tf-checkout-react-native 2.0.0-beta.12 → 2.0.0-beta.13

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.js CHANGED
@@ -470,7 +470,9 @@ __export(index_exports, {
470
470
  socialProfileLinkInput: () => socialProfileLinkInput,
471
471
  socialProfileLinkUrl: () => socialProfileLinkUrl,
472
472
  startBundlePaymentWith: () => startBundlePaymentWith,
473
+ stripeElementsPaymentContext: () => stripeElementsPaymentContext,
473
474
  stripeOffersOxxo: () => stripeOffersOxxo,
475
+ stripeWalletPaymentContext: () => stripeWalletPaymentContext,
474
476
  subscribeAccountCreation: () => subscribeAccountCreation,
475
477
  syncCurrency: () => syncCurrency,
476
478
  syncCurrencyWith: () => syncCurrencyWith,
@@ -4693,6 +4695,8 @@ var INTENT_OUTCOMES = /* @__PURE__ */ new Map([
4693
4695
  ]);
4694
4696
  var paymentIntentOutcome = (status) => status && INTENT_OUTCOMES.get(status) || "unknown";
4695
4697
  var planUsesSavedCard = (last4, selected) => selected && typeof last4 === "string" && /^\d{4}$/.test(last4);
4698
+ var stripeElementsPaymentContext = (amountMinor, currency) => typeof amountMinor === "number" && Number.isSafeInteger(amountMinor) && amountMinor > 0 && typeof currency === "string" && /^[A-Z]{3}$/.test(currency) ? { amountMinor, currency } : void 0;
4699
+ var stripeWalletPaymentContext = (amount2, currency, merchantCountry) => typeof amount2 === "string" && /^(?:0|[1-9]\d*)(?:\.\d+)?$/.test(amount2) && Number.isFinite(Number(amount2)) && Number(amount2) > 0 && typeof currency === "string" && /^[A-Z]{3}$/.test(currency) && typeof merchantCountry === "string" && /^[A-Z]{2}$/.test(merchantCountry) ? { amount: amount2, currency, merchantCountry } : void 0;
4696
4700
  var DEFAULT_PLAN_TERMINOLOGY = "Payment Plan";
4697
4701
  var planTerminology = (plan) => {
4698
4702
  var _a2;
@@ -10323,27 +10327,36 @@ var mapTicket = (t) => {
10323
10327
  badgeText: badgeOf((_n = t.badgeText) != null ? _n : t.badge_text)
10324
10328
  };
10325
10329
  };
10326
- var getEventDetails = async (eventId) => {
10327
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
10330
+ var getEventDetails = async (eventId, language = "en") => {
10331
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
10328
10332
  const body3 = await get(ENDPOINTS.events.info(eventId));
10329
10333
  const a = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) != null ? _b : {};
10330
10334
  const text6 = (value6) => typeof value6 === "string" && value6.trim() ? value6 : null;
10335
+ const originals = a.imageURLs && typeof a.imageURLs === "object" && !Array.isArray(a.imageURLs) ? a.imageURLs : {};
10336
+ const locale = language.replace(/_/g, "-").toLowerCase();
10337
+ const localized = (_c = Object.entries(originals).find(
10338
+ ([key5]) => key5.toLowerCase() === locale
10339
+ )) == null ? void 0 : _c[1];
10340
+ const base = (_d = Object.entries(originals).find(
10341
+ ([key5]) => key5.toLowerCase() === locale.split("-")[0]
10342
+ )) == null ? void 0 : _d[1];
10343
+ const original = (_f = (_e = text6(localized)) != null ? _e : text6(base)) != null ? _f : text6(originals.en);
10331
10344
  const coordinate = (value6) => value6 !== null && value6 !== void 0 && value6 !== "" && Number.isFinite(Number(value6)) ? Number(value6) : null;
10332
10345
  const hidden = a.hideVenue === true || a.hideVenue === 1 || a.hideVenue === "yes";
10333
10346
  const hideDate = a.hideDate === true || a.hideDate === 1 || a.hideDate === "yes" || a.hideDate === "1";
10334
10347
  return {
10335
- id: String((_d = (_c = body3 == null ? void 0 : body3.data) == null ? void 0 : _c.id) != null ? _d : eventId),
10336
- name: String((_f = (_e = a.name) != null ? _e : a.title) != null ? _f : ""),
10337
- slug: String((_g = a.slug) != null ? _g : ""),
10338
- description: String((_h = a.description) != null ? _h : ""),
10339
- shortDescription: String((_i = a.shortDescription) != null ? _i : ""),
10340
- imageUrl: (_k = (_j = text6(a.imageUrlHd)) != null ? _j : text6(a.productImage)) != null ? _k : text6(a.imageUrl),
10348
+ id: String((_h = (_g = body3 == null ? void 0 : body3.data) == null ? void 0 : _g.id) != null ? _h : eventId),
10349
+ name: String((_j = (_i = a.name) != null ? _i : a.title) != null ? _j : ""),
10350
+ slug: String((_k = a.slug) != null ? _k : ""),
10351
+ description: String((_l = a.description) != null ? _l : ""),
10352
+ shortDescription: String((_m = a.shortDescription) != null ? _m : ""),
10353
+ imageUrl: (_o = (_n = original != null ? original : text6(a.imageUrlHd)) != null ? _n : text6(a.productImage)) != null ? _o : text6(a.imageUrl),
10341
10354
  hideDate,
10342
- startDate: hideDate ? null : (_l = text6(a.startDate)) != null ? _l : text6(a.date),
10355
+ startDate: hideDate ? null : (_p = text6(a.startDate)) != null ? _p : text6(a.date),
10343
10356
  endDate: hideDate ? null : text6(a.endDate),
10344
- formattedDate: hideDate ? "Date TBC" : String((_m = a.formattedDate) != null ? _m : ""),
10357
+ formattedDate: hideDate ? "Date TBC" : String((_q = a.formattedDate) != null ? _q : ""),
10345
10358
  timezone: text6(a.timezone),
10346
- currency: String((_n = a.currency) != null ? _n : ""),
10359
+ currency: String((_r = a.currency) != null ? _r : ""),
10347
10360
  salesStart: text6(a.salesStart),
10348
10361
  salesEnd: text6(a.salesEnd),
10349
10362
  salesStarted: Boolean(a.salesStarted),
@@ -10973,6 +10986,10 @@ var getOrderReview = async (orderHash) => {
10973
10986
  clientSecret: (_e = method.stripe_client_secret) != null ? _e : null,
10974
10987
  publishableKey: (_f = method.stripe_publishable_key) != null ? _f : null,
10975
10988
  connectedAccount: method.stripe_connected_account || null,
10989
+ stripeAmountMinor: Number.isSafeInteger(method.amount_minor) && method.amount_minor >= 0 ? method.amount_minor : void 0,
10990
+ stripeWalletAmount: typeof method.stripe_wallet_amount === "string" ? method.stripe_wallet_amount : void 0,
10991
+ stripeCurrency: typeof method.stripe_currency === "string" && /^[A-Z]{3}$/.test(method.stripe_currency) ? method.stripe_currency : void 0,
10992
+ stripeMerchantCountry: typeof method.stripe_merchant_country === "string" && /^[A-Z]{2}$/.test(method.stripe_merchant_country) ? method.stripe_merchant_country : void 0,
10976
10993
  expiresInSeconds: Number.isFinite(rawExpiry) && rawExpiry > 0 ? rawExpiry : void 0,
10977
10994
  gateway: detectGateway(method),
10978
10995
  orderId: ((_g = a == null ? void 0 : a.order_details) == null ? void 0 : _g.id) != null ? String(a.order_details.id) : void 0,
@@ -12683,7 +12700,13 @@ var primeSeatsIoWith = (store, ctx, eventId, selection) => {
12683
12700
  currency: "",
12684
12701
  quantity: line.labels.length
12685
12702
  }));
12686
- return primeCore(store, ctx, eventId, selections, () => addSeatsIoToCart(eventId, selection));
12703
+ return primeCore(
12704
+ store,
12705
+ ctx,
12706
+ eventId,
12707
+ selections,
12708
+ () => addSeatsIoToCart(eventId, selection)
12709
+ );
12687
12710
  };
12688
12711
  var resumeCartWith = async (store, ctx, eventId, options = {}) => {
12689
12712
  assertNotBusy(store);
@@ -12822,7 +12845,8 @@ var repriceWith = async (store, addOns) => {
12822
12845
  redirectPaymentMethods: pricing.redirectPaymentMethods,
12823
12846
  walletAvailability: pricing.walletAvailability,
12824
12847
  stripeElementsConfig: pricing.stripeElementsConfig,
12825
- ...pricing.stripe ? { stripe: pricing.stripe } : {}
12848
+ stripe: pricing.stripe,
12849
+ paymentStripe: void 0
12826
12850
  });
12827
12851
  } catch (e) {
12828
12852
  failForCart(store, cart, e);
@@ -12887,19 +12911,29 @@ var setExtraItemsWith = async (store, input) => {
12887
12911
  failForCart(store, cart, error);
12888
12912
  }
12889
12913
  };
12890
- var orderStripeKeys = (review, stripe) => {
12891
- var _a2, _b, _c;
12892
- const publishableKey = (_a2 = review.publishableKey) != null ? _a2 : stripe == null ? void 0 : stripe.publishableKey;
12893
- if (!publishableKey) return null;
12914
+ var orderStripeKeys = (review) => {
12915
+ var _a2;
12916
+ if (!review.publishableKey) return null;
12894
12917
  return {
12895
- publishableKey,
12896
- accountId: (_c = (_b = review.connectedAccount) != null ? _b : stripe == null ? void 0 : stripe.accountId) != null ? _c : null
12918
+ publishableKey: review.publishableKey,
12919
+ accountId: (_a2 = review.connectedAccount) != null ? _a2 : null
12897
12920
  };
12898
12921
  };
12899
- var PAYABLE_PRE_ORDER_GATEWAYS = ["stripe_payment_intents", "xendit", "razorpay", "adyen"];
12900
- var NON_STRIPE_RAILS = ["paypal", "razorpay", "xenditCard", "xenditEWallet", "adyen"];
12922
+ var PAYABLE_PRE_ORDER_GATEWAYS = [
12923
+ "stripe_payment_intents",
12924
+ "xendit",
12925
+ "razorpay",
12926
+ "adyen"
12927
+ ];
12928
+ var NON_STRIPE_RAILS = [
12929
+ "paypal",
12930
+ "razorpay",
12931
+ "xenditCard",
12932
+ "xenditEWallet",
12933
+ "adyen"
12934
+ ];
12901
12935
  var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12902
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
12936
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
12903
12937
  const { ports, options } = ctx;
12904
12938
  const { confirmer } = ports;
12905
12939
  const initForCard = async (keys) => {
@@ -12927,7 +12961,7 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12927
12961
  }
12928
12962
  }
12929
12963
  const snap = store.getState();
12930
- const { billing, holders, addOns, consent, stripe } = snap;
12964
+ const { billing, holders, addOns, consent } = snap;
12931
12965
  if (((_d = (_c = snap.waiverSigningIndexes) == null ? void 0 : _c.length) != null ? _d : 0) > 0 && snap.status !== "placing") {
12932
12966
  store.setState({ status: "error", error: SIGNATURE_SAVING_MESSAGE });
12933
12967
  throw new Error(SIGNATURE_SAVING_MESSAGE);
@@ -13053,7 +13087,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13053
13087
  if (!noMoney && sameCart(store, placingCart) && !nothingCharged(error)) {
13054
13088
  store.progress.paymentAttempted = true;
13055
13089
  if (attemptedStripe) store.progress.uncertainStripeAttempt = true;
13056
- if (attemptedStripeIntent) store.progress.uncertainStripeIntent = attemptedStripeIntent;
13090
+ if (attemptedStripeIntent)
13091
+ store.progress.uncertainStripeIntent = attemptedStripeIntent;
13057
13092
  }
13058
13093
  throw error;
13059
13094
  });
