tf-checkout-react 2.0.0-beta.2 → 2.0.0-beta.3

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/index.d.mts CHANGED
@@ -451,6 +451,11 @@ interface TicketType {
451
451
  waitingListMaxQuantity?: number;
452
452
  /** Raw rich-text description (may contain HTML). */
453
453
  descriptionRich: string | null;
454
+ /** Organiser-written scarcity badge for this type ("Selling fast", "Limited
455
+ * stock", or any custom text), else null. Free text in whatever language the
456
+ * organiser typed — render verbatim, never translate. The old checkout shows
457
+ * it only while the type can actually be bought. */
458
+ badgeText?: string | null;
454
459
  /** Present for time-slot tickets: the session this id belongs to (display
455
460
  * metadata only — the id already encodes the session). */
456
461
  timeSlot?: {
package/dist/index.d.ts CHANGED
@@ -451,6 +451,11 @@ interface TicketType {
451
451
  waitingListMaxQuantity?: number;
452
452
  /** Raw rich-text description (may contain HTML). */
453
453
  descriptionRich: string | null;
454
+ /** Organiser-written scarcity badge for this type ("Selling fast", "Limited
455
+ * stock", or any custom text), else null. Free text in whatever language the
456
+ * organiser typed — render verbatim, never translate. The old checkout shows
457
+ * it only while the type can actually be bought. */
458
+ badgeText?: string | null;
454
459
  /** Present for time-slot tickets: the session this id belongs to (display
455
460
  * metadata only — the id already encodes the session). */
456
461
  timeSlot?: {
package/dist/index.esm.js CHANGED
@@ -1467,7 +1467,7 @@ var buildXenditCheckoutHtml = (options) => {
1467
1467
 
1468
1468
  // ../tf-checkout-shared/src/engine/errors.ts
1469
1469
  var errorMessage = (error) => toTtfError(error).message;
1470
- var EXPIRED_WORDS = /expir|caduc|scadut|abgelaufen|verlopen|udløbet|löpt ut|utløpt|vypršel|wygasł|истек|expirou|kedaluwarsa|hết hạn|期限切れ|已过期|已過期|만료/i;
1470
+ var EXPIRED_WORDS = /expir|caduc|scadut|abgelaufen|verlopen|udløbet|löpt ut|utløpt|vypršel|wygasł|истек|expirou|kedaluwarsa|vanhentu|hết hạn|期限切れ|已过期|已過期|만료/i;
1471
1471
  var isCartExpiredError = (error) => {
1472
1472
  const e = toTtfError(error);
1473
1473
  if (e.status !== 422) return false;
@@ -1869,8 +1869,12 @@ var removeReservedSeats = async (eventId, tierId, seatIds) => (
1869
1869
  var refreshReservation = async (eventId, orderId) => patch(ENDPOINTS.seatmap.refreshReservation(eventId), { order_id: orderId });
1870
1870
 
1871
1871
  // ../tf-checkout-shared/src/api/events.ts
1872
+ var badgeOf = (raw) => {
1873
+ const text = typeof raw === "string" ? raw.trim() : "";
1874
+ return text || null;
1875
+ };
1872
1876
  var mapTicket = (t) => {
1873
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
1877
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
1874
1878
  return {
1875
1879
  id: String(t.id),
1876
1880
  name: (_a = t.displayName) != null ? _a : "",
@@ -1898,7 +1902,8 @@ var mapTicket = (t) => {
1898
1902
  allowDirectPurchase: Boolean(t.allowDirectPurchase),
1899
1903
  waitingListEnabled: Boolean(t.waitingListEnabled),
1900
1904
  waitingListMaxQuantity: t.waitingListMaxQuantity != null ? Number(t.waitingListMaxQuantity) : void 0,
1901
- descriptionRich: (_m = t.descriptionRich) != null ? _m : null
1905
+ descriptionRich: (_m = t.descriptionRich) != null ? _m : null,
1906
+ badgeText: badgeOf((_n = t.badgeText) != null ? _n : t.badge_text)
1902
1907
  };
1903
1908
  };
1904
1909
  var getEventTickets = async (eventId) => {
@@ -1952,7 +1957,7 @@ var getEventConditions = async (eventId) => {
1952
1957
  }).filter((c) => c.content || c.name);
1953
1958
  };
1954
1959
  var getEventTimeSlotTickets = async (eventId, date, options) => {
1955
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
1960
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
1956
1961
  const body = await get(ENDPOINTS.events.timeSlotByDate(eventId), {
1957
1962
  params: {
1958
1963
  date,
@@ -1989,6 +1994,7 @@ var getEventTimeSlotTickets = async (eventId, date, options) => {
1989
1994
  isTable: Boolean(s.is_table),
1990
1995
  allowDirectPurchase: true,
1991
1996
  descriptionRich: (_t = s.description) != null ? _t : null,
1997
+ badgeText: badgeOf((_u = s.badge_text) != null ? _u : s.badgeText),
1992
1998
  timeSlot: { date: slotDate, time: timeKey }
1993
1999
  });
1994
2000
  }
@@ -4187,7 +4193,53 @@ var en = {
4187
4193
  "auth.passwordsMustMatch": "Passwords must match.",
4188
4194
  "auth.passwordChanged": "Your password has been changed. You can now log in.",
4189
4195
  "auth.selectState": "Select state / region",
4190
- "auth.notRequired": "Not required"
4196
+ "auth.notRequired": "Not required",
4197
+ // --- Previously hardcoded in components ---------------------------------
4198
+ "tickets.waitingListJoined": "You\u2019re on the waiting list \u2014 we\u2019ll email you if a spot opens.",
4199
+ "tickets.firstName": "First name",
4200
+ "tickets.lastName": "Last name",
4201
+ "tickets.email": "Email",
4202
+ "tickets.joinWaitingList": "Join the waiting list",
4203
+ "tickets.free": "FREE",
4204
+ "tickets.withFees": "({{price}} with fees)",
4205
+ "tickets.deposit": "{{percent}}% DEPOSIT",
4206
+ "tickets.gotPromoCode": "Got a promo code? Click here",
4207
+ "payment.conditionRequired": "You must accept this condition to continue.",
4208
+ "payment.payInFull": "Pay in full instead",
4209
+ "payment.installmentTotal": "{{amount}} total",
4210
+ "confirmation.viewVoucher": "View payment voucher",
4211
+ "confirmation.viewTickets": "View my tickets",
4212
+ "confirmation.orderConfirmed": "Your order has been confirmed!",
4213
+ "confirmation.emailed": "Your tickets have been emailed to you",
4214
+ "confirmation.inMyTickets": "Your tickets are available in My Tickets.",
4215
+ "confirmation.bringThem": "Please bring them with you to the event",
4216
+ "confirmation.viewOrder": "View Order",
4217
+ "confirmation.missingReference": "The order reference is missing.",
4218
+ "referral.titleStart": "Your ticket can become",
4219
+ "referral.titleCheaper": "cheaper",
4220
+ "referral.titleOr": "or even",
4221
+ "referral.titleFree": "FREE!",
4222
+ "referral.inviteMiddle": "and we'll refund up to",
4223
+ "referral.inviteEnd": "of your ticket money, if they buy tickets as well!",
4224
+ "referral.copy": "Copy",
4225
+ "referral.currentPrice": "Your ticket is currently",
4226
+ "referral.ifFriendsBuy": "If your friends buy {{count}} tickets",
4227
+ "referral.becomes": "Your ticket becomes",
4228
+ "referral.goesDownTo": "Your ticket goes down to",
4229
+ "verification.title": "Account Verification",
4230
+ "verification.checking": "Checking your verification status\u2026",
4231
+ "verification.idle": "To complete the purchase, please verify your identity.",
4232
+ "verification.starting": "Opening the verification page\u2026",
4233
+ "verification.polling": "Waiting for verification to complete in the other tab\u2026",
4234
+ "verification.verified": "Identity verified \u2014 your tickets are on their way.",
4235
+ "verification.timeoutCheckAgain": "Still not confirmed. Finish in the other tab, then check again.",
4236
+ "verification.timeoutSafe": "Verification is taking longer than usual. Your payment is safe.",
4237
+ "verification.error": "We couldn\u2019t reach the verification service. Try again.",
4238
+ "verification.verify": "Verify",
4239
+ "verification.verifying": "Verifying\u2026",
4240
+ "verification.checkAgain": "Check again",
4241
+ "verification.tryAgain": "Try again",
4242
+ "auth.existingAccount": "This email already has an account. Log in to autofill your checkout details."
4191
4243
  };
4192
4244
 
4193
4245
  // ../tf-checkout-shared/src/i18n/resolve.ts
@@ -4403,7 +4455,53 @@ var esMX = {
4403
4455
  "auth.passwordsMustMatch": "Las contrase\xF1as deben coincidir.",
4404
4456
  "auth.passwordChanged": "Tu contrase\xF1a se cambi\xF3. Ya puedes iniciar sesi\xF3n.",
4405
4457
  "auth.selectState": "Selecciona estado / regi\xF3n",
4406
- "auth.notRequired": "No requerido"
4458
+ "auth.notRequired": "No requerido",
4459
+ // --- Previously hardcoded in components ---------------------------------
4460
+ "tickets.waitingListJoined": "Ya est\xE1s en la lista de espera \u2014 te escribiremos si se libera un lugar.",
4461
+ "tickets.firstName": "Nombre",
4462
+ "tickets.lastName": "Apellido",
4463
+ "tickets.email": "Correo electr\xF3nico",
4464
+ "tickets.joinWaitingList": "Unirme a la lista de espera",
4465
+ "tickets.free": "GRATIS",
4466
+ "tickets.withFees": "({{price}} con cargos)",
4467
+ "tickets.deposit": "{{percent}}% DE ANTICIPO",
4468
+ "tickets.gotPromoCode": "\xBFTienes un c\xF3digo promocional? Haz clic aqu\xED",
4469
+ "payment.conditionRequired": "Debes aceptar esta condici\xF3n para continuar.",
4470
+ "payment.payInFull": "Mejor pagar en una sola exhibici\xF3n",
4471
+ "payment.installmentTotal": "{{amount}} en total",
4472
+ "confirmation.viewVoucher": "Ver ficha de pago",
4473
+ "confirmation.viewTickets": "Ver mis boletos",
4474
+ "confirmation.orderConfirmed": "\xA1Tu pedido est\xE1 confirmado!",
4475
+ "confirmation.emailed": "Te enviamos tus boletos por correo",
4476
+ "confirmation.inMyTickets": "Tus boletos est\xE1n disponibles en Mis boletos.",
4477
+ "confirmation.bringThem": "Ll\xE9valos contigo al evento",
4478
+ "confirmation.viewOrder": "Ver pedido",
4479
+ "confirmation.missingReference": "Falta la referencia del pedido.",
4480
+ "referral.titleStart": "Tu boleto puede salirte",
4481
+ "referral.titleCheaper": "m\xE1s barato",
4482
+ "referral.titleOr": "o incluso",
4483
+ "referral.titleFree": "\xA1GRATIS!",
4484
+ "referral.inviteMiddle": "y te reembolsamos hasta el",
4485
+ "referral.inviteEnd": "de lo que pagaste por tu boleto si ellos tambi\xE9n compran.",
4486
+ "referral.copy": "Copiar",
4487
+ "referral.currentPrice": "Tu boleto cuesta ahora",
4488
+ "referral.ifFriendsBuy": "Si tus amigos compran {{count}} boletos",
4489
+ "referral.becomes": "Tu boleto queda",
4490
+ "referral.goesDownTo": "Tu boleto baja a",
4491
+ "verification.title": "Verificaci\xF3n de cuenta",
4492
+ "verification.checking": "Revisando el estado de tu verificaci\xF3n\u2026",
4493
+ "verification.idle": "Para completar la compra, verifica tu identidad.",
4494
+ "verification.starting": "Abriendo la p\xE1gina de verificaci\xF3n\u2026",
4495
+ "verification.polling": "Esperando a que termines la verificaci\xF3n en la otra pesta\xF1a\u2026",
4496
+ "verification.verified": "Identidad verificada \u2014 tus boletos van en camino.",
4497
+ "verification.timeoutCheckAgain": "A\xFAn no se confirma. Termina en la otra pesta\xF1a y vuelve a revisar.",
4498
+ "verification.timeoutSafe": "La verificaci\xF3n est\xE1 tardando m\xE1s de lo normal. Tu pago est\xE1 seguro.",
4499
+ "verification.error": "No pudimos conectar con el servicio de verificaci\xF3n. Int\xE9ntalo de nuevo.",
4500
+ "verification.verify": "Verificar",
4501
+ "verification.verifying": "Verificando\u2026",
4502
+ "verification.checkAgain": "Revisar de nuevo",
4503
+ "verification.tryAgain": "Intentar de nuevo",
4504
+ "auth.existingAccount": "Este correo ya tiene una cuenta. Inicia sesi\xF3n para autocompletar tus datos de compra."
4407
4505
  };
4408
4506
 
4409
4507
  // ../tf-checkout-shared/src/i18n/locales/index.ts
@@ -5269,14 +5367,17 @@ import React4, { forwardRef } from "react";
5269
5367
 
5270
5368
  // src/ui/Loader.tsx
5271
5369
  import React3 from "react";
5272
- var Loader = ({ className }) => /* @__PURE__ */ React3.createElement(
5273
- "span",
5274
- {
5275
- className: cx("tf-checkout-loader", className),
5276
- role: "status",
5277
- "aria-label": "Loading"
5278
- }
5279
- );
5370
+ var Loader = ({ className }) => {
5371
+ const t = useT();
5372
+ return /* @__PURE__ */ React3.createElement(
5373
+ "span",
5374
+ {
5375
+ className: cx("tf-checkout-loader", className),
5376
+ role: "status",
5377
+ "aria-label": t("common.loading")
5378
+ }
5379
+ );
5380
+ };
5280
5381
 
5281
5382
  // src/ui/Button.tsx
5282
5383
  var Button = forwardRef(
@@ -5330,9 +5431,9 @@ var useInstallmentPicker = () => {
5330
5431
  onClick: () => choose(o)
5331
5432
  },
5332
5433
  /* @__PURE__ */ React5.createElement("span", null, o.count, " \xD7 ", (_a = o.per_installment_formatted) != null ? _a : o.per_installment),
5333
- /* @__PURE__ */ React5.createElement("span", { className: "tf-checkout-installments__meta" }, o.total_formatted ? `${o.total_formatted} total` : "", o.diff_from_original_formatted ? ` \xB7 ${o.diff_from_original_formatted}` : "")
5434
+ /* @__PURE__ */ React5.createElement("span", { className: "tf-checkout-installments__meta" }, o.total_formatted ? t("payment.installmentTotal", { amount: o.total_formatted }) : "", o.diff_from_original_formatted ? ` \xB7 ${o.diff_from_original_formatted}` : "")
5334
5435
  );
5335
- })), /* @__PURE__ */ React5.createElement(Button, { variant: "ghost", block: true, onClick: () => choose(null) }, "Pay in full instead"))
5436
+ })), /* @__PURE__ */ React5.createElement(Button, { variant: "ghost", block: true, onClick: () => choose(null) }, t("payment.payInFull")))
5336
5437
  ) : null;
