@code-collective/booking-widget 1.0.4 → 1.0.6
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.
- package/README.md +38 -3
- package/dist/booking-widget.css +1 -1
- package/dist/booking-widget.js +330 -226
- package/dist/booking-widget.min.css +1 -1
- package/dist/booking-widget.min.js +9 -5
- package/dist/booking-widget.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/lib/CartBar.svelte +14 -0
- package/src/lib/CartBarView.svelte +1 -1
- package/src/lib/CartOverviewButton.svelte +15 -1
- package/src/lib/Checkout.svelte +38 -28
- package/src/lib/CheckoutModal.svelte +10 -0
- package/src/lib/TicketConfigurator.svelte +31 -16
- package/src/lib/api.ts +2 -1
- package/src/lib/app.css +12 -4
- package/src/lib/cart-manager.ts +1 -0
- package/src/lib/fake-api.ts +1 -1
- package/src/lib/index.ts +2 -1
package/dist/booking-widget.js
CHANGED
|
@@ -2959,7 +2959,7 @@ var Ai = "morii-checkout-cart", ji = "morii-checkout-cart-items", Mi = class {
|
|
|
2959
2959
|
issuedAt: "",
|
|
2960
2960
|
idleExpiresAt: "",
|
|
2961
2961
|
absoluteExpiresAt: t.absoluteExpiresAt
|
|
2962
|
-
};
|
|
2962
|
+
}, this.api.cartToken = t.cartToken;
|
|
2963
2963
|
} catch {}
|
|
2964
2964
|
}
|
|
2965
2965
|
};
|
|
@@ -2967,44 +2967,138 @@ var Ai = "morii-checkout-cart", ji = "morii-checkout-cart-items", Mi = class {
|
|
|
2967
2967
|
//#region node_modules/svelte/src/internal/disclose-version.js
|
|
2968
2968
|
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
2969
2969
|
//#endregion
|
|
2970
|
+
//#region src/lib/config.ts
|
|
2971
|
+
var Ri = [
|
|
2972
|
+
{
|
|
2973
|
+
title: "Option",
|
|
2974
|
+
widgets: ["option", "age-category"]
|
|
2975
|
+
},
|
|
2976
|
+
{
|
|
2977
|
+
title: "Schedule",
|
|
2978
|
+
widgets: ["date", "time"]
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
title: "Pickup",
|
|
2982
|
+
widgets: ["pickup"]
|
|
2983
|
+
}
|
|
2984
|
+
], zi = {
|
|
2985
|
+
"option-first": Ri,
|
|
2986
|
+
"date-first": [
|
|
2987
|
+
{
|
|
2988
|
+
title: "Age & capacity",
|
|
2989
|
+
widgets: ["age-category"]
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
title: "Schedule",
|
|
2993
|
+
widgets: ["date", "time"]
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
title: "Option",
|
|
2997
|
+
widgets: ["option"]
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
title: "Pickup",
|
|
3001
|
+
widgets: ["pickup"]
|
|
3002
|
+
}
|
|
3003
|
+
]
|
|
3004
|
+
};
|
|
3005
|
+
function Bi(e) {
|
|
3006
|
+
if (!e) return Ri;
|
|
3007
|
+
if (e in zi) return zi[e];
|
|
3008
|
+
try {
|
|
3009
|
+
let t = JSON.parse(e);
|
|
3010
|
+
if (Array.isArray(t) && t.length > 0 && t[0].widgets) return t;
|
|
3011
|
+
} catch {}
|
|
3012
|
+
return Ri;
|
|
3013
|
+
}
|
|
3014
|
+
var Vi = {
|
|
3015
|
+
"option-first": [
|
|
3016
|
+
{
|
|
3017
|
+
title: "Option",
|
|
3018
|
+
widgets: ["option"]
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
title: "Age, Date & Time",
|
|
3022
|
+
widgets: [
|
|
3023
|
+
"age-category",
|
|
3024
|
+
"date",
|
|
3025
|
+
"time"
|
|
3026
|
+
]
|
|
3027
|
+
},
|
|
3028
|
+
{
|
|
3029
|
+
title: "Pickup",
|
|
3030
|
+
widgets: ["pickup"]
|
|
3031
|
+
}
|
|
3032
|
+
],
|
|
3033
|
+
"date-first": [
|
|
3034
|
+
{
|
|
3035
|
+
title: "Age, Date & Time",
|
|
3036
|
+
widgets: [
|
|
3037
|
+
"age-category",
|
|
3038
|
+
"date",
|
|
3039
|
+
"time"
|
|
3040
|
+
]
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
title: "Option",
|
|
3044
|
+
widgets: ["option"]
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
title: "Pickup",
|
|
3048
|
+
widgets: ["pickup"]
|
|
3049
|
+
}
|
|
3050
|
+
]
|
|
3051
|
+
};
|
|
3052
|
+
function Hi(e, t) {
|
|
3053
|
+
if (t) {
|
|
3054
|
+
if (t in Vi) return Vi[t];
|
|
3055
|
+
try {
|
|
3056
|
+
let e = JSON.parse(t);
|
|
3057
|
+
if (Array.isArray(e) && e.length > 0 && e[0].widgets) return e;
|
|
3058
|
+
} catch {}
|
|
3059
|
+
}
|
|
3060
|
+
let n = e ? e in zi ? e : null : "option-first";
|
|
3061
|
+
return n ? Vi[n] : Bi(e);
|
|
3062
|
+
}
|
|
3063
|
+
//#endregion
|
|
2970
3064
|
//#region src/lib/messages.ts
|
|
2971
|
-
function
|
|
3065
|
+
function Ui(e) {
|
|
2972
3066
|
window.parent?.postMessage(JSON.stringify(e), "*");
|
|
2973
3067
|
}
|
|
2974
3068
|
//#endregion
|
|
2975
3069
|
//#region src/lib/currency.ts
|
|
2976
|
-
var
|
|
3070
|
+
var Wi = {
|
|
2977
3071
|
ZAR: "R",
|
|
2978
3072
|
USD: "$",
|
|
2979
3073
|
EUR: "€",
|
|
2980
3074
|
GBP: "£"
|
|
2981
3075
|
};
|
|
2982
|
-
function
|
|
3076
|
+
function Gi(e, t, n, r = 0) {
|
|
2983
3077
|
let i = e / 10 ** n;
|
|
2984
|
-
return `${
|
|
3078
|
+
return `${Wi[t] ?? t}\u00A0${i.toFixed(r)}`;
|
|
2985
3079
|
}
|
|
2986
3080
|
//#endregion
|
|
2987
3081
|
//#region src/lib/SelectableCard.svelte
|
|
2988
|
-
var
|
|
2989
|
-
function
|
|
2990
|
-
var n =
|
|
3082
|
+
var Ki = /* @__PURE__ */ J("<div class=\"leading\"><!></div>"), qi = /* @__PURE__ */ J("<div class=\"heading svelte-idp8p9\"> </div>"), Ji = /* @__PURE__ */ J("<div class=\"body svelte-idp8p9\"> </div>"), Yi = /* @__PURE__ */ J("<button><div class=\"layout svelte-idp8p9\"><!> <div class=\"text svelte-idp8p9\"><!> <!> <!></div> <span></span></div></button>");
|
|
3083
|
+
function Xi(e, t) {
|
|
3084
|
+
var n = Yi();
|
|
2991
3085
|
let r;
|
|
2992
3086
|
var i = B(n), a = B(i), o = (e) => {
|
|
2993
|
-
var n =
|
|
3087
|
+
var n = Ki();
|
|
2994
3088
|
Mr(B(n), () => t.leading), j(n), Y(e, n);
|
|
2995
3089
|
};
|
|
2996
3090
|
Z(a, (e) => {
|
|
2997
3091
|
t.leading && e(o);
|
|
2998
3092
|
});
|
|
2999
3093
|
var s = H(a, 2), c = B(s), l = (e) => {
|
|
3000
|
-
var n =
|
|
3094
|
+
var n = qi(), r = B(n, !0);
|
|
3001
3095
|
j(n), U(() => X(r, t.heading)), Y(e, n);
|
|
3002
3096
|
};
|
|
3003
3097
|
Z(c, (e) => {
|
|
3004
3098
|
t.heading && e(l);
|
|
3005
3099
|
});
|
|
3006
3100
|
var u = H(c, 2), d = (e) => {
|
|
3007
|
-
var n =
|
|
3101
|
+
var n = Ji(), r = B(n, !0);
|
|
3008
3102
|
j(n), U(() => X(r, t.body)), Y(e, n);
|
|
3009
3103
|
};
|
|
3010
3104
|
Z(u, (e) => {
|
|
@@ -3028,19 +3122,19 @@ function Gi(e, t) {
|
|
|
3028
3122
|
lr(["click"]);
|
|
3029
3123
|
//#endregion
|
|
3030
3124
|
//#region src/lib/OptionCard.svelte
|
|
3031
|
-
var
|
|
3032
|
-
function
|
|
3125
|
+
var Zi = /* @__PURE__ */ J("<p class=\"pricing svelte-19wqhng\"> </p>");
|
|
3126
|
+
function Qi(e, t) {
|
|
3033
3127
|
N(t, !0);
|
|
3034
3128
|
let n = /* @__PURE__ */ I(() => () => {
|
|
3035
3129
|
let e = [];
|
|
3036
3130
|
for (let n of t.option.units) {
|
|
3037
3131
|
if (!n.pricing || n.pricing.length === 0) continue;
|
|
3038
3132
|
let t = n.pricing[0];
|
|
3039
|
-
e.push(`${n.title ?? n.id} from ${
|
|
3133
|
+
e.push(`${n.title ?? n.id} from ${Gi(t.retail, t.currency, t.currencyPrecision)}`);
|
|
3040
3134
|
}
|
|
3041
3135
|
return e.join(", ");
|
|
3042
3136
|
});
|
|
3043
|
-
|
|
3137
|
+
Xi(e, {
|
|
3044
3138
|
get selected() {
|
|
3045
3139
|
return t.selected;
|
|
3046
3140
|
},
|
|
@@ -3055,7 +3149,7 @@ function qi(e, t) {
|
|
|
3055
3149
|
},
|
|
3056
3150
|
children: (e, t) => {
|
|
3057
3151
|
var r = _r(), i = V(r), a = (e) => {
|
|
3058
|
-
var t =
|
|
3152
|
+
var t = Zi(), r = B(t, !0);
|
|
3059
3153
|
j(t), U((e) => X(r, e), [() => K(n)()]), Y(e, t);
|
|
3060
3154
|
}, o = /* @__PURE__ */ I(() => K(n)());
|
|
3061
3155
|
Z(i, (e) => {
|
|
@@ -3067,13 +3161,13 @@ function qi(e, t) {
|
|
|
3067
3161
|
}
|
|
3068
3162
|
//#endregion
|
|
3069
3163
|
//#region src/lib/UnitCounter.svelte
|
|
3070
|
-
var
|
|
3071
|
-
function
|
|
3164
|
+
var $i = /* @__PURE__ */ J("<span class=\"price svelte-bzhcxd\"> </span>"), ea = /* @__PURE__ */ J("<div class=\"card row svelte-bzhcxd\"><div class=\"info svelte-bzhcxd\"><span class=\"name svelte-bzhcxd\"> </span> <!></div> <div class=\"stepper svelte-bzhcxd\"><button class=\"step-btn svelte-bzhcxd\" aria-label=\"Decrease\">−</button> <span class=\"qty svelte-bzhcxd\"> </span> <button class=\"step-btn svelte-bzhcxd\" aria-label=\"Increase\">+</button></div></div>");
|
|
3165
|
+
function ta(e, t) {
|
|
3072
3166
|
N(t, !0);
|
|
3073
3167
|
let n = /* @__PURE__ */ I(() => () => {
|
|
3074
3168
|
if (!t.unit.pricing || t.unit.pricing.length === 0) return "";
|
|
3075
3169
|
let e = t.unit.pricing[0];
|
|
3076
|
-
return `from ${
|
|
3170
|
+
return `from ${Gi(e.retail, e.currency, e.currencyPrecision)}`;
|
|
3077
3171
|
});
|
|
3078
3172
|
function r() {
|
|
3079
3173
|
t.quantity > 0 && t.onChange(t.quantity - 1);
|
|
@@ -3081,10 +3175,10 @@ function Xi(e, t) {
|
|
|
3081
3175
|
function i() {
|
|
3082
3176
|
t.onChange(t.quantity + 1);
|
|
3083
3177
|
}
|
|
3084
|
-
var a =
|
|
3178
|
+
var a = ea(), o = B(a), s = B(o), c = B(s, !0);
|
|
3085
3179
|
j(s);
|
|
3086
3180
|
var l = H(s, 2), u = (e) => {
|
|
3087
|
-
var t =
|
|
3181
|
+
var t = $i(), r = B(t, !0);
|
|
3088
3182
|
j(t), U((e) => X(r, e), [() => K(n)()]), Y(e, t);
|
|
3089
3183
|
}, d = /* @__PURE__ */ I(() => K(n)());
|
|
3090
3184
|
Z(l, (e) => {
|
|
@@ -3100,8 +3194,8 @@ function Xi(e, t) {
|
|
|
3100
3194
|
lr(["click"]);
|
|
3101
3195
|
//#endregion
|
|
3102
3196
|
//#region src/lib/AvailabilityCalendar.svelte
|
|
3103
|
-
var
|
|
3104
|
-
function
|
|
3197
|
+
var na = /* @__PURE__ */ J("<div class=\"loading-center\"><div class=\"spinner\"></div></div>"), ra = /* @__PURE__ */ J("<span class=\"svelte-10gu2tq\"> </span>"), ia = /* @__PURE__ */ J("<span class=\"cell empty svelte-10gu2tq\"></span>"), aa = /* @__PURE__ */ J("<span class=\"day-price svelte-10gu2tq\"> </span>"), oa = /* @__PURE__ */ J("<button><span class=\"day-num svelte-10gu2tq\"> </span> <!></button>"), sa = /* @__PURE__ */ J("<div class=\"header svelte-10gu2tq\"><button class=\"nav-btn svelte-10gu2tq\" aria-label=\"Previous month\">‹</button> <span class=\"month svelte-10gu2tq\"> </span> <button class=\"nav-btn svelte-10gu2tq\" aria-label=\"Next month\">›</button></div> <div class=\"day-names svelte-10gu2tq\"></div> <div class=\"grid svelte-10gu2tq\"></div>", 1), ca = /* @__PURE__ */ J("<div class=\"calendar svelte-10gu2tq\"><!></div>");
|
|
3198
|
+
function la(e, t) {
|
|
3105
3199
|
N(t, !0);
|
|
3106
3200
|
let n = [
|
|
3107
3201
|
"SU",
|
|
@@ -3134,7 +3228,7 @@ function ia(e, t) {
|
|
|
3134
3228
|
if (!n || !n.available) return "";
|
|
3135
3229
|
if (n.unitPricing && n.unitPricing.length > 0) {
|
|
3136
3230
|
let e = n.unitPricing[0];
|
|
3137
|
-
return
|
|
3231
|
+
return Gi(e.retail, e.currency, e.currencyPrecision);
|
|
3138
3232
|
}
|
|
3139
3233
|
return "";
|
|
3140
3234
|
}
|
|
@@ -3148,30 +3242,30 @@ function ia(e, t) {
|
|
|
3148
3242
|
function f(e) {
|
|
3149
3243
|
c(e) !== "available" || d(e) || t.onDateSelected(e);
|
|
3150
3244
|
}
|
|
3151
|
-
var p =
|
|
3152
|
-
Y(e,
|
|
3245
|
+
var p = ca(), m = B(p), h = (e) => {
|
|
3246
|
+
Y(e, na());
|
|
3153
3247
|
}, g = (e) => {
|
|
3154
|
-
var t =
|
|
3248
|
+
var t = sa(), r = V(t), p = B(r), m = H(p, 2), h = B(m, !0);
|
|
3155
3249
|
j(m);
|
|
3156
3250
|
var g = H(m, 2);
|
|
3157
3251
|
j(r);
|
|
3158
3252
|
var _ = H(r, 2);
|
|
3159
3253
|
$(_, 21, () => n, Q, (e, t) => {
|
|
3160
|
-
var n =
|
|
3254
|
+
var n = ra(), r = B(n, !0);
|
|
3161
3255
|
j(n), U(() => X(r, K(t))), Y(e, n);
|
|
3162
3256
|
}), j(_);
|
|
3163
3257
|
var v = H(_, 2);
|
|
3164
3258
|
$(v, 21, () => K(i)(), Q, (e, t) => {
|
|
3165
3259
|
var n = _r(), r = V(n), i = (e) => {
|
|
3166
|
-
Y(e,
|
|
3260
|
+
Y(e, ia());
|
|
3167
3261
|
}, a = (e) => {
|
|
3168
3262
|
let n = /* @__PURE__ */ I(() => c(K(t))), r = /* @__PURE__ */ I(() => d(K(t))), i = /* @__PURE__ */ I(() => l(K(t)));
|
|
3169
|
-
var a =
|
|
3263
|
+
var a = oa();
|
|
3170
3264
|
let o;
|
|
3171
3265
|
var s = B(a), p = B(s, !0);
|
|
3172
3266
|
j(s);
|
|
3173
3267
|
var m = H(s, 2), h = (e) => {
|
|
3174
|
-
var t =
|
|
3268
|
+
var t = aa(), n = B(t, !0);
|
|
3175
3269
|
j(t), U(() => X(n, K(i))), Y(e, t);
|
|
3176
3270
|
};
|
|
3177
3271
|
Z(m, (e) => {
|
|
@@ -3197,20 +3291,20 @@ function ia(e, t) {
|
|
|
3197
3291
|
lr(["click"]);
|
|
3198
3292
|
//#endregion
|
|
3199
3293
|
//#region src/lib/TimeSlotPicker.svelte
|
|
3200
|
-
var
|
|
3201
|
-
function
|
|
3294
|
+
var ua = /* @__PURE__ */ J("<div class=\"loading-center\"><div class=\"spinner\"></div></div>"), da = /* @__PURE__ */ J("<p class=\"hint svelte-1hu99a4\">All-day availability</p>"), fa = /* @__PURE__ */ J("<div class=\"slots svelte-1hu99a4\"></div>");
|
|
3295
|
+
function pa(e, t) {
|
|
3202
3296
|
N(t, !0);
|
|
3203
3297
|
var n = _r(), r = V(n), i = (e) => {
|
|
3204
|
-
Y(e,
|
|
3298
|
+
Y(e, ua());
|
|
3205
3299
|
}, a = (e) => {
|
|
3206
|
-
Y(e,
|
|
3300
|
+
Y(e, da());
|
|
3207
3301
|
}, o = (e) => {
|
|
3208
|
-
var n =
|
|
3302
|
+
var n = fa();
|
|
3209
3303
|
$(n, 21, () => t.timeSlots, Q, (e, n) => {
|
|
3210
3304
|
let r = /* @__PURE__ */ I(() => pi(K(n).localDateTimeStart));
|
|
3211
3305
|
{
|
|
3212
3306
|
let i = /* @__PURE__ */ I(() => t.selectedTime === K(r)), a = /* @__PURE__ */ I(() => K(n).vacancies == null ? void 0 : `${K(n).vacancies} left`);
|
|
3213
|
-
|
|
3307
|
+
Xi(e, {
|
|
3214
3308
|
get selected() {
|
|
3215
3309
|
return K(i);
|
|
3216
3310
|
},
|
|
@@ -3231,8 +3325,8 @@ function ca(e, t) {
|
|
|
3231
3325
|
}
|
|
3232
3326
|
//#endregion
|
|
3233
3327
|
//#region src/lib/WizardPage.svelte
|
|
3234
|
-
var
|
|
3235
|
-
function
|
|
3328
|
+
var ma = /* @__PURE__ */ J("<div class=\"wizard-header svelte-9w5z1v\"><h2 class=\"svelte-9w5z1v\">Buy Tickets</h2></div>"), ha = /* @__PURE__ */ J("<span></span>"), ga = /* @__PURE__ */ J("<div class=\"page-dots svelte-9w5z1v\"></div>"), _a = /* @__PURE__ */ J("<div class=\"page-title-row svelte-9w5z1v\"><h3 class=\"page-title svelte-9w5z1v\"> </h3> <!></div>"), va = /* @__PURE__ */ J("<span> </span>"), ya = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><div class=\"option-list svelte-9w5z1v\"></div></div>"), ba = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><div class=\"unit-list svelte-9w5z1v\"></div></div>"), xa = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><!></div>"), Sa = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><div class=\"pickup-list svelte-9w5z1v\"></div></div>"), Ca = /* @__PURE__ */ J("<!> <!> <!> <!> <!>", 1), wa = /* @__PURE__ */ J("<div class=\"accordion-body svelte-9w5z1v\"></div>"), Ta = /* @__PURE__ */ J("<div><button class=\"accordion-header svelte-9w5z1v\"><div class=\"accordion-header-text svelte-9w5z1v\"><span class=\"accordion-title svelte-9w5z1v\"> </span> <!></div> <span></span></button> <!></div>"), Ea = /* @__PURE__ */ J("<div class=\"wizard-body svelte-9w5z1v\"></div> <div class=\"action-bar\"><button class=\"btn btn-secondary\">Return to Cart</button> <button class=\"btn btn-primary\">Save & Update</button></div>", 1), Da = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><h4 class=\"section-title\">Options</h4> <div class=\"option-list svelte-9w5z1v\"></div></div>"), Oa = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><h4 class=\"section-title\">How many tickets?</h4> <div class=\"unit-list svelte-9w5z1v\"></div></div>"), ka = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><h4 class=\"section-title\">Choose a date</h4> <!></div>"), Aa = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><h4 class=\"section-title\">Select a time</h4> <!></div>"), ja = /* @__PURE__ */ J("<div class=\"section svelte-9w5z1v\"><h4 class=\"section-title\">Select pickup point</h4> <div class=\"pickup-list svelte-9w5z1v\"></div></div>"), Ma = /* @__PURE__ */ J("<button class=\"btn btn-secondary\"> </button>"), Na = /* @__PURE__ */ J("<div class=\"wizard-body svelte-9w5z1v\"></div> <div class=\"action-bar\"><!> <button class=\"btn btn-primary\"> <span class=\"arrow\">→</span></button></div>", 1), Pa = /* @__PURE__ */ J("<div class=\"dialog-backdrop svelte-9w5z1v\"><div class=\"dialog svelte-9w5z1v\"><h3 class=\"dialog-title svelte-9w5z1v\">You have unsaved changes</h3> <p class=\"dialog-body svelte-9w5z1v\">Would you like to proceed?</p> <div class=\"dialog-actions svelte-9w5z1v\"><button class=\"dialog-btn-text svelte-9w5z1v\">Discard changes</button> <button class=\"dialog-btn-fill svelte-9w5z1v\">Return to editing</button></div></div></div>"), Fa = /* @__PURE__ */ J("<div class=\"wizard svelte-9w5z1v\"><!> <!> <!></div> <!>", 1);
|
|
3329
|
+
function Ia(e, t) {
|
|
3236
3330
|
N(t, !0);
|
|
3237
3331
|
let n = Xr(t, "editPages", 19, () => t.wizardPages), r = Xr(t, "autoSelectSingleTimeSlot", 3, !1), i = /* @__PURE__ */ I(() => t.editItem != null), a = /* @__PURE__ */ I(() => t.editItem && !K(re)() ? t.editItem.optionId : void 0), o = /* @__PURE__ */ R(0), s = /* @__PURE__ */ R(null), c = /* @__PURE__ */ R(Kt({})), l = /* @__PURE__ */ R(null), u = /* @__PURE__ */ R(null), d = /* @__PURE__ */ R(null), f = /* @__PURE__ */ R(null), p = /* @__PURE__ */ R(Kt({})), m = /* @__PURE__ */ R(Kt([])), h = /* @__PURE__ */ R(!1), g = /* @__PURE__ */ R(!1), _ = /* @__PURE__ */ R(!1), v = /* @__PURE__ */ R(!1), y = /* @__PURE__ */ R(0), b = /* @__PURE__ */ R(Kt(/* @__PURE__ */ new Set()));
|
|
3238
3332
|
function x(...e) {
|
|
@@ -3445,19 +3539,19 @@ function ja(e, t) {
|
|
|
3445
3539
|
currencyPrecision: a
|
|
3446
3540
|
});
|
|
3447
3541
|
}
|
|
3448
|
-
var k =
|
|
3449
|
-
Y(e,
|
|
3542
|
+
var k = Fa(), Oe = V(k), A = B(Oe), ke = (e) => {
|
|
3543
|
+
Y(e, ma());
|
|
3450
3544
|
};
|
|
3451
3545
|
Z(A, (e) => {
|
|
3452
3546
|
K(i) || e(ke);
|
|
3453
3547
|
});
|
|
3454
3548
|
var Ae = H(A, 2), Me = (e) => {
|
|
3455
|
-
var t =
|
|
3549
|
+
var t = _a(), n = B(t), r = B(n, !0);
|
|
3456
3550
|
j(n);
|
|
3457
3551
|
var i = H(n, 2), a = (e) => {
|
|
3458
|
-
var t =
|
|
3552
|
+
var t = ga();
|
|
3459
3553
|
$(t, 21, () => K(ce)(), Q, (e, t, n) => {
|
|
3460
|
-
var r =
|
|
3554
|
+
var r = ha();
|
|
3461
3555
|
let i;
|
|
3462
3556
|
U(() => i = Fr(r, 1, "dot svelte-9w5z1v", null, i, { active: n === K(o) })), Y(e, r);
|
|
3463
3557
|
}), j(t), Y(e, t);
|
|
@@ -3470,15 +3564,15 @@ function ja(e, t) {
|
|
|
3470
3564
|
K(i) || e(Me);
|
|
3471
3565
|
});
|
|
3472
3566
|
var Ne = H(Ae, 2), Pe = (e) => {
|
|
3473
|
-
var n =
|
|
3567
|
+
var n = Ea(), r = V(n);
|
|
3474
3568
|
$(r, 21, () => K(he)(), Q, (e, n, r) => {
|
|
3475
3569
|
let i = /* @__PURE__ */ I(() => K(n).widgets.some((e) => K(b).has(e)));
|
|
3476
|
-
var o =
|
|
3570
|
+
var o = Ta();
|
|
3477
3571
|
let d;
|
|
3478
3572
|
var _ = B(o), v = B(_), x = B(v), S = B(x, !0);
|
|
3479
3573
|
j(x);
|
|
3480
3574
|
var ee = H(x, 2), w = (e) => {
|
|
3481
|
-
var t =
|
|
3575
|
+
var t = va();
|
|
3482
3576
|
let r;
|
|
3483
3577
|
var a = B(t, !0);
|
|
3484
3578
|
j(t), U((e) => {
|
|
@@ -3492,14 +3586,14 @@ function ja(e, t) {
|
|
|
3492
3586
|
let re;
|
|
3493
3587
|
j(_);
|
|
3494
3588
|
var ie = H(_, 2), ae = (e) => {
|
|
3495
|
-
var r =
|
|
3589
|
+
var r = wa();
|
|
3496
3590
|
$(r, 21, () => K(n).widgets, Q, (e, n) => {
|
|
3497
|
-
var r =
|
|
3498
|
-
var n =
|
|
3591
|
+
var r = Ca(), i = V(r), o = (e) => {
|
|
3592
|
+
var n = ya(), r = B(n);
|
|
3499
3593
|
$(r, 21, () => t.product.options, Q, (e, t) => {
|
|
3500
3594
|
{
|
|
3501
3595
|
let n = /* @__PURE__ */ I(() => K(s)?.id === K(t).id);
|
|
3502
|
-
|
|
3596
|
+
Qi(e, {
|
|
3503
3597
|
get option() {
|
|
3504
3598
|
return K(t);
|
|
3505
3599
|
},
|
|
@@ -3515,11 +3609,11 @@ function ja(e, t) {
|
|
|
3515
3609
|
K(n) === "option" && !K(a) && e(o);
|
|
3516
3610
|
});
|
|
3517
3611
|
var d = H(i, 2), _ = (e) => {
|
|
3518
|
-
var t =
|
|
3612
|
+
var t = ba(), n = B(t);
|
|
3519
3613
|
$(n, 21, () => K(T)(), Q, (e, t) => {
|
|
3520
3614
|
{
|
|
3521
3615
|
let n = /* @__PURE__ */ I(() => K(c)[K(t).id] ?? 0);
|
|
3522
|
-
|
|
3616
|
+
ta(e, {
|
|
3523
3617
|
get unit() {
|
|
3524
3618
|
return K(t);
|
|
3525
3619
|
},
|
|
@@ -3535,8 +3629,8 @@ function ja(e, t) {
|
|
|
3535
3629
|
K(v) && e(_);
|
|
3536
3630
|
});
|
|
3537
3631
|
var y = H(d, 2), b = (e) => {
|
|
3538
|
-
var t =
|
|
3539
|
-
|
|
3632
|
+
var t = xa();
|
|
3633
|
+
la(B(t), {
|
|
3540
3634
|
get availabilityByDate() {
|
|
3541
3635
|
return K(p);
|
|
3542
3636
|
},
|
|
@@ -3553,8 +3647,8 @@ function ja(e, t) {
|
|
|
3553
3647
|
K(n) === "date" && K(C) && e(b);
|
|
3554
3648
|
});
|
|
3555
3649
|
var x = H(y, 2), S = (e) => {
|
|
3556
|
-
var t =
|
|
3557
|
-
|
|
3650
|
+
var t = xa();
|
|
3651
|
+
pa(B(t), {
|
|
3558
3652
|
get timeSlots() {
|
|
3559
3653
|
return K(m);
|
|
3560
3654
|
},
|
|
@@ -3571,11 +3665,11 @@ function ja(e, t) {
|
|
|
3571
3665
|
K(n) === "time" && K(l) && !K(ne) && e(S);
|
|
3572
3666
|
});
|
|
3573
3667
|
var ee = H(x, 2), w = (e) => {
|
|
3574
|
-
var t =
|
|
3668
|
+
var t = Sa(), n = B(t);
|
|
3575
3669
|
$(n, 21, () => K(s).pickupLocations, Q, (e, t) => {
|
|
3576
3670
|
{
|
|
3577
3671
|
let n = /* @__PURE__ */ I(() => K(f)?.id === K(t).id), r = /* @__PURE__ */ I(() => K(t).title ?? K(t).id);
|
|
3578
|
-
|
|
3672
|
+
Xi(e, {
|
|
3579
3673
|
get selected() {
|
|
3580
3674
|
return K(n);
|
|
3581
3675
|
},
|
|
@@ -3609,14 +3703,14 @@ function ja(e, t) {
|
|
|
3609
3703
|
var i = H(r, 2), o = B(i), d = H(o, 2);
|
|
3610
3704
|
j(i), U((e) => d.disabled = e, [() => !K(ge)()]), q("click", o, Te), q("click", d, De), Y(e, n);
|
|
3611
3705
|
}, Fe = (e) => {
|
|
3612
|
-
var n =
|
|
3706
|
+
var n = Na(), r = V(n);
|
|
3613
3707
|
$(r, 21, () => K(ue)()?.widgets ?? [], Q, (e, n) => {
|
|
3614
|
-
var r =
|
|
3615
|
-
var n =
|
|
3708
|
+
var r = Ca(), i = V(r), o = (e) => {
|
|
3709
|
+
var n = Da(), r = H(B(n), 2);
|
|
3616
3710
|
$(r, 21, () => t.product.options, Q, (e, t) => {
|
|
3617
3711
|
{
|
|
3618
3712
|
let n = /* @__PURE__ */ I(() => K(s)?.id === K(t).id);
|
|
3619
|
-
|
|
3713
|
+
Qi(e, {
|
|
3620
3714
|
get option() {
|
|
3621
3715
|
return K(t);
|
|
3622
3716
|
},
|
|
@@ -3632,11 +3726,11 @@ function ja(e, t) {
|
|
|
3632
3726
|
K(n) === "option" && !K(a) && e(o);
|
|
3633
3727
|
});
|
|
3634
3728
|
var d = H(i, 2), _ = (e) => {
|
|
3635
|
-
var t =
|
|
3729
|
+
var t = Oa(), n = H(B(t), 2);
|
|
3636
3730
|
$(n, 21, () => K(T)(), Q, (e, t) => {
|
|
3637
3731
|
{
|
|
3638
3732
|
let n = /* @__PURE__ */ I(() => K(c)[K(t).id] ?? 0);
|
|
3639
|
-
|
|
3733
|
+
ta(e, {
|
|
3640
3734
|
get unit() {
|
|
3641
3735
|
return K(t);
|
|
3642
3736
|
},
|
|
@@ -3652,8 +3746,8 @@ function ja(e, t) {
|
|
|
3652
3746
|
K(v) && e(_);
|
|
3653
3747
|
});
|
|
3654
3748
|
var y = H(d, 2), b = (e) => {
|
|
3655
|
-
var t =
|
|
3656
|
-
|
|
3749
|
+
var t = ka();
|
|
3750
|
+
la(H(B(t), 2), {
|
|
3657
3751
|
get availabilityByDate() {
|
|
3658
3752
|
return K(p);
|
|
3659
3753
|
},
|
|
@@ -3670,8 +3764,8 @@ function ja(e, t) {
|
|
|
3670
3764
|
K(n) === "date" && K(C) && e(b);
|
|
3671
3765
|
});
|
|
3672
3766
|
var x = H(y, 2), S = (e) => {
|
|
3673
|
-
var t =
|
|
3674
|
-
|
|
3767
|
+
var t = Aa();
|
|
3768
|
+
pa(H(B(t), 2), {
|
|
3675
3769
|
get timeSlots() {
|
|
3676
3770
|
return K(m);
|
|
3677
3771
|
},
|
|
@@ -3688,11 +3782,11 @@ function ja(e, t) {
|
|
|
3688
3782
|
K(n) === "time" && K(l) && !K(ne) && e(S);
|
|
3689
3783
|
});
|
|
3690
3784
|
var ee = H(x, 2), w = (e) => {
|
|
3691
|
-
var t =
|
|
3785
|
+
var t = ja(), n = H(B(t), 2);
|
|
3692
3786
|
$(n, 21, () => K(s).pickupLocations, Q, (e, t) => {
|
|
3693
3787
|
{
|
|
3694
3788
|
let n = /* @__PURE__ */ I(() => K(f)?.id === K(t).id), r = /* @__PURE__ */ I(() => K(t).title ?? K(t).id);
|
|
3695
|
-
|
|
3789
|
+
Xi(e, {
|
|
3696
3790
|
get selected() {
|
|
3697
3791
|
return K(n);
|
|
3698
3792
|
},
|
|
@@ -3712,7 +3806,7 @@ function ja(e, t) {
|
|
|
3712
3806
|
}), Y(e, r);
|
|
3713
3807
|
}), j(r);
|
|
3714
3808
|
var i = H(r, 2), d = B(i), _ = (e) => {
|
|
3715
|
-
var t =
|
|
3809
|
+
var t = Ma(), n = B(t, !0);
|
|
3716
3810
|
j(t), U(() => X(n, K(o) > 0 ? "Back" : "Cancel")), q("click", t, we), Y(e, t);
|
|
3717
3811
|
};
|
|
3718
3812
|
Z(d, (e) => {
|
|
@@ -3727,7 +3821,7 @@ function ja(e, t) {
|
|
|
3727
3821
|
K(i) ? e(Pe) : e(Fe, -1);
|
|
3728
3822
|
}), j(Oe);
|
|
3729
3823
|
var Ie = H(Oe, 2), M = (e) => {
|
|
3730
|
-
var t =
|
|
3824
|
+
var t = Pa(), n = B(t), r = H(B(n), 4), i = B(r), a = H(i, 2);
|
|
3731
3825
|
j(r), j(n), j(t), q("click", t, () => {
|
|
3732
3826
|
z(v, !1);
|
|
3733
3827
|
}), q("click", n, (e) => e.stopPropagation()), q("click", i, Ee), q("click", a, () => {
|
|
@@ -3741,16 +3835,16 @@ function ja(e, t) {
|
|
|
3741
3835
|
lr(["click"]);
|
|
3742
3836
|
//#endregion
|
|
3743
3837
|
//#region src/lib/TicketConfigurator.svelte
|
|
3744
|
-
var
|
|
3745
|
-
function
|
|
3838
|
+
var La = /* @__PURE__ */ J("<div class=\"loading-center\" style=\"height:100vh\"><div class=\"spinner\"></div></div>"), Ra = /* @__PURE__ */ J("<div class=\"bw-widget svelte-19qd5my\"><!></div>");
|
|
3839
|
+
function za(e, t) {
|
|
3746
3840
|
N(t, !0);
|
|
3747
|
-
let n = Xr(t, "autoSelectSingleTimeSlot", 3, !1),
|
|
3748
|
-
async function
|
|
3749
|
-
z(
|
|
3841
|
+
let n = Xr(t, "wizardPages", 3, Ri), r = Xr(t, "autoSelectSingleTimeSlot", 3, !1), i = /* @__PURE__ */ R(null), a = /* @__PURE__ */ R(!0), o = /* @__PURE__ */ R(!1);
|
|
3842
|
+
async function s() {
|
|
3843
|
+
z(i, await t.api.getProduct(t.productId), !0), z(a, !1);
|
|
3750
3844
|
}
|
|
3751
|
-
|
|
3752
|
-
async function
|
|
3753
|
-
z(
|
|
3845
|
+
s();
|
|
3846
|
+
async function c(e) {
|
|
3847
|
+
z(o, !0);
|
|
3754
3848
|
try {
|
|
3755
3849
|
await t.cartManager.ensureCart();
|
|
3756
3850
|
let n = hi(e.units), r = await t.api.addCartItem({
|
|
@@ -3763,61 +3857,48 @@ function Na(e, t) {
|
|
|
3763
3857
|
amount: e.totalPrice,
|
|
3764
3858
|
currencyCode: e.currency,
|
|
3765
3859
|
currencyPrecision: e.currencyPrecision
|
|
3766
|
-
}), i =
|
|
3767
|
-
|
|
3860
|
+
}), i = Gi(e.totalPrice, e.currency, e.currencyPrecision, 2);
|
|
3861
|
+
Ui({
|
|
3768
3862
|
type: "cart:change",
|
|
3769
3863
|
itemCount: n.length,
|
|
3770
3864
|
cartItemId: r.id,
|
|
3771
3865
|
totalFormatted: i,
|
|
3772
3866
|
openCheckout: !0
|
|
3773
|
-
});
|
|
3867
|
+
}), Ui({ type: "cart:updated" });
|
|
3774
3868
|
} finally {
|
|
3775
|
-
z(
|
|
3869
|
+
z(o, !1);
|
|
3776
3870
|
}
|
|
3777
3871
|
}
|
|
3778
|
-
var
|
|
3779
|
-
Y(e,
|
|
3780
|
-
},
|
|
3781
|
-
|
|
3872
|
+
var l = Ra(), u = B(l), d = (e) => {
|
|
3873
|
+
Y(e, La());
|
|
3874
|
+
}, f = (e) => {
|
|
3875
|
+
Ia(e, {
|
|
3782
3876
|
get product() {
|
|
3783
|
-
return K(
|
|
3877
|
+
return K(i);
|
|
3784
3878
|
},
|
|
3785
3879
|
get api() {
|
|
3786
3880
|
return t.api;
|
|
3787
3881
|
},
|
|
3788
3882
|
get wizardPages() {
|
|
3789
|
-
return
|
|
3883
|
+
return n();
|
|
3790
3884
|
},
|
|
3791
3885
|
get autoSelectSingleTimeSlot() {
|
|
3792
|
-
return
|
|
3886
|
+
return r();
|
|
3793
3887
|
},
|
|
3794
3888
|
get onCancel() {
|
|
3795
3889
|
return t.onCancel;
|
|
3796
3890
|
},
|
|
3797
|
-
onComplete:
|
|
3891
|
+
onComplete: c
|
|
3798
3892
|
});
|
|
3799
3893
|
};
|
|
3800
|
-
Z(
|
|
3801
|
-
K(
|
|
3802
|
-
}), Y(e,
|
|
3894
|
+
Z(u, (e) => {
|
|
3895
|
+
K(a) || K(o) ? e(d) : K(i) && e(f, 1);
|
|
3896
|
+
}), j(l), Y(e, l), P();
|
|
3803
3897
|
}
|
|
3804
3898
|
//#endregion
|
|
3805
|
-
//#region src/lib/
|
|
3806
|
-
var
|
|
3807
|
-
|
|
3808
|
-
title: "Option",
|
|
3809
|
-
widgets: ["option", "age-category"]
|
|
3810
|
-
},
|
|
3811
|
-
{
|
|
3812
|
-
title: "Schedule",
|
|
3813
|
-
widgets: ["date", "time"]
|
|
3814
|
-
},
|
|
3815
|
-
{
|
|
3816
|
-
title: "Pickup",
|
|
3817
|
-
widgets: ["pickup"]
|
|
3818
|
-
}
|
|
3819
|
-
], Fa = /* @__PURE__ */ J("<div class=\"form svelte-12xyhj1\"><div class=\"field svelte-12xyhj1\"><label for=\"firstName\" class=\"svelte-12xyhj1\">First name *</label> <input id=\"firstName\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"lastName\" class=\"svelte-12xyhj1\">Last name</label> <input id=\"lastName\" class=\"input\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"email\" class=\"svelte-12xyhj1\">Email address *</label> <input id=\"email\" type=\"email\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"phone\" class=\"svelte-12xyhj1\">Phone number *</label> <input id=\"phone\" type=\"tel\"/></div></div>");
|
|
3820
|
-
function Ia(e, t) {
|
|
3899
|
+
//#region src/lib/ContactForm.svelte
|
|
3900
|
+
var Ba = /* @__PURE__ */ J("<div class=\"form svelte-12xyhj1\"><div class=\"field svelte-12xyhj1\"><label for=\"firstName\" class=\"svelte-12xyhj1\">First name *</label> <input id=\"firstName\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"lastName\" class=\"svelte-12xyhj1\">Last name</label> <input id=\"lastName\" class=\"input\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"email\" class=\"svelte-12xyhj1\">Email address *</label> <input id=\"email\" type=\"email\"/></div> <div class=\"field svelte-12xyhj1\"><label for=\"phone\" class=\"svelte-12xyhj1\">Phone number *</label> <input id=\"phone\" type=\"tel\"/></div></div>");
|
|
3901
|
+
function Va(e, t) {
|
|
3821
3902
|
N(t, !0);
|
|
3822
3903
|
let n = /* @__PURE__ */ R(""), r = /* @__PURE__ */ R(""), i = /* @__PURE__ */ R(""), a = /* @__PURE__ */ R("");
|
|
3823
3904
|
function o() {
|
|
@@ -3837,7 +3918,7 @@ function Ia(e, t) {
|
|
|
3837
3918
|
var l = {
|
|
3838
3919
|
isValid: o,
|
|
3839
3920
|
getContact: s
|
|
3840
|
-
}, u =
|
|
3921
|
+
}, u = Ba(), d = B(u), f = H(B(d), 2);
|
|
3841
3922
|
zr(f);
|
|
3842
3923
|
let p;
|
|
3843
3924
|
j(d);
|
|
@@ -3860,10 +3941,10 @@ function Ia(e, t) {
|
|
|
3860
3941
|
}
|
|
3861
3942
|
//#endregion
|
|
3862
3943
|
//#region src/lib/ConsentSection.svelte
|
|
3863
|
-
var
|
|
3864
|
-
function
|
|
3944
|
+
var Ha = /* @__PURE__ */ J("<div class=\"consent svelte-19pmjwi\"><label><input type=\"checkbox\" class=\"svelte-19pmjwi\"/> <span class=\"svelte-19pmjwi\">I accept the privacy policy *</span></label> <label class=\"check svelte-19pmjwi\"><input type=\"checkbox\" class=\"svelte-19pmjwi\"/> <span>I would like to receive marketing communications</span></label></div>");
|
|
3945
|
+
function Ua(e, t) {
|
|
3865
3946
|
N(t, !0);
|
|
3866
|
-
var n =
|
|
3947
|
+
var n = Ha(), r = B(n);
|
|
3867
3948
|
let i;
|
|
3868
3949
|
var a = B(r);
|
|
3869
3950
|
zr(a), je(2), j(r);
|
|
@@ -3875,8 +3956,8 @@ function Ra(e, t) {
|
|
|
3875
3956
|
lr(["change"]);
|
|
3876
3957
|
//#endregion
|
|
3877
3958
|
//#region src/lib/CountdownTimer.svelte
|
|
3878
|
-
var
|
|
3879
|
-
function
|
|
3959
|
+
var Wa = /* @__PURE__ */ J("<span class=\"timer svelte-1u82ue3\"> </span>");
|
|
3960
|
+
function Ga(e, t) {
|
|
3880
3961
|
N(t, !0);
|
|
3881
3962
|
let n = /* @__PURE__ */ R("");
|
|
3882
3963
|
function r() {
|
|
@@ -3886,13 +3967,13 @@ function Ba(e, t) {
|
|
|
3886
3967
|
r();
|
|
3887
3968
|
let i = setInterval(r, 1e3);
|
|
3888
3969
|
Qr(() => clearInterval(i));
|
|
3889
|
-
var a =
|
|
3970
|
+
var a = Wa(), o = B(a, !0);
|
|
3890
3971
|
j(a), U(() => X(o, K(n))), Y(e, a), P();
|
|
3891
3972
|
}
|
|
3892
3973
|
//#endregion
|
|
3893
3974
|
//#region src/lib/PaymentPage.svelte
|
|
3894
|
-
var
|
|
3895
|
-
function
|
|
3975
|
+
var Ka = /* @__PURE__ */ J("<div class=\"error-state svelte-1ubcp68\"><div class=\"error-icon svelte-1ubcp68\">!</div> <p class=\"error-title svelte-1ubcp68\">Unable to load payment form</p> <p class=\"error-msg svelte-1ubcp68\"> </p></div>"), qa = /* @__PURE__ */ J("<div class=\"brands svelte-1ubcp68\"><span class=\"brand svelte-1ubcp68\">VISA</span> <span class=\"brand svelte-1ubcp68\">MC</span> <span class=\"brand svelte-1ubcp68\">AMEX</span></div> <div id=\"peach-container\"></div>", 1), Ja = /* @__PURE__ */ J("<div class=\"payment-page svelte-1ubcp68\"><div class=\"page-header\"><button class=\"icon-btn\" aria-label=\"Back\">←</button> <h2>Payment</h2> <span class=\"spacer\"></span> <button class=\"icon-btn\" aria-label=\"Close\">×</button></div> <div class=\"body svelte-1ubcp68\"><div class=\"amount-bar svelte-1ubcp68\"><span>Amount to pay</span> <span class=\"amount svelte-1ubcp68\"> </span></div> <!></div></div>");
|
|
3976
|
+
function Ya(e, t) {
|
|
3896
3977
|
N(t, !0);
|
|
3897
3978
|
let n = /* @__PURE__ */ R(!1), r = /* @__PURE__ */ R(""), i = null;
|
|
3898
3979
|
Zr(() => {
|
|
@@ -3931,15 +4012,15 @@ function Wa(e, t) {
|
|
|
3931
4012
|
i &&= (i.unmount(), null);
|
|
3932
4013
|
}
|
|
3933
4014
|
Qr(a);
|
|
3934
|
-
var o =
|
|
4015
|
+
var o = Ja(), s = B(o), c = B(s), l = H(c, 6);
|
|
3935
4016
|
j(s);
|
|
3936
4017
|
var u = H(s, 2), d = B(u), f = H(B(d), 2), p = B(f, !0);
|
|
3937
4018
|
j(f), j(d);
|
|
3938
4019
|
var m = H(d, 2), h = (e) => {
|
|
3939
|
-
var t =
|
|
4020
|
+
var t = Ka(), n = H(B(t), 4), i = B(n, !0);
|
|
3940
4021
|
j(n), j(t), U(() => X(i, K(r) || "The checkout session may have expired.")), Y(e, t);
|
|
3941
4022
|
}, g = (e) => {
|
|
3942
|
-
var t =
|
|
4023
|
+
var t = qa();
|
|
3943
4024
|
je(2), Y(e, t);
|
|
3944
4025
|
};
|
|
3945
4026
|
Z(m, (e) => {
|
|
@@ -3953,15 +4034,15 @@ function Wa(e, t) {
|
|
|
3953
4034
|
lr(["click"]);
|
|
3954
4035
|
//#endregion
|
|
3955
4036
|
//#region src/lib/ResultView.svelte
|
|
3956
|
-
var
|
|
3957
|
-
function
|
|
4037
|
+
var Xa = /* @__PURE__ */ J("<div class=\"spinner\"></div> <p class=\"hint svelte-16gfovn\">Verifying payment...</p>", 1), Za = /* @__PURE__ */ J("<button class=\"btn btn-primary\">Done</button>"), Qa = /* @__PURE__ */ J("<button class=\"btn btn-outline\">Try Again</button>"), $a = /* @__PURE__ */ J("<div> </div> <h2 class=\"svelte-16gfovn\"> </h2> <p class=\"desc svelte-16gfovn\"> </p> <!>", 1), eo = /* @__PURE__ */ J("<div class=\"result svelte-16gfovn\"><!></div>");
|
|
4038
|
+
function to(e, t) {
|
|
3958
4039
|
N(t, !0);
|
|
3959
4040
|
let n = /* @__PURE__ */ I(() => t.status?.outcome === "successful");
|
|
3960
|
-
var r =
|
|
3961
|
-
var t =
|
|
4041
|
+
var r = eo(), i = B(r), a = (e) => {
|
|
4042
|
+
var t = Xa();
|
|
3962
4043
|
je(2), Y(e, t);
|
|
3963
4044
|
}, o = (e) => {
|
|
3964
|
-
var r =
|
|
4045
|
+
var r = $a(), i = V(r);
|
|
3965
4046
|
let a;
|
|
3966
4047
|
var o = B(i, !0);
|
|
3967
4048
|
j(i);
|
|
@@ -3970,12 +4051,12 @@ function Xa(e, t) {
|
|
|
3970
4051
|
var l = H(s, 2), u = B(l, !0);
|
|
3971
4052
|
j(l);
|
|
3972
4053
|
var d = H(l, 2), f = (e) => {
|
|
3973
|
-
var n =
|
|
4054
|
+
var n = Za();
|
|
3974
4055
|
q("click", n, function(...e) {
|
|
3975
4056
|
t.onDone?.apply(this, e);
|
|
3976
4057
|
}), Y(e, n);
|
|
3977
4058
|
}, p = (e) => {
|
|
3978
|
-
var n =
|
|
4059
|
+
var n = Qa();
|
|
3979
4060
|
q("click", n, function(...e) {
|
|
3980
4061
|
t.onRetry?.apply(this, e);
|
|
3981
4062
|
}), Y(e, n);
|
|
@@ -3996,8 +4077,8 @@ function Xa(e, t) {
|
|
|
3996
4077
|
lr(["click"]);
|
|
3997
4078
|
//#endregion
|
|
3998
4079
|
//#region src/lib/EditBookingView.svelte
|
|
3999
|
-
var
|
|
4000
|
-
function
|
|
4080
|
+
var no = /* @__PURE__ */ J("<div class=\"loading-center\"><div class=\"spinner\"></div></div>"), ro = /* @__PURE__ */ J("<div class=\"edit-view svelte-15l4305\"><div class=\"page-header\"><button class=\"icon-btn\" aria-label=\"Back\">←</button> <h2>Edit Item</h2> <span class=\"spacer\"></span> <button class=\"icon-btn\" aria-label=\"Close\">×</button></div> <!></div>");
|
|
4081
|
+
function io(e, t) {
|
|
4001
4082
|
N(t, !0);
|
|
4002
4083
|
let n = Xr(t, "autoSelectSingleTimeSlot", 3, !1), r = /* @__PURE__ */ R(!1);
|
|
4003
4084
|
async function i(e) {
|
|
@@ -4018,14 +4099,14 @@ function $a(e, t) {
|
|
|
4018
4099
|
z(r, !1);
|
|
4019
4100
|
}
|
|
4020
4101
|
}
|
|
4021
|
-
var a =
|
|
4102
|
+
var a = ro(), o = B(a), s = B(o), c = H(s, 6);
|
|
4022
4103
|
j(o);
|
|
4023
4104
|
var l = H(o, 2), u = (e) => {
|
|
4024
|
-
Y(e,
|
|
4105
|
+
Y(e, no());
|
|
4025
4106
|
}, d = (e) => {
|
|
4026
4107
|
{
|
|
4027
|
-
let r = /* @__PURE__ */ I(() => t.wizardPages ??
|
|
4028
|
-
|
|
4108
|
+
let r = /* @__PURE__ */ I(() => t.wizardPages ?? Ri), a = /* @__PURE__ */ I(() => t.editPages ?? t.wizardPages ?? Ri);
|
|
4109
|
+
Ia(e, {
|
|
4029
4110
|
get product() {
|
|
4030
4111
|
return t.product;
|
|
4031
4112
|
},
|
|
@@ -4062,8 +4143,8 @@ function $a(e, t) {
|
|
|
4062
4143
|
lr(["click"]);
|
|
4063
4144
|
//#endregion
|
|
4064
4145
|
//#region src/lib/CheckoutModal.svelte
|
|
4065
|
-
var
|
|
4066
|
-
function
|
|
4146
|
+
var ao = /* @__PURE__ */ J("<div class=\"loading-center\" style=\"height:100%\"><div class=\"spinner\"></div></div>"), oo = /* @__PURE__ */ J("<div class=\"page-header\"><button class=\"icon-btn\" aria-label=\"Back\">←</button> <h2>Checkout</h2> <span class=\"spacer\"></span> <button class=\"icon-btn\" aria-label=\"Close\">×</button></div> <div class=\"body svelte-i0rtg0\"><div class=\"contact-header svelte-i0rtg0\"><span class=\"contact-title svelte-i0rtg0\">Contact Details</span> <span class=\"required-hint svelte-i0rtg0\">* Required Fields</span></div> <!> <div style=\"margin-top:24px\"><!></div></div> <div class=\"pay-bar svelte-i0rtg0\"><span class=\"pay-bar-total svelte-i0rtg0\"> </span> <button class=\"pay-bar-btn svelte-i0rtg0\">Pay Now <span class=\"arrow svelte-i0rtg0\">→</span></button></div>", 1), so = /* @__PURE__ */ J("<p class=\"cart-detail svelte-i0rtg0\"> </p>"), co = /* @__PURE__ */ J("<div class=\"cart-unit-line svelte-i0rtg0\"><span class=\"cart-unit-label svelte-i0rtg0\"> </span> <span class=\"cart-unit-price svelte-i0rtg0\"> </span></div>"), lo = /* @__PURE__ */ J("<div class=\"cart-card svelte-i0rtg0\"><div class=\"cart-card-top svelte-i0rtg0\"><h3 class=\"cart-product svelte-i0rtg0\"> </h3> <span class=\"cart-item-total svelte-i0rtg0\"> </span></div> <div class=\"cart-detail-lines svelte-i0rtg0\"><!> <p class=\"cart-detail svelte-i0rtg0\"> </p></div> <div class=\"cart-divider svelte-i0rtg0\"></div> <div class=\"cart-units svelte-i0rtg0\"></div> <div class=\"cart-actions svelte-i0rtg0\"><button class=\"action-edit svelte-i0rtg0\">Edit</button> <button class=\"action-remove svelte-i0rtg0\">Remove</button></div></div>"), uo = /* @__PURE__ */ J("<div class=\"page-header\"><h2>Your cart</h2> <span class=\"spacer\"></span> <!> <button class=\"keep-shopping-btn svelte-i0rtg0\">+ Keep shopping</button></div> <div class=\"body svelte-i0rtg0\"><!> <div class=\"cart-total-divider svelte-i0rtg0\"></div> <div class=\"cart-total-row svelte-i0rtg0\"><span>Total payable today</span> <span class=\"cart-total-amount svelte-i0rtg0\"> </span></div></div> <div class=\"action-bar\"><button class=\"btn btn-primary\">Checkout <span class=\"arrow\">→</span></button></div>", 1), fo = /* @__PURE__ */ J("<div class=\"modal svelte-i0rtg0\"><!></div>");
|
|
4147
|
+
function po(e, t) {
|
|
4067
4148
|
N(t, !0);
|
|
4068
4149
|
let n = Xr(t, "cart", 7), r = Xr(t, "autoSelectSingleTimeSlot", 3, !1), i = /* @__PURE__ */ R("cart"), a = /* @__PURE__ */ R(null), o = /* @__PURE__ */ R(null), s = /* @__PURE__ */ R(null), c = /* @__PURE__ */ R(!1), l = /* @__PURE__ */ R(!0), u = /* @__PURE__ */ R(!1), d = /* @__PURE__ */ R(!1), f = /* @__PURE__ */ R(!1), p = /* @__PURE__ */ R(!1), m = /* @__PURE__ */ R(null), h = /* @__PURE__ */ R(Kt(/* @__PURE__ */ new Map()));
|
|
4069
4150
|
async function g() {
|
|
@@ -4072,7 +4153,7 @@ function so(e, t) {
|
|
|
4072
4153
|
z(h, i, !0), z(l, !1);
|
|
4073
4154
|
}
|
|
4074
4155
|
g();
|
|
4075
|
-
let _ = /* @__PURE__ */ I(() => () => n().items.reduce((e, t) => e + t.amount, 0)), v = /* @__PURE__ */ I(() => () => n().items[0]?.currencyCode ?? "ZAR"), y = /* @__PURE__ */ I(() => () =>
|
|
4156
|
+
let _ = /* @__PURE__ */ I(() => () => n().items.reduce((e, t) => e + t.amount, 0)), v = /* @__PURE__ */ I(() => () => n().items[0]?.currencyCode ?? "ZAR"), y = /* @__PURE__ */ I(() => () => Gi(K(_)(), K(v)(), 2, 2)), b = /* @__PURE__ */ I(() => () => new Date(n().absoluteExpiresAt));
|
|
4076
4157
|
function x(e) {
|
|
4077
4158
|
return K(h).get(e.productId)?.title ?? e.productId;
|
|
4078
4159
|
}
|
|
@@ -4112,9 +4193,9 @@ function so(e, t) {
|
|
|
4112
4193
|
"Dec"
|
|
4113
4194
|
][n.getMonth()]} ${n.getFullYear()}`;
|
|
4114
4195
|
}
|
|
4115
|
-
Qr(() =>
|
|
4196
|
+
Qr(() => Ui({ type: "modal:close" }));
|
|
4116
4197
|
function w() {
|
|
4117
|
-
|
|
4198
|
+
Ui({ type: "modal:close" }), t.onClose();
|
|
4118
4199
|
}
|
|
4119
4200
|
function te() {
|
|
4120
4201
|
w();
|
|
@@ -4124,14 +4205,17 @@ function so(e, t) {
|
|
|
4124
4205
|
}
|
|
4125
4206
|
async function re() {
|
|
4126
4207
|
let e = await t.api.getCart();
|
|
4127
|
-
n(e), z(i, "cart");
|
|
4208
|
+
n(e), z(i, "cart"), ie();
|
|
4128
4209
|
}
|
|
4129
4210
|
async function T(e) {
|
|
4130
4211
|
await t.api.removeCartItem(e.id);
|
|
4131
4212
|
let r = await t.api.getCart();
|
|
4132
|
-
n(r), n().items.length === 0 && w();
|
|
4213
|
+
n(r), ie(), n().items.length === 0 && w();
|
|
4133
4214
|
}
|
|
4134
|
-
|
|
4215
|
+
function ie() {
|
|
4216
|
+
Ui({ type: "cart:updated" });
|
|
4217
|
+
}
|
|
4218
|
+
async function ae() {
|
|
4135
4219
|
if (z(p, !0), !K(m)?.isValid() || !K(d)) return;
|
|
4136
4220
|
let e = K(m).getContact();
|
|
4137
4221
|
z(l, !0);
|
|
@@ -4141,7 +4225,7 @@ function so(e, t) {
|
|
|
4141
4225
|
z(l, !1);
|
|
4142
4226
|
}
|
|
4143
4227
|
}
|
|
4144
|
-
async function
|
|
4228
|
+
async function oe(e) {
|
|
4145
4229
|
if (e.status === "cancelled") {
|
|
4146
4230
|
z(i, "contact");
|
|
4147
4231
|
return;
|
|
@@ -4154,17 +4238,17 @@ function so(e, t) {
|
|
|
4154
4238
|
try {
|
|
4155
4239
|
z(s, await t.api.confirmCart(), !0);
|
|
4156
4240
|
let e = K(s).items.every((e) => e.statusCode >= 200 && e.statusCode < 300);
|
|
4157
|
-
z(c, !e), z(u, !1), e && (
|
|
4241
|
+
z(c, !e), z(u, !1), e && (Ui({ type: "modal:close" }), t.onOrderConfirmed());
|
|
4158
4242
|
} catch {
|
|
4159
4243
|
z(c, !0), z(u, !1);
|
|
4160
4244
|
}
|
|
4161
4245
|
}
|
|
4162
|
-
var
|
|
4163
|
-
Y(e,
|
|
4164
|
-
},
|
|
4246
|
+
var E = fo(), D = B(E), se = (e) => {
|
|
4247
|
+
Y(e, ao());
|
|
4248
|
+
}, ce = (e) => {
|
|
4165
4249
|
{
|
|
4166
4250
|
let t = /* @__PURE__ */ I(() => K(y)());
|
|
4167
|
-
|
|
4251
|
+
Ya(e, {
|
|
4168
4252
|
get checkoutId() {
|
|
4169
4253
|
return K(o).checkoutId;
|
|
4170
4254
|
},
|
|
@@ -4175,16 +4259,16 @@ function so(e, t) {
|
|
|
4175
4259
|
z(i, "contact");
|
|
4176
4260
|
},
|
|
4177
4261
|
onClose: w,
|
|
4178
|
-
onPaymentComplete:
|
|
4262
|
+
onPaymentComplete: oe
|
|
4179
4263
|
});
|
|
4180
4264
|
}
|
|
4181
|
-
},
|
|
4265
|
+
}, le = (e) => {
|
|
4182
4266
|
{
|
|
4183
4267
|
let n = /* @__PURE__ */ I(() => K(u) ? null : K(c) ? {
|
|
4184
4268
|
outcome: "failed",
|
|
4185
4269
|
resultDescription: "Something went wrong confirming your order. Please try again."
|
|
4186
4270
|
} : { outcome: "successful" });
|
|
4187
|
-
|
|
4271
|
+
to(e, {
|
|
4188
4272
|
get status() {
|
|
4189
4273
|
return K(n);
|
|
4190
4274
|
},
|
|
@@ -4192,17 +4276,17 @@ function so(e, t) {
|
|
|
4192
4276
|
return K(u);
|
|
4193
4277
|
},
|
|
4194
4278
|
onDone: () => {
|
|
4195
|
-
|
|
4279
|
+
Ui({ type: "modal:close" }), t.onOrderConfirmed();
|
|
4196
4280
|
},
|
|
4197
4281
|
onRetry: () => {
|
|
4198
4282
|
z(i, "payment");
|
|
4199
4283
|
}
|
|
4200
4284
|
});
|
|
4201
4285
|
}
|
|
4202
|
-
},
|
|
4286
|
+
}, ue = (e) => {
|
|
4203
4287
|
{
|
|
4204
4288
|
let n = /* @__PURE__ */ I(() => K(h).get(K(a).productId));
|
|
4205
|
-
|
|
4289
|
+
io(e, {
|
|
4206
4290
|
get cartItem() {
|
|
4207
4291
|
return K(a);
|
|
4208
4292
|
},
|
|
@@ -4228,15 +4312,15 @@ function so(e, t) {
|
|
|
4228
4312
|
onUpdated: re
|
|
4229
4313
|
});
|
|
4230
4314
|
}
|
|
4231
|
-
},
|
|
4232
|
-
var t =
|
|
4315
|
+
}, de = /* @__PURE__ */ I(() => K(i) === "edit" && K(a) && K(h).get(K(a).productId)), fe = (e) => {
|
|
4316
|
+
var t = oo(), n = V(t), r = B(n), a = H(r, 6);
|
|
4233
4317
|
j(n);
|
|
4234
4318
|
var o = H(n, 2), s = H(B(o), 2);
|
|
4235
|
-
Yr(
|
|
4319
|
+
Yr(Va(s, { get hasAttemptedSubmit() {
|
|
4236
4320
|
return K(p);
|
|
4237
4321
|
} }), (e) => z(m, e, !0), () => K(m));
|
|
4238
4322
|
var c = H(s, 2);
|
|
4239
|
-
|
|
4323
|
+
Ua(B(c), {
|
|
4240
4324
|
get privacyAccepted() {
|
|
4241
4325
|
return K(d);
|
|
4242
4326
|
},
|
|
@@ -4258,12 +4342,12 @@ function so(e, t) {
|
|
|
4258
4342
|
var g = H(u, 2);
|
|
4259
4343
|
j(l), U((e) => X(h, e), [() => K(y)()]), q("click", r, () => {
|
|
4260
4344
|
z(i, "cart");
|
|
4261
|
-
}), q("click", a, w), q("click", g,
|
|
4262
|
-
},
|
|
4263
|
-
var t =
|
|
4345
|
+
}), q("click", a, w), q("click", g, ae), Y(e, t);
|
|
4346
|
+
}, pe = (e) => {
|
|
4347
|
+
var t = uo(), r = V(t), a = H(B(r), 4);
|
|
4264
4348
|
{
|
|
4265
4349
|
let e = /* @__PURE__ */ I(() => K(b)());
|
|
4266
|
-
|
|
4350
|
+
Ga(a, { get expiresAt() {
|
|
4267
4351
|
return K(e);
|
|
4268
4352
|
} });
|
|
4269
4353
|
}
|
|
@@ -4271,12 +4355,12 @@ function so(e, t) {
|
|
|
4271
4355
|
j(r);
|
|
4272
4356
|
var s = H(r, 2), c = B(s);
|
|
4273
4357
|
$(c, 17, () => n().items, Q, (e, t) => {
|
|
4274
|
-
var n =
|
|
4358
|
+
var n = lo(), r = B(n), i = B(r), a = B(i, !0);
|
|
4275
4359
|
j(i);
|
|
4276
4360
|
var o = H(i, 2), s = B(o, !0);
|
|
4277
4361
|
j(o), j(r);
|
|
4278
4362
|
var c = H(r, 2), l = B(c), u = (e) => {
|
|
4279
|
-
var n =
|
|
4363
|
+
var n = so(), r = B(n, !0);
|
|
4280
4364
|
j(n), U((e) => X(r, e), [() => ee(K(t))]), Y(e, n);
|
|
4281
4365
|
}, d = /* @__PURE__ */ I(() => ee(K(t)));
|
|
4282
4366
|
Z(l, (e) => {
|
|
@@ -4286,19 +4370,19 @@ function so(e, t) {
|
|
|
4286
4370
|
j(f), j(c);
|
|
4287
4371
|
var m = H(c, 4);
|
|
4288
4372
|
$(m, 21, () => C(K(t)), Q, (e, n) => {
|
|
4289
|
-
var r =
|
|
4373
|
+
var r = co(), i = B(r), a = B(i);
|
|
4290
4374
|
j(i);
|
|
4291
4375
|
var o = H(i, 2), s = B(o, !0);
|
|
4292
4376
|
j(o), j(r), U((e) => {
|
|
4293
4377
|
X(a, `${K(n).title ?? ""} × ${K(n).quantity ?? ""}`), X(s, e);
|
|
4294
|
-
}, [() =>
|
|
4378
|
+
}, [() => Gi(K(n).linePrice, K(t).currencyCode, 2, 0)]), Y(e, r);
|
|
4295
4379
|
}), j(m);
|
|
4296
4380
|
var h = H(m, 2), g = B(h), _ = H(g, 2);
|
|
4297
4381
|
j(h), j(n), U((e, t, n) => {
|
|
4298
4382
|
X(a, e), X(s, t), X(p, n);
|
|
4299
4383
|
}, [
|
|
4300
4384
|
() => x(K(t)),
|
|
4301
|
-
() =>
|
|
4385
|
+
() => Gi(K(t).amount, K(t).currencyCode, 2, 0),
|
|
4302
4386
|
() => S(K(t))
|
|
4303
4387
|
]), q("click", g, () => ne(K(t))), q("click", _, () => T(K(t))), Y(e, n);
|
|
4304
4388
|
});
|
|
@@ -4309,17 +4393,17 @@ function so(e, t) {
|
|
|
4309
4393
|
z(i, "contact");
|
|
4310
4394
|
}), Y(e, t);
|
|
4311
4395
|
};
|
|
4312
|
-
Z(
|
|
4313
|
-
K(l) ? e(
|
|
4314
|
-
}), j(
|
|
4396
|
+
Z(D, (e) => {
|
|
4397
|
+
K(l) ? e(se) : K(i) === "payment" && K(o) ? e(ce, 1) : K(i) === "result" ? e(le, 2) : K(de) ? e(ue, 3) : K(i) === "contact" ? e(fe, 4) : e(pe, -1);
|
|
4398
|
+
}), j(E), Y(e, E), P();
|
|
4315
4399
|
}
|
|
4316
4400
|
lr(["click"]);
|
|
4317
4401
|
//#endregion
|
|
4318
4402
|
//#region src/lib/Checkout.svelte
|
|
4319
|
-
var
|
|
4320
|
-
function
|
|
4403
|
+
var mo = /* @__PURE__ */ J("<div class=\"loading-center\" style=\"height:100vh\"><div class=\"spinner\"></div></div>"), ho = /* @__PURE__ */ J("<div class=\"loading-center\" style=\"height:100vh;color:var(--bw-color-text-secondary)\">No items in cart.</div>"), go = /* @__PURE__ */ J("<div class=\"bw-widget svelte-5e515v\"><!></div>");
|
|
4404
|
+
function _o(e, t) {
|
|
4321
4405
|
N(t, !0);
|
|
4322
|
-
let n = Xr(t, "wizardPages", 3,
|
|
4406
|
+
let n = Xr(t, "wizardPages", 3, Ri), r = Xr(t, "autoSelectSingleTimeSlot", 3, !1), i = /* @__PURE__ */ I(() => t.editPages ?? n()), a = /* @__PURE__ */ R(null), o = /* @__PURE__ */ R(!0);
|
|
4323
4407
|
async function s() {
|
|
4324
4408
|
try {
|
|
4325
4409
|
z(a, await t.api.getCart(), !0);
|
|
@@ -4329,10 +4413,10 @@ function uo(e, t) {
|
|
|
4329
4413
|
z(o, !1);
|
|
4330
4414
|
}
|
|
4331
4415
|
s();
|
|
4332
|
-
var c =
|
|
4333
|
-
Y(e,
|
|
4416
|
+
var c = go(), l = B(c), u = (e) => {
|
|
4417
|
+
Y(e, mo());
|
|
4334
4418
|
}, d = (e) => {
|
|
4335
|
-
|
|
4419
|
+
po(e, {
|
|
4336
4420
|
get cart() {
|
|
4337
4421
|
return K(a);
|
|
4338
4422
|
},
|
|
@@ -4348,10 +4432,10 @@ function uo(e, t) {
|
|
|
4348
4432
|
get autoSelectSingleTimeSlot() {
|
|
4349
4433
|
return r();
|
|
4350
4434
|
},
|
|
4351
|
-
onClose: () =>
|
|
4435
|
+
onClose: () => Ui({ type: "modal:close" }),
|
|
4352
4436
|
onOrderConfirmed: () => {
|
|
4353
4437
|
let e = K(a).items.reduce((e, t) => e + t.amount, 0), t = K(a).items[0]?.currencyCode ?? "ZAR";
|
|
4354
|
-
|
|
4438
|
+
Ui({
|
|
4355
4439
|
type: "order:complete",
|
|
4356
4440
|
cartToken: K(a).cartToken,
|
|
4357
4441
|
value: e,
|
|
@@ -4360,27 +4444,27 @@ function uo(e, t) {
|
|
|
4360
4444
|
}
|
|
4361
4445
|
});
|
|
4362
4446
|
}, f = (e) => {
|
|
4363
|
-
Y(e,
|
|
4447
|
+
Y(e, ho());
|
|
4364
4448
|
};
|
|
4365
4449
|
Z(l, (e) => {
|
|
4366
4450
|
K(o) ? e(u) : K(a) && K(a).items.length > 0 ? e(d, 1) : e(f, -1);
|
|
4367
|
-
}), Y(e, c), P();
|
|
4451
|
+
}), j(c), Y(e, c), P();
|
|
4368
4452
|
}
|
|
4369
4453
|
//#endregion
|
|
4370
4454
|
//#region src/lib/CartBarView.svelte
|
|
4371
|
-
var
|
|
4372
|
-
function
|
|
4455
|
+
var vo = /* @__PURE__ */ J("<div class=\"cart-bar bw-widget svelte-1xt0fxx\"><div class=\"cart-info svelte-1xt0fxx\"><span class=\"item-count svelte-1xt0fxx\"> <!></span> <span class=\"total svelte-1xt0fxx\"> </span></div> <button class=\"btn btn-primary\">Checkout →</button></div>");
|
|
4456
|
+
function yo(e, t) {
|
|
4373
4457
|
N(t, !0);
|
|
4374
4458
|
let n = /* @__PURE__ */ I(() => t.cart?.items.length ?? 0), r = /* @__PURE__ */ I(() => () => {
|
|
4375
4459
|
if (!t.cart || t.cart.items.length === 0) return "";
|
|
4376
4460
|
let e = t.cart.items[0].currencyCode;
|
|
4377
|
-
return
|
|
4461
|
+
return Gi(t.cart.items.reduce((e, t) => e + t.amount, 0), e, 2, 2);
|
|
4378
4462
|
}), i = /* @__PURE__ */ I(() => () => t.cart ? new Date(t.cart.absoluteExpiresAt) : /* @__PURE__ */ new Date());
|
|
4379
4463
|
var a = _r(), o = V(a), s = (e) => {
|
|
4380
|
-
var t =
|
|
4464
|
+
var t = vo(), a = B(t), o = B(a), s = B(o), c = H(s);
|
|
4381
4465
|
{
|
|
4382
4466
|
let e = /* @__PURE__ */ I(() => K(i)());
|
|
4383
|
-
|
|
4467
|
+
Ga(c, { get expiresAt() {
|
|
4384
4468
|
return K(e);
|
|
4385
4469
|
} });
|
|
4386
4470
|
}
|
|
@@ -4390,7 +4474,7 @@ function po(e, t) {
|
|
|
4390
4474
|
var d = H(a, 2);
|
|
4391
4475
|
j(t), U((e) => {
|
|
4392
4476
|
X(s, `${K(n) === 1 ? "1 item" : `${K(n)} items`} `), X(u, e);
|
|
4393
|
-
}, [() => K(r)()]), q("click", d, () =>
|
|
4477
|
+
}, [() => K(r)()]), q("click", d, () => Ui({ type: "modal:open" })), Y(e, t);
|
|
4394
4478
|
};
|
|
4395
4479
|
Z(o, (e) => {
|
|
4396
4480
|
t.cart && t.cart.items.length > 0 && e(s);
|
|
@@ -4399,7 +4483,7 @@ function po(e, t) {
|
|
|
4399
4483
|
lr(["click"]);
|
|
4400
4484
|
//#endregion
|
|
4401
4485
|
//#region src/lib/CartBar.svelte
|
|
4402
|
-
function
|
|
4486
|
+
function bo(e, t) {
|
|
4403
4487
|
N(t, !0);
|
|
4404
4488
|
let n = /* @__PURE__ */ R(null), r = /* @__PURE__ */ R(!0);
|
|
4405
4489
|
async function i() {
|
|
@@ -4411,19 +4495,29 @@ function mo(e, t) {
|
|
|
4411
4495
|
z(r, !1);
|
|
4412
4496
|
}
|
|
4413
4497
|
i();
|
|
4414
|
-
|
|
4415
|
-
|
|
4498
|
+
function a(e) {
|
|
4499
|
+
let t;
|
|
4500
|
+
try {
|
|
4501
|
+
t = typeof e.data == "string" ? JSON.parse(e.data) : e.data;
|
|
4502
|
+
} catch {
|
|
4503
|
+
return;
|
|
4504
|
+
}
|
|
4505
|
+
t?.type === "cart:updated" && i();
|
|
4506
|
+
}
|
|
4507
|
+
dn(() => (window.addEventListener("message", a), () => window.removeEventListener("message", a)));
|
|
4508
|
+
var o = _r(), s = V(o), c = (e) => {
|
|
4509
|
+
yo(e, { get cart() {
|
|
4416
4510
|
return K(n);
|
|
4417
4511
|
} });
|
|
4418
4512
|
};
|
|
4419
|
-
Z(
|
|
4420
|
-
K(r) || e(
|
|
4421
|
-
}), Y(e,
|
|
4513
|
+
Z(s, (e) => {
|
|
4514
|
+
K(r) || e(c);
|
|
4515
|
+
}), Y(e, o), P();
|
|
4422
4516
|
}
|
|
4423
4517
|
//#endregion
|
|
4424
4518
|
//#region src/lib/CartOverviewButton.svelte
|
|
4425
|
-
var
|
|
4426
|
-
function
|
|
4519
|
+
var xo = /* @__PURE__ */ J("<button class=\"cart-overview-btn bw-widget svelte-16bjfem\"><svg class=\"cart-icon svelte-16bjfem\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"9\" cy=\"21\" r=\"1\"></circle><circle cx=\"20\" cy=\"21\" r=\"1\"></circle><path d=\"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6\"></path></svg> <span class=\"cart-badge svelte-16bjfem\"> </span> <span class=\"cart-total svelte-16bjfem\"> </span> <span class=\"cart-sep svelte-16bjfem\"></span> <span class=\"cart-timer svelte-16bjfem\"> </span></button>");
|
|
4520
|
+
function So(e, t) {
|
|
4427
4521
|
N(t, !0);
|
|
4428
4522
|
let n = /* @__PURE__ */ R(null), r = /* @__PURE__ */ R("");
|
|
4429
4523
|
async function i() {
|
|
@@ -4434,7 +4528,17 @@ function go(e, t) {
|
|
|
4434
4528
|
}
|
|
4435
4529
|
}
|
|
4436
4530
|
i();
|
|
4437
|
-
function a() {
|
|
4531
|
+
function a(e) {
|
|
4532
|
+
let t;
|
|
4533
|
+
try {
|
|
4534
|
+
t = typeof e.data == "string" ? JSON.parse(e.data) : e.data;
|
|
4535
|
+
} catch {
|
|
4536
|
+
return;
|
|
4537
|
+
}
|
|
4538
|
+
t?.type === "cart:updated" && i();
|
|
4539
|
+
}
|
|
4540
|
+
dn(() => (window.addEventListener("message", a), () => window.removeEventListener("message", a)));
|
|
4541
|
+
function o() {
|
|
4438
4542
|
if (!K(n)) {
|
|
4439
4543
|
z(r, "0:00");
|
|
4440
4544
|
return;
|
|
@@ -4442,34 +4546,34 @@ function go(e, t) {
|
|
|
4442
4546
|
let e = Math.max(0, new Date(K(n).absoluteExpiresAt).getTime() - Date.now()), t = Math.floor(e / 6e4), i = Math.floor(e % 6e4 / 1e3);
|
|
4443
4547
|
z(r, `${t}:${String(i).padStart(2, "0")}`);
|
|
4444
4548
|
}
|
|
4445
|
-
|
|
4446
|
-
let
|
|
4447
|
-
Qr(() => clearInterval(
|
|
4448
|
-
let
|
|
4549
|
+
o();
|
|
4550
|
+
let s = setInterval(o, 1e3);
|
|
4551
|
+
Qr(() => clearInterval(s));
|
|
4552
|
+
let c = /* @__PURE__ */ I(() => K(n)?.items.length ?? 0), l = /* @__PURE__ */ I(() => () => {
|
|
4449
4553
|
if (!K(n) || K(n).items.length === 0) return "";
|
|
4450
4554
|
let e = K(n).items[0].currencyCode;
|
|
4451
|
-
return
|
|
4555
|
+
return Gi(K(n).items.reduce((e, t) => e + t.amount, 0), e, 2, 0);
|
|
4452
4556
|
});
|
|
4453
|
-
var
|
|
4454
|
-
var t =
|
|
4557
|
+
var u = _r(), d = V(u), f = (e) => {
|
|
4558
|
+
var t = xo(), n = H(B(t), 2), i = B(n, !0);
|
|
4455
4559
|
j(n);
|
|
4456
4560
|
var a = H(n, 2), o = B(a, !0);
|
|
4457
4561
|
j(a);
|
|
4458
|
-
var
|
|
4459
|
-
j(
|
|
4460
|
-
X(i, K(
|
|
4461
|
-
}, [() => K(
|
|
4562
|
+
var s = H(a, 4), u = B(s, !0);
|
|
4563
|
+
j(s), j(t), U((e) => {
|
|
4564
|
+
X(i, K(c)), X(o, e), X(u, K(r));
|
|
4565
|
+
}, [() => K(l)()]), q("click", t, () => Ui({ type: "modal:open" })), Y(e, t);
|
|
4462
4566
|
};
|
|
4463
|
-
Z(
|
|
4464
|
-
K(n) && K(n).items.length > 0 && e(
|
|
4465
|
-
}), Y(e,
|
|
4567
|
+
Z(d, (e) => {
|
|
4568
|
+
K(n) && K(n).items.length > 0 && e(f);
|
|
4569
|
+
}), Y(e, u), P();
|
|
4466
4570
|
}
|
|
4467
4571
|
lr(["click"]);
|
|
4468
4572
|
//#endregion
|
|
4469
4573
|
//#region src/lib/CartOverview.svelte
|
|
4470
|
-
function
|
|
4574
|
+
function Co(e, t) {
|
|
4471
4575
|
var n = _r(), r = V(n), i = (e) => {
|
|
4472
|
-
|
|
4576
|
+
So(e, {
|
|
4473
4577
|
get api() {
|
|
4474
4578
|
return t.api;
|
|
4475
4579
|
},
|
|
@@ -4478,7 +4582,7 @@ function _o(e, t) {
|
|
|
4478
4582
|
}
|
|
4479
4583
|
});
|
|
4480
4584
|
}, a = (e) => {
|
|
4481
|
-
|
|
4585
|
+
bo(e, {
|
|
4482
4586
|
get api() {
|
|
4483
4587
|
return t.api;
|
|
4484
4588
|
},
|
|
@@ -4493,7 +4597,7 @@ function _o(e, t) {
|
|
|
4493
4597
|
}
|
|
4494
4598
|
//#endregion
|
|
4495
4599
|
//#region src/lib/index.ts
|
|
4496
|
-
function
|
|
4600
|
+
function wo(e) {
|
|
4497
4601
|
let t = e.useFakeApi ? new Mi() : new gi(e.apiBaseUrl ?? ""), n = new Fi(t), r = new Li(t);
|
|
4498
4602
|
return n.startBackgroundRefresh(), {
|
|
4499
4603
|
api: t,
|
|
@@ -4501,10 +4605,10 @@ function vo(e) {
|
|
|
4501
4605
|
cartManager: r
|
|
4502
4606
|
};
|
|
4503
4607
|
}
|
|
4504
|
-
async function
|
|
4505
|
-
let { api: n, sessionManager: r, cartManager: i } =
|
|
4608
|
+
async function To(e, t) {
|
|
4609
|
+
let { api: n, sessionManager: r, cartManager: i } = wo(t);
|
|
4506
4610
|
await r.ensureSession(t.checkoutKey ?? "");
|
|
4507
|
-
let a = vr(
|
|
4611
|
+
let a = vr(za, {
|
|
4508
4612
|
target: e,
|
|
4509
4613
|
props: {
|
|
4510
4614
|
api: n,
|
|
@@ -4532,10 +4636,10 @@ async function yo(e, t) {
|
|
|
4532
4636
|
window.removeEventListener("message", o), r.stop(), Sr(a);
|
|
4533
4637
|
} };
|
|
4534
4638
|
}
|
|
4535
|
-
async function
|
|
4536
|
-
let { api: n, sessionManager: r } =
|
|
4639
|
+
async function Eo(e, t) {
|
|
4640
|
+
let { api: n, sessionManager: r } = wo(t);
|
|
4537
4641
|
await r.ensureSession(t.checkoutKey ?? "");
|
|
4538
|
-
let i = vr(
|
|
4642
|
+
let i = vr(_o, {
|
|
4539
4643
|
target: e,
|
|
4540
4644
|
props: {
|
|
4541
4645
|
api: n,
|
|
@@ -4561,10 +4665,10 @@ async function bo(e, t) {
|
|
|
4561
4665
|
window.removeEventListener("message", a), r.stop(), Sr(i);
|
|
4562
4666
|
} };
|
|
4563
4667
|
}
|
|
4564
|
-
async function
|
|
4565
|
-
let { api: n, sessionManager: r, cartManager: i } =
|
|
4668
|
+
async function Do(e, t) {
|
|
4669
|
+
let { api: n, sessionManager: r, cartManager: i } = wo(t);
|
|
4566
4670
|
await r.ensureSession(t.checkoutKey ?? "");
|
|
4567
|
-
let a = vr(
|
|
4671
|
+
let a = vr(Co, {
|
|
4568
4672
|
target: e,
|
|
4569
4673
|
props: {
|
|
4570
4674
|
api: n,
|
|
@@ -4586,4 +4690,4 @@ async function xo(e, t) {
|
|
|
4586
4690
|
} };
|
|
4587
4691
|
}
|
|
4588
4692
|
//#endregion
|
|
4589
|
-
export { gi as ApiClient,
|
|
4693
|
+
export { gi as ApiClient, bo as CartBar, Li as CartManager, Co as CartOverview, So as CartOverviewButton, _o as Checkout, Ri as DEFAULT_WIZARD_PAGES, Mi as FakeApiClient, Fi as SessionManager, za as TicketConfigurator, Do as mountCartOverview, Eo as mountCheckout, To as mountConfigurator, Hi as resolveEditPages, Bi as resolveWizardPages };
|