55 lines
3.3 KiB
TypeScript
55 lines
3.3 KiB
TypeScript
/* Metro module 10109; source: modules/payments/native/NativePaymentContext.tsx; dependencies: [57, 31, 3807, 33, 7045, 7943, 6847, 10110, 566, 2] */
|
|
function _fun78912(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:6, offset: 0x01e3baff, size: 224 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importDefault(57) /* metro dependency 57 */;
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */;
|
|
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = value((importDefault(7045) /* metro dependency 7045: ContextUtils */)(), 3);
|
|
const env0_6 = value[0];
|
|
const property = value[1];
|
|
const property2 = value[2];
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/payments/native/NativePaymentContext.tsx');
|
|
exports.NativePaymentContextProvider = NativePaymentContextProvider;
|
|
exports.useNativeIAPPaymentContext = property;
|
|
exports.useForwardedNativePaymentContext = property2;
|
|
}
|
|
|
|
function NativePaymentContextProvider({children, skuIDs, activeSubscription}) { // fn#78913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:291, offset: 0x01e3bbdf, size: 261 bytes, params: 2, frame: 24
|
|
const {nativePaymentsConnected,
|
|
storeFront} = (importDefault(7943) /* metro dependency 7943: NativePaymentHooksAndroid */).useNativeIAPPayments();
|
|
env0_3.useEffect(_fun78914, [storeFront, skuIDs]);
|
|
const {selectedPlanId,
|
|
setSelectedPlanId} = (importDefault(10110) /* metro dependency 10110: useSubscriptionSelection */)();
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SubscriptionPlanStore],
|
|
_fun78915, [selectedPlanId]);
|
|
const Provider = env0_6.Provider;
|
|
return (
|
|
<Provider
|
|
value={{isReadyToPurchase: nativePaymentsConnected, setSelectedPlanId: setSelectedPlanId,
|
|
selectedPlan: value4, storeFront: storeFront, activeSubscription: activeSubscription}}
|
|
>
|
|
{children}
|
|
</Provider>
|
|
);
|
|
}
|
|
|
|
function _fun78914() { // fn#78914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:466, offset: 0x01e3bce4, size: 98 bytes, params: 1, frame: 14
|
|
var value4;
|
|
var moduleValue;
|
|
if (!(storeFront == null || SubscriptionPlanStore.isFetchingForSKUs(skuIDs))) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(6847) /* metro dependency 6847: SubscriptionPlanActionCreators */;
|
|
moduleValue.fetchSubscriptionPlansBySKUs(skuIDs, storeFront.country);
|
|
}
|
|
}
|
|
|
|
function _fun78915() { // fn#78915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:654, offset: 0x01e3bd46, size: 39 bytes, params: 1, frame: 12
|
|
const selectedPlanIdBinding = selectedPlanId;
|
|
const value2 = null;
|
|
return value2 != selectedPlanIdBinding ? SubscriptionPlanStore.get(selectedPlanId) : value2;
|
|
}
|
|
|