@getmicdrop/venue-calendar 4.0.71 → 4.0.73
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/{CarouselView.legacy-ClHr7g2d.js → CarouselView.legacy-D8292Vwd.js} +3 -3
- package/dist/{CarouselView.legacy-ClHr7g2d.js.map → CarouselView.legacy-D8292Vwd.js.map} +1 -1
- package/dist/{CartView-BncT-vVW.js → CartView-CLi2VVd0.js} +139 -139
- package/dist/{CartView-BncT-vVW.js.map → CartView-CLi2VVd0.js.map} +1 -1
- package/dist/{Checkout-DUwzAkMN.js → Checkout-ByCnBt-G.js} +317 -316
- package/dist/{Checkout-DUwzAkMN.js.map → Checkout-ByCnBt-G.js.map} +1 -1
- package/dist/Checkout-DvbhqCsh.js +830 -0
- package/dist/Checkout-DvbhqCsh.js.map +1 -0
- package/dist/{Checkout.legacy-D9nNe_AZ.js → Checkout.legacy-C95H23qA.js} +60 -60
- package/dist/{Checkout.legacy-D9nNe_AZ.js.map → Checkout.legacy-C95H23qA.js.map} +1 -1
- package/dist/{CheckoutTimer-Vgrjjbvg.js → CheckoutTimer-CzRcyBzu.js} +2 -2
- package/dist/{CheckoutTimer-Vgrjjbvg.js.map → CheckoutTimer-CzRcyBzu.js.map} +1 -1
- package/dist/{CollectionView-DLcoMjuw.js → CollectionView-CtMBS-m8.js} +5 -5
- package/dist/{CollectionView-DLcoMjuw.js.map → CollectionView-CtMBS-m8.js.map} +1 -1
- package/dist/{CollectionView.legacy-B_8a2U1u.js → CollectionView.legacy-C4ba5bLU.js} +32 -32
- package/dist/{CollectionView.legacy-B_8a2U1u.js.map → CollectionView.legacy-C4ba5bLU.js.map} +1 -1
- package/dist/Event-Bm1bpwyl.js +2188 -0
- package/dist/Event-Bm1bpwyl.js.map +1 -0
- package/dist/{EventPage-CtJ9YZcS.js → EventPage-BT2m0JQi.js} +5 -5
- package/dist/{EventPage-CtJ9YZcS.js.map → EventPage-BT2m0JQi.js.map} +1 -1
- package/dist/EventPage.legacy-Deu8PGw6.js +1300 -0
- package/dist/EventPage.legacy-Deu8PGw6.js.map +1 -0
- package/dist/{FeaturedView.legacy-aKrVnwkw.js → FeaturedView.legacy-Cbxg3oCb.js} +22 -22
- package/dist/{FeaturedView.legacy-aKrVnwkw.js.map → FeaturedView.legacy-Cbxg3oCb.js.map} +1 -1
- package/dist/{GalleryCard-Da9zFkLr.js → GalleryCard-K-h-w_A6.js} +13 -13
- package/dist/{GalleryCard-Da9zFkLr.js.map → GalleryCard-K-h-w_A6.js.map} +1 -1
- package/dist/{GalleryView.legacy-D3A9pCKp.js → GalleryView.legacy-BYiC8PVZ.js} +3 -3
- package/dist/{GalleryView.legacy-D3A9pCKp.js.map → GalleryView.legacy-BYiC8PVZ.js.map} +1 -1
- package/dist/{GroupedListView.legacy-BaoTHCTN.js → GroupedListView.legacy-BZq2qDjS.js} +27 -27
- package/dist/{GroupedListView.legacy-BaoTHCTN.js.map → GroupedListView.legacy-BZq2qDjS.js.map} +1 -1
- package/dist/{SeriesPage-Cp9hhvIY.js → SeriesPage-BbGXRoCV.js} +5 -5
- package/dist/{SeriesPage-Cp9hhvIY.js.map → SeriesPage-BbGXRoCV.js.map} +1 -1
- package/dist/{SeriesPage.legacy-Jk6vH4SQ.js → SeriesPage.legacy-eMr3yDRa.js} +33 -33
- package/dist/{SeriesPage.legacy-Jk6vH4SQ.js.map → SeriesPage.legacy-eMr3yDRa.js.map} +1 -1
- package/dist/{Success-C7SFYk8j.js → Success-CeNSlAZj.js} +130 -131
- package/dist/{Success-C7SFYk8j.js.map → Success-CeNSlAZj.js.map} +1 -1
- package/dist/{Success.legacy-VgQ_-sfp.js → Success.legacy-DpYGRNGA.js} +25 -25
- package/dist/{Success.legacy-VgQ_-sfp.js.map → Success.legacy-DpYGRNGA.js.map} +1 -1
- package/dist/{VenueCalendar-BYs68ta2.js → VenueCalendar-CGKy4kQ8.js} +6897 -7487
- package/dist/VenueCalendar-CGKy4kQ8.js.map +1 -0
- package/dist/{ViewTicketsEmbed-DLjGYNC1.js → ViewTicketsEmbed-CxQZM79q.js} +20 -20
- package/dist/{ViewTicketsEmbed-DLjGYNC1.js.map → ViewTicketsEmbed-CxQZM79q.js.map} +1 -1
- package/dist/{api-COTZNjyj.js → api-toYmKtOR.js} +2 -2
- package/dist/{api-COTZNjyj.js.map → api-toYmKtOR.js.map} +1 -1
- package/dist/{data-toggle-store.svelte-C65MzzYZ.js → data-toggle-store.svelte-DWzk0MLS.js} +2 -2
- package/dist/{data-toggle-store.svelte-C65MzzYZ.js.map → data-toggle-store.svelte-DWzk0MLS.js.map} +1 -1
- package/dist/labels-BpBCM7Zc.js +657 -0
- package/dist/labels-BpBCM7Zc.js.map +1 -0
- package/dist/{transform-TJz04LxL.js → transform-DeiNOLZ8.js} +2 -2
- package/dist/{transform-TJz04LxL.js.map → transform-DeiNOLZ8.js.map} +1 -1
- package/dist/types/index.d.ts +20 -17
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +23 -24
- package/dist/venue-calendar.iife.js +71 -62
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +68 -71
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +4 -1
- package/dist/Checkout-7rhwtJSX.js +0 -803
- package/dist/Checkout-7rhwtJSX.js.map +0 -1
- package/dist/Event-BBIEvf3e.js +0 -1789
- package/dist/Event-BBIEvf3e.js.map +0 -1
- package/dist/EventDetailsView-BHxDjZCb.js +0 -1366
- package/dist/EventDetailsView-BHxDjZCb.js.map +0 -1
- package/dist/EventPage.legacy-CQ1MAI_B.js +0 -1044
- package/dist/EventPage.legacy-CQ1MAI_B.js.map +0 -1
- package/dist/OrderSummary-DaBRHOX_.js +0 -497
- package/dist/OrderSummary-DaBRHOX_.js.map +0 -1
- package/dist/PromoCodeInput-C_RKyiKy.js +0 -415
- package/dist/PromoCodeInput-C_RKyiKy.js.map +0 -1
- package/dist/VenueCalendar-BYs68ta2.js.map +0 -1
- package/dist/WaitlistModal-BRRzVbhX.js +0 -266
- package/dist/WaitlistModal-BRRzVbhX.js.map +0 -1
- package/dist/labels-CWMBE5R1.js +0 -163
- package/dist/labels-CWMBE5R1.js.map +0 -1
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
import "svelte/internal/disclose-version";
|
|
2
|
-
import * as e from "svelte/internal/client";
|
|
3
|
-
import { g as Q, aK as j, ae as ke, ad as te, B as R, ab as ye, ac as be, h as J } from "./VenueCalendar-BYs68ta2.js";
|
|
4
|
-
import { H as Pe } from "./Heading-AFd3o0xt.js";
|
|
5
|
-
import { T as $ } from "./Text-CXR2fhx6.js";
|
|
6
|
-
import "svelte/transition";
|
|
7
|
-
import "svelte/easing";
|
|
8
|
-
import { g as Se, b as qe, f as De, D as ae } from "./OrderSummary-DaBRHOX_.js";
|
|
9
|
-
function ee(w = "light") {
|
|
10
|
-
if (typeof window > "u" || typeof navigator > "u" || !navigator.vibrate) return;
|
|
11
|
-
const t = w === "light" ? 8 : w === "medium" ? 18 : 32;
|
|
12
|
-
navigator.vibrate(t);
|
|
13
|
-
}
|
|
14
|
-
var Ce = e.from_html('<div class="donation-input-wrapper svelte-1rkcli3"><!></div>'), Ae = e.from_html('<span class="price-fee"> </span>'), we = e.from_html('<span class="price-strikethrough"> </span> <span class="price-discounted svelte-1rkcli3"> </span> <!>', 1), Te = e.from_html('<span class="price-lg text-color-muted"> </span>'), ze = e.from_html('<span class="price-fee"> </span>'), Be = e.from_html('<span class="price-lg text-color-primary"> </span> <!>', 1), Ie = e.from_html('<!> <span class="qty-display svelte-1rkcli3" aria-live="polite"> </span> <!>', 1), Ve = e.from_html('<article><div class="vc-flex-between-start gap-4"><div class="flex-1 min-w-0"><div class="flex-row-2 flex-wrap"><!> <!></div> <!> <div class="flex-row-2 mt-2"><!></div> <!></div> <div class="flex items-center quantity-selector svelte-1rkcli3"><!></div></div></article>');
|
|
15
|
-
function Me(w, t) {
|
|
16
|
-
e.push(t, !0);
|
|
17
|
-
let n = e.prop(t, "donationAmount", 3, ""), B = e.prop(t, "isRevealedByPromo", 3, !1), h = e.prop(t, "isDiscountedByPromo", 3, !1), T = e.prop(t, "discountedPrice", 3, null), u = e.prop(t, "labels", 19, () => ({})), k = e.derived(() => t.ticket.isDonation || t.ticket.ticketType === 2), I = e.derived(() => t.ticket.status === "sold_out" || t.ticket.quantityAvailable === 0), g = e.derived(() => t.ticket.status === "coming_soon"), V = e.derived(() => t.ticket.status === "sales_ended"), z = e.derived(() => e.get(I) || e.get(g) || e.get(V)), H = e.derived(() => Se(t.ticket.quantityAvailable, t.ticket.quantityTotal)), s = e.derived(() => qe(e.get(H), t.ticket.quantityAvailable, "ticket")), m = e.derived(() => parseFloat(n()) || 0), y = e.derived(() => e.get(k) && n() !== "" && e.get(m) < 1 ? "Minimum $1.00" : ""), b = e.derived(() => !e.get(k) || n() !== "" && e.get(m) >= 1), E = e.derived(() => t.quantity > 0), O = e.derived(() => !e.get(z) && t.quantity < t.ticket.maxPerOrder && t.quantity < t.ticket.quantityAvailable && e.get(b));
|
|
18
|
-
function F() {
|
|
19
|
-
if (e.get(E)) {
|
|
20
|
-
const a = t.quantity - 1;
|
|
21
|
-
t.onQuantityChange(J(t.ticket.id), a < t.ticket.minPerOrder ? 0 : a), ee("light");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function K() {
|
|
25
|
-
if (e.get(O)) {
|
|
26
|
-
const a = t.quantity === 0 ? t.ticket.minPerOrder : t.quantity + 1;
|
|
27
|
-
t.onQuantityChange(J(t.ticket.id), a), ee("light");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
let P = e.state(e.proxy(n()));
|
|
31
|
-
e.user_effect(() => {
|
|
32
|
-
e.set(P, n());
|
|
33
|
-
});
|
|
34
|
-
function L() {
|
|
35
|
-
e.get(P) !== n() && t.onDonationChange?.(J(t.ticket.id), e.get(P));
|
|
36
|
-
}
|
|
37
|
-
let d = e.derived(() => e.get(k) ? 0 : t.ticket.price + (t.ticket.price === 0 ? 0 : t.ticket.fee)), o = e.derived(() => e.get(k) ? "" : t.ticket.price === 0 ? u().free || "Free" : Q(e.get(d))), c = e.derived(() => !e.get(k) && t.ticket.fee > 0 && t.ticket.price > 0 ? `incl. ${Q(t.ticket.fee)} ${u().fee || "fee"}` : ""), S = e.derived(() => e.get(g) && t.ticket.salesStartDate ? `Sales start ${De(t.ticket.salesStartDate)}` : e.get(g) ? "Coming soon" : "");
|
|
38
|
-
var v = Ve();
|
|
39
|
-
let q;
|
|
40
|
-
var W = e.child(v), U = e.child(W), M = e.child(U), X = e.child(M);
|
|
41
|
-
Pe(X, {
|
|
42
|
-
level: 4,
|
|
43
|
-
size: "sm",
|
|
44
|
-
weight: "semibold",
|
|
45
|
-
children: (a, i) => {
|
|
46
|
-
e.next();
|
|
47
|
-
var l = e.text();
|
|
48
|
-
e.template_effect(() => e.set_text(l, t.ticket.name)), e.append(a, l);
|
|
49
|
-
},
|
|
50
|
-
$$slots: { default: !0 }
|
|
51
|
-
});
|
|
52
|
-
var ie = e.sibling(X, 2);
|
|
53
|
-
{
|
|
54
|
-
var re = (a) => {
|
|
55
|
-
j(a, {
|
|
56
|
-
variant: "error",
|
|
57
|
-
children: (i, l) => {
|
|
58
|
-
e.next();
|
|
59
|
-
var r = e.text();
|
|
60
|
-
e.template_effect(() => e.set_text(r, u().soldOut || "Sold out")), e.append(i, r);
|
|
61
|
-
},
|
|
62
|
-
$$slots: { default: !0 }
|
|
63
|
-
});
|
|
64
|
-
}, le = (a) => {
|
|
65
|
-
j(a, {
|
|
66
|
-
variant: "neutral",
|
|
67
|
-
children: (i, l) => {
|
|
68
|
-
e.next();
|
|
69
|
-
var r = e.text("Sales ended");
|
|
70
|
-
e.append(i, r);
|
|
71
|
-
},
|
|
72
|
-
$$slots: { default: !0 }
|
|
73
|
-
});
|
|
74
|
-
}, ne = (a) => {
|
|
75
|
-
j(a, {
|
|
76
|
-
variant: "success",
|
|
77
|
-
children: (i, l) => {
|
|
78
|
-
e.next();
|
|
79
|
-
var r = e.text("Unlocked");
|
|
80
|
-
e.append(i, r);
|
|
81
|
-
},
|
|
82
|
-
$$slots: { default: !0 }
|
|
83
|
-
});
|
|
84
|
-
}, de = (a) => {
|
|
85
|
-
j(a, {
|
|
86
|
-
variant: "green",
|
|
87
|
-
children: (i, l) => {
|
|
88
|
-
e.next();
|
|
89
|
-
var r = e.text("Discount applied");
|
|
90
|
-
e.append(i, r);
|
|
91
|
-
},
|
|
92
|
-
$$slots: { default: !0 }
|
|
93
|
-
});
|
|
94
|
-
}, se = (a) => {
|
|
95
|
-
ke(a, {
|
|
96
|
-
get remaining() {
|
|
97
|
-
return t.ticket.quantityAvailable;
|
|
98
|
-
},
|
|
99
|
-
get total() {
|
|
100
|
-
return t.ticket.quantityTotal;
|
|
101
|
-
},
|
|
102
|
-
context: "ticket"
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
e.if(ie, (a) => {
|
|
106
|
-
e.get(I) ? a(re) : e.get(V) ? a(le, 1) : B() ? a(ne, 2) : h() ? a(de, 3) : e.get(s) && !e.get(g) && a(se, 4);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
e.reset(M);
|
|
110
|
-
var Y = e.sibling(M, 2);
|
|
111
|
-
{
|
|
112
|
-
var oe = (a) => {
|
|
113
|
-
$(a, {
|
|
114
|
-
size: "xs",
|
|
115
|
-
color: "muted",
|
|
116
|
-
class: "block mt-1 line-clamp-2",
|
|
117
|
-
children: (i, l) => {
|
|
118
|
-
e.next();
|
|
119
|
-
var r = e.text();
|
|
120
|
-
e.template_effect(() => e.set_text(r, t.ticket.description)), e.append(i, r);
|
|
121
|
-
},
|
|
122
|
-
$$slots: { default: !0 }
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
e.if(Y, (a) => {
|
|
126
|
-
t.ticket.description && a(oe);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
var N = e.sibling(Y, 2), ce = e.child(N);
|
|
130
|
-
{
|
|
131
|
-
var ve = (a) => {
|
|
132
|
-
var i = Ce(), l = e.child(i);
|
|
133
|
-
{
|
|
134
|
-
let r = e.derived(() => e.get(y) ? "red" : "base");
|
|
135
|
-
te(l, {
|
|
136
|
-
label: "Donation amount",
|
|
137
|
-
size: "md",
|
|
138
|
-
type: "text",
|
|
139
|
-
placeholder: "0.00",
|
|
140
|
-
get disabled() {
|
|
141
|
-
return e.get(z);
|
|
142
|
-
},
|
|
143
|
-
get errorText() {
|
|
144
|
-
return e.get(y);
|
|
145
|
-
},
|
|
146
|
-
get color() {
|
|
147
|
-
return e.get(r);
|
|
148
|
-
},
|
|
149
|
-
get value() {
|
|
150
|
-
return e.get(P);
|
|
151
|
-
},
|
|
152
|
-
set value(D) {
|
|
153
|
-
e.set(P, D, !0);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
e.reset(i), e.delegated("input", i, L), e.append(a, i);
|
|
158
|
-
}, ue = (a) => {
|
|
159
|
-
const i = e.derived(() => T() + (T() === 0 ? 0 : t.ticket.fee));
|
|
160
|
-
var l = we(), r = e.first_child(l), D = e.child(r, !0);
|
|
161
|
-
e.reset(r);
|
|
162
|
-
var C = e.sibling(r, 2), f = e.child(C, !0);
|
|
163
|
-
e.reset(C);
|
|
164
|
-
var _ = e.sibling(C, 2);
|
|
165
|
-
{
|
|
166
|
-
var A = (p) => {
|
|
167
|
-
var x = Ae(), G = e.child(x, !0);
|
|
168
|
-
e.reset(x), e.template_effect(() => e.set_text(G, e.get(c))), e.append(p, x);
|
|
169
|
-
};
|
|
170
|
-
e.if(_, (p) => {
|
|
171
|
-
e.get(c) && p(A);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
e.template_effect(
|
|
175
|
-
(p, x) => {
|
|
176
|
-
e.set_text(D, p), e.set_text(f, x);
|
|
177
|
-
},
|
|
178
|
-
[
|
|
179
|
-
() => Q(e.get(d)),
|
|
180
|
-
() => Q(e.get(i))
|
|
181
|
-
]
|
|
182
|
-
), e.append(a, l);
|
|
183
|
-
}, ge = (a) => {
|
|
184
|
-
var i = Te(), l = e.child(i, !0);
|
|
185
|
-
e.reset(i), e.template_effect(() => e.set_text(l, e.get(o))), e.append(a, i);
|
|
186
|
-
}, me = (a) => {
|
|
187
|
-
var i = Be(), l = e.first_child(i), r = e.child(l, !0);
|
|
188
|
-
e.reset(l);
|
|
189
|
-
var D = e.sibling(l, 2);
|
|
190
|
-
{
|
|
191
|
-
var C = (f) => {
|
|
192
|
-
var _ = ze(), A = e.child(_, !0);
|
|
193
|
-
e.reset(_), e.template_effect(() => e.set_text(A, e.get(c))), e.append(f, _);
|
|
194
|
-
};
|
|
195
|
-
e.if(D, (f) => {
|
|
196
|
-
e.get(c) && f(C);
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
e.template_effect(() => e.set_text(r, e.get(o))), e.append(a, i);
|
|
200
|
-
};
|
|
201
|
-
e.if(ce, (a) => {
|
|
202
|
-
e.get(k) ? a(ve) : h() && T() !== null ? a(ue, 1) : e.get(g) ? a(ge, 2) : a(me, !1);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
e.reset(N);
|
|
206
|
-
var fe = e.sibling(N, 2);
|
|
207
|
-
{
|
|
208
|
-
var _e = (a) => {
|
|
209
|
-
$(a, {
|
|
210
|
-
size: "xs",
|
|
211
|
-
color: "muted",
|
|
212
|
-
class: "block mt-1.5",
|
|
213
|
-
children: (i, l) => {
|
|
214
|
-
e.next();
|
|
215
|
-
var r = e.text();
|
|
216
|
-
e.template_effect(() => e.set_text(r, e.get(S))), e.append(i, r);
|
|
217
|
-
},
|
|
218
|
-
$$slots: { default: !0 }
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
e.if(fe, (a) => {
|
|
222
|
-
e.get(S) && a(_e);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
e.reset(U);
|
|
226
|
-
var Z = e.sibling(U, 2), pe = e.child(Z);
|
|
227
|
-
{
|
|
228
|
-
var xe = (a) => {
|
|
229
|
-
}, he = (a) => {
|
|
230
|
-
var i = Ie(), l = e.first_child(i);
|
|
231
|
-
{
|
|
232
|
-
let f = e.derived(() => !e.get(E)), _ = e.derived(() => u().decrease || "Decrease"), A = e.derived(() => t.ticket.name), p = e.derived(() => u().quantity || "quantity");
|
|
233
|
-
R(l, {
|
|
234
|
-
variant: "alternative",
|
|
235
|
-
size: "icon-lg",
|
|
236
|
-
onclick: F,
|
|
237
|
-
get disabled() {
|
|
238
|
-
return e.get(f);
|
|
239
|
-
},
|
|
240
|
-
get "aria-label"() {
|
|
241
|
-
return `${e.get(_) ?? ""} ${e.get(A) ?? ""} ${e.get(p) ?? ""}`;
|
|
242
|
-
},
|
|
243
|
-
children: (x, G) => {
|
|
244
|
-
ye(x, { size: 16 });
|
|
245
|
-
},
|
|
246
|
-
$$slots: { default: !0 }
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
var r = e.sibling(l, 2), D = e.child(r, !0);
|
|
250
|
-
e.reset(r);
|
|
251
|
-
var C = e.sibling(r, 2);
|
|
252
|
-
{
|
|
253
|
-
let f = e.derived(() => !e.get(O)), _ = e.derived(() => u().increase || "Increase"), A = e.derived(() => t.ticket.name), p = e.derived(() => u().quantity || "quantity");
|
|
254
|
-
R(C, {
|
|
255
|
-
variant: "alternative",
|
|
256
|
-
size: "icon-lg",
|
|
257
|
-
onclick: K,
|
|
258
|
-
get disabled() {
|
|
259
|
-
return e.get(f);
|
|
260
|
-
},
|
|
261
|
-
get "aria-label"() {
|
|
262
|
-
return `${e.get(_) ?? ""} ${e.get(A) ?? ""} ${e.get(p) ?? ""}`;
|
|
263
|
-
},
|
|
264
|
-
children: (x, G) => {
|
|
265
|
-
be(x, { size: 16 });
|
|
266
|
-
},
|
|
267
|
-
$$slots: { default: !0 }
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
e.template_effect(() => {
|
|
271
|
-
e.set_attribute(r, "aria-label", `${t.ticket.name ?? ""} ${(u().quantity || "quantity") ?? ""}: ${t.quantity ?? ""}`), e.set_text(D, t.quantity);
|
|
272
|
-
}), e.append(a, i);
|
|
273
|
-
};
|
|
274
|
-
e.if(pe, (a) => {
|
|
275
|
-
e.get(I) || e.get(g) || e.get(V) ? a(xe) : a(he, !1);
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
e.reset(Z), e.reset(W), e.reset(v), e.template_effect(() => {
|
|
279
|
-
q = e.set_class(v, 1, "ticket-card rounded-lg border p-4 transition-all svelte-1rkcli3", null, q, {
|
|
280
|
-
"disabled-ticket": e.get(z),
|
|
281
|
-
revealed: B() && !e.get(z)
|
|
282
|
-
}), e.set_style(v, `transition-duration: ${ae.normal}ms;`);
|
|
283
|
-
}), e.append(w, v), e.pop();
|
|
284
|
-
}
|
|
285
|
-
e.delegate(["input"]);
|
|
286
|
-
var Re = e.from_html('<p class="promo-message success body-sm svelte-1uooa2j" role="status" aria-live="polite"> </p>'), Ee = e.from_html('<div class="space-y-2"><div class="promo-input-wrapper svelte-1uooa2j"><div class="flex-1"><!></div> <!></div> <!></div>'), Oe = e.from_html('<div class="promo-section svelte-1uooa2j" role="group" aria-labelledby="promo-label"><span id="promo-label" class="sr-only">Promo code entry</span> <!></div>');
|
|
287
|
-
function Ne(w, t) {
|
|
288
|
-
e.push(t, !0);
|
|
289
|
-
let n = e.prop(t, "labels", 19, () => ({})), B = e.state(!1), h = e.state("");
|
|
290
|
-
function T() {
|
|
291
|
-
const s = e.get(h).trim();
|
|
292
|
-
s && t.onApply(s);
|
|
293
|
-
}
|
|
294
|
-
function u() {
|
|
295
|
-
e.set(h, ""), t.onRemove();
|
|
296
|
-
}
|
|
297
|
-
function k(s) {
|
|
298
|
-
s.key === "Enter" && (s.preventDefault(), T());
|
|
299
|
-
}
|
|
300
|
-
let I = e.derived(() => t.promoState.isApplied || e.get(B));
|
|
301
|
-
var g = Oe(), V = e.sibling(e.child(g), 2);
|
|
302
|
-
{
|
|
303
|
-
var z = (s) => {
|
|
304
|
-
R(s, {
|
|
305
|
-
variant: "link",
|
|
306
|
-
onclick: () => e.set(B, !0),
|
|
307
|
-
children: (m, y) => {
|
|
308
|
-
e.next();
|
|
309
|
-
var b = e.text();
|
|
310
|
-
e.template_effect(() => e.set_text(b, n().havePromoCode || "Have a promo code?")), e.append(m, b);
|
|
311
|
-
},
|
|
312
|
-
$$slots: { default: !0 }
|
|
313
|
-
});
|
|
314
|
-
}, H = (s) => {
|
|
315
|
-
var m = Ee(), y = e.child(m), b = e.child(y), E = e.child(b);
|
|
316
|
-
{
|
|
317
|
-
let d = e.derived(() => n().promoCode || "Promo code"), o = e.derived(() => n().enterCode || "Enter code"), c = e.derived(() => t.promoState.isApplied || t.promoState.isValidating), S = e.derived(() => t.promoState.error || ""), v = e.derived(() => t.promoState.error ? "red" : "base");
|
|
318
|
-
te(E, {
|
|
319
|
-
get label() {
|
|
320
|
-
return e.get(d);
|
|
321
|
-
},
|
|
322
|
-
get placeholder() {
|
|
323
|
-
return e.get(o);
|
|
324
|
-
},
|
|
325
|
-
size: "md",
|
|
326
|
-
type: "text",
|
|
327
|
-
get disabled() {
|
|
328
|
-
return e.get(c);
|
|
329
|
-
},
|
|
330
|
-
get errorText() {
|
|
331
|
-
return e.get(S);
|
|
332
|
-
},
|
|
333
|
-
get color() {
|
|
334
|
-
return e.get(v);
|
|
335
|
-
},
|
|
336
|
-
get value() {
|
|
337
|
-
return e.get(h);
|
|
338
|
-
},
|
|
339
|
-
set value(q) {
|
|
340
|
-
e.set(h, q, !0);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
e.reset(b);
|
|
345
|
-
var O = e.sibling(b, 2);
|
|
346
|
-
{
|
|
347
|
-
var F = (d) => {
|
|
348
|
-
{
|
|
349
|
-
let o = e.derived(() => n().removePromoCode || "Remove promo code");
|
|
350
|
-
R(d, {
|
|
351
|
-
variant: "outline",
|
|
352
|
-
onclick: u,
|
|
353
|
-
class: "h-10 self-start mt-5",
|
|
354
|
-
get "aria-label"() {
|
|
355
|
-
return e.get(o);
|
|
356
|
-
},
|
|
357
|
-
children: (c, S) => {
|
|
358
|
-
e.next();
|
|
359
|
-
var v = e.text();
|
|
360
|
-
e.template_effect(() => e.set_text(v, n().remove || "Remove")), e.append(c, v);
|
|
361
|
-
},
|
|
362
|
-
$$slots: { default: !0 }
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
}, K = (d) => {
|
|
366
|
-
{
|
|
367
|
-
let o = e.derived(() => t.promoState.isValidating || !e.get(h).trim()), c = e.derived(() => t.promoState.isValidating ? n().checkingPromoCode || "Checking promo code" : n().applyPromoCode || "Apply promo code");
|
|
368
|
-
R(d, {
|
|
369
|
-
onclick: T,
|
|
370
|
-
get disabled() {
|
|
371
|
-
return e.get(o);
|
|
372
|
-
},
|
|
373
|
-
class: "h-10 self-start mt-5",
|
|
374
|
-
get "aria-label"() {
|
|
375
|
-
return e.get(c);
|
|
376
|
-
},
|
|
377
|
-
children: (S, v) => {
|
|
378
|
-
e.next();
|
|
379
|
-
var q = e.text();
|
|
380
|
-
e.template_effect(() => e.set_text(q, t.promoState.isValidating ? n().checking || "Checking..." : n().apply || "Apply")), e.append(S, q);
|
|
381
|
-
},
|
|
382
|
-
$$slots: { default: !0 }
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
e.if(O, (d) => {
|
|
387
|
-
t.promoState.isApplied ? d(F) : d(K, !1);
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
e.reset(y);
|
|
391
|
-
var P = e.sibling(y, 2);
|
|
392
|
-
{
|
|
393
|
-
var L = (d) => {
|
|
394
|
-
var o = Re(), c = e.child(o, !0);
|
|
395
|
-
e.reset(o), e.template_effect(() => e.set_text(c, t.promoState.hint)), e.append(d, o);
|
|
396
|
-
};
|
|
397
|
-
e.if(P, (d) => {
|
|
398
|
-
t.promoState.hint && d(L);
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
e.reset(m), e.template_effect(() => e.set_style(m, `animation: promoSlideIn ${ae.normal}ms ease-out;`)), e.delegated("keydown", y, k), e.append(s, m);
|
|
402
|
-
};
|
|
403
|
-
e.if(V, (s) => {
|
|
404
|
-
e.get(I) ? s(H, !1) : s(z);
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
e.reset(g), e.append(w, g), e.pop();
|
|
408
|
-
}
|
|
409
|
-
e.delegate(["keydown"]);
|
|
410
|
-
export {
|
|
411
|
-
Ne as P,
|
|
412
|
-
Me as T,
|
|
413
|
-
ee as t
|
|
414
|
-
};
|
|
415
|
-
//# sourceMappingURL=PromoCodeInput-C_RKyiKy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PromoCodeInput-C_RKyiKy.js","sources":["../src/lib/utils/haptic.ts","../src/lib/public-calendar-flow/TicketCard.svelte","../src/lib/public-calendar-flow/PromoCodeInput.svelte"],"sourcesContent":["/**\r\n * Haptic feedback helper.\r\n *\r\n * One call site for `navigator.vibrate` so consumers don't repeat the\r\n * SSR + capability check. Android browsers vibrate; iOS Safari silently\r\n * no-ops (Apple deliberate — they reserve haptics for native apps via\r\n * the Taptic Engine, no web API exposed). Future-proof: if Apple ever\r\n * ships a web haptic API, swap the impl here and every consumer gets it.\r\n *\r\n * Styles:\r\n * - 'light' (8ms) — UI tick on small interactions (ticket +/-, tap)\r\n * - 'medium' (18ms) — committed state change (drawer snap, month flip)\r\n * - 'heavy' (32ms) — destructive / important confirmations\r\n */\r\nexport function tick(style: 'light' | 'medium' | 'heavy' = 'light'): void {\r\n\tif (typeof window === 'undefined') return;\r\n\tif (typeof navigator === 'undefined' || !navigator.vibrate) return;\r\n\tconst ms = style === 'light' ? 8 : style === 'medium' ? 18 : 32;\r\n\tnavigator.vibrate(ms);\r\n}\r\n","<script lang=\"ts\">\r\n\timport { Add, Subtract } from 'carbon-icons-svelte';\r\n\timport { Badge, Button, Heading, Input, Text, asTicketId, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { TicketId, USD } from '@getmicdrop/svelte-components';\r\n\timport ScarcityBadge from '../../components/ScarcityBadge.svelte';\r\n\timport { tick } from '$lib/utils/haptic';\r\n\timport type { TicketTypeData, ScarcityLevel } from '$lib/public-calendar-flow/types';\r\n\timport {\r\n\t\tgetScarcityLevel,\r\n\t\tgetScarcityText,\r\n\t\tformatSmartSalesDate,\r\n\t\tDURATION\r\n\t} from '$lib/public-calendar-flow/defaults';\r\n\r\n\tinterface Props {\r\n\t\tticket: TicketTypeData;\r\n\t\tquantity: number;\r\n\t\tonQuantityChange: (ticketId: TicketId, quantity: number) => void;\r\n\t\tdonationAmount?: string;\r\n\t\tonDonationChange?: (ticketId: TicketId, amount: string) => void;\r\n\t\tisRevealedByPromo?: boolean;\r\n\t\tisDiscountedByPromo?: boolean;\r\n\t\tdiscountedPrice?: number | null;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet {\r\n\t\tticket,\r\n\t\tquantity,\r\n\t\tonQuantityChange,\r\n\t\tdonationAmount = '',\r\n\t\tonDonationChange,\r\n\t\tisRevealedByPromo = false,\r\n\t\tisDiscountedByPromo = false,\r\n\t\tdiscountedPrice = null,\r\n\t\tlabels = {},\r\n\t}: Props = $props();\r\n\r\n\t// --- State detection ---\r\n\tlet isDonation = $derived(ticket.isDonation || ticket.ticketType === 2);\r\n\tlet isSoldOut = $derived(ticket.status === 'sold_out' || ticket.quantityAvailable === 0);\r\n\tlet isComingSoon = $derived(ticket.status === 'coming_soon');\r\n\tlet isSalesEnded = $derived(ticket.status === 'sales_ended');\r\n\tlet isDisabled = $derived(isSoldOut || isComingSoon || isSalesEnded);\r\n\r\n\tlet scarcityLevel: ScarcityLevel = $derived(\r\n\t\tgetScarcityLevel(ticket.quantityAvailable, ticket.quantityTotal)\r\n\t);\r\n\tlet scarcityText = $derived(getScarcityText(scarcityLevel, ticket.quantityAvailable, 'ticket'));\r\n\r\n\t// Donation validation\r\n\tlet donationValue = $derived(parseFloat(donationAmount) || 0);\r\n\tlet donationError = $derived(\r\n\t\tisDonation && donationAmount !== '' && donationValue < 1 ? 'Minimum $1.00' : ''\r\n\t);\r\n\tlet isDonationValid = $derived(!isDonation || (donationAmount !== '' && donationValue >= 1));\r\n\r\n\tlet canDecrement = $derived(quantity > 0);\r\n\tlet canIncrement = $derived(\r\n\t\t!isDisabled &&\r\n\t\tquantity < ticket.maxPerOrder &&\r\n\t\tquantity < ticket.quantityAvailable &&\r\n\t\tisDonationValid\r\n\t);\r\n\r\n\tfunction decrement() {\r\n\t\tif (canDecrement) {\r\n\t\t\t// If decrementing would go below minimum, jump to 0 (remove from cart)\r\n\t\t\tconst newQty = quantity - 1;\r\n\t\t\tonQuantityChange(asTicketId(ticket.id), newQty < ticket.minPerOrder ? 0 : newQty);\r\n\t\t\ttick('light');\r\n\t\t}\r\n\t}\r\n\r\n\tfunction increment() {\r\n\t\tif (canIncrement) {\r\n\t\t\t// If at 0, jump to minimum purchase quantity\r\n\t\t\tconst newQty = quantity === 0 ? ticket.minPerOrder : quantity + 1;\r\n\t\t\tonQuantityChange(asTicketId(ticket.id), newQty);\r\n\t\t\ttick('light');\r\n\t\t}\r\n\t}\r\n\r\n\tlet donationInputValue = $state(donationAmount);\r\n\r\n\t// Sync external donationAmount prop to local state\r\n\t$effect(() => {\r\n\t\tdonationInputValue = donationAmount;\r\n\t});\r\n\r\n\t// Push local changes upstream\r\n\tfunction syncDonation() {\r\n\t\tif (donationInputValue !== donationAmount) {\r\n\t\t\t// eslint-disable-next-line micdrop/boundary-only-as-cast -- API response mapper: ticket.id arrives as raw number from server\r\n\t\tonDonationChange?.(asTicketId(ticket.id), donationInputValue);\r\n\t\t}\r\n\t}\r\n\r\n\t// Price display — show total inclusive of fees (matching production TicketBlock.svelte)\r\n\tlet totalPrice = $derived(isDonation ? 0 : ticket.price + (ticket.price === 0 ? 0 : ticket.fee));\r\n\tlet priceDisplay = $derived(\r\n\t\tisDonation ? '' : ticket.price === 0 ? (labels.free || 'Free') : formatCurrency(totalPrice as USD)\r\n\t);\r\n\tlet feeCaption = $derived(\r\n\t\t!isDonation && ticket.fee > 0 && ticket.price > 0 ? `incl. ${formatCurrency(ticket.fee as USD)} ${labels.fee || 'fee'}` : ''\r\n\t);\r\n\r\n\t// Sales start display for coming soon tickets\r\n\tlet salesStartDisplay = $derived(\r\n\t\tisComingSoon && ticket.salesStartDate\r\n\t\t\t? `Sales start ${formatSmartSalesDate(ticket.salesStartDate)}`\r\n\t\t\t: isComingSoon\r\n\t\t\t\t? 'Coming soon'\r\n\t\t\t\t: ''\r\n\t);\r\n</script>\r\n\r\n<article\r\n\tclass=\"ticket-card rounded-lg border p-4 transition-all\"\r\n\tclass:disabled-ticket={isDisabled}\r\n\tclass:revealed={isRevealedByPromo && !isDisabled}\r\n\tstyle=\"transition-duration: {DURATION.normal}ms;\"\r\n>\r\n\t<div class=\"vc-flex-between-start gap-4\">\r\n\t\t<!-- Ticket info -->\r\n\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t<div class=\"flex-row-2 flex-wrap\">\r\n\t\t\t\t<Heading level={4} size=\"sm\" weight=\"semibold\">\r\n\t\t\t\t\t{ticket.name}\r\n\t\t\t\t</Heading>\r\n\t\t\t\t{#if isSoldOut}\r\n\t\t\t\t\t<Badge variant=\"error\">{labels.soldOut || 'Sold out'}</Badge>\r\n\t\t\t\t{:else if isSalesEnded}\r\n\t\t\t\t\t<Badge variant=\"neutral\">Sales ended</Badge>\r\n\t\t\t\t{:else if isRevealedByPromo}\r\n\t\t\t\t\t<Badge variant=\"success\">Unlocked</Badge>\r\n\t\t\t\t{:else if isDiscountedByPromo}\r\n\t\t\t\t\t<Badge variant=\"green\">Discount applied</Badge>\r\n\t\t\t\t{:else if scarcityText && !isComingSoon}\r\n\t\t\t\t\t<ScarcityBadge\r\n\t\t\t\t\t\tremaining={ticket.quantityAvailable}\r\n\t\t\t\t\t\ttotal={ticket.quantityTotal}\r\n\t\t\t\t\t\tcontext=\"ticket\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t{#if ticket.description}\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-1 line-clamp-2\">\r\n\t\t\t\t\t{ticket.description}\r\n\t\t\t\t</Text>\r\n\t\t\t{/if}\r\n\r\n\t\t\t<!-- Price row -->\r\n\t\t\t<div class=\"flex-row-2 mt-2\">\r\n\t\t\t\t{#if isDonation}\r\n\t\t\t\t\t<!-- Donation: $ input -->\r\n\t\t\t\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\r\n\t\t\t\t\t<div class=\"donation-input-wrapper\" oninput={syncDonation}>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tlabel=\"Donation amount\"\r\n\t\t\t\t\t\t\tsize=\"md\"\r\n\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\tplaceholder=\"0.00\"\r\n\t\t\t\t\t\t\tbind:value={donationInputValue}\r\n\t\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\t\terrorText={donationError}\r\n\t\t\t\t\t\t\tcolor={donationError ? 'red' : 'base'}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t{:else if isDiscountedByPromo && discountedPrice !== null}\r\n\t\t\t\t\t<!-- Discounted: strikethrough original total + discounted total (both inclusive of fee) -->\r\n\t\t\t\t\t{@const discountedTotal = discountedPrice + (discountedPrice === 0 ? 0 : ticket.fee)}\r\n\t\t\t\t\t<span class=\"price-strikethrough\">{formatCurrency(totalPrice as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}</span>\r\n\t\t\t\t\t<span class=\"price-discounted\">{formatCurrency(discountedTotal as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}</span>\r\n\t\t\t\t\t{#if feeCaption}\r\n\t\t\t\t\t\t<span class=\"price-fee\">{feeCaption}</span>\r\n\t\t\t\t\t{/if}\r\n\t\t\t\t{:else if isComingSoon}\r\n\t\t\t\t\t<!-- Coming soon: show price dimmed -->\r\n\t\t\t\t\t<span class=\"price-lg text-color-muted\">{priceDisplay}</span>\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t<!-- Standard price -->\r\n\t\t\t\t\t<span class=\"price-lg text-color-primary\">{priceDisplay}</span>\r\n\t\t\t\t\t{#if feeCaption}\r\n\t\t\t\t\t\t<span class=\"price-fee\">{feeCaption}</span>\r\n\t\t\t\t\t{/if}\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t<!-- Coming soon / sales ended message -->\r\n\t\t\t{#if salesStartDisplay}\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-1.5\">\r\n\t\t\t\t\t{salesStartDisplay}\r\n\t\t\t\t</Text>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\r\n\t\t<!-- Quantity controls -->\r\n\t\t<div class=\"flex items-center quantity-selector\">\r\n\t\t\t{#if isSoldOut || isComingSoon || isSalesEnded}\r\n\t\t\t\t<!-- No controls for coming soon / sales ended -->\r\n\t\t\t{:else}\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant=\"alternative\"\r\n\t\t\t\t\tsize=\"icon-lg\"\r\n\t\t\t\t\tonclick={decrement}\r\n\t\t\t\t\tdisabled={!canDecrement}\r\n\t\t\t\t\taria-label=\"{labels.decrease || 'Decrease'} {ticket.name} {labels.quantity || 'quantity'}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<Subtract size={16} />\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<span\r\n\t\t\t\t\tclass=\"qty-display\"\r\n\t\t\t\t\taria-live=\"polite\"\r\n\t\t\t\t\taria-label=\"{ticket.name} {labels.quantity || 'quantity'}: {quantity}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{quantity}\r\n\t\t\t\t</span>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant=\"alternative\"\r\n\t\t\t\t\tsize=\"icon-lg\"\r\n\t\t\t\t\tonclick={increment}\r\n\t\t\t\t\tdisabled={!canIncrement}\r\n\t\t\t\t\taria-label=\"{labels.increase || 'Increase'} {ticket.name} {labels.quantity || 'quantity'}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<Add size={16} />\r\n\t\t\t\t</Button>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\t</div>\r\n</article>\r\n\r\n<style>\r\n\t/* Card states using HSL CSS variables (matching TicketBlock.svelte) */\r\n\t.ticket-card {\r\n\t\tborder-color: hsl(var(--stroke-secondary, 220 13% 91%));\r\n\t\tbackground-color: hsl(var(--ts-card-bg, var(--bg-primary, 0 0% 100%)));\r\n\t}\r\n\r\n\t.ticket-card.revealed {\r\n\t\tborder-color: hsl(var(--accent-success) / 50%);\r\n\t\tbackground-color: hsl(var(--accent-success) / 8%);\r\n\t}\r\n\r\n\t.ticket-card.disabled-ticket {\r\n\t\topacity: 0.5;\r\n\t}\r\n\r\n\t/* Quantity selector */\r\n\t.quantity-selector {\r\n\t\tgap: 0.5rem;\r\n\t\tuser-select: none;\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t.qty-display {\r\n\t\tmin-width: 2rem;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t\tfont-size: 1.125rem;\r\n\t\tfont-weight: 600;\r\n\t\tcolor: hsl(var(--text-primary, 222 47% 11%));\r\n\t\tuser-select: none;\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t/* Discounted price green text */\r\n\t.price-discounted {\r\n\t\tfont-size: 0.875rem;\r\n\t\tline-height: 1.25rem;\r\n\t\tfont-weight: 600;\r\n\t\tcolor: hsl(var(--accent-success)); /* green-600 */\r\n\t}\r\n\r\n\t/* Donation input wrapper */\r\n\t.donation-input-wrapper {\r\n\t\tmin-width: 10rem;\r\n\t}\r\n\r\n .ticket-card {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tborder-color: hsl(var(--stroke-secondary, 215 19% 35%));\r\n\t\tbackground-color: hsl(var(--ts-card-bg, var(--bg-primary, 222 47% 11%)));\r\n\t }\r\n }\r\n\r\n .ticket-card.revealed {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tborder-color: hsl(var(--accent-success)); /* green-700 */\r\n\t\tbackground-color: hsl(var(--accent-success));\r\n\t }\r\n }\r\n\r\n .qty-display {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tcolor: hsl(var(--text-primary, 0 0% 100%));\r\n\t }\r\n }\r\n</style>\r\n","<script lang=\"ts\">\r\n\timport { Input, Button } from '@getmicdrop/svelte-components';\r\n\timport type { PromoCodeState } from '$lib/public-calendar-flow/types';\r\n\timport { DURATION } from '$lib/public-calendar-flow/defaults';\r\n\r\n\tinterface Props {\r\n\t\tpromoState: PromoCodeState;\r\n\t\tonApply: (code: string) => void;\r\n\t\tonRemove: () => void;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { promoState, onApply, onRemove, labels = {}, }: Props = $props();\r\n\r\n\tlet isExpanded = $state(false);\r\n\tlet inputValue = $state('');\r\n\r\n\tfunction handleApply() {\r\n\t\tconst trimmed = inputValue.trim();\r\n\t\tif (!trimmed) return;\r\n\t\tonApply(trimmed);\r\n\t}\r\n\r\n\tfunction handleRemove() {\r\n\t\tinputValue = '';\r\n\t\tonRemove();\r\n\t}\r\n\r\n\tfunction handleKeydown(e: KeyboardEvent) {\r\n\t\tif (e.key === 'Enter') {\r\n\t\t\te.preventDefault();\r\n\t\t\thandleApply();\r\n\t\t}\r\n\t}\r\n\r\n\t// Auto-expand when promo is applied (e.g. on restore)\r\n\tlet shouldExpand = $derived(promoState.isApplied || isExpanded);\r\n</script>\r\n\r\n<div class=\"promo-section\" role=\"group\" aria-labelledby=\"promo-label\">\r\n\t<span id=\"promo-label\" class=\"sr-only\">Promo code entry</span>\r\n\t{#if !shouldExpand}\r\n\t\t<Button variant=\"link\" onclick={() => (isExpanded = true)}>\r\n\t\t\t{labels.havePromoCode || 'Have a promo code?'}\r\n\t\t</Button>\r\n\t{:else}\r\n\t\t<div\r\n\t\t\tclass=\"space-y-2\"\r\n\t\t\tstyle=\"animation: promoSlideIn {DURATION.normal}ms ease-out;\"\r\n\t\t>\r\n\t\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\r\n\t\t\t<div class=\"promo-input-wrapper\" onkeydown={handleKeydown}>\r\n\t\t\t\t<div class=\"flex-1\">\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\tlabel={labels.promoCode || 'Promo code'}\r\n\t\t\t\t\t\tplaceholder={labels.enterCode || 'Enter code'}\r\n\t\t\t\t\t\tsize=\"md\"\r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tbind:value={inputValue}\r\n\t\t\t\t\t\tdisabled={promoState.isApplied || promoState.isValidating}\r\n\t\t\t\t\t\terrorText={promoState.error || ''}\r\n\t\t\t\t\t\tcolor={promoState.error ? 'red' : 'base'}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t{#if promoState.isApplied}\r\n\t\t\t\t\t<Button variant=\"outline\" onclick={handleRemove} class=\"h-10 self-start mt-5\" aria-label={labels.removePromoCode || 'Remove promo code'}>\r\n\t\t\t\t\t\t{labels.remove || 'Remove'}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tonclick={handleApply}\r\n\t\t\t\t\t\tdisabled={promoState.isValidating || !inputValue.trim()}\r\n\t\t\t\t\t\tclass=\"h-10 self-start mt-5\"\r\n\t\t\t\t\t\taria-label={promoState.isValidating ? (labels.checkingPromoCode || 'Checking promo code') : (labels.applyPromoCode || 'Apply promo code')}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{promoState.isValidating ? (labels.checking || 'Checking...') : (labels.apply || 'Apply')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t<!-- Success hint -->\r\n\t\t\t{#if promoState.hint}\r\n\t\t\t\t<p class=\"promo-message success body-sm\" role=\"status\" aria-live=\"polite\">\r\n\t\t\t\t\t{promoState.hint}\r\n\t\t\t\t</p>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\t{/if}\r\n</div>\r\n\r\n<style>\r\n\t.promo-section {\r\n\t\tmargin-top: 1rem;\r\n\t}\r\n\r\n\t.promo-input-wrapper {\r\n\t\tdisplay: flex;\r\n\t\tgap: 0.5rem;\r\n\t\talign-items: flex-start;\r\n\t}\r\n\r\n\t.promo-message {\r\n\t\tmargin-top: 0.5rem;\r\n\t}\r\n\r\n\t.promo-message.success {\r\n\t\tcolor: hsl(var(--accent-success)); /* green-600 */\r\n\t}\r\n\r\n\t@keyframes promoSlideIn {\r\n\t\tfrom {\r\n\t\t\topacity: 0;\r\n\t\t\ttransform: translateY(-4px);\r\n\t\t}\r\n\r\n\t\tto {\r\n\t\t\topacity: 1;\r\n\t\t\ttransform: translateY(0);\r\n\t\t}\r\n\t}\r\n</style>\r\n"],"names":["tick","style","ms","donationAmount","isRevealedByPromo","isDiscountedByPromo","discountedPrice","labels","$","$$props","isDonation","isSoldOut","isComingSoon","isSalesEnded","isDisabled","scarcityLevel","getScarcityLevel","scarcityText","getScarcityText","donationValue","donationError","isDonationValid","canDecrement","canIncrement","decrement","newQty","asTicketId","increment","donationInputValue","syncDonation","totalPrice","priceDisplay","formatCurrency","feeCaption","salesStartDisplay","formatSmartSalesDate","article","root","div","div_1","div_2","Heading","node","Badge","$$anchor","ScarcityBadge","$$render","consequent","consequent_1","consequent_3","consequent_4","Text","consequent_5","div_3","node_2","div_4","root_13","Input","node_4","$$value","discountedTotal","span","fragment_9","span_1","span_2","root_15","consequent_7","span_3","root_16","span_4","fragment_10","span_5","root_18","consequent_10","consequent_9","alternate","consequent_11","div_5","Button","node_9","Subtract","span_6","node_10","Add","consequent_12","alternate_1","classes","DURATION","isExpanded","inputValue","handleApply","trimmed","handleRemove","handleKeydown","e","shouldExpand","root_3","$2","$3","node_1","p","root_8","consequent_2"],"mappings":";;;;;;;;AAcO,SAASA,GAAKC,IAAsC,SAAe;AAEzE,MADI,OAAO,SAAW,OAClB,OAAO,YAAc,OAAe,CAAC,UAAU,QAAS;AAC5D,QAAMC,IAAKD,MAAU,UAAU,IAAIA,MAAU,WAAW,KAAK;AAC7D,YAAU,QAAQC,CAAE;AACrB;;kBCnBA;;AA8BE,MAAAC,mCAAiB,EAAE,GAEnBC,sCAAoB,EAAK,GACzBC,wCAAsB,EAAK,GAC3BC,oCAAkB,IAAI,GACtBC,IAAMC,EAAA,KAAAC,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA,GAIHC,IAAUF,EAAA,QAAA,MAAAC,EAAA,OAAmB,cAAUA,EAAA,OAAW,eAAe,CAAC,GAClEE,6BAA4B,WAAW,cAAUF,EAAA,OAAW,sBAAsB,CAAC,GACnFG,IAAYJ,EAAA,QAAA,MAAAC,EAAA,OAAmB,WAAW,aAAa,GACvDI,IAAYL,EAAA,QAAA,MAAAC,EAAA,OAAmB,WAAW,aAAa,GACvDK,IAAUN,EAAA,QAAA,MAAAA,EAAA,IAAYG,CAAS,KAAAH,EAAA,IAAII,CAAY,WAAIC,CAAY,CAAA,GAE/DE,IAA4BP,EAAA,QAAA,MAC/BQ,GAAgBP,EAAA,OAAQ,4BAA0B,aAAa,CAAA,GAE5DQ,oBAAwBC,GAAeV,EAAA,IAACO,CAAa,GAAAN,EAAA,OAAS,mBAAmB,QAAQ,CAAA,GAGzFU,IAAaX,EAAA,QAAA,MAAY,WAAWL,EAAc,MAAK,CAAC,GACxDiB,IAAaZ,EAAA,QAAA,MAAAA,EAAA,IAChBE,CAAU,KAAIP,EAAc,MAAK,MAAEK,EAAA,I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