(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","vue","maplibre-gl"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.VueMapbox={},d.Vue,d.maplibregl))})(this,function(d,e,T){"use strict";function ge(t,i){const n=e.ref(),c=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.fitBounds(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{setFitBounds:l,bounds:n}}function he(t,i){const n=e.ref(i==null?void 0:i.bounds),c=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.cameraForBounds(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{cameraForBounds:l,bbox:n}}function ve(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.easeTo(n.value)});function c(l){l&&(n.value=l)}return{easeTo:c}}function be(t){const i=e.ref(),n=e.ref(),c=e.ref(void 0),l=e.ref(void 0);function u(a,f,s,o){i.value=a,n.value=f,s&&(c.value=s),o&&(l.value=o)}return e.watchEffect(()=>{t.value&&i.value&&n.value&&(l.value=l.value??t.value.getBearing(),t.value.fitScreenCoordinates(i.value,n.value,l.value,c.value))}),{fitScreenCoordinates:u,p0:i,p1:n}}function pe(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.flyTo(n.value)});function c(l){l&&(n.value=l)}return{flyTo:c}}function we(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.jumpTo(n.value)});function c(l){l&&(n.value=l)}return{jumpTo:c}}function Le(t,i){const n=e.ref(i==null?void 0:i.offset),c=e.ref(i);e.watchEffect(()=>{t.value&&c.value&&t.value.panBy(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{panBy:l}}function Pe(t,i){const n=e.ref(i==null?void 0:i.lnglat),c=e.ref(i);e.watchEffect(()=>{t.value&&c.value&&t.value.panTo(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{panTo:l}}function Ee(t,i){const n=e.ref(i==null?void 0:i.bearing),c=e.ref(i);e.watchEffect(()=>{t.value&&c.value&&t.value.rotateTo(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{rotateTo:l}}function Ie(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.resetNorth(n.value)});function c(l){l&&(n.value=l)}return{resetNorth:c}}function Ce(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.resetNorthPitch(n.value)});function c(l){l&&(n.value=l)}return{resetNorthPitch:c}}function Me(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.snapToNorth(n.value)});function c(l){l&&(n.value=l)}return{snapToNorth:c}}function Se(t,i){const n=e.ref(i==null?void 0:i.zoom),c=e.ref(i);e.watchEffect(()=>{t.value&&c.value&&t.value.zoomTo(n.value,c.value)});function l(u,a){n.value=u,a&&(c.value=a)}return{zoomTo:l}}function ze(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.zoomIn(n.value)});function c(l){l&&(n.value=l)}return{zoomIn:c}}function xe(t,i){const n=e.ref(i);e.watchEffect(()=>{t.value&&n.value&&t.value.zoomOut(n.value)});function c(l){l&&(n.value=l)}return{zoomOut:c}}function W(t=!1){return{log:(...n)=>{t&&console.log(...n)}}}const M=Symbol(),Z=Symbol();var O=(t=>(t[t.Disposed=-1]="Disposed",t[t.NotLoaded=0]="NotLoaded",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Error=3]="Error",t))(O||{});const q=["error","load","idle","remove","render","resize","webglcontextlost","webglcontextrestored","dataloading","data","tiledataloading","sourcedataloading","sourcedata","styledata","styleimagemissing","dataabort","sourcedataabort","boxzoomcancel","boxzoomstart","boxzoomend","touchcancel","touchmove","touchend","touchstart","click","contextmenu","dblclick","mousemove","mouseup","mousedown","mouseout","mouseover","movestart","move","moveend","zoomstart","zoom","zoomend","rotatestart","rotate","rotateend","dragstart","drag","dragend","pitchstart","pitch","pitchend","wheel","terrain"],J=["geolocate","error","outofmaxbounds","trackuserlocationstart","trackuserlocationend"],j=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"];function U(t,i,n={}){const{register:c,...l}=n,{log:u}=W(n.debug),a=e.shallowRef(null),f=e.ref(O.NotLoaded),s=e.ref(l),o=e.watchEffect(()=>{b(),!e.unref(a)&&e.unref(t)&&(m(),o())});function r(){!l.center&&!l.bounds||m()}function m(){f.value=O.NotLoaded;const g=e.unref(s),w=e.unref(t),$=e.unref(i);!w||!$||(a.value=new T.Map({...g,style:$,container:w}),f.value=O.Loading,c==null||c(C),a.value.on("load",h),a.value.on("error",y))}function b(){const g=e.unref(a);g&&(g.off("load",h),g.off("error",y),g.remove()),a.value=null}function h(g){f.value=O.Loaded,u("MapLoadEvent",g)}function y(g){f.value=O.Error,u("MapErrorEvent",g)}function L(g){var w;(w=a.value)==null||w.setCenter(g),s.value.center=g}function F(g=0){var w;(w=a.value)==null||w.setBearing(g),s.value.bearing=g}function z(g){var w;(w=a.value)==null||w.setZoom(g),s.value.zoom=g}function x(g){var w;(w=a.value)==null||w.setPitch(g),s.value.pitch=g}function _(g,w){var $;($=a.value)==null||$.setStyle(g,w)}function B(g){var w;(w=a.value)==null||w.setMaxBounds(g),s.value.maxBounds=g}function P(g=60){var w;(w=a.value)==null||w.setMaxPitch(g),s.value.maxPitch=g}function p(g=24){var w;(w=a.value)==null||w.setMaxZoom(g),s.value.maxZoom=g}function v(g=0){var w;(w=a.value)==null||w.setMinPitch(g),s.value.minPitch=g}function E(g=0){var w;(w=a.value)==null||w.setMinZoom(g),s.value.minZoom=g}function I(g=!0){var w;(w=a.value)==null||w.setRenderWorldCopies(g),s.value.renderWorldCopies=g}const C={mapInstance:e.computed(()=>a.value),mapStatus:e.computed(()=>f.value),setRenderWorldCopies:I,setMinZoom:E,setMinPitch:v,setMaxZoom:p,setMaxPitch:P,setMaxBounds:B,setStyle:_,setPitch:x,setZoom:z,setBearing:F,setCenter:L};return{initMap:m,removeMap:b,checkInitMap:r,...C}}function _e(){const t=e.ref(),i=e.ref(!1),n=e.shallowRef(null),c=e.ref(O.NotLoaded);let l;function u(o){e.unref(i)&&o===e.unref(t)||(t.value=o,i.value=!0,l==null||l.stop(),l=e.effectScope(),l.run(()=>{e.watch(()=>o.mapInstance.value,r=>{n.value=r},{immediate:!0}),e.watch(()=>o.mapStatus.value,r=>{c.value=r},{immediate:!0})}))}function a(){var r;const o=e.unref((r=t.value)==null?void 0:r.mapInstance);if(o)return o}function f(){const o=e.unref(t);if(o)return o}const s={mapInstance:e.computed(()=>n.value),mapStatus:e.computed(()=>c.value),getContainer:()=>{var o;return(o=a())==null?void 0:o.getContainer()},getCanvasContainer:()=>{var o;return(o=a())==null?void 0:o.getCanvasContainer()},getCanvas:()=>{var o;return(o=a())==null?void 0:o.getCanvas()},getStyle:()=>{var o;return(o=a())==null?void 0:o.getStyle()},getBounds:()=>{var o;return(o=a())==null?void 0:o.getBounds()},getCenter:()=>{var o;return(o=a())==null?void 0:o.getCenter()},getZoom:()=>{var o;return(o=a())==null?void 0:o.getZoom()},getBearing:()=>{var o;return(o=a())==null?void 0:o.getBearing()},getPadding:()=>{var o;return(o=a())==null?void 0:o.getPadding()},getPitch:()=>{var o;return(o=a())==null?void 0:o.getPitch()},getMinZoom:()=>{var o;return(o=a())==null?void 0:o.getMinZoom()},getMaxZoom:()=>{var o;return(o=a())==null?void 0:o.getMaxZoom()},getMinPitch:()=>{var o;return(o=a())==null?void 0:o.getMinPitch()},getMaxPitch:()=>{var o;return(o=a())==null?void 0:o.getMaxPitch()},getFilter:o=>{var r;return(r=a())==null?void 0:r.getFilter(o)},getLayer:o=>{var r;return(r=a())==null?void 0:r.getLayer(o)},getLayoutProperty:(o,r)=>{var m;return(m=a())==null?void 0:m.getLayoutProperty(o,r)},getPaintProperty:(o,r)=>{var m;return(m=a())==null?void 0:m.getPaintProperty(o,r)},getSource:o=>{var r;return(r=a())==null?void 0:r.getSource(o)},project:o=>{var r;return(r=a())==null?void 0:r.project(o)},unproject:o=>{var r;return(r=a())==null?void 0:r.unproject(o)},queryRenderedFeatures:(o,r)=>{var m;return(m=a())==null?void 0:m.queryRenderedFeatures(o,r)},querySourceFeatures:(o,r)=>{var m;return(m=a())==null?void 0:m.querySourceFeatures(o,r)},queryTerrainElevation:o=>{var r;return(r=a())==null?void 0:r.queryTerrainElevation(o)},isStyleLoaded:()=>{var o;return(o=a())==null?void 0:o.isStyleLoaded()},isMoving:()=>{var o;return(o=a())==null?void 0:o.isMoving()},isZooming:()=>{var o;return(o=a())==null?void 0:o.isZooming()},isRotating:()=>{var o;return(o=a())==null?void 0:o.isRotating()},isEasing:()=>{var o;return(o=a())==null?void 0:o.isEasing()},resize:()=>{var o;(o=a())==null||o.resize()},remove:()=>{var o;(o=a())==null||o.remove()},triggerRepaint:()=>{var o;(o=a())==null||o.triggerRepaint()},setFeatureState:(o,r)=>{var m;(m=a())==null||m.setFeatureState(o,r)},removeFeatureState:(o,r)=>{var m;(m=a())==null||m.removeFeatureState(o,r)},getFeatureState:o=>{var r;return(r=a())==null?void 0:r.getFeatureState(o)},setPadding:o=>{var r;o&&((r=a())==null||r.setPadding(o))},setRenderWorldCopies:o=>{var r,m;(m=(r=f())==null?void 0:r.setRenderWorldCopies)==null||m.call(r,o)},setMinZoom:o=>{var r,m;(m=(r=f())==null?void 0:r.setMaxZoom)==null||m.call(r,o)},setMinPitch:o=>{var r,m;(m=(r=f())==null?void 0:r.setMinPitch)==null||m.call(r,o)},setMaxZoom:o=>{var r,m;(m=(r=f())==null?void 0:r.setMaxZoom)==null||m.call(r,o)},setMaxPitch:o=>{var r,m;(m=(r=f())==null?void 0:r.setMaxPitch)==null||m.call(r,o)},setMaxBounds:o=>{var r,m;(m=(r=f())==null?void 0:r.setMaxBounds)==null||m.call(r,o)},setStyle:o=>{var r,m;(m=(r=f())==null?void 0:r.setStyle)==null||m.call(r,o)},setPitch:o=>{var r,m;(m=(r=f())==null?void 0:r.setPitch)==null||m.call(r,o)},setZoom:o=>{var r,m;(m=(r=f())==null?void 0:r.setZoom)==null||m.call(r,o)},setBearing:o=>{var r,m;(m=(r=f())==null?void 0:r.setBearing)==null||m.call(r,o)},setCenter:o=>{var r,m;(m=(r=f())==null?void 0:r.setCenter)==null||m.call(r,o)}};return{register:u,...s}}const Be="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Fe=(t=21)=>{let i="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)i+=Be[n[t]&63];return i};function A(t){return t||Fe()}function H(){return parseInt(T.getVersion().split(".")[0],10)}function D(t,i){return!!t.style&&!!t.getSource(i)}function S(t,i){return!!t.style&&!!t.getLayer(i)}function K(t){if(t){if(Array.isArray(t))return t.length>=2&&t[0]!==void 0&&t[1]!==void 0;if(typeof t=="object"&&"lat"in t&&("lng"in t||"lon"in t)){const{lat:i}=t,n="lng"in t?t.lng:void 0,c="lon"in t?t.lon:void 0;return(n!==void 0||c!==void 0)&&i!==void 0}}return!1}function R(t,i){return Object.fromEntries(Object.entries(t).filter(([n])=>i.includes(n)))}function Re(){const t=e.ref(),i=e.ref(!1),n=e.shallowRef(null),c=e.shallowRef(null),l=e.ref();let u;function a(o,r){e.unref(i)&&o===e.unref(t)||(t.value=o,n.value=r,i.value=!0,u==null||u.stop(),u=e.effectScope(),u.run(()=>{e.watch(()=>o.getLayer.value,m=>{c.value=m,l.value=m==null?void 0:m.id},{immediate:!0})}))}function f(){const o=e.unref(t);if(o)return o}const s={layerId:e.computed(()=>l.value),layer:e.computed(()=>c.value),getFilter:()=>{if(n.value&&l.value&&S(n.value,l.value))return n.value.getFilter(l.value)},getLayoutProperty:o=>{if(n.value&&l.value&&S(n.value,l.value))return n.value.getLayoutProperty(l.value,o)},getPaintProperty:o=>{n.value&&l.value&&S(n.value,l.value)&&n.value.getPaintProperty(l.value,o)},setBeforeId:o=>{var r;(r=f())==null||r.setBeforeId(o)},setFilter:o=>{var r;(r=f())==null||r.setFilter(o)},setPaintProperty:(o,r,m)=>{var b;(b=f())==null||b.setPaintProperty(o,r,m)},setLayoutProperty:(o,r,m)=>{var b;(b=f())==null||b.setLayoutProperty(o,r,m)},setZoomRange:(o,r)=>{var m;(m=f())==null||m.setZoomRange(o,r)},removeLayer:()=>{var o;(o=f())==null||o.removeLayer()},setStyle:o=>{var r;(r=f())==null||r.setStyle(o)}};return{register:a,...s}}function Y(t){let i,n;const c=new Promise((f,s)=>{i=f,n=s});e.watchEffect(()=>{e.unref(t.map)&&l(t.image).then(i).catch(n)});async function l(f){const s=e.unref(t.map);if(s)if(typeof f=="string")try{const o=await u(f);s.hasImage(t.id)?s.updateImage(t.id,o):s.addImage(t.id,o,t.options),Promise.resolve()}catch(o){Promise.reject(o)}else s.hasImage(t.id)?s.updateImage(t.id,f):s.addImage(t.id,f,t.options),Promise.resolve();else Promise.reject(new Error("Map is not defined"))}async function u(f){const s=e.unref(t.map);return new Promise((o,r)=>{if(!s)return r(new Error("Map is not defined"));s.loadImage(f).then(({data:m})=>{o(m)}).catch(()=>{r(new Error("Failed to load image"))})})}function a(){const f=e.unref(t.map);f!=null&&f.hasImage(t.id)&&f.removeImage(t.id),n()}return{remove:a,loadImage:u,updateImage:l,loadPromise:c}}function Oe(){const t=e.ref(),i=e.ref(!1),n=e.shallowRef(null),c=e.ref();let l;function u(f){e.unref(i)&&f===e.unref(t)||(t.value=f,i.value=!0,l==null||l.stop(),l=e.effectScope(),l.run(()=>{e.watch(()=>f.getSource.value,s=>{n.value=s,c.value=f.sourceId},{immediate:!0})}))}const a={sourceId:e.computed(()=>c.value),getSource:e.computed(()=>n.value),setData:f=>{}};return{register:u,...a}}function Q({map:t,lnglat:i,html:n,el:c,show:l=!0,withMap:u=!0,options:a={},on:f={}}){const s=e.shallowRef(null),o=e.computed(()=>s.value);e.watchEffect(v=>{e.unref(t)&&(c!=null&&c.value)&&!s.value&&(s.value=new T.Popup({...a}),s.value.setDOMContent(c.value),i&&K(i)&&b(i),l&&z(),u&&_(),n&&B(),s.value.on("close",m),s.value.on("open",r)),v(()=>{P()})});function r(){var v;s.value&&((v=f.open)==null||v.call(f,s.value))}async function m(){var v;s.value&&(await new Promise(E=>E(!0)),(v=f.close)==null||v.call(f,s.value))}function b(v){s.value&&s.value.setLngLat(v)}function h(v){s.value&&s.value.setOffset(v)}function y(v){s.value&&s.value.addClassName(v)}function L(v){s.value&&s.value.removeClassName(v)}function F(v){s.value&&s.value.setMaxWidth(v)}function z(){const v=e.unref(t);v&&s.value&&!s.value.isOpen()&&s.value.addTo(v)}function x(){s.value&&s.value.isOpen()&&s.value.remove()}function _(){const v=e.unref(t);s.value&&v&&s.value.addTo(v)}function B(){s.value&&n&&s.value.setHTML(n)}function P(){p(),x(),s.value=null}function p(){s.value&&(s.value.off("close",m),s.value.off("open",r))}return{popupInstance:o,setLngLat:b,setOffset:h,addClassName:y,removeClassName:L,removePopup:P,show:z,hide:x,setMaxWidth:F,addToMap:_,setHTMLContent:B}}function X({map:t,lnglat:i,popup:n,el:c,options:l={},on:u={}}){const a=e.shallowRef(null);let f=e.unref(n);function s(p){var v;(v=u.dragstart)==null||v.call(u,p)}function o(p){var v;(v=u.drag)==null||v.call(u,p)}function r(p){var v;(v=u.dragend)==null||v.call(u,p)}e.watchEffect(p=>{const v=e.unref(t);v&&!a.value&&(a.value=new T.Marker({...l,element:c==null?void 0:c.value}),i&&K(i)&&m(i),f&&b(f),a.value.addTo(v),a.value.on("dragstart",s),a.value.on("drag",o),a.value.on("dragend",r)),p(P)}),e.watch(()=>e.unref(n),b);function m(p){a.value&&a.value.setLngLat(p)}function b(p){f=p,a.value&&a.value.setPopup(p)}function h(p){a.value&&a.value.setOffset(p)}function y(p){a.value&&a.value.setDraggable(p)}function L(){a.value&&a.value.togglePopup()}function F(){return a.value?a.value.getElement():null}function z(p){a.value&&a.value.setRotation(p)}function x(p){a.value&&a.value.setRotationAlignment(p)}function _(p){a.value&&a.value.setPitchAlignment(p)}function B(p,v){a.value&&a.value.setOpacity(p,v)}function P(){a.value&&(a.value.off("dragstart",s),a.value.off("drag",o),a.value.off("dragend",r),a.value.remove()),a.value=null}return{setLngLat:m,setPopup:b,setOffset:h,setDraggable:y,togglePopup:L,getElement:F,setRotation:z,setRotationAlignment:x,setPitchAlignment:_,setOpacity:B,removeMarker:P}}function V(t){const i=l=>{t.on&&t.on(l)},n=e.watchEffect(l=>{const u=e.unref(t.map);u&&u.on(t.event,i),l(c)});function c(){const l=e.unref(t.map);l&&l.off(t.event,i)}return e.onUnmounted(()=>{n()}),{removeListener:c}}function ee(t){const i=e.shallowRef(t.geolocate),n=u=>{t.on&&t.on(u)},c=e.watchEffect(()=>{i.value&&i.value.on(t.event,n)});function l(){i.value&&i.value.off(t.event,n)}return e.onUnmounted(()=>{c()}),{removeListener:l}}function G(t,i){const n=e.unref(t);let c=!!(n!=null&&n._loaded);c&&u(!0);function l(){const s=e.unref(t);c&&(c=!1,i.unLoad&&i.unLoad(s))}function u(s=!1){const o=e.unref(t);c&&!s||(c=!0,i.onLoad&&i.onLoad(o))}function a(){const s=e.unref(t);s&&(s.off("styledata",u),s.off("styledataloading",l),s.off("load",u))}const f=e.watchEffect(s=>{const o=e.unref(t);o&&(c?u():o.on("load",u),o.on("styledata",u),o.on("styledataloading",l),s(a))});return e.onUnmounted(()=>{l(),f(),a()}),{clear:a}}function N(t){const i=l=>{t.on&&t.on(l)},n=e.watchEffect(l=>{const u=e.unref(t.map),a=e.unref(t.layer);if(u&&a){const f=typeof a=="string"?a:a.id;u.on(t.event,f,i)}l(c)});function c(){const l=e.unref(t.map),u=e.unref(t.layer);if(l&&u){const a=typeof u=="string"?u:u.id;l.off(t.event,a,i)}}return e.onUnmounted(()=>{n()}),{removeListener:c}}function te({map:t,position:i="bottom-right",options:n={}}){const c=e.shallowRef(null),l=e.watchEffect(()=>{t.value&&!c.value&&(c.value=new T.GeolocateControl(n),t.value.addControl(c.value,i))});function u(){l(),t.value&&c.value&&t.value.removeControl(c.value),c.value=null}return e.onUnmounted(()=>{u()}),{geolocateControl:c,removeListener:u}}const Te={type:"FeatureCollection",features:[]};function ne({map:t,id:i,data:n=Te,options:c={},register:l}){const u=A(i),a=e.shallowRef(null),f=e.computed(()=>a.value);G(t,{unLoad:m,onLoad:o});function s(b){const h=e.unref(t);let y=b.isSourceLoaded;H()>0&&(y=!0),!a.value&&b.sourceId===u&&y&&(a.value=h==null?void 0:h.getSource(u),l==null||l({sourceId:u,getSource:f,setData:r},h),h==null||h.off("sourcedata",s))}function o(){const b=e.unref(t);if(b&&!a.value&&!D(b,u)){if(!n)return;b.addSource(u,{...c,type:"geojson",data:n}),b.on("sourcedata",s)}}function r(b){const h=e.unref(t);h&&a.value&&D(h,u)&&b&&a.value.setData(b)}function m(){const b=e.unref(t);a.value=null,b&&D(b,u)&&(b.removeSource(u),b.off("sourcedata",s))}return e.onMounted(async()=>{await e.nextTick(),o()}),e.onUnmounted(()=>{m()}),{sourceId:u,getSource:f,setData:r,removeSource:m}}function k(t){const{map:i,id:n,source:c,type:l,beforeId:u,filter:a=["all"],layout:f={},paint:s={},maxzoom:o=24,minzoom:r=0,metadata:m,sourceLayer:b="",register:h}=t,y=A(n),L=e.shallowRef(null),F=e.computed(()=>L.value);e.watch(()=>e.unref(c),E=>{E?p():v()}),G(i,{unLoad:v,onLoad:p});function z(E){const I=e.unref(i);I&&L.value&&S(I,y)&&I.moveLayer(y,E)}function x(E=["all"]){const I=e.unref(i);I&&L.value&&S(I,y)&&I.setFilter(y,E)}function _(E=0,I=24){const C=e.unref(i);C&&L.value&&S(C,y)&&C.setLayerZoomRange(y,E,I)}function B(E,I,C={validate:!0}){const g=e.unref(i);g&&L.value&&S(g,y)&&g.setPaintProperty(y,E,I,C)}function P(E,I,C={validate:!0}){const g=e.unref(i);g&&L.value&&S(g,y)&&g.setLayoutProperty(y,E,I,C)}function p(){const E=e.unref(i),I=e.unref(c);if(E&&I&&!L.value&&!S(E,y)){let C;if(typeof I=="string"?C=I:typeof I=="object"&&"id"in I?C=I.id:typeof I=="object"&&"type"in I?C=I:C="",!C)return;const g={id:y,type:l,source:C,layout:f,paint:s,"source-layer":b,minzoom:r,maxzoom:o,metadata:m,filter:a};E.addLayer(g,u),L.value=E.getLayer(y),h==null||h({layerId:y,getLayer:F,removeLayer:v,setBeforeId:z,setFilter:x,setZoomRange:_,setPaintProperty:B,setLayoutProperty:P},E)}}function v(){const E=e.unref(i);L.value=null,E&&S(E,y)&&E.removeLayer(y)}return{layerId:y,getLayer:F,removeLayer:v,setBeforeId:z,setFilter:x,setZoomRange:_,setPaintProperty:B,setLayoutProperty:P}}const oe=["fill-antialias","fill-opacity","fill-color","fill-outline-color","fill-translate","fill-translate-anchor","fill-pattern"],ae=["fill-sort-key","visibility"];function re(t){const i=t.style||{},n=R(i,oe),c=R(i,ae),{setLayoutProperty:l,setPaintProperty:u,...a}=k({map:t.map,source:t.source,type:"fill",id:t.id,beforeId:t.beforeId,filter:t.filter,layout:c,paint:n,maxzoom:t.maxzoom,minzoom:t.minzoom,metadata:t.metadata,sourceLayer:t.sourceLayer,register:(s,o)=>{var r;(r=t.register)==null||r.call(t,{...s,setStyle:f},o)}});function f(s={}){Object.keys(s).forEach(o=>{oe.includes(o)&&u(o,s[o],{validate:!1}),ae.includes(o)&&l(o,s[o],{validate:!1})})}return{...a,setStyle:f,setLayoutProperty:l,setPaintProperty:u}}const ie=["circle-radius","circle-color","circle-blur","circle-opacity","circle-translate","circle-translate-anchor","circle-pitch-scale","circle-pitch-alignment","circle-stroke-width","circle-stroke-color","circle-stroke-opacity"],le=["circle-sort-key","visibility"];function ce(t){const i=t.style||{},n=R(i,ie),c=R(i,le),{setLayoutProperty:l,setPaintProperty:u,...a}=k({map:t.map,source:t.source,type:"circle",id:t.id,beforeId:t.beforeId,filter:t.filter,layout:c,paint:n,maxzoom:t.maxzoom,minzoom:t.minzoom,metadata:t.metadata,sourceLayer:t.sourceLayer,register:(s,o)=>{var r;(r=t.register)==null||r.call(t,{...s,setStyle:f},o)}});function f(s={}){Object.keys(s).forEach(o=>{ie.includes(o)&&u(o,s[o],{validate:!1}),le.includes(o)&&l(o,s[o],{validate:!1})})}return{...a,setStyle:f,setLayoutProperty:l,setPaintProperty:u}}const se=["line-opacity","line-color","line-translate","line-translate-anchor","line-width","line-gap-width","line-offset","line-blur","line-dasharray","line-pattern","line-gradient"],ue=["line-cap","line-join","line-miter-limit","line-round-limit","line-sort-key","visibility"];function fe(t){const i=t.style||{},n=R(i,se),c=R(i,ue),{setLayoutProperty:l,setPaintProperty:u,...a}=k({map:t.map,source:t.source,type:"line",id:t.id,beforeId:t.beforeId,filter:t.filter,layout:c,paint:n,maxzoom:t.maxzoom,minzoom:t.minzoom,metadata:t.metadata,sourceLayer:t.sourceLayer,register:(s,o)=>{var r;(r=t.register)==null||r.call(t,{...s,setStyle:f},o)}});function f(s={}){Object.keys(s).forEach(o=>{se.includes(o)&&u(o,s[o],{validate:!1}),ue.includes(o)&&l(o,s[o],{validate:!1})})}return{...a,setStyle:f,setLayoutProperty:l,setPaintProperty:u}}const me=["icon-opacity","icon-color","icon-halo-color","icon-halo-width","icon-halo-blur","icon-translate","icon-translate-anchor","text-opacity","text-color","text-halo-color","text-halo-width","text-halo-blur","text-translate","text-translate-anchor"],de=["symbol-placement","symbol-spacing","symbol-avoid-edges","symbol-sort-key","symbol-z-order","icon-allow-overlap","icon-overlap","icon-ignore-placement","icon-optional","icon-rotation-alignment","icon-size","icon-text-fit","icon-text-fit-padding","icon-image","icon-rotate","icon-padding","icon-keep-upright","icon-offset","icon-anchor","icon-pitch-alignment","text-pitch-alignment","text-rotation-alignment","text-field","text-font","text-size","text-max-width","text-line-height","text-letter-spacing","text-justify","text-radial-offset","text-variable-anchor","text-variable-anchor-offset","text-anchor","text-max-angle","text-writing-mode","text-rotate","text-padding","text-keep-upright","text-transform","text-offset","text-allow-overlap","text-overlap","text-ignore-placement","text-optional"];function ye(t){const i=t.style||{},n=R(i,me),c=R(i,de),{setLayoutProperty:l,setPaintProperty:u,...a}=k({map:t.map,source:t.source,type:"symbol",id:t.id,beforeId:t.beforeId,filter:t.filter,layout:c,paint:n,maxzoom:t.maxzoom,minzoom:t.minzoom,metadata:t.metadata,sourceLayer:t.sourceLayer,register:(s,o)=>{var r;(r=t.register)==null||r.call(t,{...s,setStyle:f},o)}});function f(s={}){Object.keys(s).forEach(o=>{me.includes(o)&&u(o,s[o],{validate:!1}),de.includes(o)&&l(o,s[o],{validate:!1})})}return{...a,setStyle:f,setLayoutProperty:l,setPaintProperty:u}}const Ze={id:"maplibre_container"},je=e.defineComponent({__name:"Mapbox",props:{options:{default:()=>({})},register:{},debug:{type:Boolean}},emits:["register","error","load","idle","remove","render","resize","webglcontextlost","webglcontextrestored","dataloading","data","tiledataloading","sourcedataloading","sourcedata","styledata","styleimagemissing","dataabort","sourcedataabort","boxzoomcancel","boxzoomstart","boxzoomend","touchcancel","touchmove","touchend","touchstart","click","contextmenu","dblclick","mousemove","mouseup","mousedown","mouseout","mouseover","movestart","move","moveend","zoomstart","zoom","zoomend","rotatestart","rotate","rotateend","dragstart","drag","dragend","pitchstart","pitch","pitchend","wheel","terrain"],setup(t,{emit:i}){const n=t,c=i,l=e.ref({}),u=e.ref(),a=e.ref(n.options.style),f=e.computed(()=>({...n.options,...l.value}));function s(P){l.value={style:P.style,...e.unref(f),...P}}const{mapInstance:o,setCenter:r,setBearing:m,setZoom:b,setPitch:h,setStyle:y,setMaxBounds:L,setMaxPitch:F,setMaxZoom:z,setMinPitch:x,setMinZoom:_,setRenderWorldCopies:B}=U(u,a,{...e.unref(f),register:P=>{var p;(p=n.register)==null||p.call(n,{...P,setMapOptions:s}),c("register",{...P,setMapOptions:s})},debug:n.debug});return q.map(P=>{V({map:o,event:P,on:p=>{c(P,p)}})}),e.provide(M,o),e.watch(()=>e.unref(f).center,r),e.watch(()=>e.unref(f).bearing,m),e.watch(()=>e.unref(f).zoom,b),e.watch(()=>e.unref(f).pitch,h),e.watch(()=>e.unref(f).style,y),e.watch(()=>e.unref(f).maxBounds,L),e.watch(()=>e.unref(f).maxPitch,F),e.watch(()=>e.unref(f).maxZoom,z),e.watch(()=>e.unref(f).minPitch,x),e.watch(()=>e.unref(f).minZoom,_),e.watch(()=>e.unref(f).renderWorldCopies,B),e.watchEffect(async()=>{var p,v;await e.nextTick();const P=document.getElementById("maplibre_container");u.value=document.createElement("div"),u.value.id=(p=n.options)!=null&&p.container?String((v=n.options)==null?void 0:v.container):"maplibre",u.value.style.width="100%",u.value.style.height="100%",P==null||P.appendChild(u.value)}),e.onBeforeMount(()=>{var P;(P=u.value)==null||P.remove()}),(P,p)=>(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(P.$slots,"default")]))}}),Ne=e.defineComponent({__name:"GeolocateControl",props:{position:{},options:{}},emits:["register","geolocate","error","outofmaxbounds","trackuserlocationstart","trackuserlocationend"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(M,e.ref(null)),{geolocateControl:u}=te({map:l,...n});return e.watchEffect(()=>{u.value&&c("register",u.value)}),J.map(a=>{ee({geolocate:u,event:a,on:f=>{c(a,f)}})}),(a,f)=>null}}),ke=e.defineComponent({__name:"GeoJsonSource",props:{id:{},data:{default:()=>({type:"FeatureCollection",features:[]})},options:{},register:{}},emits:["register"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(M,e.ref(null)),{setData:u,getSource:a}=ne({map:l,id:n.id,data:n.data,options:n.options,register:f=>{var s;(s=n.register)==null||s.call(n,f),c("register",f)}});return e.provide(Z,a),e.watch(()=>n.data,u,{deep:!0,immediate:!0}),(f,s)=>e.renderSlot(f.$slots,"default")}}),$e=e.defineComponent({__name:"FillLayer",props:{id:{},filter:{type:[Boolean,Array]},style:{},maxzoom:{},minzoom:{},metadata:{},source:{},sourceLayer:{},beforeId:{},visible:{type:Boolean,default:!0},register:{}},emits:["register","click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(Z,e.ref(null)),u=e.inject(M,e.ref(null)),a={};n.visible!==void 0&&(a.visibility=n.visible?"visible":"none");const{getLayer:f,setBeforeId:s,setFilter:o,setStyle:r,setZoomRange:m,setLayoutProperty:b}=re({map:u,source:n.source||l,style:{...n.style,...a},filter:n.filter||["all"],id:n.id,maxzoom:n.maxzoom,minzoom:n.minzoom,metadata:n.metadata,sourceLayer:n.sourceLayer,register:(h,y)=>{var L;(L=n.register)==null||L.call(n,h,y),c("register",h,y)}});return j.map(h=>{N({map:u,layer:f,event:h,on:y=>{c(h,y)}})}),e.watch(()=>n.filter,o),e.watch(()=>n.style,r),e.watch(()=>n.maxzoom,m),e.watch(()=>n.minzoom,m),e.watch(()=>n.beforeId,s),e.watchEffect(()=>{b("visibility",n.visible?"visible":"none")}),(h,y)=>null}}),De=e.defineComponent({__name:"CircleLayer",props:{id:{},filter:{type:[Boolean,Array]},style:{},maxzoom:{},minzoom:{},metadata:{},source:{},sourceLayer:{},beforeId:{},visible:{type:Boolean,default:!0},register:{}},emits:["register","click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(Z,e.ref(null)),u=e.inject(M,e.ref(null)),a={};n.visible!==void 0&&(a.visibility=n.visible?"visible":"none");const{getLayer:f,setBeforeId:s,setFilter:o,setStyle:r,setZoomRange:m,setLayoutProperty:b}=ce({map:u,source:n.source||l,style:{...n.style,...a},filter:n.filter||["all"],id:n.id,maxzoom:n.maxzoom,minzoom:n.minzoom,metadata:n.metadata,sourceLayer:n.sourceLayer,register:(h,y)=>{var L;(L=n.register)==null||L.call(n,h,y),c("register",h,y)}});return j.map(h=>{N({map:u,layer:f,event:h,on:y=>{c(h,y)}})}),e.watch(()=>n.filter,o),e.watch(()=>n.style,r),e.watch(()=>n.maxzoom,m),e.watch(()=>n.minzoom,m),e.watch(()=>n.beforeId,s),e.watchEffect(()=>{b("visibility",n.visible?"visible":"none")}),(h,y)=>null}}),Ae=e.defineComponent({__name:"LineLayer",props:{id:{},filter:{type:[Boolean,Array]},style:{},maxzoom:{},minzoom:{},metadata:{},source:{},sourceLayer:{},beforeId:{},visible:{type:Boolean,default:!0},register:{}},emits:["register","click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(Z,e.ref(null)),u=e.inject(M,e.ref(null)),a={};n.visible!==void 0&&(a.visibility=n.visible?"visible":"none");const{getLayer:f,setBeforeId:s,setFilter:o,setStyle:r,setZoomRange:m,setLayoutProperty:b}=fe({map:u,source:n.source||l,style:{...n.style,...a},filter:n.filter||["all"],id:n.id,maxzoom:n.maxzoom,minzoom:n.minzoom,metadata:n.metadata,sourceLayer:n.sourceLayer,register:(h,y)=>{var L;(L=n.register)==null||L.call(n,h,y),c("register",h,y)}});return j.map(h=>{N({map:u,layer:f,event:h,on:y=>{c(h,y)}})}),e.watch(()=>n.filter,o),e.watch(()=>n.style,r),e.watch(()=>n.maxzoom,m),e.watch(()=>n.minzoom,m),e.watch(()=>n.beforeId,s),e.watchEffect(()=>{b("visibility",n.visible?"visible":"none")}),(h,y)=>null}}),Ke=e.defineComponent({__name:"SymbolLayer",props:{id:{},filter:{type:[Boolean,Array]},style:{},maxzoom:{},minzoom:{},metadata:{},source:{},sourceLayer:{},beforeId:{},visible:{type:Boolean,default:!0},register:{}},emits:["register","click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(Z,e.ref(null)),u=e.inject(M,e.ref(null)),a={};n.visible!==void 0&&(a.visibility=n.visible?"visible":"none");const{getLayer:f,setBeforeId:s,setFilter:o,setStyle:r,setZoomRange:m,setLayoutProperty:b}=ye({map:u,source:n.source||l,style:{...n.style,...a},filter:n.filter||["all"],id:n.id,maxzoom:n.maxzoom,minzoom:n.minzoom,metadata:n.metadata,sourceLayer:n.sourceLayer,register:(h,y)=>{var L;(L=n.register)==null||L.call(n,h,y),c("register",h,y)}});return j.map(h=>{N({map:u,layer:f,event:h,on:y=>{c(h,y)}})}),e.watch(()=>n.filter,o),e.watch(()=>n.style,r),e.watch(()=>n.maxzoom,m),e.watch(()=>n.minzoom,m),e.watch(()=>n.beforeId,s),e.watchEffect(()=>{b("visibility",n.visible?"visible":"none")}),(h,y)=>null}}),Ge=e.defineComponent({__name:"Image",props:{images:{default:()=>[]},options:{}},setup(t){const i=t,n=e.ref(!0),c=e.inject(M,e.ref(null));l(i.images);function l(u){const a=u.map(f=>Y({map:c,id:f.id,image:f.image,options:f.options||i.options}).loadPromise);Promise.all(a).finally(()=>{n.value=!1})}return(u,a)=>n.value?e.createCommentVNode("",!0):e.renderSlot(u.$slots,"default",{key:0})}}),We=e.defineComponent({__name:"Popup",props:{className:{},lnglat:{},show:{type:Boolean,default:!0},withMap:{type:Boolean,default:!0},options:{},html:{}},emits:["close","open","update:show"],setup(t,{emit:i}){const n=t,c=i,l=e.inject(M,e.ref(null)),u=e.ref(),{setLngLat:a,show:f,hide:s}=Q({map:l,el:u,lnglat:n.lnglat,html:n.html,show:n.show,withMap:n.withMap,options:{...n.options,className:n.className},on:{open:()=>{c("open"),c("update:show",!0)},close:async()=>{c("close"),c("update:show",!1)}}});return e.watch(()=>n.show,o=>{o?f():s()}),e.watch(()=>n.lnglat,o=>{o&&a(o)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"popupElRef",ref:u,class:"mapboxgl-popup-content-inner"},[e.renderSlot(o.$slots,"default")],512))}}),qe=e.defineComponent({__name:"Marker",props:{lnglat:{},popup:{},options:{default:()=>({})},draggable:{type:Boolean},element:{},offset:{},anchor:{},color:{},clickTolerance:{},rotation:{},rotationAlignment:{},pitchAlignment:{},scale:{},occludedOpacity:{}},emits:["dragstart","drag","dragend"],setup(t,{emit:i}){var o;const n=t,c=i,l=e.useSlots(),u=e.inject(M,e.ref(null)),a=e.ref(),{setDraggable:f,setLngLat:s}=X({map:u,el:(o=l.default)!=null&&o.call(l)?a:void 0,lnglat:n.lnglat,popup:n.popup,options:{...n.options,...n.draggable===void 0?{}:{draggable:n.draggable}},on:{dragstart:r=>c("dragstart",r),drag:r=>c("drag",r),dragend:r=>c("dragend",r)}});return e.watch(()=>n.lnglat,r=>{r&&s(r)}),e.watch(()=>n.draggable,f),(r,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"markerElRef",ref:a},[e.renderSlot(r.$slots,"default")],512))}});d.CircleLayer=De,d.FillLayer=$e,d.GeoJsonSource=ke,d.GeolocateControl=Ne,d.GeolocateEvents=J,d.Image=Ge,d.LineLayer=Ae,d.MapProvideKey=M,d.Mapbox=je,d.MapboxEvents=q,d.MapboxLayerEvents=j,d.MapboxStatus=O,d.Marker=qe,d.Popup=We,d.SourceProvideKey=Z,d.SymbolLayer=Ke,d.filterStylePropertiesByKeys=R,d.getMainVersion=H,d.getNanoid=A,d.hasLayer=S,d.hasSource=D,d.lngLatLikeHasValue=K,d.useCameraForBounds=he,d.useCreateCircleLayer=ce,d.useCreateFillLayer=re,d.useCreateGeoJsonSource=ne,d.useCreateImage=Y,d.useCreateLayer=k,d.useCreateLineLayer=fe,d.useCreateMapbox=U,d.useCreateMarker=X,d.useCreatePopup=Q,d.useCreateSymbolLayer=ye,d.useEaseTo=ve,d.useFitBounds=ge,d.useFitScreenCoordinates=be,d.useFlyTo=pe,d.useGeoJsonSource=Oe,d.useGeolocateControl=te,d.useGeolocateEventListener=ee,d.useJumpTo=we,d.useLayer=Re,d.useLayerEventListener=N,d.useLogger=W,d.useMapEventListener=V,d.useMapReloadEvent=G,d.useMapbox=_e,d.usePanBy=Le,d.usePanTo=Pe,d.useResetNorth=Ie,d.useResetNorthPitch=Ce,d.useRotateTo=Ee,d.useSnapToNorth=Me,d.useZoomIn=ze,d.useZoomOut=xe,d.useZoomTo=Se,Object.keys(T).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(d,t)&&Object.defineProperty(d,t,{enumerable:!0,get:()=>T[t]})}),Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});