5337
5438
  return { onInstallmentOffers, picker };
5338
5439
  };
@@ -5735,27 +5836,30 @@ var PaymentMethods = ({
5735
5836
 
5736
5837
  // src/ui/Stepper.tsx
5737
5838
  import React11 from "react";
5738
- var Stepper = ({ value, onChange, min = 0, max = Infinity, step = 1, disabled, className }) => /* @__PURE__ */ React11.createElement("div", { className: cx("tf-checkout-stepper", className) }, /* @__PURE__ */ React11.createElement(
5739
- "button",
5740
- {
5741
- type: "button",
5742
- className: "tf-checkout-stepper__btn",
5743
- "aria-label": "Decrease",
5744
- disabled: disabled || value <= min,
5745
- onClick: () => onChange(Math.max(min, value - step))
5746
- },
5747
- "\u2212"
5748
- ), /* @__PURE__ */ React11.createElement("span", { className: "tf-checkout-stepper__value" }, value), /* @__PURE__ */ React11.createElement(
5749
- "button",
5750
- {
5751
- type: "button",
5752
- className: "tf-checkout-stepper__btn",
5753
- "aria-label": "Increase",
5754
- disabled: disabled || value >= max,
5755
- onClick: () => onChange(Math.min(max, value + step))
5756
- },
5757
- "+"
5758
- ));
5839
+ var Stepper = ({ value, onChange, min = 0, max = Infinity, step = 1, disabled, className }) => {
5840
+ const t = useT();
5841
+ return /* @__PURE__ */ React11.createElement("div", { className: cx("tf-checkout-stepper", className) }, /* @__PURE__ */ React11.createElement(
5842
+ "button",
5843
+ {
5844
+ type: "button",
5845
+ className: "tf-checkout-stepper__btn",
5846
+ "aria-label": t("common.decrease"),
5847
+ disabled: disabled || value <= min,
5848
+ onClick: () => onChange(Math.max(min, value - step))
5849
+ },
5850
+ "\u2212"
5851
+ ), /* @__PURE__ */ React11.createElement("span", { className: "tf-checkout-stepper__value" }, value), /* @__PURE__ */ React11.createElement(
5852
+ "button",
5853
+ {
5854
+ type: "button",
5855
+ className: "tf-checkout-stepper__btn",
5856
+ "aria-label": t("common.increase"),
5857
+ disabled: disabled || value >= max,
5858
+ onClick: () => onChange(Math.min(max, value + step))
5859
+ },
5860
+ "+"
5861
+ ));
5862
+ };
5759
5863
 
5760
5864
  // src/ui/QuantitySelect.tsx
5761
5865
  import React12 from "react";
@@ -6602,30 +6706,31 @@ import React22, {
6602
6706
  useState as useState12
6603
6707
  } from "react";
6604
6708
  var WaitingListForm = ({ ticket, onJoin }) => {
6709
+ const tr = useT();
6605
6710
  const [form, setForm] = useState12({ firstName: "", lastName: "", email: "" });
6606
6711
  const [state, setState] = useState12("idle");
6607
6712
  const [error, setError] = useState12("");
6608
6713
  const ok = form.firstName.trim() && form.lastName.trim() && form.email.trim();
6609
6714
  if (state === "done")
6610
- return /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-note tf-checkout-tickets__wl-done" }, "You\u2019re on the waiting list \u2014 we\u2019ll email you if a spot opens.");
6715
+ return /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-note tf-checkout-tickets__wl-done" }, tr("tickets.waitingListJoined"));
6611
6716
  return /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__wl" }, /* @__PURE__ */ React22.createElement(FieldRow, null, /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
6612
6717
  Input,
6613
6718
  {
6614
- placeholder: "First name",
6719
+ placeholder: tr("tickets.firstName"),
6615
6720
  value: form.firstName,
6616
6721
  onChange: (e) => setForm((f) => ({ ...f, firstName: e.target.value }))
6617
6722
  }
6618
6723
  )), /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
6619
6724
  Input,
6620
6725
  {
6621
- placeholder: "Last name",
6726
+ placeholder: tr("tickets.lastName"),
6622
6727
  value: form.lastName,
6623
6728
  onChange: (e) => setForm((f) => ({ ...f, lastName: e.target.value }))
6624
6729
  }
6625
6730
  ))), /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
