decord/source/modules/premium/native/NoticeStore.tsx

166 lines
5.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13328
// Function ID: 13329
2026-07-29 08:29:29 +00:00
// Name: clearDismissUntil
2026-08-24 06:08:38 +00:00
// Dependencies: [7459, 1924, 676, 595, 3978, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 13328 (clearDismissUntil)
import initializeDefault from "initialize" /* 589 */;
import Storage4 from "Storage" /* 595 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import tDefault from "t" /* 3978 */;
import closure_3 from "emitChanges" /* 7459 */;
import { PremiumSubscriptionSKUs } from "GuildFeatures" /* 1924 */;
import { NoticeTypes } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function clearDismissUntil(arg0) {
2026-08-24 06:08:38 +00:00
const Storage = Storage4.Storage;
2026-07-29 08:29:29 +00:00
Storage.remove(`${closure_8[arg0]}-untilAtLeast`);
2026-07-20 16:05:17 +00:00
}
function isNoticeDismissed(PREMIUM_TIER_0_TRIAL_ENDING) {
if (null == PREMIUM_TIER_0_TRIAL_ENDING) {
return false;
} else {
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[PREMIUM_TIER_0_TRIAL_ENDING]) {
2026-08-24 06:08:38 +00:00
const Storage = Storage4.Storage;
2026-07-29 08:29:29 +00:00
const value = Storage.get(`${tmp10[PREMIUM_TIER_0_TRIAL_ENDING]}-untilAtLeast`);
let tmp4 = null;
2026-07-20 16:05:17 +00:00
if (null != value) {
2026-08-24 06:08:38 +00:00
tmp4 = tDefault(value);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (null != tmp4) {
2026-08-24 06:08:38 +00:00
return tmp4.isAfter(tDefault());
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp6 = null != tmp11;
if (tmp6) {
tmp6 = "" !== tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-08-24 06:08:38 +00:00
const Storage2 = Storage4.Storage;
2026-07-29 08:29:29 +00:00
let flag = Storage2.get(tmp11);
if (flag == null) {
flag = false;
}
tmp6 = flag;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
}
}
function updateNotice() {
2026-08-24 06:08:38 +00:00
c6 = null;
2026-07-29 08:29:29 +00:00
const iter = items[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp3 = nextResult;
let tmp4 = NoticeTypes;
if (nextResult === NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING) {
let tmp9 = store;
let tmp10 = PremiumSubscriptionSKUs;
items = [PremiumSubscriptionSKUs.TIER_2];
if (store.getAlmostExpiringTrialOffersForReminder(items).length > 0) {
let tmp11 = isNoticeDismissed;
if (!isNoticeDismissed(tmp4.PREMIUM_TIER_2_TRIAL_ENDING)) {
let tmp12 = nextResult;
c6 = tmp3;
let tmp13 = iter;
iter.return();
break;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
} else {
let tmp5 = nextResult;
if (tmp3 === tmp4.PREMIUM_TIER_0_TRIAL_ENDING) {
let tmp14 = store;
let tmp15 = PremiumSubscriptionSKUs;
let items1 = [PremiumSubscriptionSKUs.TIER_0];
if (store.getAlmostExpiringTrialOffersForReminder(items1).length > 0) {
let tmp6 = isNoticeDismissed;
if (!isNoticeDismissed(tmp4.PREMIUM_TIER_0_TRIAL_ENDING)) {
let tmp7 = nextResult;
c6 = tmp3;
let tmp8 = iter;
iter.return();
break;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
break;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let c6 = null;
2026-07-23 10:11:24 +00:00
let items = [, ];
2026-07-20 16:05:17 +00:00
({ PREMIUM_TIER_2_TRIAL_ENDING: arr[0], PREMIUM_TIER_0_TRIAL_ENDING: arr[1] } = NoticeTypes);
2026-07-29 08:29:29 +00:00
let closure_8 = { [NoticeTypes.PREMIUM_TIER_0_TRIAL_ENDING]: "hidePremiumTier0TrialEndingReminder", [NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING]: "hidePremiumTier2TrialEndingReminder" };
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class NoticeStore extends Store {
}
const prototype = NoticeStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
items = [closure_3];
2026-07-29 08:29:29 +00:00
this.syncWith(items, updateNotice);
2026-08-24 06:08:38 +00:00
this.waitFor(closure_3);
2026-07-29 08:29:29 +00:00
};
prototype["getNoticeType"] = function getNoticeType() {
return c6;
};
NoticeStore.displayName = "NoticeStore";
2026-08-24 06:08:38 +00:00
const noticeStore = new NoticeStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: updateNotice,
CURRENT_USER_UPDATE: updateNotice,
PREMIUM_PAYMENT_SUBSCRIBE_SUCCESS: updateNotice,
BILLING_SUBSCRIPTION_UPDATE_SUCCESS: updateNotice,
BILLING_MOST_RECENT_SUBSCRIPTION_FETCH_SUCCESS: updateNotice,
BILLING_SUBSCRIPTION_FETCH_SUCCESS: updateNotice,
LOGOUT: function handleLogout() {
2026-07-29 08:29:29 +00:00
(function clearStorage() {
const iter = dependencyMap[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp4 = table2;
let tmp5 = table2[nextResult];
let tmp3 = nextResult;
if (null != tmp5) {
let tmp7 = callback;
let tmp8 = table;
let Storage = callback(table[3]).Storage;
let tmp9 = tmp5;
let removeResult = Storage.remove(tmp6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp11 = callback2;
let tmp12 = nextResult;
let tmp13 = callback2(tmp3);
continue;
}
})();
2026-08-24 06:08:38 +00:00
c6 = null;
2026-07-20 16:05:17 +00:00
},
NOTICE_DISMISS: function handleNoticeDismiss(untilAtLeast) {
2026-07-29 08:29:29 +00:00
if (null != c6) {
let result1 = untilAtLeast;
let text = c6;
untilAtLeast = untilAtLeast.untilAtLeast;
if (null != c6) {
result1 = dependencyMap;
if (null != dependencyMap[text]) {
2026-08-24 06:08:38 +00:00
const Storage = Storage4.Storage;
2026-07-29 08:29:29 +00:00
const result = Storage.set(tmp13, true);
}
if (null == untilAtLeast) {
2026-08-24 06:08:38 +00:00
const Storage2 = Storage4.Storage;
2026-07-29 08:29:29 +00:00
Storage2.remove(`${tmp10[tmp9]}-untilAtLeast`);
}
2026-08-24 06:08:38 +00:00
const Storage3 = Storage4.Storage;
2026-07-29 08:29:29 +00:00
text = `${tmp10[tmp9]}-untilAtLeast`;
result1 = Storage3.set(`${tmp10[tmp9]}-untilAtLeast`, untilAtLeast.format("YYYY-MM-DDTHH:mm:ss.SSSZ"));
}
2026-07-20 16:05:17 +00:00
updateNotice();
}
}
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/premium/native/NoticeStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default noticeStore;