@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.
31 lines (27 loc) • 311 kB
JavaScript
(function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x.MeyerSquaredUI={},x.Vue))})(this,(function(x,e){"use strict";const u=(o,t)=>{const r=o.__vccOpts||o;for(const[l,a]of t)r[l]=a;return r},et={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]}`:"",a=this.hoverColor?`hover:text-${this.hoverColor}`:"";return`${r} ${l} ${t[this.weight]} text-${this.color} ${a} font-${this.font}`}}};function tt(o,t,r,l,a,n){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.tag),{class:e.normalizeClass(n.textClasses)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"])}const y=u(et,[["render",tt]]),rt={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 ot(o,t,r,l,a,n){return e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass([r.type,r.icon,n.colorClasses,n.sizeClasses]),onClick:t[0]||(t[0]=s=>o.$emit("click"))},null,2)}const V=u(rt,[["render",ot]]),nt={name:"BaseButton",components:{BaseText:y,Icon:V},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)}},data(){return{hoverTextColor:this.hoverColor||"secondary",buttonTextColor:this.color||"primary"}},computed:{paddingClass(){return this.padding},backgroundClass(){return{primary:"bg-primary hover:bg-accent text-secondary hover:text-primary",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"}},methods:{setHoverTextColor(){this.buttonTextColor=this.hoverColor||"secondary"},setTextColor(){this.buttonTextColor=this.color||"primary"}}},st=["title","aria-label"];function at(o,t,r,l,a,n){const s=e.resolveComponent("BaseText"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["group","rounded-md transition duration-300 ease-in-out",n.paddingClass,n.backgroundClass,n.borderClass]),title:r.altText||r.label,"aria-label":r.altText||r.label,onClick:t[0]||(t[0]=i=>o.$emit("buttonClick")),onMouseenter:t[1]||(t[1]=(...i)=>n.setHoverTextColor&&n.setHoverTextColor(...i)),onMouseleave:t[2]||(t[2]=(...i)=>n.setTextColor&&n.setTextColor(...i))},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center",n.alignmentClass,"space-x-2"])},[e.createVNode(s,{tag:"span",color:a.buttonTextColor,hoverColor:a.hoverTextColor,size:r.size,weight:r.weight},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:1},8,["color","hoverColor","size","weight"]),e.createVNode(c,{icon:r.iconName,color:r.iconColor,size:r.iconSize,type:r.iconType},null,8,["icon","color","size","type"])],2)],42,st)}const T=u(nt,[["render",at]]),lt={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}`}}},it=["type","placeholder","value"];function ct(o,t,r,l,a,n){return e.openBlock(),e.createElementBlock("input",{type:r.type,placeholder:r.placeholder,value:r.modelValue,class:e.normalizeClass([n.inputClass]),onInput:t[0]||(t[0]=s=>o.$emit("update:modelValue",s.target.value))},null,42,it)}const W=u(lt,[["render",ct]]),dt={name:"SearchBox",components:{InputField:W,Icon:V},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)}}},mt={class:"relative flex items-center w-full max-w-md"};function ht(o,t,r,l,a,n){const s=e.resolveComponent("InputField"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(s,{modelValue:a.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=i=>a.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:n.onSearch},null,8,["color","size","onClick"])])}const oe=u(dt,[["render",ht]]),gt={name:"BasicDropDown",emits:["item-select"],components:{BaseText:y,Icon:V},props:{items:{type:Array,default:()=>["All Weapons","Longsword","Saber","Rapier","Smallsword","Sword and Buckler"]},defaultSelectedItem:{type:String,default:""},width:{type:String,default:"w-48"},boldText:{type:Boolean,default:!1}},data(){return{selectedItem:this.defaultSelectedItem,dropdownOpen:!1}},mounted(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown(){if(this.dropdownOpen=!this.dropdownOpen,window.innerWidth<768&&this.dropdownOpen){document.body.style.overflow="hidden";return}document.body.style.overflow=""},selectWeapon(o){this.$emit("item-select",o),this.selectedItem=o,this.dropdownOpen=!1,document.body.style.overflow=""},handleClickOutside(o){this.dropdownOpen&&!this.$refs.dropdownContainer.contains(o.target)&&(this.dropdownOpen=!1,document.body.style.overflow="")}}},pt={key:0,class:"absolute top-full mt-1 w-full bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 hidden md:block"},ft=["onClick"],ut={key:1,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 md:hidden"},bt={class:"bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 w-3/4 max-w-lg p-6"},xt=["onClick"];function yt(o,t,r,l,a,n){const s=e.resolveComponent("BaseText"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`relative ${r.width}`),ref:"dropdownContainer"},[e.createElementVNode("div",{onClick:t[0]||(t[0]=(...i)=>n.toggleDropdown&&n.toggleDropdown(...i)),class:"flex items-center cursor-pointer"},[e.createVNode(s,{class:"border-b-2 border-transparent hover:border-accent pb-1 duration-300 ease-in-out",color:"primary",size:"xs md",tag:"p",weight:r.boldText?"bold":"normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.selectedItem),1)]),_:1},8,["weight"]),e.createVNode(c,{icon:"fa-chevron-down",size:"sm",color:"primary",class:"ml-4"})]),a.dropdownOpen?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.items,(i,d)=>(e.openBlock(),e.createElementBlock("li",{key:i,onClick:m=>n.selectWeapon(i),class:e.normalizeClass(["px-4 py-2 cursor-pointer hover:bg-hoverColor",d===0?"rounded-t-lg":"",d===r.items.length-1?"rounded-b-lg":""])},[e.createVNode(s,{color:"primary",size:"xs sm",tag:"p",weight:"bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1024)],10,ft))),128))])])):e.createCommentVNode("",!0),a.dropdownOpen?(e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("div",bt,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.items,i=>(e.openBlock(),e.createElementBlock("li",{key:i,onClick:d=>n.selectWeapon(i),class:"px-4 py-2 cursor-pointer hover:bg-hoverColor"},[e.createVNode(s,{color:"primary",size:"xs sm",tag:"p",weight:"bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1024)],8,xt))),128))])])])):e.createCommentVNode("",!0)],2)}const X=u(gt,[["render",yt]]),wt={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++}}},Ct={class:"w-80 h-80 p-6 bg-primary rounded-lg shadow-md"},Nt={class:"flex justify-between items-center mb-4"},kt={class:"grid grid-cols-7 gap-1 text-center font-bold text-sm text-gray-600 mb-2"},Vt={class:"grid grid-cols-7 gap-1 text-center"},Bt=["onClick"];function Et(o,t,r,l,a,n){const s=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("div",Nt,[e.createVNode(s,{tag:"h2",size:"sm",weight:"normal",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.monthYear),1)]),_:1}),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=(...c)=>n.prevMonth&&n.prevMonth(...c)),class:"text-secondary hover:text-accent mr-4"}," < "),e.createElementVNode("button",{onClick:t[1]||(t[1]=(...c)=>n.nextMonth&&n.nextMonth(...c)),class:"text-secondary hover:text-accent"}," > ")])]),e.createElementVNode("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.weekdays,c=>(e.openBlock(),e.createElementBlock("div",{key:c},[e.createVNode(s,{tag:"p",size:"xs",weight:"bold",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)]))),128))]),e.createElementVNode("div",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.startDay,c=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+c}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.daysInMonth,(c,i)=>(e.openBlock(),e.createElementBlock("div",{key:"day-"+c,onClick:d=>n.dayClicked(c),class:e.normalizeClass(["flex justify-center items-center cursor-pointer p-2 rounded-full",{"bg-accent text-white":n.hasTournament(c),"hover:bg-gray-200":n.hasTournament(c),"text-gray-400":!n.hasTournament(c)}])},[e.createVNode(s,{tag:"p",size:"xs",weight:"thin",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c),1)]),_:2},1024)],10,Bt))),128))])])}const St=u(wt,[["render",Et]]);(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 At=Object.defineProperty,Tt=(o,t,r)=>t in o?At(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,xe=(o,t,r)=>(Tt(o,typeof t!="symbol"?t+"":t,r),r);const M=Symbol("map"),R=Symbol("api"),ne=Symbol("marker"),se=Symbol("markerCluster"),$=Symbol("CustomMarker"),ye=Symbol("mapTilesLoaded"),U=["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 _t(o,t,r,l){function a(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function c(m){try{d(l.next(m))}catch(h){s(h)}}function i(m){try{d(l.throw(m))}catch(h){s(h)}}function d(m){m.done?n(m.value):a(m.value).then(c,i)}d((l=l.apply(o,[])).next())})}var It=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,a,n;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(a=l;a--!==0;)if(!o(t[a],r[a]))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(n=Object.keys(t),l=n.length,l!==Object.keys(r).length)return!1;for(a=l;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[a]))return!1;for(a=l;a--!==0;){var s=n[a];if(!o(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const we="__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 O{constructor({apiKey:t,authReferrerPolicy:r,channel:l,client:a,id:n=we,language:s,libraries:c=[],mapIds:i,nonce:d,region:m,retries:h=3,url:g="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=r,this.channel=l,this.client=a,this.id=n||we,this.language=s,this.libraries=c,this.mapIds=i,this.nonce=d,this.region=m,this.retries=h,this.url=g,this.version=p,O.instance){if(!It(this.options,O.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(O.instance.options)}`);return O.instance}O.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+=`®ion=${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(n=>!l[n]&&delete l[n]),!((r=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.maps)===null||r===void 0)&&r.importLibrary||(n=>{let s,c,i,d="The Google Maps JavaScript API",m="google",h="importLibrary",g="__ib__",p=document,f=window;f=f[m]||(f[m]={});const b=f.maps||(f.maps={}),w=new Set,C=new URLSearchParams,N=()=>s||(s=new Promise((k,E)=>_t(this,void 0,void 0,function*(){var A;yield c=p.createElement("script"),c.id=this.id,C.set("libraries",[...w]+"");for(i in n)C.set(i.replace(/[A-Z]/g,B=>"_"+B[0].toLowerCase()),n[i]);C.set("callback",m+".maps."+g),c.src=this.url+"?"+C,b[g]=k,c.onerror=()=>s=E(Error(d+" could not load.")),c.nonce=this.nonce||((A=p.querySelector("script[nonce]"))===null||A===void 0?void 0:A.nonce)||"",p.head.append(c)})));b[h]?console.warn(d+" only loads once. Ignoring:",n):b[h]=(k,...E)=>w.add(k)&&N().then(()=>b[h](k,...E))})(l);const a=this.libraries.map(n=>this.importLibrary(n));a.length||a.push(this.importLibrary("core")),Promise.all(a).then(()=>this.callback(),n=>{const s=new ErrorEvent("error",{error:n});this.loadErrorCallback(s)})}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 zt(o){return class extends o.OverlayView{constructor(t){super(),xe(this,"element"),xe(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";let l,a;switch(this.opts.anchorPoint){case"TOP_CENTER":l="-50%",a="-100%";break;case"BOTTOM_CENTER":l="-50%",a="0";break;case"LEFT_CENTER":l="-100%",a="-50%";break;case"RIGHT_CENTER":l="0",a="-50%";break;case"TOP_LEFT":l="-100%",a="-100%";break;case"TOP_RIGHT":l="0",a="-100%";break;case"BOTTOM_LEFT":l="-100%",a="0";break;case"BOTTOM_RIGHT":l="0",a="0";break;default:l="-50%",a="-50%"}const n=r.x+(this.opts.offsetX||0)+"px",s=r.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${l}) translateX(${n}) translateY(${a}) translateY(${s})`,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 Ce;const Ne=["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"],Dt=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:Ne,setup(o,{emit:t}){const r=e.ref(),l=e.ref(!1),a=e.ref(),n=e.ref(),s=e.ref(!1);e.provide(M,a),e.provide(R,n),e.provide(ye,s);const c=()=>{const h={...o};Object.keys(h).forEach(f=>{h[f]===void 0&&delete h[f]});const g=f=>{var b;return f?{position:(b=n.value)==null?void 0:b.ControlPosition[f]}:{}},p={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,...p}},i=e.watch([n,a],([h,g])=>{const p=h,f=g;p&&f&&(p.event.addListenerOnce(f,"tilesloaded",()=>{s.value=!0}),setTimeout(i,0))},{immediate:!0}),d=()=>{try{const{apiKey:h,region:g,version:p,language:f,libraries:b,nonce:w}=o;Ce=new O({apiKey:h,region:g,version:p,language:f,libraries:b,nonce:w})}catch(h){console.error(h)}},m=h=>{n.value=e.markRaw(h.maps),a.value=e.markRaw(new h.maps.Map(r.value,c()));const g=zt(n.value);n.value[$]=g,Ne.forEach(f=>{var b;(b=a.value)==null||b.addListener(f,w=>t(f,w))}),l.value=!0;const p=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,...p],([f,b],[w,C])=>{var N,k,E;const{center:A,zoom:B,...S}=c();(N=a.value)==null||N.setOptions(S),b!==void 0&&b!==C&&((k=a.value)==null||k.setZoom(b));const D=!w||f.lng!==w.lng||f.lat!==w.lat;f&&D&&((E=a.value)==null||E.panTo(f))})};return e.onMounted(()=>{o.apiPromise&&o.apiPromise instanceof Promise?o.apiPromise.then(m):(d(),Ce.load().then(m))}),e.onBeforeUnmount(()=>{var h;s.value=!1,a.value&&((h=n.value)==null||h.event.clearInstanceListeners(a.value))}),{mapRef:r,ready:l,map:a,api:n,mapTilesLoaded:s}}}),Pt=(o,t)=>{const r=o.__vccOpts||o;for(const[l,a]of t)r[l]=a;return r},Lt={ref:"mapRef",class:"mapdiv"};function jt(o,t,r,l,a,n){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Lt,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 Mt=Pt(Dt,[["render",jt],["__scopeId","data-v-d05fc6bc"]]);function Rt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Ot=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,a,n;if(Array.isArray(t)){if(l=t.length,l!=r.length)return!1;for(a=l;a--!==0;)if(!o(t[a],r[a]))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(n=Object.keys(t),l=n.length,l!==Object.keys(r).length)return!1;for(a=l;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[a]))return!1;for(a=l;a--!==0;){var s=n[a];if(!o(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const z=Rt(Ot),ke=["click","drag","dragend","dragstart","gmp-click"],Ft=e.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ke,setup(o,{emit:t,expose:r,slots:l}){const a=e.toRef(o,"options"),n=e.toRef(o,"pinOptions"),s=e.ref(),c=e.inject(M,e.ref()),i=e.inject(R,e.ref()),d=e.inject(se,e.ref()),m=e.computed(()=>!!(d.value&&i.value&&s.value instanceof google.maps.marker.AdvancedMarkerElement));return e.watch([c,a,n],async(h,[g,p,f])=>{var b,w,C;const N=!z(a.value,p)||!z(n.value,f)||c.value!==g;if(!c.value||!i.value||!N)return;const{AdvancedMarkerElement:k,PinElement:E}=i.value.marker;if(s.value){const{map:A,content:B,...S}=a.value;Object.assign(s.value,{content:n.value?new E(n.value).element:B,...S}),m.value&&((b=d.value)==null||b.removeMarker(s.value),(w=d.value)==null||w.addMarker(s.value))}else n.value&&(a.value.content=new E(n.value).element),s.value=e.markRaw(new k(a.value)),m.value?(C=d.value)==null||C.addMarker(s.value):s.value.map=c.value,ke.forEach(A=>{var B;(B=s.value)==null||B.addListener(A,S=>t(A,S))})},{immediate:!0}),e.onBeforeUnmount(()=>{var h,g;s.value&&((h=i.value)==null||h.event.clearInstanceListeners(s.value),m.value?(g=d.value)==null||g.removeMarker(s.value):s.value.map=null)}),e.provide(ne,s),r({marker:s}),()=>{var h;return(h=l.default)==null?void 0:h.call(l)}}}),qt=o=>o==="Marker",Ut=o=>o===$,J=(o,t,r,l)=>{const a=e.ref(),n=e.inject(M,e.ref()),s=e.inject(R,e.ref()),c=e.inject(se,e.ref()),i=e.computed(()=>!!(c.value&&s.value&&(a.value instanceof s.value.Marker||a.value instanceof s.value[$])));return e.watch([n,r],(d,[m,h])=>{var g,p,f;const b=!z(r.value,h)||n.value!==m;!n.value||!s.value||!b||(a.value?(a.value.setOptions(r.value),i.value&&((g=c.value)==null||g.removeMarker(a.value),(p=c.value)==null||p.addMarker(a.value))):(qt(o)?a.value=e.markRaw(new s.value[o](r.value)):Ut(o)?a.value=e.markRaw(new s.value[o](r.value)):a.value=e.markRaw(new s.value[o]({...r.value,map:n.value})),i.value?(f=c.value)==null||f.addMarker(a.value):a.value.setMap(n.value),t.forEach(w=>{var C;(C=a.value)==null||C.addListener(w,N=>l(w,N))})))},{immediate:!0}),e.onBeforeUnmount(()=>{var d,m;a.value&&((d=s.value)==null||d.event.clearInstanceListeners(a.value),i.value?(m=c.value)==null||m.removeMarker(a.value):a.value.setMap(null))}),a},Ve=["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:Ve,setup(o,{emit:t,expose:r,slots:l}){const a=e.toRef(o,"options"),n=J("Marker",Ve,a,t);return e.provide(ne,n),r({marker:n}),()=>{var s;return(s=l.default)==null?void 0:s.call(l)}}}),e.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:U,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polyline:J("Polyline",U,r,t)}},render:()=>null}),e.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:U,setup(o,{emit:t}){const r=e.toRef(o,"options");return{polygon:J("Polygon",U,r,t)}},render:()=>null});const Be=U.concat(["bounds_changed"]);e.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:Be,setup(o,{emit:t}){const r=e.toRef(o,"options");return{rectangle:J("Rectangle",Be,r,t)}},render:()=>null});const Ee=U.concat(["center_changed","radius_changed"]);e.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:Ee,setup(o,{emit:t}){const r=e.toRef(o,"options");return{circle:J("Circle",Ee,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(M,e.ref()),a=e.inject(R,e.ref()),n=e.inject(ye,e.ref(!1)),s=e.watch([n,a,r],([d,m,h])=>{m&&d&&h&&(c(o.position),t("content:loaded"),setTimeout(s,0))},{immediate:!0}),c=d=>{if(l.value&&a.value&&r.value){const m=a.value.ControlPosition[d];l.value.controls[m].push(r.value)}},i=d=>{if(l.value&&a.value){let m=null;const h=a.value.ControlPosition[d];l.value.controls[h].forEach((g,p)=>{g===r.value&&(m=p)}),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 Se=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"];e.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Se,"update:modelValue"],setup(o,{slots:t,emit:r,expose:l}){const a=e.ref(),n=e.ref(),s=e.inject(M,e.ref()),c=e.inject(R,e.ref()),i=e.inject(ne,e.ref());let d,m=o.modelValue;const h=e.computed(()=>{var b;return(b=t.default)==null?void 0:b.call(t).some(w=>w.type!==e.Comment)}),g=b=>{m=b,r("update:modelValue",b)},p=b=>{a.value&&(a.value.open({map:s.value,anchor:i.value,...b}),g(!0))},f=()=>{a.value&&(a.value.close(),g(!1))};return e.onMounted(()=>{e.watch([s,()=>o.options],([b,w],[C,N])=>{var k;const E=!z(w,N)||s.value!==C;s.value&&c.value&&E&&(a.value?(a.value.setOptions({...w,content:h.value?n.value:w.content}),i.value||p()):(a.value=e.markRaw(new c.value.InfoWindow({...w,content:h.value?n.value:w.content})),i.value&&(d=i.value.addListener("click",()=>{p()})),(!i.value||m)&&p(),Se.forEach(A=>{var B;(B=a.value)==null||B.addListener(A,S=>r(A,S))}),(k=a.value)==null||k.addListener("closeclick",()=>g(!1))))},{immediate:!0}),e.watch(()=>o.modelValue,b=>{b!==m&&(b?p():f())})}),e.onBeforeUnmount(()=>{var b;d&&d.remove(),a.value&&((b=c.value)==null||b.event.clearInstanceListeners(a.value),f())}),l({infoWindow:a,open:p,close:f}),{infoWindow:a,infoWindowRef:n,hasSlotContent:h,open:p,close:f}}});const Ae=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ae=1,K=8;class le{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 a=l>>4;if(a!==ae)throw new Error(`Got v${a} data when expected v${ae}.`);const n=Ae[l&15];if(!n)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new le(c,s,n,t)}constructor(t,r=64,l=Float64Array,a){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 n=Ae.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,i=(8-c%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${l}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,K,t),this.coords=new this.ArrayType(this.data,K+c+i,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(K+s+c+i),this.ids=new this.IndexArrayType(this.data,K,t),this.coords=new this.ArrayType(this.data,K+c+i,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ae<<4)+n]),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 ie(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,l,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:s,nodeSize:c}=this,i=[0,n.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 w=g;w<=h;w++){const C=s[2*w],N=s[2*w+1];C>=t&&C<=l&&N>=r&&N<=a&&d.push(n[w])}continue}const p=g+h>>1,f=s[2*p],b=s[2*p+1];f>=t&&f<=l&&b>=r&&b<=a&&d.push(n[p]),(m===0?t<=f:r<=b)&&(i.push(g),i.push(p-1),i.push(1-m)),(m===0?l>=f:a>=b)&&(i.push(p+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:a,coords:n,nodeSize:s}=this,c=[0,a.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<=s){for(let w=g;w<=h;w++)_e(n[2*w],n[2*w+1],t,r)<=d&&i.push(a[w]);continue}const p=g+h>>1,f=n[2*p],b=n[2*p+1];_e(f,b,t,r)<=d&&i.push(a[p]),(m===0?t-l<=f:r-l<=b)&&(c.push(g),c.push(p-1),c.push(1-m)),(m===0?t+l>=f:r+l>=b)&&(c.push(p+1),c.push(h),c.push(1-m))}return i}}function ie(o,t,r,l,a,n){if(a-l<=r)return;const s=l+a>>1;Te(o,t,s,l,a,n),ie(o,t,r,l,s-1,1-n),ie(o,t,r,s+1,a,1-n)}function Te(o,t,r,l,a,n){for(;a>l;){if(a-l>600){const d=a-l+1,m=r-l+1,h=Math.log(d),g=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*g*(d-g)/d)*(m-d/2<0?-1:1),f=Math.max(l,Math.floor(r-m*g/d+p)),b=Math.min(a,Math.floor(r+(d-m)*g/d+p));Te(o,t,r,f,b,n)}const s=t[2*r+n];let c=l,i=a;for(Y(o,t,l,r),t[2*a+n]>s&&Y(o,t,l,a);c<i;){for(Y(o,t,c,i),c++,i--;t[2*c+n]<s;)c++;for(;t[2*i+n]>s;)i--}t[2*l+n]===s?Y(o,t,l,i):(i++,Y(o,t,i,a)),i<=r&&(l=i+1),r<=i&&(a=i-1)}}function Y(o,t,r,l){ce(o,r,l),ce(t,2*r,2*l),ce(t,2*r+1,2*l+1)}function ce(o,t,r){const l=o[t];o[t]=o[r],o[r]=l}function _e(o,t,r,l){const a=o-r,n=t-l;return a*a+n*n}const Qt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},Ie=Math.fround||(o=>t=>(o[0]=+t,o[0]))(new Float32Array(1)),F=2,L=3,de=4,j=5,ze=6;class De{constructor(t){this.options=Object.assign(Object.create(Qt),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:a}=this.options;r&&console.time("total time");const n=`prepare ${t.length} points`;r&&console.time(n),this.points=t;const s=[];for(let i=0;i<t.length;i++){const d=t[i];if(!d.geometry)continue;const[m,h]=d.geometry.coordinates,g=Ie(v(m)),p=Ie(ee(h));s.push(g,p,1/0,i,-1,1),this.options.reduce&&s.push(0)}let c=this.trees[a+1]=this._createTree(s);r&&console.timeEnd(n);for(let i=a;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 a=Math.max(-90,Math.min(90,t[1]));let n=t[2]===180?180:((t[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)l=-180,n=180;else if(l>n){const h=this.getClusters([l,a,180,s],r),g=this.getClusters([-180,a,n,s],r);return h.concat(g)}const c=this.trees[this._limitZoom(r)],i=c.range(v(l),ee(s),v(n),ee(a)),d=c.data,m=[];for(const h of i){const g=this.stride*h;m.push(d[g+j]>1?Pe(d,g,this.clusterProps):this.points[d[g+L]])}return m}getChildren(t){const r=this._getOriginId(t),l=this._getOriginZoom(t),a="No cluster with the specified id.",n=this.trees[l];if(!n)throw new Error(a);const s=n.data;if(r*this.stride>=s.length)throw new Error(a);const c=this.options.radius/(this.options.extent*Math.pow(2,l-1)),i=s[r*this.stride],d=s[r*this.stride+1],m=n.within(i,d,c),h=[];for(const g of m){const p=g*this.stride;s[p+de]===t&&h.push(s[p+j]>1?Pe(s,p,this.clusterProps):this.points[s[p+L]])}if(h.length===0)throw new Error(a);return h}getLeaves(t,r,l){r=r||10,l=l||0;const a=[];return this._appendLeaves(a,t,r,l,0),a}getTile(t,r,l){const a=this.trees[this._limitZoom(t)],n=Math.pow(2,t),{extent:s,radius:c}=this.options,i=c/s,d=(l-i)/n,m=(l+1+i)/n,h={features:[]};return this._addTileFeatures(a.range((r-i)/n,d,(r+1+i)/n,m),a.data,r,l,n,h),r===0&&this._addTileFeatures(a.range(1-i/n,d,1,m),a.data,n,l,n,h),r===n-1&&this._addTileFeatures(a.range(0,d,i/n,m),a.data,-1,l,n,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,a,n){const s=this.getChildren(r);for(const c of s){const i=c.properties;if(i&&i.cluster?n+i.point_count<=a?n+=i.point_count:n=this._appendLeaves(t,i.cluster_id,l,a,n):n<a?n++:t.push(c),t.length===l)break}return n}_createTree(t){const r=new le(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,a,n,s){for(const c of t){const i=c*this.stride,d=r[i+j]>1;let m,h,g;if(d)m=Le(r,i,this.clusterProps),h=r[i],g=r[i+1];else{const b=this.points[r[i+L]];m=b.properties;const[w,C]=b.geometry.coordinates;h=v(w),g=ee(C)}const p={type:1,geometry:[[Math.round(this.options.extent*(h*n-l)),Math.round(this.options.extent*(g*n-a))]],tags:m};let f;d||this.options.generateId?f=r[i+L]:f=this.points[r[i+L]].id,f!==void 0&&(p.id=f),s.features.push(p)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const{radius:l,extent:a,reduce:n,minPoints:s}=this.options,c=l/(a*Math.pow(2,r)),i=t.data,d=[],m=this.stride;for(let h=0;h<i.length;h+=m){if(i[h+F]<=r)continue;i[h+F]=r;const g=i[h],p=i[h+1],f=t.within(i[h],i[h+1],c),b=i[h+j];let w=b;for(const C of f){const N=C*m;i[N+F]>r&&(w+=i[N+j])}if(w>b&&w>=s){let C=g*b,N=p*b,k,E=-1;const A=((h/m|0)<<5)+(r+1)+this.points.length;for(const B of f){const S=B*m;if(i[S+F]<=r)continue;i[S+F]=r;const D=i[S+j];C+=i[S]*D,N+=i[S+1]*D,i[S+de]=A,n&&(k||(k=this._map(i,h,!0),E=this.clusterProps.length,this.clusterProps.push(k)),n(k,this._map(i,S)))}i[h+de]=A,d.push(C/w,N/w,1/0,A,-1,w),n&&d.push(E)}else{for(let C=0;C<m;C++)d.push(i[h+C]);if(w>1)for(const C of f){const N=C*m;if(!(i[N+F]<=r)){i[N+F]=r;for(let k=0;k<m;k++)d.push(i[N+k])}}}}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+j]>1){const s=this.clusterProps[t[r+ze]];return l?Object.assign({},s):s}const a=this.points[t[r+L]].properties,n=this.options.map(a);return l&&n===a?Object.assign({},n):n}}function Pe(o,t,r){return{type:"Feature",id:o[t+L],properties:Le(o,t,r),geometry:{type:"Point",coordinates:[Jt(o[t]),Ht(o[t+1])]}}}function Le(o,t,r){const l=o[t+j],a=l>=1e4?`${Math.round(l/1e3)}k`:l>=1e3?`${Math.round(l/100)/10}k`:l,n=o[t+ze],s=n===-1?{}:Object.assign({},r[n]);return Object.assign(s,{cluster:!0,cluster_id:o[t+L],point_count:l,point_count_abbreviated:a})}function v(o){return o/360+.5}function ee(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 Jt(o){return(o-.5)*360}function Ht(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 me(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 a=0,l=Object.getOwnPropertySymbols(o);a<l.length;a++)t.indexOf(l[a])<0&&Object.prototype.propertyIsEnumerable.call(o,l[a])&&(r[l[a]]=o[l[a]]);return r}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,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 G{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(_.getPosition(r));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 Wt=(o,t,r,l)=>{const a=je(o.getBounds(),t,l);return r.filter(n=>a.contains(_.getPosition(n)))},je=(o,t,r)=>{const{northEast:l,southWest:a}=Kt(o,t),n=Yt({northEast:l,southWest:a},r);return Gt(n,t)},Me=(o,t,r)=>{const l=je(o,t,r),a=l.getNorthEast(),n=l.getSouthWest();return[n.lng(),n.lat(),a.lng(),a.lat()]},Kt=(o,t)=>({northEast:t.fromLatLngToDivPixel(o.getNorthEast()),southWest:t.fromLatLngToDivPixel(o.getSouthWest())}),Yt=({northEast:o,southWest:t},r)=>(o.x+=r,o.y-=r,t.x-=r,t.y+=r,{northEast:o,southWest:t}),Gt=({northEast:o,southWest:t},r)=>{const l=r.fromDivPixelToLatLng(t),a=r.fromDivPixelToLatLng(o);return new google.maps.LatLngBounds(l,a)};class Re{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Xt(t)}}class Zt extends Re{constructor(t){var{viewportPadding:r=60}=t,l=me(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:Wt(r,l,t,this.viewportPadding),map:r,mapCanvasProjection:l})}}}const Xt=o=>o.map(t=>new G({position:_.getPosition(t),markers:[t]}));class $t extends Re{constructor(t){var{maxZoom:r,radius:l=60}=t,a=me(t,["maxZoom","radius"]);super({maxZoom:r}),this.state={zoom:-1},this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:l},a))}calculate(t){let r=!1;const l={zoom:t.map.getZoom()};if(!z(t.markers,this.markers)){r=!0,this.markers=[...t.markers];const a=this.markers.map(n=>{const s=_.getPosition(n);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:n}}});this.superCluster.load(a)}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 G({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(n=>n.properties.marker),position:{lat:r,lng:t}});const a=l.marker;return new G({markers:[a],position:_.getPosition(a)})}}class vt extends Zt{constructor(t){var{maxZoom:r,radius:l=60,viewportPadding:a=60}=t,n=me(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:r,viewportPadding:a}),this.superCluster=new De(Object.assign({maxZoom:this.maxZoom,radius:l},n)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const r={zoom:Math.round(t.map.getZoom()),view:Me(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 a=this.markers.map(n=>{const s=_.getPosition(n);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:n}}});this.superCluster.load(a)}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:Me(t.getBounds(),r,this.viewportPadding)};return this.superCluster.getClusters(l.view,l.zoom).map(a=>this.transformCluster(a))}transformCluster({geometry:{coordinates:[t,r]},properties:l}){if(l.cluster)return new G({markers:this.superCluster.getLeaves(l.cluster_id,1/0).map(n=>n.properties.marker),position:{lat:r,lng:t}});const a=l.marker;return new G({markers:[a],position:_.getPosition(a)})}}class er{constructor(t,r){this.markers={sum:t.length};const l=r.map(n=>n.count),a=l.reduce((n,s)=>n+s,0);this.clusters={count:r.length,markers:{mean:a/r.length,sum:a,min:Math.min(...l),max:Math.max(...l)}}}}class tr{render({count:t,position:r},l,a){const n=`<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" fo