6626
6731
  Input,
6627
6732
  {
6628
- placeholder: "Email",
6733
+ placeholder: tr("tickets.email"),
6629
6734
  value: form.email,
6630
6735
  onChange: (e) => setForm((f) => ({ ...f, email: e.target.value }))
6631
6736
  }
@@ -6644,7 +6749,7 @@ var WaitingListForm = ({ ticket, onJoin }) => {
6644
6749
  disabled: !ok || state === "busy",
6645
6750
  variant: "secondary"
6646
6751
  },
6647
- "Join the waiting list"
6752
+ tr("tickets.joinWaitingList")
6648
6753
  ), error && /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-error-text" }, error));
6649
6754
  };
6650
6755
  var Tickets = ({
@@ -6792,7 +6897,7 @@ var Tickets = ({
6792
6897
  onClick: () => setVisibleDescription((current2) => current2 === t.id ? null : t.id)
6793
6898
  },
6794
6899
  visibleDescription === t.id ? tr("tickets.hideInfo") : tr("tickets.viewInfo")
6795
- )), /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__price" }, discounted && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__old" }, money(sym, original)), /* @__PURE__ */ React22.createElement(
6900
+ )), t.badgeText && !unavailable && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__badge" }, t.badgeText), /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__price" }, discounted && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__old" }, money(sym, original)), /* @__PURE__ */ React22.createElement(
6796
6901
  "span",
