decord/source/modules/storefront/SKUPricesStore.tsx

257 lines
8.5 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5960
// Function ID: 5961
2026-07-29 08:29:29 +00:00
// Name: resetStoreState
2026-08-25 06:04:03 +00:00
// Dependencies: [1996, 589, 1370, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 5960 (resetStoreState)
2026-08-24 06:08:38 +00:00
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1370 */;
2026-08-25 06:04:03 +00:00
import closure_2 from "_getSystemLocale" /* 1996 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function resetStoreState() {
2026-08-24 06:08:38 +00:00
closure_3 = {};
closure_4 = {};
closure_5 = {};
closure_6 = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let closure_3 = {};
let closure_4 = {};
let closure_5 = {};
let closure_6 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class SKUPricesStore extends Store {
}
const prototype = SKUPricesStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_2);
const items = [closure_2];
2026-07-29 08:29:29 +00:00
this.syncWith(items, resetStoreState);
};
prototype["getPricesForSkuId"] = function getPricesForSkuId(id) {
if (null != id) {
let pricingResultId;
if (dependencyMap[id] != null) {
pricingResultId = tmp2.pricingResultId;
}
if (null != pricingResultId) {
return table[pricingResultId];
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
};
prototype["getFetchStateForSkuId"] = function getFetchStateForSkuId(arg0) {
if (null != arg0) {
const obj = { type: "sku", skuId: null };
obj[1] = arg0;
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return closure_3[combined];
}
};
prototype["getFetchStateForApplicationId"] = function getFetchStateForApplicationId(arg0) {
if (null != arg0) {
const obj = { type: "application", applicationId: null };
obj[1] = arg0;
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return closure_3[combined];
}
};
2026-08-24 06:08:38 +00:00
prototype["getPromotionIdsForSkuId"] = function getPromotionIdsForSkuId(arg0) {
if (null != arg0) {
let prop;
if (dependencyMap[arg0] != null) {
prop = tmp2.storefrontPromotionIds;
}
return prop;
}
};
2026-07-29 08:29:29 +00:00
prototype["getRewardsForSkuId"] = function getRewardsForSkuId(id) {
if (null != id) {
if (null != dependencyMap[id]) {
const mapped = tmp2.rewardResultIds.map((arg0) => table[arg0]);
2026-08-24 06:08:38 +00:00
return mapped.filter(isDiscordFrontendDevelopment.isNotNullish);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
};
SKUPricesStore.displayName = "SKUPricesStore";
2026-08-24 06:08:38 +00:00
const sKUPricesStore = new SKUPricesStore(dispatcherDefault, {
2026-07-29 08:29:29 +00:00
LOGOUT: resetStoreState,
SKUS_PRICING_FETCH_START: function handleFetchStart(priceId) {
priceId = priceId.priceId;
let obj = { type: "loading" };
if ("application" === priceId.type) {
obj = {};
const merged = Object.assign(obj);
let str = { type: "application", applicationId: null };
str[1] = priceId.applicationId;
if ("application" === str.type) {
const _HermesInternal2 = HermesInternal;
str = "application:";
let combined = "application:" + str.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + `application:`.skuId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[combined] = obj;
} else {
obj = {};
const merged1 = Object.assign(obj);
const _Object = Object;
const skuIds = priceId.skuIds;
const merged2 = Object.assign(Object.fromEntries(skuIds.map((skuId) => {
2026-08-24 06:08:38 +00:00
obj = { type: "sku", skuId };
2026-07-29 08:29:29 +00:00
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items = [combined, obj];
return items;
})));
2026-07-20 16:05:17 +00:00
}
},
SKUS_PRICING_FETCH_SUCCESS: function handleFetchSuccess(arg0) {
({ priceId, data } = arg0);
2026-07-29 08:29:29 +00:00
let str = globalThis;
2026-07-20 16:05:17 +00:00
const timestamp = Date.now();
2026-07-29 08:29:29 +00:00
let obj = { type: "success", fetchedAt: timestamp };
let obj5 = obj;
2026-07-20 16:05:17 +00:00
if ("application" === priceId.type) {
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(obj6);
let str2 = { type: "application", applicationId: null };
str2[1] = priceId.applicationId;
if ("application" === str2.type) {
const _HermesInternal2 = HermesInternal;
str2 = "application:";
let combined = "application:" + str2.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + `application:`.skuId;
}
obj[combined] = obj;
} else {
obj = {};
const merged1 = Object.assign(obj6);
2026-07-20 16:05:17 +00:00
const _Object = Object;
2026-07-29 08:29:29 +00:00
const skuIds = priceId.skuIds;
const merged2 = Object.assign(Object.fromEntries(skuIds.map((skuId) => {
2026-08-24 06:08:38 +00:00
obj = { type: "sku", skuId };
2026-07-29 08:29:29 +00:00
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
}
const items = [combined, obj];
return items;
})));
obj6 = obj;
if ("application" !== priceId.type) {
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-07-29 08:29:29 +00:00
const merged3 = Object.assign(obj1);
const merged4 = Object.assign(data.pricingResultIdMap);
const obj2 = {};
const merged5 = Object.assign(obj2);
const merged6 = Object.assign(data.skuPriceMap);
const obj3 = {};
const merged7 = Object.assign(obj3);
const merged8 = Object.assign(data.rewardResultIdMap);
} else {
const obj4 = { type: "skus", skuIds: null };
const _Object3 = Object;
obj4[1] = Object.keys(data.skuPriceMap);
obj5 = { type: "success", fetchedAt: null };
obj5[1] = timestamp;
if ("application" !== obj4.type) {
obj6 = {};
const merged9 = Object.assign(obj6);
const _Object2 = Object;
const skuIds1 = obj4.skuIds;
const merged10 = Object.assign(Object.fromEntries(skuIds1.map((skuId) => {
2026-08-24 06:08:38 +00:00
obj = { type: "sku", skuId };
2026-07-29 08:29:29 +00:00
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
}
const items = [combined, obj];
return items;
})));
}
const obj7 = {};
const merged11 = Object.assign(obj6);
let obj8 = { type: "application", applicationId: null };
obj8[1] = obj4.applicationId;
if ("application" === obj8.type) {
obj8 = str.HermesInternal.concat;
str = "application:";
let obj9Result = obj8(obj8.applicationId);
} else {
const _HermesInternal3 = HermesInternal;
obj9Result = "skus:" + obj8.skuId;
}
obj7[obj9Result] = obj5;
}
2026-07-20 16:05:17 +00:00
}
},
SKUS_PRICING_FETCH_FAIL: function handleFetchFail(priceId) {
2026-07-29 08:29:29 +00:00
priceId = priceId.priceId;
let obj = { type: "error", fetchedAt: Date.now() };
let str = globalThis;
if ("application" === priceId.type) {
obj = {};
const merged = Object.assign(obj1);
obj = { type: "application", applicationId: null };
obj[1] = priceId.applicationId;
if ("application" === obj.type) {
obj = str.HermesInternal.concat;
str = "application:";
let obj1Result = obj(obj.applicationId);
} else {
let _HermesInternal = HermesInternal;
obj1Result = "skus:" + obj.skuId;
}
obj[obj1Result] = obj;
} else {
obj1 = {};
const merged1 = Object.assign(obj1);
const _Object = Object;
const skuIds = priceId.skuIds;
const merged2 = Object.assign(Object.fromEntries(skuIds.map((skuId) => {
2026-08-24 06:08:38 +00:00
obj = { type: "sku", skuId };
2026-07-29 08:29:29 +00:00
if ("application" === obj.type) {
const _HermesInternal2 = HermesInternal;
let combined = "application:" + obj.applicationId;
} else {
const _HermesInternal = HermesInternal;
combined = "skus:" + obj.skuId;
}
const items = [combined, obj];
return items;
})));
}
2026-07-20 16:05:17 +00:00
},
STOREFRONT_PROMOTION_ID_OVERRIDE_SET: resetStoreState
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/storefront/SKUPricesStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default sKUPricesStore;