@viur/shop-components 0.0.1-dev.31 → 0.0.1-dev.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,807 @@
1
+ import { reactive as R, computed as C, useCssVars as L, resolveComponent as v, openBlock as c, createBlock as N, Transition as M, withCtx as f, createElementBlock as k, createVNode as l, createElementVNode as e, createCommentVNode as B, Fragment as x, createTextVNode as i, toDisplayString as S, onBeforeMount as E, pushScopeId as T, popScopeId as j, ref as P, renderList as q, unref as z, Teleport as Q, resolveDynamicComponent as X, mergeProps as Y, normalizeClass as ee, withDirectives as te, vShow as se, shallowRef as ae } from "vue";
2
+ import { Request as U } from "@viur/vue-utils";
3
+ import { defineStore as oe } from "pinia";
4
+ import { ViURShopClient as ne } from "@viur/viur-shop-client";
5
+ import "vue-router";
6
+ const O = (t, n) => {
7
+ const o = t.__vccOpts || t;
8
+ for (const [p, s] of n)
9
+ o[p] = s;
10
+ return o;
11
+ }, K = {
12
+ props: {
13
+ size: {
14
+ type: String,
15
+ default: "2"
16
+ },
17
+ active: {
18
+ type: Boolean,
19
+ default: !0
20
+ },
21
+ logo: {
22
+ default: "logo-cube.svg",
23
+ type: String
24
+ },
25
+ color: {
26
+ default: "var(--sl-color-primary-500)",
27
+ type: String
28
+ }
29
+ },
30
+ setup(t, n) {
31
+ const o = R({
32
+ trackWidth: C(() => `${t.size / 30}rem`),
33
+ outerSize: C(() => `calc(${t.size}rem + ${o.trackWidth})`),
34
+ spinnerSize: C(() => `${t.size}rem`),
35
+ logoSize: C(() => `calc(${t.size}rem - ${o.trackWidth} * 10)`),
36
+ shadow: C(() => `0px 0px ${t.size / 6}rem 0 color-mix(in hsl, var(--sl-color-neutral-1000), 80% transparent)`)
37
+ });
38
+ return { state: o };
39
+ }
40
+ }, Z = () => {
41
+ L((t) => ({
42
+ "93747d92": t.state.outerSize,
43
+ "284424e5": t.state.shadow,
44
+ "6485ca5e": t.state.logoSize,
45
+ "5d833915": t.state.spinnerSize,
46
+ d5b3feca: t.color,
47
+ "2050b700": t.state.trackWidth
48
+ }));
49
+ }, H = K.setup;
50
+ K.setup = H ? (t, n) => (Z(), H(t, n)) : Z;
51
+ const re = {
52
+ key: 0,
53
+ class: "loading"
54
+ }, ie = { class: "logo" };
55
+ function le(t, n, o, p, s, d) {
56
+ const $ = v("sl-spinner"), b = v("sl-icon");
57
+ return c(), N(M, null, {
58
+ default: f(() => [
59
+ o.active ? (c(), k("div", re, [
60
+ l($, { class: "loader" }),
61
+ e("div", ie, [
62
+ l(b, { src: o.logo }, null, 8, ["src"])
63
+ ])
64
+ ])) : B("", !0)
65
+ ]),
66
+ _: 1
67
+ });
68
+ }
69
+ const ce = /* @__PURE__ */ O(K, [["render", le], ["__scopeId", "data-v-46c45785"]]), G = oe("cartstore", () => {
70
+ const t = new ne({
71
+ host_url: window.location.origin === "http://localhost:8081" ? "http://localhost:8080" : window.location.origin
72
+ }), n = R({
73
+ basketRootNode: {},
74
+ whishlistRootNodes: [],
75
+ children: {},
76
+ structure: { address: {}, cart: {} }
77
+ });
78
+ async function o() {
79
+ await s();
80
+ }
81
+ async function p(r) {
82
+ return await t.cart_list({ cart_key: r });
83
+ }
84
+ async function s() {
85
+ (await t.cart_list()).forEach((a) => {
86
+ a.is_root_node && (a.cart_type === "basket" ? n.basketRootNode = a : n.whishlistRootNodes.push(a));
87
+ });
88
+ }
89
+ async function d(r, a) {
90
+ let _ = await t.article_add({
91
+ article_key: r,
92
+ parent_cart_key: a
93
+ });
94
+ console.log("addToCart", _);
95
+ }
96
+ async function $(r, a) {
97
+ let _ = await t.article_view({
98
+ article_key: r,
99
+ parent_cart_key: a
100
+ });
101
+ console.log("getArticleView", _);
102
+ }
103
+ async function b(r, a) {
104
+ let _ = await t.article_remove({
105
+ article_key: r,
106
+ parent_cart_key: a
107
+ });
108
+ console.log("remove Resp", _);
109
+ }
110
+ async function m(r, a, _) {
111
+ let h = await t.article_update({
112
+ article_key: r,
113
+ parent_cart_key: a,
114
+ quantity: _,
115
+ quantity_mode: "replace"
116
+ });
117
+ console.log("update Resp", h);
118
+ }
119
+ async function y() {
120
+ let r = await t.address_structure();
121
+ n.structure.address = r.addSkel, console.log("adress add", n.structure.address);
122
+ }
123
+ return {
124
+ state: n,
125
+ addToCart: d,
126
+ getArticleView: $,
127
+ removeItem: b,
128
+ updateItem: m,
129
+ init: o,
130
+ getAdressStructure: y,
131
+ getChildren: p
132
+ };
133
+ }), de = {
134
+ __name: "CartNode",
135
+ props: {
136
+ node: { type: Object, required: !0 }
137
+ },
138
+ setup(t) {
139
+ return R({}), (n, o) => (c(), k(x, null, [
140
+ i(" cartnode "),
141
+ e("pre", null, S(t.node.name), 1)
142
+ ], 64));
143
+ }
144
+ }, F = (t) => (T("data-v-0e24135f"), t = t(), j(), t), ue = ["src"], _e = {
145
+ class: "viur-shop-cart-card-header",
146
+ slot: "header"
147
+ }, he = { class: "viur-shop-cart-card-headline headline" }, pe = { class: "viur-shop-cart-card-body-row" }, me = { class: "viur-shop-cart-card-body-info" }, fe = /* @__PURE__ */ F(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-card-descr" }, [
148
+ /* @__PURE__ */ i(" Version: 900x900x2000 "),
149
+ /* @__PURE__ */ e("br"),
150
+ /* @__PURE__ */ i(" Farbe: Chromoptik "),
151
+ /* @__PURE__ */ e("br"),
152
+ /* @__PURE__ */ i(" Glasart: Klar hell mit Edelglasbeschichtung"),
153
+ /* @__PURE__ */ e("br"),
154
+ /* @__PURE__ */ i(" Anschlag: Beidseitig variabel"),
155
+ /* @__PURE__ */ e("br"),
156
+ /* @__PURE__ */ i(" Griff: Stangengriff Exklusiv (56) ")
157
+ ], -1)), ve = { class: "viur-shop-cart-card-body-footer" }, be = { class: "viur-shop-cart-card-body-amount" }, ye = {
158
+ class: "viur-shop-cart-card-price-wrap",
159
+ slot: "footer"
160
+ }, ke = /* @__PURE__ */ F(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-card-price-label" }, "Preis", -1)), ge = { class: "viur-shop-cart-card-price" }, we = /* @__PURE__ */ F(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-card-small-print" }, "Brutto / Stk.", -1)), $e = {
161
+ __name: "CartLeaf",
162
+ props: {
163
+ leaf: { type: Object, required: !0 },
164
+ node: { type: Object, required: !0 }
165
+ },
166
+ emits: ["updateItem", "removeItem"],
167
+ setup(t, { emit: n }) {
168
+ const o = t, p = n, s = R({
169
+ leaf: {}
170
+ });
171
+ function d(m) {
172
+ return m !== void 0 ? U.downloadUrlFor(m) : "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
173
+ }
174
+ function $(m, y, r, a) {
175
+ p("updateItem", {
176
+ item: m,
177
+ articleKey: y,
178
+ node: r,
179
+ quantity: a
180
+ });
181
+ }
182
+ function b(m, y, r) {
183
+ p("removeItem", { item: m, articleKey: y, node: r });
184
+ }
185
+ return E(() => {
186
+ s.leaf = o.leaf;
187
+ }), (m, y) => {
188
+ const r = v("sl-icon"), a = v("sl-button"), _ = v("sl-input"), h = v("sl-card");
189
+ return c(), k(x, null, [
190
+ i(" cartleafe "),
191
+ l(h, {
192
+ horizontal: "",
193
+ class: "viur-shop-cart-card"
194
+ }, {
195
+ default: f(() => [
196
+ e("img", {
197
+ class: "viur-shop-cart-card-img",
198
+ slot: "image",
199
+ src: d(s.leaf.shop_image ? s.leaf.shop_image : void 0)
200
+ }, null, 8, ue),
201
+ e("div", _e, [
202
+ e("h4", he, S(s.leaf.shop_name) + " | " + S(t.leaf.shop_art_no_or_gtin), 1)
203
+ ]),
204
+ e("div", pe, [
205
+ e("div", me, [
206
+ fe,
207
+ e("div", ve, [
208
+ l(a, {
209
+ size: "small",
210
+ outline: "",
211
+ class: "viur-shop-cart-card-add-to-favourites-btn",
212
+ variant: "primary",
213
+ title: "Add to favourites"
214
+ }, {
215
+ default: f(() => [
216
+ l(r, {
217
+ name: "heart",
218
+ slot: "prefix"
219
+ })
220
+ ]),
221
+ _: 1
222
+ }),
223
+ l(a, {
224
+ size: "small",
225
+ outline: "",
226
+ class: "viur-shop-cart-card-delete-btn",
227
+ variant: "primary",
228
+ title: "Remove from cart",
229
+ onClick: y[0] || (y[0] = (I) => b(s.leaf, s.leaf.article.dest.key, t.node))
230
+ }, {
231
+ default: f(() => [
232
+ l(r, {
233
+ name: "trash",
234
+ slot: "prefix"
235
+ })
236
+ ]),
237
+ _: 1
238
+ })
239
+ ])
240
+ ]),
241
+ e("div", be, [
242
+ l(_, {
243
+ class: "amount-input",
244
+ type: "number",
245
+ label: "Anzahl",
246
+ placeholder: "Number",
247
+ min: "0",
248
+ modelValue: s.leaf.quantity,
249
+ "onUpdate:modelValue": y[1] || (y[1] = (I) => s.leaf.quantity = I),
250
+ onInput: y[2] || (y[2] = (I) => $(
251
+ s.leaf,
252
+ s.leaf.article.dest.key,
253
+ t.node,
254
+ s.leaf.quantity
255
+ ))
256
+ }, null, 8, ["modelValue"])
257
+ ]),
258
+ e("div", ye, [
259
+ ke,
260
+ e("div", ge, S(s.leaf.price.retail) + " € ", 1),
261
+ we
262
+ ])
263
+ ])
264
+ ]),
265
+ _: 1
266
+ })
267
+ ], 64);
268
+ };
269
+ }
270
+ }, Ie = /* @__PURE__ */ O($e, [["__scopeId", "data-v-0e24135f"]]), V = (t) => (T("data-v-7aae4815"), t = t(), j(), t), Ce = /* @__PURE__ */ V(() => /* @__PURE__ */ e("p", null, "Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?", -1)), Se = {
271
+ class: "footer-wrap",
272
+ slot: "footer"
273
+ }, Ne = { key: 0 }, ze = /* @__PURE__ */ V(() => /* @__PURE__ */ e("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Zusammenfassung", -1)), xe = /* @__PURE__ */ V(() => /* @__PURE__ */ e("br", null, null, -1)), Re = /* @__PURE__ */ V(() => /* @__PURE__ */ e("br", null, null, -1)), Ve = { class: "viur-shop-cart-sidebar-info-line" }, Be = /* @__PURE__ */ V(() => /* @__PURE__ */ e("span", null, "Zwischensumme", -1)), qe = /* @__PURE__ */ V(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-sidebar-info-line" }, [
274
+ /* @__PURE__ */ e("span", null, "Rabatt"),
275
+ /* @__PURE__ */ i(" 0 € ")
276
+ ], -1)), Oe = /* @__PURE__ */ V(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-sidebar-info-line" }, [
277
+ /* @__PURE__ */ e("span", null, "Versandkosten"),
278
+ /* @__PURE__ */ i(" 0 € ")
279
+ ], -1)), Ae = { class: "viur-shop-cart-sidebar-info-line total" }, Ee = /* @__PURE__ */ V(() => /* @__PURE__ */ e("span", null, "Gesamt:", -1)), Te = { class: "viur-shop-cart-sidebar-btn-wrap" }, je = {
280
+ __name: "CartView",
281
+ props: {
282
+ mode: { type: String, default: "basket" },
283
+ cartKey: { type: String, required: !0 },
284
+ sidebar: { type: Boolean, default: !0 }
285
+ },
286
+ setup(t) {
287
+ const n = t, o = G(), p = P(null), s = R({
288
+ cartIsInit: C(() => !!o.state.basketRootNode),
289
+ itemsIsInit: C(() => !0),
290
+ images: {},
291
+ currentItem: {},
292
+ currentNode: {},
293
+ nodes: [],
294
+ leaves: {}
295
+ });
296
+ C(() => n.mode === "basket" ? o.state.basket : n.cartKey);
297
+ async function d() {
298
+ await o.updateItem(
299
+ s.currentItem.article.dest.key,
300
+ s.currentNode.key,
301
+ 0
302
+ ), await y(), p.value.hide();
303
+ }
304
+ async function $(a) {
305
+ console.log("updateItem :", a), a.quantity === 0 ? (p.value.show(), s.currentItem = a.item, s.currentNode = a.node) : (await o.updateItem(a.articleKey, a.node.key, a.quantity), await o.init());
306
+ }
307
+ function b(a) {
308
+ console.log("removeItem :", a), p.value.show(), s.currentItem = a.item, s.currentNode = a.node;
309
+ }
310
+ async function m() {
311
+ s.leaves[s.currentNode.key].forEach((a) => {
312
+ a.key === s.currentItem.key && (a.quantity = 1);
313
+ }), s.currentItem = {}, s.currentNode = {};
314
+ }
315
+ async function y() {
316
+ s.nodes = [], s.leaves = {}, await o.init(), await r();
317
+ }
318
+ async function r(a = n.cartKey) {
319
+ console.log("debug getChildren parentKey from comp: ", a);
320
+ const _ = await o.getChildren(a);
321
+ console.log("getChildren children: ", _), _.forEach(async (h) => {
322
+ h.skel_type === "node" ? (s.nodes.push(h), await r(h.key)) : (Object.keys(s.leaves).includes(a) || (s.leaves[a] = []), s.leaves[a].push(h));
323
+ });
324
+ }
325
+ return E(async () => {
326
+ await o.init(), await r(), n.mode === "basket" && s.nodes.push(o.state.basketRootNode), console.log("state.nodes test", s.nodes), console.log("state.leaves", s.leaves);
327
+ }), (a, _) => {
328
+ const h = v("sl-spinner"), I = v("sl-button"), D = v("sl-dialog"), W = v("sl-input"), g = v("sl-icon");
329
+ return t.cartKey.length ? (c(), k(x, { key: 1 }, [
330
+ l(D, {
331
+ ref_key: "confirm",
332
+ ref: p,
333
+ onSlHide: m
334
+ }, {
335
+ default: f(() => [
336
+ Ce,
337
+ e("div", Se, [
338
+ l(I, {
339
+ variant: "danger",
340
+ onClick: _[0] || (_[0] = (w) => p.value.hide()),
341
+ size: "medium"
342
+ }, {
343
+ default: f(() => [
344
+ i(" Abbrechen ")
345
+ ]),
346
+ _: 1
347
+ }),
348
+ l(I, {
349
+ variant: "success",
350
+ onClick: d,
351
+ size: "medium"
352
+ }, {
353
+ default: f(() => [
354
+ i(" Aus Warenkorb entfernen ")
355
+ ]),
356
+ _: 1
357
+ })
358
+ ])
359
+ ]),
360
+ _: 1
361
+ }, 512),
362
+ (c(!0), k(x, null, q(s.nodes, (w) => (c(), k("div", null, [
363
+ Object.keys(s.leaves).includes(w.key) ? (c(), k(x, { key: 0 }, [
364
+ l(de, { node: w }, null, 8, ["node"]),
365
+ (c(!0), k(x, null, q(s.leaves[w.key], (A) => (c(), N(Ie, {
366
+ key: A.key,
367
+ leaf: A,
368
+ node: w,
369
+ onRemoveItem: b,
370
+ onUpdateItem: $
371
+ }, null, 8, ["leaf", "node"]))), 128))
372
+ ], 64)) : B("", !0)
373
+ ]))), 256)),
374
+ t.sidebar ? (c(), k("div", Ne, [
375
+ ze,
376
+ xe,
377
+ l(W, { label: "Rabattcode eingeben" }),
378
+ Re,
379
+ e("div", Ve, [
380
+ Be,
381
+ i(" --> " + S(t.mode === "basket" ? z(o).state.basketRootNode.total : z(o).state.whishlistRootNodes[t.cartKey].total) + " € ", 1)
382
+ ]),
383
+ qe,
384
+ Oe,
385
+ e("div", Ae, [
386
+ Ee,
387
+ i(" " + S(t.mode === "basket" ? z(o).state.basketRootNode.total : z(o).state.whishlistRootNodes[t.cartKey].total) + " € ", 1)
388
+ ]),
389
+ e("div", Te, [
390
+ l(I, {
391
+ variant: "info",
392
+ size: "small"
393
+ }, {
394
+ default: f(() => [
395
+ i(" Jetzt Bestellen ")
396
+ ]),
397
+ _: 1
398
+ }),
399
+ l(I, {
400
+ size: "small",
401
+ variant: "primary"
402
+ }, {
403
+ default: f(() => [
404
+ l(g, {
405
+ name: "paypal",
406
+ slot: "prefix"
407
+ }),
408
+ i(" Paypal ")
409
+ ]),
410
+ _: 1
411
+ })
412
+ ])
413
+ ])) : B("", !0)
414
+ ], 64)) : (c(), N(h, { key: 0 }));
415
+ };
416
+ }
417
+ }, J = /* @__PURE__ */ O(je, [["__scopeId", "data-v-7aae4815"]]), u = (t) => (T("data-v-75e70e9a"), t = t(), j(), t), De = {
418
+ key: 1,
419
+ class: "list"
420
+ }, We = /* @__PURE__ */ u(() => /* @__PURE__ */ e("h2", { class: "viur-shop-cart-headline headline" }, "Bestellung prüfen", -1)), Ue = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Ke = { class: "viur-shop-cart-address-wrap" }, Ge = { class: "viur-shop-cart-address" }, Fe = { class: "viur-shop-cart-address-headline" }, Ze = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), He = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Pe = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Je = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Le = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Me = { class: "viur-shop-cart-address" }, Qe = { class: "viur-shop-cart-address-headline" }, Xe = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), Ye = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), et = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), tt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), st = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), at = { class: "viur-shop-cart-payment" }, ot = /* @__PURE__ */ u(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-payment-method" }, [
421
+ /* @__PURE__ */ e("span", null, "Zahlungsmethode:"),
422
+ /* @__PURE__ */ i(" Paypal ")
423
+ ], -1)), nt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("h2", { class: "viur-shop-cart-headline headline" }, "Warenkorb", -1)), rt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), it = ["src"], lt = {
424
+ class: "viur-shop-cart-mini-cart-header",
425
+ slot: "header"
426
+ }, ct = { class: "viur-shop-cart-mini-headline headline" }, dt = { class: "viur-shop-cart-mini-card-body-row" }, ut = { class: "viur-shop-cart-mini-card-body-info" }, _t = { class: "viur-shop-cart-mini-card-info-wrap" }, ht = /* @__PURE__ */ u(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-mini-card-info" }, [
427
+ /* @__PURE__ */ e("span", null, "Anzahl: "),
428
+ /* @__PURE__ */ i(" 1 ")
429
+ ], -1)), pt = { class: "viur-shop-cart-mini-card-info" }, mt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("span", null, "Preis: ", -1)), ft = /* @__PURE__ */ u(() => /* @__PURE__ */ e("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Jetzt Bestellen", -1)), vt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("br", null, null, -1)), bt = { class: "viur-shop-cart-sidebar-info-line" }, yt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("span", null, "Zwischensumme", -1)), kt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-sidebar-info-line" }, [
430
+ /* @__PURE__ */ e("span", null, "Rabatt"),
431
+ /* @__PURE__ */ i(" 0 € ")
432
+ ], -1)), gt = /* @__PURE__ */ u(() => /* @__PURE__ */ e("div", { class: "viur-shop-cart-sidebar-info-line" }, [
433
+ /* @__PURE__ */ e("span", null, "Versandkosten"),
434
+ /* @__PURE__ */ i(" 0 € ")
435
+ ], -1)), wt = { class: "viur-shop-cart-sidebar-info-line total" }, $t = /* @__PURE__ */ u(() => /* @__PURE__ */ e("span", null, "Gesamt:", -1)), It = { class: "viur-shop-cart-sidebar-btn-wrap" }, Ct = {
436
+ __name: "ConfirmView",
437
+ setup(t) {
438
+ const n = G(), o = R({
439
+ cartIsInit: C(() => !!n.state.basket.length),
440
+ itemsIsInit: C(() => !!n.state.carts[n.state.basket].items),
441
+ images: {},
442
+ showOrderButton: !1
443
+ });
444
+ function p(d) {
445
+ return U.get(`/json/dk_variante/view/${d}`).then(async ($) => {
446
+ let b = await $.json();
447
+ b = b.values;
448
+ let m = b.dk_artikel.dest.image ? U.downloadUrlFor(b.dk_artikel.dest.image) : "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
449
+ o.images[d] = m;
450
+ }), o.images[d];
451
+ }
452
+ function s(d) {
453
+ d.target.checked && (o.showOrderButton = !0), d.target.checked || (o.showOrderButton = !1);
454
+ }
455
+ return E(async () => {
456
+ await n.init();
457
+ }), (d, $) => {
458
+ const b = v("sl-icon"), m = v("sl-button"), y = v("sl-card"), r = v("sl-checkbox");
459
+ return o.cartIsInit ? (c(), k("div", De, [
460
+ We,
461
+ Ue,
462
+ e("div", Ke, [
463
+ e("div", Ge, [
464
+ e("div", Fe, [
465
+ i(" Versandadresse "),
466
+ l(m, {
467
+ outline: "",
468
+ size: "small"
469
+ }, {
470
+ default: f(() => [
471
+ l(b, {
472
+ name: "pencil",
473
+ slot: "prefix"
474
+ })
475
+ ]),
476
+ _: 1
477
+ })
478
+ ]),
479
+ i(" Roland Brose"),
480
+ Ze,
481
+ i(" Speicherstraße 33"),
482
+ He,
483
+ i(" 44147 Dortmund, DE"),
484
+ Pe,
485
+ Je,
486
+ i(" rb@mausbrand.de"),
487
+ Le,
488
+ i(" 0231 21 34 68 90 ")
489
+ ]),
490
+ e("div", Me, [
491
+ e("div", Qe, [
492
+ i(" Rechnungsadresse "),
493
+ l(m, {
494
+ outline: "",
495
+ size: "small"
496
+ }, {
497
+ default: f(() => [
498
+ l(b, {
499
+ name: "pencil",
500
+ slot: "prefix"
501
+ })
502
+ ]),
503
+ _: 1
504
+ })
505
+ ]),
506
+ i(" Roland Brose"),
507
+ Xe,
508
+ i(" Speicherstraße 33"),
509
+ Ye,
510
+ i(" 44147 Dortmund, DE"),
511
+ et,
512
+ tt,
513
+ i(" rb@mausbrand.de"),
514
+ st,
515
+ i(" 0231 21 34 68 90 ")
516
+ ])
517
+ ]),
518
+ e("div", at, [
519
+ ot,
520
+ l(m, {
521
+ outline: "",
522
+ size: "small"
523
+ }, {
524
+ default: f(() => [
525
+ l(b, {
526
+ name: "pencil",
527
+ slot: "prefix"
528
+ })
529
+ ]),
530
+ _: 1
531
+ })
532
+ ]),
533
+ nt,
534
+ rt,
535
+ (c(!0), k(x, null, q(z(n).state.carts[z(n).state.basket].items, (a) => (c(), N(y, {
536
+ horizontal: "",
537
+ class: "viur-shop-cart-mini-card"
538
+ }, {
539
+ default: f(() => [
540
+ e("img", {
541
+ class: "viur-shop-cart-mini-card-img",
542
+ slot: "image",
543
+ src: p(a.article.dest.key)
544
+ }, null, 8, it),
545
+ e("div", lt, [
546
+ e("h4", ct, S(a.article.dest.shop_name) + " | 425018", 1)
547
+ ]),
548
+ e("div", dt, [
549
+ e("div", ut, [
550
+ e("div", _t, [
551
+ ht,
552
+ e("div", pt, [
553
+ mt,
554
+ i(" " + S(a.article.dest.shop_price_recommended) + " € ", 1)
555
+ ])
556
+ ])
557
+ ])
558
+ ])
559
+ ]),
560
+ _: 2
561
+ }, 1024))), 256)),
562
+ (c(), N(Q, { to: "#order_sidebar" }, [
563
+ ft,
564
+ vt,
565
+ e("div", bt, [
566
+ yt,
567
+ i(" " + S(z(n).state.carts[z(n).state.basket].info.total) + " € ", 1)
568
+ ]),
569
+ kt,
570
+ gt,
571
+ e("div", wt, [
572
+ $t,
573
+ i(" " + S(z(n).state.carts[z(n).state.basket].info.total) + " € ", 1)
574
+ ]),
575
+ l(r, { onSlChange: s }, {
576
+ default: f(() => [
577
+ i(" Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ")
578
+ ]),
579
+ _: 1
580
+ }),
581
+ e("div", It, [
582
+ l(m, {
583
+ variant: o.showOrderButton ? "info" : "disabled",
584
+ size: "small",
585
+ disabled: !o.showOrderButton
586
+ }, {
587
+ default: f(() => [
588
+ i(" Zahlungspflichtig bestellen ")
589
+ ]),
590
+ _: 1
591
+ }, 8, ["variant", "disabled"])
592
+ ])
593
+ ]))
594
+ ])) : (c(), N(ce, { key: 0 }));
595
+ };
596
+ }
597
+ }, St = /* @__PURE__ */ O(Ct, [["__scopeId", "data-v-75e70e9a"]]), Nt = (t) => (T("data-v-61488015"), t = t(), j(), t), zt = { class: "bind viur-shop-wrap" }, xt = { class: "viur-shop-order-step" }, Rt = { class: "viur-shop-order-status-text" }, Vt = /* @__PURE__ */ Nt(() => /* @__PURE__ */ e("div", {
598
+ class: "viur-shop-sidebar",
599
+ id: "order_sidebar"
600
+ }, null, -1)), Bt = {
601
+ __name: "OrderView",
602
+ props: {
603
+ tabs: {
604
+ type: Object,
605
+ required: !0
606
+ }
607
+ },
608
+ emits: ["tabChange"],
609
+ setup(t, { emit: n }) {
610
+ const o = t, p = n, s = R({
611
+ tabNames: C(() => $(o.tabs)),
612
+ isFirstTab: (r) => r === 0
613
+ }), d = P(null);
614
+ function $(r) {
615
+ let a = [], _ = [];
616
+ for (const h in r)
617
+ r[h].position ? a.push([h, r[h].position]) : a.push([h, 0]);
618
+ return a.sort((h, I) => h[1] - I[1]), a.forEach((h) => {
619
+ _.push(h[0]);
620
+ }), _;
621
+ }
622
+ function b(r) {
623
+ p("tabChange", r);
624
+ }
625
+ function m(r) {
626
+ d.value.show(r);
627
+ }
628
+ function y(r) {
629
+ d.value.show(r);
630
+ }
631
+ return (r, a) => {
632
+ const _ = v("sl-icon"), h = v("sl-tab"), I = v("sl-button"), D = v("sl-tab-panel"), W = v("sl-tab-group");
633
+ return c(), k("div", zt, [
634
+ l(W, {
635
+ class: "viur-shop-order-tab",
636
+ noScrollControls: "",
637
+ onSlTabShow: b,
638
+ ref_key: "tabGroup",
639
+ ref: d
640
+ }, {
641
+ default: f(() => [
642
+ (c(!0), k(x, null, q(s.tabNames, (g, w) => (c(), N(h, {
643
+ slot: "nav",
644
+ panel: g,
645
+ key: g,
646
+ disabled: t.tabs[g].disabled
647
+ }, {
648
+ default: f(() => [
649
+ e("div", xt, [
650
+ l(_, {
651
+ name: t.tabs[g].icon.name,
652
+ library: t.tabs[g].icon.library
653
+ }, null, 8, ["name", "library"]),
654
+ e("div", Rt, S(w + 1) + ". " + S(t.tabs[g].displayName), 1)
655
+ ]),
656
+ w < s.tabNames.length - 1 ? (c(), N(_, {
657
+ key: 0,
658
+ name: "chevron-right",
659
+ class: "viur-shop-order-tab-check"
660
+ })) : B("", !0)
661
+ ]),
662
+ _: 2
663
+ }, 1032, ["panel", "disabled"]))), 128)),
664
+ (c(!0), k(x, null, q(s.tabNames, (g, w) => (c(), N(D, {
665
+ name: g,
666
+ key: g
667
+ }, {
668
+ default: f(() => [
669
+ (c(), N(X(t.tabs[g].component), Y({ ref_for: !0 }, t.tabs[g].props ? t.tabs[g].props : ""), null, 16)),
670
+ w !== s.tabNames.length - 1 ? (c(), k("div", {
671
+ key: 0,
672
+ class: ee(["viur-shop-form-footer", { "flex-end": s.isFirstTab(w) }])
673
+ }, [
674
+ te(l(I, {
675
+ type: "submit",
676
+ onClick: (A) => m(s.tabNames[w - 1])
677
+ }, {
678
+ default: f(() => [
679
+ i(" Zurück ")
680
+ ]),
681
+ _: 2
682
+ }, 1032, ["onClick"]), [
683
+ [se, w !== 0]
684
+ ]),
685
+ l(I, {
686
+ type: "submit",
687
+ variant: "primary",
688
+ onClick: (A) => y(s.tabNames[w + 1])
689
+ }, {
690
+ default: f(() => [
691
+ i(" Weiter ")
692
+ ]),
693
+ _: 2
694
+ }, 1032, ["onClick"])
695
+ ], 2)) : B("", !0)
696
+ ]),
697
+ _: 2
698
+ }, 1032, ["name"]))), 128))
699
+ ]),
700
+ _: 1
701
+ }, 512),
702
+ Vt
703
+ ]);
704
+ };
705
+ }
706
+ }, qt = /* @__PURE__ */ O(Bt, [["__scopeId", "data-v-61488015"]]), Ot = {
707
+ __name: "ExampleUsage",
708
+ setup(t) {
709
+ const n = G(), o = C(
710
+ () => n.state.basketRootNode.key ? n.state.basketRootNode.key : ""
711
+ ), p = R({
712
+ rootNode: {},
713
+ tabs: {
714
+ cart: {
715
+ component: ae(J),
716
+ props: {
717
+ sidebar: !0,
718
+ mode: "basket",
719
+ cartKey: o
720
+ },
721
+ // 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
722
+ displayName: "Warenkorb",
723
+ icon: { name: "cart", library: "hsk" },
724
+ position: 2,
725
+ disabled: !1,
726
+ atShow: null,
727
+ atHide: null
728
+ }
729
+ // confirm: {
730
+ // component: shallowRef(ConfirmView),
731
+ // props: {},
732
+ // displayName: "Bestellung prüfen",
733
+ // icon: { name: "order-check", library: "hsk" },
734
+ // position: 5,
735
+ // disabled: false,
736
+ // atShow: null,
737
+ // atHide: null,
738
+ // },
739
+ // order: {
740
+ // component: shallowRef(CategoryView),
741
+ // props: {
742
+ // listHandler: ListRequest("categorystore", {
743
+ // module: "variante",
744
+ // params: { type: "dk", limit: 99 },
745
+ // }),
746
+ // },
747
+ // displayName: "Artikel Bestellen",
748
+ // icon: { name: "cart-add", library: "hsk" },
749
+ // position: 1,
750
+ // disabled: false,
751
+ // atShow: null,
752
+ // atHide: null,
753
+ // },
754
+ // orderComplete: {
755
+ // component: shallowRef(OrderComplete),
756
+ // props: {},
757
+ // displayName: "Bestellung Abgeschlossen",
758
+ // icon: { name: "order-confirmed", library: "hsk" },
759
+ // position: 6,
760
+ // disabled: true,
761
+ // atShow: null,
762
+ // atHide: null,
763
+ // },
764
+ // userInfo: {
765
+ // component: shallowRef(UserInformation),
766
+ // props: {},
767
+ // displayName: "Daten Eingeben",
768
+ // icon: { name: "user", library: "hsk" },
769
+ // position: 3,
770
+ // disabled: false,
771
+ // atShow: null,
772
+ // atHide: null,
773
+ // },
774
+ // userInfoMulti: {
775
+ // component: shallowRef(UserInfoMulti),
776
+ // props: {},
777
+ // displayName: "Daten Eingeben (Multi)",
778
+ // icon: { name: "user", library: "hsk" },
779
+ // position: 4,
780
+ // disabled: false,
781
+ // atShow: null,
782
+ // atHide: null,
783
+ // },
784
+ }
785
+ });
786
+ function s(d) {
787
+ (d == null ? void 0 : d.detail.name) === "confirm" && (p.tabs.orderComplete.disabled = !1);
788
+ }
789
+ return E(async () => {
790
+ await n.init(), await n.getAdressStructure(), console.log("debug init exampleusage :", n.state.basketRootNode);
791
+ }), (d, $) => (c(), N(qt, {
792
+ tabs: p.tabs,
793
+ onTabChange: s
794
+ }, null, 8, ["tabs"]));
795
+ }
796
+ }, Wt = {
797
+ install(t) {
798
+ t.component("CartView", J), t.component("ExampleUsage", Ot), t.component("ConfirmView", St);
799
+ }
800
+ };
801
+ export {
802
+ J as CartView,
803
+ St as ConfirmView,
804
+ Ot as ExampleUsage,
805
+ Wt as default,
806
+ G as useCartStore
807
+ };