@getmicdrop/venue-calendar 4.0.17 → 4.0.20
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/AirbnbSplitMain-Wz79VNen.js +2251 -0
- package/dist/AirbnbSplitMain-Wz79VNen.js.map +1 -0
- package/dist/{CarouselView.legacy-C0cRJS-3.js → CarouselView.legacy-DLQhvBNY.js} +3 -3
- package/dist/CarouselView.legacy-DLQhvBNY.js.map +1 -0
- package/dist/CartView-PJvVTSos.js +1698 -0
- package/dist/CartView-PJvVTSos.js.map +1 -0
- package/dist/{Checkout-5WyBsOUz.js → Checkout-BZOTf4nF.js} +128 -125
- package/dist/Checkout-BZOTf4nF.js.map +1 -0
- package/dist/{Checkout.legacy-x2UOIEi6.js → Checkout.legacy-CwrYTqT2.js} +196 -196
- package/dist/Checkout.legacy-CwrYTqT2.js.map +1 -0
- package/dist/{CheckoutMain-DbwF9DJU.js → CheckoutMain-o0AFbrSA.js} +499 -499
- package/dist/CheckoutMain-o0AFbrSA.js.map +1 -0
- package/dist/{CheckoutTimer-lq9B5TfI.js → CheckoutTimer-BTxuvxKM.js} +2 -2
- package/dist/{CheckoutTimer-lq9B5TfI.js.map → CheckoutTimer-BTxuvxKM.js.map} +1 -1
- package/dist/{CollectionView-DMp_ShDZ.js → CollectionView-J9OmVdPH.js} +22 -22
- package/dist/{CollectionView-DMp_ShDZ.js.map → CollectionView-J9OmVdPH.js.map} +1 -1
- package/dist/{CollectionView.legacy-iqREDeXb.js → CollectionView.legacy-Dm1-Myj3.js} +53 -53
- package/dist/{CollectionView.legacy-iqREDeXb.js.map → CollectionView.legacy-Dm1-Myj3.js.map} +1 -1
- package/dist/{EventDetailsView-Bt4ekqYp.js → EventDetailsView-DumsB2_T.js} +2 -2
- package/dist/{EventDetailsView-Bt4ekqYp.js.map → EventDetailsView-DumsB2_T.js.map} +1 -1
- package/dist/{FeaturedView.legacy-DN2Abh2g.js → FeaturedView.legacy-CpCOAi81.js} +32 -32
- package/dist/{FeaturedView.legacy-DN2Abh2g.js.map → FeaturedView.legacy-CpCOAi81.js.map} +1 -1
- package/dist/{GalleryCard-DCxMRHdL.js → GalleryCard-ClOMciuA.js} +18 -18
- package/dist/{GalleryCard-DCxMRHdL.js.map → GalleryCard-ClOMciuA.js.map} +1 -1
- package/dist/{GalleryView.legacy-fF5jz57f.js → GalleryView.legacy-BBkCpmF1.js} +9 -9
- package/dist/{GalleryView.legacy-fF5jz57f.js.map → GalleryView.legacy-BBkCpmF1.js.map} +1 -1
- package/dist/{GroupedListView.legacy-oU5NjDaG.js → GroupedListView.legacy-ch0yYGJD.js} +20 -20
- package/dist/{GroupedListView.legacy-oU5NjDaG.js.map → GroupedListView.legacy-ch0yYGJD.js.map} +1 -1
- package/dist/Heading-AFd3o0xt.js.map +1 -1
- package/dist/{SeriesPage-DQftH9yI.js → SeriesPage-Picw22FM.js} +5 -5
- package/dist/{SeriesPage-DQftH9yI.js.map → SeriesPage-Picw22FM.js.map} +1 -1
- package/dist/{SeriesPage.legacy-DyZXSsXv.js → SeriesPage.legacy-CnVhVfLT.js} +44 -44
- package/dist/{SeriesPage.legacy-DyZXSsXv.js.map → SeriesPage.legacy-CnVhVfLT.js.map} +1 -1
- package/dist/{Success-BkrSlcZJ.js → Success-ZS8yIPoc.js} +122 -120
- package/dist/Success-ZS8yIPoc.js.map +1 -0
- package/dist/{Success.legacy-6_EgTF8T.js → Success.legacy-CBtg-aS-.js} +25 -25
- package/dist/{Success.legacy-6_EgTF8T.js.map → Success.legacy-CBtg-aS-.js.map} +1 -1
- package/dist/Text-CXR2fhx6.js.map +1 -1
- package/dist/{VenueCalendar-BjvqDumC.js → VenueCalendar-D-i3taSj.js} +6522 -6062
- package/dist/VenueCalendar-D-i3taSj.js.map +1 -0
- package/dist/{ViewTicketsEmbed-uzMst6xe.js → ViewTicketsEmbed-CSAwEkBy.js} +97 -97
- package/dist/{ViewTicketsEmbed-uzMst6xe.js.map → ViewTicketsEmbed-CSAwEkBy.js.map} +1 -1
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.cjs.map +1 -1
- package/dist/api/api.mjs +622 -563
- package/dist/api/api.mjs.map +1 -1
- package/dist/api/cta.d.ts +5 -1
- package/dist/api/gift-cards.d.ts +0 -5
- package/dist/api/index.d.ts +3 -2
- package/dist/api/orders.d.ts +30 -0
- package/dist/api/types.d.ts +10 -1
- package/dist/{labels-CNpTKuG-.js → labels-s8pbx3tn.js} +435 -282
- package/dist/labels-s8pbx3tn.js.map +1 -0
- package/dist/{transform-CujsjTyt.js → transform-CyWcWnyR.js} +111 -75
- package/dist/transform-CyWcWnyR.js.map +1 -0
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +25 -25
- package/dist/venue-calendar.iife.js +45 -45
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +45 -45
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +163 -163
- package/dist/AirbnbSplitMain-CR7SsRG2.js +0 -2201
- package/dist/AirbnbSplitMain-CR7SsRG2.js.map +0 -1
- package/dist/CarouselView.legacy-C0cRJS-3.js.map +0 -1
- package/dist/CartView-DaYfGxiQ.js +0 -1708
- package/dist/CartView-DaYfGxiQ.js.map +0 -1
- package/dist/Checkout-5WyBsOUz.js.map +0 -1
- package/dist/Checkout.legacy-x2UOIEi6.js.map +0 -1
- package/dist/CheckoutMain-DbwF9DJU.js.map +0 -1
- package/dist/Success-BkrSlcZJ.js.map +0 -1
- package/dist/VenueCalendar-BjvqDumC.js.map +0 -1
- package/dist/labels-CNpTKuG-.js.map +0 -1
- package/dist/transform-CujsjTyt.js.map +0 -1
package/dist/api/api.mjs
CHANGED
|
@@ -1,116 +1,117 @@
|
|
|
1
|
-
import { createLogger as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { createLogger as p } from "@getmicdrop/svelte-components/utils/logger";
|
|
2
|
+
import { AppError as C } from "@getmicdrop/svelte-components";
|
|
3
|
+
import { formatDateRaw as q, formatCurrency as O } from "@getmicdrop/svelte-components/utils/formatters";
|
|
4
|
+
const x = p("VC"), G = {
|
|
4
5
|
baseUrl: "https://get-micdrop.com",
|
|
5
6
|
timeout: 3e4,
|
|
6
7
|
retries: 2,
|
|
7
8
|
retryDelay: 500,
|
|
8
|
-
onError: (e) =>
|
|
9
|
+
onError: (e) => x.error("API Error:", e)
|
|
9
10
|
};
|
|
10
|
-
let
|
|
11
|
-
function
|
|
12
|
-
|
|
11
|
+
let y = { ...G };
|
|
12
|
+
function ie(e) {
|
|
13
|
+
y = { ...y, ...e };
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
return { ...
|
|
15
|
+
function ue() {
|
|
16
|
+
return { ...y };
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return `${
|
|
18
|
+
function c() {
|
|
19
|
+
return `${y.baseUrl}/api/v2/public`;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return `${
|
|
21
|
+
function le() {
|
|
22
|
+
return `${y.baseUrl}/api/public`;
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return `${
|
|
24
|
+
function A() {
|
|
25
|
+
return `${y.baseUrl}/api/orders/v2/public`;
|
|
25
26
|
}
|
|
26
|
-
async function
|
|
27
|
+
async function de() {
|
|
27
28
|
return "";
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
-
async function L(e,
|
|
31
|
-
const
|
|
30
|
+
const B = (e) => new Promise((t) => setTimeout(t, e));
|
|
31
|
+
async function L(e, t, r) {
|
|
32
|
+
const n = (t.method || "GET").toUpperCase(), a = n === "GET" || n === "HEAD" ? r.retries + 1 : 1;
|
|
32
33
|
let s;
|
|
33
|
-
for (let i = 1; i <=
|
|
34
|
-
const l = new AbortController(),
|
|
35
|
-
let
|
|
36
|
-
|
|
34
|
+
for (let i = 1; i <= a; i++) {
|
|
35
|
+
const l = new AbortController(), _ = setTimeout(() => l.abort(), r.timeout), h = t.signal;
|
|
36
|
+
let m;
|
|
37
|
+
h && (h.aborted ? l.abort() : (m = () => l.abort(), h.addEventListener("abort", m, { once: !0 })));
|
|
37
38
|
try {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
s = new Error(`HTTP ${
|
|
39
|
+
const g = await fetch(e, { ...t, signal: l.signal });
|
|
40
|
+
if (g.status >= 500 && i < a)
|
|
41
|
+
s = new Error(`HTTP ${g.status}`);
|
|
41
42
|
else
|
|
42
|
-
return
|
|
43
|
-
} catch (
|
|
44
|
-
if (s =
|
|
43
|
+
return g;
|
|
44
|
+
} catch (g) {
|
|
45
|
+
if (s = g, h?.aborted) throw g;
|
|
45
46
|
} finally {
|
|
46
|
-
clearTimeout(
|
|
47
|
+
clearTimeout(_), h && m && h.removeEventListener("abort", m);
|
|
47
48
|
}
|
|
48
|
-
i <
|
|
49
|
+
i < a && await B(r.retryDelay * Math.pow(2, i - 1));
|
|
49
50
|
}
|
|
50
51
|
throw s;
|
|
51
52
|
}
|
|
52
|
-
async function
|
|
53
|
-
return
|
|
53
|
+
async function fe(e, t) {
|
|
54
|
+
return N("GET", e, void 0, t);
|
|
54
55
|
}
|
|
55
|
-
async function
|
|
56
|
-
return
|
|
56
|
+
async function me(e, t, r) {
|
|
57
|
+
return N("POST", e, t, r);
|
|
57
58
|
}
|
|
58
|
-
async function
|
|
59
|
-
return
|
|
59
|
+
async function he(e, t, r) {
|
|
60
|
+
return N("PUT", e, t, r);
|
|
60
61
|
}
|
|
61
|
-
async function
|
|
62
|
-
return
|
|
62
|
+
async function ye(e, t) {
|
|
63
|
+
return N("DELETE", e, void 0, t);
|
|
63
64
|
}
|
|
64
|
-
async function
|
|
65
|
-
const
|
|
65
|
+
async function N(e, t, r, n) {
|
|
66
|
+
const o = t.startsWith("http") ? t : `${c()}${t}`;
|
|
66
67
|
try {
|
|
67
|
-
const
|
|
68
|
-
|
|
68
|
+
const a = await L(
|
|
69
|
+
o,
|
|
69
70
|
{
|
|
70
71
|
method: e,
|
|
71
72
|
headers: {
|
|
72
73
|
"Content-Type": "application/json",
|
|
73
|
-
...
|
|
74
|
+
...n?.headers
|
|
74
75
|
},
|
|
75
|
-
body:
|
|
76
|
+
body: r !== void 0 ? JSON.stringify(r) : void 0,
|
|
76
77
|
credentials: "include",
|
|
77
|
-
...
|
|
78
|
+
...n
|
|
78
79
|
},
|
|
79
|
-
|
|
80
|
+
y
|
|
80
81
|
);
|
|
81
|
-
if (!
|
|
82
|
-
const i = await
|
|
83
|
-
return
|
|
82
|
+
if (!a.ok) {
|
|
83
|
+
const i = await a.json().catch(() => ({})), l = i.error || i.message || `HTTP ${a.status}`;
|
|
84
|
+
return y.onError(new Error(l)), { success: !1, error: l, statusCode: a.status };
|
|
84
85
|
}
|
|
85
|
-
return { success: !0, data: await
|
|
86
|
-
} catch (
|
|
87
|
-
const s =
|
|
88
|
-
return
|
|
89
|
-
|
|
86
|
+
return { success: !0, data: await a.json(), statusCode: a.status };
|
|
87
|
+
} catch (a) {
|
|
88
|
+
const s = a instanceof Error ? a.name === "AbortError" ? "Request timed out" : a.message : "Unknown error";
|
|
89
|
+
return y.onError(
|
|
90
|
+
a instanceof Error ? a : new Error(s)
|
|
90
91
|
), { success: !1, error: s };
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
async function
|
|
94
|
+
async function z(e, t) {
|
|
94
95
|
try {
|
|
95
|
-
const
|
|
96
|
+
const r = await L(
|
|
96
97
|
e,
|
|
97
|
-
{ credentials: "include", ...
|
|
98
|
-
|
|
98
|
+
{ credentials: "include", ...t },
|
|
99
|
+
y
|
|
99
100
|
);
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
return
|
|
101
|
+
if (!r.ok) {
|
|
102
|
+
const n = await r.json().catch(() => ({}));
|
|
103
|
+
return x.error(`API request failed: ${r.status}`, n), null;
|
|
103
104
|
}
|
|
104
|
-
return
|
|
105
|
-
} catch (
|
|
106
|
-
return
|
|
105
|
+
return r.json();
|
|
106
|
+
} catch (r) {
|
|
107
|
+
return x.error("API request error:", r), null;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
const
|
|
110
|
-
async function
|
|
110
|
+
const f = p("VC");
|
|
111
|
+
async function ge(e, t, r) {
|
|
111
112
|
try {
|
|
112
|
-
const
|
|
113
|
-
`${
|
|
113
|
+
const n = await fetch(
|
|
114
|
+
`${A()}/cart/${e}/payment-intent`,
|
|
114
115
|
{
|
|
115
116
|
method: "POST",
|
|
116
117
|
headers: {
|
|
@@ -118,56 +119,82 @@ async function fe(e, r, t) {
|
|
|
118
119
|
},
|
|
119
120
|
credentials: "include",
|
|
120
121
|
body: JSON.stringify({
|
|
121
|
-
productQuantities:
|
|
122
|
-
...
|
|
122
|
+
productQuantities: t,
|
|
123
|
+
...r && Object.keys(r).length > 0 ? { donationAmounts: r } : {}
|
|
123
124
|
})
|
|
124
125
|
}
|
|
125
126
|
);
|
|
126
|
-
if (!
|
|
127
|
-
const
|
|
128
|
-
throw
|
|
127
|
+
if (!n.ok) {
|
|
128
|
+
const a = await n.json().catch(() => ({}));
|
|
129
|
+
throw f.error("Payment intent creation failed:", a), new C(a.error || "Failed to create payment intent", "lib/api/orders/createPaymentIntent");
|
|
129
130
|
}
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
} catch (
|
|
133
|
-
return
|
|
131
|
+
const o = await n.json();
|
|
132
|
+
return f.debug("Payment intent created:", o), o;
|
|
133
|
+
} catch (n) {
|
|
134
|
+
return f.error("createPaymentIntent error:", n), null;
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
async function
|
|
137
|
+
async function we(e, t) {
|
|
138
|
+
if (!e) return null;
|
|
137
139
|
try {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
+
const r = await fetch(`${A()}/cart/${e}`, {
|
|
141
|
+
method: "GET",
|
|
142
|
+
headers: { "Content-Type": "application/json" },
|
|
143
|
+
credentials: "include"
|
|
144
|
+
});
|
|
145
|
+
if (!r.ok)
|
|
146
|
+
return null;
|
|
147
|
+
const n = await r.json(), o = n.UUID ?? n.uuid ?? "", a = Number(n.EventID ?? n.eventID ?? 0), s = n.Status ?? n.status ?? "", i = n.ExpiresAt ?? n.expiresAt ?? "", _ = (n.Reservations ?? n.reservations ?? []).map((h) => {
|
|
148
|
+
const m = h;
|
|
149
|
+
return {
|
|
150
|
+
ticketID: Number(m.TicketID ?? m.ticketID ?? 0),
|
|
151
|
+
quantity: Number(m.Quantity ?? m.quantity ?? 0),
|
|
152
|
+
priceAtReservation: Number(
|
|
153
|
+
m.PriceAtReservation ?? m.priceAtReservation ?? 0
|
|
154
|
+
),
|
|
155
|
+
status: String(m.Status ?? m.status ?? "")
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
return s !== "reserved" && s !== "active" || t !== void 0 && a !== Number(t) ? null : { uuid: o, eventID: a, status: s, expiresAt: i, reservations: _ };
|
|
159
|
+
} catch (r) {
|
|
160
|
+
return f.error("getCartByUUID error:", r), null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async function ve(e, t, r) {
|
|
164
|
+
try {
|
|
165
|
+
const n = {};
|
|
166
|
+
for (const [s, i] of Object.entries(t)) {
|
|
140
167
|
const l = typeof s == "number" ? s : parseInt(s, 10);
|
|
141
|
-
!Number.isNaN(l) && i > 0 && (
|
|
168
|
+
!Number.isNaN(l) && i > 0 && (n[l] = i);
|
|
142
169
|
}
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
145
|
-
for (const [s, i] of Object.entries(
|
|
170
|
+
const o = {};
|
|
171
|
+
if (r)
|
|
172
|
+
for (const [s, i] of Object.entries(r)) {
|
|
146
173
|
const l = typeof s == "number" ? s : parseInt(s, 10);
|
|
147
|
-
!Number.isNaN(l) && i > 0 && (
|
|
174
|
+
!Number.isNaN(l) && i > 0 && (o[l] = i);
|
|
148
175
|
}
|
|
149
|
-
const
|
|
176
|
+
const a = await fetch(`${A()}/cart/${e}`, {
|
|
150
177
|
method: "PUT",
|
|
151
178
|
headers: { "Content-Type": "application/json" },
|
|
152
179
|
credentials: "include",
|
|
153
180
|
body: JSON.stringify({
|
|
154
|
-
quantities:
|
|
155
|
-
...Object.keys(
|
|
181
|
+
quantities: n,
|
|
182
|
+
...Object.keys(o).length > 0 ? { donationAmounts: o } : {}
|
|
156
183
|
})
|
|
157
184
|
});
|
|
158
|
-
if (!
|
|
159
|
-
const s = await
|
|
160
|
-
return
|
|
185
|
+
if (!a.ok) {
|
|
186
|
+
const s = await a.json().catch(() => ({}));
|
|
187
|
+
return f.error("Cart update failed:", s), !1;
|
|
161
188
|
}
|
|
162
189
|
return !0;
|
|
163
|
-
} catch (
|
|
164
|
-
return
|
|
190
|
+
} catch (n) {
|
|
191
|
+
return f.error("updateCartQuantities error:", n), !1;
|
|
165
192
|
}
|
|
166
193
|
}
|
|
167
|
-
async function
|
|
194
|
+
async function _e(e) {
|
|
168
195
|
try {
|
|
169
|
-
const
|
|
170
|
-
`${
|
|
196
|
+
const t = await fetch(
|
|
197
|
+
`${c()}/orders/complete/${e}`,
|
|
171
198
|
{
|
|
172
199
|
method: "POST",
|
|
173
200
|
headers: {
|
|
@@ -175,21 +202,21 @@ async function he(e) {
|
|
|
175
202
|
}
|
|
176
203
|
}
|
|
177
204
|
);
|
|
178
|
-
return
|
|
205
|
+
return t.ok ? {
|
|
179
206
|
success: !0,
|
|
180
|
-
message: (await
|
|
207
|
+
message: (await t.json()).message
|
|
181
208
|
} : {
|
|
182
209
|
success: !1,
|
|
183
|
-
error: (await
|
|
210
|
+
error: (await t.json().catch(() => ({}))).error || "Failed to complete reservation"
|
|
184
211
|
};
|
|
185
|
-
} catch (
|
|
186
|
-
return
|
|
212
|
+
} catch (t) {
|
|
213
|
+
return f.error("Error completing reservation:", t), { success: !1, error: "Network error completing reservation" };
|
|
187
214
|
}
|
|
188
215
|
}
|
|
189
|
-
async function
|
|
216
|
+
async function be(e) {
|
|
190
217
|
try {
|
|
191
|
-
const
|
|
192
|
-
`${
|
|
218
|
+
const t = await fetch(
|
|
219
|
+
`${c()}/orders/cancel/${e}`,
|
|
193
220
|
{
|
|
194
221
|
method: "POST",
|
|
195
222
|
headers: {
|
|
@@ -197,204 +224,208 @@ async function ye(e) {
|
|
|
197
224
|
}
|
|
198
225
|
}
|
|
199
226
|
);
|
|
200
|
-
return
|
|
227
|
+
return t.ok ? {
|
|
201
228
|
success: !0,
|
|
202
|
-
message: (await
|
|
229
|
+
message: (await t.json()).message
|
|
203
230
|
} : {
|
|
204
231
|
success: !1,
|
|
205
|
-
error: (await
|
|
232
|
+
error: (await t.json().catch(() => ({}))).error || "Failed to cancel reservation"
|
|
206
233
|
};
|
|
207
|
-
} catch (
|
|
208
|
-
return
|
|
234
|
+
} catch (t) {
|
|
235
|
+
return f.error("Error cancelling reservation:", t), { success: !1, error: "Network error cancelling reservation" };
|
|
209
236
|
}
|
|
210
237
|
}
|
|
211
|
-
async function
|
|
238
|
+
async function pe(e, t) {
|
|
212
239
|
try {
|
|
213
|
-
const
|
|
240
|
+
const r = await fetch(`${c()}/orders/create`, {
|
|
214
241
|
method: "POST",
|
|
215
242
|
headers: {
|
|
216
243
|
"Content-Type": "application/json"
|
|
217
244
|
},
|
|
218
245
|
body: JSON.stringify({
|
|
219
246
|
eventID: e,
|
|
220
|
-
promoCode:
|
|
247
|
+
promoCode: t
|
|
221
248
|
})
|
|
222
249
|
});
|
|
223
|
-
if (!
|
|
224
|
-
const
|
|
225
|
-
return
|
|
250
|
+
if (!r.ok) {
|
|
251
|
+
const n = await r.json().catch(() => ({}));
|
|
252
|
+
return f.error("Create order failed:", n), null;
|
|
226
253
|
}
|
|
227
|
-
return
|
|
228
|
-
} catch (
|
|
229
|
-
return
|
|
254
|
+
return r.json();
|
|
255
|
+
} catch (r) {
|
|
256
|
+
return f.error("createOrder error:", r), null;
|
|
230
257
|
}
|
|
231
258
|
}
|
|
232
|
-
async function
|
|
233
|
-
return
|
|
259
|
+
async function $e(e) {
|
|
260
|
+
return z(`${c()}/orders/${e}`);
|
|
234
261
|
}
|
|
235
|
-
async function
|
|
262
|
+
async function Pe(e, t) {
|
|
236
263
|
try {
|
|
237
|
-
const
|
|
238
|
-
`${
|
|
264
|
+
const r = await fetch(
|
|
265
|
+
`${A()}/validatePaymentIntent/${e}`,
|
|
239
266
|
{
|
|
240
267
|
method: "POST",
|
|
241
268
|
headers: {
|
|
242
269
|
"Content-Type": "application/json"
|
|
243
270
|
},
|
|
244
|
-
body: JSON.stringify(
|
|
271
|
+
body: JSON.stringify(t)
|
|
245
272
|
}
|
|
246
273
|
);
|
|
247
|
-
if (!
|
|
248
|
-
const
|
|
249
|
-
return
|
|
274
|
+
if (!r.ok) {
|
|
275
|
+
const o = await r.json().catch(() => ({}));
|
|
276
|
+
return f.error("Payment validation failed:", o), {
|
|
250
277
|
success: !1,
|
|
251
278
|
status: "failed",
|
|
252
|
-
error:
|
|
279
|
+
error: o.error || "Payment validation failed"
|
|
253
280
|
};
|
|
254
281
|
}
|
|
255
|
-
const
|
|
282
|
+
const n = await r.json();
|
|
256
283
|
return {
|
|
257
284
|
success: !0,
|
|
258
|
-
status:
|
|
259
|
-
orderUUID:
|
|
285
|
+
status: n.status || "Payment succeeded",
|
|
286
|
+
orderUUID: n.orderUUID || n.uuid
|
|
260
287
|
};
|
|
261
|
-
} catch (
|
|
262
|
-
return
|
|
288
|
+
} catch (r) {
|
|
289
|
+
return f.error("validatePaymentIntent error:", r), null;
|
|
263
290
|
}
|
|
264
291
|
}
|
|
265
|
-
async function
|
|
292
|
+
async function Ce(e) {
|
|
266
293
|
try {
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
294
|
+
const t = await fetch(
|
|
295
|
+
`${c()}/orders/extend-session`,
|
|
296
|
+
{
|
|
297
|
+
method: "POST",
|
|
298
|
+
headers: {
|
|
299
|
+
"Content-Type": "application/json"
|
|
300
|
+
},
|
|
301
|
+
body: JSON.stringify({ orderUuid: e })
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
if (!t.ok)
|
|
275
305
|
return {
|
|
276
306
|
success: !1,
|
|
277
|
-
error: (await
|
|
307
|
+
error: (await t.json().catch(() => ({}))).error || "Failed to extend session",
|
|
308
|
+
statusCode: t.status
|
|
278
309
|
};
|
|
279
|
-
const
|
|
310
|
+
const r = await t.json();
|
|
280
311
|
return {
|
|
281
312
|
success: !0,
|
|
282
|
-
newExpiryTime:
|
|
283
|
-
remainingExtensions:
|
|
313
|
+
newExpiryTime: r.newExpiryTime,
|
|
314
|
+
remainingExtensions: r.remainingExtensions
|
|
284
315
|
};
|
|
285
|
-
} catch (
|
|
286
|
-
return
|
|
316
|
+
} catch (t) {
|
|
317
|
+
return f.error("Error extending checkout session:", t), { success: !1, error: "Network error extending session" };
|
|
287
318
|
}
|
|
288
319
|
}
|
|
289
|
-
async function
|
|
320
|
+
async function Se(e) {
|
|
290
321
|
try {
|
|
291
|
-
const
|
|
292
|
-
`${
|
|
322
|
+
const t = await fetch(
|
|
323
|
+
`${c()}/orders/session/${e}`
|
|
293
324
|
);
|
|
294
|
-
if (!
|
|
325
|
+
if (!t.ok)
|
|
295
326
|
return {
|
|
296
|
-
error: (await
|
|
297
|
-
notFound:
|
|
327
|
+
error: (await t.json().catch(() => ({}))).error || "No active session found",
|
|
328
|
+
notFound: t.status === 404
|
|
298
329
|
};
|
|
299
|
-
const
|
|
330
|
+
const r = await t.json();
|
|
300
331
|
return {
|
|
301
|
-
expiresAt:
|
|
302
|
-
extensionCount:
|
|
303
|
-
remainingExtensions:
|
|
304
|
-
canExtend:
|
|
305
|
-
reservationCount:
|
|
332
|
+
expiresAt: r.expiresAt,
|
|
333
|
+
extensionCount: r.extensionCount,
|
|
334
|
+
remainingExtensions: r.remainingExtensions,
|
|
335
|
+
canExtend: r.canExtend,
|
|
336
|
+
reservationCount: r.reservationCount
|
|
306
337
|
};
|
|
307
|
-
} catch (
|
|
308
|
-
return
|
|
338
|
+
} catch (t) {
|
|
339
|
+
return f.error("Error getting session status:", t), { error: "Network error getting session status" };
|
|
309
340
|
}
|
|
310
341
|
}
|
|
311
|
-
async function
|
|
342
|
+
async function De(e = {}) {
|
|
312
343
|
try {
|
|
313
|
-
const
|
|
344
|
+
const t = await fetch(`${c()}/orders/create`, {
|
|
314
345
|
method: "POST",
|
|
315
346
|
headers: {
|
|
316
347
|
"Content-Type": "application/json"
|
|
317
348
|
},
|
|
318
349
|
body: JSON.stringify(e)
|
|
319
350
|
});
|
|
320
|
-
if (!
|
|
321
|
-
const
|
|
322
|
-
return
|
|
351
|
+
if (!t.ok) {
|
|
352
|
+
const n = await t.json().catch(() => ({}));
|
|
353
|
+
return f.error("Order initiation failed:", n), null;
|
|
323
354
|
}
|
|
324
|
-
return (await
|
|
325
|
-
} catch (
|
|
326
|
-
return
|
|
355
|
+
return (await t.json()).uuid;
|
|
356
|
+
} catch (t) {
|
|
357
|
+
return f.error("initiateOrder error:", t), null;
|
|
327
358
|
}
|
|
328
359
|
}
|
|
329
|
-
async function
|
|
360
|
+
async function Ae(e) {
|
|
330
361
|
if (typeof window > "u") return;
|
|
331
|
-
const
|
|
362
|
+
const r = new URLSearchParams(window.location.search).get("utm_source") || "Direct";
|
|
332
363
|
try {
|
|
333
364
|
await fetch(
|
|
334
|
-
`${
|
|
365
|
+
`${c()}/utm/${e}/${encodeURIComponent(r)}`
|
|
335
366
|
);
|
|
336
|
-
} catch (
|
|
337
|
-
|
|
367
|
+
} catch (n) {
|
|
368
|
+
f.error("UTM tracking failed:", n);
|
|
338
369
|
}
|
|
339
370
|
}
|
|
340
|
-
const
|
|
341
|
-
async function
|
|
371
|
+
const k = p("VC");
|
|
372
|
+
async function je(e, t) {
|
|
342
373
|
try {
|
|
343
|
-
if (!
|
|
374
|
+
if (!t || !t.trim())
|
|
344
375
|
return { valid: !1, error: "Promo code is required" };
|
|
345
|
-
const
|
|
346
|
-
`${
|
|
376
|
+
const r = encodeURIComponent(t.trim()), n = await fetch(
|
|
377
|
+
`${c()}/promo-codes/validate/${e}/${r}`
|
|
347
378
|
);
|
|
348
|
-
if (!
|
|
349
|
-
return
|
|
350
|
-
const
|
|
379
|
+
if (!n.ok)
|
|
380
|
+
return n.status === 404 ? { valid: !1, error: "Invalid promo code" } : { valid: !1, error: (await n.json().catch(() => ({}))).error || "Failed to validate code" };
|
|
381
|
+
const o = await n.json();
|
|
351
382
|
return {
|
|
352
|
-
valid:
|
|
353
|
-
revealHiddenTickets:
|
|
354
|
-
revealTicketIds:
|
|
355
|
-
provideDiscount:
|
|
356
|
-
discountType:
|
|
357
|
-
amount:
|
|
358
|
-
code:
|
|
383
|
+
valid: o.valid ?? !0,
|
|
384
|
+
revealHiddenTickets: o.revealHiddenTickets,
|
|
385
|
+
revealTicketIds: o.revealTicketIds,
|
|
386
|
+
provideDiscount: o.provideDiscount,
|
|
387
|
+
discountType: o.discountType,
|
|
388
|
+
amount: o.amount,
|
|
389
|
+
code: o.code || t
|
|
359
390
|
};
|
|
360
|
-
} catch (
|
|
361
|
-
return
|
|
391
|
+
} catch (r) {
|
|
392
|
+
return k.error("Error validating promo code:", r), { valid: !1, error: "Network error validating code" };
|
|
362
393
|
}
|
|
363
394
|
}
|
|
364
|
-
async function
|
|
395
|
+
async function Ie(e) {
|
|
365
396
|
try {
|
|
366
|
-
const
|
|
367
|
-
`${
|
|
397
|
+
const t = await fetch(
|
|
398
|
+
`${c()}/promo-codes/check/${e}`
|
|
368
399
|
);
|
|
369
|
-
return
|
|
370
|
-
} catch (
|
|
371
|
-
return
|
|
400
|
+
return t.ok ? (await t.json()).hasPromoCodes === !0 : !0;
|
|
401
|
+
} catch (t) {
|
|
402
|
+
return k.error("Error checking promo codes availability:", t), !0;
|
|
372
403
|
}
|
|
373
404
|
}
|
|
374
|
-
async function
|
|
405
|
+
async function Ne(e, t) {
|
|
375
406
|
try {
|
|
376
|
-
const
|
|
377
|
-
`${
|
|
407
|
+
const r = await fetch(
|
|
408
|
+
`${c()}/orders/${e}/apply-promo`,
|
|
378
409
|
{
|
|
379
410
|
method: "POST",
|
|
380
411
|
headers: {
|
|
381
412
|
"Content-Type": "application/json"
|
|
382
413
|
},
|
|
383
|
-
body: JSON.stringify({ code:
|
|
414
|
+
body: JSON.stringify({ code: t })
|
|
384
415
|
}
|
|
385
416
|
);
|
|
386
|
-
return
|
|
417
|
+
return r.ok ? { success: !0 } : {
|
|
387
418
|
success: !1,
|
|
388
|
-
error: (await
|
|
419
|
+
error: (await r.json().catch(() => ({}))).error || "Failed to apply promo code"
|
|
389
420
|
};
|
|
390
|
-
} catch (
|
|
391
|
-
return
|
|
421
|
+
} catch (r) {
|
|
422
|
+
return k.error("Error applying promo code:", r), { success: !1, error: "Network error applying code" };
|
|
392
423
|
}
|
|
393
424
|
}
|
|
394
425
|
async function ke(e) {
|
|
395
426
|
try {
|
|
396
|
-
const
|
|
397
|
-
`${
|
|
427
|
+
const t = await fetch(
|
|
428
|
+
`${c()}/orders/${e}/remove-promo`,
|
|
398
429
|
{
|
|
399
430
|
method: "POST",
|
|
400
431
|
headers: {
|
|
@@ -402,460 +433,487 @@ async function ke(e) {
|
|
|
402
433
|
}
|
|
403
434
|
}
|
|
404
435
|
);
|
|
405
|
-
return
|
|
436
|
+
return t.ok ? { success: !0 } : {
|
|
406
437
|
success: !1,
|
|
407
|
-
error: (await
|
|
438
|
+
error: (await t.json().catch(() => ({}))).error || "Failed to remove promo code"
|
|
408
439
|
};
|
|
409
|
-
} catch (
|
|
410
|
-
return
|
|
440
|
+
} catch (t) {
|
|
441
|
+
return k.error("Error removing promo code:", t), { success: !1, error: "Network error removing code" };
|
|
411
442
|
}
|
|
412
443
|
}
|
|
413
|
-
const u =
|
|
414
|
-
async function
|
|
415
|
-
const
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
444
|
+
const u = p("VC"), I = /* @__PURE__ */ new Map();
|
|
445
|
+
async function xe(e, t = fetch) {
|
|
446
|
+
const r = String(e);
|
|
447
|
+
if (t === fetch) {
|
|
448
|
+
const o = I.get(r);
|
|
449
|
+
if (o) return o;
|
|
419
450
|
}
|
|
420
|
-
const
|
|
451
|
+
const n = (async () => {
|
|
421
452
|
try {
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
424
|
-
throw new
|
|
425
|
-
return await
|
|
426
|
-
} catch (
|
|
427
|
-
return u.error("Error fetching event details:",
|
|
453
|
+
const o = await t(`${c()}/events/${e}`);
|
|
454
|
+
if (!o.ok)
|
|
455
|
+
throw new C(`Failed to fetch event details: ${o.status}`, "lib/api/events/fetchEventDetails");
|
|
456
|
+
return await o.json();
|
|
457
|
+
} catch (o) {
|
|
458
|
+
return u.error("Error fetching event details:", o), null;
|
|
428
459
|
}
|
|
429
460
|
})();
|
|
430
|
-
return
|
|
431
|
-
|
|
432
|
-
})),
|
|
461
|
+
return t === fetch && (I.set(r, n), n.finally(() => {
|
|
462
|
+
I.get(r) === n && I.delete(r);
|
|
463
|
+
})), n;
|
|
433
464
|
}
|
|
434
|
-
async function
|
|
465
|
+
async function Te(e) {
|
|
435
466
|
try {
|
|
436
|
-
const
|
|
437
|
-
`${
|
|
467
|
+
const t = await fetch(
|
|
468
|
+
`${c()}/tickets/event/${e}`
|
|
438
469
|
);
|
|
439
|
-
if (!
|
|
440
|
-
throw new
|
|
441
|
-
const
|
|
442
|
-
return Array.isArray(
|
|
443
|
-
} catch (
|
|
444
|
-
return u.error("Error fetching tickets:",
|
|
470
|
+
if (!t.ok)
|
|
471
|
+
throw new C(`Failed to fetch tickets: ${t.status}`, "lib/api/events/fetchEventTickets");
|
|
472
|
+
const r = await t.json();
|
|
473
|
+
return Array.isArray(r) ? r : [];
|
|
474
|
+
} catch (t) {
|
|
475
|
+
return u.error("Error fetching tickets:", t), [];
|
|
445
476
|
}
|
|
446
477
|
}
|
|
447
|
-
async function
|
|
478
|
+
async function Fe(e) {
|
|
448
479
|
try {
|
|
449
480
|
if (!e)
|
|
450
481
|
return u.warn("fetchEventPerformers called without eventId"), { performers: [], showPerformers: !1 };
|
|
451
|
-
const
|
|
452
|
-
`${
|
|
482
|
+
const t = await fetch(
|
|
483
|
+
`${c()}/events/${e}/performers`
|
|
453
484
|
);
|
|
454
|
-
if (!
|
|
485
|
+
if (!t.ok)
|
|
455
486
|
return u.error(
|
|
456
|
-
`Failed to fetch performers: ${
|
|
487
|
+
`Failed to fetch performers: ${t.status} ${t.statusText}`
|
|
457
488
|
), { performers: [], showPerformers: !1 };
|
|
458
|
-
const
|
|
489
|
+
const r = await t.json();
|
|
459
490
|
return {
|
|
460
|
-
performers: Array.isArray(
|
|
461
|
-
showPerformers:
|
|
491
|
+
performers: Array.isArray(r.performers) ? r.performers : [],
|
|
492
|
+
showPerformers: r.showPerformers === !0
|
|
462
493
|
};
|
|
463
|
-
} catch (
|
|
464
|
-
return u.error("Error fetching event performers:",
|
|
494
|
+
} catch (t) {
|
|
495
|
+
return u.error("Error fetching event performers:", t), { performers: [], showPerformers: !1 };
|
|
465
496
|
}
|
|
466
497
|
}
|
|
467
|
-
async function
|
|
498
|
+
async function Ue(e) {
|
|
468
499
|
try {
|
|
469
500
|
if (!e)
|
|
470
501
|
return u.warn("fetchAllVenues called without orgId"), [];
|
|
471
|
-
const
|
|
472
|
-
`${
|
|
502
|
+
const t = await fetch(
|
|
503
|
+
`${c()}/venues/organization/${e}`
|
|
473
504
|
);
|
|
474
|
-
if (!
|
|
505
|
+
if (!t.ok)
|
|
475
506
|
return u.error(
|
|
476
|
-
`Failed to fetch venues: ${
|
|
507
|
+
`Failed to fetch venues: ${t.status} ${t.statusText}`
|
|
477
508
|
), [];
|
|
478
|
-
const
|
|
479
|
-
return Array.isArray(
|
|
480
|
-
} catch (
|
|
481
|
-
return u.error("Error fetching venues:",
|
|
509
|
+
const r = await t.json();
|
|
510
|
+
return Array.isArray(r) ? r : [];
|
|
511
|
+
} catch (t) {
|
|
512
|
+
return u.error("Error fetching venues:", t), [];
|
|
482
513
|
}
|
|
483
514
|
}
|
|
484
|
-
async function
|
|
515
|
+
async function Re(e) {
|
|
485
516
|
try {
|
|
486
517
|
if (!e)
|
|
487
518
|
return u.warn("fetchVenueEvents called without venueId"), [];
|
|
488
|
-
const
|
|
489
|
-
`${
|
|
519
|
+
const t = await fetch(
|
|
520
|
+
`${c()}/events/venue/${e}`
|
|
490
521
|
);
|
|
491
|
-
if (!
|
|
522
|
+
if (!t.ok)
|
|
492
523
|
return u.error(
|
|
493
|
-
`Failed to fetch venue events: ${
|
|
524
|
+
`Failed to fetch venue events: ${t.status} ${t.statusText}`
|
|
494
525
|
), [];
|
|
495
|
-
const
|
|
496
|
-
return Array.isArray(
|
|
497
|
-
} catch (
|
|
498
|
-
return u.error("Error fetching venue events:",
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
async function xe(e, r, t) {
|
|
502
|
-
try {
|
|
503
|
-
const o = await fetch(
|
|
504
|
-
`${a()}/events/venue/${e}/month/${r}/${t}`
|
|
505
|
-
);
|
|
506
|
-
if (!o.ok)
|
|
507
|
-
return u.error(`Failed to fetch month events: ${o.status}`), [];
|
|
508
|
-
const n = await o.json();
|
|
509
|
-
return Array.isArray(n.events) ? n.events : Array.isArray(n) ? n : [];
|
|
510
|
-
} catch (o) {
|
|
511
|
-
return u.error("Error fetching month events:", o), [];
|
|
526
|
+
const r = await t.json();
|
|
527
|
+
return Array.isArray(r) ? r : [];
|
|
528
|
+
} catch (t) {
|
|
529
|
+
return u.error("Error fetching venue events:", t), [];
|
|
512
530
|
}
|
|
513
531
|
}
|
|
514
|
-
async function
|
|
532
|
+
async function qe(e, t, r) {
|
|
515
533
|
try {
|
|
516
|
-
const
|
|
517
|
-
`${
|
|
534
|
+
const n = await fetch(
|
|
535
|
+
`${c()}/events/venue/${e}/month/${t}/${r}`
|
|
518
536
|
);
|
|
519
|
-
if (!
|
|
520
|
-
return u.error(`Failed to fetch
|
|
521
|
-
const
|
|
522
|
-
return Array.isArray(
|
|
523
|
-
} catch (
|
|
524
|
-
return u.error("Error fetching
|
|
537
|
+
if (!n.ok)
|
|
538
|
+
return u.error(`Failed to fetch month events: ${n.status}`), [];
|
|
539
|
+
const o = await n.json();
|
|
540
|
+
return Array.isArray(o.events) ? o.events : Array.isArray(o) ? o : [];
|
|
541
|
+
} catch (n) {
|
|
542
|
+
return u.error("Error fetching month events:", n), [];
|
|
525
543
|
}
|
|
526
544
|
}
|
|
527
|
-
async function
|
|
545
|
+
async function Ee(e, t, r) {
|
|
528
546
|
try {
|
|
529
|
-
const
|
|
530
|
-
`${
|
|
547
|
+
const n = await fetch(
|
|
548
|
+
`${c()}/events/organization/${e}/month/${t}/${r}`
|
|
531
549
|
);
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
550
|
+
if (!n.ok)
|
|
551
|
+
return u.error(`Failed to fetch org month events: ${n.status}`), [];
|
|
552
|
+
const o = await n.json();
|
|
553
|
+
return Array.isArray(o.events) ? o.events : Array.isArray(o) ? o : [];
|
|
554
|
+
} catch (n) {
|
|
555
|
+
return u.error("Error fetching org month events:", n), [];
|
|
535
556
|
}
|
|
536
557
|
}
|
|
537
|
-
async function
|
|
558
|
+
async function Le(e) {
|
|
538
559
|
try {
|
|
539
560
|
const t = await fetch(
|
|
540
|
-
`${
|
|
561
|
+
`${c()}/series/${e}/occurrences`
|
|
541
562
|
);
|
|
542
|
-
return t.ok ? t.json() : (u.error(`Failed to fetch series
|
|
563
|
+
return t.ok ? t.json() : (u.error(`Failed to fetch series occurrences: ${t.status}`), null);
|
|
543
564
|
} catch (t) {
|
|
544
565
|
return u.error("Error fetching series occurrences:", t), null;
|
|
545
566
|
}
|
|
546
567
|
}
|
|
547
|
-
async function
|
|
568
|
+
async function Oe(e, t) {
|
|
548
569
|
try {
|
|
549
570
|
const r = await fetch(
|
|
550
|
-
`${
|
|
571
|
+
`${c()}/series/${e}/occurrences?venueId=${t}`
|
|
551
572
|
);
|
|
552
|
-
|
|
553
|
-
throw new Error(`Failed to fetch series page: ${r.status}`);
|
|
554
|
-
return r.json();
|
|
573
|
+
return r.ok ? r.json() : (u.error(`Failed to fetch series with CTA: ${r.status}`), null);
|
|
555
574
|
} catch (r) {
|
|
556
|
-
return u.error("Error fetching series
|
|
575
|
+
return u.error("Error fetching series occurrences:", r), null;
|
|
557
576
|
}
|
|
558
577
|
}
|
|
559
|
-
async function
|
|
578
|
+
async function Ge(e) {
|
|
560
579
|
try {
|
|
561
|
-
const t =
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
580
|
+
const t = await fetch(
|
|
581
|
+
`${c()}/series/${e}/page`
|
|
582
|
+
);
|
|
583
|
+
if (!t.ok)
|
|
584
|
+
throw new C(`Failed to fetch series page: ${t.status}`, "lib/api/events/fetchSeriesPage");
|
|
585
|
+
return t.json();
|
|
565
586
|
} catch (t) {
|
|
566
|
-
return u.error("Error fetching
|
|
587
|
+
return u.error("Error fetching series page:", t), null;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
async function Be(e, t) {
|
|
591
|
+
try {
|
|
592
|
+
const r = t ? `${c()}/collections/${e}/public?password=${encodeURIComponent(t)}` : `${c()}/collections/${e}/public`, n = await fetch(r);
|
|
593
|
+
if (!n.ok)
|
|
594
|
+
throw new C(`Failed to fetch collection: ${n.status}`, "lib/api/events/fetchPublicCollection");
|
|
595
|
+
return n.json();
|
|
596
|
+
} catch (r) {
|
|
597
|
+
return u.error("Error fetching collection:", r), null;
|
|
567
598
|
}
|
|
568
599
|
}
|
|
569
|
-
async function
|
|
600
|
+
async function ze(e, t) {
|
|
570
601
|
try {
|
|
571
|
-
const
|
|
572
|
-
`${
|
|
602
|
+
const r = encodeURIComponent(t), n = await fetch(
|
|
603
|
+
`${c()}/collections/${e}/check-password/${r}`
|
|
573
604
|
);
|
|
574
|
-
return
|
|
575
|
-
} catch (
|
|
576
|
-
return u.error("Error checking collection password:",
|
|
605
|
+
return n.ok ? (await n.json()).valid === !0 : !1;
|
|
606
|
+
} catch (r) {
|
|
607
|
+
return u.error("Error checking collection password:", r), !1;
|
|
577
608
|
}
|
|
578
609
|
}
|
|
579
|
-
async function
|
|
610
|
+
async function He(e, t) {
|
|
580
611
|
try {
|
|
581
|
-
const
|
|
582
|
-
`${
|
|
612
|
+
const r = await fetch(
|
|
613
|
+
`${c()}/events/${e}/check-password`,
|
|
583
614
|
{
|
|
584
615
|
method: "POST",
|
|
585
616
|
headers: { "Content-Type": "application/json" },
|
|
586
|
-
body: JSON.stringify({ password:
|
|
617
|
+
body: JSON.stringify({ password: t })
|
|
587
618
|
}
|
|
588
619
|
);
|
|
589
|
-
if (!
|
|
590
|
-
const
|
|
591
|
-
return typeof
|
|
592
|
-
} catch (
|
|
593
|
-
return u.error("Error checking event password:",
|
|
620
|
+
if (!r.ok) return { valid: !1 };
|
|
621
|
+
const n = await r.json();
|
|
622
|
+
return typeof n == "boolean" ? { valid: n } : { valid: n.valid === !0 || n === !0 };
|
|
623
|
+
} catch (r) {
|
|
624
|
+
return u.error("Error checking event password:", r), { valid: !1 };
|
|
594
625
|
}
|
|
595
626
|
}
|
|
596
|
-
async function
|
|
627
|
+
async function Je(e, t) {
|
|
597
628
|
try {
|
|
598
|
-
const
|
|
599
|
-
return (await fetch(
|
|
629
|
+
const r = t ? `${c()}/events/venue/${t}` : e ? `${c()}/venues/organization/${e}` : `${c()}/health`;
|
|
630
|
+
return (await fetch(r, {
|
|
600
631
|
method: "HEAD"
|
|
601
632
|
})).ok;
|
|
602
|
-
} catch (
|
|
603
|
-
return u.error("Network connection test failed:",
|
|
633
|
+
} catch (r) {
|
|
634
|
+
return u.error("Network connection test failed:", r), !1;
|
|
604
635
|
}
|
|
605
636
|
}
|
|
606
|
-
const
|
|
607
|
-
async function
|
|
637
|
+
const P = p("VC");
|
|
638
|
+
async function H(e) {
|
|
608
639
|
try {
|
|
609
640
|
if (!e)
|
|
610
|
-
return
|
|
611
|
-
const
|
|
612
|
-
return
|
|
613
|
-
} catch (
|
|
614
|
-
return
|
|
641
|
+
return P.warn("getVenue called without venueId"), null;
|
|
642
|
+
const t = await fetch(`${c()}/venues/${e}`);
|
|
643
|
+
return t.ok ? t.json() : (P.error(`Failed to fetch venue: ${t.status}`), null);
|
|
644
|
+
} catch (t) {
|
|
645
|
+
return P.error("Error fetching venue:", t), null;
|
|
615
646
|
}
|
|
616
647
|
}
|
|
617
|
-
async function
|
|
618
|
-
const
|
|
619
|
-
return
|
|
620
|
-
serviceFeePercentage:
|
|
621
|
-
serviceFeeCents:
|
|
622
|
-
taxPercentage:
|
|
648
|
+
async function Me(e) {
|
|
649
|
+
const t = await H(e);
|
|
650
|
+
return t ? {
|
|
651
|
+
serviceFeePercentage: t.serviceFeePercentage ?? 0,
|
|
652
|
+
serviceFeeCents: t.serviceFeeCents ?? 0,
|
|
653
|
+
taxPercentage: t.taxPercentage ?? 0
|
|
623
654
|
} : null;
|
|
624
655
|
}
|
|
625
|
-
async function
|
|
656
|
+
async function We(e) {
|
|
626
657
|
try {
|
|
627
658
|
if (!e)
|
|
628
|
-
return
|
|
629
|
-
const
|
|
630
|
-
return
|
|
631
|
-
} catch (
|
|
632
|
-
return
|
|
659
|
+
return P.warn("getVenueBySlug called without slug"), null;
|
|
660
|
+
const t = encodeURIComponent(e), r = await fetch(`${c()}/venues/slug/${t}`);
|
|
661
|
+
return r.ok ? r.json() : (P.error(`Failed to fetch venue by slug: ${r.status}`), null);
|
|
662
|
+
} catch (t) {
|
|
663
|
+
return P.error("Error fetching venue by slug:", t), null;
|
|
633
664
|
}
|
|
634
665
|
}
|
|
635
|
-
const
|
|
636
|
-
async function
|
|
666
|
+
const v = p("VC"), J = "https://get-micdrop.com", M = `${J}/api/orders/v2`, F = () => A();
|
|
667
|
+
async function Qe(e) {
|
|
637
668
|
try {
|
|
638
|
-
const
|
|
639
|
-
`${
|
|
669
|
+
const t = await fetch(
|
|
670
|
+
`${M}/gift-cards`,
|
|
640
671
|
{
|
|
641
672
|
method: "POST",
|
|
642
673
|
headers: { "Content-Type": "application/json" },
|
|
643
674
|
body: JSON.stringify(e)
|
|
644
675
|
}
|
|
645
676
|
);
|
|
646
|
-
if (!
|
|
647
|
-
const
|
|
648
|
-
throw
|
|
677
|
+
if (!t.ok) {
|
|
678
|
+
const n = await t.json().catch(() => ({}));
|
|
679
|
+
throw v.error("Gift card purchase creation failed:", n), new C(n.error || "Failed to create gift card purchase", "lib/api/gift-cards/createGiftCardPurchase");
|
|
649
680
|
}
|
|
650
|
-
const
|
|
651
|
-
return
|
|
652
|
-
} catch (
|
|
653
|
-
return
|
|
681
|
+
const r = await t.json();
|
|
682
|
+
return v.debug("Gift card purchase created:", r), r;
|
|
683
|
+
} catch (t) {
|
|
684
|
+
return v.error("Gift card purchase creation error:", t), null;
|
|
654
685
|
}
|
|
655
686
|
}
|
|
656
|
-
async function
|
|
687
|
+
async function Ye(e, t) {
|
|
657
688
|
try {
|
|
658
|
-
const
|
|
689
|
+
const r = await fetch(`${F()}/cart/${e}/apply-gift-card`, {
|
|
659
690
|
method: "POST",
|
|
660
691
|
headers: { "Content-Type": "application/json" },
|
|
661
|
-
body: JSON.stringify({ giftCardCode:
|
|
692
|
+
body: JSON.stringify({ giftCardCode: t })
|
|
662
693
|
});
|
|
663
|
-
if (!
|
|
664
|
-
if (
|
|
694
|
+
if (!r.ok) {
|
|
695
|
+
if (r.status === 429)
|
|
665
696
|
return {
|
|
666
697
|
valid: !1,
|
|
667
698
|
error: "Too many attempts. Please wait a moment and try again."
|
|
668
699
|
};
|
|
669
|
-
const
|
|
670
|
-
return
|
|
700
|
+
const o = await r.json().catch(() => ({}));
|
|
701
|
+
return v.error("Apply gift card failed:", o), { valid: !1, error: o.error || "Invalid gift card code" };
|
|
671
702
|
}
|
|
672
|
-
const
|
|
703
|
+
const n = await r.json();
|
|
673
704
|
return {
|
|
674
705
|
valid: !0,
|
|
675
|
-
giftCardCode:
|
|
676
|
-
giftCardAmount:
|
|
677
|
-
giftCardBalance:
|
|
678
|
-
paymentType:
|
|
679
|
-
stripeAmount:
|
|
680
|
-
orderTotal:
|
|
681
|
-
requiresStripe:
|
|
706
|
+
giftCardCode: n.giftCardCode,
|
|
707
|
+
giftCardAmount: n.giftCardAmount,
|
|
708
|
+
giftCardBalance: n.giftCardBalance,
|
|
709
|
+
paymentType: n.paymentType,
|
|
710
|
+
stripeAmount: n.stripeAmount,
|
|
711
|
+
orderTotal: n.orderTotal,
|
|
712
|
+
requiresStripe: n.requiresStripe
|
|
682
713
|
};
|
|
683
|
-
} catch (
|
|
684
|
-
return
|
|
714
|
+
} catch (r) {
|
|
715
|
+
return v.error("applyGiftCard error:", r), {
|
|
685
716
|
valid: !1,
|
|
686
717
|
error: "Network error. Please check your connection and try again."
|
|
687
718
|
};
|
|
688
719
|
}
|
|
689
720
|
}
|
|
690
|
-
async function
|
|
721
|
+
async function Ke(e) {
|
|
691
722
|
try {
|
|
692
|
-
const
|
|
723
|
+
const t = await fetch(`${F()}/cart/${e}/gift-card`, {
|
|
693
724
|
method: "DELETE",
|
|
694
725
|
headers: { "Content-Type": "application/json" }
|
|
695
726
|
});
|
|
696
|
-
if (!
|
|
697
|
-
const
|
|
698
|
-
return
|
|
727
|
+
if (!t.ok) {
|
|
728
|
+
const r = await t.json().catch(() => ({}));
|
|
729
|
+
return v.error("Remove gift card failed:", r), { success: !1, error: r.error || "Failed to remove gift card" };
|
|
699
730
|
}
|
|
700
731
|
return { success: !0 };
|
|
701
|
-
} catch (
|
|
702
|
-
return
|
|
732
|
+
} catch (t) {
|
|
733
|
+
return v.error("removeGiftCard error:", t), {
|
|
703
734
|
success: !1,
|
|
704
735
|
error: "Network error. Please check your connection and try again."
|
|
705
736
|
};
|
|
706
737
|
}
|
|
707
738
|
}
|
|
708
|
-
async function
|
|
739
|
+
async function Xe(e, t) {
|
|
709
740
|
try {
|
|
710
|
-
const
|
|
711
|
-
`${
|
|
741
|
+
const r = await fetch(
|
|
742
|
+
`${F()}/cart/${e}/complete-gift-card-payment`,
|
|
712
743
|
{
|
|
713
744
|
method: "POST",
|
|
714
745
|
headers: { "Content-Type": "application/json" },
|
|
715
746
|
body: JSON.stringify({
|
|
716
|
-
firstName:
|
|
717
|
-
lastName:
|
|
718
|
-
email:
|
|
719
|
-
phoneNumber:
|
|
720
|
-
mailingList:
|
|
747
|
+
firstName: t.firstName,
|
|
748
|
+
lastName: t.lastName,
|
|
749
|
+
email: t.email,
|
|
750
|
+
phoneNumber: t.phoneNumber || null,
|
|
751
|
+
mailingList: t.mailingList || !1
|
|
721
752
|
})
|
|
722
753
|
}
|
|
723
754
|
);
|
|
724
|
-
if (!
|
|
725
|
-
const
|
|
726
|
-
return
|
|
755
|
+
if (!r.ok) {
|
|
756
|
+
const o = await r.json().catch(() => ({}));
|
|
757
|
+
return v.error("Complete gift card payment failed:", o), { success: !1, error: o.error || "Failed to complete payment" };
|
|
727
758
|
}
|
|
728
|
-
const
|
|
759
|
+
const n = await r.json();
|
|
729
760
|
return {
|
|
730
761
|
success: !0,
|
|
731
|
-
orderId:
|
|
732
|
-
confirmationNumber:
|
|
762
|
+
orderId: n.orderId,
|
|
763
|
+
confirmationNumber: n.confirmationNumber
|
|
733
764
|
};
|
|
734
|
-
} catch (
|
|
735
|
-
return
|
|
765
|
+
} catch (r) {
|
|
766
|
+
return v.error("completeGiftCardPayment error:", r), {
|
|
736
767
|
success: !1,
|
|
737
768
|
error: "Network error. Please check your connection and try again."
|
|
738
769
|
};
|
|
739
770
|
}
|
|
740
771
|
}
|
|
741
|
-
const
|
|
772
|
+
const T = p("VC"), W = {
|
|
742
773
|
waitlist_not_enabled: "Waitlist is not available for this event",
|
|
743
774
|
event_not_found: "Event not found",
|
|
744
775
|
invalid_phone: "Please enter a valid phone number",
|
|
745
776
|
already_purchased: "You have already purchased tickets for this event",
|
|
746
777
|
phone_already_registered: "This phone number is already on the waitlist"
|
|
747
778
|
};
|
|
748
|
-
async function
|
|
779
|
+
async function Ze(e, t, r = null, n = !1) {
|
|
749
780
|
try {
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
const
|
|
781
|
+
const o = { email: t };
|
|
782
|
+
r && n && (o.phone = r, o.smsOptIn = !0);
|
|
783
|
+
const a = await fetch(`${c()}/events/${e}/waitlist`, {
|
|
753
784
|
method: "POST",
|
|
754
785
|
headers: { "Content-Type": "application/json" },
|
|
755
|
-
body: JSON.stringify(
|
|
786
|
+
body: JSON.stringify(o)
|
|
756
787
|
});
|
|
757
|
-
if (!
|
|
758
|
-
const i = await
|
|
759
|
-
return
|
|
788
|
+
if (!a.ok) {
|
|
789
|
+
const i = await a.json().catch(() => ({}));
|
|
790
|
+
return T.error("Join waitlist failed:", i), {
|
|
760
791
|
success: !1,
|
|
761
|
-
error:
|
|
792
|
+
error: W[i.error] || "Failed to join waitlist. Please try again."
|
|
762
793
|
};
|
|
763
794
|
}
|
|
764
|
-
const s = await
|
|
795
|
+
const s = await a.json();
|
|
765
796
|
return {
|
|
766
797
|
success: !0,
|
|
767
798
|
position: s.position,
|
|
768
799
|
updated: s.updated
|
|
769
800
|
};
|
|
770
|
-
} catch (
|
|
771
|
-
return
|
|
801
|
+
} catch (o) {
|
|
802
|
+
return T.error("joinWaitlist error:", o), {
|
|
772
803
|
success: !1,
|
|
773
804
|
error: "Network error. Please check your connection and try again."
|
|
774
805
|
};
|
|
775
806
|
}
|
|
776
807
|
}
|
|
777
|
-
async function
|
|
808
|
+
async function Ve(e, t) {
|
|
778
809
|
try {
|
|
779
|
-
const
|
|
780
|
-
`${
|
|
810
|
+
const r = await fetch(
|
|
811
|
+
`${c()}/events/${e}/waitlist/position?email=${encodeURIComponent(t)}`
|
|
781
812
|
);
|
|
782
|
-
return
|
|
783
|
-
} catch (
|
|
784
|
-
return
|
|
813
|
+
return r.ok ? { position: (await r.json()).position } : r.status === 404 ? { position: null } : { position: null, error: "Failed to check position" };
|
|
814
|
+
} catch (r) {
|
|
815
|
+
return T.error("getWaitlistPosition error:", r), { position: null, error: "Network error" };
|
|
785
816
|
}
|
|
786
817
|
}
|
|
787
|
-
function
|
|
818
|
+
function Q(e) {
|
|
819
|
+
if (!e || !(e.isHidden === !0 || typeof e.visibility == "number" && e.visibility >= 2) || e.salesChannel === 2) return !1;
|
|
820
|
+
const r = /* @__PURE__ */ new Date(), n = e.salesBegin || e.salesStart || e.saleBegin || e.onSaleStart, o = e.salesEnd || e.saleEnd || e.onSaleEnd;
|
|
821
|
+
if (n && new Date(n) > r || o && new Date(o) < r) return !1;
|
|
822
|
+
const a = e.remainingCapacity ?? e.quantityRemaining ?? e.quantity;
|
|
823
|
+
return !(e.soldOut || a != null && a <= 0);
|
|
824
|
+
}
|
|
825
|
+
function et(e, t, r = {}) {
|
|
788
826
|
const {
|
|
789
|
-
cancelled:
|
|
790
|
-
isRegistration:
|
|
791
|
-
waitlistEnabled:
|
|
792
|
-
} =
|
|
793
|
-
if (
|
|
827
|
+
cancelled: n = !1,
|
|
828
|
+
isRegistration: o = !1,
|
|
829
|
+
waitlistEnabled: a = !1
|
|
830
|
+
} = r, s = /* @__PURE__ */ new Date();
|
|
831
|
+
if (n)
|
|
794
832
|
return { text: "Cancelled", disabled: !0, reason: "cancelled" };
|
|
795
833
|
const i = e.endDateTime || e.startDateTime;
|
|
796
834
|
if (i && new Date(i) < s)
|
|
797
835
|
return { text: "Sales ended", disabled: !0, reason: "event_past" };
|
|
798
|
-
const l =
|
|
799
|
-
|
|
800
|
-
|
|
836
|
+
const l = e?.hasPurchasableHiddenTickets === !0 || Array.isArray(t) && t.some(Q), _ = (t || []).filter(
|
|
837
|
+
(d) => d.salesChannel !== 2 && !d.isHidden && !(typeof d.visibility == "number" && d.visibility >= 2)
|
|
838
|
+
);
|
|
839
|
+
if (_.length === 0)
|
|
840
|
+
return l ? {
|
|
841
|
+
text: o ? "Reserve a spot" : "Get tickets",
|
|
842
|
+
disabled: !1,
|
|
843
|
+
reason: "hidden_only"
|
|
844
|
+
} : {
|
|
801
845
|
text: "No tickets available",
|
|
802
846
|
disabled: !0,
|
|
803
847
|
reason: "no_tickets"
|
|
804
848
|
};
|
|
805
|
-
let
|
|
806
|
-
for (const
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
809
|
-
const
|
|
810
|
-
(!
|
|
849
|
+
let h = !1, m = !0, g = !0, w = null;
|
|
850
|
+
for (const d of _) {
|
|
851
|
+
const $ = d.salesBegin || d.salesStart || d.saleBegin || d.onSaleStart, j = d.salesEnd || d.saleEnd || d.onSaleEnd, b = d.remainingCapacity ?? d.quantityRemaining ?? d.quantity, S = d.soldOut || b != null && b <= 0, D = $ ? new Date($) > s : !1, U = j ? new Date(j) < s : !1;
|
|
852
|
+
if (!S && !D && !U && (h = !0), S || (m = !1), D || (g = !1), D && $ && !S && !U) {
|
|
853
|
+
const R = new Date($);
|
|
854
|
+
(!w || R < w) && (w = R);
|
|
811
855
|
}
|
|
812
856
|
}
|
|
813
|
-
if (
|
|
857
|
+
if (h)
|
|
814
858
|
return {
|
|
815
|
-
text:
|
|
859
|
+
text: o ? "Reserve a spot" : "Get tickets",
|
|
816
860
|
disabled: !1,
|
|
817
861
|
reason: "available"
|
|
818
862
|
};
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
863
|
+
if (g && w) {
|
|
864
|
+
if (l)
|
|
865
|
+
return {
|
|
866
|
+
text: o ? "Reserve a spot" : "Get tickets",
|
|
867
|
+
disabled: !1,
|
|
868
|
+
reason: "hidden_only"
|
|
869
|
+
};
|
|
870
|
+
const d = w.getTime() - s.getTime(), $ = d / (1e3 * 60 * 60), j = d / (1e3 * 60 * 60 * 24);
|
|
871
|
+
let b;
|
|
872
|
+
if ($ < 24)
|
|
873
|
+
b = w.toLocaleTimeString("en-US", {
|
|
824
874
|
hour: "numeric",
|
|
825
875
|
minute: "2-digit",
|
|
826
876
|
hour12: !0
|
|
827
877
|
});
|
|
828
|
-
else if (
|
|
829
|
-
|
|
830
|
-
|
|
878
|
+
else if (j <= 7)
|
|
879
|
+
b = q(
|
|
880
|
+
w,
|
|
831
881
|
{ weekday: "short", hour: "numeric", minute: "2-digit", hour12: !0 },
|
|
832
882
|
"en-US"
|
|
833
883
|
);
|
|
834
884
|
else {
|
|
835
|
-
const
|
|
836
|
-
|
|
885
|
+
const S = q(
|
|
886
|
+
w,
|
|
837
887
|
{ month: "short", day: "numeric" },
|
|
838
888
|
"en-US"
|
|
839
|
-
),
|
|
889
|
+
), D = w.toLocaleTimeString("en-US", {
|
|
840
890
|
hour: "numeric",
|
|
841
891
|
minute: "2-digit",
|
|
842
892
|
hour12: !0
|
|
843
893
|
});
|
|
844
|
-
|
|
894
|
+
b = `${S} ${D}`;
|
|
845
895
|
}
|
|
846
896
|
return {
|
|
847
|
-
text: `On sale ${
|
|
897
|
+
text: `On sale ${b}`,
|
|
848
898
|
disabled: !0,
|
|
849
899
|
reason: "coming_soon"
|
|
850
900
|
};
|
|
851
901
|
}
|
|
852
|
-
return
|
|
902
|
+
return m ? l ? {
|
|
903
|
+
text: o ? "Reserve a spot" : "Get tickets",
|
|
904
|
+
disabled: !1,
|
|
905
|
+
reason: "hidden_only"
|
|
906
|
+
} : a ? {
|
|
853
907
|
text: "Join Waitlist",
|
|
854
908
|
disabled: !1,
|
|
855
909
|
reason: "sold_out_waitlist"
|
|
856
|
-
} : { text: "Sold out", disabled: !0, reason: "sold_out" } :
|
|
910
|
+
} : { text: "Sold out", disabled: !0, reason: "sold_out" } : l ? {
|
|
911
|
+
text: o ? "Reserve a spot" : "Get tickets",
|
|
912
|
+
disabled: !1,
|
|
913
|
+
reason: "hidden_only"
|
|
914
|
+
} : { text: "Sales ended", disabled: !0, reason: "sales_ended" };
|
|
857
915
|
}
|
|
858
|
-
function
|
|
916
|
+
function Y(e) {
|
|
859
917
|
return {
|
|
860
918
|
uuid: e.uuid || String(e.id || e.ID || ""),
|
|
861
919
|
id: e.id || e.ID,
|
|
@@ -872,8 +930,8 @@ function W(e) {
|
|
|
872
930
|
checkedInAt: e.checkedInAt || e.checked_in_at
|
|
873
931
|
};
|
|
874
932
|
}
|
|
875
|
-
function
|
|
876
|
-
const
|
|
933
|
+
function K(e) {
|
|
934
|
+
const t = e.purchasedTickets || e.tickets || e.purchased_tickets || [];
|
|
877
935
|
return {
|
|
878
936
|
uuid: e.uuid || String(e.id || e.ID || ""),
|
|
879
937
|
id: e.id || e.ID,
|
|
@@ -888,57 +946,57 @@ function H(e) {
|
|
|
888
946
|
discount: e.discount || 0,
|
|
889
947
|
paymentIntentId: e.paymentIntentId || e.payment_intent_id,
|
|
890
948
|
paymentMethod: e.paymentMethod || e.payment_method,
|
|
891
|
-
purchasedTickets:
|
|
949
|
+
purchasedTickets: t.map(Y),
|
|
892
950
|
createdAt: e.createdAt || e.created_at,
|
|
893
951
|
updatedAt: e.updatedAt || e.updated_at
|
|
894
952
|
};
|
|
895
953
|
}
|
|
896
|
-
function
|
|
897
|
-
const
|
|
954
|
+
function tt(e) {
|
|
955
|
+
const t = K(e), r = t.uuid.split("-")[0] || t.uuid;
|
|
898
956
|
return {
|
|
899
|
-
orderId:
|
|
900
|
-
displayOrderId:
|
|
901
|
-
email:
|
|
902
|
-
customerName: [
|
|
903
|
-
total:
|
|
904
|
-
formattedTotal: `${
|
|
905
|
-
|
|
957
|
+
orderId: t.uuid,
|
|
958
|
+
displayOrderId: r,
|
|
959
|
+
email: t.customerEmail,
|
|
960
|
+
customerName: [t.customerFirstName, t.customerLastName].filter(Boolean).join(" "),
|
|
961
|
+
total: t.totalAmount,
|
|
962
|
+
formattedTotal: `${O(
|
|
963
|
+
t.totalAmount / 100
|
|
906
964
|
/* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */
|
|
907
965
|
)}`,
|
|
908
|
-
ticketCount:
|
|
909
|
-
status:
|
|
966
|
+
ticketCount: t.purchasedTickets.length,
|
|
967
|
+
status: t.status
|
|
910
968
|
};
|
|
911
969
|
}
|
|
912
|
-
const
|
|
913
|
-
function
|
|
914
|
-
return e ? e.startsWith("http") ? e : `${
|
|
970
|
+
const X = "https://micdrop-images.sfo3.digitaloceanspaces.com";
|
|
971
|
+
function Z(e) {
|
|
972
|
+
return e ? e.startsWith("http") ? e : `${X}/${e.replace(/^\//, "")}` : "";
|
|
915
973
|
}
|
|
916
|
-
function
|
|
917
|
-
const
|
|
918
|
-
return
|
|
974
|
+
function E(e) {
|
|
975
|
+
const t = e.imageUrl || e.imageURL || e.image_url || e.image || "";
|
|
976
|
+
return Z(t);
|
|
919
977
|
}
|
|
920
|
-
function
|
|
921
|
-
const
|
|
922
|
-
if (
|
|
923
|
-
return
|
|
978
|
+
function V(e) {
|
|
979
|
+
const t = e.ctaState || e.cta_state;
|
|
980
|
+
if (t)
|
|
981
|
+
return t;
|
|
924
982
|
if (e.isCancelled || e.is_cancelled)
|
|
925
983
|
return "ended";
|
|
926
|
-
const
|
|
927
|
-
if (
|
|
928
|
-
const s = new Date(
|
|
984
|
+
const r = e.startDateTime || e.start_date_time || e.date;
|
|
985
|
+
if (r) {
|
|
986
|
+
const s = new Date(r).getTime(), i = Date.now();
|
|
929
987
|
if (s < i)
|
|
930
988
|
return "ended";
|
|
931
989
|
}
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
return
|
|
935
|
-
const
|
|
936
|
-
return
|
|
937
|
-
const l = i.quantityAvailable ?? i.quantity_available ?? i.quantity ?? 0,
|
|
938
|
-
return s + Math.max(0, l -
|
|
990
|
+
const n = e.ticketsAvailable ?? e.tickets_available;
|
|
991
|
+
if (n !== void 0)
|
|
992
|
+
return n <= 0 ? "sold_out" : "available";
|
|
993
|
+
const o = e.availableTickets || e.available_tickets || e.tickets || [];
|
|
994
|
+
return o.length === 0 ? "coming_soon" : o.reduce((s, i) => {
|
|
995
|
+
const l = i.quantityAvailable ?? i.quantity_available ?? i.quantity ?? 0, _ = i.quantitySold ?? i.quantity_sold ?? 0;
|
|
996
|
+
return s + Math.max(0, l - _);
|
|
939
997
|
}, 0) <= 0 ? "sold_out" : "available";
|
|
940
998
|
}
|
|
941
|
-
function
|
|
999
|
+
function ee(e) {
|
|
942
1000
|
return {
|
|
943
1001
|
id: e.id || e.ID,
|
|
944
1002
|
name: e.name || e.ticketName || "",
|
|
@@ -958,8 +1016,8 @@ function X(e) {
|
|
|
958
1016
|
sortOrder: e.sortOrder || e.sort_order || 0
|
|
959
1017
|
};
|
|
960
1018
|
}
|
|
961
|
-
function
|
|
962
|
-
const
|
|
1019
|
+
function te(e) {
|
|
1020
|
+
const r = (e.availableTickets || e.available_tickets || e.tickets || []).map(ee), n = r.map((s) => s.price).filter((s) => s > 0), o = n.length > 0 ? Math.min(...n) : void 0, a = n.length > 0 ? Math.max(...n) : void 0;
|
|
963
1021
|
return {
|
|
964
1022
|
eventID: e.eventID || e.id || e.ID || 0,
|
|
965
1023
|
id: e.id || e.ID,
|
|
@@ -976,29 +1034,29 @@ function Z(e) {
|
|
|
976
1034
|
venueName: e.venueName || e.venue_name,
|
|
977
1035
|
venueAddress: e.venueAddress || e.venue_address,
|
|
978
1036
|
location: e.location || e.venueAddress || e.venue_address,
|
|
979
|
-
imageUrl:
|
|
980
|
-
imageURL:
|
|
1037
|
+
imageUrl: E(e),
|
|
1038
|
+
imageURL: E(e),
|
|
981
1039
|
status: e.status,
|
|
982
1040
|
isPublished: e.isPublished ?? e.is_published,
|
|
983
1041
|
isCancelled: e.isCancelled ?? e.is_cancelled,
|
|
984
|
-
availableTickets:
|
|
985
|
-
ticketsAvailable: e.ticketsAvailable ?? e.tickets_available ??
|
|
1042
|
+
availableTickets: r,
|
|
1043
|
+
ticketsAvailable: e.ticketsAvailable ?? e.tickets_available ?? r.reduce((s, i) => s + (i.quantityAvailable || 0), 0),
|
|
986
1044
|
ticketsSold: e.ticketsSold ?? e.tickets_sold,
|
|
987
|
-
minPrice: e.minPrice ?? e.min_price ??
|
|
988
|
-
maxPrice: e.maxPrice ?? e.max_price ??
|
|
1045
|
+
minPrice: e.minPrice ?? e.min_price ?? o,
|
|
1046
|
+
maxPrice: e.maxPrice ?? e.max_price ?? a,
|
|
989
1047
|
ctaText: e.ctaText || e.cta_text,
|
|
990
|
-
ctaState:
|
|
1048
|
+
ctaState: V(e),
|
|
991
1049
|
showPerformers: e.showPerformers ?? e.show_performers,
|
|
992
1050
|
eventSeriesId: e.eventSeriesId || e.event_series_id,
|
|
993
1051
|
seriesInstanceNumber: e.seriesInstanceNumber || e.series_instance_number
|
|
994
1052
|
};
|
|
995
1053
|
}
|
|
996
|
-
const
|
|
997
|
-
function
|
|
998
|
-
return e ? e.startsWith("http") ? e : `${
|
|
1054
|
+
const rt = te, re = "https://micdrop-images.sfo3.digitaloceanspaces.com";
|
|
1055
|
+
function ne(e) {
|
|
1056
|
+
return e ? e.startsWith("http") ? e : `${re}/${e.replace(/^\//, "")}` : "";
|
|
999
1057
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const
|
|
1058
|
+
function nt(e) {
|
|
1059
|
+
const t = e.logoUrl || e.logo_url || e.logo;
|
|
1002
1060
|
return {
|
|
1003
1061
|
id: e.id || e.ID || 0,
|
|
1004
1062
|
name: e.name || "",
|
|
@@ -1010,21 +1068,21 @@ function Ze(e) {
|
|
|
1010
1068
|
zipCode: e.zipCode || e.zip_code,
|
|
1011
1069
|
country: e.country,
|
|
1012
1070
|
timezone: e.timezone || e.time_zone,
|
|
1013
|
-
logoUrl:
|
|
1071
|
+
logoUrl: ne(t),
|
|
1014
1072
|
serviceFeePercentage: e.serviceFeePercentage ?? e.service_fee_percentage ?? 0,
|
|
1015
1073
|
serviceFeeCents: e.serviceFeeCents ?? e.service_fee_cents ?? 0,
|
|
1016
1074
|
taxPercentage: e.taxPercentage ?? e.tax_percentage ?? 0,
|
|
1017
1075
|
organizationId: e.organizationId || e.organization_id
|
|
1018
1076
|
};
|
|
1019
1077
|
}
|
|
1020
|
-
function
|
|
1078
|
+
function ot(e) {
|
|
1021
1079
|
return {
|
|
1022
1080
|
serviceFeePercentage: e.serviceFeePercentage ?? e.service_fee_percentage ?? 0,
|
|
1023
1081
|
serviceFeeCents: e.serviceFeeCents ?? e.service_fee_cents ?? 0,
|
|
1024
1082
|
taxPercentage: e.taxPercentage ?? e.tax_percentage ?? 0
|
|
1025
1083
|
};
|
|
1026
1084
|
}
|
|
1027
|
-
function
|
|
1085
|
+
function st(e) {
|
|
1028
1086
|
return [
|
|
1029
1087
|
e.address,
|
|
1030
1088
|
e.city,
|
|
@@ -1033,66 +1091,67 @@ function er(e) {
|
|
|
1033
1091
|
].filter(Boolean).join(", ");
|
|
1034
1092
|
}
|
|
1035
1093
|
export {
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1094
|
+
ye as apiDelete,
|
|
1095
|
+
fe as apiGet,
|
|
1096
|
+
me as apiPost,
|
|
1097
|
+
he as apiPut,
|
|
1098
|
+
Ye as applyGiftCard,
|
|
1099
|
+
Ne as applyPromoCode,
|
|
1100
|
+
V as calculateCtaState,
|
|
1101
|
+
be as cancelReservation,
|
|
1102
|
+
ze as checkCollectionPassword,
|
|
1103
|
+
He as checkEventPassword,
|
|
1104
|
+
Xe as completeGiftCardPayment,
|
|
1105
|
+
_e as completeReservation,
|
|
1106
|
+
et as computeCtaState,
|
|
1107
|
+
ie as configureApi,
|
|
1108
|
+
Qe as createGiftCardPurchase,
|
|
1109
|
+
pe as createOrder,
|
|
1110
|
+
ge as createPaymentIntent,
|
|
1111
|
+
Ce as extendCheckoutSession,
|
|
1112
|
+
ot as extractVenueFees,
|
|
1113
|
+
Ue as fetchAllVenues,
|
|
1114
|
+
xe as fetchEventDetails,
|
|
1115
|
+
Fe as fetchEventPerformers,
|
|
1116
|
+
Te as fetchEventTickets,
|
|
1117
|
+
Be as fetchPublicCollection,
|
|
1118
|
+
Oe as fetchSeriesOccurrences,
|
|
1119
|
+
Ge as fetchSeriesPage,
|
|
1120
|
+
Re as fetchVenueEvents,
|
|
1121
|
+
st as formatVenueAddress,
|
|
1122
|
+
ue as getApiConfig,
|
|
1123
|
+
Z as getCDNImageUrl,
|
|
1124
|
+
we as getCartByUUID,
|
|
1125
|
+
de as getClientIP,
|
|
1126
|
+
E as getEventImageUrl,
|
|
1127
|
+
le as getLegacyPublicUrl,
|
|
1128
|
+
qe as getMonthEvents,
|
|
1129
|
+
$e as getOrder,
|
|
1130
|
+
A as getOrdersV2Url,
|
|
1131
|
+
Ee as getOrgMonthEvents,
|
|
1132
|
+
c as getPublicBaseUrl,
|
|
1133
|
+
Le as getSeriesOccurrences,
|
|
1134
|
+
Se as getSessionStatus,
|
|
1135
|
+
H as getVenue,
|
|
1136
|
+
We as getVenueBySlug,
|
|
1137
|
+
Me as getVenueFees,
|
|
1138
|
+
Ve as getWaitlistPosition,
|
|
1139
|
+
Ie as hasPromoCodes,
|
|
1140
|
+
De as initiateOrder,
|
|
1141
|
+
Ze as joinWaitlist,
|
|
1142
|
+
Ke as removeGiftCard,
|
|
1084
1143
|
ke as removePromoCode,
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1144
|
+
Je as testNetworkConnection,
|
|
1145
|
+
Ae as trackUTMSource,
|
|
1146
|
+
ee as transformAvailableTicket,
|
|
1147
|
+
te as transformEvent,
|
|
1148
|
+
rt as transformEventData,
|
|
1149
|
+
K as transformOrder,
|
|
1150
|
+
tt as transformOrderForDisplay,
|
|
1151
|
+
Y as transformTicket,
|
|
1152
|
+
nt as transformVenue,
|
|
1153
|
+
ve as updateCartQuantities,
|
|
1154
|
+
Pe as validatePaymentIntent,
|
|
1155
|
+
je as validatePromoCode
|
|
1097
1156
|
};
|
|
1098
1157
|
//# sourceMappingURL=api.mjs.map
|