2026-09-14 20:04:03 +00:00
|
|
|
// Module ID: 15316
|
|
|
|
|
// Function ID: 15317
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useTrialIntervalOptions
|
2026-09-14 20:04:03 +00:00
|
|
|
// Dependencies: [19, 15289, 1373, 1114, 15315, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-14 20:04:03 +00:00
|
|
|
// Module 15316 (useTrialIntervalOptions)
|
2026-09-10 05:38:07 +00:00
|
|
|
import noop from "module_19" /* 19 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const require = fn;
|
2026-09-14 20:04:03 +00:00
|
|
|
const TIER_TRIAL_INTERVALS = fn(15289).TIER_TRIAL_INTERVALS;
|
2026-09-10 05:38:07 +00:00
|
|
|
const SubscriptionIntervalTypes = fn(1373).SubscriptionIntervalTypes;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/guild_role_subscriptions/useTrialIntervalOptions.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useTrialIntervalOptions(arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [arg0];
|
2026-09-10 05:38:07 +00:00
|
|
|
return noop.useMemo(() => {
|
|
|
|
|
const options = TIER_TRIAL_INTERVALS.map((value) => {
|
|
|
|
|
const obj = { value, label: null, isDefault: null };
|
|
|
|
|
if (value.interval === constants.DAY) {
|
|
|
|
|
if (7 === value.interval_count) {
|
|
|
|
|
const intl = closure_1_0(1114).intl;
|
2026-09-14 20:04:03 +00:00
|
|
|
const obj3 = { defaultLimit: closure_1_0(15315).formatPlanIntervalDuration(value) };
|
2026-09-10 05:38:07 +00:00
|
|
|
let formatToPlainStringResult = intl.formatToPlainString(closure_1_0(1114).t.XfSsr1, obj3);
|
2026-09-14 20:04:03 +00:00
|
|
|
const obj4 = closure_1_0(15315);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj.label = formatToPlainStringResult;
|
|
|
|
|
let tmp5 = value.interval === tmp.DAY;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (tmp5) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tmp5 = 7 === value.interval_count;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj.isDefault = tmp5;
|
2026-07-20 16:05:17 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
2026-09-14 20:04:03 +00:00
|
|
|
formatToPlainStringResult = closure_1_0(15315).formatPlanIntervalDuration(value);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
2026-07-29 08:29:29 +00:00
|
|
|
let selectedOption = closure_0;
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != closure_0) {
|
2026-07-29 08:29:29 +00:00
|
|
|
const iter = options.find((value) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp = null != value.value;
|
|
|
|
|
if (tmp) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tmp = value.value.interval === closure_1_0.interval;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (tmp) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tmp = value.value.interval_count === closure_1_0.interval_count;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
2026-09-10 05:38:07 +00:00
|
|
|
value = undefined;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (iter != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
value = iter.value;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
selectedOption = value;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
return { options, selectedOption };
|
2026-07-20 16:05:17 +00:00
|
|
|
}, items);
|
|
|
|
|
};
|