decord/source/stores/web/WindowStore.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

192 lines
6.3 KiB
TypeScript

// Module ID: 13908
// Function ID: 13909
// Name: WindowStore
// Dependencies: [38, 504, 5605, 573, 1242, 1896, 2]
// Module 13908 (WindowStore)
import _modDef38 from "module_38" /* 38 */;
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import WindowIdUtils from "WindowIdUtils" /* 5605 */;
require = fn;
let c3 = null;
const map = new Map();
const set = new Set();
const Store = initializeDefault.Store;
class WindowStore extends Store {
}
const prototype = WindowStore.prototype;
prototype["isFocused"] = function isFocused() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
}
value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
return value.focused;
};
prototype["isAppFocused"] = function isAppFocused() {
return null != this.getFocusedWindowId();
};
prototype["isVisible"] = function isVisible() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
}
value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
return value.visible;
};
prototype["getFocusedWindowId"] = function getFocusedWindowId() {
closure_0 = null;
const item = map.forEach((focused, index) => {
if (focused.focused) {
closure_0 = index;
}
});
return closure_0;
};
prototype["getLastFocusedWindowId"] = function getLastFocusedWindowId() {
return c3;
};
prototype["isElementFullScreen"] = function isElementFullScreen() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
}
value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
return value.isElementFullscreen;
};
prototype["windowSize"] = function windowSize() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
}
value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
return value.windowSize;
};
WindowStore.displayName = "WindowStore";
const windowStore = new WindowStore(DispatcherDefault, {
WINDOW_INIT: function handleWindowInit(width) {
_modDef38(!map.has(width.windowId), "Window initialized multiple times");
const focused = width.focused;
const result = map.set(width.windowId, { windowSize: { width: width.width, height: width.height }, isElementFullscreen: width.isElementFullscreen, focused, visible: width.visible });
if (focused) {
const windowId = width.windowId;
}
return true;
},
WINDOW_FULLSCREEN_CHANGE: function handleWindowFullscreenChange(windowId) {
windowId = windowId.windowId;
value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
let flag = value.isElementFullscreen !== windowId.isElementFullscreen;
if (flag) {
const obj3 = {};
const merged = Object.assign(value);
obj3.isElementFullscreen = windowId.isElementFullscreen;
const result = map.set(windowId.windowId, obj3);
flag = true;
}
return flag;
},
WINDOW_FOCUS: function handleWindowFocus(windowId) {
windowId = windowId.windowId;
value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
let flag = value.focused !== windowId.focused;
if (flag) {
if (windowId.focused) {
const windowId2 = windowId.windowId;
}
const obj3 = {};
const merged = Object.assign(value);
obj3.focused = windowId.focused;
const result = map.set(windowId.windowId, obj3);
flag = true;
}
return flag;
},
WINDOW_RESIZED: function handleWindowResize(windowId) {
windowId = windowId.windowId;
value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
let flag = value.windowSize.width !== windowId.width || value.windowSize.height !== windowId.height;
if (flag) {
const obj3 = {};
const merged = Object.assign(value);
const size = { width: null, height: null };
({ width: obj4.width, height: obj4.height } = windowId);
obj3.windowSize = size;
const result = map.set(windowId.windowId, obj3);
flag = true;
}
return flag;
},
WINDOW_UNLOAD: function handleWindowUnload(windowId) {
set.add(windowId.windowId);
map.delete(windowId.windowId);
if (c3 === windowId.windowId) {
c3 = null;
}
return true;
},
WINDOW_VISIBILITY_CHANGE: function handleWindowVisibilityChange(windowId) {
windowId = windowId.windowId;
value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
}
let flag = value.visible !== windowId.visible;
if (flag) {
const obj3 = {};
const merged = Object.assign(value);
obj3.visible = windowId.visible;
const result = map.set(windowId.windowId, obj3);
flag = true;
}
return flag;
}
});
fn(1896)(1242, dependencyMap.paths).then((addExtraAnalyticsDecorator) => {
const result = addExtraAnalyticsDecorator.addExtraAnalyticsDecorator(() => {
});
});
let size = fn(2);
let result = size.fileFinishedImporting("stores/web/WindowStore.tsx");
export default windowStore;