6797
6902
  {
6798
6903
  className: cx(
@@ -6800,8 +6905,8 @@ var Tickets = ({
6800
6905
  isFree && "tf-checkout-tickets__amount--free"
6801
6906
  )
6802
6907
  },
6803
- isFree ? "FREE" : money(sym, t.price)
6804
- ), !isFree && !t.soldOut && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__fees" }, "(", money(sym, t.priceWithFees), " with fees)"), t.depositPercent != null && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__deposit" }, t.depositPercent.toFixed(2), "% DEPOSIT"))), seatMapRow(t) ? null : unavailable ? /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__soldout" }, t.soldOut ? tr("tickets.soldOut") : notStarted ? tr("tickets.salesNotStarted") : tr("tickets.salesEnded")) : /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__qty" }, t.isTable && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__guests" }, tr("tickets.guests")), /* @__PURE__ */ React22.createElement(
6908
+ isFree ? tr("tickets.free") : money(sym, t.price)
6909
+ ), !isFree && !t.soldOut && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__fees" }, tr("tickets.withFees", { price: money(sym, t.priceWithFees) })), t.depositPercent != null && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__deposit" }, tr("tickets.deposit", { percent: t.depositPercent.toFixed(2) })))), seatMapRow(t) ? null : unavailable ? /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__soldout" }, t.soldOut ? tr("tickets.soldOut") : notStarted ? tr("tickets.salesNotStarted") : tr("tickets.salesEnded")) : /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__qty" }, t.isTable && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__guests" }, tr("tickets.guests")), /* @__PURE__ */ React22.createElement(
6805
6910
  QuantitySelect,