@@ -13121,8 +13156,12 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13121
13156
  if (!displayTotal || !Number.isFinite(total) || session.currency !== displayTotal.currencyCode)
13122
13157
  throw new Error("Refresh your accommodation selection before paying.");
13123
13158
  if (Math.abs(total - displayTotal.total) > 5e-3) {
13124
- store.setState({ reviewedExtraOrderTotal: { total, currency: session.currency } });
13125
- throw new Error("The total has changed. Review the updated amount and press Pay again.");
13159
+ store.setState({
13160
+ reviewedExtraOrderTotal: { total, currency: session.currency }
13161
+ });
13162
+ throw new Error(
13163
+ "The total has changed. Review the updated amount and press Pay again."
13164
+ );
13126
13165
  }
13127
13166
  }
13128
13167
  const origin = getOriginUrl();
@@ -13130,10 +13169,14 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13130
13169
  if (returnUrl.origin !== new URL(origin).origin)
13131
13170
  throw new Error("Unable to open your payment window. Please try again.");
13132
13171
  const inspectOriginal = prepareInspectAdyenCheckout(orderHash, session.capability);
13133
- await paying(ports.providerPage({
13134
- uri: adyenCheckoutPage(orderHash, session.capability),
13135
- returnUrlPrefix: returnUrl.href
13136
- }), false, true);
13172
+ await paying(
13173
+ ports.providerPage({
13174
+ uri: adyenCheckoutPage(orderHash, session.capability),
13175
+ returnUrlPrefix: returnUrl.href
13176
+ }),
13177
+ false,
13178
+ true
13179
+ );
13137
13180
  const state = await paying(inspectOriginal(), true, true);
