@illgrenoble/webx-client 1.11.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebXClient.d.ts +1 -2
- package/dist/common/WebXImageBlenderFunc.d.ts +26 -0
- package/dist/{display → common}/WebXSubImage.d.ts +5 -5
- package/dist/common/index.d.ts +3 -0
- package/dist/display/WebXCursor.d.ts +5 -17
- package/dist/display/WebXCursorFactory.d.ts +2 -2
- package/dist/display/WebXDisplay.d.ts +11 -10
- package/dist/display/WebXDisplayOverlay.d.ts +10 -0
- package/dist/display/WebXWindow.d.ts +4 -4
- package/dist/display/WebXWindowImageFactory.d.ts +31 -0
- package/dist/display/index.d.ts +0 -6
- package/dist/index.d.ts +2 -0
- package/dist/message/WebXCursorImageMessage.d.ts +3 -3
- package/dist/message/WebXImageMessage.d.ts +4 -4
- package/dist/message/WebXMessage.d.ts +13 -1
- package/dist/message/WebXShapeMessage.d.ts +3 -3
- package/dist/message/WebXSubImagesMessage.d.ts +1 -1
- package/dist/message/WebXWindowsMessage.d.ts +1 -1
- package/dist/renderer/WebXCanvasRenderer.d.ts +1 -2
- package/dist/renderer/{WebXAlphaStencilBlender.d.ts → WebXImageBlender.d.ts} +1 -1
- package/dist/renderer/WebXImageBlenderWorker.d.ts +1 -0
- package/dist/renderer/WebXWindowCanvas.d.ts +27 -8
- package/dist/renderer/index.d.ts +1 -1
- package/dist/texture/WebXTexture.d.ts +18 -0
- package/dist/texture/WebXTextureFactory.d.ts +23 -0
- package/dist/texture/WebXTextureFunc.d.ts +3 -0
- package/dist/texture/index.d.ts +3 -0
- package/dist/transport/WebXBinarySerializer.d.ts +13 -8
- package/dist/transport/WebXMessageBuffer.d.ts +4 -0
- package/dist/transport/WebXMessageDecoder.d.ts +2 -5
- package/dist/transport/WebXMessageDecoderWorker.d.ts +1 -0
- package/dist/transport/WebXMessageFunc.d.ts +22 -0
- package/dist/transport/index.d.ts +0 -2
- package/dist/tunnel/WebXTunnel.d.ts +5 -2
- package/dist/tunnel/WebXWebSocketTunnel.d.ts +2 -4
- package/dist/webx-client.cjs +1 -0
- package/dist/webx-client.esm.js +1 -0
- package/package.json +12 -9
- package/dist/WebXClient.js +0 -513
- package/dist/WebXClient.js.map +0 -1
- package/dist/WebXConnectionHandler.js +0 -96
- package/dist/WebXConnectionHandler.js.map +0 -1
- package/dist/WebXEngine.js +0 -7
- package/dist/WebXEngine.js.map +0 -1
- package/dist/display/WebXCursor.js +0 -150
- package/dist/display/WebXCursor.js.map +0 -1
- package/dist/display/WebXCursorFactory.js +0 -59
- package/dist/display/WebXCursorFactory.js.map +0 -1
- package/dist/display/WebXDisplay.js +0 -501
- package/dist/display/WebXDisplay.js.map +0 -1
- package/dist/display/WebXMaterial.js +0 -142
- package/dist/display/WebXMaterial.js.map +0 -1
- package/dist/display/WebXSubImage.js +0 -26
- package/dist/display/WebXSubImage.js.map +0 -1
- package/dist/display/WebXTextureFactory.d.ts +0 -54
- package/dist/display/WebXTextureFactory.js +0 -160
- package/dist/display/WebXTextureFactory.js.map +0 -1
- package/dist/display/WebXWindow.js +0 -475
- package/dist/display/WebXWindow.js.map +0 -1
- package/dist/display/WebXWindowProperties.js +0 -25
- package/dist/display/WebXWindowProperties.js.map +0 -1
- package/dist/display/index.js +0 -24
- package/dist/display/index.js.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/input/GuacamoleKeyboard.js +0 -1551
- package/dist/input/WebXKeyboard.js +0 -44
- package/dist/input/WebXKeyboard.js.map +0 -1
- package/dist/input/WebXMouse.js +0 -231
- package/dist/input/WebXMouse.js.map +0 -1
- package/dist/input/index.js +0 -20
- package/dist/input/index.js.map +0 -1
- package/dist/input/mouse/WebXMouseState.js +0 -217
- package/dist/input/mouse/WebXMouseState.js.map +0 -1
- package/dist/input/mouse/index.js +0 -18
- package/dist/input/mouse/index.js.map +0 -1
- package/dist/instruction/WebXClipboardInstruction.js +0 -23
- package/dist/instruction/WebXClipboardInstruction.js.map +0 -1
- package/dist/instruction/WebXConnectInstruction.js +0 -24
- package/dist/instruction/WebXConnectInstruction.js.map +0 -1
- package/dist/instruction/WebXCursorImageInstruction.js +0 -23
- package/dist/instruction/WebXCursorImageInstruction.js.map +0 -1
- package/dist/instruction/WebXDataAckInstruction.js +0 -26
- package/dist/instruction/WebXDataAckInstruction.js.map +0 -1
- package/dist/instruction/WebXImageInstruction.js +0 -23
- package/dist/instruction/WebXImageInstruction.js.map +0 -1
- package/dist/instruction/WebXInstruction.js +0 -28
- package/dist/instruction/WebXInstruction.js.map +0 -1
- package/dist/instruction/WebXInstructionResponse.js +0 -78
- package/dist/instruction/WebXInstructionResponse.js.map +0 -1
- package/dist/instruction/WebXInstructionType.js +0 -96
- package/dist/instruction/WebXInstructionType.js.map +0 -1
- package/dist/instruction/WebXKeyboardInstruction.js +0 -25
- package/dist/instruction/WebXKeyboardInstruction.js.map +0 -1
- package/dist/instruction/WebXMouseInstruction.js +0 -27
- package/dist/instruction/WebXMouseInstruction.js.map +0 -1
- package/dist/instruction/WebXPongInstruction.js +0 -23
- package/dist/instruction/WebXPongInstruction.js.map +0 -1
- package/dist/instruction/WebXQualityInstruction.js +0 -24
- package/dist/instruction/WebXQualityInstruction.js.map +0 -1
- package/dist/instruction/WebXScreenInstruction.js +0 -20
- package/dist/instruction/WebXScreenInstruction.js.map +0 -1
- package/dist/instruction/WebXShapeInstruction.js +0 -23
- package/dist/instruction/WebXShapeInstruction.js.map +0 -1
- package/dist/instruction/WebXWindowsInstruction.js +0 -21
- package/dist/instruction/WebXWindowsInstruction.js.map +0 -1
- package/dist/instruction/index.js +0 -32
- package/dist/instruction/index.js.map +0 -1
- package/dist/message/WebXClipboardMessage.js +0 -23
- package/dist/message/WebXClipboardMessage.js.map +0 -1
- package/dist/message/WebXConnectionMessage.js +0 -21
- package/dist/message/WebXConnectionMessage.js.map +0 -1
- package/dist/message/WebXCursorImageMessage.js +0 -35
- package/dist/message/WebXCursorImageMessage.js.map +0 -1
- package/dist/message/WebXImageMessage.js +0 -33
- package/dist/message/WebXImageMessage.js.map +0 -1
- package/dist/message/WebXMessage.js +0 -23
- package/dist/message/WebXMessage.js.map +0 -1
- package/dist/message/WebXMessageType.js +0 -64
- package/dist/message/WebXMessageType.js.map +0 -1
- package/dist/message/WebXMouseMessage.js +0 -29
- package/dist/message/WebXMouseMessage.js.map +0 -1
- package/dist/message/WebXNopMessage.js +0 -18
- package/dist/message/WebXNopMessage.js.map +0 -1
- package/dist/message/WebXPingMessage.js +0 -21
- package/dist/message/WebXPingMessage.js.map +0 -1
- package/dist/message/WebXQualityMessage.js +0 -32
- package/dist/message/WebXQualityMessage.js.map +0 -1
- package/dist/message/WebXScreenMessage.js +0 -29
- package/dist/message/WebXScreenMessage.js.map +0 -1
- package/dist/message/WebXShapeMessage.js +0 -29
- package/dist/message/WebXShapeMessage.js.map +0 -1
- package/dist/message/WebXSubImagesMessage.js +0 -29
- package/dist/message/WebXSubImagesMessage.js.map +0 -1
- package/dist/message/WebXWindowsMessage.js +0 -25
- package/dist/message/WebXWindowsMessage.js.map +0 -1
- package/dist/message/index.js +0 -31
- package/dist/message/index.js.map +0 -1
- package/dist/renderer/WebXAlphaStencilBlender.js +0 -136
- package/dist/renderer/WebXAlphaStencilBlender.js.map +0 -1
- package/dist/renderer/WebXBlenderWorker.d.ts +0 -1
- package/dist/renderer/WebXBlenderWorker.js +0 -33
- package/dist/renderer/WebXBlenderWorker.js.map +0 -1
- package/dist/renderer/WebXCanvasRenderer.js +0 -190
- package/dist/renderer/WebXCanvasRenderer.js.map +0 -1
- package/dist/renderer/WebXWindowBlender.d.ts +0 -11
- package/dist/renderer/WebXWindowBlender.js +0 -27
- package/dist/renderer/WebXWindowBlender.js.map +0 -1
- package/dist/renderer/WebXWindowCanvas.js +0 -306
- package/dist/renderer/WebXWindowCanvas.js.map +0 -1
- package/dist/renderer/blender.d.ts +0 -5
- package/dist/renderer/blender.js +0 -201
- package/dist/renderer/blender.js.map +0 -1
- package/dist/renderer/index.js +0 -20
- package/dist/renderer/index.js.map +0 -1
- package/dist/tracer/WebXDebugImageMessageHandler.js +0 -102
- package/dist/tracer/WebXDebugImageMessageHandler.js.map +0 -1
- package/dist/tracer/WebXHandler.js +0 -3
- package/dist/tracer/WebXHandler.js.map +0 -1
- package/dist/tracer/WebXInstructionHandler.js +0 -13
- package/dist/tracer/WebXInstructionHandler.js.map +0 -1
- package/dist/tracer/WebXMessageHandler.js +0 -13
- package/dist/tracer/WebXMessageHandler.js.map +0 -1
- package/dist/tracer/WebXStatsHandler.js +0 -13
- package/dist/tracer/WebXStatsHandler.js.map +0 -1
- package/dist/tracer/index.js +0 -22
- package/dist/tracer/index.js.map +0 -1
- package/dist/transport/WebXBinarySerializer.js +0 -63
- package/dist/transport/WebXBinarySerializer.js.map +0 -1
- package/dist/transport/WebXInstructionBuffer.js +0 -109
- package/dist/transport/WebXInstructionBuffer.js.map +0 -1
- package/dist/transport/WebXInstructionEncoder.js +0 -294
- package/dist/transport/WebXInstructionEncoder.js.map +0 -1
- package/dist/transport/WebXMessageBuffer.js +0 -104
- package/dist/transport/WebXMessageBuffer.js.map +0 -1
- package/dist/transport/WebXMessageDecoder.js +0 -333
- package/dist/transport/WebXMessageDecoder.js.map +0 -1
- package/dist/transport/index.js +0 -22
- package/dist/transport/index.js.map +0 -1
- package/dist/tunnel/WebXTunnel.js +0 -156
- package/dist/tunnel/WebXTunnel.js.map +0 -1
- package/dist/tunnel/WebXWebSocketTunnel.js +0 -88
- package/dist/tunnel/WebXWebSocketTunnel.js.map +0 -1
- package/dist/tunnel/index.js +0 -19
- package/dist/tunnel/index.js.map +0 -1
- package/dist/utils/WebXColorGenerator.js +0 -46
- package/dist/utils/WebXColorGenerator.js.map +0 -1
- package/dist/utils/WebXVersion.js +0 -25
- package/dist/utils/WebXVersion.js.map +0 -1
- package/dist/utils/index.js +0 -19
- package/dist/utils/index.js.map +0 -1
- /package/dist/{display → common}/WebXWindowProperties.d.ts +0 -0
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXCanvasRenderer = void 0;
|
|
4
|
-
const three_1 = require("three");
|
|
5
|
-
const WebXWindowCanvas_1 = require("./WebXWindowCanvas");
|
|
6
|
-
const WebXAlphaStencilBlender_1 = require("./WebXAlphaStencilBlender");
|
|
7
|
-
/**
|
|
8
|
-
* The `WebXCanvasRenderer` class is responsible for rendering a desktop-like environment
|
|
9
|
-
* using HTML elements. It integrates with the Three.js library using 3D objects (meshes, materials, textures)
|
|
10
|
-
* to hold the graphical data used to render the windows.
|
|
11
|
-
*/
|
|
12
|
-
class WebXCanvasRenderer {
|
|
13
|
-
/**
|
|
14
|
-
* Gets the root DOM element of the renderer.
|
|
15
|
-
* @returns The root DOM element.
|
|
16
|
-
*/
|
|
17
|
-
get domElement() {
|
|
18
|
-
return this._desktopContainer;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Initializes the `WebXCanvasRenderer` by creating the main desktop container
|
|
22
|
-
* and initializing the alpha stencil blender.
|
|
23
|
-
*/
|
|
24
|
-
constructor() {
|
|
25
|
-
this._clearColor = new three_1.Color(0, 0, 0);
|
|
26
|
-
this._windowCanvases = new Map();
|
|
27
|
-
this.createMainElement();
|
|
28
|
-
this._alphaStencilBlender = new WebXAlphaStencilBlender_1.WebXAlphaStencilBlender();
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Sets the size of the desktop container.
|
|
32
|
-
* @param width - The width of the desktop in pixels.
|
|
33
|
-
* @param height - The height of the desktop in pixels.
|
|
34
|
-
* @param unused - An optional unused parameter.
|
|
35
|
-
*/
|
|
36
|
-
setSize(width, height, unused) {
|
|
37
|
-
this._width = width;
|
|
38
|
-
this._height = height;
|
|
39
|
-
this._desktop.style.width = `${width}px`;
|
|
40
|
-
this._desktop.style.height = `${height}px`;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Sets the background color of the desktop.
|
|
44
|
-
* @param color - The color to set, represented as a `ColorRepresentation`.
|
|
45
|
-
*/
|
|
46
|
-
setClearColor(color) {
|
|
47
|
-
this._clearColor.set(color);
|
|
48
|
-
this._desktop.style.backgroundColor = `#${this._clearColor.getHexString()}`;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Renders the scene: updates the window element positions, sizes and z-orders and updates
|
|
52
|
-
* the graphical content of the windows. Any windows that are no longer in the scene have their
|
|
53
|
-
* graphical elements removed from the dom.
|
|
54
|
-
* @param scene - The root `Object3D` containing the scene to render.
|
|
55
|
-
* @param camera - The `Camera` used for rendering (currently unused).
|
|
56
|
-
*/
|
|
57
|
-
render(scene, camera) {
|
|
58
|
-
if (scene.children.length > 0) {
|
|
59
|
-
const screen = scene.children[0];
|
|
60
|
-
const activeWindowIds = new Set();
|
|
61
|
-
for (const object of screen.children) {
|
|
62
|
-
if (object instanceof three_1.Mesh && object.visible) {
|
|
63
|
-
if (!this._windowCanvases.has(object.id)) {
|
|
64
|
-
this.createWindowCanvas(object);
|
|
65
|
-
}
|
|
66
|
-
const windowCanvas = this._windowCanvases.get(object.id);
|
|
67
|
-
windowCanvas.updateGeometry();
|
|
68
|
-
windowCanvas.updateCanvas();
|
|
69
|
-
activeWindowIds.add(object.id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Remove defunct windows
|
|
73
|
-
for (const [windowId, windowCanvas] of this._windowCanvases.entries()) {
|
|
74
|
-
if (!activeWindowIds.has(windowId)) {
|
|
75
|
-
this.removeWindowCanvas(windowCanvas);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else if (this._windowCanvases.size > 0) {
|
|
80
|
-
// Remove all windows
|
|
81
|
-
for (const [_, windowCanvas] of this._windowCanvases.entries()) {
|
|
82
|
-
this.removeWindowCanvas(windowCanvas);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Generates a screenshot of the current windows. Each window canvas is rendered onto a global
|
|
88
|
-
* desktop canvas. The main canvas is then converted into a blob with the specified image type and quality
|
|
89
|
-
* @param type The type of the screenshot (e.g., 'image/png').
|
|
90
|
-
* @param quality The quality of the screenshot (0 to 1).
|
|
91
|
-
*/
|
|
92
|
-
createScreenshot(type, quality) {
|
|
93
|
-
return new Promise((resolve, reject) => {
|
|
94
|
-
try {
|
|
95
|
-
const screenshotCanvas = this.createElementNS('canvas');
|
|
96
|
-
screenshotCanvas.width = this._width;
|
|
97
|
-
screenshotCanvas.height = this._height;
|
|
98
|
-
const context = screenshotCanvas.getContext('2d');
|
|
99
|
-
// Ensure that the background is set correctly
|
|
100
|
-
context.fillStyle = `#${this._clearColor.getHexString()}`;
|
|
101
|
-
context.fillRect(0, 0, this._width, this._height);
|
|
102
|
-
// Painters algorithm: Order the windows from back to front and draw the window canvas into the screenshot
|
|
103
|
-
Array.from(this._windowCanvases.values()).sort((a, b) => a.zIndex - b.zIndex).forEach(window => {
|
|
104
|
-
context.drawImage(window.canvas, window.x, window.y);
|
|
105
|
-
});
|
|
106
|
-
// Convert to specified image type and return the blob
|
|
107
|
-
screenshotCanvas.toBlob((blob) => {
|
|
108
|
-
resolve(blob);
|
|
109
|
-
}, type, quality);
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
reject(error);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Disposes of the renderer by removing all window canvases and terminating
|
|
118
|
-
* the alpha stencil blender (and its web worker if present).
|
|
119
|
-
*/
|
|
120
|
-
dispose() {
|
|
121
|
-
// Remove all windows
|
|
122
|
-
for (const [_, windowCanvas] of this._windowCanvases.entries()) {
|
|
123
|
-
this.removeWindowCanvas(windowCanvas);
|
|
124
|
-
}
|
|
125
|
-
// Terminate the blended web worker if present
|
|
126
|
-
this._alphaStencilBlender.terminate();
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Updates a specific region of a window canvas from the color and alpha data sent from the server. The updates are stored in the window
|
|
130
|
-
* and handled at the next render request.
|
|
131
|
-
* @param meshId - The ID of the mesh associated with the window canvas.
|
|
132
|
-
* @param srcColorMap - The source color texture.
|
|
133
|
-
* @param dstColorMap - The destination color texture.
|
|
134
|
-
* @param srcAlphaMap - The source alpha texture.
|
|
135
|
-
* @param dstAlphaMap - The destination alpha texture.
|
|
136
|
-
* @param width - The width of the region to update.
|
|
137
|
-
* @param height - The height of the region to update.
|
|
138
|
-
* @param dstPosition - The destination position of the region.
|
|
139
|
-
*/
|
|
140
|
-
updateWindowRegion(meshId, srcColorMap, dstColorMap, srcAlphaMap, dstAlphaMap, width, height, dstPosition) {
|
|
141
|
-
const windowCanvas = this._windowCanvases.get(meshId);
|
|
142
|
-
if (windowCanvas) {
|
|
143
|
-
windowCanvas.addRegionUpdate(srcColorMap, dstColorMap, srcAlphaMap, dstAlphaMap, width, height, dstPosition);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Creates the main desktop container element and initializes its styles.
|
|
148
|
-
*/
|
|
149
|
-
createMainElement() {
|
|
150
|
-
const desktopContainer = this.createElementNS('div');
|
|
151
|
-
desktopContainer.id = 'webx-desktop-container';
|
|
152
|
-
desktopContainer.style.display = 'block';
|
|
153
|
-
desktopContainer.style.position = 'relative';
|
|
154
|
-
desktopContainer.style.overflow = 'hidden';
|
|
155
|
-
const desktop = document.createElement('div');
|
|
156
|
-
desktop.id = 'webx-desktop';
|
|
157
|
-
desktopContainer.style.position = 'absolute';
|
|
158
|
-
desktopContainer.style.transformOrigin = 'top left';
|
|
159
|
-
desktopContainer.appendChild(desktop);
|
|
160
|
-
this._desktopContainer = desktopContainer;
|
|
161
|
-
this._desktop = desktop;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Creates a new window canvas for the given mesh and adds it to the desktop.
|
|
165
|
-
* @param mesh - The `Mesh` object representing the window.
|
|
166
|
-
*/
|
|
167
|
-
createWindowCanvas(mesh) {
|
|
168
|
-
const windowCanvas = new WebXWindowCanvas_1.WebXWindowCanvas(mesh, this._alphaStencilBlender);
|
|
169
|
-
this._desktop.appendChild(windowCanvas.canvas);
|
|
170
|
-
this._windowCanvases.set(mesh.id, windowCanvas);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Removes a window canvas from the desktop and cleans up its resources.
|
|
174
|
-
* @param windowCanvas - The `WebXWindowCanvas` to remove.
|
|
175
|
-
*/
|
|
176
|
-
removeWindowCanvas(windowCanvas) {
|
|
177
|
-
this._desktop.removeChild(windowCanvas.canvas);
|
|
178
|
-
this._windowCanvases.delete(windowCanvas.id);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Creates an HTML element with the specified namespace.
|
|
182
|
-
* @param name - The name of the element to create.
|
|
183
|
-
* @returns The created `HTMLElement`.
|
|
184
|
-
*/
|
|
185
|
-
createElementNS(name) {
|
|
186
|
-
return document.createElementNS('http://www.w3.org/1999/xhtml', name);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
exports.WebXCanvasRenderer = WebXCanvasRenderer;
|
|
190
|
-
//# sourceMappingURL=WebXCanvasRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXCanvasRenderer.js","sourceRoot":"","sources":["../../src/renderer/WebXCanvasRenderer.ts"],"names":[],"mappings":";;;AAAA,iCAA2F;AAC3F,yDAAoD;AACpD,uEAAkE;AAGlE;;;;GAIG;AACH,MAAa,kBAAkB;IAW7B;;;OAGG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH;QAjBQ,gBAAW,GAAU,IAAI,aAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAGxC,oBAAe,GAAkC,IAAI,GAAG,EAAE,CAAC;QAejE,IAAI,CA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C,YAA8B;QACvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACK,eAAe,CAAC,IAAY;QAClC,OAAO,QAAQ,CAAC,eAAe,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;CACF;AA5MD,gDA4MC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BlenderModule } from './blender';
|
|
2
|
-
export declare class WebXWindowBlender {
|
|
3
|
-
private _blenderModule;
|
|
4
|
-
private _byteSize;
|
|
5
|
-
private _stencilPtr;
|
|
6
|
-
private _stencilView;
|
|
7
|
-
constructor(_blenderModule: BlenderModule);
|
|
8
|
-
setByteSize(size: number): void;
|
|
9
|
-
setStencilData(stencilData: ImageData): void;
|
|
10
|
-
private _freeStencilData;
|
|
11
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXWindowBlender = void 0;
|
|
4
|
-
class WebXWindowBlender {
|
|
5
|
-
constructor(_blenderModule) {
|
|
6
|
-
this._blenderModule = _blenderModule;
|
|
7
|
-
}
|
|
8
|
-
setByteSize(size) {
|
|
9
|
-
this._byteSize = size;
|
|
10
|
-
this._freeStencilData();
|
|
11
|
-
}
|
|
12
|
-
setStencilData(stencilData) {
|
|
13
|
-
this._freeStencilData();
|
|
14
|
-
const byteLength = stencilData.data.length;
|
|
15
|
-
this._stencilPtr = this._blenderModule._malloc(byteLength);
|
|
16
|
-
this._stencilView = new Uint8ClampedArray(this._blenderModule.HEAPU8.buffer, this._stencilPtr, byteLength);
|
|
17
|
-
this._stencilView.set(stencilData.data);
|
|
18
|
-
}
|
|
19
|
-
_freeStencilData() {
|
|
20
|
-
if (this._stencilPtr) {
|
|
21
|
-
this._blenderModule._free(this._stencilPtr);
|
|
22
|
-
this._stencilView = null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.WebXWindowBlender = WebXWindowBlender;
|
|
27
|
-
//# sourceMappingURL=WebXWindowBlender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXWindowBlender.js","sourceRoot":"","sources":["../../src/renderer/WebXWindowBlender.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAM5B,YAAoB,cAA6B;QAA7B,mBAAc,GAAd,cAAc,CAAe;IACjD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,cAAc,CAAC,WAAsB;QACnC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;QAC1G,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAGO,gBAAgB;QACtB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;IACH,CAAC;CAGF;AAjCD,8CAiCC"}
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.WebXWindowCanvas = void 0;
|
|
13
|
-
const three_1 = require("three");
|
|
14
|
-
const WebXMaterial_1 = require("../display/WebXMaterial");
|
|
15
|
-
/**
|
|
16
|
-
* The `WebXWindowCanvas` class holds the graphical elements necessary for rendering
|
|
17
|
-
* a specific window in the desktop environment. HTML Canvases are used for rendering image data. Window image data
|
|
18
|
-
* is received in the form of color, alpha and stencil buffers. These are blended to produce the final window image.
|
|
19
|
-
*/
|
|
20
|
-
class WebXWindowCanvas {
|
|
21
|
-
/**
|
|
22
|
-
* Gets the unique ID of the associated mesh.
|
|
23
|
-
*/
|
|
24
|
-
get id() {
|
|
25
|
-
return this._mesh.id;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Returns the window canvas
|
|
29
|
-
*/
|
|
30
|
-
get canvas() {
|
|
31
|
-
return this._canvas;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Returns the left-hand x coordinate of the window
|
|
35
|
-
*/
|
|
36
|
-
get x() {
|
|
37
|
-
return this._x;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Returns the top y coordinate of the window
|
|
41
|
-
*/
|
|
42
|
-
get y() {
|
|
43
|
-
return this._y;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Returns the zIndex of the window
|
|
47
|
-
*/
|
|
48
|
-
get zIndex() {
|
|
49
|
-
return this._zIndex;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Returns the width of the window
|
|
53
|
-
*/
|
|
54
|
-
get width() {
|
|
55
|
-
return this._width;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Returns the height of the window
|
|
59
|
-
*/
|
|
60
|
-
get height() {
|
|
61
|
-
return this._height;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Initializes a new `WebXWindowCanvas` for the given window Mesh and Material. The Mesh and Material contains all graphical information
|
|
65
|
-
* necessary to render a window (namely window position, size and z-order), the Mesh Material contains the graphical information (color, alpha and stencil data).
|
|
66
|
-
* @param _mesh - The `Mesh` object representing the window.
|
|
67
|
-
* @param _alphaStencilBlender - The alpha stencil blender instance.
|
|
68
|
-
*/
|
|
69
|
-
constructor(_mesh, _alphaStencilBlender) {
|
|
70
|
-
this._mesh = _mesh;
|
|
71
|
-
this._alphaStencilBlender = _alphaStencilBlender;
|
|
72
|
-
this._x = 0;
|
|
73
|
-
this._y = 0;
|
|
74
|
-
this._zIndex = 0;
|
|
75
|
-
this._width = 0;
|
|
76
|
-
this._height = 0;
|
|
77
|
-
this._regionUpdates = [];
|
|
78
|
-
this._canvas = this.createElementNS('canvas');
|
|
79
|
-
this._canvas.id = `webx-window-${this.id}`;
|
|
80
|
-
this._canvas.style.position = 'absolute';
|
|
81
|
-
this._canvas.style.pointerEvents = 'none';
|
|
82
|
-
this._canvas.style.top = '0';
|
|
83
|
-
this._canvas.style.left = '0';
|
|
84
|
-
this._canvas.style.overflow = 'hidden';
|
|
85
|
-
this._context = this._canvas.getContext('2d');
|
|
86
|
-
this.updateGeometry();
|
|
87
|
-
this.updateCanvas();
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Updates the geometry of the window canvas based on the mesh's properties if any changes are needed.
|
|
91
|
-
*/
|
|
92
|
-
updateGeometry() {
|
|
93
|
-
const width = this._mesh.scale.x;
|
|
94
|
-
const height = this._mesh.scale.y;
|
|
95
|
-
const x = this._mesh.position.x - 0.5 * width;
|
|
96
|
-
const y = this._mesh.position.y - 0.5 * height;
|
|
97
|
-
const zIndex = this._mesh.position.z;
|
|
98
|
-
if (x !== this._x || y !== this._y) {
|
|
99
|
-
this._canvas.style.top = `${y}px`;
|
|
100
|
-
this._canvas.style.left = `${x}px`;
|
|
101
|
-
this._x = x;
|
|
102
|
-
this._y = y;
|
|
103
|
-
}
|
|
104
|
-
if (width !== this._width || height !== this._height) {
|
|
105
|
-
this._canvas.style.width = `${width}px`;
|
|
106
|
-
this._canvas.style.height = `${height}px`;
|
|
107
|
-
this._width = width;
|
|
108
|
-
this._height = height;
|
|
109
|
-
}
|
|
110
|
-
if (zIndex !== this._zIndex) {
|
|
111
|
-
this._canvas.style.zIndex = `${this._mesh.position.z}`;
|
|
112
|
-
this._zIndex = zIndex;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Updates the canvas content using the material textures (color, alpha and stencil buffers)
|
|
117
|
-
* if any changes have occurred.
|
|
118
|
-
*/
|
|
119
|
-
updateCanvas() {
|
|
120
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
var _a;
|
|
122
|
-
if (this._mesh.material instanceof WebXMaterial_1.WebXMaterial || this._mesh.material instanceof three_1.MeshBasicMaterial) {
|
|
123
|
-
const material = this._mesh.material;
|
|
124
|
-
// Handle the stencil map
|
|
125
|
-
this.updateStencilMap(material);
|
|
126
|
-
if (material.map) {
|
|
127
|
-
// Check for new color map and/or alpha map
|
|
128
|
-
const updateCanvas = material.map != this._colorMap || material.alphaMap != this._alphaMap;
|
|
129
|
-
if (updateCanvas) {
|
|
130
|
-
this._colorMap = material.map;
|
|
131
|
-
this._alphaMap = material.alphaMap;
|
|
132
|
-
const colorImage = material.map.image;
|
|
133
|
-
const width = colorImage.width;
|
|
134
|
-
const height = colorImage.height;
|
|
135
|
-
if (this._canvas.width !== width || this._canvas.height !== height) {
|
|
136
|
-
this._canvas.width = width;
|
|
137
|
-
this._canvas.height = height;
|
|
138
|
-
this._canvas.style.width = `${width}px`;
|
|
139
|
-
this._canvas.style.height = `${height}px`;
|
|
140
|
-
}
|
|
141
|
-
const hasAlphaMap = this.isValidAlphaMap(material.alphaMap);
|
|
142
|
-
if (hasAlphaMap || this._stencilContext) {
|
|
143
|
-
const alphaImage = (_a = material.alphaMap) === null || _a === void 0 ? void 0 : _a.image;
|
|
144
|
-
const blendedImageData = yield this.blendAlphaAndStencil(colorImage, alphaImage, 0, 0);
|
|
145
|
-
this._context.putImageData(blendedImageData, 0, 0);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
this._context.clearRect(0, 0, width, height);
|
|
149
|
-
this._context.drawImage(colorImage, 0, 0, width, height);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Apply any regional updates
|
|
153
|
-
yield this.handleRegionUpdates();
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
if (this._colorMap) {
|
|
157
|
-
this._colorMap = null;
|
|
158
|
-
this._alphaMap = null;
|
|
159
|
-
this._regionUpdates = [];
|
|
160
|
-
this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Adds a region update to the canvas taking into account the color, alpha and stencil buffers. Here we store a simple
|
|
168
|
-
* array of all the updates necessary for this frame. The updates are taken into account in the next rendering request of the window
|
|
169
|
-
* (and are only applied if the destination buffers have not been replaced).
|
|
170
|
-
* @param srcColorMap - The source color texture.
|
|
171
|
-
* @param dstColorMap - The destination color texture.
|
|
172
|
-
* @param srcAlphaMap - The source alpha texture.
|
|
173
|
-
* @param dstAlphaMap - The destination alpha texture.
|
|
174
|
-
* @param width - The width of the region to update.
|
|
175
|
-
* @param height - The height of the region to update.
|
|
176
|
-
* @param dstPosition - The destination position of the region.
|
|
177
|
-
*/
|
|
178
|
-
addRegionUpdate(srcColorMap, dstColorMap, srcAlphaMap, dstAlphaMap, width, height, dstPosition) {
|
|
179
|
-
this._regionUpdates.push({
|
|
180
|
-
srcColorMap,
|
|
181
|
-
dstColorMap,
|
|
182
|
-
srcAlphaMap,
|
|
183
|
-
dstAlphaMap,
|
|
184
|
-
width,
|
|
185
|
-
height,
|
|
186
|
-
dstPosition,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Handles all pending region updates for the canvas. The different buffers (color, alpha and stencil) are blended (in a web
|
|
191
|
-
* worker if available) and then re-rendered into the main canvas of the window. If the window has only a color buffer then this
|
|
192
|
-
* is rendered immediately into the main canvas.
|
|
193
|
-
*/
|
|
194
|
-
handleRegionUpdates() {
|
|
195
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
for (const region of this._regionUpdates) {
|
|
197
|
-
if (region.dstColorMap === this._colorMap && region.dstAlphaMap === this._alphaMap) {
|
|
198
|
-
const { srcColorMap, srcAlphaMap, width, height, dstPosition } = region;
|
|
199
|
-
const colorImage = srcColorMap.image;
|
|
200
|
-
const alphaImage = srcAlphaMap === null || srcAlphaMap === void 0 ? void 0 : srcAlphaMap.image;
|
|
201
|
-
if (alphaImage || this._stencilContext) {
|
|
202
|
-
const blendedImageData = yield this.blendAlphaAndStencil(colorImage, alphaImage, dstPosition.x, dstPosition.y);
|
|
203
|
-
this._context.putImageData(blendedImageData, dstPosition.x, dstPosition.y);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
this._context.drawImage(colorImage, 0, 0, width, height, dstPosition.x, dstPosition.y, width, height);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
this._regionUpdates = [];
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Checks if the provided alpha map is valid for the canvas (dimensions are equal).
|
|
215
|
-
* @param alphaMap - The alpha texture to validate.
|
|
216
|
-
* @returns `true` if the alpha map is valid, otherwise `false`.
|
|
217
|
-
*/
|
|
218
|
-
isValidAlphaMap(alphaMap) {
|
|
219
|
-
if (alphaMap) {
|
|
220
|
-
const width = alphaMap.image.width;
|
|
221
|
-
const height = alphaMap.image.height;
|
|
222
|
-
return width === this._canvas.width && height === this._canvas.height;
|
|
223
|
-
}
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Updates the stencil map for the window if it exists in the material and has changed.
|
|
228
|
-
* @param material - The material of the associated mesh.
|
|
229
|
-
*/
|
|
230
|
-
updateStencilMap(material) {
|
|
231
|
-
// Get stencil map if it exists, remove it if no longer needed
|
|
232
|
-
if (material instanceof WebXMaterial_1.WebXMaterial && material.stencilMap) {
|
|
233
|
-
if (material.stencilMap != this._stencilMap) {
|
|
234
|
-
this._stencilMap = material.stencilMap;
|
|
235
|
-
// Create canvas and context for stencil Image
|
|
236
|
-
const stencilImage = this._stencilMap.image;
|
|
237
|
-
this._stencilCanvas = this.createElementNS('canvas');
|
|
238
|
-
this._stencilCanvas.width = stencilImage.width;
|
|
239
|
-
this._stencilCanvas.height = stencilImage.height;
|
|
240
|
-
this._stencilContext = this._stencilCanvas.getContext('2d', { willReadFrequently: true });
|
|
241
|
-
this._stencilContext.drawImage(stencilImage, 0, 0);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
if (this._stencilMap) {
|
|
246
|
-
this._stencilMap = null;
|
|
247
|
-
this._stencilCanvas = null;
|
|
248
|
-
this._stencilContext = null;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Prepares temporary canvases to renderer the image data (jpeg format) into raw pixmaps. The pixmap data for the different
|
|
254
|
-
* images is sent to the blender for processing.
|
|
255
|
-
* @param colorImage - The color image.
|
|
256
|
-
* @param alphaImage - The alpha image.
|
|
257
|
-
* @param dstX - The destination X position.
|
|
258
|
-
* @param dstY - The destination Y position.
|
|
259
|
-
* @returns A promise that resolves to the blended `ImageData`.
|
|
260
|
-
*/
|
|
261
|
-
blendAlphaAndStencil(colorImage, alphaImage, dstX, dstY) {
|
|
262
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
-
if (!alphaImage && !this._stencilContext) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const width = colorImage.width;
|
|
267
|
-
const height = colorImage.height;
|
|
268
|
-
// Create temporary canvas and context for color Image
|
|
269
|
-
const colorCanvas = this.createElementNS('canvas');
|
|
270
|
-
colorCanvas.width = width;
|
|
271
|
-
colorCanvas.height = height;
|
|
272
|
-
const colorContext = colorCanvas.getContext('2d');
|
|
273
|
-
colorContext.drawImage(colorImage, 0, 0);
|
|
274
|
-
const colorImageData = colorContext.getImageData(0, 0, width, height);
|
|
275
|
-
let alphaImageData = null;
|
|
276
|
-
if (alphaImage) {
|
|
277
|
-
// Create temporary canvas and context for alpha Image
|
|
278
|
-
const alphaCanvas = this.createElementNS('canvas');
|
|
279
|
-
alphaCanvas.width = width;
|
|
280
|
-
alphaCanvas.height = height;
|
|
281
|
-
const alphaContext = alphaCanvas.getContext('2d');
|
|
282
|
-
alphaContext.drawImage(alphaImage, 0, 0);
|
|
283
|
-
alphaImageData = alphaContext.getImageData(0, 0, width, height);
|
|
284
|
-
}
|
|
285
|
-
const startTime = performance.now();
|
|
286
|
-
let stencilImageData = null;
|
|
287
|
-
if (this._stencilContext) {
|
|
288
|
-
stencilImageData = this._stencilContext.getImageData(dstX, dstY, width, height);
|
|
289
|
-
}
|
|
290
|
-
const blendedImageData = yield this._alphaStencilBlender.blendAlphaAndStencil(colorImageData, alphaImageData, stencilImageData);
|
|
291
|
-
const endTime = performance.now();
|
|
292
|
-
// console.log(`Time to blend alpha image = ${(endTime - startTime).toFixed((3))}ms for ${width * height} pixels`);
|
|
293
|
-
return blendedImageData;
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Creates an HTML element with the specified namespace.
|
|
298
|
-
* @param name - The name of the element to create.
|
|
299
|
-
* @returns The created `HTMLElement`.
|
|
300
|
-
*/
|
|
301
|
-
createElementNS(name) {
|
|
302
|
-
return document.createElementNS('http://www.w3.org/1999/xhtml', name);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
exports.WebXWindowCanvas = WebXWindowCanvas;
|
|
306
|
-
//# sourceMappingURL=WebXWindowCanvas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXWindowCanvas.js","sourceRoot":"","sources":["../../src/renderer/WebXWindowCanvas.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAgE;AAChE,0DAAqD;AAarD;;;;GAIG;AACH,MAAa,gBAAgB;IAoB3B;;OAEG;IACH,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,YAA6B,KAAW,EACX,oBAA6C;QAD7C,UAAK,GAAL,KAAK,CAAM;QACX,yBAAoB,GAApB,oBAAoB,CAAyB;QApElE,OAAE,GAAW,CAAC,CAAC;QACf,OAAE,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