6806
6911
  {
6807
6912
  value: (_a2 = qty[t.id]) != null ? _a2 : 0,
@@ -6830,7 +6935,7 @@ var Tickets = ({
6830
6935
  className: "tf-checkout-tickets__wl-toggle",
6831
6936
  onClick: () => setWlOpen((w) => ({ ...w, [t.id]: true }))
6832
6937
  },
6833
- "Join the waiting list"
6938
+ tr("tickets.joinWaitingList")
6834
6939
  ))));
6835
6940
  };
6836
6941
  const timeGroups = [];
@@ -6874,7 +6979,7 @@ var Tickets = ({
6874
6979
  className: "tf-checkout-tickets__promo-toggle",
6875
6980
  onClick: () => setPromoOpen(true)
6876
6981
  },
6877
- "Got a promo code? Click here"
6982
+ tr("tickets.gotPromoCode")
6878
6983
  ) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(FieldRow, null, /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
6879
6984
  Input,
6880
6985
  {
@@ -8588,7 +8693,7 @@ var Payment = ({
8588
8693
  label: /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement("span", { dangerouslySetInnerHTML: { __html: c.content || c.name } }), c.isRequired && " *")
8589
8694
  }
8590
8695
  ),
8591
- invalid && /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-consent__error" }, "You must accept this condition to continue.")
8696
+ invalid && /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-consent__error" }, t("payment.conditionRequired"))
8592
8697
  );
8593
8698
  })), /* @__PURE__ */ React30.createElement(OrderSummary, { eventId }), /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-payment__cta" }, /* @__PURE__ */ React30.createElement(
8594
8699
  Button,
@@ -8604,14 +8709,15 @@ var Payment = ({
8604
8709
  // src/sections/IDVerification.tsx
8605
8710
  import React31, { useState as useState17 } from "react";
8606
8711
  var MESSAGE = {
8607
- idle: "To complete the purchase, please verify your identity.",
8608
- starting: "Opening the verification page\u2026",
8609
- polling: "Waiting for verification to complete in the other tab\u2026",
8610
- verified: "Identity verified \u2014 your tickets are on their way.",
8611
- timeout: "Still not confirmed. Finish in the other tab, then check again.",
8612
- error: "We couldn\u2019t reach the verification service. Try again."
8712
+ idle: "verification.idle",
8713
+ starting: "verification.starting",
8714
+ polling: "verification.polling",
8715
+ verified: "verification.verified",
8716
+ timeout: "verification.timeoutCheckAgain",
8717
+ error: "verification.error"
8613
8718
  };
8614
8719
  var IDVerification = ({ className }) => {
8720
+ const t = useT();
8615
8721
  const checkout = useCheckoutContext();
8616
8722
  const order = checkout.order;
8617
8723
  const [phase, setPhase] = useState17("idle");
@@ -8632,7 +8738,7 @@ var IDVerification = ({ className }) => {
8632
8738
  setError(errorMessage(e));
8633
8739
  });
8634
8740
  };
8635
- return /* @__PURE__ */ React31.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React31.createElement(SectionHeader, { title: "Account Verification" }), /* @__PURE__ */ React31.createElement("p", { className: cx("tf-checkout-note", done && "tf-checkout-idverify__done") }, MESSAGE[phase]), !done && /* @__PURE__ */ React31.createElement(Button, { block: true, onClick: run, loading: running, disabled: running }, phase === "idle" ? "Verify" : running ? "Verifying\u2026" : "Check again"), error && /* @__PURE__ */ React31.createElement("p", { className: "tf-checkout-error-text" }, error));
8741
+ return /* @__PURE__ */ React31.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React31.createElement(SectionHeader, { title: t("verification.title") }), /* @__PURE__ */ React31.createElement("p", { className: cx("tf-checkout-note", done && "tf-checkout-idverify__done") }, t(MESSAGE[phase])), !done && /* @__PURE__ */ React31.createElement(Button, { block: true, onClick: run, loading: running, disabled: running }, phase === "idle" ? t("verification.verify") : running ? t("verification.verifying") : t("verification.checkAgain")), error && /* @__PURE__ */ React31.createElement("p", { className: "tf-checkout-error-text" }, error));
8636
8742
  };
8637
8743
 
8638
8744
  // src/sections/Confirmation.tsx
