decord/source/modules/premium/native/hooks/useCheckoutPlanPriceString.tsx

135 lines
4.7 KiB
TypeScript
Raw Normal View History

// Module ID: 13431
// Function ID: 13432
// Name: useCheckoutPlanPriceString
// Dependencies: [19, 7527, 1150, 7512, 2]
2026-09-03 10:05:34 +00:00
// Exports: useCheckoutPlan, useCheckoutPlanDiscountPrices, useCheckoutPlanPriceString
2026-07-20 16:05:17 +00:00
// Module 13431 (useCheckoutPlanPriceString)
import PremiumBundledPlansUtils from "PremiumBundledPlansUtils" /* 7512 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
require = fn;
const useNativeCheckoutStore = fn(7527).useNativeCheckoutStore;
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/native/hooks/useCheckoutPlanPriceString.tsx");
2026-07-20 16:05:17 +00:00
2026-09-03 10:05:34 +00:00
export const useCheckoutPlan = function useCheckoutPlan(arg0) {
_require = arg0;
2026-09-03 10:05:34 +00:00
const tmp2 = useNativeCheckoutStore((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
dependencyMap = tmp2;
const tmp = useNativeCheckoutStore((orderRequired) => orderRequired.orderRequired);
const tmp3 = require("PlatformUtils").isIOS() && tmp;
noop = tmp3;
const obj2 = { plan: null, useOrderPricing: tmp3 };
const items = [tmp2, arg0, tmp3];
obj2.plan = noop.useMemo(() => {
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != closure_1) {
2026-09-03 10:05:34 +00:00
availablePlanForItems = null;
if (null != closure_0) {
availablePlanForItems = obj.getAvailablePlanForItems(PremiumBundledPlansUtils.getSubscriptionItemsForProduct(tmp2));
2026-09-03 10:05:34 +00:00
}
}
obj = closure_1;
}
return availablePlanForItems;
}, items);
return obj2;
2026-09-03 10:05:34 +00:00
};
export const useCheckoutPlanDiscountPrices = function useCheckoutPlanDiscountPrices(productId, discountedPriceString) {
let memo = productId;
const tmp2 = regularPriceString((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
const tmp = regularPriceString((orderRequired) => orderRequired.orderRequired);
let tmp3 = memo(1150).isIOS() && tmp;
2026-09-03 10:05:34 +00:00
discountedPriceString = tmp3;
const items = [tmp2, productId, tmp3];
memo = discountedPriceString.useMemo(() => {
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != closure_1) {
2026-09-03 10:05:34 +00:00
availablePlanForItems = null;
if (null != closure_0) {
availablePlanForItems = obj.getAvailablePlanForItems(PremiumBundledPlansUtils.getSubscriptionItemsForProduct(tmp2));
2026-09-03 10:05:34 +00:00
}
}
obj = closure_1;
2026-09-03 10:05:34 +00:00
}
return availablePlanForItems;
}, items);
dependencyMap = tmp3;
discountedPriceString = discountedPriceString.discountedPriceString;
regularPriceString = discountedPriceString.regularPriceString;
const items1 = [discountedPriceString, memo, regularPriceString, tmp3];
return discountedPriceString.useMemo(() => {
if (closure_1) {
if (null == memo) {
return null;
} else {
discountedPriceString = obj2.getDiscountedPriceString();
let tmp7 = null;
if (null != discountedPriceString) {
const obj3 = { discountedPrice: discountedPriceString, regularPrice: obj2.getRegularPriceString() };
tmp7 = obj3;
2026-09-03 10:05:34 +00:00
}
return tmp7;
}
} else {
let tmp3 = null;
if (null != discountedPriceString) {
tmp3 = null;
if (null != regularPriceString) {
const obj = { discountedPrice: tmp, regularPrice: tmp4 };
2026-09-03 10:05:34 +00:00
tmp3 = obj;
}
}
return tmp3;
}
}, items1);
};
export const useCheckoutPlanPriceString = function useCheckoutPlanPriceString(productId, stateFromStores) {
2026-07-20 16:05:17 +00:00
let priceString;
if (stateFromStores != null) {
priceString = stateFromStores.priceString;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (priceString == null) {
priceString = null;
2026-07-20 16:05:17 +00:00
}
_require = productId;
2026-07-29 08:29:29 +00:00
const tmp3 = useNativeCheckoutStore((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
2026-09-03 10:05:34 +00:00
const tmp2 = useNativeCheckoutStore((orderRequired) => orderRequired.orderRequired);
const tmp4 = require("PlatformUtils").isIOS() && tmp2;
noop = tmp4;
2026-09-03 10:05:34 +00:00
const items = [tmp3, productId, tmp4];
const memo = noop.useMemo(() => {
2026-09-03 10:05:34 +00:00
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != closure_1) {
2026-09-03 10:05:34 +00:00
availablePlanForItems = null;
if (null != closure_0) {
availablePlanForItems = obj.getAvailablePlanForItems(PremiumBundledPlansUtils.getSubscriptionItemsForProduct(tmp2));
2026-09-03 10:05:34 +00:00
}
2026-07-20 16:05:17 +00:00
}
obj = closure_1;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
return availablePlanForItems;
2026-07-20 16:05:17 +00:00
}, items);
2026-09-03 10:05:34 +00:00
if (tmp4) {
let priceString1;
if (memo != null) {
priceString1 = memo.getPriceString();
}
if (priceString1 == null) {
priceString1 = null;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
priceString = priceString1;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
return priceString;
2026-07-20 16:05:17 +00:00
};