decord/source/modules/premium/PremiumSubscription.tsx

60 lines
2 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 3789
2026-07-27 11:26:19 +00:00
// Function ID: 29542
2026-07-20 16:05:17 +00:00
// Name: getNonePlanIdForIntervalType
2026-07-25 08:10:48 +00:00
// Dependencies: [1852, 2]
2026-07-20 16:05:17 +00:00
// Exports: getBasePlanIdForSubscriptionItems, getNonePlanIdForSubscription
2026-07-25 08:10:48 +00:00
// Module 3789 (getNonePlanIdForIntervalType)
2026-07-23 10:11:24 +00:00
import GuildFeatures from "GuildFeatures";
let closure_0;
let closure_1;
let closure_2;
2026-07-20 16:05:17 +00:00
function getNonePlanIdForIntervalType(interval, intervalCount) {
let num = intervalCount;
2026-07-23 10:11:24 +00:00
const constants = interval;
2026-07-20 16:05:17 +00:00
if (intervalCount === undefined) {
num = 1;
}
const keys = Object.keys(num);
let NONE_MONTH = keys.find((arg0) => {
let tmp2 = null != tmp;
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = tmp.skuId === outer1_2.NONE;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = tmp.interval === closure_0;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
tmp2 = tmp.intervalCount === num;
}
return tmp2;
});
if (null == NONE_MONTH) {
2026-07-23 10:11:24 +00:00
NONE_MONTH = constants.NONE_MONTH;
2026-07-20 16:05:17 +00:00
}
return NONE_MONTH;
}
function getBaseSubscriptionItemForSubscriptionItems(arr) {
2026-07-23 10:11:24 +00:00
return arr.find((arg0) => null != outer1_1[arg0.planId] && null != outer1_1[arg0.planId].premiumType);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ SubscriptionPlans: closure_0, SubscriptionPlanInfo: closure_1, PremiumSubscriptionSKUs: closure_2 } = GuildFeatures);
const result = require("set").fileFinishedImporting("modules/premium/PremiumSubscription.tsx");
2026-07-20 16:05:17 +00:00
export { getNonePlanIdForIntervalType };
export const getNonePlanIdForSubscription = function getNonePlanIdForSubscription(arg0) {
2026-07-23 10:11:24 +00:00
return getNonePlanIdForIntervalType(dependencyMap[arg0.items[0].planId].interval, dependencyMap[arg0.items[0].planId].intervalCount);
2026-07-20 16:05:17 +00:00
};
export { getBaseSubscriptionItemForSubscriptionItems };
export const getBasePlanIdForSubscriptionItems = function getBasePlanIdForSubscriptionItems(items, interval, intervalCount) {
const tmp = getBaseSubscriptionItemForSubscriptionItems(items);
if (null == tmp) {
if (items.length > 0) {
2026-07-23 10:11:24 +00:00
({ interval, intervalCount } = dependencyMap[items[0].planId]);
2026-07-20 16:05:17 +00:00
}
return getNonePlanIdForIntervalType(interval, intervalCount);
} else {
return tmp.planId;
}
};