tf-checkout-react-native 2.0.0-beta.14 → 2.0.0-beta.16
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 +38 -37
- package/dist/index.d.ts +38 -37
- package/dist/index.js +723 -342
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +677 -293
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
- package/src/confirmer.ts +338 -99
- package/src/index.tsx +10 -2
- package/src/instance.ts +1 -3
- package/src/paymentSheet.ts +170 -0
- package/src/sections/Payment.tsx +41 -24
- package/src/ui/CheckoutProvider.tsx +14 -12
- package/src/ui/Select.tsx +30 -6
- package/src/useCheckout.ts +78 -3
package/dist/index.js
CHANGED
|
@@ -6833,8 +6833,8 @@ var beginRequest = (currentScope) => {
|
|
|
6833
6833
|
var createActionLock = () => {
|
|
6834
6834
|
const held = /* @__PURE__ */ new Set();
|
|
6835
6835
|
const waiting = /* @__PURE__ */ new Map();
|
|
6836
|
-
const
|
|
6837
|
-
const notify = () =>
|
|
6836
|
+
const listeners42 = /* @__PURE__ */ new Set();
|
|
6837
|
+
const notify = () => listeners42.forEach((listener) => listener());
|
|
6838
6838
|
return {
|
|
6839
6839
|
acquire: (scope) => {
|
|
6840
6840
|
if (held.has(scope)) return null;
|
|
@@ -6858,9 +6858,9 @@ var createActionLock = () => {
|
|
|
6858
6858
|
waiting.set(scope, [...(_a2 = waiting.get(scope)) != null ? _a2 : [], resolve]);
|
|
6859
6859
|
}) : Promise.resolve(),
|
|
6860
6860
|
subscribe: (listener) => {
|
|
6861
|
-
|
|
6861
|
+
listeners42.add(listener);
|
|
6862
6862
|
return () => {
|
|
6863
|
-
|
|
6863
|
+
listeners42.delete(listener);
|
|
6864
6864
|
};
|
|
6865
6865
|
}
|
|
6866
6866
|
};
|
|
@@ -8893,9 +8893,9 @@ var withOrderFixed = (snapshot, progress) => {
|
|
|
8893
8893
|
};
|
|
8894
8894
|
var createCheckoutStore = (initial = initialSnapshot()) => {
|
|
8895
8895
|
let state = initial;
|
|
8896
|
-
const
|
|
8896
|
+
const listeners42 = /* @__PURE__ */ new Set();
|
|
8897
8897
|
const emit = () => {
|
|
8898
|
-
|
|
8898
|
+
listeners42.forEach((listener) => listener(state));
|
|
8899
8899
|
};
|
|
8900
8900
|
const store = {
|
|
8901
8901
|
progress: {},
|
|
@@ -8908,9 +8908,9 @@ var createCheckoutStore = (initial = initialSnapshot()) => {
|
|
|
8908
8908
|
emit();
|
|
8909
8909
|
},
|
|
8910
8910
|
subscribe: (listener) => {
|
|
8911
|
-
|
|
8911
|
+
listeners42.add(listener);
|
|
8912
8912
|
return () => {
|
|
8913
|
-
|
|
8913
|
+
listeners42.delete(listener);
|
|
8914
8914
|
};
|
|
8915
8915
|
},
|
|
8916
8916
|
reset: () => {
|
|
@@ -14388,8 +14388,8 @@ var withCheckoutStart = async (lock2, scope, work) => {
|
|
|
14388
14388
|
var createCardOwnership = () => {
|
|
14389
14389
|
const registered = [];
|
|
14390
14390
|
let chosen = null;
|
|
14391
|
-
const
|
|
14392
|
-
const emit = () =>
|
|
14391
|
+
const listeners42 = /* @__PURE__ */ new Set();
|
|
14392
|
+
const emit = () => listeners42.forEach((listener) => listener());
|
|
14393
14393
|
return {
|
|
14394
14394
|
register: (id2) => {
|
|
14395
14395
|
if (!chosen && registered.length === 1 && registered[0] !== id2)
|
|
@@ -14414,8 +14414,8 @@ var createCardOwnership = () => {
|
|
|
14414
14414
|
// single section never flashes "Continue paying here" while it mounts.
|
|
14415
14415
|
owns: (id2) => registered.includes(id2) ? chosen ? chosen === id2 : registered.every((other) => other === id2) : registered.length === 0,
|
|
14416
14416
|
subscribe: (listener) => {
|
|
14417
|
-
|
|
14418
|
-
return () =>
|
|
14417
|
+
listeners42.add(listener);
|
|
14418
|
+
return () => listeners42.delete(listener);
|
|
14419
14419
|
}
|
|
14420
14420
|
};
|
|
14421
14421
|
};
|
|
@@ -14496,8 +14496,8 @@ var gateCheckoutActions = (actions, gateway, holder) => {
|
|
|
14496
14496
|
};
|
|
14497
14497
|
var createConfirmerGateway = (lock2, scope) => {
|
|
14498
14498
|
let current5 = null;
|
|
14499
|
-
const
|
|
14500
|
-
const emit = () =>
|
|
14499
|
+
const listeners42 = /* @__PURE__ */ new Set();
|
|
14500
|
+
const emit = () => listeners42.forEach((listener) => listener());
|
|
14501
14501
|
const held = async (release, holder, work) => {
|
|
14502
14502
|
current5 = holder;
|
|
14503
14503
|
emit();
|
|
@@ -14527,9 +14527,9 @@ var createConfirmerGateway = (lock2, scope) => {
|
|
|
14527
14527
|
},
|
|
14528
14528
|
holder: () => current5,
|
|
14529
14529
|
subscribe: (listener) => {
|
|
14530
|
-
|
|
14530
|
+
listeners42.add(listener);
|
|
14531
14531
|
return () => {
|
|
14532
|
-
|
|
14532
|
+
listeners42.delete(listener);
|
|
14533
14533
|
};
|
|
14534
14534
|
}
|
|
14535
14535
|
};
|
|
@@ -14600,8 +14600,8 @@ var createPaymentMarks = () => {
|
|
|
14600
14600
|
let marks = {};
|
|
14601
14601
|
let details = {};
|
|
14602
14602
|
const live = /* @__PURE__ */ new Set();
|
|
14603
|
-
const
|
|
14604
|
-
const emit = () =>
|
|
14603
|
+
const listeners42 = /* @__PURE__ */ new Set();
|
|
14604
|
+
const emit = () => listeners42.forEach((listener) => listener());
|
|
14605
14605
|
const state = (ticketHash, owner) => {
|
|
14606
14606
|
const by = marks[ticketHash];
|
|
14607
14607
|
if (!by) return "none";
|
|
@@ -14638,9 +14638,9 @@ var createPaymentMarks = () => {
|
|
|
14638
14638
|
emit();
|
|
14639
14639
|
},
|
|
14640
14640
|
subscribe: (listener) => {
|
|
14641
|
-
|
|
14641
|
+
listeners42.add(listener);
|
|
14642
14642
|
return () => {
|
|
14643
|
-
|
|
14643
|
+
listeners42.delete(listener);
|
|
14644
14644
|
};
|
|
14645
14645
|
}
|
|
14646
14646
|
};
|
|
@@ -15336,8 +15336,8 @@ var bindAppCheckoutEngine = (engine) => {
|
|
|
15336
15336
|
);
|
|
15337
15337
|
};
|
|
15338
15338
|
var ttfKeys = {
|
|
15339
|
-
trips: (
|
|
15340
|
-
trip: (
|
|
15339
|
+
trips: (accountKey2, query) => ["ttf", "trips", accountKey2, query],
|
|
15340
|
+
trip: (accountKey2, eventId, query) => ["ttf", "trip", accountKey2, eventId, query],
|
|
15341
15341
|
profile: ["ttf", "profile"],
|
|
15342
15342
|
countries: ["ttf", "countries"],
|
|
15343
15343
|
states: (countryId) => ["ttf", "states", countryId],
|
|
@@ -17874,22 +17874,22 @@ var useWaiverSigning = (eventId, waiver, attach, hold) => {
|
|
|
17874
17874
|
sign
|
|
17875
17875
|
};
|
|
17876
17876
|
};
|
|
17877
|
-
var useTrips = (
|
|
17877
|
+
var useTrips = (accountKey2, query = {}, options) => {
|
|
17878
17878
|
var _a2;
|
|
17879
17879
|
return useSessionQuery({
|
|
17880
17880
|
...options,
|
|
17881
|
-
queryKey: ttfKeys.trips(
|
|
17881
|
+
queryKey: ttfKeys.trips(accountKey2 != null ? accountKey2 : "", query),
|
|
17882
17882
|
queryFn: () => ttf.trips.list(query),
|
|
17883
|
-
enabled:
|
|
17883
|
+
enabled: accountKey2 ? (_a2 = options == null ? void 0 : options.enabled) != null ? _a2 : true : false
|
|
17884
17884
|
});
|
|
17885
17885
|
};
|
|
17886
|
-
var useTrip = (
|
|
17886
|
+
var useTrip = (accountKey2, eventId, query = {}, options) => {
|
|
17887
17887
|
var _a2;
|
|
17888
17888
|
return useSessionQuery({
|
|
17889
17889
|
...options,
|
|
17890
|
-
queryKey: ttfKeys.trip(
|
|
17890
|
+
queryKey: ttfKeys.trip(accountKey2 != null ? accountKey2 : "", eventId != null ? eventId : "", query),
|
|
17891
17891
|
queryFn: () => ttf.trips.get(eventId, query),
|
|
17892
|
-
enabled:
|
|
17892
|
+
enabled: accountKey2 && eventId ? (_a2 = options == null ? void 0 : options.enabled) != null ? _a2 : true : false
|
|
17893
17893
|
});
|
|
17894
17894
|
};
|
|
17895
17895
|
var useCheckoutPhoneIdentity = (options) => {
|
|
@@ -24010,6 +24010,9 @@ var translateAccountMessage = (translate2, english, vars) => {
|
|
|
24010
24010
|
return english.replace(/\{\{\s*(\w+)\s*\}\}/g, (whole, name) => (vars == null ? void 0 : vars[name]) === void 0 ? whole : String(vars[name]));
|
|
24011
24011
|
};
|
|
24012
24012
|
|
|
24013
|
+
// src/useCheckout.ts
|
|
24014
|
+
var import_react46 = require("react");
|
|
24015
|
+
|
|
24013
24016
|
// src/CardInput.tsx
|
|
24014
24017
|
var import_react45 = require("react");
|
|
24015
24018
|
var import_react_native4 = require("react-native");
|
|
@@ -24527,7 +24530,10 @@ var getQueryClient = () => {
|
|
|
24527
24530
|
}
|
|
24528
24531
|
return sharedQueryClient;
|
|
24529
24532
|
};
|
|
24530
|
-
var CheckoutThemeProvider = ({
|
|
24533
|
+
var CheckoutThemeProvider = ({
|
|
24534
|
+
theme,
|
|
24535
|
+
children
|
|
24536
|
+
}) => {
|
|
24531
24537
|
const resolved = (0, import_react44.useMemo)(() => resolveTheme(theme), [theme]);
|
|
24532
24538
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeCtx.Provider, { value: resolved, children });
|
|
24533
24539
|
};
|
|
@@ -24550,7 +24556,8 @@ var SelfProvidedCheckout = ({
|
|
|
24550
24556
|
const { providerPage, page: page2 } = useProviderPages();
|
|
24551
24557
|
const checkout = useCheckout2({
|
|
24552
24558
|
ports: { onInstallmentOffers, providerPage },
|
|
24553
|
-
options: rest.options
|
|
24559
|
+
options: rest.options,
|
|
24560
|
+
paymentSheet: rest.paymentSheet
|
|
24554
24561
|
});
|
|
24555
24562
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckoutRoot, { checkout, ...rest, children: [
|
|
24556
24563
|
children,
|
|
@@ -24652,6 +24659,107 @@ var styles2 = import_react_native4.StyleSheet.create({
|
|
|
24652
24659
|
// src/confirmer.ts
|
|
24653
24660
|
var import_react_native5 = require("react-native");
|
|
24654
24661
|
var import_stripe_react_native2 = require("@stripe/stripe-react-native");
|
|
24662
|
+
|
|
24663
|
+
// src/paymentSheet.ts
|
|
24664
|
+
var nativePaymentSheetAvailable = (snapshot) => {
|
|
24665
|
+
var _a2;
|
|
24666
|
+
return snapshot.gateway === "stripe_payment_intents" && typeof ((_a2 = snapshot.breakdown) == null ? void 0 : _a2.currencyCode) === "string" && /^[A-Z]{3}$/.test(snapshot.breakdown.currencyCode) && snapshot.breakdown.currencyCode !== "MXN";
|
|
24667
|
+
};
|
|
24668
|
+
var NATIVE_SHEET_CARD_FIELD_REQUIRED = "NATIVE_SHEET_CARD_FIELD_REQUIRED";
|
|
24669
|
+
var NATIVE_SHEET_CARD_FIELD_MESSAGE = "Enter your card details below, then select Pay to continue.";
|
|
24670
|
+
var NATIVE_SHEET_REVIEW_REQUIRED = "The original payment details changed. Review this order before paying.";
|
|
24671
|
+
var nativeSheetIntentIdentity = (intent, intentId, reviewed) => {
|
|
24672
|
+
if (!intent || typeof intent !== "object" || !reviewed || !Number.isSafeInteger(reviewed.amountMinor) || reviewed.amountMinor <= 0 || !/^[A-Z]{3}$/.test(reviewed.currency))
|
|
24673
|
+
return false;
|
|
24674
|
+
const own = (key5) => {
|
|
24675
|
+
var _a2;
|
|
24676
|
+
return (_a2 = Object.getOwnPropertyDescriptor(intent, key5)) == null ? void 0 : _a2.value;
|
|
24677
|
+
};
|
|
24678
|
+
const amount2 = own("amount");
|
|
24679
|
+
const currency = own("currency");
|
|
24680
|
+
return own("id") === intentId && Number.isSafeInteger(amount2) && amount2 === reviewed.amountMinor && typeof currency === "string" && /^[A-Za-z]{3}$/.test(currency) && currency.toUpperCase() === reviewed.currency;
|
|
24681
|
+
};
|
|
24682
|
+
var nativeSheetCardMethods = (intent) => {
|
|
24683
|
+
var _a2;
|
|
24684
|
+
if (!intent || typeof intent !== "object") return false;
|
|
24685
|
+
const methods = (_a2 = Object.getOwnPropertyDescriptor(intent, "paymentMethodTypes")) == null ? void 0 : _a2.value;
|
|
24686
|
+
return Array.isArray(methods) && methods.length === 1 && methods[0] === "card";
|
|
24687
|
+
};
|
|
24688
|
+
var createPaymentSheetConfirmation = (sdk, options) => {
|
|
24689
|
+
let active2 = false;
|
|
24690
|
+
const assertAfterPresentation = () => {
|
|
24691
|
+
try {
|
|
24692
|
+
options.assertCurrent();
|
|
24693
|
+
} catch (e) {
|
|
24694
|
+
throw paymentProviderError("The original payment owner changed.", "unknown");
|
|
24695
|
+
}
|
|
24696
|
+
};
|
|
24697
|
+
return async (clientSecret, billing) => {
|
|
24698
|
+
var _a2;
|
|
24699
|
+
if (active2)
|
|
24700
|
+
throw paymentProviderError("Another payment sheet is active.", "notStarted");
|
|
24701
|
+
const intentId = (_a2 = /^(pi_[A-Za-z0-9]+)_secret_[A-Za-z0-9]+$/.exec(clientSecret)) == null ? void 0 : _a2[1];
|
|
24702
|
+
if (!intentId || !options.merchantDisplayName.trim() || !options.returnURL)
|
|
24703
|
+
throw paymentProviderError("Payment sheet details are unavailable.", "notStarted");
|
|
24704
|
+
options.assertCurrent();
|
|
24705
|
+
active2 = true;
|
|
24706
|
+
try {
|
|
24707
|
+
const before = await sdk.retrievePaymentIntent(clientSecret);
|
|
24708
|
+
options.assertCurrent();
|
|
24709
|
+
const requireAdmittedIntent = (result4) => {
|
|
24710
|
+
if (result4.error || !nativeSheetIntentIdentity(result4.paymentIntent, intentId, options.reviewed))
|
|
24711
|
+
throw paymentProviderError(NATIVE_SHEET_REVIEW_REQUIRED, "notStarted");
|
|
24712
|
+
if (!nativeSheetCardMethods(result4.paymentIntent))
|
|
24713
|
+
throw paymentProviderError(NATIVE_SHEET_CARD_FIELD_MESSAGE, "notStarted", {
|
|
24714
|
+
code: NATIVE_SHEET_CARD_FIELD_REQUIRED
|
|
24715
|
+
});
|
|
24716
|
+
};
|
|
24717
|
+
requireAdmittedIntent(before);
|
|
24718
|
+
if (CONFIRMED_INTENT_STATUSES.includes(before.paymentIntent.status))
|
|
24719
|
+
return confirmedStripeIntentStatus(before.paymentIntent);
|
|
24720
|
+
const initialized = await sdk.initPaymentSheet({
|
|
24721
|
+
paymentIntentClientSecret: clientSecret,
|
|
24722
|
+
merchantDisplayName: options.merchantDisplayName,
|
|
24723
|
+
returnURL: options.returnURL,
|
|
24724
|
+
defaultBillingDetails: billing,
|
|
24725
|
+
customFlow: false,
|
|
24726
|
+
allowsDelayedPaymentMethods: false,
|
|
24727
|
+
// Stripe decides whether the original account/session supports card-mode
|
|
24728
|
+
// Link. This preference does not add an explicit Link/non-card PI type.
|
|
24729
|
+
link: { display: sdk.LinkDisplay.AUTOMATIC }
|
|
24730
|
+
});
|
|
24731
|
+
if (initialized.error)
|
|
24732
|
+
throw paymentProviderError(NATIVE_SHEET_CARD_FIELD_MESSAGE, "notStarted", {
|
|
24733
|
+
code: NATIVE_SHEET_CARD_FIELD_REQUIRED
|
|
24734
|
+
});
|
|
24735
|
+
options.assertCurrent();
|
|
24736
|
+
const ready = await sdk.retrievePaymentIntent(clientSecret);
|
|
24737
|
+
options.assertCurrent();
|
|
24738
|
+
requireAdmittedIntent(ready);
|
|
24739
|
+
if (CONFIRMED_INTENT_STATUSES.includes(ready.paymentIntent.status))
|
|
24740
|
+
return confirmedStripeIntentStatus(ready.paymentIntent);
|
|
24741
|
+
const presented = await sdk.presentPaymentSheet();
|
|
24742
|
+
if (presented.error)
|
|
24743
|
+
throw paymentProviderError(
|
|
24744
|
+
presented.error.message || "Payment failed.",
|
|
24745
|
+
nativeStripeErrorOutcome(presented.error)
|
|
24746
|
+
);
|
|
24747
|
+
assertAfterPresentation();
|
|
24748
|
+
const result3 = await sdk.retrievePaymentIntent(clientSecret);
|
|
24749
|
+
if (result3.error || !nativeSheetIntentIdentity(result3.paymentIntent, intentId, options.reviewed) || !nativeSheetCardMethods(result3.paymentIntent))
|
|
24750
|
+
throw paymentProviderError(
|
|
24751
|
+
"The original payment could not be verified.",
|
|
24752
|
+
"unknown"
|
|
24753
|
+
);
|
|
24754
|
+
assertAfterPresentation();
|
|
24755
|
+
return confirmedStripeIntentStatus(result3.paymentIntent);
|
|
24756
|
+
} finally {
|
|
24757
|
+
active2 = false;
|
|
24758
|
+
}
|
|
24759
|
+
};
|
|
24760
|
+
};
|
|
24761
|
+
|
|
24762
|
+
// src/confirmer.ts
|
|
24655
24763
|
var toBillingDetails = (billing) => ({
|
|
24656
24764
|
email: billing.email,
|
|
24657
24765
|
name: `${billing.firstName} ${billing.lastName}`.trim(),
|
|
@@ -24674,23 +24782,169 @@ var stripeFailure = (error, fallback) => {
|
|
|
24674
24782
|
code: (_a2 = error.stripeErrorCode) != null ? _a2 : error.code
|
|
24675
24783
|
});
|
|
24676
24784
|
};
|
|
24785
|
+
var initKey = null;
|
|
24786
|
+
var accountKey = null;
|
|
24787
|
+
var listeners4 = /* @__PURE__ */ new Set();
|
|
24788
|
+
var initializedScheme;
|
|
24789
|
+
var initializing = false;
|
|
24790
|
+
var sheetPresenting = false;
|
|
24791
|
+
var nativeOperationActive = false;
|
|
24792
|
+
var sheetOwner = null;
|
|
24793
|
+
var assertNativeLeaseFree = () => {
|
|
24794
|
+
if (sheetOwner || initializing || nativeOperationActive)
|
|
24795
|
+
throw paymentProviderError(
|
|
24796
|
+
"The payment SDK is owned by another operation.",
|
|
24797
|
+
"notStarted"
|
|
24798
|
+
);
|
|
24799
|
+
};
|
|
24800
|
+
var nativeSdkCall = async (operation) => {
|
|
24801
|
+
assertNativeLeaseFree();
|
|
24802
|
+
nativeOperationActive = true;
|
|
24803
|
+
try {
|
|
24804
|
+
return await operation();
|
|
24805
|
+
} finally {
|
|
24806
|
+
nativeOperationActive = false;
|
|
24807
|
+
}
|
|
24808
|
+
};
|
|
24677
24809
|
var createRnStripeConfirmer = () => {
|
|
24678
|
-
|
|
24679
|
-
let accountKey = null;
|
|
24680
|
-
const listeners4 = /* @__PURE__ */ new Set();
|
|
24681
|
-
return {
|
|
24810
|
+
const adapter = {
|
|
24682
24811
|
init: async ({ publishableKey, accountId, merchantIdentifier, urlScheme }) => {
|
|
24683
|
-
const key5 =
|
|
24684
|
-
if (initKey === key5) return;
|
|
24685
|
-
await (0, import_stripe_react_native2.initStripe)({
|
|
24812
|
+
const key5 = JSON.stringify([
|
|
24686
24813
|
publishableKey,
|
|
24687
|
-
|
|
24688
|
-
|
|
24689
|
-
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24814
|
+
accountId != null ? accountId : null,
|
|
24815
|
+
merchantIdentifier != null ? merchantIdentifier : null,
|
|
24816
|
+
urlScheme != null ? urlScheme : null
|
|
24817
|
+
]);
|
|
24818
|
+
if (initializing || sheetOwner && sheetOwner.key !== key5)
|
|
24819
|
+
throw paymentProviderError(
|
|
24820
|
+
"The payment SDK is owned by another operation.",
|
|
24821
|
+
"notStarted"
|
|
24822
|
+
);
|
|
24823
|
+
if (initKey === key5) return;
|
|
24824
|
+
if (nativeOperationActive)
|
|
24825
|
+
throw paymentProviderError(
|
|
24826
|
+
"The payment SDK is owned by another operation.",
|
|
24827
|
+
"notStarted"
|
|
24828
|
+
);
|
|
24829
|
+
initializing = true;
|
|
24830
|
+
initKey = null;
|
|
24831
|
+
accountKey = null;
|
|
24832
|
+
initializedScheme = void 0;
|
|
24833
|
+
try {
|
|
24834
|
+
await (0, import_stripe_react_native2.initStripe)({
|
|
24835
|
+
publishableKey,
|
|
24836
|
+
...accountId ? { stripeAccountId: accountId } : {},
|
|
24837
|
+
...merchantIdentifier ? { merchantIdentifier } : {},
|
|
24838
|
+
...urlScheme ? { urlScheme } : {}
|
|
24839
|
+
});
|
|
24840
|
+
initKey = key5;
|
|
24841
|
+
initializedScheme = urlScheme;
|
|
24842
|
+
accountKey = `${publishableKey}:${accountId != null ? accountId : ""}`;
|
|
24843
|
+
listeners4.forEach((listener) => listener());
|
|
24844
|
+
} finally {
|
|
24845
|
+
initializing = false;
|
|
24846
|
+
}
|
|
24847
|
+
},
|
|
24848
|
+
createPaymentSheetSession: (options) => {
|
|
24849
|
+
let running = false;
|
|
24850
|
+
let owner = null;
|
|
24851
|
+
let requiresCardField = false;
|
|
24852
|
+
let reviewed;
|
|
24853
|
+
return {
|
|
24854
|
+
requiresCardField: () => requiresCardField,
|
|
24855
|
+
cardFieldOperation: async (operation) => {
|
|
24856
|
+
if (running) {
|
|
24857
|
+
requiresCardField = true;
|
|
24858
|
+
throw paymentProviderError("Use the card form for this order.", "notStarted");
|
|
24859
|
+
}
|
|
24860
|
+
return operation();
|
|
24861
|
+
},
|
|
24862
|
+
confirmer: {
|
|
24863
|
+
...adapter,
|
|
24864
|
+
prepareCardPayment: async (context) => {
|
|
24865
|
+
if (!running) return;
|
|
24866
|
+
reviewed = stripeElementsPaymentContext(
|
|
24867
|
+
context == null ? void 0 : context.amountMinor,
|
|
24868
|
+
context == null ? void 0 : context.currency
|
|
24869
|
+
);
|
|
24870
|
+
if (!reviewed || !owner || sheetOwner !== owner) {
|
|
24871
|
+
throw paymentProviderError(NATIVE_SHEET_REVIEW_REQUIRED, "notStarted");
|
|
24872
|
+
}
|
|
24873
|
+
},
|
|
24874
|
+
confirmCard: async (clientSecret, billing) => {
|
|
24875
|
+
if (!running) return adapter.confirmCard(clientSecret, billing);
|
|
24876
|
+
if (requiresCardField)
|
|
24877
|
+
throw paymentProviderError(
|
|
24878
|
+
"Use the card form for this order.",
|
|
24879
|
+
"notStarted"
|
|
24880
|
+
);
|
|
24881
|
+
if (!owner || sheetOwner !== owner)
|
|
24882
|
+
throw paymentProviderError(
|
|
24883
|
+
"The payment sheet was not claimed.",
|
|
24884
|
+
"notStarted"
|
|
24885
|
+
);
|
|
24886
|
+
{
|
|
24887
|
+
if (sheetPresenting)
|
|
24888
|
+
throw paymentProviderError(
|
|
24889
|
+
"Another payment sheet is active.",
|
|
24890
|
+
"notStarted"
|
|
24891
|
+
);
|
|
24892
|
+
const confirm = createPaymentSheetConfirmation(
|
|
24893
|
+
{
|
|
24894
|
+
initPaymentSheet: import_stripe_react_native2.initPaymentSheet,
|
|
24895
|
+
presentPaymentSheet: import_stripe_react_native2.presentPaymentSheet,
|
|
24896
|
+
retrievePaymentIntent: import_stripe_react_native2.retrievePaymentIntent,
|
|
24897
|
+
LinkDisplay: import_stripe_react_native2.LinkDisplay
|
|
24898
|
+
},
|
|
24899
|
+
{
|
|
24900
|
+
...owner.options,
|
|
24901
|
+
reviewed,
|
|
24902
|
+
assertCurrent: () => {
|
|
24903
|
+
if (sheetOwner !== owner || initKey !== owner.key || initializing)
|
|
24904
|
+
throw paymentProviderError(
|
|
24905
|
+
"The original payment owner changed.",
|
|
24906
|
+
"notStarted"
|
|
24907
|
+
);
|
|
24908
|
+
}
|
|
24909
|
+
}
|
|
24910
|
+
);
|
|
24911
|
+
sheetPresenting = true;
|
|
24912
|
+
try {
|
|
24913
|
+
return await confirm(clientSecret, toBillingDetails(billing));
|
|
24914
|
+
} catch (error) {
|
|
24915
|
+
if ((error == null ? void 0 : error.providerCode) === NATIVE_SHEET_CARD_FIELD_REQUIRED)
|
|
24916
|
+
requiresCardField = true;
|
|
24917
|
+
throw error;
|
|
24918
|
+
} finally {
|
|
24919
|
+
sheetPresenting = false;
|
|
24920
|
+
}
|
|
24921
|
+
}
|
|
24922
|
+
}
|
|
24923
|
+
},
|
|
24924
|
+
run: async (operation) => {
|
|
24925
|
+
if (running)
|
|
24926
|
+
throw paymentProviderError("This payment is already active.", "notStarted");
|
|
24927
|
+
running = true;
|
|
24928
|
+
reviewed = void 0;
|
|
24929
|
+
let admitted = true;
|
|
24930
|
+
const claim = () => {
|
|
24931
|
+
if (!admitted || nativeOperationActive || initializing || !initKey || sheetOwner || !initializedScheme || options.returnURL !== `${initializedScheme}://stripe-redirect` || !options.merchantDisplayName.trim())
|
|
24932
|
+
return "unavailable";
|
|
24933
|
+
owner = { key: initKey, options: { ...options } };
|
|
24934
|
+
sheetOwner = owner;
|
|
24935
|
+
return "attached";
|
|
24936
|
+
};
|
|
24937
|
+
try {
|
|
24938
|
+
return await operation(claim);
|
|
24939
|
+
} finally {
|
|
24940
|
+
admitted = false;
|
|
24941
|
+
if (owner && sheetOwner === owner) sheetOwner = null;
|
|
24942
|
+
owner = null;
|
|
24943
|
+
reviewed = void 0;
|
|
24944
|
+
running = false;
|
|
24945
|
+
}
|
|
24946
|
+
}
|
|
24947
|
+
};
|
|
24694
24948
|
},
|
|
24695
24949
|
// `publishableKey:accountId`, the shape `bundleConfirmerKey` expects.
|
|
24696
24950
|
currentKey: () => accountKey,
|
|
@@ -24702,19 +24956,25 @@ var createRnStripeConfirmer = () => {
|
|
|
24702
24956
|
},
|
|
24703
24957
|
// Native statuses are already the port's PascalCase vocabulary — no normalize.
|
|
24704
24958
|
getIntentStatus: async (clientSecret) => {
|
|
24705
|
-
|
|
24959
|
+
assertNativeLeaseFree();
|
|
24960
|
+
const { paymentIntent } = await nativeSdkCall(
|
|
24961
|
+
() => (0, import_stripe_react_native2.retrievePaymentIntent)(clientSecret)
|
|
24962
|
+
);
|
|
24706
24963
|
return paymentIntent == null ? void 0 : paymentIntent.status;
|
|
24707
24964
|
},
|
|
24708
24965
|
confirmCard: async (clientSecret, billing) => {
|
|
24709
|
-
|
|
24710
|
-
|
|
24711
|
-
|
|
24712
|
-
|
|
24966
|
+
assertNativeLeaseFree();
|
|
24967
|
+
const { error, paymentIntent } = await nativeSdkCall(
|
|
24968
|
+
() => (0, import_stripe_react_native2.confirmPayment)(clientSecret, {
|
|
24969
|
+
paymentMethodType: "Card",
|
|
24970
|
+
paymentMethodData: { billingDetails: toBillingDetails(billing) }
|
|
24971
|
+
})
|
|
24972
|
+
);
|
|
24713
24973
|
if (error) throw stripeFailure(error, "Payment failed.");
|
|
24714
24974
|
return confirmedStripeIntentStatus(paymentIntent);
|
|
24715
24975
|
},
|
|
24716
24976
|
confirmApplePay: async (clientSecret, total, currencyCode, merchant) => {
|
|
24717
|
-
|
|
24977
|
+
assertNativeLeaseFree();
|
|
24718
24978
|
const context = stripeWalletPaymentContext(
|
|
24719
24979
|
total,
|
|
24720
24980
|
currencyCode,
|
|
@@ -24725,24 +24985,29 @@ var createRnStripeConfirmer = () => {
|
|
|
24725
24985
|
"The order wallet details are unavailable.",
|
|
24726
24986
|
"notStarted"
|
|
24727
24987
|
);
|
|
24728
|
-
const { error, paymentIntent } = await (
|
|
24729
|
-
|
|
24730
|
-
|
|
24731
|
-
|
|
24732
|
-
|
|
24733
|
-
|
|
24734
|
-
|
|
24735
|
-
|
|
24736
|
-
|
|
24988
|
+
const { error, paymentIntent } = await nativeSdkCall(
|
|
24989
|
+
() => {
|
|
24990
|
+
var _a2;
|
|
24991
|
+
return (0, import_stripe_react_native2.confirmPlatformPayPayment)(clientSecret, {
|
|
24992
|
+
applePay: {
|
|
24993
|
+
merchantCountryCode: context.merchantCountry,
|
|
24994
|
+
currencyCode: context.currency,
|
|
24995
|
+
cartItems: [
|
|
24996
|
+
{
|
|
24997
|
+
label: (_a2 = merchant.merchantName) != null ? _a2 : "Order",
|
|
24998
|
+
amount: context.amount,
|
|
24999
|
+
paymentType: import_stripe_react_native2.PlatformPay.PaymentType.Immediate
|
|
25000
|
+
}
|
|
25001
|
+
]
|
|
24737
25002
|
}
|
|
24738
|
-
|
|
25003
|
+
});
|
|
24739
25004
|
}
|
|
24740
|
-
|
|
25005
|
+
);
|
|
24741
25006
|
if (error) throw stripeFailure(error, "Apple Pay failed.");
|
|
24742
25007
|
return confirmedStripeIntentStatus(paymentIntent);
|
|
24743
25008
|
},
|
|
24744
25009
|
confirmGooglePay: async (clientSecret, total, currencyCode, merchant) => {
|
|
24745
|
-
|
|
25010
|
+
assertNativeLeaseFree();
|
|
24746
25011
|
const context = stripeWalletPaymentContext(
|
|
24747
25012
|
total,
|
|
24748
25013
|
currencyCode,
|
|
@@ -24753,88 +25018,118 @@ var createRnStripeConfirmer = () => {
|
|
|
24753
25018
|
"The order wallet details are unavailable.",
|
|
24754
25019
|
"notStarted"
|
|
24755
25020
|
);
|
|
24756
|
-
const { error, paymentIntent } = await (
|
|
24757
|
-
|
|
24758
|
-
|
|
24759
|
-
|
|
24760
|
-
|
|
24761
|
-
|
|
25021
|
+
const { error, paymentIntent } = await nativeSdkCall(
|
|
25022
|
+
() => {
|
|
25023
|
+
var _a2;
|
|
25024
|
+
return (0, import_stripe_react_native2.confirmPlatformPayPayment)(clientSecret, {
|
|
25025
|
+
googlePay: {
|
|
25026
|
+
testEnv: merchant.testEnv === true,
|
|
25027
|
+
merchantCountryCode: context.merchantCountry,
|
|
25028
|
+
currencyCode: context.currency,
|
|
25029
|
+
merchantName: (_a2 = merchant.merchantName) != null ? _a2 : "Order"
|
|
25030
|
+
}
|
|
25031
|
+
});
|
|
24762
25032
|
}
|
|
24763
|
-
|
|
25033
|
+
);
|
|
24764
25034
|
if (error) throw stripeFailure(error, "Google Pay failed.");
|
|
24765
25035
|
return confirmedStripeIntentStatus(paymentIntent);
|
|
24766
25036
|
}
|
|
24767
25037
|
};
|
|
25038
|
+
return adapter;
|
|
24768
25039
|
};
|
|
24769
25040
|
var createRnPorts = () => ({
|
|
24770
25041
|
// The promise is handed back: a URL the device cannot open rejects, and the
|
|
24771
25042
|
// caller shows its failure (for example "We could not open the payment page").
|
|
24772
25043
|
openUrl: (url2) => import_react_native5.Linking.openURL(url2).then(() => void 0),
|
|
24773
25044
|
createCardPaymentMethod: async (billing) => {
|
|
24774
|
-
|
|
24775
|
-
|
|
24776
|
-
|
|
24777
|
-
|
|
25045
|
+
assertNativeLeaseFree();
|
|
25046
|
+
const { paymentMethod, error } = await nativeSdkCall(
|
|
25047
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25048
|
+
paymentMethodType: "Card",
|
|
25049
|
+
paymentMethodData: { billingDetails: toBillingDetails(billing) }
|
|
25050
|
+
})
|
|
25051
|
+
);
|
|
24778
25052
|
if (error || !(paymentMethod == null ? void 0 : paymentMethod.id)) throw failed(error == null ? void 0 : error.message, "Payment failed");
|
|
24779
25053
|
return paymentMethod.id;
|
|
24780
25054
|
},
|
|
24781
25055
|
createRedirectPaymentMethod: async (methodType, billing) => {
|
|
24782
25056
|
var _a2, _b;
|
|
25057
|
+
assertNativeLeaseFree();
|
|
24783
25058
|
const details = toBillingDetails(billing);
|
|
24784
25059
|
const result3 = await (() => {
|
|
24785
25060
|
switch (methodType) {
|
|
24786
25061
|
case "klarna":
|
|
24787
|
-
return (
|
|
24788
|
-
|
|
24789
|
-
|
|
24790
|
-
|
|
25062
|
+
return nativeSdkCall(
|
|
25063
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25064
|
+
paymentMethodType: "Klarna",
|
|
25065
|
+
paymentMethodData: { billingDetails: details }
|
|
25066
|
+
})
|
|
25067
|
+
);
|
|
24791
25068
|
case "afterpay_clearpay":
|
|
24792
|
-
return (
|
|
24793
|
-
|
|
24794
|
-
|
|
24795
|
-
|
|
25069
|
+
return nativeSdkCall(
|
|
25070
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25071
|
+
paymentMethodType: "AfterpayClearpay",
|
|
25072
|
+
paymentMethodData: { billingDetails: details, shippingDetails: details }
|
|
25073
|
+
})
|
|
25074
|
+
);
|
|
24796
25075
|
case "affirm":
|
|
24797
|
-
return (
|
|
24798
|
-
|
|
24799
|
-
|
|
24800
|
-
|
|
25076
|
+
return nativeSdkCall(
|
|
25077
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25078
|
+
paymentMethodType: "Affirm",
|
|
25079
|
+
paymentMethodData: { billingDetails: details }
|
|
25080
|
+
})
|
|
25081
|
+
);
|
|
24801
25082
|
case "ideal":
|
|
24802
|
-
return (
|
|
24803
|
-
|
|
24804
|
-
|
|
24805
|
-
|
|
25083
|
+
return nativeSdkCall(
|
|
25084
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25085
|
+
paymentMethodType: "Ideal",
|
|
25086
|
+
paymentMethodData: { billingDetails: details }
|
|
25087
|
+
})
|
|
25088
|
+
);
|
|
24806
25089
|
case "bancontact":
|
|
24807
|
-
return (
|
|
24808
|
-
|
|
24809
|
-
|
|
24810
|
-
|
|
25090
|
+
return nativeSdkCall(
|
|
25091
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25092
|
+
paymentMethodType: "Bancontact",
|
|
25093
|
+
paymentMethodData: { billingDetails: details }
|
|
25094
|
+
})
|
|
25095
|
+
);
|
|
24811
25096
|
case "eps":
|
|
24812
|
-
return (
|
|
24813
|
-
|
|
24814
|
-
|
|
24815
|
-
|
|
25097
|
+
return nativeSdkCall(
|
|
25098
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25099
|
+
paymentMethodType: "Eps",
|
|
25100
|
+
paymentMethodData: { billingDetails: details }
|
|
25101
|
+
})
|
|
25102
|
+
);
|
|
24816
25103
|
case "p24":
|
|
24817
|
-
return (
|
|
24818
|
-
|
|
24819
|
-
|
|
24820
|
-
|
|
25104
|
+
return nativeSdkCall(
|
|
25105
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25106
|
+
paymentMethodType: "P24",
|
|
25107
|
+
paymentMethodData: { billingDetails: details }
|
|
25108
|
+
})
|
|
25109
|
+
);
|
|
24821
25110
|
case "alipay":
|
|
24822
|
-
return (0, import_stripe_react_native2.createPaymentMethod)({ paymentMethodType: "Alipay" });
|
|
25111
|
+
return nativeSdkCall(() => (0, import_stripe_react_native2.createPaymentMethod)({ paymentMethodType: "Alipay" }));
|
|
24823
25112
|
case "grabpay":
|
|
24824
|
-
return (
|
|
24825
|
-
|
|
24826
|
-
|
|
24827
|
-
|
|
25113
|
+
return nativeSdkCall(
|
|
25114
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25115
|
+
paymentMethodType: "GrabPay",
|
|
25116
|
+
paymentMethodData: { billingDetails: details }
|
|
25117
|
+
})
|
|
25118
|
+
);
|
|
24828
25119
|
case "cashapp":
|
|
24829
|
-
return (
|
|
24830
|
-
|
|
24831
|
-
|
|
24832
|
-
|
|
25120
|
+
return nativeSdkCall(
|
|
25121
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25122
|
+
paymentMethodType: "CashApp",
|
|
25123
|
+
paymentMethodData: { billingDetails: details }
|
|
25124
|
+
})
|
|
25125
|
+
);
|
|
24833
25126
|
case "paypal":
|
|
24834
|
-
return (
|
|
24835
|
-
|
|
24836
|
-
|
|
24837
|
-
|
|
25127
|
+
return nativeSdkCall(
|
|
25128
|
+
() => (0, import_stripe_react_native2.createPaymentMethod)({
|
|
25129
|
+
paymentMethodType: "PayPal",
|
|
25130
|
+
paymentMethodData: { billingDetails: details }
|
|
25131
|
+
})
|
|
25132
|
+
);
|
|
24838
25133
|
default:
|
|
24839
25134
|
throw new Error("This payment method is not available on this device.");
|
|
24840
25135
|
}
|
|
@@ -24844,24 +25139,31 @@ var createRnPorts = () => ({
|
|
|
24844
25139
|
return result3.paymentMethod.id;
|
|
24845
25140
|
},
|
|
24846
25141
|
handleNextAction: async (clientSecret) => {
|
|
24847
|
-
|
|
25142
|
+
assertNativeLeaseFree();
|
|
25143
|
+
const { error } = await nativeSdkCall(() => (0, import_stripe_react_native2.handleNextAction)(clientSecret));
|
|
24848
25144
|
if (error) throw stripeFailure(error, "Payment failed");
|
|
24849
25145
|
},
|
|
24850
25146
|
confirmOxxo: async (clientSecret, billing) => {
|
|
24851
|
-
|
|
24852
|
-
|
|
24853
|
-
|
|
24854
|
-
|
|
25147
|
+
assertNativeLeaseFree();
|
|
25148
|
+
const { error, paymentIntent } = await nativeSdkCall(
|
|
25149
|
+
() => (0, import_stripe_react_native2.confirmPayment)(clientSecret, {
|
|
25150
|
+
paymentMethodType: "Oxxo",
|
|
25151
|
+
paymentMethodData: { billingDetails: toBillingDetails(billing) }
|
|
25152
|
+
})
|
|
25153
|
+
);
|
|
24855
25154
|
return { error: error == null ? void 0 : error.message, nextAction: paymentIntent == null ? void 0 : paymentIntent.nextAction };
|
|
24856
25155
|
},
|
|
24857
25156
|
// Payment plan (new card): confirm the SetupIntent to SAVE the card (nothing
|
|
24858
25157
|
// charged) and return its PaymentMethod id for the server-side plan.
|
|
24859
25158
|
confirmPaymentPlanSetup: async (clientSecret, billing) => {
|
|
24860
25159
|
var _a2;
|
|
24861
|
-
|
|
24862
|
-
|
|
24863
|
-
|
|
24864
|
-
|
|
25160
|
+
assertNativeLeaseFree();
|
|
25161
|
+
const { setupIntent, error } = await nativeSdkCall(
|
|
25162
|
+
() => (0, import_stripe_react_native2.confirmSetupIntent)(clientSecret, {
|
|
25163
|
+
paymentMethodType: "Card",
|
|
25164
|
+
paymentMethodData: { billingDetails: toBillingDetails(billing) }
|
|
25165
|
+
})
|
|
25166
|
+
);
|
|
24865
25167
|
const paymentMethodId = (_a2 = setupIntent == null ? void 0 : setupIntent.paymentMethod) == null ? void 0 : _a2.id;
|
|
24866
25168
|
if (error || !paymentMethodId) throw failed(error == null ? void 0 : error.message, "Card setup failed");
|
|
24867
25169
|
return paymentMethodId;
|
|
@@ -24869,10 +25171,13 @@ var createRnPorts = () => ({
|
|
|
24869
25171
|
// Payment plan (saved-card 3DS): confirm the pending charge against the
|
|
24870
25172
|
// existing PaymentMethod when the plan comes back requires_action.
|
|
24871
25173
|
confirmSavedCardPayment: async (clientSecret, paymentMethodId) => {
|
|
24872
|
-
|
|
24873
|
-
|
|
24874
|
-
|
|
24875
|
-
|
|
25174
|
+
assertNativeLeaseFree();
|
|
25175
|
+
const { error } = await nativeSdkCall(
|
|
25176
|
+
() => (0, import_stripe_react_native2.confirmPayment)(clientSecret, {
|
|
25177
|
+
paymentMethodType: "Card",
|
|
25178
|
+
paymentMethodData: { paymentMethodId }
|
|
25179
|
+
})
|
|
25180
|
+
);
|
|
24876
25181
|
if (error) throw stripeFailure(error, "Payment failed");
|
|
24877
25182
|
}
|
|
24878
25183
|
});
|
|
@@ -24882,11 +25187,61 @@ var rnConfirmer = createRnStripeConfirmer();
|
|
|
24882
25187
|
var rnPorts = createRnPorts();
|
|
24883
25188
|
|
|
24884
25189
|
// src/useCheckout.ts
|
|
24885
|
-
var useCheckout2 = (opts = {}) =>
|
|
24886
|
-
|
|
24887
|
-
|
|
24888
|
-
|
|
24889
|
-
|
|
25190
|
+
var useCheckout2 = (opts = {}) => {
|
|
25191
|
+
var _a2;
|
|
25192
|
+
const [sheetConfig] = (0, import_react46.useState)(
|
|
25193
|
+
() => opts.paymentSheet ? { ...opts.paymentSheet } : void 0
|
|
25194
|
+
);
|
|
25195
|
+
const [sheetScheme] = (0, import_react46.useState)(() => {
|
|
25196
|
+
var _a3;
|
|
25197
|
+
return (_a3 = opts.options) == null ? void 0 : _a3.urlScheme;
|
|
25198
|
+
});
|
|
25199
|
+
const [sheet] = (0, import_react46.useState)(
|
|
25200
|
+
() => sheetConfig ? rnConfirmer.createPaymentSheetSession(sheetConfig) : void 0
|
|
25201
|
+
);
|
|
25202
|
+
const nativePorts = { ...rnPorts, ...opts.ports };
|
|
25203
|
+
const checkout = useCheckout({
|
|
25204
|
+
// A Pay without its own claim uses the default ticket field (`checkout`).
|
|
25205
|
+
ports: {
|
|
25206
|
+
confirmer: (_a2 = sheet == null ? void 0 : sheet.confirmer) != null ? _a2 : rnConfirmer,
|
|
25207
|
+
claimDefaultCardField,
|
|
25208
|
+
...nativePorts,
|
|
25209
|
+
...sheet && nativePorts.createCardPaymentMethod ? {
|
|
25210
|
+
createCardPaymentMethod: (billing) => sheet.cardFieldOperation(
|
|
25211
|
+
() => nativePorts.createCardPaymentMethod(billing)
|
|
25212
|
+
)
|
|
25213
|
+
} : {}
|
|
25214
|
+
},
|
|
25215
|
+
options: opts.options
|
|
25216
|
+
});
|
|
25217
|
+
return {
|
|
25218
|
+
...checkout,
|
|
25219
|
+
paymentSheet: sheet && !sheet.requiresCardField() ? {
|
|
25220
|
+
placeOrder: () => {
|
|
25221
|
+
var _a3, _b, _c, _d;
|
|
25222
|
+
if (sheet.requiresCardField())
|
|
25223
|
+
return Promise.reject(
|
|
25224
|
+
paymentProviderError(NATIVE_SHEET_CARD_FIELD_MESSAGE, "notStarted")
|
|
25225
|
+
);
|
|
25226
|
+
if (!((_a3 = opts.options) == null ? void 0 : _a3.urlScheme) || !(sheetConfig == null ? void 0 : sheetConfig.merchantDisplayName.trim()) || opts.options.urlScheme !== sheetScheme || ((_b = opts.paymentSheet) == null ? void 0 : _b.merchantDisplayName) !== (sheetConfig == null ? void 0 : sheetConfig.merchantDisplayName) || ((_c = opts.paymentSheet) == null ? void 0 : _c.returnURL) !== (sheetConfig == null ? void 0 : sheetConfig.returnURL) || ((_d = opts.paymentSheet) == null ? void 0 : _d.returnURL) !== `${opts.options.urlScheme}://stripe-redirect`)
|
|
25227
|
+
return Promise.reject(
|
|
25228
|
+
paymentProviderError(
|
|
25229
|
+
"The payment return route is not configured.",
|
|
25230
|
+
"notStarted"
|
|
25231
|
+
)
|
|
25232
|
+
);
|
|
25233
|
+
if (!nativePaymentSheetAvailable(checkout.store.getState()))
|
|
25234
|
+
return Promise.reject(
|
|
25235
|
+
paymentProviderError(
|
|
25236
|
+
"Use the installment card form for this currency.",
|
|
25237
|
+
"notStarted"
|
|
25238
|
+
)
|
|
25239
|
+
);
|
|
25240
|
+
return sheet.run((claimCard) => checkout.placeOrder("card", { claimCard }));
|
|
25241
|
+
}
|
|
25242
|
+
} : void 0
|
|
25243
|
+
};
|
|
25244
|
+
};
|
|
24890
25245
|
|
|
24891
25246
|
// src/storage.ts
|
|
24892
25247
|
var import_react_native_mmkv = require("react-native-mmkv");
|
|
@@ -24923,7 +25278,7 @@ var configureCheckout = (config) => configure({
|
|
|
24923
25278
|
});
|
|
24924
25279
|
|
|
24925
25280
|
// src/ui/Field.tsx
|
|
24926
|
-
var
|
|
25281
|
+
var import_react47 = require("react");
|
|
24927
25282
|
var import_react_native6 = require("react-native");
|
|
24928
25283
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
24929
25284
|
var Field = ({ label, error, required, children }) => {
|
|
@@ -24954,7 +25309,7 @@ var Input = ({
|
|
|
24954
25309
|
const editable = editableProp && !frozen;
|
|
24955
25310
|
const theme = useTheme();
|
|
24956
25311
|
const s9 = useFieldStyles(theme);
|
|
24957
|
-
const [focused, setFocused] = (0,
|
|
25312
|
+
const [focused, setFocused] = (0, import_react47.useState)(false);
|
|
24958
25313
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
24959
25314
|
import_react_native6.TextInput,
|
|
24960
25315
|
{
|
|
@@ -25011,7 +25366,7 @@ var Checkbox = ({ checked, onChange, label, invalid: invalid3 = false }) => {
|
|
|
25011
25366
|
}
|
|
25012
25367
|
);
|
|
25013
25368
|
};
|
|
25014
|
-
var useFieldStyles = (theme) => (0,
|
|
25369
|
+
var useFieldStyles = (theme) => (0, import_react47.useMemo)(
|
|
25015
25370
|
() => import_react_native6.StyleSheet.create({
|
|
25016
25371
|
field: { gap: 6 },
|
|
25017
25372
|
label: {
|
|
@@ -25061,7 +25416,7 @@ var useFieldStyles = (theme) => (0, import_react46.useMemo)(
|
|
|
25061
25416
|
);
|
|
25062
25417
|
|
|
25063
25418
|
// src/ui/Select.tsx
|
|
25064
|
-
var
|
|
25419
|
+
var import_react48 = require("react");
|
|
25065
25420
|
var import_react_native7 = require("react-native");
|
|
25066
25421
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
25067
25422
|
function Select({
|
|
@@ -25076,7 +25431,18 @@ function Select({
|
|
|
25076
25431
|
const disabled = disabledProp || frozen;
|
|
25077
25432
|
const theme = useTheme();
|
|
25078
25433
|
const s9 = useSelectStyles(theme);
|
|
25079
|
-
const [open, setOpen] = (0,
|
|
25434
|
+
const [open, setOpen] = (0, import_react48.useState)(false);
|
|
25435
|
+
const interaction = (0, import_react48.useRef)({ disabled, open: false, revision: 0 });
|
|
25436
|
+
interaction.current.disabled = disabled;
|
|
25437
|
+
const revision = interaction.current.revision;
|
|
25438
|
+
const close = (0, import_react48.useCallback)(() => {
|
|
25439
|
+
interaction.current.open = false;
|
|
25440
|
+
interaction.current.revision += 1;
|
|
25441
|
+
setOpen(false);
|
|
25442
|
+
}, []);
|
|
25443
|
+
(0, import_react48.useEffect)(() => {
|
|
25444
|
+
if (disabled && interaction.current.open) close();
|
|
25445
|
+
}, [disabled, close]);
|
|
25080
25446
|
const selected = options.find((o) => o.value === value6);
|
|
25081
25447
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
25082
25448
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
@@ -25084,7 +25450,12 @@ function Select({
|
|
|
25084
25450
|
{
|
|
25085
25451
|
accessibilityRole: "button",
|
|
25086
25452
|
disabled,
|
|
25087
|
-
onPress: () =>
|
|
25453
|
+
onPress: () => {
|
|
25454
|
+
if (interaction.current.disabled) return;
|
|
25455
|
+
interaction.current.open = true;
|
|
25456
|
+
interaction.current.revision += 1;
|
|
25457
|
+
setOpen(true);
|
|
25458
|
+
},
|
|
25088
25459
|
style: [s9.control, invalid3 && s9.controlInvalid, disabled && s9.controlDisabled],
|
|
25089
25460
|
children: [
|
|
25090
25461
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { style: [s9.value, !selected && s9.placeholder], numberOfLines: 1, children: selected ? selected.label : placeholder }),
|
|
@@ -25095,11 +25466,11 @@ function Select({
|
|
|
25095
25466
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
25096
25467
|
import_react_native7.Modal,
|
|
25097
25468
|
{
|
|
25098
|
-
visible: open,
|
|
25469
|
+
visible: open && !disabled,
|
|
25099
25470
|
transparent: true,
|
|
25100
25471
|
animationType: "fade",
|
|
25101
|
-
onRequestClose:
|
|
25102
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Pressable, { style: s9.backdrop, onPress:
|
|
25472
|
+
onRequestClose: close,
|
|
25473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Pressable, { style: s9.backdrop, onPress: close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Pressable, { style: s9.sheet, onPress: () => {
|
|
25103
25474
|
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
25104
25475
|
import_react_native7.FlatList,
|
|
25105
25476
|
{
|
|
@@ -25112,9 +25483,13 @@ function Select({
|
|
|
25112
25483
|
import_react_native7.Pressable,
|
|
25113
25484
|
{
|
|
25114
25485
|
style: s9.option,
|
|
25486
|
+
disabled,
|
|
25115
25487
|
onPress: () => {
|
|
25488
|
+
const current5 = interaction.current;
|
|
25489
|
+
if (current5.disabled || !current5.open || current5.revision !== revision)
|
|
25490
|
+
return;
|
|
25116
25491
|
onChange(item.value);
|
|
25117
|
-
|
|
25492
|
+
close();
|
|
25118
25493
|
},
|
|
25119
25494
|
children: [
|
|
25120
25495
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { style: [s9.optionLabel, isSelected && s9.optionLabelSelected], children: item.label }),
|
|
@@ -25130,7 +25505,7 @@ function Select({
|
|
|
25130
25505
|
)
|
|
25131
25506
|
] });
|
|
25132
25507
|
}
|
|
25133
|
-
var useSelectStyles = (theme) => (0,
|
|
25508
|
+
var useSelectStyles = (theme) => (0, import_react48.useMemo)(
|
|
25134
25509
|
() => import_react_native7.StyleSheet.create({
|
|
25135
25510
|
control: {
|
|
25136
25511
|
flexDirection: "row",
|
|
@@ -25191,7 +25566,7 @@ var useSelectStyles = (theme) => (0, import_react47.useMemo)(
|
|
|
25191
25566
|
);
|
|
25192
25567
|
|
|
25193
25568
|
// src/ui/QuantitySelect.tsx
|
|
25194
|
-
var
|
|
25569
|
+
var import_react49 = require("react");
|
|
25195
25570
|
var import_react_native8 = require("react-native");
|
|
25196
25571
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
25197
25572
|
var QuantitySelect = ({
|
|
@@ -25262,7 +25637,7 @@ var QuantitySelect = ({
|
|
|
25262
25637
|
}
|
|
25263
25638
|
);
|
|
25264
25639
|
};
|
|
25265
|
-
var useQuantityStyles = (theme) => (0,
|
|
25640
|
+
var useQuantityStyles = (theme) => (0, import_react49.useMemo)(
|
|
25266
25641
|
() => import_react_native8.StyleSheet.create({
|
|
25267
25642
|
stepper: { flexDirection: "row", alignItems: "center", gap: 14 },
|
|
25268
25643
|
btn: {
|
|
@@ -25290,7 +25665,7 @@ var useQuantityStyles = (theme) => (0, import_react48.useMemo)(
|
|
|
25290
25665
|
);
|
|
25291
25666
|
|
|
25292
25667
|
// src/ui/Timer.tsx
|
|
25293
|
-
var
|
|
25668
|
+
var import_react50 = require("react");
|
|
25294
25669
|
var import_react_native9 = require("react-native");
|
|
25295
25670
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
25296
25671
|
var clock = (s9) => {
|
|
@@ -25309,7 +25684,7 @@ var Timer = ({ seconds: seconds2, urgentAt = 60, label }) => {
|
|
|
25309
25684
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.Text, { style: [s9.clock, urgent && s9.clockUrgent], children: clock(seconds2) })
|
|
25310
25685
|
] });
|
|
25311
25686
|
};
|
|
25312
|
-
var useTimerStyles = (theme) => (0,
|
|
25687
|
+
var useTimerStyles = (theme) => (0, import_react50.useMemo)(
|
|
25313
25688
|
() => import_react_native9.StyleSheet.create({
|
|
25314
25689
|
row: { flexDirection: "row", alignItems: "center", gap: 6 },
|
|
25315
25690
|
label: {
|
|
@@ -25330,7 +25705,7 @@ var useTimerStyles = (theme) => (0, import_react49.useMemo)(
|
|
|
25330
25705
|
);
|
|
25331
25706
|
|
|
25332
25707
|
// src/ui/TimerBanner.tsx
|
|
25333
|
-
var
|
|
25708
|
+
var import_react51 = require("react");
|
|
25334
25709
|
var import_react_native10 = require("react-native");
|
|
25335
25710
|
var import_jsx_runtime11 = (
|
|
25336
25711
|
// `accessibilityLiveRegion="polite"` is the RN analogue of the web
|
|
@@ -25349,7 +25724,7 @@ var TimerBanner = ({
|
|
|
25349
25724
|
}) => {
|
|
25350
25725
|
const theme = useTheme();
|
|
25351
25726
|
const s9 = useBannerStyles(theme);
|
|
25352
|
-
const [dismissed, setDismissed] = (0,
|
|
25727
|
+
const [dismissed, setDismissed] = (0, import_react51.useState)(false);
|
|
25353
25728
|
if (seconds2 === void 0 || seconds2 <= 0 || dismissed) return null;
|
|
25354
25729
|
const urgent = seconds2 <= urgentAt;
|
|
25355
25730
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native10.View, { accessibilityLiveRegion: "polite", style: [s9.banner, urgent && s9.bannerUrgent], children: [
|
|
@@ -25368,7 +25743,7 @@ var TimerBanner = ({
|
|
|
25368
25743
|
)
|
|
25369
25744
|
] });
|
|
25370
25745
|
};
|
|
25371
|
-
var useBannerStyles = (theme) => (0,
|
|
25746
|
+
var useBannerStyles = (theme) => (0, import_react51.useMemo)(
|
|
25372
25747
|
() => import_react_native10.StyleSheet.create({
|
|
25373
25748
|
banner: {
|
|
25374
25749
|
flexDirection: "row",
|
|
@@ -25408,7 +25783,7 @@ var useBannerStyles = (theme) => (0, import_react50.useMemo)(
|
|
|
25408
25783
|
);
|
|
25409
25784
|
|
|
25410
25785
|
// src/ui/PaymentMethods.tsx
|
|
25411
|
-
var
|
|
25786
|
+
var import_react52 = require("react");
|
|
25412
25787
|
var import_react_native11 = require("react-native");
|
|
25413
25788
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
25414
25789
|
var EXTRA_LABEL = {
|
|
@@ -25487,7 +25862,7 @@ var PaymentMethods = ({
|
|
|
25487
25862
|
] }, option.value);
|
|
25488
25863
|
}) });
|
|
25489
25864
|
};
|
|
25490
|
-
var useStyles3 = (theme) => (0,
|
|
25865
|
+
var useStyles3 = (theme) => (0, import_react52.useMemo)(
|
|
25491
25866
|
() => import_react_native11.StyleSheet.create({
|
|
25492
25867
|
list: { gap: 8 },
|
|
25493
25868
|
row: {
|
|
@@ -25531,14 +25906,14 @@ var useStyles3 = (theme) => (0, import_react51.useMemo)(
|
|
|
25531
25906
|
);
|
|
25532
25907
|
|
|
25533
25908
|
// src/sections/Tickets.tsx
|
|
25534
|
-
var
|
|
25909
|
+
var import_react53 = require("react");
|
|
25535
25910
|
var import_react_native12 = require("react-native");
|
|
25536
25911
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
25537
25912
|
var money = (sym, n) => `${sym} ${Number(n).toFixed(2)}`;
|
|
25538
25913
|
var WaitingListForm = ({ ticket, onJoin }) => {
|
|
25539
|
-
const [form, setForm] = (0,
|
|
25540
|
-
const [state, setState] = (0,
|
|
25541
|
-
const [error, setError] = (0,
|
|
25914
|
+
const [form, setForm] = (0, import_react53.useState)({ firstName: "", lastName: "", email: "" });
|
|
25915
|
+
const [state, setState] = (0, import_react53.useState)("idle");
|
|
25916
|
+
const [error, setError] = (0, import_react53.useState)("");
|
|
25542
25917
|
const ok = Boolean(form.firstName.trim() && form.lastName.trim() && form.email.trim());
|
|
25543
25918
|
if (state === "done")
|
|
25544
25919
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MutedText, { children: "You\u2019re on the waiting list \u2014 we\u2019ll email you if a spot opens." });
|
|
@@ -25612,32 +25987,32 @@ var Tickets = ({
|
|
|
25612
25987
|
const bundleStarting = bundleWait !== null;
|
|
25613
25988
|
const promoMeta = (_a2 = ticketsQuery.data) == null ? void 0 : _a2.promo;
|
|
25614
25989
|
const showWaitingList = (_c = (_b = ticketsQuery.data) == null ? void 0 : _b.showWaitingList) != null ? _c : false;
|
|
25615
|
-
const [qty, setQty] = (0,
|
|
25616
|
-
const [slotDate, setSlotDate] = (0,
|
|
25990
|
+
const [qty, setQty] = (0, import_react53.useState)({});
|
|
25991
|
+
const [slotDate, setSlotDate] = (0, import_react53.useState)("");
|
|
25617
25992
|
const eventInfo = hooks_exports.useEvent(eventId).data;
|
|
25618
25993
|
const isTimeSlot = Boolean((timeSlotDates == null ? void 0 : timeSlotDates.length) || (eventInfo == null ? void 0 : eventInfo.isTimeSlotEvent));
|
|
25619
|
-
const dates = (0,
|
|
25994
|
+
const dates = (0, import_react53.useMemo)(
|
|
25620
25995
|
() => {
|
|
25621
25996
|
var _a3;
|
|
25622
25997
|
return (_a3 = timeSlotDates != null ? timeSlotDates : eventInfo == null ? void 0 : eventInfo.availableDates) != null ? _a3 : [];
|
|
25623
25998
|
},
|
|
25624
25999
|
[timeSlotDates, eventInfo == null ? void 0 : eventInfo.availableDates]
|
|
25625
26000
|
);
|
|
25626
|
-
(0,
|
|
26001
|
+
(0, import_react53.useEffect)(() => {
|
|
25627
26002
|
if (isTimeSlot && !slotDate && dates.length) setSlotDate(dates[0]);
|
|
25628
26003
|
}, [isTimeSlot, slotDate, dates]);
|
|
25629
26004
|
const slotQuery = hooks_exports.useTimeSlotTickets(eventId, isTimeSlot ? slotDate : void 0);
|
|
25630
|
-
const tickets = (0,
|
|
26005
|
+
const tickets = (0, import_react53.useMemo)(
|
|
25631
26006
|
() => {
|
|
25632
26007
|
var _a3, _b2, _c2;
|
|
25633
26008
|
return isTimeSlot ? (_a3 = slotQuery.data) != null ? _a3 : [] : (_c2 = (_b2 = ticketsQuery.data) == null ? void 0 : _b2.tickets) != null ? _c2 : [];
|
|
25634
26009
|
},
|
|
25635
26010
|
[isTimeSlot, slotQuery.data, (_d = ticketsQuery.data) == null ? void 0 : _d.tickets]
|
|
25636
26011
|
);
|
|
25637
|
-
const [error, setError] = (0,
|
|
25638
|
-
const [code, setCode] = (0,
|
|
25639
|
-
const [codeState, setCodeState] = (0,
|
|
25640
|
-
const [promoOpen, setPromoOpen] = (0,
|
|
26012
|
+
const [error, setError] = (0, import_react53.useState)("");
|
|
26013
|
+
const [code, setCode] = (0, import_react53.useState)("");
|
|
26014
|
+
const [codeState, setCodeState] = (0, import_react53.useState)("idle");
|
|
26015
|
+
const [promoOpen, setPromoOpen] = (0, import_react53.useState)(false);
|
|
25641
26016
|
hooks_exports.useOnEventChange(eventId, () => {
|
|
25642
26017
|
setQty({});
|
|
25643
26018
|
setSlotDate("");
|
|
@@ -25645,10 +26020,10 @@ var Tickets = ({
|
|
|
25645
26020
|
setPromoOpen(false);
|
|
25646
26021
|
setError("");
|
|
25647
26022
|
});
|
|
25648
|
-
const [wlOpen, setWlOpen] = (0,
|
|
25649
|
-
const [visibleDescription, setVisibleDescription] = (0,
|
|
25650
|
-
const attributionEvent = (0,
|
|
25651
|
-
(0,
|
|
26023
|
+
const [wlOpen, setWlOpen] = (0, import_react53.useState)({});
|
|
26024
|
+
const [visibleDescription, setVisibleDescription] = (0, import_react53.useState)(null);
|
|
26025
|
+
const attributionEvent = (0, import_react53.useRef)(null);
|
|
26026
|
+
(0, import_react53.useEffect)(() => {
|
|
25652
26027
|
var _a3;
|
|
25653
26028
|
if (attributionEvent.current === eventId) return;
|
|
25654
26029
|
attributionEvent.current = eventId;
|
|
@@ -25666,7 +26041,7 @@ var Tickets = ({
|
|
|
25666
26041
|
});
|
|
25667
26042
|
}
|
|
25668
26043
|
}, [eventId, initialPromoCode, referrer, readAttributionFromUrl]);
|
|
25669
|
-
(0,
|
|
26044
|
+
(0, import_react53.useEffect)(() => {
|
|
25670
26045
|
checkout.syncCurrency(eventId, void 0, { seed: true }).catch(() => void 0);
|
|
25671
26046
|
}, [eventId]);
|
|
25672
26047
|
const changeCurrency = (nextCode) => {
|
|
@@ -25677,8 +26052,8 @@ var Tickets = ({
|
|
|
25677
26052
|
}
|
|
25678
26053
|
}).catch(() => void 0);
|
|
25679
26054
|
};
|
|
25680
|
-
const originals = (0,
|
|
25681
|
-
(0,
|
|
26055
|
+
const originals = (0, import_react53.useRef)({});
|
|
26056
|
+
(0, import_react53.useEffect)(() => {
|
|
25682
26057
|
for (const t of tickets)
|
|
25683
26058
|
if (originals.current[t.id] == null) originals.current[t.id] = t.price;
|
|
25684
26059
|
}, [tickets]);
|
|
@@ -25745,7 +26120,7 @@ var Tickets = ({
|
|
|
25745
26120
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider, {}),
|
|
25746
26121
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.group, children: "Reserve tables" })
|
|
25747
26122
|
] }) : null;
|
|
25748
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
26123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react53.Fragment, { children: [
|
|
25749
26124
|
groupHeading,
|
|
25750
26125
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native12.View, { style: renderTicket ? void 0 : s9.rowWrap, children: [
|
|
25751
26126
|
renderTicket ? renderTicket({
|
|
@@ -25864,7 +26239,7 @@ var Tickets = ({
|
|
|
25864
26239
|
)
|
|
25865
26240
|
] }) : null,
|
|
25866
26241
|
isTimeSlot && !slotQuery.isLoading && tickets.length === 0 && slotDate ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MutedText, { children: "No sessions available on this date." }) : null,
|
|
25867
|
-
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
26242
|
+
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react53.Fragment, { children: [
|
|
25868
26243
|
g.time ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: s9.slotTime, children: g.time }) : null,
|
|
25869
26244
|
g.items.map(renderRow)
|
|
25870
26245
|
] }, g.time)) : tickets.map(renderRow),
|
|
@@ -25928,7 +26303,7 @@ var Tickets = ({
|
|
|
25928
26303
|
var staticStyles = import_react_native12.StyleSheet.create({
|
|
25929
26304
|
wlForm: { gap: 8 }
|
|
25930
26305
|
});
|
|
25931
|
-
var useTicketStyles = (theme) => (0,
|
|
26306
|
+
var useTicketStyles = (theme) => (0, import_react53.useMemo)(
|
|
25932
26307
|
() => import_react_native12.StyleSheet.create({
|
|
25933
26308
|
loading: { paddingVertical: 24, alignItems: "center" },
|
|
25934
26309
|
selectBlock: { gap: 6 },
|
|
@@ -26067,7 +26442,7 @@ var useTicketStyles = (theme) => (0, import_react52.useMemo)(
|
|
|
26067
26442
|
);
|
|
26068
26443
|
|
|
26069
26444
|
// src/sections/SeatsIoMap.tsx
|
|
26070
|
-
var
|
|
26445
|
+
var import_react54 = require("react");
|
|
26071
26446
|
var import_react_native13 = require("react-native");
|
|
26072
26447
|
var import_react_native_webview2 = require("react-native-webview");
|
|
26073
26448
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
@@ -26076,7 +26451,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
26076
26451
|
const checkout = useCheckoutContext();
|
|
26077
26452
|
const flow = hooks_exports.useSeatsIoSelection(eventId, checkout, initial, onContinue);
|
|
26078
26453
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
26079
|
-
const html = (0,
|
|
26454
|
+
const html = (0, import_react54.useMemo)(
|
|
26080
26455
|
() => flow.data.chart ? seatsIoChartDocument(flow.data.chart, flow.nonce) : "",
|
|
26081
26456
|
[flow.data.chart, flow.nonce]
|
|
26082
26457
|
);
|
|
@@ -26162,7 +26537,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
26162
26537
|
};
|
|
26163
26538
|
|
|
26164
26539
|
// src/sections/SeatMap.tsx
|
|
26165
|
-
var
|
|
26540
|
+
var import_react55 = require("react");
|
|
26166
26541
|
var import_react_native14 = require("react-native");
|
|
26167
26542
|
var import_react_native_webview3 = require("react-native-webview");
|
|
26168
26543
|
|
|
@@ -26178,9 +26553,9 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
26178
26553
|
const theme = useTheme();
|
|
26179
26554
|
const flow = hooks_exports.useSeatSelection(eventId, checkout, onContinue);
|
|
26180
26555
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
26181
|
-
const webview = (0,
|
|
26182
|
-
const [rendererError, setRendererError] = (0,
|
|
26183
|
-
const [size, setSize] = (0,
|
|
26556
|
+
const webview = (0, import_react55.useRef)(null);
|
|
26557
|
+
const [rendererError, setRendererError] = (0, import_react55.useState)(false);
|
|
26558
|
+
const [size, setSize] = (0, import_react55.useState)(320);
|
|
26184
26559
|
const properties = flow.chart.state === "ready" ? {
|
|
26185
26560
|
seatData: flow.chart.data.seatData,
|
|
26186
26561
|
statuses: flow.statuses,
|
|
@@ -26196,7 +26571,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
26196
26571
|
predefinedSeats: flow.chart.data.predefinedSeats
|
|
26197
26572
|
} : null;
|
|
26198
26573
|
const chart = flow.chart.state === "ready" ? flow.chart.data : null;
|
|
26199
|
-
const html = (0,
|
|
26574
|
+
const html = (0, import_react55.useMemo)(
|
|
26200
26575
|
() => chart ? `<!doctype html><html><head><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><style>html,body,#seat-map{margin:0;width:100%;height:100%;overflow:hidden}body{background:#fff}${SEAT_MAP_CSS}</style></head><body><div id="seat-map"></div><script>${SEAT_MAP_SCRIPT.replace(/<\/script/gi, "<\\/script")}</script></body></html>` : "",
|
|
26201
26576
|
[chart]
|
|
26202
26577
|
);
|
|
@@ -26207,7 +26582,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
26207
26582
|
`window.__tfSeatMapUpdate&&window.__tfSeatMapUpdate(${safeJson2(properties)});true;`
|
|
26208
26583
|
);
|
|
26209
26584
|
};
|
|
26210
|
-
(0,
|
|
26585
|
+
(0, import_react55.useEffect)(update, [properties && safeJson2(properties)]);
|
|
26211
26586
|
if (flow.chart.state === "provider") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SeatsIoMap, { eventId, initial: flow.chart.data, onContinue });
|
|
26212
26587
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FrozenFields, { frozen: checkout.orderFixed, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Card, { children: [
|
|
26213
26588
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SectionHeader, { title: "Select your seats" }),
|
|
@@ -26343,7 +26718,7 @@ var styles3 = import_react_native14.StyleSheet.create({
|
|
|
26343
26718
|
});
|
|
26344
26719
|
|
|
26345
26720
|
// src/sections/AddOns.tsx
|
|
26346
|
-
var
|
|
26721
|
+
var import_react56 = require("react");
|
|
26347
26722
|
var import_react_native16 = require("react-native");
|
|
26348
26723
|
|
|
26349
26724
|
// src/ui/CustomFields.tsx
|
|
@@ -26550,7 +26925,7 @@ var AddOns = ({
|
|
|
26550
26925
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.Text, { style: s9.subtitle, children: "PLEASE SELECT FROM THE OPTIONAL ADD-ONS BELOW" }),
|
|
26551
26926
|
groups.map((g, gi) => {
|
|
26552
26927
|
var _a3;
|
|
26553
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
26928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react56.Fragment, { children: [
|
|
26554
26929
|
g.heading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native16.Text, { style: s9.group, children: g.heading }) : null,
|
|
26555
26930
|
g.items.map((a) => {
|
|
26556
26931
|
var _a4, _b2;
|
|
@@ -26615,7 +26990,7 @@ var AddOns = ({
|
|
|
26615
26990
|
error || checkout.error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorText, { children: error || checkout.error }) : null
|
|
26616
26991
|
] }) });
|
|
26617
26992
|
};
|
|
26618
|
-
var useAddonStyles = (theme) => (0,
|
|
26993
|
+
var useAddonStyles = (theme) => (0, import_react56.useMemo)(
|
|
26619
26994
|
() => import_react_native16.StyleSheet.create({
|
|
26620
26995
|
head: { flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 },
|
|
26621
26996
|
eyebrow: {
|
|
@@ -26709,7 +27084,7 @@ var useAddonStyles = (theme) => (0, import_react55.useMemo)(
|
|
|
26709
27084
|
);
|
|
26710
27085
|
|
|
26711
27086
|
// src/sections/Bundles.tsx
|
|
26712
|
-
var
|
|
27087
|
+
var import_react57 = require("react");
|
|
26713
27088
|
var import_react_native17 = require("react-native");
|
|
26714
27089
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
26715
27090
|
var money3 = (currency, amount2) => `${currency} ${amount2.toFixed(2)}`;
|
|
@@ -26960,7 +27335,7 @@ var Bundles = ({
|
|
|
26960
27335
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { onPress: flow.continueToDetails, disabled: !anySelected, children: t("bundles.continue") })
|
|
26961
27336
|
] });
|
|
26962
27337
|
};
|
|
26963
|
-
var useBundleStyles = (theme) => (0,
|
|
27338
|
+
var useBundleStyles = (theme) => (0, import_react57.useMemo)(
|
|
26964
27339
|
() => import_react_native17.StyleSheet.create({
|
|
26965
27340
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
26966
27341
|
heading: {
|
|
@@ -27013,7 +27388,7 @@ var useBundleStyles = (theme) => (0, import_react56.useMemo)(
|
|
|
27013
27388
|
);
|
|
27014
27389
|
|
|
27015
27390
|
// src/sections/BillingInfo.tsx
|
|
27016
|
-
var
|
|
27391
|
+
var import_react60 = require("react");
|
|
27017
27392
|
var import_react_native22 = require("react-native");
|
|
27018
27393
|
|
|
27019
27394
|
// src/sections/billing/BillingAddressFields.tsx
|
|
@@ -27121,11 +27496,11 @@ var styles4 = import_react_native18.StyleSheet.create({
|
|
|
27121
27496
|
});
|
|
27122
27497
|
|
|
27123
27498
|
// src/sections/billing/PhoneIdentity.tsx
|
|
27124
|
-
var
|
|
27499
|
+
var import_react59 = require("react");
|
|
27125
27500
|
var import_react_native20 = require("react-native");
|
|
27126
27501
|
|
|
27127
27502
|
// src/auth/TwoFactorForm.tsx
|
|
27128
|
-
var
|
|
27503
|
+
var import_react58 = require("react");
|
|
27129
27504
|
var import_react_native19 = require("react-native");
|
|
27130
27505
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
27131
27506
|
var TwoFactorForm = ({
|
|
@@ -27138,7 +27513,7 @@ var TwoFactorForm = ({
|
|
|
27138
27513
|
onSendSms,
|
|
27139
27514
|
onCancel
|
|
27140
27515
|
}) => {
|
|
27141
|
-
const [code, setCode] = (0,
|
|
27516
|
+
const [code, setCode] = (0, import_react58.useState)("");
|
|
27142
27517
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native19.View, { style: { gap: 14 }, children: [
|
|
27143
27518
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MutedText, { children: "Enter the six-digit code from your authenticator app or registered phone to complete sign-in." }),
|
|
27144
27519
|
error ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -27190,8 +27565,8 @@ var PhoneIdentity = ({
|
|
|
27190
27565
|
}) => {
|
|
27191
27566
|
var _a2;
|
|
27192
27567
|
const identity = hooks_exports.useCheckoutPhoneIdentity(options);
|
|
27193
|
-
const [code, setCode] = (0,
|
|
27194
|
-
const [emailInstead, setEmailInstead] = (0,
|
|
27568
|
+
const [code, setCode] = (0, import_react59.useState)("");
|
|
27569
|
+
const [emailInstead, setEmailInstead] = (0, import_react59.useState)(false);
|
|
27195
27570
|
if (emailInstead) return null;
|
|
27196
27571
|
if (identity.challenge)
|
|
27197
27572
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -27506,17 +27881,17 @@ var BillingInfo = ({
|
|
|
27506
27881
|
const profile = hooks_exports.useCheckoutBuyerProfile(eventId);
|
|
27507
27882
|
const event = hooks_exports.useEvent(eventId);
|
|
27508
27883
|
const combined = !onContinue;
|
|
27509
|
-
const [billing, setBilling] = (0,
|
|
27884
|
+
const [billing, setBilling] = (0, import_react60.useState)(
|
|
27510
27885
|
() => billingDraftFrom(checkout.billing)
|
|
27511
27886
|
);
|
|
27512
|
-
const [dataCapture, setDataCapture] = (0,
|
|
27887
|
+
const [dataCapture, setDataCapture] = (0, import_react60.useState)(
|
|
27513
27888
|
(_b = (_a2 = checkout.billing) == null ? void 0 : _a2.dataCapture) != null ? _b : {}
|
|
27514
27889
|
);
|
|
27515
|
-
const [holders, setHolders] = (0,
|
|
27890
|
+
const [holders, setHolders] = (0, import_react60.useState)(
|
|
27516
27891
|
() => holderDraftsFrom(checkout.holders, checkout.backfilledHolderIndexes)
|
|
27517
27892
|
);
|
|
27518
|
-
const [consent, setConsent] = (0,
|
|
27519
|
-
const [dob, setDob] = (0,
|
|
27893
|
+
const [consent, setConsent] = (0, import_react60.useState)({ ttfOptIn: false, brandOptIn: false });
|
|
27894
|
+
const [dob, setDob] = (0, import_react60.useState)(() => billingDobIso(checkout.billing));
|
|
27520
27895
|
hooks_exports.useOnOrderReleased(checkout.orderFixed, () => {
|
|
27521
27896
|
var _a3, _b2;
|
|
27522
27897
|
setBilling(billingDraftFrom(checkout.billing));
|
|
@@ -27527,35 +27902,35 @@ var BillingInfo = ({
|
|
|
27527
27902
|
(prev) => holderDraftsReloaded(prev, checkout.holders, checkout.backfilledHolderIndexes)
|
|
27528
27903
|
);
|
|
27529
27904
|
});
|
|
27530
|
-
const restoredHolders = (0,
|
|
27905
|
+
const restoredHolders = (0, import_react60.useRef)(checkout.holders);
|
|
27531
27906
|
hooks_exports.useOnEventChange(checkout.eventId, () => {
|
|
27532
27907
|
restoredHolders.current = [];
|
|
27533
27908
|
setHolders([]);
|
|
27534
27909
|
setDataCapture({});
|
|
27535
27910
|
});
|
|
27536
|
-
const profileSeeded = (0,
|
|
27537
|
-
const countryDefaultApplied = (0,
|
|
27911
|
+
const profileSeeded = (0, import_react60.useRef)(false);
|
|
27912
|
+
const countryDefaultApplied = (0, import_react60.useRef)(Boolean((_c = checkout.billing) == null ? void 0 : _c.countryId));
|
|
27538
27913
|
const {
|
|
27539
27914
|
setBilling: commitBilling,
|
|
27540
27915
|
setHolders: commitHolders,
|
|
27541
27916
|
setConsent: commitConsent
|
|
27542
27917
|
} = checkout;
|
|
27543
27918
|
const gates = checkout.fieldGates;
|
|
27544
|
-
const orderGroups = (0,
|
|
27919
|
+
const orderGroups = (0, import_react60.useMemo)(
|
|
27545
27920
|
() => checkout.customFields.filter((g) => g.scope === "order"),
|
|
27546
27921
|
[checkout.customFields]
|
|
27547
27922
|
);
|
|
27548
|
-
const ticketGroups = (0,
|
|
27923
|
+
const ticketGroups = (0, import_react60.useMemo)(
|
|
27549
27924
|
() => checkout.customFields.filter((g) => g.scope === "ticket"),
|
|
27550
27925
|
[checkout.customFields]
|
|
27551
27926
|
);
|
|
27552
|
-
const ticketFields = (0,
|
|
27927
|
+
const ticketFields = (0, import_react60.useMemo)(
|
|
27553
27928
|
() => ticketGroups.flatMap((g) => g.fields),
|
|
27554
27929
|
[ticketGroups]
|
|
27555
27930
|
);
|
|
27556
27931
|
const holderNamesRequired = checkout.holderNamesRequired || collectTicketHolders;
|
|
27557
27932
|
const showHolders = holderNamesRequired || ticketFields.length > 0;
|
|
27558
|
-
const slots = (0,
|
|
27933
|
+
const slots = (0, import_react60.useMemo)(() => {
|
|
27559
27934
|
var _a3, _b2;
|
|
27560
27935
|
const out = [];
|
|
27561
27936
|
const lines = (_b2 = (_a3 = checkout.breakdown) == null ? void 0 : _a3.tickets) != null ? _b2 : [];
|
|
@@ -27568,7 +27943,7 @@ var BillingInfo = ({
|
|
|
27568
27943
|
}
|
|
27569
27944
|
return out;
|
|
27570
27945
|
}, [checkout.breakdown, checkout.selections]);
|
|
27571
|
-
(0,
|
|
27946
|
+
(0, import_react60.useEffect)(() => {
|
|
27572
27947
|
const p = profile.data;
|
|
27573
27948
|
if (!p || profileSeeded.current) return;
|
|
27574
27949
|
profileSeeded.current = true;
|
|
@@ -27591,10 +27966,10 @@ var BillingInfo = ({
|
|
|
27591
27966
|
return keys.every((k) => next[k] === prev[k]) ? prev : next;
|
|
27592
27967
|
});
|
|
27593
27968
|
}, [profile.data, checkout.isLoggedIn]);
|
|
27594
|
-
(0,
|
|
27969
|
+
(0, import_react60.useEffect)(() => {
|
|
27595
27970
|
setHolders((prev) => holderDraftsForSlots(prev, slots, restoredHolders.current));
|
|
27596
27971
|
}, [slots]);
|
|
27597
|
-
(0,
|
|
27972
|
+
(0, import_react60.useEffect)(() => {
|
|
27598
27973
|
if (!showHolders) return;
|
|
27599
27974
|
setHolders(
|
|
27600
27975
|
(prev) => holderDraftsMirroringBuyer(prev, {
|
|
@@ -27605,7 +27980,7 @@ var BillingInfo = ({
|
|
|
27605
27980
|
})
|
|
27606
27981
|
);
|
|
27607
27982
|
}, [showHolders, billing.firstName, billing.lastName, billing.email, billing.phone]);
|
|
27608
|
-
(0,
|
|
27983
|
+
(0, import_react60.useEffect)(() => {
|
|
27609
27984
|
const email = billing.email.trim();
|
|
27610
27985
|
if (checkout.isLoggedIn || !isEmail(email)) return;
|
|
27611
27986
|
const t = setTimeout(
|
|
@@ -27619,18 +27994,18 @@ var BillingInfo = ({
|
|
|
27619
27994
|
const countriesQuery = hooks_exports.useCountries({
|
|
27620
27995
|
enabled: needsNationality || gates.showAddress
|
|
27621
27996
|
});
|
|
27622
|
-
const countries = (0,
|
|
27997
|
+
const countries = (0, import_react60.useMemo)(() => {
|
|
27623
27998
|
var _a3;
|
|
27624
27999
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
27625
28000
|
}, [countriesQuery.data]);
|
|
27626
28001
|
const statesQuery = hooks_exports.useStates(billing.countryId, {
|
|
27627
28002
|
enabled: Boolean(billing.countryId)
|
|
27628
28003
|
});
|
|
27629
|
-
const states = (0,
|
|
28004
|
+
const states = (0, import_react60.useMemo)(() => {
|
|
27630
28005
|
var _a3;
|
|
27631
28006
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
27632
28007
|
}, [statesQuery.data]);
|
|
27633
|
-
(0,
|
|
28008
|
+
(0, import_react60.useEffect)(() => {
|
|
27634
28009
|
var _a3, _b2, _c2, _d2;
|
|
27635
28010
|
if (countryDefaultApplied.current || billing.countryId || countries.length === 0 || profile.isLoading || eventId && event.isLoading) {
|
|
27636
28011
|
return;
|
|
@@ -27669,7 +28044,7 @@ var BillingInfo = ({
|
|
|
27669
28044
|
event.isLoading,
|
|
27670
28045
|
(_e = event.data) == null ? void 0 : _e.countryCode
|
|
27671
28046
|
]);
|
|
27672
|
-
(0,
|
|
28047
|
+
(0, import_react60.useEffect)(() => {
|
|
27673
28048
|
var _a3;
|
|
27674
28049
|
if (!billing.countryId) return;
|
|
27675
28050
|
const country = countries.find(
|
|
@@ -27680,7 +28055,7 @@ var BillingInfo = ({
|
|
|
27680
28055
|
setBilling((current5) => ({ ...current5, countryCode }));
|
|
27681
28056
|
}
|
|
27682
28057
|
}, [billing.countryId, billing.countryCode, countries]);
|
|
27683
|
-
(0,
|
|
28058
|
+
(0, import_react60.useEffect)(() => {
|
|
27684
28059
|
if (!billing.stateId) return;
|
|
27685
28060
|
const state = states.find(
|
|
27686
28061
|
(candidate) => String(candidate.id) === String(billing.stateId)
|
|
@@ -27740,7 +28115,7 @@ var BillingInfo = ({
|
|
|
27740
28115
|
});
|
|
27741
28116
|
if (ttfOptInLabel || brandOptInLabel) commitConsent(consent);
|
|
27742
28117
|
};
|
|
27743
|
-
(0,
|
|
28118
|
+
(0, import_react60.useEffect)(() => {
|
|
27744
28119
|
if (combined) commit();
|
|
27745
28120
|
}, [
|
|
27746
28121
|
combined,
|
|
@@ -27937,7 +28312,7 @@ var BillingInfo = ({
|
|
|
27937
28312
|
setBilling
|
|
27938
28313
|
}
|
|
27939
28314
|
) : null,
|
|
27940
|
-
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
28315
|
+
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react60.Fragment, { children: [
|
|
27941
28316
|
g.label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: s9.sectionLabel, children: g.label }) : null,
|
|
27942
28317
|
renderGroupFields(
|
|
27943
28318
|
g,
|
|
@@ -28014,7 +28389,7 @@ var BillingInfo = ({
|
|
|
28014
28389
|
showHolders ? continueButton : null
|
|
28015
28390
|
] });
|
|
28016
28391
|
};
|
|
28017
|
-
var useStyles4 = (theme) => (0,
|
|
28392
|
+
var useStyles4 = (theme) => (0, import_react60.useMemo)(
|
|
28018
28393
|
() => import_react_native22.StyleSheet.create({
|
|
28019
28394
|
loginRow: {
|
|
28020
28395
|
flexDirection: "row",
|
|
@@ -28207,7 +28582,7 @@ var Accommodation = ({ eventId }) => {
|
|
|
28207
28582
|
var styles7 = import_react_native24.StyleSheet.create({ room: { gap: 12, paddingVertical: 12 }, title: { fontSize: 16, fontWeight: "600" } });
|
|
28208
28583
|
|
|
28209
28584
|
// src/sections/Payment.tsx
|
|
28210
|
-
var
|
|
28585
|
+
var import_react61 = require("react");
|
|
28211
28586
|
var import_react_native25 = require("react-native");
|
|
28212
28587
|
var import_stripe_react_native3 = require("@stripe/stripe-react-native");
|
|
28213
28588
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
@@ -28261,14 +28636,14 @@ var Payment = ({
|
|
|
28261
28636
|
const bundleWait = hooks_exports.useTicketGatewayWait(checkout.store);
|
|
28262
28637
|
const bundleStarting = bundleWait !== null;
|
|
28263
28638
|
const validation = useCheckoutValidation();
|
|
28264
|
-
const [error, setError] = (0,
|
|
28639
|
+
const [error, setError] = (0, import_react61.useState)("");
|
|
28265
28640
|
const paymentMethods = hooks_exports.useCheckoutPaymentMethods(checkout.store);
|
|
28266
28641
|
const methods = (_a2 = paymentMethods.data) != null ? _a2 : null;
|
|
28267
|
-
const [selected, setSelected] = (0,
|
|
28268
|
-
const [extras, setExtras] = (0,
|
|
28269
|
-
const [useSavedCard, setUseSavedCard] = (0,
|
|
28270
|
-
const [nativeWalletSupported, setNativeWalletSupported] = (0,
|
|
28271
|
-
(0,
|
|
28642
|
+
const [selected, setSelected] = (0, import_react61.useState)("");
|
|
28643
|
+
const [extras, setExtras] = (0, import_react61.useState)({});
|
|
28644
|
+
const [useSavedCard, setUseSavedCard] = (0, import_react61.useState)(true);
|
|
28645
|
+
const [nativeWalletSupported, setNativeWalletSupported] = (0, import_react61.useState)(false);
|
|
28646
|
+
(0, import_react61.useEffect)(() => {
|
|
28272
28647
|
let mounted = true;
|
|
28273
28648
|
const env = getConfig().env;
|
|
28274
28649
|
(0, import_stripe_react_native3.isPlatformPaySupported)({ googlePay: { testEnv: env === "STAG" || env === "DEV" } }).then((supported) => {
|
|
@@ -28284,7 +28659,7 @@ var Payment = ({
|
|
|
28284
28659
|
const isFree = bd !== void 0 && Number(bd.total) === 0;
|
|
28285
28660
|
const isXendit = checkout.gateway === "xendit";
|
|
28286
28661
|
const offersOxxo = stripeOffersOxxo(checkout.stripeElementsConfig);
|
|
28287
|
-
const options = (0,
|
|
28662
|
+
const options = (0, import_react61.useMemo)(() => {
|
|
28288
28663
|
var _a3, _b2, _c2, _d2, _e2;
|
|
28289
28664
|
if (isFree || !methods) return [];
|
|
28290
28665
|
const out = [];
|
|
@@ -28341,7 +28716,7 @@ var Payment = ({
|
|
|
28341
28716
|
nativeWalletSupported,
|
|
28342
28717
|
offersOxxo
|
|
28343
28718
|
]);
|
|
28344
|
-
(0,
|
|
28719
|
+
(0, import_react61.useEffect)(() => {
|
|
28345
28720
|
if (options.length && !options.some((o) => o.value === selected))
|
|
28346
28721
|
setSelected(options[0].value);
|
|
28347
28722
|
}, [options, selected]);
|
|
@@ -28351,7 +28726,10 @@ var Payment = ({
|
|
|
28351
28726
|
const isPlanSelected = (selectedOption == null ? void 0 : selectedOption.id.kind) === "paymentPlan";
|
|
28352
28727
|
const savedLast4 = methods == null ? void 0 : methods.savedPlanCardLast4;
|
|
28353
28728
|
const reuseSavedCard = planUsesSavedCard(savedLast4, useSavedCard);
|
|
28354
|
-
const
|
|
28729
|
+
const useStripeSheet = Boolean(
|
|
28730
|
+
checkout.paymentSheet && isCardSelected && nativePaymentSheetAvailable(checkout)
|
|
28731
|
+
);
|
|
28732
|
+
const showStripeCardField = !isXendit && (!useStripeSheet && isCardSelected || isPlanSelected && !reuseSavedCard);
|
|
28355
28733
|
const showXenditCardNote = isXendit && isCardSelected;
|
|
28356
28734
|
const ticketCard = hooks_exports.useTicketCardForm({
|
|
28357
28735
|
confirmer: rnConfirmer,
|
|
@@ -28413,14 +28791,16 @@ var Payment = ({
|
|
|
28413
28791
|
req = { method: "xenditEWallet", walletKey: id2.walletKey, extra: extras[selected] };
|
|
28414
28792
|
else if (id2.kind === "redirect")
|
|
28415
28793
|
req = { method: "redirect", methodType: id2.methodType };
|
|
28416
|
-
else if (id2.kind === "paymentPlan")
|
|
28794
|
+
else if (id2.kind === "paymentPlan")
|
|
28795
|
+
req = { method: "paymentPlan", useSavedCard: reuseSavedCard };
|
|
28417
28796
|
else req = { method: id2.kind };
|
|
28418
|
-
checkout.placeOrder(
|
|
28797
|
+
const payment = useStripeSheet && checkout.paymentSheet && !isFree ? checkout.paymentSheet.placeOrder() : checkout.placeOrder(
|
|
28419
28798
|
req,
|
|
28420
28799
|
usesOwnCardField ? {
|
|
28421
28800
|
claimCard: cardClaimStep("nativeCard", () => claimCardField(cardOwner))
|
|
28422
28801
|
} : void 0
|
|
28423
|
-
)
|
|
28802
|
+
);
|
|
28803
|
+
payment.then((order) => onComplete == null ? void 0 : onComplete(order)).catch(
|
|
28424
28804
|
(e) => setError(
|
|
28425
28805
|
e instanceof CartChangedError ? t("checkout.error.cartChanged") : e instanceof CardClaimError || e instanceof ConfirmerBusyError ? createTranslator()(e.message) : errorMessage(e)
|
|
28426
28806
|
)
|
|
@@ -28433,6 +28813,7 @@ var Payment = ({
|
|
|
28433
28813
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MutedText, { children: createTranslator()("bundles.payingElsewhere") }),
|
|
28434
28814
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "ghost", onPress: ticketCard.payHere, children: createTranslator()("bundles.payHere") })
|
|
28435
28815
|
] }) : showStripeCardField ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CardInput, { owner: cardOwner }) : null,
|
|
28816
|
+
useStripeSheet && !isFree ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MutedText, { children: "Choose your payment details securely with Stripe when you pay." }) : null,
|
|
28436
28817
|
showXenditCardNote ? (
|
|
28437
28818
|
// Xendit card tokenizes in a WebView sheet (deferred — see confirmer.ts).
|
|
28438
28819
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MutedText, { children: "Card details are entered in a secure Xendit window when you pay." })
|
|
@@ -28511,17 +28892,17 @@ var Payment = ({
|
|
|
28511
28892
|
};
|
|
28512
28893
|
|
|
28513
28894
|
// src/sections/WaiverSigning.tsx
|
|
28514
|
-
var
|
|
28895
|
+
var import_react63 = require("react");
|
|
28515
28896
|
var import_react_native27 = require("react-native");
|
|
28516
28897
|
|
|
28517
28898
|
// src/ui/SignaturePad.tsx
|
|
28518
|
-
var
|
|
28899
|
+
var import_react62 = require("react");
|
|
28519
28900
|
var import_react_native26 = require("react-native");
|
|
28520
28901
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
28521
28902
|
var LINE_WIDTH = 2.5;
|
|
28522
28903
|
var PAD_HEIGHT = 160;
|
|
28523
28904
|
var MIN_STEP = 1.5;
|
|
28524
|
-
var StrokeView = (0,
|
|
28905
|
+
var StrokeView = (0, import_react62.memo)(
|
|
28525
28906
|
({ stroke }) => stroke.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
28526
28907
|
import_react_native26.View,
|
|
28527
28908
|
{
|
|
@@ -28561,13 +28942,13 @@ var SignaturePad = ({
|
|
|
28561
28942
|
disabled
|
|
28562
28943
|
}) => {
|
|
28563
28944
|
const theme = useTheme();
|
|
28564
|
-
const strokesRef = (0,
|
|
28565
|
-
const [, setFrame] = (0,
|
|
28566
|
-
const frameRequest = (0,
|
|
28567
|
-
const size = (0,
|
|
28568
|
-
const report = (0,
|
|
28945
|
+
const strokesRef = (0, import_react62.useRef)([]);
|
|
28946
|
+
const [, setFrame] = (0, import_react62.useState)(0);
|
|
28947
|
+
const frameRequest = (0, import_react62.useRef)(null);
|
|
28948
|
+
const size = (0, import_react62.useRef)({ width: 0, height: PAD_HEIGHT });
|
|
28949
|
+
const report = (0, import_react62.useRef)(onChange);
|
|
28569
28950
|
report.current = onChange;
|
|
28570
|
-
const disabledRef = (0,
|
|
28951
|
+
const disabledRef = (0, import_react62.useRef)(disabled);
|
|
28571
28952
|
disabledRef.current = disabled;
|
|
28572
28953
|
const render = () => {
|
|
28573
28954
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
@@ -28578,7 +28959,7 @@ var SignaturePad = ({
|
|
|
28578
28959
|
if (frameRequest.current !== null) return;
|
|
28579
28960
|
frameRequest.current = requestAnimationFrame(render);
|
|
28580
28961
|
};
|
|
28581
|
-
(0,
|
|
28962
|
+
(0, import_react62.useEffect)(
|
|
28582
28963
|
() => () => {
|
|
28583
28964
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
28584
28965
|
},
|
|
@@ -28593,7 +28974,7 @@ var SignaturePad = ({
|
|
|
28593
28974
|
});
|
|
28594
28975
|
if (ended) report.current(ended.pngDataUrl, ended.inkLength);
|
|
28595
28976
|
};
|
|
28596
|
-
const responder = (0,
|
|
28977
|
+
const responder = (0, import_react62.useMemo)(
|
|
28597
28978
|
() => import_react_native26.PanResponder.create({
|
|
28598
28979
|
onStartShouldSetPanResponder: () => !disabledRef.current,
|
|
28599
28980
|
onMoveShouldSetPanResponder: () => !disabledRef.current,
|
|
@@ -28705,8 +29086,8 @@ var WaiverSigning = ({
|
|
|
28705
29086
|
checkout.setWaiverSignature,
|
|
28706
29087
|
checkout.holdWaiverSigning
|
|
28707
29088
|
);
|
|
28708
|
-
const [open, setOpen] = (0,
|
|
28709
|
-
const [reloading, setReloading] = (0,
|
|
29089
|
+
const [open, setOpen] = (0, import_react63.useState)({});
|
|
29090
|
+
const [reloading, setReloading] = (0, import_react63.useState)(false);
|
|
28710
29091
|
if ((_a2 = checkout.unavailableDetails) == null ? void 0 : _a2.includes("waiver")) {
|
|
28711
29092
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
|
|
28712
29093
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SectionHeader, { title: t("waivers.heading") }),
|
|
@@ -28800,17 +29181,17 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
28800
29181
|
var _a2, _b, _c, _d;
|
|
28801
29182
|
const theme = useTheme();
|
|
28802
29183
|
const s9 = useWaiverStyles(theme);
|
|
28803
|
-
const [heldDraft, setDraft] = (0,
|
|
29184
|
+
const [heldDraft, setDraft] = (0, import_react63.useState)(
|
|
28804
29185
|
() => emptyWaiverDraft(
|
|
28805
29186
|
{ firstName: ticket.holderFirstName, lastName: ticket.holderLastName },
|
|
28806
29187
|
{ signatureMethods: methods }
|
|
28807
29188
|
)
|
|
28808
29189
|
);
|
|
28809
29190
|
const draft = draftWithAllowedMethod(heldDraft, methods);
|
|
28810
|
-
const [problems, setProblems] = (0,
|
|
28811
|
-
const [pressed, setPressed] = (0,
|
|
29191
|
+
const [problems, setProblems] = (0, import_react63.useState)([]);
|
|
29192
|
+
const [pressed, setPressed] = (0, import_react63.useState)(false);
|
|
28812
29193
|
const frozen = busy || locked;
|
|
28813
|
-
const draftRef = (0,
|
|
29194
|
+
const draftRef = (0, import_react63.useRef)(draft);
|
|
28814
29195
|
draftRef.current = draft;
|
|
28815
29196
|
const patch2 = (next) => {
|
|
28816
29197
|
if (!frozen) setDraft((d) => ({ ...d, ...next }));
|
|
@@ -28964,7 +29345,7 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
28964
29345
|
)
|
|
28965
29346
|
] });
|
|
28966
29347
|
};
|
|
28967
|
-
var useWaiverStyles = (theme) => (0,
|
|
29348
|
+
var useWaiverStyles = (theme) => (0, import_react63.useMemo)(
|
|
28968
29349
|
() => import_react_native27.StyleSheet.create({
|
|
28969
29350
|
muted: {
|
|
28970
29351
|
color: theme.muted,
|
|
@@ -29009,7 +29390,7 @@ var useWaiverStyles = (theme) => (0, import_react62.useMemo)(
|
|
|
29009
29390
|
);
|
|
29010
29391
|
|
|
29011
29392
|
// src/sections/IDVerification.tsx
|
|
29012
|
-
var
|
|
29393
|
+
var import_react64 = require("react");
|
|
29013
29394
|
var import_react_native28 = require("react-native");
|
|
29014
29395
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
29015
29396
|
var MESSAGE = {
|
|
@@ -29024,8 +29405,8 @@ var IDVerification = () => {
|
|
|
29024
29405
|
const checkout = useCheckoutContext();
|
|
29025
29406
|
const theme = useTheme();
|
|
29026
29407
|
const order = checkout.order;
|
|
29027
|
-
const [phase, setPhase] = (0,
|
|
29028
|
-
const [error, setError] = (0,
|
|
29408
|
+
const [phase, setPhase] = (0, import_react64.useState)("idle");
|
|
29409
|
+
const [error, setError] = (0, import_react64.useState)("");
|
|
29029
29410
|
if (!(order == null ? void 0 : order.needIdVerification)) return null;
|
|
29030
29411
|
const done = phase === "verified";
|
|
29031
29412
|
const running = phase === "starting" || phase === "polling";
|
|
@@ -29052,7 +29433,7 @@ var IDVerification = () => {
|
|
|
29052
29433
|
};
|
|
29053
29434
|
|
|
29054
29435
|
// src/sections/Confirmation.tsx
|
|
29055
|
-
var
|
|
29436
|
+
var import_react65 = require("react");
|
|
29056
29437
|
var import_react_native29 = require("react-native");
|
|
29057
29438
|
var import_clipboard = __toESM(require("@react-native-clipboard/clipboard"));
|
|
29058
29439
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
@@ -29066,7 +29447,7 @@ var Confirmation = ({
|
|
|
29066
29447
|
const checkout = useCheckoutContext();
|
|
29067
29448
|
const theme = useTheme();
|
|
29068
29449
|
const order = checkout.order;
|
|
29069
|
-
const [copied, setCopied] = (0,
|
|
29450
|
+
const [copied, setCopied] = (0, import_react65.useState)(false);
|
|
29070
29451
|
if (!order) return null;
|
|
29071
29452
|
const pending3 = order.pending;
|
|
29072
29453
|
const url2 = shareUrl != null ? shareUrl : "";
|
|
@@ -29120,12 +29501,12 @@ var styles9 = import_react_native29.StyleSheet.create({
|
|
|
29120
29501
|
});
|
|
29121
29502
|
|
|
29122
29503
|
// src/sections/Rewards.tsx
|
|
29123
|
-
var
|
|
29504
|
+
var import_react68 = require("react");
|
|
29124
29505
|
var import_react_native32 = require("react-native");
|
|
29125
29506
|
var import_clipboard2 = __toESM(require("@react-native-clipboard/clipboard"));
|
|
29126
29507
|
|
|
29127
29508
|
// src/sections/rewards/RewardsLadder.tsx
|
|
29128
|
-
var
|
|
29509
|
+
var import_react66 = require("react");
|
|
29129
29510
|
var import_react_native30 = require("react-native");
|
|
29130
29511
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
29131
29512
|
var AWARD_STATUS_KEYS = {
|
|
@@ -29135,9 +29516,9 @@ var AWARD_STATUS_KEYS = {
|
|
|
29135
29516
|
cancelled: "rewards.awards.cancelled"
|
|
29136
29517
|
};
|
|
29137
29518
|
var DeliveryDetails = ({ fields, translate: t, onSubmit }) => {
|
|
29138
|
-
const [values2, setValues] = (0,
|
|
29139
|
-
const [saving, setSaving] = (0,
|
|
29140
|
-
const [failure, setFailure] = (0,
|
|
29519
|
+
const [values2, setValues] = (0, import_react66.useState)({});
|
|
29520
|
+
const [saving, setSaving] = (0, import_react66.useState)(false);
|
|
29521
|
+
const [failure, setFailure] = (0, import_react66.useState)("");
|
|
29141
29522
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_native30.View, { style: { gap: 10 }, children: [
|
|
29142
29523
|
fields.map((field) => {
|
|
29143
29524
|
var _a2;
|
|
@@ -29229,7 +29610,7 @@ var styles10 = import_react_native30.StyleSheet.create({
|
|
|
29229
29610
|
});
|
|
29230
29611
|
|
|
29231
29612
|
// src/sections/rewards/RewardsTree.tsx
|
|
29232
|
-
var
|
|
29613
|
+
var import_react67 = require("react");
|
|
29233
29614
|
var import_react_native31 = require("react-native");
|
|
29234
29615
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
29235
29616
|
var MAX_NODES = 120;
|
|
@@ -29237,11 +29618,11 @@ var DOT = 10;
|
|
|
29237
29618
|
var ROOT_DOT = 16;
|
|
29238
29619
|
var RewardsTree = ({ tree, size = 260 }) => {
|
|
29239
29620
|
const theme = useTheme();
|
|
29240
|
-
const nodes = (0,
|
|
29621
|
+
const nodes = (0, import_react67.useMemo)(() => {
|
|
29241
29622
|
var _a2;
|
|
29242
29623
|
return ((_a2 = tree == null ? void 0 : tree.nodes) != null ? _a2 : []).slice(0, MAX_NODES);
|
|
29243
29624
|
}, [tree]);
|
|
29244
|
-
const { layout, edges, rootId } = (0,
|
|
29625
|
+
const { layout, edges, rootId } = (0, import_react67.useMemo)(() => {
|
|
29245
29626
|
const root = treeRootId(nodes);
|
|
29246
29627
|
const computed = computeRadialTreeLayout(nodes, root);
|
|
29247
29628
|
return { layout: computed, edges: radialTreeEdges(nodes, computed), rootId: root };
|
|
@@ -29328,10 +29709,10 @@ var RewardsView = ({
|
|
|
29328
29709
|
var _a2, _b, _c, _d, _e, _f;
|
|
29329
29710
|
const t = translate2 != null ? translate2 : createTranslator({ locale, messages });
|
|
29330
29711
|
const { rewards, failure, busy, hash } = flow;
|
|
29331
|
-
const [packName, setPackName] = (0,
|
|
29332
|
-
const [packCode, setPackCode] = (0,
|
|
29333
|
-
const [copied, setCopied] = (0,
|
|
29334
|
-
(0,
|
|
29712
|
+
const [packName, setPackName] = (0, import_react68.useState)("");
|
|
29713
|
+
const [packCode, setPackCode] = (0, import_react68.useState)("");
|
|
29714
|
+
const [copied, setCopied] = (0, import_react68.useState)(false);
|
|
29715
|
+
(0, import_react68.useEffect)(() => {
|
|
29335
29716
|
setCopied(false);
|
|
29336
29717
|
}, [rewards == null ? void 0 : rewards.share_link]);
|
|
29337
29718
|
if (!rewards)
|
|
@@ -29519,7 +29900,7 @@ var styles12 = import_react_native32.StyleSheet.create({
|
|
|
29519
29900
|
});
|
|
29520
29901
|
|
|
29521
29902
|
// src/sections/TicketChange.tsx
|
|
29522
|
-
var
|
|
29903
|
+
var import_react69 = require("react");
|
|
29523
29904
|
var import_react_native33 = require("react-native");
|
|
29524
29905
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
29525
29906
|
var TicketChange = ({
|
|
@@ -29729,7 +30110,7 @@ var TicketChange = ({
|
|
|
29729
30110
|
flow.notice ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native33.Text, { style: s9.muted, children: t(flow.notice) }) : null
|
|
29730
30111
|
] });
|
|
29731
30112
|
};
|
|
29732
|
-
var useChangeStyles = (theme) => (0,
|
|
30113
|
+
var useChangeStyles = (theme) => (0, import_react69.useMemo)(
|
|
29733
30114
|
() => import_react_native33.StyleSheet.create({
|
|
29734
30115
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
29735
30116
|
muted: {
|
|
@@ -29825,17 +30206,17 @@ var Trips = ({
|
|
|
29825
30206
|
};
|
|
29826
30207
|
|
|
29827
30208
|
// src/sections/EventDiscussionView.tsx
|
|
29828
|
-
var
|
|
30209
|
+
var import_react73 = require("react");
|
|
29829
30210
|
var import_react_native37 = require("react-native");
|
|
29830
30211
|
|
|
29831
30212
|
// src/sections/discussion/CommentImages.tsx
|
|
29832
|
-
var
|
|
30213
|
+
var import_react71 = require("react");
|
|
29833
30214
|
var import_react_native35 = require("react-native");
|
|
29834
30215
|
|
|
29835
30216
|
// src/ui/useAccountT.ts
|
|
29836
|
-
var
|
|
30217
|
+
var import_react70 = require("react");
|
|
29837
30218
|
var useAccountT = (locale) => {
|
|
29838
|
-
const translate2 = (0,
|
|
30219
|
+
const translate2 = (0, import_react70.useMemo)(
|
|
29839
30220
|
() => createTranslator({ locale: resolveLocale(locale) }),
|
|
29840
30221
|
[locale]
|
|
29841
30222
|
);
|
|
@@ -29899,8 +30280,8 @@ var CommentImages = ({
|
|
|
29899
30280
|
const t = useAccountT(locale);
|
|
29900
30281
|
const theme = useTheme();
|
|
29901
30282
|
const white = [s.white, { fontFamily: theme.fontFamily }];
|
|
29902
|
-
const [selected, setSelected] = (0,
|
|
29903
|
-
(0,
|
|
30283
|
+
const [selected, setSelected] = (0, import_react71.useState)(null);
|
|
30284
|
+
(0, import_react71.useEffect)(() => {
|
|
29904
30285
|
if (selected === null) return;
|
|
29905
30286
|
onPreviewChange(true);
|
|
29906
30287
|
return () => onPreviewChange(false);
|
|
@@ -30156,7 +30537,7 @@ var s = import_react_native35.StyleSheet.create({
|
|
|
30156
30537
|
});
|
|
30157
30538
|
|
|
30158
30539
|
// src/sections/discussion/SwipeReply.tsx
|
|
30159
|
-
var
|
|
30540
|
+
var import_react72 = require("react");
|
|
30160
30541
|
var import_react_native36 = require("react-native");
|
|
30161
30542
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
30162
30543
|
var SwipeReply = ({
|
|
@@ -30167,8 +30548,8 @@ var SwipeReply = ({
|
|
|
30167
30548
|
children
|
|
30168
30549
|
}) => {
|
|
30169
30550
|
const theme = useTheme();
|
|
30170
|
-
const offset = (0,
|
|
30171
|
-
const gesture = (0,
|
|
30551
|
+
const offset = (0, import_react72.useRef)(new import_react_native36.Animated.Value(0)).current;
|
|
30552
|
+
const gesture = (0, import_react72.useMemo)(() => {
|
|
30172
30553
|
const reset = () => import_react_native36.Animated.spring(offset, { toValue: 0, useNativeDriver: true }).start();
|
|
30173
30554
|
return import_react_native36.PanResponder.create({
|
|
30174
30555
|
onMoveShouldSetPanResponder: (_, value6) => enabled && value6.dx < -12 && Math.abs(value6.dx) > Math.abs(value6.dy) * 1.5,
|
|
@@ -30248,17 +30629,17 @@ var EventDiscussionBody = ({
|
|
|
30248
30629
|
var _a2, _b, _c;
|
|
30249
30630
|
const theme = useTheme();
|
|
30250
30631
|
const t = useAccountT(locale);
|
|
30251
|
-
const list2 = (0,
|
|
30252
|
-
const firstContent = (0,
|
|
30253
|
-
const [actions, setActions] = (0,
|
|
30254
|
-
const [reporting, setReporting] = (0,
|
|
30255
|
-
const [moderating, setModerating] = (0,
|
|
30256
|
-
const [reason, setReason] = (0,
|
|
30257
|
-
const [blocksVisible, setBlocksVisible] = (0,
|
|
30258
|
-
const [pickerError, setPickerError] = (0,
|
|
30259
|
-
const [imageOpen, setImageOpen] = (0,
|
|
30260
|
-
const [pickerBusy, setPickerBusy] = (0,
|
|
30261
|
-
const picking = (0,
|
|
30632
|
+
const list2 = (0, import_react73.useRef)(null);
|
|
30633
|
+
const firstContent = (0, import_react73.useRef)(true);
|
|
30634
|
+
const [actions, setActions] = (0, import_react73.useState)(null);
|
|
30635
|
+
const [reporting, setReporting] = (0, import_react73.useState)(null);
|
|
30636
|
+
const [moderating, setModerating] = (0, import_react73.useState)(null);
|
|
30637
|
+
const [reason, setReason] = (0, import_react73.useState)("");
|
|
30638
|
+
const [blocksVisible, setBlocksVisible] = (0, import_react73.useState)(false);
|
|
30639
|
+
const [pickerError, setPickerError] = (0, import_react73.useState)("");
|
|
30640
|
+
const [imageOpen, setImageOpen] = (0, import_react73.useState)(false);
|
|
30641
|
+
const [pickerBusy, setPickerBusy] = (0, import_react73.useState)(false);
|
|
30642
|
+
const picking = (0, import_react73.useRef)(false);
|
|
30262
30643
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
30263
30644
|
const muted = { color: theme.muted, fontFamily: theme.fontFamily };
|
|
30264
30645
|
const closeActions = (work) => {
|
|
@@ -31272,7 +31653,7 @@ var styles13 = import_react_native42.StyleSheet.create({
|
|
|
31272
31653
|
});
|
|
31273
31654
|
|
|
31274
31655
|
// src/sections/Streaming.tsx
|
|
31275
|
-
var
|
|
31656
|
+
var import_react74 = require("react");
|
|
31276
31657
|
var import_react_native43 = require("react-native");
|
|
31277
31658
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
31278
31659
|
var Streaming = (props) => {
|
|
@@ -31294,14 +31675,14 @@ var StreamingView = ({
|
|
|
31294
31675
|
const defaultT = useAccountT(locale);
|
|
31295
31676
|
const t = translate2 != null ? translate2 : defaultT;
|
|
31296
31677
|
const inherited = useTheme();
|
|
31297
|
-
const theme = (0,
|
|
31678
|
+
const theme = (0, import_react74.useMemo)(
|
|
31298
31679
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
31299
31680
|
[inherited, override]
|
|
31300
31681
|
);
|
|
31301
31682
|
const session = hooks_exports.useAuthSession();
|
|
31302
31683
|
const assertOwner = hooks_exports.useSessionAction();
|
|
31303
|
-
const pendingBrowser = (0,
|
|
31304
|
-
const [stored, setStored] = (0,
|
|
31684
|
+
const pendingBrowser = (0, import_react74.useRef)({ scope: session.sessionScope, locked: false });
|
|
31685
|
+
const [stored, setStored] = (0, import_react74.useState)({
|
|
31305
31686
|
scope: session.sessionScope,
|
|
31306
31687
|
busy: false,
|
|
31307
31688
|
error: ""
|
|
@@ -31464,7 +31845,7 @@ var s4 = import_react_native43.StyleSheet.create({
|
|
|
31464
31845
|
});
|
|
31465
31846
|
|
|
31466
31847
|
// src/sections/AccountDeletion.tsx
|
|
31467
|
-
var
|
|
31848
|
+
var import_react75 = require("react");
|
|
31468
31849
|
var import_react_native44 = require("react-native");
|
|
31469
31850
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
31470
31851
|
var AccountDeletion = (props) => {
|
|
@@ -31487,7 +31868,7 @@ var AccountDeletionView = ({
|
|
|
31487
31868
|
const defaultT = useAccountT(locale);
|
|
31488
31869
|
const t = translate2 != null ? translate2 : defaultT;
|
|
31489
31870
|
const inherited = useTheme();
|
|
31490
|
-
const theme = (0,
|
|
31871
|
+
const theme = (0, import_react75.useMemo)(
|
|
31491
31872
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
31492
31873
|
[inherited, override]
|
|
31493
31874
|
);
|
|
@@ -31716,7 +32097,7 @@ var s5 = import_react_native44.StyleSheet.create({
|
|
|
31716
32097
|
});
|
|
31717
32098
|
|
|
31718
32099
|
// src/sections/ProfileSettings.tsx
|
|
31719
|
-
var
|
|
32100
|
+
var import_react76 = require("react");
|
|
31720
32101
|
var import_react_native45 = require("react-native");
|
|
31721
32102
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
31722
32103
|
var ProfileSettings = (props) => {
|
|
@@ -31740,7 +32121,7 @@ var ProfileSettingsView = ({
|
|
|
31740
32121
|
const defaultT = useAccountT(locale);
|
|
31741
32122
|
const t = translate2 != null ? translate2 : defaultT;
|
|
31742
32123
|
const inherited = useTheme();
|
|
31743
|
-
const theme = (0,
|
|
32124
|
+
const theme = (0, import_react76.useMemo)(
|
|
31744
32125
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
31745
32126
|
[inherited, override]
|
|
31746
32127
|
);
|
|
@@ -31752,7 +32133,7 @@ var ProfileSettingsView = ({
|
|
|
31752
32133
|
} catch (e) {
|
|
31753
32134
|
}
|
|
31754
32135
|
};
|
|
31755
|
-
(0,
|
|
32136
|
+
(0, import_react76.useEffect)(() => {
|
|
31756
32137
|
if (flow.settings) flow.open(mode);
|
|
31757
32138
|
}, [mode, flow.scopeKey, Boolean(flow.settings)]);
|
|
31758
32139
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
@@ -32257,7 +32638,7 @@ var AccountPaymentPlanSection = ({
|
|
|
32257
32638
|
};
|
|
32258
32639
|
|
|
32259
32640
|
// src/sections/NotificationPreferences.tsx
|
|
32260
|
-
var
|
|
32641
|
+
var import_react77 = require("react");
|
|
32261
32642
|
var import_react_native48 = require("react-native");
|
|
32262
32643
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
32263
32644
|
var NotificationPreferences = (props) => {
|
|
@@ -32280,7 +32661,7 @@ var NotificationPreferencesView = ({
|
|
|
32280
32661
|
const defaultT = useAccountT(locale);
|
|
32281
32662
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32282
32663
|
const inherited = useTheme();
|
|
32283
|
-
const theme = (0,
|
|
32664
|
+
const theme = (0, import_react77.useMemo)(
|
|
32284
32665
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32285
32666
|
[inherited, override]
|
|
32286
32667
|
);
|
|
@@ -32292,7 +32673,7 @@ var NotificationPreferencesView = ({
|
|
|
32292
32673
|
} catch (e) {
|
|
32293
32674
|
}
|
|
32294
32675
|
};
|
|
32295
|
-
(0,
|
|
32676
|
+
(0, import_react77.useEffect)(() => {
|
|
32296
32677
|
var _a3;
|
|
32297
32678
|
if ((_a3 = flow.preferences) == null ? void 0 : _a3.available) flow.begin();
|
|
32298
32679
|
}, [flow.scopeKey, Boolean(flow.preferences), (_a2 = flow.preferences) == null ? void 0 : _a2.available]);
|
|
@@ -32457,15 +32838,15 @@ var s7 = import_react_native48.StyleSheet.create({
|
|
|
32457
32838
|
var import_react_native54 = require("react-native");
|
|
32458
32839
|
|
|
32459
32840
|
// src/auth/LoginForm.tsx
|
|
32460
|
-
var
|
|
32841
|
+
var import_react79 = require("react");
|
|
32461
32842
|
var import_react_native50 = require("react-native");
|
|
32462
32843
|
|
|
32463
32844
|
// src/auth/PasswordInput.tsx
|
|
32464
|
-
var
|
|
32845
|
+
var import_react78 = require("react");
|
|
32465
32846
|
var import_react_native49 = require("react-native");
|
|
32466
32847
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
32467
32848
|
var PasswordInput = (props) => {
|
|
32468
|
-
const [visible, setVisible] = (0,
|
|
32849
|
+
const [visible, setVisible] = (0, import_react78.useState)(false);
|
|
32469
32850
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_native49.View, { style: styles14.wrap, children: [
|
|
32470
32851
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Input, { ...props, autoCapitalize: "none", secureTextEntry: !visible }),
|
|
32471
32852
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
@@ -32507,9 +32888,9 @@ var LoginForm = ({
|
|
|
32507
32888
|
onFieldChange
|
|
32508
32889
|
}) => {
|
|
32509
32890
|
const theme = useTheme();
|
|
32510
|
-
const [email, setEmail] = (0,
|
|
32511
|
-
const [password, setPassword] = (0,
|
|
32512
|
-
(0,
|
|
32891
|
+
const [email, setEmail] = (0, import_react79.useState)(initialEmail);
|
|
32892
|
+
const [password, setPassword] = (0, import_react79.useState)("");
|
|
32893
|
+
(0, import_react79.useEffect)(() => {
|
|
32513
32894
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
32514
32895
|
}, [email, initialEmail]);
|
|
32515
32896
|
const submit = () => void onSubmit({ email, password });
|
|
@@ -32561,7 +32942,7 @@ var styles15 = import_react_native50.StyleSheet.create({
|
|
|
32561
32942
|
});
|
|
32562
32943
|
|
|
32563
32944
|
// src/auth/EmailCodeForm.tsx
|
|
32564
|
-
var
|
|
32945
|
+
var import_react80 = require("react");
|
|
32565
32946
|
var import_react_native51 = require("react-native");
|
|
32566
32947
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
32567
32948
|
var EmailCodeForm = ({
|
|
@@ -32576,8 +32957,8 @@ var EmailCodeForm = ({
|
|
|
32576
32957
|
onVerify,
|
|
32577
32958
|
onBack
|
|
32578
32959
|
}) => {
|
|
32579
|
-
const [email, setEmail] = (0,
|
|
32580
|
-
const [code, setCode] = (0,
|
|
32960
|
+
const [email, setEmail] = (0, import_react80.useState)(initialEmail);
|
|
32961
|
+
const [code, setCode] = (0, import_react80.useState)("");
|
|
32581
32962
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react_native51.View, { style: { gap: 14 }, children: [
|
|
32582
32963
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MutedText, { children: sent ? `Enter the sign-in code sent to ${target}.` : "Receive a one-time sign-in code by email." }),
|
|
32583
32964
|
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -32633,7 +33014,7 @@ var EmailCodeForm = ({
|
|
|
32633
33014
|
};
|
|
32634
33015
|
|
|
32635
33016
|
// src/auth/ForgotPasswordForm.tsx
|
|
32636
|
-
var
|
|
33017
|
+
var import_react81 = require("react");
|
|
32637
33018
|
var import_react_native52 = require("react-native");
|
|
32638
33019
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
32639
33020
|
var ForgotPasswordForm = ({
|
|
@@ -32647,8 +33028,8 @@ var ForgotPasswordForm = ({
|
|
|
32647
33028
|
onFieldChange
|
|
32648
33029
|
}) => {
|
|
32649
33030
|
const theme = useTheme();
|
|
32650
|
-
const [email, setEmail] = (0,
|
|
32651
|
-
(0,
|
|
33031
|
+
const [email, setEmail] = (0, import_react81.useState)(initialEmail);
|
|
33032
|
+
(0, import_react81.useEffect)(() => {
|
|
32652
33033
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
32653
33034
|
}, [email, initialEmail]);
|
|
32654
33035
|
const submit = () => void onSubmit(email);
|
|
@@ -32696,7 +33077,7 @@ var styles16 = import_react_native52.StyleSheet.create({
|
|
|
32696
33077
|
});
|
|
32697
33078
|
|
|
32698
33079
|
// src/auth/RegisterForm.tsx
|
|
32699
|
-
var
|
|
33080
|
+
var import_react82 = require("react");
|
|
32700
33081
|
var import_react_native53 = require("react-native");
|
|
32701
33082
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
32702
33083
|
var emptyRegistration = (email) => ({
|
|
@@ -32725,30 +33106,30 @@ var RegisterForm = ({
|
|
|
32725
33106
|
onFieldChange
|
|
32726
33107
|
}) => {
|
|
32727
33108
|
var _a2, _b, _c, _d, _e, _f;
|
|
32728
|
-
const t = (0,
|
|
32729
|
-
const [values2, setValues] = (0,
|
|
33109
|
+
const t = (0, import_react82.useMemo)(() => createTranslator({ locale }), [locale]);
|
|
33110
|
+
const [values2, setValues] = (0, import_react82.useState)(
|
|
32730
33111
|
() => emptyRegistration(initialEmail)
|
|
32731
33112
|
);
|
|
32732
|
-
const [termsAccepted, setTermsAccepted] = (0,
|
|
32733
|
-
const [refreshingProof, setRefreshingProof] = (0,
|
|
32734
|
-
const [refreshCode, setRefreshCode] = (0,
|
|
33113
|
+
const [termsAccepted, setTermsAccepted] = (0, import_react82.useState)(false);
|
|
33114
|
+
const [refreshingProof, setRefreshingProof] = (0, import_react82.useState)(false);
|
|
33115
|
+
const [refreshCode, setRefreshCode] = (0, import_react82.useState)("");
|
|
32735
33116
|
const countriesQuery = hooks_exports.useCountries();
|
|
32736
|
-
const countries = (0,
|
|
33117
|
+
const countries = (0, import_react82.useMemo)(() => {
|
|
32737
33118
|
var _a3;
|
|
32738
33119
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
32739
33120
|
}, [countriesQuery.data]);
|
|
32740
33121
|
const statesQuery = hooks_exports.useStates(values2.countryId, {
|
|
32741
33122
|
enabled: requireAddress && Boolean(values2.countryId)
|
|
32742
33123
|
});
|
|
32743
|
-
const states = (0,
|
|
33124
|
+
const states = (0, import_react82.useMemo)(() => {
|
|
32744
33125
|
var _a3;
|
|
32745
33126
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
32746
33127
|
}, [statesQuery.data]);
|
|
32747
|
-
(0,
|
|
33128
|
+
(0, import_react82.useEffect)(() => {
|
|
32748
33129
|
if (initialEmail && !values2.email)
|
|
32749
33130
|
setValues((current5) => ({ ...current5, email: initialEmail }));
|
|
32750
33131
|
}, [initialEmail, values2.email]);
|
|
32751
|
-
(0,
|
|
33132
|
+
(0, import_react82.useEffect)(() => {
|
|
32752
33133
|
var _a3;
|
|
32753
33134
|
if (!requireAddress || values2.countryId || countries.length === 0) return;
|
|
32754
33135
|
const preferred = (_a3 = countries.find((country) => {
|
|
@@ -32769,11 +33150,11 @@ var RegisterForm = ({
|
|
|
32769
33150
|
setValues((current5) => ({ ...current5, [field]: value6 }));
|
|
32770
33151
|
onFieldChange == null ? void 0 : onFieldChange(field);
|
|
32771
33152
|
};
|
|
32772
|
-
const countryOptions = (0,
|
|
33153
|
+
const countryOptions = (0, import_react82.useMemo)(
|
|
32773
33154
|
() => countries.map((country) => ({ label: country.name, value: String(country.id) })),
|
|
32774
33155
|
[countries]
|
|
32775
33156
|
);
|
|
32776
|
-
const stateOptions = (0,
|
|
33157
|
+
const stateOptions = (0, import_react82.useMemo)(
|
|
32777
33158
|
() => states.map((state) => ({ label: state.name, value: String(state.id) })),
|
|
32778
33159
|
[states]
|
|
32779
33160
|
);
|
|
@@ -33372,7 +33753,7 @@ function AccountEmailEnrichment({
|
|
|
33372
33753
|
}
|
|
33373
33754
|
|
|
33374
33755
|
// src/auth/AuthModal.tsx
|
|
33375
|
-
var
|
|
33756
|
+
var import_react83 = require("react");
|
|
33376
33757
|
var import_react_native56 = require("react-native");
|
|
33377
33758
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
33378
33759
|
var Tab = ({
|
|
@@ -33407,7 +33788,7 @@ var CredentialAuthModal = ({
|
|
|
33407
33788
|
}) => {
|
|
33408
33789
|
const theme = useTheme();
|
|
33409
33790
|
const t = useAccountT();
|
|
33410
|
-
const closeAfterAuth = (0,
|
|
33791
|
+
const closeAfterAuth = (0, import_react83.useCallback)(
|
|
33411
33792
|
(profile) => {
|
|
33412
33793
|
onAuthenticated == null ? void 0 : onAuthenticated(profile);
|
|
33413
33794
|
onClose();
|
|
@@ -33599,8 +33980,8 @@ var PhoneAccountModal = ({
|
|
|
33599
33980
|
},
|
|
33600
33981
|
onCancelled: onClose
|
|
33601
33982
|
});
|
|
33602
|
-
const prepared = (0,
|
|
33603
|
-
(0,
|
|
33983
|
+
const prepared = (0, import_react83.useRef)(false);
|
|
33984
|
+
(0, import_react83.useEffect)(() => {
|
|
33604
33985
|
if (prepared.current) return;
|
|
33605
33986
|
prepared.current = true;
|
|
33606
33987
|
if (initialEmail) flow.emailAuth.showLogin(initialEmail);
|
|
@@ -33690,7 +34071,7 @@ var styles18 = import_react_native56.StyleSheet.create({
|
|
|
33690
34071
|
});
|
|
33691
34072
|
|
|
33692
34073
|
// src/auth/ResetPasswordForm.tsx
|
|
33693
|
-
var
|
|
34074
|
+
var import_react84 = require("react");
|
|
33694
34075
|
var import_react_native57 = require("react-native");
|
|
33695
34076
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
33696
34077
|
var ResetPasswordForm = ({
|
|
@@ -33699,11 +34080,11 @@ var ResetPasswordForm = ({
|
|
|
33699
34080
|
onBackToLogin
|
|
33700
34081
|
}) => {
|
|
33701
34082
|
const theme = useTheme();
|
|
33702
|
-
const [password, setPassword] = (0,
|
|
33703
|
-
const [confirmation, setConfirmation] = (0,
|
|
33704
|
-
const [submitted, setSubmitted] = (0,
|
|
33705
|
-
const [success, setSuccess] = (0,
|
|
33706
|
-
const validation = (0,
|
|
34083
|
+
const [password, setPassword] = (0, import_react84.useState)("");
|
|
34084
|
+
const [confirmation, setConfirmation] = (0, import_react84.useState)("");
|
|
34085
|
+
const [submitted, setSubmitted] = (0, import_react84.useState)(false);
|
|
34086
|
+
const [success, setSuccess] = (0, import_react84.useState)(false);
|
|
34087
|
+
const validation = (0, import_react84.useMemo)(() => {
|
|
33707
34088
|
if (!submitted)
|
|
33708
34089
|
return {};
|
|
33709
34090
|
return {
|
|
@@ -33762,7 +34143,7 @@ var styles19 = import_react_native57.StyleSheet.create({
|
|
|
33762
34143
|
});
|
|
33763
34144
|
|
|
33764
34145
|
// src/EmbeddedCheckout.tsx
|
|
33765
|
-
var
|
|
34146
|
+
var import_react85 = require("react");
|
|
33766
34147
|
var import_react_native58 = require("react-native");
|
|
33767
34148
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
33768
34149
|
var Flow = ({
|
|
@@ -33790,13 +34171,13 @@ var Flow = ({
|
|
|
33790
34171
|
var _a2;
|
|
33791
34172
|
const checkout = useCheckoutContext();
|
|
33792
34173
|
const theme = useTheme();
|
|
33793
|
-
const [view, setView] = (0,
|
|
33794
|
-
const [selectionView, setSelectionView] = (0,
|
|
33795
|
-
const editedDetailsRef = (0,
|
|
33796
|
-
const [authRequest, setAuthRequest] = (0,
|
|
34174
|
+
const [view, setView] = (0, import_react85.useState)(initialView);
|
|
34175
|
+
const [selectionView, setSelectionView] = (0, import_react85.useState)(initialView);
|
|
34176
|
+
const editedDetailsRef = (0, import_react85.useRef)(null);
|
|
34177
|
+
const [authRequest, setAuthRequest] = (0, import_react85.useState)(
|
|
33797
34178
|
null
|
|
33798
34179
|
);
|
|
33799
|
-
const [privacyAttempted, setPrivacyAttempted] = (0,
|
|
34180
|
+
const [privacyAttempted, setPrivacyAttempted] = (0, import_react85.useState)(false);
|
|
33800
34181
|
const openBuiltInAuth = (email) => setAuthRequest((current5) => {
|
|
33801
34182
|
var _a3;
|
|
33802
34183
|
return { email, key: ((_a3 = current5 == null ? void 0 : current5.key) != null ? _a3 : 0) + 1 };
|
|
@@ -33809,7 +34190,7 @@ var Flow = ({
|
|
|
33809
34190
|
orderFixed: checkout.orderFixed
|
|
33810
34191
|
});
|
|
33811
34192
|
const leaveAllowed = canLeavePayment(checkout);
|
|
33812
|
-
(0,
|
|
34193
|
+
(0, import_react85.useEffect)(() => {
|
|
33813
34194
|
if (visibleView === view) return;
|
|
33814
34195
|
if (visibleView === "checkout") setView("checkout");
|
|
33815
34196
|
else {
|
|
@@ -33817,7 +34198,7 @@ var Flow = ({
|
|
|
33817
34198
|
setSelectionView("tickets");
|
|
33818
34199
|
}
|
|
33819
34200
|
}, [view, visibleView]);
|
|
33820
|
-
(0,
|
|
34201
|
+
(0, import_react85.useEffect)(() => {
|
|
33821
34202
|
onViewChange == null ? void 0 : onViewChange(visibleView);
|
|
33822
34203
|
}, [onViewChange, visibleView]);
|
|
33823
34204
|
const enterCheckout = (from) => {
|