UNPKG

@eotl/core

Version:

Assortment of data structures, Vue.js components, and utilities across EOTL apps and sites.

1 lines 861 kB
{"version":3,"file":"components.cjs","sources":["../../src/components/Alert.vue","../../src/components/Estimator.vue","../../src/components/IdentityKey.vue","../../node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.es.js","../../node_modules/leaflet/dist/leaflet-src.js","../../node_modules/@eotl/icons/dist/bicycle-1.svg","../../node_modules/@eotl/icons/dist/supplier.svg","../../assets/icons/marker-icon-selected.png","../../src/components/Map/utils.js","../../src/components/Map/index.vue","../../src/components/Place/Name.vue","../../src/components/Place/Location.vue","../../src/components/Place/Contact.vue"],"sourcesContent":["<script>\nimport { useEotlCore } from '@/store/eotlStore'\nimport { inject, onActivated, onBeforeMount, onDeactivated, onMounted, provide, reactive, ref, watchEffect } from 'vue';\n\nconst ALERT_CONTEXT_KEY = Symbol('eotl-core-alert')\n\nconst DEFAULT_CONTEXT = reactive({\n childAlertRoots: 0\n})\n\n/**\n * Apps like ui-ordering and ui-inventory can be run standalone or within another app which has multiple alert containers.\n * To avoid duplicate alerts, this method will provide a context saying that parent alert containers shouldn't be shown.\n */\nexport function createAlertContext() {\n provide(ALERT_CONTEXT_KEY, reactive({\n // a counter to record whether there are <Alert> components deeper in the tree\n // which should be used instead of the current one\n childAlertRoots: 0\n }))\n\n // Get the parent alert context\n const parent = inject(ALERT_CONTEXT_KEY, DEFAULT_CONTEXT)\n\n // record the current component's mount and activation state\n const isMounted = ref(false)\n const isActivated = ref(true)\n onMounted(() => isMounted.value = true)\n onBeforeMount(() => isMounted.value = false)\n onActivated(() => isActivated.value = true)\n onDeactivated(() => isActivated.value = false)\n\n // while this component is mounted and activated (under <keep-alive>), increment the parent's counter\n watchEffect((onCleanup) => {\n if (!isActivated.value || !isMounted.value) return\n\n parent.childAlertRoots++\n useEotlCore().alert.show = false\n\n onCleanup(() => {\n parent.childAlertRoots--\n useEotlCore().alert.show = false\n })\n })\n}\n</script>\n\n<script setup>\nconst eotlStore = useEotlCore()\nconst alertRoot = inject(ALERT_CONTEXT_KEY, DEFAULT_CONTEXT)\n</script>\n\n<template>\n <div>\n <div v-if=\"eotlStore.alert.show && !alertRoot?.childAlertRoots\"\n :class=\"'mb-3 alert alert-dismissable alert-' + eotlStore.alert.style\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" @click=\"() => eotlStore.alertReset()\" aria-label=\"Close\">\n ×\n </button>\n <h4>{{ eotlStore.alert.title }}</h4>\n <p class=\"mb-0\">\n {{ eotlStore.alert.message }}\n </p>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" scoped></style>\n","<template>\n <div v-if=\"!loading\" class=\"estimator\">\n <form method=\"POST\" @submit.prevent=\"btnCreateShipment()\">\n <div class=\"estimate\" id=\"estimate\">\n {{ $t('estimate') }}\n </div>\n <div class=\"preview\">\n <div class=\"row\">\n <div class=\"col-md-6 text-center\">\n <span class=\"height\">{{ sizing.height }}</span>\n <img id=\"previewImg\" v-bind:src=\"sizeImage\" class=invert />\n <span class=\"width\">{{ sizing.width }}</span> x\n <span class=\"length\">{{ sizing.length }}</span>\n </div>\n <div class=\"col-md-6 text-center\">\n <h2>\n {{ priceEstimate }}\n </h2>\n </div>\n </div>\n </div>\n <div class=\"mt-3\">\n <ul class=\"nav nav-tabs\" id=\"myTab\" role=\"tablist\">\n <li class=\"nav-item\">\n <a class=\"nav-link active\" id=\"shipment-tab\" data-toggle=\"tab\" href=\"#shipment\" role=\"tab\"\n aria-controls=\"shipment\" aria-selected=\"true\">\n {{ $t('shipment.title') }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" id=\"pickup-tab\" data-toggle=\"tab\" href=\"#pickup\" role=\"tab\"\n aria-controls=\"pickup\" aria-selected=\"false\">\n {{ $t('pickup.title') }}\n </a>\n </li>\n <li class=\"nav-item\" symbol>\n <a class=\"nav-link\" id=\"destination-tab\" data-toggle=\"tab\" href=\"#destination\" role=\"tab\"\n aria-controls=\"destination\" aria-selected=\"false\">\n {{ $t('destination.title') }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" id=\"details-tab\" data-toggle=\"tab\" href=\"#details\" role=\"tab\"\n aria-controls=\"details\" aria-selected=\"false\">\n {{ $t('delivery.title') }}\n </a>\n </li>\n </ul>\n </div>\n\n <div class=\"tab-content pb-4\" id=\"myTabContent\">\n <div class=\"tab-pane active\" id=\"shipment\" role=\"tabpanel\" aria-labelledby=\"shipment-tab\">\n <div class=\"form-row mb-4\">\n <div class=\"col-md-4\">\n <label for=\"inputSize\">{{ $t('shipment.size') }}</label>\n <select v-model=\"shipment.size\" id=\"inputSize\" class=\"form-control\">\n <option v-for=\"(size, index) in sizes\" v-bind:key=\"index\" v-bind:value=\"index\">\n {{ $t('sizes.' + index) }}\n </option>\n </select>\n </div>\n <div class=\"col-md-4\">\n <label for=\"inputWeight\">{{ $t('shipment.weight') }}</label>\n <select v-model=\"shipment.weight\" id=\"inputWeight\" class=\"form-control\">\n <option v-for=\"(weight, index) in weights\" v-bind:key=\"index\" v-bind:value=\"index\">\n {{ $t('weights.' + index) }} ({{ weight.kg }})\n </option>\n </select>\n </div>\n <div class=\"col-md-4\">\n <label for=\"inputSpeed\">{{ $t('shipment.shipmentSpeed') }}</label>\n <select v-model=\"shipment.speed\" id=\"inputSpeed\" class=\"form-control\">\n <option v-for=\"speed in speeds\" v-bind:key=\"speed\" v-bind:value=\"speed\">\n {{ $t('speeds.' + speed) }}\n </option>\n </select>\n </div>\n </div>\n <div class=\"form-row mb-4 text-right\">\n <button type=\"button\" v-on:click=\"btnShowPickup\" class=\"btn btn-primary\">\n Next Step\n </button>\n </div>\n </div>\n\n <div class=\"tab-pane\" id=\"pickup\" role=\"tabpanel\" aria-labelledby=\"pickup-tab\">\n <div class=\"mb-5\">\n <div class=\"form-row\">\n <div class=\"form-group col-md-5\">\n <label for=\"inputName\">\n {{ $t('pickup.name') }}\n </label>\n <input type=\"text\" v-model=\"pickup.name\" class=\"form-control\" id=\"inputName\" />\n </div>\n <div class=\"form-group col-md-3\">\n <label for=\"inputMethod\">\n {{ $t('pickup.contactMethod') }}\n </label>\n <select id=\"inputMethod\" class=\"form-control\" v-model=\"pickup.method\">\n <option value=\"none\">None</option>\n <option value=\"sms\">SMS</option>\n <option value=\"voice\">Phone Call</option>\n <option value=\"email\">Email</option>\n <option value=\"signal\">Signal</option>\n <option value=\"telegram\">Telegram</option>\n <option value=\"whatsapp\">WhatsApp</option>\n <option value=\"wire\">Wire</option>\n </select>\n </div>\n <div class=\"form-group col-md-4\">\n <label for=\"inputContact\">\n {{ $t('pickup.contact') }}\n </label>\n <input type=\"text\" v-model=\"pickup.contact\" class=\"form-control\" id=\"inputContact\" />\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group col-md-6\">\n <label for=\"inputAddressStart\">\n {{ $t('pickup.address') }}\n </label>\n <input type=\"text\" class=\"form-control\" v-model=\"pickup.address\" id=\"inputAddressStart\"\n placeholder=\"1234 Main St\" />\n </div>\n <div class=\"form-group col-md-6\">\n <label for=\"inputAddress2Start\">\n {{ $t('pickup.addressSuffix') }}\n </label>\n <input type=\"text\" class=\"form-control\" v-model=\"pickup.address2\"\n id=\"inputAddress2Start\" placeholder=\"Apartment, studio, or floor\" />\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group col-md-6\">\n <label for=\"inputCityStart\">{{ $t('pickup.city') }}</label>\n <input type=\"text\" class=\"form-control\" v-model=\"pickup.city\" id=\"inputCityStart\" />\n </div>\n <div class=\"form-group col-md-2\">\n <label for=\"inputZipStart\">{{ $t('pickup.postal') }}</label>\n <input type=\"text\" class=\"form-control\" id=\"inputZipStart\" v-model=\"pickup.postal\" />\n </div>\n <div class=\"form-group col-md-4\">\n <label for=\"inputStateStart\">{{ $t('pickup.state') }}</label>\n <select id=\"inputStateStart\" class=\"form-control\" v-model=\"pickup.state\">\n <option v-for=\"country in $tm('countries')\" :key=\"country.value\"\n v-bind:value=\"country.value\">\n {{ country.text }}\n </option>\n </select>\n </div>\n </div>\n <button type=\"button\" v-on:click=\"btnShowDestination\" class=\"btn btn-primary float-right\">\n Next Step\n </button>\n </div>\n </div>\n\n <div class=\"tab-pane\" id=\"destination\" role=\"tabpanel\" aria-labelledby=\"destination-tab\">\n <div class=\"mb-5\">\n <div class=\"form-row\">\n <div class=\"form-group col-md-5\">\n <label for=\"inputNameEnd\">{{ $t('destination.name') }}</label>\n <input type=\"text\" class=\"form-control\" id=\"inputNameEnd\" v-model=\"destination.name\" />\n </div>\n <div class=\"form-group col-md-3\">\n <label for=\"inputMethodEnd\">{{ $t('destination.contactMethod') }}</label>\n <select id=\"inputMethodEnd\" class=\"form-control\" v-model=\"destination.method\">\n <option value=\"none\" selected>None</option>\n <option value=\"sms\">SMS</option>\n <option value=\"voice\">Phone Call</option>\n <option value=\"day\">Email</option>\n <option value=\"signal\">Signal</option>\n <option value=\"telegram\">Telegram</option>\n <option value=\"whatsapp\">WhatsApp</option>\n <option value=\"wire\">Wire</option>\n </select>\n </div>\n <div class=\"form-group col-md-4\">\n <label for=\"inputContactEnd\">\n {{ $t('destination.contact') }}\n </label>\n <input type=\"text\" class=\"form-control\" id=\"inputContactEnd\"\n v-model=\"destination.contact\" />\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group col-md-6\">\n <label for=\"inputAddressEnd\">\n {{ $t('destination.address') }}\n </label>\n <input type=\"text\" class=\"form-control\" id=\"inputAddressEnd\" placeholder=\"1234 Main St\"\n v-model=\"destination.address\" />\n </div>\n <div class=\"form-group col-md-6\">\n <label for=\"inputAddress2End\">\n {{ $t('destination.addressSuffix') }}\n </label>\n <input type=\"text\" class=\"form-control\" id=\"inputAddress2End\"\n placeholder=\"Apartment, studio, or floor\" v-model=\"destination.address2\" />\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group col-md-6\">\n <label for=\"inputCityEnd\">\n {{ $t('destination.city') }}\n </label>\n <input type=\"text\" class=\"form-control\" id=\"inputCityEnd\" v-model=\"destination.city\" />\n </div>\n <div class=\"form-group col-md-2\">\n <label for=\"inputZipEnd\">\n {{ $t('destination.postal') }}\n </label>\n <input type=\"text\" class=\"form-control\" id=\"inputZipEnd\" v-model=\"destination.postal\" />\n </div>\n <div class=\"form-group col-md-4\">\n <label for=\"inputStateEnd\">\n {{ $t('destination.state') }}\n </label>\n <select id=\"inputStateEnd\" class=\"form-control\" v-model=\"destination.state\">\n <option v-for=\"country in $tm('countries')\" :key=\"country.value\"\n v-bind:value=\"country.value\">\n {{ country.text }}\n </option>\n </select>\n </div>\n </div>\n <button type=\"button\" v-on:click=\"btnShowDetails\" class=\"btn btn-primary float-right\">\n Next Step\n </button>\n </div>\n </div>\n\n <div class=\"tab-pane\" id=\"details\" role=\"tabpanel\" aria-labelledby=\"details-tab\">\n <h4>{{ $t('delivery.payment') }}</h4>\n <div class=\"form-row mb-3\">\n <div class=\"form-group col-md-6\">\n <label for=\"inputPayment\">\n {{ $t('delivery.paymentMethod') }}\n </label>\n <select id=\"inputPayment\" class=\"form-control\" v-model=\"details.payment\">\n <option value=\"none\" selected>None</option>\n <option value=\"cash\">Cash</option>\n <option value=\"bitcoin\">Bitcoin</option>\n <option value=\"paypal\">PayPal</option>\n <option value=\"cc\">Credit Card</option>\n <option value=\"time\">Time Bank</option>\n </select>\n </div>\n <div class=\"col-md-6\">\n <label for=\"payer\">{{ $t('delivery.paymentPayer') }}</label>\n <select id=\"payer\" class=\"form-control\" v-model=\"details.payer\">\n <option value=\"na\">Not Applicable</option>\n <option value=\"sender\">Sender</option>\n <option value=\"receiver\">Receiver</option>\n </select>\n </div>\n </div>\n <h5>{{ $t('delivery.tos') }}</h5>\n <div v-html=\"$t('delivery.tosMust')\"></div>\n <div class=\"form-group\">\n <div class=\"form-check\">\n <input class=\"form-check-input\" v-model=\"agree\" type=\"checkbox\" id=\"gridCheck\" />\n <label class=\"form-check-label\" for=\"gridCheck\">\n {{ $t('delivery.tosAgree') }}\n </label>\n </div>\n </div>\n <div class=\"mb-3\">\n <button type=\"button\" class=\"btn btn-secondary mr-4\" @click=\"btnCancelShipment()\">\n {{ $t('delivery.btnCancel') }}\n </button>\n <button type=\"submit\" class=\"btn btn-primary\" @submit.prevent=\"btnCreateShipment()\">\n {{ $t('delivery.btnComplete') }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n</template>\n\n<script>\nimport $ from 'jquery'\n\nimport { ssr, ssrFetcher } from '@eotl/simple-signed-records'\n\nimport sizes from '@/enums/Sizes'\nimport currency from '@/enums/Currency'\nimport weights from '@/enums/Weights'\nimport { cargoUtils, friendlyId } from '@/composables'\nimport { useEotlCore } from '@/store'\n\nexport default {\n data() {\n const store = useEotlCore()\n\n return {\n store,\n currency: currency.eur,\n sizing: sizes.md,\n sizes: sizes,\n weights: weights,\n speeds: ['immediate', 'day', 'next', 'second', 'week'],\n loading: true,\n shipment: {\n size: 'md',\n weight: 'average',\n speed: 'next',\n },\n details: {\n payment: 'cash',\n payer: 'receiver',\n },\n agree: false,\n }\n },\n computed: {\n sizeImage() {\n return `/images/icons/box-${this.shipment.size}.svg`\n },\n priceEstimate() {\n return cargoUtils.tallyFee(this.shipment, currency['eur'].symbol)\n },\n pickup() {\n const { city, country, postal } = this.store.config\n\n return {\n name: '',\n method: 'none',\n contact: '',\n address: '',\n address2: '',\n city,\n state: country,\n postal,\n }\n },\n destination() {\n const { city, country, postal } = this.store.config\n\n return {\n name: '',\n method: 'none',\n contact: '',\n address: '',\n address2: '',\n city,\n state: country,\n postal,\n }\n },\n },\n methods: {\n btnShowShipment() {\n $('#shipment-tab').tab('show')\n },\n btnShowPickup() {\n $('#pickup-tab').tab('show')\n },\n btnShowDestination() {\n $('#destination-tab').tab('show')\n },\n btnShowDetails() {\n $('#details-tab').tab('show')\n },\n btnCreateShipment() {\n const record = {\n size: this.shipment.size,\n weight: this.shipment.weight,\n speed: this.shipment.speed,\n pickup_name: this.pickup.name,\n pickup_method: this.pickup.method,\n pickup_contact: this.pickup.contact,\n pickup_address: this.pickup.address,\n pickup_address2: this.pickup.address2,\n pickup_city: this.pickup.city,\n pickup_state: this.pickup.state,\n pickup_postal: this.pickup.postal,\n dest_name: this.destination.name,\n dest_method: this.destination.method,\n dest_contact: this.destination.contact,\n dest_address: this.destination.address,\n dest_address2: this.destination.address2,\n dest_city: this.destination.city,\n dest_state: this.destination.state,\n dest_postal: this.destination.postal,\n }\n\n const router = this.$router\n ssrFetcher.Post('shipments', record).then((data) => {\n router.push('/shipment/' + data.id)\n })\n },\n btnCancelShipment() {\n alert('Cancel order to be created...')\n }\n },\n mounted() {\n this.loading = false\n },\n}\n</script>\n\n<style>\n.estimator {\n max-width: 1000px;\n}\n\n.estimator .estimate {\n background-color: #fffb77;\n border-radius: .75rem;\n font-size: 0.85rem;\n padding: .25rem .75rem;\n color: #444444;\n display: inline-block;\n margin: 0 auto;\n position: relative;\n top: 15px;\n left: 10px;\n}\n\n.estimator .preview {\n background-color: var(--box-bg-color);\n margin-bottom: 2.5rem;\n padding-bottom: 1.5rem;\n font-family: 'Roboto-Light', serif;\n}\n\n.estimator .preview h2 {\n padding: 4rem 1rem 2rem 1rem;\n color: var(--main-fg-color);\n font-size: 4.5rem;\n border-radius: 1rem;\n}\n\n@media (prefers-color-scheme: dark) {\n .estimator .preview img {\n /* might bring back later\n filter: invert(100%);\n */\n }\n}\n\n.estimator #account-tab img {\n height: 20px;\n}\n\n.estimator #account-tab.active img {\n filter: invert(1)\n}\n\n.estimator #gridCheck:checked {\n background: green;\n}\n\n.estimator .form-control {\n background-color: var(--form-bg-color) !important;\n}\n</style>\n","<template>\n <div>\n <small>\n {{ identity.identity }}<br>\n Level: {{ identity.level }}<br>\n Status: {{ identity.status }}<br>\n {{ identity.info }}\n </small>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'IdentityKey',\n props: ['identity'],\n data: function () {\n return {};\n }\n};\n</script>\n","import { watch as He, ref as c, provide as A, inject as O, onUnmounted as pe, h as U, onBeforeUnmount as R, defineComponent as S, onMounted as _, markRaw as j, nextTick as g, render as mt, reactive as vt, computed as oe } from \"vue\";\nconst ce = (e, o) => {\n for (const t of Object.keys(o))\n e.on(t, o[t]);\n}, ye = (e) => {\n for (const o of Object.keys(e)) {\n const t = e[o];\n t && k(t.cancel) && t.cancel();\n }\n}, Je = (e) => !e || typeof e.charAt != \"function\" ? e : e.charAt(0).toUpperCase() + e.slice(1), k = (e) => typeof e == \"function\", L = (e, o, t) => {\n for (const n in t) {\n const s = \"set\" + Je(n);\n e[s] ? He(\n () => t[n],\n (r, l) => {\n e[s](r, l);\n }\n ) : o[s] && He(\n () => t[n],\n (r) => {\n o[s](r);\n }\n );\n }\n}, f = (e, o, t = {}) => {\n const n = { ...t };\n for (const s in e) {\n const r = o[s], l = e[s];\n r && (r && r.custom === !0 || l !== void 0 && (n[s] = l));\n }\n return n;\n}, T = (e) => {\n const o = {}, t = {};\n for (const n in e)\n if (n.startsWith(\"on\") && !n.startsWith(\"onUpdate\") && n !== \"onReady\") {\n const s = n.slice(2).toLocaleLowerCase();\n o[s] = e[n];\n } else\n t[n] = e[n];\n return { listeners: o, attrs: t };\n}, qe = async (e) => {\n const o = await Promise.all([\n import(\"leaflet/dist/images/marker-icon-2x.png\"),\n import(\"leaflet/dist/images/marker-icon.png\"),\n import(\"leaflet/dist/images/marker-shadow.png\")\n ]);\n delete e.Default.prototype._getIconUrl, e.Default.mergeOptions({\n iconRetinaUrl: o[0].default,\n iconUrl: o[1].default,\n shadowUrl: o[2].default\n });\n}, Y = (e) => {\n const o = c(\n (...n) => console.warn(`Method ${e} has been invoked without being replaced`)\n ), t = (...n) => o.value(...n);\n return t.wrapped = o, A(e, t), t;\n}, V = (e, o) => e.wrapped.value = o, b = typeof self == \"object\" && self.self === self && self || typeof global == \"object\" && global.global === global && global || globalThis, m = (e) => {\n const o = O(e);\n if (o === void 0)\n throw new Error(\n `Attempt to inject ${e.description} before it was provided.`\n );\n return o;\n}, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n WINDOW_OR_GLOBAL: b,\n assertInject: m,\n bindEventHandlers: ce,\n cancelDebounces: ye,\n capitalizeFirstLetter: Je,\n isFunction: k,\n propsBinder: L,\n propsToLeafletOptions: f,\n provideLeafletWrapper: Y,\n remapEvents: T,\n resetWebpackIcon: qe,\n updateLeafletWrapper: V\n}, Symbol.toStringTag, { value: \"Module\" })), h = Symbol(\n \"useGlobalLeaflet\"\n), M = Symbol(\"addLayer\"), ee = Symbol(\"removeLayer\"), H = Symbol(\n \"registerControl\"\n), me = Symbol(\n \"registerLayerControl\"\n), ve = Symbol(\n \"canSetParentHtml\"\n), be = Symbol(\"setParentHtml\"), fe = Symbol(\"setIcon\"), ge = Symbol(\"bindPopup\"), Le = Symbol(\"bindTooltip\"), he = Symbol(\"unbindPopup\"), Oe = Symbol(\"unbindTooltip\"), Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n AddLayerInjection: M,\n BindPopupInjection: ge,\n BindTooltipInjection: Le,\n CanSetParentHtmlInjection: ve,\n RegisterControlInjection: H,\n RegisterLayerControlInjection: me,\n RemoveLayerInjection: ee,\n SetIconInjection: fe,\n SetParentHtmlInjection: be,\n UnbindPopupInjection: he,\n UnbindTooltipInjection: Oe,\n UseGlobalLeafletInjection: h\n}, Symbol.toStringTag, { value: \"Module\" })), W = {\n options: {\n type: Object,\n default: () => ({}),\n custom: !0\n }\n}, J = (e) => ({ options: e.options, methods: {} }), bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n componentProps: W,\n setupComponent: J\n}, Symbol.toStringTag, { value: \"Module\" })), D = {\n ...W,\n pane: {\n type: String\n },\n attribution: {\n type: String\n },\n name: {\n type: String,\n custom: !0\n },\n layerType: {\n type: String,\n custom: !0\n },\n visible: {\n type: Boolean,\n custom: !0,\n default: !0\n }\n}, q = (e, o, t) => {\n const n = m(M), s = m(ee), { options: r, methods: l } = J(e), a = f(\n e,\n D,\n r\n ), i = () => n({ leafletObject: o.value }), u = () => s({ leafletObject: o.value }), d = {\n ...l,\n setAttribution(y) {\n u(), o.value.options.attribution = y, e.visible && i();\n },\n setName() {\n u(), e.visible && i();\n },\n setLayerType() {\n u(), e.visible && i();\n },\n setVisible(y) {\n o.value && (y ? i() : u());\n },\n bindPopup(y) {\n if (!o.value || !k(o.value.bindPopup)) {\n console.warn(\n \"Attempt to bind popup before bindPopup method available on layer.\"\n );\n return;\n }\n o.value.bindPopup(y);\n },\n bindTooltip(y) {\n if (!o.value || !k(o.value.bindTooltip)) {\n console.warn(\n \"Attempt to bind tooltip before bindTooltip method available on layer.\"\n );\n return;\n }\n o.value.bindTooltip(y);\n },\n unbindTooltip() {\n o.value && (k(o.value.closeTooltip) && o.value.closeTooltip(), k(o.value.unbindTooltip) && o.value.unbindTooltip());\n },\n unbindPopup() {\n o.value && (k(o.value.closePopup) && o.value.closePopup(), k(o.value.unbindPopup) && o.value.unbindPopup());\n },\n updateVisibleProp(y) {\n t.emit(\"update:visible\", y);\n }\n };\n return A(ge, d.bindPopup), A(Le, d.bindTooltip), A(he, d.unbindPopup), A(Oe, d.unbindTooltip), pe(() => {\n d.unbindPopup(), d.unbindTooltip(), u();\n }), { options: a, methods: d };\n}, G = (e, o) => {\n if (e && o.default)\n return U(\"div\", { style: { display: \"none\" } }, o.default());\n}, ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n layerProps: D,\n render: G,\n setupLayer: q\n}, Symbol.toStringTag, { value: \"Module\" })), Se = {\n ...D,\n interactive: {\n type: Boolean,\n default: void 0\n },\n bubblingMouseEvents: {\n type: Boolean,\n default: void 0\n }\n}, Ke = (e, o, t) => {\n const { options: n, methods: s } = q(\n e,\n o,\n t\n );\n return { options: f(\n e,\n Se,\n n\n ), methods: s };\n}, gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n interactiveLayerProps: Se,\n setupInteractiveLayer: Ke\n}, Symbol.toStringTag, { value: \"Module\" })), ne = {\n ...Se,\n stroke: {\n type: Boolean,\n default: void 0\n },\n color: {\n type: String\n },\n weight: {\n type: Number\n },\n opacity: {\n type: Number\n },\n lineCap: {\n type: String\n },\n lineJoin: {\n type: String\n },\n dashArray: {\n type: String\n },\n dashOffset: {\n type: String\n },\n fill: {\n type: Boolean,\n default: void 0\n },\n fillColor: {\n type: String\n },\n fillOpacity: {\n type: Number\n },\n fillRule: {\n type: String\n },\n className: {\n type: String\n }\n}, _e = (e, o, t) => {\n const { options: n, methods: s } = Ke(e, o, t), r = f(\n e,\n ne,\n n\n ), l = m(ee), a = {\n ...s,\n setStroke(i) {\n o.value.setStyle({ stroke: i });\n },\n setColor(i) {\n o.value.setStyle({ color: i });\n },\n setWeight(i) {\n o.value.setStyle({ weight: i });\n },\n setOpacity(i) {\n o.value.setStyle({ opacity: i });\n },\n setLineCap(i) {\n o.value.setStyle({ lineCap: i });\n },\n setLineJoin(i) {\n o.value.setStyle({ lineJoin: i });\n },\n setDashArray(i) {\n o.value.setStyle({ dashArray: i });\n },\n setDashOffset(i) {\n o.value.setStyle({ dashOffset: i });\n },\n setFill(i) {\n o.value.setStyle({ fill: i });\n },\n setFillColor(i) {\n o.value.setStyle({ fillColor: i });\n },\n setFillOpacity(i) {\n o.value.setStyle({ fillOpacity: i });\n },\n setFillRule(i) {\n o.value.setStyle({ fillRule: i });\n },\n setClassName(i) {\n o.value.setStyle({ className: i });\n }\n };\n return R(() => {\n l({ leafletObject: o.value });\n }), { options: r, methods: a };\n}, Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n pathProps: ne,\n setupPath: _e\n}, Symbol.toStringTag, { value: \"Module\" })), re = {\n ...ne,\n /**\n * Radius of the marker in pixels.\n */\n radius: {\n type: Number\n },\n latLng: {\n type: [Object, Array],\n required: !0,\n custom: !0\n }\n}, je = (e, o, t) => {\n const { options: n, methods: s } = _e(\n e,\n o,\n t\n ), r = f(\n e,\n re,\n n\n ), l = {\n ...s,\n setRadius(a) {\n o.value.setRadius(a);\n },\n setLatLng(a) {\n o.value.setLatLng(a);\n }\n };\n return { options: r, methods: l };\n}, ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n circleMarkerProps: re,\n setupCircleMarker: je\n}, Symbol.toStringTag, { value: \"Module\" })), Pe = {\n ...re,\n /**\n * Radius of the circle in meters.\n */\n radius: {\n type: Number\n }\n}, Qe = (e, o, t) => {\n const { options: n, methods: s } = je(e, o, t), r = f(\n e,\n Pe,\n n\n ), l = {\n ...s\n };\n return { options: r, methods: l };\n}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n circleProps: Pe,\n setupCircle: Qe\n}, Symbol.toStringTag, { value: \"Module\" })), Xt = S({\n name: \"LCircle\",\n props: Pe,\n setup(e, o) {\n const t = c(), n = c(!1), s = O(h), r = m(M), { options: l, methods: a } = Qe(e, t, o);\n return _(async () => {\n const { circle: i } = s ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(i(e.latLng, l));\n const { listeners: u } = T(o.attrs);\n t.value.on(u), L(a, t.value, e), r({\n ...e,\n ...a,\n leafletObject: t.value\n }), n.value = !0, g(() => o.emit(\"ready\", t.value));\n }), { ready: n, leafletObject: t };\n },\n render() {\n return G(this.ready, this.$slots);\n }\n}), Yt = S({\n name: \"LCircleMarker\",\n props: re,\n setup(e, o) {\n const t = c(), n = c(!1), s = O(h), r = m(M), { options: l, methods: a } = je(\n e,\n t,\n o\n );\n return _(async () => {\n const { circleMarker: i } = s ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(\n i(e.latLng, l)\n );\n const { listeners: u } = T(o.attrs);\n t.value.on(u), L(a, t.value, e), r({\n ...e,\n ...a,\n leafletObject: t.value\n }), n.value = !0, g(() => o.emit(\"ready\", t.value));\n }), { ready: n, leafletObject: t };\n },\n render() {\n return G(this.ready, this.$slots);\n }\n}), F = {\n ...W,\n position: {\n type: String\n }\n}, K = (e, o) => {\n const { options: t, methods: n } = J(e), s = f(\n e,\n F,\n t\n ), r = {\n ...n,\n setPosition(l) {\n o.value && o.value.setPosition(l);\n }\n };\n return pe(() => {\n o.value && o.value.remove();\n }), { options: s, methods: r };\n}, Xe = (e) => e.default ? U(\"div\", { ref: \"root\" }, e.default()) : null, St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n controlProps: F,\n renderLControl: Xe,\n setupControl: K\n}, Symbol.toStringTag, { value: \"Module\" })), Vt = S({\n name: \"LControl\",\n props: {\n ...F,\n disableClickPropagation: {\n type: Boolean,\n custom: !0,\n default: !0\n },\n disableScrollPropagation: {\n type: Boolean,\n custom: !0,\n default: !1\n }\n },\n setup(e, o) {\n const t = c(), n = c(), s = O(h), r = m(H), { options: l, methods: a } = K(e, t);\n return _(async () => {\n const { Control: i, DomEvent: u } = s ? b.L : await import(\"leaflet/dist/leaflet-src.esm\"), d = i.extend({\n onAdd() {\n return n.value;\n }\n });\n t.value = j(new d(l)), L(a, t.value, e), r({ leafletObject: t.value }), e.disableClickPropagation && n.value && u.disableClickPropagation(n.value), e.disableScrollPropagation && n.value && u.disableScrollPropagation(n.value), g(() => o.emit(\"ready\", t.value));\n }), { root: n, leafletObject: t };\n },\n render() {\n return Xe(this.$slots);\n }\n}), Ce = {\n ...F,\n prefix: {\n type: String\n }\n}, Ye = (e, o) => {\n const { options: t, methods: n } = K(\n e,\n o\n ), s = f(\n e,\n Ce,\n t\n ), r = {\n ...n,\n setPrefix(l) {\n o.value.setPrefix(l);\n }\n };\n return { options: s, methods: r };\n}, _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n controlAttributionProps: Ce,\n setupControlAttribution: Ye\n}, Symbol.toStringTag, { value: \"Module\" })), xt = S({\n name: \"LControlAttribution\",\n props: Ce,\n setup(e, o) {\n const t = c(), n = O(h), s = m(H), { options: r, methods: l } = Ye(e, t);\n return _(async () => {\n const { control: a } = n ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(\n a.attribution(r)\n ), L(l, t.value, e), s({ leafletObject: t.value }), g(() => o.emit(\"ready\", t.value));\n }), { leafletObject: t };\n },\n render() {\n return null;\n }\n}), Te = {\n ...F,\n collapsed: {\n type: Boolean,\n default: void 0\n },\n autoZIndex: {\n type: Boolean,\n default: void 0\n },\n hideSingleBase: {\n type: Boolean,\n default: void 0\n },\n sortLayers: {\n type: Boolean,\n default: void 0\n },\n sortFunction: {\n type: Function\n }\n}, Ve = (e, o) => {\n const { options: t } = K(e, o);\n return { options: f(\n e,\n Te,\n t\n ), methods: {\n addLayer(r) {\n r.layerType === \"base\" ? o.value.addBaseLayer(r.leafletObject, r.name) : r.layerType === \"overlay\" && o.value.addOverlay(r.leafletObject, r.name);\n },\n removeLayer(r) {\n o.value.removeLayer(r.leafletObject);\n }\n } };\n}, jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n controlLayersProps: Te,\n setupControlLayers: Ve\n}, Symbol.toStringTag, { value: \"Module\" })), Rt = S({\n name: \"LControlLayers\",\n props: Te,\n setup(e, o) {\n const t = c(), n = O(h), s = m(me), { options: r, methods: l } = Ve(e, t);\n return _(async () => {\n const { control: a } = n ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(\n a.layers(void 0, void 0, r)\n ), L(l, t.value, e), s({\n ...e,\n ...l,\n leafletObject: t.value\n }), g(() => o.emit(\"ready\", t.value));\n }), { leafletObject: t };\n },\n render() {\n return null;\n }\n}), Me = {\n ...F,\n maxWidth: {\n type: Number\n },\n metric: {\n type: Boolean,\n default: void 0\n },\n imperial: {\n type: Boolean,\n default: void 0\n },\n updateWhenIdle: {\n type: Boolean,\n default: void 0\n }\n}, xe = (e, o) => {\n const { options: t, methods: n } = K(\n e,\n o\n );\n return { options: f(\n e,\n Me,\n t\n ), methods: n };\n}, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n controlScaleProps: Me,\n setupControlScale: xe\n}, Symbol.toStringTag, { value: \"Module\" })), eo = S({\n name: \"LControlScale\",\n props: Me,\n setup(e, o) {\n const t = c(), n = O(h), s = m(H), { options: r, methods: l } = xe(e, t);\n return _(async () => {\n const { control: a } = n ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(a.scale(r)), L(l, t.value, e), s({ leafletObject: t.value }), g(() => o.emit(\"ready\", t.value));\n }), { leafletObject: t };\n },\n render() {\n return null;\n }\n}), Be = {\n ...F,\n zoomInText: {\n type: String\n },\n zoomInTitle: {\n type: String\n },\n zoomOutText: {\n type: String\n },\n zoomOutTitle: {\n type: String\n }\n}, Re = (e, o) => {\n const { options: t, methods: n } = K(\n e,\n o\n );\n return { options: f(\n e,\n Be,\n t\n ), methods: n };\n}, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n controlZoomProps: Be,\n setupControlZoom: Re\n}, Symbol.toStringTag, { value: \"Module\" })), to = S({\n name: \"LControlZoom\",\n props: Be,\n setup(e, o) {\n const t = c(), n = O(h), s = m(H), { options: r, methods: l } = Re(e, t);\n return _(async () => {\n const { control: a } = n ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(a.zoom(r)), L(l, t.value, e), s({ leafletObject: t.value }), g(() => o.emit(\"ready\", t.value));\n }), { leafletObject: t };\n },\n render() {\n return null;\n }\n}), te = {\n ...D\n}, se = (e, o, t) => {\n const { options: n, methods: s } = q(\n e,\n o,\n t\n ), r = f(\n e,\n te,\n n\n ), l = {\n ...s,\n addLayer(a) {\n o.value.addLayer(a.leafletObject);\n },\n removeLayer(a) {\n o.value.removeLayer(a.leafletObject);\n }\n };\n return A(M, l.addLayer), A(ee, l.removeLayer), { options: r, methods: l };\n}, Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n layerGroupProps: te,\n setupLayerGroup: se\n}, Symbol.toStringTag, { value: \"Module\" })), we = {\n ...te\n}, et = (e, o, t) => {\n const { options: n, methods: s } = se(\n e,\n o,\n t\n ), r = f(\n e,\n we,\n n\n ), l = {\n ...s\n };\n return { options: r, methods: l };\n}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n featureGroupProps: we,\n setupFeatureGroup: et\n}, Symbol.toStringTag, { value: \"Module\" })), oo = S({\n props: we,\n setup(e, o) {\n const t = c(), n = c(!1), s = O(h), r = m(M), { methods: l, options: a } = et(\n e,\n t,\n o\n );\n return _(async () => {\n const { featureGroup: i } = s ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(\n i(void 0, a)\n );\n const { listeners: u } = T(o.attrs);\n t.value.on(u), L(l, t.value, e), r({\n ...e,\n ...l,\n leafletObject: t.value\n }), n.value = !0, g(() => o.emit(\"ready\", t.value));\n }), { ready: n, leafletObject: t };\n },\n render() {\n return G(this.ready, this.$slots);\n }\n}), Ie = {\n ...te,\n geojson: {\n type: [Object, Array],\n custom: !0\n },\n optionsStyle: {\n type: Function,\n custom: !0\n }\n}, tt = (e, o, t) => {\n const { options: n, methods: s } = se(\n e,\n o,\n t\n ), r = f(\n e,\n Ie,\n n\n );\n Object.prototype.hasOwnProperty.call(e, \"optionsStyle\") && (r.style = e.optionsStyle);\n const l = {\n ...s,\n setGeojson(a) {\n o.value.clearLayers(), o.value.addData(a);\n },\n setOptionsStyle(a) {\n o.value.setStyle(a);\n },\n getGeoJSONData() {\n return o.value.toGeoJSON();\n },\n getBounds() {\n return o.value.getBounds();\n }\n };\n return { options: r, methods: l };\n}, Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n geoJSONProps: Ie,\n setupGeoJSON: tt\n}, Symbol.toStringTag, { value: \"Module\" })), no = S({\n props: Ie,\n setup(e, o) {\n const t = c(), n = c(!1), s = O(h), r = m(M), { methods: l, options: a } = tt(e, t, o);\n return _(async () => {\n const { geoJSON: i } = s ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n t.value = j(i(e.geojson, a));\n const { listeners: u } = T(o.attrs);\n t.value.on(u), L(l, t.value, e), r({\n ...e,\n ...l,\n leafletObject: t.value\n }), n.value = !0, g(() => o.emit(\"ready\", t.value));\n }), { ready: n, leafletObject: t };\n },\n render() {\n return G(this.ready, this.$slots);\n }\n}), ae = {\n ...D,\n opacity: {\n type: Number\n },\n zIndex: {\n type: Number\n },\n tileSize: {\n type: [Number, Array, Object]\n },\n noWrap: {\n type: Boolean,\n default: void 0\n },\n minZoom: {\n type: Number\n },\n maxZoom: {\n type: Number\n },\n className: {\n type: String\n }\n}, Ae = (e, o, t) => {\n const { options: n, methods: s } = q(\n e,\n o,\n t\n ), r = f(\n e,\n ae,\n n\n ), l = {\n ...s,\n setTileComponent() {\n var a;\n (a = o.value) == null || a.redraw();\n }\n };\n return pe(() => {\n o.value.off();\n }), { options: r, methods: l };\n}, ot = (e, o, t, n) => e.extend({\n initialize(s) {\n this.tileComponents = {}, this.on(\"tileunload\", this._unloadTile), t.setOptions(this, s);\n },\n createTile(s) {\n const r = this._tileCoordsToKey(s);\n this.tileComponents[r] = o.create(\"div\");\n const l = U({ setup: n, props: [\"coords\"] }, { coords: s });\n return mt(l, this.tileComponents[r]), this.tileComponents[r];\n },\n _unloadTile(s) {\n const r = this._tileCoordsToKey(s.coords);\n this.tileComponents[r] && (this.tileComponents[r].innerHTML = \"\", this.tileComponents[r] = void 0);\n }\n}), wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n CreateVueGridLayer: ot,\n gridLayerProps: ae,\n setupGridLayer: Ae\n}, Symbol.toStringTag, { value: \"Module\" })), ro = S({\n props: {\n ...ae,\n childRender: {\n type: Function,\n required: !0\n }\n },\n setup(e, o) {\n const t = c(), n = c(null), s = c(!1), r = O(h), l = m(M), { options: a, methods: i } = Ae(e, t, o);\n return _(async () => {\n const { GridLayer: u, DomUtil: d, Util: y } = r ? b.L : await import(\"leaflet/dist/leaflet-src.esm\"), w = ot(\n u,\n d,\n y,\n e.childRender\n );\n t.value = j(new w(a));\n const { listeners: v } = T(o.attrs);\n t.value.on(v), L(i, t.value, e), l({\n ...e,\n ...i,\n leafletObject: t.value\n }), s.value = !0, g(() => o.emit(\"ready\", t.value));\n }), { root: n, ready: s, leafletObject: t };\n },\n render() {\n return this.ready ? U(\"div\", { style: { display: \"none\" }, ref: \"root\" }) : null;\n }\n}), de = {\n iconUrl: {\n type: String\n },\n iconRetinaUrl: {\n type: String\n },\n iconSize: {\n type: [Object, Array]\n },\n iconAnchor: {\n type: [Object, Array]\n },\n popupAnchor: {\n type: [Object, Array]\n },\n tooltipAnchor: {\n type: [Object, Array]\n },\n shadowUrl: {\n type: String\n },\n shadowRetinaUrl: {\n type: String\n },\n shadowSize: {\n type: [Object, Array]\n },\n shadowAnchor: {\n type: [Object, Array]\n },\n bgPos: {\n type: [Object, Array]\n },\n className: {\n type: String\n }\n}, It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n iconProps: de\n}, Symbol.toStringTag, { value: \"Module\" })), so = S({\n name: \"LIcon\",\n props: {\n ...de,\n ...W\n },\n setup(e, o) {\n const t = c(), n = O(h), s = m(ve), r = m(be), l = m(fe);\n let a, i, u, d, y;\n const w = (N, P, B) => {\n const I = N && N.innerHTML;\n if (!P) {\n B && y && s() && r(I);\n return;\n }\n const { listeners: E } = T(o.attrs);\n y && i(y, E);\n const { options: ue } = J(e), $ = f(\n e,\n de,\n ue\n );\n I && ($.html = I), y = $.html ? u($) : d($), a(y, E), l(y);\n }, v = () => {\n g(() => w(t.value, !0, !1));\n }, z = () => {\n g(() => w(t.value, !1, !0));\n }, Z = {\n setIconUrl: v,\n setIconRetinaUrl: v,\n setIconSize: v,\n setIconAnchor: v,\n setPopupAnchor: v,\n setTooltipAnchor: v,\n setShadowUrl: v,\n setShadowRetinaUrl: v,\n setShadowAnchor: v,\n setBgPos: v,\n setClassName: v,\n setHtml: v\n };\n return _(async () => {\n const {\n DomEvent: N,\n divIcon: P,\n icon: B\n } = n ? b.L : await import(\"leaflet/dist/leaflet-src.esm\");\n a = N.on, i = N.off, u = P, d = B, L(Z, {}, e), new MutationObserver(z).observe(t.value, {\n attributes: !0,\n childList: !0,\n characterData: !0,\n subtree: !0\n