@getmicdrop/venue-calendar 4.3.122 → 4.3.124

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.
Files changed (137) hide show
  1. package/dist/{AddOnCard-BkEFPzAX.js → AddOnCard-BCakRkN0.js} +18 -18
  2. package/dist/{ArrowLeftIcon-t-CY0sbi.js → ArrowLeftIcon-B6vERrBh.js} +1 -1
  3. package/dist/{BlockPlaceholder-BmEZ68_q.js → BlockPlaceholder-CInLJaAM.js} +1 -1
  4. package/dist/{Calendar-hxcQBkTF.js → Calendar-DV_SrEdT.js} +131 -150
  5. package/dist/{CalendarFoundryView-CSAKDe-F.js → CalendarFoundryView-Cx60F-de.js} +968 -966
  6. package/dist/{CalendarIcon-B5JWs0gm.js → CalendarIcon-BA9OTu6n.js} +1 -1
  7. package/dist/{CartView-CQZw_kwm.js → CartView-DXL2fN6s.js} +279 -276
  8. package/dist/{CheckIcon-BSwoGox7.js → CheckIcon-CsHdBvm7.js} +1 -1
  9. package/dist/{Checkout-Bsx9d4qD.js → Checkout-BDogQG64.js} +378 -376
  10. package/dist/Checkout-puHwDIls.js +1934 -0
  11. package/dist/{CheckoutTimer-Bpt5gPyA.js → CheckoutTimer-KkahlL47.js} +5 -5
  12. package/dist/{ChevronDownIcon-CVZ0usBx.js → ChevronDownIcon-CfmGVqjm.js} +1 -1
  13. package/dist/ChevronRightOutline-CiG8UHni.js +23 -0
  14. package/dist/{CloseIcon-DUnvWXUY.js → CloseIcon-0KKo8fB2.js} +1 -1
  15. package/dist/{CollectionView-DXkBRGeQ.js → CollectionView-COd_e_aK.js} +6 -6
  16. package/dist/{Event-CmD84Ni8.js → Event-BYhY0nEy.js} +604 -518
  17. package/dist/EventCard-am-bIial.js +175 -0
  18. package/dist/{EventPage-4ToDFEaL.js → EventPage-DOiyzTGz.js} +289 -265
  19. package/dist/{Input-BXZmvQ0p.js → Input-CUn5WW7v.js} +1 -1
  20. package/dist/{LocationIcon-E-7CQh4E.js → LocationIcon-MUNzCw0b.js} +1 -1
  21. package/dist/{PasswordInput-DzXNIwRc.js → PasswordInput-uLRaGMSt.js} +1 -1
  22. package/dist/{PhoneInput-DnmN_L03.js → PhoneInput-5l-M5ykF.js} +1 -1
  23. package/dist/{RecommendationsRail-CrBSsbBD.js → RecommendationsRail-ShRQ7JzA.js} +69 -66
  24. package/dist/{ScarcityBadge-BL4shc2w.js → ScarcityBadge-BvLoTIiM.js} +6 -6
  25. package/dist/{SeriesPage-Dt-T6mco.js → SeriesPage-DMYXn2vA.js} +2 -2
  26. package/dist/{Spinner-B2rdbspc.js → Spinner-CwCn-yPI.js} +1 -1
  27. package/dist/{Success-BTm0jRAO.js → Success-BP76tviw.js} +175 -172
  28. package/dist/{TagIcon-BY8tK_qA.js → TagIcon-CUfTUPrP.js} +1 -1
  29. package/dist/{ViewTicketsEmbed-BjqniKb9.js → ViewTicketsEmbed-DnMqRwJI.js} +17 -16
  30. package/dist/{WarningCircleIcon-C5Lc7qkF.js → WarningCircleIcon-BVUWnzFt.js} +1 -1
  31. package/dist/{WarningTriIcon-BM8qc9xx.js → WarningTriIcon-CBHdMLyJ.js} +1 -1
  32. package/dist/adapter-BaqXgSqI.js +164 -0
  33. package/dist/api-BUAptAYH.js +489 -0
  34. package/dist/checkoutState-DKdzYK3y.js +198 -0
  35. package/dist/client-BxgiVv8K.js +262 -0
  36. package/dist/{constants-C6MZgb2S.js → constants-lKAMwRvZ.js} +5 -1
  37. package/dist/{copyToClipboard-F-akSgaF.js → copyToClipboard-BaAhnhZ9.js} +1 -1
  38. package/dist/{createErrorGate.svelte-CEGaIQeI.js → createErrorGate.svelte-BCjQmoDN.js} +1 -1
  39. package/dist/cta-BE_N5pBc.js +116 -0
  40. package/dist/{datetime-BnKG6Hjm.js → datetime-BetkhP3Y.js} +47 -47
  41. package/dist/{de-BHcAXwnM.js → de-C3szl-Vf.js} +10 -4
  42. package/dist/{de-BPmqZ6ao.js → de-CX7o2WAr.js} +5 -1
  43. package/dist/{defaultLabels-BbNEEsF7.js → defaultLabels-D7c3DLP3.js} +378 -401
  44. package/dist/{defaults-CcPpWiyw.js → defaults-QFkzo2Vg.js} +6 -6
  45. package/dist/{es-BV3Sgeg-.js → es-DS1-fjU8.js} +5 -1
  46. package/dist/{es-DZ3yceh-.js → es-QnJXFKEx.js} +10 -4
  47. package/dist/{event-DfqUhl5j.js → event-DFyH3dNo.js} +1 -1
  48. package/dist/{event-transform-DJYPMj8I.js → event-transform-za8lXql7.js} +18 -18
  49. package/dist/{eventStatusStream-DXyc5Eng.js → eventStatusStream-CaDLn9GX.js} +1 -1
  50. package/dist/{fr-Dyi163Vk.js → fr-BVgQDC6c.js} +10 -4
  51. package/dist/{fr-BJ0VQGEj.js → fr-CN3PiNzU.js} +5 -1
  52. package/dist/{href-CfWGAmkP.js → href--Xjr4Dsb.js} +3 -3
  53. package/dist/i18n-Bd9CN9cj.js +497 -0
  54. package/dist/i18n-Cwq8IQ_c.js +28 -0
  55. package/dist/{id-CVXaHHqU.js → id-CPG4tPVY.js} +5 -1
  56. package/dist/{id-DvFRZVAm.js → id-DCcXxLEY.js} +10 -4
  57. package/dist/{it-C0lzsHje.js → it-CjwnCYFF.js} +5 -1
  58. package/dist/{it-Bh05tcLv.js → it-CufAwhe3.js} +10 -4
  59. package/dist/{ja-Dl2r6tQ6.js → ja-C2uiNCJX.js} +5 -1
  60. package/dist/{ja-CU4PQS4j.js → ja-CMa_nsLY.js} +10 -4
  61. package/dist/{ko-DINqFSE1.js → ko-Bh97byDf.js} +5 -1
  62. package/dist/{ko-DDk6EdWm.js → ko-BwJHUjqS.js} +10 -4
  63. package/dist/locales/{4.3.122 → 4.3.124}/flow/de.js +1 -1
  64. package/dist/locales/{4.3.122 → 4.3.124}/flow/es.js +1 -1
  65. package/dist/locales/{4.3.122 → 4.3.124}/flow/fr.js +1 -1
  66. package/dist/locales/{4.3.122 → 4.3.124}/flow/id.js +1 -1
  67. package/dist/locales/{4.3.122 → 4.3.124}/flow/it.js +1 -1
  68. package/dist/locales/{4.3.122 → 4.3.124}/flow/ja.js +1 -1
  69. package/dist/locales/{4.3.122 → 4.3.124}/flow/ko.js +1 -1
  70. package/dist/locales/{4.3.122 → 4.3.124}/flow/nl.js +1 -1
  71. package/dist/locales/{4.3.122 → 4.3.124}/flow/pl.js +1 -1
  72. package/dist/locales/{4.3.122 → 4.3.124}/flow/pt-br.js +1 -1
  73. package/dist/locales/{4.3.122 → 4.3.124}/flow/tr.js +1 -1
  74. package/dist/locales/{4.3.122 → 4.3.124}/flow/zh.js +1 -1
  75. package/dist/locales/4.3.124/main/de.js +1 -0
  76. package/dist/locales/4.3.124/main/es.js +1 -0
  77. package/dist/locales/4.3.124/main/fr.js +1 -0
  78. package/dist/locales/4.3.124/main/id.js +1 -0
  79. package/dist/locales/4.3.124/main/it.js +1 -0
  80. package/dist/locales/4.3.124/main/ja.js +1 -0
  81. package/dist/locales/4.3.124/main/ko.js +1 -0
  82. package/dist/locales/4.3.124/main/nl.js +1 -0
  83. package/dist/locales/4.3.124/main/pl.js +1 -0
  84. package/dist/locales/4.3.124/main/pt-br.js +1 -0
  85. package/dist/locales/4.3.124/main/tr.js +1 -0
  86. package/dist/locales/4.3.124/main/zh.js +1 -0
  87. package/dist/look-island.svelte-QW0yvxsq.js +1278 -0
  88. package/dist/looks/4.3.124/looks.js +242 -0
  89. package/dist/looks/4.3.124/micdrop-wordmark-BYMG6vLR.svg +1 -0
  90. package/dist/looks/4.3.124/microphone-Ccv4r-kd.webp +0 -0
  91. package/dist/looks/4.3.124/superuser-CZF6a5gO.webp +0 -0
  92. package/dist/looks/4.3.124/treasury-DUE7lZzT.webp +0 -0
  93. package/dist/looks/4.3.124/user-image-yuS4errP.svg +9 -0
  94. package/dist/navigation-BYEhsDX4.js +176 -0
  95. package/dist/{nl-DOSKYHSx.js → nl-BQALrtyB.js} +10 -4
  96. package/dist/{nl-D92n5tHa.js → nl-ve_OaXOQ.js} +5 -1
  97. package/dist/normalizers-CqGXhPZo.js +44 -0
  98. package/dist/{phoneUtils-CS66SHie.js → phoneUtils-CL8tIxoM.js} +4 -0
  99. package/dist/{pixels-CFwOgA2N.js → pixels-CV8Zw_Kn.js} +1 -1
  100. package/dist/{pl-BlZHcnlS.js → pl-BHBBOz2I.js} +5 -1
  101. package/dist/{pl-CkLEymA2.js → pl-DaPcPjBE.js} +10 -4
  102. package/dist/{pt-br-BHuCQSM-.js → pt-br-BxdP86Vr.js} +10 -4
  103. package/dist/{pt-br-BrxthY0b.js → pt-br-D30dkLzU.js} +5 -1
  104. package/dist/{serverTotals-B8SJCzxE.js → serverTotals-DGQ7a35U.js} +1 -1
  105. package/dist/{showcase-state-options-KO_TYk3I.js → showcase-state-options-DTl2gdkG.js} +3 -3
  106. package/dist/to-event-card-props-CklRkTpt.js +205 -0
  107. package/dist/{tr-BnAdi4HO.js → tr-CFVBCuqV.js} +5 -1
  108. package/dist/{tr-Bvc34ODh.js → tr-CSfagpI3.js} +10 -4
  109. package/dist/types/index.d.ts +21 -4
  110. package/dist/utils-CowZZZtC.js +219 -0
  111. package/dist/venue-calendar.css +1 -1
  112. package/dist/venue-calendar.es.js +1550 -1836
  113. package/dist/venue-calendar.iife.js +35 -35
  114. package/dist/venue-calendar.umd.js +183 -54
  115. package/dist/widget-key-context-DX9WCLIM.js +744 -0
  116. package/dist/{zh-K0hOzZ3G.js → zh-DWMcKVLH.js} +10 -4
  117. package/dist/{zh-Tg1OTvWs.js → zh-DeEOoOFR.js} +5 -1
  118. package/package.json +4 -4
  119. package/dist/Checkout-CN1o3v9L.js +0 -1933
  120. package/dist/api-0hNBT78w.js +0 -654
  121. package/dist/i18n-CIpUYDU6.js +0 -28
  122. package/dist/i18n-DyjdmQSR.js +0 -608
  123. package/dist/locales/4.3.122/main/de.js +0 -1
  124. package/dist/locales/4.3.122/main/es.js +0 -1
  125. package/dist/locales/4.3.122/main/fr.js +0 -1
  126. package/dist/locales/4.3.122/main/id.js +0 -1
  127. package/dist/locales/4.3.122/main/it.js +0 -1
  128. package/dist/locales/4.3.122/main/ja.js +0 -1
  129. package/dist/locales/4.3.122/main/ko.js +0 -1
  130. package/dist/locales/4.3.122/main/nl.js +0 -1
  131. package/dist/locales/4.3.122/main/pl.js +0 -1
  132. package/dist/locales/4.3.122/main/pt-br.js +0 -1
  133. package/dist/locales/4.3.122/main/tr.js +0 -1
  134. package/dist/locales/4.3.122/main/zh.js +0 -1
  135. package/dist/to-event-card-props-DYIfPN8e.js +0 -379
  136. package/dist/utils-BzgFQSTg.js +0 -412
  137. package/dist/widget-key-context-CmI7Qdtf.js +0 -991
