@getmicdrop/venue-calendar 4.0.89 → 4.0.91
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/dist/CartView-gasx8QHt.js +2366 -0
- package/dist/CartView-gasx8QHt.js.map +1 -0
- package/dist/Checkout-Bm5un0yn.js +1763 -0
- package/dist/Checkout-Bm5un0yn.js.map +1 -0
- package/dist/Checkout-DU8QW51B.js +916 -0
- package/dist/Checkout-DU8QW51B.js.map +1 -0
- package/dist/{CheckoutTimer-t_De4Cyb.js → CheckoutTimer-seT9skG1.js} +11 -11
- package/dist/CheckoutTimer-seT9skG1.js.map +1 -0
- package/dist/{CollectionView-CbAdxCbJ.js → CollectionView-Dy1PWTZg.js} +67 -67
- package/dist/CollectionView-Dy1PWTZg.js.map +1 -0
- package/dist/{Event-PxIWk8RL.js → Event-wKLQzQod.js} +1152 -1145
- package/dist/Event-wKLQzQod.js.map +1 -0
- package/dist/EventPage-GprihVCY.js +532 -0
- package/dist/EventPage-GprihVCY.js.map +1 -0
- package/dist/{Heading-RCWgeQcq.js → Heading-C1g2tMwa.js} +2 -2
- package/dist/Heading-C1g2tMwa.js.map +1 -0
- package/dist/{ScarcityBadge-CdI_V1gg.js → ScarcityBadge-BCJIS4dt.js} +15 -15
- package/dist/ScarcityBadge-BCJIS4dt.js.map +1 -0
- package/dist/{SeriesPage-7jC1lxOp.js → SeriesPage-DBtQarUf.js} +5 -5
- package/dist/{SeriesPage-7jC1lxOp.js.map → SeriesPage-DBtQarUf.js.map} +1 -1
- package/dist/{Spinner-BEOure61.js → Spinner-Cg931di6.js} +6 -6
- package/dist/{Spinner-BEOure61.js.map → Spinner-Cg931di6.js.map} +1 -1
- package/dist/{Success-CnyCxUxf.js → Success-B-X7iUhg.js} +164 -164
- package/dist/Success-B-X7iUhg.js.map +1 -0
- package/dist/{Text-PTp4a7zJ.js → Text-DkbT1W8b.js} +16 -16
- package/dist/Text-DkbT1W8b.js.map +1 -0
- package/dist/{VenueCalendar-CqcmTiwH.js → VenueCalendar-DpXlpxlW.js} +138 -132
- package/dist/VenueCalendar-DpXlpxlW.js.map +1 -0
- package/dist/{ViewTicketsEmbed-D1_biEaQ.js → ViewTicketsEmbed-C53Noeou.js} +474 -474
- package/dist/ViewTicketsEmbed-C53Noeou.js.map +1 -0
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.cjs.map +1 -1
- package/dist/api/api.mjs +41 -38
- package/dist/api/api.mjs.map +1 -1
- package/dist/api/types.d.ts +438 -423
- package/dist/{data-toggle-store.svelte-DG4WuovC.js → data-toggle-store.svelte-LbtOs016.js} +6 -6
- package/dist/{data-toggle-store.svelte-DG4WuovC.js.map → data-toggle-store.svelte-LbtOs016.js.map} +1 -1
- package/dist/{labels-V7Z6TGEH.js → labels-BWRJZD5n.js} +43 -43
- package/dist/{labels-V7Z6TGEH.js.map → labels-BWRJZD5n.js.map} +1 -1
- package/dist/modalManager.svelte-DH07yk5J.js +56 -0
- package/dist/modalManager.svelte-DH07yk5J.js.map +1 -0
- package/dist/seo/types.d.ts +150 -150
- package/dist/{transform-Bz5QJu_t.js → transform-0JpmvWCo.js} +6 -6
- package/dist/{transform-Bz5QJu_t.js.map → transform-0JpmvWCo.js.map} +1 -1
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +2 -2
- package/dist/venue-calendar.iife.js +25 -23
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +24 -22
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +3 -2
- package/dist/CartView-CvtUTe19.js +0 -2366
- package/dist/CartView-CvtUTe19.js.map +0 -1
- package/dist/Checkout-B6Iqvhz5.js +0 -809
- package/dist/Checkout-B6Iqvhz5.js.map +0 -1
- package/dist/Checkout-l7NYcxer.js +0 -1669
- package/dist/Checkout-l7NYcxer.js.map +0 -1
- package/dist/CheckoutTimer-t_De4Cyb.js.map +0 -1
- package/dist/CollectionView-CbAdxCbJ.js.map +0 -1
- package/dist/Event-PxIWk8RL.js.map +0 -1
- package/dist/EventPage-C6m9ICd-.js +0 -529
- package/dist/EventPage-C6m9ICd-.js.map +0 -1
- package/dist/Heading-RCWgeQcq.js.map +0 -1
- package/dist/ModalHeader-B4CtYJNc.js +0 -22
- package/dist/ModalHeader-B4CtYJNc.js.map +0 -1
- package/dist/ScarcityBadge-CdI_V1gg.js.map +0 -1
- package/dist/Success-CnyCxUxf.js.map +0 -1
- package/dist/Text-PTp4a7zJ.js.map +0 -1
- package/dist/VenueCalendar-CqcmTiwH.js.map +0 -1
- package/dist/ViewTicketsEmbed-D1_biEaQ.js.map +0 -1
|
@@ -0,0 +1,916 @@
|
|
|
1
|
+
import "svelte/internal/disclose-version";
|
|
2
|
+
import * as e from "svelte/internal/client";
|
|
3
|
+
import { j as Te, C as ye, m as fe, s as me, D as pe, G as Fe, r as De, n as ze, o as Oe, W as Ne, M as Re, a as je, b as Me, c as Ge, t as Le, q as qe, d as Be, u as Ue, w as Ve, x as We, y as Ke, z as He, A as Je, E as Ye, F as he, H as _e, I as Xe, J as Ze, K as Qe } from "./VenueCalendar-DpXlpxlW.js";
|
|
4
|
+
import { onMount as $e } from "svelte";
|
|
5
|
+
import { g as et, C as tt, a as rt } from "./Checkout-Bm5un0yn.js";
|
|
6
|
+
var at = e.from_svg('<svg aria-hidden="true" fill="none" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M8 2.25v3M16 2.25v3M3.75 9.75h16.5M5.25 4.5h13.5a1.5 1.5 0 011.5 1.5v13.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5V6a1.5 1.5 0 011.5-1.5z"></path></svg>');
|
|
7
|
+
function nt(m, t) {
|
|
8
|
+
let l = e.prop(t, "size", 3, "24"), d = e.prop(t, "color", 3, "currentColor"), s = e.prop(t, "class", 3, "");
|
|
9
|
+
var o = at();
|
|
10
|
+
e.template_effect(() => {
|
|
11
|
+
e.set_class(o, 0, e.clsx(s())), e.set_attribute(o, "width", l()), e.set_attribute(o, "height", l()), e.set_attribute(o, "stroke", d());
|
|
12
|
+
}), e.append(m, o);
|
|
13
|
+
}
|
|
14
|
+
function ce(m) {
|
|
15
|
+
"@babel/helpers - typeof";
|
|
16
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ce = function(t) {
|
|
17
|
+
return typeof t;
|
|
18
|
+
} : ce = function(t) {
|
|
19
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
20
|
+
}, ce(m);
|
|
21
|
+
}
|
|
22
|
+
var Pe = "clover", it = function(t) {
|
|
23
|
+
return t === 3 ? "v3" : t;
|
|
24
|
+
}, Ie = "https://js.stripe.com", st = "".concat(Ie, "/").concat(Pe, "/stripe.js"), ot = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, lt = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
|
|
25
|
+
var dt = function(t) {
|
|
26
|
+
return ot.test(t) || lt.test(t);
|
|
27
|
+
}, ct = function() {
|
|
28
|
+
for (var t = document.querySelectorAll('script[src^="'.concat(Ie, '"]')), l = 0; l < t.length; l++) {
|
|
29
|
+
var d = t[l];
|
|
30
|
+
if (dt(d.src))
|
|
31
|
+
return d;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}, be = function(t) {
|
|
35
|
+
var l = "", d = document.createElement("script");
|
|
36
|
+
d.src = "".concat(st).concat(l);
|
|
37
|
+
var s = document.head || document.body;
|
|
38
|
+
if (!s)
|
|
39
|
+
throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
40
|
+
return s.appendChild(d), d;
|
|
41
|
+
}, ut = function(t, l) {
|
|
42
|
+
!t || !t._registerWrapper || t._registerWrapper({
|
|
43
|
+
name: "stripe-js",
|
|
44
|
+
version: "8.8.0",
|
|
45
|
+
startTime: l
|
|
46
|
+
});
|
|
47
|
+
}, se = null, le = null, de = null, gt = function(t) {
|
|
48
|
+
return function(l) {
|
|
49
|
+
t(new Error("Failed to load Stripe.js", {
|
|
50
|
+
cause: l
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
}, ft = function(t, l) {
|
|
54
|
+
return function() {
|
|
55
|
+
window.Stripe ? t(window.Stripe) : l(new Error("Stripe.js not available"));
|
|
56
|
+
};
|
|
57
|
+
}, mt = function(t) {
|
|
58
|
+
return se !== null ? se : (se = new Promise(function(l, d) {
|
|
59
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
60
|
+
l(null);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (window.Stripe) {
|
|
64
|
+
l(window.Stripe);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
var s = ct();
|
|
69
|
+
if (!(s && t)) {
|
|
70
|
+
if (!s)
|
|
71
|
+
s = be(t);
|
|
72
|
+
else if (s && de !== null && le !== null) {
|
|
73
|
+
var o;
|
|
74
|
+
s.removeEventListener("load", de), s.removeEventListener("error", le), (o = s.parentNode) === null || o === void 0 || o.removeChild(s), s = be(t);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
de = ft(l, d), le = gt(d), s.addEventListener("load", de), s.addEventListener("error", le);
|
|
78
|
+
} catch (P) {
|
|
79
|
+
d(P);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}), se.catch(function(l) {
|
|
83
|
+
return se = null, Promise.reject(l);
|
|
84
|
+
}));
|
|
85
|
+
}, pt = function(t, l, d) {
|
|
86
|
+
if (t === null)
|
|
87
|
+
return null;
|
|
88
|
+
var s = l[0];
|
|
89
|
+
if (typeof s != "string")
|
|
90
|
+
throw new Error("Expected publishable key to be of type string, got type ".concat(ce(s), " instead."));
|
|
91
|
+
var o = s.match(/^pk_test/), P = it(t.version), c = Pe;
|
|
92
|
+
o && P !== c && console.warn("Stripe.js@".concat(P, " was loaded on the page, but @stripe/stripe-js@").concat("8.8.0", " expected Stripe.js@").concat(c, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
93
|
+
var b = t.apply(void 0, l);
|
|
94
|
+
return ut(b, d), b;
|
|
95
|
+
}, oe, Se = !1, ke = function() {
|
|
96
|
+
return oe || (oe = mt(null).catch(function(t) {
|
|
97
|
+
return oe = null, Promise.reject(t);
|
|
98
|
+
}), oe);
|
|
99
|
+
};
|
|
100
|
+
Promise.resolve().then(function() {
|
|
101
|
+
return ke();
|
|
102
|
+
}).catch(function(m) {
|
|
103
|
+
Se || console.warn(m);
|
|
104
|
+
});
|
|
105
|
+
var vt = function() {
|
|
106
|
+
for (var t = arguments.length, l = new Array(t), d = 0; d < t; d++)
|
|
107
|
+
l[d] = arguments[d];
|
|
108
|
+
Se = !0;
|
|
109
|
+
var s = Date.now();
|
|
110
|
+
return ke().then(function(o) {
|
|
111
|
+
return pt(o, l, s);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
function ae(m) {
|
|
115
|
+
const t = m?.code || m?.decline_code || "", l = m?.type || "", d = m?.message || "";
|
|
116
|
+
if (t === "card_declined" || l === "card_error") {
|
|
117
|
+
const s = m?.decline_code || "";
|
|
118
|
+
return s === "insufficient_funds" ? {
|
|
119
|
+
type: "card_declined",
|
|
120
|
+
title: "Insufficient funds",
|
|
121
|
+
message: "Your card has insufficient funds to complete this purchase.",
|
|
122
|
+
suggestion: "Please try a different payment method or contact your bank.",
|
|
123
|
+
retryable: !0
|
|
124
|
+
} : s === "lost_card" || s === "stolen_card" ? {
|
|
125
|
+
type: "card_declined",
|
|
126
|
+
title: "Card cannot be used",
|
|
127
|
+
message: "This card cannot be used for this transaction.",
|
|
128
|
+
suggestion: "Please use a different payment method.",
|
|
129
|
+
retryable: !0
|
|
130
|
+
} : s === "expired_card" ? {
|
|
131
|
+
type: "card_declined",
|
|
132
|
+
title: "Card expired",
|
|
133
|
+
message: "Your card has expired.",
|
|
134
|
+
suggestion: "Please use a different card or update your card details.",
|
|
135
|
+
retryable: !0
|
|
136
|
+
} : {
|
|
137
|
+
type: "card_declined",
|
|
138
|
+
title: "Card declined",
|
|
139
|
+
message: "Your card was declined by your bank.",
|
|
140
|
+
suggestion: "Please try a different card or contact your bank for more information.",
|
|
141
|
+
retryable: !0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return l === "api_connection_error" || d.includes("network") || d.includes("connection") ? {
|
|
145
|
+
type: "network",
|
|
146
|
+
title: "Connection error",
|
|
147
|
+
message: "We couldn't connect to the payment server.",
|
|
148
|
+
suggestion: "Please check your internet connection and try again.",
|
|
149
|
+
retryable: !0
|
|
150
|
+
} : t === "rate_limit" ? {
|
|
151
|
+
type: "rate_limit",
|
|
152
|
+
title: "Too many attempts",
|
|
153
|
+
message: "Too many payment attempts. Please wait a moment.",
|
|
154
|
+
suggestion: "Wait 30 seconds before trying again.",
|
|
155
|
+
retryable: !0
|
|
156
|
+
} : t === "incorrect_number" || t === "invalid_number" ? {
|
|
157
|
+
type: "validation",
|
|
158
|
+
title: "Invalid card number",
|
|
159
|
+
message: "The card number you entered is invalid.",
|
|
160
|
+
suggestion: "Please check your card number and try again.",
|
|
161
|
+
retryable: !0
|
|
162
|
+
} : t === "incorrect_cvc" || t === "invalid_cvc" ? {
|
|
163
|
+
type: "validation",
|
|
164
|
+
title: "Invalid security code",
|
|
165
|
+
message: "The security code (CVC) is incorrect.",
|
|
166
|
+
suggestion: "Please check the 3-digit code on the back of your card.",
|
|
167
|
+
retryable: !0
|
|
168
|
+
} : t === "invalid_expiry_month" || t === "invalid_expiry_year" ? {
|
|
169
|
+
type: "validation",
|
|
170
|
+
title: "Invalid expiration date",
|
|
171
|
+
message: "The expiration date is invalid.",
|
|
172
|
+
suggestion: "Please check your card's expiration date.",
|
|
173
|
+
retryable: !0
|
|
174
|
+
} : {
|
|
175
|
+
type: "general",
|
|
176
|
+
title: "Payment failed",
|
|
177
|
+
message: d || "Something went wrong with your payment.",
|
|
178
|
+
suggestion: "Please try again or use a different payment method.",
|
|
179
|
+
retryable: !0
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const xe = Te("GiftCardInput");
|
|
183
|
+
var yt = e.from_html('<span class="gc-spinner gc-spinner-sm svelte-emw0hd"></span>'), ht = e.from_html('<div class="applied-card mb-2 svelte-emw0hd"><div class="flex items-center gap-3"><div class="applied-icon svelte-emw0hd"><!></div> <div class="flex flex-col flex-1"><span class="text-xs text-status-success-text font-medium"> </span> <span class="text-sm font-mono text-text-primary"> </span></div> <span class="font-medium text-accent-success"> </span> <button class="remove-btn svelte-emw0hd"><!></button></div></div>'), _t = e.from_html('<div class="full-coverage-badge svelte-emw0hd"><!> <span> </span></div>'), bt = e.from_html('<div class="flex justify-between items-center text-sm mt-1.5"><span class="text-text-secondary"> </span> <span class="font-medium text-text-primary"> </span></div>'), xt = e.from_html('<div class="applied-card mb-3 svelte-emw0hd"><div class="flex justify-between items-center text-sm"><span class="text-text-secondary"> </span> <span class="font-medium text-accent-success"> </span></div> <!></div>'), wt = e.from_html('<span class="gc-spinner svelte-emw0hd"></span>'), Ct = e.from_html('<div class="flex items-center gap-1.5 mt-2 text-sm text-accent-danger"><!> <span> </span></div>'), Tt = e.from_html('<div class="input-section svelte-emw0hd"><div class="flex gap-2"><input type="text" name="giftCardCode" autocomplete="off" autocapitalize="characters"/> <button class="apply-btn svelte-emw0hd"><!></button></div> <!></div>'), Pt = e.from_html('<div class="mb-4"><!> <!> <button class="gift-card-toggle svelte-emw0hd"><!> <span> </span> <span class="toggle-indicator svelte-emw0hd"> </span></button> <!></div>');
|
|
184
|
+
function It(m, t) {
|
|
185
|
+
e.push(t, !0);
|
|
186
|
+
let l = e.prop(t, "onApplied", 3, () => {
|
|
187
|
+
}), d = e.prop(t, "onRemoved", 3, () => {
|
|
188
|
+
}), s = e.prop(t, "disabled", 3, !1), o = e.prop(t, "labels", 19, () => ({})), P = e.state(""), c = e.state(!1), b = e.state(""), C = e.state(e.proxy([])), j = e.state(!1), g = e.state(0), p = e.derived(() => e.get(C).reduce((h, u) => h + (u.giftCardAmount || 0), 0)), I = e.derived(() => Math.max(0, e.get(g) - e.get(p))), $ = e.derived(() => e.get(C).length > 0 && e.get(I) <= 0);
|
|
189
|
+
function B() {
|
|
190
|
+
if (e.get(C).length === 0) {
|
|
191
|
+
d()();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
l()({
|
|
195
|
+
code: e.get(C).map((h) => h.code).join(", "),
|
|
196
|
+
giftCardAmount: e.get(p),
|
|
197
|
+
stripeAmount: e.get(I),
|
|
198
|
+
requiresStripe: e.get(I) > 0,
|
|
199
|
+
paymentType: e.get(I) > 0 ? "split" : "gift_card_only",
|
|
200
|
+
orderTotal: e.get(g)
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async function U() {
|
|
204
|
+
const h = e.get(P).trim().toUpperCase();
|
|
205
|
+
if (!(!h || e.get(c) || !t.cartId)) {
|
|
206
|
+
if (e.get(C).some((u) => u.code === h)) {
|
|
207
|
+
e.set(b, o().giftCardAlreadyApplied || "That gift card is already applied", !0);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
e.set(c, !0), e.set(b, "");
|
|
211
|
+
try {
|
|
212
|
+
const u = await Oe(t.cartId, h);
|
|
213
|
+
u.valid ? (e.set(
|
|
214
|
+
C,
|
|
215
|
+
[
|
|
216
|
+
...e.get(C),
|
|
217
|
+
{
|
|
218
|
+
code: u.giftCardCode || h,
|
|
219
|
+
giftCardAmount: u.giftCardAmount || 0
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
!0
|
|
223
|
+
), e.set(g, e.get(p) + (u.stripeAmount || 0)), e.set(P, ""), e.set(j, !1), B()) : e.set(b, u.error || o().invalidGiftCardCode || "Invalid gift card code", !0);
|
|
224
|
+
} catch (u) {
|
|
225
|
+
xe.error("Error applying gift card:", u), e.set(b, o().failedToApplyGiftCard || "Failed to apply gift card. Please try again.", !0);
|
|
226
|
+
}
|
|
227
|
+
e.set(c, !1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async function ee(h) {
|
|
231
|
+
if (!(e.get(c) || !t.cartId)) {
|
|
232
|
+
e.set(c, !0), e.set(b, "");
|
|
233
|
+
try {
|
|
234
|
+
const u = await De(t.cartId, h);
|
|
235
|
+
u.success !== !1 && !u.error ? (e.set(C, e.get(C).filter((S) => S.code !== h), !0), B()) : e.set(b, u.error || o().failedToRemoveGiftCard || "Failed to remove gift card.", !0);
|
|
236
|
+
} catch (u) {
|
|
237
|
+
xe.error("Error removing gift card:", u), e.set(b, o().failedToRemoveGiftCard || "Failed to remove gift card. Please try again.", !0);
|
|
238
|
+
}
|
|
239
|
+
e.set(c, !1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function F(h) {
|
|
243
|
+
h.key === "Enter" && !e.get(c) && U();
|
|
244
|
+
}
|
|
245
|
+
function M() {
|
|
246
|
+
e.set(j, !e.get(j)), e.get(j) || (e.set(P, ""), e.set(b, ""));
|
|
247
|
+
}
|
|
248
|
+
var O = Pt(), E = e.child(O);
|
|
249
|
+
e.each(E, 17, () => e.get(C), (h) => h.code, (h, u) => {
|
|
250
|
+
var S = ht(), T = e.child(S), W = e.child(T), L = e.child(W);
|
|
251
|
+
ye(L, { size: 16 }), e.reset(W);
|
|
252
|
+
var Y = e.sibling(W, 2), X = e.child(Y), te = e.child(X, !0);
|
|
253
|
+
e.reset(X);
|
|
254
|
+
var Z = e.sibling(X, 2), D = e.child(Z, !0);
|
|
255
|
+
e.reset(Z), e.reset(Y);
|
|
256
|
+
var y = e.sibling(Y, 2), w = e.child(y);
|
|
257
|
+
e.reset(y);
|
|
258
|
+
var k = e.sibling(y, 2), R = e.child(k);
|
|
259
|
+
{
|
|
260
|
+
var re = (K) => {
|
|
261
|
+
var ge = yt();
|
|
262
|
+
e.append(K, ge);
|
|
263
|
+
}, ne = (K) => {
|
|
264
|
+
ze(K, { size: 16 });
|
|
265
|
+
};
|
|
266
|
+
e.if(R, (K) => {
|
|
267
|
+
e.get(c) ? K(re) : K(ne, -1);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
e.reset(k), e.reset(T), e.reset(S), e.template_effect(
|
|
271
|
+
(K) => {
|
|
272
|
+
e.set_text(te, o().giftCardApplied || "Gift card applied"), e.set_text(D, e.get(u).code), e.set_text(w, `-${K ?? ""}`), k.disabled = e.get(c) || s(), e.set_attribute(k, "aria-label", o().removeGiftCard || "Remove gift card");
|
|
273
|
+
},
|
|
274
|
+
[() => fe(e.get(u).giftCardAmount)]
|
|
275
|
+
), e.delegated("click", k, () => ee(e.get(u).code)), e.transition(3, S, () => me, () => ({ duration: pe.fast })), e.append(h, S);
|
|
276
|
+
});
|
|
277
|
+
var v = e.sibling(E, 2);
|
|
278
|
+
{
|
|
279
|
+
var H = (h) => {
|
|
280
|
+
var u = xt(), S = e.child(u), T = e.child(S), W = e.child(T, !0);
|
|
281
|
+
e.reset(T);
|
|
282
|
+
var L = e.sibling(T, 2), Y = e.child(L);
|
|
283
|
+
e.reset(L), e.reset(S);
|
|
284
|
+
var X = e.sibling(S, 2);
|
|
285
|
+
{
|
|
286
|
+
var te = (D) => {
|
|
287
|
+
var y = _t(), w = e.child(y);
|
|
288
|
+
ye(w, { size: 16 });
|
|
289
|
+
var k = e.sibling(w, 2), R = e.child(k, !0);
|
|
290
|
+
e.reset(k), e.reset(y), e.template_effect(() => e.set_text(R, o().fullyCoveredByGiftCard || "Fully covered by gift card")), e.append(D, y);
|
|
291
|
+
}, Z = (D) => {
|
|
292
|
+
var y = bt(), w = e.child(y), k = e.child(w, !0);
|
|
293
|
+
e.reset(w);
|
|
294
|
+
var R = e.sibling(w, 2), re = e.child(R, !0);
|
|
295
|
+
e.reset(R), e.reset(y), e.template_effect(
|
|
296
|
+
(ne) => {
|
|
297
|
+
e.set_text(k, o().remainingToPay || "Remaining to pay"), e.set_text(re, ne);
|
|
298
|
+
},
|
|
299
|
+
[() => fe(e.get(I))]
|
|
300
|
+
), e.append(D, y);
|
|
301
|
+
};
|
|
302
|
+
e.if(X, (D) => {
|
|
303
|
+
e.get($) ? D(te) : D(Z, -1);
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
e.reset(u), e.template_effect(
|
|
307
|
+
(D) => {
|
|
308
|
+
e.set_text(W, o().appliedToOrder || "Applied to order"), e.set_text(Y, `-${D ?? ""}`);
|
|
309
|
+
},
|
|
310
|
+
[() => fe(e.get(p))]
|
|
311
|
+
), e.append(h, u);
|
|
312
|
+
};
|
|
313
|
+
e.if(v, (h) => {
|
|
314
|
+
e.get(C).length > 0 && h(H);
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
var G = e.sibling(v, 2), J = e.child(G);
|
|
318
|
+
Fe(J, { size: 20, class: "gift-icon" });
|
|
319
|
+
var V = e.sibling(J, 2), Q = e.child(V, !0);
|
|
320
|
+
e.reset(V);
|
|
321
|
+
var x = e.sibling(V, 2), N = e.child(x, !0);
|
|
322
|
+
e.reset(x), e.reset(G);
|
|
323
|
+
var z = e.sibling(G, 2);
|
|
324
|
+
{
|
|
325
|
+
var ue = (h) => {
|
|
326
|
+
var u = Tt(), S = e.child(u), T = e.child(S);
|
|
327
|
+
e.remove_input_defaults(T);
|
|
328
|
+
let W;
|
|
329
|
+
var L = e.sibling(T, 2), Y = e.child(L);
|
|
330
|
+
{
|
|
331
|
+
var X = (y) => {
|
|
332
|
+
var w = wt();
|
|
333
|
+
e.append(y, w);
|
|
334
|
+
}, te = (y) => {
|
|
335
|
+
var w = e.text();
|
|
336
|
+
e.template_effect(() => e.set_text(w, o().apply || "Apply")), e.append(y, w);
|
|
337
|
+
};
|
|
338
|
+
e.if(Y, (y) => {
|
|
339
|
+
e.get(c) ? y(X) : y(te, -1);
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
e.reset(L), e.reset(S);
|
|
343
|
+
var Z = e.sibling(S, 2);
|
|
344
|
+
{
|
|
345
|
+
var D = (y) => {
|
|
346
|
+
var w = Ct(), k = e.child(w);
|
|
347
|
+
Ne(k, { size: 16 });
|
|
348
|
+
var R = e.sibling(k, 2), re = e.child(R, !0);
|
|
349
|
+
e.reset(R), e.reset(w), e.template_effect(() => e.set_text(re, e.get(b))), e.transition(3, w, () => me, () => ({ duration: pe.micro })), e.append(y, w);
|
|
350
|
+
};
|
|
351
|
+
e.if(Z, (y) => {
|
|
352
|
+
e.get(b) && y(D);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
e.reset(u), e.template_effect(
|
|
356
|
+
(y) => {
|
|
357
|
+
e.set_attribute(T, "aria-label", o().enterGiftCardCode || "Enter gift card code"), e.set_attribute(T, "placeholder", o().enterGiftCardCode || "Enter gift card code"), T.disabled = e.get(c) || s(), W = e.set_class(T, 1, "gift-input svelte-emw0hd", null, W, { "has-error": !!e.get(b) }), L.disabled = y;
|
|
358
|
+
},
|
|
359
|
+
[() => !e.get(P).trim() || e.get(c) || s()]
|
|
360
|
+
), e.delegated("keydown", T, F), e.bind_value(T, () => e.get(P), (y) => e.set(P, y)), e.delegated("click", L, U), e.transition(3, u, () => me, () => ({ duration: pe.fast })), e.append(h, u);
|
|
361
|
+
};
|
|
362
|
+
e.if(z, (h) => {
|
|
363
|
+
e.get(j) && h(ue);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
e.reset(O), e.template_effect(() => {
|
|
367
|
+
G.disabled = s(), e.set_attribute(G, "aria-expanded", e.get(j)), e.set_text(Q, e.get(C).length > 0 ? o().addAnotherGiftCard || "Add another gift card" : o().haveAGiftCard || "Have a gift card?"), e.set_text(N, e.get(j) ? "-" : "+");
|
|
368
|
+
}), e.delegated("click", G, M), e.append(m, O), e.pop();
|
|
369
|
+
}
|
|
370
|
+
e.delegate(["click", "keydown"]);
|
|
371
|
+
var St = e.from_html('<div class="flex flex-col items-center text-center pt-6 px-4 pb-4"><div aria-hidden="true"><!></div> <h3 id="event-unavailable-title"> </h3> <p id="event-unavailable-body" class="type-body tone-secondary max-w-72"> </p></div>'), we = e.from_html("<!> <!>", 1);
|
|
372
|
+
function kt(m, t) {
|
|
373
|
+
e.push(t, !0);
|
|
374
|
+
let l = e.prop(t, "open", 15, !1), d = e.prop(t, "onBackToEvents", 3, () => {
|
|
375
|
+
}), s = e.prop(t, "labels", 19, () => ({})), o = e.derived(() => t.reason === "canceled"), P = e.derived(() => e.get(o) ? s().eventCanceledTitle || "Event canceled" : s().eventPostponedTitle || "Event postponed"), c = e.derived(() => e.get(o) ? s().eventCanceledBody || "This event was canceled — you weren't charged." : s().eventPostponedBody || "Sales are paused while this show is rescheduled — you weren't charged."), b = e.derived(() => s().backToEvents || "Back to events");
|
|
376
|
+
Re(m, {
|
|
377
|
+
size: "sm",
|
|
378
|
+
role: "alertdialog",
|
|
379
|
+
class: "micdrop",
|
|
380
|
+
get open() {
|
|
381
|
+
return l();
|
|
382
|
+
},
|
|
383
|
+
set open(C) {
|
|
384
|
+
l(C);
|
|
385
|
+
},
|
|
386
|
+
children: (C, j) => {
|
|
387
|
+
var g = we(), p = e.first_child(g);
|
|
388
|
+
je(p, {});
|
|
389
|
+
var I = e.sibling(p, 2);
|
|
390
|
+
Me(I, {
|
|
391
|
+
children: ($, B) => {
|
|
392
|
+
var U = we(), ee = e.first_child(U);
|
|
393
|
+
Ge(ee, {
|
|
394
|
+
children: (M, O) => {
|
|
395
|
+
var E = St(), v = e.child(E), H = e.child(v);
|
|
396
|
+
{
|
|
397
|
+
var G = (z) => {
|
|
398
|
+
qe(z, { size: "32" });
|
|
399
|
+
}, J = (z) => {
|
|
400
|
+
nt(z, { size: "32" });
|
|
401
|
+
};
|
|
402
|
+
e.if(H, (z) => {
|
|
403
|
+
e.get(o) ? z(G) : z(J, -1);
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
e.reset(v);
|
|
407
|
+
var V = e.sibling(v, 2), Q = e.child(V, !0);
|
|
408
|
+
e.reset(V);
|
|
409
|
+
var x = e.sibling(V, 2), N = e.child(x, !0);
|
|
410
|
+
e.reset(x), e.reset(E), e.template_effect(() => {
|
|
411
|
+
e.set_class(v, 1, `w-16 h-16 rounded-full flex items-center justify-center mb-4 ${e.get(o) ? "bg-accent-danger/10 text-accent-danger" : "bg-accent-warning/10 text-accent-warning"}`), e.set_class(V, 1, `mb-2 ${Le.heading}`), e.set_text(Q, e.get(P)), e.set_text(N, e.get(c));
|
|
412
|
+
}), e.append(M, E);
|
|
413
|
+
},
|
|
414
|
+
$$slots: { default: !0 }
|
|
415
|
+
});
|
|
416
|
+
var F = e.sibling(ee, 2);
|
|
417
|
+
Be(F, {
|
|
418
|
+
children: (M, O) => {
|
|
419
|
+
Ue(M, {
|
|
420
|
+
size: "full",
|
|
421
|
+
variant: "default",
|
|
422
|
+
get onclick() {
|
|
423
|
+
return d();
|
|
424
|
+
},
|
|
425
|
+
get "aria-label"() {
|
|
426
|
+
return e.get(b);
|
|
427
|
+
},
|
|
428
|
+
children: (E, v) => {
|
|
429
|
+
e.next();
|
|
430
|
+
var H = e.text();
|
|
431
|
+
e.template_effect(() => e.set_text(H, e.get(b))), e.append(E, H);
|
|
432
|
+
},
|
|
433
|
+
$$slots: { default: !0 }
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
$$slots: { default: !0 }
|
|
437
|
+
}), e.append($, U);
|
|
438
|
+
},
|
|
439
|
+
$$slots: { default: !0 }
|
|
440
|
+
}), e.append(C, g);
|
|
441
|
+
},
|
|
442
|
+
$$slots: { default: !0 }
|
|
443
|
+
}), e.pop();
|
|
444
|
+
}
|
|
445
|
+
const q = Te("Checkout");
|
|
446
|
+
var Et = e.from_html('<div class="max-w-6xl mx-auto px-4 md:px-6 -mt-4 mb-8"><!></div>'), Ce = e.from_html("<!> <!>", 1), At = e.from_html('<div class="p-8 text-center"><p class="text-accent-danger"> </p></div>'), Ft = e.from_html('<div class="p-8 text-center"><p class="tone-muted"> </p></div>');
|
|
447
|
+
function Rt(m, t) {
|
|
448
|
+
e.push(t, !0);
|
|
449
|
+
let l = e.prop(t, "availableTickets", 23, () => []);
|
|
450
|
+
e.prop(t, "value", 3, "");
|
|
451
|
+
let d = e.prop(t, "venueId", 3, ""), s = e.prop(t, "organizationId", 3, ""), o = e.prop(t, "onNavigateBack", 3, void 0), P = e.prop(t, "initialError", 3, void 0), c = e.prop(t, "labels", 19, () => ({})), b = e.derived(() => (t.data || {}).id);
|
|
452
|
+
e.derived(() => (t.data || {}).orgSlug);
|
|
453
|
+
let C = e.derived(() => (t.data || {}).slug), j = e.derived(() => (t.data || {}).event), g = e.derived(() => e.get(j) ? Ve(e.get(j)) : t.data && (t.data.id || e.get(b)) ? {
|
|
454
|
+
id: t.data.id || e.get(b),
|
|
455
|
+
eventID: t.data.id || e.get(b),
|
|
456
|
+
venueID: t.data.venueID ?? t.data.venueId ?? null,
|
|
457
|
+
venueId: t.data.venueId ?? t.data.venueID ?? null,
|
|
458
|
+
eventTicketingType: 0,
|
|
459
|
+
ticketType: 0,
|
|
460
|
+
availableTickets: []
|
|
461
|
+
} : null), p = e.state(""), I = e.state(e.proxy({})), $ = e.state(e.proxy({})), B = e.state(e.proxy([])), U = e.state(""), ee = e.state(0), F = e.state(!1), M = e.state(null), O = e.state(""), E = e.state(void 0), v = e.state(""), H = e.state(!1), G = e.state(""), J = e.state(null), V = e.derived(() => e.get(J) !== null), Q = e.state(null), x = e.state(null), N = null;
|
|
462
|
+
$e(async () => {
|
|
463
|
+
if (e.set(p, et(rt.CHECKOUT_CARTID), !0), !e.get(p)) {
|
|
464
|
+
e.set(H, !0), e.set(G, c().noCheckoutSession || "No checkout session found. Please select tickets first.", !0);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
try {
|
|
468
|
+
const i = We(e.get(g)?.eventID || e.get(g)?.id || e.get(b));
|
|
469
|
+
e.set(I, i.quantities || {}, !0), e.set($, i.donationAmounts || {}, !0), e.set(U, i.promocode || "", !0), e.set(ee, i.promoDiscountAmount || 0, !0), e.set(B, i.tickets || [], !0);
|
|
470
|
+
} catch (i) {
|
|
471
|
+
q.error("Error loading checkout state:", i), e.set(I, {}, !0), e.set(B, [], !0);
|
|
472
|
+
}
|
|
473
|
+
e.get(B).length > 0 && e.get(g) && (e.get(g).availableTickets = e.get(B), l(e.get(B)));
|
|
474
|
+
let r = {
|
|
475
|
+
serviceFeeCents: 0,
|
|
476
|
+
serviceFeePercentage: 0,
|
|
477
|
+
serviceFeeChargeType: "both",
|
|
478
|
+
maxServiceFeeCents: 0,
|
|
479
|
+
taxPercentage: 0
|
|
480
|
+
};
|
|
481
|
+
try {
|
|
482
|
+
const i = (
|
|
483
|
+
/** @type {any} */
|
|
484
|
+
await Ke(e.get(g)?.venueID || e.get(g)?.venueId || d())
|
|
485
|
+
);
|
|
486
|
+
r = {
|
|
487
|
+
serviceFeeCents: Number(i?.serviceFeeCents ?? 0),
|
|
488
|
+
serviceFeePercentage: Number(i?.serviceFeePercentage ?? 0),
|
|
489
|
+
serviceFeeChargeType: String(i?.serviceFeeChargeType ?? "both"),
|
|
490
|
+
maxServiceFeeCents: Number(i?.maxServiceFeeCents ?? 0),
|
|
491
|
+
taxPercentage: Number(i?.taxPercentage ?? 0)
|
|
492
|
+
};
|
|
493
|
+
} catch (i) {
|
|
494
|
+
q.error("Error fetching venue data:", i);
|
|
495
|
+
}
|
|
496
|
+
const a = h(e.get(I), e.get(B), r);
|
|
497
|
+
Object.keys(e.get(I)).length > 0 && await z();
|
|
498
|
+
let n = 900;
|
|
499
|
+
if (e.get(p)) {
|
|
500
|
+
const i = typeof localStorage < "u" ? localStorage.getItem(`checkout-expiry-${e.get(
|
|
501
|
+
p
|
|
502
|
+
// @storage-escape: checkout-timer state (intentional raw localStorage)
|
|
503
|
+
)}`) : null;
|
|
504
|
+
if (i) {
|
|
505
|
+
const f = Math.max(0, Math.floor((parseInt(i, 10) - Date.now()) / 1e3));
|
|
506
|
+
f > 0 && (n = f);
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
const f = await He(e.get(p));
|
|
510
|
+
!f.error && f.expiresAt && (n = Math.max(0, Math.floor((new Date(f.expiresAt).getTime() - Date.now()) / 1e3)), localStorage.setItem(
|
|
511
|
+
// @storage-escape: checkout-timer state (intentional raw localStorage)
|
|
512
|
+
`checkout-expiry-${e.get(p)}`,
|
|
513
|
+
String(new Date(f.expiresAt).getTime())
|
|
514
|
+
));
|
|
515
|
+
} catch {
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
if (e.set(
|
|
519
|
+
x,
|
|
520
|
+
{
|
|
521
|
+
event: ue(e.get(g), r),
|
|
522
|
+
lines: a,
|
|
523
|
+
timerStart: n,
|
|
524
|
+
promoApplied: !!e.get(U),
|
|
525
|
+
promoDiscount: e.get(ee),
|
|
526
|
+
forceExpired: !1,
|
|
527
|
+
...N ? { serverTotals: N } : {}
|
|
528
|
+
},
|
|
529
|
+
!0
|
|
530
|
+
), P()) {
|
|
531
|
+
const i = ae(typeof P() == "object" ? P() : {
|
|
532
|
+
code: "card_declined",
|
|
533
|
+
message: "Your card was declined. Please try a different payment method."
|
|
534
|
+
});
|
|
535
|
+
e.set(v, i.message, !0);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
async function z() {
|
|
539
|
+
if (!e.get(p)) {
|
|
540
|
+
q.error("Missing cartId!");
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
const r = Object.fromEntries(Object.entries(e.get(I)).filter(([a, n]) => n > 0));
|
|
544
|
+
try {
|
|
545
|
+
const a = Object.fromEntries(Object.entries(e.get($)).filter(([, _]) => parseFloat(String(_)) > 0).map(([_, A]) => [parseInt(_, 10), parseFloat(String(A))]));
|
|
546
|
+
if (e.get(U)) {
|
|
547
|
+
const _ = await Je(e.get(p), e.get(U));
|
|
548
|
+
_.success || q.error("Failed to apply promo code to cart:", _.error);
|
|
549
|
+
}
|
|
550
|
+
const n = await Ye(e.get(p), r, Object.keys(a).length > 0 ? a : void 0);
|
|
551
|
+
if (!n) {
|
|
552
|
+
e.set(v, c().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again.", !0);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
const i = (
|
|
556
|
+
/** @type {any} */
|
|
557
|
+
n
|
|
558
|
+
);
|
|
559
|
+
if (N = {
|
|
560
|
+
subtotal: (i.subtotal ?? 0) / 100,
|
|
561
|
+
fees: (i.service_fee ?? 0) / 100,
|
|
562
|
+
taxes: (i.tax_amount_exclusive ?? 0) / 100,
|
|
563
|
+
total: (i.amount_total ?? 0) / 100,
|
|
564
|
+
promoDiscount: (i.discount ?? 0) / 100,
|
|
565
|
+
giftCardAmount: (i.gift_card_amount ?? 0) / 100,
|
|
566
|
+
stripeAmount: (i.stripe_amount ?? 0) / 100
|
|
567
|
+
}, e.get(x) && e.set(
|
|
568
|
+
x,
|
|
569
|
+
{
|
|
570
|
+
...e.get(x),
|
|
571
|
+
serverTotals: N
|
|
572
|
+
},
|
|
573
|
+
!0
|
|
574
|
+
), i.requires_stripe === !1 || i.payment_type === "free") {
|
|
575
|
+
e.set(O, "free");
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const f = n.stripe_publishable_key;
|
|
579
|
+
if (!f) {
|
|
580
|
+
q.error("No Stripe publishable key in payment intent response"), e.set(v, c().paymentConfigError || "Payment configuration error. Please try again.", !0);
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
e.set(M, await vt(f), !0), n.client_secret ? e.set(O, n.client_secret, !0) : e.set(v, c().failedToInitPayment || "Failed to initialize payment. Please try again.", !0);
|
|
584
|
+
} catch (a) {
|
|
585
|
+
q.error("Failed to initialize Stripe payment:", a), e.set(v, a.message || c().failedToInitPayment || "Failed to initialize payment. Please try again.", !0);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function ue(r, a) {
|
|
589
|
+
return r ? {
|
|
590
|
+
id: r.id || r.eventID,
|
|
591
|
+
title: r.name || r.title || "",
|
|
592
|
+
slug: r.slug || e.get(C) || "",
|
|
593
|
+
description: r.description || "",
|
|
594
|
+
date: r.date || "",
|
|
595
|
+
startDateTime: r.startDateTime || "",
|
|
596
|
+
endDateTime: r.endDateTime || "",
|
|
597
|
+
doorsOpenTime: r.doorsOpenTime || "",
|
|
598
|
+
timezone: r.timeZone || r.timezone || he(),
|
|
599
|
+
imageUrl: r.imageUrl || r.image || "",
|
|
600
|
+
venue: {
|
|
601
|
+
id: r.venueID || r.venueId || 0,
|
|
602
|
+
name: r.venueName || "",
|
|
603
|
+
address: r.venueAddress || "",
|
|
604
|
+
timezone: r.timeZone || r.timezone || he(),
|
|
605
|
+
serviceFeePercentage: a.serviceFeePercentage,
|
|
606
|
+
serviceFeeCents: a.serviceFeeCents,
|
|
607
|
+
taxPercentage: a.taxPercentage,
|
|
608
|
+
serviceFeeChargeType: a.serviceFeeChargeType,
|
|
609
|
+
maxServiceFeeCents: a.maxServiceFeeCents
|
|
610
|
+
},
|
|
611
|
+
performers: r.performers || [],
|
|
612
|
+
tickets: (r.availableTickets || []).map((n) => ({
|
|
613
|
+
id: n.ID || n.id,
|
|
614
|
+
name: n.name || "",
|
|
615
|
+
description: n.description || "",
|
|
616
|
+
price: (n.price || 0) / 100,
|
|
617
|
+
fee: 0,
|
|
618
|
+
quantityAvailable: n.quantityAvailable || 0,
|
|
619
|
+
quantityTotal: n.quantityTotal || 0,
|
|
620
|
+
minPerOrder: n.minPerOrder || 1,
|
|
621
|
+
maxPerOrder: n.maxPerOrder || 10,
|
|
622
|
+
status: "on_sale",
|
|
623
|
+
isDonation: n.type === 2,
|
|
624
|
+
isHidden: !1
|
|
625
|
+
})),
|
|
626
|
+
faqs: r.faqs || [],
|
|
627
|
+
status: "on_sale",
|
|
628
|
+
isPasswordProtected: !1,
|
|
629
|
+
isRegistrationEvent: r.eventTicketingType === 1 || r.ticketType === 1,
|
|
630
|
+
totalTicketsRemaining: 100,
|
|
631
|
+
totalTicketsCapacity: 100
|
|
632
|
+
} : null;
|
|
633
|
+
}
|
|
634
|
+
function h(r, a, n) {
|
|
635
|
+
const i = [];
|
|
636
|
+
for (const [f, _] of Object.entries(r)) {
|
|
637
|
+
if (_ <= 0) continue;
|
|
638
|
+
const A = a.find((ve) => String(ve.ID) === f || String(ve.id) === f);
|
|
639
|
+
if (!A) continue;
|
|
640
|
+
const ie = A.price || 0, Ae = u(ie, n);
|
|
641
|
+
i.push({
|
|
642
|
+
ticketId: parseInt(f),
|
|
643
|
+
ticketName: A.name || "",
|
|
644
|
+
quantity: _,
|
|
645
|
+
unitPrice: ie,
|
|
646
|
+
fee: Ae,
|
|
647
|
+
subtotal: _e(ie * _)
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
return i;
|
|
651
|
+
}
|
|
652
|
+
function u(r, a) {
|
|
653
|
+
if (r === 0) return 0;
|
|
654
|
+
const {
|
|
655
|
+
serviceFeePercentage: n = 0,
|
|
656
|
+
serviceFeeCents: i = 0,
|
|
657
|
+
serviceFeeChargeType: f = "both",
|
|
658
|
+
maxServiceFeeCents: _ = 0
|
|
659
|
+
} = a;
|
|
660
|
+
let A = 0;
|
|
661
|
+
return (f === "percentage" || f === "both") && (A += r * (n / 100)), (f === "fixed" || f === "flat" || f === "cents" || f === "both") && (A += i / 100), _ > 0 && (A = Math.min(A, _ / 100)), _e(A);
|
|
662
|
+
}
|
|
663
|
+
let S = e.derived(() => Object.values(e.get($)).some((r) => (Number(r) || 0) > 0)), T = e.derived(() => !e.get(S) && (e.get(x) ? e.get(x).lines.every((r) => r.unitPrice === 0) : !0));
|
|
664
|
+
async function W(r) {
|
|
665
|
+
if (!e.get(F)) {
|
|
666
|
+
e.set(F, !0), e.set(v, "");
|
|
667
|
+
try {
|
|
668
|
+
if (e.get(Q) && !e.get(Q).requiresStripe) {
|
|
669
|
+
await L(r);
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
if (e.get(T)) {
|
|
673
|
+
await Y(r);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (!e.get(E)) {
|
|
677
|
+
e.set(v, c().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again.", !0), e.set(F, !1);
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
if (!e.get(M)) {
|
|
681
|
+
e.set(v, c().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page.", !0), e.set(F, !1);
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
const { error: a } = await e.get(E).submit();
|
|
685
|
+
if (a) {
|
|
686
|
+
const _ = ae(a);
|
|
687
|
+
e.set(v, _.message, !0), e.set(F, !1);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
const n = await e.get(M).confirmPayment({ elements: e.get(E), redirect: "if_required" });
|
|
691
|
+
if (n.error) {
|
|
692
|
+
const _ = ae(n.error);
|
|
693
|
+
e.set(v, _.message, !0), e.set(F, !1);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const i = {
|
|
697
|
+
id: e.get(p),
|
|
698
|
+
paymentIntentId: n.paymentIntent.id,
|
|
699
|
+
tickets: e.get(I),
|
|
700
|
+
firstName: r.firstName,
|
|
701
|
+
lastName: r.lastName,
|
|
702
|
+
email: r.email,
|
|
703
|
+
paymentMethod: "credit-card",
|
|
704
|
+
mailingList: r.keepMeUpdated,
|
|
705
|
+
saleType: "online"
|
|
706
|
+
}, f = await Ze(e.get(p), i);
|
|
707
|
+
if (f?.eventCanceled || f?.eventPostponed) {
|
|
708
|
+
e.set(J, f.eventCanceled ? "canceled" : "postponed", !0), e.set(v, "");
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
if (f?.status === "Payment succeeded") {
|
|
712
|
+
const _ = {
|
|
713
|
+
orderId: e.get(p),
|
|
714
|
+
eventId: e.get(g)?.id || e.get(g)?.eventID || null,
|
|
715
|
+
event: e.get(g) || null,
|
|
716
|
+
venueId: d() || e.get(g)?.venueId || null,
|
|
717
|
+
organizationId: s() || e.get(g)?.organizationId || null
|
|
718
|
+
};
|
|
719
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(_);
|
|
720
|
+
} else f?.status === "Payment amount does not match the total price" ? e.set(v, c().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again.", !0) : e.set(v, c().paymentValidationFailed || "Payment validation failed. Please try again.", !0);
|
|
721
|
+
} catch (a) {
|
|
722
|
+
q.error("Payment execution error:", a);
|
|
723
|
+
const n = ae(a);
|
|
724
|
+
e.set(v, n.message, !0);
|
|
725
|
+
} finally {
|
|
726
|
+
e.set(F, !1);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
async function L(r) {
|
|
731
|
+
try {
|
|
732
|
+
const a = await Qe(e.get(p), {
|
|
733
|
+
firstName: r.firstName,
|
|
734
|
+
lastName: r.lastName,
|
|
735
|
+
email: r.email,
|
|
736
|
+
phoneNumber: null,
|
|
737
|
+
mailingList: r.keepMeUpdated
|
|
738
|
+
});
|
|
739
|
+
if (a?.success) {
|
|
740
|
+
const n = {
|
|
741
|
+
orderId: a.orderId || e.get(p),
|
|
742
|
+
eventId: e.get(g)?.id || e.get(g)?.eventID || null,
|
|
743
|
+
event: e.get(g) || null,
|
|
744
|
+
venueId: d() || e.get(g)?.venueId || null,
|
|
745
|
+
organizationId: s() || e.get(g)?.organizationId || null,
|
|
746
|
+
paymentType: "gift_card_only"
|
|
747
|
+
};
|
|
748
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(n);
|
|
749
|
+
} else
|
|
750
|
+
e.set(v, a?.error || c().failedToCompleteOrder || "Failed to complete order. Please try again.", !0);
|
|
751
|
+
} catch (a) {
|
|
752
|
+
q.error("Gift card payment error:", a);
|
|
753
|
+
const n = ae(a);
|
|
754
|
+
e.set(v, n.message, !0);
|
|
755
|
+
} finally {
|
|
756
|
+
e.set(F, !1);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
async function Y(r) {
|
|
760
|
+
try {
|
|
761
|
+
if (e.get(O) !== "free" && await z(), e.get(O) !== "free") {
|
|
762
|
+
e.set(v, c().failedToCompleteOrder || "Could not complete the order. Please try again.", !0);
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
const a = {
|
|
766
|
+
orderId: e.get(p),
|
|
767
|
+
eventId: e.get(g)?.id || e.get(g)?.eventID || null,
|
|
768
|
+
event: e.get(g) || null,
|
|
769
|
+
venueId: d() || e.get(g)?.venueId || null,
|
|
770
|
+
organizationId: s() || e.get(g)?.organizationId || null,
|
|
771
|
+
paymentType: "free"
|
|
772
|
+
};
|
|
773
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(a);
|
|
774
|
+
} catch (a) {
|
|
775
|
+
q.error("Free order completion error:", a);
|
|
776
|
+
const n = ae(a);
|
|
777
|
+
e.set(v, n.message, !0);
|
|
778
|
+
} finally {
|
|
779
|
+
e.set(F, !1);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
function X(r) {
|
|
783
|
+
if (e.set(Q, r, !0), e.get(x) && N) {
|
|
784
|
+
const a = r.requiresStripe ? r.stripeAmount ?? 0 : 0;
|
|
785
|
+
e.set(
|
|
786
|
+
x,
|
|
787
|
+
{
|
|
788
|
+
...e.get(x),
|
|
789
|
+
serverTotals: {
|
|
790
|
+
...N,
|
|
791
|
+
giftCardAmount: r.giftCardAmount ?? 0,
|
|
792
|
+
total: a
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
!0
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
r.requiresStripe ? e.get(p) && Object.keys(e.get(I)).length > 0 && z() : (e.set(E, void 0), e.set(M, null), e.set(O, ""));
|
|
799
|
+
}
|
|
800
|
+
function te() {
|
|
801
|
+
e.set(Q, null), e.get(x) && N && e.set(
|
|
802
|
+
x,
|
|
803
|
+
{
|
|
804
|
+
...e.get(x),
|
|
805
|
+
serverTotals: N
|
|
806
|
+
},
|
|
807
|
+
!0
|
|
808
|
+
), e.get(p) && Object.keys(e.get(I)).length > 0 && z();
|
|
809
|
+
}
|
|
810
|
+
function Z() {
|
|
811
|
+
o() ? o()() : window.history.back();
|
|
812
|
+
}
|
|
813
|
+
function D() {
|
|
814
|
+
o() ? o()() : window.history.back();
|
|
815
|
+
}
|
|
816
|
+
function y() {
|
|
817
|
+
e.set(J, null), Z();
|
|
818
|
+
}
|
|
819
|
+
async function w() {
|
|
820
|
+
if (!e.get(p)) return null;
|
|
821
|
+
try {
|
|
822
|
+
const r = await Xe(e.get(p));
|
|
823
|
+
return r.success ? {
|
|
824
|
+
newExpiryTime: r.newExpiryTime,
|
|
825
|
+
remainingExtensions: r.remainingExtensions
|
|
826
|
+
} : (q.error("Failed to extend session:", r.error), null);
|
|
827
|
+
} catch (r) {
|
|
828
|
+
return q.error("Error extending checkout session:", r), null;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
var k = Ce(), R = e.first_child(k);
|
|
832
|
+
{
|
|
833
|
+
var re = (r) => {
|
|
834
|
+
var a = Ce(), n = e.first_child(a);
|
|
835
|
+
tt(n, {
|
|
836
|
+
get config() {
|
|
837
|
+
return e.get(x);
|
|
838
|
+
},
|
|
839
|
+
onPlaceOrder: W,
|
|
840
|
+
onBack: Z,
|
|
841
|
+
onRetryExpired: D,
|
|
842
|
+
onExtendSession: w,
|
|
843
|
+
get stripe() {
|
|
844
|
+
return e.get(M);
|
|
845
|
+
},
|
|
846
|
+
get paymentIntent() {
|
|
847
|
+
return e.get(O);
|
|
848
|
+
},
|
|
849
|
+
get paymentError() {
|
|
850
|
+
return e.get(v);
|
|
851
|
+
},
|
|
852
|
+
get labels() {
|
|
853
|
+
return c();
|
|
854
|
+
},
|
|
855
|
+
get elements() {
|
|
856
|
+
return e.get(E);
|
|
857
|
+
},
|
|
858
|
+
set elements(_) {
|
|
859
|
+
e.set(E, _, !0);
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
var i = e.sibling(n, 2);
|
|
863
|
+
{
|
|
864
|
+
var f = (_) => {
|
|
865
|
+
var A = Et(), ie = e.child(A);
|
|
866
|
+
It(ie, {
|
|
867
|
+
get cartId() {
|
|
868
|
+
return e.get(p);
|
|
869
|
+
},
|
|
870
|
+
onApplied: X,
|
|
871
|
+
onRemoved: te,
|
|
872
|
+
get disabled() {
|
|
873
|
+
return e.get(F);
|
|
874
|
+
}
|
|
875
|
+
}), e.reset(A), e.append(_, A);
|
|
876
|
+
};
|
|
877
|
+
e.if(i, (_) => {
|
|
878
|
+
e.get(T) || _(f);
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
e.append(r, a);
|
|
882
|
+
}, ne = (r) => {
|
|
883
|
+
var a = At(), n = e.child(a), i = e.child(n, !0);
|
|
884
|
+
e.reset(n), e.reset(a), e.template_effect(() => e.set_text(i, e.get(G))), e.append(r, a);
|
|
885
|
+
}, K = (r) => {
|
|
886
|
+
var a = Ft(), n = e.child(a), i = e.child(n, !0);
|
|
887
|
+
e.reset(n), e.reset(a), e.template_effect(() => e.set_text(i, c().loadingSecurePaymentForm || "Loading secure payment form...")), e.append(r, a);
|
|
888
|
+
};
|
|
889
|
+
e.if(R, (r) => {
|
|
890
|
+
e.get(x) ? r(re) : e.get(H) ? r(ne, 1) : r(K, -1);
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
var ge = e.sibling(R, 2);
|
|
894
|
+
{
|
|
895
|
+
var Ee = (r) => {
|
|
896
|
+
kt(r, {
|
|
897
|
+
open: !0,
|
|
898
|
+
get reason() {
|
|
899
|
+
return e.get(J);
|
|
900
|
+
},
|
|
901
|
+
onBackToEvents: y,
|
|
902
|
+
get labels() {
|
|
903
|
+
return c();
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
};
|
|
907
|
+
e.if(ge, (r) => {
|
|
908
|
+
e.get(V) && r(Ee);
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
e.append(m, k), e.pop();
|
|
912
|
+
}
|
|
913
|
+
export {
|
|
914
|
+
Rt as default
|
|
915
|
+
};
|
|
916
|
+
//# sourceMappingURL=Checkout-DU8QW51B.js.map
|