@@ -8686,14 +8792,14 @@ var Confirmation = ({
8686
8792
  target: "_blank",
8687
8793
  rel: "noopener noreferrer"
8688
8794
  },
8689
- "View payment voucher"
8795
+ t("confirmation.viewVoucher")
8690
8796
  ), viewOrderUrl && /* @__PURE__ */ React32.createElement(
8691
8797
  "a",
8692
8798
  {
8693
8799
  className: "tf-checkout-button tf-checkout-button--secondary tf-checkout-button--block",
8694
8800
  href: viewOrderUrl
8695
8801
  },
8696
- "View my tickets"
8802
+ t("confirmation.viewTickets")
8697
8803
  ), children, !pending && url && /* @__PURE__ */ React32.createElement("div", { className: "tf-checkout-confirmation__share" }, /* @__PURE__ */ React32.createElement("strong", null, t("referral.cheaperOrFree")), /* @__PURE__ */ React32.createElement("p", { className: "tf-checkout-note" }, "Invite friends with your link. When they buy, you get rewarded."), /* @__PURE__ */ React32.createElement("div", { className: "tf-checkout-confirmation__share-link" }, /* @__PURE__ */ React32.createElement("input", { className: "tf-checkout-input", readOnly: true, value: url }), /* @__PURE__ */ React32.createElement(Button, { variant: "secondary", onClick: copy }, copied ? t("referral.copied") : t("referral.copyLink"))), /* @__PURE__ */ React32.createElement("div", { className: "tf-checkout-confirmation__socials" }, shares.map((s) => /* @__PURE__ */ React32.createElement(
8698
8804
  "a",
8699
8805
  {
@@ -8716,9 +8822,10 @@ var attributesOf = (response) => {
8716
8822
  if (data && typeof data === "object") return data;
8717
8823
  return response;
8718
8824
  };
8825
+ var MISSING_REFERENCE = "\0missing-reference";
8719
8826
  var OrderConfirmation = ({
8720
8827
  orderHash,
8721
- title = "Your order has been confirmed!",
8828
+ title,
8722
8829
  message,
8723
8830
  helper,
8724
8831
  eventTitle,
@@ -8732,6 +8839,7 @@ var OrderConfirmation = ({
8732
8839
  className
8733
8840
  }) => {
8734
8841
  var _a, _b, _c, _d;
8842
+ const t = useT();
8735
8843
  const [data, setData] = useState19(null);
8736
8844
  const [failure, setFailure] = useState19("");
8737
8845
  const [copied, setCopied] = useState19(false);
@@ -8743,7 +8851,7 @@ var OrderConfirmation = ({
8743
8851
  }, [onError, onLoaded]);
8744
8852
  useEffect13(() => {
8745
8853
  if (!orderHash) {
8746
- setFailure("The order reference is missing.");
8854
+ setFailure(MISSING_REFERENCE);
8747
8855
  return;
8748
8856
  }
8749
8857
  let active = true;
@@ -8768,7 +8876,7 @@ var OrderConfirmation = ({
8768
8876
  };
8769
8877
  }, [orderHash]);
8770
8878
  if (failure) {
8771
- return /* @__PURE__ */ React33.createElement("div", { className: cx("confirmation-page tf-checkout-confirmation-page", className) }, /* @__PURE__ */ React33.createElement("div", { className: "tf-checkout-auth__alert", role: "alert" }, failure));
8879
+ return /* @__PURE__ */ React33.createElement("div", { className: cx("confirmation-page tf-checkout-confirmation-page", className) }, /* @__PURE__ */ React33.createElement("div", { className: "tf-checkout-auth__alert", role: "alert" }, failure === MISSING_REFERENCE ? t("confirmation.missingReference") : failure));
8772
8880
  }
8773
8881
  if (!data) {
8774
8882
  return /* @__PURE__ */ React33.createElement("div", { className: "tf-checkout-confirmation-page__loading" }, /* @__PURE__ */ React33.createElement(Loader, { className: "tf-checkout-loader--page" }));
@@ -8784,14 +8892,14 @@ var OrderConfirmation = ({
8784
8892
  const pricing = [
8785
8893
  ...Number.isFinite(currentPrice) ? [
8786
8894
  {
8787
- label: "Your ticket is currently",
8895
+ label: t("referral.currentPrice"),
8788
8896
  price: `${symbol}${currentPrice.toFixed(2)}`
8789
8897
  }
8790
8898
  ] : [],
8791
8899
  ...sales.map((sale) => ({
8792
- label: `If your friends buy ${sale.sales} tickets`,
8793
- subLabel: Number(sale.price) === 0 ? "Your ticket becomes" : "Your ticket goes down to",
8794
- price: Number(sale.price) === 0 ? "FREE!" : `${symbol}${Number(sale.price).toFixed(2)}`
8900
+ label: t("referral.ifFriendsBuy", { count: sale.sales }),
8901
+ subLabel: Number(sale.price) === 0 ? t("referral.becomes") : t("referral.goesDownTo"),
8902
+ price: Number(sale.price) === 0 ? t("referral.titleFree") : `${symbol}${Number(sale.price).toFixed(2)}`
8795
8903
  }))
8796
8904
  ];
8797
8905
  const copy = () => {
@@ -8801,20 +8909,20 @@ var OrderConfirmation = ({
8801
8909
  window.setTimeout(() => setCopied(false), 1500);
8802
8910
  });
8803
8911
  };
8804
- return /* @__PURE__ */ React33.createElement("div", { className: cx("confirmation-page tf-checkout-confirmation-page", className) }, /* @__PURE__ */ React33.createElement("div", { className: "header-container" }, /* @__PURE__ */ React33.createElement("div", { className: "header-product-text" }, /* @__PURE__ */ React33.createElement("p", { className: "title" }, title), (eventTitle || eventDate || eventLocation) && /* @__PURE__ */ React33.createElement("div", { className: "event-details" }, eventTitle && /* @__PURE__ */ React33.createElement("div", { className: "event-title" }, eventTitle), eventDate && /* @__PURE__ */ React33.createElement("div", { className: "event-date" }, eventDate), eventLocation && /* @__PURE__ */ React33.createElement("div", { className: "event-location" }, eventLocation)), /* @__PURE__ */ React33.createElement("div", { className: "share-message-section" }, customReplacement ? /* @__PURE__ */ React33.createElement("div", { dangerouslySetInnerHTML: { __html: customText } }) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("span", { className: "main" }, attachTickets ? "Your tickets have been emailed to you" : message != null ? message : "Your tickets are available in My Tickets."), /* @__PURE__ */ React33.createElement("span", { className: "helper" }, attachTickets ? "Please bring them with you to the event" : helper))))), customText && !customReplacement && /* @__PURE__ */ React33.createElement(
8912
+ return /* @__PURE__ */ React33.createElement("div", { className: cx("confirmation-page tf-checkout-confirmation-page", className) }, /* @__PURE__ */ React33.createElement("div", { className: "header-container" }, /* @__PURE__ */ React33.createElement("div", { className: "header-product-text" }, /* @__PURE__ */ React33.createElement("p", { className: "title" }, title != null ? title : t("confirmation.orderConfirmed")), (eventTitle || eventDate || eventLocation) && /* @__PURE__ */ React33.createElement("div", { className: "event-details" }, eventTitle && /* @__PURE__ */ React33.createElement("div", { className: "event-title" }, eventTitle), eventDate && /* @__PURE__ */ React33.createElement("div", { className: "event-date" }, eventDate), eventLocation && /* @__PURE__ */ React33.createElement("div", { className: "event-location" }, eventLocation)), /* @__PURE__ */ React33.createElement("div", { className: "share-message-section" }, customReplacement ? /* @__PURE__ */ React33.createElement("div", { dangerouslySetInnerHTML: { __html: customText } }) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("span", { className: "main" }, attachTickets ? t("confirmation.emailed") : message != null ? message : t("confirmation.inMyTickets")), /* @__PURE__ */ React33.createElement("span", { className: "helper" }, attachTickets ? t("confirmation.bringThem") : helper))))), customText && !customReplacement && /* @__PURE__ */ React33.createElement(
8805
8913
  "div",
8806
8914
  {
8807
8915
  className: "custom-confirmation-page-text tf-checkout-confirmation-page__custom",
8808
8916
  dangerouslySetInnerHTML: { __html: customText }
8809
8917
  }
8810
- ), orderUrl && /* @__PURE__ */ React33.createElement("div", { className: "order-details-button-container" }, /* @__PURE__ */ React33.createElement("a", { className: "view-order-button", href: orderUrl }, "View Order")), showReferral && data.disable_referral === false && shareUrl && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", { className: "referral_text_image_section" }, /* @__PURE__ */ React33.createElement("div", { className: "referral_text_section" }, /* @__PURE__ */ React33.createElement("div", { className: "referral_title_text" }, "Your ticket can become", /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " cheaper "), "or even", /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " FREE!")), /* @__PURE__ */ React33.createElement("div", { className: "referral_text" }, /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, "Invite friends "), "and we'll refund up to", /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " 100% "), "of your ticket money, if they buy tickets as well!"))), /* @__PURE__ */ React33.createElement("div", { className: "share_wrapper" }, /* @__PURE__ */ React33.createElement("div", { className: "share_section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_title" }, "How do you invite your friends?"), /* @__PURE__ */ React33.createElement("div", { className: "share_buttons" }, /* @__PURE__ */ React33.createElement("div", { className: "share-by-link" }, /* @__PURE__ */ React33.createElement("h5", { className: "share-by-link label" }, "Send them this link:"), /* @__PURE__ */ React33.createElement("div", { className: "share-btn-inner" }, /* @__PURE__ */ React33.createElement("input", { className: "share-input", readOnly: true, value: shareUrl }), /* @__PURE__ */ React33.createElement(
8918
+ ), orderUrl && /* @__PURE__ */ React33.createElement("div", { className: "order-details-button-container" }, /* @__PURE__ */ React33.createElement("a", { className: "view-order-button", href: orderUrl }, t("confirmation.viewOrder"))), showReferral && data.disable_referral === false && shareUrl && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", { className: "referral_text_image_section" }, /* @__PURE__ */ React33.createElement("div", { className: "referral_text_section" }, /* @__PURE__ */ React33.createElement("div", { className: "referral_title_text" }, t("referral.titleStart"), /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " ", t("referral.titleCheaper"), " "), t("referral.titleOr"), /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " ", t("referral.titleFree"))), /* @__PURE__ */ React33.createElement("div", { className: "referral_text" }, /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, t("referral.inviteFriends"), " "), t("referral.inviteMiddle"), /* @__PURE__ */ React33.createElement("span", { className: "strong-text" }, " 100% "), t("referral.inviteEnd")))), /* @__PURE__ */ React33.createElement("div", { className: "share_wrapper" }, /* @__PURE__ */ React33.createElement("div", { className: "share_section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_title" }, t("referral.howToInvite")), /* @__PURE__ */ React33.createElement("div", { className: "share_buttons" }, /* @__PURE__ */ React33.createElement("div", { className: "share-by-link" }, /* @__PURE__ */ React33.createElement("h5", { className: "share-by-link label" }, t("referral.sendThisLink")), /* @__PURE__ */ React33.createElement("div", { className: "share-btn-inner" }, /* @__PURE__ */ React33.createElement("input", { className: "share-input", readOnly: true, value: shareUrl }), /* @__PURE__ */ React33.createElement(
8811
8919
  "button",
8812
8920
  {
8813
8921
  className: "share-by-link-copy-icon",
8814
8922
  type: "button",
8815
8923
  onClick: copy
8816
8924
  },
8817
- /* @__PURE__ */ React33.createElement("span", { className: "copy-icon" }, copied ? "Copied!" : "Copy")
8925
+ /* @__PURE__ */ React33.createElement("span", { className: "copy-icon" }, copied ? t("referral.copied") : t("referral.copy"))
8818
8926
  ))), showShareButtons && /* @__PURE__ */ React33.createElement("div", { className: "social-media-btns" }, /* @__PURE__ */ React33.createElement(
8819
8927
  "a",
8820
8928
  {
@@ -8835,31 +8943,33 @@ var OrderConfirmation = ({
8835
8943
  rel: "noopener noreferrer"
8836
8944
  },
8837
8945
  "WhatsApp"
8838
- ))))), pricing.length > 0 && /* @__PURE__ */ React33.createElement("div", { className: "pricing-section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_title" }, "How much cheaper?"), pricing.map((item, index) => /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_wrapper", key: `${item.label}-${index}` }, /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_label" }, item.label, item.subLabel && /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_sublabel" }, item.subLabel)), /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_price" }, item.price)))))));
8946
+ ))))), pricing.length > 0 && /* @__PURE__ */ React33.createElement("div", { className: "pricing-section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_title" }, t("referral.howMuchCheaper")), pricing.map((item, index) => /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_wrapper", key: `${item.label}-${index}` }, /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_label" }, item.label, item.subLabel && /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_sublabel" }, item.subLabel)), /* @__PURE__ */ React33.createElement("div", { className: "pricing-section_price" }, item.price)))))));
8839
8947
  };
