From d2854e481d7d7b7f0296d4447e884af837b043b3 Mon Sep 17 00:00:00 2001 From: Kadir Balku Date: Fri, 2 Aug 2024 16:37:46 +0200 Subject: [PATCH] chore: bump version --- source/dist/CategoryView-Z-tCFNv1.mjs | 60 + source/dist/ItemCard-CVfih_bz.mjs | 64 + source/dist/ItemView-cjeQBSTR.mjs | 1848 +++++++++++++++ source/dist/main-CZfMYx-A.mjs | 3167 +++++++++++++++++++++++++ 4 files changed, 5139 insertions(+) create mode 100644 source/dist/CategoryView-Z-tCFNv1.mjs create mode 100644 source/dist/ItemCard-CVfih_bz.mjs create mode 100644 source/dist/ItemView-cjeQBSTR.mjs create mode 100644 source/dist/main-CZfMYx-A.mjs diff --git a/source/dist/CategoryView-Z-tCFNv1.mjs b/source/dist/CategoryView-Z-tCFNv1.mjs new file mode 100644 index 0000000..dd6ce6f --- /dev/null +++ b/source/dist/CategoryView-Z-tCFNv1.mjs @@ -0,0 +1,60 @@ +import { reactive as p, computed as m, onMounted as f, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as g, renderSlot as _, createTextVNode as h, createCommentVNode as k, Fragment as y, renderList as v, createBlock as w, pushScopeId as I, popScopeId as S } from "vue"; +import { _ as C, u as b } from "./main-CZfMYx-A.mjs"; +import { useRoute as x } from "vue-router"; +import "@viur/vue-utils"; +import { I as L } from "./ItemCard-CVfih_bz.mjs"; +const V = (t) => (I("data-v-532e5cf3"), t = t(), S(), t), B = { + key: 0, + class: "viur-shop-loading-wrap" +}, H = /* @__PURE__ */ V(() => /* @__PURE__ */ o("sl-spinner", null, null, -1)), T = [ + H +], E = { + key: 1, + class: "bind" +}, M = { class: "page-header" }, N = { class: "viur-shop-category-view-list" }, A = ["loading", "disabled"], j = { + __name: "CategoryView", + props: { + skellist: { type: Array }, + filter: { type: Boolean, default: !0 }, + pageHeader: { type: String, default: "Artikel Liste" }, + listHandler: { type: Object, required: !0 } + }, + setup(t) { + const l = t, n = x(), c = b(), e = p({ + skellist: [], + loading: !0, + currentCursor: "", + isLastItem: !1, + itemCount: 99, + itemType: m(() => n.params.identifier) + }), s = l.listHandler; + async function d() { + e.loading = !0, await s.next(), e.skellist.length < s.state.skellist.length ? (e.skellist = s.state.skellist, e.loading = !1) : (e.loading = !1, e.isLastItem = !0); + } + return f(async () => { + await c.init(), await s.fetch(!0), e.skellist = s.state.skellist, e.loading = !1; + }), (u, q) => e.loading ? (a(), i("div", B, T)) : (a(), i("div", E, [ + o("div", M, [ + o("h1", null, g(t.pageHeader), 1) + ]), + t.filter ? _(u.$slots, "filter", { key: 0 }, () => [ + h(" text-transform text-transform TEST ") + ], !0) : k("", !0), + o("div", N, [ + (a(!0), i(y, null, v(e.skellist, (r) => (a(), w(L, { + key: r.shop_name, + item: r + }, null, 8, ["item"]))), 128)) + ]), + o("sl-button", { + onClick: d, + loading: e.loading, + disabled: e.isLastItem, + class: "viur-shop-category-view-more-button" + }, " Mehr anzeigen ", 8, A) + ])); + } +}, $ = /* @__PURE__ */ C(j, [["__scopeId", "data-v-532e5cf3"]]); +export { + $ as default +}; diff --git a/source/dist/ItemCard-CVfih_bz.mjs b/source/dist/ItemCard-CVfih_bz.mjs new file mode 100644 index 0000000..f198c63 --- /dev/null +++ b/source/dist/ItemCard-CVfih_bz.mjs @@ -0,0 +1,64 @@ +import { openBlock as l, createElementBlock as n, createElementVNode as e, toDisplayString as r, withModifiers as m, unref as d, createTextVNode as p, pushScopeId as u, popScopeId as h } from "vue"; +import { Request as _ } from "@viur/vue-utils"; +import { _ as f, u as v } from "./main-CZfMYx-A.mjs"; +const i = (t) => (u("data-v-dc32dd0b"), t = t(), h(), t), b = { class: "viur-shop-item-card-card" }, g = ["src", "alt"], k = { class: "viur-shop-item-card-headline" }, x = /* @__PURE__ */ i(() => /* @__PURE__ */ e("h4", { class: "viur-shop-item-card-subline" }, "B 21 x H 6,5 x T 19 cm", -1)), I = { class: "viur-shop-item-card-price" }, y = { + class: "viur-shop-item-card-footer", + slot: "footer" +}, S = /* @__PURE__ */ i(() => /* @__PURE__ */ e("sl-icon", { + name: "bag-plus", + slot: "prefix" +}, null, -1)), C = /* @__PURE__ */ i(() => /* @__PURE__ */ e("sl-button", { + size: "small", + outline: "", + class: "viur-shop-item-card-add-to-favourites-btn", + variant: "primary", + title: "Add to favourites" +}, [ + /* @__PURE__ */ e("sl-icon", { + name: "heart", + slot: "prefix" + }) +], -1)), w = { + __name: "ItemCard", + props: { + item: { + type: Object, + required: !0 + } + }, + setup(t) { + const a = v(); + function c(s) { + let o = "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"; + return s.dk_artikel.dest.image ? _.downloadUrlFor(s.dk_artikel.dest.image) : o; + } + return (s, o) => (l(), n("sl-card", b, [ + e("img", { + slot: "image", + src: c(t.item), + alt: t.item.shop_name, + loading: "lazy", + class: "viur-shop-item-card-image" + }, null, 8, g), + e("h3", k, r(t.item.shop_name), 1), + x, + e("div", I, r(t.item.shop_price_retail) + " €", 1), + e("div", y, [ + e("sl-button", { + size: "small", + class: "viur-shop-item-card-add-to-cart-btn", + variant: "primary", + title: "Add to cart", + onClick: o[0] || (o[0] = m((B) => d(a).addToCart(t.item.key, d(a).state.basket), ["stop"])) + }, [ + S, + p(" In den Warenkorb ") + ]), + C + ]) + ])); + } +}, T = /* @__PURE__ */ f(w, [["__scopeId", "data-v-dc32dd0b"]]); +export { + T as I +}; diff --git a/source/dist/ItemView-cjeQBSTR.mjs b/source/dist/ItemView-cjeQBSTR.mjs new file mode 100644 index 0000000..acf7a84 --- /dev/null +++ b/source/dist/ItemView-cjeQBSTR.mjs @@ -0,0 +1,1848 @@ +import { reactive as Yt, onBeforeMount as Gt, openBlock as Qt, createElementBlock as Xt, Fragment as te, createElementVNode as p, toDisplayString as dt, withModifiers as ee, createTextVNode as It, createVNode as se, pushScopeId as ie, popScopeId as re } from "vue"; +import { Request as ut } from "@viur/vue-utils"; +import { useRoute as oe } from "vue-router"; +import { I as ne } from "./ItemCard-CVfih_bz.mjs"; +import { _ as ae } from "./main-CZfMYx-A.mjs"; +function pt(s, t, e) { + const i = (r) => Object.is(r, -0) ? 0 : r; + return s < t ? i(t) : s > e ? i(e) : i(s); +} +var le = class { + constructor(s, t) { + this.timerId = 0, this.activeInteractions = 0, this.paused = !1, this.stopped = !0, this.pause = () => { + this.activeInteractions++ || (this.paused = !0, this.host.requestUpdate()); + }, this.resume = () => { + --this.activeInteractions || (this.paused = !1, this.host.requestUpdate()); + }, s.addController(this), this.host = s, this.tickCallback = t; + } + hostConnected() { + this.host.addEventListener("mouseenter", this.pause), this.host.addEventListener("mouseleave", this.resume), this.host.addEventListener("focusin", this.pause), this.host.addEventListener("focusout", this.resume), this.host.addEventListener("touchstart", this.pause, { passive: !0 }), this.host.addEventListener("touchend", this.resume); + } + hostDisconnected() { + this.stop(), this.host.removeEventListener("mouseenter", this.pause), this.host.removeEventListener("mouseleave", this.resume), this.host.removeEventListener("focusin", this.pause), this.host.removeEventListener("focusout", this.resume), this.host.removeEventListener("touchstart", this.pause), this.host.removeEventListener("touchend", this.resume); + } + start(s) { + this.stop(), this.stopped = !1, this.timerId = window.setInterval(() => { + this.paused || this.tickCallback(); + }, s); + } + stop() { + clearInterval(this.timerId), this.stopped = !0, this.host.requestUpdate(); + } +}; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const W = globalThis, at = W.ShadowRoot && (W.ShadyCSS === void 0 || W.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = Symbol(), gt = /* @__PURE__ */ new WeakMap(); +let Ut = class { + constructor(t, e, i) { + if (this._$cssResult$ = !0, i !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t, this.t = e; + } + get styleSheet() { + let t = this.o; + const e = this.t; + if (at && t === void 0) { + const i = e !== void 0 && e.length === 1; + i && (t = gt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && gt.set(e, t)); + } + return t; + } + toString() { + return this.cssText; + } +}; +const ce = (s) => new Ut(typeof s == "string" ? s : s + "", void 0, lt), ct = (s, ...t) => { + const e = s.length === 1 ? s[0] : t.reduce((i, r, o) => i + ((n) => { + if (n._$cssResult$ === !0) return n.cssText; + if (typeof n == "number") return n; + throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(r) + s[o + 1], s[0]); + return new Ut(e, s, lt); +}, he = (s, t) => { + if (at) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); + else for (const e of t) { + const i = document.createElement("style"), r = W.litNonce; + r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i); + } +}, vt = at ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { + let e = ""; + for (const i of t.cssRules) e += i.cssText; + return ce(e); +})(s) : s; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const { is: de, defineProperty: ue, getOwnPropertyDescriptor: pe, getOwnPropertyNames: ge, getOwnPropertySymbols: ve, getPrototypeOf: fe } = Object, $ = globalThis, ft = $.trustedTypes, me = ft ? ft.emptyScript : "", G = $.reactiveElementPolyfillSupport, O = (s, t) => s, Z = { toAttribute(s, t) { + switch (t) { + case Boolean: + s = s ? me : null; + break; + case Object: + case Array: + s = s == null ? s : JSON.stringify(s); + } + return s; +}, fromAttribute(s, t) { + let e = s; + switch (t) { + case Boolean: + e = s !== null; + break; + case Number: + e = s === null ? null : Number(s); + break; + case Object: + case Array: + try { + e = JSON.parse(s); + } catch { + e = null; + } + } + return e; +} }, ht = (s, t) => !de(s, t), mt = { attribute: !0, type: String, converter: Z, reflect: !1, hasChanged: ht }; +Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); +class L extends HTMLElement { + static addInitializer(t) { + this._$Ei(), (this.l ?? (this.l = [])).push(t); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t, e = mt) { + if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) { + const i = Symbol(), r = this.getPropertyDescriptor(t, i, e); + r !== void 0 && ue(this.prototype, t, r); + } + } + static getPropertyDescriptor(t, e, i) { + const { get: r, set: o } = pe(this.prototype, t) ?? { get() { + return this[e]; + }, set(n) { + this[e] = n; + } }; + return { get() { + return r == null ? void 0 : r.call(this); + }, set(n) { + const l = r == null ? void 0 : r.call(this); + o.call(this, n), this.requestUpdate(t, l, i); + }, configurable: !0, enumerable: !0 }; + } + static getPropertyOptions(t) { + return this.elementProperties.get(t) ?? mt; + } + static _$Ei() { + if (this.hasOwnProperty(O("elementProperties"))) return; + const t = fe(this); + t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(O("finalized"))) return; + if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) { + const e = this.properties, i = [...ge(e), ...ve(e)]; + for (const r of i) this.createProperty(r, e[r]); + } + const t = this[Symbol.metadata]; + if (t !== null) { + const e = litPropertyMetadata.get(t); + if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [e, i] of this.elementProperties) { + const r = this._$Eu(e, i); + r !== void 0 && this._$Eh.set(r, e); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(t) { + const e = []; + if (Array.isArray(t)) { + const i = new Set(t.flat(1 / 0).reverse()); + for (const r of i) e.unshift(vt(r)); + } else t !== void 0 && e.push(vt(t)); + return e; + } + static _$Eu(t, e) { + const i = e.attribute; + return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev(); + } + _$Ev() { + var t; + this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this)); + } + addController(t) { + var e; + (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t)); + } + removeController(t) { + var e; + (e = this._$EO) == null || e.delete(t); + } + _$E_() { + const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; + for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]); + t.size > 0 && (this._$Ep = t); + } + createRenderRoot() { + const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return he(t, this.constructor.elementStyles), t; + } + connectedCallback() { + var t; + this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => { + var i; + return (i = e.hostConnected) == null ? void 0 : i.call(e); + }); + } + enableUpdating(t) { + } + disconnectedCallback() { + var t; + (t = this._$EO) == null || t.forEach((e) => { + var i; + return (i = e.hostDisconnected) == null ? void 0 : i.call(e); + }); + } + attributeChangedCallback(t, e, i) { + this._$AK(t, i); + } + _$EC(t, e) { + var o; + const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i); + if (r !== void 0 && i.reflect === !0) { + const n = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : Z).toAttribute(e, i.type); + this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null; + } + } + _$AK(t, e) { + var o; + const i = this.constructor, r = i._$Eh.get(t); + if (r !== void 0 && this._$Em !== r) { + const n = i.getPropertyOptions(r), l = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : Z; + this._$Em = r, this[r] = l.fromAttribute(e, n.type), this._$Em = null; + } + } + requestUpdate(t, e, i) { + if (t !== void 0) { + if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? ht)(this[t], e)) return; + this.P(t, e, i); + } + this.isUpdatePending === !1 && (this._$ES = this._$ET()); + } + P(t, e, i) { + this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t); + } + async _$ET() { + this.isUpdatePending = !0; + try { + await this._$ES; + } catch (e) { + Promise.reject(e); + } + const t = this.scheduleUpdate(); + return t != null && await t, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + var i; + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { + for (const [o, n] of this._$Ep) this[o] = n; + this._$Ep = void 0; + } + const r = this.constructor.elementProperties; + if (r.size > 0) for (const [o, n] of r) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n); + } + let t = !1; + const e = this._$AL; + try { + t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((r) => { + var o; + return (o = r.hostUpdate) == null ? void 0 : o.call(r); + }), this.update(e)) : this._$EU(); + } catch (r) { + throw t = !1, this._$EU(), r; + } + t && this._$AE(e); + } + willUpdate(t) { + } + _$AE(t) { + var e; + (e = this._$EO) == null || e.forEach((i) => { + var r; + return (r = i.hostUpdated) == null ? void 0 : r.call(i); + }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t) { + return !0; + } + update(t) { + this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU(); + } + updated(t) { + } + firstUpdated(t) { + } +} +L.elementStyles = [], L.shadowRootOptions = { mode: "open" }, L[O("elementProperties")] = /* @__PURE__ */ new Map(), L[O("finalized")] = /* @__PURE__ */ new Map(), G == null || G({ ReactiveElement: L }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const R = globalThis, K = R.trustedTypes, _t = K ? K.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Ot = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, Rt = "?" + w, _e = `<${Rt}>`, E = document, B = () => E.createComment(""), H = (s) => s === null || typeof s != "object" && typeof s != "function", Nt = Array.isArray, be = (s) => Nt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Q = `[ +\f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, yt = />/g, S = RegExp(`>|${Q}(?:([^\\s"'>=/]+)(${Q}*=${Q}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, $t = /"/g, Bt = /^(?:script|style|textarea|title)$/i, ye = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), b = ye(1), x = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), St = /* @__PURE__ */ new WeakMap(), C = E.createTreeWalker(E, 129); +function Ht(s, t) { + if (!Array.isArray(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return _t !== void 0 ? _t.createHTML(t) : t; +} +const we = (s, t) => { + const e = s.length - 1, i = []; + let r, o = t === 2 ? "" : "", n = I; + for (let l = 0; l < e; l++) { + const a = s[l]; + let d, g, h = -1, _ = 0; + for (; _ < a.length && (n.lastIndex = _, g = n.exec(a), g !== null); ) _ = n.lastIndex, n === I ? g[1] === "!--" ? n = bt : g[1] !== void 0 ? n = yt : g[2] !== void 0 ? (Bt.test(g[2]) && (r = RegExp("" ? (n = r ?? I, h = -1) : g[1] === void 0 ? h = -2 : (h = n.lastIndex - g[2].length, d = g[1], n = g[3] === void 0 ? S : g[3] === '"' ? $t : wt) : n === $t || n === wt ? n = S : n === bt || n === yt ? n = I : (n = S, r = void 0); + const y = n === S && s[l + 1].startsWith("/>") ? " " : ""; + o += n === I ? a + _e : h >= 0 ? (i.push(d), a.slice(0, h) + Ot + a.slice(h) + w + y) : a + w + (h === -2 ? l : y); + } + return [Ht(s, o + (s[e] || "") + (t === 2 ? "" : "")), i]; +}; +class D { + constructor({ strings: t, _$litType$: e }, i) { + let r; + this.parts = []; + let o = 0, n = 0; + const l = t.length - 1, a = this.parts, [d, g] = we(t, e); + if (this.el = D.createElement(d, i), C.currentNode = this.el.content, e === 2) { + const h = this.el.content.firstChild; + h.replaceWith(...h.childNodes); + } + for (; (r = C.nextNode()) !== null && a.length < l; ) { + if (r.nodeType === 1) { + if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ot)) { + const _ = g[n++], y = r.getAttribute(h).split(w), V = /([.?@])?(.*)/.exec(_); + a.push({ type: 1, index: o, name: V[2], strings: y, ctor: V[1] === "." ? Se : V[1] === "?" ? Ae : V[1] === "@" ? Ce : J }), r.removeAttribute(h); + } else h.startsWith(w) && (a.push({ type: 6, index: o }), r.removeAttribute(h)); + if (Bt.test(r.tagName)) { + const h = r.textContent.split(w), _ = h.length - 1; + if (_ > 0) { + r.textContent = K ? K.emptyScript : ""; + for (let y = 0; y < _; y++) r.append(h[y], B()), C.nextNode(), a.push({ type: 2, index: ++o }); + r.append(h[_], B()); + } + } + } else if (r.nodeType === 8) if (r.data === Rt) a.push({ type: 2, index: o }); + else { + let h = -1; + for (; (h = r.data.indexOf(w, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += w.length - 1; + } + o++; + } + } + static createElement(t, e) { + const i = E.createElement("template"); + return i.innerHTML = t, i; + } +} +function k(s, t, e = s, i) { + var n, l; + if (t === x) return t; + let r = i !== void 0 ? (n = e._$Co) == null ? void 0 : n[i] : e._$Cl; + const o = H(t) ? void 0 : t._$litDirective$; + return (r == null ? void 0 : r.constructor) !== o && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), o === void 0 ? r = void 0 : (r = new o(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = k(s, r._$AS(s, t.values), r, i)), t; +} +class $e { + constructor(t, e) { + this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t) { + const { el: { content: e }, parts: i } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? E).importNode(e, !0); + C.currentNode = r; + let o = C.nextNode(), n = 0, l = 0, a = i[0]; + for (; a !== void 0; ) { + if (n === a.index) { + let d; + a.type === 2 ? d = new j(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ee(o, this, t)), this._$AV.push(d), a = i[++l]; + } + n !== (a == null ? void 0 : a.index) && (o = C.nextNode(), n++); + } + return C.currentNode = E, r; + } + p(t) { + let e = 0; + for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++; + } +} +class j { + get _$AU() { + var t; + return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv; + } + constructor(t, e, i, r) { + this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0; + } + get parentNode() { + let t = this._$AA.parentNode; + const e = this._$AM; + return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t, e = this) { + t = k(this, t, e), H(t) ? t === v || t == null || t === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : be(t) ? this.k(t) : this._(t); + } + S(t) { + return this._$AA.parentNode.insertBefore(t, this._$AB); + } + T(t) { + this._$AH !== t && (this._$AR(), this._$AH = this.S(t)); + } + _(t) { + this._$AH !== v && H(this._$AH) ? this._$AA.nextSibling.data = t : this.T(E.createTextNode(t)), this._$AH = t; + } + $(t) { + var o; + const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = D.createElement(Ht(i.h, i.h[0]), this.options)), i); + if (((o = this._$AH) == null ? void 0 : o._$AD) === r) this._$AH.p(e); + else { + const n = new $e(r, this), l = n.u(this.options); + n.p(e), this.T(l), this._$AH = n; + } + } + _$AC(t) { + let e = St.get(t.strings); + return e === void 0 && St.set(t.strings, e = new D(t)), e; + } + k(t) { + Nt(this._$AH) || (this._$AH = [], this._$AR()); + const e = this._$AH; + let i, r = 0; + for (const o of t) r === e.length ? e.push(i = new j(this.S(B()), this.S(B()), this, this.options)) : i = e[r], i._$AI(o), r++; + r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r); + } + _$AR(t = this._$AA.nextSibling, e) { + var i; + for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) { + const r = t.nextSibling; + t.remove(), t = r; + } + } + setConnected(t) { + var e; + this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t)); + } +} +class J { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t, e, i, r, o) { + this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v; + } + _$AI(t, e = this, i, r) { + const o = this.strings; + let n = !1; + if (o === void 0) t = k(this, t, e, 0), n = !H(t) || t !== this._$AH && t !== x, n && (this._$AH = t); + else { + const l = t; + let a, d; + for (t = o[0], a = 0; a < o.length - 1; a++) d = k(this, l[i + a], e, a), d === x && (d = this._$AH[a]), n || (n = !H(d) || d !== this._$AH[a]), d === v ? t = v : t !== v && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d; + } + n && !r && this.j(t); + } + j(t) { + t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); + } +} +class Se extends J { + constructor() { + super(...arguments), this.type = 3; + } + j(t) { + this.element[this.name] = t === v ? void 0 : t; + } +} +class Ae extends J { + constructor() { + super(...arguments), this.type = 4; + } + j(t) { + this.element.toggleAttribute(this.name, !!t && t !== v); + } +} +class Ce extends J { + constructor(t, e, i, r, o) { + super(t, e, i, r, o), this.type = 5; + } + _$AI(t, e = this) { + if ((t = k(this, t, e, 0) ?? v) === x) return; + const i = this._$AH, r = t === v && i !== v || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== v && (i === v || r); + r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t; + } + handleEvent(t) { + var e; + typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t); + } +} +class Ee { + constructor(t, e, i) { + this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t) { + k(this, t); + } +} +const X = R.litHtmlPolyfillSupport; +X == null || X(D, j), (R.litHtmlVersions ?? (R.litHtmlVersions = [])).push("3.1.4"); +const xe = (s, t, e) => { + const i = (e == null ? void 0 : e.renderBefore) ?? t; + let r = i._$litPart$; + if (r === void 0) { + const o = (e == null ? void 0 : e.renderBefore) ?? null; + i._$litPart$ = r = new j(t.insertBefore(B(), o), o, void 0, e ?? {}); + } + return r._$AI(s), r; +}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +class N extends L { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; + } + createRenderRoot() { + var e; + const t = super.createRenderRoot(); + return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t; + } + update(t) { + const e = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = xe(e, this.renderRoot, this.renderOptions); + } + connectedCallback() { + var t; + super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0); + } + disconnectedCallback() { + var t; + super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1); + } + render() { + return x; + } +} +var zt; +N._$litElement$ = !0, N.finalized = !0, (zt = globalThis.litElementHydrateSupport) == null || zt.call(globalThis, { LitElement: N }); +const tt = globalThis.litElementPolyfillSupport; +tt == null || tt({ LitElement: N }); +(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.6"); +var Pe = ct` + :host { + --slide-gap: var(--sl-spacing-medium, 1rem); + --aspect-ratio: 16 / 9; + --scroll-hint: 0px; + + display: flex; + } + + .carousel { + display: grid; + grid-template-columns: min-content 1fr min-content; + grid-template-rows: 1fr min-content; + grid-template-areas: + '. slides .' + '. pagination .'; + gap: var(--sl-spacing-medium); + align-items: center; + min-height: 100%; + min-width: 100%; + position: relative; + } + + .carousel__pagination { + grid-area: pagination; + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--sl-spacing-small); + } + + .carousel__slides { + grid-area: slides; + + display: grid; + height: 100%; + width: 100%; + align-items: center; + justify-items: center; + overflow: auto; + overscroll-behavior-x: contain; + scrollbar-width: none; + aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page)); + border-radius: var(--sl-border-radius-small); + + --slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page)); + } + + @media (prefers-reduced-motion) { + :where(.carousel__slides) { + scroll-behavior: auto; + } + } + + .carousel__slides--horizontal { + grid-auto-flow: column; + grid-auto-columns: var(--slide-size); + grid-auto-rows: 100%; + column-gap: var(--slide-gap); + scroll-snap-type: x mandatory; + scroll-padding-inline: var(--scroll-hint); + padding-inline: var(--scroll-hint); + overflow-y: hidden; + } + + .carousel__slides--vertical { + grid-auto-flow: row; + grid-auto-columns: 100%; + grid-auto-rows: var(--slide-size); + row-gap: var(--slide-gap); + scroll-snap-type: y mandatory; + scroll-padding-block: var(--scroll-hint); + padding-block: var(--scroll-hint); + overflow-x: hidden; + } + + .carousel__slides--dragging { + } + + :host([vertical]) ::slotted(sl-carousel-item) { + height: 100%; + } + + .carousel__slides::-webkit-scrollbar { + display: none; + } + + .carousel__navigation { + grid-area: navigation; + display: contents; + font-size: var(--sl-font-size-x-large); + } + + .carousel__navigation-button { + flex: 0 0 auto; + display: flex; + align-items: center; + background: none; + border: none; + border-radius: var(--sl-border-radius-small); + font-size: inherit; + color: var(--sl-color-neutral-600); + padding: var(--sl-spacing-x-small); + cursor: pointer; + transition: var(--sl-transition-medium) color; + appearance: none; + } + + .carousel__navigation-button--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .carousel__navigation-button--disabled::part(base) { + pointer-events: none; + } + + .carousel__navigation-button--previous { + grid-column: 1; + grid-row: 1; + } + + .carousel__navigation-button--next { + grid-column: 3; + grid-row: 1; + } + + .carousel__pagination-item { + display: block; + cursor: pointer; + background: none; + border: 0; + border-radius: var(--sl-border-radius-circle); + width: var(--sl-spacing-small); + height: var(--sl-spacing-small); + background-color: var(--sl-color-neutral-300); + padding: 0; + margin: 0; + } + + .carousel__pagination-item--active { + background-color: var(--sl-color-neutral-700); + transform: scale(1.2); + } + + /* Focus styles */ + .carousel__slides:focus-visible, + .carousel__navigation-button:focus-visible, + .carousel__pagination-item:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } +`, Dt = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, At = Object.getOwnPropertySymbols, Me = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable, Ct = (s, t, e) => t in s ? Dt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, jt = (s, t) => { + for (var e in t || (t = {})) + Me.call(t, e) && Ct(s, e, t[e]); + if (At) + for (var e of At(t)) + ke.call(t, e) && Ct(s, e, t[e]); + return s; +}, c = (s, t, e, i) => { + for (var r = i > 1 ? void 0 : i ? Le(t, e) : t, o = s.length - 1, n; o >= 0; o--) + (n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r); + return i && r && Dt(t, e, r), r; +}; +function Te(s, t) { + return new Promise((e) => { + function i(r) { + r.target === s && (s.removeEventListener(t, i), e()); + } + s.addEventListener(t, i); + }); +} +function Et() { + return window.matchMedia("(prefers-reduced-motion: reduce)").matches; +} +const it = /* @__PURE__ */ new Set(), ze = new MutationObserver(Wt), M = /* @__PURE__ */ new Map(); +let Vt = document.documentElement.dir || "ltr", qt = document.documentElement.lang || navigator.language, A; +ze.observe(document.documentElement, { + attributes: !0, + attributeFilter: ["dir", "lang"] +}); +function Ft(...s) { + s.map((t) => { + const e = t.$code.toLowerCase(); + M.has(e) ? M.set(e, Object.assign(Object.assign({}, M.get(e)), t)) : M.set(e, t), A || (A = t); + }), Wt(); +} +function Wt() { + Vt = document.documentElement.dir || "ltr", qt = document.documentElement.lang || navigator.language, [...it.keys()].map((s) => { + typeof s.requestUpdate == "function" && s.requestUpdate(); + }); +} +let Ie = class { + constructor(t) { + this.host = t, this.host.addController(this); + } + hostConnected() { + it.add(this.host); + } + hostDisconnected() { + it.delete(this.host); + } + dir() { + return `${this.host.dir || Vt}`.toLowerCase(); + } + lang() { + return `${this.host.lang || qt}`.toLowerCase(); + } + getTranslationData(t) { + var e, i; + const r = new Intl.Locale(t.replace(/_/g, "-")), o = r == null ? void 0 : r.language.toLowerCase(), n = (i = (e = r == null ? void 0 : r.region) === null || e === void 0 ? void 0 : e.toLowerCase()) !== null && i !== void 0 ? i : "", l = M.get(`${o}-${n}`), a = M.get(o); + return { locale: r, language: o, region: n, primary: l, secondary: a }; + } + exists(t, e) { + var i; + const { primary: r, secondary: o } = this.getTranslationData((i = e.lang) !== null && i !== void 0 ? i : this.lang()); + return e = Object.assign({ includeFallback: !1 }, e), !!(r && r[t] || o && o[t] || e.includeFallback && A && A[t]); + } + term(t, ...e) { + const { primary: i, secondary: r } = this.getTranslationData(this.lang()); + let o; + if (i && i[t]) + o = i[t]; + else if (r && r[t]) + o = r[t]; + else if (A && A[t]) + o = A[t]; + else + return console.error(`No translation found for: ${String(t)}`), String(t); + return typeof o == "function" ? o(...e) : o; + } + date(t, e) { + return t = new Date(t), new Intl.DateTimeFormat(this.lang(), e).format(t); + } + number(t, e) { + return t = Number(t), isNaN(t) ? "" : new Intl.NumberFormat(this.lang(), e).format(t); + } + relativeTime(t, e, i) { + return new Intl.RelativeTimeFormat(this.lang(), i).format(t, e); + } +}; +var Zt = { + $code: "en", + $name: "English", + $dir: "ltr", + carousel: "Carousel", + clearEntry: "Clear entry", + close: "Close", + copied: "Copied", + copy: "Copy", + currentValue: "Current value", + error: "Error", + goToSlide: (s, t) => `Go to slide ${s} of ${t}`, + hidePassword: "Hide password", + loading: "Loading", + nextMonth: "Next month", + nextSlide: "Next slide", + numOptionsSelected: (s) => s === 0 ? "No options selected" : s === 1 ? "1 option selected" : `${s} options selected`, + previousMonth: "Previous month", + previousSlide: "Previous slide", + progress: "Progress", + remove: "Remove", + resize: "Resize", + scrollToEnd: "Scroll to end", + scrollToStart: "Scroll to start", + selectAColorFromTheScreen: "Select a color from the screen", + showPassword: "Show password", + slideNum: (s) => `Slide ${s}`, + toggleColorFormat: "Toggle color format" +}; +Ft(Zt); +var Ue = Zt, Oe = class extends Ie { +}; +Ft(Ue); +var rt = ""; +function xt(s) { + rt = s; +} +function ot(s = "") { + if (!rt) { + const t = [...document.getElementsByTagName("script")], e = t.find((i) => i.hasAttribute("data-shoelace")); + if (e) + xt(e.getAttribute("data-shoelace")); + else { + const i = t.find((o) => /shoelace(\.min)?\.js($|\?)/.test(o.src) || /shoelace-autoloader(\.min)?\.js($|\?)/.test(o.src)); + let r = ""; + i && (r = i.getAttribute("src")), xt(r.split("/").slice(0, -1).join("/")); + } + } + return rt.replace(/\/$/, "") + (s ? `/${s.replace(/^\//, "")}` : ""); +} +var Re = { + name: "default", + resolver: (s, t = !1) => ot(t ? `assets/bootstrap-icons/${s}.svg` : `assets/bootstrap-icons/${s.substring(0, 1)}/${s}.svg`) +}, Ne = Re, Be = { + name: "viur", + resolver: (s, t = !1) => ot(`/assets/icons/${s}.svg`), + mutator: (s) => { + s.setAttribute("fill", "currentColor"), [...s.querySelectorAll("*")].map((t) => t.setAttribute("fill", "inherit")); + } +}, He = Be, Pt = { + caret: ` + + + + `, + check: ` + + + + + + + + + + + `, + "chevron-down": ` + + + + `, + "chevron-left": ` + + + + `, + "chevron-right": ` + + + + `, + copy: ` + + + + `, + eye: ` + + + + + `, + "eye-slash": ` + + + + + + `, + eyedropper: ` + + + + `, + "grip-vertical": ` + + + + `, + indeterminate: ` + + + + + + + + + + `, + checked: ` + + + + + + + + `, + "person-fill": ` + + + + `, + "play-fill": ` + + + + `, + "pause-fill": ` + + + + `, + radio: ` + + + + + + + + `, + "star-fill": ` + + + + `, + "x-lg": ` + + + + `, + "x-circle-fill": ` + + + + `, + search: ` + + + + ` +}, De = { + name: "system", + resolver: (s, t = !1) => s in Pt ? `data:image/svg+xml,${encodeURIComponent(Pt[s])}` : "" +}, je = De, Ve = [He, Ne, je], nt = []; +function qe(s) { + nt.push(s); +} +function Fe(s) { + nt = nt.filter((t) => t !== s); +} +function Lt(s) { + return Ve.find((t) => t.name === s); +} +var We = ct` + :host { + display: inline-block; + width: 1em; + height: 1em; + box-sizing: content-box !important; + } + + svg { + display: block; + height: 100%; + width: 100%; + } +`; +function P(s, t) { + const e = jt({ + waitUntilFirstUpdate: !1 + }, t); + return (i, r) => { + const { update: o } = i, n = Array.isArray(s) ? s : [s]; + i.update = function(l) { + n.forEach((a) => { + const d = a; + if (l.has(d)) { + const g = l.get(d), h = this[d]; + g !== h && (!e.waitUntilFirstUpdate || this.hasUpdated) && this[r](g, h); + } + }), o.call(this, l); + }; + }; +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Ze = { attribute: !0, type: String, converter: Z, reflect: !1, hasChanged: ht }, Ke = (s = Ze, t, e) => { + const { kind: i, metadata: r } = e; + let o = globalThis.litPropertyMetadata.get(r); + if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), o.set(e.name, s), i === "accessor") { + const { name: n } = e; + return { set(l) { + const a = t.get.call(this); + t.set.call(this, l), this.requestUpdate(n, a, s); + }, init(l) { + return l !== void 0 && this.P(n, void 0, s), l; + } }; + } + if (i === "setter") { + const { name: n } = e; + return function(l) { + const a = this[n]; + t.call(this, l), this.requestUpdate(n, a, s); + }; + } + throw Error("Unsupported decorator location: " + i); +}; +function f(s) { + return (t, e) => typeof e == "object" ? Ke(s, t, e) : ((i, r, o) => { + const n = r.hasOwnProperty(o); + return r.constructor.createProperty(o, n ? { ...i, wrapped: !0 } : i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0; + })(s, t, e); +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function Y(s) { + return f({ ...s, state: !0, attribute: !1 }); +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function Je(s) { + return (t, e) => { + const i = typeof t == "function" ? t : t[e]; + Object.assign(i, s); + }; +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Ye = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function Kt(s, t) { + return (e, i, r) => { + const o = (n) => { + var l; + return ((l = n.renderRoot) == null ? void 0 : l.querySelector(s)) ?? null; + }; + return Ye(e, i, { get() { + return o(this); + } }); + }; +} +var T = class extends N { + constructor() { + super(), Object.entries(this.constructor.dependencies).forEach(([s, t]) => { + this.constructor.define(s, t); + }); + } + emit(s, t) { + const e = new CustomEvent(s, jt({ + bubbles: !0, + cancelable: !1, + composed: !0, + detail: {} + }, t)); + return this.dispatchEvent(e), e; + } + /* eslint-enable */ + static define(s, t = this, e = {}) { + const i = customElements.get(s); + if (!i) { + customElements.define(s, class extends t { + }, e); + return; + } + let r = " (unknown version)", o = r; + "version" in t && t.version && (r = " v" + t.version), "version" in i && i.version && (o = " v" + i.version), !(r && o && r === o) && console.warn( + `Attempted to register <${s}>${r}, but <${s}>${o} has already been registered.` + ); + } +}; +T.version = "1.0.6-v2.15.1"; +T.dependencies = {}; +c([ + f() +], T.prototype, "dir", 2); +c([ + f() +], T.prototype, "lang", 2); +var Jt = ct` + :host { + box-sizing: border-box; + } + + :host *, + :host *::before, + :host *::after { + box-sizing: border-box; + } + + [hidden] { + display: none !important; + } +`; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Ge = (s, t) => (s == null ? void 0 : s._$litType$) !== void 0; +var U = Symbol(), q = Symbol(), et, st = /* @__PURE__ */ new Map(), m = class extends T { + constructor() { + super(...arguments), this.initialRender = !1, this.svg = null, this.label = "", this.library = "default", this.vueonce = !0, this.sprite = !1; + } + /** Given a URL, this function returns the resulting SVG element or an appropriate error symbol. */ + async resolveIcon(s, t) { + var e; + let i; + if (t != null && t.spriteSheet) { + this.svg = b` + + `, await this.updateComplete; + const r = this.shadowRoot.querySelector("[part='svg']"); + return typeof t.mutator == "function" && t.mutator(r), this.svg; + } + try { + if (i = await fetch(s, { mode: "cors" }), !i.ok) + return i.status === 410 ? U : q; + } catch { + return q; + } + try { + const r = document.createElement("div"); + r.innerHTML = await i.text(); + const o = r.firstElementChild; + if (((e = o == null ? void 0 : o.tagName) == null ? void 0 : e.toLowerCase()) !== "svg") + return U; + et || (et = new DOMParser()); + const l = et.parseFromString(o.outerHTML, "text/html").body.querySelector("svg"); + return l ? (l.part.add("svg"), document.adoptNode(l)) : U; + } catch { + return U; + } + } + connectedCallback() { + super.connectedCallback(), qe(this); + } + firstUpdated() { + this.sprite || this.setIcon(), this.initialRender = !0, this.setIcon(); + } + disconnectedCallback() { + super.disconnectedCallback(), Fe(this); + } + getIconSource(s = !1) { + const t = Lt(this.library); + return this.name && t ? { + url: t.resolver(this.name, s), + fromLibrary: !0 + } : { + url: this.src, + fromLibrary: !1 + }; + } + getDir() { + const { url: s } = this.getIconSource(!0); + return s == null ? void 0 : s.substring(0, s == null ? void 0 : s.lastIndexOf("/")); + } + // Fetches the icon and redraws it. Used to handle library registrations. + redraw() { + this.sprite || this.setIcon(); + } + handleLabelChange() { + typeof this.label == "string" && this.label.length > 0 ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.label), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true")); + } + async setIcon() { + var s; + const { url: t, fromLibrary: e } = this.getIconSource(), i = e ? Lt(this.library) : void 0; + if (!t) { + this.svg = null; + return; + } + let r = st.get(t); + if (r || (r = this.resolveIcon(t, i), st.set(t, r)), !this.initialRender) + return; + const o = await r; + if (o === q && st.delete(t), t === this.getIconSource().url) { + if (Ge(o)) { + this.svg = o; + return; + } + switch (o) { + case q: + case U: + this.svg = null, this.emit("sl-error"); + break; + default: + this.svg = o.cloneNode(!0), (s = i == null ? void 0 : i.mutator) == null || s.call(i, this.svg), this.emit("sl-load"); + } + } + } + handleChange() { + this.sprite || this.setIcon(); + } + render() { + return b` + ${this.sprite ? b` + + ` : b`${this.svg}`}`; + } +}; +m.styles = [Jt, We]; +c([ + Y() +], m.prototype, "svg", 2); +c([ + f({ reflect: !0 }) +], m.prototype, "name", 2); +c([ + f() +], m.prototype, "src", 2); +c([ + f() +], m.prototype, "label", 2); +c([ + f({ reflect: !0 }) +], m.prototype, "library", 2); +c([ + f({ reflect: !0, type: Boolean, attribute: "v-once" }) +], m.prototype, "vueonce", 2); +c([ + f({ reflect: !0, type: Boolean }) +], m.prototype, "sprite", 2); +c([ + P("label") +], m.prototype, "handleLabelChange", 1); +c([ + P(["name", "src", "library"]) +], m.prototype, "setIcon", 1); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Qe = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Xe = (s) => (...t) => ({ _$litDirective$: s, values: t }); +class ts { + constructor(t) { + } + get _$AU() { + return this._$AM._$AU; + } + _$AT(t, e, i) { + this._$Ct = t, this._$AM = e, this._$Ci = i; + } + _$AS(t, e) { + return this.update(t, e); + } + update(t, e) { + return this.render(...e); + } +} +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const F = Xe(class extends ts { + constructor(s) { + var t; + if (super(s), s.type !== Qe.ATTRIBUTE || s.name !== "class" || ((t = s.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); + } + render(s) { + return " " + Object.keys(s).filter((t) => s[t]).join(" ") + " "; + } + update(s, [t]) { + var i, r; + if (this.st === void 0) { + this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter((o) => o !== ""))); + for (const o in t) t[o] && !((i = this.nt) != null && i.has(o)) && this.st.add(o); + return this.render(t); + } + const e = s.element.classList; + for (const o of this.st) o in t || (e.remove(o), this.st.delete(o)); + for (const o in t) { + const n = !!t[o]; + n === this.st.has(o) || (r = this.nt) != null && r.has(o) || (n ? (e.add(o), this.st.add(o)) : (e.remove(o), this.st.delete(o))); + } + return x; + } +}); +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function* Mt(s, t) { + if (s !== void 0) { + let e = 0; + for (const i of s) yield t(i, e++); + } +} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function* kt(s, t, e = 1) { + const i = t === void 0 ? 0 : s; + t ?? (t = s); + for (let r = i; e > 0 ? r < t : t < r; r += e) yield r; +} +var es = (s, t) => { + let e = 0; + return function(...i) { + window.clearTimeout(e), e = window.setTimeout(() => { + s.call(this, ...i); + }, t); + }; +}, Tt = (s, t, e) => { + const i = s[t]; + s[t] = function(...r) { + i.call(this, ...r), e.call(this, i, ...r); + }; +}, ss = "onscrollend" in window; +if (!ss) { + const s = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new WeakMap(), e = (r) => { + for (const o of r.changedTouches) + s.add(o.identifier); + }, i = (r) => { + for (const o of r.changedTouches) + s.delete(o.identifier); + }; + document.addEventListener("touchstart", e, !0), document.addEventListener("touchend", i, !0), document.addEventListener("touchcancel", i, !0), Tt(EventTarget.prototype, "addEventListener", function(r, o) { + if (o !== "scrollend") + return; + const n = es(() => { + s.size ? n() : this.dispatchEvent(new Event("scrollend")); + }, 100); + r.call(this, "scroll", n, { passive: !0 }), t.set(this, n); + }), Tt(EventTarget.prototype, "removeEventListener", function(r, o) { + if (o !== "scrollend") + return; + const n = t.get(this); + n && r.call(this, "scroll", n, { passive: !0 }); + }); +} +var u = class extends T { + constructor() { + super(...arguments), this.loop = !1, this.navigation = !1, this.pagination = !1, this.autoplay = !1, this.autoplayInterval = 3e3, this.slidesPerPage = 1, this.slidesPerMove = 1, this.orientation = "horizontal", this.mouseDragging = !1, this.activeSlide = 0, this.scrolling = !1, this.dragging = !1, this.autoplayController = new le(this, () => this.next()), this.localize = new Oe(this), this.handleMouseDrag = (s) => { + this.dragging || (this.scrollContainer.style.setProperty("scroll-snap-type", "none"), this.dragging = !0), this.scrollContainer.scrollBy({ + left: -s.movementX, + top: -s.movementY, + behavior: "instant" + }); + }, this.handleMouseDragEnd = () => { + const s = this.scrollContainer; + document.removeEventListener("pointermove", this.handleMouseDrag, { capture: !0 }); + const t = s.scrollLeft, e = s.scrollTop; + s.style.removeProperty("scroll-snap-type"), s.style.setProperty("overflow", "hidden"); + const i = s.scrollLeft, r = s.scrollTop; + s.style.removeProperty("overflow"), s.style.setProperty("scroll-snap-type", "none"), s.scrollTo({ left: t, top: e, behavior: "instant" }), requestAnimationFrame(async () => { + (t !== i || e !== r) && (s.scrollTo({ + left: i, + top: r, + behavior: Et() ? "auto" : "smooth" + }), await Te(s, "scrollend")), s.style.removeProperty("scroll-snap-type"), this.dragging = !1, this.handleScrollEnd(); + }); + }, this.handleSlotChange = (s) => { + s.some( + (e) => [...e.addedNodes, ...e.removedNodes].some( + (i) => this.isCarouselItem(i) && !i.hasAttribute("data-clone") + ) + ) && this.initializeSlides(), this.requestUpdate(); + }; + } + connectedCallback() { + super.connectedCallback(), this.setAttribute("role", "region"), this.setAttribute("aria-label", this.localize.term("carousel")); + } + disconnectedCallback() { + super.disconnectedCallback(), this.mutationObserver.disconnect(); + } + firstUpdated() { + this.initializeSlides(), this.mutationObserver = new MutationObserver(this.handleSlotChange), this.mutationObserver.observe(this, { + childList: !0, + subtree: !0 + }); + } + willUpdate(s) { + (s.has("slidesPerMove") || s.has("slidesPerPage")) && (this.slidesPerMove = Math.min(this.slidesPerMove, this.slidesPerPage)); + } + getPageCount() { + const s = this.getSlides().length, { slidesPerPage: t, slidesPerMove: e, loop: i } = this, r = i ? s / e : (s - t) / e + 1; + return Math.ceil(r); + } + getCurrentPage() { + return Math.ceil(this.activeSlide / this.slidesPerMove); + } + getShadowSlideCount() { + return this.slidesPerPage - this.getSlides().length % this.slidesPerPage; + } + canScrollNext() { + return this.loop || this.getCurrentPage() < this.getPageCount() - 1; + } + canScrollPrev() { + return this.loop || this.getCurrentPage() > 0; + } + /** @internal Gets all carousel items. */ + getSlides({ excludeClones: s = !0 } = {}) { + return [...this.children].filter( + (t) => this.isCarouselItem(t) && (!s || !t.hasAttribute("data-clone")) + ); + } + handleKeyDown(s) { + if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(s.key)) { + const t = s.target, e = this.localize.dir() === "rtl", i = t.closest('[part~="pagination-item"]') !== null, r = s.key === "ArrowDown" || !e && s.key === "ArrowRight" || e && s.key === "ArrowLeft", o = s.key === "ArrowUp" || !e && s.key === "ArrowLeft" || e && s.key === "ArrowRight"; + s.preventDefault(), o && this.previous(), r && this.next(), s.key === "Home" && this.goToSlide(0), s.key === "End" && this.goToSlide(this.getSlides().length - 1), i && this.updateComplete.then(() => { + var n; + const l = (n = this.shadowRoot) == null ? void 0 : n.querySelector( + '[part~="pagination-item--active"]' + ); + l && l.focus(); + }); + } + } + handleMouseDragStart(s) { + this.mouseDragging && s.button === 0 && (s.preventDefault(), document.addEventListener("pointermove", this.handleMouseDrag, { capture: !0, passive: !0 }), document.addEventListener("pointerup", this.handleMouseDragEnd, { capture: !0, once: !0 })); + } + handleScroll() { + this.scrolling = !0; + } + /** @internal Synchronizes the slides with the IntersectionObserver API. */ + synchronizeSlides() { + const s = new IntersectionObserver( + (t) => { + s.disconnect(); + for (const i of t) { + const r = i.target; + r.toggleAttribute("inert", !i.isIntersecting), r.classList.toggle("--in-view", i.isIntersecting), r.setAttribute("aria-hidden", i.isIntersecting ? "false" : "true"); + } + const e = t.find((i) => i.isIntersecting); + if (e) + if (this.loop && e.target.hasAttribute("data-clone")) { + const i = Number(e.target.getAttribute("data-clone")); + this.goToSlide(i, "instant"); + } else { + const r = this.getSlides().indexOf(e.target); + this.activeSlide = Math.ceil(r / this.slidesPerMove) * this.slidesPerMove; + } + }, + { + root: this.scrollContainer, + threshold: 0.6 + } + ); + this.getSlides({ excludeClones: !1 }).forEach((t) => { + s.observe(t); + }); + } + handleScrollEnd() { + !this.scrolling || this.dragging || (this.synchronizeSlides(), this.scrolling = !1); + } + isCarouselItem(s) { + return s instanceof Element && s.tagName.toLowerCase() === "sl-carousel-item"; + } + initializeSlides() { + this.getSlides({ excludeClones: !1 }).forEach((s, t) => { + s.classList.remove("--in-view"), s.classList.remove("--is-active"), s.setAttribute("aria-label", this.localize.term("slideNum", t + 1)), s.hasAttribute("data-clone") && s.remove(); + }), this.updateSlidesSnap(), this.loop && this.createClones(), this.synchronizeSlides(), this.goToSlide(this.activeSlide, "auto"); + } + createClones() { + const s = this.getSlides(), t = this.slidesPerPage, e = s.slice(-t), i = s.slice(0, t); + e.reverse().forEach((r, o) => { + const n = r.cloneNode(!0); + n.setAttribute("data-clone", String(s.length - o - 1)), this.prepend(n); + }), i.forEach((r, o) => { + const n = r.cloneNode(!0); + n.setAttribute("data-clone", String(o)), this.append(n); + }); + } + handelSlideChange() { + const s = this.getSlides(); + s.forEach((t, e) => { + t.classList.toggle("--is-active", e === this.activeSlide); + }), this.hasUpdated && this.emit("sl-slide-change", { + detail: { + index: this.activeSlide, + slide: s[this.activeSlide] + } + }); + } + updateSlidesSnap() { + const s = this.getSlides(), t = this.slidesPerMove; + s.forEach((e, i) => { + (i + t) % t === 0 ? e.style.removeProperty("scroll-snap-align") : e.style.setProperty("scroll-snap-align", "none"); + }); + } + handleAutoplayChange() { + this.autoplayController.stop(), this.autoplay && this.autoplayController.start(this.autoplayInterval); + } + /** + * Move the carousel backward by `slides-per-move` slides. + * + * @param behavior - The behavior used for scrolling. + */ + previous(s = "smooth") { + this.goToSlide(this.activeSlide - this.slidesPerMove, s); + } + /** + * Move the carousel forward by `slides-per-move` slides. + * + * @param behavior - The behavior used for scrolling. + */ + next(s = "smooth") { + this.goToSlide(this.activeSlide + this.slidesPerMove, s); + } + /** + * Scrolls the carousel to the slide specified by `index`. + * + * @param index - The slide index. + * @param behavior - The behavior used for scrolling. + */ + goToSlide(s, t = "smooth") { + const { slidesPerPage: e, loop: i } = this, r = this.getSlides(), o = this.getSlides({ excludeClones: !1 }); + if (!r.length) + return; + const n = i ? (s + r.length) % r.length : pt(s, 0, r.length - 1); + this.activeSlide = n; + const l = pt(s + (i ? e : 0), 0, o.length - 1), a = o[l]; + this.scrollToSlide(a, Et() ? "auto" : t); + } + scrollToSlide(s, t = "smooth") { + const e = this.scrollContainer, i = e.getBoundingClientRect(), r = s.getBoundingClientRect(), o = r.left - i.left, n = r.top - i.top; + e.scrollTo({ + left: o + e.scrollLeft, + top: n + e.scrollTop, + behavior: t + }); + } + render() { + const { slidesPerMove: s, scrolling: t } = this, e = this.getPageCount(), i = this.getCurrentPage(), r = this.canScrollPrev(), o = this.canScrollNext(), n = this.localize.dir() === "ltr"; + return b` + + `; + } +}; +u.styles = [Jt, Pe]; +u.dependencies = { "sl-icon": m }; +c([ + f({ type: Boolean, reflect: !0 }) +], u.prototype, "loop", 2); +c([ + f({ type: Boolean, reflect: !0 }) +], u.prototype, "navigation", 2); +c([ + f({ type: Boolean, reflect: !0 }) +], u.prototype, "pagination", 2); +c([ + f({ type: Boolean, reflect: !0 }) +], u.prototype, "autoplay", 2); +c([ + f({ type: Number, attribute: "autoplay-interval" }) +], u.prototype, "autoplayInterval", 2); +c([ + f({ type: Number, attribute: "slides-per-page" }) +], u.prototype, "slidesPerPage", 2); +c([ + f({ type: Number, attribute: "slides-per-move" }) +], u.prototype, "slidesPerMove", 2); +c([ + f() +], u.prototype, "orientation", 2); +c([ + f({ type: Boolean, reflect: !0, attribute: "mouse-dragging" }) +], u.prototype, "mouseDragging", 2); +c([ + Kt(".carousel__slides") +], u.prototype, "scrollContainer", 2); +c([ + Kt(".carousel__pagination") +], u.prototype, "paginationContainer", 2); +c([ + Y() +], u.prototype, "activeSlide", 2); +c([ + Y() +], u.prototype, "scrolling", 2); +c([ + Y() +], u.prototype, "dragging", 2); +c([ + Je({ passive: !0 }) +], u.prototype, "handleScroll", 1); +c([ + P("loop", { waitUntilFirstUpdate: !0 }), + P("slidesPerPage", { waitUntilFirstUpdate: !0 }) +], u.prototype, "initializeSlides", 1); +c([ + P("activeSlide") +], u.prototype, "handelSlideChange", 1); +c([ + P("slidesPerMove") +], u.prototype, "updateSlidesSnap", 1); +c([ + P("autoplay") +], u.prototype, "handleAutoplayChange", 1); +u.define("sl-carousel"); +const z = (s) => (ie("data-v-720fb199"), s = s(), re(), s), is = { class: "wrap" }, rs = { class: "viur-shop-item-view-image-wrap" }, os = { + class: "viur-shop-item-view-carousel-thumbnails", + navigation: "", + loop: "" +}, ns = ["alt", "src"], as = { class: "viur-shop-item-view-thumbnails" }, ls = { class: "viur-shop-item-view-thumbnails-scroller" }, cs = ["alt", "src"], hs = { class: "viur-shop-item-view-info-wrap" }, ds = { class: "viur-shop-item-view-headline" }, us = /* @__PURE__ */ z(() => /* @__PURE__ */ p("h2", { class: "viur-shop-item-view-subline" }, "B 21 x H 6,5 x T 19 cm", -1)), ps = { class: "viur-shop-item-view-price" }, gs = /* @__PURE__ */ z(() => /* @__PURE__ */ p("div", { class: "viur-shop-item-view-paragraph" }, " Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ", -1)), vs = { class: "viur-shop-item-view-btn-wrap" }, fs = /* @__PURE__ */ z(() => /* @__PURE__ */ p("sl-icon", { + name: "bag-plus", + slot: "prefix" +}, null, -1)), ms = /* @__PURE__ */ z(() => /* @__PURE__ */ p("sl-button", { + size: "small", + outline: "", + class: "viur-shop-item-view-add-to-favourites-btn", + variant: "primary", + title: "Add to favourites" +}, [ + /* @__PURE__ */ p("sl-icon", { + name: "heart", + slot: "prefix" + }), + /* @__PURE__ */ It(" Auf die Wunschliste ") +], -1)), _s = /* @__PURE__ */ z(() => /* @__PURE__ */ p("br", null, null, -1)), bs = /* @__PURE__ */ z(() => /* @__PURE__ */ p("h1", { class: "viur-shop-item-view-headline" }, "Ähnliche Artikel", -1)), ys = { class: "viur-shop-item-view-item-grid" }, ws = { + __name: "ItemView", + setup(s) { + const t = oe(), e = Yt({ + item: {} + }); + function i(r) { + console.log("hier", r.dk_artikel); + let o = "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"; + return r != null && r.dk_artikel.dest.image ? ut.downloadUrlFor(r.dk_artikel.dest.image) : o; + } + return Gt(async () => { + ut.get(`/json/variante/view/${t.params.item}`).then(async (r) => { + let o = await r.json(); + e.item = o.values; + }); + }), (r, o) => (Qt(), Xt(te, null, [ + p("div", is, [ + p("div", rs, [ + p("sl-carousel", os, [ + p("sl-carousel-item", null, [ + p("img", { + alt: e.item.shop_name, + src: i(e.item) + }, null, 8, ns) + ]) + ]), + p("div", as, [ + p("div", ls, [ + p("img", { + alt: e.item.shop_name, + class: "viur-shop-item-view-thumbnails-image active", + src: i(e.item) + }, null, 8, cs) + ]) + ]) + ]), + p("div", hs, [ + p("h1", ds, dt(e.item.shop_name), 1), + us, + p("div", ps, dt(e.item.shop_price_retail) + " € ", 1), + gs, + p("div", vs, [ + p("sl-button", { + size: "small", + class: "viur-shop-item-view-add-to-cart-btn", + variant: "primary", + title: "Add to cart", + onClick: o[0] || (o[0] = ee((n) => r.cartStore.addToCart(r.item.key, r.cartStore.state.currentCart), ["stop"])) + }, [ + fs, + It(" In den Warenkorb ") + ]), + ms + ]) + ]) + ]), + _s, + bs, + p("div", ys, [ + se(ne, { + item: e.item + }, null, 8, ["item"]) + ]) + ], 64)); + } +}, Ls = /* @__PURE__ */ ae(ws, [["__scopeId", "data-v-720fb199"]]); +export { + Ls as default +}; diff --git a/source/dist/main-CZfMYx-A.mjs b/source/dist/main-CZfMYx-A.mjs new file mode 100644 index 0000000..efa2227 --- /dev/null +++ b/source/dist/main-CZfMYx-A.mjs @@ -0,0 +1,3167 @@ +var et = Object.defineProperty; +var tt = (e, n, t) => n in e ? et(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t; +var Ie = (e, n, t) => tt(e, typeof n != "symbol" ? n + "" : n, t); +import { defineComponent as D, inject as C, reactive as w, openBlock as m, createElementBlock as h, normalizeClass as pe, createElementVNode as d, renderSlot as He, pushScopeId as M, popScopeId as z, Fragment as E, createCommentVNode as _, toDisplayString as B, onMounted as R, ref as q, readonly as nt, getCurrentScope as at, onScopeDispose as st, unref as K, computed as S, watchEffect as de, renderList as U, watch as ne, withDirectives as Z, vModelText as se, getCurrentInstance as lt, resolveComponent as ae, createBlock as T, vShow as be, withModifiers as ue, createTextVNode as j, shallowRef as H, provide as oe, onBeforeMount as x, useCssVars as rt, Transition as ot, withCtx as it, createVNode as ut, Teleport as dt, resolveDynamicComponent as ct, mergeProps as ft } from "vue"; +import { defineStore as ye } from "pinia"; +import { Request as mt } from "@viur/vue-utils"; +import { ViURShopClient as gt } from "@viur/viur-shop-client"; +import { useRoute as ht, createRouter as bt, createWebHashHistory as vt } from "vue-router"; +const pt = D({ + props: { + isDragging: Boolean, + draggingLineBottom: Boolean, + draggingLineTop: Boolean + }, + components: {}, + emits: ["change", "delete", "handleDragStart", "handleDragEnd", "handleDragOver", "handleDrop"], + setup(e, n) { + const t = C("boneState"); + return { + state: w({ + isDraggable: !1 + }), + boneState: t + }; + } +}), I = (e, n) => { + const t = e.__vccOpts || e; + for (const [l, s] of n) + t[l] = s; + return t; +}, Ge = (e) => (M("data-v-141aaf9b"), e = e(), z(), e), yt = ["draggable"], $t = ["disabled"], St = /* @__PURE__ */ Ge(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "grip-vertical" +}, null, -1)), kt = [ + St +], _t = { class: "value" }, wt = ["disabled", "title"], Et = /* @__PURE__ */ Ge(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "x-lg" +}, null, -1)), At = [ + Et +]; +function It(e, n, t, l, s, o) { + return m(), h("div", { + class: pe(["value-line", { + "is-dragging": e.isDragging, + "dragging-line-bottom": e.draggingLineBottom, + "dragging-line-top": e.draggingLineTop + }]), + draggable: e.state.isDraggable, + onDragover: n[2] || (n[2] = (a) => e.$emit("handleDragOver", a)), + onDrop: n[3] || (n[3] = (a) => e.$emit("handleDrop", a)), + onDragstart: n[4] || (n[4] = (a) => e.$emit("handleDragStart", a)), + onDragend: n[5] || (n[5] = (a) => e.$emit("handleDragEnd")) + }, [ + d("sl-button", { + disabled: e.boneState.readonly, + class: "drag-button", + onMousedown: n[0] || (n[0] = (a) => e.state.isDraggable = !0) + }, kt, 40, $t), + d("div", _t, [ + He(e.$slots, "default", {}, void 0, !0) + ]), + d("sl-button", { + variant: "danger", + disabled: e.boneState.readonly, + outline: "", + title: e.$t("bone.del"), + class: "delete-btn", + onClick: n[1] || (n[1] = (a) => e.$emit("delete")) + }, At, 8, wt) + ], 42, yt); +} +const Ct = /* @__PURE__ */ I(pt, [["render", It], ["__scopeId", "data-v-141aaf9b"]]), Ot = D({ + props: { + name: String, + value: Object, + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change", "handleClick"], + setup(e, n) { + const t = C("boneState"); + return { + state: w({ + debug: !1 + }), + boneState: t + }; + } +}), jt = { class: "bone-name" }, Bt = { key: 0 }, Dt = { class: "bone" }; +function Vt(e, n, t, l, s, o) { + return m(), h(E, null, [ + d("label", jt, [ + He(e.$slots, "default", {}, void 0, !0), + _("", !0) + ]), + e.state.debug ? (m(), h("div", Bt, [ + d("div", Dt, B(e.name), 1), + d("pre", null, " " + B(e.boneState) + ` + `, 1) + ])) : _("", !0) + ], 64); +} +const Nt = /* @__PURE__ */ I(Ot, [["render", Vt], ["__scopeId", "data-v-b7149172"]]), Rt = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({}); + function s(o) { + n.emit("change", e.name, o.target.value, e.lang, e.index); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), Lt = ["disabled", "value"], Ut = ["disabled", "value"]; +function Tt(e, n, t, l, s, o) { + var a, i; + return e.boneState.bonestructure.type === "raw.json" ? (m(), h("sl-textarea", { + key: 0, + disabled: (a = e.boneState) == null ? void 0 : a.readonly, + value: JSON.stringify(e.value), + onInput: n[0] || (n[0] = (...r) => e.changeEvent && e.changeEvent(...r)) + }, null, 40, Lt)) : (m(), h("sl-textarea", { + key: 1, + disabled: (i = e.boneState) == null ? void 0 : i.readonly, + value: e.value, + onInput: n[1] || (n[1] = (...r) => e.changeEvent && e.changeEvent(...r)) + }, null, 40, Ut)); +} +const ve = /* @__PURE__ */ I(Rt, [["render", Tt], ["__scopeId", "data-v-0ebe5f0b"]]), Pt = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = w({}); + function l(s) { + n.emit("change", e.name, s.target.value, e.lang, e.index); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: t, + changeEvent: l + }; + } +}), Mt = ["value"]; +function Wt(e, n, t, l, s, o) { + return m(), h("sl-input", { + disabled: "", + value: e.value, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, Mt); +} +const Ce = /* @__PURE__ */ I(Pt, [["render", Wt], ["__scopeId", "data-v-b45a1311"]]); +function zt(e) { + return at() ? (st(e), !0) : !1; +} +function qt(e) { + return typeof e == "function" ? e() : K(e); +} +const Ft = typeof window < "u" && typeof document < "u"; +typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; +function ce(e, n, t = {}) { + const { + immediate: l = !0 + } = t, s = q(!1); + let o = null; + function a() { + o && (clearTimeout(o), o = null); + } + function i() { + s.value = !1, a(); + } + function r(...c) { + a(), s.value = !0, o = setTimeout(() => { + s.value = !1, o = null, e(...c); + }, qt(n)); + } + return l && (s.value = !0, Ft && r()), zt(i), { + isPending: nt(s), + start: r, + stop: i + }; +} +class Kt { + static objectEmpty(n) { + return Object.keys(n).length === 0 && n.constructor === Object; + } + static getDescr(n, t) { + try { + return n.values.filter((l) => l[0] === t)[0][1]; + } catch { + return "-"; + } + } + static unescape(n) { + return n || (n = ""), String(n).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/(/g, "(").replace(/)/g, ")").replace(/=/g, "=").replace(/'/g, "'").replace(/(/g, "(").replace(/)/g, ")").replace(/=/g, "="); + } + static formatString(n, t) { + function l(a) { + let i = [], r = [], c = /\$\((.*?)\)/g; + for (; r; ) { + if (r = c.exec(a), !r) { + r = !1; + continue; + } + i.push(r[1]); + } + return i; + } + let s = l(n), o = []; + Array.isArray(t) || (t = [t]); + for (let a of t) { + let i = n; + for (let r of s) { + let c = r.split("."), u = a; + for (let f of c) + u && u !== "-" && f in u && u[f] ? u = u[f] : u = "-"; + u = this.unescape(u), i = i.replace("$(" + r + ")", u); + } + o.push(i); + } + return o.join(", "); + } +} +const Ht = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + autofocus: Boolean + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: S(() => e.value) + }), s = q(null); + function o(a) { + n.emit("change", e.name, a.target.value, e.lang, e.index); + } + return de(() => { + if (e.autofocus && s.value && s.value !== null && s !== null) { + const { start: a } = ce(() => { + s.value.focus(); + }, 600); + a(); + } + }), R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + Utils: Kt, + boneState: t, + changeEvent: o, + stringBone: s + }; + } +}), Gt = ["disabled", "value", "required"]; +function Zt(e, n, t, l, s, o) { + return m(), h("sl-input", { + ref: "stringBone", + disabled: e.boneState.readonly, + value: e.Utils.unescape(e.value), + required: e.boneState.bonestructure.required, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)), + onKeyup: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, Gt); +} +const Oe = /* @__PURE__ */ I(Ht, [["render", Zt], ["__scopeId", "data-v-1ccbacc0"]]), Jt = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + autofocus: Boolean + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({}), s = q(null); + function o(a) { + n.emit("change", e.name, a.target.value, e.lang, e.index); + } + return de(() => { + if (e.autofocus && s.value && s.value !== null && s !== null) { + const { start: a } = ce(() => { + s.value.focus(); + }, 600); + a(); + } + }), R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: o, + emailBone: s + }; + } +}), Qt = ["disabled", "value"]; +function Yt(e, n, t, l, s, o) { + return m(), h("sl-input", { + ref: "emailBone", + disabled: e.boneState.readonly, + type: "email", + value: e.value, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, Qt); +} +const je = /* @__PURE__ */ I(Jt, [["render", Yt], ["__scopeId", "data-v-4328e024"]]), Xt = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: S(() => { + var a; + let o = e.value; + return t.bonestructure.time ? o = (a = e.value) == null ? void 0 : a.split("+")[0] : e.value && (o = new Date(e.value).toISOString().substr(0, 10)), o; + }), + typeString: S(() => { + let o = "datetime-local"; + return t.bonestructure.time || (o = "date"), o; + }) + }); + function s(o) { + n.emit("change", e.name, o.target.value, e.lang, e.index); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), xt = ["disabled", "type", "value"]; +function en(e, n, t, l, s, o) { + return m(), h("sl-input", { + disabled: e.boneState.readonly, + type: e.state.typeString, + value: e.state.value, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, xt); +} +const Be = /* @__PURE__ */ I(Xt, [["render", en], ["__scopeId", "data-v-f1b8af8c"]]), tn = D({ + inheritAttrs: !1, + props: { + name: String, + value: null, + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: S(() => { + let a = e.value; + return Array.isArray(e.value) ? (t.bonestructure.values instanceof Array ? a = a.filter((i) => t.bonestructure.values.map((r) => r[0].toString()).includes(i)) : a = a.filter( + (i) => Object.keys(t.bonestructure.values).map((r) => r.toString()).includes(i) + ), a.map((i) => i.toString())) : e.value ? e.value.toString() : ""; + }) + }); + function s() { + if (Array.isArray(t.bonestructure.values)) + return t.bonestructure.values; + { + let a = []; + for (const [i, r] of Object.entries(t.bonestructure.values)) + a.push([i, r]); + return a; + } + } + function o(a) { + n.emit("change", e.name, a.target.value, e.lang, e.index), W; + } + return R(() => { + n.emit("change", e.name, l.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: o, + convertObjToList: s + }; + } +}), nn = ["disabled", "value", "multiple"], an = ["value"]; +function sn(e, n, t, l, s, o) { + return m(), h("sl-select", { + disabled: e.boneState.readonly, + value: e.state.value, + hoist: "", + multiple: e.boneState.bonestructure.multiple, + "max-options-visible": "0", + clearable: "", + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, [ + (m(!0), h(E, null, U(e.convertObjToList(), (a) => (m(), h("sl-option", { + key: a[0], + value: a[0] + }, B(a[1]), 9, an))), 128)) + ], 40, nn); +} +const De = /* @__PURE__ */ I(tn, [["render", sn], ["__scopeId", "data-v-5a38b97f"]]), ln = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: S(() => ![!1, null, void 0, ""].includes(e.value)) + }); + function s(o) { + n.emit("change", e.name, o.target.checked, e.lang, e.index); + } + return R(() => { + let o = e.value; + o || (o = !1), n.emit("change", e.name, o, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), rn = ["disabled", "checked"]; +function on(e, n, t, l, s, o) { + return m(), h("sl-switch", { + disabled: e.boneState.readonly, + checked: e.state.value, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, rn); +} +const Ve = /* @__PURE__ */ I(ln, [["render", on], ["__scopeId", "data-v-363598c8"]]), un = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + autofocus: Boolean + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value1: "", + value2: null, + equal: !1, + passwordInfo: [], + requiredPasswordInfo: [] + }), s = q(null); + function o(i) { + l.value1 === l.value2 ? l.equal = !0 : l.equal = !1, a(l.value1), l.requiredPasswordInfo.length === 0 && l.passwordInfo.length - l.requiredPasswordInfo.length <= t.bonestructure.test_threshold ? n.emit("change", e.name, l.value1, e.lang, e.index, !0) : n.emit("change", e.name, l.value1, e.lang, e.index, !1); + } + R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }); + function a(i) { + l.passwordInfo = [], l.requiredPasswordInfo = []; + for (const r of t.bonestructure.tests) + new RegExp(r[0]).test(i) || (r[2] ? l.requiredPasswordInfo.push(r[1]) : l.passwordInfo.push(r[1])); + l.equal || l.requiredPasswordInfo.push("Die eingegebenen Passwörter stimmen nicht überein."), l.value1 || l.requiredPasswordInfo.push("Das eingegebene Passwort ist leer."); + } + return de(() => { + if (e.autofocus && s.value && s.value !== null && s !== null) { + const { start: i } = ce(() => { + s.value.focus(); + }, 600); + i(); + } + }), ne( + () => e.value, + (i, r) => { + l.value1 = i; + } + ), { + state: l, + boneState: t, + changeEvent: o, + passwordBone: s + }; + } +}), dn = ["disabled"], cn = ["name"], fn = ["name"], mn = { class: "errors" }; +function gn(e, n, t, l, s, o) { + return m(), h(E, null, [ + Z(d("sl-input", { + ref: "passwordBone", + "onUpdate:modelValue": n[0] || (n[0] = (a) => e.state.value1 = a), + disabled: e.boneState.readonly, + class: pe({ "has-check": !e.boneState.readonly }), + type: "password", + clearable: "", + "password-toggle": "true", + onSlChange: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)), + onSlClear: n[2] || (n[2] = (a) => e.state.value1 = ""), + onKeyup: n[3] || (n[3] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, [ + d("sl-icon", { + slot: "suffix", + name: e.state.equal && e.state.value1.length ? "check" : "x" + }, null, 8, cn) + ], 42, dn), [ + [se, e.state.value1] + ]), + e.boneState.readonly ? _("", !0) : Z((m(), h("sl-input", { + key: 0, + "onUpdate:modelValue": n[4] || (n[4] = (a) => e.state.value2 = a), + class: "password-check", + type: "password", + clearable: "", + "password-toggle": "true", + onSlChange: n[5] || (n[5] = (...a) => e.changeEvent && e.changeEvent(...a)), + onSlClear: n[6] || (n[6] = (a) => e.state.value2 = ""), + onKeyup: n[7] || (n[7] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, [ + d("sl-icon", { + slot: "suffix", + name: e.state.equal && e.state.value1.length ? "check" : "x" + }, null, 8, fn) + ], 544)), [ + [se, e.state.value2] + ]), + d("ul", mn, [ + (m(!0), h(E, null, U(e.state.passwordInfo, (a, i) => (m(), h("li", { key: i }, B(a), 1))), 128)), + (m(!0), h(E, null, U(e.state.requiredPasswordInfo, (a, i) => (m(), h("li", { + key: i, + class: "requiredInfo" + }, B(a), 1))), 128)) + ]) + ], 64); +} +const Ne = /* @__PURE__ */ I(un, [["render", gn], ["__scopeId", "data-v-0ccf18c0"]]), hn = D({ + props: { + name: String, + value: null, + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: S(() => e.value), + structure: S(() => a(t.bonestructure.using)), + globalRegistration: !1, + formGroups: S(() => { + var c, u; + let i = { default: { name: "Allgemein", bones: [], groupVisible: !1, groupOpen: !0 } }; + for (const [f, p] of Object.entries(l.structure)) { + let v = "default", k = l.structure[f], g = (c = l.value) == null ? void 0 : c[f]; + (u = p == null ? void 0 : p.params) != null && u.category && (v = p.params.category.toLowerCase()), Object.keys(i).includes(v) ? i[v].bones.push({ + boneName: f, + boneStructure: k, + boneValue: g + }) : i[v] = { + name: p.params.category, + bones: [ + { + boneName: f, + boneStructure: k, + boneValue: g + } + ] + }, k.visible === !0 && (i[v].groupVisible = !0); + } + let r = {}; + return Object.keys(i).sort().forEach(function(f) { + r[f] = i[f]; + }), r; + }) + }); + function s(i) { + n.emit("change", i); + } + R(() => { + lt().appContext.components.Bone ? l.globalRegistration = !0 : l.globalRegistration = !1, n.emit("change", e.name, e.value, e.lang, e.index); + }); + function o(i) { + console.log(i); + } + function a(i) { + if (Array.isArray(i)) { + let r = {}; + for (const c in i) + r[i[c][0]] = i[c][1]; + return r; + } else + return i; + } + return { + state: l, + boneState: t, + getBoneWidget: X, + structureToDict: a, + changeEvent: s, + updateValue: o + }; + } +}), bn = { + key: 0, + open: "", + variant: "danger" +}, vn = { + key: 1, + class: "form" +}, pn = ["summary", "open"]; +function yn(e, n, t, l, s, o) { + const a = ae("bone"); + return e.state.globalRegistration ? (m(), h("div", vn, [ + (m(!0), h(E, null, U(e.state.formGroups, (i, r) => Z((m(), h("sl-details", { + key: r, + summary: i.name, + open: i.groupOpen + }, [ + (m(!0), h(E, null, U(i.bones, (c) => Z((m(), T(a, { + key: c.name, + is: e.getBoneWidget(e.state.structure[c.boneName].type), + name: c.boneName, + structure: e.state.structure, + skel: e.state.value, + errors: e.boneState.errors, + readonly: e.boneState.bonestructure.readonly ? !0 : void 0, + onChangeInternal: e.changeEvent + }, null, 8, ["is", "name", "structure", "skel", "errors", "readonly", "onChangeInternal"])), [ + [be, e.state.structure[c.boneName].visible] + ])), 128)) + ], 8, pn)), [ + [be, i.groupVisible] + ])), 128)) + ])) : (m(), h("sl-alert", bn, " In Order to use this Bone register the bone component globally in your main file ")); +} +const Ze = /* @__PURE__ */ I(hn, [["render", yn], ["__scopeId", "data-v-e6fcfbca"]]), $n = D({ + inheritAttrs: !1, + props: { + name: String, + value: null, + index: Number, + lang: String + }, + components: { Wrapper_nested: Ze }, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: {}, + index: S(() => e.index), + lang: S(() => e.lang) + }); + function s(o) { + var i; + (i = l.value) != null && i[o.name] || (l.value ? l.value[o.name] = null : l.value = { [o.name]: null }); + let a = l.value[o.name]; + o.lang ? (a === null && (a = {}), Object.keys(a).includes(o.lang) && o.index !== null ? a[o.lang][o.index] = o.value : a[o.lang] = o.value) : o.index !== null ? (a === null && (a = []), a[o.index] = o.value) : a = o.value, l.value[o.name] = a, n.emit("change", e.name, l.value, e.lang, e.index, !0); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}); +function Sn(e, n, t, l, s, o) { + const a = ae("Wrapper_nested"); + return m(), T(a, { + value: e.value, + name: e.name, + index: e.state.index, + disabled: e.boneState.bonestructure.readonly, + onChange: e.changeEvent + }, null, 8, ["value", "name", "index", "disabled", "onChange"]); +} +const Re = /* @__PURE__ */ I($n, [["render", Sn], ["__scopeId", "data-v-84a761ce"]]), kn = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({}); + function s(o) { + n.emit("change", e.name, o.target.value, e.lang, e.index); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), _n = ["disabled", "value"]; +function wn(e, n, t, l, s, o) { + return m(), h("sl-color-picker", { + disabled: e.boneState.readonly, + value: e.value, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, _n); +} +const Le = /* @__PURE__ */ I(kn, [["render", wn], ["__scopeId", "data-v-534b9149"]]), En = D({ + inheritAttrs: !1, + emits: { change: null }, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + autofocus: Boolean + }, + components: {}, + setup(e, n) { + const t = C("boneState"), l = w({ + minAmount: S(() => t.bonestructure.minAmount), + maxAmount: S(() => t.bonestructure.maxAmount), + precision: S(() => { + if (t.bonestructure.precision > 1) + return parseFloat(`0.${"0".repeat(t.bonestructure.precision - 1)}1`); + }) + }), s = q(null); + function o(a) { + n.emit("change", e.name, a.target.value, e.lang, e.index); + } + return de(() => { + if (e.autofocus && s.value && s.value !== null && s !== null) { + const { start: a } = ce(() => { + s.value.focus(); + }, 600); + a(); + } + }), R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: o, + numericBone: s + }; + } +}), An = ["disabled", "value", "min", "max", "step"], In = { class: "info" }, Cn = { key: 0 }, On = { key: 1 }, jn = { key: 2 }; +function Bn(e, n, t, l, s, o) { + return m(), h(E, null, [ + d("sl-input", { + ref: "numericBone", + type: "number", + disabled: e.boneState.readonly, + value: e.value, + min: e.state.minAmount, + max: e.state.maxAmount, + step: e.state.precision, + onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)), + onKeyup: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)) + }, null, 40, An), + d("ul", In, [ + e.state.minAmount !== -9223372036854776e3 && e.state.minAmount ? (m(), h("li", Cn, B(e.$t("bones.numeric.min", { val: e.state.minAmount })), 1)) : _("", !0), + e.state.maxAmount !== 9223372036854776e3 && e.state.maxAmount ? (m(), h("li", On, B(e.$t("bones.numeric.max", { val: e.state.maxAmount })), 1)) : _("", !0), + e.state.precision ? (m(), h("li", jn, B(e.$t("bones.numeric.precision", { val: e.boneState.bonestructure.precision })), 1)) : _("", !0) + ]) + ], 64); +} +const Ue = /* @__PURE__ */ I(En, [["render", Bn], ["__scopeId", "data-v-03d5b399"]]); +var N = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }; +class ie extends Error { + constructor(n, t, l, s) { + super(l || t), arguments.length >= 4 && s && Object.assign(this, s), this.statusText = t, this.statusCode = n, this.response = s; + } +} +let he = null; +function Y() { + return he || (he = ye("requestStore", () => { + const e = w({ sKeys: /* @__PURE__ */ new Set() }); + function n() { + e.sKeys = /* @__PURE__ */ new Set(); + } + return { + state: e, + $reset: n + }; + })), he(); +} +class O { + static resetState() { + Y().$reset(), Y().$dispose(); + } + static buildUrl(n) { + return n && !(n.startsWith("http://") || n.startsWith("https://") || n.startsWith("//")) && (n = (N.VITE_API_URL ? N.VITE_API_URL : window.location.origin) + n), n; + } + static post(n, { dataObj: t = null, callback: l = null, failedCallback: s = null, abortController: o = null, headers: a = null, mode: i = null } = {}) { + function r() { + if (t instanceof FormData) + return t; + const u = new FormData(); + for (const f in t) + if (Array.isArray(t[f])) + for (let p of t[f]) + u.append(f, p); + else + u.append(f, t[f]); + return u; + } + let c = le.post(O.buildUrl(n), r(), null, a, o, i); + return c.then(function(u) { + l && l(u.data); + }).catch(function(u) { + s && s(u); + }), c; + } + static async getBatchSkeys(n = 30, t = N.VITE_DEFAULT_RENDERER || "json") { + await O.get(`/${t}/skey`, { + dataObj: { amount: n } + }).then(async (l) => { + let s = await l.json(); + Array.isArray(s) || (s = [s]), Y().state.sKeys = new Set(s); + }); + } + static async securePost(n, { + dataObj: t = null, + callback: l = null, + failedCallback: s = null, + abortController: o = null, + renderer: a = N.VITE_DEFAULT_RENDERER || "json", + headers: i = null, + mode: r = null, + amount: c = 30 + } = {}) { + let u = null; + Y().state.sKeys.size === 0 && await O.getBatchSkeys(c); + const f = [...Y().state.sKeys][0]; + return t instanceof FormData ? (t.append("skey", f), Y().state.sKeys.delete(f)) : (t || (t = {}), t.skey = f, Y().state.sKeys.delete(f)), u = O.post(n, { + dataObj: t, + callback: l, + abortController: o, + headers: i, + mode: r + }), u; + } + static get(n, { + dataObj: t = null, + callback: l = null, + failedCallback: s = null, + cached: o = !1, + clearCache: a = !1, + abortController: i = null, + headers: r = null, + mode: c = null, + // milli sec min Std Tage + cacheTime: u = 1e3 * 60 * 60 * 24 * 1 + } = {}) { + let f = le.get(O.buildUrl(n), t, a, r, i, c); + return f.then(function(p) { + l && l(p.data); + }).catch(function(p) { + s && s(p); + }), f; + } + static list(n, { + dataObj: t = null, + callback: l = null, + failedCallback: s = null, + group: o = null, + abortController: a = null, + renderer: i = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + let r = `/${i}/${n}/list`; + return o && (r += `/${o}`), O.get(r, { + dataObj: t, + callback: l, + failedCallback: s, + abortController: a + }); + } + static getStructure(n, { + dataObj: t = null, + callback: l = null, + failedCallback: s = null, + group: o = null, + abortController: a = null, + renderer: i = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + n = n.replace(/\//g, "."); + let r = `/${i}/getStructure/${n}`; + return o && (r += `/${o}`), O.get(r, { + dataObj: t, + callback: l, + failedCallback: s, + abortController: a + }); + } + static view(n, t, { + dataObj: l = null, + callback: s = null, + failedCallback: o = null, + group: a = null, + abortController: i = null, + renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + let c = `/${r}/${n}/view/${t}`; + return a && (c = `/${r}/${n}/view/${a}/${t}`), O.get(c, { + dataObj: l, + callback: s, + failedCallback: o, + abortController: i + }); + } + static add(n, { + dataObj: t = null, + callback: l = null, + failedCallback: s = null, + group: o = null, + abortController: a = null, + renderer: i = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + let r = `/${i}/${n}/add`; + return o && (r = `/${i}/${n}/add/${o}`), O.securePost(r, { + dataObj: t, + callback: l, + failedCallback: s, + abortController: a + }); + } + static edit(n, t, { + dataObj: l = null, + callback: s = null, + failedCallback: o = null, + group: a = null, + abortController: i = null, + renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + let c = `/${r}/${n}/edit/${t}`; + return a && (c = `/${r}/${n}/edit/${a}/${t}`), O.securePost(c, { + dataObj: l, + callback: s, + failedCallback: o, + abortController: i + }); + } + static delete(n, t, { + dataObj: l = null, + callback: s = null, + failedCallback: o = null, + group: a = null, + abortController: i = null, + renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json" + } = {}) { + let c = `/${r}/${n}/delete/${t}`; + return a && (c = `/${r}/${n}/delete/${a}/${t}`), O.securePost(c, { + dataObj: l, + callback: s, + failedCallback: o, + abortController: i, + amount: 1 + }); + } + static downloadUrlFor(n, t = !1) { + return n && "dest" in n ? t && "thumbnail" in n.dest ? O.buildUrl(n.dest.thumbnail) : "downloadUrl" in n.dest ? O.buildUrl(n.dest.downloadUrl) : O.buildUrl(null) : O.buildUrl(n); + } + static uploadFile(n, t = void 0) { + const l = { + fileName: n.name, + mimeType: n.type || "application/octet-stream", + size: n.size.toString(), + node: t + }; + return new Promise((s, o) => { + O.securePost("/vi/file/getUploadURL", { dataObj: l }).then(async (a) => { + let i = await a.json(); + fetch(i.values.uploadUrl, { + body: n, + method: "POST", + mode: "no-cors" + }).then(async (r) => { + const c = { + key: i.values.uploadKey, + skelType: "leaf" + }; + O.securePost("/vi/file/add", { dataObj: c }).then(async (u) => { + let f = await u.json(); + f.action === "addSuccess" ? s(f.values) : o(f); + }).catch((u) => { + o(u); + }); + }).catch((r) => { + o(r); + }); + }).catch((a) => { + o(a); + }); + }); + } +} +class le { + constructor() { + Ie(this, "withCredentials", !0); + } + static buildOptions(n, t = null, l = null, s = null, o = null) { + let a = { method: n }; + return a.credentials = "include", a.headers = { + Accept: "application/json, text/plain, */*" + }, l && (a.headers = { ...a.headers, ...l }), t && (a.body = t), s && (a.signal = s.signal), o && (a.mode = o), a; + } + static get(n, t = null, l = null, s = null, o = null, a = null) { + function i(r, c) { + let u = new URL(r); + if (c && Object.keys(c).length > 0) { + const f = new URLSearchParams(); + for (const [p, v] of Object.entries(c)) + if (Array.isArray(v)) + for (const k of v) + f.append(p, k); + else + f.append(p, v); + u.search = f.toString(); + } + return u.toString(); + } + return fetch(i(n, t), le.buildOptions("GET", null, s, o, a)).then(async (r) => { + if (r.ok) + return r; + { + const c = `${r.status} ${r.statusText}: ${r.headers ? r.headers.get("x-error-descr") : ""}`; + return Promise.reject(new ie(r.status, r.statusText, c, r)); + } + }).catch((r) => { + if (r instanceof TypeError) { + const u = `503 ${r.message}: ${r.headers ? r.headers.get("x-error-descr") : ""}`; + return Promise.reject(new ie(503, r.message, u, r)); + } + if (r instanceof DOMException && r.name == "AbortError") { + const u = `${r.code} ${r.name}: ${r.headers ? r.headers.get("x-error-descr") : ""}`; + return Promise.reject(new ie(r.code, r.name, u, { url: n })); + } + const c = `${r.statusCode} ${r.statusText}: ${r.headers ? r.headers.get("x-error-descr") : ""}`; + return Promise.reject(new ie(r.statusCode, r.statusText, c, r.response)); + }); + } + static post(n, t = null, l = null, s = null, o = null, a = null) { + return fetch(n, le.buildOptions("POST", t, s, o, a)); + } +} +var Dn = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }; +const Vn = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: { Wrapper_nested: Ze }, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = C("formatString"), s = w({ + format: S(() => t == null ? void 0 : t.bonestructure.format), + skellistdata: null, + selection: null + }); + function o(r) { + let c = ""; + return t.bonestructure.type === "relational.tree.leaf.file" ? c = "skelType=leaf&" : t.bonestructure.type === "relational.tree.node.file" && (c = "skelType=node&"), O.get( + `/${Dn.VITE_DEFAULT_RENDERER || "vi"}/${t.bonestructure.module}/list?${c}limit=99` + ).then(async (u) => { + var p; + const f = await u.json(); + s.skellistdata = {}; + for (let v of f.skellist) + s.skellistdata[v.key] = v; + return (p = f.skellist) == null ? void 0 : p.map((v) => ({ text: l(t.bonestructure.format, { dest: v }), value: v.key, data: v })); + }); + } + function a(r) { + s.selection = { dest: s.skellistdata[r.detail.item.value] }, n.emit("change", e.name, s.selection, e.lang, e.index); + } + function i(r) { + var u; + s.selection || (s.selection = {}), (u = s.selection.rel) != null && u[r.name] || (s.selection.rel ? s.selection.rel[r.name] = null : s.selection.rel = { [r.name]: null }); + let c = s.selection.rel[r.name]; + r.lang ? (c === null && (c = {}), Object.keys(c).includes(r.lang) && r.index !== null ? c[r.lang][r.index] = r.value : c[r.lang] = r.value) : r.index !== null ? (c === null && (c = []), c[r.index] = r.value) : c = r.value, Object.keys(s.selection).includes("rel") && s.selection.rel ? s.selection.rel[r.name] = c : s.selection.rel = { [r.name]: c }, Object.keys(s.selection).includes("dest") && n.emit("change", e.name, s.selection, e.lang, e.index); + } + return R(() => { + s.selection = e.value, n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: s, + boneState: t, + formatString: l, + changeEvent: a, + changeEventNested: i, + getList: o + }; + } +}), Nn = (e) => (M("data-v-61dd72e0"), e = e(), z(), e), Rn = { class: "record" }, Ln = { class: "single-entry" }, Un = ["value"], Tn = ["disabled", "source"], Pn = ["title"], Mn = /* @__PURE__ */ Nn(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "x-lg" +}, null, -1)), Wn = [ + Mn +]; +function zn(e, n, t, l, s, o) { + var i, r; + const a = ae("Wrapper_nested"); + return m(), h("div", Rn, [ + d("div", Ln, [ + e.state.selection ? (m(), h("sl-input", { + key: 0, + disabled: !0, + value: e.value ? e.formatString(e.state.format, e.state.selection) : "" + }, null, 8, Un)) : (m(), h("sl-combobox", { + key: 1, + disabled: e.boneState.readonly, + source: e.getList, + hoist: "", + onSlItemSelect: n[0] || (n[0] = (...c) => e.changeEvent && e.changeEvent(...c)) + }, null, 40, Tn)), + !e.boneState.multiple && !e.boneState.isEmpty ? (m(), h("sl-button", { + key: 2, + variant: "danger", + outline: "", + title: e.$t("bone.del"), + class: "delete-btn square-btn", + onClick: n[1] || (n[1] = () => { + e.$emit("change", e.name, "", e.lang, e.index), e.state.selection = null; + }) + }, Wn, 8, Pn)) : _("", !0) + ]), + (i = e.boneState) != null && i.bonestructure.using ? (m(), T(a, { + key: 0, + value: (r = e.value) == null ? void 0 : r.rel, + name: e.name, + index: e.index, + disabled: e.boneState.bonestructure.readonly, + onChange: e.changeEventNested + }, null, 8, ["value", "name", "index", "disabled", "onChange"])) : _("", !0) + ]); +} +const Te = /* @__PURE__ */ I(Vn, [["render", zn], ["__scopeId", "data-v-61dd72e0"]]), qn = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({}); + function s(o, a) { + n.emit("change", e.name, o, e.lang, e.index); + } + return R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), Fn = { class: "box" }; +function Kn(e, n, t, l, s, o) { + return m(), h("div", Fn, B(e.value), 1); +} +const Hn = /* @__PURE__ */ I(qn, [["render", Kn], ["__scopeId", "data-v-343aca69"]]); +var Pe = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }; +const Gn = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = q(), s = w({ + loading: !1, + droparea: !1, + previewopen: !1 + }); + R(() => { + n.emit("change", e.name, e.value, e.lang, e.index); + }); + function o() { + console.log(O.downloadUrlFor(e.value)), window.open(O.downloadUrlFor(e.value)); + } + function a() { + return O.downloadUrlFor(e.value, !1); + } + function i(u) { + const f = { + fileName: u.name, + mimeType: u.type || "application/octet-stream", + size: u.size.toString() + }; + return new Promise((p, v) => { + O.securePost(`/${Pe.VITE_DEFAULT_RENDERER || "vi"}/file/getUploadURL`, { dataObj: f }).then(async (k) => { + let g = await k.json(); + fetch(g.values.uploadUrl, { + body: u, + method: "POST", + mode: "no-cors" + }).then(async (b) => { + const y = { + key: g.values.uploadKey, + node: void 0, + skelType: "leaf" + }; + O.securePost(`/${Pe.VITE_DEFAULT_RENDERER || "vi"}/file/add`, { dataObj: y }).then(async ($) => { + let A = await $.json(); + A.action === "addSuccess" ? p(A.values) : v(A); + }).catch(($) => { + v($); + }); + }).catch((b) => { + v(b); + }); + }).catch((k) => { + v(k); + }); + }); + } + async function r(u) { + s.loading = !0; + for (let f of u.target.files) { + let p = await i(f); + l.value.value = null, n.emit("change", e.name, { dest: p, rel: null }, e.lang, e.index); + } + s.loading = !1; + } + async function c(u) { + s.loading = !0, s.droparea = !1; + for (let f of u.dataTransfer.files) { + let p = await i(f); + l.value.value = null, n.emit("change", e.name, { dest: p, rel: null }, e.lang, e.index); + break; + } + s.loading = !1; + } + return { + state: s, + boneState: t, + downloadFile: o, + createBackgroundImage: a, + handleUpload: r, + uploadinput: l, + handleDrop: c + }; + } +}), fe = (e) => (M("data-v-91086308"), e = e(), z(), e), Zn = { + key: 0, + class: "loader" +}, Jn = /* @__PURE__ */ fe(() => /* @__PURE__ */ d("sl-spinner", { slot: "suffix" }, null, -1)), Qn = [ + Jn +], Yn = { + key: 1, + class: "droparea" +}, Xn = ["title"], xn = /* @__PURE__ */ fe(() => /* @__PURE__ */ d("sl-icon", { name: "upload" }, null, -1)), ea = [ + xn +], ta = ["multiple"], na = ["title"], aa = /* @__PURE__ */ fe(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "download" +}, null, -1)), sa = [ + aa +], la = { class: "box" }, ra = ["src"], oa = ["label", "open"], ia = ["src"], ua = { + key: 1, + class: "preview" +}, da = { + key: 0, + name: "file-earmark" +}, ca = { key: 2 }, fa = ["title"], ma = /* @__PURE__ */ fe(() => /* @__PURE__ */ d("sl-icon", { name: "x-lg" }, null, -1)), ga = [ + ma +]; +function ha(e, n, t, l, s, o) { + var a, i, r, c, u, f, p, v, k, g; + return m(), h("div", { + class: "file-wrapper", + onDragover: n[5] || (n[5] = ue((b) => e.state.droparea = !0, ["prevent"])), + onDragleave: n[6] || (n[6] = (b) => e.state.droparea = !1), + onDrop: n[7] || (n[7] = ue((...b) => e.handleDrop && e.handleDrop(...b), ["prevent"])) + }, [ + e.state.loading ? (m(), h("div", Zn, Qn)) : _("", !0), + e.state.droparea ? (m(), h("div", Yn, " Dateien hier hinziehen ")) : _("", !0), + !e.boneState.readonly && (!e.value || e.state.loading) ? (m(), h("sl-button", { + key: 2, + title: e.$t("bone.upload"), + outline: "", + class: "upload-btn", + onClick: n[0] || (n[0] = (b) => e.uploadinput.click()) + }, ea, 8, Xn)) : _("", !0), + d("input", { + ref: "uploadinput", + hidden: "", + type: "file", + multiple: e.boneState.multiple, + onChange: n[1] || (n[1] = (...b) => e.handleUpload && e.handleUpload(...b)) + }, null, 40, ta), + e.value ? (m(), h("sl-button", { + key: 3, + title: e.$t("bone.download"), + onClick: n[2] || (n[2] = (...b) => e.downloadFile && e.downloadFile(...b)) + }, sa, 8, na)) : _("", !0), + d("div", la, [ + (i = (a = e.value) == null ? void 0 : a.dest) != null && i.mimetype.includes("image") ? (m(), h("div", { + key: 0, + class: "preview has-preview", + onClick: n[3] || (n[3] = (b) => e.state.previewopen = !e.state.previewopen) + }, [ + d("img", { + class: "preview-img", + src: e.createBackgroundImage(), + alt: "" + }, null, 8, ra), + d("sl-dialog", { + label: decodeURIComponent((c = (r = e.value) == null ? void 0 : r.dest) == null ? void 0 : c.name), + class: "preview-overlay", + open: e.state.previewopen + }, [ + d("img", { + src: e.createBackgroundImage(), + alt: "" + }, null, 8, ia) + ], 8, oa) + ])) : (m(), h("div", ua, [ + (f = (u = e.value) == null ? void 0 : u.dest) != null && f.name ? (m(), h("sl-icon", da)) : _("", !0) + ])), + (v = (p = e.value) == null ? void 0 : p.dest) != null && v.name ? (m(), h("div", ca, B(decodeURIComponent((g = (k = e.value) == null ? void 0 : k.dest) == null ? void 0 : g.name)), 1)) : _("", !0) + ]), + e.boneState.multiple ? _("", !0) : (m(), h("sl-button", { + key: 4, + variant: "danger", + outline: "", + title: e.$t("bone.del"), + class: "delete-btn", + onClick: n[4] || (n[4] = (b) => e.$emit("change", e.name, "", e.lang, e.index)) + }, ga, 8, fa)) + ], 32); +} +const Me = /* @__PURE__ */ I(Gn, [["render", ha], ["__scopeId", "data-v-91086308"]]), ba = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + value: "", + editorConfig: {}, + editor: S(() => ClassicEditor) + }); + function s(i) { + n.emit("change", e.name, l.value, e.lang, e.index); + } + function o(i) { + l.value = i.target.value, n.emit("change", e.name, l.value, e.lang, e.index); + } + R(() => { + e.value !== null && (l.value = e.value), n.emit("change", e.name, e.value, e.lang, e.index); + }); + function a(i) { + i.editing.view.change((r) => { + r.setStyle("min-height", "250px", i.editing.view.document.getRoot()); + }); + } + return ne( + () => e.value, + (i, r) => { + l.value = i; + } + ), { + state: l, + ClassicEditor, + boneState: t, + changeEvent: s, + onReady: a, + changeEventTextarea: o + }; + } +}), va = ["disabled", "value"]; +function pa(e, n, t, l, s, o) { + var i, r, c, u; + const a = ae("ckeditor"); + return e.state.editor ? (m(), h(E, { key: 0 }, [ + (i = e.boneState.bonestructure) != null && i.valid_html || (r = e.boneState.bonestructure) != null && r.validHtml ? (m(), T(a, { + key: 0, + modelValue: e.state.value, + "onUpdate:modelValue": n[0] || (n[0] = (f) => e.state.value = f), + editor: e.state.editor, + config: e.state.editorConfig, + disabled: (c = e.boneState) == null ? void 0 : c.readonly, + onReady: e.onReady, + onInput: e.changeEvent + }, null, 8, ["modelValue", "editor", "config", "disabled", "onReady", "onInput"])) : (m(), h("sl-textarea", { + key: 1, + disabled: (u = e.boneState) == null ? void 0 : u.readonly, + value: e.value, + onInput: n[1] || (n[1] = (...f) => e.changeEventTextarea && e.changeEventTextarea(...f)) + }, null, 40, va)) + ], 64)) : _("", !0); +} +const We = /* @__PURE__ */ I(ba, [["render", pa]]), ya = D({ + inheritAttrs: !1, + props: { + name: String, + value: [Object, String, Number, Boolean, Array], + index: Number, + lang: String + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + valueLat: null, + valueLng: null + }); + function s() { + n.emit("change", e.name, [l.valueLat, l.valueLng], e.lang, e.index); + } + return R(() => { + try { + l.valueLat = e.value[0], l.valueLng = e.value[1]; + } catch { + } + n.emit("change", e.name, [l.valueLat, l.valueLng], e.lang, e.index); + }), { + state: l, + boneState: t, + changeEvent: s + }; + } +}), $a = ["name", "min", "max", "disabled"], Sa = ["name", "min", "max", "disabled"]; +function ka(e, n, t, l, s, o) { + return m(), h(E, null, [ + Z(d("sl-input", { + "onUpdate:modelValue": n[0] || (n[0] = (a) => e.state.valueLat = a), + index: "lat", + type: "number", + name: e.name, + min: e.boneState.bonestructure.boundslat[0], + max: e.boneState.bonestructure.boundslat[1], + disabled: e.boneState.readonly, + "value-as-number": "", + step: "0.000001", + onSlChange: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)), + placeholder: "Lat" + }, null, 40, $a), [ + [se, e.state.valueLat] + ]), + Z(d("sl-input", { + "onUpdate:modelValue": n[2] || (n[2] = (a) => e.state.valueLng = a), + index: "lng", + type: "number", + name: e.name, + min: e.boneState.bonestructure.boundslat[0], + max: e.boneState.bonestructure.boundslat[1], + disabled: e.boneState.readonly, + "value-as-number": "", + step: "0.000001", + onSlChange: n[3] || (n[3] = (...a) => e.changeEvent && e.changeEvent(...a)), + placeholder: "Long" + }, null, 40, Sa), [ + [se, e.state.valueLng] + ]) + ], 64); +} +const ze = /* @__PURE__ */ I(ya, [["render", ka], ["__scopeId", "data-v-7bc31020"]]), _a = D({ + props: { + name: String, + value: Object, + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = w({ + counter: 0, + debounce: null + }), s = C("addMultipleEntry"), o = C("removeMultipleEntries"); + function a() { + l.counter += 1; + let r = 200; + l.counter > 1 && (r = 500), l.debounce && clearTimeout(l.debounce), l.debounce = setTimeout(() => { + for (let c = l.counter; c--; ) + s(e.lang); + l.counter = 0; + }, r); + } + function i() { + let r = 200; + l.debounce && clearTimeout(l.debounce), l.debounce = setTimeout(() => { + o(e.lang); + }, r); + } + return R(() => { + (!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang); + }), { + state: l, + boneState: t, + handleAdd: a, + handleRemove: i, + removeMultipleEntries: o + }; + } +}), Je = (e) => (M("data-v-63e75dee"), e = e(), z(), e), wa = { class: "actionbar" }, Ea = ["title"], Aa = /* @__PURE__ */ Je(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "x-lg" +}, null, -1)), Ia = [ + Aa +], Ca = ["title"], Oa = /* @__PURE__ */ Je(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "plus-lg" +}, null, -1)); +function ja(e, n, t, l, s, o) { + return m(), h("div", wa, [ + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 0, + variant: "danger", + title: e.$t("bone.del"), + outline: "", + class: "delete-btn", + onClick: n[0] || (n[0] = (a) => e.handleRemove(e.lang)) + }, Ia, 8, Ea)) : _("", !0), + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 1, + variant: "success", + title: e.$t("bone.add"), + outline: "", + class: "add-btn", + onClick: n[1] || (n[1] = (a) => e.handleAdd(e.lang)) + }, [ + Oa, + j(" " + B(e.$t("bone.add")) + " ", 1), + e.state.counter > 1 ? (m(), h(E, { key: 0 }, [ + j("(" + B(e.state.counter) + ")", 1) + ], 64)) : _("", !0) + ], 8, Ca)) : _("", !0) + ]); +} +const Ba = /* @__PURE__ */ I(_a, [["render", ja], ["__scopeId", "data-v-63e75dee"]]); +var Da = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }; +const Va = D({ + props: { + name: String, + value: Object, + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = C("addMultipleEntry"), s = C("formatString"), o = null, a = w({ + skels: {}, + hasUsing: S(() => t == null ? void 0 : t.bonestructure.using) + }); + function i(r) { + let c = ""; + return t.bonestructure.type === "relational.tree.leaf.file" ? c = "skelType=leaf&" : t.bonestructure.type === "relational.tree.node.file" && (c = "skelType=node&"), O.get( + `/${Da.VITE_DEFAULT_RENDERER || "vi"}/${t.bonestructure.module}/list?${c}limit=99` + ).then(async (u) => { + var p; + const f = await u.json(); + return a.skels = f.skellist.reduce((v, k) => (v[k.key] = k, v), {}), (p = f.skellist) == null ? void 0 : p.map((v) => ({ text: s(t.bonestructure.format, { dest: v }), value: v.key, data: v })); + }); + } + return R(() => { + (!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang); + }), { + state: a, + boneState: t, + addMultipleEntry: l, + removeMultipleEntries: o, + getList: i + }; + } +}), Qe = (e) => (M("data-v-eeea51c6"), e = e(), z(), e), Na = { class: "actionbar" }, Ra = ["title"], La = /* @__PURE__ */ Qe(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "x-lg" +}, null, -1)), Ua = [ + La +], Ta = ["source"], Pa = ["title"], Ma = /* @__PURE__ */ Qe(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "plus-lg" +}, null, -1)); +function Wa(e, n, t, l, s, o) { + return m(), h("div", Na, [ + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 0, + variant: "danger", + title: e.$t("bone.del"), + outline: "", + class: "delete-btn", + onClick: n[0] || (n[0] = (a) => e.openSelector()) + }, Ua, 8, Ra)) : _("", !0), + d("sl-combobox", { + source: e.getList, + hoist: "", + onSlItemSelect: n[1] || (n[1] = (a) => { + var i; + return e.addMultipleEntry(e.lang, { + dest: (i = e.state.skels) == null ? void 0 : i[a.detail.item.value], + rel: e.state.hasUsing ? void 0 : null + }); + }) + }, null, 40, Ta), + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 1, + variant: "success", + title: e.$t("bone.add"), + outline: "", + class: "add-btn", + onClick: n[2] || (n[2] = (a) => e.addMultipleEntry(e.lang)) + }, [ + Ma, + j(" " + B(e.$t("bone.list")), 1) + ], 8, Pa)) : _("", !0) + ]); +} +const za = /* @__PURE__ */ I(Va, [["render", Wa], ["__scopeId", "data-v-eeea51c6"]]); +var qe = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }; +const qa = D({ + props: { + name: String, + value: Object, + index: Number, + lang: String, + readonly: Boolean, + params: Object + }, + components: {}, + emits: ["change"], + setup(e, n) { + const t = C("boneState"), l = C("addMultipleEntry"); + C("formatString"); + const s = null, o = q(), a = w({ + skels: {}, + uploadinput: null, + loading: !1, + droparea: !1, + hasUsing: S(() => t == null ? void 0 : t.bonestructure.using) + }); + function i(u) { + const f = { + fileName: u.name, + mimeType: u.type || "application/octet-stream", + size: u.size.toString() + }; + return new Promise((p, v) => { + O.securePost(`/${qe.VITE_DEFAULT_RENDERER || "vi"}/file/getUploadURL`, { dataObj: f }).then(async (k) => { + let g = await k.json(); + fetch(g.values.uploadUrl, { + body: u, + method: "POST", + mode: "no-cors" + }).then(async (b) => { + const y = { + key: g.values.uploadKey, + node: void 0, + skelType: "leaf" + }; + O.securePost(`/${qe.VITE_DEFAULT_RENDERER || "vi"}/file/add`, { dataObj: y }).then(async ($) => { + let A = await $.json(); + A.action === "addSuccess" ? p(A.values) : v(A); + }).catch(($) => { + v($); + }); + }).catch((b) => { + v(b); + }); + }).catch((k) => { + v(k); + }); + }); + } + async function r(u) { + a.loading = !0; + for (let f of u.target.files) { + let p = await i(f); + o.value.value = null; + let v = null; + a.hasUsing && (v = void 0), l(e.lang, { dest: p, rel: v }); + } + a.loading = !1; + } + async function c(u) { + a.loading = !0, a.droparea = !1; + for (let f of u.dataTransfer.files) { + let p = await i(f); + o.value.value = null; + let v = null; + a.hasUsing && (v = void 0), l(e.lang, { dest: p, rel: v }); + } + a.loading = !1; + } + return R(() => { + (!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang); + }), { + state: a, + boneState: t, + addMultipleEntry: l, + removeMultipleEntries: s, + uploadFile: i, + uploadinput: o, + handleUpload: r, + handleDrop: c + }; + } +}), $e = (e) => (M("data-v-9bac9f8a"), e = e(), z(), e), Fa = ["title"], Ka = /* @__PURE__ */ $e(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "x-lg" +}, null, -1)), Ha = [ + Ka +], Ga = { + key: 1, + class: "droparea" +}, Za = ["multiple"], Ja = ["title"], Qa = /* @__PURE__ */ $e(() => /* @__PURE__ */ d("sl-icon", { + slot: "prefix", + name: "plus-lg" +}, null, -1)), Ya = [ + Qa +], Xa = ["title"], xa = /* @__PURE__ */ $e(() => /* @__PURE__ */ d("sl-icon", { name: "upload" }, null, -1)), es = { + key: 0, + slot: "suffix" +}; +function ts(e, n, t, l, s, o) { + return m(), h("div", { + class: "actionbar", + onDragover: n[4] || (n[4] = ue((a) => e.state.droparea = !0, ["prevent"])), + onDragleave: n[5] || (n[5] = (a) => e.state.droparea = !1), + onDrop: n[6] || (n[6] = ue((...a) => e.handleDrop && e.handleDrop(...a), ["prevent"])) + }, [ + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 0, + variant: "danger", + title: e.$t("bone.del"), + outline: "", + class: "delete-btn", + onClick: n[0] || (n[0] = (a) => e.openSelector()) + }, Ha, 8, Fa)) : _("", !0), + e.state.droparea ? (m(), h("div", Ga, " Dateien hier hinziehen ")) : _("", !0), + d("input", { + ref: "uploadinput", + hidden: "", + type: "file", + multiple: e.boneState.multiple, + onChange: n[1] || (n[1] = (...a) => e.handleUpload && e.handleUpload(...a)) + }, null, 40, Za), + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 2, + outline: "", + title: e.$t("bone.list"), + class: "add-btn", + onClick: n[2] || (n[2] = (a) => e.addMultipleEntry(e.lang)) + }, Ya, 8, Ja)) : _("", !0), + e.boneState.multiple && !e.readonly ? (m(), h("sl-button", { + key: 3, + variant: "success", + outline: "", + title: e.$t("bone.upload"), + class: "upload-btn", + onClick: n[3] || (n[3] = (a) => e.uploadinput.click()) + }, [ + xa, + j(" " + B(e.$t("bone.upload")) + " ", 1), + e.state.loading ? (m(), h("sl-spinner", es)) : _("", !0) + ], 8, Xa)) : _("", !0) + ], 32); +} +const ns = /* @__PURE__ */ I(qa, [["render", ts], ["__scopeId", "data-v-9bac9f8a"]]), Se = ye("boneStore", () => { + const e = w({ + additionalBones: H({}), + defaultBones: H({ + rawBone: ve, + keyBone: Ce, + stringBone: Oe, + emailBone: je, + dateBone: Be, + booleanBone: Ve, + selectBone: De, + passwordBone: Ne, + recordBone: Re, + numericBone: Ue, + colorBone: Le, + relationalBone: Te, + jsonBone: Hn, + fileBone: Me, + textBone: We, + spatialBone: ze + }), + actionbars: H({ + "relational.tree.leaf.file.file": ns, + "relational.": za + }), + multibones: H(["select", "select."]) + }); + function n(a, i) { + e.additionalBones[a] = i; + } + function t() { + let a = e.defaultBones; + for (const [i, r] of Object.entries(e.additionalBones)) + a.add(r); + return a; + } + function l(a) { + if (Object.keys(e.additionalBones).includes(a)) + return e.additionalBones[a]; + { + let i = a.split("."), r = Object.entries(e.additionalBones).filter( + (c) => c[0].startsWith(i[0] + ".") + ); + if (r.length > 0) { + r.sort((c, u) => u.length - c.length); + for (let c of r) + if (a.startsWith(c[0])) + return e.additionalBones[c[0]]; + } + } + return a === "date" ? Be : a === "key" ? Ce : a === "str.email" ? je : a === "str" || a.startsWith("str.") ? Oe : a === "select" || a.startsWith("select.") ? De : a === "bool" ? Ve : a === "password" ? Ne : a === "record" ? Re : a === "numeric" || a.startsWith("numeric.") ? Ue : a === "relational.tree.leaf.file.file" ? Me : a === "relational" || a.startsWith("relational.") ? Te : a === "color" ? Le : a === "text" ? We : a === "spatial" ? ze : ve; + } + function s(a, i) { + e.actionbars[a] = i; + } + function o(a) { + if (Object.keys(e.actionbars).includes(a)) + return e.actionbars[a]; + { + let i = a.split("."), r = Object.entries(e.actionbars).filter( + (c) => c[0].startsWith(i[0] + ".") + ); + if (r.length > 0) { + r.sort((c, u) => u.length - c.length); + for (let c of r) + if (a.startsWith(c[0])) + return e.actionbars[c[0]]; + } + } + return Ba; + } + return { + state: e, + addBoneWidget: n, + getBoneWidget: l, + importWidgets: t, + addBoneActionbar: s, + getBoneActionbar: o + }; +}); +function as(e) { + return Se().getBoneActionbar(e); +} +function X(e) { + return Se().getBoneWidget(e); +} +function ss(e) { + const n = Se(); + if (n.state.multibones.includes(e)) + return !0; + { + let t = e.split("."), l = Object.entries(n.state.multibones).filter( + (s) => s[1].startsWith(t[0] + ".") + ); + if (l.length > 0) { + l.sort((s, o) => o.length - s.length); + for (let s of l) + if (e.startsWith(s[1])) + return !0; + } + } + return !1; +} +D({ + inheritAttrs: !1, + emits: ["change", "change-internal", "handleClick"], + components: { + wrapperMultiple: Ct, + BoneLabel: Nt + }, + props: { + is: { + type: Object, + default: ve + }, + name: { + type: String, + required: !0 + }, + languages: Array, + multiple: Boolean, + readonly: Boolean, + required: Boolean, + params: Object, + value: [Object, String, Number, Boolean, Array], + structure: { + type: Object, + required: !0 + }, + skel: { + type: null, + required: !0 + }, + errors: Object, + showLabelInfo: { type: Boolean, required: !1, default: !1 }, + autofocus: { type: Boolean, required: !1, default: !1 } + }, + setup(e, n) { + const t = w({ + bonestructure: S(() => { + var g; + return (g = e.structure) == null ? void 0 : g[e.name]; + }), + bonevalue: null, + dragStartIndex: { + lang: null, + index: Number + }, + dropIndex: { + lang: null, + index: Number + }, + draggingLineBottom: { + lang: String, + index: Number + }, + draggingLineTop: { + lang: String, + index: Number + }, + isDragging: { + lang: String, + index: Number + }, + multilanguage: S(() => { + var g; + return ((g = t.languages) == null ? void 0 : g.length) && t.languages.length > 0; + }), + languages: S(() => e.languages ? e.languages : t.bonestructure && Object.keys(t.bonestructure).includes("languages") ? t.bonestructure.languages : []), + readonly: S(() => e.readonly ? e.readonly : t.bonestructure && Object.keys(t.bonestructure).includes("readonly") ? t.bonestructure.readonly : !1), + required: S(() => e.required ? e.required : t.bonestructure && Object.keys(t.bonestructure).includes("required") ? t.bonestructure.required : !1), + hasTooltip: S(() => !!(t.bonestructure && Object.keys(t.bonestructure.params).includes("tooltip"))), + multiple: S(() => e.multiple ? e.multiple : t.bonestructure && Object.keys(t.bonestructure).includes("multiple") ? t.bonestructure.multiple : !1), + params: S(() => e.params ? e.params : t.bonestructure && Object.keys(t.bonestructure).includes("params") ? t.bonestructure.params : {}), + actionbar: S(() => { + var g; + return as((g = t.bonestructure) == null ? void 0 : g.type); + }), + isEmpty: S(() => { + function g(b) { + for (const [y, $] of Object.entries(b)) + if ($ !== null) { + if (Array.isArray($) && $.length > 0) + return !1; + if (!Array.isArray($)) + return !1; + } + return !0; + } + return t.readonly ? !1 : !t.bonevalue || Array.isArray(t.bonevalue) && t.bonevalue.length === 0 ? !0 : t.bonevalue === Object(t.bonevalue) && !Array.isArray(t.bonevalue) ? g(t.bonevalue) : !1; + }), + errors: [], + errorMessages: S(() => { + let g = []; + for (let b of e.errors) + b.fieldPath[0] === e.name && (b.severity > 2 || t.required && (b.severity === 2 || b.severity === 0)) && g.push(b.errorMessage); + return g; + }) + }); + oe("boneState", t); + function l(g, b, y) { + a(b, g, "isDragging"), a(b, g, "dragStartIndex"); + } + function s(g, b, y) { + y.preventDefault(); + const $ = y.clientY - y.target.getBoundingClientRect().top, A = y.target.closest(".value-line"); + $ < A.offsetHeight / 2 ? (a(b, g, "draggingLineTop"), i("draggingLineBottom"), t.dropIndex.index = g) : (a(b, g, "draggingLineBottom"), i("draggingLineTop"), t.dropIndex.index = g + 1); + let L = b ? t.bonevalue[b] : t.bonevalue; + t.dropIndex.index > L.length - 1 && (t.dropIndex.index -= 1); + } + function o(g, b, y) { + let $ = null; + t.dragStartIndex.index !== t.dropIndex.index && (b ? ($ = t.bonevalue[b].splice(t.dragStartIndex.index, 1)[0], t.bonevalue[b].splice(t.dropIndex.index, 0, $)) : ($ = t.bonevalue.splice(t.dragStartIndex.index, 1)[0], t.bonevalue.splice(t.dropIndex.index, 0, $)), console.dir(t.bonevalue[0]), n.emit("change", { + name: e.name, + value: c(), + lang: b, + index: g + })), i("draggingLineBottom", "draggingLineTop", "isDragging", "dragStartIndex", "dropIndex"); + } + function a(g, b, y) { + t[y].lang = g || null, t[y].index = b; + } + function i(...g) { + g.forEach((b) => { + t[b] = { + lang: null, + index: Number + }; + }); + } + function r(g, b, y = null, $ = null, A) { + if (b === void 0 || (y ? (t.bonevalue || (t.bonevalue = {}), Object.keys(t.bonevalue).includes(y) && $ !== null ? t.bonevalue[y][$] = b : t.bonevalue[y] = b) : $ !== null ? t.bonevalue[$] = b : A === !1 || (t.bonevalue = b), t.readonly)) return !1; + let L = { + name: g, + value: c(), + lang: y, + index: $ + }, V = { + name: g, + value: b, + lang: y, + index: $ + }; + A != null && (L.pwMatch = A, V.pwMatch = A), n.emit("change", L), n.emit("change-internal", V); + } + function c() { + function g(y, $ = null) { + let A = []; + if (Array.isArray(y)) + if (t.bonestructure.type == "spatial" && y.length === 2 && !Array.isArray(y[0])) + A.push({ [$ + ".lat"]: y[0] }), A.push({ [$ + ".lng"]: y[1] }); + else if (Object.values(y).filter((L) => L === Object(L)).length > 0) + for (const [L, V] of y.entries()) + V.rel !== null ? A.push(g(V, $ + "." + L)) : A.push(g(V, $)); + else + for (const [L, V] of y.entries()) + A.push(g(V, $)); + else if (y === Object(y)) + for (const [L, V] of Object.entries(y)) + $ ? $.endsWith(".dest") || $.endsWith(".rel") ? $.endsWith(".dest") && L === "key" ? (/\.[0-9]*\.dest$/.test($) ? A.push(g(V, $.replace(/\.[0-9]*\.dest/, ""))) : A.push(g(V, $.replace(/\.dest/, ""))), A.push(g(V, $.replace(/\.dest/, "") + "." + L))) : $.endsWith(".rel") && A.push(g(V, $.replace(/\.rel/, "") + "." + L)) : A.push(g(V, $ + "." + L)) : A.push(g(V, L)); + else + y == null && (y = ""), $ !== null && A.push({ [$]: y }); + return A; + } + let b = g(t.bonevalue, e.name); + return b = b.flat(10), b; + } + function u(g = null, b = "") { + g ? Object.keys(t.bonevalue).includes(g) ? t.bonevalue[g].push(b) : t.bonevalue[g] = [b] : t.bonevalue ? t.bonevalue.push(b) : t.bonevalue = [b]; + } + oe("addMultipleEntry", u); + function f(g, b = null) { + var y; + b ? (y = t.bonevalue) == null || y[b].splice(g, 1) : t.bonevalue.splice(g, 1), n.emit("change", { + name: e.name, + value: c(), + lang: b, + index: g + }), n.emit("change-internal", { + name: e.name, + value: c(), + lang: b, + index: g + }); + } + function p(g = null) { + var b; + g ? (b = t.bonevalue) == null || b[g].splice(0) : t.bonevalue.splice(0), n.emit("change", { + name: e.name, + value: c(), + lang: g + }), n.emit("change-internal", { + name: e.name, + value: c(), + lang: g + }); + } + oe("removeMultipleEntries", p); + function v(g = null, b = "") { + u(g, b); + } + function k(g, b) { + function y(V) { + let G = [], F = [], te = /\$\((.*?)\)/g; + for (; F; ) { + if (F = te.exec(V), !F) { + F = !1; + continue; + } + G.push(F[1]); + } + return G; + } + function $(V, G) { + let F = V.split("."), te = V.split("."), P = G; + for (let Q of F) + if (te.shift(), P && P !== "-" && Object.keys(P).includes(Q) && P[Q]) + if (Array.isArray(P[Q])) { + let Ae = []; + for (let xe of P[Q]) + Ae.push($(te.join("."), xe)); + P = Ae.join(", "); + } else + P = P[Q]; + else (!P || typeof P[Q] == "object" && !P[Q]) && (P = "-"); + return P; + } + let A = y(g), L = []; + Array.isArray(b) || (b = [b]); + for (let V of b) { + let G = g; + for (let F of A) { + let te = $(F, V); + G = G.replace("$(" + F + ")", te); + } + L.push(G); + } + return L.join(", "); + } + return oe("formatString", k), x(() => { + var g; + e.value ? t.bonevalue = e.value : t.bonevalue = (g = e.skel) == null ? void 0 : g[e.name]; + }), ne( + () => e.skel, + (g, b) => { + var y; + t.bonevalue = (y = e.skel) == null ? void 0 : y[e.name]; + } + ), ne( + () => { + var g; + return (g = e.errors) == null ? void 0 : g[e.name]; + }, + (g, b) => { + t.errors = e.errors; + } + ), { + state: t, + updateValue: r, + addMultipleEntry: u, + removeMultipleEntry: f, + removeMultipleEntries: p, + BoneHasMultipleHandling: ss, + multipleBonePressEnter: v, + handleDragStart: l, + handleDragOver: s, + handleDrop: o, + setStateProperties: a, + resetStateProperties: i + }; + } +}); +const ke = { + props: { + size: { + type: String, + default: "2" + }, + active: { + type: Boolean, + default: !0 + }, + logo: { + default: "logo-cube.svg", + type: String + }, + color: { + default: "var(--sl-color-primary-500)", + type: String + } + }, + setup(e, n) { + const t = w({ + trackWidth: S(() => `${e.size / 30}rem`), + outerSize: S(() => `calc(${e.size}rem + ${t.trackWidth})`), + spinnerSize: S(() => `${e.size}rem`), + logoSize: S(() => `calc(${e.size}rem - ${t.trackWidth} * 10)`), + shadow: S(() => `0px 0px ${e.size / 6}rem 0 color-mix(in hsl, var(--sl-color-neutral-1000), 80% transparent)`) + }); + return { state: t }; + } +}, Fe = () => { + rt((e) => ({ + "93747d92": e.state.outerSize, + "284424e5": e.state.shadow, + "6485ca5e": e.state.logoSize, + "5d833915": e.state.spinnerSize, + d5b3feca: e.color, + "2050b700": e.state.trackWidth + })); +}, Ke = ke.setup; +ke.setup = Ke ? (e, n) => (Fe(), Ke(e, n)) : Fe; +const ls = (e) => (M("data-v-46c45785"), e = e(), z(), e), rs = { + key: 0, + class: "loading" +}, os = /* @__PURE__ */ ls(() => /* @__PURE__ */ d("sl-spinner", { class: "loader" }, null, -1)), is = { class: "logo" }, us = ["src"]; +function ds(e, n, t, l, s, o) { + return m(), T(ot, null, { + default: it(() => [ + t.active ? (m(), h("div", rs, [ + os, + d("div", is, [ + d("sl-icon", { src: t.logo }, null, 8, us) + ]) + ])) : _("", !0) + ]), + _: 1 + }); +} +const cs = /* @__PURE__ */ I(ke, [["render", ds], ["__scopeId", "data-v-46c45785"]]), re = ye("cartstore", () => { + const e = new gt({ + host_url: window.location.origin === "http://localhost:8081" ? "http://localhost:8080" : window.location.origin + }), n = w({ + basketRootNode: {}, + whishlistRootNodes: [], + children: {}, + structure: { address: {}, cart: {} } + }); + async function t() { + await s(); + } + async function l(u) { + return await e.cart_list({ cart_key: u }); + } + async function s() { + (await e.cart_list()).forEach((f) => { + f.is_root_node && (f.cart_type === "basket" ? n.basketRootNode = f : n.whishlistRootNodes.push(f)); + }); + } + async function o(u, f) { + let p = await e.article_add({ + article_key: u, + parent_cart_key: f + }); + console.log("addToCart", p); + } + async function a(u, f) { + let p = await e.article_view({ + article_key: u, + parent_cart_key: f + }); + console.log("getArticleView", p); + } + async function i(u, f) { + let p = await e.article_remove({ + article_key: u, + parent_cart_key: f + }); + console.log("remove Resp", p); + } + async function r(u, f, p) { + let v = await e.article_update({ + article_key: u, + parent_cart_key: f, + quantity: p, + quantity_mode: "replace" + }); + console.log("update Resp", v); + } + async function c() { + let u = await e.address_structure(); + n.structure.address = u.addSkel, console.log("adress add", n.structure.address); + } + return { + state: n, + addToCart: o, + getArticleView: a, + removeItem: i, + updateItem: r, + init: t, + getAdressStructure: c, + getChildren: l + }; +}), fs = { + __name: "CartNode", + props: { + node: { type: Object, required: !0 } + }, + setup(e) { + return w({}), (n, t) => (m(), h("pre", null, B(e.node.name), 1)); + } +}, me = (e) => (M("data-v-8a06be60"), e = e(), z(), e), ms = { + horizontal: "", + class: "viur-shop-cart-leaf" +}, gs = ["src"], hs = { class: "viur-shop-cart-leaf-headline headline" }, bs = { class: "viur-shop-cart-leaf-artno" }, vs = ["innerHTML"], ps = { class: "viur-shop-cart-leaf-actions" }, ys = /* @__PURE__ */ me(() => /* @__PURE__ */ d("sl-button", { + size: "small", + outline: "", + class: "viur-shop-cart-leaf-add-to-favourites-btn", + variant: "primary", + title: "Add to favourites" +}, [ + /* @__PURE__ */ d("sl-icon", { + name: "heart", + slot: "prefix" + }) +], -1)), $s = /* @__PURE__ */ me(() => /* @__PURE__ */ d("sl-icon", { + name: "trash", + slot: "prefix" +}, null, -1)), Ss = [ + $s +], ks = { class: "viur-shop-cart-leaf-quantity" }, _s = { class: "viur-shop-cart-leaf-unitprice" }, ws = /* @__PURE__ */ me(() => /* @__PURE__ */ d("div", { class: "viur-shop-cart-leaf-label" }, "Stückpreis", -1)), Es = ["value"], As = { class: "viur-shop-cart-leaf-price" }, Is = /* @__PURE__ */ me(() => /* @__PURE__ */ d("div", { class: "viur-shop-cart-leaf-label" }, "Gesamtpreis", -1)), Cs = ["value"], Os = { + __name: "CartLeaf", + props: { + leaf: { type: Object, required: !0 }, + node: { type: Object, required: !0 } + }, + emits: ["updateItem", "removeItem"], + setup(e, { emit: n }) { + const t = e, l = n, s = w({ + leaf: {} + }); + function o(r) { + return r !== void 0 ? mt.downloadUrlFor(r) : "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"; + } + function a(r, c, u, f) { + l("updateItem", { + item: r, + articleKey: c, + node: u, + quantity: f + }); + } + function i(r, c, u) { + l("removeItem", { item: r, articleKey: c, node: u }); + } + return x(() => { + s.leaf = t.leaf; + }), (r, c) => (m(), h("sl-card", ms, [ + d("img", { + class: "viur-shop-cart-leaf-image", + slot: "image", + src: o(s.leaf.shop_image ? s.leaf.shop_image : void 0) + }, null, 8, gs), + d("h4", hs, B(s.leaf.shop_name), 1), + d("h5", bs, B(s.leaf.shop_art_no_or_gtin), 1), + d("div", { + class: "viur-shop-cart-leaf-description", + innerHTML: s.leaf.shop_description + }, null, 8, vs), + d("div", ps, [ + ys, + d("sl-button", { + size: "small", + outline: "", + class: "viur-shop-cart-leaf-delete-btn", + variant: "primary", + title: "Remove from cart", + onClick: c[0] || (c[0] = (u) => i(s.leaf, s.leaf.article.dest.key, e.node)) + }, Ss) + ]), + d("div", ks, [ + Z(d("sl-input", { + class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--quantity", + type: "number", + label: "Anzahl", + placeholder: "Number", + min: "0", + "onUpdate:modelValue": c[1] || (c[1] = (u) => s.leaf.quantity = u), + onInput: c[2] || (c[2] = (u) => a( + s.leaf, + s.leaf.article.dest.key, + e.node, + s.leaf.quantity + )) + }, null, 544), [ + [se, s.leaf.quantity] + ]) + ]), + d("div", _s, [ + ws, + d("sl-format-number", { + class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice", + lang: "de", + type: "currency", + currency: "EUR", + value: e.leaf.price.retail + }, null, 8, Es) + ]), + d("div", As, [ + Is, + d("sl-format-number", { + class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--price", + lang: "de", + type: "currency", + currency: "EUR", + value: e.leaf.price.retail * e.leaf.quantity + }, null, 8, Cs) + ]) + ])); + } +}, js = /* @__PURE__ */ I(Os, [["__scopeId", "data-v-8a06be60"]]), Ye = (e) => (M("data-v-c292acd9"), e = e(), z(), e), Bs = { key: 0 }, Ds = /* @__PURE__ */ Ye(() => /* @__PURE__ */ d("p", null, "Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?", -1)), Vs = { + class: "footer-wrap", + slot: "footer" +}, Ns = { class: "viur-shop-cart-node" }, Rs = /* @__PURE__ */ Ye(() => /* @__PURE__ */ d("div", { class: "viur-shop-cart-mobile-footer" }, [ + /* @__PURE__ */ d("sl-button", { + variant: "primary", + size: "medium" + }, " Jetzt Bestellen ") +], -1)), Ls = { + __name: "CartView", + props: { + mode: { type: String, default: "basket" }, + cartKey: { type: String, required: !0 }, + sidebar: { type: Boolean, default: !0 } + }, + setup(e) { + const n = e, t = re(), l = q(null), s = w({ + itemsIsInit: S(() => !0), + images: {}, + currentItem: {}, + currentNode: {}, + nodes: [], + leaves: {} + }); + S(() => n.mode === "basket" ? t.state.basketRootNode.key : n.cartKey); + async function o() { + await t.updateItem( + s.currentItem.article.dest.key, + s.currentNode.key, + 0 + ), await c(), l.value.hide(); + } + async function a(f) { + console.log("updateItem :", f), f.quantity === 0 ? (l.value.show(), s.currentItem = f.item, s.currentNode = f.node) : (await t.updateItem(f.articleKey, f.node.key, f.quantity), await t.init()); + } + function i(f) { + console.log("removeItem :", f), l.value.show(), s.currentItem = f.item, s.currentNode = f.node; + } + async function r() { + s.leaves[s.currentNode.key].forEach((f) => { + f.key === s.currentItem.key && (f.quantity = 1); + }), s.currentItem = {}, s.currentNode = {}; + } + async function c() { + s.nodes = [], s.leaves = {}, await t.init(), await u(); + } + async function u(f = n.cartKey) { + console.log("debug getChildren parentKey from comp: ", f); + const p = await t.getChildren(f); + console.log("getChildren children: ", p), p.forEach(async (v) => { + v.skel_type === "node" ? (s.nodes.push(v), await u(v.key)) : (Object.keys(s.leaves).includes(f) || (s.leaves[f] = []), s.leaves[f].push(v)); + }); + } + return x(async () => { + await t.init(), await u(), n.mode === "basket" && s.nodes.push(t.state.basketRootNode), console.log("state.nodes test", s.nodes), console.log("state.leaves", s.leaves); + }), (f, p) => e.cartKey.length ? (m(), h(E, { key: 1 }, [ + d("sl-dialog", { + ref_key: "confirm", + ref: l, + onSlHide: r + }, [ + Ds, + d("div", Vs, [ + d("sl-button", { + variant: "danger", + onClick: p[0] || (p[0] = (v) => l.value.hide()), + size: "medium" + }, " Abbrechen "), + d("sl-button", { + variant: "success", + onClick: o, + size: "medium" + }, " Aus Warenkorb entfernen ") + ]) + ], 544), + (m(!0), h(E, null, U(s.nodes, (v) => (m(), h("div", Ns, [ + Object.keys(s.leaves).includes(v.key) ? (m(), h(E, { key: 0 }, [ + ut(fs, { node: v }, null, 8, ["node"]), + (m(!0), h(E, null, U(s.leaves[v.key], (k) => (m(), T(js, { + key: k.key, + leaf: k, + node: v, + onRemoveItem: i, + onUpdateItem: a + }, null, 8, ["leaf", "node"]))), 128)) + ], 64)) : _("", !0) + ]))), 256)), + Rs + ], 64)) : (m(), h("sl-spinner", Bs)); + } +}, _e = /* @__PURE__ */ I(Ls, [["__scopeId", "data-v-c292acd9"]]), Us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: _e +}, Symbol.toStringTag, { value: "Module" })), J = (e) => (M("data-v-b7b745be"), e = e(), z(), e), Ts = { + key: 1, + class: "list" +}, Ps = /* @__PURE__ */ J(() => /* @__PURE__ */ d("h2", { class: "viur-shop-cart-headline headline" }, "Bestellung prüfen", -1)), Ms = /* @__PURE__ */ J(() => /* @__PURE__ */ d("br", null, null, -1)), Ws = /* @__PURE__ */ J(() => /* @__PURE__ */ d("div", { class: "viur-shop-cart-address-wrap" }, [ + /* @__PURE__ */ d("div", { class: "viur-shop-cart-address" }, [ + /* @__PURE__ */ d("div", { class: "viur-shop-cart-address-headline" }, [ + /* @__PURE__ */ j(" Versandadresse "), + /* @__PURE__ */ d("sl-button", { + outline: "", + size: "small" + }, [ + /* @__PURE__ */ d("sl-icon", { + name: "pencil", + slot: "prefix" + }) + ]) + ]), + /* @__PURE__ */ j(" Roland Brose"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" Speicherstraße 33"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" 44147 Dortmund, DE"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" rb@mausbrand.de"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" 0231 21 34 68 90 ") + ]), + /* @__PURE__ */ d("div", { class: "viur-shop-cart-address" }, [ + /* @__PURE__ */ d("div", { class: "viur-shop-cart-address-headline" }, [ + /* @__PURE__ */ j(" Rechnungsadresse "), + /* @__PURE__ */ d("sl-button", { + outline: "", + size: "small" + }, [ + /* @__PURE__ */ d("sl-icon", { + name: "pencil", + slot: "prefix" + }) + ]) + ]), + /* @__PURE__ */ j(" Roland Brose"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" Speicherstraße 33"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" 44147 Dortmund, DE"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" rb@mausbrand.de"), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" 0231 21 34 68 90 ") + ]) +], -1)), zs = /* @__PURE__ */ J(() => /* @__PURE__ */ d("div", { class: "viur-shop-cart-payment" }, [ + /* @__PURE__ */ d("div", { class: "viur-shop-cart-payment-method" }, [ + /* @__PURE__ */ d("span", null, "Zahlungsmethode:"), + /* @__PURE__ */ j(" Paypal ") + ]), + /* @__PURE__ */ d("sl-button", { + outline: "", + size: "small" + }, [ + /* @__PURE__ */ d("sl-icon", { + name: "pencil", + slot: "prefix" + }) + ]) +], -1)), qs = /* @__PURE__ */ J(() => /* @__PURE__ */ d("h2", { class: "viur-shop-cart-headline headline" }, "Warenkorb", -1)), Fs = /* @__PURE__ */ J(() => /* @__PURE__ */ d("br", null, null, -1)), Ks = /* @__PURE__ */ J(() => /* @__PURE__ */ d("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Jetzt Bestellen", -1)), Hs = /* @__PURE__ */ J(() => /* @__PURE__ */ d("br", null, null, -1)), Gs = { class: "viur-shop-cart-sidebar-btn-wrap" }, Zs = ["variant", "disabled"], Js = { + __name: "ConfirmView", + setup(e) { + const n = re(), t = w({ + cartIsInit: S(() => !0), + itemsIsInit: S(() => { + var s; + return !!((s = n.state) != null && s.carts[n.state.basket].items); + }), + images: {}, + showOrderButton: !1 + }); + function l(s) { + s.target.checked && (t.showOrderButton = !0), s.target.checked || (t.showOrderButton = !1); + } + return x(async () => { + await n.init(); + }), (s, o) => t.cartIsInit ? (m(), h("div", Ts, [ + Ps, + Ms, + Ws, + zs, + qs, + Fs, + (m(), T(dt, { to: "#order_sidebar" }, [ + Ks, + Hs, + d("sl-checkbox", { onSlChange: l }, " Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ", 32), + d("div", Gs, [ + d("sl-button", { + variant: t.showOrderButton ? "info" : "disabled", + size: "small", + disabled: !t.showOrderButton + }, " Zahlungspflichtig bestellen ", 8, Zs) + ]) + ])) + ])) : (m(), T(cs, { key: 0 })); + } +}, we = /* @__PURE__ */ I(Js, [["__scopeId", "data-v-b7b745be"]]), Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: we +}, Symbol.toStringTag, { value: "Module" })), Ys = (e) => (M("data-v-0e63188d"), e = e(), z(), e), Xs = { class: "bind viur-shop-wrap" }, xs = ["panel", "disabled"], el = { class: "viur-shop-order-step" }, tl = ["name", "library"], nl = { class: "viur-shop-order-status-text" }, al = { + key: 0, + name: "chevron-right", + class: "viur-shop-order-tab-check" +}, sl = ["name"], ll = ["onClick"], rl = ["onClick"], ol = /* @__PURE__ */ Ys(() => /* @__PURE__ */ d("div", { class: "viur-shop-sidebar-wrap" }, [ + /* @__PURE__ */ d("div", { + class: "viur-shop-sidebar", + id: "order_sidebar" + }) +], -1)), il = { + __name: "OrderView", + props: { + tabs: { + type: Object, + required: !0 + } + }, + emits: ["tabChange"], + setup(e, { emit: n }) { + const t = e, l = n, s = w({ + tabNames: S(() => a(t.tabs)), + isFirstTab: (u) => u === 0 + }), o = q(null); + function a(u) { + let f = [], p = []; + for (const v in u) + u[v].position ? f.push([v, u[v].position]) : f.push([v, 0]); + return f.sort((v, k) => v[1] - k[1]), f.forEach((v) => { + p.push(v[0]); + }), p; + } + function i(u) { + l("tabChange", u); + } + function r(u) { + o.value.show(u); + } + function c(u) { + o.value.show(u); + } + return (u, f) => (m(), h("div", Xs, [ + d("sl-tab-group", { + class: "viur-shop-order-tabgroup", + noScrollControls: "", + onSlTabShow: i, + ref_key: "tabGroup", + ref: o + }, [ + (m(!0), h(E, null, U(s.tabNames, (p, v) => (m(), h("sl-tab", { + class: "viur-shop-order-tab", + slot: "nav", + panel: p, + key: p, + disabled: e.tabs[p].disabled + }, [ + d("div", el, [ + d("sl-icon", { + class: "viur-shop-order-step-icon", + name: e.tabs[p].icon.name, + library: e.tabs[p].icon.library + }, null, 8, tl), + d("div", nl, B(v + 1) + ". " + B(e.tabs[p].displayName), 1) + ]), + v < s.tabNames.length - 1 ? (m(), h("sl-icon", al)) : _("", !0) + ], 8, xs))), 128)), + (m(!0), h(E, null, U(s.tabNames, (p, v) => (m(), h("sl-tab-panel", { + class: "viur-shop-order-tab-panel", + name: p, + key: p + }, [ + (m(), T(ct(e.tabs[p].component), ft({ ref_for: !0 }, e.tabs[p].props ? e.tabs[p].props : ""), null, 16)), + v !== s.tabNames.length - 1 ? (m(), h("div", { + key: 0, + class: pe(["viur-shop-form-footer", { "flex-end": s.isFirstTab(v) }]) + }, [ + Z(d("sl-button", { + type: "submit", + onClick: (k) => r(s.tabNames[v - 1]) + }, " Zurück ", 8, ll), [ + [be, v !== 0] + ]), + d("sl-button", { + type: "submit", + variant: "primary", + onClick: (k) => c(s.tabNames[v + 1]) + }, " Weiter ", 8, rl) + ], 2)) : _("", !0) + ], 8, sl))), 128)) + ], 544), + ol + ])); + } +}, ul = /* @__PURE__ */ I(il, [["__scopeId", "data-v-0e63188d"]]), dl = {}, ge = (e) => (M("data-v-36ccc280"), e = e(), z(), e), cl = { class: "bind" }, fl = /* @__PURE__ */ ge(() => /* @__PURE__ */ d("h1", { class: "headline" }, "Vielen Dank für Ihre Bestellung", -1)), ml = /* @__PURE__ */ ge(() => /* @__PURE__ */ d("br", null, null, -1)), gl = /* @__PURE__ */ ge(() => /* @__PURE__ */ d("p", { class: "paragraph" }, [ + /* @__PURE__ */ d("strong", null, "Ihre Bestellnummer:"), + /* @__PURE__ */ j(" 123345670 ") +], -1)), hl = /* @__PURE__ */ ge(() => /* @__PURE__ */ d("p", { class: "paragraph" }, [ + /* @__PURE__ */ j(" Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten."), + /* @__PURE__ */ d("br"), + /* @__PURE__ */ j(" Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail. "), + /* @__PURE__ */ d("div", { class: "btn-wrap" }, [ + /* @__PURE__ */ d("sl-button", { size: "medium" }, " Zur Startseite "), + /* @__PURE__ */ d("sl-button", { + variant: "primary", + size: "medium" + }, " Weiter Einkaufen ") + ]) +], -1)), bl = [ + fl, + ml, + gl, + hl +]; +function vl(e, n) { + return m(), h("div", cl, bl); +} +const pl = /* @__PURE__ */ I(dl, [["render", vl], ["__scopeId", "data-v-36ccc280"]]), Ee = (e) => (M("data-v-b68a2bfa"), e = e(), z(), e), yl = /* @__PURE__ */ Ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Nutzterdaten", -1)), $l = /* @__PURE__ */ Ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Lieferadresse", -1)), Sl = { key: 0 }, kl = /* @__PURE__ */ Ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Rechnungsadresse", -1)), _l = { + __name: "UserInformation", + props: { + mode: { type: String, default: "form" }, + conditions: { type: Function } + }, + setup(e) { + const n = re(), t = w({ + formValues: {}, + requiredFieldsFilled: S(() => { + if (t.isCustomAdress) + return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("billing.city") && Object.keys(t.formValues).includes("billing.street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname"); + if (!t.isCustomAdress) + return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname"); + }), + isCustomAdress: !1, + addSkel: null, + errors: {} + }); + function l(a) { + a.target.checked && (t.isCustomAdress = !1), a.target.checked || (t.isCustomAdress = !0); + } + function s(a, i) { + for (const [r, c] of Object.entries(i.value[0])) + t.formValues[r] = c; + } + function o(a) { + let i = {}; + return Array.isArray(a) ? (a.forEach((r) => { + let c = r[0], u = r[1]; + i[c] = u; + }), console.log("output", i), i) : a; + } + return ne(t.formValues, (a) => { + Object.entries(a).forEach(([i, r]) => { + r === "" && delete t.formValues[i]; + }); + }), x(async () => { + await n.getAdressStructure(), t.addSkel = o(n.state.structure.address); + }), (a, i) => { + const r = ae("bone"); + return m(), h(E, null, [ + d("div", null, [ + j(" test "), + yl, + (m(!0), h(E, null, U(t.addSkel, (c, u) => (m(), h(E, { key: u }, [ + j(B(u) + " ", 1), + c.visible && c.params.group === "Customer Info" ? (m(), T(r, { + key: 0, + is: K(X)(c.type), + name: u, + structure: o(t.addSkel), + errors: t.errors[u] ? t.errors[u] : [], + skel: t.formValues, + onChange: (f) => s(u, f), + class: "viur-shop-form-grid-w-2" + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ]), + d("div", null, [ + $l, + (m(!0), h(E, null, U(t.addSkel, (c, u) => (m(), h(E, { key: u }, [ + c.visible && c.params.group === "Customer Address" ? (m(), T(r, { + key: 0, + is: K(X)(c.type), + name: u, + structure: o(t.addSkel), + errors: t.errors[u] ? t.errors[u] : [], + skel: t.formValues, + onChange: (f) => s(u, f) + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ]), + t.isCustomAdress ? (m(), h("div", Sl, [ + kl, + (m(!0), h(E, null, U(t.addSkel, (c, u) => (m(), h(E, { key: u }, [ + c.visible && c.params.group === "Customer Address" ? (m(), T(r, { + key: 0, + is: K(X)(c.type), + name: u, + structure: o(t.addSkel), + errors: t.errors[u] ? t.errors[u] : [], + skel: t.formValues, + onChange: (f) => s(u, f) + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ])) : _("", !0), + d("sl-checkbox", { + onSlChange: l, + checked: "" + }, " Rechnungsadresse wie Lieferadresse ", 32) + ], 64); + }; + } +}, wl = /* @__PURE__ */ I(_l, [["__scopeId", "data-v-b68a2bfa"]]), ee = (e) => (M("data-v-a4accf28"), e = e(), z(), e), El = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Nutzterdaten", -1)), Al = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Lieferadresse", -1)), Il = ["onSlChange", "onSlClear", "label"], Cl = ["value"], Ol = { key: 0 }, jl = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("h2", { class: "viur-shop-form-headline headline" }, "Rechnungsadresse", -1)), Bl = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("sl-icon", { + name: "x-lg", + slot: "prefix" +}, null, -1)), Dl = [ + Bl +], Vl = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("sl-icon", { + name: "plus-lg", + slot: "prefix" +}, null, -1)), Nl = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("sl-icon", { + slot: "icon", + name: "exclamation-triangle" +}, null, -1)), Rl = /* @__PURE__ */ ee(() => /* @__PURE__ */ d("br", null, null, -1)), Ll = { + __name: "UserInfoMulti", + props: { + mode: { type: String, default: "form" } + }, + setup(e) { + const n = re(), t = w({ + formValues: {}, + requiredFieldsFilled: S(() => { + if (t.isCustomAdress) + return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("billing.city") && Object.keys(t.formValues).includes("billing.street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname"); + if (!t.isCustomAdress) + return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname"); + }), + isCustomAdress: !1, + shippingAdressAmount: 1, + maxShippingAdress: S( + () => Object.keys(n.state.carts).length + 2 + ), + amountAlert: { title: "", msg: "" }, + items: null, + addSkel: null, + errors: {}, + selectedItem: {}, + isInit: S(() => !!n.state.carts[n.state.basket]) + }), l = q(null), s = q(null); + function o(p) { + p.target.checked && (t.isCustomAdress = !1), p.target.checked || (t.isCustomAdress = !0); + } + function a() { + if (t.shippingAdressAmount === t.maxShippingAdress) { + t.amountAlert.title = "Zu viele Lieferadressen", t.amountAlert.msg = `Sie können nur maximal: "${t.maxShippingAdress}" Lieferadressen verwenden.`, s.value.show(); + return; + } + t.shippingAdressAmount += 1; + } + function i(p, v) { + for (const [k, g] of Object.entries(v.value[0])) + t.formValues[k] = g; + } + function r() { + if (t.shippingAdressAmount === 1) { + t.amountAlert.title = "Zu wenig Lieferadressen", t.amountAlert.msg = "Mindestens eine Lieferadresse muss angegeben werden.", s.value.show(); + return; + } + t.shippingAdressAmount -= 1; + } + function c(p, v) { + if (console.log(p.target.value), !p.target.value.length) { + u(); + return; + } + t.selectedItem[v] = p.target.value, t.isItemSelected = !0; + } + function u(p, v) { + console.log("clearing..."), delete t.selectedItem[v], t.isItemSelected = !1; + } + function f(p) { + let v = {}; + return Array.isArray(p) ? (p.forEach((k) => { + let g = k[0], b = k[1]; + v[g] = b; + }), v) : p; + } + return ne(t.formValues, (p) => { + Object.entries(p).forEach(([v, k]) => { + k === "" && delete t.formValues[v]; + }); + }), x(async () => { + await n.getAdressStructure(), t.addSkel = f(n.state.structure.address); + }), (p, v) => { + const k = ae("bone"); + return m(), h(E, null, [ + d("div", null, [ + El, + (m(!0), h(E, null, U(t.addSkel, (g, b) => (m(), h(E, { key: b }, [ + g.visible && g.params.group === "Customer Info" ? (m(), T(k, { + key: 0, + is: K(X)(g.type), + name: b, + structure: f(t.addSkel), + errors: t.errors[b] ? t.errors[b] : [], + skel: t.formValues, + onChange: (y) => i(b, y), + class: "viur-shop-form-grid-w-2" + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ]), + Al, + (m(!0), h(E, null, U(t.shippingAdressAmount, (g) => (m(), h("div", { key: g }, [ + d("sl-select", { + clearable: "", + ref_for: !0, + ref_key: "itemSelection", + ref: l, + onSlChange: (b) => c(b, g), + onSlClear: (b) => u(b, g), + label: t.selectedItem[g] ? K(n).state.carts[t.selectedItem[g]].info.name : "Warenkorb für Adresse wählen.", + class: "grid-w-4" + }, [ + (m(!0), h(E, null, U(K(n).state.carts, (b, y) => (m(), h("sl-option", { value: y }, B(b.info.name), 9, Cl))), 256)) + ], 40, Il), + (m(!0), h(E, null, U(t.addSkel, (b, y) => (m(), h(E, { key: y }, [ + b.visible && b.params.group === "Customer Address" ? (m(), T(k, { + key: 0, + is: K(X)(b.type), + name: y, + structure: f(t.addSkel), + errors: t.errors[y] ? t.errors[y] : [], + skel: t.formValues, + onChange: ($) => i(y, $) + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ]))), 128)), + t.isCustomAdress ? (m(), h("div", Ol, [ + jl, + (m(!0), h(E, null, U(t.addSkel, (g, b) => (m(), h(E, { key: b }, [ + g.visible && g.params.group === "Customer Address" ? (m(), T(k, { + key: 0, + is: K(X)(g.type), + name: b, + structure: f(t.addSkel), + errors: t.errors[b] ? t.errors[b] : [], + skel: t.formValues, + onChange: (y) => i(b, y) + }, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : _("", !0) + ], 64))), 128)) + ])) : _("", !0), + d("div", { class: "viur-shop-form-btn-wrap" }, [ + d("sl-button", { + size: "medium", + onClick: r, + title: "Lieferadresse entfernen" + }, Dl), + d("sl-button", { + size: "medium", + variant: "primary", + onClick: a + }, [ + Vl, + j(" Lieferadresse hinzufügen ") + ]) + ]), + d("sl-alert", { + variant: "warning", + duration: "2000", + ref_key: "shippingWarning", + ref: s, + closable: "" + }, [ + Nl, + d("strong", null, B(t.amountAlert.title), 1), + Rl, + j(" " + B(t.amountAlert.msg), 1) + ], 512), + d("sl-checkbox", { + onSlChange: o, + checked: "" + }, " Rechnungsadresse wie Lieferadresse ", 32) + ], 64); + }; + } +}, Ul = /* @__PURE__ */ I(Ll, [["__scopeId", "data-v-a4accf28"]]), Xe = { + __name: "ExampleUsage", + setup(e) { + const n = re(), t = S( + () => n.state.basketRootNode.key ? n.state.basketRootNode.key : "" + ), l = w({ + rootNode: {}, + tabs: { + cart: { + component: H(_e), + props: { + sidebar: !0, + mode: "basket", + cartKey: t + }, + // cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted + displayName: "Warenkorb", + icon: { name: "cart", library: "hsk" }, + position: 2, + disabled: !1, + atShow: null, + atHide: null + }, + confirm: { + component: H(we), + props: {}, + displayName: "Bestellung prüfen", + icon: { name: "order-check", library: "hsk" }, + position: 5, + disabled: !1, + atShow: null, + atHide: null + }, + // order: { + // component: shallowRef(CategoryView), + // props: { + // listHandler: ListRequest("categorystore", { + // module: "variante", + // params: { type: "dk", limit: 99 }, + // }), + // }, + // displayName: "Artikel Bestellen", + // icon: { name: "cart-add", library: "hsk" }, + // position: 1, + // disabled: false, + // atShow: null, + // atHide: null, + // }, + orderComplete: { + component: H(pl), + props: {}, + displayName: "Bestellung Abgeschlossen", + icon: { name: "order-confirmed", library: "hsk" }, + position: 6, + disabled: !0, + atShow: null, + atHide: null + }, + userInfo: { + component: H(wl), + props: {}, + displayName: "Daten Eingeben", + icon: { name: "user", library: "hsk" }, + position: 3, + disabled: !1, + atShow: null, + atHide: null + }, + userInfoMulti: { + component: H(Ul), + props: {}, + displayName: "Daten Eingeben (Multi)", + icon: { name: "user", library: "hsk" }, + position: 4, + disabled: !1, + atShow: null, + atHide: null + } + } + }); + function s(o) { + (o == null ? void 0 : o.detail.name) === "confirm" && (l.tabs.orderComplete.disabled = !1); + } + return x(async () => { + await n.init(), await n.getAdressStructure(), console.log("debug init exampleusage :", n.state.basketRootNode); + }), (o, a) => (m(), T(ul, { + tabs: l.tabs, + onTabChange: s + }, null, 8, ["tabs"])); + } +}, Tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: Xe +}, Symbol.toStringTag, { value: "Module" })), Pl = D({ + props: {}, + components: {}, + setup(e, n) { + const t = ht(); + return { state: w({}), route: t }; + } +}), Ml = { class: "home" }; +function Wl(e, n, t, l, s, o) { + return m(), h("div", Ml, "View " + B(e.route.path) + " is missing.", 1); +} +const zl = /* @__PURE__ */ I(Pl, [["render", Wl]]), ql = [ + { + path: "/:pathMatch(.*)*", + name: "view_missing", + component: zl + }, + { + path: "/shop/category/:identifier", + name: "CategoryView", + component: () => import("./CategoryView-Z-tCFNv1.mjs") + }, + { + path: "/shop/item/:item", + name: "itemView", + component: () => import("./ItemView-cjeQBSTR.mjs") + }, + { + path: "/shop/cart/view", + name: "CartView", + component: () => Promise.resolve().then(() => Us) + }, + { + path: "/shop/order/", + name: "OrderView", + component: () => Promise.resolve().then(() => Tl) + }, + { + path: "/shop/order/confirm", + name: "ConfirmView", + component: () => Promise.resolve().then(() => Qs) + } +]; +function Ql(e, n = !1) { + let t = []; + return n ? t = e : t = e.concat(ql), bt({ + // @ts-ignore + history: vt("/"), + routes: t + }); +} +const Yl = { + install(e) { + e.component("CartView", _e), e.component("ExampleUsage", Xe), e.component("ConfirmView", we); + } +}; +export { + _e as C, + Yl as V, + I as _, + Xe as a, + we as b, + Ql as c, + re as u +};