decord/alpha/source/modules/premium/PremiumSubscription.tsx

70 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 4740
// Function ID: 4741
// Name: PremiumSubscription
2026-10-09 10:00:15 +00:00
// Dependencies: [1392, 2]
2026-07-29 08:29:29 +00:00
// Exports: getBasePlanIdForSubscriptionItems, getBaseSubscriptionItemForSubscriptionItems, getNonePlanIdForIntervalType, getNonePlanIdForSubscription
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 4740 (PremiumSubscription)
import PremiumConstants from "PremiumConstants" /* 1392 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let constants;
let _window;
let c2;
let map;
({ SubscriptionPlans: _window, SubscriptionPlanInfo: map, PremiumSubscriptionSKUs: c2 } = PremiumConstants);
const result = size.fileFinishedImporting("modules/premium/PremiumSubscription.tsx");
2026-07-29 08:29:29 +00:00
export const getNonePlanIdForIntervalType = function getNonePlanIdForIntervalType(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
constants = arg0;
2026-07-29 08:29:29 +00:00
let num = arg1;
if (arg1 === undefined) {
2026-07-20 16:05:17 +00:00
num = 1;
}
const keys = Object.keys(num);
2026-10-03 08:58:59 +00:00
let NONE_MONTH = keys.find((item) => null != tmp && tmp.skuId === constants.NONE && tmp.interval === interval && tmp.intervalCount === intervalCount);
2026-07-29 08:29:29 +00:00
if (NONE_MONTH == null) {
2026-07-23 10:11:24 +00:00
NONE_MONTH = constants.NONE_MONTH;
2026-07-20 16:05:17 +00:00
}
return NONE_MONTH;
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const getNonePlanIdForSubscription = function getNonePlanIdForSubscription(arg0) {
let num;
2026-07-29 08:29:29 +00:00
const interval = tmp2.interval;
2026-10-03 08:58:59 +00:00
const tmp = num;
2026-07-29 08:29:29 +00:00
if (num === undefined) {
num = 1;
}
2026-10-03 08:58:59 +00:00
const keys = Object.keys(tmp);
let NONE_MONTH = keys.find((item) => null != tmp && tmp.skuId === constants.NONE && tmp.interval === interval && tmp.intervalCount === intervalCount);
2026-07-29 08:29:29 +00:00
if (NONE_MONTH == null) {
NONE_MONTH = interval.NONE_MONTH;
}
return NONE_MONTH;
};
2026-08-13 07:00:46 +00:00
export const getBaseSubscriptionItemForSubscriptionItems = function getBaseSubscriptionItemForSubscriptionItems(items) {
return items.find((item) => null != intervalCount[item.planId] && null != intervalCount[item.planId].premiumType);
2026-07-20 16:05:17 +00:00
};
export const getBasePlanIdForSubscriptionItems = function getBasePlanIdForSubscriptionItems(items, interval, intervalCount) {
const found = items.find((item) => null != intervalCount[item.planId] && null != intervalCount[item.planId].premiumType);
2026-07-29 08:29:29 +00:00
if (null == found) {
2026-07-20 16:05:17 +00:00
if (items.length > 0) {
2026-07-29 08:29:29 +00:00
({ interval, intervalCount } = intervalCount[items[0].planId]);
}
if (intervalCount === undefined) {
intervalCount = 1;
}
const _Object = Object;
const keys = Object.keys(intervalCount);
2026-10-03 08:58:59 +00:00
let NONE_MONTH = keys.find((item) => null != tmp && tmp.skuId === constants.NONE && tmp.interval === interval && tmp.intervalCount === intervalCount);
2026-07-29 08:29:29 +00:00
if (NONE_MONTH == null) {
NONE_MONTH = interval.NONE_MONTH;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return NONE_MONTH;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
return found.planId;
2026-07-20 16:05:17 +00:00
}
};