decord/source/stores/web/WindowStore.tsx

193 lines
6.3 KiB
TypeScript
Raw Normal View History

// Module ID: 13921
// Function ID: 13922
// Name: WindowStore
// Dependencies: [38, 504, 5636, 573, 1242, 1896, 2]
2026-07-20 16:05:17 +00:00
// Module 13921 (WindowStore)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import WindowIdUtils from "WindowIdUtils" /* 5636 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-29 08:29:29 +00:00
let c3 = null;
const map = new Map();
const set = new Set();
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class WindowStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = WindowStore.prototype;
prototype["isFocused"] = function isFocused() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
2026-07-29 08:29:29 +00:00
}
value = map.get(mainWindowId);
2026-07-20 16:05:17 +00:00
if (null == value) {
2026-07-29 08:29:29 +00:00
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return value.focused;
};
prototype["isAppFocused"] = function isAppFocused() {
return null != this.getFocusedWindowId();
};
prototype["isVisible"] = function isVisible() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
2026-07-20 16:05:17 +00:00
}
value = map.get(mainWindowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
return value.visible;
};
prototype["getFocusedWindowId"] = function getFocusedWindowId() {
closure_0 = null;
const item = map.forEach((focused, index) => {
2026-07-29 08:29:29 +00:00
if (focused.focused) {
closure_0 = index;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
});
return closure_0;
2026-07-29 08:29:29 +00:00
};
prototype["getLastFocusedWindowId"] = function getLastFocusedWindowId() {
return c3;
};
prototype["isElementFullScreen"] = function isElementFullScreen() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
2026-07-29 08:29:29 +00:00
}
value = map.get(mainWindowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
return value.isElementFullscreen;
};
prototype["windowSize"] = function windowSize() {
let mainWindowId = arg0;
if (arg0 === undefined) {
mainWindowId = WindowIdUtils.getMainWindowId();
2026-07-29 08:29:29 +00:00
}
value = map.get(mainWindowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(mainWindowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
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 });
2026-07-20 16:05:17 +00:00
if (focused) {
const windowId = width.windowId;
2026-07-20 16:05:17 +00:00
}
return true;
},
WINDOW_FULLSCREEN_CHANGE: function handleWindowFullscreenChange(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
value = map.get(windowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
let flag = value.isElementFullscreen !== windowId.isElementFullscreen;
2026-07-20 16:05:17 +00:00
if (flag) {
const obj3 = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(value);
obj3.isElementFullscreen = windowId.isElementFullscreen;
const result = map.set(windowId.windowId, obj3);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
WINDOW_FOCUS: function handleWindowFocus(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
value = map.get(windowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
let flag = value.focused !== windowId.focused;
2026-07-20 16:05:17 +00:00
if (flag) {
if (windowId.focused) {
const windowId2 = windowId.windowId;
2026-07-20 16:05:17 +00:00
}
const obj3 = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(value);
obj3.focused = windowId.focused;
const result = map.set(windowId.windowId, obj3);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
WINDOW_RESIZED: function handleWindowResize(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
value = map.get(windowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
let flag = value.windowSize.width !== windowId.width || value.windowSize.height !== windowId.height;
2026-07-20 16:05:17 +00:00
if (flag) {
const obj3 = {};
2026-07-29 08:29:29 +00:00
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);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
WINDOW_UNLOAD: function handleWindowUnload(windowId) {
set.add(windowId.windowId);
map.delete(windowId.windowId);
2026-07-29 08:29:29 +00:00
if (c3 === windowId.windowId) {
c3 = null;
2026-07-20 16:05:17 +00:00
}
return true;
},
WINDOW_VISIBILITY_CHANGE: function handleWindowVisibilityChange(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
value = map.get(windowId);
2026-07-29 08:29:29 +00:00
if (null == value) {
const hasItem = set.has(windowId);
const obj2 = { isElementFullscreen: false, focused: false, windowSize: { width: 0, height: 0 }, visible: false };
value = obj2;
2026-07-29 08:29:29 +00:00
}
let flag = value.visible !== windowId.visible;
2026-07-20 16:05:17 +00:00
if (flag) {
const obj3 = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(value);
obj3.visible = windowId.visible;
const result = map.set(windowId.windowId, obj3);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
}
});
fn(1896)(1242, dependencyMap.paths).then((addExtraAnalyticsDecorator) => {
2026-07-20 16:05:17 +00:00
const result = addExtraAnalyticsDecorator.addExtraAnalyticsDecorator(() => {
});
});
let size = fn(2);
let result = size.fileFinishedImporting("stores/web/WindowStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default windowStore;