Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
89 lines
4 KiB
TypeScript
89 lines
4 KiB
TypeScript
// Module ID: 7531
|
|
// Function ID: 7532
|
|
// Name: PremiumPlanPurchasedStore
|
|
// Dependencies: [4328, 1374, 560, 1248, 7532, 7292, 2]
|
|
// Exports: handleMobileWebCheckoutStatus, reset, setInitiatedPurchaseFromNewFlow, setMobileWebRedirectCheckoutStatus, setPaymentSuccess, showOldPaymentFlowSuccess
|
|
|
|
// Module 7531 (PremiumPlanPurchasedStore)
|
|
import ReactBatchUpdates from "ReactBatchUpdates" /* 1248 */;
|
|
import AnalyticsLocationDefault from "AnalyticsLocation" /* 7292 */;
|
|
import openPremiumPlanSelectionActionSheetDefault from "openPremiumPlanSelectionActionSheet" /* 7532 */;
|
|
import ActionSheetStore from "ActionSheetStore" /* 4328 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
const PremiumConstants = fn(1374);
|
|
({ PREMIUM_PLAN_SELECTION_ACTION_SHEET_KEY: closure_4, PremiumTypes: hasOwnProperty } = PremiumConstants);
|
|
const module_560 = fn(560);
|
|
const obj3 = module_560.create(() => ({ productId: "", initiatedPurchaseFromNewFlow: false, isPaymentSuccess: false, mobileWebRedirectCheckoutStatus: null }));
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/premium/native/PremiumPlanPurchasedStore.tsx");
|
|
|
|
export const usePremiumPlanPurchasedStore = obj3;
|
|
export const setInitiatedPurchaseFromNewFlow = function setInitiatedPurchaseFromNewFlow(arg0) {
|
|
({ productId: require, onPaymentSuccess: importDefault, onPaymentDismiss: dependencyMap } = arg0);
|
|
ReactBatchUpdates.batchUpdates(() => {
|
|
obj3.setState({ productId, initiatedPurchaseFromNewFlow: true, onPaymentSuccess, onPaymentDismiss });
|
|
});
|
|
};
|
|
export const setPaymentSuccess = function setPaymentSuccess() {
|
|
if (obj3.getState().initiatedPurchaseFromNewFlow) {
|
|
const state = obj3.getState();
|
|
const onPaymentSuccess = state.onPaymentSuccess;
|
|
ReactBatchUpdates.batchUpdates(() => state.setState({ isPaymentSuccess: true }));
|
|
if (onPaymentSuccess != null) {
|
|
onPaymentSuccess(state.productId);
|
|
}
|
|
}
|
|
};
|
|
export const setMobileWebRedirectCheckoutStatus = function setMobileWebRedirectCheckoutStatus(mobileWebRedirectCheckoutStatus) {
|
|
_require = mobileWebRedirectCheckoutStatus;
|
|
require("ReactBatchUpdates").batchUpdates(() => obj3.setState({ mobileWebRedirectCheckoutStatus }));
|
|
};
|
|
export const handleMobileWebCheckoutStatus = function handleMobileWebCheckoutStatus(mobileWebRedirectCheckoutStatus) {
|
|
_require = mobileWebRedirectCheckoutStatus;
|
|
if ("succeeded" === mobileWebRedirectCheckoutStatus) {
|
|
const state = obj3.getState();
|
|
const onPaymentSuccess = state.onPaymentSuccess;
|
|
if ("dismissed" !== state.mobileWebRedirectCheckoutStatus) {
|
|
if (ActionSheetStore.getKey() !== closure_4) {
|
|
const obj = { premiumType: TIER_2.TIER_2, analyticsLocations: null, analyticsLocation: null };
|
|
const items = [AnalyticsLocationDefault.DEEPLINK];
|
|
obj.analyticsLocations = items;
|
|
obj.analyticsLocation = {};
|
|
openPremiumPlanSelectionActionSheetDefault(obj);
|
|
}
|
|
require("ReactBatchUpdates").batchUpdates(() => obj3.setState({ isPaymentSuccess: true, mobileWebRedirectCheckoutStatus }));
|
|
if (null != onPaymentSuccess) {
|
|
onPaymentSuccess(tmp13);
|
|
}
|
|
const obj2 = require("ReactBatchUpdates");
|
|
}
|
|
}
|
|
};
|
|
export const showOldPaymentFlowSuccess = function showOldPaymentFlowSuccess(fn) {
|
|
if (obj3.getState().initiatedPurchaseFromNewFlow) {
|
|
ReactBatchUpdates.batchUpdates(() => state.setState({ isPaymentSuccess: true }));
|
|
} else {
|
|
fn();
|
|
}
|
|
};
|
|
export const reset = function reset() {
|
|
const state = obj3.getState();
|
|
({ onPaymentDismiss, mobileWebRedirectCheckoutStatus: require } = state);
|
|
if (onPaymentDismiss != null) {
|
|
const obj = { productId: tmp2, isSuccess: tmp3 };
|
|
onPaymentDismiss(obj);
|
|
}
|
|
ReactBatchUpdates.batchUpdates(() => {
|
|
let str = null;
|
|
if (null != _require) {
|
|
str = null;
|
|
if ("in_mobile_web" !== tmp2) {
|
|
str = "dismissed";
|
|
}
|
|
}
|
|
obj3.setState({ productId: "", initiatedPurchaseFromNewFlow: false, isPaymentSuccess: false, mobileWebRedirectCheckoutStatus: str, onPaymentSuccess: "r", onPaymentDismiss: "call" });
|
|
});
|
|
};
|