@@ -1,412 +0,0 @@
1
- import { g as e } from "./sizing-B7ixYndz.js";
2
- import { $ as t, I as n, L as r, P as i, V as a, at as o, rt as s, tt as c } from "./widget-key-context-CmI7Qdtf.js";
3
- import "./event-transform-DJYPMj8I.js";
4
- //#region node_modules/js-cookie/dist/js.cookie.mjs
5
- function l(e) {
6
- for (var t = 1; t < arguments.length; t++) {
7
- var n = arguments[t];
8
- for (var r in n) r !== "__proto__" && (e[r] = n[r]);
9
- }
10
- return e;
11
- }
12
- var u = {
13
- read: function(e) {
14
- return e[0] === "\"" && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
15
- },
16
- write: function(e) {
17
- return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
18
- }
19
- };
20
- function d(e, t) {
21
- function n(n, r, i) {
22
- if (!(typeof document > "u")) {
23
- i = l({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires && (i.expires = i.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
24
- var a = "";
25
- for (var o in i) i[o] && (a += "; " + o, i[o] !== !0 && (a += "=" + i[o].split(";")[0]));
26
- return document.cookie = n + "=" + e.write(r, n) + a;
27
- }
28
- }
29
- function r(t) {
30
- if (!(typeof document > "u" || arguments.length && !t)) {
31
- for (var n = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < n.length; i++) {
32
- var a = n[i].split("="), o = a.slice(1).join("=");
33
- try {
34
- var s = decodeURIComponent(a[0]);
35
- if (s in r || (r[s] = e.read(o, s)), t === s) break;
36
- } catch {}
37
- }
38
- return t ? r[t] : r;
39
- }
40
- }
41
- return Object.create({
42
- set: n,
43
- get: r,
44
- remove: function(e, t) {
45
- n(e, "", l({}, t, { expires: -1 }));
46
- },
47
- withAttributes: function(e) {
48
- return d(this.converter, l({}, this.attributes, e));
49
- },
50
- withConverter: function(e) {
51
- return d(l({}, this.converter, e), this.attributes);
52
- }
53
- }, {
54
- attributes: { value: Object.freeze(t) },
55
- converter: { value: Object.freeze(e) }
56
- });
57
- }
58
- var f = d(u, { path: "/" });
59
- //#endregion
60
- //#region src/lib/utils/cookies.ts
61
- function p(e, t, n = {}) {
62
- f.set(e, t, n);
63
- }
64
- function m(e) {
65
- return f.get(e);
66
- }
67
- function h(e) {
68
- f.remove(e);
69
- }
70
- //#endregion
71
- //#region src/lib/utils/checkoutState.ts
72
- var g = e("checkoutState"), _ = (e) => `micdrop:vc:${e}`, v = (e) => `micdrop-${e}`, y = (e) => _(`checkout-state-${e}`), b = (e) => `checkout-state-${e}`, x = (e) => _(`checkout-expiry-${e}`), S = (e) => `checkout-expiry-${e}`, C = v("cartid"), w = "checkout-cartid";
73
- function T(e) {
74
- return Number(e.type) === 2;
75
- }
76
- function E() {
77
- let e = typeof window < "u" && window.location.protocol === "https:";
78
- return {
79
- secure: e,
80
- sameSite: e ? "none" : "lax",
81
- path: "/"
82
- };
83
- }
84
- function D(e) {
85
- let n = {}, r = {}, i = [], a = "", o = 0, l = {};
86
- if (typeof window > "u") return {
87
- quantities: n,
88
- donationAmounts: r,
89
- addOnQuantities: l,
90
- promocode: a,
91
- promoDiscountAmount: o,
92
- tickets: i
93
- };
94
- let u = t(y(e), null);
95
- if (!u) {
96
- let n = t(b(e), null);
97
- n && (u = n, s(y(e), n), c(b(e)));
98
- }
99
- if (u) return {
100
- quantities: u.quantities || {},
101
- donationAmounts: u.donationAmounts || {},
102
- addOnQuantities: u.addOnQuantities || {},
103
- promocode: u.promocode || "",
104
- promoDiscountAmount: parseFloat(String(u.promoDiscountAmount)) || 0,
105
- tickets: u.tickets || []
106
- };
107
- try {
108
- n = JSON.parse(m(`checkout-quantities-${e}`) || "{}");
109
- } catch (e) {
110
- g.warn("Failed to parse checkout quantities cookie:", e), n = {};
111
- }
112
- try {
113
- i = JSON.parse(m(`checkout-tickets-${e}`) || "[]");
114
- } catch (e) {
115
- g.warn("Failed to parse checkout tickets cookie:", e), i = [];
116
- }
117
- return a = m(`checkout-promocode-${e}`) || "", o = parseFloat(m(`checkout-promo-discount-${e}`) || "0"), (Object.keys(n).length > 0 || i.length > 0 || a) && (A({
118
- eventID: e,
119
- quantities: n,
120
- donationAmounts: r,
121
- promocode: a,
122
- promoDiscountAmount: o,
123
- tickets: i
124
- }), O(e)), {
125
- quantities: n,
126
- donationAmounts: r,
127
- addOnQuantities: l,
128
- promocode: a,
129
- promoDiscountAmount: o,
130
- tickets: i
131
- };
132
- }
133
- function O(e) {
134
- h(`checkout-quantities-${e}`), h(`checkout-tickets-${e}`), h(`checkout-promocode-${e}`), h(`checkout-promo-discount-${e}`);
135
- }
136
- function k(e) {
137
- c(y(e)), c(b(e)), O(e), h(`checkout-promo-discount-type-${e}`), h(`checkout-promo-reveal-${e}`), h(`checkout-promo-reveal-ids-${e}`), h(`checkout-promo-ticket-ids-${e}`);
138
- }
139
- function A({ eventID: e, quantities: t, donationAmounts: n, addOnQuantities: r, promocode: i, promoDiscountAmount: a, tickets: o }) {
140
- if (typeof window > "u") return;
141
- let c = (o || []).map((e) => ({
142
- ID: e.ID,
143
- name: e.name,
144
- price: e.price,
145
- type: e.type,
146
- visibility: e.visibility,
147
- salesChannel: e.salesChannel
148
- })), l = {
149
- quantities: t || {},
150
- donationAmounts: n || {},
151
- addOnQuantities: r || {},
152
- promocode: i || "",
153
- promoDiscountAmount: a || 0,
154
- tickets: c,
155
- updatedAt: Date.now()
156
- };
157
- s(y(e), l);
158
- }
159
- function j(e) {
160
- if (!e) return null;
161
- let n = t(x(e), null);
162
- if (n != null) return P(n);
163
- let r = t(S(e), null);
164
- if (r == null) return null;
165
- let i = P(r);
166
- return i != null && (s(x(e), i), c(S(e))), i;
167
- }
168
- function M(e, t) {
169
- !e || !Number.isFinite(t) || s(x(e), t);
170
- }
171
- function N(e) {
172
- e && (c(x(e)), c(S(e)));
173
- }
174
- function P(e) {
175
- let t = typeof e == "number" ? e : parseInt(e, 10);
176
- return Number.isFinite(t) && t > 0 ? t : null;
177
- }
178
- function ee(e) {
179
- let t = E();
180
- p(C, e, t), p(w, e, t);
181
- }
182
- async function te(e) {
183
- let t = v(`order-id-${e}`), n = `order-id-${e}`, r = m(t) || m(n);
184
- if (r) return r;
185
- let i = `order-${e}-${Date.now()}`, a = E();
186
- return p(t, i, a), p(n, i, a), i;
187
- }
188
- var F = (e) => _(`queue-token-${e}`);
189
- function I(e) {
190
- return t(F(e), null);
191
- }
192
- function L(e, t) {
193
- t && s(F(e), t);
194
- }
195
- function R(e) {
196
- c(F(e));
197
- }
198
- //#endregion
199
- //#region src/lib/api/surge-queue.ts
200
- var z = e("VC"), B = "queue_unavailable", V = {
201
- armed: !1,
202
- mode: "off",
203
- waiting: 0,
204
- etaSeconds: 0
205
- }, H = 5e3, U = 1e3;
206
- function W(e) {
207
- return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.floor(e) : 0;
208
- }
209
- function G(e) {
210
- return e === "off" || e === "auto" || e === "on" ? e : "off";
211
- }
212
- function K(e) {
213
- return e === "open" || e === "waiting" || e === "admitted" ? e : "expired";
214
- }
215
- function q(e) {
216
- return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? H : Math.max(e, U);
217
- }
218
- function J(e) {
219
- let t = K(e?.state), n = typeof e?.token == "string" ? e.token : "";
220
- return !n && t !== "open" ? null : {
221
- token: n,
222
- state: t,
223
- position: W(e?.position),
224
- ahead: W(e?.ahead),
225
- etaSeconds: W(e?.etaSeconds),
226
- pollAfterMs: q(e?.pollAfterMs),
227
- expiresAt: typeof e?.expiresAt == "string" ? e.expiresAt : ""
228
- };
229
- }
230
- async function Y(e, t) {
231
- try {
232
- let r = await n(`/events/${e}/queue`, { widgetKey: t?.widgetKey });
233
- return r.success ? {
234
- armed: r.data?.armed === !0,
235
- mode: G(r.data?.mode),
236
- waiting: W(r.data?.waiting),
237
- etaSeconds: W(r.data?.etaSeconds)
238
- } : V;
239
- } catch (e) {
240
- return z.error("getQueueState error:", e), V;
241
- }
242
- }
243
- async function X(e, t) {
244
- try {
245
- let n = await r(`/events/${e}/queue/join`, {}, { widgetKey: t?.widgetKey });
246
- if (!n.success) return {
247
- success: !1,
248
- errorCode: n.errorCode || "queue_unavailable",
249
- statusCode: n.statusCode
250
- };
251
- let i = J(n.data);
252
- return i ? {
253
- success: !0,
254
- entry: i,
255
- statusCode: n.statusCode
256
- } : {
257
- success: !1,
258
- errorCode: B,
259
- statusCode: n.statusCode
260
- };
261
- } catch (e) {
262
- return z.error("joinQueue error:", e), {
263
- success: !1,
264
- errorCode: B
265
- };
266
- }
267
- }
268
- async function Z(e, t, r) {
269
- if (!t) return {
270
- success: !1,
271
- errorCode: B
272
- };
273
- try {
274
- let i = await n(`/events/${e}/queue/status?token=${encodeURIComponent(t)}`, { widgetKey: r?.widgetKey });
275
- if (!i.success) return {
276
- success: !1,
277
- errorCode: i.errorCode || "queue_unavailable",
278
- statusCode: i.statusCode
279
- };
280
- let a = J(i.data);
281
- return a ? {
282
- success: !0,
283
- entry: a,
284
- statusCode: i.statusCode
285
- } : {
286
- success: !1,
287
- errorCode: B,
288
- statusCode: i.statusCode
289
- };
290
- } catch (e) {
291
- return z.error("getQueueStatus error:", e), {
292
- success: !1,
293
- errorCode: B
294
- };
295
- }
296
- }
297
- async function ne(e, t, n) {
298
- if (!t) return { released: !1 };
299
- try {
300
- return { released: (await r(`/events/${e}/queue/leave`, { token: t }, {
301
- keepalive: !0,
302
- suppressOnError: !0,
303
- widgetKey: n?.widgetKey
304
- })).data?.released === !0 };
305
- } catch (e) {
306
- return z.error("leaveQueue error:", e), { released: !1 };
307
- }
308
- }
309
- //#endregion
310
- //#region src/lib/utils/orderApi.ts
311
- var Q = e("orderApi");
312
- function re(e) {
313
- if (typeof e == "string") return e;
314
- if (e && typeof e == "object") {
315
- let t = e.message;
316
- if (typeof t == "string" && t) return t;
317
- let n = e.code;
318
- if (typeof n == "string" && n) return n;
319
- }
320
- return "";
321
- }
322
- function ie(e) {
323
- if (e && typeof e == "object") {
324
- let t = e.code;
325
- if (typeof t == "string") return t;
326
- }
327
- return "";
328
- }
329
- async function ae() {
330
- return null;
331
- }
332
- async function oe(e, t) {
333
- try {
334
- let r = await n(`/venues/${e}`, { widgetKey: t?.widgetKey });
335
- if (!r.success) throw new o(r.error ?? `API error: ${r.statusCode}`, r.statusCode ?? 0, {
336
- endpoint: `/venues/${e}`,
337
- method: "GET"
338
- });
339
- return r.data;
340
- } catch (e) {
341
- throw Q.error("getVenueDetails error:", e), e;
342
- }
343
- }
344
- async function $(e = {}, t, n) {
345
- try {
346
- let i = await ae(), { eventID: a, quantities: o, donationAmounts: s, ...c } = e, l = o ? Object.fromEntries(Object.entries(o).map(([e, t]) => [parseInt(e, 10), t])) : {}, u = s ? Object.fromEntries(Object.entries(s).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))])) : void 0, d = {
347
- purchaserIP: i,
348
- eventID: a ? parseInt(String(a), 10) : void 0,
349
- quantities: l,
350
- ...u && Object.keys(u).length > 0 ? { donationAmounts: u } : {},
351
- ...c
352
- }, f = await r("/orders/create", d, t ? {
353
- headers: { "X-Queue-Token": t },
354
- widgetKey: n?.widgetKey
355
- } : { widgetKey: n?.widgetKey }), p = f.data ?? {};
356
- if (!f.success || p.error) {
357
- let e = re(p.error) || (typeof p.message == "string" ? p.message : "") || f.error || "Order creation failed";
358
- if ((f.errorCode || ie(p.error)) === "QUEUE_REQUIRED") return {
359
- success: !1,
360
- error: e,
361
- errorType: "queue"
362
- };
363
- let t = e.toLowerCase();
364
- return {
365
- success: !1,
366
- error: e,
367
- errorType: t.includes("inventory") || t.includes("sold out") || t.includes("not available") || t.includes("insufficient") || f.statusCode === 409 ? "inventory" : "server"
368
- };
369
- }
370
- return ee(p.uuid || p.cartUUID), {
371
- success: !0,
372
- uuid: p.uuid || p.cartUUID,
373
- serviceFee: p.serviceFee ?? 0,
374
- subtotal: p.subtotal ?? 0
375
- };
376
- } catch (e) {
377
- let t = e instanceof Error ? e.message : "Network error";
378
- return Q.error("Order initiation failed:", e), {
379
- success: !1,
380
- error: t,
381
- errorType: "network"
382
- };
383
- }
384
- }
385
- async function se(e, t) {
386
- try {
387
- let r = await n(`/orders/${e}`, { widgetKey: t?.widgetKey });
388
- if (!r.success) {
389
- let t = r.error ?? `Failed to fetch order (${r.statusCode})`;
390
- throw Q.error("getOrder error response:", t), new o(t, r.statusCode ?? 0, {
391
- endpoint: `/orders/${e}`,
392
- method: "GET"
393
- });
394
- }
395
- return r.data;
396
- } catch (e) {
397
- throw Q.error("getOrder error:", e), e;
398
- }
399
- }
400
- //#endregion
401
- //#region src/lib/utils/utm.ts
402
- var ce = e("utm");
403
- async function le(e) {
404
- let t = new URLSearchParams(window.location.search), n = i(t.get("utm_source")) || "direct";
405
- try {
406
- await fetch(`${a()}/utm/${e}/${encodeURIComponent(n)}`);
407
- } catch (e) {
408
- ce.error("UTM tracking failed:", e);
409
- }
410
- }
411
- //#endregion
412
- export { h as C, m as S, A as _, Y as a, M as b, ne as c, k as d, N as f, D as g, T as h, $ as i, C as l, te as m, se as n, Z as o, R as p, oe as r, X as s, le as t, w as u, j as v, p as w, L as x, I as y };