decord/beta/source/modules/applications/useGetOrFetchApplications.tsx

186 lines
5.3 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 6858
// Function ID: 6859
// Name: useGetOrFetchApplications
2026-10-12 16:32:48 +00:00
// Dependencies: [19, 5440, 558, 576, 568, 6853, 12, 1388, 504, 2]
2026-10-12 16:32:48 +00:00
// Module 6858 (useGetOrFetchApplications)
import _modDef12 from "module_12" /* 12 */;
2026-10-02 13:37:24 +00:00
import shallowEqual from "shallowEqual" /* 568 */;
import react2 from "react" /* 576 */;
2026-10-12 16:32:48 +00:00
import GlobalUtils from "GlobalUtils" /* 1388 */;
import ApplicationActionCreatorsDefault from "ApplicationActionCreators" /* 6853 */;
2026-10-01 14:13:23 +00:00
import react from "react" /* 19 */;
2026-10-12 16:32:48 +00:00
import ApplicationStore from "ApplicationStore" /* 5440 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require, application, dependencyMap;
2026-10-02 13:37:24 +00:00
let ReactCompilerGating = ReactCompilerGating_mod;
2026-10-12 16:32:48 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useGetOrFetchApplications(current, arg1) {
2026-10-02 13:37:24 +00:00
let first;
let ref;
_require = current;
let tmp = _require;
let obj = require("react");
const cResult = obj.c(8);
let closure_1 = tmp4;
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
2026-10-02 13:37:24 +00:00
dependencyMap = react.useRef(first);
const obj2 = react;
if (cResult[1] === current) {
let tmp6;
let tmp7;
let tmp9;
let tmp11;
if (cResult[2] === (undefined === arg1 || arg1)) {
tmp6 = cResult[3];
tmp7 = cResult[4];
}
const effect = obj2.useEffect(tmp6, tmp7);
const _Symbol = Symbol;
if (cResult[5] === Symbol.for("react.memo_cache_sentinel")) {
const items1 = [ApplicationStore];
cResult[5] = items1;
tmp9 = items1;
} else {
tmp9 = cResult[5];
}
if (cResult[6] !== current) {
2026-10-12 16:32:48 +00:00
class A {
constructor() {
return closure_0.map((item) => {
application = undefined;
if (null != item) {
application = application.getApplication(item);
}
return application;
});
}
}
2026-10-02 13:37:24 +00:00
cResult[6] = current;
2026-10-12 16:32:48 +00:00
cResult[7] = A;
tmp11 = A;
2026-10-02 13:37:24 +00:00
} else {
2026-10-12 16:32:48 +00:00
class A {
constructor() {
return closure_0.map((item) => {
application = undefined;
if (null != item) {
application = application.getApplication(item);
}
return application;
});
}
}
2026-10-02 13:37:24 +00:00
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStoresArray(tmp9, tmp11);
}
2026-10-12 16:32:48 +00:00
const fn = function p() {
2026-10-02 13:37:24 +00:00
let tmp = closure_1;
2026-10-01 14:13:23 +00:00
if (tmp) {
const obj = shallowEqual;
2026-10-02 13:37:24 +00:00
tmp = !obj.areArraysShallowEqual(current, ref.current);
}
if (tmp) {
2026-10-01 14:13:23 +00:00
const fetchApplications = ApplicationActionCreatorsDefault.fetchApplications;
ApplicationActionCreatorsDefault;
2026-10-02 13:37:24 +00:00
const arr = _modDef12(current);
2026-10-01 14:13:23 +00:00
const found = arr.filter(GlobalUtils.isNotNullish);
const iter = found.uniq();
2026-10-01 14:13:23 +00:00
const applications = fetchApplications(iter.value(), false);
2026-10-02 13:37:24 +00:00
ref.current = current;
}
2026-10-02 13:37:24 +00:00
};
const items2 = [current, tmp4];
cResult[1] = current;
cResult[2] = undefined === arg1 || arg1;
cResult[3] = fn;
cResult[4] = items2;
tmp7 = items2;
tmp6 = fn;
2026-10-12 16:32:48 +00:00
}) : (function useGetOrFetchApplications(current) {
2026-10-01 14:13:23 +00:00
let ref;
2026-10-02 13:37:24 +00:00
_require = current;
let flag = arg1;
if (arg1 === undefined) {
flag = true;
}
2026-10-01 14:13:23 +00:00
dependencyMap = react.useRef([]);
2026-10-02 13:37:24 +00:00
const items = [current, flag];
2026-10-01 14:13:23 +00:00
const effect = react.useEffect(() => {
let tmp = flag;
2026-10-01 14:13:23 +00:00
if (tmp) {
const obj = shallowEqual;
2026-10-02 13:37:24 +00:00
tmp = !obj.areArraysShallowEqual(current, ref.current);
}
if (tmp) {
2026-10-01 14:13:23 +00:00
const fetchApplications = ApplicationActionCreatorsDefault.fetchApplications;
ApplicationActionCreatorsDefault;
2026-10-02 13:37:24 +00:00
const arr = _modDef12(current);
2026-10-01 14:13:23 +00:00
const found = arr.filter(GlobalUtils.isNotNullish);
const iter = found.uniq();
2026-10-01 14:13:23 +00:00
const applications = fetchApplications(iter.value(), false);
2026-10-02 13:37:24 +00:00
ref.current = current;
}
2026-10-02 13:37:24 +00:00
}, items);
let obj = require("get initialized");
const items1 = [ApplicationStore];
return obj.useStateFromStoresArray(items1, () => current.map((item) => {
application = undefined;
if (null != item) {
application = application.getApplication(item);
}
return application;
2026-10-02 13:37:24 +00:00
}));
});
let closure_5 = tmp2;
ReactCompilerGating = ReactCompilerGating_mod;
2026-10-12 16:32:48 +00:00
let tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useGetOrFetchApplication(arg0, arg1) {
2026-10-02 13:37:24 +00:00
let tmp3;
const obj = react2;
const cResult = obj.c(2);
const tmp2 = undefined === arg1 || arg1;
if (cResult[0] !== arg0) {
let items1;
if (null != arg0) {
const items = [arg0];
items1 = items;
} else {
items1 = [];
}
cResult[0] = arg0;
cResult[1] = items1;
tmp3 = items1;
} else {
tmp3 = cResult[1];
}
return closure_5(tmp3, tmp2)[0];
2026-10-12 16:32:48 +00:00
}) : (function useGetOrFetchApplication(arg0) {
2026-10-02 13:37:24 +00:00
let items1;
let flag = arg1;
if (arg1 === undefined) {
flag = true;
}
const tmp = closure_5;
if (null != arg0) {
const items = [arg0];
items1 = items;
} else {
items1 = [];
}
return tmp(items1, flag)[0];
});
const result = size.fileFinishedImporting("modules/applications/useGetOrFetchApplications.tsx");
export default tmp2;
export const useGetOrFetchApplication = tmp3;