import Me from"./BZI46otX.js";import xe from"./BkokwQMS.js";import{bZ as Xt,d as nt,r as E,b_ as V,s as B,b8 as bt,bT as Qt,e as ot,f as yt,o as G,h as _e,bi as Ce,b$ as Ee,c0 as Pe,j as Le,c1 as it,c2 as K,V as te,a as Oe,c3 as Ae,c4 as X,i as Q,C as St,bj as Se,g as P,aR as Ie,t as It,x as Te,F as Ze,y as je,n as Be,c5 as Tt,_ as De}from"./BxiWQxwE.js";import"./DbZappjS.js";import"./D4QCjprS.js";var ct,Zt;function Re(){return Zt||(Zt=1,ct=function i(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var s,r,o;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!i(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=s;r--!==0;){var a=o[r];if(!i(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}),ct}var Ne=Re();const W=Xt(Ne),jt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ut=1,z=8;class Mt{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(r!==ut)throw new Error(`Got v${r} data when expected v${ut}.`);const o=jt[s&15];if(!o)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new Mt(c,a,o,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=jt.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,n=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,z,t),this.coords=new this.ArrayType(this.data,z+c+n,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(z+a+c+n),this.ids=new this.IndexArrayType(this.data,z,t),this.coords=new this.ArrayType(this.data,z+c+n,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ut<<4)+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return vt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:c}=this,n=[0,o.length-1,0],h=[];for(;n.length;){const u=n.pop()||0,l=n.pop()||0,d=n.pop()||0;if(l-d<=c){for(let g=d;g<=l;g++){const w=a[2*g],f=a[2*g+1];w>=t&&w<=s&&f>=e&&f<=r&&h.push(o[g])}continue}const p=d+l>>1,m=a[2*p],y=a[2*p+1];m>=t&&m<=s&&y>=e&&y<=r&&h.push(o[p]),(u===0?t<=m:e<=y)&&(n.push(d),n.push(p-1),n.push(1-u)),(u===0?s>=m:r>=y)&&(n.push(p+1),n.push(l),n.push(1-u))}return h}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:a}=this,c=[0,r.length-1,0],n=[],h=s*s;for(;c.length;){const u=c.pop()||0,l=c.pop()||0,d=c.pop()||0;if(l-d<=a){for(let g=d;g<=l;g++)Bt(o[2*g],o[2*g+1],t,e)<=h&&n.push(r[g]);continue}const p=d+l>>1,m=o[2*p],y=o[2*p+1];Bt(m,y,t,e)<=h&&n.push(r[p]),(u===0?t-s<=m:e-s<=y)&&(c.push(d),c.push(p-1),c.push(1-u)),(u===0?t+s>=m:e+s>=y)&&(c.push(p+1),c.push(l),c.push(1-u))}return n}}function vt(i,t,e,s,r,o){if(r-s<=e)return;const a=s+r>>1;ee(i,t,a,s,r,o),vt(i,t,e,s,a-1,1-o),vt(i,t,e,a+1,r,1-o)}function ee(i,t,e,s,r,o){for(;r>s;){if(r-s>600){const h=r-s+1,u=e-s+1,l=Math.log(h),d=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*d*(h-d)/h)*(u-h/2<0?-1:1),m=Math.max(s,Math.floor(e-u*d/h+p)),y=Math.min(r,Math.floor(e+(h-u)*d/h+p));ee(i,t,e,m,y,o)}const a=t[2*e+o];let c=s,n=r;for(q(i,t,s,e),t[2*r+o]>a&&q(i,t,s,r);c<n;){for(q(i,t,c,n),c++,n--;t[2*c+o]<a;)c++;for(;t[2*n+o]>a;)n--}t[2*s+o]===a?q(i,t,s,n):(n++,q(i,t,n,r)),n<=e&&(s=n+1),e<=n&&(r=n-1)}}function q(i,t,e,s){ht(i,e,s),ht(t,2*e,2*s),ht(t,2*e+1,2*s+1)}function ht(i,t,e){const s=i[t];i[t]=i[e],i[e]=s}function Bt(i,t,e,s){const r=i-e,o=t-s;return r*r+o*o}const Ue={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:i=>i},Dt=Math.fround||(i=>t=>(i[0]=+t,i[0]))(new Float32Array(1)),T=2,A=3,dt=4,L=5,se=6;class re{constructor(t){this.options=Object.assign(Object.create(Ue),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;const a=[];for(let n=0;n<t.length;n++){const h=t[n];if(!h.geometry)continue;const[u,l]=h.geometry.coordinates,d=Dt(tt(u)),p=Dt(et(l));a.push(d,p,1/0,n,-1,1),this.options.reduce&&a.push(0)}let c=this.trees[r+1]=this._createTree(a);e&&console.timeEnd(o);for(let n=r;n>=s;n--){const h=+Date.now();c=this.trees[n]=this._createTree(this._cluster(c,n)),e&&console.log("z%d: %d clusters in %dms",n,c.numItems,+Date.now()-h)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let o=t[2]===180?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,o=180;else if(s>o){const l=this.getClusters([s,r,180,a],e),d=this.getClusters([-180,r,o,a],e);return l.concat(d)}const c=this.trees[this._limitZoom(e)],n=c.range(tt(s),et(a),tt(o),et(r)),h=c.data,u=[];for(const l of n){const d=this.stride*l;u.push(h[d+L]>1?Rt(h,d,this.clusterProps):this.points[h[d+A]])}return u}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(r);const a=o.data;if(e*this.stride>=a.length)throw new Error(r);const c=this.options.radius/(this.options.extent*Math.pow(2,s-1)),n=a[e*this.stride],h=a[e*this.stride+1],u=o.within(n,h,c),l=[];for(const d of u){const p=d*this.stride;a[p+dt]===t&&l.push(a[p+L]>1?Rt(a,p,this.clusterProps):this.points[a[p+A]])}if(l.length===0)throw new Error(r);return l}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:a,radius:c}=this.options,n=c/a,h=(s-n)/o,u=(s+1+n)/o,l={features:[]};return this._addTileFeatures(r.range((e-n)/o,h,(e+1+n)/o,u),r.data,e,s,o,l),e===0&&this._addTileFeatures(r.range(1-n/o,h,1,u),r.data,o,s,o,l),e===o-1&&this._addTileFeatures(r.range(0,h,n/o,u),r.data,-1,s,o,l),l.features.length?l:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,s.length!==1)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,o){const a=this.getChildren(e);for(const c of a){const n=c.properties;if(n&&n.cluster?o+n.point_count<=r?o+=n.point_count:o=this._appendLeaves(t,n.cluster_id,s,r,o):o<r?o++:t.push(c),t.length===s)break}return o}_createTree(t){const e=new Mt(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,o,a){for(const c of t){const n=c*this.stride,h=e[n+L]>1;let u,l,d;if(h)u=oe(e,n,this.clusterProps),l=e[n],d=e[n+1];else{const y=this.points[e[n+A]];u=y.properties;const[g,w]=y.geometry.coordinates;l=tt(g),d=et(w)}const p={type:1,geometry:[[Math.round(this.options.extent*(l*o-s)),Math.round(this.options.extent*(d*o-r))]],tags:u};let m;h||this.options.generateId?m=e[n+A]:m=this.points[e[n+A]].id,m!==void 0&&(p.id=m),a.features.push(p)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:o,minPoints:a}=this.options,c=s/(r*Math.pow(2,e)),n=t.data,h=[],u=this.stride;for(let l=0;l<n.length;l+=u){if(n[l+T]<=e)continue;n[l+T]=e;const d=n[l],p=n[l+1],m=t.within(n[l],n[l+1],c),y=n[l+L];let g=y;for(const w of m){const f=w*u;n[f+T]>e&&(g+=n[f+L])}if(g>y&&g>=a){let w=d*y,f=p*y,v,k=-1;const x=((l/u|0)<<5)+(e+1)+this.points.length;for(const M of m){const b=M*u;if(n[b+T]<=e)continue;n[b+T]=e;const I=n[b+L];w+=n[b]*I,f+=n[b+1]*I,n[b+dt]=x,o&&(v||(v=this._map(n,l,!0),k=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(n,b)))}n[l+dt]=x,h.push(w/g,f/g,1/0,x,-1,g),o&&h.push(k)}else{for(let w=0;w<u;w++)h.push(n[l+w]);if(g>1)for(const w of m){const f=w*u;if(!(n[f+T]<=e)){n[f+T]=e;for(let v=0;v<u;v++)h.push(n[f+v])}}}}return h}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+L]>1){const a=this.clusterProps[t[e+se]];return s?Object.assign({},a):a}const r=this.points[t[e+A]].properties,o=this.options.map(r);return s&&o===r?Object.assign({},o):o}}function Rt(i,t,e){return{type:"Feature",id:i[t+A],properties:oe(i,t,e),geometry:{type:"Point",coordinates:[ze(i[t]),qe(i[t+1])]}}}function oe(i,t,e){const s=i[t+L],r=s>=1e4?`${Math.round(s/1e3)}k`:s>=1e3?`${Math.round(s/100)/10}k`:s,o=i[t+se],a=o===-1?{}:Object.assign({},e[o]);return Object.assign(a,{cluster:!0,cluster_id:i[t+A],point_count:s,point_count_abbreviated:r})}function tt(i){return i/360+.5}function et(i){const t=Math.sin(i*Math.PI/180),e=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return e<0?0:e>1?1:e}function ze(i){return(i-.5)*360}function qe(i){const t=(180-i*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Y(i,t){var e={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&t.indexOf(s)<0&&(e[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(i,s[r])&&(e[s[r]]=i[s[r]]);return e}class _{static isAdvancedMarkerAvailable(t){return google.maps.marker&&t.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return this.isAdvancedMarker(t)?!0:t.getVisible()}}class D{constructor({markers:t,position:e}){this.markers=t,e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(this.markers.length===0&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(_.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>_.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(_.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const xt=(i,t,e,s)=>{const r=at(i.getBounds(),t,s);return e.filter(o=>r.contains(_.getPosition(o)))},at=(i,t,e)=>{const{northEast:s,southWest:r}=Fe(i,t),o=ne({northEast:s,southWest:r},e);return ae(o,t)},wt=(i,t,e)=>{const s=at(i,t,e),r=s.getNorthEast(),o=s.getSouthWest();return[o.lng(),o.lat(),r.lng(),r.lat()]},ie=(i,t)=>{const s=(t.lat-i.lat)*Math.PI/180,r=(t.lng-i.lng)*Math.PI/180,o=Math.sin(s/2),a=Math.sin(r/2),c=o*o+Math.cos(i.lat*Math.PI/180)*Math.cos(t.lat*Math.PI/180)*a*a;return 6371*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},Fe=(i,t)=>({northEast:t.fromLatLngToDivPixel(i.getNorthEast()),southWest:t.fromLatLngToDivPixel(i.getSouthWest())}),ne=({northEast:i,southWest:t},e)=>(i.x+=e,i.y-=e,t.x-=e,t.y+=e,{northEast:i,southWest:t}),ae=({northEast:i,southWest:t},e)=>{const s=e.fromDivPixelToLatLng(t),r=e.fromDivPixelToLatLng(i);return new google.maps.LatLngBounds(s,r)};class lt{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return le(t)}}class _t extends lt{constructor(t){var{viewportPadding:e=60}=t,s=Y(t,["viewportPadding"]);super(s),this.viewportPadding=60,this.viewportPadding=e}calculate({markers:t,map:e,mapCanvasProjection:s}){return e.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t}),changed:!1}:{clusters:this.cluster({markers:xt(e,s,t,this.viewportPadding),map:e,mapCanvasProjection:s})}}}const le=i=>i.map(e=>new D({position:_.getPosition(e),markers:[e]}));class $e extends _t{constructor(t){var{maxDistance:e=4e4,gridSize:s=40}=t,r=Y(t,["maxDistance","gridSize"]);super(r),this.clusters=[],this.state={zoom:-1},this.maxDistance=e,this.gridSize=s}calculate({markers:t,map:e,mapCanvasProjection:s}){const r={zoom:e.getZoom()};let o=!1;return this.state.zoom>=this.maxZoom&&r.zoom>=this.maxZoom||(o=!W(this.state,r)),this.state=r,e.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t}),changed:o}:{clusters:this.cluster({markers:xt(e,s,t,this.viewportPadding),map:e,mapCanvasProjection:s})}}cluster({markers:t,map:e,mapCanvasProjection:s}){return this.clusters=[],t.forEach(r=>{this.addToClosestCluster(r,e,s)}),this.clusters}addToClosestCluster(t,e,s){let r=this.maxDistance,o=null;for(let a=0;a<this.clusters.length;a++){const c=this.clusters[a],n=ie(c.bounds.getCenter().toJSON(),_.getPosition(t).toJSON());n<r&&(r=n,o=c)}if(o&&at(o.bounds,s,this.gridSize).contains(_.getPosition(t)))o.push(t);else{const a=new D({markers:[t]});this.clusters.push(a)}}}class Ge extends lt{constructor(t){var e=Y(t,[]);super(e)}calculate({markers:t,map:e,mapCanvasProjection:s}){return{clusters:this.cluster({markers:t,map:e,mapCanvasProjection:s}),changed:!1}}cluster(t){return this.noop(t)}}class ce extends lt{constructor(t){var{maxZoom:e,radius:s=60}=t,r=Y(t,["maxZoom","radius"]);super({maxZoom:e}),this.state={zoom:-1},this.superCluster=new re(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(t){let e=!1;const s={zoom:t.map.getZoom()};if(!W(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=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(r)}return e||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(e=!W(this.state,s)),this.state=s,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new D({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new D({markers:[r],position:_.getPosition(r)})}}class Ve extends _t{constructor(t){var{maxZoom:e,radius:s=60,viewportPadding:r=60}=t,o=Y(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:e,viewportPadding:r}),this.superCluster=new re(Object.assign({maxZoom:this.maxZoom,radius:s},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const e={zoom:Math.round(t.map.getZoom()),view:wt(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let s=!W(this.state,e);if(!W(t.markers,this.markers)){s=!0,this.markers=[...t.markers];const r=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(r)}return s&&(this.clusters=this.cluster(t),this.state=e),{clusters:this.clusters,changed:s}}cluster({map:t,mapCanvasProjection:e}){const s={zoom:Math.round(t.getZoom()),view:wt(t.getBounds(),e,this.viewportPadding)};return this.superCluster.getClusters(s.view,s.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new D({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new D({markers:[r],position:_.getPosition(r)})}}class ue{constructor(t,e){this.markers={sum:t.length};const s=e.map(o=>o.count),r=s.reduce((o,a)=>o+a,0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class he{render({count:t,position:e},s,r){const a=`<svg fill="${t>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
<circle cx="120" cy="120" opacity=".6" r="70" />
<circle cx="120" cy="120" opacity=".3" r="90" />
<circle cx="120" cy="120" opacity=".2" r="110" />
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>
</svg>`,c=`Cluster of ${t} markers`,n=Number(google.maps.Marker.MAX_ZINDEX)+t;if(_.isAdvancedMarkerAvailable(r)){const l=new DOMParser().parseFromString(a,"image/svg+xml").documentElement;l.setAttribute("transform","translate(0 25)");const d={map:r,position:e,zIndex:n,title:c,content:l};return new google.maps.marker.AdvancedMarkerElement(d)}const h={position:e,zIndex:n,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 Ke(i,t){for(let e in t.prototype)i.prototype[e]=t.prototype[e]}class Ct{constructor(){Ke(Ct,google.maps.OverlayView)}}var N;(function(i){i.CLUSTERING_BEGIN="clusteringbegin",i.CLUSTERING_END="clusteringend",i.CLUSTER_CLICK="click"})(N||(N={}));const de=(i,t,e)=>{e.fitBounds(t.bounds)};class We extends Ct{constructor({map:t,markers:e=[],algorithmOptions:s={},algorithm:r=new ce(s),renderer:o=new he,onClusterClick:a=de}){super(),this.markers=[...e],this.clusters=[],this.algorithm=r,this.renderer=o,this.onClusterClick=a,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(s=>{this.addMarker(s,!0)}),e||this.render()}removeMarker(t,e){const s=this.markers.indexOf(t);return s===-1?!1:(_.setMap(t,null),this.markers.splice(s,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach(r=>{s=this.removeMarker(r,!0)||s}),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,N.CLUSTERING_BEGIN,this);const{clusters:e,changed:s}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(s||s==null){const r=new Set;for(const a of e)a.markers.length==1&&r.add(a.markers[0]);const o=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?r.has(a.marker)||_.setMap(a.marker,null):o.push(a.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>o.forEach(a=>_.setMap(a,null)))}google.maps.event.trigger(this,N.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(t=>_.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new ue(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(s=>{s.markers.length===1?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,t,e),s.markers.forEach(r=>_.setMap(r,null)),this.onClusterClick&&s.marker.addListener("click",r=>{google.maps.event.trigger(this,N.CLUSTER_CLICK,s),this.onClusterClick(r,s,e)})),_.setMap(s.marker,e)})}}const He=Object.freeze(Object.defineProperty({__proto__:null,AbstractAlgorithm:lt,AbstractViewportAlgorithm:_t,Cluster:D,ClusterStats:ue,DefaultRenderer:he,GridAlgorithm:$e,MarkerClusterer:We,get MarkerClustererEvents(){return N},MarkerUtils:_,NoopAlgorithm:Ge,SuperClusterAlgorithm:ce,SuperClusterViewportAlgorithm:Ve,defaultOnClusterClickHandler:de,distanceBetweenPoints:ie,extendBoundsToPaddedViewport:at,extendPixelBounds:ne,filterMarkersToPaddedViewport:xt,getPaddedViewport:wt,noop:le,pixelBoundsToLatLngBounds:ae},Symbol.toStringTag,{value:"Module"}));var pt,Nt;function Je(){if(Nt)return pt;Nt=1;const i=Math.atan2,t=Math.cos,e=Math.sin,s=Math.sqrt,r=Math.PI,o=6378137;function a(u){return u*u}function c(u){return u*r/180}function n(u){return a(e(u/2))}function h(u,l){const d=c(Array.isArray(u)?u[1]:u.latitude??u.lat),p=c(Array.isArray(l)?l[1]:l.latitude??l.lat),m=c(Array.isArray(u)?u[0]:u.longitude??u.lng??u.lon),y=c(Array.isArray(l)?l[0]:l.longitude??l.lng??l.lon),g=n(p-d)+t(d)*t(p)*n(y-m);return 2*o*i(s(g),s(1-g))}return pt=h,pt}var Ye=Je();const Xe=Xt(Ye);(function(){try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".mapdiv[data-v-dbf82c40]{width:100%;height:100%}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(i)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var Qe=Object.defineProperty,ts=(i,t,e)=>t in i?Qe(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Ut=(i,t,e)=>(ts(i,typeof t!="symbol"?t+"":t,e),e);const Et=Symbol("map"),Pt=Symbol("api"),es=Symbol("marker"),pe=Symbol("markerCluster"),me=Symbol("CustomMarker"),ss=Symbol("mapTilesLoaded"),fe=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function rs(i,t,e,s){function r(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function c(u){try{h(s.next(u))}catch(l){a(l)}}function n(u){try{h(s.throw(u))}catch(l){a(l)}}function h(u){u.done?o(u.value):r(u.value).then(c,n)}h((s=s.apply(i,[])).next())})}var os=function i(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var s,r,o;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!i(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=s;r--!==0;){var a=o[r];if(!i(t[a],e[a]))return!1}return!0}return t!==t&&e!==e};const zt="__googleMapsScriptId";var R;(function(i){i[i.INITIALIZED=0]="INITIALIZED",i[i.LOADING=1]="LOADING",i[i.SUCCESS=2]="SUCCESS",i[i.FAILURE=3]="FAILURE"})(R||(R={}));class j{constructor({apiKey:t,authReferrerPolicy:e,channel:s,client:r,id:o=zt,language:a,libraries:c=[],mapIds:n,nonce:h,region:u,retries:l=3,url:d="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=e,this.channel=s,this.client=r,this.id=o||zt,this.language=a,this.libraries=c,this.mapIds=n,this.nonce=h,this.region=u,this.retries=l,this.url=d,this.version=p,j.instance){if(!os(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?R.FAILURE:this.done?R.SUCCESS:this.loading?R.LOADING:R.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+="?callback=__googleMapsCallback",this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`&region=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((t,e)=>{this.loadCallback(s=>{s?e(s.error):t(window.google)})})}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,e;if(document.getElementById(this.id)){this.callback();return}const s={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(s).forEach(o=>!s[o]&&delete s[o]),!((e=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.maps)===null||e===void 0)&&e.importLibrary||(o=>{let a,c,n,h="The Google Maps JavaScript API",u="google",l="importLibrary",d="__ib__",p=document,m=window;m=m[u]||(m[u]={});const y=m.maps||(m.maps={}),g=new Set,w=new URLSearchParams,f=()=>a||(a=new Promise((v,k)=>rs(this,void 0,void 0,function*(){var x;yield c=p.createElement("script"),c.id=this.id,w.set("libraries",[...g]+"");for(n in o)w.set(n.replace(/[A-Z]/g,M=>"_"+M[0].toLowerCase()),o[n]);w.set("callback",u+".maps."+d),c.src=this.url+"?"+w,y[d]=v,c.onerror=()=>a=k(Error(h+" could not load.")),c.nonce=this.nonce||((x=p.querySelector("script[nonce]"))===null||x===void 0?void 0:x.nonce)||"",p.head.append(c)})));y[l]?console.warn(h+" only loads once. Ignoring:",o):y[l]=(v,...k)=>g.add(v)&&f().then(()=>y[l](v,...k))})(s);const r=this.libraries.map(o=>this.importLibrary(o));r.length||r.push(this.importLibrary("core")),Promise.all(r).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(t){if(this.errors.push(t),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=t,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(t=>{t(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 is(i){return class extends i.OverlayView{constructor(t){super(),Ut(this,"element"),Ut(this,"opts");const{element:e,...s}=t;this.element=e,this.opts=s,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof i.LatLng?this.opts.position:new i.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const t=this.element;return t.style.display!=="none"&&t.style.visibility!=="hidden"&&(t.style.opacity===""||Number(t.style.opacity)>.01)}onAdd(){if(!this.element)return;const t=this.getPanes();t&&t.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const t=this.getProjection(),e=t==null?void 0:t.fromLatLngToDivPixel(this.getPosition());if(e){this.element.style.position="absolute";const s=this.element.offsetHeight,r=this.element.offsetWidth;let o,a;switch(this.opts.anchorPoint){case"TOP_CENTER":o=e.x-r/2,a=e.y;break;case"BOTTOM_CENTER":o=e.x-r/2,a=e.y-s;break;case"LEFT_CENTER":o=e.x,a=e.y-s/2;break;case"RIGHT_CENTER":o=e.x-r,a=e.y-s/2;break;case"TOP_LEFT":o=e.x,a=e.y;break;case"TOP_RIGHT":o=e.x-r,a=e.y;break;case"BOTTOM_LEFT":o=e.x,a=e.y-s;break;case"BOTTOM_RIGHT":o=e.x-r,a=e.y-s;break;default:o=e.x-r/2,a=e.y-s/2}this.element.style.left=o+"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(t){const{element:e,...s}=t;this.element=e,this.opts=s,this.draw()}}}let qt;const Ft=["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"],ns=nt({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},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},nonce:{type:String,default:""}},emits:Ft,setup(i,{emit:t}){const e=E(),s=E(!1),r=E(),o=E(),a=E(!1);K(Et,r),K(Pt,o),K(ss,a);const c=()=>{const l={...i};Object.keys(l).forEach(m=>{l[m]===void 0&&delete l[m]});const d=m=>{var y;return m?{position:(y=o.value)==null?void 0:y.ControlPosition[m]}:{}},p={scaleControlOptions:i.scaleControlStyle?{style:i.scaleControlStyle}:{},panControlOptions:d(i.panControlPosition),zoomControlOptions:d(i.zoomControlPosition),rotateControlOptions:d(i.rotateControlPosition),streetViewControlOptions:d(i.streetViewControlPosition),fullscreenControlOptions:d(i.fullscreenControlPosition),disableDefaultUI:i.disableDefaultUi};return{...l,...p}},n=B([o,r],([l,d])=>{const p=l,m=d;p&&m&&(p.event.addListenerOnce(m,"tilesloaded",()=>{a.value=!0}),setTimeout(n,0))},{immediate:!0}),h=()=>{try{const{apiKey:l,region:d,version:p,language:m,libraries:y,nonce:g}=i;qt=new j({apiKey:l,region:d,version:p,language:m,libraries:y,nonce:g})}catch(l){console.error(l)}},u=l=>{o.value=it(l.maps),r.value=it(new l.maps.Map(e.value,c()));const d=is(o.value);o.value[me]=d,Ft.forEach(m=>{var y;(y=r.value)==null||y.addListener(m,g=>t(m,g))}),s.value=!0;const p=Object.keys(i).filter(m=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(m)).map(m=>Qt(i,m));B([()=>i.center,()=>i.zoom,...p],([m,y],[g,w])=>{var f,v,k;const{center:x,zoom:M,...b}=c();(f=r.value)==null||f.setOptions(b),y!==void 0&&y!==w&&((v=r.value)==null||v.setZoom(y));const I=!g||m.lng!==g.lng||m.lat!==g.lat;m&&I&&((k=r.value)==null||k.panTo(m))})};return Le(()=>{i.apiPromise&&i.apiPromise instanceof Promise?i.apiPromise.then(u):(h(),qt.load().then(u))}),bt(()=>{var l;a.value=!1,r.value&&((l=o.value)==null||l.event.clearInstanceListeners(r.value))}),{mapRef:e,ready:s,map:r,api:o,mapTilesLoaded:a}}}),as=(i,t)=>{const e=i.__vccOpts||i;for(const[s,r]of t)e[s]=r;return e},ls={ref:"mapRef",class:"mapdiv"};function cs(i,t,e,s,r,o){return G(),yt("div",null,[_e("div",ls,null,512),Ce(i.$slots,"default",Ee(Pe({ready:i.ready,map:i.map,api:i.api,mapTilesLoaded:i.mapTilesLoaded})),void 0,!0)])}const us=as(ns,[["render",cs],["__scopeId","data-v-dbf82c40"]]);function hs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ds=function i(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var s,r,o;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!i(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=s;r--!==0;){var a=o[r];if(!i(t[a],e[a]))return!1}return!0}return t!==t&&e!==e};const H=hs(ds),ps=(i,t,e,s)=>{const r=E(),o=V(Et,E()),a=V(Pt,E()),c=V(pe,E()),n=ot(()=>!!(c.value&&a.value&&(r.value instanceof a.value.Marker||r.value instanceof a.value[me])));return B([o,e],(h,[u,l])=>{var d,p,m;const y=!H(e.value,l)||o.value!==u;!o.value||!a.value||!y||(r.value?(r.value.setOptions(e.value),n.value&&((d=c.value)==null||d.removeMarker(r.value),(p=c.value)==null||p.addMarker(r.value))):(r.value=it(new a.value[i](e.value)),n.value?(m=c.value)==null||m.addMarker(r.value):r.value.setMap(o.value),t.forEach(g=>{var w;(w=r.value)==null||w.addListener(g,f=>s(g,f))})))},{immediate:!0}),bt(()=>{var h,u;r.value&&((h=a.value)==null||h.event.clearInstanceListeners(r.value),n.value?(u=c.value)==null||u.removeMarker(r.value):r.value.setMap(null))}),r},$t=["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"],Gt=nt({name:"Marker",props:{options:{type:Object,required:!0}},emits:$t,setup(i,{emit:t,expose:e,slots:s}){const r=Qt(i,"options"),o=ps("Marker",$t,r,t);return K(es,o),e({marker:o}),()=>{var a;return(a=s.default)==null?void 0:a.call(s)}}});fe.concat(["bounds_changed"]);fe.concat(["center_changed","radius_changed"]);const Vt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],mt=1,F=8;class Lt{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(r!==mt)throw new Error(`Got v${r} data when expected v${mt}.`);const o=Vt[s&15];if(!o)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new Lt(c,a,o,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=Vt.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,n=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,F,t),this.coords=new this.ArrayType(this.data,F+c+n,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(F+a+c+n),this.ids=new this.IndexArrayType(this.data,F,t),this.coords=new this.ArrayType(this.data,F+c+n,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(mt<<4)+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return kt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:c}=this,n=[0,o.length-1,0],h=[];for(;n.length;){const u=n.pop()||0,l=n.pop()||0,d=n.pop()||0;if(l-d<=c){for(let g=d;g<=l;g++){const w=a[2*g],f=a[2*g+1];w>=t&&w<=s&&f>=e&&f<=r&&h.push(o[g])}continue}const p=d+l>>1,m=a[2*p],y=a[2*p+1];m>=t&&m<=s&&y>=e&&y<=r&&h.push(o[p]),(u===0?t<=m:e<=y)&&(n.push(d),n.push(p-1),n.push(1-u)),(u===0?s>=m:r>=y)&&(n.push(p+1),n.push(l),n.push(1-u))}return h}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:a}=this,c=[0,r.length-1,0],n=[],h=s*s;for(;c.length;){const u=c.pop()||0,l=c.pop()||0,d=c.pop()||0;if(l-d<=a){for(let g=d;g<=l;g++)Kt(o[2*g],o[2*g+1],t,e)<=h&&n.push(r[g]);continue}const p=d+l>>1,m=o[2*p],y=o[2*p+1];Kt(m,y,t,e)<=h&&n.push(r[p]),(u===0?t-s<=m:e-s<=y)&&(c.push(d),c.push(p-1),c.push(1-u)),(u===0?t+s>=m:e+s>=y)&&(c.push(p+1),c.push(l),c.push(1-u))}return n}}function kt(i,t,e,s,r,o){if(r-s<=e)return;const a=s+r>>1;ge(i,t,a,s,r,o),kt(i,t,e,s,a-1,1-o),kt(i,t,e,a+1,r,1-o)}function ge(i,t,e,s,r,o){for(;r>s;){if(r-s>600){const h=r-s+1,u=e-s+1,l=Math.log(h),d=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*d*(h-d)/h)*(u-h/2<0?-1:1),m=Math.max(s,Math.floor(e-u*d/h+p)),y=Math.min(r,Math.floor(e+(h-u)*d/h+p));ge(i,t,e,m,y,o)}const a=t[2*e+o];let c=s,n=r;for($(i,t,s,e),t[2*r+o]>a&&$(i,t,s,r);c<n;){for($(i,t,c,n),c++,n--;t[2*c+o]<a;)c++;for(;t[2*n+o]>a;)n--}t[2*s+o]===a?$(i,t,s,n):(n++,$(i,t,n,r)),n<=e&&(s=n+1),e<=n&&(r=n-1)}}function $(i,t,e,s){ft(i,e,s),ft(t,2*e,2*s),ft(t,2*e+1,2*s+1)}function ft(i,t,e){const s=i[t];i[t]=i[e],i[e]=s}function Kt(i,t,e,s){const r=i-e,o=t-s;return r*r+o*o}const ms={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:i=>i},Wt=Math.fround||(i=>t=>(i[0]=+t,i[0]))(new Float32Array(1)),Z=2,S=3,gt=4,O=5,ye=6;class ve{constructor(t){this.options=Object.assign(Object.create(ms),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;const a=[];for(let n=0;n<t.length;n++){const h=t[n];if(!h.geometry)continue;const[u,l]=h.geometry.coordinates,d=Wt(st(u)),p=Wt(rt(l));a.push(d,p,1/0,n,-1,1),this.options.reduce&&a.push(0)}let c=this.trees[r+1]=this._createTree(a);e&&console.timeEnd(o);for(let n=r;n>=s;n--){const h=+Date.now();c=this.trees[n]=this._createTree(this._cluster(c,n)),e&&console.log("z%d: %d clusters in %dms",n,c.numItems,+Date.now()-h)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let o=t[2]===180?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,o=180;else if(s>o){const l=this.getClusters([s,r,180,a],e),d=this.getClusters([-180,r,o,a],e);return l.concat(d)}const c=this.trees[this._limitZoom(e)],n=c.range(st(s),rt(a),st(o),rt(r)),h=c.data,u=[];for(const l of n){const d=this.stride*l;u.push(h[d+O]>1?Ht(h,d,this.clusterProps):this.points[h[d+S]])}return u}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(r);const a=o.data;if(e*this.stride>=a.length)throw new Error(r);const c=this.options.radius/(this.options.extent*Math.pow(2,s-1)),n=a[e*this.stride],h=a[e*this.stride+1],u=o.within(n,h,c),l=[];for(const d of u){const p=d*this.stride;a[p+gt]===t&&l.push(a[p+O]>1?Ht(a,p,this.clusterProps):this.points[a[p+S]])}if(l.length===0)throw new Error(r);return l}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:a,radius:c}=this.options,n=c/a,h=(s-n)/o,u=(s+1+n)/o,l={features:[]};return this._addTileFeatures(r.range((e-n)/o,h,(e+1+n)/o,u),r.data,e,s,o,l),e===0&&this._addTileFeatures(r.range(1-n/o,h,1,u),r.data,o,s,o,l),e===o-1&&this._addTileFeatures(r.range(0,h,n/o,u),r.data,-1,s,o,l),l.features.length?l:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,s.length!==1)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,o){const a=this.getChildren(e);for(const c of a){const n=c.properties;if(n&&n.cluster?o+n.point_count<=r?o+=n.point_count:o=this._appendLeaves(t,n.cluster_id,s,r,o):o<r?o++:t.push(c),t.length===s)break}return o}_createTree(t){const e=new Lt(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,o,a){for(const c of t){const n=c*this.stride,h=e[n+O]>1;let u,l,d;if(h)u=we(e,n,this.clusterProps),l=e[n],d=e[n+1];else{const y=this.points[e[n+S]];u=y.properties;const[g,w]=y.geometry.coordinates;l=st(g),d=rt(w)}const p={type:1,geometry:[[Math.round(this.options.extent*(l*o-s)),Math.round(this.options.extent*(d*o-r))]],tags:u};let m;h||this.options.generateId?m=e[n+S]:m=this.points[e[n+S]].id,m!==void 0&&(p.id=m),a.features.push(p)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:o,minPoints:a}=this.options,c=s/(r*Math.pow(2,e)),n=t.data,h=[],u=this.stride;for(let l=0;l<n.length;l+=u){if(n[l+Z]<=e)continue;n[l+Z]=e;const d=n[l],p=n[l+1],m=t.within(n[l],n[l+1],c),y=n[l+O];let g=y;for(const w of m){const f=w*u;n[f+Z]>e&&(g+=n[f+O])}if(g>y&&g>=a){let w=d*y,f=p*y,v,k=-1;const x=((l/u|0)<<5)+(e+1)+this.points.length;for(const M of m){const b=M*u;if(n[b+Z]<=e)continue;n[b+Z]=e;const I=n[b+O];w+=n[b]*I,f+=n[b+1]*I,n[b+gt]=x,o&&(v||(v=this._map(n,l,!0),k=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(n,b)))}n[l+gt]=x,h.push(w/g,f/g,1/0,x,-1,g),o&&h.push(k)}else{for(let w=0;w<u;w++)h.push(n[l+w]);if(g>1)for(const w of m){const f=w*u;if(!(n[f+Z]<=e)){n[f+Z]=e;for(let v=0;v<u;v++)h.push(n[f+v])}}}}return h}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+O]>1){const a=this.clusterProps[t[e+ye]];return s?Object.assign({},a):a}const r=this.points[t[e+S]].properties,o=this.options.map(r);return s&&o===r?Object.assign({},o):o}}function Ht(i,t,e){return{type:"Feature",id:i[t+S],properties:we(i,t,e),geometry:{type:"Point",coordinates:[fs(i[t]),gs(i[t+1])]}}}function we(i,t,e){const s=i[t+O],r=s>=1e4?`${Math.round(s/1e3)}k`:s>=1e3?`${Math.round(s/100)/10}k`:s,o=i[t+ye],a=o===-1?{}:Object.assign({},e[o]);return Object.assign(a,{cluster:!0,cluster_id:i[t+S],point_count:s,point_count_abbreviated:r})}function st(i){return i/360+.5}function rt(i){const t=Math.sin(i*Math.PI/180),e=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return e<0?0:e>1?1:e}function fs(i){return(i-.5)*360}function gs(i){const t=(180-i*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Ot(i,t){var e={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&t.indexOf(s)<0&&(e[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(i,s[r])&&(e[s[r]]=i[s[r]]);return e}class C{static isAdvancedMarkerAvailable(t){return google.maps.marker&&t.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return this.isAdvancedMarker(t)?!0:t.getVisible()}}class J{constructor({markers:t,position:e}){this.markers=t,e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(this.markers.length===0&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(C.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>C.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(C.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const ys=(i,t,e,s)=>{const r=ke(i.getBounds(),t,s);return e.filter(o=>r.contains(C.getPosition(o)))},ke=(i,t,e)=>{const{northEast:s,southWest:r}=vs(i,t),o=ws({northEast:s,southWest:r},e);return ks(o,t)},Jt=(i,t,e)=>{const s=ke(i,t,e),r=s.getNorthEast(),o=s.getSouthWest();return[o.lng(),o.lat(),r.lng(),r.lat()]},vs=(i,t)=>({northEast:t.fromLatLngToDivPixel(i.getNorthEast()),southWest:t.fromLatLngToDivPixel(i.getSouthWest())}),ws=({northEast:i,southWest:t},e)=>(i.x+=e,i.y-=e,t.x-=e,t.y+=e,{northEast:i,southWest:t}),ks=({northEast:i,southWest:t},e)=>{const s=e.fromDivPixelToLatLng(t),r=e.fromDivPixelToLatLng(i);return new google.maps.LatLngBounds(s,r)};class be{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Ms(t)}}class bs extends be{constructor(t){var{viewportPadding:e=60}=t,s=Ot(t,["viewportPadding"]);super(s),this.viewportPadding=60,this.viewportPadding=e}calculate({markers:t,map:e,mapCanvasProjection:s}){return e.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t}),changed:!1}:{clusters:this.cluster({markers:ys(e,s,t,this.viewportPadding),map:e,mapCanvasProjection:s})}}}const Ms=i=>i.map(t=>new J({position:C.getPosition(t),markers:[t]}));class xs extends be{constructor(t){var{maxZoom:e,radius:s=60}=t,r=Ot(t,["maxZoom","radius"]);super({maxZoom:e}),this.state={zoom:-1},this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(t){let e=!1;const s={zoom:t.map.getZoom()};if(!H(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(o=>{const a=C.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(e=!H(this.state,s)),this.state=s,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new J({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new J({markers:[r],position:C.getPosition(r)})}}class _s extends bs{constructor(t){var{maxZoom:e,radius:s=60,viewportPadding:r=60}=t,o=Ot(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:e,viewportPadding:r}),this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:s},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const e={zoom:Math.round(t.map.getZoom()),view:Jt(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let s=!H(this.state,e);if(!H(t.markers,this.markers)){s=!0,this.markers=[...t.markers];const r=this.markers.map(o=>{const a=C.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(r)}return s&&(this.clusters=this.cluster(t),this.state=e),{clusters:this.clusters,changed:s}}cluster({map:t,mapCanvasProjection:e}){const s={zoom:Math.round(t.getZoom()),view:Jt(t.getBounds(),e,this.viewportPadding)};return this.superCluster.getClusters(s.view,s.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new J({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new J({markers:[r],position:C.getPosition(r)})}}class Cs{constructor(t,e){this.markers={sum:t.length};const s=e.map(o=>o.count),r=s.reduce((o,a)=>o+a,0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class Es{render({count:t,position:e},s,r){const o=`<svg fill="${t>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
<circle cx="120" cy="120" opacity=".6" r="70" />
<circle cx="120" cy="120" opacity=".3" r="90" />
<circle cx="120" cy="120" opacity=".2" r="110" />
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>
</svg>`,a=`Cluster of ${t} markers`,c=Number(google.maps.Marker.MAX_ZINDEX)+t;if(C.isAdvancedMarkerAvailable(r)){const h=document.createElement("div");h.innerHTML=o;const u=h.firstElementChild;u.setAttribute("transform","translate(0 25)");const l={map:r,position:e,zIndex:c,title:a,content:u};return new google.maps.marker.AdvancedMarkerElement(l)}const n={position:e,zIndex:c,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(o)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(n)}}function Ps(i,t){for(let e in t.prototype)i.prototype[e]=t.prototype[e]}class At{constructor(){Ps(At,google.maps.OverlayView)}}var U;(function(i){i.CLUSTERING_BEGIN="clusteringbegin",i.CLUSTERING_END="clusteringend",i.CLUSTER_CLICK="click"})(U||(U={}));const Ls=(i,t,e)=>{e.fitBounds(t.bounds)};class Os extends At{constructor({map:t,markers:e=[],algorithmOptions:s={},algorithm:r=new xs(s),renderer:o=new Es,onClusterClick:a=Ls}){super(),this.markers=[...e],this.clusters=[],this.algorithm=r,this.renderer=o,this.onClusterClick=a,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(s=>{this.addMarker(s,!0)}),e||this.render()}removeMarker(t,e){const s=this.markers.indexOf(t);return s===-1?!1:(C.setMap(t,null),this.markers.splice(s,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach(r=>{s=this.removeMarker(r,!0)||s}),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,U.CLUSTERING_BEGIN,this);const{clusters:e,changed:s}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(s||s==null){const r=new Set;for(const a of e)a.markers.length==1&&r.add(a.markers[0]);const o=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?r.has(a.marker)||C.setMap(a.marker,null):o.push(a.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>o.forEach(a=>C.setMap(a,null)))}google.maps.event.trigger(this,U.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(t=>C.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new Cs(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(s=>{s.markers.length===1?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,t,e),s.markers.forEach(r=>C.setMap(r,null)),this.onClusterClick&&s.marker.addListener("click",r=>{google.maps.event.trigger(this,U.CLUSTER_CLICK,s),this.onClusterClick(r,s,e)})),C.setMap(s.marker,e)})}}const Yt=Object.values(U),As=nt({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Yt,setup(i,{emit:t,expose:e,slots:s}){const r=E(),o=V(Et,E()),a=V(Pt,E());return K(pe,r),B(o,()=>{o.value&&(r.value=it(new Os({map:o.value,algorithm:new _s(i.options.algorithmOptions??{}),...i.options})),Yt.forEach(c=>{var n;(n=r.value)==null||n.addListener(c,h=>t(c,h))}))},{immediate:!0}),bt(()=>{var c;r.value&&((c=a.value)==null||c.event.clearInstanceListeners(r.value),r.value.clearMarkers(),r.value.setMap(null))}),e({markerCluster:r}),()=>{var c;return(c=s.default)==null?void 0:c.call(s)}}}),Ss=()=>({options:{apiKey:te().public.googleMapsApiKey,scrollwheel:!1,disableDefaultUI:!0,mapTypeControl:!1,clickableIcons:!1,streetViewControl:!1,fullscreenControl:!1,scaleControl:!1,zoomControl:!1,styles:[{featureType:"road",elementType:"geometry",stylers:[{lightness:100},{visibility:"simplified"}]},{featureType:"water",elementType:"geometry",stylers:[{visibility:"on"},{color:"#C6E2FF"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{color:"#C5E3BF"}]},{featureType:"poi.business",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#D1D1B8"}]}]}}),Is={class:"stores-map"},Ts=nt({__name:"map",props:{searchInput:{type:String,required:!1,default:""},stores:{type:Array,required:!0},center:{type:Object,required:!1,default:()=>Ie},hasSearched:{type:Boolean,required:!1,default:!1}},emits:["visibleStores","update-location","error-location"],setup(i,{emit:t}){const e=i,s=te(),{$gtm:r}=Oe(),o=E(),{options:a}=Ss(),{SuperClusterAlgorithm:c}=He;o.value=new c({radius:140,maxZoom:16,minPoints:4});const n=t,h=E(X.DEFAULT),u=E(),l={default:`${s.public.imageUrl}marker.svg`,nieuw:`${s.public.imageUrl}marker.svg`},d=ot(()=>e.stores.map(f=>{var v,k,x,M;return{position:{lat:(v=f==null?void 0:f.storeDetail)==null?void 0:v.latitude,lng:(k=f==null?void 0:f.storeDetail)==null?void 0:k.longitude},icon:l[((M=(x=f.storeDetail)==null?void 0:x.label)==null?void 0:M.toLowerCase())??"default"]||l.default,title:f==null?void 0:f.street,city:f==null?void 0:f.city,storeId:f==null?void 0:f.storeId,animation:2,to:f==null?void 0:f.to}})),p=ot(()=>({...a,center:e.center,zoom:h.value})),m={render:({count:f,position:v})=>new google.maps.Marker({position:v,label:{text:String(f),color:"#ffffff",fontSize:"1.4rem",fontFamily:"var(--body-font-bold)"},icon:{url:`${s.public.imageUrl}cluster.svg`},zIndex:1e3})},y=ot(()=>e.hasSearched?(f,v)=>f.distance-v.distance:(f,v)=>f.city.localeCompare(v.city??"")),g=async f=>{f.to&&(r("stores.map_pointer_selection",{location_name:f.title,vestigings_id:f.storeId}),await Be(f.to))},w=()=>{var M;const f=(M=u.value)==null?void 0:M.map;if(!f)return;const v=f.getBounds(),k={lat:f.getCenter().lat(),lng:f.getCenter().lng()},x=e.stores.filter(b=>v==null?void 0:v.contains(new google.maps.LatLng(b.storeDetail.latitude,b.storeDetail.longitude))).map(b=>({...b,distance:Xe(k,{lat:b.storeDetail.latitude,lng:b.storeDetail.longitude})})).sort(y.value);n("visibleStores",x)};return Ae(()=>{(window==null?void 0:window.innerWidth)<=700&&(h.value=X.MOBILE)}),B(()=>e.stores,()=>{w()}),B(()=>e.center,()=>{var k;const f=(window==null?void 0:window.innerWidth)<=700?Tt.MOBILE:Tt.DEFAULT;((k=u.value)==null?void 0:k.map).setZoom(f)}),B(()=>e.searchInput,()=>{e.searchInput===""&&setTimeout(()=>{var k;const f=window.innerWidth<=700?X.MOBILE:X.DEFAULT;((k=u.value)==null?void 0:k.map).setZoom(f)},100)}),(f,v)=>{const k=Me,x=xe;return G(),yt("div",Is,[Q(P(us),Se({ref_key:"mapRef",ref:u,style:{width:"100%",height:"100%"}},P(p),{onBounds_changed:w}),{default:St(()=>[Q(P(As),{options:{renderer:m,algorithm:P(o)}},{default:St(()=>[(G(!0),yt(Ze,null,je(P(d),M=>(G(),It(P(Gt),{key:M.storeId,options:M,onClick:b=>g(M)},null,8,["options","onClick"]))),128))]),_:1},8,["options"]),i.hasSearched?(G(),It(P(Gt),{key:0,options:{position:i.center,icon:{url:`${P(s).public.imageUrl}marker.svg`,scaledSize:{width:50,height:50,equals:()=>!1}},zIndex:9999}},null,8,["options"])):Te("",!0)]),_:1},16),Q(k,{onZoomIn:v[0]||(v[0]=M=>h.value++),onZoomOut:v[1]||(v[1]=M=>h.value--)}),Q(x,{onUpdateLocation:v[2]||(v[2]=M=>n("update-location",M)),onError:v[3]||(v[3]=M=>n("error-location",M))})])}}}),Ns=De(Ts,[["__scopeId","data-v-c088fabe"]]);export{Ns as default};
