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) 396 kB
import { openBlock as h, createBlock as E, resolveDynamicComponent as Ce, normalizeClass as _, withCtx as u, renderSlot as Ee, createElementBlock as f, resolveComponent as x, createElementVNode as a, createVNode as d, createTextVNode as m, toDisplayString as p, Fragment as T, renderList as P, createCommentVNode as C, defineComponent as J, ref as N, provide as de, watch as H, onMounted as st, onBeforeUnmount as ne, toRef as te, inject as Q, computed as pe, markRaw as W, Comment as ot, normalizeProps as vt, guardReactiveProps as Ct, withModifiers as V, withDirectives as nt, vShow as At, normalizeStyle as Y, vModelText as St, createStaticVNode as ye, Transition as it } from "vue"; const S = (r, e) => { const t = r.__vccOpts || r; for (const [i, n] of e) t[i] = n; return t; }, kt = { 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]}` : "", n = this.hoverColor ? `hover:text-${this.hoverColor}` : ""; return `${t} ${i} ${e[this.weight]} text-${this.color} ${n} font-${this.font}`; } } }; function _t(r, e, t, i, n, s) { return h(), E(Ce(t.tag), { class: _(s.textClasses) }, { default: u(() => [ Ee(r.$slots, "default") ]), _: 3 }, 8, ["class"]); } const B = /* @__PURE__ */ S(kt, [["render", _t]]), Bt = { 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 It(r, e, t, i, n, s) { return h(), f("i", { class: _([t.type, t.icon, s.colorClasses, s.sizeClasses]), onClick: e[0] || (e[0] = (o) => r.$emit("click")) }, null, 2); } const O = /* @__PURE__ */ S(Bt, [["render", It]]), Tt = { name: "BaseButton", components: { BaseText: B, Icon: O }, 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"; } } }, Et = ["title", "aria-label"]; function zt(r, e, t, i, n, s) { const o = x("BaseText"), c = x("Icon"); return h(), f("button", { class: _([ "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] = (l) => r.$emit("buttonClick")), onMouseenter: e[1] || (e[1] = (...l) => s.setHoverTextColor && s.setHoverTextColor(...l)), onMouseleave: e[2] || (e[2] = (...l) => s.setTextColor && s.setTextColor(...l)) }, [ a("div", { class: _(["flex items-center", s.alignmentClass, "space-x-2"]) }, [ d(o, { tag: "span", color: n.buttonTextColor, hoverColor: n.hoverTextColor, size: t.size, weight: t.weight }, { default: u(() => [ m(p(t.label), 1) ]), _: 1 }, 8, ["color", "hoverColor", "size", "weight"]), d(c, { icon: t.iconName, color: t.iconColor, size: t.iconSize, type: t.iconType }, null, 8, ["icon", "color", "size", "type"]) ], 2) ], 42, Et); } const F = /* @__PURE__ */ S(Tt, [["render", zt]]), Pt = { 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}`; } } }, Nt = ["type", "placeholder", "value"]; function Lt(r, e, t, i, n, s) { return h(), f("input", { type: t.type, placeholder: t.placeholder, value: t.modelValue, class: _([s.inputClass]), onInput: e[0] || (e[0] = (o) => r.$emit("update:modelValue", o.target.value)) }, null, 42, Nt); } const Se = /* @__PURE__ */ S(Pt, [["render", Lt]]), jt = { name: "SearchBox", components: { InputField: Se, Icon: O }, 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); } } }, Ot = { class: "relative flex items-center w-full max-w-md" }; function Mt(r, e, t, i, n, s) { const o = x("InputField"), c = x("Icon"); return h(), f("div", Ot, [ d(o, { modelValue: n.searchQuery, "onUpdate:modelValue": e[0] || (e[0] = (l) => n.searchQuery = l), "text-size": t.textSize, placeholder: "Search", color: t.inputColor }, null, 8, ["modelValue", "text-size", "color"]), d(c, { icon: "fa-search", color: t.iconColor, size: t.iconSize, class: "absolute right-2", onClick: s.onSearch }, null, 8, ["color", "size", "onClick"]) ]); } const at = /* @__PURE__ */ S(jt, [["render", Mt]]), Rt = { name: "BasicDropDown", emits: ["item-select"], components: { BaseText: B, Icon: O }, 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 = ""); } } }, Dt = { key: 0, class: "absolute top-full mt-1 w-full bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 hidden md:block" }, qt = ["onClick"], Ut = { key: 1, class: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 md:hidden" }, Qt = { class: "bg-secondary border rounded-lg border-lineGrey shadow-xl z-50 w-3/4 max-w-lg p-6" }, Vt = ["onClick"]; function Ft(r, e, t, i, n, s) { const o = x("BaseText"), c = x("Icon"); return h(), f("div", { class: _(`relative ${t.width}`), ref: "dropdownContainer" }, [ a("div", { onClick: e[0] || (e[0] = (...l) => s.toggleDropdown && s.toggleDropdown(...l)), class: "flex items-center cursor-pointer" }, [ d(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: u(() => [ m(p(n.selectedItem), 1) ]), _: 1 }, 8, ["weight"]), d(c, { icon: "fa-chevron-down", size: "sm", color: "primary", class: "ml-4" }) ]), n.dropdownOpen ? (h(), f("div", Dt, [ a("ul", null, [ (h(!0), f(T, null, P(t.items, (l, g) => (h(), f("li", { key: l, onClick: (b) => s.selectWeapon(l), class: _([ "px-4 py-2 cursor-pointer hover:bg-hoverColor", g === 0 ? "rounded-t-lg" : "", g === t.items.length - 1 ? "rounded-b-lg" : "" ]) }, [ d(o, { color: "primary", size: "xs sm", tag: "p", weight: "bold" }, { default: u(() => [ m(p(l), 1) ]), _: 2 }, 1024) ], 10, qt))), 128)) ]) ])) : C("", !0), n.dropdownOpen ? (h(), f("div", Ut, [ a("div", Qt, [ a("ul", null, [ (h(!0), f(T, null, P(t.items, (l) => (h(), f("li", { key: l, onClick: (g) => s.selectWeapon(l), class: "px-4 py-2 cursor-pointer hover:bg-hoverColor" }, [ d(o, { color: "primary", size: "xs sm", tag: "p", weight: "bold" }, { default: u(() => [ m(p(l), 1) ]), _: 2 }, 1024) ], 8, Vt))), 128)) ]) ]) ])) : C("", !0) ], 2); } const ze = /* @__PURE__ */ S(Rt, [["render", Ft]]), Jt = { name: "Calendar", components: { BaseText: B }, 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++; } } }, Ht = { class: "w-80 h-80 p-6 bg-primary rounded-lg shadow-md" }, Wt = { 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" }, Yt = { class: "grid grid-cols-7 gap-1 text-center" }, Gt = ["onClick"]; function Zt(r, e, t, i, n, s) { const o = x("BaseText"); return h(), f("div", Ht, [ a("div", Wt, [ d(o, { tag: "h2", size: "sm", weight: "normal", color: "secondary" }, { default: u(() => [ m(p(s.monthYear), 1) ]), _: 1 }), a("div", null, [ a("button", { onClick: e[0] || (e[0] = (...c) => s.prevMonth && s.prevMonth(...c)), class: "text-secondary hover:text-accent mr-4" }, " < "), a("button", { onClick: e[1] || (e[1] = (...c) => s.nextMonth && s.nextMonth(...c)), class: "text-secondary hover:text-accent" }, " > ") ]) ]), a("div", Kt, [ (h(!0), f(T, null, P(n.weekdays, (c) => (h(), f("div", { key: c }, [ d(o, { tag: "p", size: "xs", weight: "bold", color: "secondary" }, { default: u(() => [ m(p(c), 1) ]), _: 2 }, 1024) ]))), 128)) ]), a("div", Yt, [ (h(!0), f(T, null, P(s.startDay, (c) => (h(), f("div", { key: "empty-" + c }))), 128)), (h(!0), f(T, null, P(s.daysInMonth, (c, l) => (h(), f("div", { key: "day-" + c, onClick: (g) => s.dayClicked(c), class: _(["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) }]) }, [ d(o, { tag: "p", size: "xs", weight: "thin", color: "secondary" }, { default: u(() => [ m(p(c), 1) ]), _: 2 }, 1024) ], 10, Gt))), 128)) ]) ]); } const yh = /* @__PURE__ */ S(Jt, [["render", Zt]]); (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 Xt = Object.defineProperty, $t = (r, e, t) => e in r ? Xt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, De = (r, e, t) => ($t(r, typeof e != "symbol" ? e + "" : e, t), t); const ie = Symbol("map"), ae = Symbol("api"), Pe = Symbol("marker"), Ne = Symbol("markerCluster"), ke = Symbol("CustomMarker"), lt = Symbol("mapTilesLoaded"), ue = [ "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 er(r, e, t, i) { function n(s) { return s instanceof t ? s : new t(function(o) { o(s); }); } return new (t || (t = Promise))(function(s, o) { function c(b) { try { g(i.next(b)); } catch (y) { o(y); } } function l(b) { try { g(i.throw(b)); } catch (y) { o(y); } } function g(b) { b.done ? s(b.value) : n(b.value).then(c, l); } g((i = i.apply(r, [])).next()); }); } 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, n, s; if (Array.isArray(e)) { if (i = e.length, i != t.length) return !1; for (n = i; n-- !== 0; ) if (!r(e[n], t[n])) return !1; return !0; } if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags; if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf(); if (e.toString !== Object.prototype.toString) return e.toString() === t.toString(); if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length) return !1; for (n = i; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1; for (n = i; n-- !== 0; ) { var o = s[n]; if (!r(e[o], t[o])) return !1; } return !0; } return e !== e && t !== t; }; const qe = "__googleMapsScriptId"; var le; (function(r) { r[r.INITIALIZED = 0] = "INITIALIZED", r[r.LOADING = 1] = "LOADING", r[r.SUCCESS = 2] = "SUCCESS", r[r.FAILURE = 3] = "FAILURE"; })(le || (le = {})); class se { /** * 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: n, id: s = qe, language: o, libraries: c = [], mapIds: l, nonce: g, region: b, retries: y = 3, url: w = "https://maps.googleapis.com/maps/api/js", version: v }) { if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = i, this.client = n, this.id = s || qe, this.language = o, this.libraries = c, this.mapIds = l, this.nonce = g, this.region = b, this.retries = y, this.url = w, this.version = v, se.instance) { if (!tr(this.options, se.instance.options)) throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(se.instance.options)}`); return se.instance; } se.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 ? le.FAILURE : this.done ? le.SUCCESS : this.loading ? le.LOADING : le.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, l, g = "The Google Maps JavaScript API", b = "google", y = "importLibrary", w = "__ib__", v = document, A = window; A = A[b] || (A[b] = {}); const k = A.maps || (A.maps = {}), I = /* @__PURE__ */ new Set(), z = new URLSearchParams(), L = () => ( // @ts-ignore o || (o = new Promise((j, R) => er(this, void 0, void 0, function* () { var q; yield c = v.createElement("script"), c.id = this.id, z.set("libraries", [...I] + ""); for (l in s) z.set(l.replace(/[A-Z]/g, (M) => "_" + M[0].toLowerCase()), s[l]); z.set("callback", b + ".maps." + w), c.src = this.url + "?" + z, k[w] = j, c.onerror = () => o = R(Error(g + " could not load.")), c.nonce = this.nonce || ((q = v.querySelector("script[nonce]")) === null || q === void 0 ? void 0 : q.nonce) || "", v.head.append(c); }))) ); k[y] ? console.warn(g + " only loads once. Ignoring:", s) : k[y] = (j, ...R) => I.add(j) && L().then(() => k[y](j, ...R)); })(i); const n = this.libraries.map((s) => this.importLibrary(s)); n.length || n.push(this.importLibrary("core")), Promise.all(n).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 rr(r) { return class extends r.OverlayView { constructor(e) { super(), De(this, "element"), De(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, n; switch (this.opts.anchorPoint) { case "TOP_CENTER": i = "-50%", n = "-100%"; break; case "BOTTOM_CENTER": i = "-50%", n = "0"; break; case "LEFT_CENTER": i = "-100%", n = "-50%"; break; case "RIGHT_CENTER": i = "0", n = "-50%"; break; case "TOP_LEFT": i = "-100%", n = "-100%"; break; case "TOP_RIGHT": i = "0", n = "-100%"; break; case "BOTTOM_LEFT": i = "-100%", n = "0"; break; case "BOTTOM_RIGHT": i = "0", n = "0"; break; default: i = "-50%", n = "-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(${n}) 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 Ue; const Qe = [ "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" ], sr = J({ 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: Qe, setup(r, { emit: e }) { const t = N(), i = N(!1), n = N(), s = N(), o = N(!1); de(ie, n), de(ae, s), de(lt, o); const c = () => { const y = { ...r }; Object.keys(y).forEach((A) => { y[A] === void 0 && delete y[A]; }); const w = (A) => { var k; return A ? { position: (k = s.value) == null ? void 0 : k.ControlPosition[A] } : {}; }, v = { scaleControlOptions: r.scaleControlStyle ? { style: r.scaleControlStyle } : {}, panControlOptions: w(r.panControlPosition), zoomControlOptions: w(r.zoomControlPosition), rotateControlOptions: w(r.rotateControlPosition), streetViewControlOptions: w(r.streetViewControlPosition), fullscreenControlOptions: w(r.fullscreenControlPosition), disableDefaultUI: r.disableDefaultUi }; return { ...y, ...v }; }, l = H( [s, n], ([y, w]) => { const v = y, A = w; v && A && (v.event.addListenerOnce(A, "tilesloaded", () => { o.value = !0; }), setTimeout(l, 0)); }, { immediate: !0 } ), g = () => { try { const { apiKey: y, region: w, version: v, language: A, libraries: k, nonce: I } = r; Ue = new se({ apiKey: y, region: w, version: v, language: A, libraries: k, nonce: I }); } catch (y) { console.error(y); } }, b = (y) => { s.value = W(y.maps), n.value = W(new y.maps.Map(t.value, c())); const w = rr(s.value); s.value[ke] = w, Qe.forEach((A) => { var k; (k = n.value) == null || k.addListener(A, (I) => e(A, I)); }), i.value = !0; const v = Object.keys(r).filter( (A) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(A) ).map((A) => te(r, A)); H( [() => r.center, () => r.zoom, ...v], ([A, k], [I, z]) => { var L, j, R; const { center: q, zoom: M, ...D } = c(); (L = n.value) == null || L.setOptions(D), k !== void 0 && k !== z && ((j = n.value) == null || j.setZoom(k)); const G = !I || A.lng !== I.lng || A.lat !== I.lat; A && G && ((R = n.value) == null || R.panTo(A)); } ); }; return st(() => { r.apiPromise && r.apiPromise instanceof Promise ? r.apiPromise.then(b) : (g(), Ue.load().then(b)); }), ne(() => { var y; o.value = !1, n.value && ((y = s.value) == null || y.event.clearInstanceListeners(n.value)); }), { mapRef: t, ready: i, map: n, api: s, mapTilesLoaded: o }; } }), or = (r, e) => { const t = r.__vccOpts || r; for (const [i, n] of e) t[i] = n; return t; }, nr = { ref: "mapRef", class: "mapdiv" }; function ir(r, e, t, i, n, s) { return h(), f("div", null, [ a("div", nr, null, 512), Ee(r.$slots, "default", vt(Ct({ ready: r.ready, map: r.map, api: r.api, mapTilesLoaded: r.mapTilesLoaded })), void 0, !0) ]); } const ar = /* @__PURE__ */ or(sr, [["render", ir], ["__scopeId", "data-v-d05fc6bc"]]); function lr(r) { return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r; } var dr = 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, n, s; if (Array.isArray(e)) { if (i = e.length, i != t.length) return !1; for (n = i; n-- !== 0; ) if (!r(e[n], t[n])) return !1; return !0; } if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags; if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf(); if (e.toString !== Object.prototype.toString) return e.toString() === t.toString(); if (s = Object.keys(e), i = s.length, i !== Object.keys(t).length) return !1; for (n = i; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1; for (n = i; n-- !== 0; ) { var o = s[n]; if (!r(e[o], t[o])) return !1; } return !0; } return e !== e && t !== t; }; const X = /* @__PURE__ */ lr(dr), Ve = ["click", "drag", "dragend", "dragstart", "gmp-click"], cr = J({ name: "AdvancedMarker", props: { options: { type: Object, required: !0 }, pinOptions: { type: Object, required: !1 } }, emits: Ve, setup(r, { emit: e, expose: t, slots: i }) { const n = te(r, "options"), s = te(r, "pinOptions"), o = N(), c = Q(ie, N()), l = Q(ae, N()), g = Q(Ne, N()), b = pe( () => !!(g.value && l.value && o.value instanceof google.maps.marker.AdvancedMarkerElement) ); return H( [c, n, s], async (y, [w, v, A]) => { var k, I, z; const L = !X(n.value, v) || !X(s.value, A) || c.value !== w; if (!c.value || !l.value || !L) return; const { AdvancedMarkerElement: j, PinElement: R } = l.value.marker; if (o.value) { const { map: q, content: M, ...D } = n.value; Object.assign(o.value, { content: s.value ? new R(s.value).element : M, ...D }), b.value && ((k = g.value) == null || k.removeMarker(o.value), (I = g.value) == null || I.addMarker(o.value)); } else s.value && (n.value.content = new R(s.value).element), o.value = W(new j(n.value)), b.value ? (z = g.value) == null || z.addMarker(o.value) : o.value.map = c.value, Ve.forEach((q) => { var M; (M = o.value) == null || M.addListener(q, (D) => e(q, D)); }); }, { immediate: !0 } ), ne(() => { var y, w; o.value && ((y = l.value) == null || y.event.clearInstanceListeners(o.value), b.value ? (w = g.value) == null || w.removeMarker(o.value) : o.value.map = null); }), de(Pe, o), t({ marker: o }), () => { var y; return (y = i.default) == null ? void 0 : y.call(i); }; } }), ur = (r) => r === "Marker", mr = (r) => r === ke, me = (r, e, t, i) => { const n = N(), s = Q(ie, N()), o = Q(ae, N()), c = Q(Ne, N()), l = pe( () => !!(c.value && o.value && (n.value instanceof o.value.Marker || n.value instanceof o.value[ke])) ); return H( [s, t], (g, [b, y]) => { var w, v, A; const k = !X(t.value, y) || s.value !== b; !s.value || !o.value || !k || (n.value ? (n.value.setOptions(t.value), l.value && ((w = c.value) == null || w.removeMarker(n.value), (v = c.value) == null || v.addMarker(n.value))) : (ur(r) ? n.value = W( new o.value[r](t.value) ) : mr(r) ? n.value = W( new o.value[r](t.value) ) : n.value = W( new o.value[r]({ ...t.value, map: s.value }) ), l.value ? (A = c.value) == null || A.addMarker(n.value) : n.value.setMap(s.value), e.forEach((I) => { var z; (z = n.value) == null || z.addListener(I, (L) => i(I, L)); }))); }, { immediate: !0 } ), ne(() => { var g, b; n.value && ((g = o.value) == null || g.event.clearInstanceListeners(n.value), l.value ? (b = c.value) == null || b.removeMarker(n.value) : n.value.setMap(null)); }), n; }, Fe = [ "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" ]; J({ name: "Marker", props: { options: { type: Object, required: !0 } }, emits: Fe, setup(r, { emit: e, expose: t, slots: i }) { const n = te(r, "options"), s = me("Marker", Fe, n, e); return de(Pe, s), t({ marker: s }), () => { var o; return (o = i.default) == null ? void 0 : o.call(i); }; } }); J({ name: "Polyline", props: { options: { type: Object, required: !0 } }, emits: ue, setup(r, { emit: e }) { const t = te(r, "options"); return { polyline: me("Polyline", ue, t, e) }; }, render: () => null }); J({ name: "Polygon", props: { options: { type: Object, required: !0 } }, emits: ue, setup(r, { emit: e }) { const t = te(r, "options"); return { polygon: me("Polygon", ue, t, e) }; }, render: () => null }); const Je = ue.concat(["bounds_changed"]); J({ name: "Rectangle", props: { options: { type: Object, required: !0 } }, emits: Je, setup(r, { emit: e }) { const t = te(r, "options"); return { rectangle: me("Rectangle", Je, t, e) }; }, render: () => null }); const He = ue.concat(["center_changed", "radius_changed"]); J({ name: "Circle", props: { options: { type: Object, required: !0 } }, emits: He, setup(r, { emit: e }) { const t = te(r, "options"); return { circle: me("Circle", He, t, e) }; }, render: () => null }); J({ props: { position: { type: String, required: !0 }, index: { type: Number, default: 1 } }, emits: ["content:loaded"], setup(r, { emit: e }) { const t = N(null), i = Q(ie, N()), n = Q(ae, N()), s = Q(lt, N(!1)), o = H( [s, n, t], ([g, b, y]) => { b && g && y && (c(r.position), e("content:loaded"), setTimeout(o, 0)); }, { immediate: !0 } ), c = (g) => { if (i.value && n.value && t.value) { const b = n.value.ControlPosition[g]; i.value.controls[b].push(t.value); } }, l = (g) => { if (i.value && n.value) { let b = null; const y = n.value.ControlPosition[g]; i.value.controls[y].forEach((w, v) => { w === t.value && (b = v); }), b !== null && i.value.controls[y].removeAt(b); } }; return ne(() => l(r.position)), H( () => r.position, (g, b) => { l(b), c(g); } ), H( () => r.index, (g) => { g && t.value && (t.value.index = r.index); } ), { controlRef: t }; } }); const We = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"]; J({ inheritAttrs: !1, props: { options: { type: Object, default: () => ({}) }, modelValue: { type: Boolean } }, emits: [...We, "update:modelValue"], setup(r, { slots: e, emit: t, expose: i }) { const n = N(), s = N(), o = Q(ie, N()), c = Q(ae, N()), l = Q(Pe, N()); let g, b = r.modelValue; const y = pe(() => { var k; return (k = e.default) == null ? void 0 : k.call(e).some((I) => I.type !== ot); }), w = (k) => { b = k, t("update:modelValue", k); }, v = (k) => { n.value && (n.value.open({ map: o.value, anchor: l.value, ...k }), w(!0)); }, A = () => { n.value && (n.value.close(), w(!1)); }; return st(() => { H( [o, () => r.options], ([k, I], [z, L]) => { var j; const R = !X(I, L) || o.value !== z; o.value && c.value && R && (n.value ? (n.value.setOptions({ ...I, content: y.value ? s.value : I.content }), l.value || v()) : (n.value = W( new c.value.InfoWindow({ ...I, content: y.value ? s.value : I.content }) ), l.value && (g = l.value.addListener("click", () => { v(); })), (!l.value || b) && v(), We.forEach((q) => { var M; (M = n.value) == null || M.addListener(q, (D) => t(q, D)); }), (j = n.value) == null || j.addListener("closeclick", () => w(!1)))); }, { immediate: !0 } ), H( () => r.modelValue, (k) => { k !== b && (k ? v() : A()); } ); }), ne(() => { var k; g && g.remove(), n.value && ((k = c.value) == null || k.event.clearInstanceListeners(n.value), A()); }), i({ infoWindow: n, open: v, close: A }), { infoWindow: n, infoWindowRef: s, hasSlotContent: y, open: v, close: A }; } }); const Ke = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ], _e = 1, he = 8; class Le { /** * 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 n = i >> 4; if (n !== _e) throw new Error(`Got v${n} data when expected v${_e}.`); const s = Ke[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 Le(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, n) { 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 = Ke.indexOf(this.ArrayType), o = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, c = e * this.IndexArrayType.BYTES_PER_ELEMENT, l = (8 - c % 8) % 8; if (s < 0) throw new Error(`Unexpected typed array class: ${i}.`); n && n instanceof ArrayBuffer ? (this.data = n, this.ids = new this.IndexArrayType(this.data, he, e), this.coords = new this.ArrayType(this.data, he + c + l, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(he + o + c + l), this.ids = new this.IndexArrayType(this.data, he, e), this.coords = new this.ArrayType(this.data, he + c + l, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (_e << 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 $