13138
13181
  if (state.status === "completed" || state.status === "pending") {
13139
13182
  store.progress.paymentConfirmed = true;
@@ -13147,13 +13190,19 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13147
13190
  state.status === "declined" ? "declined" : "cancelled"
13148
13191
  );
13149
13192
  }
13150
- throw new Error("Your payment needs another step. Open the payment window to continue.");
13193
+ throw new Error(
13194
+ "Your payment needs another step. Open the payment window to continue."
13195
+ );
13151
13196
  }
13152
13197
  const finishOriginalOrder = prepareConfirmOrderSuccess(orderHash);
13153
13198
  const review = await forThisCart(getOrderReview(orderHash));
13154
13199
  const secretIntentId = paymentIntentIdFromClientSecret(review.clientSecret);
13155
13200
  const reviewIntentId = review.stripeIntentId || secretIntentId;
13156
- const currentStripeIntent = review.gateway === "stripe" && reviewIntentId && (!review.clientSecret || secretIntentId === reviewIntentId) && review.publishableKey ? { id: reviewIntentId, account: cleanAccountId(review.connectedAccount) || "", key: review.publishableKey } : void 0;
13201
+ const currentStripeIntent = review.gateway === "stripe" && reviewIntentId && (!review.clientSecret || secretIntentId === reviewIntentId) && review.publishableKey ? {
13202
+ id: reviewIntentId,
13203
+ account: cleanAccountId(review.connectedAccount) || "",
13204
+ key: review.publishableKey
13205
+ } : void 0;
13157
13206
  const uncertainStripeIntent = store.progress.uncertainStripeIntent;
