UNPKG

@dcrackel/meyersquaredui

Version:

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

32 lines (28 loc) 292 kB
(function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.MeyerSquaredUI={},b.Vue))})(this,function(b,e){"use strict";const p=(o,t)=>{const r=o.__vccOpts||o;for(const[l,s]of t)r[l]=s;return r},Ye={name:"BaseText",props:{tag:{type:String,default:"p",validator:o=>["h1","h2","h3","h4","h5","h6","p","span","div","label"].includes(o)},smallSize:{type:String,default:null},size:{type:String,default:"md"},color:{type:String,default:"primary"},hoverColor:{type:String,default:null},weight:{type:String,default:"normal",validator:o=>["thin","light","normal","medium","semibold","bold"].includes(o)},font:{type:String,default:"raleway"}},computed:{textClasses(){const o={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl","10xl":"text-10xl","11xl":"text-11xl","12xl":"text-12xl"},t={thin:"font-thin",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},r=this.smallSize&&o[this.smallSize]?o[this.smallSize]:o[this.size]||"",l=this.smallSize&&o[this.size]?`md:${o[this.size]}`:"",s=this.hoverColor?`hover:text-${this.hoverColor}`:"";return`${r} ${l} ${t[this.weight]} text-${this.color} ${s} font-${this.font}`}}};function Ge(o,t,r,l,s,a){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.tag),{class:e.normalizeClass(a.textClasses)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"])}const y=p(Ye,[["render",Ge]]),Ze={name:"Icon",props:{icon:{type:String,required:!0},color:{type:String,default:"primary",validator:o=>["primary","secondary","accent","lineGrey"].includes(o)},size:{type:String,default:"md",validator:o=>["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl"].includes(o)},type:{type:String,default:"fa-solid",validator:o=>["fa-thin","fa-sharp","fa-kit","fa-brands","fa-solid","fa-regular"].includes(o)}},computed:{colorClasses(){return{primary:"text-primary",secondary:"text-secondary",accent:"text-accent",lineGrey:"text-lineGrey"}[this.color]||"text-primary"},sizeClasses(){return{xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl"}[this.size]||"text-base"}}};function Xe(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass([r.type,r.icon,a.colorClasses,a.sizeClasses]),onClick:t[0]||(t[0]=n=>o.$emit("click"))},null,2)}const k=p(Ze,[["render",Xe]]),$e={name:"BaseButton",components:{BaseText:y,Icon:k},props:{label:{type:String,required:!0},altText:{type:String,default:null},size:{type:String,default:"sm"},weight:{type:String,default:"normal"},color:{type:String,default:"primary",validator:o=>["primary","secondary","accent","white"].includes(o)},hoverColor:{type:String,default:null,validator:o=>o===null||["primary","secondary","accent"].includes(o)},backgroundColor:{type:String,default:"primary",validator:o=>["primary","secondary","accent"].includes(o)},border:{type:String,default:"none",validator:o=>["none","primary","secondary","accent","gradient1","gradient2"].includes(o)},padding:{type:String,default:"px-4 py-2"},iconName:{type:String,default:""},iconColor:{type:String,default:"primary",validator:o=>["primary","secondary","accent"].includes(o)},iconSize:{control:{type:"select",options:["xs","sm","md","lg","xl","2xl","3xl"]},description:"Icon size"},iconType:{type:String,default:"fa-solid",validator:o=>["fa-brands","fa-solid","fa-thin","fa-sharp"].includes(o)},align:{type:String,default:"center",validator:o=>["left","center","right","between"].includes(o)}},computed:{paddingClass(){return this.padding},backgroundClass(){return{primary:"bg-primary hover:bg-accent text-secondary hover:text-secondary",secondary:"bg-secondary hover:bg-primary text-primary hover:text-secondary",accent:"bg-accent hover:bg-accent hover:text-secondary",white:"bg-white hover:bg-accent text-primary hover:text-secondary"}[this.backgroundColor]||"bg-primary"},borderClass(){return{none:"",primary:"border border-primary",secondary:"border border-secondary",accent:"border border-accent",gradient1:"border-gradient-rounded-1",gradient2:"border-gradient-rounded-2"}[this.border]||""},alignmentClass(){return{left:"justify-start",center:"justify-center",right:"justify-end",between:"justify-between"}[this.align]||"justify-center"}}},ve=["title","aria-label"];function et(o,t,r,l,s,a){const n=e.resolveComponent("BaseText"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["rounded-md transition duration-300 ease-in-out",a.paddingClass,a.backgroundClass,a.borderClass]),title:r.altText||r.label,"aria-label":r.altText||r.label,onClick:t[0]||(t[0]=i=>o.$emit("buttonClick"))},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center",a.alignmentClass,"space-x-2"])},[e.createVNode(n,{tag:"span",color:"",size:r.size,weight:r.weight},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:1},8,["size","weight"]),e.createVNode(c,{icon:r.iconName,color:r.iconColor,size:r.iconSize,type:r.iconType},null,8,["icon","color","size","type"])],2)],10,ve)}const T=p($e,[["render",et]]),tt={name:"InputField",props:{type:{type:String,default:"text"},placeholder:{type:String,default:"Search"},modelValue:{type:String,default:""},color:{type:String,default:"primary",validator:o=>["primary","secondary"].includes(o)},textSize:{type:String,default:"text-md",validator:o=>["text-sm","text-md","text-lg","text-xl","text-2xl"].includes(o)}},computed:{inputClass(){const o="w-full border-b-2 focus:outline-none focus:border-accent px-2 hover:border-accent duration-300 ease-in-out",t=this.color==="primary"?"bg-primary text-secondary border-secondary placeholder-secondary":"bg-white text-primary border-secondary placeholder-primary",r=this.textSize;return`${o} ${t} ${r}`}}},rt=["type","placeholder","value"];function ot(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("input",{type:r.type,placeholder:r.placeholder,value:r.modelValue,class:e.normalizeClass([a.inputClass]),onInput:t[0]||(t[0]=n=>o.$emit("update:modelValue",n.target.value))},null,42,rt)}const H=p(tt,[["render",ot]]),at={name:"SearchBox",components:{InputField:H,Icon:k},props:{textSize:{type:String,default:"text-md"},iconSize:{type:String,default:"md"},inputColor:{type:String,default:"primary"},iconColor:{type:String,default:"secondary"}},data(){return{searchQuery:""}},methods:{onSearch(){this.$emit("search",this.searchQuery)}}},nt={class:"relative flex items-center w-full max-w-md"};function st(o,t,r,l,s,a){const n=e.resolveComponent("InputField"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(n,{modelValue:s.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=i=>s.searchQuery=i),"text-size":r.textSize,placeholder:"Search",color:r.inputColor},null,8,["modelValue","text-size","color"]),e.createVNode(c,{icon:"fa-search",color:r.iconColor,size:r.iconSize,class:"absolute right-2",onClick:a.onSearch},null,8,["color","size","onClick"])])}const $=p(at,[["render",st]]),lt={name:"Calendar",components:{BaseText:y},props:{tournaments:{type:Array,default:()=>[]}},data(){return{currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]}},computed:{daysInMonth(){const o=new Date(this.currentYear,this.currentMonth+1,0).getDate();return Array.from({length:o},(t,r)=>r+1)},startDay(){const o=new Date(this.currentYear,this.currentMonth,1).getDay();return o===0?6:o-1},monthYear(){return new Date(this.currentYear,this.currentMonth).toLocaleString("default",{month:"long",year:"numeric"})}},methods:{hasTournament(o){const t=`${this.currentYear}-${String(this.currentMonth+1).padStart(2,"0")}-${String(o).padStart(2,"0")}`;return this.tournaments.some(r=>r.date===t)},dayClicked(o){if(this.hasTournament(o)){const t=`${this.currentYear}-${String(this.currentMonth+1).padStart(2,"0")}-${String(o).padStart(2,"0")}`;this.$emit("date-select",t)}},prevMonth(){this.currentMonth===0?(this.currentMonth=11,this.currentYear--):this.currentMonth--},nextMonth(){this.currentMonth===11?(this.currentMonth=0,this.currentYear++):this.currentMonth++}}},it={class:"w-80 h-80 p-6 bg-primary rounded-lg shadow-md"},ct={class:"flex justify-between items-center mb-4"},dt={class:"grid grid-cols-7 gap-1 text-center font-bold text-sm text-gray-600 mb-2"},mt={class:"grid grid-cols-7 gap-1 text-center"},ht=["onClick"];function gt(o,t,r,l,s,a){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",ct,[e.createVNode(n,{tag:"h2",size:"sm",weight:"normal",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.monthYear),1)]),_:1}),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=(...c)=>a.prevMonth&&a.prevMonth(...c)),class:"text-secondary hover:text-accent mr-4"}," < "),e.createElementVNode("button",{onClick:t[1]||(t[1]=(...c)=>a.nextMonth&&a.nextMonth(...c)),class:"text-secondary hover:text-accent"}," > ")])]),e.createElementVNode("div",dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.weekdays,c=>(e.openBlock(),e.createElementBlock("div",{key:c},[e.createVNode(n,{tag:"p",size:"xs",weight:"bold",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)]))),128))]),e.createElementVNode("div",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.startDay,c=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+c}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.daysInMonth,(c,i)=>(e.openBlock(),e.createElementBlock("div",{key:"day-"+c,onClick:d=>a.dayClicked(c),class:e.normalizeClass(["flex justify-center items-center cursor-pointer p-2 rounded-full",{"bg-accent text-white":a.hasTournament(c),"hover:bg-gray-200":a.hasTournament(c),"text-gray-400":!a.hasTournament(c)}])},[e.createVNode(n,{tag:"p",size:"xs",weight:"thin",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)],10,ht))),128))])])}const pt=p(lt,[["render",gt]]);(function(){try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".mapdiv[data-v-d05fc6bc]{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(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var ft=Object.defineProperty,bt=(o,t,r)=>t in o?ft(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,ge=(o,t,r)=>(bt(o,typeof t!="symbol"?t+"":t,r),r);const D=Symbol("map"),j=Symbol("api"),v=Symbol("marker"),ee=Symbol("markerCluster"),Y=Symbol("CustomMarker"),pe=Symbol("mapTilesLoaded"),F=["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 ut(o,t,r,l){function s(a){return a instanceof r?a:new r(function(n){n(a)})}return new(r||(r=Promise))(function(a,n){function c(m){try{d(l.next(m))}catch(h){n(h)}}function i(m){try{d(l.throw(m))}catch(h){n(h)}}function d(m){m.done?a(m.value):s(m.value).then(c,i)}d((l=l.apply(o,[])).next())})}var xt=function o(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var l,s,a;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(s=l;s--!==0;)if(!o(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),l=a.length,l!==Object.keys(r).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=l;s--!==0;){var n=a[s];if(!o(t[n],r[n]))return!1}return!0}return t!==t&&r!==r};const fe="__googleMapsScriptId";var q;(function(o){o[o.INITIALIZED=0]="INITIALIZED",o[o.LOADING=1]="LOADING",o[o.SUCCESS=2]="SUCCESS",o[o.FAILURE=3]="FAILURE"})(q||(q={}));class M{constructor({apiKey:t,authReferrerPolicy:r,channel:l,client:s,id:a=fe,language:n,libraries:c=[],mapIds:i,nonce:d,region:m,retries:h=3,url:g="https://maps.googleapis.com/maps/api/js",version:u}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=r,this.channel=l,this.client=s,this.id=a||fe,this.language=n,this.libraries=c,this.mapIds=i,this.nonce=d,this.region=m,this.retries=h,this.url=g,this.version=u,M.instance){if(!xt(this.options,M.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(M.instance.options)}`);return M.instance}M.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?q.FAILURE:this.done?q.SUCCESS:this.loading?q.LOADING:q.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,r)=>{this.loadCallback(l=>{l?r(l.error):t(window.google)})})}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,r;if(document.getElementById(this.id)){this.callback();return}const l={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(l).forEach(a=>!l[a]&&delete l[a]),!((r=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.maps)===null||r===void 0)&&r.importLibrary||(a=>{let n,c,i,d="The Google Maps JavaScript API",m="google",h="importLibrary",g="__ib__",u=document,f=window;f=f[m]||(f[m]={});const x=f.maps||(f.maps={}),C=new Set,w=new URLSearchParams,N=()=>n||(n=new Promise((S,A)=>ut(this,void 0,void 0,function*(){var E;yield c=u.createElement("script"),c.id=this.id,w.set("libraries",[...C]+"");for(i in a)w.set(i.replace(/[A-Z]/g,_=>"_"+_[0].toLowerCase()),a[i]);w.set("callback",m+".maps."+g),c.src=this.url+"?"+w,x[g]=S,c.onerror=()=>n=A(Error(d+" could not load.")),c.nonce=this.nonce||((E=u.querySelector("script[nonce]"))===null||E===void 0?void 0:E.nonce)||"",u.head.append(c)})));x[h]?console.warn(d+" only loads once. Ignoring:",a):x[h]=(S,...A)=>C.add(S)&&N().then(()=>x[h](S,...A))})(l);const s=this.libraries.map(a=>this.importLibrary(a));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),a=>{const n=new ErrorEvent("error",{error:a});this.loadErrorCallback(n)})}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 r=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${r} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},r)}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 yt(o){return class extends o.OverlayView{constructor(t){super(),ge(this,"element"),ge(this,"opts");const{element:r,...l}=t;this.element=r,this.opts=l,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof o.LatLng?this.opts.position:new o.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(),r=t==null?void 0:t.fromLatLngToDivPixel(this.getPosition());if(r){this.element.style.position="absolute";const l=this.element.offsetHeight,s=this.element.offsetWidth;let a,n;switch(this.opts.anchorPoint){case"TOP_CENTER":a=r.x-s/2,n=r.y;break;case"BOTTOM_CENTER":a=r.x-s/2,n=r.y-l;break;case"LEFT_CENTER":a=r.x,n=r.y-l/2;break;case"RIGHT_CENTER":a=r.x-s,n=r.y-l/2;break;case"TOP_LEFT":a=r.x,n=r.y;break;case"TOP_RIGHT":a=r.x-s,n=r.y;break;case"BOTTOM_LEFT":a=r.x,n=r.y-l;break;case"BOTTOM_RIGHT":a=r.x-s,n=r.y-l;break;default:a=r.x-s/2,n=r.y-l/2}this.element.style.left=a+"px",this.element.style.top=n+"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:r,...l}=t;this.element=r,this.opts=l,this.draw()}}}let be;const ue=["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"],Ct=e.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},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:ue,setup(o,{emit:t}){const r=e.ref(),l=e.ref(!1),s=e.ref(),a=e.ref(),n=e.ref(!1);e.provide(D,s),e.provide(j,a),e.provide(pe,n);const c=()=>{const h={...o};Object.keys(h).forEach(f=>{h[f]===void 0&&delete h[f]});const g=f=>{var x;return f?{position:(x=a.value)==null?void 0:x.ControlPosition[f]}:{}},u={scaleControlOptions:o.scaleControlStyle?{style:o.scaleControlStyle}:{},panControlOptions:g(o.panControlPosition),zoomControlOptions:g(o.zoomControlPosition),rotateControlOptions:g(o.rotateControlPosition),streetViewControlOptions:g(o.streetViewControlPosition),fullscreenControlOptions:g(o.fullscreenControlPosition),disableDefaultUI:o.disableDefaultUi};return{...h,...u}},i=e.watch([a,s],([h,g])=>{const u=h,f=g;u&&f&&(u.event.addListenerOnce(f,"tilesloaded",()=>{n.value=!0}),setTimeout(i,0))},{immediate:!0}),d=()=>{try{const{apiKey:h,region:g,version:u,language:f,libraries:x,nonce:C}=o;be=new M({apiKey:h,region:g,version:u,language:f,libraries:x,nonce:C})}catch(h){console.error(h)}},m=h=>{a.value=e.markRaw(h.maps),s.value=e.markRaw(new h.maps.Map(r.value,c()));const g=yt(a.value);a.value[Y]=g,ue.forEach(f=>{var x;(x=s.value)==null||x.addListener(f,C=>t(f,C))}),l.value=!0;const u=Object.keys(o).filter(f=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(f)).map(f=>e.toRef(o,f));e.watch([()=>o.center,()=>o.zoom,...u],([f,x],[C,w])=>{var N,S,A;const{center:E,zoom:_,...B}=c();(N=s.value)==null||N.setOptions(B),x!==void 0&&x!==w&&((S=s.value)==null||S.setZoom(x));const X=!C||f.lng!==C.lng||f.lat!==C.lat;f&&X&&((A=s.value)==null||A.panTo(f))})};return e.onMounted(()=>{o.apiPromise&&o.apiPromise instanceof Promise?o.apiPromise.then(m):(d(),be.load().then(m))}),e.onBeforeUnmount(()=>{var h;n.value=!1,s.value&&((h=a.value)==null||h.event.clearInstanceListeners(s.value))}),{mapRef:r,ready:l,map:s,api:a,mapTilesLoaded:n}}}),wt=(o,t)=>{const r=o.__vccOpts||o;for(const[l,s]of t)r[l]=s;return r},Nt={ref:"mapRef",class:"mapdiv"};function kt(o,t,r,l,s,a){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Nt,null,512),e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({ready:o.ready,map:o.map,api:o.api,mapTilesLoaded:o.mapTilesLoaded})),void 0,!0)])}const St=wt(Ct,[["render",kt],["__scopeId","data-v-d05fc6bc"]]);function Vt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Et=function o(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var l,s,a;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(s=l;s--!==0;)if(!o(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),l=a.length,l!==Object.keys(r).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=l;s--!==0;){var n=a[s];if(!o(t[n],r[n]))return!1}return!0}return t!==t&&r!==r};const z=Vt(Et),xe=["click","drag","dragend","dragstart","gmp-click"],Bt=e.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:xe,setup(o,{emit:t,expose:r,slots:l}){const s=e.toRef(o,"options"),a=e.toRef(o,"pinOptions"),n=e.ref(),c=e.inject(D,e.ref()),i=e.inject(j,e.ref()),d=e.inject(ee,e.ref()),m=e.computed(()=>!!(d.value&&i.value&&n.value instanceof google.maps.marker.AdvancedMarkerElement));return e.watch([c,s,a],async(h,[g,u,f])=>{var x,C,w;const N=!z(s.value,u)||!z(a.value,f)||c.value!==g;if(!c.value||!i.value||!N)return;const{AdvancedMarkerElement:S,PinElement:A}=i.value.marker;if(n.value){const{map:E,content:_,...B}=s.value;Object.assign(n.value,{content:a.value?new A(a.value).element:_,...B}),m.value&&((x=d.value)==null||x.removeMarker(n.value),(C=d.value)==null||C.addMarker(n.value))}else a.value&&(s.value.content=new A(a.value).element),n.value=e.markRaw(new S(s.value)),m.value?(w=d.value)==null||w.addMarker(n.value):n.value.map=c.value,xe.forEach(E=>{var _;(_=n.value)==null||_.addListener(E,B=>t(E,B))})},{immediate:!0}),e.onBeforeUnmount(()=>{var h,g;n.value&&((h=i.value)==null||h.event.clearInstanceListeners(n.value),m.value?(g=d.value)==null||g.removeMarker(n.value):n.value.map=null)}),e.provide(v,n),r({marker:n}),()=>{var h;return(h=l.default)==null?void 0:h.call(l)}}}),At=o=>o==="Marker",Tt=o=>o===Y,U=(o,t,r,l)=>{const s=e.ref(),a=e.inject(D,e.ref()),n=e.inject(j,e.ref()),c=e.inject(ee,e.ref()),i=e.computed(()=>!!(c.value&&n.value&&(s.value instanceof n.value.Marker||s.value instanceof n.value[Y])));return e.watch([a,r],(d,[m,h])=>{var g,u,f;const x=!z(r.value,h)||a.value!==m;!a.value||!n.value||!x||(s.value?(s.value.setOptions(r.value),i.value&&((g=c.value)==null||g.removeMarker(s.value),(u=c.value)==null||u.addMarker(s.value))):(At(o)?s.value=e.markRaw(new n.value[o](r.value)):Tt(o)?s.value=e.markRaw(new n.value[o](r.value)):s.value=e.markRaw(new n.value[o]({...r.value,map:a.value})),i.value?(f=c.value)==null||f.addMarker(s.value):s.value.setMap(a.value),t.forEach(C=>{var w;(w=s.value)==null||w.addListener(C,N=>l(C,N))})))},{immediate:!0}),e.onBeforeUnmount(()=>{var d,m;s.value&&((d=n.value)==null||d.event.clearInstanceListeners(s.value),i.value?(m=c.value)==null||m.removeMarker(s.value):s.value.setMap(null))}),s},ye=["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.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:ye,setup(o,{emit:t,expose:r,slots:l}){const s=e.toRef(o,"options"),a=U("Marker",ye,s,t);return e.provide(v,a),r({marker:a}),()=>{var n;return(n=l.default)==null?void 0:n.call(l)}}}),e.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:F,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polyline:U("Polyline",F,r,t)}},render:()=>null}),e.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:F,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polygon:U("Polygon",F,r,t)}},render:()=>null});const Ce=F.concat(["bounds_changed"]);e.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:Ce,setup(o,{emit:t}){const r=e.toRef(o,"options");return{rectangle:U("Rectangle",Ce,r,t)}},render:()=>null});const we=F.concat(["center_changed","radius_changed"]);e.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:we,setup(o,{emit:t}){const r=e.toRef(o,"options");return{circle:U("Circle",we,r,t)}},render:()=>null}),e.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(o,{emit:t}){const r=e.ref(null),l=e.inject(D,e.ref()),s=e.inject(j,e.ref()),a=e.inject(pe,e.ref(!1)),n=e.watch([a,s,r],([d,m,h])=>{m&&d&&h&&(c(o.position),t("content:loaded"),setTimeout(n,0))},{immediate:!0}),c=d=>{if(l.value&&s.value&&r.value){const m=s.value.ControlPosition[d];l.value.controls[m].push(r.value)}},i=d=>{if(l.value&&s.value){let m=null;const h=s.value.ControlPosition[d];l.value.controls[h].forEach((g,u)=>{g===r.value&&(m=u)}),m!==null&&l.value.controls[h].removeAt(m)}};return e.onBeforeUnmount(()=>i(o.position)),e.watch(()=>o.position,(d,m)=>{i(m),c(d)}),e.watch(()=>o.index,d=>{d&&r.value&&(r.value.index=o.index)}),{controlRef:r}}});const Ne=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"];e.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ne,"update:modelValue"],setup(o,{slots:t,emit:r,expose:l}){const s=e.ref(),a=e.ref(),n=e.inject(D,e.ref()),c=e.inject(j,e.ref()),i=e.inject(v,e.ref());let d,m=o.modelValue;const h=e.computed(()=>{var x;return(x=t.default)==null?void 0:x.call(t).some(C=>C.type!==e.Comment)}),g=x=>{m=x,r("update:modelValue",x)},u=x=>{s.value&&(s.value.open({map:n.value,anchor:i.value,...x}),g(!0))},f=()=>{s.value&&(s.value.close(),g(!1))};return e.onMounted(()=>{e.watch([n,()=>o.options],([x,C],[w,N])=>{var S;const A=!z(C,N)||n.value!==w;n.value&&c.value&&A&&(s.value?(s.value.setOptions({...C,content:h.value?a.value:C.content}),i.value||u()):(s.value=e.markRaw(new c.value.InfoWindow({...C,content:h.value?a.value:C.content})),i.value&&(d=i.value.addListener("click",()=>{u()})),(!i.value||m)&&u(),Ne.forEach(E=>{var _;(_=s.value)==null||_.addListener(E,B=>r(E,B))}),(S=s.value)==null||S.addListener("closeclick",()=>g(!1))))},{immediate:!0}),e.watch(()=>o.modelValue,x=>{x!==m&&(x?u():f())})}),e.onBeforeUnmount(()=>{var x;d&&d.remove(),s.value&&((x=c.value)==null||x.event.clearInstanceListeners(s.value),f())}),l({infoWindow:s,open:u,close:f}),{infoWindow:s,infoWindowRef:a,hasSlotContent:h,open:u,close:f}}});const ke=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],te=1,J=8;class re{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,l]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=l>>4;if(s!==te)throw new Error(`Got v${s} data when expected v${te}.`);const a=ke[l&15];if(!a)throw new Error("Unrecognized array type.");const[n]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new re(c,n,a,t)}constructor(t,r=64,l=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=l,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const a=ke.indexOf(this.ArrayType),n=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,i=(8-c%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${l}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,J,t),this.coords=new this.ArrayType(this.data,J+c+i,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(J+n+c+i),this.ids=new this.IndexArrayType(this.data,J,t),this.coords=new this.ArrayType(this.data,J+c+i,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(te<<4)+a]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const l=this._pos>>1;return this.ids[l]=l,this.coords[this._pos++]=t,this.coords[this._pos++]=r,l}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return oe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,l,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:n,nodeSize:c}=this,i=[0,a.length-1,0],d=[];for(;i.length;){const m=i.pop()||0,h=i.pop()||0,g=i.pop()||0;if(h-g<=c){for(let C=g;C<=h;C++){const w=n[2*C],N=n[2*C+1];w>=t&&w<=l&&N>=r&&N<=s&&d.push(a[C])}continue}const u=g+h>>1,f=n[2*u],x=n[2*u+1];f>=t&&f<=l&&x>=r&&x<=s&&d.push(a[u]),(m===0?t<=f:r<=x)&&(i.push(g),i.push(u-1),i.push(1-m)),(m===0?l>=f:s>=x)&&(i.push(u+1),i.push(h),i.push(1-m))}return d}within(t,r,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:n}=this,c=[0,s.length-1,0],i=[],d=l*l;for(;c.length;){const m=c.pop()||0,h=c.pop()||0,g=c.pop()||0;if(h-g<=n){for(let C=g;C<=h;C++)Ve(a[2*C],a[2*C+1],t,r)<=d&&i.push(s[C]);continue}const u=g+h>>1,f=a[2*u],x=a[2*u+1];Ve(f,x,t,r)<=d&&i.push(s[u]),(m===0?t-l<=f:r-l<=x)&&(c.push(g),c.push(u-1),c.push(1-m)),(m===0?t+l>=f:r+l>=x)&&(c.push(u+1),c.push(h),c.push(1-m))}return i}}function oe(o,t,r,l,s,a){if(s-l<=r)return;const n=l+s>>1;Se(o,t,n,l,s,a),oe(o,t,r,l,n-1,1-a),oe(o,t,r,n+1,s,1-a)}function Se(o,t,r,l,s,a){for(;s>l;){if(s-l>600){const d=s-l+1,m=r-l+1,h=Math.log(d),g=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*g*(d-g)/d)*(m-d/2<0?-1:1),f=Math.max(l,Math.floor(r-m*g/d+u)),x=Math.min(s,Math.floor(r+(d-m)*g/d+u));Se(o,t,r,f,x,a)}const n=t[2*r+a];let c=l,i=s;for(W(o,t,l,r),t[2*s+a]>n&&W(o,t,l,s);c<i;){for(W(o,t,c,i),c++,i--;t[2*c+a]<n;)c++;for(;t[2*i+a]>n;)i--}t[2*l+a]===n?W(o,t,l,i):(i++,W(o,t,i,s)),i<=r&&(l=i+1),r<=i&&(s=i-1)}}function W(o,t,r,l){ae(o,r,l),ae(t,2*r,2*l),ae(t,2*r+1,2*l+1)}function ae(o,t,r){const l=o[t];o[t]=o[r],o[r]=l}function Ve(o,t,r,l){const s=o-r,a=t-l;return s*s+a*a}const _t={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},Ee=Math.fround||(o=>t=>(o[0]=+t,o[0]))(new Float32Array(1)),R=2,L=3,ne=4,P=5,Be=6;class Ae{constructor(t){this.options=Object.assign(Object.create(_t),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:r,minZoom:l,maxZoom:s}=this.options;r&&console.time("total time");const a=`prepare ${t.length} points`;r&&console.time(a),this.points=t;const n=[];for(let i=0;i<t.length;i++){const d=t[i];if(!d.geometry)continue;const[m,h]=d.geometry.coordinates,g=Ee(G(m)),u=Ee(Z(h));n.push(g,u,1/0,i,-1,1),this.options.reduce&&n.push(0)}let c=this.trees[s+1]=this._createTree(n);r&&console.timeEnd(a);for(let i=s;i>=l;i--){const d=+Date.now();c=this.trees[i]=this._createTree(this._cluster(c,i)),r&&console.log("z%d: %d clusters in %dms",i,c.numItems,+Date.now()-d)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let l=((t[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,t[1]));let a=t[2]===180?180:((t[2]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)l=-180,a=180;else if(l>a){const h=this.getClusters([l,s,180,n],r),g=this.getClusters([-180,s,a,n],r);return h.concat(g)}const c=this.trees[this._limitZoom(r)],i=c.range(G(l),Z(n),G(a),Z(s)),d=c.data,m=[];for(const h of i){const g=this.stride*h;m.push(d[g+P]>1?Te(d,g,this.clusterProps):this.points[d[g+L]])}return m}getChildren(t){const r=this._getOriginId(t),l=this._getOriginZoom(t),s="No cluster with the specified id.",a=this.trees[l];if(!a)throw new Error(s);const n=a.data;if(r*this.stride>=n.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,l-1)),i=n[r*this.stride],d=n[r*this.stride+1],m=a.within(i,d,c),h=[];for(const g of m){const u=g*this.stride;n[u+ne]===t&&h.push(n[u+P]>1?Te(n,u,this.clusterProps):this.points[n[u+L]])}if(h.length===0)throw new Error(s);return h}getLeaves(t,r,l){r=r||10,l=l||0;const s=[];return this._appendLeaves(s,t,r,l,0),s}getTile(t,r,l){const s=this.trees[this._limitZoom(t)],a=Math.pow(2,t),{extent:n,radius:c}=this.options,i=c/n,d=(l-i)/a,m=(l+1+i)/a,h={features:[]};return this._addTileFeatures(s.range((r-i)/a,d,(r+1+i)/a,m),s.data,r,l,a,h),r===0&&this._addTileFeatures(s.range(1-i/a,d,1,m),s.data,a,l,a,h),r===a-1&&this._addTileFeatures(s.range(0,d,i/a,m),s.data,-1,l,a,h),h.features.length?h:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){const l=this.getChildren(t);if(r++,l.length!==1)break;t=l[0].properties.cluster_id}return r}_appendLeaves(t,r,l,s,a){const n=this.getChildren(r);for(const c of n){const i=c.properties;if(i&&i.cluster?a+i.point_count<=s?a+=i.point_count:a=this._appendLeaves(t,i.cluster_id,l,s,a):a<s?a++:t.push(c),t.length===l)break}return a}_createTree(t){const r=new re(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let l=0;l<t.length;l+=this.stride)r.add(t[l],t[l+1]);return r.finish(),r.data=t,r}_addTileFeatures(t,r,l,s,a,n){for(const c of t){const i=c*this.stride,d=r[i+P]>1;let m,h,g;if(d)m=_e(r,i,this.clusterProps),h=r[i],g=r[i+1];else{const x=this.points[r[i+L]];m=x.properties;const[C,w]=x.geometry.coordinates;h=G(C),g=Z(w)}const u={type:1,geometry:[[Math.round(this.options.extent*(h*a-l)),Math.round(this.options.extent*(g*a-s))]],tags:m};let f;d||this.options.generateId?f=r[i+L]:f=this.points[r[i+L]].id,f!==void 0&&(u.id=f),n.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const{radius:l,extent:s,reduce:a,minPoints:n}=this.options,c=l/(s*Math.pow(2,r)),i=t.data,d=[],m=this.stride;for(let h=0;h<i.length;h+=m){if(i[h+R]<=r)continue;i[h+R]=r;const g=i[h],u=i[h+1],f=t.within(i[h],i[h+1],c),x=i[h+P];let C=x;for(const w of f){const N=w*m;i[N+R]>r&&(C+=i[N+P])}if(C>x&&C>=n){let w=g*x,N=u*x,S,A=-1;const E=((h/m|0)<<5)+(r+1)+this.points.length;for(const _ of f){const B=_*m;if(i[B+R]<=r)continue;i[B+R]=r;const X=i[B+P];w+=i[B]*X,N+=i[B+1]*X,i[B+ne]=E,a&&(S||(S=this._map(i,h,!0),A=this.clusterProps.length,this.clusterProps.push(S)),a(S,this._map(i,B)))}i[h+ne]=E,d.push(w/C,N/C,1/0,E,-1,C),a&&d.push(A)}else{for(let w=0;w<m;w++)d.push(i[h+w]);if(C>1)for(const w of f){const N=w*m;if(!(i[N+R]<=r)){i[N+R]=r;for(let S=0;S<m;S++)d.push(i[N+S])}}}}return d}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r,l){if(t[r+P]>1){const n=this.clusterProps[t[r+Be]];return l?Object.assign({},n):n}const s=this.points[t[r+L]].properties,a=this.options.map(s);return l&&a===s?Object.assign({},a):a}}function Te(o,t,r){return{type:"Feature",id:o[t+L],properties:_e(o,t,r),geometry:{type:"Point",coordinates:[It(o[t]),zt(o[t+1])]}}}function _e(o,t,r){const l=o[t+P],s=l>=1e4?`${Math.round(l/1e3)}k`:l>=1e3?`${Math.round(l/100)/10}k`:l,a=o[t+Be],n=a===-1?{}:Object.assign({},r[a]);return Object.assign(n,{cluster:!0,cluster_id:o[t+L],point_count:l,point_count_abbreviated:s})}function G(o){return o/360+.5}function Z(o){const t=Math.sin(o*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function It(o){return(o-.5)*360}function zt(o){const t=(180-o*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 se(o,t){var r={};for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&t.indexOf(l)<0&&(r[l]=o[l]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(o);s<l.length;s++)t.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(o,l[s])&&(r[l[s]]=o[l[s]]);return r}class V{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,r){this.isAdvancedMarker(t)?t.map=r:t.setMap(r)}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 K{constructor({markers:t,position:r}){this.markers=t,r&&(r instanceof google.maps.LatLng?this._position=r:this._position=new google.maps.LatLng(r))}get bounds(){if(this.markers.length===0&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const r of this.markers)t.extend(V.getPosition(r));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>V.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(V.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const Lt=(o,t,r,l)=>{const s=Ie(o.getBounds(),t,l);return r.filter(a=>s.contains(V.getPosition(a)))},Ie=(o,t,r)=>{const{northEast:l,southWest:s}=Pt(o,t),a=Dt({northEast:l,southWest:s},r);return jt(a,t)},ze=(o,t,r)=>{const l=Ie(o,t,r),s=l.getNorthEast(),a=l.getSouthWest();return[a.lng(),a.lat(),s.lng(),s.lat()]},Pt=(o,t)=>({northEast:t.fromLatLngToDivPixel(o.getNorthEast()),southWest:t.fromLatLngToDivPixel(o.getSouthWest())}),Dt=({northEast:o,southWest:t},r)=>(o.x+=r,o.y-=r,t.x-=r,t.y+=r,{northEast:o,southWest:t}),jt=({northEast:o,southWest:t},r)=>{const l=r.fromDivPixelToLatLng(t),s=r.fromDivPixelToLatLng(o);return new google.maps.LatLngBounds(l,s)};class Le{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Rt(t)}}class Mt extends Le{constructor(t){var{viewportPadding:r=60}=t,l=se(t,["viewportPadding"]);super(l),this.viewportPadding=60,this.viewportPadding=r}calculate({markers:t,map:r,mapCanvasProjection:l}){return r.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t}),changed:!1}:{clusters:this.cluster({markers:Lt(r,l,t,this.viewportPadding),map:r,mapCanvasProjection:l})}}}const Rt=o=>o.map(t=>new K({position:V.getPosition(t),markers:[t]}));class Ot extends Le{constructor(t){var{maxZoom:r,radius:l=60}=t,s=se(t,["maxZoom","radius"]);super({maxZoom:r}),this.state={zoom:-1},this.superCluster=new Ae(Object.assign({maxZoom:this.maxZoom,radius:l},s))}calculate(t){let r=!1;const l={zoom:t.map.getZoom()};if(!z(t.markers,this.markers)){r=!0,this.markers=[...t.markers];const s=this.markers.map(a=>{const n=V.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[n.lng(),n.lat()]},properties:{marker:a}}});this.superCluster.load(s)}return r||(this.state.zoom<=this.maxZoom||l.zoom<=this.maxZoom)&&(r=!z(this.state,l)),this.state=l,r&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:r}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[t,r]},properties:l}){if(l.cluster)return new K({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:r,lng:t}});const s=l.marker;return new K({markers:[s],position:V.getPosition(s)})}}class Ft extends Mt{constructor(t){var{maxZoom:r,radius:l=60,viewportPadding:s=60}=t,a=se(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:r,viewportPadding:s}),this.superCluster=new Ae(Object.assign({maxZoom:this.maxZoom,radius:l},a)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const r={zoom:Math.round(t.map.getZoom()),view:ze(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let l=!z(this.state,r);if(!z(t.markers,this.markers)){l=!0,this.markers=[...t.markers];const s=this.markers.map(a=>{const n=V.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[n.lng(),n.lat()]},properties:{marker:a}}});this.superCluster.load(s)}return l&&(this.clusters=this.cluster(t),this.state=r),{clusters:this.clusters,changed:l}}cluster({map:t,mapCanvasProjection:r}){const l={zoom:Math.round(t.getZoom()),view:ze(t.getBounds(),r,this.viewportPadding)};return this.superCluster.getClusters(l.view,l.zoom).map(s=>this.transformCluster(s))}transformCluster({geometry:{coordinates:[t,r]},properties:l}){if(l.cluster)return new K({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:r,lng:t}});const s=l.marker;return new K({markers:[s],position:V.getPosition(s)})}}class qt{constructor(t,r){this.markers={sum:t.length};const l=r.map(a=>a.count),s=l.reduce((a,n)=>a+n,0);this.clusters={count:r.length,markers:{mean:s/r.length,sum:s,min:Math.min(...l),max:Math.max(...l)}}}}class Ut{render({count:t,position:r},l,s){const a=`<svg fill="${t>Math.max(10,l.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>`,n=`Cluster of ${t} markers`,c=Number(google.maps.Marker.MAX_ZINDEX)+t;if(V.isAdvancedMarkerAvailable(s)){const d=document.createElement("div");d.innerHTML=a;const m=d.firstElementChild;m.setAttribute("transform","translate(0 25)");const h={map:s,position:r,zIndex:c,title:n,content:m};return new google.maps.marker.AdvancedMarkerElement(h)}const i={position:r,zIndex:c,title:n,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(i)}}function Qt(o,t){for(let r in t.prototype)o.prototype[r]=t.prototype[r]}class le{constructor(){Qt(le,google.maps.OverlayView)}}var Q;(function(o){o.CLUSTERING_BEGIN="clusteringbegin",o.CLUSTERING_END="clusteringend",o.CLUSTER_CLICK="click"})(Q||(Q={}));const Ht=(o,t,r)=>{r.fitBounds(t.bounds)};class Jt extends le{constructor({map:t,markers:r=[],algorithmOptions:l={},algorithm:s=new Ot(l),renderer:a=new Ut,onClusterClick:n=Ht}){super(),this.markers=[...r],this.clusters=[],this.algorithm=s,this.renderer=a,this.onClusterClick=n,t&&this.setMap(t)}addMarker(t,r){this.markers.includes(t)||(this.markers.push(t),r||this.render())}addMarkers(t,r){t.forEach(l=>{this.addMarker(l,!0)}),r||this.render()}removeMarker(t,r){const l=this.markers.indexOf(t);return l===-1?!1:(V.setMap(t,null),this.markers.splice(l,1),r||this.render(),!0)}removeMarkers(t,r){let l=!1;return t.forEach(s=>{l=this.removeMarker(s,!0)||l}),l&&!r&&this.render(),l}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,Q.CLUSTERING_BEGIN,this);const{clusters:r,changed:l}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(l||l==null){const s=new Set;for(const n of r)n.markers.length==1&&s.add(n.markers[0]);const a=[];for(const n of this.clusters)n.marker!=null&&(n.markers.length==1?s.has(n.marker)||V.setMap(n.marker,null):a.push(n.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame(()=>a.forEach(n=>V.setMap(n,null)))}google.maps.event.trigger(this,Q.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=>V.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new qt(this.markers,this.clusters),r=this.getMap();this.clusters.forEach(l=>{l.markers.length===1?l.marker=l.markers[0]:(l.marker=this.renderer.render(l,t,r),l.markers.forEach(s=>V.setMap(s,null)),this.onClusterClick&&l.marker.addListener("click",s=>{google.maps.event.trigger(this,Q.CLUSTER_CLICK,l),this.onClusterClick(s,l,r)})),V.setMap(l.marker,r)})}}const Pe=Object.values(Q);e.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Pe,setup(o,{emit:t,expose:r,slots:l}){const s=e.ref(),a=e.inject(D,e.ref()),n=e.inject(j,e.ref());return e.provide(ee,s),e.watch(a,()=>{a.value&&(s.value=e.markRaw(new Jt({map:a.value,algorithm:new Ft(o.options.algorithmOptions??{}),...o.options})),Pe.forEach(c=>{var i;(i=s.value)==null||i.addListener(c,d=>t(c,d))}))},{immediate:!0}),e.onBeforeUnmount(()=>{var c;s.value&&((c=n.value)==null||c.event.clearInstanceListeners(s.value),s.value.clearMarkers(),s.value.setMap(null))}),r({markerCluster:s}),()=>{var c;return(c=l.default)==null?void 0:c.call(l)}}}),e.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(o,{slots:t,emit:r,expose: