vue3-google-map 0.16.0 → 0.17.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020-present, Inocan Group
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # vue3-google-map
2
+ ![Build Status](https://github.com/inocan-group/vue3-google-map/actions/workflows/build.yml/badge.svg)
3
+ [![License](https://img.shields.io/github/license/inocan-group/vue3-google-map)](https://github.com/inocan-group/vue3-google-map/blob/develop/LICENSE)
2
4
 
3
5
  > Composable components for easy use of Google Maps with Vue 3
4
6
 
@@ -35,17 +37,21 @@ Note: Please refer to the [documentation site](https://vue3-google-map.netlify.a
35
37
  ```bash
36
38
  npm install vue3-google-map
37
39
  # OR
38
- yarn add vue3-google-map
40
+ pnpm add vue3-google-map
39
41
  ```
40
42
 
41
43
  #### CDN
42
44
 
43
- Include the following script tag in your `index.html` (make sure to include it after Vue 3).
45
+ Include the following script tag in your `index.html` (make sure to include it after Vue 3's global build).
44
46
 
45
47
  ```html
46
48
  <script src="https://unpkg.com/vue3-google-map"></script>
47
49
  ```
48
50
 
51
+ All the map components are available on the `Vue3GoogleMap` global variable.
52
+
53
+ [Codepen demo](https://codepen.io/husamibrahim/pen/poQXZbR)
54
+
49
55
  ### Your First Map
50
56
 
51
57
  To construct a map using `vue3-google-map` you'll need to use the base `GoogleMap` component which receives your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key), styles (e.g. setting width and height), and any [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) to configure your map ([see this](https://github.com/inocan-group/vue3-google-map/blob/develop/src/components/GoogleMap.vue#L57-L218) for all the supported `MapOptions`).
package/dist/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.appendChild(document.createTextNode(".mapdiv[data-v-7d660dd5]{width:100%;height:100%}.info-window-wrapper[data-v-45a4606d]{display:none}.mapdiv .info-window-wrapper[data-v-45a4606d]{display:inline-block}.custom-marker-wrapper[data-v-c7599d50]{display:none}.mapdiv .custom-marker-wrapper[data-v-c7599d50]{display:inline-block}")),document.head.appendChild(d)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- "use strict";var ce=Object.defineProperty;var ue=(r,e,t)=>e in r?ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var B=(r,e,t)=>(ue(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),b=Symbol("map"),O=Symbol("api"),re=Symbol("marker"),se=Symbol("markerCluster"),T=Symbol("CustomMarker"),ie=Symbol("mapTilesLoaded"),M=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];var de=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var o,n,s;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!r(e[n],t[n]))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(s=Object.keys(e),o=s.length,o!==Object.keys(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;for(n=o;n--!==0;){var l=s[n];if(!r(e[l],t[l]))return!1}return!0}return e!==e&&t!==t};const G="__googleMapsScriptId";class _{constructor({apiKey:e,channel:t,client:o,id:n=G,libraries:s=[],language:l,region:c,version:a,mapIds:p,nonce:d,retries:u=3,url:f="https://maps.googleapis.com/maps/api/js"}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=a,this.apiKey=e,this.channel=t,this.client=o,this.id=n||G,this.libraries=s,this.language=l,this.region=c,this.mapIds=p,this.nonce=d,this.retries=u,this.url=f,_.instance){if(!de(this.options,_.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(_.instance.options)}`);return _.instance}_.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}}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+=`?callback=${this.CALLBACK}`,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+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(o=>{o?t(o.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}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.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),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||(this.loading=!0,this.setCallback(),this.setScript())}}}function pe(r){return class extends r.OverlayView{constructor(o){super();B(this,"element");B(this,"opts");const{element:n,...s}=o;this.element=n,this.opts=s,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof r.LatLng?this.opts.position:new r.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const o=this.element;return o.style.display!=="none"&&o.style.visibility!=="hidden"&&(o.style.opacity===""||Number(o.style.opacity)>.01)}onAdd(){if(!this.element)return;const o=this.getPanes();o&&o.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const n=this.getProjection().fromLatLngToDivPixel(this.getPosition());if(n){this.element.style.position="absolute";const s=this.element.offsetHeight,l=this.element.offsetWidth;let c,a;switch(this.opts.anchorPoint){case"TOP_CENTER":c=n.x-l/2,a=n.y;break;case"BOTTOM_CENTER":c=n.x-l/2,a=n.y-s;break;case"LEFT_CENTER":c=n.x,a=n.y-s/2;break;case"RIGHT_CENTER":c=n.x-l,a=n.y-s/2;break;case"TOP_LEFT":c=n.x,a=n.y;break;case"TOP_RIGHT":c=n.x-l,a=n.y;break;case"BOTTOM_LEFT":c=n.x,a=n.y-s;break;case"BOTTOM_RIGHT":c=n.x-l,a=n.y-s;break;default:c=n.x-l/2,a=n.y-s/2}this.element.style.left=c+"px",this.element.style.top=a+"px",this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(o){this.opts=o,this.draw()}}}let V;const H=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","heading_changed","idle","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","resize","rightclick","tilesloaded","tilt_changed","zoom_changed"],he=i.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},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},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},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}},emits:H,setup(r,{emit:e}){const t=i.ref(),o=i.ref(!1),n=i.ref(),s=i.ref(),l=i.ref(!1);i.provide(b,n),i.provide(O,s),i.provide(ie,l);const c=()=>{const u={...r};Object.keys(u).forEach(g=>{u[g]===void 0&&delete u[g]});const m=g=>{var v;return g?{position:(v=s.value)==null?void 0:v.ControlPosition[g]}:{}},h={scaleControlOptions:r.scaleControlStyle?{style:r.scaleControlStyle}:{},panControlOptions:m(r.panControlPosition),zoomControlOptions:m(r.zoomControlPosition),rotateControlOptions:m(r.rotateControlPosition),streetViewControlOptions:m(r.streetViewControlPosition),fullscreenControlOptions:m(r.fullscreenControlPosition),disableDefaultUI:r.disableDefaultUi};return{...u,...h}},a=i.watch([s,n],([u,f])=>{const m=u,h=f;m&&h&&(m.event.addListenerOnce(h,"tilesloaded",()=>{l.value=!0}),setTimeout(a,0))},{immediate:!0}),p=()=>{try{const{apiKey:u,region:f,version:m,language:h,libraries:g}=r;V=new _({apiKey:u,region:f,version:m,language:h,libraries:g})}catch(u){console.error(u)}},d=u=>{s.value=i.markRaw(u.maps),n.value=i.markRaw(new u.maps.Map(t.value,c()));const f=pe(s.value);s.value[T]=f,H.forEach(h=>{var g;(g=n.value)==null||g.addListener(h,v=>e(h,v))}),o.value=!0;const m=Object.keys(r).filter(h=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(h)).map(h=>i.toRef(r,h));i.watch([()=>r.center,()=>r.zoom,...m],([h,g],[v,y])=>{var D,U,F;const{center:k,zoom:P,...C}=c();(D=n.value)==null||D.setOptions(C),g!==void 0&&g!==y&&((U=n.value)==null||U.setZoom(g));const I=!v||h.lng!==v.lng||h.lat!==v.lat;h&&I&&((F=n.value)==null||F.panTo(h))})};return i.onMounted(()=>{r.apiPromise&&r.apiPromise instanceof Promise?r.apiPromise.then(d):(p(),V.load().then(d))}),i.onBeforeUnmount(()=>{var u;l.value=!1,n.value&&((u=s.value)==null||u.event.clearInstanceListeners(n.value))}),{mapRef:t,ready:o,map:n,api:s,mapTilesLoaded:l}}});const q=(r,e)=>{const t=r.__vccOpts||r;for(const[o,n]of e)t[o]=n;return t},fe={ref:"mapRef",class:"mapdiv"};function me(r,e,t,o,n,s){return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",fe,null,512),i.renderSlot(r.$slots,"default",i.normalizeProps(i.guardReactiveProps({ready:r.ready,map:r.map,api:r.api,mapTilesLoaded:r.mapTilesLoaded})),void 0,!0)])}const ge=q(he,[["render",me],["__scopeId","data-v-7d660dd5"]]);function ve(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ye=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var o,n,s;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!r(e[n],t[n]))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(s=Object.keys(e),o=s.length,o!==Object.keys(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;for(n=o;n--!==0;){var l=s[n];if(!r(e[l],t[l]))return!1}return!0}return e!==e&&t!==t};const E=ve(ye),Ce=r=>r==="Marker",ke=r=>r===T,x=(r,e,t,o)=>{const n=i.ref(),s=i.inject(b,i.ref()),l=i.inject(O,i.ref()),c=i.inject(se,i.ref()),a=i.computed(()=>!!(c.value&&l.value&&(n.value instanceof l.value.Marker||n.value instanceof l.value[T])));return i.watch([s,t],(p,[d,u])=>{var m,h,g;const f=!E(t.value,u)||s.value!==d;!s.value||!l.value||!f||(n.value?(n.value.setOptions(t.value),a.value&&((m=c.value)==null||m.removeMarker(n.value),(h=c.value)==null||h.addMarker(n.value))):(Ce(r)?n.value=i.markRaw(new l.value[r](t.value)):ke(r)?n.value=i.markRaw(new l.value[r](t.value)):n.value=i.markRaw(new l.value[r]({...t.value,map:s.value})),a.value?(g=c.value)==null||g.addMarker(n.value):n.value.setMap(s.value),e.forEach(v=>{var y;(y=n.value)==null||y.addListener(v,k=>o(v,k))})))},{immediate:!0}),i.onBeforeUnmount(()=>{var p,d;n.value&&((p=l.value)==null||p.event.clearInstanceListeners(n.value),a.value?(d=c.value)==null||d.removeMarker(n.value):n.value.setMap(null))}),n},K=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],_e=i.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:K,setup(r,{emit:e,expose:t,slots:o}){const n=i.toRef(r,"options"),s=x("Marker",K,n,e);return i.provide(re,s),t({marker:s}),()=>{var l;return(l=o.default)==null?void 0:l.call(o)}}}),we=i.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:M,setup(r,{emit:e}){const t=i.toRef(r,"options");return{polyline:x("Polyline",M,t,e)}},render:()=>null}),Me=i.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:M,setup(r,{emit:e}){const t=i.toRef(r,"options");return{polygon:x("Polygon",M,t,e)}},render:()=>null}),W=M.concat(["bounds_changed"]),be=i.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:W,setup(r,{emit:e}){const t=i.toRef(r,"options");return{rectangle:x("Rectangle",W,t,e)}},render:()=>null}),J=M.concat(["center_changed","radius_changed"]),Oe=i.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:J,setup(r,{emit:e}){const t=i.toRef(r,"options");return{circle:x("Circle",J,t,e)}},render:()=>null}),xe=i.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(r,{emit:e}){const t=i.ref(null),o=i.inject(b,i.ref()),n=i.inject(O,i.ref()),s=i.inject(ie,i.ref(!1)),l=i.ref(!1),c=i.watch([s,n,t],([d,u,f])=>{u&&d&&f&&(a(r.position),l.value=!0,e("content:loaded"),setTimeout(c,0))},{immediate:!0}),a=d=>{if(o.value&&n.value&&t.value){const u=n.value.ControlPosition[d];o.value.controls[u].push(t.value)}},p=d=>{if(o.value&&n.value){let u=null;const f=n.value.ControlPosition[d];o.value.controls[f].forEach((m,h)=>{m===t.value&&(u=h)}),u!==null&&o.value.controls[f].removeAt(u)}};return i.onBeforeUnmount(()=>p(r.position)),i.watch(()=>r.position,(d,u)=>{p(u),a(d)}),i.watch(()=>r.index,d=>{d&&t.value&&(t.value.index=r.index)}),{controlRef:t,showContent:l}}}),Pe={ref:"controlRef"};function Se(r,e,t,o,n,s){return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pe,[i.renderSlot(r.$slots,"default")],512)),[[i.vShow,r.showContent]])}const Le=q(xe,[["render",Se]]),X=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],Ee=i.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})}},emits:X,setup(r,{slots:e,emit:t,expose:o}){const n=i.ref(),s=i.ref(),l=i.inject(b,i.ref()),c=i.inject(O,i.ref()),a=i.inject(re,i.ref());let p;const d=i.computed(()=>{var m;return(m=e.default)==null?void 0:m.call(e).some(h=>h.type!==i.Comment)}),u=m=>{var h;return(h=n.value)==null?void 0:h.open({map:l.value,anchor:a.value,...m})},f=()=>{var m;return(m=n.value)==null?void 0:m.close()};return i.onMounted(()=>{i.watch([l,()=>r.options],([m,h],[g,v])=>{const y=!E(h,v)||l.value!==g;l.value&&c.value&&y&&(n.value?(n.value.setOptions({...h,content:d.value?s.value:h.content}),a.value||u()):(n.value=i.markRaw(new c.value.InfoWindow({...h,content:d.value?s.value:h.content})),a.value?p=a.value.addListener("click",()=>{u()}):u(),X.forEach(k=>{var P;(P=n.value)==null||P.addListener(k,C=>t(k,C))})))},{immediate:!0})}),i.onBeforeUnmount(()=>{var m;p&&p.remove(),n.value&&((m=c.value)==null||m.event.clearInstanceListeners(n.value),f())}),o({infoWindow:n,open:u,close:f}),{infoWindow:n,infoWindowRef:s,hasSlotContent:d,open:u,close:f}}});const Ie={key:0,class:"info-window-wrapper"};function je(r,e,t,o,n,s){return r.hasSlotContent?(i.openBlock(),i.createElementBlock("div",Ie,[i.createElementVNode("div",i.mergeProps({ref:"infoWindowRef"},r.$attrs),[i.renderSlot(r.$slots,"default",{},void 0,!0)],16)])):i.createCommentVNode("",!0)}const $e=q(Ee,[["render",je],["__scopeId","data-v-45a4606d"]]);function N(r,e,t,o,n,s){if(n-o<=t)return;const l=o+n>>1;ae(r,e,l,o,n,s%2),N(r,e,t,o,l-1,s+1),N(r,e,t,l+1,n,s+1)}function ae(r,e,t,o,n,s){for(;n>o;){if(n-o>600){const p=n-o+1,d=t-o+1,u=Math.log(p),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(p-f)/p)*(d-p/2<0?-1:1),h=Math.max(o,Math.floor(t-d*f/p+m)),g=Math.min(n,Math.floor(t+(p-d)*f/p+m));ae(r,e,t,h,g,s)}const l=e[2*t+s];let c=o,a=n;for(S(r,e,o,t),e[2*n+s]>l&&S(r,e,o,n);c<a;){for(S(r,e,c,a),c++,a--;e[2*c+s]<l;)c++;for(;e[2*a+s]>l;)a--}e[2*o+s]===l?S(r,e,o,a):(a++,S(r,e,a,n)),a<=t&&(o=a+1),t<=a&&(n=a-1)}}function S(r,e,t,o){A(r,t,o),A(e,2*t,2*o),A(e,2*t+1,2*o+1)}function A(r,e,t){const o=r[e];r[e]=r[t],r[t]=o}function Re(r,e,t,o,n,s,l){const c=[0,r.length-1,0],a=[];let p,d;for(;c.length;){const u=c.pop(),f=c.pop(),m=c.pop();if(f-m<=l){for(let v=m;v<=f;v++)p=e[2*v],d=e[2*v+1],p>=t&&p<=n&&d>=o&&d<=s&&a.push(r[v]);continue}const h=Math.floor((m+f)/2);p=e[2*h],d=e[2*h+1],p>=t&&p<=n&&d>=o&&d<=s&&a.push(r[h]);const g=(u+1)%2;(u===0?t<=p:o<=d)&&(c.push(m),c.push(h-1),c.push(g)),(u===0?n>=p:s>=d)&&(c.push(h+1),c.push(f),c.push(g))}return a}function Te(r,e,t,o,n,s){const l=[0,r.length-1,0],c=[],a=n*n;for(;l.length;){const p=l.pop(),d=l.pop(),u=l.pop();if(d-u<=s){for(let v=u;v<=d;v++)Y(e[2*v],e[2*v+1],t,o)<=a&&c.push(r[v]);continue}const f=Math.floor((u+d)/2),m=e[2*f],h=e[2*f+1];Y(m,h,t,o)<=a&&c.push(r[f]);const g=(p+1)%2;(p===0?t-n<=m:o-n<=h)&&(l.push(u),l.push(f-1),l.push(g)),(p===0?t+n>=m:o+n>=h)&&(l.push(f+1),l.push(d),l.push(g))}return c}function Y(r,e,t,o){const n=r-t,s=e-o;return n*n+s*s}const qe=r=>r[0],Be=r=>r[1];class Q{constructor(e,t=qe,o=Be,n=64,s=Float64Array){this.nodeSize=n,this.points=e;const l=e.length<65536?Uint16Array:Uint32Array,c=this.ids=new l(e.length),a=this.coords=new s(e.length*2);for(let p=0;p<e.length;p++)c[p]=p,a[2*p]=t(e[p]),a[2*p+1]=o(e[p]);N(c,a,n,0,c.length-1,0)}range(e,t,o,n){return Re(this.ids,this.coords,e,t,o,n,this.nodeSize)}within(e,t,o){return Te(this.ids,this.coords,e,t,o,this.nodeSize)}}const Ae={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r},R=Math.fround||(r=>e=>(r[0]=+e,r[0]))(new Float32Array(1));class Ne{constructor(e){this.options=L(Object.create(Ae),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:t,minZoom:o,maxZoom:n,nodeSize:s}=this.options;t&&console.time("total time");const l=`prepare ${e.length} points`;t&&console.time(l),this.points=e;let c=[];for(let a=0;a<e.length;a++)e[a].geometry&&c.push(ze(e[a],a));this.trees[n+1]=new Q(c,te,ne,s,Float32Array),t&&console.timeEnd(l);for(let a=n;a>=o;a--){const p=+Date.now();c=this._cluster(c,a),this.trees[a]=new Q(c,te,ne,s,Float32Array),t&&console.log("z%d: %d clusters in %dms",a,c.length,+Date.now()-p)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let o=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const l=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,s=180;else if(o>s){const d=this.getClusters([o,n,180,l],t),u=this.getClusters([-180,n,s,l],t);return d.concat(u)}const c=this.trees[this._limitZoom(t)],a=c.range(j(o),$(l),j(s),$(n)),p=[];for(const d of a){const u=c.points[d];p.push(u.numPoints?ee(u):this.points[u.index])}return p}getChildren(e){const t=this._getOriginId(e),o=this._getOriginZoom(e),n="No cluster with the specified id.",s=this.trees[o];if(!s)throw new Error(n);const l=s.points[t];if(!l)throw new Error(n);const c=this.options.radius/(this.options.extent*Math.pow(2,o-1)),a=s.within(l.x,l.y,c),p=[];for(const d of a){const u=s.points[d];u.parentId===e&&p.push(u.numPoints?ee(u):this.points[u.index])}if(p.length===0)throw new Error(n);return p}getLeaves(e,t,o){t=t||10,o=o||0;const n=[];return this._appendLeaves(n,e,t,o,0),n}getTile(e,t,o){const n=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:l,radius:c}=this.options,a=c/l,p=(o-a)/s,d=(o+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((t-a)/s,p,(t+1+a)/s,d),n.points,t,o,s,u),t===0&&this._addTileFeatures(n.range(1-a/s,p,1,d),n.points,s,o,s,u),t===s-1&&this._addTileFeatures(n.range(0,p,a/s,d),n.points,-1,o,s,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const o=this.getChildren(e);if(t++,o.length!==1)break;e=o[0].properties.cluster_id}return t}_appendLeaves(e,t,o,n,s){const l=this.getChildren(t);for(const c of l){const a=c.properties;if(a&&a.cluster?s+a.point_count<=n?s+=a.point_count:s=this._appendLeaves(e,a.cluster_id,o,n,s):s<n?s++:e.push(c),e.length===o)break}return s}_addTileFeatures(e,t,o,n,s,l){for(const c of e){const a=t[c],p=a.numPoints;let d,u,f;if(p)d=le(a),u=a.x,f=a.y;else{const g=this.points[a.index];d=g.properties,u=j(g.geometry.coordinates[0]),f=$(g.geometry.coordinates[1])}const m={type:1,geometry:[[Math.round(this.options.extent*(u*s-o)),Math.round(this.options.extent*(f*s-n))]],tags:d};let h;p?h=a.id:this.options.generateId?h=a.index:this.points[a.index].id&&(h=this.points[a.index].id),h!==void 0&&(m.id=h),l.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const o=[],{radius:n,extent:s,reduce:l,minPoints:c}=this.options,a=n/(s*Math.pow(2,t));for(let p=0;p<e.length;p++){const d=e[p];if(d.zoom<=t)continue;d.zoom=t;const u=this.trees[t+1],f=u.within(d.x,d.y,a),m=d.numPoints||1;let h=m;for(const g of f){const v=u.points[g];v.zoom>t&&(h+=v.numPoints||1)}if(h>m&&h>=c){let g=d.x*m,v=d.y*m,y=l&&m>1?this._map(d,!0):null;const k=(p<<5)+(t+1)+this.points.length;for(const P of f){const C=u.points[P];if(C.zoom<=t)continue;C.zoom=t;const I=C.numPoints||1;g+=C.x*I,v+=C.y*I,C.parentId=k,l&&(y||(y=this._map(d,!0)),l(y,this._map(C)))}d.parentId=k,o.push(Ze(g/h,v/h,k,h,y))}else if(o.push(d),h>1)for(const g of f){const v=u.points[g];v.zoom<=t||(v.zoom=t,o.push(v))}}return o}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t){if(e.numPoints)return t?L({},e.properties):e.properties;const o=this.points[e.index].properties,n=this.options.map(o);return t&&n===o?L({},n):n}}function Ze(r,e,t,o,n){return{x:R(r),y:R(e),zoom:1/0,id:t,parentId:-1,numPoints:o,properties:n}}function ze(r,e){const[t,o]=r.geometry.coordinates;return{x:R(j(t)),y:R($(o)),zoom:1/0,index:e,parentId:-1}}function ee(r){return{type:"Feature",id:r.id,properties:le(r),geometry:{type:"Point",coordinates:[De(r.x),Ue(r.y)]}}}function le(r){const e=r.numPoints,t=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return L(L({},r.properties),{cluster:!0,cluster_id:r.id,point_count:e,point_count_abbreviated:t})}function j(r){return r/360+.5}function $(r){const e=Math.sin(r*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function De(r){return(r-.5)*360}function Ue(r){const e=(180-r*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function L(r,e){for(const t in e)r[t]=e[t];return r}function te(r){return r.x}function ne(r){return r.y}/*! *****************************************************************************
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-174b771e]{width:100%;height:100%}.info-window-wrapper[data-v-45a4606d]{display:none}.mapdiv .info-window-wrapper[data-v-45a4606d]{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 _e=Object.defineProperty;var Ce=(n,e,t)=>e in n?_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var V=(n,e,t)=>(Ce(n,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),R=Symbol("map"),j=Symbol("api"),he=Symbol("marker"),pe=Symbol("markerCluster"),F=Symbol("CustomMarker"),fe=Symbol("mapTilesLoaded"),T=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,9 +12,22 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Fe(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]]);return t}class Z{constructor({markers:e,position:t}){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 this.markers.reduce((e,t)=>e.extend(t.getPosition()),new google.maps.LatLngBounds(this._position,this._position))}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>e.getVisible()).length}push(e){this.markers.push(e)}delete(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}class Ge{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return Ve(e)}}const Ve=r=>r.map(t=>new Z({position:t.getPosition(),markers:[t]}));class He extends Ge{constructor(e){var{maxZoom:t,radius:o=60}=e,n=Fe(e,["maxZoom","radius"]);super({maxZoom:t}),this.superCluster=new Ne(Object.assign({maxZoom:this.maxZoom,radius:o},n)),this.state={zoom:null}}calculate(e){let t=!1;if(!E(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const n=this.markers.map(s=>({type:"Feature",geometry:{type:"Point",coordinates:[s.getPosition().lng(),s.getPosition().lat()]},properties:{marker:s}}));this.superCluster.load(n)}const o={zoom:e.map.getZoom()};return t||this.state.zoom>this.maxZoom&&o.zoom>this.maxZoom||(t=t||!E(this.state,o)),this.state=o,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(this.transformCluster.bind(this))}transformCluster({geometry:{coordinates:[e,t]},properties:o}){if(o.cluster)return new Z({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map(n=>n.properties.marker),position:new google.maps.LatLng({lat:t,lng:e})});{const n=o.marker;return new Z({markers:[n],position:n.getPosition()})}}}class Ke{constructor(e,t){this.markers={sum:e.length};const o=t.map(s=>s.count),n=o.reduce((s,l)=>s+l,0);this.clusters={count:t.length,markers:{mean:n/t.length,sum:n,min:Math.min(...o),max:Math.max(...o)}}}}class We{render({count:e,position:t},o){const n=e>Math.max(10,o.clusters.markers.mean)?"#ff0000":"#0000ff",s=window.btoa(`
16
- <svg fill="${n}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
17
- <circle cx="120" cy="120" opacity=".6" r="70" />
18
- <circle cx="120" cy="120" opacity=".3" r="90" />
19
- <circle cx="120" cy="120" opacity=".2" r="110" />
20
- </svg>`);return new google.maps.Marker({position:t,icon:{url:`data:image/svg+xml;base64,${s}`,scaledSize:new google.maps.Size(45,45)},label:{text:String(e),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:`Cluster of ${e} markers`,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+e})}}function Je(r,e){for(let t in e.prototype)r.prototype[t]=e.prototype[t]}class z{constructor(){Je(z,google.maps.OverlayView)}}var w;(function(r){r.CLUSTERING_BEGIN="clusteringbegin",r.CLUSTERING_END="clusteringend",r.CLUSTER_CLICK="click"})(w||(w={}));const Xe=(r,e,t)=>{t.fitBounds(e.bounds)};class Ye extends z{constructor({map:e,markers:t=[],algorithm:o=new He({}),renderer:n=new We,onClusterClick:s=Xe}){super(),this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=n,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(o=>{this.addMarker(o,!0)}),t||this.render()}removeMarker(e,t){const o=this.markers.indexOf(e);return o===-1?!1:(e.setMap(null),this.markers.splice(o,1),t||this.render(),!0)}removeMarkers(e,t){let o=!1;return e.forEach(n=>{o=this.removeMarker(n,!0)||o}),o&&!t&&this.render(),o}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,w.CLUSTERING_BEGIN,this);const{clusters:t,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});(o||o==null)&&(this.reset(),this.clusters=t,this.renderClusters()),google.maps.event.trigger(this,w.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>e.setMap(null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new Ke(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(o=>{o.markers.length===1?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e),this.onClusterClick&&o.marker.addListener("click",n=>{google.maps.event.trigger(this,w.CLUSTER_CLICK,o),this.onClusterClick(n,o,t)})),o.marker.setMap(t)})}}const oe=Object.values(w),Qe=i.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:oe,setup(r,{emit:e,expose:t,slots:o}){const n=i.ref(),s=i.inject(b,i.ref()),l=i.inject(O,i.ref());return i.provide(se,n),i.watch(s,()=>{s.value&&(n.value=i.markRaw(new Ye({map:s.value,...r.options})),oe.forEach(c=>{var a;(a=n.value)==null||a.addListener(c,p=>e(c,p))}))},{immediate:!0}),i.onBeforeUnmount(()=>{var c;n.value&&((c=l.value)==null||c.event.clearInstanceListeners(n.value),n.value.clearMarkers(),n.value.setMap(null))}),t({markerCluster:n}),()=>{var c;return(c=o.default)==null?void 0:c.call(o)}}}),et=i.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(r,{slots:e,emit:t,expose:o}){const n=i.ref(),s=i.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(p=>p.type!==i.Comment)}),l=i.computed(()=>({...r.options,element:n.value})),c=x(T,[],l,t);return o({customMarker:c}),{customMarkerRef:n,customMarker:c,hasSlotContent:s}}});const tt={key:0,class:"custom-marker-wrapper"};function nt(r,e,t,o,n,s){return r.hasSlotContent?(i.openBlock(),i.createElementBlock("div",tt,[i.createElementVNode("div",i.mergeProps({ref:"customMarkerRef",style:{cursor:r.$attrs.onClick?"pointer":void 0}},r.$attrs),[i.renderSlot(r.$slots,"default",{},void 0,!0)],16)])):i.createCommentVNode("",!0)}const ot=q(et,[["render",nt],["__scopeId","data-v-c7599d50"]]),rt=i.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(r){const e=i.ref(),t=i.inject(b,i.ref()),o=i.inject(O,i.ref());return i.watch([t,()=>r.options],([n,s],[l,c])=>{var p;const a=!E(s,c)||t.value!==l;if(t.value&&o.value&&a){const d=structuredClone(s);if(d.data&&!(d.data instanceof o.value.MVCArray)){const u=o.value.LatLng;d.data=(p=d.data)==null?void 0:p.map(f=>f instanceof u||"location"in f&&(f.location instanceof u||f.location===null)?f:"location"in f?{...f,location:new u(f.location)}:new u(f))}e.value?e.value.setOptions(d):e.value=i.markRaw(new o.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),i.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});exports.Circle=Oe;exports.CustomControl=Le;exports.CustomMarker=ot;exports.GoogleMap=ge;exports.HeatmapLayer=rt;exports.InfoWindow=$e;exports.Marker=_e;exports.MarkerCluster=Qe;exports.Polygon=Me;exports.Polyline=we;exports.Rectangle=be;
15
+ ***************************************************************************** */function be(n,e,t,r){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function c(d){try{h(r.next(d))}catch(u){a(u)}}function i(d){try{h(r.throw(d))}catch(u){a(u)}}function h(d){d.done?o(d.value):s(d.value).then(c,i)}h((r=r.apply(n,e||[])).next())})}var Me=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 a=o[s];if(!n(e[a],t[a]))return!1}return!0}return e!==e&&t!==t};const Q="__googleMapsScriptId";var I;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(I||(I={}));class x{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=Q,language:a,libraries:c=[],mapIds:i,nonce:h,region:d,retries:u=3,url:p="https://maps.googleapis.com/maps/api/js",version:f}){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||Q,this.language=a,this.libraries=c,this.mapIds=i,this.nonce=h,this.region=d,this.retries=u,this.url=p,this.version=f,x.instance){if(!Me(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?I.FAILURE:this.done?I.SUCCESS:this.loading?I.LOADING:I.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",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+=`&region=${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 a,c,i,h="The Google Maps JavaScript API",d="google",u="importLibrary",p="__ib__",f=document,m=window;m=m[d]||(m[d]={});const g=m.maps||(m.maps={}),v=new Set,y=new URLSearchParams,w=()=>a||(a=new Promise((k,C)=>be(this,void 0,void 0,function*(){var M;yield c=f.createElement("script"),c.id=this.id,y.set("libraries",[...v]+"");for(i in o)y.set(i.replace(/[A-Z]/g,L=>"_"+L[0].toLowerCase()),o[i]);y.set("callback",d+".maps."+p),c.src=this.url+"?"+y,g[p]=k,c.onerror=()=>a=C(Error(h+" could not load.")),c.nonce=this.nonce||((M=f.querySelector("script[nonce]"))===null||M===void 0?void 0:M.nonce)||"",f.head.append(c)})));g[u]?console.warn(h+" only loads once. Ignoring:",o):g[u]=(k,...C)=>v.add(k)&&w().then(()=>g[u](k,...C))})(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 a=new ErrorEvent("error",{error:o});this.loadErrorCallback(a)})}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.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||(this.loading=!0,this.setScript())}}}function Ee(n){return class extends n.OverlayView{constructor(r){super();V(this,"element");V(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";const o=this.element.offsetHeight,a=this.element.offsetWidth;let c,i;switch(this.opts.anchorPoint){case"TOP_CENTER":c=s.x-a/2,i=s.y;break;case"BOTTOM_CENTER":c=s.x-a/2,i=s.y-o;break;case"LEFT_CENTER":c=s.x,i=s.y-o/2;break;case"RIGHT_CENTER":c=s.x-a,i=s.y-o/2;break;case"TOP_LEFT":c=s.x,i=s.y;break;case"TOP_RIGHT":c=s.x-a,i=s.y;break;case"BOTTOM_LEFT":c=s.x,i=s.y-o;break;case"BOTTOM_RIGHT":c=s.x-a,i=s.y-o;break;default:c=s.x-a/2,i=s.y-o/2}this.element.style.left=c+"px",this.element.style.top=i+"px",this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`,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 ee;const te=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","heading_changed","idle","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","resize","rightclick","tilesloaded","tilt_changed","zoom_changed"],Pe=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},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},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},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}},emits:te,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),a=l.ref(!1);l.provide(R,s),l.provide(j,o),l.provide(fe,a);const c=()=>{const u={...n};Object.keys(u).forEach(g=>{u[g]===void 0&&delete u[g]});const f=g=>{var v;return g?{position:(v=o.value)==null?void 0:v.ControlPosition[g]}:{}},m={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:f(n.panControlPosition),zoomControlOptions:f(n.zoomControlPosition),rotateControlOptions:f(n.rotateControlPosition),streetViewControlOptions:f(n.streetViewControlPosition),fullscreenControlOptions:f(n.fullscreenControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...m}},i=l.watch([o,s],([u,p])=>{const f=u,m=p;f&&m&&(f.event.addListenerOnce(m,"tilesloaded",()=>{a.value=!0}),setTimeout(i,0))},{immediate:!0}),h=()=>{try{const{apiKey:u,region:p,version:f,language:m,libraries:g}=n;ee=new x({apiKey:u,region:p,version:f,language:m,libraries:g})}catch(u){console.error(u)}},d=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const p=Ee(o.value);o.value[F]=p,te.forEach(m=>{var g;(g=s.value)==null||g.addListener(m,v=>e(m,v))}),r.value=!0;const f=Object.keys(n).filter(m=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(m)).map(m=>l.toRef(n,m));l.watch([()=>n.center,()=>n.zoom,...f],([m,g],[v,y])=>{var L,b,B;const{center:w,zoom:k,...C}=c();(L=s.value)==null||L.setOptions(C),g!==void 0&&g!==y&&((b=s.value)==null||b.setZoom(g));const M=!v||m.lng!==v.lng||m.lat!==v.lat;m&&M&&((B=s.value)==null||B.panTo(m))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(d):(h(),ee.load().then(d))}),l.onBeforeUnmount(()=>{var u;a.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:a}}});const z=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Oe={ref:"mapRef",class:"mapdiv"};function xe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Oe,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 Se=z(Pe,[["render",xe],["__scopeId","data-v-174b771e"]]);function Le(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ie=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 a=o[s];if(!n(e[a],t[a]))return!1}return!0}return e!==e&&t!==t};const S=Le(Ie),Ae=n=>n==="Marker",Te=n=>n===F,$=(n,e,t,r)=>{const s=l.ref(),o=l.inject(R,l.ref()),a=l.inject(j,l.ref()),c=l.inject(pe,l.ref()),i=l.computed(()=>!!(c.value&&a.value&&(s.value instanceof a.value.Marker||s.value instanceof a.value[F])));return l.watch([o,t],(h,[d,u])=>{var f,m,g;const p=!S(t.value,u)||o.value!==d;!o.value||!a.value||!p||(s.value?(s.value.setOptions(t.value),i.value&&((f=c.value)==null||f.removeMarker(s.value),(m=c.value)==null||m.addMarker(s.value))):(Ae(n)?s.value=l.markRaw(new a.value[n](t.value)):Te(n)?s.value=l.markRaw(new a.value[n](t.value)):s.value=l.markRaw(new a.value[n]({...t.value,map:o.value})),i.value?(g=c.value)==null||g.addMarker(s.value):s.value.setMap(o.value),e.forEach(v=>{var y;(y=s.value)==null||y.addListener(v,w=>r(v,w))})))},{immediate:!0}),l.onBeforeUnmount(()=>{var h,d;s.value&&((h=a.value)==null||h.event.clearInstanceListeners(s.value),i.value?(d=c.value)==null||d.removeMarker(s.value):s.value.setMap(null))}),s},re=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],Re=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:re,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=$("Marker",re,s,e);return l.provide(he,o),t({marker:o}),()=>{var a;return(a=r.default)==null?void 0:a.call(r)}}}),je=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:T,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:$("Polyline",T,t,e)}},render:()=>null}),$e=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:T,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:$("Polygon",T,t,e)}},render:()=>null}),se=T.concat(["bounds_changed"]),Be=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:se,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:$("Rectangle",se,t,e)}},render:()=>null}),ne=T.concat(["center_changed","radius_changed"]),qe=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:ne,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:$("Circle",ne,t,e)}},render:()=>null}),Ne=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(R,l.ref()),s=l.inject(j,l.ref()),o=l.inject(fe,l.ref(!1)),a=l.ref(!1),c=l.watch([o,s,t],([d,u,p])=>{u&&d&&p&&(i(n.position),a.value=!0,e("content:loaded"),setTimeout(c,0))},{immediate:!0}),i=d=>{if(r.value&&s.value&&t.value){const u=s.value.ControlPosition[d];r.value.controls[u].push(t.value)}},h=d=>{if(r.value&&s.value){let u=null;const p=s.value.ControlPosition[d];r.value.controls[p].forEach((f,m)=>{f===t.value&&(u=m)}),u!==null&&r.value.controls[p].removeAt(u)}};return l.onBeforeUnmount(()=>h(n.position)),l.watch(()=>n.position,(d,u)=>{h(u),i(d)}),l.watch(()=>n.index,d=>{d&&t.value&&(t.value.index=n.index)}),{controlRef:t,showContent:a}}}),Ze={ref:"controlRef"};function Ue(n,e,t,r,s,o){return l.withDirectives((l.openBlock(),l.createElementBlock("div",Ze,[l.renderSlot(n.$slots,"default")],512)),[[l.vShow,n.showContent]])}const De=z(Ne,[["render",Ue]]),oe=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],Fe=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})}},emits:oe,setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),a=l.inject(R,l.ref()),c=l.inject(j,l.ref()),i=l.inject(he,l.ref());let h;const d=l.computed(()=>{var f;return(f=e.default)==null?void 0:f.call(e).some(m=>m.type!==l.Comment)}),u=f=>{var m;return(m=s.value)==null?void 0:m.open({map:a.value,anchor:i.value,...f})},p=()=>{var f;return(f=s.value)==null?void 0:f.close()};return l.onMounted(()=>{l.watch([a,()=>n.options],([f,m],[g,v])=>{const y=!S(m,v)||a.value!==g;a.value&&c.value&&y&&(s.value?(s.value.setOptions({...m,content:d.value?o.value:m.content}),i.value||u()):(s.value=l.markRaw(new c.value.InfoWindow({...m,content:d.value?o.value:m.content})),i.value?h=i.value.addListener("click",()=>{u()}):u(),oe.forEach(w=>{var k;(k=s.value)==null||k.addListener(w,C=>t(w,C))})))},{immediate:!0})}),l.onBeforeUnmount(()=>{var f;h&&h.remove(),s.value&&((f=c.value)==null||f.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:u,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:d,open:u,close:p}}});const ze={key:0,class:"info-window-wrapper"};function Ve(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",ze,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const Ge=z(Fe,[["render",Ve],["__scopeId","data-v-45a4606d"]]),ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=1,q=8;class J{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!==G)throw new Error(`Got v${s} data when expected v${G}.`);const o=ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new J(c,a,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),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,i=(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,q,e),this.coords=new this.ArrayType(this.data,q+c+i,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(q+a+c+i),this.ids=new this.IndexArrayType(this.data,q,e),this.coords=new this.ArrayType(this.data,q+c+i,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(G<<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 K(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:a,nodeSize:c}=this,i=[0,o.length-1,0],h=[];for(;i.length;){const d=i.pop()||0,u=i.pop()||0,p=i.pop()||0;if(u-p<=c){for(let v=p;v<=u;v++){const y=a[2*v],w=a[2*v+1];y>=e&&y<=r&&w>=t&&w<=s&&h.push(o[v])}continue}const f=p+u>>1,m=a[2*f],g=a[2*f+1];m>=e&&m<=r&&g>=t&&g<=s&&h.push(o[f]),(d===0?e<=m:t<=g)&&(i.push(p),i.push(f-1),i.push(1-d)),(d===0?r>=m:s>=g)&&(i.push(f+1),i.push(u),i.push(1-d))}return h}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:a}=this,c=[0,s.length-1,0],i=[],h=r*r;for(;c.length;){const d=c.pop()||0,u=c.pop()||0,p=c.pop()||0;if(u-p<=a){for(let v=p;v<=u;v++)ae(o[2*v],o[2*v+1],e,t)<=h&&i.push(s[v]);continue}const f=p+u>>1,m=o[2*f],g=o[2*f+1];ae(m,g,e,t)<=h&&i.push(s[f]),(d===0?e-r<=m:t-r<=g)&&(c.push(p),c.push(f-1),c.push(1-d)),(d===0?e+r>=m:t+r>=g)&&(c.push(f+1),c.push(u),c.push(1-d))}return i}}function K(n,e,t,r,s,o){if(s-r<=t)return;const a=r+s>>1;me(n,e,a,r,s,o),K(n,e,t,r,a-1,1-o),K(n,e,t,a+1,s,1-o)}function me(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const h=s-r+1,d=t-r+1,u=Math.log(h),p=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*p*(h-p)/h)*(d-h/2<0?-1:1),m=Math.max(r,Math.floor(t-d*p/h+f)),g=Math.min(s,Math.floor(t+(h-d)*p/h+f));me(n,e,t,m,g,o)}const a=e[2*t+o];let c=r,i=s;for(N(n,e,r,t),e[2*s+o]>a&&N(n,e,r,s);c<i;){for(N(n,e,c,i),c++,i--;e[2*c+o]<a;)c++;for(;e[2*i+o]>a;)i--}e[2*r+o]===a?N(n,e,r,i):(i++,N(n,e,i,s)),i<=t&&(r=i+1),t<=i&&(s=i-1)}}function N(n,e,t,r){H(n,t,r),H(e,2*t,2*r),H(e,2*t+1,2*r+1)}function H(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function ae(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const He={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},le=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),O=2,P=3,W=4,E=5,ge=6;class ve{constructor(e){this.options=Object.assign(Object.create(He),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 a=[];for(let i=0;i<e.length;i++){const h=e[i];if(!h.geometry)continue;const[d,u]=h.geometry.coordinates,p=le(U(d)),f=le(D(u));a.push(p,f,1/0,i,-1,1),this.options.reduce&&a.push(0)}let c=this.trees[s+1]=this._createTree(a);t&&console.timeEnd(o);for(let i=s;i>=r;i--){const h=+Date.now();c=this.trees[i]=this._createTree(this._cluster(c,i)),t&&console.log("z%d: %d clusters in %dms",i,c.numItems,+Date.now()-h)}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 a=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,a],t),p=this.getClusters([-180,s,o,a],t);return u.concat(p)}const c=this.trees[this._limitZoom(t)],i=c.range(U(r),D(a),U(o),D(s)),h=c.data,d=[];for(const u of i){const p=this.stride*u;d.push(h[p+E]>1?ce(h,p,this.clusterProps):this.points[h[p+P]])}return d}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 a=o.data;if(t*this.stride>=a.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),i=a[t*this.stride],h=a[t*this.stride+1],d=o.within(i,h,c),u=[];for(const p of d){const f=p*this.stride;a[f+W]===e&&u.push(a[f+E]>1?ce(a,f,this.clusterProps):this.points[a[f+P]])}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:a,radius:c}=this.options,i=c/a,h=(r-i)/o,d=(r+1+i)/o,u={features:[]};return this._addTileFeatures(s.range((t-i)/o,h,(t+1+i)/o,d),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-i/o,h,1,d),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,h,i/o,d),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 a=this.getChildren(t);for(const c of a){const i=c.properties;if(i&&i.cluster?o+i.point_count<=s?o+=i.point_count:o=this._appendLeaves(e,i.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new J(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,a){for(const c of e){const i=c*this.stride,h=t[i+E]>1;let d,u,p;if(h)d=ye(t,i,this.clusterProps),u=t[i],p=t[i+1];else{const g=this.points[t[i+P]];d=g.properties;const[v,y]=g.geometry.coordinates;u=U(v),p=D(y)}const f={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(p*o-s))]],tags:d};let m;h||this.options.generateId?m=t[i+P]:m=this.points[t[i+P]].id,m!==void 0&&(f.id=m),a.features.push(f)}}_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:a}=this.options,c=r/(s*Math.pow(2,t)),i=e.data,h=[],d=this.stride;for(let u=0;u<i.length;u+=d){if(i[u+O]<=t)continue;i[u+O]=t;const p=i[u],f=i[u+1],m=e.within(i[u],i[u+1],c),g=i[u+E];let v=g;for(const y of m){const w=y*d;i[w+O]>t&&(v+=i[w+E])}if(v>g&&v>=a){let y=p*g,w=f*g,k,C=-1;const M=((u/d|0)<<5)+(t+1)+this.points.length;for(const L of m){const b=L*d;if(i[b+O]<=t)continue;i[b+O]=t;const B=i[b+E];y+=i[b]*B,w+=i[b+1]*B,i[b+W]=M,o&&(k||(k=this._map(i,u,!0),C=this.clusterProps.length,this.clusterProps.push(k)),o(k,this._map(i,b)))}i[u+W]=M,h.push(y/v,w/v,1/0,M,-1,v),o&&h.push(C)}else{for(let y=0;y<d;y++)h.push(i[u+y]);if(v>1)for(const y of m){const w=y*d;if(!(i[w+O]<=t)){i[w+O]=t;for(let k=0;k<d;k++)h.push(i[w+k])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+E]>1){const a=this.clusterProps[e[t+ge]];return r?Object.assign({},a):a}const s=this.points[e[t+P]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function ce(n,e,t){return{type:"Feature",id:n[e+P],properties:ye(n,e,t),geometry:{type:"Point",coordinates:[We(n[e]),Ke(n[e+1])]}}}function ye(n,e,t){const r=n[e+E],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+ge],a=o===-1?{}:Object.assign({},t[o]);return Object.assign(a,{cluster:!0,cluster_id:n[e+P],point_count:r,point_count_abbreviated:s})}function U(n){return n/360+.5}function D(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 We(n){return(n-.5)*360}function Ke(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
16
+ Copyright (c) Microsoft Corporation.
17
+
18
+ Permission to use, copy, modify, and/or distribute this software for any
19
+ purpose with or without fee is hereby granted.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
24
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
+ PERFORMANCE OF THIS SOFTWARE.
28
+ ***************************************************************************** */function Y(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 _{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(e.position.lat&&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,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}}const Je=(n,e,t,r)=>{const s=we(n.getBounds(),e,r);return t.filter(o=>s.contains(_.getPosition(o)))},we=(n,e,t)=>{const{northEast:r,southWest:s}=Ye(n,e),o=Xe({northEast:r,southWest:s},t);return Qe(o,e)},ue=(n,e,t)=>{const r=we(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},Ye=(n,e)=>({northEast:e.fromLatLngToDivPixel(n.getNorthEast()),southWest:e.fromLatLngToDivPixel(n.getSouthWest())}),Xe=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),Qe=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class ke{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return tt(e)}}class et extends ke{constructor(e){var{viewportPadding:t=60}=e,r=Y(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){return t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:Je(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const tt=n=>n.map(t=>new Z({position:_.getPosition(t),markers:[t]}));class rt extends ke{constructor(e){var{maxZoom:t,radius:r=60}=e,s=Y(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1;const r={zoom:e.map.getZoom()};if(!S(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const a=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return t||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(t=!S(this.state,r)),this.state=r,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}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 st extends et{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=Y(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t={zoom:Math.round(e.map.getZoom()),view:ue(e.map.getBounds(),e.mapCanvasProjection,this.viewportPadding)};let r=!S(this.state,t);if(!S(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const a=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster({map:e,mapCanvasProjection:t}){const r={zoom:Math.round(e.getZoom()),view:ue(e.getBounds(),t,this.viewportPadding)};return this.superCluster.getClusters(r.view,r.zoom).map(s=>this.transformCluster(s))}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 nt{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,a)=>o+a,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class ot{render({count:e,position:t},r,s){const a=`<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">
29
+ <circle cx="120" cy="120" opacity=".6" r="70" />
30
+ <circle cx="120" cy="120" opacity=".3" r="90" />
31
+ <circle cx="120" cy="120" opacity=".2" r="110" />
32
+ <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>
33
+ </svg>`,c=`Cluster of ${e} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+e;if(_.isAdvancedMarkerAvailable(s)){const d=document.createElement("div");d.innerHTML=a;const u=d.firstElementChild;u.setAttribute("transform","translate(0 25)");const p={map:s,position:t,zIndex:i,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(p)}const h={position:t,zIndex:i,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(h)}}function it(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class X{constructor(){it(X,google.maps.OverlayView)}}var A;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click"})(A||(A={}));const at=(n,e,t)=>{t.fitBounds(e.bounds)};class lt extends X{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new rt(r),renderer:o=new ot,onClusterClick:a=at}){super(),this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=a,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,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 a of t)a.markers.length==1&&s.add(a.markers[0]);const o=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?s.has(a.marker)||_.setMap(a.marker,null):o.push(a.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(a=>_.setMap(a,null)))}google.maps.event.trigger(this,A.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){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 nt(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>_.setMap(s,null)),this.onClusterClick&&r.marker.addListener("click",s=>{google.maps.event.trigger(this,A.CLUSTER_CLICK,r),this.onClusterClick(s,r,t)})),_.setMap(r.marker,t)})}}const de=Object.values(A),ct=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:de,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.inject(R,l.ref()),a=l.inject(j,l.ref());return l.provide(pe,s),l.watch(o,()=>{o.value&&(s.value=l.markRaw(new lt({map:o.value,algorithm:new st(n.options.algorithmOptions??{}),...n.options})),de.forEach(c=>{var i;(i=s.value)==null||i.addListener(c,h=>e(c,h))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var c;s.value&&((c=a.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)}}}),ut=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 i;return(i=e.default)==null?void 0:i.call(e).some(h=>h.type!==l.Comment)}),a=l.computed(()=>({...n.options,element:s.value})),c=$(F,[],a,t);return r({customMarker:c}),{customMarkerRef:s,customMarker:c,hasSlotContent:o}}});const dt={key:0,class:"custom-marker-wrapper"};function ht(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",dt,[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 pt=z(ut,[["render",ht],["__scopeId","data-v-2d2d343a"]]),ft=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(R,l.ref()),r=l.inject(j,l.ref());return l.watch([t,()=>n.options],([s,o],[a,c])=>{var h;const i=!S(o,c)||t.value!==a;if(t.value&&r.value&&i){const d=structuredClone(o);if(d.data&&!(d.data instanceof r.value.MVCArray)){const u=r.value.LatLng;d.data=(h=d.data)==null?void 0:h.map(p=>p instanceof u||"location"in p&&(p.location instanceof u||p.location===null)?p:"location"in p?{...p,location:new u(p.location)}:new u(p))}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.Circle=qe;exports.CustomControl=De;exports.CustomMarker=pt;exports.GoogleMap=Se;exports.HeatmapLayer=ft;exports.InfoWindow=Ge;exports.Marker=Re;exports.MarkerCluster=ct;exports.Polygon=$e;exports.Polyline=je;exports.Rectangle=Be;