13158
13207
  if (store.progress.paymentAttempted && store.progress.uncertainStripeAttempt && (!uncertainStripeIntent || !currentStripeIntent || currentStripeIntent.id !== uncertainStripeIntent.id || currentStripeIntent.account !== uncertainStripeIntent.account || currentStripeIntent.key !== uncertainStripeIntent.key)) {
13159
13208
  throw new Error(PAYMENT_UNCONFIRMED_MESSAGE);
@@ -13210,15 +13259,22 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13210
13259
  const placedHash = orderHash;
13211
13260
  const failClosedPage = async (outcome, pageStartsPayment = false) => {
13212
13261
  if (pageStartsPayment && outcome.event === "failed" && outcome.notOpened === true) {
13213
- throw paymentProviderError(outcome.description || "The payment page could not be opened.", "cancelled");
13262
+ throw paymentProviderError(
13263
+ outcome.description || "The payment page could not be opened.",
13264
+ "cancelled"
13265
+ );
13214
13266
  }
13215
13267
  if (request2.method === "razorpay" && outcome.event === "failed" && outcome.paymentOutcome === "declined") {
13216
- throw paymentProviderError(outcome.description || "Your payment was declined.", "declined");
13268
+ throw paymentProviderError(
13269
+ outcome.description || "Your payment was declined.",
13270
+ "declined"
13271
+ );
13217
13272
  }
13218
13273
  assertSameCart();
13219
13274
  store.progress.paymentAttempted = true;
13220
13275
  if (attemptedStripe) store.progress.uncertainStripeAttempt = true;
13221
- if (attemptedStripeIntent) store.progress.uncertainStripeIntent = attemptedStripeIntent;
13276
+ if (attemptedStripeIntent)
13277
+ store.progress.uncertainStripeIntent = attemptedStripeIntent;
13222
13278
  await forThisCart(getOrderReview(placedHash)).catch((e) => {
13223
13279
  if (e instanceof CartChangedError) throw e;
13224
13280
  return null;
@@ -13226,7 +13282,7 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13226
13282
  throw new Error(PAYMENT_UNCONFIRMED_MESSAGE);
13227
13283
  };
13228
13284
  if (!store.progress.paymentConfirmed) {
13229
- const orderKeys = NON_STRIPE_RAILS.includes(request2.method) ? null : orderStripeKeys(review, stripe);
13285
+ const orderKeys = NON_STRIPE_RAILS.includes(request2.method) ? null : orderStripeKeys(review);
13230
13286
  let claimOwnCard = () => void 0;
13231
13287
  if (orderKeys) {
13232
13288
  store.setState({ paymentStripe: orderKeys });
@@ -13306,7 +13362,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13306
13362
  returnUrlPrefix: `${origin}/store/order-complete`
13307
13363
  })
13308
13364
  );
13309
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet, true);
13365
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13366
+ await failClosedPage(sheet, true);
13310
13367
  store.progress.paymentConfirmed = true;
13311
13368
  try {
13312
13369
  const { needIdVerification: needIdVerification2 } = await paying(confirmOrderSuccess(orderHash));
@@ -13338,7 +13395,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13338
13395
  returnUrlPrefix: `${getOriginUrl()}/store/order-complete`
13339
13396
  })
13340
13397
  );
