@getmicdrop/venue-calendar 4.0.106 → 4.0.108

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 (78) hide show
  1. package/README.md +740 -740
  2. package/dist/CartView-eQNOdQSz.js +2354 -0
  3. package/dist/CartView-eQNOdQSz.js.map +1 -0
  4. package/dist/{Checkout-DO-U-jI4.js → Checkout-C4zUFYYG.js} +606 -622
  5. package/dist/Checkout-C4zUFYYG.js.map +1 -0
  6. package/dist/{Checkout-BEauxCmt.js → Checkout-CACB_Qvi.js} +3 -3
  7. package/dist/Checkout-CACB_Qvi.js.map +1 -0
  8. package/dist/{CheckoutTimer-BNket1Fg.js → CheckoutTimer-D5llSBPs.js} +5 -5
  9. package/dist/CheckoutTimer-D5llSBPs.js.map +1 -0
  10. package/dist/{ClockIcon-Cqo9retG.js → ClockIcon-BJnxLZ4f.js} +2 -2
  11. package/dist/ClockIcon-BJnxLZ4f.js.map +1 -0
  12. package/dist/{CollectionView-Dq2SqpzE.js → CollectionView-BLpwWRcN.js} +31 -31
  13. package/dist/CollectionView-BLpwWRcN.js.map +1 -0
  14. package/dist/{Event-DoBDfGr-.js → Event-DXp4Ypv4.js} +15 -15
  15. package/dist/Event-DXp4Ypv4.js.map +1 -0
  16. package/dist/EventPage-Dfxyzfg2.js +949 -0
  17. package/dist/EventPage-Dfxyzfg2.js.map +1 -0
  18. package/dist/{Heading-CezkoB7-.js → Heading-C_Pc_j8f.js} +2 -2
  19. package/dist/Heading-C_Pc_j8f.js.map +1 -0
  20. package/dist/{ScarcityBadge-DdBiJx4s.js → ScarcityBadge-CSi-i0-w.js} +22 -22
  21. package/dist/ScarcityBadge-CSi-i0-w.js.map +1 -0
  22. package/dist/{SeriesPage-xrz2-uAc.js → SeriesPage-bPZlyzQ6.js} +5 -5
  23. package/dist/SeriesPage-bPZlyzQ6.js.map +1 -0
  24. package/dist/{Spinner-C_CcLVlr.js → Spinner-BFIjCOTb.js} +2 -2
  25. package/dist/Spinner-BFIjCOTb.js.map +1 -0
  26. package/dist/{Success-D63NKAXD.js → Success-Cv8d2syu.js} +122 -139
  27. package/dist/Success-Cv8d2syu.js.map +1 -0
  28. package/dist/{Text-CkjZ082Q.js → Text-tWGKQJab.js} +9 -9
  29. package/dist/Text-tWGKQJab.js.map +1 -0
  30. package/dist/{VenueCalendar-CNQZD54v.js → VenueCalendar-Dhoi9hF5.js} +4451 -4363
  31. package/dist/VenueCalendar-Dhoi9hF5.js.map +1 -0
  32. package/dist/{ViewTicketsEmbed-XLGxE6AE.js → ViewTicketsEmbed-BrXae6cK.js} +79 -79
  33. package/dist/ViewTicketsEmbed-BrXae6cK.js.map +1 -0
  34. package/dist/api/api.cjs.map +1 -1
  35. package/dist/api/api.mjs.map +1 -1
  36. package/dist/api/types.d.ts +483 -483
  37. package/dist/{labels-qYCu0gWu.js → labels-CGndTgO9.js} +39 -42
  38. package/dist/labels-CGndTgO9.js.map +1 -0
  39. package/dist/{modalManager.svelte-CQfHFG2s.js → modalManager.svelte-BgW5Xd6y.js} +2 -2
  40. package/dist/modalManager.svelte-BgW5Xd6y.js.map +1 -0
  41. package/dist/promo-WWbp2OWI.js.map +1 -1
  42. package/dist/seo/seo.cjs.map +1 -1
  43. package/dist/seo/seo.mjs.map +1 -1
  44. package/dist/{data-toggle-store.svelte-9Zfr1xPH.js → showcase-state-options-BxLP2R1L.js} +72 -45
  45. package/dist/showcase-state-options-BxLP2R1L.js.map +1 -0
  46. package/dist/{transform-DKQtPuXk.js → transform-CVOgA-Ky.js} +10 -10
  47. package/dist/transform-CVOgA-Ky.js.map +1 -0
  48. package/dist/types/index.d.ts +455 -455
  49. package/dist/venue-calendar.css +1 -1
  50. package/dist/venue-calendar.es.js +4 -4
  51. package/dist/venue-calendar.iife.js +44 -44
  52. package/dist/venue-calendar.iife.js.map +1 -1
  53. package/dist/venue-calendar.umd.js +42 -42
  54. package/dist/venue-calendar.umd.js.map +1 -1
  55. package/package.json +11 -3
  56. package/src/lib/theme.js +222 -222
  57. package/dist/CartView-CIfnfmZj.js +0 -2348
  58. package/dist/CartView-CIfnfmZj.js.map +0 -1
  59. package/dist/Checkout-BEauxCmt.js.map +0 -1
  60. package/dist/Checkout-DO-U-jI4.js.map +0 -1
  61. package/dist/CheckoutTimer-BNket1Fg.js.map +0 -1
  62. package/dist/ClockIcon-Cqo9retG.js.map +0 -1
  63. package/dist/CollectionView-Dq2SqpzE.js.map +0 -1
  64. package/dist/Event-DoBDfGr-.js.map +0 -1
  65. package/dist/EventPage-Dbw2JTn6.js +0 -940
  66. package/dist/EventPage-Dbw2JTn6.js.map +0 -1
  67. package/dist/Heading-CezkoB7-.js.map +0 -1
  68. package/dist/ScarcityBadge-DdBiJx4s.js.map +0 -1
  69. package/dist/SeriesPage-xrz2-uAc.js.map +0 -1
  70. package/dist/Spinner-C_CcLVlr.js.map +0 -1
  71. package/dist/Success-D63NKAXD.js.map +0 -1
  72. package/dist/Text-CkjZ082Q.js.map +0 -1
  73. package/dist/VenueCalendar-CNQZD54v.js.map +0 -1
  74. package/dist/ViewTicketsEmbed-XLGxE6AE.js.map +0 -1
  75. package/dist/data-toggle-store.svelte-9Zfr1xPH.js.map +0 -1
  76. package/dist/labels-qYCu0gWu.js.map +0 -1
  77. package/dist/modalManager.svelte-CQfHFG2s.js.map +0 -1
  78. package/dist/transform-DKQtPuXk.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
- import { u as I, aW as M, aX as N, ae as Y, N as F, z as D, aN as V } from "./VenueCalendar-CNQZD54v.js";
4
- import { T as p } from "./Text-CkjZ082Q.js";
3
+ import { u as Y, aX as I, aY as O, aZ as M, ag as V, O as F, A as $, aO as N } from "./VenueCalendar-Dhoi9hF5.js";
4
+ import { T as p } from "./Text-tWGKQJab.js";
5
5
  var G = e.from_svg('<path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"></path>'), j = e.from_svg('<rect x="40" y="40" width="176" height="176" rx="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></rect><line x1="176" y1="24" x2="176" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><line x1="80" y1="24" x2="80" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><line x1="40" y1="88" x2="216" y2="88" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><polyline points="88 128 104 120 104 184" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline><path d="M138.14,128a16,16,0,1,1,26.64,17.63L136,184h32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path>', 1), U = e.from_svg('<svg aria-hidden="true" viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><!></svg>');
6
6
  function re(r, t) {
7
7
  e.push(t, !0);
8
8
  let a = e.prop(t, "size", 3, "24"), f = e.prop(t, "color", 3, "currentColor"), m = e.prop(t, "class", 3, "");
9
- const T = I();
9
+ const T = Y();
10
10
  let _ = e.derived(() => t.weight ?? T?.weight ?? "regular");
11
11
  var i = U();
12
12
  let S;
@@ -27,9 +27,6 @@ function re(r, t) {
27
27
  e.set_class(i, 0, e.clsx(m())), e.set_attribute(i, "width", a()), e.set_attribute(i, "height", a()), S = e.set_style(i, "", S, { color: f() });
28
28
  }), e.append(r, i), e.pop();
29
29
  }
