vue3-google-map 0.23.1 → 0.24.1
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.
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +8 -4
- package/dist/index.umd.js +4 -4
- package/dist/types/index.d.ts +1 -0
- package/package.json +6 -4
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-
|
|
2
|
-
"use strict";var Ve=Object.defineProperty;var Ge=(n,e,t)=>e in n?Ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ee=(n,e,t)=>(Ge(n,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),I=Symbol("map"),j=Symbol("api"),ie=Symbol("marker"),ae=Symbol("markerCluster"),Y=Symbol("CustomMarker"),Re=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function ze(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function u(f){try{d(r.next(f))}catch(c){i(c)}}function a(f){try{d(r.throw(f))}catch(c){i(c)}}function d(f){f.done?o(f.value):s(f.value).then(u,a)}d((r=r.apply(n,e||[])).next())})}function We(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var te,fe;function He(){return fe||(fe=1,te=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),te}var Ke=He(),Je=We(Ke);const pe="__googleMapsScriptId";var B;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(B||(B={}));class x{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=pe,language:i,libraries:u=[],mapIds:a,nonce:d,region:f,retries:c=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||pe,this.language=i,this.libraries=u,this.mapIds=a,this.nonce=d,this.region=f,this.retries=c,this.url=m,this.version=g,x.instance){if(!Je(this.options,x.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(x.instance.options)}`);return x.instance}x.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?B.FAILURE:this.done?B.SUCCESS:this.loading?B.LOADING:B.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,u,a,d="The Google Maps JavaScript API",f="google",c="importLibrary",m="__ib__",g=document,p=window;p=p[f]||(p[f]={});const h=p.maps||(p.maps={}),v=new Set,y=new URLSearchParams,E=()=>i||(i=new Promise((w,M)=>ze(this,void 0,void 0,function*(){var C;yield u=g.createElement("script"),u.id=this.id,y.set("libraries",[...v]+"");for(a in o)y.set(a.replace(/[A-Z]/g,O=>"_"+O[0].toLowerCase()),o[a]);y.set("callback",f+".maps."+m),u.src=this.url+"?"+y,h[m]=w,u.onerror=()=>i=M(Error(d+" could not load.")),u.nonce=this.nonce||((C=g.querySelector("script[nonce]"))===null||C===void 0?void 0:C.nonce)||"",g.head.append(u)})));h[c]?console.warn(d+" only loads once. Ignoring:",o):h[c]=(w,...M)=>v.add(w)&&E().then(()=>h[c](w,...M))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}function Ye(n){return class extends n.OverlayView{constructor(r){super();ee(this,"element");ee(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const u=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${u}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let he;const me=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Xe=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:me,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(I,s),l.provide(j,o),l.provide(Re,i);const u=()=>{const c={...n};Object.keys(c).forEach(h=>{c[h]===void 0&&delete c[h]});const g=h=>{var v;return h?{position:(v=o.value)==null?void 0:v.ControlPosition[h]}:{}},p={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...c,...p}},a=l.watch([o,s],([c,m])=>{const g=c,p=m;g&&p&&(g.event.addListenerOnce(p,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:c,region:m,version:g,language:p,libraries:h,nonce:v}=n;he=new x({apiKey:c,region:m,version:g,language:p,libraries:h,nonce:v})}catch(c){console.error(c)}},f=c=>{o.value=l.markRaw(c.maps),s.value=l.markRaw(new c.maps.Map(t.value,u()));const m=Ye(o.value);o.value[Y]=m,me.forEach(p=>{var h;(h=s.value)==null||h.addListener(p,v=>e(p,v))}),r.value=!0;const g=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...g],([p,h],[v,y])=>{var O,_,P;const{center:E,zoom:w,...M}=u();(O=s.value)==null||O.setOptions(M),h!==void 0&&h!==y&&((_=s.value)==null||_.setZoom(h));const C=!v||p.lng!==v.lng||p.lat!==v.lat;p&&C&&((P=s.value)==null||P.panTo(p))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(f):(d(),he.load().then(f))}),l.onBeforeUnmount(()=>{var c;i.value=!1,s.value&&((c=o.value)==null||c.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}});const G=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Qe={ref:"mapRef",class:"mapdiv"};function et(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Qe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const tt=G(Xe,[["render",et],["__scopeId","data-v-289550ca"]]);function rt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nt=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=rt(nt),ge=["click","drag","dragend","dragstart","gmp-click"],st=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ge,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(p=>p.type!==l.Comment)}),i=l.toRef(n,"options"),u=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(I,l.ref()),f=l.inject(j,l.ref()),c=l.inject(ae,l.ref()),m=l.computed(()=>!!(c.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,u,s],async(g,[p,h,v,y])=>{var _,P,de;const E=!F(i.value,h)||!F(u.value,v),w=s.value!==y,M=E||w||d.value!==p;if(!d.value||!f.value||!M||o.value&&!s.value)return;const{AdvancedMarkerElement:C,PinElement:O}=f.value.marker;if(a.value){const{map:X,content:z,...Q}=i.value;Object.assign(a.value,{content:o.value?s.value:u.value?new O(u.value).element:z,...Q}),m.value&&((_=c.value)==null||_.removeMarker(a.value),(P=c.value)==null||P.addMarker(a.value))}else o.value?i.value.content=s.value:u.value&&(i.value.content=new O(u.value).element),a.value=l.markRaw(new C(i.value)),m.value?(de=c.value)==null||de.addMarker(a.value):a.value.map=d.value,ge.forEach(X=>{var z;(z=a.value)==null||z.addListener(X,Q=>e(X,Q))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,p;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(p=c.value)==null||p.removeMarker(a.value):a.value.map=null)}),l.provide(ie,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}});const ot={key:0,class:"advanced-marker-wrapper"};function it(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",ot,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default")],64)}const at=G(st,[["render",it]]),ve=n=>n==="Marker",ye=n=>n===Y,N=(n,e,t,r)=>{const s=l.ref(),o=l.inject(I,l.ref()),i=l.inject(j,l.ref()),u=l.inject(ae,l.ref()),a=l.computed(()=>!!(u.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[Y])));return l.watch([o,t],(d,[f,c])=>{var g,p,h;const m=!F(t.value,c)||o.value!==f;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=u.value)==null||g.removeMarker(s.value),(p=u.value)==null||p.addMarker(s.value));else{if(ve(n))s.value=l.markRaw(new i.value[n](t.value));else if(ye(n)){const v=t.value;v.element&&(s.value=l.markRaw(new i.value[n](v)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=u.value)==null||h.addMarker(s.value):(ve(n)||ye(n))&&s.value.setMap(o.value)),e.forEach(v=>{var y;(y=s.value)==null||y.addListener(v,E=>r(v,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(f=u.value)==null||f.removeMarker(s.value):s.value.setMap(null))}),s},we=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],lt=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:we,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=N("Marker",we,s,e);return l.provide(ie,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),ut=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:N("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:N("Polygon",$,t,e)}},render:()=>null}),Ee=$.concat(["bounds_changed"]),dt=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:N("Rectangle",Ee,t,e)}},render:()=>null}),ke=$.concat(["center_changed","radius_changed"]),ft=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:N("Circle",ke,t,e)}},render:()=>null}),pt=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(I,l.ref()),s=l.inject(j,l.ref()),o=l.inject(Re,l.ref(!1)),i=l.watch([o,s,t],([d,f,c])=>{f&&d&&c&&(u(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),u=d=>{if(r.value&&s.value&&t.value){const f=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&s.value){let f=null;const c=s.value.ControlPosition[d];r.value.controls[c].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[c].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),u(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}});const ht={ref:"controlRef",class:"custom-control-wrapper"};function mt(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",ht,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)}const gt=G(pt,[["render",mt],["__scopeId","data-v-ab9120cd"]]),_e=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],vt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[..._e,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(I,l.ref()),u=l.inject(j,l.ref()),a=l.inject(ie,l.ref());let d,f=n.modelValue;const c=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(v=>v.type!==l.Comment)}),m=h=>{f=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},p=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,v],[y,E])=>{var M;const w=!F(v,E)||i.value!==y;i.value&&u.value&&w&&(s.value?(s.value.setOptions({...v,content:c.value?o.value:v.content}),a.value||g()):(s.value=l.markRaw(new u.value.InfoWindow({...v,content:c.value?o.value:v.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),_e.forEach(C=>{var O;(O=s.value)==null||O.addListener(C,_=>t(C,_))}),(M=s.value)==null||M.addListener("closeclick",()=>m(!1))))},{immediate:!0}),l.watch(()=>n.modelValue,h=>{h!==f&&(h?g():p())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=u.value)==null||h.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:g,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:c,open:g,close:p}}});const yt={key:0,class:"info-window-wrapper"};function wt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const Et=G(vt,[["render",wt],["__scopeId","data-v-f0c09f6e"]]);var kt=Object.getOwnPropertyNames,_t=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty;function Ce(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function W(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),u=o.get(r);if(i&&u)return i===r&&u===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Me(n){return kt(n).concat(_t(n))}var Mt=Object.hasOwn||function(n,e){return Ct.call(n,e)};function R(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Ot="__v",bt="__o",Pt="_owner",Oe=Object.getOwnPropertyDescriptor,be=Object.keys;function St(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function qt(n,e){return R(n.getTime(),e.getTime())}function At(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Tt(n,e){return n===e}function Pe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,u,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),f=!1,c=0;(u=d.next())&&!u.done;){if(s[c]){c++;continue}var m=i.value,g=u.value;if(t.equals(m[0],g[0],a,c,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=s[c]=!0;break}c++}if(!f)return!1;a++}return!0}var Lt=R;function xt(n,e,t){var r=be(n),s=r.length;if(be(e).length!==s)return!1;for(;s-- >0;)if(!Be(n,e,t,r[s]))return!1;return!0}function D(n,e,t){var r=Me(n),s=r.length;if(Me(e).length!==s)return!1;for(var o,i,u;s-- >0;)if(o=r[s],!Be(n,e,t,o)||(i=Oe(n,o),u=Oe(e,o),(i||u)&&(!i||!u||i.configurable!==u.configurable||i.enumerable!==u.enumerable||i.writable!==u.writable)))return!1;return!0}function It(n,e){return R(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function Se(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,u;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(u=a.next())&&!u.done;){if(!s[f]&&t.equals(i.value,u.value,i.value,u.value,n,e,t)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Bt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Be(n,e,t,r){return(r===Pt||r===bt||r===Ot)&&(n.$$typeof||e.$$typeof)?!0:Mt(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var $t="[object Arguments]",Nt="[object Boolean]",Dt="[object Date]",Ut="[object Error]",Zt="[object Map]",Ft="[object Number]",Vt="[object Object]",Gt="[object RegExp]",zt="[object Set]",Wt="[object String]",Ht="[object URL]",Kt=Array.isArray,qe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Ae=Object.assign,Jt=Object.prototype.toString.call.bind(Object.prototype.toString);function Yt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,u=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,c=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(p,h,v){if(p===h)return!0;if(p==null||h==null)return!1;var y=typeof p;if(y!==typeof h)return!1;if(y!=="object")return y==="number"?i(p,h,v):y==="function"?s(p,h,v):!1;var E=p.constructor;if(E!==h.constructor)return!1;if(E===Object)return u(p,h,v);if(Kt(p))return e(p,h,v);if(qe!=null&&qe(p))return c(p,h,v);if(E===Date)return t(p,h,v);if(E===RegExp)return d(p,h,v);if(E===Map)return o(p,h,v);if(E===Set)return f(p,h,v);var w=Jt(p);return w===Dt?t(p,h,v):w===Gt?d(p,h,v):w===Zt?o(p,h,v):w===zt?f(p,h,v):w===Vt?typeof p.then!="function"&&typeof h.then!="function"&&u(p,h,v):w===Ht?m(p,h,v):w===Ut?r(p,h,v):w===$t?u(p,h,v):w===Nt||w===Ft||w===Wt?a(p,h,v):!1}}function Xt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?D:St,areDatesEqual:qt,areErrorsEqual:At,areFunctionsEqual:Tt,areMapsEqual:r?Ce(Pe,D):Pe,areNumbersEqual:Lt,areObjectsEqual:r?D:xt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Ce(Se,D):Se,areTypedArraysEqual:r?D:Rt,areUrlsEqual:Bt};if(t&&(s=Ae({},s,t(s))),e){var o=W(s.areArraysEqual),i=W(s.areMapsEqual),u=W(s.areObjectsEqual),a=W(s.areSetsEqual);s=Ae({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:u,areSetsEqual:a})}return s}function Qt(n){return function(e,t,r,s,o,i,u){return n(e,t,u)}}function er(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var f=r(),c=f.cache,m=c===void 0?e?new WeakMap:void 0:c,g=f.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var J=T();T({strict:!0});T({circular:!0});T({circular:!0,strict:!0});T({createInternalComparator:function(){return R}});T({strict:!0,createInternalComparator:function(){return R}});T({circular:!0,createInternalComparator:function(){return R}});T({circular:!0,createInternalComparator:function(){return R},strict:!0});function T(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,u=Xt(n),a=Yt(u),d=r?r(a):Qt(a);return er({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Te=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,U=8;class le{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==re)throw new Error(`Got v${s} data when expected v${re}.`);const o=Te[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new le(u,i,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Te.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-u%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+u+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(U+i+u+a),this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+u+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return oe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:u}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,c=a.pop()||0,m=a.pop()||0;if(c-m<=u){for(let v=m;v<=c;v++){const y=i[2*v],E=i[2*v+1];y>=e&&y<=r&&E>=t&&E<=s&&d.push(o[v])}continue}const g=m+c>>1,p=i[2*g],h=i[2*g+1];p>=e&&p<=r&&h>=t&&h<=s&&d.push(o[g]),(f===0?e<=p:t<=h)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=p:s>=h)&&(a.push(g+1),a.push(c),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,u=[0,s.length-1,0],a=[],d=r*r;for(;u.length;){const f=u.pop()||0,c=u.pop()||0,m=u.pop()||0;if(c-m<=i){for(let v=m;v<=c;v++)Le(o[2*v],o[2*v+1],e,t)<=d&&a.push(s[v]);continue}const g=m+c>>1,p=o[2*g],h=o[2*g+1];Le(p,h,e,t)<=d&&a.push(s[g]),(f===0?e-r<=p:t-r<=h)&&(u.push(m),u.push(g-1),u.push(1-f)),(f===0?e+r>=p:t+r>=h)&&(u.push(g+1),u.push(c),u.push(1-f))}return a}}function oe(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;$e(n,e,i,r,s,o),oe(n,e,t,r,i-1,1-o),oe(n,e,t,i+1,s,1-o)}function $e(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,f=t-r+1,c=Math.log(d),m=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*m*(d-m)/d)*(f-d/2<0?-1:1),p=Math.max(r,Math.floor(t-f*m/d+g)),h=Math.min(s,Math.floor(t+(d-f)*m/d+g));$e(n,e,t,p,h,o)}const i=e[2*t+o];let u=r,a=s;for(Z(n,e,r,t),e[2*s+o]>i&&Z(n,e,r,s);u<a;){for(Z(n,e,u,a),u++,a--;e[2*u+o]<i;)u++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?Z(n,e,r,a):(a++,Z(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function Z(n,e,t,r){ne(n,t,r),ne(e,2*t,2*r),ne(e,2*t+1,2*r+1)}function ne(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Le(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const tr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},xe=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),L=2,q=3,se=4,S=5,Ne=6;class De{constructor(e){this.options=Object.assign(Object.create(tr),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,c]=d.geometry.coordinates,m=xe(H(f)),g=xe(K(c));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let u=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();u=this.trees[a]=this._createTree(this._cluster(u,a)),t&&console.log("z%d: %d clusters in %dms",a,u.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const c=this.getClusters([r,s,180,i],t),m=this.getClusters([-180,s,o,i],t);return c.concat(m)}const u=this.trees[this._limitZoom(t)],a=u.range(H(r),K(i),H(o),K(s)),d=u.data,f=[];for(const c of a){const m=this.stride*c;f.push(d[m+S]>1?Ie(d,m,this.clusterProps):this.points[d[m+q]])}return f}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const i=o.data;if(t*this.stride>=i.length)throw new Error(s);const u=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=o.within(a,d,u),c=[];for(const m of f){const g=m*this.stride;i[g+se]===e&&c.push(i[g+S]>1?Ie(i,g,this.clusterProps):this.points[i[g+q]])}if(c.length===0)throw new Error(s);return c}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:u}=this.options,a=u/i,d=(r-a)/o,f=(r+1+a)/o,c={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,f),s.data,t,r,o,c),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,f),s.data,o,r,o,c),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,f),s.data,-1,r,o,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const i=this.getChildren(t);for(const u of i){const a=u.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(u),e.length===r)break}return o}_createTree(e){const t=new le(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,i){for(const u of e){const a=u*this.stride,d=t[a+S]>1;let f,c,m;if(d)f=Ue(t,a,this.clusterProps),c=t[a],m=t[a+1];else{const h=this.points[t[a+q]];f=h.properties;const[v,y]=h.geometry.coordinates;c=H(v),m=K(y)}const g={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:f};let p;d||this.options.generateId?p=t[a+q]:p=this.points[t[a+q]].id,p!==void 0&&(g.id=p),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:i}=this.options,u=r/(s*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let c=0;c<a.length;c+=f){if(a[c+L]<=t)continue;a[c+L]=t;const m=a[c],g=a[c+1],p=e.within(a[c],a[c+1],u),h=a[c+S];let v=h;for(const y of p){const E=y*f;a[E+L]>t&&(v+=a[E+S])}if(v>h&&v>=i){let y=m*h,E=g*h,w,M=-1;const C=((c/f|0)<<5)+(t+1)+this.points.length;for(const O of p){const _=O*f;if(a[_+L]<=t)continue;a[_+L]=t;const P=a[_+S];y+=a[_]*P,E+=a[_+1]*P,a[_+se]=C,o&&(w||(w=this._map(a,c,!0),M=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,_)))}a[c+se]=C,d.push(y/v,E/v,1/0,C,-1,v),o&&d.push(M)}else{for(let y=0;y<f;y++)d.push(a[c+y]);if(v>1)for(const y of p){const E=y*f;if(!(a[E+L]<=t)){a[E+L]=t;for(let w=0;w<f;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+S]>1){const i=this.clusterProps[e[t+Ne]];return r?Object.assign({},i):i}const s=this.points[e[t+q]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function Ie(n,e,t){return{type:"Feature",id:n[e+q],properties:Ue(n,e,t),geometry:{type:"Point",coordinates:[rr(n[e]),nr(n[e+1])]}}}function Ue(n,e,t){const r=n[e+S],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Ne],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+q],point_count:r,point_count_abbreviated:s})}function H(n){return n/360+.5}function K(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function rr(n){return(n-.5)*360}function nr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ue(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}class k{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class V{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(k.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>k.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(k.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function b(n,e="assertion failed"){if(n==null)throw Error(e)}const sr=(n,e,t,r)=>{const s=n.getBounds();b(s);const o=Ze(s,e,r);return t.filter(i=>o.contains(k.getPosition(i)))},Ze=(n,e,t)=>{const{northEast:r,southWest:s}=ir(n,e),o=ar({northEast:r,southWest:s},t);return lr(o,e)},or=(n,e,t)=>{const r=Ze(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},ir=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return b(t),b(r),{northEast:t,southWest:r}},ar=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),lr=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class ur extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=ue(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return b(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:sr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new V({position:k.getPosition(t),markers:[t]}));class dr extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=ue(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();b(r),r=Math.round(r);const s={zoom:r};if(!J(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const u=k.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[u.lng(),u.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!J(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return b(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new V({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new V({markers:[s],position:k.getPosition(s)})}}class fr extends ur{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=ue(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!J(this.state,t);if(!J(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=k.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new V({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new V({markers:[s],position:k.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return b(t),b(r),{zoom:Math.round(t),view:or(r,e.mapCanvasProjection,this.viewportPadding)}}}class pr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class hr{render({count:e,position:t},r,s){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-135889a7]{display:none}.mapdiv .info-window-wrapper[data-v-135889a7]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
2
|
+
"use strict";var Ve=Object.defineProperty;var Ge=(n,e,t)=>e in n?Ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ee=(n,e,t)=>(Ge(n,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),T=Symbol("map"),L=Symbol("api"),ie=Symbol("marker"),ae=Symbol("markerCluster"),Y=Symbol("CustomMarker"),le=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function ze(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function u(p){try{d(r.next(p))}catch(c){i(c)}}function a(p){try{d(r.throw(p))}catch(c){i(c)}}function d(p){p.done?o(p.value):s(p.value).then(u,a)}d((r=r.apply(n,e||[])).next())})}function We(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var te,fe;function He(){return fe||(fe=1,te=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),te}var Ke=He(),Je=We(Ke);const he="__googleMapsScriptId";var B;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(B||(B={}));class j{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=he,language:i,libraries:u=[],mapIds:a,nonce:d,region:p,retries:c=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||he,this.language=i,this.libraries=u,this.mapIds=a,this.nonce=d,this.region=p,this.retries=c,this.url=m,this.version=g,j.instance){if(!Je(this.options,j.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(j.instance.options)}`);return j.instance}j.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?B.FAILURE:this.done?B.SUCCESS:this.loading?B.LOADING:B.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,u,a,d="The Google Maps JavaScript API",p="google",c="importLibrary",m="__ib__",g=document,f=window;f=f[p]||(f[p]={});const h=f.maps||(f.maps={}),v=new Set,y=new URLSearchParams,E=()=>i||(i=new Promise((w,M)=>ze(this,void 0,void 0,function*(){var C;yield u=g.createElement("script"),u.id=this.id,y.set("libraries",[...v]+"");for(a in o)y.set(a.replace(/[A-Z]/g,O=>"_"+O[0].toLowerCase()),o[a]);y.set("callback",p+".maps."+m),u.src=this.url+"?"+y,h[m]=w,u.onerror=()=>i=M(Error(d+" could not load.")),u.nonce=this.nonce||((C=g.querySelector("script[nonce]"))===null||C===void 0?void 0:C.nonce)||"",g.head.append(u)})));h[c]?console.warn(d+" only loads once. Ignoring:",o):h[c]=(w,...M)=>v.add(w)&&E().then(()=>h[c](w,...M))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}function Ye(n){return class extends n.OverlayView{constructor(r){super();ee(this,"element");ee(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const u=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${u}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let me;const ge=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Xe=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ge,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(T,s),l.provide(L,o),l.provide(le,i);const u=()=>{const c={...n};Object.keys(c).forEach(h=>{c[h]===void 0&&delete c[h]});const g=h=>{var v;return h?{position:(v=o.value)==null?void 0:v.ControlPosition[h]}:{}},f={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...c,...f}},a=l.watch([o,s],([c,m])=>{const g=c,f=m;g&&f&&(g.event.addListenerOnce(f,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:c,region:m,version:g,language:f,libraries:h,nonce:v}=n;me=new j({apiKey:c,region:m,version:g,language:f,libraries:h,nonce:v})}catch(c){console.error(c)}},p=c=>{o.value=l.markRaw(c.maps),s.value=l.markRaw(new c.maps.Map(t.value,u()));const m=Ye(o.value);o.value[Y]=m,ge.forEach(f=>{var h;(h=s.value)==null||h.addListener(f,v=>e(f,v))}),r.value=!0;const g=Object.keys(n).filter(f=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(f)).map(f=>l.toRef(n,f));l.watch([()=>n.center,()=>n.zoom,...g],([f,h],[v,y])=>{var O,_,S;const{center:E,zoom:w,...M}=u();(O=s.value)==null||O.setOptions(M),h!==void 0&&h!==y&&((_=s.value)==null||_.setZoom(h));const C=!v||f.lng!==v.lng||f.lat!==v.lat;f&&C&&((S=s.value)==null||S.panTo(f))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(p):(d(),me.load().then(p))}),l.onBeforeUnmount(()=>{var c;i.value=!1,s.value&&((c=o.value)==null||c.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}});const G=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Qe={ref:"mapRef",class:"mapdiv"};function et(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Qe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const tt=G(Xe,[["render",et],["__scopeId","data-v-289550ca"]]);function rt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nt=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=rt(nt),ve=["click","drag","dragend","dragstart","gmp-click"],st=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ve,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(f=>f.type!==l.Comment)}),i=l.toRef(n,"options"),u=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(T,l.ref()),p=l.inject(L,l.ref()),c=l.inject(ae,l.ref()),m=l.computed(()=>!!(c.value&&p.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,u,s],async(g,[f,h,v,y])=>{var _,S,pe;const E=!F(i.value,h)||!F(u.value,v),w=s.value!==y,M=E||w||d.value!==f;if(!d.value||!p.value||!M||o.value&&!s.value)return;const{AdvancedMarkerElement:C,PinElement:O}=p.value.marker;if(a.value){const{map:X,content:z,...Q}=i.value;Object.assign(a.value,{content:o.value?s.value:u.value?new O(u.value).element:z,...Q}),m.value&&((_=c.value)==null||_.removeMarker(a.value),(S=c.value)==null||S.addMarker(a.value))}else o.value?i.value.content=s.value:u.value&&(i.value.content=new O(u.value).element),a.value=l.markRaw(new C(i.value)),m.value?(pe=c.value)==null||pe.addMarker(a.value):a.value.map=d.value,ve.forEach(X=>{var z;(z=a.value)==null||z.addListener(X,Q=>e(X,Q))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,f;a.value&&((g=p.value)==null||g.event.clearInstanceListeners(a.value),m.value?(f=c.value)==null||f.removeMarker(a.value):a.value.map=null)}),l.provide(ie,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}});const ot={key:0,class:"advanced-marker-wrapper"};function it(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",ot,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default")],64)}const at=G(st,[["render",it]]),ye=n=>n==="Marker",we=n=>n===Y,N=(n,e,t,r)=>{const s=l.ref(),o=l.inject(T,l.ref()),i=l.inject(L,l.ref()),u=l.inject(ae,l.ref()),a=l.computed(()=>!!(u.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[Y])));return l.watch([o,t],(d,[p,c])=>{var g,f,h;const m=!F(t.value,c)||o.value!==p;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=u.value)==null||g.removeMarker(s.value),(f=u.value)==null||f.addMarker(s.value));else{if(ye(n))s.value=l.markRaw(new i.value[n](t.value));else if(we(n)){const v=t.value;v.element&&(s.value=l.markRaw(new i.value[n](v)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=u.value)==null||h.addMarker(s.value):(ye(n)||we(n))&&s.value.setMap(o.value)),e.forEach(v=>{var y;(y=s.value)==null||y.addListener(v,E=>r(v,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,p;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(p=u.value)==null||p.removeMarker(s.value):s.value.setMap(null))}),s},Ee=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],lt=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=N("Marker",Ee,s,e);return l.provide(ie,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),ut=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:N("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:N("Polygon",$,t,e)}},render:()=>null}),ke=$.concat(["bounds_changed"]),dt=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:N("Rectangle",ke,t,e)}},render:()=>null}),_e=$.concat(["center_changed","radius_changed"]),pt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:N("Circle",_e,t,e)}},render:()=>null}),ft=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(T,l.ref()),s=l.inject(L,l.ref()),o=l.inject(le,l.ref(!1)),i=l.watch([o,s,t],([d,p,c])=>{p&&d&&c&&(u(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),u=d=>{if(r.value&&s.value&&t.value){const p=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[p].push(t.value)}},a=d=>{if(r.value&&s.value){let p=null;const c=s.value.ControlPosition[d];r.value.controls[c].forEach((m,g)=>{m===t.value&&(p=g)}),p!==null&&r.value.controls[c].removeAt(p)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,p)=>{a(p),u(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}});const ht={ref:"controlRef",class:"custom-control-wrapper"};function mt(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",ht,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)}const gt=G(ft,[["render",mt],["__scopeId","data-v-ab9120cd"]]),Ce=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],vt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ce,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(T,l.ref()),u=l.inject(L,l.ref()),a=l.inject(ie,l.ref());let d,p=n.modelValue;const c=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(v=>v.type!==l.Comment)}),m=h=>{p=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},f=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,v],[y,E])=>{var M;const w=!F(v,E)||i.value!==y;i.value&&u.value&&w&&(s.value?(s.value.setOptions({...v,content:c.value?o.value:v.content}),a.value||g()):(s.value=l.markRaw(new u.value.InfoWindow({...v,content:c.value?o.value:v.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||p)&&g(),Ce.forEach(C=>{var O;(O=s.value)==null||O.addListener(C,_=>t(C,_))}),(M=s.value)==null||M.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(()=>n.modelValue,h=>{h!==p&&(h?g():f())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=u.value)==null||h.event.clearInstanceListeners(s.value),f())}),r({infoWindow:s,open:g,close:f}),{infoWindow:s,infoWindowRef:o,hasSlotContent:c,open:g,close:f}}});const yt={key:0,class:"info-window-wrapper"};function wt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const Et=G(vt,[["render",wt],["__scopeId","data-v-135889a7"]]);var kt=Object.getOwnPropertyNames,_t=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty;function Me(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function W(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),u=o.get(r);if(i&&u)return i===r&&u===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Oe(n){return kt(n).concat(_t(n))}var Mt=Object.hasOwn||function(n,e){return Ct.call(n,e)};function R(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Ot="__v",bt="__o",St="_owner",be=Object.getOwnPropertyDescriptor,Se=Object.keys;function Pt(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function qt(n,e){return R(n.getTime(),e.getTime())}function At(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Tt(n,e){return n===e}function Pe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,u,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),p=!1,c=0;(u=d.next())&&!u.done;){if(s[c]){c++;continue}var m=i.value,g=u.value;if(t.equals(m[0],g[0],a,c,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){p=s[c]=!0;break}c++}if(!p)return!1;a++}return!0}var Lt=R;function xt(n,e,t){var r=Se(n),s=r.length;if(Se(e).length!==s)return!1;for(;s-- >0;)if(!Be(n,e,t,r[s]))return!1;return!0}function D(n,e,t){var r=Oe(n),s=r.length;if(Oe(e).length!==s)return!1;for(var o,i,u;s-- >0;)if(o=r[s],!Be(n,e,t,o)||(i=be(n,o),u=be(e,o),(i||u)&&(!i||!u||i.configurable!==u.configurable||i.enumerable!==u.enumerable||i.writable!==u.writable)))return!1;return!0}function It(n,e){return R(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function qe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,u;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,p=0;(u=a.next())&&!u.done;){if(!s[p]&&t.equals(i.value,u.value,i.value,u.value,n,e,t)){d=s[p]=!0;break}p++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Bt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Be(n,e,t,r){return(r===St||r===bt||r===Ot)&&(n.$$typeof||e.$$typeof)?!0:Mt(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var $t="[object Arguments]",Nt="[object Boolean]",Dt="[object Date]",Ut="[object Error]",Zt="[object Map]",Ft="[object Number]",Vt="[object Object]",Gt="[object RegExp]",zt="[object Set]",Wt="[object String]",Ht="[object URL]",Kt=Array.isArray,Ae=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Te=Object.assign,Jt=Object.prototype.toString.call.bind(Object.prototype.toString);function Yt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,u=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,p=n.areSetsEqual,c=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(f,h,v){if(f===h)return!0;if(f==null||h==null)return!1;var y=typeof f;if(y!==typeof h)return!1;if(y!=="object")return y==="number"?i(f,h,v):y==="function"?s(f,h,v):!1;var E=f.constructor;if(E!==h.constructor)return!1;if(E===Object)return u(f,h,v);if(Kt(f))return e(f,h,v);if(Ae!=null&&Ae(f))return c(f,h,v);if(E===Date)return t(f,h,v);if(E===RegExp)return d(f,h,v);if(E===Map)return o(f,h,v);if(E===Set)return p(f,h,v);var w=Jt(f);return w===Dt?t(f,h,v):w===Gt?d(f,h,v):w===Zt?o(f,h,v):w===zt?p(f,h,v):w===Vt?typeof f.then!="function"&&typeof h.then!="function"&&u(f,h,v):w===Ht?m(f,h,v):w===Ut?r(f,h,v):w===$t?u(f,h,v):w===Nt||w===Ft||w===Wt?a(f,h,v):!1}}function Xt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?D:Pt,areDatesEqual:qt,areErrorsEqual:At,areFunctionsEqual:Tt,areMapsEqual:r?Me(Pe,D):Pe,areNumbersEqual:Lt,areObjectsEqual:r?D:xt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Me(qe,D):qe,areTypedArraysEqual:r?D:Rt,areUrlsEqual:Bt};if(t&&(s=Te({},s,t(s))),e){var o=W(s.areArraysEqual),i=W(s.areMapsEqual),u=W(s.areObjectsEqual),a=W(s.areSetsEqual);s=Te({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:u,areSetsEqual:a})}return s}function Qt(n){return function(e,t,r,s,o,i,u){return n(e,t,u)}}function er(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var p=r(),c=p.cache,m=c===void 0?e?new WeakMap:void 0:c,g=p.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var J=x();x({strict:!0});x({circular:!0});x({circular:!0,strict:!0});x({createInternalComparator:function(){return R}});x({strict:!0,createInternalComparator:function(){return R}});x({circular:!0,createInternalComparator:function(){return R}});x({circular:!0,createInternalComparator:function(){return R},strict:!0});function x(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,u=Xt(n),a=Yt(u),d=r?r(a):Qt(a);return er({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Le=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,U=8;class ue{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==re)throw new Error(`Got v${s} data when expected v${re}.`);const o=Le[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new ue(u,i,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Le.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-u%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+u+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(U+i+u+a),this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+u+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return oe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:u}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const p=a.pop()||0,c=a.pop()||0,m=a.pop()||0;if(c-m<=u){for(let v=m;v<=c;v++){const y=i[2*v],E=i[2*v+1];y>=e&&y<=r&&E>=t&&E<=s&&d.push(o[v])}continue}const g=m+c>>1,f=i[2*g],h=i[2*g+1];f>=e&&f<=r&&h>=t&&h<=s&&d.push(o[g]),(p===0?e<=f:t<=h)&&(a.push(m),a.push(g-1),a.push(1-p)),(p===0?r>=f:s>=h)&&(a.push(g+1),a.push(c),a.push(1-p))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,u=[0,s.length-1,0],a=[],d=r*r;for(;u.length;){const p=u.pop()||0,c=u.pop()||0,m=u.pop()||0;if(c-m<=i){for(let v=m;v<=c;v++)xe(o[2*v],o[2*v+1],e,t)<=d&&a.push(s[v]);continue}const g=m+c>>1,f=o[2*g],h=o[2*g+1];xe(f,h,e,t)<=d&&a.push(s[g]),(p===0?e-r<=f:t-r<=h)&&(u.push(m),u.push(g-1),u.push(1-p)),(p===0?e+r>=f:t+r>=h)&&(u.push(g+1),u.push(c),u.push(1-p))}return a}}function oe(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;$e(n,e,i,r,s,o),oe(n,e,t,r,i-1,1-o),oe(n,e,t,i+1,s,1-o)}function $e(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,p=t-r+1,c=Math.log(d),m=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*m*(d-m)/d)*(p-d/2<0?-1:1),f=Math.max(r,Math.floor(t-p*m/d+g)),h=Math.min(s,Math.floor(t+(d-p)*m/d+g));$e(n,e,t,f,h,o)}const i=e[2*t+o];let u=r,a=s;for(Z(n,e,r,t),e[2*s+o]>i&&Z(n,e,r,s);u<a;){for(Z(n,e,u,a),u++,a--;e[2*u+o]<i;)u++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?Z(n,e,r,a):(a++,Z(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function Z(n,e,t,r){ne(n,t,r),ne(e,2*t,2*r),ne(e,2*t+1,2*r+1)}function ne(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function xe(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const tr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},Ie=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),I=2,q=3,se=4,P=5,Ne=6;class De{constructor(e){this.options=Object.assign(Object.create(tr),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[p,c]=d.geometry.coordinates,m=Ie(H(p)),g=Ie(K(c));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let u=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();u=this.trees[a]=this._createTree(this._cluster(u,a)),t&&console.log("z%d: %d clusters in %dms",a,u.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const c=this.getClusters([r,s,180,i],t),m=this.getClusters([-180,s,o,i],t);return c.concat(m)}const u=this.trees[this._limitZoom(t)],a=u.range(H(r),K(i),H(o),K(s)),d=u.data,p=[];for(const c of a){const m=this.stride*c;p.push(d[m+P]>1?je(d,m,this.clusterProps):this.points[d[m+q]])}return p}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const i=o.data;if(t*this.stride>=i.length)throw new Error(s);const u=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],p=o.within(a,d,u),c=[];for(const m of p){const g=m*this.stride;i[g+se]===e&&c.push(i[g+P]>1?je(i,g,this.clusterProps):this.points[i[g+q]])}if(c.length===0)throw new Error(s);return c}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:u}=this.options,a=u/i,d=(r-a)/o,p=(r+1+a)/o,c={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,p),s.data,t,r,o,c),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,p),s.data,o,r,o,c),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,p),s.data,-1,r,o,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const i=this.getChildren(t);for(const u of i){const a=u.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(u),e.length===r)break}return o}_createTree(e){const t=new ue(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,i){for(const u of e){const a=u*this.stride,d=t[a+P]>1;let p,c,m;if(d)p=Ue(t,a,this.clusterProps),c=t[a],m=t[a+1];else{const h=this.points[t[a+q]];p=h.properties;const[v,y]=h.geometry.coordinates;c=H(v),m=K(y)}const g={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:p};let f;d||this.options.generateId?f=t[a+q]:f=this.points[t[a+q]].id,f!==void 0&&(g.id=f),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:i}=this.options,u=r/(s*Math.pow(2,t)),a=e.data,d=[],p=this.stride;for(let c=0;c<a.length;c+=p){if(a[c+I]<=t)continue;a[c+I]=t;const m=a[c],g=a[c+1],f=e.within(a[c],a[c+1],u),h=a[c+P];let v=h;for(const y of f){const E=y*p;a[E+I]>t&&(v+=a[E+P])}if(v>h&&v>=i){let y=m*h,E=g*h,w,M=-1;const C=((c/p|0)<<5)+(t+1)+this.points.length;for(const O of f){const _=O*p;if(a[_+I]<=t)continue;a[_+I]=t;const S=a[_+P];y+=a[_]*S,E+=a[_+1]*S,a[_+se]=C,o&&(w||(w=this._map(a,c,!0),M=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,_)))}a[c+se]=C,d.push(y/v,E/v,1/0,C,-1,v),o&&d.push(M)}else{for(let y=0;y<p;y++)d.push(a[c+y]);if(v>1)for(const y of f){const E=y*p;if(!(a[E+I]<=t)){a[E+I]=t;for(let w=0;w<p;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+P]>1){const i=this.clusterProps[e[t+Ne]];return r?Object.assign({},i):i}const s=this.points[e[t+q]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function je(n,e,t){return{type:"Feature",id:n[e+q],properties:Ue(n,e,t),geometry:{type:"Point",coordinates:[rr(n[e]),nr(n[e+1])]}}}function Ue(n,e,t){const r=n[e+P],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Ne],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+q],point_count:r,point_count_abbreviated:s})}function H(n){return n/360+.5}function K(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function rr(n){return(n-.5)*360}function nr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ce(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}class k{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class V{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(k.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>k.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(k.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function b(n,e="assertion failed"){if(n==null)throw Error(e)}const sr=(n,e,t,r)=>{const s=n.getBounds();b(s);const o=Ze(s,e,r);return t.filter(i=>o.contains(k.getPosition(i)))},Ze=(n,e,t)=>{const{northEast:r,southWest:s}=ir(n,e),o=ar({northEast:r,southWest:s},t);return lr(o,e)},or=(n,e,t)=>{const r=Ze(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},ir=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return b(t),b(r),{northEast:t,southWest:r}},ar=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),lr=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class ur extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=ce(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return b(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:sr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new V({position:k.getPosition(t),markers:[t]}));class dr extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=ce(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();b(r),r=Math.round(r);const s={zoom:r};if(!J(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const u=k.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[u.lng(),u.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!J(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return b(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new V({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new V({markers:[s],position:k.getPosition(s)})}}class pr extends ur{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=ce(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!J(this.state,t);if(!J(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=k.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new V({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new V({markers:[s],position:k.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return b(t),b(r),{zoom:Math.round(t),view:or(r,e.mapCanvasProjection,this.viewportPadding)}}}class fr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class hr{render({count:e,position:t},r,s){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
3
3
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
4
4
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
5
5
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
6
6
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
7
|
-
</svg>`,u=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(k.isAdvancedMarkerAvailable(s)){const c=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:a,title:u,content:c};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:u,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function mr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class
|
|
7
|
+
</svg>`,u=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(k.isAdvancedMarkerAvailable(s)){const c=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:a,title:u,content:c};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:u,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function mr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class de{constructor(){mr(de,google.maps.OverlayView)}}var A;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(A||(A={}));const gr=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class vr extends de{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new dr(r),renderer:o=new hr,onClusterClick:i=gr}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(k.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(s=>{r=this.removeMarker(s,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,A.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const s=new Set;for(const i of t)i.markers.length==1&&s.add(i.markers[0]);const o=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?s.has(i.marker)||k.setMap(i.marker,null):o.push(i.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(i=>k.setMap(i,null)))}google.maps.event.trigger(this,A.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();b(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>k.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new fr(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>k.setMap(s,null)),this.onClusterClick){const s=k.isAdvancedMarker(r.marker)?A.GMP_CLICK:A.CLUSTER_CLICK;r.marker.addListener(s,o=>{google.maps.event.trigger(this,A.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})}k.setMap(r.marker,t)})}}const Re=Object.values(A),yr=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Re,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.inject(T,l.ref()),i=l.inject(L,l.ref());return l.provide(ae,s),l.watch(o,()=>{o.value&&(s.value=l.markRaw(new vr({map:o.value,algorithm:new pr(n.options.algorithmOptions??{}),...n.options})),Re.forEach(u=>{var a;(a=s.value)==null||a.addListener(u,d=>e(u,d))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var u;s.value&&((u=i.value)==null||u.event.clearInstanceListeners(s.value),s.value.clearMarkers(),s.value.setMap(null))}),t({markerCluster:s}),()=>{var u;return(u=r.default)==null?void 0:u.call(r)}}}),wr=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(d=>d.type!==l.Comment)}),i=l.computed(()=>({...n.options,element:s.value})),u=N(Y,[],i,t);return r({customMarker:u}),{customMarkerRef:s,customMarker:u,hasSlotContent:o}}});const Er={key:0,class:"custom-marker-wrapper"};function kr(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",Er,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:n.$attrs.onClick?"pointer":void 0}},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const _r=G(wr,[["render",kr],["__scopeId","data-v-2d2d343a"]]),Cr=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(T,l.ref()),r=l.inject(L,l.ref());return l.watch([t,()=>n.options],([s,o],[i,u])=>{const a=!F(o,u)||t.value!==i;if(t.value&&r.value&&a){let d;if(o.data&&!(o.data instanceof r.value.MVCArray)){const p=r.value.LatLng,c=o.data.map(m=>m instanceof p||"location"in m&&(m.location instanceof p||m.location===null)?m:"location"in m?{...m,location:new p(m.location)}:new p(m));d={...o,data:c}}else d=o;e.value?e.value.setOptions(d):e.value=l.markRaw(new r.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});exports.AdvancedMarker=at;exports.Circle=pt;exports.CustomControl=gt;exports.CustomMarker=_r;exports.GoogleMap=tt;exports.HeatmapLayer=Cr;exports.InfoWindow=Et;exports.Marker=lt;exports.MarkerCluster=yr;exports.Polygon=ct;exports.Polyline=ut;exports.Rectangle=dt;exports.apiSymbol=L;exports.mapSymbol=T;exports.mapTilesLoadedSymbol=le;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-135889a7]{display:none}.mapdiv .info-window-wrapper[data-v-135889a7]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
2
2
|
var it = Object.defineProperty;
|
|
3
3
|
var at = (n, e, t) => e in n ? it(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
4
|
var pe = (n, e, t) => (at(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
@@ -994,7 +994,8 @@ const Zr = /* @__PURE__ */ re(Mt, [["render", Pt], ["__scopeId", "data-v-ab9120c
|
|
|
994
994
|
}), (M = s.value) == null || M.addListener("closeclick", () => h(!1))));
|
|
995
995
|
},
|
|
996
996
|
{
|
|
997
|
-
immediate: !0
|
|
997
|
+
immediate: !0,
|
|
998
|
+
flush: "post"
|
|
998
999
|
}
|
|
999
1000
|
), q(
|
|
1000
1001
|
() => n.modelValue,
|
|
@@ -1019,7 +1020,7 @@ function At(n, e, t, r, s, o) {
|
|
|
1019
1020
|
], 16)
|
|
1020
1021
|
])) : Ee("", !0);
|
|
1021
1022
|
}
|
|
1022
|
-
const Fr = /* @__PURE__ */ re(qt, [["render", At], ["__scopeId", "data-v-
|
|
1023
|
+
const Fr = /* @__PURE__ */ re(qt, [["render", At], ["__scopeId", "data-v-135889a7"]]);
|
|
1023
1024
|
var Tt = Object.getOwnPropertyNames, Lt = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty;
|
|
1024
1025
|
function Ne(n, e) {
|
|
1025
1026
|
return function(r, s, o) {
|
|
@@ -2230,5 +2231,8 @@ export {
|
|
|
2230
2231
|
Ur as MarkerCluster,
|
|
2231
2232
|
Nr as Polygon,
|
|
2232
2233
|
$r as Polyline,
|
|
2233
|
-
Br as Rectangle
|
|
2234
|
+
Br as Rectangle,
|
|
2235
|
+
Z as apiSymbol,
|
|
2236
|
+
D as mapSymbol,
|
|
2237
|
+
Xe as mapTilesLoadedSymbol
|
|
2234
2238
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-e315b413]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ae91c15f]{display:none}.mapdiv .custom-control-wrapper[data-v-ae91c15f]{display:inline-block}.info-window-wrapper[data-v-
|
|
2
|
-
(function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.Vue3GoogleMap={},k.Vue))})(this,function(k,l){"use strict";var Cr=Object.defineProperty;var Mr=(k,l,O)=>l in k?Cr(k,l,{enumerable:!0,configurable:!0,writable:!0,value:O}):k[l]=O;var de=(k,l,O)=>(Mr(k,typeof l!="symbol"?l+"":l,O),O);const O=Symbol("map"),j=Symbol("api"),Q=Symbol("marker"),ee=Symbol("markerCluster"),W=Symbol("CustomMarker"),fe=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ge(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function c(f){try{d(r.next(f))}catch(u){i(u)}}function a(f){try{d(r.throw(f))}catch(u){i(u)}}function d(f){f.done?o(f.value):s(f.value).then(c,a)}d((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function ze(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var te,pe;function We(){return pe||(pe=1,te=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),te}var He=We(),Ke=ze(He);const he="__googleMapsScriptId";var N;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(N||(N={}));class R{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=he,language:i,libraries:c=[],mapIds:a,nonce:d,region:f,retries:u=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||he,this.language=i,this.libraries=c,this.mapIds=a,this.nonce=d,this.region=f,this.retries=u,this.url=m,this.version=g,R.instance){if(!Ke(this.options,R.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(R.instance.options)}`);return R.instance}R.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?N.FAILURE:this.done?N.SUCCESS:this.loading?N.LOADING:N.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,c,a,d="The Google Maps JavaScript API",f="google",u="importLibrary",m="__ib__",g=document,p=window;p=p[f]||(p[f]={});const h=p.maps||(p.maps={}),y=new Set,v=new URLSearchParams,E=()=>i||(i=new Promise((w,b)=>Ge(this,void 0,void 0,function*(){var M;yield c=g.createElement("script"),c.id=this.id,v.set("libraries",[...y]+"");for(a in o)v.set(a.replace(/[A-Z]/g,P=>"_"+P[0].toLowerCase()),o[a]);v.set("callback",f+".maps."+m),c.src=this.url+"?"+v,h[m]=w,c.onerror=()=>i=b(Error(d+" could not load.")),c.nonce=this.nonce||((M=g.querySelector("script[nonce]"))===null||M===void 0?void 0:M.nonce)||"",g.head.append(c)})));h[u]?console.warn(d+" only loads once. Ignoring:",o):h[u]=(w,...b)=>y.add(w)&&E().then(()=>h[u](w,...b))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}function Je(n){return class extends n.OverlayView{constructor(r){super();de(this,"element");de(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const c=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${c}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let me;const ge=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Ye=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ge,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(O,s),l.provide(j,o),l.provide(fe,i);const c=()=>{const u={...n};Object.keys(u).forEach(h=>{u[h]===void 0&&delete u[h]});const g=h=>{var y;return h?{position:(y=o.value)==null?void 0:y.ControlPosition[h]}:{}},p={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...p}},a=l.watch([o,s],([u,m])=>{const g=u,p=m;g&&p&&(g.event.addListenerOnce(p,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y}=n;me=new R({apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y})}catch(u){console.error(u)}},f=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const m=Je(o.value);o.value[W]=m,ge.forEach(p=>{var h;(h=s.value)==null||h.addListener(p,y=>e(p,y))}),r.value=!0;const g=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...g],([p,h],[y,v])=>{var P,C,I;const{center:E,zoom:w,...b}=c();(P=s.value)==null||P.setOptions(b),h!==void 0&&h!==v&&((C=s.value)==null||C.setZoom(h));const M=!y||p.lng!==y.lng||p.lat!==y.lat;p&&M&&((I=s.value)==null||I.panTo(p))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(f):(d(),me.load().then(f))}),l.onBeforeUnmount(()=>{var u;i.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}}),Or="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Xe={ref:"mapRef",class:"mapdiv"};function Qe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Xe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const et=U(Ye,[["render",Qe],["__scopeId","data-v-e315b413"]]);function tt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rt=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=tt(rt),ye=["click","drag","dragend","dragstart","gmp-click"],nt=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(p=>p.type!==l.Comment)}),i=l.toRef(n,"options"),c=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(O,l.ref()),f=l.inject(j,l.ref()),u=l.inject(ee,l.ref()),m=l.computed(()=>!!(u.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,c,s],async(g,[p,h,y,v])=>{var C,I,Ve;const E=!F(i.value,h)||!F(c.value,y),w=s.value!==v,b=E||w||d.value!==p;if(!d.value||!f.value||!b||o.value&&!s.value)return;const{AdvancedMarkerElement:M,PinElement:P}=f.value.marker;if(a.value){const{map:ce,content:X,...ue}=i.value;Object.assign(a.value,{content:o.value?s.value:c.value?new P(c.value).element:X,...ue}),m.value&&((C=u.value)==null||C.removeMarker(a.value),(I=u.value)==null||I.addMarker(a.value))}else o.value?i.value.content=s.value:c.value&&(i.value.content=new P(c.value).element),a.value=l.markRaw(new M(i.value)),m.value?(Ve=u.value)==null||Ve.addMarker(a.value):a.value.map=d.value,ye.forEach(ce=>{var X;(X=a.value)==null||X.addListener(ce,ue=>e(ce,ue))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,p;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(p=u.value)==null||p.removeMarker(a.value):a.value.map=null)}),l.provide(Q,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}}),br="",st={key:0,class:"advanced-marker-wrapper"};function ot(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",st,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("v-if",!0),l.renderSlot(n.$slots,"default")],64)}const it=U(nt,[["render",ot]]),ve=n=>n==="Marker",we=n=>n===W,D=(n,e,t,r)=>{const s=l.ref(),o=l.inject(O,l.ref()),i=l.inject(j,l.ref()),c=l.inject(ee,l.ref()),a=l.computed(()=>!!(c.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[W])));return l.watch([o,t],(d,[f,u])=>{var g,p,h;const m=!F(t.value,u)||o.value!==f;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=c.value)==null||g.removeMarker(s.value),(p=c.value)==null||p.addMarker(s.value));else{if(ve(n))s.value=l.markRaw(new i.value[n](t.value));else if(we(n)){const y=t.value;y.element&&(s.value=l.markRaw(new i.value[n](y)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=c.value)==null||h.addMarker(s.value):(ve(n)||we(n))&&s.value.setMap(o.value)),e.forEach(y=>{var v;(v=s.value)==null||v.addListener(y,E=>r(y,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(f=c.value)==null||f.removeMarker(s.value):s.value.setMap(null))}),s},Ee=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],at=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=D("Marker",Ee,s,e);return l.provide(Q,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),lt=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:D("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:D("Polygon",$,t,e)}},render:()=>null}),ke=$.concat(["bounds_changed"]),ut=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:D("Rectangle",ke,t,e)}},render:()=>null}),_e=$.concat(["center_changed","radius_changed"]),dt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:D("Circle",_e,t,e)}},render:()=>null}),ft=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(O,l.ref()),s=l.inject(j,l.ref()),o=l.inject(fe,l.ref(!1)),i=l.watch([o,s,t],([d,f,u])=>{f&&d&&u&&(c(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),c=d=>{if(r.value&&s.value&&t.value){const f=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&s.value){let f=null;const u=s.value.ControlPosition[d];r.value.controls[u].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[u].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),c(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}}),Pr="",pt={ref:"controlRef",class:"custom-control-wrapper"};function ht(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createCommentVNode(`
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-e315b413]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ae91c15f]{display:none}.mapdiv .custom-control-wrapper[data-v-ae91c15f]{display:inline-block}.info-window-wrapper[data-v-0e669f85]{display:none}.mapdiv .info-window-wrapper[data-v-0e669f85]{display:inline-block}.custom-marker-wrapper[data-v-4b2eafc1]{display:none}.mapdiv .custom-marker-wrapper[data-v-4b2eafc1]{display:inline-block}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.Vue3GoogleMap={},k.Vue))})(this,function(k,l){"use strict";var Cr=Object.defineProperty;var Mr=(k,l,M)=>l in k?Cr(k,l,{enumerable:!0,configurable:!0,writable:!0,value:M}):k[l]=M;var fe=(k,l,M)=>(Mr(k,typeof l!="symbol"?l+"":l,M),M);const M=Symbol("map"),q=Symbol("api"),Q=Symbol("marker"),ee=Symbol("markerCluster"),W=Symbol("CustomMarker"),te=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ge(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function c(f){try{d(r.next(f))}catch(u){i(u)}}function a(f){try{d(r.throw(f))}catch(u){i(u)}}function d(f){f.done?o(f.value):s(f.value).then(c,a)}d((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function ze(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var re,pe;function We(){return pe||(pe=1,re=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),re}var He=We(),Ke=ze(He);const he="__googleMapsScriptId";var N;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(N||(N={}));class R{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=he,language:i,libraries:c=[],mapIds:a,nonce:d,region:f,retries:u=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||he,this.language=i,this.libraries=c,this.mapIds=a,this.nonce=d,this.region=f,this.retries=u,this.url=m,this.version=g,R.instance){if(!Ke(this.options,R.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(R.instance.options)}`);return R.instance}R.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?N.FAILURE:this.done?N.SUCCESS:this.loading?N.LOADING:N.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,c,a,d="The Google Maps JavaScript API",f="google",u="importLibrary",m="__ib__",g=document,p=window;p=p[f]||(p[f]={});const h=p.maps||(p.maps={}),y=new Set,v=new URLSearchParams,E=()=>i||(i=new Promise((w,b)=>Ge(this,void 0,void 0,function*(){var O;yield c=g.createElement("script"),c.id=this.id,v.set("libraries",[...y]+"");for(a in o)v.set(a.replace(/[A-Z]/g,S=>"_"+S[0].toLowerCase()),o[a]);v.set("callback",f+".maps."+m),c.src=this.url+"?"+v,h[m]=w,c.onerror=()=>i=b(Error(d+" could not load.")),c.nonce=this.nonce||((O=g.querySelector("script[nonce]"))===null||O===void 0?void 0:O.nonce)||"",g.head.append(c)})));h[u]?console.warn(d+" only loads once. Ignoring:",o):h[u]=(w,...b)=>y.add(w)&&E().then(()=>h[u](w,...b))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}function Je(n){return class extends n.OverlayView{constructor(r){super();fe(this,"element");fe(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const c=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${c}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let me;const ge=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Ye=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ge,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(M,s),l.provide(q,o),l.provide(te,i);const c=()=>{const u={...n};Object.keys(u).forEach(h=>{u[h]===void 0&&delete u[h]});const g=h=>{var y;return h?{position:(y=o.value)==null?void 0:y.ControlPosition[h]}:{}},p={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...p}},a=l.watch([o,s],([u,m])=>{const g=u,p=m;g&&p&&(g.event.addListenerOnce(p,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y}=n;me=new R({apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y})}catch(u){console.error(u)}},f=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const m=Je(o.value);o.value[W]=m,ge.forEach(p=>{var h;(h=s.value)==null||h.addListener(p,y=>e(p,y))}),r.value=!0;const g=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...g],([p,h],[y,v])=>{var S,C,j;const{center:E,zoom:w,...b}=c();(S=s.value)==null||S.setOptions(b),h!==void 0&&h!==v&&((C=s.value)==null||C.setZoom(h));const O=!y||p.lng!==y.lng||p.lat!==y.lat;p&&O&&((j=s.value)==null||j.panTo(p))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(f):(d(),me.load().then(f))}),l.onBeforeUnmount(()=>{var u;i.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}}),Or="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Xe={ref:"mapRef",class:"mapdiv"};function Qe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Xe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const et=U(Ye,[["render",Qe],["__scopeId","data-v-e315b413"]]);function tt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rt=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=tt(rt),ye=["click","drag","dragend","dragstart","gmp-click"],nt=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(p=>p.type!==l.Comment)}),i=l.toRef(n,"options"),c=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(M,l.ref()),f=l.inject(q,l.ref()),u=l.inject(ee,l.ref()),m=l.computed(()=>!!(u.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,c,s],async(g,[p,h,y,v])=>{var C,j,Ve;const E=!F(i.value,h)||!F(c.value,y),w=s.value!==v,b=E||w||d.value!==p;if(!d.value||!f.value||!b||o.value&&!s.value)return;const{AdvancedMarkerElement:O,PinElement:S}=f.value.marker;if(a.value){const{map:ue,content:X,...de}=i.value;Object.assign(a.value,{content:o.value?s.value:c.value?new S(c.value).element:X,...de}),m.value&&((C=u.value)==null||C.removeMarker(a.value),(j=u.value)==null||j.addMarker(a.value))}else o.value?i.value.content=s.value:c.value&&(i.value.content=new S(c.value).element),a.value=l.markRaw(new O(i.value)),m.value?(Ve=u.value)==null||Ve.addMarker(a.value):a.value.map=d.value,ye.forEach(ue=>{var X;(X=a.value)==null||X.addListener(ue,de=>e(ue,de))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,p;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(p=u.value)==null||p.removeMarker(a.value):a.value.map=null)}),l.provide(Q,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}}),br="",st={key:0,class:"advanced-marker-wrapper"};function ot(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",st,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("v-if",!0),l.renderSlot(n.$slots,"default")],64)}const it=U(nt,[["render",ot]]),ve=n=>n==="Marker",we=n=>n===W,D=(n,e,t,r)=>{const s=l.ref(),o=l.inject(M,l.ref()),i=l.inject(q,l.ref()),c=l.inject(ee,l.ref()),a=l.computed(()=>!!(c.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[W])));return l.watch([o,t],(d,[f,u])=>{var g,p,h;const m=!F(t.value,u)||o.value!==f;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=c.value)==null||g.removeMarker(s.value),(p=c.value)==null||p.addMarker(s.value));else{if(ve(n))s.value=l.markRaw(new i.value[n](t.value));else if(we(n)){const y=t.value;y.element&&(s.value=l.markRaw(new i.value[n](y)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=c.value)==null||h.addMarker(s.value):(ve(n)||we(n))&&s.value.setMap(o.value)),e.forEach(y=>{var v;(v=s.value)==null||v.addListener(y,E=>r(y,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(f=c.value)==null||f.removeMarker(s.value):s.value.setMap(null))}),s},Ee=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],at=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=D("Marker",Ee,s,e);return l.provide(Q,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),lt=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:D("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:D("Polygon",$,t,e)}},render:()=>null}),ke=$.concat(["bounds_changed"]),ut=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:D("Rectangle",ke,t,e)}},render:()=>null}),_e=$.concat(["center_changed","radius_changed"]),dt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:D("Circle",_e,t,e)}},render:()=>null}),ft=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(M,l.ref()),s=l.inject(q,l.ref()),o=l.inject(te,l.ref(!1)),i=l.watch([o,s,t],([d,f,u])=>{f&&d&&u&&(c(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),c=d=>{if(r.value&&s.value&&t.value){const f=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&s.value){let f=null;const u=s.value.ControlPosition[d];r.value.controls[u].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[u].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),c(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}}),Sr="",pt={ref:"controlRef",class:"custom-control-wrapper"};function ht(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createCommentVNode(`
|
|
3
3
|
v-show must be used instead of v-if otherwise there
|
|
4
4
|
would be no rendered content pushed to the map controls
|
|
5
|
-
`),l.createElementVNode("div",pt,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)],2112)}const mt=U(ft,[["render",ht],["__scopeId","data-v-ae91c15f"]]),Ce=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],gt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ce,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(O,l.ref()),c=l.inject(j,l.ref()),a=l.inject(Q,l.ref());let d,f=n.modelValue;const u=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(y=>y.type!==l.Comment)}),m=h=>{f=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},p=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,y],[v,E])=>{var b;const w=!F(y,E)||i.value!==v;i.value&&c.value&&w&&(s.value?(s.value.setOptions({...y,content:u.value?o.value:y.content}),a.value||g()):(s.value=l.markRaw(new c.value.InfoWindow({...y,content:u.value?o.value:y.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),Ce.forEach(M=>{var P;(P=s.value)==null||P.addListener(M,C=>t(M,C))}),(b=s.value)==null||b.addListener("closeclick",()=>m(!1))))},{immediate:!0}),l.watch(()=>n.modelValue,h=>{h!==f&&(h?g():p())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=c.value)==null||h.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:g,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:u,open:g,close:p}}}),Sr="",yt={key:0,class:"info-window-wrapper"};function vt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const wt=U(gt,[["render",vt],["__scopeId","data-v-dfef906e"]]);var Et=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty;function Me(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function H(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),c=o.get(r);if(i&&c)return i===r&&c===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Oe(n){return Et(n).concat(kt(n))}var Ct=Object.hasOwn||function(n,e){return _t.call(n,e)};function x(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Mt="__v",Ot="__o",bt="_owner",be=Object.getOwnPropertyDescriptor,Pe=Object.keys;function Pt(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function St(n,e){return x(n.getTime(),e.getTime())}function qt(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function At(n,e){return n===e}function Se(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,c,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),f=!1,u=0;(c=d.next())&&!c.done;){if(s[u]){u++;continue}var m=i.value,g=c.value;if(t.equals(m[0],g[0],a,u,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=s[u]=!0;break}u++}if(!f)return!1;a++}return!0}var Tt=x;function Lt(n,e,t){var r=Pe(n),s=r.length;if(Pe(e).length!==s)return!1;for(;s-- >0;)if(!Ae(n,e,t,r[s]))return!1;return!0}function Z(n,e,t){var r=Oe(n),s=r.length;if(Oe(e).length!==s)return!1;for(var o,i,c;s-- >0;)if(o=r[s],!Ae(n,e,t,o)||(i=be(n,o),c=be(e,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function It(n,e){return x(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function qe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,c;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(c=a.next())&&!c.done;){if(!s[f]&&t.equals(i.value,c.value,i.value,c.value,n,e,t)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function xt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Ae(n,e,t,r){return(r===bt||r===Ot||r===Mt)&&(n.$$typeof||e.$$typeof)?!0:Ct(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var Bt="[object Arguments]",$t="[object Boolean]",Nt="[object Date]",Dt="[object Error]",Ut="[object Map]",Ft="[object Number]",Zt="[object Object]",Vt="[object RegExp]",Gt="[object Set]",zt="[object String]",Wt="[object URL]",Ht=Array.isArray,Te=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Le=Object.assign,Kt=Object.prototype.toString.call.bind(Object.prototype.toString);function Jt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,c=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(p,h,y){if(p===h)return!0;if(p==null||h==null)return!1;var v=typeof p;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?i(p,h,y):v==="function"?s(p,h,y):!1;var E=p.constructor;if(E!==h.constructor)return!1;if(E===Object)return c(p,h,y);if(Ht(p))return e(p,h,y);if(Te!=null&&Te(p))return u(p,h,y);if(E===Date)return t(p,h,y);if(E===RegExp)return d(p,h,y);if(E===Map)return o(p,h,y);if(E===Set)return f(p,h,y);var w=Kt(p);return w===Nt?t(p,h,y):w===Vt?d(p,h,y):w===Ut?o(p,h,y):w===Gt?f(p,h,y):w===Zt?typeof p.then!="function"&&typeof h.then!="function"&&c(p,h,y):w===Wt?m(p,h,y):w===Dt?r(p,h,y):w===Bt?c(p,h,y):w===$t||w===Ft||w===zt?a(p,h,y):!1}}function Yt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?Z:Pt,areDatesEqual:St,areErrorsEqual:qt,areFunctionsEqual:At,areMapsEqual:r?Me(Se,Z):Se,areNumbersEqual:Tt,areObjectsEqual:r?Z:Lt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Me(qe,Z):qe,areTypedArraysEqual:r?Z:Rt,areUrlsEqual:xt};if(t&&(s=Le({},s,t(s))),e){var o=H(s.areArraysEqual),i=H(s.areMapsEqual),c=H(s.areObjectsEqual),a=H(s.areSetsEqual);s=Le({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:c,areSetsEqual:a})}return s}function Xt(n){return function(e,t,r,s,o,i,c){return n(e,t,c)}}function Qt(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var f=r(),u=f.cache,m=u===void 0?e?new WeakMap:void 0:u,g=f.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var K=q();q({strict:!0}),q({circular:!0}),q({circular:!0,strict:!0}),q({createInternalComparator:function(){return x}}),q({strict:!0,createInternalComparator:function(){return x}}),q({circular:!0,createInternalComparator:function(){return x}}),q({circular:!0,createInternalComparator:function(){return x},strict:!0});function q(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,c=Yt(n),a=Jt(c),d=r?r(a):Xt(a);return Qt({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,V=8;class ne{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==re)throw new Error(`Got v${s} data when expected v${re}.`);const o=Ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new ne(c,i,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Ie.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(V+i+c+a),this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return se(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:c}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,u=a.pop()||0,m=a.pop()||0;if(u-m<=c){for(let y=m;y<=u;y++){const v=i[2*y],E=i[2*y+1];v>=e&&v<=r&&E>=t&&E<=s&&d.push(o[y])}continue}const g=m+u>>1,p=i[2*g],h=i[2*g+1];p>=e&&p<=r&&h>=t&&h<=s&&d.push(o[g]),(f===0?e<=p:t<=h)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=p:s>=h)&&(a.push(g+1),a.push(u),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,c=[0,s.length-1,0],a=[],d=r*r;for(;c.length;){const f=c.pop()||0,u=c.pop()||0,m=c.pop()||0;if(u-m<=i){for(let y=m;y<=u;y++)Re(o[2*y],o[2*y+1],e,t)<=d&&a.push(s[y]);continue}const g=m+u>>1,p=o[2*g],h=o[2*g+1];Re(p,h,e,t)<=d&&a.push(s[g]),(f===0?e-r<=p:t-r<=h)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?e+r>=p:t+r>=h)&&(c.push(g+1),c.push(u),c.push(1-f))}return a}}function se(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;je(n,e,i,r,s,o),se(n,e,t,r,i-1,1-o),se(n,e,t,i+1,s,1-o)}function je(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,f=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*m*(d-m)/d)*(f-d/2<0?-1:1),p=Math.max(r,Math.floor(t-f*m/d+g)),h=Math.min(s,Math.floor(t+(d-f)*m/d+g));je(n,e,t,p,h,o)}const i=e[2*t+o];let c=r,a=s;for(G(n,e,r,t),e[2*s+o]>i&&G(n,e,r,s);c<a;){for(G(n,e,c,a),c++,a--;e[2*c+o]<i;)c++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?G(n,e,r,a):(a++,G(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function G(n,e,t,r){oe(n,t,r),oe(e,2*t,2*r),oe(e,2*t+1,2*r+1)}function oe(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Re(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const er={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},xe=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),B=2,A=3,ie=4,T=5,Be=6;class $e{constructor(e){this.options=Object.assign(Object.create(er),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,u]=d.geometry.coordinates,m=xe(J(f)),g=xe(Y(u));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let c=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const u=this.getClusters([r,s,180,i],t),m=this.getClusters([-180,s,o,i],t);return u.concat(m)}const c=this.trees[this._limitZoom(t)],a=c.range(J(r),Y(i),J(o),Y(s)),d=c.data,f=[];for(const u of a){const m=this.stride*u;f.push(d[m+T]>1?Ne(d,m,this.clusterProps):this.points[d[m+A]])}return f}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const i=o.data;if(t*this.stride>=i.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=o.within(a,d,c),u=[];for(const m of f){const g=m*this.stride;i[g+ie]===e&&u.push(i[g+T]>1?Ne(i,g,this.clusterProps):this.points[i[g+A]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:c}=this.options,a=c/i,d=(r-a)/o,f=(r+1+a)/o,u={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,f),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,f),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,f),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const i=this.getChildren(t);for(const c of i){const a=c.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new ne(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,i){for(const c of e){const a=c*this.stride,d=t[a+T]>1;let f,u,m;if(d)f=De(t,a,this.clusterProps),u=t[a],m=t[a+1];else{const h=this.points[t[a+A]];f=h.properties;const[y,v]=h.geometry.coordinates;u=J(y),m=Y(v)}const g={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:f};let p;d||this.options.generateId?p=t[a+A]:p=this.points[t[a+A]].id,p!==void 0&&(g.id=p),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:i}=this.options,c=r/(s*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let u=0;u<a.length;u+=f){if(a[u+B]<=t)continue;a[u+B]=t;const m=a[u],g=a[u+1],p=e.within(a[u],a[u+1],c),h=a[u+T];let y=h;for(const v of p){const E=v*f;a[E+B]>t&&(y+=a[E+T])}if(y>h&&y>=i){let v=m*h,E=g*h,w,b=-1;const M=((u/f|0)<<5)+(t+1)+this.points.length;for(const P of p){const C=P*f;if(a[C+B]<=t)continue;a[C+B]=t;const I=a[C+T];v+=a[C]*I,E+=a[C+1]*I,a[C+ie]=M,o&&(w||(w=this._map(a,u,!0),b=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,C)))}a[u+ie]=M,d.push(v/y,E/y,1/0,M,-1,y),o&&d.push(b)}else{for(let v=0;v<f;v++)d.push(a[u+v]);if(y>1)for(const v of p){const E=v*f;if(!(a[E+B]<=t)){a[E+B]=t;for(let w=0;w<f;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+T]>1){const i=this.clusterProps[e[t+Be]];return r?Object.assign({},i):i}const s=this.points[e[t+A]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function Ne(n,e,t){return{type:"Feature",id:n[e+A],properties:De(n,e,t),geometry:{type:"Point",coordinates:[tr(n[e]),rr(n[e+1])]}}}function De(n,e,t){const r=n[e+T],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Be],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+A],point_count:r,point_count_abbreviated:s})}function J(n){return n/360+.5}function Y(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function tr(n){return(n-.5)*360}function rr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ae(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}typeof SuppressedError=="function"&&SuppressedError;class _{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class z{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(_.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>_.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(_.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function S(n,e="assertion failed"){if(n==null)throw Error(e)}const nr=(n,e,t,r)=>{const s=n.getBounds();S(s);const o=Ue(s,e,r);return t.filter(i=>o.contains(_.getPosition(i)))},Ue=(n,e,t)=>{const{northEast:r,southWest:s}=or(n,e),o=ir({northEast:r,southWest:s},t);return ar(o,e)},sr=(n,e,t)=>{const r=Ue(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},or=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return S(t),S(r),{northEast:t,southWest:r}},ir=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),ar=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class lr extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=ae(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return S(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:nr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new z({position:_.getPosition(t),markers:[t]}));class ur extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=ae(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();S(r),r=Math.round(r);const s={zoom:r};if(!K(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const c=_.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[c.lng(),c.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!K(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return S(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}}class dr extends lr{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=ae(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!K(this.state,t);if(!K(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return S(t),S(r),{zoom:Math.round(t),view:sr(r,e.mapCanvasProjection,this.viewportPadding)}}}class fr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class pr{render({count:e,position:t},r,s){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
5
|
+
`),l.createElementVNode("div",pt,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)],2112)}const mt=U(ft,[["render",ht],["__scopeId","data-v-ae91c15f"]]),Ce=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],gt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ce,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(M,l.ref()),c=l.inject(q,l.ref()),a=l.inject(Q,l.ref());let d,f=n.modelValue;const u=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(y=>y.type!==l.Comment)}),m=h=>{f=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},p=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,y],[v,E])=>{var b;const w=!F(y,E)||i.value!==v;i.value&&c.value&&w&&(s.value?(s.value.setOptions({...y,content:u.value?o.value:y.content}),a.value||g()):(s.value=l.markRaw(new c.value.InfoWindow({...y,content:u.value?o.value:y.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),Ce.forEach(O=>{var S;(S=s.value)==null||S.addListener(O,C=>t(O,C))}),(b=s.value)==null||b.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(()=>n.modelValue,h=>{h!==f&&(h?g():p())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=c.value)==null||h.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:g,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:u,open:g,close:p}}}),Pr="",yt={key:0,class:"info-window-wrapper"};function vt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const wt=U(gt,[["render",vt],["__scopeId","data-v-0e669f85"]]);var Et=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty;function Me(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function H(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),c=o.get(r);if(i&&c)return i===r&&c===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Oe(n){return Et(n).concat(kt(n))}var Ct=Object.hasOwn||function(n,e){return _t.call(n,e)};function x(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Mt="__v",Ot="__o",bt="_owner",be=Object.getOwnPropertyDescriptor,Se=Object.keys;function St(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Pt(n,e){return x(n.getTime(),e.getTime())}function qt(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function At(n,e){return n===e}function Pe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,c,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),f=!1,u=0;(c=d.next())&&!c.done;){if(s[u]){u++;continue}var m=i.value,g=c.value;if(t.equals(m[0],g[0],a,u,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=s[u]=!0;break}u++}if(!f)return!1;a++}return!0}var Tt=x;function Lt(n,e,t){var r=Se(n),s=r.length;if(Se(e).length!==s)return!1;for(;s-- >0;)if(!Ae(n,e,t,r[s]))return!1;return!0}function Z(n,e,t){var r=Oe(n),s=r.length;if(Oe(e).length!==s)return!1;for(var o,i,c;s-- >0;)if(o=r[s],!Ae(n,e,t,o)||(i=be(n,o),c=be(e,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function It(n,e){return x(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function qe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,c;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(c=a.next())&&!c.done;){if(!s[f]&&t.equals(i.value,c.value,i.value,c.value,n,e,t)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function xt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Ae(n,e,t,r){return(r===bt||r===Ot||r===Mt)&&(n.$$typeof||e.$$typeof)?!0:Ct(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var Bt="[object Arguments]",$t="[object Boolean]",Nt="[object Date]",Dt="[object Error]",Ut="[object Map]",Ft="[object Number]",Zt="[object Object]",Vt="[object RegExp]",Gt="[object Set]",zt="[object String]",Wt="[object URL]",Ht=Array.isArray,Te=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Le=Object.assign,Kt=Object.prototype.toString.call.bind(Object.prototype.toString);function Jt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,c=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(p,h,y){if(p===h)return!0;if(p==null||h==null)return!1;var v=typeof p;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?i(p,h,y):v==="function"?s(p,h,y):!1;var E=p.constructor;if(E!==h.constructor)return!1;if(E===Object)return c(p,h,y);if(Ht(p))return e(p,h,y);if(Te!=null&&Te(p))return u(p,h,y);if(E===Date)return t(p,h,y);if(E===RegExp)return d(p,h,y);if(E===Map)return o(p,h,y);if(E===Set)return f(p,h,y);var w=Kt(p);return w===Nt?t(p,h,y):w===Vt?d(p,h,y):w===Ut?o(p,h,y):w===Gt?f(p,h,y):w===Zt?typeof p.then!="function"&&typeof h.then!="function"&&c(p,h,y):w===Wt?m(p,h,y):w===Dt?r(p,h,y):w===Bt?c(p,h,y):w===$t||w===Ft||w===zt?a(p,h,y):!1}}function Yt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?Z:St,areDatesEqual:Pt,areErrorsEqual:qt,areFunctionsEqual:At,areMapsEqual:r?Me(Pe,Z):Pe,areNumbersEqual:Tt,areObjectsEqual:r?Z:Lt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Me(qe,Z):qe,areTypedArraysEqual:r?Z:Rt,areUrlsEqual:xt};if(t&&(s=Le({},s,t(s))),e){var o=H(s.areArraysEqual),i=H(s.areMapsEqual),c=H(s.areObjectsEqual),a=H(s.areSetsEqual);s=Le({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:c,areSetsEqual:a})}return s}function Xt(n){return function(e,t,r,s,o,i,c){return n(e,t,c)}}function Qt(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var f=r(),u=f.cache,m=u===void 0?e?new WeakMap:void 0:u,g=f.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var K=A();A({strict:!0}),A({circular:!0}),A({circular:!0,strict:!0}),A({createInternalComparator:function(){return x}}),A({strict:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x},strict:!0});function A(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,c=Yt(n),a=Jt(c),d=r?r(a):Xt(a);return Qt({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ne=1,V=8;class se{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==ne)throw new Error(`Got v${s} data when expected v${ne}.`);const o=Ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new se(c,i,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Ie.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(V+i+c+a),this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ne<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return oe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:c}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,u=a.pop()||0,m=a.pop()||0;if(u-m<=c){for(let y=m;y<=u;y++){const v=i[2*y],E=i[2*y+1];v>=e&&v<=r&&E>=t&&E<=s&&d.push(o[y])}continue}const g=m+u>>1,p=i[2*g],h=i[2*g+1];p>=e&&p<=r&&h>=t&&h<=s&&d.push(o[g]),(f===0?e<=p:t<=h)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=p:s>=h)&&(a.push(g+1),a.push(u),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,c=[0,s.length-1,0],a=[],d=r*r;for(;c.length;){const f=c.pop()||0,u=c.pop()||0,m=c.pop()||0;if(u-m<=i){for(let y=m;y<=u;y++)Re(o[2*y],o[2*y+1],e,t)<=d&&a.push(s[y]);continue}const g=m+u>>1,p=o[2*g],h=o[2*g+1];Re(p,h,e,t)<=d&&a.push(s[g]),(f===0?e-r<=p:t-r<=h)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?e+r>=p:t+r>=h)&&(c.push(g+1),c.push(u),c.push(1-f))}return a}}function oe(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;je(n,e,i,r,s,o),oe(n,e,t,r,i-1,1-o),oe(n,e,t,i+1,s,1-o)}function je(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,f=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*m*(d-m)/d)*(f-d/2<0?-1:1),p=Math.max(r,Math.floor(t-f*m/d+g)),h=Math.min(s,Math.floor(t+(d-f)*m/d+g));je(n,e,t,p,h,o)}const i=e[2*t+o];let c=r,a=s;for(G(n,e,r,t),e[2*s+o]>i&&G(n,e,r,s);c<a;){for(G(n,e,c,a),c++,a--;e[2*c+o]<i;)c++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?G(n,e,r,a):(a++,G(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function G(n,e,t,r){ie(n,t,r),ie(e,2*t,2*r),ie(e,2*t+1,2*r+1)}function ie(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Re(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const er={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},xe=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),B=2,T=3,ae=4,L=5,Be=6;class $e{constructor(e){this.options=Object.assign(Object.create(er),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,u]=d.geometry.coordinates,m=xe(J(f)),g=xe(Y(u));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let c=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const u=this.getClusters([r,s,180,i],t),m=this.getClusters([-180,s,o,i],t);return u.concat(m)}const c=this.trees[this._limitZoom(t)],a=c.range(J(r),Y(i),J(o),Y(s)),d=c.data,f=[];for(const u of a){const m=this.stride*u;f.push(d[m+L]>1?Ne(d,m,this.clusterProps):this.points[d[m+T]])}return f}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const i=o.data;if(t*this.stride>=i.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=o.within(a,d,c),u=[];for(const m of f){const g=m*this.stride;i[g+ae]===e&&u.push(i[g+L]>1?Ne(i,g,this.clusterProps):this.points[i[g+T]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:c}=this.options,a=c/i,d=(r-a)/o,f=(r+1+a)/o,u={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,f),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,f),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,f),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const i=this.getChildren(t);for(const c of i){const a=c.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new se(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,i){for(const c of e){const a=c*this.stride,d=t[a+L]>1;let f,u,m;if(d)f=De(t,a,this.clusterProps),u=t[a],m=t[a+1];else{const h=this.points[t[a+T]];f=h.properties;const[y,v]=h.geometry.coordinates;u=J(y),m=Y(v)}const g={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:f};let p;d||this.options.generateId?p=t[a+T]:p=this.points[t[a+T]].id,p!==void 0&&(g.id=p),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:i}=this.options,c=r/(s*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let u=0;u<a.length;u+=f){if(a[u+B]<=t)continue;a[u+B]=t;const m=a[u],g=a[u+1],p=e.within(a[u],a[u+1],c),h=a[u+L];let y=h;for(const v of p){const E=v*f;a[E+B]>t&&(y+=a[E+L])}if(y>h&&y>=i){let v=m*h,E=g*h,w,b=-1;const O=((u/f|0)<<5)+(t+1)+this.points.length;for(const S of p){const C=S*f;if(a[C+B]<=t)continue;a[C+B]=t;const j=a[C+L];v+=a[C]*j,E+=a[C+1]*j,a[C+ae]=O,o&&(w||(w=this._map(a,u,!0),b=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,C)))}a[u+ae]=O,d.push(v/y,E/y,1/0,O,-1,y),o&&d.push(b)}else{for(let v=0;v<f;v++)d.push(a[u+v]);if(y>1)for(const v of p){const E=v*f;if(!(a[E+B]<=t)){a[E+B]=t;for(let w=0;w<f;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+L]>1){const i=this.clusterProps[e[t+Be]];return r?Object.assign({},i):i}const s=this.points[e[t+T]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function Ne(n,e,t){return{type:"Feature",id:n[e+T],properties:De(n,e,t),geometry:{type:"Point",coordinates:[tr(n[e]),rr(n[e+1])]}}}function De(n,e,t){const r=n[e+L],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Be],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+T],point_count:r,point_count_abbreviated:s})}function J(n){return n/360+.5}function Y(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function tr(n){return(n-.5)*360}function rr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function le(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}typeof SuppressedError=="function"&&SuppressedError;class _{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class z{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(_.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>_.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(_.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function P(n,e="assertion failed"){if(n==null)throw Error(e)}const nr=(n,e,t,r)=>{const s=n.getBounds();P(s);const o=Ue(s,e,r);return t.filter(i=>o.contains(_.getPosition(i)))},Ue=(n,e,t)=>{const{northEast:r,southWest:s}=or(n,e),o=ir({northEast:r,southWest:s},t);return ar(o,e)},sr=(n,e,t)=>{const r=Ue(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},or=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return P(t),P(r),{northEast:t,southWest:r}},ir=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),ar=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class lr extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=le(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return P(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:nr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new z({position:_.getPosition(t),markers:[t]}));class ur extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=le(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();P(r),r=Math.round(r);const s={zoom:r};if(!K(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const c=_.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[c.lng(),c.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!K(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return P(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}}class dr extends lr{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=le(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!K(this.state,t);if(!K(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return P(t),P(r),{zoom:Math.round(t),view:sr(r,e.mapCanvasProjection,this.viewportPadding)}}}class fr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class pr{render({count:e,position:t},r,s){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
6
6
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
7
7
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
8
8
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
9
9
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
10
|
-
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(_.isAdvancedMarkerAvailable(s)){const u=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;u.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function hr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class
|
|
10
|
+
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(_.isAdvancedMarkerAvailable(s)){const u=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;u.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function hr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class ce{constructor(){hr(ce,google.maps.OverlayView)}}var I;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(I||(I={}));const mr=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class gr extends ce{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new ur(r),renderer:o=new pr,onClusterClick:i=mr}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(_.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(s=>{r=this.removeMarker(s,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,I.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const s=new Set;for(const i of t)i.markers.length==1&&s.add(i.markers[0]);const o=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?s.has(i.marker)||_.setMap(i.marker,null):o.push(i.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(i=>_.setMap(i,null)))}google.maps.event.trigger(this,I.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();P(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>_.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new fr(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>_.setMap(s,null)),this.onClusterClick){const s=_.isAdvancedMarker(r.marker)?I.GMP_CLICK:I.CLUSTER_CLICK;r.marker.addListener(s,o=>{google.maps.event.trigger(this,I.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})}_.setMap(r.marker,t)})}}const Ze=Object.values(I),yr=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Ze,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.inject(M,l.ref()),i=l.inject(q,l.ref());return l.provide(ee,s),l.watch(o,()=>{o.value&&(s.value=l.markRaw(new gr({map:o.value,algorithm:new dr(n.options.algorithmOptions??{}),...n.options})),Ze.forEach(c=>{var a;(a=s.value)==null||a.addListener(c,d=>e(c,d))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var c;s.value&&((c=i.value)==null||c.event.clearInstanceListeners(s.value),s.value.clearMarkers(),s.value.setMap(null))}),t({markerCluster:s}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}}),vr=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(d=>d.type!==l.Comment)}),i=l.computed(()=>({...n.options,element:s.value})),c=D(W,[],i,t);return r({customMarker:c}),{customMarkerRef:s,customMarker:c,hasSlotContent:o}}}),qr="",wr={key:0,class:"custom-marker-wrapper"};function Er(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",wr,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:n.$attrs.onClick?"pointer":void 0}},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const kr=U(vr,[["render",Er],["__scopeId","data-v-4b2eafc1"]]),_r=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(M,l.ref()),r=l.inject(q,l.ref());return l.watch([t,()=>n.options],([s,o],[i,c])=>{const a=!F(o,c)||t.value!==i;if(t.value&&r.value&&a){let d;if(o.data&&!(o.data instanceof r.value.MVCArray)){const f=r.value.LatLng,u=o.data.map(m=>m instanceof f||"location"in m&&(m.location instanceof f||m.location===null)?m:"location"in m?{...m,location:new f(m.location)}:new f(m));d={...o,data:u}}else d=o;e.value?e.value.setOptions(d):e.value=l.markRaw(new r.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});k.AdvancedMarker=it,k.Circle=dt,k.CustomControl=mt,k.CustomMarker=kr,k.GoogleMap=et,k.HeatmapLayer=_r,k.InfoWindow=wt,k.Marker=at,k.MarkerCluster=yr,k.Polygon=ct,k.Polyline=lt,k.Rectangle=ut,k.apiSymbol=q,k.mapSymbol=M,k.mapTilesLoadedSymbol=te,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue3-google-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,9 +60,10 @@
|
|
|
60
60
|
"fast-deep-equal": "^3.1.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
+
"@babel/core": "^7.28.0",
|
|
63
64
|
"@googlemaps/jest-mocks": "^2.22.6",
|
|
64
65
|
"@types/google.maps": "^3.58.1",
|
|
65
|
-
"@types/jest": "^
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
66
67
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
67
68
|
"@typescript-eslint/parser": "^4.33.0",
|
|
68
69
|
"@vitejs/plugin-vue": "^4.3.1",
|
|
@@ -70,12 +71,13 @@
|
|
|
70
71
|
"@vue/eslint-config-typescript": "^7.0.0",
|
|
71
72
|
"@vue/test-utils": "^2.4.6",
|
|
72
73
|
"@vue/vue3-jest": "^29.2.6",
|
|
74
|
+
"babel-jest": "29.7.0",
|
|
73
75
|
"eslint": "^7.32.0",
|
|
74
76
|
"eslint-config-prettier": "^8.10.0",
|
|
75
77
|
"eslint-plugin-prettier": "^3.4.1",
|
|
76
78
|
"eslint-plugin-vue": "^7.20.0",
|
|
77
|
-
"jest": "^
|
|
78
|
-
"jest-environment-jsdom": "^
|
|
79
|
+
"jest": "^29.7.0",
|
|
80
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
79
81
|
"pnpm": "^10.13.1",
|
|
80
82
|
"prettier": "^2.8.8",
|
|
81
83
|
"rimraf": "^5.0.1",
|