13341
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet, true);
13398
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13399
+ await failClosedPage(sheet, true);
13342
13400
  store.progress.paymentConfirmed = true;
13343
13401
  const paymentId = typeof ((_k = sheet.data) == null ? void 0 : _k.razorpay_payment_id) === "string" ? sheet.data.razorpay_payment_id : void 0;
13344
13402
  const { needIdVerification: needIdVerification2 } = await paying(
@@ -13457,7 +13515,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13457
13515
  returnUrlPrefix: `${getOriginUrl()}/store/order-complete`
13458
13516
  })
13459
13517
  );
13460
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet);
13518
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13519
+ await failClosedPage(sheet);
13461
13520
  store.progress.paymentConfirmed = true;
13462
13521
  } else if (request2.method === "redirect") {
13463
13522
  if (!ports.providerPage || !ports.createRedirectPaymentMethod) {
@@ -13495,7 +13554,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13495
13554
  returnUrlPrefix: returnUrl
13496
13555
  })
13497
13556
  );
13498
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet);
13557
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13558
+ await failClosedPage(sheet);
13499
13559
  const redirectStatus = (_u = /[?&]redirect_status=([^&#]+)/.exec(
13500
13560
  sheet.returnUrl || ""
13501
13561
  )) == null ? void 0 : _u[1];
@@ -13570,16 +13630,27 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13570
13630
  }
13571
13631
  }
