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.

1,676 lines (1,674 loc) 382 kB
import { createBlock as E, openBlock as u, resolveDynamicComponent as Ae, normalizeClass as S, withCtx as h, renderSlot as _e, createElementBlock as g, resolveComponent as y, createElementVNode as n, createVNode as l, createTextVNode as m, toDisplayString as p, createCommentVNode as w, Fragment as I, renderList as z, defineComponent as H, ref as L, provide as ie, watch as J, onMounted as Xe, onBeforeUnmount as se, toRef as $, inject as R, computed as he, markRaw as W, Comment as $e, normalizeProps as mt, guardReactiveProps as ht, withModifiers as F, withDirectives as et, vShow as gt, normalizeStyle as Y, vModelText as pt, createStaticVNode as pe, Transition as ft } from "vue"; const C = (r, e) => { const t = r.__vccOpts || r; for (const [i, a] of e) t[i] = a; return t; }, bt = { name: "BaseText", props: { tag: { type: String, default: "p", validator: (r) => ["h1", "h2", "h3", "h4", "h5", "h6", "p", "span", "div", "label"].includes(r) }, 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: (r) => ["thin", "light", "normal", "medium", "semibold", "bold"].includes(r) }, font: { type: String, default: "raleway" } }, computed: { textClasses() { const r = { 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" }, e = { thin: "font-thin", light: "font-light", normal: "font-normal", medium: "font-medium", semibold: "font-semibold", bold: "font-bold" }, t = this.smallSize && r[this.smallSize] ? r[this.smallSize] : r[this.size] || "", i = this.smallSize && r[this.size] ? `md:${r[this.size]}` : "", a = this.hoverColor ? `hover:text-${this.hoverColor}` : ""; return `${t} ${i} ${e[this.weight]} text-${this.color} ${a} font-${this.font}`; } } }; function yt(r, e, t, i, a, s) { return u(), E(Ae(t.tag), { class: S(s.textClasses) }, { default: h(() => [ _e(r.$slots, "default") ]), _: 3 }, 8, ["class"]); } const _ = /* @__PURE__ */ C(bt, [["render", yt]]), xt = { name: "Icon", props: { icon: { type: String, required: !0 }, color: { type: String, default: "primary", validator: (r) => ["primary", "secondary", "accent", "lineGrey"].includes(r) }, size: { type: String, default: "md", validator: (r) => ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl"].includes(r) }, type: { type: String, default: "fa-solid", validator: (r) => ["fa-thin", "fa-sharp", "fa-kit", "fa-brands", "fa-solid", "fa-regular"].includes(r) } }, 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 wt(r, e, t, i, a, s) { return u(), g("i", { class: S([t.type, t.icon, s.colorClasses, s.sizeClasses]), onClick: e[0] || (e[0] = (o) => r.$emit("click")) }, null, 2); } const j = /* @__PURE__ */ C(xt, [["render", wt]]), vt = { name: "BaseButton", components: { BaseText: _, Icon: j }, 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: (r) => ["primary", "secondary", "accent", "white"].includes(r) }, hoverColor: { type: String, default: null, validator: (r) => r === null || ["primary", "secondary", "accent"].includes(r) }, backgroundColor: { type: String, default: "primary", validator: (r) => ["primary", "secondary", "accent"].includes(r) }, border: { type: String, default: "none", validator: (r) => ["none", "primary", "secondary", "accent", "gradient1", "gradient2"].includes(r) }, padding: { type: String, default: "px-4 py-2" }, iconName: { type: String, default: "" }, iconColor: { type: String, default: "primary", validator: (r) => ["primary", "secondary", "accent"].includes(r) }, iconSize: { control: { type: "select", options: ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"] }, description: "Icon size" }, iconType: { type: String, default: "fa-solid", validator: (r) => ["fa-brands", "fa-solid", "fa-thin", "fa-sharp"].includes(r) }, align: { type: String, default: "center", validator: (r) => ["left", "center", "right", "between"].includes(r) } }, 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"; } } }, Ct = ["title", "aria-label"]; function St(r, e, t, i, a, s) { const o = y("BaseText"), c = y("Icon"); return u(), g("button", { class: S([ "group", "rounded-md transition duration-300 ease-in-out", s.paddingClass, s.backgroundClass, s.borderClass ]), title: t.altText || t.label, "aria-label": t.altText || t.label, onClick: e[0] || (e[0] = (d) => r.$emit("buttonClick")), onMouseenter: e[1] || (e[1] = (...d) => s.setHoverTextColor && s.setHoverTextColor(...d)), onMouseleave: e[2] || (e[2] = (...d) => s.setTextColor && s.setTextColor(...d)) }, [ n("div", { class: S(["flex items-center", s.alignmentClass, "space-x-2"]) }, [ l(o, { tag: "span", color: a.buttonTextColor, hoverColor: a.hoverTextColor, size: t.size, weight: t.weight }, { default: h(() => [ m(p(t.label), 1) ]), _: 1 }, 8, ["color", "hoverColor", "size", "weight"]), l(c, { icon: t.iconName, color: t.iconColor, size: t.iconSize, type: t.iconType }, null, 8, ["icon", "color", "size", "type"]) ], 2) ], 42, Ct); } const U = /* @__PURE__ */ C(vt, [["render", St]]), At = { name: "InputField", props: { type: { type: String, default: "text" }, placeholder: { type: String, default: "Search" }, modelValue: { type: String, default: "" }, color: { type: String, default: "primary", validator: (r) => ["primary", "secondary"].includes(r) }, textSize: { type: String, default: "text-md", validator: (r) => ["text-sm", "text-md", "text-lg", "text-xl", "text-2xl"].includes(r) } }, computed: { inputClass() { const r = "w-full border-b-2 focus:outline-none focus:border-accent px-2 hover:border-accent duration-300 ease-in-out", e = this.color === "primary" ? "bg-primary text-secondary border-secondary placeholder-secondary" : "bg-white text-primary border-secondary placeholder-primary", t = this.textSize; return `${r} ${e} ${t}`; } } }, kt = ["type", "placeholder", "value"]; function _t(r, e, t, i, a, s) { return u(), g("input", { type: t.type, placeholder: t.placeholder, value: t.modelValue, class: S([s.inputClass]), onInput: e[0] || (e[0] = (o) => r.$emit("update:modelValue", o.target.value)) }, null, 42, kt); } const xe = /* @__PURE__ */ C(At, [["render", _t]]), Tt = { name: "SearchBox", components: { InputField: xe, Icon: j }, 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); } } }, Bt = { class: "relative flex items-center w-full max-w-md" }; function It(r, e, t, i, a, s) { const o = y("InputField"), c = y("Icon"); return u(), g("div", Bt, [ l(o, { modelValue: a.searchQuery, "onUpdate:modelValue": e[0] || (e[0] = (d) => a.searchQuery = d), "text-size": t.textSize, placeholder: "Search", color: t.inputColor }, null, 8, ["modelValue", "text-size", "color"]), l(c, { icon: "fa-search", color: t.iconColor, size: t.iconSize, class: "absolute right-2", onClick: s.onSearch }, null, 8, ["color", "size", "onClick"]) ]); } const tt = /* @__PURE__ */ C(Tt, [["render", It]]), Et = { name: "BasicDropDown", emits: ["item-select"], components: { BaseText: _, Icon: j }, 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(r) { this.$emit("item-select", r), this.selectedItem = r, this.dropdownOpen = !1, document.body.style.overflow = ""; }, handleClickOutside(r) { this.dropdownOpen && !this.$refs.dropdownContainer.contains(r.target) && (this.dropdownOpen = !1, document.body.style.overflow = ""); } } }, zt = { key: 0, class: "absolute top-full mt-1 w-full bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 hidden md:block" }, Nt = ["onClick"], Lt = { key: 1, class: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 md:hidden" }, Pt = { class: "bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 w-3/4 max-w-lg p-6" }, jt = ["onClick"]; function Ot(r, e, t, i, a, s) { const o = y("BaseText"), c = y("Icon"); return u(), g("div", { class: S(`relative ${t.width}`), ref: "dropdownContainer" }, [ n("div", { onClick: e[0] || (e[0] = (...d) => s.toggleDropdown && s.toggleDropdown(...d)), class: "flex items-center cursor-pointer" }, [ l(o, { class: "border-b-2 border-transparent hover:border-accent pb-1 duration-300 ease-in-out", color: "primary", size: "xs md", tag: "p", weight: t.boldText ? "bold" : "normal" }, { default: h(() => [ m(p(a.selectedItem), 1) ]), _: 1 }, 8, ["weight"]), l(c, { icon: "fa-chevron-down", size: "sm", color: "primary", class: "ml-4" }) ]), a.dropdownOpen ? (u(), g("div", zt, [ n("ul", null, [ (u(!0), g(I, null, z(t.items, (d, f) => (u(), g("li", { key: d, onClick: (b) => s.selectWeapon(d), class: S([ "px-4 py-2 cursor-pointer hover:bg-hoverColor", f === 0 ? "rounded-t-lg" : "", f === t.items.length - 1 ? "rounded-b-lg" : "" ]) }, [ l(o, { color: "primary", size: "xs sm", tag: "p", weight: "bold" }, { default: h(() => [ m(p(d), 1) ]), _: 2 }, 1024) ], 10, Nt))), 128)) ]) ])) : w("", !0), a.dropdownOpen ? (u(), g("div", Lt, [ n("div", Pt, [ n("ul", null, [ (u(!0), g(I, null, z(t.items, (d) => (u(), g("li", { key: d, onClick: (f) => s.selectWeapon(d), class: "px-4 py-2 cursor-pointer hover:bg-hoverColor" }, [ l(o, { color: "primary", size: "xs sm", tag: "p", weight: "bold" }, { default: h(() => [ m(p(d), 1) ]), _: 2 }, 1024) ], 8, jt))), 128)) ]) ]) ])) : w("", !0) ], 2); } const Te = /* @__PURE__ */ C(Et, [["render", Ot]]), Mt = { name: "Calendar", components: { BaseText: _ }, props: { tournaments: { type: Array, default: () => [] } }, data() { return { currentMonth: (/* @__PURE__ */ new Date()).getMonth(), currentYear: (/* @__PURE__ */ new Date()).getFullYear(), weekdays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"] }; }, computed: { daysInMonth() { const r = new Date(this.currentYear, this.currentMonth + 1, 0).getDate(); return Array.from({ length: r }, (e, t) => t + 1); }, startDay() { const r = new Date(this.currentYear, this.currentMonth, 1).getDay(); return r === 0 ? 6 : r - 1; }, monthYear() { return new Date(this.currentYear, this.currentMonth).toLocaleString("default", { month: "long", year: "numeric" }); } }, methods: { hasTournament(r) { const e = `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`; return this.tournaments.some((t) => t.date === e); }, dayClicked(r) { if (this.hasTournament(r)) { const e = `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`; this.$emit("date-select", e); } }, prevMonth() { this.currentMonth === 0 ? (this.currentMonth = 11, this.currentYear--) : this.currentMonth--; }, nextMonth() { this.currentMonth === 11 ? (this.currentMonth = 0, this.currentYear++) : this.currentMonth++; } } }, Rt = { class: "w-80 h-80 p-6 bg-primary rounded-lg shadow-md" }, Dt = { class: "flex justify-between items-center mb-4" }, qt = { class: "grid grid-cols-7 gap-1 text-center font-bold text-sm text-gray-600 mb-2" }, Ft = { class: "grid grid-cols-7 gap-1 text-center" }, Ut = ["onClick"]; function Qt(r, e, t, i, a, s) { const o = y("BaseText"); return u(), g("div", Rt, [ n("div", Dt, [ l(o, { tag: "h2", size: "sm", weight: "normal", color: "secondary" }, { default: h(() => [ m(p(s.monthYear), 1) ]), _: 1 }), n("div", null, [ n("button", { onClick: e[0] || (e[0] = (...c) => s.prevMonth && s.prevMonth(...c)), class: "text-secondary hover:text-accent mr-4" }, " < "), n("button", { onClick: e[1] || (e[1] = (...c) => s.nextMonth && s.nextMonth(...c)), class: "text-secondary hover:text-accent" }, " > ") ]) ]), n("div", qt, [ (u(!0), g(I, null, z(a.weekdays, (c) => (u(), g("div", { key: c }, [ l(o, { tag: "p", size: "xs", weight: "bold", color: "secondary" }, { default: h(() => [ m(p(c), 1) ]), _: 2 }, 1024) ]))), 128)) ]), n("div", Ft, [ (u(!0), g(I, null, z(s.startDay, (c) => (u(), g("div", { key: "empty-" + c }))), 128)), (u(!0), g(I, null, z(s.daysInMonth, (c, d) => (u(), g("div", { key: "day-" + c, onClick: (f) => s.dayClicked(c), class: S(["flex justify-center items-center cursor-pointer p-2 rounded-full", { "bg-accent text-white": s.hasTournament(c), "hover:bg-gray-200": s.hasTournament(c), "text-gray-400": !s.hasTournament(c) }]) }, [ l(o, { tag: "p", size: "xs", weight: "thin", color: "secondary" }, { default: h(() => [ m(p(c), 1) ]), _: 2 }, 1024) ], 10, Ut))), 128)) ]) ]); } const Bm = /* @__PURE__ */ C(Mt, [["render", Qt]]); (function() { try { if (typeof document < "u") { var r = document.createElement("style"); r.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(r); } } catch (e) { console.error("vite-plugin-css-injected-by-js", e); } })(); var Vt = Object.defineProperty, Ht = (r, e, t) => e in r ? Vt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Pe = (r, e, t) => (Ht(r, typeof e != "symbol" ? e + "" : e, t), t); const oe = Symbol("map"), ae = Symbol("api"), Be = Symbol("marker"), Ie = Symbol("markerCluster"), we = Symbol("CustomMarker"), rt = Symbol("mapTilesLoaded"), de = [ "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 Jt(r, e, t, i) { function a(s) { return s instanceof t ? s : new t(function(o) { o(s); }); } return new (t || (t = Promise))(function(s, o) { function c(b) { try { f(i.next(b)); } catch (x) { o(x); } } function d(b) { try { f(i.throw(b)); } catch (x) { o(x); } } function f(b) { b.done ? s(b.value) : a(b.value).then(c, d); } f((i = i.apply(r, [])).next()); }); } var Wt = function r(e, t) { if (e === t) return !0; if (e && t && typeof e == "object" && typeof t == "object") { if (e.constructor !== t.constructor) return !1; var i, a, s; if (Array.isArray(e)) { if (i = e.length, i != t.length) return !1; for (a = i; a-- !== 0; ) if (!r(e[a], t[a])) return !1; return !0; } if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags; if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf(); if (e.toString !== Object.prototype.toString) return e.toString() === t.toString(); if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length) return !1; for (a = i; a-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, s[a])) return !1; for (a = i; a-- !== 0; ) { var o = s[a]; if (!r(e[o], t[o])) return !1; } return !0; } return e !== e && t !== t; }; const je = "__googleMapsScriptId"; var ne; (function(r) { r[r.INITIALIZED = 0] = "INITIALIZED", r[r.LOADING = 1] = "LOADING", r[r.SUCCESS = 2] = "SUCCESS", r[r.FAILURE = 3] = "FAILURE"; })(ne || (ne = {})); class te { /** * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set * using this library, instead the defaults are set by the Google Maps * JavaScript API server. * * ``` * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']}); * ``` */ constructor({ apiKey: e, authReferrerPolicy: t, channel: i, client: a, id: s = je, language: o, libraries: c = [], mapIds: d, nonce: f, region: b, retries: x = 3, url: v = "https://maps.googleapis.com/maps/api/js", version: k }) { if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = i, this.client = a, this.id = s || je, this.language = o, this.libraries = c, this.mapIds = d, this.nonce = f, this.region = b, this.retries = x, this.url = v, this.version = k, te.instance) { if (!Wt(this.options, te.instance.options)) throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(te.instance.options)}`); return te.instance; } te.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 ? ne.FAILURE : this.done ? ne.SUCCESS : this.loading ? ne.LOADING : ne.INITIALIZED; } get failed() { return this.done && !this.loading && this.errors.length >= this.retries + 1; } /** * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]]. * * @ignore * @deprecated */ createUrl() { let e = this.url; return e += "?callback=__googleMapsCallback", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `&region=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e; } deleteScript() { const e = document.getElementById(this.id); e && e.remove(); } /** * Load the Google Maps JavaScript API script and return a Promise. * @deprecated, use importLibrary() instead. */ load() { return this.loadPromise(); } /** * Load the Google Maps JavaScript API script and return a Promise. * * @ignore * @deprecated, use importLibrary() instead. */ loadPromise() { return new Promise((e, t) => { this.loadCallback((i) => { i ? t(i.error) : e(window.google); }); }); } importLibrary(e) { return this.execute(), google.maps.importLibrary(e); } /** * Load the Google Maps JavaScript API script with a callback. * @deprecated, use importLibrary() instead. */ loadCallback(e) { this.callbacks.push(e), this.execute(); } /** * Set the script on document. */ setScript() { var e, t; if (document.getElementById(this.id)) { this.callback(); return; } const i = { 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(i).forEach( // eslint-disable-next-line @typescript-eslint/no-explicit-any (s) => !i[s] && delete i[s] ), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((s) => { let o, c, d, f = "The Google Maps JavaScript API", b = "google", x = "importLibrary", v = "__ib__", k = document, A = window; A = A[b] || (A[b] = {}); const T = A.maps || (A.maps = {}), B = /* @__PURE__ */ new Set(), N = new URLSearchParams(), P = () => ( // @ts-ignore o || (o = new Promise((O, Q) => Jt(this, void 0, void 0, function* () { var D; yield c = k.createElement("script"), c.id = this.id, N.set("libraries", [...B] + ""); for (d in s) N.set(d.replace(/[A-Z]/g, (V) => "_" + V[0].toLowerCase()), s[d]); N.set("callback", b + ".maps." + v), c.src = this.url + "?" + N, T[v] = O, c.onerror = () => o = Q(Error(f + " could not load.")), c.nonce = this.nonce || ((D = k.querySelector("script[nonce]")) === null || D === void 0 ? void 0 : D.nonce) || "", k.head.append(c); }))) ); T[x] ? console.warn(f + " only loads once. Ignoring:", s) : T[x] = (O, ...Q) => B.add(O) && P().then(() => T[x](O, ...Q)); })(i); const a = this.libraries.map((s) => this.importLibrary(s)); a.length || a.push(this.importLibrary("core")), Promise.all(a).then(() => this.callback(), (s) => { const o = new ErrorEvent("error", { error: s }); this.loadErrorCallback(o); }); } /** * Reset the loader state. */ reset() { this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null; } resetIfRetryingFailed() { this.failed && this.reset(); } loadErrorCallback(e) { if (this.errors.push(e), this.errors.length <= this.retries) { const t = this.errors.length * Math.pow(2, this.errors.length); console.error(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => { this.deleteScript(), this.setScript(); }, t); } else this.onerrorEvent = e, this.callback(); } callback() { this.done = !0, this.loading = !1, this.callbacks.forEach((e) => { e(this.onerrorEvent); }), this.callbacks = []; } execute() { if (this.resetIfRetryingFailed(), this.done) this.callback(); else { if (window.google && window.google.maps && window.google.maps.version) { console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."), this.callback(); return; } this.loading || (this.loading = !0, this.setScript()); } } } function Kt(r) { return class extends r.OverlayView { constructor(e) { super(), Pe(this, "element"), Pe(this, "opts"); const { element: t, ...i } = e; this.element = t, this.opts = i, this.opts.map && this.setMap(this.opts.map); } getPosition() { return this.opts.position ? this.opts.position instanceof r.LatLng ? this.opts.position : new r.LatLng(this.opts.position) : null; } getVisible() { if (!this.element) return !1; const e = this.element; return e.style.display !== "none" && e.style.visibility !== "hidden" && (e.style.opacity === "" || Number(e.style.opacity) > 0.01); } onAdd() { if (!this.element) return; const e = this.getPanes(); e && e.overlayMouseTarget.appendChild(this.element); } draw() { if (!this.element) return; const e = this.getProjection(), t = e == null ? void 0 : e.fromLatLngToDivPixel(this.getPosition()); if (t) { this.element.style.position = "absolute"; let i, a; switch (this.opts.anchorPoint) { case "TOP_CENTER": i = "-50%", a = "-100%"; break; case "BOTTOM_CENTER": i = "-50%", a = "0"; break; case "LEFT_CENTER": i = "-100%", a = "-50%"; break; case "RIGHT_CENTER": i = "0", a = "-50%"; break; case "TOP_LEFT": i = "-100%", a = "-100%"; break; case "TOP_RIGHT": i = "0", a = "-100%"; break; case "BOTTOM_LEFT": i = "-100%", a = "0"; break; case "BOTTOM_RIGHT": i = "0", a = "0"; break; default: i = "-50%", a = "-50%"; } const s = t.x + (this.opts.offsetX || 0) + "px", o = t.y + (this.opts.offsetY || 0) + "px"; this.element.style.transform = `translateX(${i}) translateX(${s}) translateY(${a}) translateY(${o})`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString()); } } onRemove() { this.element && this.element.remove(); } setOptions(e) { const { element: t, ...i } = e; this.element = t, this.opts = i, this.draw(); } }; } let Oe; const Me = [ "bounds_changed", "center_changed", "click", "contextmenu", "dblclick", "drag", "dragend", "dragstart", "heading_changed", "idle", "isfractionalzoomenabled_changed", "mapcapabilities_changed", "maptypeid_changed", "mousemove", "mouseout", "mouseover", "projection_changed", "renderingtype_changed", "rightclick", "tilesloaded", "tilt_changed", "zoom_changed" ], Yt = H({ 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: Me, setup(r, { emit: e }) { const t = L(), i = L(!1), a = L(), s = L(), o = L(!1); ie(oe, a), ie(ae, s), ie(rt, o); const c = () => { const x = { ...r }; Object.keys(x).forEach((A) => { x[A] === void 0 && delete x[A]; }); const v = (A) => { var T; return A ? { position: (T = s.value) == null ? void 0 : T.ControlPosition[A] } : {}; }, k = { scaleControlOptions: r.scaleControlStyle ? { style: r.scaleControlStyle } : {}, panControlOptions: v(r.panControlPosition), zoomControlOptions: v(r.zoomControlPosition), rotateControlOptions: v(r.rotateControlPosition), streetViewControlOptions: v(r.streetViewControlPosition), fullscreenControlOptions: v(r.fullscreenControlPosition), disableDefaultUI: r.disableDefaultUi }; return { ...x, ...k }; }, d = J( [s, a], ([x, v]) => { const k = x, A = v; k && A && (k.event.addListenerOnce(A, "tilesloaded", () => { o.value = !0; }), setTimeout(d, 0)); }, { immediate: !0 } ), f = () => { try { const { apiKey: x, region: v, version: k, language: A, libraries: T, nonce: B } = r; Oe = new te({ apiKey: x, region: v, version: k, language: A, libraries: T, nonce: B }); } catch (x) { console.error(x); } }, b = (x) => { s.value = W(x.maps), a.value = W(new x.maps.Map(t.value, c())); const v = Kt(s.value); s.value[we] = v, Me.forEach((A) => { var T; (T = a.value) == null || T.addListener(A, (B) => e(A, B)); }), i.value = !0; const k = Object.keys(r).filter( (A) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(A) ).map((A) => $(r, A)); J( [() => r.center, () => r.zoom, ...k], ([A, T], [B, N]) => { var P, O, Q; const { center: D, zoom: V, ...q } = c(); (P = a.value) == null || P.setOptions(q), T !== void 0 && T !== N && ((O = a.value) == null || O.setZoom(T)); const fe = !B || A.lng !== B.lng || A.lat !== B.lat; A && fe && ((Q = a.value) == null || Q.panTo(A)); } ); }; return Xe(() => { r.apiPromise && r.apiPromise instanceof Promise ? r.apiPromise.then(b) : (f(), Oe.load().then(b)); }), se(() => { var x; o.value = !1, a.value && ((x = s.value) == null || x.event.clearInstanceListeners(a.value)); }), { mapRef: t, ready: i, map: a, api: s, mapTilesLoaded: o }; } }), Zt = (r, e) => { const t = r.__vccOpts || r; for (const [i, a] of e) t[i] = a; return t; }, Gt = { ref: "mapRef", class: "mapdiv" }; function Xt(r, e, t, i, a, s) { return u(), g("div", null, [ n("div", Gt, null, 512), _e(r.$slots, "default", mt(ht({ ready: r.ready, map: r.map, api: r.api, mapTilesLoaded: r.mapTilesLoaded })), void 0, !0) ]); } const $t = /* @__PURE__ */ Zt(Yt, [["render", Xt], ["__scopeId", "data-v-d05fc6bc"]]); function er(r) { return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r; } var tr = function r(e, t) { if (e === t) return !0; if (e && t && typeof e == "object" && typeof t == "object") { if (e.constructor !== t.constructor) return !1; var i, a, s; if (Array.isArray(e)) { if (i = e.length, i != t.length) return !1; for (a = i; a-- !== 0; ) if (!r(e[a], t[a])) return !1; return !0; } if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags; if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf(); if (e.toString !== Object.prototype.toString) return e.toString() === t.toString(); if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length) return !1; for (a = i; a-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, s[a])) return !1; for (a = i; a-- !== 0; ) { var o = s[a]; if (!r(e[o], t[o])) return !1; } return !0; } return e !== e && t !== t; }; const Z = /* @__PURE__ */ er(tr), Re = ["click", "drag", "dragend", "dragstart", "gmp-click"], rr = H({ name: "AdvancedMarker", props: { options: { type: Object, required: !0 }, pinOptions: { type: Object, required: !1 } }, emits: Re, setup(r, { emit: e, expose: t, slots: i }) { const a = $(r, "options"), s = $(r, "pinOptions"), o = L(), c = R(oe, L()), d = R(ae, L()), f = R(Ie, L()), b = he( () => !!(f.value && d.value && o.value instanceof google.maps.marker.AdvancedMarkerElement) ); return J( [c, a, s], async (x, [v, k, A]) => { var T, B, N; const P = !Z(a.value, k) || !Z(s.value, A) || c.value !== v; if (!c.value || !d.value || !P) return; const { AdvancedMarkerElement: O, PinElement: Q } = d.value.marker; if (o.value) { const { map: D, content: V, ...q } = a.value; Object.assign(o.value, { content: s.value ? new Q(s.value).element : V, ...q }), b.value && ((T = f.value) == null || T.removeMarker(o.value), (B = f.value) == null || B.addMarker(o.value)); } else s.value && (a.value.content = new Q(s.value).element), o.value = W(new O(a.value)), b.value ? (N = f.value) == null || N.addMarker(o.value) : o.value.map = c.value, Re.forEach((D) => { var V; (V = o.value) == null || V.addListener(D, (q) => e(D, q)); }); }, { immediate: !0 } ), se(() => { var x, v; o.value && ((x = d.value) == null || x.event.clearInstanceListeners(o.value), b.value ? (v = f.value) == null || v.removeMarker(o.value) : o.value.map = null); }), ie(Be, o), t({ marker: o }), () => { var x; return (x = i.default) == null ? void 0 : x.call(i); }; } }), sr = (r) => r === "Marker", or = (r) => r === we, ce = (r, e, t, i) => { const a = L(), s = R(oe, L()), o = R(ae, L()), c = R(Ie, L()), d = he( () => !!(c.value && o.value && (a.value instanceof o.value.Marker || a.value instanceof o.value[we])) ); return J( [s, t], (f, [b, x]) => { var v, k, A; const T = !Z(t.value, x) || s.value !== b; !s.value || !o.value || !T || (a.value ? (a.value.setOptions(t.value), d.value && ((v = c.value) == null || v.removeMarker(a.value), (k = c.value) == null || k.addMarker(a.value))) : (sr(r) ? a.value = W( new o.value[r](t.value) ) : or(r) ? a.value = W( new o.value[r](t.value) ) : a.value = W( new o.value[r]({ ...t.value, map: s.value }) ), d.value ? (A = c.value) == null || A.addMarker(a.value) : a.value.setMap(s.value), e.forEach((B) => { var N; (N = a.value) == null || N.addListener(B, (P) => i(B, P)); }))); }, { immediate: !0 } ), se(() => { var f, b; a.value && ((f = o.value) == null || f.event.clearInstanceListeners(a.value), d.value ? (b = c.value) == null || b.removeMarker(a.value) : a.value.setMap(null)); }), a; }, De = [ "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" ]; H({ name: "Marker", props: { options: { type: Object, required: !0 } }, emits: De, setup(r, { emit: e, expose: t, slots: i }) { const a = $(r, "options"), s = ce("Marker", De, a, e); return ie(Be, s), t({ marker: s }), () => { var o; return (o = i.default) == null ? void 0 : o.call(i); }; } }); H({ name: "Polyline", props: { options: { type: Object, required: !0 } }, emits: de, setup(r, { emit: e }) { const t = $(r, "options"); return { polyline: ce("Polyline", de, t, e) }; }, render: () => null }); H({ name: "Polygon", props: { options: { type: Object, required: !0 } }, emits: de, setup(r, { emit: e }) { const t = $(r, "options"); return { polygon: ce("Polygon", de, t, e) }; }, render: () => null }); const qe = de.concat(["bounds_changed"]); H({ name: "Rectangle", props: { options: { type: Object, required: !0 } }, emits: qe, setup(r, { emit: e }) { const t = $(r, "options"); return { rectangle: ce("Rectangle", qe, t, e) }; }, render: () => null }); const Fe = de.concat(["center_changed", "radius_changed"]); H({ name: "Circle", props: { options: { type: Object, required: !0 } }, emits: Fe, setup(r, { emit: e }) { const t = $(r, "options"); return { circle: ce("Circle", Fe, t, e) }; }, render: () => null }); H({ props: { position: { type: String, required: !0 }, index: { type: Number, default: 1 } }, emits: ["content:loaded"], setup(r, { emit: e }) { const t = L(null), i = R(oe, L()), a = R(ae, L()), s = R(rt, L(!1)), o = J( [s, a, t], ([f, b, x]) => { b && f && x && (c(r.position), e("content:loaded"), setTimeout(o, 0)); }, { immediate: !0 } ), c = (f) => { if (i.value && a.value && t.value) { const b = a.value.ControlPosition[f]; i.value.controls[b].push(t.value); } }, d = (f) => { if (i.value && a.value) { let b = null; const x = a.value.ControlPosition[f]; i.value.controls[x].forEach((v, k) => { v === t.value && (b = k); }), b !== null && i.value.controls[x].removeAt(b); } }; return se(() => d(r.position)), J( () => r.position, (f, b) => { d(b), c(f); } ), J( () => r.index, (f) => { f && t.value && (t.value.index = r.index); } ), { controlRef: t }; } }); const Ue = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"]; H({ inheritAttrs: !1, props: { options: { type: Object, default: () => ({}) }, modelValue: { type: Boolean } }, emits: [...Ue, "update:modelValue"], setup(r, { slots: e, emit: t, expose: i }) { const a = L(), s = L(), o = R(oe, L()), c = R(ae, L()), d = R(Be, L()); let f, b = r.modelValue; const x = he(() => { var T; return (T = e.default) == null ? void 0 : T.call(e).some((B) => B.type !== $e); }), v = (T) => { b = T, t("update:modelValue", T); }, k = (T) => { a.value && (a.value.open({ map: o.value, anchor: d.value, ...T }), v(!0)); }, A = () => { a.value && (a.value.close(), v(!1)); }; return Xe(() => { J( [o, () => r.options], ([T, B], [N, P]) => { var O; const Q = !Z(B, P) || o.value !== N; o.value && c.value && Q && (a.value ? (a.value.setOptions({ ...B, content: x.value ? s.value : B.content }), d.value || k()) : (a.value = W( new c.value.InfoWindow({ ...B, content: x.value ? s.value : B.content }) ), d.value && (f = d.value.addListener("click", () => { k(); })), (!d.value || b) && k(), Ue.forEach((D) => { var V; (V = a.value) == null || V.addListener(D, (q) => t(D, q)); }), (O = a.value) == null || O.addListener("closeclick", () => v(!1)))); }, { immediate: !0 } ), J( () => r.modelValue, (T) => { T !== b && (T ? k() : A()); } ); }), se(() => { var T; f && f.remove(), a.value && ((T = c.value) == null || T.event.clearInstanceListeners(a.value), A()); }), i({ infoWindow: a, open: k, close: A }), { infoWindow: a, infoWindowRef: s, hasSlotContent: x, open: k, close: A }; } }); const Qe = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ], ve = 1, ue = 8; class Ee { /** * Creates an index from raw `ArrayBuffer` data. * @param {ArrayBuffer} data */ static from(e) { if (!(e instanceof ArrayBuffer)) throw new Error("Data must be an instance of ArrayBuffer."); const [t, i] = new Uint8Array(e, 0, 2); if (t !== 219) throw new Error("Data does not appear to be in a KDBush format."); const a = i >> 4; if (a !== ve) throw new Error(`Got v${a} data when expected v${ve}.`); const s = Qe[i & 15]; if (!s) throw new Error("Unrecognized array type."); const [o] = new Uint16Array(e, 2, 1), [c] = new Uint32Array(e, 4, 1); return new Ee(c, o, s, e); } /** * Creates an index that will hold a given number of items. * @param {number} numItems * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default). * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default). * @param {ArrayBuffer} [data] (For internal use only) */ constructor(e, t = 64, i = Float64Array, a) { if (isNaN(e) || e < 0) throw new Error(`Unpexpected numItems value: ${e}.`); this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = i, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array; const s = Qe.indexOf(this.ArrayType), o = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, c = e * this.IndexArrayType.BYTES_PER_ELEMENT, d = (8 - c % 8) % 8; if (s < 0) throw new Error(`Unexpected typed array class: ${i}.`); a && a instanceof ArrayBuffer ? (this.data = a, this.ids = new this.IndexArrayType(this.data, ue, e), this.coords = new this.ArrayType(this.data, ue + c + d, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(ue + o + c + d), this.ids = new this.IndexArrayType(this.data, ue, e), this.coords = new this.ArrayType(this.data, ue + c + d, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (ve << 4) + s]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e); } /** * Add a point to the index. * @param {number} x * @param {number} y * @returns {number} An incremental index associated with the added item (starting from `0`). */ add(e, t) { const i = this._pos >> 1; return this.ids[i] = i, this.coords[this._pos++] = e, this.coords[this._pos++] = t, i; } /** * Perform indexing of the added points. */ finish() { const e = this._pos >> 1; if (e !== this.numItems) throw new Error(`Added ${e} items when expected ${this.n