30
- function O(r, t, a = "en-US") {
31
- return new Intl.DateTimeFormat(a, t).format(r);
32
- }
33
30
  function W(r, t, a = {}) {
34
31
  const {
35
32
  cancelled: f = !1,
@@ -41,7 +38,7 @@ function W(r, t, a = {}) {
41
38
  const i = r.endDateTime || r.startDateTime;
42
39
  if (i && new Date(i) < _)
43
40
  return { text: "Sales ended", disabled: !0, reason: "event_past" };
44
- const S = r?.hasPurchasableHiddenTickets === !0 || Array.isArray(t) && t.some(M), g = (t || []).filter(
41
+ const S = r?.hasPurchasableHiddenTickets === !0 || Array.isArray(t) && t.some(I), g = (t || []).filter(
45
42
  (o) => o.salesChannel !== 2 && !o.isHidden && !(typeof o.visibility == "number" && o.visibility >= 2)
46
43
  );
47
44
  if (g.length === 0)
@@ -56,8 +53,8 @@ function W(r, t, a = {}) {
56
53
  };
57
54
  let P = !1, E = !0, v = !0, u = null;
58
55
  for (const o of g) {
59
- const y = o.salesBegin || o.salesStart || o.saleBegin || o.onSaleStart, A = o.salesEnd || o.saleEnd || o.onSaleEnd, b = o.remainingCapacity ?? o.quantityRemaining ?? o.quantity, x = o.soldOut || b != null && b <= 0, h = y ? new Date(y) > _ : !1, $ = A ? new Date(A) < _ : !1;
60
- if (!x && !h && !$ && (P = !0), x || (E = !1), h || (v = !1), h && y && !x && !$) {
56
+ const y = o.salesBegin || o.salesStart || o.saleBegin || o.onSaleStart, A = o.salesEnd || o.saleEnd || o.onSaleEnd, b = o.remainingCapacity ?? o.quantityRemaining ?? o.quantity, x = o.soldOut || b != null && b <= 0, h = y ? new Date(y) > _ : !1, D = A ? new Date(A) < _ : !1;
57
+ if (!x && !h && !D && (P = !0), x || (E = !1), h || (v = !1), h && y && !x && !D) {
61
58
  const R = new Date(y);
62
59
  (!u || R < u) && (u = R);
63
60
  }
@@ -110,11 +107,11 @@ function W(r, t, a = {}) {
110
107
  } : { text: "Sales ended", disabled: !0, reason: "sales_ended" };
111
108
  }
112
109
  function ae(r, t) {
113
- const a = Y(r, t);
110
+ const a = V(r, t);
114
111
  return a === "sold-out" ? "sold_out" : a === "plenty" ? "none" : a;
115
112
  }
116
113
  function ie(r, t, a, f) {
117
- return r === "none" ? null : r === "sold_out" ? "Sold out" : r === "urgent" && a !== "browse" && t <= N.MAX_EXACT_COUNT ? `Only ${t} left` : r === "low" || r === "urgent" ? "Selling fast" : null;
114
+ return r === "none" ? null : r === "sold_out" ? "Sold out" : r === "urgent" && a !== "browse" && t <= M.MAX_EXACT_COUNT ? `Only ${t} left` : r === "low" || r === "urgent" ? "Selling fast" : null;
118
115
  }
119
116
  function oe(r) {
120
117
  const t = r.tickets.map((f) => ({
@@ -196,7 +193,7 @@ function ne(r) {
196
193
  function le(r, t) {
197
194
  return F(r * (t / 100));
198
195
  }
199
- const K = {
196
+ const Z = {
200
197
  normal: 300
201
198
  };
202
199
  function de() {
@@ -213,7 +210,7 @@ function de() {
213
210
  revealTicketIds: []
214
211
  };
215
212
  }
216
- var q = e.from_html('<div class="flex justify-between"><!> <!></div>'), Z = e.from_html('<div class="flex justify-between pt-1 border-t border-default"><!> <!></div>'), J = e.from_html('<!> <!> <!> <!> <!> <div class="flex justify-between pt-2 border-t border-default"><!> <!></div>', 1), X = e.from_html('<div class="space-y-2"><!> <!></div>');
213
+ var q = e.from_html('<div class="flex justify-between"><!> <!></div>'), K = e.from_html('<div class="flex justify-between pt-1 border-t border-default"><!> <!></div>'), J = e.from_html('<!> <!> <!> <!> <!> <div class="flex justify-between pt-2 border-t border-default"><!> <!></div>', 1), X = e.from_html('<div class="space-y-2"><!> <!></div>');
217
214
  function ce(r, t) {
218
215
  e.push(t, !0);
219
216
  let a = e.prop(t, "labels", 19, () => ({})), f = e.prop(t, "mode", 3, "full");
@@ -238,8 +235,8 @@ function ce(r, t) {
238
235
  children: (b, x) => {
239
236
  e.next();
240
237
  var h = e.text();
241
- e.template_effect(($) => e.set_text(h, $), [
242
- () => e.get(u).isDonation ? D(e.get(u).subtotal) : V(e.get(u).subtotal, a())
238
+ e.template_effect((D) => e.set_text(h, D), [
239
+ () => e.get(u).isDonation ? $(e.get(u).subtotal) : N(e.get(u).subtotal, a())
243
240
  ]), e.append(b, h);
244
241
  },
245
242
  $$slots: { default: !0 }
@@ -256,7 +253,7 @@ function ce(r, t) {
256
253
  var P = J(), E = e.first_child(P);
257
254
  {
258
255
  var v = (n) => {
259
- var l = Z(), d = e.child(l);
256
+ var l = K(), d = e.child(l);
260
257
  p(d, {
261
258
  size: "sm",
262
259
  color: "muted",
@@ -274,7 +271,7 @@ function ce(r, t) {
274
271
  children: (c, w) => {
275
272
  e.next();
276
273
  var s = e.text();
277
- e.template_effect((C) => e.set_text(s, C), [() => D(t.orderTotals.subtotal)]), e.append(c, s);
274
+ e.template_effect((C) => e.set_text(s, C), [() => $(t.orderTotals.subtotal)]), e.append(c, s);
278
275
  },
279
276
  $$slots: { default: !0 }
280
277
  }), e.reset(l), e.append(n, l);
@@ -297,7 +294,7 @@ function ce(r, t) {
297
294
  children: (c, w) => {
298
295
  e.next();
299
296
  var s = e.text();
300
- e.template_effect((C) => e.set_text(s, C), [() => D(t.orderTotals.subtotal)]), e.append(c, s);
297
+ e.template_effect((C) => e.set_text(s, C), [() => $(t.orderTotals.subtotal)]), e.append(c, s);
301
298
  },
302
299
  $$slots: { default: !0 }
303
300
  }), e.reset(l), e.append(n, l);
@@ -327,7 +324,7 @@ function ce(r, t) {
327
324
  children: (c, w) => {
328
325
  e.next();
329
326
  var s = e.text();
330
- e.template_effect((C) => e.set_text(s, C), [() => D(t.orderTotals.fees)]), e.append(c, s);
327
+ e.template_effect((C) => e.set_text(s, C), [() => $(t.orderTotals.fees)]), e.append(c, s);
331
328
  },
332
329
  $$slots: { default: !0 }
333
330
  }), e.reset(l), e.append(n, l);
@@ -357,7 +354,7 @@ function ce(r, t) {
357
354
  children: (c, w) => {
358
355
  e.next();
359
356
  var s = e.text();
360
- e.template_effect((C) => e.set_text(s, C), [() => D(t.orderTotals.taxes)]), e.append(c, s);
357
+ e.template_effect((C) => e.set_text(s, C), [() => $(t.orderTotals.taxes)]), e.append(c, s);
361
358
  },
362
359
  $$slots: { default: !0 }
363
360
  }), e.reset(l), e.append(n, l);
@@ -387,7 +384,7 @@ function ce(r, t) {
387
384
  children: (c, w) => {
388
385
  e.next();
389
386
  var s = e.text();
390
- e.template_effect((C) => e.set_text(s, `-${C ?? ""}`), [() => D(t.orderTotals.promoDiscount)]), e.append(c, s);
387
+ e.template_effect((C) => e.set_text(s, `-${C ?? ""}`), [() => $(t.orderTotals.promoDiscount)]), e.append(c, s);
391
388
  },
392
389
  $$slots: { default: !0 }
393
390
  }), e.reset(l), e.append(n, l);
@@ -396,7 +393,7 @@ function ce(r, t) {
396
393
  t.orderTotals.promoDiscount > 0 && n(h);
397
394
  });
398
395
  }
399
- var $ = e.sibling(x, 2);
396
+ var D = e.sibling(x, 2);
400
397
  {
401
398
  var L = (n) => {
402
399
  var l = q(), d = e.child(l);
@@ -417,17 +414,17 @@ function ce(r, t) {
417
414
  children: (c, w) => {
418
415
  e.next();
419
416
  var s = e.text();
420
- e.template_effect((C) => e.set_text(s, `-${C ?? ""}`), [() => D(t.orderTotals.giftCardAmount)]), e.append(c, s);
417
+ e.template_effect((C) => e.set_text(s, `-${C ?? ""}`), [() => $(t.orderTotals.giftCardAmount)]), e.append(c, s);
421
418
  },
422
419
  $$slots: { default: !0 }
423
420
  }), e.reset(l), e.append(n, l);
424
421
  };
425
- e.if($, (n) => {
422
+ e.if(D, (n) => {
426
423
  t.orderTotals.giftCardAmount > 0 && n(L);
427
424
  });
428
425
  }
429
- var R = e.sibling($, 2), z = e.child(R);
430
- p(z, {
426
+ var R = e.sibling(D, 2), H = e.child(R);
427
+ p(H, {
431
428
  size: "base",
432
429
  weight: "semibold",
433
430
  children: (n, l) => {
@@ -437,14 +434,14 @@ function ce(r, t) {
437
434
  },
438
435
  $$slots: { default: !0 }
439
436
  });
440
- var H = e.sibling(z, 2);
441
- p(H, {
437
+ var z = e.sibling(H, 2);
438
+ p(z, {
442
439
  size: "base",
443
440
  weight: "semibold",
444
441
  children: (n, l) => {
445
442
  e.next();
446
443
  var d = e.text();
447
- e.template_effect((k) => e.set_text(d, k), [() => D(t.orderTotals.total)]), e.append(n, d);
444
+ e.template_effect((k) => e.set_text(d, k), [() => $(t.orderTotals.total)]), e.append(n, d);
448
445
  },
449
446
  $$slots: { default: !0 }
450
447
  }), e.reset(R), e.append(g, P);
@@ -453,7 +450,7 @@ function ce(r, t) {
453
450
  f() !== "lines" && g(S);
454
451
  });
455
452
  }
456
- e.reset(m), e.template_effect(() => e.set_style(m, `transition-duration: ${K.normal}ms;`)), e.append(r, m), e.pop();
453
+ e.reset(m), e.template_effect(() => e.set_style(m, `transition-duration: ${Z.normal}ms;`)), e.append(r, m), e.pop();
457
454
  }
458
455
  const Q = {
459
456
  // ── Ticket quantity controls ──────────────────────────────────────
@@ -482,9 +479,9 @@ const Q = {
482
479
  selectTicketsToContinue: "Select tickets to continue",
483
480
  reserveASpot: "Reserve a spot",
484
481
  // ── Password modal / gate ─────────────────────────────────────────
485
- enterPassword: "Enter Password",
482
+ enterPassword: "Enter password",
486
483
  enterEventPassword: "Enter event password",
487
- passwordRequired: "Password Required",
484
+ passwordRequired: "Password required",
488
485
  passwordRequiredShort: "Password required",
489
486
  eventRequiresPassword: "This event requires a password to purchase tickets.",
490
487
  eventRequiresPasswordAccess: "This event requires a password to access tickets.",
@@ -508,7 +505,7 @@ const Q = {
508
505
  giftCard: "Gift card",
509
506
  total: "Total",
510
507
  orderSummary: "Order summary",
511
- yourOrder: "Your Order",
508
+ yourOrder: "Your order",
512
509
  // ── Ticket counts (used in CTA buttons) ───────────────────────────
513
510
  ticket: "ticket",
514
511
  tickets: "tickets",
@@ -573,7 +570,7 @@ const Q = {
573
570
  doors: "Doors",
574
571
  doorsOpenAt: "Doors open at",
575
572
  // ── Series occurrences ────────────────────────────────────────────
576
- upcomingDates: "Upcoming Dates",
573
+ upcomingDates: "Upcoming dates",
577
574
  // ── Close / dismiss ───────────────────────────────────────────────
578
575
  closeTicketSelection: "Close ticket selection",
579
576
  closeTicketSelector: "Close ticket selector",
@@ -582,20 +579,20 @@ const Q = {
582
579
  ticketsSelected: "tickets selected",
583
580
  view: "View",
584
581
  // ── Success page (public-calendar-flow) ────────────────────────────────
585
- youreIn: "You're in!",
586
- youreRegistered: "You're registered!",
582
+ youreIn: "You're in",
583
+ youreRegistered: "You're registered",
587
584
  confirmed: "confirmed",
588
585
  viewTickets: "View tickets",
589
586
  order: "Order",
590
587
  confirmationSentTo: "Confirmation sent to",
591
- addToCalendar: "Add to Calendar",
588
+ addToCalendar: "Add to calendar",
592
589
  googleCalendar: "Google Calendar",
593
590
  appleCalendar: "Apple Calendar (.ics)",
594
591
  share: "Share",
595
592
  map: "Map",
596
593
  backToEvent: "Back to event",
597
594
  needHelp: "Need help?",
598
- linkCopied: "Link copied to clipboard!",
595
+ linkCopied: "Link copied to clipboard",
599
596
  copyLink: "Copy this link:",
600
597
  addToAppleWallet: "Add to Apple Wallet",
601
598
  saveToGoogleWallet: "Save to Google Wallet",
@@ -614,9 +611,9 @@ const Q = {
614
611
  selectTicketsAgain: "Select tickets again",
615
612
  extendingSession: "Extending...",
616
613
  // ── MobileCta ─────────────────────────────────────────────────────
617
- selectTicketsLabel: "Select Tickets",
614
+ selectTicketsLabel: "Select tickets",
618
615
  // ── Waitlist (sold-out gating + tokenized unlock) ─────────────────
619
- joinWaitlist: "Join Waitlist",
616
+ joinWaitlist: "Join waitlist",
620
617
  getNotifiedWhenAvailable: "Get notified when tickets are available",
621
618
  // Tokenized-link unlock outcomes (decisions #3/#22/#36). Mapped from the
622
619
  // server's failure enum; shown as a small dismissible notice near the CTA.
@@ -632,7 +629,7 @@ function ue(r = {}) {
632
629
  }
633
630
  export {
634
631
  re as C,
635
- K as D,
632
+ Z as D,
636
633
  ce as O,
637
634
  ie as a,
638
635
  oe as b,
@@ -642,4 +639,4 @@ export {
642
639
  ae as g,
643
640
  ue as m
644
641
  };
645
- //# sourceMappingURL=labels-qYCu0gWu.js.map
642
+ //# sourceMappingURL=labels-CGndTgO9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels-CGndTgO9.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/CalendarIcon.svelte","../src/lib/api/cta.ts","../src/lib/public-calendar-flow/defaults.ts","../src/lib/public-calendar-flow/OrderSummary.svelte","../src/lib/public-calendar-flow/i18n/labels.js"],"sourcesContent":["<script lang=\"ts\">\n /**\n * Calendar — Phosphor icon (canonical Micdrop icon family).\n * Outline by default; pass `weight=\"fill\"` for solid, or let a stateful parent\n * (NavItem / Tabs / BottomNav / status badge) drive it via icon-weight context.\n */\n import { useIconWeight, type IconWeight } from './iconWeight.js';\n\n interface Props {\n /** Pixel size (width + height). */\n size?: string;\n /** Icon color; defaults to `currentColor` (inherits text color). */\n color?: string;\n /** Extra classes. */\n class?: string;\n /** `regular` (outline) or `fill` (solid). Overrides ambient state weight. */\n weight?: IconWeight;\n }\n\n let { size = '24', color = 'currentColor', class: className = '', weight }: Props = $props();\n\n const ctx = useIconWeight();\n let resolved: IconWeight = $derived(weight ?? ctx?.weight ?? 'regular');\n</script>\n\n<svg\n class={className}\n aria-hidden=\"true\"\n width={size}\n height={size}\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style:color={color}\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n {#if resolved === 'fill'}<path d=\"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z\"/>{:else}<rect x=\"40\" y=\"40\" width=\"176\" height=\"176\" rx=\"8\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><line x1=\"176\" y1=\"24\" x2=\"176\" y2=\"56\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><line x1=\"80\" y1=\"24\" x2=\"80\" y2=\"56\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><line x1=\"40\" y1=\"88\" x2=\"216\" y2=\"88\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><polyline points=\"88 128 104 120 104 184\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><path d=\"M138.14,128a16,16,0,1,1,26.64,17.63L136,184h32\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/>{/if}\n</svg>\n","/**\n * CTA state computation.\n *\n * Pure function (no I/O) — derives the buy-button state from an event and\n * its ticket list. Lives in `api/` because it is the canonical, single\n * source of truth that replaces the duplicate implementations previously\n * scattered across utils/api.js, core/api-client.js, and a few components.\n */\n\n// Import from the specific subpath (not the bare entry) so the api/\n// bundle doesn't pull in the entire SC component graph (Accordion etc.)\n// and break `npm run build:api`. `formatLocal` is the sanctioned browser-local\n// (no-timezone) Intl label home — these \"On sale …\" countdown labels render in\n// the viewer's own clock, so no venue timezone applies. The datetime subpath is\n// leaf/component-free; only `formatLocal` (→ Intl) is pulled, no date-fns.\nimport { formatLocal } from '@getmicdrop/svelte-components/datetime';\n// Hidden-ticket predicate from the `/transforms` leaf subpath (no component\n// graph, so `npm run build:api` stays clean). SC's copy was pinned FROM this\n// body (dedup #392) and additionally honours the backend-resolved\n// `effectiveSales*` window for relative-offset tickets (#388). Imported (not\n// just re-exported) so it stays in local scope for `computeCtaState` below.\nimport { isHiddenTicketPurchasable } from '@getmicdrop/svelte-components/transforms';\n\nexport interface CtaStateOptions {\n cancelled?: boolean;\n isRegistration?: boolean;\n waitlistEnabled?: boolean;\n}\n\nexport interface CtaState {\n text: string;\n disabled: boolean;\n reason:\n | 'cancelled'\n | 'event_past'\n | 'no_tickets'\n | 'available'\n | 'coming_soon'\n | 'sold_out_waitlist'\n | 'sold_out'\n | 'sales_ended'\n | 'hidden_only';\n}\n\ninterface CtaEvent {\n startDateTime?: string | null;\n endDateTime?: string | null;\n hasPurchasableHiddenTickets?: boolean;\n}\n\ninterface CtaTicket {\n salesChannel?: number;\n salesBegin?: string | null;\n salesStart?: string | null;\n saleBegin?: string | null;\n onSaleStart?: string | null;\n salesEnd?: string | null;\n saleEnd?: string | null;\n onSaleEnd?: string | null;\n remainingCapacity?: number | null;\n quantityRemaining?: number | null;\n quantity?: number | null;\n soldOut?: boolean;\n isHidden?: boolean;\n visibility?: number;\n}\n\n// A hidden ticket (visibility>=2 or isHidden) that's still on sale drives the\n// \"Sales ended\" / \"Sold out\" / \"No tickets\" → \"Get tickets\" override. The user\n// just needs the promo code to see it. Re-exported from the SC canonical so\n// existing consumers (cta.test.ts, computeCtaState) keep their import path while\n// the single-source body lives in SC (dedup #392).\nexport { isHiddenTicketPurchasable };\n\nexport function computeCtaState(\n event: CtaEvent,\n tickets: CtaTicket[] | undefined,\n options: CtaStateOptions = {}\n): CtaState {\n const {\n cancelled = false,\n isRegistration = false,\n waitlistEnabled = false,\n } = options;\n const now = new Date(); // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\n\n if (cancelled)\n return { text: 'Cancelled', disabled: true, reason: 'cancelled' };\n\n const eventEnd = event.endDateTime || event.startDateTime;\n // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\n if (eventEnd && new Date(eventEnd) < now) {\n return { text: 'Sales ended', disabled: true, reason: 'event_past' };\n }\n\n const hiddenAvailable =\n event?.hasPurchasableHiddenTickets === true ||\n (Array.isArray(tickets) && tickets.some(isHiddenTicketPurchasable));\n\n const publicTickets = (tickets || []).filter(\n t =>\n t.salesChannel !== 2 &&\n !t.isHidden &&\n !(typeof t.visibility === 'number' && t.visibility >= 2)\n );\n if (publicTickets.length === 0) {\n if (hiddenAvailable) {\n return {\n text: isRegistration ? 'Reserve a spot' : 'Get tickets',\n disabled: false,\n reason: 'hidden_only',\n };\n }\n return {\n text: 'No tickets available',\n disabled: true,\n reason: 'no_tickets',\n };\n }\n\n let hasPurchasable = false;\n let allSoldOut = true;\n let allComingSoon = true;\n let earliestSalesStart: Date | null = null;\n\n for (const ticket of publicTickets) {\n const salesBegin =\n ticket.salesBegin ||\n ticket.salesStart ||\n ticket.saleBegin ||\n ticket.onSaleStart;\n const salesEnd = ticket.salesEnd || ticket.saleEnd || ticket.onSaleEnd;\n const remaining =\n ticket.remainingCapacity ?? ticket.quantityRemaining ?? ticket.quantity;\n const isSoldOut =\n ticket.soldOut ||\n (remaining !== null && remaining !== undefined && remaining <= 0);\n\n const isScheduled = salesBegin ? new Date(salesBegin) > now : false; // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\n const hasSalesEnded = salesEnd ? new Date(salesEnd) < now : false; // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\n const isPurchasable = !isSoldOut && !isScheduled && !hasSalesEnded;\n\n if (isPurchasable) hasPurchasable = true;\n if (!isSoldOut) allSoldOut = false;\n if (!isScheduled) allComingSoon = false;\n\n if (isScheduled && salesBegin && !isSoldOut && !hasSalesEnded) {\n const startDate = new Date(salesBegin); // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\n if (!earliestSalesStart || startDate < earliestSalesStart) {\n earliestSalesStart = startDate;\n }\n }\n }\n\n if (hasPurchasable) {\n return {\n text: isRegistration ? 'Reserve a spot' : 'Get tickets',\n disabled: false,\n reason: 'available',\n };\n }\n\n if (allComingSoon && earliestSalesStart) {\n if (hiddenAvailable) {\n return {\n text: isRegistration ? 'Reserve a spot' : 'Get tickets',\n disabled: false,\n reason: 'hidden_only',\n };\n }\n const diffMs = earliestSalesStart.getTime() - now.getTime();\n const diffHours = diffMs / (1000 * 60 * 60);\n const diffDays = diffMs / (1000 * 60 * 60 * 24);\n // Viewer-local time label (\"8:00 PM\") — the shape shared by the <24h branch\n // and the >7d composite. Matches the deprecated `formatTime(d,{hour12:true})`\n // defaults-merge exactly.\n const timeLabel = (d: Date) =>\n formatLocal(\n d,\n { hour: 'numeric', minute: '2-digit', hour12: true },\n 'en-US'\n );\n let dateText: string;\n if (diffHours < 24) {\n dateText = timeLabel(earliestSalesStart);\n } else if (diffDays <= 7) {\n dateText = formatLocal(\n earliestSalesStart,\n { weekday: 'short', hour: 'numeric', minute: '2-digit', hour12: true },\n 'en-US'\n );\n } else {\n const d = formatLocal(\n earliestSalesStart,\n { month: 'short', day: 'numeric' },\n 'en-US'\n );\n dateText = `${d} ${timeLabel(earliestSalesStart)}`;\n }\n return {\n text: `On sale ${dateText}`,\n disabled: true,\n reason: 'coming_soon',\n };\n }\n\n if (allSoldOut) {\n if (hiddenAvailable) {\n return {\n text: isRegistration ? 'Reserve a spot' : 'Get tickets',\n disabled: false,\n reason: 'hidden_only',\n };\n }\n if (waitlistEnabled) {\n return {\n text: 'Join Waitlist',\n disabled: false,\n reason: 'sold_out_waitlist',\n };\n }\n return { text: 'Sold out', disabled: true, reason: 'sold_out' };\n }\n\n if (hiddenAvailable) {\n return {\n text: isRegistration ? 'Reserve a spot' : 'Get tickets',\n disabled: false,\n reason: 'hidden_only',\n };\n }\n\n return { text: 'Sales ended', disabled: true, reason: 'sales_ended' };\n}\n","// @currency-escape: feeCents / 100 in calculateServiceFee is arithmetic,\n// not display. Produces a dollar-magnitude number used in the fee formula\n// `price * (feePercentage / 100) + feeCents / 100`. Per Atlas\n// utility-currency convergence record; the no-handrolled-currency\n// ESLint rule's divideByHundred detector treats variable-name `Cents`\n// as drift but here it's real math.\n\n// Premium Ticket Experience — Constants & Defaults\n// Used by all design variants. DO NOT MODIFY per-variant.\n\n// This file is the canonical formatter module for public-calendar-flow: it\n// wraps + re-exports the timezone-aware production date/time formatters, plus\n// the shared sales-countdown formatter (formatSmartSalesDate) hoisted into\n// svelte-components (SC #471). No raw Intl date formatting lives here anymore.\n\nimport type {\n EventData,\n TicketTypeData,\n ScarcityLevel,\n CtaConfig,\n PromoCodeState,\n} from './types';\nimport { computeCtaState } from '$lib/api';\nimport {\n computeScarcityLevel,\n SCARCITY_THRESHOLDS,\n} from '$lib/constants/scarcity';\nimport type { Cents } from '@getmicdrop/svelte-components';\nimport { roundCurrency } from '@getmicdrop/svelte-components';\nimport { formatSmartSalesDate } from '@getmicdrop/svelte-components/utils/formatters';\nimport {\n formatFullDate,\n formatFullDateCompact,\n formatEventTime,\n formatTimeRange,\n formatDoorsTime,\n formatSalesDate,\n formatBrowseDate,\n formatEventDate,\n formatCleanTimeRange,\n getDateParts,\n} from '$lib/utils/datetime.js';\n\n// --- Re-export production date/time formatters (timezone-aware) ---\nexport {\n formatFullDate,\n formatFullDateCompact,\n formatEventTime,\n formatTimeRange,\n formatDoorsTime,\n formatSalesDate,\n formatBrowseDate,\n formatEventDate,\n formatCleanTimeRange,\n getDateParts,\n};\n\n// Shared sales-countdown formatter, adopted from svelte-components (SC #471).\n// Kept as a re-export so public-calendar-flow consumers import it from this\n// module unchanged. English defaults match VC's prior copy; the clock time\n// renders in UTC (matching the production TicketBlock origin) rather than the\n// old copy's viewer-local time.\nexport { formatSmartSalesDate };\n\n// --- Scarcity Badge Rules ---\n// Threshold logic lives in the ONE canonical computeScarcityLevel\n// ($lib/constants/scarcity) — including the sliding floor/cap that keeps a\n// 1,000-seat show from flagging \"Selling fast\" at 200 left. This module only\n// adapts the canon's tier enum ('sold-out'/'plenty') to public-calendar-flow's\n// display enum ('sold_out'/'none') and renders the copy.\nexport function getScarcityLevel(\n remaining: number,\n total: number\n): ScarcityLevel {\n const level = computeScarcityLevel(remaining, total);\n if (level === 'sold-out') return 'sold_out';\n if (level === 'plenty') return 'none';\n return level; // 'urgent' | 'low' — identical between the two enums\n}\n\nexport function getScarcityText(\n level: ScarcityLevel,\n remaining: number,\n context: 'browse' | 'event' | 'ticket',\n options?: { isFree?: boolean }\n): string | null {\n if (level === 'none') return null;\n if (level === 'sold_out') return 'Sold out';\n // No scarcity badges on free events/tickets — nothing to lose = no urgency\n if (options?.isFree) return null;\n if (\n level === 'urgent' &&\n context !== 'browse' &&\n remaining <= SCARCITY_THRESHOLDS.MAX_EXACT_COUNT\n ) {\n return `Only ${remaining} left`;\n }\n if (level === 'low' || level === 'urgent') return 'Selling fast';\n return null;\n}\n\n// --- CTA Rules ---\n// Delegates to production computeCtaState() but adapts our EventData shape.\n// Components keep calling getCtaConfig(event) — internal logic is production-aligned.\nexport function getCtaConfig(event: EventData): CtaConfig {\n // Map our EventData tickets to the shape computeCtaState expects.\n // `isHidden` flows through so computeCtaState can apply the hidden-only\n // \"Sales ended\" → \"Get tickets\" override (MIC-1039).\n const apiTickets = event.tickets.map(t => ({\n salesBegin: t.salesStartDate,\n salesEnd: t.salesEndDate,\n remainingCapacity: t.quantityAvailable,\n totalCapacity: t.quantityTotal,\n soldOut: t.status === 'sold_out',\n salesChannel: 1, // All our tickets are online (not \"at the door only\")\n isHidden: t.isHidden,\n }));\n\n // Handle statuses that computeCtaState doesn't compute from tickets\n if (event.status === 'cancelled') {\n return {\n text: 'Cancelled',\n disabled: true,\n reason: 'This event has been cancelled',\n };\n }\n if (event.status === 'past') {\n return {\n text: 'Event ended',\n disabled: true,\n reason: 'This event has ended',\n };\n }\n\n const result = computeCtaState(\n { startDateTime: event.startDateTime, endDateTime: event.endDateTime },\n apiTickets,\n {\n cancelled: false,\n isRegistration: event.isRegistrationEvent,\n waitlistEnabled: false,\n }\n );\n\n return {\n text: result.text,\n disabled: result.disabled,\n reason: result.disabled ? toFriendlyReason(result.reason) : undefined,\n };\n}\n\n/**\n * computeCtaState() returns machine-enum reasons ('event_past', 'sold_out',\n * 'coming_soon', etc) intended for branching, not display. The BookingWidget\n * and MobileCta render `reason` directly as supplementary copy below the\n * button text — which leaks raw enum strings to users.\n *\n * Map each enum to a friendly sentence, OR return undefined when the button\n * `text` already says everything (\"Sales ended\" / \"Sold out\" — no need for\n * a second line repeating it).\n */\nfunction toFriendlyReason(reason: string | undefined): string | undefined {\n if (!reason) return undefined;\n switch (reason) {\n case 'cancelled':\n return 'This event has been cancelled.';\n case 'event_past':\n return 'This event has already happened.';\n case 'no_tickets':\n return 'There are no tickets configured for this event.';\n case 'coming_soon':\n return undefined; // text already shows \"On sale <date>\"\n case 'sold_out':\n return undefined; // text already shows \"Sold out\"\n case 'sold_out_waitlist':\n return 'All tickets are claimed. Join the waitlist to be notified.';\n case 'sales_ended':\n return undefined; // text already shows \"Sales ended\"\n default:\n return undefined; // unknown enum — never leak it\n }\n}\n\n// --- Price Display Rules (from DECISIONS.md #1) ---\nexport function getPriceDisplay(event: EventData): string | null {\n const visibleTickets = event.tickets.filter(\n t => t.status === 'on_sale' && !t.isHidden\n );\n if (visibleTickets.length === 0) return null;\n\n const hasDonation = visibleTickets.some(\n t => t.isDonation || t.ticketType === 2\n );\n const paidTickets = visibleTickets.filter(\n t => !t.isDonation && t.ticketType !== 2\n );\n const hasFree = paidTickets.some(t => t.price === 0);\n const pricedTickets = paidTickets.filter(t => t.price > 0);\n\n // Only donation tickets → \"Donation\"\n if (pricedTickets.length === 0 && !hasFree && hasDonation) return 'Donation';\n\n // Only free tickets (no paid, no donation) → null (BookingWidget shows \"Free\" via isFreeEvent)\n if (pricedTickets.length === 0 && hasFree) return null;\n\n const minPrice = Math.min(...pricedTickets.map(t => t.price));\n\n // Free + paid → \"Free\" (free dominates the display). Non-donation free tickets\n // outrank the paid options in the headline, matching the shared \"Free\" label\n // every other price surface uses. Returning null here left the widget blank.\n if (hasFree) return 'Free';\n\n // Donation + paid → \"From $X\" (donation is an alternative option)\n if (hasDonation) return `From $${minPrice}`;\n\n // Single paid ticket type → \"$X\"\n if (pricedTickets.length === 1) return `$${minPrice}`;\n\n // Multiple paid ticket types → \"From $X\"\n return `From $${minPrice}`;\n}\n\n// --- Fee Calculation ---\nexport function calculateFee(\n price: number,\n feePercentage: number,\n feeCents: Cents\n): number {\n return roundCurrency(price * (feePercentage / 100) + feeCents / 100);\n}\n\nexport function calculateTax(amount: number, taxPercentage: number): number {\n return roundCurrency(amount * (taxPercentage / 100));\n}\n\n// --- Date Formatting ---\n// PREFERRED: Use the timezone-aware production formatters re-exported above:\n// formatBrowseDate(iso, tz) → \"Fri, Feb 20\"\n// formatFullDateCompact(iso, tz) → \"Friday, February 20\"\n// formatEventTime(iso, tz) → \"8:00 PM\"\n// formatTimeRange(start, end, tz) → \"8:00 PM - 10:00 PM\"\n// formatDoorsTime(doors, tz) → \"7:00 PM\"\n\n// --- Animation Durations ---\nexport const DURATION = {\n instant: 100,\n micro: 150,\n fast: 200,\n normal: 300,\n slow: 400,\n elaborate: 600,\n} as const;\n\n// --- Promo Code State Factory ---\nexport function createDefaultPromoState(): PromoCodeState {\n return {\n code: '',\n isApplied: false,\n isValidating: false,\n error: '',\n hint: '',\n discountAmount: 0,\n discountType: '',\n discountTicketIds: [],\n revealHiddenTickets: false,\n revealTicketIds: [],\n };\n}\n\n// --- Ticket helpers ---\nexport function getAvailableTickets(\n tickets: TicketTypeData[]\n): TicketTypeData[] {\n return tickets.filter(t => !t.isHidden && t.status === 'on_sale');\n}\n","<!-- @style-escape: widget-intentional. -->\n<script lang=\"ts\">\n import type { USD } from '@getmicdrop/svelte-components';\n import { Text, formatCurrency } from '@getmicdrop/svelte-components';\n import type { OrderTotals } from '$lib/public-calendar-flow/types';\n import { formatPriceOrFree } from '$lib/core';\n import { DURATION } from '$lib/public-calendar-flow/defaults';\n\n interface Props {\n orderTotals: OrderTotals;\n labels?: Record<string, string>;\n /**\n * Which section to render.\n * - `full` (default): ticket lines + totals stacked together.\n * - `lines` : ticket-line items only. Use when the parent scrolls\n * this section in a flex column.\n * - `totals` : subtotal/fees/taxes/promo/total only. Use in a fixed\n * footer alongside the action button.\n *\n * Splitting via `lines` / `totals` lets the sticky sidebars scroll\n * just the variable-length ticket list while keeping the summary\n * block and CTA always visible.\n */\n mode?: 'full' | 'lines' | 'totals';\n }\n\n let { orderTotals, labels = {}, mode = 'full' }: Props = $props();\n</script>\n\n<div class=\"space-y-2\" style=\"transition-duration: {DURATION.normal}ms;\">\n {#if mode !== 'totals'}\n <!-- Line items -->\n {#each orderTotals.lines as line (line.ticketId)}\n <div class=\"flex justify-between\">\n <Text size=\"sm\">{line.quantity}x {line.ticketName}</Text>\n <Text size=\"sm\"\n >{line.isDonation\n ? formatCurrency(line.subtotal as USD)\n : formatPriceOrFree(line.subtotal, labels)}</Text\n >\n </div>\n {/each}\n {/if}\n\n {#if mode !== 'lines'}\n <!-- Subtotal. In `totals` mode the parent supplies the separator above\n\t\t this block (BookingWidget wraps the totals block in border-t); a\n\t\t second internal border would render as a double line. Only show\n\t\t the internal border-t in `full` mode where lines + totals stack\n\t\t in one container with no external separator. -->\n {#if mode === 'full' && orderTotals.lines.length > 1}\n <div class=\"flex justify-between pt-1 border-t border-default\">\n <Text size=\"sm\" color=\"muted\">{labels.subtotal || 'Subtotal'}</Text>\n <Text size=\"sm\" color=\"muted\"\n >{formatCurrency(orderTotals.subtotal as USD)}</Text\n >\n </div>\n {:else if orderTotals.lines.length > 1}\n <div class=\"flex justify-between\">\n <Text size=\"sm\" color=\"muted\">{labels.subtotal || 'Subtotal'}</Text>\n <Text size=\"sm\" color=\"muted\"\n >{formatCurrency(orderTotals.subtotal as USD)}</Text\n >\n </div>\n {/if}\n\n <!-- Fees -->\n {#if orderTotals.fees > 0}\n <div class=\"flex justify-between\">\n <Text size=\"sm\" color=\"muted\"\n >{labels.serviceFees || 'Service fees'}</Text\n >\n <Text size=\"sm\" color=\"muted\"\n >{formatCurrency(orderTotals.fees as USD)}</Text\n >\n </div>\n {/if}\n\n <!-- Taxes -->\n {#if orderTotals.taxes > 0}\n <div class=\"flex justify-between\">\n <Text size=\"sm\" color=\"muted\">{labels.taxes || 'Taxes'}</Text>\n <Text size=\"sm\" color=\"muted\"\n >{formatCurrency(orderTotals.taxes as USD)}</Text\n >\n </div>\n {/if}\n\n <!-- Promo discount -->\n {#if orderTotals.promoDiscount > 0}\n <div class=\"flex justify-between\">\n <Text size=\"sm\" color=\"success\"\n >{labels.promoDiscount || 'Promo discount'}</Text\n >\n <Text size=\"sm\" color=\"success\"\n >-{formatCurrency(orderTotals.promoDiscount as USD)}</Text\n >\n </div>\n {/if}\n\n <!-- Gift card — deduction from the amount due; `total` already reflects it -->\n {#if orderTotals.giftCardAmount > 0}\n <div class=\"flex justify-between\">\n <Text size=\"sm\" color=\"success\">{labels.giftCard || 'Gift card'}</Text>\n <Text size=\"sm\" color=\"success\"\n >-{formatCurrency(orderTotals.giftCardAmount as USD)}</Text\n >\n </div>\n {/if}\n\n <!-- Total -->\n <div class=\"flex justify-between pt-2 border-t border-default\">\n <Text size=\"base\" weight=\"semibold\">{labels.total || 'Total'}</Text>\n <Text size=\"base\" weight=\"semibold\"\n >{formatCurrency(orderTotals.total as USD)}</Text\n >\n </div>\n {/if}\n</div>\n","/**\n * Default English labels for public-calendar-flow components.\n * Consumers override via the `labels` prop on any *Main component.\n *\n * Label keys use flat camelCase. For composed strings (e.g. aria-labels),\n * components build them from atomic label parts.\n */\nexport const defaultLabels = {\n // ── Ticket quantity controls ──────────────────────────────────────\n // Stepper aria-labels compose these into \"Increase <name> quantity\" etc.\n // `quantityNoun` is deliberately its OWN key (not the main i18n's `quantity`,\n // whose value is the sr-only display PREFIX 'Quantity:') so the main-i18n\n // merge can't leak a capital-Q + trailing colon into the button labels.\n // Overridable, same as increase/decrease, which main i18n also doesn't define.\n decrease: 'Decrease',\n increase: 'Increase',\n quantityNoun: 'quantity',\n\n // ── Ticket states ─────────────────────────────────────────────────\n soldOut: 'Sold out',\n free: 'Free',\n unavailable: 'Unavailable',\n eventSoldOut: 'This event is sold out',\n\n // ── Price display ─────────────────────────────────────────────────\n includesFees: 'Includes',\n fees: 'fees',\n fee: 'fee',\n\n // ── Checkout CTAs ─────────────────────────────────────────────────\n checkout: 'Checkout',\n getTickets: 'Get tickets',\n selectTickets: 'Select tickets',\n selectTicketsBelow: 'Select tickets below',\n selectTicketsToContinue: 'Select tickets to continue',\n reserveASpot: 'Reserve a spot',\n\n // ── Password modal / gate ─────────────────────────────────────────\n enterPassword: 'Enter password',\n enterEventPassword: 'Enter event password',\n passwordRequired: 'Password required',\n passwordRequiredShort: 'Password required',\n eventRequiresPassword: 'This event requires a password to purchase tickets.',\n eventRequiresPasswordAccess:\n 'This event requires a password to access tickets.',\n enterEventPasswordToView: 'Enter the event password to view tickets.',\n enterEventPasswordToViewAvailable:\n 'Enter the event password to view available tickets.',\n eventPassword: 'Event password',\n password: 'Password',\n pleaseEnterPassword: 'Please enter the event password',\n pleaseEnterAPassword: 'Please enter a password',\n eventRequiresPasswordShort: 'This event requires a password',\n unlockTickets: 'Unlock tickets',\n cancel: 'Cancel',\n continue: 'Continue',\n submit: 'Submit',\n\n // ── Order summary ─────────────────────────────────────────────────\n subtotal: 'Subtotal',\n serviceFees: 'Service fees',\n taxes: 'Taxes',\n tax: 'Tax',\n promoDiscount: 'Promo discount',\n giftCard: 'Gift card',\n total: 'Total',\n orderSummary: 'Order summary',\n yourOrder: 'Your order',\n\n // ── Ticket counts (used in CTA buttons) ───────────────────────────\n ticket: 'ticket',\n tickets: 'tickets',\n\n // ── Checkout form (public-calendar-flow) ───────────────────────────────\n yourDetails: 'Your details',\n attendeeDetails: 'Attendee details',\n attendee: 'Attendee',\n sameAsPurchaser: 'Same as purchaser',\n payment: 'Payment',\n noPaymentRequired: 'No payment required',\n freeEventMessage:\n 'This is a free event. Complete the form above to reserve your spot.',\n firstName: 'First name',\n lastName: 'Last name',\n emailAddress: 'Email address',\n email: 'Email',\n emailPlaceholder: 'you@example.com',\n attendeeEmailPlaceholder: 'attendee@example.com',\n cardNumber: 'Card number',\n cardPlaceholder: '4242 4242 4242 4242',\n expiryDate: 'Expiry date',\n expiryPlaceholder: 'MM / YY',\n cvc: 'CVC',\n cvcPlaceholder: '123',\n keepMeUpdated: 'Keep me updated about this event and similar events',\n agreeToTerms: 'I agree to the terms and conditions',\n goBack: 'Go back',\n loadingPaymentForm: 'Loading secure payment form...',\n\n // ── Checkout form validation ──────────────────────────────────────\n firstNameRequired: 'First name is required',\n lastNameRequired: 'Last name is required',\n emailRequired: 'Email is required',\n emailInvalid: 'Enter a valid email address',\n emailInvalidShort: 'Enter a valid email',\n cardNumberRequired: 'Card number is required',\n expiryRequired: 'Expiry date is required',\n cvcRequired: 'CVC is required',\n mustAgreeTerms: 'You must agree to the terms',\n\n // ── Place order CTAs ──────────────────────────────────────────────\n placeOrder: 'Place order',\n completeOrder: 'Complete order',\n placingOrder: 'Placing order...',\n\n // ── Promo code ────────────────────────────────────────────────────\n havePromoCode: 'Have a promo code?',\n promoCode: 'Promo code',\n enterCode: 'Enter code',\n apply: 'Apply',\n remove: 'Remove',\n removePromoCode: 'Remove promo code',\n applyPromoCode: 'Apply promo code',\n checkingPromoCode: 'Checking promo code',\n checking: 'Checking...',\n promoApplied: 'Promo applied',\n\n // ── Navigation tabs (app-segments) ────────────────────────────────\n about: 'About',\n ticketsTab: 'Tickets',\n eventSections: 'Event sections',\n\n // ── Event details ─────────────────────────────────────────────────\n eventDetails: 'Event details',\n performers: 'Performers',\n faq: 'FAQ',\n frequentlyAskedQuestions: 'Frequently asked questions',\n doors: 'Doors',\n doorsOpenAt: 'Doors open at',\n\n // ── Series occurrences ────────────────────────────────────────────\n upcomingDates: 'Upcoming dates',\n\n // ── Close / dismiss ───────────────────────────────────────────────\n closeTicketSelection: 'Close ticket selection',\n closeTicketSelector: 'Close ticket selector',\n\n // ── Accessibility ─────────────────────────────────────────────────\n ticketSelection: 'ticket selection',\n ticketsSelected: 'tickets selected',\n view: 'View',\n\n // ── Success page (public-calendar-flow) ────────────────────────────────\n youreIn: \"You're in\",\n youreRegistered: \"You're registered\",\n confirmed: 'confirmed',\n viewTickets: 'View tickets',\n order: 'Order',\n confirmationSentTo: 'Confirmation sent to',\n addToCalendar: 'Add to calendar',\n googleCalendar: 'Google Calendar',\n appleCalendar: 'Apple Calendar (.ics)',\n share: 'Share',\n map: 'Map',\n backToEvent: 'Back to event',\n needHelp: 'Need help?',\n linkCopied: 'Link copied to clipboard',\n copyLink: 'Copy this link:',\n addToAppleWallet: 'Add to Apple Wallet',\n saveToGoogleWallet: 'Save to Google Wallet',\n\n // ── Session timer / expiration modals ─────────────────────────────\n sessionExpiringSoon: 'Session expiring soon',\n sessionExpiringSoonMessage:\n 'Your checkout session will expire in {time}. Your selected tickets will be released back to inventory.',\n extensionsRemaining: '{count} extension{plural} remaining',\n continueCheckout: 'Continue checkout',\n okIllHurry: \"OK, I'll hurry\",\n maxExtensionsReached: 'Maximum extensions reached',\n wantToKeepTickets: 'Want to keep your tickets?',\n sessionExpiredMessage:\n 'Your checkout session has expired and your selected tickets have been released.',\n sessionExpired: 'Session expired',\n reservationTimedOut:\n 'Your reservation has timed out. Please select your tickets again to continue.',\n keepMyTickets: 'Keep my tickets',\n selectTicketsAgain: 'Select tickets again',\n extendingSession: 'Extending...',\n\n // ── MobileCta ─────────────────────────────────────────────────────\n selectTicketsLabel: 'Select tickets',\n\n // ── Waitlist (sold-out gating + tokenized unlock) ─────────────────\n joinWaitlist: 'Join waitlist',\n getNotifiedWhenAvailable: 'Get notified when tickets are available',\n // Tokenized-link unlock outcomes (decisions #3/#22/#36). Mapped from the\n // server's failure enum; shown as a small dismissible notice near the CTA.\n waitlistLinkInvalid:\n \"This link isn't valid. You're still on the waitlist — we'll email you if tickets free up.\",\n waitlistLinkExpired: \"This link has expired. You're still on the waitlist.\",\n waitlistLinkUsed:\n \"This link has already been used. You're still on the waitlist.\",\n waitlistLinkEmailMismatch:\n \"This link was sent to a different email address. You're still on the waitlist.\",\n waitlistLinkInventoryExhausted:\n \"Those tickets were just claimed. You're still on the waitlist — we'll email you if more free up.\",\n dismiss: 'Dismiss',\n};\n\n/**\n * Merge user-provided label overrides with the defaults.\n * Shallow merge — any key provided by the consumer wins.\n *\n * @param {Record<string, string>} [userLabels] - Partial label overrides\n * @returns {Record<string, string>} Merged labels object\n */\nexport function mergeLabels(userLabels = {}) {\n return { ...defaultLabels, ...userLabels };\n}\n"],"names":["size","$","$$props","color","className","ctx","useIconWeight","resolved","svg","root_2","path","root","$$render","consequent","alternate","styles","computeCtaState","event","tickets","options","cancelled","isRegistration","waitlistEnabled","now","eventEnd","hiddenAvailable","isHiddenTicketPurchasable","publicTickets","t","hasPurchasable","allSoldOut","allComingSoon","earliestSalesStart","ticket","salesBegin","salesEnd","remaining","isSoldOut","isScheduled","hasSalesEnded","startDate","diffMs","diffHours","diffDays","timeLabel","d","formatLocal","dateText","getScarcityLevel","total","level","computeScarcityLevel","getScarcityText","context","SCARCITY_THRESHOLDS","getCtaConfig","apiTickets","result","toFriendlyReason","reason","getPriceDisplay","visibleTickets","hasDonation","paidTickets","hasFree","pricedTickets","minPrice","calculateTax","amount","taxPercentage","roundCurrency","DURATION","createDefaultPromoState","labels","mode","div","root_3","node_1","line","div_1","Text","node_2","text","node_3","formatCurrency","formatPriceOrFree","div_2","root_1","node_6","node_7","$0","text_3","div_3","node_8","node_9","text_5","consequent_1","consequent_2","div_4","node_11","node_12","text_7","consequent_3","div_5","node_14","node_15","text_9","consequent_4","div_6","node_17","node_18","text_11","consequent_5","div_7","node_20","node_21","text_13","consequent_6","div_8","node_19","node_22","node_23","text_15","consequent_7","defaultLabels","mergeLabels","userLabels"],"mappings":";;;;;kBAAA;;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,qBACE;AAAA,EACF,qBAAqB;AAAA,EACrB,kBACE;AAAA,EACF,2BACE;AAAA,EACF,gCACE;AAAA,EACF,SAAS;AACX;AASO,SAASC,GAAYC,IAAa,IAAI;AAC3C,SAAO,EAAE,GAAGF,GAAe,GAAGE,EAAU;AAC1C;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
- import { aG as u, aH as d } from "./VenueCalendar-CNQZD54v.js";
3
+ import { aH as u, aI as d } from "./VenueCalendar-Dhoi9hF5.js";
4
4
  var f = e.from_html("<div><!></div>");
5
5
  function g(t, s) {
6
6
  e.push(s, !0), u();
@@ -53,4 +53,4 @@ export {
53
53
  g as M,
54
54
  m as c
55
55
  };
56
- //# sourceMappingURL=modalManager.svelte-CQfHFG2s.js.map
56
+ //# sourceMappingURL=modalManager.svelte-BgW5Xd6y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modalManager.svelte-BgW5Xd6y.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Modal/ModalHeader.svelte","../node_modules/@getmicdrop/svelte-components/dist/utils/modalManager.svelte.js"],"sourcesContent":["<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { getModalContext } from './context.js';\n import { cn } from '../../utils/classNames.js';\n\n interface Props {\n class?: string;\n children?: Snippet;\n }\n\n let { class: className, children }: Props = $props();\n\n // Validates this component is inside ModalRoot\n getModalContext();\n</script>\n\n<div class={cn('shrink-0 px-6 pt-6 pb-3', className)}>\n {#if children}{@render children()}{/if}\n</div>\n","/**\n * behavior-modal-orchestration canonical (R-MODAL-1/3).\n *\n * Two rune primitives for modal open-state — pick by modal count:\n *\n * - `createModalState<T>()` — ONE modal. Replaces the dominant\n * `let showFooModal = $state(false)` + `let fooData = $state(null)` pair.\n * Use: `modal.isOpen`, `modal.data`, `modal.open(data?)`, `modal.close()`.\n *\n * - `createModalManager<Id>()` — a page with 3+ modals. Replaces N booleans\n * with one registry: `m.open(id, payload?)`, `m.close(id)`, `m.isOpen(id)`,\n * `m.payload(id)`, `m.active`, `m.closeAll()`. Coordinates exclusive-open\n * (opening one closes the others) and focus-return (focus goes back to the\n * element that was active before the first modal opened) in one place,\n * instead of the implicit-by-convention mutual exclusion seen across the\n * 4-modal accounts page and the 3-modal checkout hand-off chains.\n *\n * `createModalState` is lifted verbatim from micdrop-frontend's storeUtils\n * (zero consumers there); `createModalManager` is new — no modal coordinator\n * existed in any of the four repos.\n *\n * ## Binding to `ModalRoot` (`bind()`)\n * Both factories expose a `bind(...)` helper returning the props to spread onto a\n * `ModalRoot`, wiring its open-state to the manager:\n *\n * <ModalRoot {...modals.bind('edit')}>…</ModalRoot> // multi\n * <ModalRoot {...editModal.bind()}>…</ModalRoot> // single\n *\n * `bind()` returns a `{ get open, set open, oncancel }` object. The `open`\n * **getter** keeps `ModalRoot` reading the manager's live open-state (so opening\n * the modal anywhere re-renders it); `oncancel` closes the modal through the\n * manager. `ModalRoot`'s only self-close path (`resetModal`) always fires\n * `oncancel` before flipping its own local `open`, so escape / backdrop dismissal\n * routes back through the manager and the two never desync.\n *\n * This deliberately avoids the foot-gun it replaces: you can't write\n * `bind:open={modals.isOpen('edit')}` (a method call isn't an assignable lvalue),\n * and feeding `bind:open` a `$derived` is the read-only binding runtime bug. The\n * getter + `oncancel` spread sidesteps both — no per-page `$state` boolean, no\n * accidental derived binding. The `set open` setter completes the\n * getter/setter pair so the object also reads/writes cleanly when assigned to\n * programmatically. Scroll-lock + focus-trap stay in `ModalRoot`; the manager\n * owns only open-state, payload, exclusivity, and focus-return.\n */\n/**\n * Reactive open/close state for a single modal, with optional context data.\n *\n * @example\n * const editModal = createModalState<User>();\n * editModal.open(user); // editModal.isOpen === true, editModal.data === user\n * editModal.close(); // isOpen === false, data === null\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...editModal.bind()}>…</ModalRoot>\n */\nexport function createModalState() {\n let isOpen = $state(false);\n let data = $state(null);\n return {\n get isOpen() {\n return isOpen;\n },\n get data() {\n return data;\n },\n open(newData) {\n data = newData ?? null;\n isOpen = true;\n },\n close() {\n isOpen = false;\n data = null;\n },\n toggle(newData) {\n if (isOpen) {\n isOpen = false;\n data = null;\n }\n else {\n data = newData ?? null;\n isOpen = true;\n }\n },\n bind() {\n return {\n get open() {\n return isOpen;\n },\n set open(value) {\n // Binding-driven open carries no data (data stays null); use the\n // explicit open(data) call when a payload is needed.\n if (value)\n isOpen = true;\n else {\n isOpen = false;\n data = null;\n }\n },\n oncancel() {\n isOpen = false;\n data = null;\n },\n };\n },\n };\n}\n/**\n * Coordinate a set of named modals on one page. See module docs for when to\n * reach for this over `createModalState`.\n *\n * @example\n * const modals = createModalManager<'create' | 'edit' | 'delete'>();\n * modals.open('edit', user);\n * modals.isOpen('edit'); // true\n * modals.payload<User>('edit');\n * modals.open('delete'); // 'edit' auto-closes (exclusive)\n * modals.closeAll(); // focus returns to the original trigger\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...modals.bind('edit')}>…</ModalRoot>\n */\nexport function createModalManager(options = {}) {\n const exclusive = options.exclusive ?? true;\n const restoreFocus = options.restoreFocus ?? true;\n const modals = $state({});\n let returnFocusEl = null;\n function anyOpen() {\n return Object.values(modals).some((m) => m.open);\n }\n function isOpen(id) {\n return modals[id]?.open ?? false;\n }\n /** Remember the active element when transitioning from \"none open\" → \"open\". */\n function captureReturnFocus() {\n if (!restoreFocus || typeof document === 'undefined')\n return;\n if (!anyOpen()) {\n const el = document.activeElement;\n returnFocusEl = el instanceof HTMLElement ? el : null;\n }\n }\n /** Return focus to the captured trigger once everything is closed. */\n function restoreReturnFocus() {\n if (!restoreFocus)\n return;\n if (!anyOpen() && returnFocusEl) {\n returnFocusEl.focus();\n returnFocusEl = null;\n }\n }\n function open(id, payload) {\n captureReturnFocus();\n if (exclusive) {\n for (const key of Object.keys(modals)) {\n if (key !== id) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n }\n }\n modals[id] = { open: true, payload: payload ?? null };\n }\n function close(id) {\n const entry = modals[id];\n if (entry) {\n entry.open = false;\n entry.payload = null;\n }\n restoreReturnFocus();\n }\n function toggle(id, payload) {\n if (isOpen(id))\n close(id);\n else\n open(id, payload);\n }\n function closeAll() {\n for (const key of Object.keys(modals)) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n restoreReturnFocus();\n }\n return {\n isOpen,\n payload(id) {\n return modals[id]?.payload ?? null;\n },\n get active() {\n return Object.keys(modals).filter((key) => modals[key].open);\n },\n open,\n close,\n toggle,\n closeAll,\n bind(id) {\n return {\n get open() {\n return isOpen(id);\n },\n set open(value) {\n // Binding-driven open carries no payload; use open(id, payload) for that.\n if (value)\n open(id);\n else\n close(id);\n },\n oncancel() {\n close(id);\n },\n };\n },\n };\n}\n"],"names":["getModalContext","div","root","$0","$","cn","$$props","createModalState","isOpen","data","newData","value"],"mappings":";;;;iBAAA;iBAaEA,EAAe;MAGhBC,IAAGC,EAAA,eAAHD,CAAG;;;;;;;;;;UAAHA,CAAG,wCAAHA,GAAG,GAAAE,CAAA,GAAA,CAAA,MAAAC,EAAA,KAAQC,EAAG,2BAAyBC,EAAA,KAAA,CAAA,CAAA,CAAA,eAAvCL,CAAG;AAFI;ACyCD,SAASM,IAAmB;AAC/B,MAAIC,IAASJ,EAAA,MAAO,EAAK,GACrBK,IAAOL,EAAA,MAAO,IAAI;AACtB,SAAM;AAAA,IACF,IAAI,SAAS;AACT,mBAAOI,CAAM;AAAA,IACjB;AAAA,IACA,IAAI,OAAO;AACP,mBAAOC,CAAI;AAAA,IACf;AAAA,IACA,KAAKC,GAAS;YACVD,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IACjB;AAAA,IACA,QAAQ;AACJ,MAAAJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,IACf;AAAA,IACA,OAAOC,GAAS;AACZ,MAAEN,EAAA,IAAEI,CAAM,KACNJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI,YAGXA,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IAErB;AAAA,IACA,OAAO;AACH,aAAM;AAAA,QACF,IAAI,OAAO;AACP,uBAAOA,CAAM;AAAA,QACjB;AAAA,QACA,IAAI,KAAKG,GAAO;AAGZ,UAAIA,IAAKP,EAAA,IACLI,GAAS,EAAI,KAEbJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QAEnB;AAAA,QACA,WAAW;AACP,UAAAL,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QACf;AAAA;IAER;AAAA;AAER;","x_google_ignoreList":[0,1]}
@@ -1 +1 @@
1
- {"version":3,"file":"promo-WWbp2OWI.js","sources":["../src/lib/utils/promo.ts"],"sourcesContent":["// Canonical promo-discount resolver.\r\n//\r\n// The promo apply endpoint returns a discount as { amount, discountType } where\r\n// a percentage promo's `amount` is the raw percent (e.g. 10 for \"10%\"). The\r\n// order-summary display path stores that raw number in the per-event\r\n// `checkout-promo-discount-${eventID}` cookie and subtracts it from the\r\n// subtotal as if it were dollars — so a \"10%\" promo renders as a flat \"$10 off\"\r\n// regardless of cart size. PromocodeInput cannot fix this at write-time: it has no subtotal\r\n// (it can even auto-apply before any ticket is chosen). The correct dollar\r\n// value is subtotal-dependent, so it must be resolved wherever the subtotal is\r\n// known, using the stored discount type.\r\n//\r\n// Single source of truth for that resolution. Two discountType vocabularies\r\n// exist in the codebase — the API/cookie form ('percentage' | 'fixed') and the\r\n// per-ticket/pcf form ('%' | '$') — so both are accepted.\r\n\r\n// The meaningful discount-type values. The resolver accepts any string (the\r\n// value comes from a cookie / promo-change event, i.e. an untyped `string`) and\r\n// treats anything that isn't a percentage marker as a fixed dollar amount.\r\nexport type PromoDiscountType =\r\n | 'percentage'\r\n | 'fixed'\r\n | '%'\r\n | '$'\r\n | ''\r\n | null\r\n | undefined;\r\n\r\ntype PromoDiscountTypeInput = PromoDiscountType | string;\r\n\r\nfunction isPercentageDiscount(discountType: PromoDiscountTypeInput): boolean {\r\n return discountType === 'percentage' || discountType === '%';\r\n}\r\n\r\n/**\r\n * Resolve a promo discount to a dollar amount against the current subtotal.\r\n *\r\n * @param subtotal - order subtotal in dollars.\r\n * @param rawAmount - the discount value from the promo response: a percent for\r\n * a percentage promo, a dollar amount for a fixed promo.\r\n * @param discountType - 'percentage'/'%' or 'fixed'/'$' (or empty → fixed).\r\n * @returns the discount in dollars, clamped to [0, subtotal].\r\n */\r\nexport function resolvePromoDiscountDollars(\r\n subtotal: number,\r\n rawAmount: number,\r\n discountType: PromoDiscountTypeInput\r\n): number {\r\n if (!(rawAmount > 0) || !(subtotal > 0)) return 0;\r\n\r\n const dollars = isPercentageDiscount(discountType)\r\n ? (subtotal * rawAmount) / 100\r\n : rawAmount;\r\n\r\n const clamped = Math.max(0, Math.min(subtotal, dollars));\r\n // Round to cents so the deduction matches the currency-formatted display.\r\n return Math.round(clamped * 100) / 100;\r\n}\r\n"],"names":["isPercentageDiscount","discountType","resolvePromoDiscountDollars","subtotal","rawAmount","dollars","clamped"],"mappings":"AA8BA,SAASA,EAAqBC,GAA+C;AAC3E,SAAOA,MAAiB,gBAAgBA,MAAiB;AAC3D;AAWO,SAASC,EACdC,GACAC,GACAH,GACQ;AACR,MAAI,EAAEG,IAAY,MAAM,EAAED,IAAW,GAAI,QAAO;AAEhD,QAAME,IAAUL,EAAqBC,CAAY,IAC5CE,IAAWC,IAAa,MACzBA,GAEEE,IAAU,KAAK,IAAI,GAAG,KAAK,IAAIH,GAAUE,CAAO,CAAC;AAEvD,SAAO,KAAK,MAAMC,IAAU,GAAG,IAAI;AACrC;"}
1
+ {"version":3,"file":"promo-WWbp2OWI.js","sources":["../src/lib/utils/promo.ts"],"sourcesContent":["// Canonical promo-discount resolver.\n//\n// The promo apply endpoint returns a discount as { amount, discountType } where\n// a percentage promo's `amount` is the raw percent (e.g. 10 for \"10%\"). The\n// order-summary display path stores that raw number in the per-event\n// `checkout-promo-discount-${eventID}` cookie and subtracts it from the\n// subtotal as if it were dollars — so a \"10%\" promo renders as a flat \"$10 off\"\n// regardless of cart size. PromocodeInput cannot fix this at write-time: it has no subtotal\n// (it can even auto-apply before any ticket is chosen). The correct dollar\n// value is subtotal-dependent, so it must be resolved wherever the subtotal is\n// known, using the stored discount type.\n//\n// Single source of truth for that resolution. Two discountType vocabularies\n// exist in the codebase — the API/cookie form ('percentage' | 'fixed') and the\n// per-ticket/pcf form ('%' | '$') — so both are accepted.\n\n// The meaningful discount-type values. The resolver accepts any string (the\n// value comes from a cookie / promo-change event, i.e. an untyped `string`) and\n// treats anything that isn't a percentage marker as a fixed dollar amount.\nexport type PromoDiscountType =\n | 'percentage'\n | 'fixed'\n | '%'\n | '$'\n | ''\n | null\n | undefined;\n\ntype PromoDiscountTypeInput = PromoDiscountType | string;\n\nfunction isPercentageDiscount(discountType: PromoDiscountTypeInput): boolean {\n return discountType === 'percentage' || discountType === '%';\n}\n\n/**\n * Resolve a promo discount to a dollar amount against the current subtotal.\n *\n * @param subtotal - order subtotal in dollars.\n * @param rawAmount - the discount value from the promo response: a percent for\n * a percentage promo, a dollar amount for a fixed promo.\n * @param discountType - 'percentage'/'%' or 'fixed'/'$' (or empty → fixed).\n * @returns the discount in dollars, clamped to [0, subtotal].\n */\nexport function resolvePromoDiscountDollars(\n subtotal: number,\n rawAmount: number,\n discountType: PromoDiscountTypeInput\n): number {\n if (!(rawAmount > 0) || !(subtotal > 0)) return 0;\n\n const dollars = isPercentageDiscount(discountType)\n ? (subtotal * rawAmount) / 100\n : rawAmount;\n\n const clamped = Math.max(0, Math.min(subtotal, dollars));\n // Round to cents so the deduction matches the currency-formatted display.\n return Math.round(clamped * 100) / 100;\n}\n"],"names":["isPercentageDiscount","discountType","resolvePromoDiscountDollars","subtotal","rawAmount","dollars","clamped"],"mappings":"AA8BA,SAASA,EAAqBC,GAA+C;AAC3E,SAAOA,MAAiB,gBAAgBA,MAAiB;AAC3D;AAWO,SAASC,EACdC,GACAC,GACAH,GACQ;AACR,MAAI,EAAEG,IAAY,MAAM,EAAED,IAAW,GAAI,QAAO;AAEhD,QAAME,IAAUL,EAAqBC,CAAY,IAC5CE,IAAWC,IAAa,MACzBA,GAEEE,IAAU,KAAK,IAAI,GAAG,KAAK,IAAIH,GAAUE,CAAO,CAAC;AAEvD,SAAO,KAAK,MAAMC,IAAU,GAAG,IAAI;AACrC;"}