decord/beta/source/modules/changelog/useCurrentChangelog.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

364 lines
12 KiB
TypeScript

// Module ID: 8355
// Function ID: 8356
// Name: useCurrentChangelog
// Dependencies: [19, 2113, 4772, 2098, 558, 568, 565, 8356, 2]
// Module 8355 (useCurrentChangelog)
import useStateFromStores from "useStateFromStores" /* 565 */;
import c from "c" /* 568 */;
import ChangeLogActionCreatorsDefault from "ChangeLogActionCreators" /* 8356 */;
import noop from "module_19" /* 19 */;
import LocaleStore from "LocaleStore" /* 2113 */;
import ChangelogStore from "ChangelogStore" /* 4772 */;
require = fn;
const ChangelogLoadState = fn(2098).ChangelogLoadState;
let ReactCompilerGating = fn(558);
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? ((id, arg1) => {
_require = id;
closure_1 = arg1;
const cResult = require("c").c(21);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [ChangelogStore];
cResult[0] = items;
let first = items;
} else {
first = cResult[0];
}
if (cResult[1] === id) {
if (cResult[2] === arg1) {
let tmp6 = cResult[3];
let tmp7 = cResult[4];
}
const stateFromStoresObject = require("useStateFromStores").useStateFromStoresObject(first, tmp6, tmp7);
changelog = stateFromStoresObject.changelog;
const loadState = stateFromStoresObject.loadState;
const defaultChangelog = stateFromStoresObject.defaultChangelog;
if (cResult[5] === changelog) {
if (cResult[6] === id) {
if (cResult[7] === loadState) {
if (cResult[8] === arg1) {
let tmp10 = cResult[9];
let tmp11 = cResult[10];
}
const effect = loadState.useEffect(tmp10, tmp11);
if (null == id) {
if (cResult[11] !== id) {
const obj2 = { id, changelog: null, loaded: false };
cResult[11] = id;
cResult[12] = obj2;
let tmp20 = obj2;
} else {
tmp20 = cResult[12];
}
return tmp20;
} else {
if (null == changelog) {
if (loadState === ChangelogLoadState.LOADED_FAILURE) {
if (cResult[13] === defaultChangelog) {
if (cResult[14] === id) {
if (cResult[15] === tmp18) {
let tmp19 = cResult[16];
}
return tmp19;
}
}
const obj3 = { id, changelog: defaultChangelog, loaded: tmp9 !== ChangelogLoadState.NOT_LOADED };
cResult[13] = defaultChangelog;
cResult[14] = id;
cResult[15] = tmp9 !== ChangelogLoadState.NOT_LOADED;
cResult[16] = obj3;
tmp19 = obj3;
}
}
if (cResult[17] === changelog) {
if (cResult[18] === id) {
if (cResult[19] === tmp16) {
let tmp17 = cResult[20];
}
return tmp17;
}
}
const obj4 = { id, changelog, loaded: loadState !== ChangelogLoadState.NOT_LOADED };
cResult[17] = changelog;
cResult[18] = id;
cResult[19] = loadState !== ChangelogLoadState.NOT_LOADED;
cResult[20] = obj4;
tmp17 = obj4;
}
}
}
}
const fn2 = function f() {
let tmp2 = null != closure_0;
if (tmp2) {
tmp2 = null == changelog;
}
if (tmp2) {
tmp2 = loadState === ChangelogLoadState.NOT_LOADED;
}
if (tmp2) {
changelog = ChangeLogActionCreatorsDefault.fetchChangelog(closure_0, closure_1);
}
};
const items1 = [id, changelog, loadState, arg1];
cResult[5] = changelog;
cResult[6] = id;
cResult[7] = loadState;
cResult[8] = arg1;
cResult[9] = fn2;
cResult[10] = items1;
tmp11 = items1;
tmp10 = fn2;
const tmpResult = require("useStateFromStores");
}
const fn = function h() {
changelog = null;
if (null != closure_0) {
changelog = ChangelogStore.getChangelog(tmp, closure_1);
}
let changelog1 = null;
if (null != closure_0) {
changelog1 = ChangelogStore.getChangelog(tmp, "en-US");
}
let changelogLoadStatus = null != tmp;
if (changelogLoadStatus) {
changelogLoadStatus = ChangelogStore.getChangelogLoadStatus(tmp, "en-US");
}
const obj = { changelog, loadState: null, defaultChangelog: null, defaultLoadState: null };
let changelogLoadStatus1 = null != tmp;
if (changelogLoadStatus1) {
changelogLoadStatus1 = ChangelogStore.getChangelogLoadStatus(tmp, closure_1);
}
obj.loadState = changelogLoadStatus1;
obj.defaultChangelog = changelog1;
obj.defaultLoadState = changelogLoadStatus;
return obj;
};
const items2 = [id, arg1];
cResult[1] = id;
cResult[2] = arg1;
cResult[3] = fn;
cResult[4] = items2;
tmp7 = items2;
tmp6 = fn;
}) : ((id, arg1) => {
_require = id;
closure_1 = arg1;
const items = [ChangelogStore];
const items1 = [id, arg1];
const stateFromStoresObject = require("useStateFromStores").useStateFromStoresObject(items, () => {
changelog = null;
if (null != closure_0) {
changelog = ChangelogStore.getChangelog(tmp, closure_1);
}
let changelog1 = null;
if (null != closure_0) {
changelog1 = ChangelogStore.getChangelog(tmp, "en-US");
}
let changelogLoadStatus = null != tmp;
if (changelogLoadStatus) {
changelogLoadStatus = ChangelogStore.getChangelogLoadStatus(tmp, "en-US");
}
const obj = { changelog, loadState: null, defaultChangelog: null, defaultLoadState: null };
let changelogLoadStatus1 = null != tmp;
if (changelogLoadStatus1) {
changelogLoadStatus1 = ChangelogStore.getChangelogLoadStatus(tmp, closure_1);
}
obj.loadState = changelogLoadStatus1;
obj.defaultChangelog = changelog1;
obj.defaultLoadState = changelogLoadStatus;
return obj;
}, items1);
changelog = stateFromStoresObject.changelog;
const loadState = stateFromStoresObject.loadState;
const items2 = [id, changelog, loadState, arg1];
({ defaultChangelog, defaultLoadState } = stateFromStoresObject);
const effect = loadState.useEffect(() => {
let tmp2 = null != closure_0;
if (tmp2) {
tmp2 = null == changelog;
}
if (tmp2) {
tmp2 = loadState === ChangelogLoadState.NOT_LOADED;
}
if (tmp2) {
changelog = ChangeLogActionCreatorsDefault.fetchChangelog(closure_0, closure_1);
}
}, items2);
if (null == id) {
const obj2 = { id, changelog: null, loaded: false };
let obj4 = obj2;
} else {
if (null == changelog) {
if (loadState === ChangelogLoadState.LOADED_FAILURE) {
const obj3 = { id, changelog: defaultChangelog, loaded: defaultLoadState !== tmp3.NOT_LOADED };
obj4 = obj3;
}
}
obj4 = { id, changelog, loaded: loadState !== ChangelogLoadState.NOT_LOADED };
}
return obj4;
});
let closure_7 = tmp2;
ReactCompilerGating = fn(558);
const size = fn(2);
const result = size.fileFinishedImporting("modules/changelog/useCurrentChangelog.tsx");
export const useChangelog = tmp2;
export const useCurrentChangelog = ReactCompilerGating.isReactCompilerEnabled() ? (() => {
const cResult = c.c(20);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [LocaleStore];
const fn = function n() {
return locale.locale;
};
cResult[0] = items;
cResult[1] = fn;
tmp4 = items;
tmp5 = fn;
} else {
[tmp4, tmp5] = cResult;
}
const stateFromStores = useStateFromStores.useStateFromStores(tmp4, tmp5);
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items1 = [ChangelogStore];
const fn2 = function s() {
return ChangelogStore.latestChangelogId();
};
cResult[2] = items1;
cResult[3] = fn2;
let tmp9 = fn2;
let tmp8 = items1;
} else {
tmp8 = cResult[2];
tmp9 = cResult[3];
}
const tmpResult = useStateFromStores;
const stateFromStores1 = useStateFromStores.useStateFromStores(tmp8, tmp9);
if (cResult[4] === Symbol.for("react.memo_cache_sentinel")) {
const items2 = [ChangelogStore];
class C {
constructor() {
return closure_1_5.getConfig();
}
}
cResult[4] = items2;
cResult[5] = C;
let tmp13 = C;
let tmp12 = items2;
} else {
tmp12 = cResult[4];
tmp13 = cResult[5];
}
const tmpResult4 = useStateFromStores;
const stateFromStores2 = useStateFromStores.useStateFromStores(tmp12, tmp13);
let tmp16 = null != stateFromStores2;
if (tmp16) {
const _Object = Object;
tmp16 = 0 === Object.keys(stateFromStores2).length;
}
if (cResult[6] === stateFromStores2) {
if (cResult[7] === stateFromStores1) {
let tmp17 = cResult[8];
}
const _Symbol = Symbol;
class C {
constructor() {
return closure_1_5.getConfig();
}
}
const stateFromStores3 = tmp(565).useStateFromStores(tmp20, tmp21);
const tmpResult6 = tmp(565);
({ changelog, loaded } = closure_7(stateFromStores1, stateFromStores));
const tmp24 = closure_7(stateFromStores1, stateFromStores);
({ changelog: changelog2, loaded: loaded2 } = closure_7(stateFromStores3, stateFromStores));
if (null != stateFromStores3) {
if (cResult[11] === changelog2) {
if (cResult[12] === stateFromStores3) {
if (cResult[13] === loaded2) {
let tmp28 = cResult[14];
}
return tmp28;
}
}
const obj2 = { id: null, changelog: null, loaded: null, clientTooOld: false };
class C {
constructor() {
return closure_1_5.getConfig();
}
}
obj2.changelog = changelog2;
obj2.loaded = loaded2;
cResult[11] = changelog2;
cResult[12] = stateFromStores3;
cResult[13] = loaded2;
cResult[14] = obj2;
tmp28 = obj2;
}
if (cResult[15] === tmp17) {
if (cResult[16] === changelog) {
if (cResult[17] === stateFromStores1) {
if (cResult[18] === tmp26) {
let tmp27 = cResult[19];
}
return tmp27;
}
}
}
const obj3 = { id: stateFromStores1, changelog, loaded: tmp16 || loaded, clientTooOld: tmp17 };
cResult[15] = tmp17;
cResult[16] = changelog;
cResult[17] = stateFromStores1;
cResult[18] = tmp16 || loaded;
cResult[19] = obj3;
tmp27 = obj3;
const tmp25 = closure_7(stateFromStores3, stateFromStores);
}
let tmp18 = null != stateFromStores2;
if (tmp18) {
const _Object2 = Object;
tmp18 = Object.keys(stateFromStores2).length > 0;
}
if (tmp18) {
tmp18 = null == stateFromStores1;
}
cResult[6] = stateFromStores2;
cResult[7] = stateFromStores1;
cResult[8] = tmp18;
tmp17 = tmp18;
}) : (() => {
const items = [LocaleStore];
const stateFromStores = useStateFromStores.useStateFromStores(items, () => locale.locale);
const items1 = [ChangelogStore];
const stateFromStores1 = useStateFromStores.useStateFromStores(items1, () => ChangelogStore.latestChangelogId());
const tmp4 = ChangelogStore;
const items2 = [ChangelogStore];
const stateFromStores2 = useStateFromStores.useStateFromStores(items2, () => ChangelogStore.getConfig());
let tmp7 = null != stateFromStores2;
if (tmp7) {
const _Object = Object;
tmp7 = 0 === Object.keys(stateFromStores2).length;
}
let tmp9 = null != stateFromStores2;
if (tmp9) {
const _Object2 = Object;
tmp9 = Object.keys(stateFromStores2).length > 0;
}
if (tmp9) {
tmp9 = null == stateFromStores1;
}
const items3 = [tmp4];
const stateFromStores3 = useStateFromStores.useStateFromStores(items3, () => ChangelogStore.overrideId());
const tmpResult = useStateFromStores;
({ changelog, loaded } = closure_7(stateFromStores1, stateFromStores));
const tmp12 = closure_7(stateFromStores1, stateFromStores);
({ changelog: changelog2, loaded: loaded2 } = closure_7(stateFromStores3, stateFromStores));
if (null == stateFromStores3) {
const obj4 = { id: stateFromStores1, changelog, loaded: tmp7 || loaded, clientTooOld: tmp9 };
let obj5 = obj4;
} else {
obj5 = { id: stateFromStores3, changelog: changelog2, loaded: loaded2, clientTooOld: false };
}
return obj5;
});