8840
8948
 
8841
8949
  // src/sections/OrderIDVerification.tsx
8842
8950
  import React34, { useEffect as useEffect14, useState as useState20 } from "react";
8843
8951
  var PHASE_MESSAGE = {
8844
- checking: "Checking your verification status\u2026",
8845
- idle: "To complete the purchase, please verify your identity.",
8846
- starting: "Opening the verification page\u2026",
8847
- polling: "Waiting for verification to complete in the other tab\u2026",
8848
- verified: "Identity verified \u2014 your tickets are on their way.",
8849
- timeout: "Verification is taking longer than usual. Your payment is safe.",
8850
- error: "We couldn\u2019t reach the verification service. Try again."
8851
- };
8952
+ checking: "verification.checking",
8953
+ idle: "verification.idle",
8954
+ starting: "verification.starting",
8955
+ polling: "verification.polling",
8956
+ verified: "verification.verified",
8957
+ timeout: "verification.timeoutSafe",
8958
+ error: "verification.error"
8959
+ };
8960
+ var MISSING_REFERENCE2 = "\0missing-reference";
8852
8961
  var OrderIDVerification = ({
8853
8962
  orderHash,
8854
8963
  onVerified,
8855
8964
  className
8856
8965
  }) => {
8966
+ const t = useT();
8857
8967
  const [phase, setPhase] = useState20("checking");
8858
8968
  const [failure, setFailure] = useState20("");
8859
8969
  useEffect14(() => {
8860
8970
  if (!orderHash) {
8861
8971
  setPhase("error");
8862
- setFailure("The order reference is missing.");
8972
+ setFailure(MISSING_REFERENCE2);
8863
8973
  return;
8864
8974
  }
8865
8975
  let active = true;
@@ -8912,7 +9022,7 @@ var OrderIDVerification = ({
8912
9022
  }
8913
9023
  );
8914
9024
  };
8915
- return /* @__PURE__ */ React34.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React34.createElement(SectionHeader, { title: "Account Verification" }), /* @__PURE__ */ React34.createElement(
9025
+ return /* @__PURE__ */ React34.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React34.createElement(SectionHeader, { title: t("verification.title") }), /* @__PURE__ */ React34.createElement(
8916
9026
  "p",
8917
9027
  {
8918
9028
  className: cx(
@@ -8920,8 +9030,8 @@ var OrderIDVerification = ({
8920
9030
  phase === "verified" && "tf-checkout-idverify__done"
8921
9031
  )
8922
9032
  },
8923
- failure || PHASE_MESSAGE[phase]
8924
- ), phase !== "verified" && orderHash && /* @__PURE__ */ React34.createElement(Button, { block: true, onClick: run, loading: running, disabled: running || !orderHash }, phase === "idle" ? "Verify" : running ? "Verifying\u2026" : "Try again"));
9033
+ failure === MISSING_REFERENCE2 ? t("confirmation.missingReference") : failure || t(PHASE_MESSAGE[phase])
9034
+ ), phase !== "verified" && orderHash && /* @__PURE__ */ React34.createElement(Button, { block: true, onClick: run, loading: running, disabled: running || !orderHash }, phase === "idle" ? t("verification.verify") : running ? t("verification.verifying") : t("verification.tryAgain")));
8925
9035
  };
8926
9036
 
8927
9037
  // src/EmbeddedCheckout.tsx
@@ -8949,6 +9059,7 @@ var Flow = ({
8949
9059
  showTestCardHint
8950
9060
  }) => {
8951
9061
  var _a;
9062
+ const t = useT();
8952
9063
  const checkout = useCheckoutContext();
8953
9064
  const [view, setView] = useState21(initialView);
8954
9065
  const [selectionView, setSelectionView] = useState21(initialView);
@@ -9075,7 +9186,7 @@ var Flow = ({
9075
9186
  key: authRequest.key,
9076
9187
  open: true,
9077
9188
  initialEmail: authRequest.email,
9078
- message: authRequest.email ? "This email already has an account. Log in to autofill your checkout details." : void 0,
9189
+ message: authRequest.email ? t("auth.existingAccount") : void 0,
9079
9190
  allowRegistration: auth == null ? void 0 : auth.allowRegistration,
9080
9191
  allowPasswordReset: auth == null ? void 0 : auth.allowPasswordReset,
9081
9192
  requireRegistrationAddress: auth == null ? void 0 : auth.requireRegistrationAddress,