13572
13632
  if (!confirmedViaInstallments) {
13573
- const currencyCode = (_x = (_w = (_v = snap.breakdown) == null ? void 0 : _v.currencyCode) != null ? _w : review.currency) != null ? _x : "";
13633
+ const wallet = stripeWalletPaymentContext(
13634
+ review.stripeWalletAmount,
13635
+ review.stripeCurrency,
13636
+ review.stripeMerchantCountry
13637
+ );
13638
+ const currencyCode = (_v = wallet == null ? void 0 : wallet.currency) != null ? _v : "";
13639
+ const walletTotal = (_w = wallet == null ? void 0 : wallet.amount) != null ? _w : "";
13640
+ if ((request2.method === "applePay" || request2.method === "googlePay") && !wallet) {
13641
+ throw new Error(
13642
+ "The order payment amount or currency is unavailable. Please refresh checkout."
13643
+ );
13644
+ }
13574
13645
  let status;
13575
13646
  if (request2.method === "applePay") {
13576
13647
  status = await paying(
13577
13648
  confirmer.confirmApplePay(
13578
13649
  review.clientSecret,
13579
- review.total,
13650
+ walletTotal,
13580
13651
  currencyCode,
13581
13652
  {
13582
- merchantCountryCode: options.merchantCountryCode,
13653
+ merchantCountryCode: wallet == null ? void 0 : wallet.merchantCountry,
13583
13654
  merchantName: options.merchantName
13584
13655
  }
13585
13656
  ),
@@ -13591,10 +13662,10 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13591
13662
  status = await paying(
13592
13663
  confirmer.confirmGooglePay(
13593
13664
  review.clientSecret,
13594
- review.total,
13665
+ walletTotal,
13595
13666
  currencyCode,
13596
13667
  {
13597
- merchantCountryCode: options.merchantCountryCode,
13668
+ merchantCountryCode: wallet == null ? void 0 : wallet.merchantCountry,
13598
13669
  merchantName: options.merchantName,
13599
13670
  testEnv: options.googlePayTestEnv
13600
13671
  }
@@ -13603,6 +13674,16 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13603
13674
  true
13604
13675
  );
13605
13676
  } else {
13677
+ if (confirmer.prepareCardPayment) {
13678
+ await forThisCart(
13679
+ confirmer.prepareCardPayment(
13680
+ stripeElementsPaymentContext(
13681
+ review.stripeAmountMinor,
13682
+ review.stripeCurrency
13683
+ )
13684
+ )
13685
+ );
13686
+ }
13606
13687
  status = await paying(
13607
13688
  confirmer.confirmCard(review.clientSecret, billing),
13608
13689
  false,
@@ -24107,6 +24188,8 @@ var useStyles = (theme) => (0, import_react41.useMemo)(
24107
24188
  buttonDisabled: { opacity: 0.5 },
24108
24189
  buttonPressed: { opacity: 0.85 },
24109
24190
  buttonLabel: {
24191
+ maxWidth: "100%",
24192
+ textAlign: "center",
24110
24193
  color: theme.accentContrast,
24111
24194
  fontSize: theme.fontSize,
24112
24195
  fontWeight: "600",
@@ -24287,7 +24370,7 @@ var secureInitialUri = (uri) => {
24287
24370
  if (!/^https:\/\/[^/?#\s\\]+(?:[/?#][^\s\\]*)?$/i.test(uri)) return false;
24288
24371
  try {
24289
24372
  const url2 = new URL(uri);
24290
- return url2.protocol === "https:" && Boolean(url2.hostname) && !url2.username && !url2.password;
24373
+ return url2 !== null && typeof url2 === "object" && "protocol" in url2 && url2.protocol === "https:" && "hostname" in url2 && typeof url2.hostname === "string" && Boolean(url2.hostname) && "username" in url2 && url2.username === "" && "password" in url2 && url2.password === "";
24291
24374
  } catch (e) {
24292
24375
  return false;
24293
24376
  }
@@ -24631,15 +24714,25 @@ var createRnStripeConfirmer = () => {
24631
24714
  return confirmedStripeIntentStatus(paymentIntent);
24632
24715
  },
24633
24716
  confirmApplePay: async (clientSecret, total, currencyCode, merchant) => {
24634
- var _a2, _b;
24717
+ var _a2;
24718
+ const context = stripeWalletPaymentContext(
24719
+ total,
24720
+ currencyCode,
24721
+ merchant.merchantCountryCode
24722
+ );
24723
+ if (!context)
24724
+ throw paymentProviderError(
24725
+ "The order wallet details are unavailable.",
24726
+ "notStarted"
24727
+ );
24635
24728
  const { error, paymentIntent } = await (0, import_stripe_react_native2.confirmPlatformPayPayment)(clientSecret, {
24636
24729
  applePay: {
24637
- merchantCountryCode: (_a2 = merchant.merchantCountryCode) != null ? _a2 : "US",
24638
- currencyCode,
24730
+ merchantCountryCode: context.merchantCountry,
24731
+ currencyCode: context.currency,
24639
24732
  cartItems: [
24640
24733
  {
24641
- label: (_b = merchant.merchantName) != null ? _b : "Order",
24642
- amount: total,
24734
+ label: (_a2 = merchant.merchantName) != null ? _a2 : "Order",
24735
+ amount: context.amount,
24643
24736
  paymentType: import_stripe_react_native2.PlatformPay.PaymentType.Immediate
24644
24737
  }
24645
24738
  ]
@@ -24649,13 +24742,23 @@ var createRnStripeConfirmer = () => {
24649
24742
  return confirmedStripeIntentStatus(paymentIntent);
24650
24743
  },
24651
24744
  confirmGooglePay: async (clientSecret, total, currencyCode, merchant) => {
24652
- var _a2, _b;
24745
+ var _a2;
24746
+ const context = stripeWalletPaymentContext(
24747
+ total,
24748
+ currencyCode,
24749
+ merchant.merchantCountryCode
24750
+ );
24751
+ if (!context)
24752
+ throw paymentProviderError(
24753
+ "The order wallet details are unavailable.",
24754
+ "notStarted"
24755
+ );
24653
24756
  const { error, paymentIntent } = await (0, import_stripe_react_native2.confirmPlatformPayPayment)(clientSecret, {
24654
24757
  googlePay: {
24655
24758
  testEnv: merchant.testEnv === true,
24656
- merchantCountryCode: (_a2 = merchant.merchantCountryCode) != null ? _a2 : "US",
24657
- currencyCode,
24658
- merchantName: (_b = merchant.merchantName) != null ? _b : "Order"
24759
+ merchantCountryCode: context.merchantCountry,
24760
+ currencyCode: context.currency,
24761
+ merchantName: (_a2 = merchant.merchantName) != null ? _a2 : "Order"
24659
24762
  }
24660
24763
  });
24661
24764
  if (error) throw stripeFailure(error, "Google Pay failed.");
@@ -25163,9 +25266,10 @@ var useQuantityStyles = (theme) => (0, import_react48.useMemo)(
25163
25266
  () => import_react_native8.StyleSheet.create({
25164
25267
  stepper: { flexDirection: "row", alignItems: "center", gap: 14 },
25165
25268
  btn: {
25166
- width: 36,
25167
- height: 36,
25168
- borderRadius: 18,
25269
+ minWidth: 44,
25270
+ minHeight: 44,
25271
+ padding: 10,
25272
+ borderRadius: 22,
25169
25273
  borderWidth: import_react_native8.StyleSheet.hairlineWidth,
25170
25274
  borderColor: theme.border,
25171
25275
  alignItems: "center",
@@ -25662,6 +25766,7 @@ var Tickets = ({
25662
25766
  import_react_native12.Pressable,
25663
25767
  {
25664
25768
  accessibilityRole: "button",
25769
+ style: s9.textAction,
25665
25770
  onPress: () => setVisibleDescription((cur) => cur === t.id ? null : t.id),
25666
25771
  children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.infoToggle, children: visibleDescription === t.id ? "Hide info" : "View info" })
25667
25772
  }
@@ -25708,6 +25813,7 @@ var Tickets = ({
25708
25813
  import_react_native12.Pressable,
25709
25814
  {
25710
25815
  accessibilityRole: "button",
25816
+ style: s9.textAction,
25711
25817
  onPress: () => setWlOpen((w) => ({ ...w, [t.id]: true })),
25712
25818
  children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.wlToggle, children: "Join the waiting list" })
25713
25819
  }
@@ -25762,7 +25868,15 @@ var Tickets = ({
25762
25868
  g.time ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.slotTime, children: g.time }) : null,
25763
25869
  g.items.map(renderRow)
25764
25870
  ] }, g.time)) : tickets.map(renderRow),
25765
- showCodeInput ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Pressable, { accessibilityRole: "button", onPress: () => setPromoOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.promoToggle, children: "Got a promo code? Tap here" }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
25871
+ showCodeInput ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
25872
+ import_react_native12.Pressable,
25873
+ {
25874
+ accessibilityRole: "button",
25875
+ style: s9.textAction,
25876
+ onPress: () => setPromoOpen(true),
25877
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.promoToggle, children: "Got a promo code? Tap here" })
25878
+ }
25879
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
25766
25880
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Field, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
25767
25881
  Input,
25768
25882
  {
@@ -25838,10 +25952,25 @@ var useTicketStyles = (theme) => (0, import_react52.useMemo)(
25838
25952
  marginTop: 4,
25839
25953
  fontFamily: theme.fontFamily
25840
25954
  },
25841
- rowWrap: { gap: 8 },
25842
- row: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
25843
- info: { flex: 1, gap: 4 },
25844
- nameRow: { flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 },
25955
+ rowWrap: { gap: 12 },
25956
+ // Keep a readable text column; a narrow host moves controls to the next line.
25957
+ row: {
25958
+ flexDirection: "row",
25959
+ flexWrap: "wrap",
25960
+ alignItems: "flex-start",
25961
+ gap: 16
25962
+ },
25963
+ info: { flexGrow: 1, flexShrink: 1, flexBasis: 220, gap: 8 },
25964
+ nameRow: { gap: 4 },
25965
+ textAction: {
25966
+ alignSelf: "flex-start",
25967
+ maxWidth: "100%",
25968
+ minWidth: 44,
25969
+ minHeight: 44,
25970
+ paddingHorizontal: 8,
25971
+ paddingVertical: 10,
25972
+ justifyContent: "center"
25973
+ },
25845
25974
  name: {
25846
25975
  color: theme.text,
25847
25976
  fontSize: theme.fontSize,
@@ -25858,7 +25987,7 @@ var useTicketStyles = (theme) => (0, import_react52.useMemo)(
25858
25987
  flexDirection: "row",
25859
25988
  alignItems: "center",
25860
25989
  flexWrap: "wrap",
25861
- gap: 6
25990
+ gap: 8
25862
25991
  },
25863
25992
  oldPrice: {
25864
25993
  color: theme.muted,
@@ -25892,12 +26021,22 @@ var useTicketStyles = (theme) => (0, import_react52.useMemo)(
25892
26021
  fontFamily: theme.fontFamily
25893
26022
  },
25894
26023
  soldout: {
26024
+ marginStart: "auto",
26025
+ maxWidth: "100%",
25895
26026
  color: theme.muted,
25896
26027
  fontSize: theme.fontSize - 1,
25897
26028
  fontWeight: "600",
25898
26029
  fontFamily: theme.fontFamily
25899
26030
  },
25900
- qtyWrap: { flexDirection: "row", alignItems: "center", gap: 8 },
26031
+ qtyWrap: {
26032
+ flexDirection: "row",
26033
+ flexWrap: "wrap",
26034
+ maxWidth: "100%",
26035
+ alignItems: "center",
26036
+ justifyContent: "flex-end",
26037
+ gap: 12,
26038
+ marginStart: "auto"
26039
+ },
25901
26040
  guests: {
25902
26041
  color: theme.muted,
25903
26042
  fontSize: theme.fontSize - 2,
@@ -25907,6 +26046,7 @@ var useTicketStyles = (theme) => (0, import_react52.useMemo)(
25907
26046
  description: {
25908
26047
  color: theme.muted,
25909
26048
  fontSize: theme.fontSize - 1,
26049
+ lineHeight: theme.fontSize * 1.5,
25910
26050
  fontFamily: theme.fontFamily
25911
26051
  },
25912
26052
  wlToggle: {
@@ -26422,7 +26562,7 @@ var AddOns = ({
26422
26562
  ] }),
26423
26563
  desc ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.Text, { style: s9.desc, children: desc }) : null
26424
26564
  ] }),
26425
- soldOut(a) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.Text, { style: s9.soldOut, children: "Sold out" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
26565
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.View, { style: s9.quantity, children: soldOut(a) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.Text, { style: s9.soldOut, children: "Sold out" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
26426
26566
  QuantitySelect,
26427
26567
  {
26428
26568
  value: n,
@@ -26430,7 +26570,7 @@ var AddOns = ({
26430
26570
  max: max(a),
26431
26571
  onChange: (v) => setQty((q) => ({ ...q, [a.id]: v }))
26432
26572
  }
26433
- )
26573
+ ) })
26434
26574
  ] }),
26435
26575
  n > 0 && group ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.View, { style: s9.fields, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
26436
26576
  CustomFieldGroupFields,
@@ -26485,7 +26625,14 @@ var useAddonStyles = (theme) => (0, import_react55.useMemo)(
26485
26625
  fontWeight: "700",
26486
26626
  fontFamily: theme.fontFamily
26487
26627
  },
26488
- skipBtn: { paddingHorizontal: 4, paddingVertical: 2 },
26628
+ skipBtn: {
26629
+ maxWidth: "100%",
26630
+ minWidth: 44,
26631
+ minHeight: 44,
26632
+ paddingHorizontal: 8,
26633
+ paddingVertical: 10,
26634
+ justifyContent: "center"
26635
+ },
26489
26636
  skip: {
26490
26637
  color: theme.accent,
26491
26638
  fontSize: theme.fontSize - 1,
@@ -26509,8 +26656,14 @@ var useAddonStyles = (theme) => (0, import_react55.useMemo)(
26509
26656
  fontFamily: theme.fontFamily
26510
26657
  },
26511
26658
  item: { gap: 10 },
26512
- row: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
26513
- info: { flex: 1, gap: 2 },
26659
+ row: {
26660
+ flexDirection: "row",
26661
+ flexWrap: "wrap",
26662
+ alignItems: "flex-start",
26663
+ gap: 16
26664
+ },
26665
+ info: { flexGrow: 1, flexShrink: 1, flexBasis: 220, gap: 8 },
26666
+ quantity: { marginStart: "auto", maxWidth: "100%" },
26514
26667
  name: {
26515
26668
  color: theme.text,
26516
26669
  fontSize: theme.fontSize,
@@ -27629,7 +27782,15 @@ var BillingInfo = ({
27629
27782
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SectionHeader, { title: heading }),
27630
27783
  onLogin && !checkout.isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.View, { style: s9.loginRow, children: [
27631
27784
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: s9.note, children: "Login & skip ahead:" }),
27632
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Pressable, { onPress: () => onLogin(), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: s9.link, children: "Login" }) })
27785
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
27786
+ import_react_native22.Pressable,
27787
+ {
27788
+ accessibilityRole: "button",
27789
+ style: s9.loginAction,
27790
+ onPress: () => onLogin(),
27791
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: s9.link, children: "Login" })
27792
+ }
27793
+ )
27633
27794
  ] }) : null,
27634
27795
  gates.phoneFirstCheckout && !checkout.isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
27635
27796
  BillingPhoneIdentity,
@@ -27847,7 +28008,20 @@ var BillingInfo = ({
27847
28008
  };
27848
28009
  var useStyles4 = (theme) => (0, import_react59.useMemo)(
27849
28010
  () => import_react_native22.StyleSheet.create({
27850
- loginRow: { flexDirection: "row", alignItems: "center", gap: 8 },
28011
+ loginRow: {
28012
+ flexDirection: "row",
28013
+ flexWrap: "wrap",
28014
+ alignItems: "center",
28015
+ gap: 12
28016
+ },
28017
+ loginAction: {
28018
+ maxWidth: "100%",
28019
+ minWidth: 44,
28020
+ minHeight: 44,
28021
+ paddingHorizontal: 8,
28022
+ paddingVertical: 10,
28023
+ justifyContent: "center"
28024
+ },
27851
28025
  note: {
27852
28026
  color: theme.muted,
27853
28027
  fontSize: theme.fontSize - 1,
@@ -27872,8 +28046,8 @@ var useStyles4 = (theme) => (0, import_react59.useMemo)(
27872
28046
  fontSize: theme.fontSize - 1,
27873
28047
  fontFamily: theme.fontFamily
27874
28048
  },
27875
- row: { flexDirection: "row", gap: 10 },
27876
- col: { flex: 1 }
28049
+ row: { flexDirection: "row", flexWrap: "wrap", gap: 12 },
28050
+ col: { flexGrow: 1, flexShrink: 1, flexBasis: 180 }
27877
28051
  }),
27878
28052
  [theme]
27879
28053
  );