tf-checkout-react 2.0.0-beta.2 → 2.0.0-beta.4
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 +108 -81
- package/dist/index.d.ts +108 -81
- package/dist/index.esm.js +264 -97
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +253 -85
- package/dist/index.js.map +1 -1
- package/dist/styles/tickets.css +18 -1
- package/package.json +1 -1
- package/src/EmbeddedCheckout.tsx +3 -5
- package/src/sections/Confirmation.tsx +2 -2
- package/src/sections/IDVerification.tsx +16 -9
- package/src/sections/OrderConfirmation.tsx +32 -23
- package/src/sections/OrderIDVerification.tsx +23 -11
- package/src/sections/Payment.tsx +1 -1
- package/src/sections/Tickets.tsx +36 -13
- package/src/styles/tickets.css +18 -1
- package/src/ui/InstallmentPicker.tsx +4 -2
- package/src/ui/Loader.tsx +11 -7
- package/src/ui/Stepper.tsx +27 -23
package/dist/index.esm.js
CHANGED
|
@@ -1173,6 +1173,31 @@ var createIdVerificationPoller = (callbacks) => {
|
|
|
1173
1173
|
};
|
|
1174
1174
|
};
|
|
1175
1175
|
|
|
1176
|
+
// ../tf-checkout-shared/src/logic/tickets.ts
|
|
1177
|
+
var BADGE_PRESETS = {
|
|
1178
|
+
"almost gone": "tickets.badge.almostGone",
|
|
1179
|
+
"high demand": "tickets.badge.highDemand",
|
|
1180
|
+
"in demand": "tickets.badge.inDemand",
|
|
1181
|
+
"limited stock": "tickets.badge.limitedStock",
|
|
1182
|
+
"limited time": "tickets.badge.limitedTime",
|
|
1183
|
+
"running low": "tickets.badge.runningLow",
|
|
1184
|
+
"selling fast": "tickets.badge.sellingFast",
|
|
1185
|
+
"selling out": "tickets.badge.sellingOut"
|
|
1186
|
+
};
|
|
1187
|
+
var PERCENT_LEFT = /^(\d{1,3})% left$/i;
|
|
1188
|
+
var ticketBadgeTranslation = (badgeText) => {
|
|
1189
|
+
const text = (badgeText != null ? badgeText : "").trim();
|
|
1190
|
+
if (!text) return null;
|
|
1191
|
+
const preset = BADGE_PRESETS[text.toLowerCase()];
|
|
1192
|
+
if (preset) return { key: preset };
|
|
1193
|
+
const percent = PERCENT_LEFT.exec(text);
|
|
1194
|
+
return percent ? { key: "tickets.badge.percentLeft", vars: { percent: percent[1] } } : null;
|
|
1195
|
+
};
|
|
1196
|
+
var orderTicketsBeforeTables = (tickets) => [
|
|
1197
|
+
...tickets.filter((ticket) => !ticket.isTable),
|
|
1198
|
+
...tickets.filter((ticket) => ticket.isTable)
|
|
1199
|
+
];
|
|
1200
|
+
|
|
1176
1201
|
// ../tf-checkout-shared/src/engine/store.ts
|
|
1177
1202
|
var initialSnapshot = () => ({
|
|
1178
1203
|
status: "idle",
|
|
@@ -1467,7 +1492,7 @@ var buildXenditCheckoutHtml = (options) => {
|
|
|
1467
1492
|
|
|
1468
1493
|
// ../tf-checkout-shared/src/engine/errors.ts
|
|
1469
1494
|
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;
|
|
1495
|
+
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
1496
|
var isCartExpiredError = (error) => {
|
|
1472
1497
|
const e = toTtfError(error);
|
|
1473
1498
|
if (e.status !== 422) return false;
|
|
@@ -1869,8 +1894,12 @@ var removeReservedSeats = async (eventId, tierId, seatIds) => (
|
|
|
1869
1894
|
var refreshReservation = async (eventId, orderId) => patch(ENDPOINTS.seatmap.refreshReservation(eventId), { order_id: orderId });
|
|
1870
1895
|
|
|
1871
1896
|
// ../tf-checkout-shared/src/api/events.ts
|
|
1897
|
+
var badgeOf = (raw) => {
|
|
1898
|
+
const text = typeof raw === "string" ? raw.trim() : "";
|
|
1899
|
+
return text || null;
|
|
1900
|
+
};
|
|
1872
1901
|
var mapTicket = (t) => {
|
|
1873
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1902
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
1874
1903
|
return {
|
|
1875
1904
|
id: String(t.id),
|
|
1876
1905
|
name: (_a = t.displayName) != null ? _a : "",
|
|
@@ -1898,7 +1927,8 @@ var mapTicket = (t) => {
|
|
|
1898
1927
|
allowDirectPurchase: Boolean(t.allowDirectPurchase),
|
|
1899
1928
|
waitingListEnabled: Boolean(t.waitingListEnabled),
|
|
1900
1929
|
waitingListMaxQuantity: t.waitingListMaxQuantity != null ? Number(t.waitingListMaxQuantity) : void 0,
|
|
1901
|
-
descriptionRich: (_m = t.descriptionRich) != null ? _m : null
|
|
1930
|
+
descriptionRich: (_m = t.descriptionRich) != null ? _m : null,
|
|
1931
|
+
badgeText: badgeOf((_n = t.badgeText) != null ? _n : t.badge_text)
|
|
1902
1932
|
};
|
|
1903
1933
|
};
|
|
1904
1934
|
var getEventTickets = async (eventId) => {
|
|
@@ -1952,7 +1982,7 @@ var getEventConditions = async (eventId) => {
|
|
|
1952
1982
|
}).filter((c) => c.content || c.name);
|
|
1953
1983
|
};
|
|
1954
1984
|
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;
|
|
1985
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
1956
1986
|
const body = await get(ENDPOINTS.events.timeSlotByDate(eventId), {
|
|
1957
1987
|
params: {
|
|
1958
1988
|
date,
|
|
@@ -1989,6 +2019,7 @@ var getEventTimeSlotTickets = async (eventId, date, options) => {
|
|
|
1989
2019
|
isTable: Boolean(s.is_table),
|
|
1990
2020
|
allowDirectPurchase: true,
|
|
1991
2021
|
descriptionRich: (_t = s.description) != null ? _t : null,
|
|
2022
|
+
badgeText: badgeOf((_u = s.badge_text) != null ? _u : s.badgeText),
|
|
1992
2023
|
timeSlot: { date: slotDate, time: timeKey }
|
|
1993
2024
|
});
|
|
1994
2025
|
}
|
|
@@ -4187,7 +4218,64 @@ var en = {
|
|
|
4187
4218
|
"auth.passwordsMustMatch": "Passwords must match.",
|
|
4188
4219
|
"auth.passwordChanged": "Your password has been changed. You can now log in.",
|
|
4189
4220
|
"auth.selectState": "Select state / region",
|
|
4190
|
-
"auth.notRequired": "Not required"
|
|
4221
|
+
"auth.notRequired": "Not required",
|
|
4222
|
+
// --- Previously hardcoded in components ---------------------------------
|
|
4223
|
+
"tickets.waitingListJoined": "You\u2019re on the waiting list \u2014 we\u2019ll email you if a spot opens.",
|
|
4224
|
+
"tickets.firstName": "First name",
|
|
4225
|
+
"tickets.lastName": "Last name",
|
|
4226
|
+
"tickets.email": "Email",
|
|
4227
|
+
"tickets.joinWaitingList": "Join the waiting list",
|
|
4228
|
+
"tickets.free": "FREE",
|
|
4229
|
+
"tickets.feesIncluded": "(incl. fees)",
|
|
4230
|
+
"tickets.feesExcluded": "(excl. fees)",
|
|
4231
|
+
"tickets.deposit": "{{percent}}% DEPOSIT",
|
|
4232
|
+
"tickets.gotPromoCode": "Got a promo code? Click here",
|
|
4233
|
+
"payment.conditionRequired": "You must accept this condition to continue.",
|
|
4234
|
+
"payment.payInFull": "Pay in full instead",
|
|
4235
|
+
"payment.installmentTotal": "{{amount}} total",
|
|
4236
|
+
"confirmation.viewVoucher": "View payment voucher",
|
|
4237
|
+
"confirmation.viewTickets": "View my tickets",
|
|
4238
|
+
"confirmation.orderConfirmed": "Your order has been confirmed!",
|
|
4239
|
+
"confirmation.emailed": "Your tickets have been emailed to you",
|
|
4240
|
+
"confirmation.inMyTickets": "Your tickets are available in My Tickets.",
|
|
4241
|
+
"confirmation.bringThem": "Please bring them with you to the event",
|
|
4242
|
+
"confirmation.viewOrder": "View Order",
|
|
4243
|
+
"confirmation.missingReference": "The order reference is missing.",
|
|
4244
|
+
"referral.titleStart": "Your ticket can become",
|
|
4245
|
+
"referral.titleCheaper": "cheaper",
|
|
4246
|
+
"referral.titleOr": "or even",
|
|
4247
|
+
"referral.titleFree": "FREE!",
|
|
4248
|
+
"referral.inviteMiddle": "and we'll refund up to",
|
|
4249
|
+
"referral.inviteEnd": "of your ticket money, if they buy tickets as well!",
|
|
4250
|
+
"referral.copy": "Copy",
|
|
4251
|
+
"referral.currentPrice": "Your ticket is currently",
|
|
4252
|
+
"referral.ifFriendsBuy": "If your friends buy {{count}} tickets",
|
|
4253
|
+
"referral.becomes": "Your ticket becomes",
|
|
4254
|
+
"referral.goesDownTo": "Your ticket goes down to",
|
|
4255
|
+
"verification.title": "Account Verification",
|
|
4256
|
+
"verification.checking": "Checking your verification status\u2026",
|
|
4257
|
+
"verification.idle": "To complete the purchase, please verify your identity.",
|
|
4258
|
+
"verification.starting": "Opening the verification page\u2026",
|
|
4259
|
+
"verification.polling": "Waiting for verification to complete in the other tab\u2026",
|
|
4260
|
+
"verification.verified": "Identity verified \u2014 your tickets are on their way.",
|
|
4261
|
+
"verification.timeoutCheckAgain": "Still not confirmed. Finish in the other tab, then check again.",
|
|
4262
|
+
"verification.timeoutSafe": "Verification is taking longer than usual. Your payment is safe.",
|
|
4263
|
+
"verification.error": "We couldn\u2019t reach the verification service. Try again.",
|
|
4264
|
+
"verification.verify": "Verify",
|
|
4265
|
+
"verification.verifying": "Verifying\u2026",
|
|
4266
|
+
"verification.checkAgain": "Check again",
|
|
4267
|
+
"verification.tryAgain": "Try again",
|
|
4268
|
+
"auth.existingAccount": "This email already has an account. Log in to autofill your checkout details.",
|
|
4269
|
+
// --- Ticket-type badges: the dashboard's presets ------------------------
|
|
4270
|
+
"tickets.badge.almostGone": "Almost gone",
|
|
4271
|
+
"tickets.badge.highDemand": "High demand",
|
|
4272
|
+
"tickets.badge.inDemand": "In demand",
|
|
4273
|
+
"tickets.badge.limitedStock": "Limited stock",
|
|
4274
|
+
"tickets.badge.limitedTime": "Limited time",
|
|
4275
|
+
"tickets.badge.runningLow": "Running low",
|
|
4276
|
+
"tickets.badge.sellingFast": "Selling fast",
|
|
4277
|
+
"tickets.badge.sellingOut": "Selling out",
|
|
4278
|
+
"tickets.badge.percentLeft": "{{percent}}% left"
|
|
4191
4279
|
};
|
|
4192
4280
|
|
|
4193
4281
|
// ../tf-checkout-shared/src/i18n/resolve.ts
|
|
@@ -4403,7 +4491,64 @@ var esMX = {
|
|
|
4403
4491
|
"auth.passwordsMustMatch": "Las contrase\xF1as deben coincidir.",
|
|
4404
4492
|
"auth.passwordChanged": "Tu contrase\xF1a se cambi\xF3. Ya puedes iniciar sesi\xF3n.",
|
|
4405
4493
|
"auth.selectState": "Selecciona estado / regi\xF3n",
|
|
4406
|
-
"auth.notRequired": "No requerido"
|
|
4494
|
+
"auth.notRequired": "No requerido",
|
|
4495
|
+
// --- Previously hardcoded in components ---------------------------------
|
|
4496
|
+
"tickets.waitingListJoined": "Ya est\xE1s en la lista de espera \u2014 te escribiremos si se libera un lugar.",
|
|
4497
|
+
"tickets.firstName": "Nombre",
|
|
4498
|
+
"tickets.lastName": "Apellido",
|
|
4499
|
+
"tickets.email": "Correo electr\xF3nico",
|
|
4500
|
+
"tickets.joinWaitingList": "Unirme a la lista de espera",
|
|
4501
|
+
"tickets.free": "GRATIS",
|
|
4502
|
+
"tickets.feesIncluded": "(incl. cargos)",
|
|
4503
|
+
"tickets.feesExcluded": "(excl. cargos)",
|
|
4504
|
+
"tickets.deposit": "{{percent}}% DE ANTICIPO",
|
|
4505
|
+
"tickets.gotPromoCode": "\xBFTienes un c\xF3digo promocional? Haz clic aqu\xED",
|
|
4506
|
+
"payment.conditionRequired": "Debes aceptar esta condici\xF3n para continuar.",
|
|
4507
|
+
"payment.payInFull": "Mejor pagar en una sola exhibici\xF3n",
|
|
4508
|
+
"payment.installmentTotal": "{{amount}} en total",
|
|
4509
|
+
"confirmation.viewVoucher": "Ver ficha de pago",
|
|
4510
|
+
"confirmation.viewTickets": "Ver mis boletos",
|
|
4511
|
+
"confirmation.orderConfirmed": "\xA1Tu pedido est\xE1 confirmado!",
|
|
4512
|
+
"confirmation.emailed": "Te enviamos tus boletos por correo",
|
|
4513
|
+
"confirmation.inMyTickets": "Tus boletos est\xE1n disponibles en Mis boletos.",
|
|
4514
|
+
"confirmation.bringThem": "Ll\xE9valos contigo al evento",
|
|
4515
|
+
"confirmation.viewOrder": "Ver pedido",
|
|
4516
|
+
"confirmation.missingReference": "Falta la referencia del pedido.",
|
|
4517
|
+
"referral.titleStart": "Tu boleto puede salirte",
|
|
4518
|
+
"referral.titleCheaper": "m\xE1s barato",
|
|
4519
|
+
"referral.titleOr": "o incluso",
|
|
4520
|
+
"referral.titleFree": "\xA1GRATIS!",
|
|
4521
|
+
"referral.inviteMiddle": "y te reembolsamos hasta el",
|
|
4522
|
+
"referral.inviteEnd": "de lo que pagaste por tu boleto si ellos tambi\xE9n compran.",
|
|
4523
|
+
"referral.copy": "Copiar",
|
|
4524
|
+
"referral.currentPrice": "Tu boleto cuesta ahora",
|
|
4525
|
+
"referral.ifFriendsBuy": "Si tus amigos compran {{count}} boletos",
|
|
4526
|
+
"referral.becomes": "Tu boleto queda",
|
|
4527
|
+
"referral.goesDownTo": "Tu boleto baja a",
|
|
4528
|
+
"verification.title": "Verificaci\xF3n de cuenta",
|
|
4529
|
+
"verification.checking": "Revisando el estado de tu verificaci\xF3n\u2026",
|
|
4530
|
+
"verification.idle": "Para completar la compra, verifica tu identidad.",
|
|
4531
|
+
"verification.starting": "Abriendo la p\xE1gina de verificaci\xF3n\u2026",
|
|
4532
|
+
"verification.polling": "Esperando a que termines la verificaci\xF3n en la otra pesta\xF1a\u2026",
|
|
4533
|
+
"verification.verified": "Identidad verificada \u2014 tus boletos van en camino.",
|
|
4534
|
+
"verification.timeoutCheckAgain": "A\xFAn no se confirma. Termina en la otra pesta\xF1a y vuelve a revisar.",
|
|
4535
|
+
"verification.timeoutSafe": "La verificaci\xF3n est\xE1 tardando m\xE1s de lo normal. Tu pago est\xE1 seguro.",
|
|
4536
|
+
"verification.error": "No pudimos conectar con el servicio de verificaci\xF3n. Int\xE9ntalo de nuevo.",
|
|
4537
|
+
"verification.verify": "Verificar",
|
|
4538
|
+
"verification.verifying": "Verificando\u2026",
|
|
4539
|
+
"verification.checkAgain": "Revisar de nuevo",
|
|
4540
|
+
"verification.tryAgain": "Intentar de nuevo",
|
|
4541
|
+
"auth.existingAccount": "Este correo ya tiene una cuenta. Inicia sesi\xF3n para autocompletar tus datos de compra.",
|
|
4542
|
+
// --- Ticket-type badges: the dashboard's presets ------------------------
|
|
4543
|
+
"tickets.badge.almostGone": "Casi agotado",
|
|
4544
|
+
"tickets.badge.highDemand": "Alta demanda",
|
|
4545
|
+
"tickets.badge.inDemand": "Muy solicitado",
|
|
4546
|
+
"tickets.badge.limitedStock": "Disponibilidad limitada",
|
|
4547
|
+
"tickets.badge.limitedTime": "Por tiempo limitado",
|
|
4548
|
+
"tickets.badge.runningLow": "Quedan pocos",
|
|
4549
|
+
"tickets.badge.sellingFast": "Se venden r\xE1pido",
|
|
4550
|
+
"tickets.badge.sellingOut": "A punto de agotarse",
|
|
4551
|
+
"tickets.badge.percentLeft": "Queda el {{percent}}%"
|
|
4407
4552
|
};
|
|
4408
4553
|
|
|
4409
4554
|
// ../tf-checkout-shared/src/i18n/locales/index.ts
|
|
@@ -5269,14 +5414,17 @@ import React4, { forwardRef } from "react";
|
|
|
5269
5414
|
|
|
5270
5415
|
// src/ui/Loader.tsx
|
|
5271
5416
|
import React3 from "react";
|
|
5272
|
-
var Loader = ({ className }) =>
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
)
|
|
5417
|
+
var Loader = ({ className }) => {
|
|
5418
|
+
const t = useT();
|
|
5419
|
+
return /* @__PURE__ */ React3.createElement(
|
|
5420
|
+
"span",
|
|
5421
|
+
{
|
|
5422
|
+
className: cx("tf-checkout-loader", className),
|
|
5423
|
+
role: "status",
|
|
5424
|
+
"aria-label": t("common.loading")
|
|
5425
|
+
}
|
|
5426
|
+
);
|
|
5427
|
+
};
|
|
5280
5428
|
|
|
5281
5429
|
// src/ui/Button.tsx
|
|
5282
5430
|
var Button = forwardRef(
|
|
@@ -5330,9 +5478,9 @@ var useInstallmentPicker = () => {
|
|
|
5330
5478
|
onClick: () => choose(o)
|
|
5331
5479
|
},
|
|
5332
5480
|
/* @__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 ?
|
|
5481
|
+
/* @__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
5482
|
);
|
|
5335
|
-
})), /* @__PURE__ */ React5.createElement(Button, { variant: "ghost", block: true, onClick: () => choose(null) }, "
|
|
5483
|
+
})), /* @__PURE__ */ React5.createElement(Button, { variant: "ghost", block: true, onClick: () => choose(null) }, t("payment.payInFull")))
|
|
5336
5484
|
) : null;
|
|
5337
5485
|
return { onInstallmentOffers, picker };
|
|
5338
5486
|
};
|
|
@@ -5735,27 +5883,30 @@ var PaymentMethods = ({
|
|
|
5735
5883
|
|
|
5736
5884
|
// src/ui/Stepper.tsx
|
|
5737
5885
|
import React11 from "react";
|
|
5738
|
-
var Stepper = ({ value, onChange, min = 0, max = Infinity, step = 1, disabled, className }) =>
|
|
5739
|
-
|
|
5740
|
-
{
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
{
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5886
|
+
var Stepper = ({ value, onChange, min = 0, max = Infinity, step = 1, disabled, className }) => {
|
|
5887
|
+
const t = useT();
|
|
5888
|
+
return /* @__PURE__ */ React11.createElement("div", { className: cx("tf-checkout-stepper", className) }, /* @__PURE__ */ React11.createElement(
|
|
5889
|
+
"button",
|
|
5890
|
+
{
|
|
5891
|
+
type: "button",
|
|
5892
|
+
className: "tf-checkout-stepper__btn",
|
|
5893
|
+
"aria-label": t("common.decrease"),
|
|
5894
|
+
disabled: disabled || value <= min,
|
|
5895
|
+
onClick: () => onChange(Math.max(min, value - step))
|
|
5896
|
+
},
|
|
5897
|
+
"\u2212"
|
|
5898
|
+
), /* @__PURE__ */ React11.createElement("span", { className: "tf-checkout-stepper__value" }, value), /* @__PURE__ */ React11.createElement(
|
|
5899
|
+
"button",
|
|
5900
|
+
{
|
|
5901
|
+
type: "button",
|
|
5902
|
+
className: "tf-checkout-stepper__btn",
|
|
5903
|
+
"aria-label": t("common.increase"),
|
|
5904
|
+
disabled: disabled || value >= max,
|
|
5905
|
+
onClick: () => onChange(Math.min(max, value + step))
|
|
5906
|
+
},
|
|
5907
|
+
"+"
|
|
5908
|
+
));
|
|
5909
|
+
};
|
|
5759
5910
|
|
|
5760
5911
|
// src/ui/QuantitySelect.tsx
|
|
5761
5912
|
import React12 from "react";
|
|
@@ -6598,34 +6749,36 @@ var ResetPasswordForm = ({
|
|
|
6598
6749
|
import React22, {
|
|
6599
6750
|
Fragment,
|
|
6600
6751
|
useEffect as useEffect8,
|
|
6752
|
+
useMemo as useMemo4,
|
|
6601
6753
|
useRef as useRef5,
|
|
6602
6754
|
useState as useState12
|
|
6603
6755
|
} from "react";
|
|
6604
6756
|
var WaitingListForm = ({ ticket, onJoin }) => {
|
|
6757
|
+
const tr = useT();
|
|
6605
6758
|
const [form, setForm] = useState12({ firstName: "", lastName: "", email: "" });
|
|
6606
6759
|
const [state, setState] = useState12("idle");
|
|
6607
6760
|
const [error, setError] = useState12("");
|
|
6608
6761
|
const ok = form.firstName.trim() && form.lastName.trim() && form.email.trim();
|
|
6609
6762
|
if (state === "done")
|
|
6610
|
-
return /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-note tf-checkout-tickets__wl-done" }, "
|
|
6763
|
+
return /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-note tf-checkout-tickets__wl-done" }, tr("tickets.waitingListJoined"));
|
|
6611
6764
|
return /* @__PURE__ */ React22.createElement("div", { className: "tf-checkout-tickets__wl" }, /* @__PURE__ */ React22.createElement(FieldRow, null, /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
|
|
6612
6765
|
Input,
|
|
6613
6766
|
{
|
|
6614
|
-
placeholder: "
|
|
6767
|
+
placeholder: tr("tickets.firstName"),
|
|
6615
6768
|
value: form.firstName,
|
|
6616
6769
|
onChange: (e) => setForm((f) => ({ ...f, firstName: e.target.value }))
|
|
6617
6770
|
}
|
|
6618
6771
|
)), /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
|
|
6619
6772
|
Input,
|
|
6620
6773
|
{
|
|
6621
|
-
placeholder: "
|
|
6774
|
+
placeholder: tr("tickets.lastName"),
|
|
6622
6775
|
value: form.lastName,
|
|
6623
6776
|
onChange: (e) => setForm((f) => ({ ...f, lastName: e.target.value }))
|
|
6624
6777
|
}
|
|
6625
6778
|
))), /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
|
|
6626
6779
|
Input,
|
|
6627
6780
|
{
|
|
6628
|
-
placeholder: "
|
|
6781
|
+
placeholder: tr("tickets.email"),
|
|
6629
6782
|
value: form.email,
|
|
6630
6783
|
onChange: (e) => setForm((f) => ({ ...f, email: e.target.value }))
|
|
6631
6784
|
}
|
|
@@ -6644,7 +6797,7 @@ var WaitingListForm = ({ ticket, onJoin }) => {
|
|
|
6644
6797
|
disabled: !ok || state === "busy",
|
|
6645
6798
|
variant: "secondary"
|
|
6646
6799
|
},
|
|
6647
|
-
"
|
|
6800
|
+
tr("tickets.joinWaitingList")
|
|
6648
6801
|
), error && /* @__PURE__ */ React22.createElement("p", { className: "tf-checkout-error-text" }, error));
|
|
6649
6802
|
};
|
|
6650
6803
|
var Tickets = ({
|
|
@@ -6660,7 +6813,7 @@ var Tickets = ({
|
|
|
6660
6813
|
readAttributionFromUrl = true,
|
|
6661
6814
|
className
|
|
6662
6815
|
}) => {
|
|
6663
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
6816
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6664
6817
|
const tr = useT();
|
|
6665
6818
|
const checkout = useCheckoutContext();
|
|
6666
6819
|
const buttonText = buttonLabel != null ? buttonLabel : tr("tickets.getTickets");
|
|
@@ -6676,7 +6829,12 @@ var Tickets = ({
|
|
|
6676
6829
|
if (isTimeSlot && !slotDate && dates.length) setSlotDate(dates[0]);
|
|
6677
6830
|
}, [isTimeSlot, slotDate, dates]);
|
|
6678
6831
|
const slotQuery = hooks_exports.useTimeSlotTickets(eventId, isTimeSlot ? slotDate : void 0);
|
|
6679
|
-
const
|
|
6832
|
+
const slotTickets = slotQuery.data;
|
|
6833
|
+
const eventTickets = (_e = ticketsQuery.data) == null ? void 0 : _e.tickets;
|
|
6834
|
+
const tickets = useMemo4(
|
|
6835
|
+
() => isTimeSlot ? slotTickets != null ? slotTickets : [] : orderTicketsBeforeTables(eventTickets != null ? eventTickets : []),
|
|
6836
|
+
[isTimeSlot, slotTickets, eventTickets]
|
|
6837
|
+
);
|
|
6680
6838
|
const [error, setError] = useState12("");
|
|
6681
6839
|
const [code, setCode] = useState12("");
|
|
6682
6840
|
const [codeState, setCodeState] = useState12("idle");
|
|
@@ -6745,7 +6903,7 @@ var Tickets = ({
|
|
|
6745
6903
|
return next;
|
|
6746
6904
|
});
|
|
6747
6905
|
const money = (sym, n) => `${sym} ${Number(n).toFixed(2)}`;
|
|
6748
|
-
const isSeated = (
|
|
6906
|
+
const isSeated = (_f = eventInfo == null ? void 0 : eventInfo.isSeatedEvent) != null ? _f : false;
|
|
6749
6907
|
const seatMapRow = (t) => isSeated && !t.allowDirectPurchase;
|
|
6750
6908
|
const hasSeatMapTickets = tickets.some(seatMapRow);
|
|
6751
6909
|
const directPurchasable = tickets.filter((t) => !seatMapRow(t));
|
|
@@ -6779,6 +6937,7 @@ var Tickets = ({
|
|
|
6779
6937
|
const isFree = Number(t.price) === 0;
|
|
6780
6938
|
const sym = t.priceSymbol || t.currency;
|
|
6781
6939
|
const range = ticketQuantityRange(t);
|
|
6940
|
+
const badge = ticketBadgeTranslation(t.badgeText);
|
|
6782
6941
|
const ticketIndex = tickets.findIndex((candidate) => candidate.id === t.id);
|
|
6783
6942
|
const previousTicket = ticketIndex > 0 ? tickets[ticketIndex - 1] : void 0;
|
|
6784
6943
|
const startsNamedGroup = Boolean(t.groupName) && t.groupName !== (previousTicket == null ? void 0 : previousTicket.groupName);
|
|
@@ -6792,7 +6951,7 @@ var Tickets = ({
|
|
|
6792
6951
|
onClick: () => setVisibleDescription((current2) => current2 === t.id ? null : t.id)
|
|
6793
6952
|
},
|
|
6794
6953
|
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(
|
|
6954
|
+
)), t.badgeText && !unavailable && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__badge" }, badge ? tr(badge.key, badge.vars) : 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
6955
|
"span",
|
|
6797
6956
|
{
|
|
6798
6957
|
className: cx(
|
|
@@ -6800,8 +6959,8 @@ var Tickets = ({
|
|
|
6800
6959
|
isFree && "tf-checkout-tickets__amount--free"
|
|
6801
6960
|
)
|
|
6802
6961
|
},
|
|
6803
|
-
isFree ? "
|
|
6804
|
-
), !isFree && !t.soldOut && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__fees" },
|
|
6962
|
+
isFree ? tr("tickets.free") : money(sym, t.price)
|
|
6963
|
+
), !isFree && !t.soldOut && /* @__PURE__ */ React22.createElement("span", { className: "tf-checkout-tickets__fees" }, tr(t.feeIncluded ? "tickets.feesIncluded" : "tickets.feesExcluded")), 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
6964
|
QuantitySelect,
|
|
6806
6965
|
{
|
|
6807
6966
|
value: (_a2 = qty[t.id]) != null ? _a2 : 0,
|
|
@@ -6830,13 +6989,13 @@ var Tickets = ({
|
|
|
6830
6989
|
className: "tf-checkout-tickets__wl-toggle",
|
|
6831
6990
|
onClick: () => setWlOpen((w) => ({ ...w, [t.id]: true }))
|
|
6832
6991
|
},
|
|
6833
|
-
"
|
|
6992
|
+
tr("tickets.joinWaitingList")
|
|
6834
6993
|
))));
|
|
6835
6994
|
};
|
|
6836
6995
|
const timeGroups = [];
|
|
6837
6996
|
if (isTimeSlot)
|
|
6838
6997
|
for (const t of tickets) {
|
|
6839
|
-
const time = (
|
|
6998
|
+
const time = (_h = (_g = t.timeSlot) == null ? void 0 : _g.time) != null ? _h : "";
|
|
6840
6999
|
const g = timeGroups.find((x) => x.time === time);
|
|
6841
7000
|
if (g) g.items.push(t);
|
|
6842
7001
|
else timeGroups.push({ time, items: [t] });
|
|
@@ -6874,7 +7033,7 @@ var Tickets = ({
|
|
|
6874
7033
|
className: "tf-checkout-tickets__promo-toggle",
|
|
6875
7034
|
onClick: () => setPromoOpen(true)
|
|
6876
7035
|
},
|
|
6877
|
-
"
|
|
7036
|
+
tr("tickets.gotPromoCode")
|
|
6878
7037
|
) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(FieldRow, null, /* @__PURE__ */ React22.createElement(Field, null, /* @__PURE__ */ React22.createElement(
|
|
6879
7038
|
Input,
|
|
6880
7039
|
{
|
|
@@ -7270,7 +7429,7 @@ var SeatMap = ({
|
|
|
7270
7429
|
};
|
|
7271
7430
|
|
|
7272
7431
|
// src/sections/AddOns.tsx
|
|
7273
|
-
import React24, { Fragment as Fragment2, useEffect as useEffect10, useMemo as
|
|
7432
|
+
import React24, { Fragment as Fragment2, useEffect as useEffect10, useMemo as useMemo5, useState as useState14 } from "react";
|
|
7274
7433
|
var AddOns = ({
|
|
7275
7434
|
eventId,
|
|
7276
7435
|
onContinue,
|
|
@@ -7299,7 +7458,7 @@ var AddOns = ({
|
|
|
7299
7458
|
(_e = checkout.addOnDataCapture) != null ? _e : {}
|
|
7300
7459
|
);
|
|
7301
7460
|
const [error, setError] = useState14("");
|
|
7302
|
-
const fieldGroups =
|
|
7461
|
+
const fieldGroups = useMemo5(() => {
|
|
7303
7462
|
const map = {};
|
|
7304
7463
|
for (const g of checkout.customFields) if (g.scope === "add-on") map[g.id] = g;
|
|
7305
7464
|
return map;
|
|
@@ -7408,7 +7567,7 @@ var AddOns = ({
|
|
|
7408
7567
|
import React28, {
|
|
7409
7568
|
Fragment as Fragment3,
|
|
7410
7569
|
useEffect as useEffect11,
|
|
7411
|
-
useMemo as
|
|
7570
|
+
useMemo as useMemo6,
|
|
7412
7571
|
useRef as useRef7,
|
|
7413
7572
|
useState as useState15
|
|
7414
7573
|
} from "react";
|
|
@@ -7782,21 +7941,21 @@ var BillingInfo = ({
|
|
|
7782
7941
|
const profileSeeded = useRef7(false);
|
|
7783
7942
|
const countryDefaultApplied = useRef7(Boolean((_v = checkout.billing) == null ? void 0 : _v.countryId));
|
|
7784
7943
|
const gates = checkout.fieldGates;
|
|
7785
|
-
const orderGroups =
|
|
7944
|
+
const orderGroups = useMemo6(
|
|
7786
7945
|
() => checkout.customFields.filter((g) => g.scope === "order"),
|
|
7787
7946
|
[checkout.customFields]
|
|
7788
7947
|
);
|
|
7789
|
-
const ticketGroups =
|
|
7948
|
+
const ticketGroups = useMemo6(
|
|
7790
7949
|
() => checkout.customFields.filter((g) => g.scope === "ticket"),
|
|
7791
7950
|
[checkout.customFields]
|
|
7792
7951
|
);
|
|
7793
|
-
const ticketFields =
|
|
7952
|
+
const ticketFields = useMemo6(
|
|
7794
7953
|
() => ticketGroups.flatMap((g) => g.fields),
|
|
7795
7954
|
[ticketGroups]
|
|
7796
7955
|
);
|
|
7797
7956
|
const holderNamesRequired = checkout.holderNamesRequired || collectTicketHolders;
|
|
7798
7957
|
const showHolders = holderNamesRequired || ticketFields.length > 0;
|
|
7799
|
-
const slots =
|
|
7958
|
+
const slots = useMemo6(() => {
|
|
7800
7959
|
var _a2, _b2;
|
|
7801
7960
|
const out = [];
|
|
7802
7961
|
const lines = (_b2 = (_a2 = checkout.breakdown) == null ? void 0 : _a2.tickets) != null ? _b2 : [];
|
|
@@ -7885,14 +8044,14 @@ var BillingInfo = ({
|
|
|
7885
8044
|
const countriesQuery = hooks_exports.useCountries({
|
|
7886
8045
|
enabled: needsNationality || gates.showAddress
|
|
7887
8046
|
});
|
|
7888
|
-
const countries =
|
|
8047
|
+
const countries = useMemo6(() => {
|
|
7889
8048
|
var _a2;
|
|
7890
8049
|
return (_a2 = countriesQuery.data) != null ? _a2 : [];
|
|
7891
8050
|
}, [countriesQuery.data]);
|
|
7892
8051
|
const statesQuery = hooks_exports.useStates(billing.countryId, {
|
|
7893
8052
|
enabled: Boolean(billing.countryId)
|
|
7894
8053
|
});
|
|
7895
|
-
const states =
|
|
8054
|
+
const states = useMemo6(() => {
|
|
7896
8055
|
var _a2;
|
|
7897
8056
|
return (_a2 = statesQuery.data) != null ? _a2 : [];
|
|
7898
8057
|
}, [statesQuery.data]);
|
|
@@ -7959,7 +8118,7 @@ var BillingInfo = ({
|
|
|
7959
8118
|
}, [billing.stateId, billing.stateCode, states]);
|
|
7960
8119
|
const setB = (k) => (e) => setBilling((b) => ({ ...b, [k]: e.target.value }));
|
|
7961
8120
|
const patchHolder = (i, patch2) => setHolders((hs) => hs.map((h, j) => j === i ? { ...h, ...patch2 } : h));
|
|
7962
|
-
const dobMax =
|
|
8121
|
+
const dobMax = useMemo6(todayISO, []);
|
|
7963
8122
|
const [dobYear, dobMonth, dobDay] = dob ? dob.split("-").map(Number) : [];
|
|
7964
8123
|
const buyerPhone = isBlankPhone(billing.phone) ? void 0 : billing.phone;
|
|
7965
8124
|
const committedBilling = {
|
|
@@ -8274,7 +8433,7 @@ var BillingInfo = ({
|
|
|
8274
8433
|
};
|
|
8275
8434
|
|
|
8276
8435
|
// src/sections/Payment.tsx
|
|
8277
|
-
import React30, { useEffect as useEffect12, useMemo as
|
|
8436
|
+
import React30, { useEffect as useEffect12, useMemo as useMemo7, useRef as useRef8, useState as useState16 } from "react";
|
|
8278
8437
|
|
|
8279
8438
|
// src/sections/OrderSummary.tsx
|
|
8280
8439
|
import React29 from "react";
|
|
@@ -8372,7 +8531,7 @@ var Payment = ({
|
|
|
8372
8531
|
const isXendit = checkout.gateway === "xendit";
|
|
8373
8532
|
const serverMethodTypes = (_a = checkout.stripeElementsConfig) == null ? void 0 : _a.paymentMethodTypes;
|
|
8374
8533
|
const offersOxxo = Array.isArray(serverMethodTypes) && serverMethodTypes.includes("oxxo");
|
|
8375
|
-
const options =
|
|
8534
|
+
const options = useMemo7(() => {
|
|
8376
8535
|
var _a2, _b2, _c2;
|
|
8377
8536
|
if (isFree || !methods) return [];
|
|
8378
8537
|
const out = [];
|
|
@@ -8588,7 +8747,7 @@ var Payment = ({
|
|
|
8588
8747
|
label: /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement("span", { dangerouslySetInnerHTML: { __html: c.content || c.name } }), c.isRequired && " *")
|
|
8589
8748
|
}
|
|
8590
8749
|
),
|
|
8591
|
-
invalid && /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-consent__error" }, "
|
|
8750
|
+
invalid && /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-consent__error" }, t("payment.conditionRequired"))
|
|
8592
8751
|
);
|
|
8593
8752
|
})), /* @__PURE__ */ React30.createElement(OrderSummary, { eventId }), /* @__PURE__ */ React30.createElement("div", { className: "tf-checkout-payment__cta" }, /* @__PURE__ */ React30.createElement(
|
|
8594
8753
|
Button,
|
|
@@ -8604,14 +8763,15 @@ var Payment = ({
|
|
|
8604
8763
|
// src/sections/IDVerification.tsx
|
|
8605
8764
|
import React31, { useState as useState17 } from "react";
|
|
8606
8765
|
var MESSAGE = {
|
|
8607
|
-
idle: "
|
|
8608
|
-
starting: "
|
|
8609
|
-
polling: "
|
|
8610
|
-
verified: "
|
|
8611
|
-
timeout: "
|
|
8612
|
-
error: "
|
|
8766
|
+
idle: "verification.idle",
|
|
8767
|
+
starting: "verification.starting",
|
|
8768
|
+
polling: "verification.polling",
|
|
8769
|
+
verified: "verification.verified",
|
|
8770
|
+
timeout: "verification.timeoutCheckAgain",
|
|
8771
|
+
error: "verification.error"
|
|
8613
8772
|
};
|
|
8614
8773
|
var IDVerification = ({ className }) => {
|
|
8774
|
+
const t = useT();
|
|
8615
8775
|
const checkout = useCheckoutContext();
|
|
8616
8776
|
const order = checkout.order;
|
|
8617
8777
|
const [phase, setPhase] = useState17("idle");
|
|
@@ -8632,7 +8792,7 @@ var IDVerification = ({ className }) => {
|
|
|
8632
8792
|
setError(errorMessage(e));
|
|
8633
8793
|
});
|
|
8634
8794
|
};
|
|
8635
|
-
return /* @__PURE__ */ React31.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React31.createElement(SectionHeader, { title: "
|
|
8795
|
+
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
8796
|
};
|
|
8637
8797
|
|
|
8638
8798
|
// src/sections/Confirmation.tsx
|
|
@@ -8686,14 +8846,14 @@ var Confirmation = ({
|
|
|
8686
8846
|
target: "_blank",
|
|
8687
8847
|
rel: "noopener noreferrer"
|
|
8688
8848
|
},
|
|
8689
|
-
"
|
|
8849
|
+
t("confirmation.viewVoucher")
|
|
8690
8850
|
), viewOrderUrl && /* @__PURE__ */ React32.createElement(
|
|
8691
8851
|
"a",
|
|
8692
8852
|
{
|
|
8693
8853
|
className: "tf-checkout-button tf-checkout-button--secondary tf-checkout-button--block",
|
|
8694
8854
|
href: viewOrderUrl
|
|
8695
8855
|
},
|
|
8696
|
-
"
|
|
8856
|
+
t("confirmation.viewTickets")
|
|
8697
8857
|
), 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
8858
|
"a",
|
|
8699
8859
|
{
|
|
@@ -8716,9 +8876,10 @@ var attributesOf = (response) => {
|
|
|
8716
8876
|
if (data && typeof data === "object") return data;
|
|
8717
8877
|
return response;
|
|
8718
8878
|
};
|
|
8879
|
+
var MISSING_REFERENCE = "\0missing-reference";
|
|
8719
8880
|
var OrderConfirmation = ({
|
|
8720
8881
|
orderHash,
|
|
8721
|
-
title
|
|
8882
|
+
title,
|
|
8722
8883
|
message,
|
|
8723
8884
|
helper,
|
|
8724
8885
|
eventTitle,
|
|
@@ -8732,6 +8893,7 @@ var OrderConfirmation = ({
|
|
|
8732
8893
|
className
|
|
8733
8894
|
}) => {
|
|
8734
8895
|
var _a, _b, _c, _d;
|
|
8896
|
+
const t = useT();
|
|
8735
8897
|
const [data, setData] = useState19(null);
|
|
8736
8898
|
const [failure, setFailure] = useState19("");
|
|
8737
8899
|
const [copied, setCopied] = useState19(false);
|
|
@@ -8743,7 +8905,7 @@ var OrderConfirmation = ({
|
|
|
8743
8905
|
}, [onError, onLoaded]);
|
|
8744
8906
|
useEffect13(() => {
|
|
8745
8907
|
if (!orderHash) {
|
|
8746
|
-
setFailure(
|
|
8908
|
+
setFailure(MISSING_REFERENCE);
|
|
8747
8909
|
return;
|
|
8748
8910
|
}
|
|
8749
8911
|
let active = true;
|
|
@@ -8768,7 +8930,7 @@ var OrderConfirmation = ({
|
|
|
8768
8930
|
};
|
|
8769
8931
|
}, [orderHash]);
|
|
8770
8932
|
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));
|
|
8933
|
+
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
8934
|
}
|
|
8773
8935
|
if (!data) {
|
|
8774
8936
|
return /* @__PURE__ */ React33.createElement("div", { className: "tf-checkout-confirmation-page__loading" }, /* @__PURE__ */ React33.createElement(Loader, { className: "tf-checkout-loader--page" }));
|
|
@@ -8784,14 +8946,14 @@ var OrderConfirmation = ({
|
|
|
8784
8946
|
const pricing = [
|
|
8785
8947
|
...Number.isFinite(currentPrice) ? [
|
|
8786
8948
|
{
|
|
8787
|
-
label: "
|
|
8949
|
+
label: t("referral.currentPrice"),
|
|
8788
8950
|
price: `${symbol}${currentPrice.toFixed(2)}`
|
|
8789
8951
|
}
|
|
8790
8952
|
] : [],
|
|
8791
8953
|
...sales.map((sale) => ({
|
|
8792
|
-
label:
|
|
8793
|
-
subLabel: Number(sale.price) === 0 ? "
|
|
8794
|
-
price: Number(sale.price) === 0 ? "
|
|
8954
|
+
label: t("referral.ifFriendsBuy", { count: sale.sales }),
|
|
8955
|
+
subLabel: Number(sale.price) === 0 ? t("referral.becomes") : t("referral.goesDownTo"),
|
|
8956
|
+
price: Number(sale.price) === 0 ? t("referral.titleFree") : `${symbol}${Number(sale.price).toFixed(2)}`
|
|
8795
8957
|
}))
|
|
8796
8958
|
];
|
|
8797
8959
|
const copy = () => {
|
|
@@ -8801,20 +8963,20 @@ var OrderConfirmation = ({
|
|
|
8801
8963
|
window.setTimeout(() => setCopied(false), 1500);
|
|
8802
8964
|
});
|
|
8803
8965
|
};
|
|
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 ? "
|
|
8966
|
+
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
8967
|
"div",
|
|
8806
8968
|
{
|
|
8807
8969
|
className: "custom-confirmation-page-text tf-checkout-confirmation-page__custom",
|
|
8808
8970
|
dangerouslySetInnerHTML: { __html: customText }
|
|
8809
8971
|
}
|
|
8810
|
-
), orderUrl && /* @__PURE__ */ React33.createElement("div", { className: "order-details-button-container" }, /* @__PURE__ */ React33.createElement("a", { className: "view-order-button", href: orderUrl }, "
|
|
8972
|
+
), 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
8973
|
"button",
|
|
8812
8974
|
{
|
|
8813
8975
|
className: "share-by-link-copy-icon",
|
|
8814
8976
|
type: "button",
|
|
8815
8977
|
onClick: copy
|
|
8816
8978
|
},
|
|
8817
|
-
/* @__PURE__ */ React33.createElement("span", { className: "copy-icon" }, copied ? "
|
|
8979
|
+
/* @__PURE__ */ React33.createElement("span", { className: "copy-icon" }, copied ? t("referral.copied") : t("referral.copy"))
|
|
8818
8980
|
))), showShareButtons && /* @__PURE__ */ React33.createElement("div", { className: "social-media-btns" }, /* @__PURE__ */ React33.createElement(
|
|
8819
8981
|
"a",
|
|
8820
8982
|
{
|
|
@@ -8835,31 +8997,33 @@ var OrderConfirmation = ({
|
|
|
8835
8997
|
rel: "noopener noreferrer"
|
|
8836
8998
|
},
|
|
8837
8999
|
"WhatsApp"
|
|
8838
|
-
))))), pricing.length > 0 && /* @__PURE__ */ React33.createElement("div", { className: "pricing-section" }, /* @__PURE__ */ React33.createElement("div", { className: "invitation_title" }, "
|
|
9000
|
+
))))), 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
9001
|
};
|
|
8840
9002
|
|
|
8841
9003
|
// src/sections/OrderIDVerification.tsx
|
|
8842
9004
|
import React34, { useEffect as useEffect14, useState as useState20 } from "react";
|
|
8843
9005
|
var PHASE_MESSAGE = {
|
|
8844
|
-
checking: "
|
|
8845
|
-
idle: "
|
|
8846
|
-
starting: "
|
|
8847
|
-
polling: "
|
|
8848
|
-
verified: "
|
|
8849
|
-
timeout: "
|
|
8850
|
-
error: "
|
|
8851
|
-
};
|
|
9006
|
+
checking: "verification.checking",
|
|
9007
|
+
idle: "verification.idle",
|
|
9008
|
+
starting: "verification.starting",
|
|
9009
|
+
polling: "verification.polling",
|
|
9010
|
+
verified: "verification.verified",
|
|
9011
|
+
timeout: "verification.timeoutSafe",
|
|
9012
|
+
error: "verification.error"
|
|
9013
|
+
};
|
|
9014
|
+
var MISSING_REFERENCE2 = "\0missing-reference";
|
|
8852
9015
|
var OrderIDVerification = ({
|
|
8853
9016
|
orderHash,
|
|
8854
9017
|
onVerified,
|
|
8855
9018
|
className
|
|
8856
9019
|
}) => {
|
|
9020
|
+
const t = useT();
|
|
8857
9021
|
const [phase, setPhase] = useState20("checking");
|
|
8858
9022
|
const [failure, setFailure] = useState20("");
|
|
8859
9023
|
useEffect14(() => {
|
|
8860
9024
|
if (!orderHash) {
|
|
8861
9025
|
setPhase("error");
|
|
8862
|
-
setFailure(
|
|
9026
|
+
setFailure(MISSING_REFERENCE2);
|
|
8863
9027
|
return;
|
|
8864
9028
|
}
|
|
8865
9029
|
let active = true;
|
|
@@ -8912,7 +9076,7 @@ var OrderIDVerification = ({
|
|
|
8912
9076
|
}
|
|
8913
9077
|
);
|
|
8914
9078
|
};
|
|
8915
|
-
return /* @__PURE__ */ React34.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React34.createElement(SectionHeader, { title: "
|
|
9079
|
+
return /* @__PURE__ */ React34.createElement(Card, { className: cx("tf-checkout-idverify", className) }, /* @__PURE__ */ React34.createElement(SectionHeader, { title: t("verification.title") }), /* @__PURE__ */ React34.createElement(
|
|
8916
9080
|
"p",
|
|
8917
9081
|
{
|
|
8918
9082
|
className: cx(
|
|
@@ -8920,8 +9084,8 @@ var OrderIDVerification = ({
|
|
|
8920
9084
|
phase === "verified" && "tf-checkout-idverify__done"
|
|
8921
9085
|
)
|
|
8922
9086
|
},
|
|
8923
|
-
failure || PHASE_MESSAGE[phase]
|
|
8924
|
-
), phase !== "verified" && orderHash && /* @__PURE__ */ React34.createElement(Button, { block: true, onClick: run, loading: running, disabled: running || !orderHash }, phase === "idle" ? "
|
|
9087
|
+
failure === MISSING_REFERENCE2 ? t("confirmation.missingReference") : failure || t(PHASE_MESSAGE[phase])
|
|
9088
|
+
), 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
9089
|
};
|
|
8926
9090
|
|
|
8927
9091
|
// src/EmbeddedCheckout.tsx
|
|
@@ -8949,6 +9113,7 @@ var Flow = ({
|
|
|
8949
9113
|
showTestCardHint
|
|
8950
9114
|
}) => {
|
|
8951
9115
|
var _a;
|
|
9116
|
+
const t = useT();
|
|
8952
9117
|
const checkout = useCheckoutContext();
|
|
8953
9118
|
const [view, setView] = useState21(initialView);
|
|
8954
9119
|
const [selectionView, setSelectionView] = useState21(initialView);
|
|
@@ -9075,7 +9240,7 @@ var Flow = ({
|
|
|
9075
9240
|
key: authRequest.key,
|
|
9076
9241
|
open: true,
|
|
9077
9242
|
initialEmail: authRequest.email,
|
|
9078
|
-
message: authRequest.email ? "
|
|
9243
|
+
message: authRequest.email ? t("auth.existingAccount") : void 0,
|
|
9079
9244
|
allowRegistration: auth == null ? void 0 : auth.allowRegistration,
|
|
9080
9245
|
allowPasswordReset: auth == null ? void 0 : auth.allowPasswordReset,
|
|
9081
9246
|
requireRegistrationAddress: auth == null ? void 0 : auth.requireRegistrationAddress,
|
|
@@ -9338,6 +9503,7 @@ export {
|
|
|
9338
9503
|
missingCheckoutDetails,
|
|
9339
9504
|
missingRequiredAddOns,
|
|
9340
9505
|
normalizeAuthEmail,
|
|
9506
|
+
orderTicketsBeforeTables,
|
|
9341
9507
|
oxxoVoucherFromNextAction,
|
|
9342
9508
|
payOrderWith,
|
|
9343
9509
|
paymentIntentIdFromClientSecret,
|
|
@@ -9365,6 +9531,7 @@ export {
|
|
|
9365
9531
|
syncCurrency,
|
|
9366
9532
|
syncCurrencyWith,
|
|
9367
9533
|
themeToVars,
|
|
9534
|
+
ticketBadgeTranslation,
|
|
9368
9535
|
ticketFieldsFor,
|
|
9369
9536
|
ticketQuantityRange,
|
|
9370
9537
|
ttf,
|