decord/alpha/source/stores/LibraryApplicationStore.tsx

339 lines
11 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 7113
// Function ID: 7114
// Name: LibraryApplicationStore
2026-10-12 06:59:38 +00:00
// Dependencies: [7114, 502, 1085, 510, 7115, 1403, 504, 12, 584, 2]
2026-07-20 16:05:17 +00:00
2026-10-12 06:59:38 +00:00
// Module 7113 (LibraryApplicationStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import Storage6 from "Storage" /* 510 */;
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import FlagUtilsAll from "FlagUtils" /* 1403 */;
2026-10-12 06:59:38 +00:00
import LibraryApplicationUtils from "LibraryApplicationUtils" /* 7115 */;
import LibraryApplicationRecord from "LibraryApplicationRecord" /* 7114 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-09 10:00:15 +00:00
let activeLibraryApplicationBranchIds, closure_10, closure_9, set2;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function setLibraryApplications(libraryApplications) {
2026-10-03 08:58:59 +00:00
const tmp = libraryApplications[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
while (tmp !== undefined) {
let fromServer = LibraryApplicationRecord.createFromServer(tmp2);
let obj = LibraryApplicationUtils;
2026-07-29 08:29:29 +00:00
closure_9[obj.getComboId(fromServer.id, fromServer.branchId)] = fromServer;
continue;
2026-07-20 16:05:17 +00:00
}
}
function handleLibraryApplicationUpdate(libraryApplication) {
const fromServer = LibraryApplicationRecord.createFromServer(libraryApplication.libraryApplication);
2026-10-03 08:58:59 +00:00
const obj = LibraryApplicationUtils;
const comboId = obj.getComboId(fromServer.id, fromServer.branchId);
2026-07-29 08:29:29 +00:00
closure_9[comboId] = fromServer;
2026-07-20 16:05:17 +00:00
set.delete(comboId);
}
2026-10-03 08:58:59 +00:00
const LibraryApplicationFlags = Constants.LibraryApplicationFlags;
const LibraryApplicationStore_str = "LibraryApplicationStore";
2026-07-29 08:29:29 +00:00
let c8 = false;
2026-10-03 08:58:59 +00:00
const React4 = {};
const authStore = {};
let set = new Set();
2026-10-09 10:00:15 +00:00
const authStore2 = {};
let activeLaunchOptionIds = {};
2026-07-29 08:29:29 +00:00
let c14 = false;
2026-10-03 08:58:59 +00:00
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class LibraryApplicationStore extends Store {
2026-10-03 08:58:59 +00:00
initialize() {
this.waitFor(AuthenticationStore);
const Storage = Storage6.Storage;
const value = Storage.get(LibraryApplicationStore_str);
if (null != value) {
if (null == value.activeLaunchOptionIds) {
const Storage2 = tmp2(510).Storage;
set = Storage2.set;
const Storage3 = tmp2(510).Storage;
let value3 = Storage3.get(tmp4);
if (value3 == null) {
value3 = {};
}
const obj = { activeLaunchOptionIds };
const merged = Object.assign(value3);
const result = set(tmp4, obj);
} else {
activeLaunchOptionIds = value.activeLaunchOptionIds;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
if (null == value.activeLibraryApplicationBranchIds) {
const Storage4 = tmp2(510).Storage;
set2 = Storage4.set;
const Storage5 = tmp2(510).Storage;
let value4 = Storage5.get(tmp4);
if (value4 == null) {
value4 = {};
}
const obj2 = { activeLibraryApplicationBranchIds };
const merged1 = Object.assign(value4);
set2(LibraryApplicationStore_str, obj2);
} else {
activeLibraryApplicationBranchIds = value.activeLibraryApplicationBranchIds;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
getAllLibraryApplications() {
2026-07-29 08:29:29 +00:00
const obj = {};
const merged = Object.assign(closure_10);
const merged1 = Object.assign(closure_9);
return obj;
}
2026-10-03 08:58:59 +00:00
hasLibraryApplication() {
const obj = {};
const merged = Object.assign(closure_10);
const merged1 = Object.assign(closure_9);
return keys(obj).length > 0;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
hasApplication(arg0, arg1) {
let flag = arg2;
if (arg2 === undefined) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const obj = LibraryApplicationUtils;
const comboId = obj.getComboId(arg0, arg1);
let obj2 = closure_9[comboId];
if (obj2 == null) {
obj2 = closure_10[comboId];
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let tmp5 = null != obj2;
if (tmp5) {
let result = !(!flag && obj2.isHidden());
!flag && obj2.isHidden();
if (result) {
const tmpResult = LibraryApplicationUtils;
result = tmpResult.isUserEntitledToLibraryApplication(obj2);
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp5 = result;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp5;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
getLibraryApplication(applicationId, item, arg2) {
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
const obj = LibraryApplicationUtils;
const comboId = obj.getComboId(applicationId, item);
let tmp4 = closure_9[comboId];
if (tmp4 == null) {
tmp4 = closure_10[comboId];
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let tmp6 = tmp4;
if (flag) {
tmp6 = tmp4;
if (null != tmp4) {
let tmp7 = null;
const tmpResult = LibraryApplicationUtils;
if (tmpResult.isUserEntitledToLibraryApplication(tmp4)) {
tmp7 = tmp4;
}
tmp6 = tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp6;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
getActiveLibraryApplication(id) {
if (null != activeLibraryApplicationBranchIds[id]) {
const obj = LibraryApplicationUtils;
const comboId = obj.getComboId(id, tmp);
let obj2 = closure_9[comboId];
const tmp2 = require;
if (obj2 == null) {
obj2 = closure_10[comboId];
}
if (null != obj2) {
2026-10-12 06:59:38 +00:00
const tmp2Result = tmp2(7115);
2026-10-03 08:58:59 +00:00
if (tmp2Result.isUserEntitledToLibraryApplication(obj2)) {
return obj2;
}
}
}
const obj3 = {};
const merged = Object.assign(closure_10);
const merged1 = Object.assign(closure_9);
for (const key10030 in obj3) {
if (obj3[key10030].id !== id) {
2026-07-20 16:05:17 +00:00
continue;
2026-07-29 08:29:29 +00:00
} else {
2026-10-03 08:58:59 +00:00
let obj5 = obj3[key10030];
let obj6 = LibraryApplicationUtils;
if (!obj6.isUserEntitledToLibraryApplication(obj5)) {
continue;
} else {
return obj5;
}
continue;
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
}
2026-10-03 08:58:59 +00:00
isUpdatingFlags(arg0, arg1) {
const has = set.has;
const obj = LibraryApplicationUtils;
return has(obj.getComboId(arg0, arg1));
}
getActiveLaunchOptionId(arg0, arg1) {
const obj = LibraryApplicationUtils;
return activeLaunchOptionIds[obj.getComboId(obj, arg0, arg1)];
}
whenInitialized(arg0) {
let closure_0 = arg0;
const result = this.addConditionalChangeListener(() => {
if (c8) {
const _setImmediate = setImmediate;
setImmediate(closure_0);
return false;
}
});
}
}
const prototype = LibraryApplicationStore.prototype;
Object.defineProperty(prototype, "libraryApplications", {
get: function libraryApplications() {
const obj = {};
const merged = Object.assign(closure_10);
const merged1 = Object.assign(closure_9);
const keys = Object.keys(obj);
const item = keys.forEach((item) => {
const tmp2 = obj[item];
const isHiddenResult = obj[item].isHidden();
const tmp = item;
if (isHiddenResult) {
delete tmp2[tmp];
}
});
return obj;
},
set: undefined
});
2026-07-29 08:29:29 +00:00
Object.defineProperty(prototype, "fetched", {
get: function fetched() {
2026-07-29 08:29:29 +00:00
return c8;
},
set: undefined
});
Object.defineProperty(prototype, "entitledBranchIds", {
get: function entitledBranchIds() {
2026-10-03 08:58:59 +00:00
let obj = {};
const tmp = require("module_12");
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_10);
const merged1 = Object.assign(closure_9);
2026-10-03 08:58:59 +00:00
const tmpResult = tmp(obj);
const values = tmpResult.values();
const found = values.filter((item) => {
const obj = LibraryApplicationUtils;
return obj.isUserEntitledToLibraryApplication(item);
});
const iter = found.map((branchId) => branchId.branchId);
return iter.value();
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "hasRemovedLibraryApplicationThisSession", {
get: function hasRemovedLibraryApplicationThisSession() {
return c14;
},
set: undefined
});
LibraryApplicationStore.displayName = "LibraryApplicationStore";
2026-10-03 08:58:59 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
LOGOUT: function handleLogout() {
2026-08-24 06:08:38 +00:00
c8 = false;
2026-07-20 16:05:17 +00:00
},
LIBRARY_FETCH_SUCCESS: function handleFetchSuccess(libraryApplications) {
2026-08-24 06:08:38 +00:00
closure_9 = {};
2026-07-20 16:05:17 +00:00
setLibraryApplications(libraryApplications.libraryApplications);
2026-08-24 06:08:38 +00:00
c8 = true;
2026-07-20 16:05:17 +00:00
},
SKU_PURCHASE_SUCCESS: function handlePurchaseSuccess(libraryApplications) {
setLibraryApplications(libraryApplications.libraryApplications);
},
LIBRARY_APPLICATION_FLAGS_UPDATE_START: function handleFlagsUpdateStart(flags) {
2026-10-03 08:58:59 +00:00
let applicationId;
let branchId;
2026-07-20 16:05:17 +00:00
({ applicationId, branchId } = flags);
2026-10-03 08:58:59 +00:00
flags = flags.flags;
const obj = LibraryApplicationUtils;
const comboId = obj.getComboId(applicationId, branchId);
const obj2 = LibraryApplicationUtils;
const comboId1 = obj2.getComboId(applicationId, branchId);
let obj3 = closure_9[comboId1];
2026-07-29 08:29:29 +00:00
if (obj3 == null) {
2026-10-03 08:58:59 +00:00
obj3 = closure_10[comboId1];
2026-07-29 08:29:29 +00:00
}
let hasFlagResult = null != obj3 && !obj3.isHidden();
2026-07-20 16:05:17 +00:00
if (hasFlagResult) {
2026-10-03 08:58:59 +00:00
const obj4 = FlagUtilsAll;
hasFlagResult = obj4.hasFlag(flags, LibraryApplicationFlags.HIDDEN);
2026-07-20 16:05:17 +00:00
}
if (hasFlagResult) {
2026-08-24 06:08:38 +00:00
c14 = true;
2026-07-20 16:05:17 +00:00
}
set.add(comboId);
},
LIBRARY_APPLICATION_FLAGS_UPDATE_SUCCESS: handleLibraryApplicationUpdate,
LIBRARY_APPLICATION_UPDATE: handleLibraryApplicationUpdate,
LIBRARY_APPLICATION_ACTIVE_LAUNCH_OPTION_UPDATE: function handleActiveLaunchOptionIdUpdate(arg0) {
2026-10-03 08:58:59 +00:00
let applicationId;
let branchId;
let launchOptionId;
2026-07-20 16:05:17 +00:00
({ applicationId, branchId, launchOptionId } = arg0);
activeLaunchOptionIds[LibraryApplicationUtils.getComboId(applicationId, branchId)] = launchOptionId;
2026-10-03 08:58:59 +00:00
LibraryApplicationUtils;
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-10-03 08:58:59 +00:00
set = Storage.set;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-10-03 08:58:59 +00:00
let obj2 = Storage2.get(LibraryApplicationStore_str);
const tmp = LibraryApplicationStore_str;
if (obj2 == null) {
obj2 = {};
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
const obj3 = { activeLaunchOptionIds };
const merged = Object.assign(obj2);
2026-10-03 08:58:59 +00:00
const result = set(tmp, obj3);
2026-07-20 16:05:17 +00:00
},
LIBRARY_APPLICATION_ACTIVE_BRANCH_UPDATE: function handleActiveBranchUpdate(arg0) {
2026-10-03 08:58:59 +00:00
let applicationId;
let branchId;
2026-07-20 16:05:17 +00:00
({ applicationId, branchId } = arg0);
if (activeLibraryApplicationBranchIds[applicationId] === branchId) {
2026-07-20 16:05:17 +00:00
return false;
} else {
activeLibraryApplicationBranchIds[applicationId] = branchId;
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-10-03 08:58:59 +00:00
set = Storage.set;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-10-03 08:58:59 +00:00
let obj = Storage2.get(LibraryApplicationStore_str);
const tmp4 = LibraryApplicationStore_str;
2026-07-29 08:29:29 +00:00
if (obj == null) {
obj = {};
}
2026-10-03 08:58:59 +00:00
const obj2 = { activeLibraryApplicationBranchIds };
2026-07-29 08:29:29 +00:00
const merged = Object.assign(obj);
2026-10-03 08:58:59 +00:00
const result = set(tmp4, obj2);
2026-07-20 16:05:17 +00:00
}
},
2026-10-03 08:58:59 +00:00
LIBRARY_APPLICATIONS_TEST_MODE_ENABLED: function handleTestModeEnabled(libraryApplications) {
libraryApplications = libraryApplications.libraryApplications;
for (const item10006 of libraryApplications) {
let obj = LibraryApplicationUtils;
2026-07-29 08:29:29 +00:00
closure_10[obj.getComboId(item10006.id, item10006.branchId)] = item10006;
continue;
2026-07-20 16:05:17 +00:00
}
},
DEVELOPER_TEST_MODE_RESET: function handleTestModeDisabled() {
2026-08-24 06:08:38 +00:00
closure_10 = {};
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
};
const libraryApplicationStore = new LibraryApplicationStore(DispatcherDefault, obj);
let result = size.fileFinishedImporting("stores/LibraryApplicationStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default libraryApplicationStore;