@luma.gl/test-utils 9.0.0-alpha.9 → 9.0.0-beta.2
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/LICENSE +3 -1
- package/dist/check-type.js +0 -1
- package/dist/check-type.js.map +1 -1
- package/dist/create-test-device.d.ts +8 -4
- package/dist/create-test-device.d.ts.map +1 -1
- package/dist/create-test-device.js +26 -13
- package/dist/create-test-device.js.map +1 -1
- package/dist/engine/classic-animation-loop.d.ts +135 -0
- package/dist/engine/classic-animation-loop.d.ts.map +1 -0
- package/dist/engine/classic-animation-loop.js +434 -0
- package/dist/engine/classic-animation-loop.js.map +1 -0
- package/dist/index.cjs +828 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/performance-test-runner.d.ts +7 -6
- package/dist/performance-test-runner.d.ts.map +1 -1
- package/dist/performance-test-runner.js +10 -22
- package/dist/performance-test-runner.js.map +1 -1
- package/dist/register-devices.js +1 -1
- package/dist/register-devices.js.map +1 -1
- package/dist/snapshot-test-runner.d.ts +11 -7
- package/dist/snapshot-test-runner.d.ts.map +1 -1
- package/dist/snapshot-test-runner.js +23 -29
- package/dist/snapshot-test-runner.js.map +1 -1
- package/dist/test-runner.d.ts +35 -23
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +62 -81
- package/dist/test-runner.js.map +1 -1
- package/dist/utils.d.ts +5 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +28 -8
- package/src/check-type.ts +1 -1
- package/src/create-test-device.ts +28 -9
- package/src/engine/classic-animation-loop.ts +714 -0
- package/src/index.ts +3 -3
- package/src/performance-test-runner.ts +17 -13
- package/src/register-devices.ts +2 -1
- package/src/snapshot-test-runner.ts +33 -31
- package/src/test-runner.ts +100 -75
- package/src/utils.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
luma.gl is provided under the MIT license
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 vis.gl contributors
|
|
2
4
|
|
|
3
5
|
This software includes parts initially developed by Uber and open sourced under MIT license.
|
|
4
6
|
Copyright (c) 2015 Uber Technologies, Inc.
|
package/dist/check-type.js
CHANGED
package/dist/check-type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"check-type.js","names":["checkType","value"],"sources":["../src/check-type.ts"],"sourcesContent":["\n/**\n * Tests that an argument matches the type.\n * @note fails during typescript type check, not during runtime.\n */\nexport function checkType<T>(value: T): void {}\n"],"mappings":"AAKA,OAAO,SAASA,SAASA,CAAIC,KAAQ,EAAQ,CAAC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import type { Device, DeviceProps } from '@luma.gl/
|
|
1
|
+
import type { Device, DeviceProps } from '@luma.gl/core';
|
|
2
2
|
import { WebGLDevice } from '@luma.gl/webgl';
|
|
3
3
|
import { WebGPUDevice } from '@luma.gl/webgpu';
|
|
4
4
|
/** Create a test WebGL context */
|
|
5
5
|
export declare function createTestContext(opts?: Record<string, any>): WebGLRenderingContext | null;
|
|
6
6
|
/** Create a test WebGLDevice */
|
|
7
7
|
export declare function createTestDevice(props?: DeviceProps): WebGLDevice | null;
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
8
|
+
/** A WebGL 1 Device intended for testing */
|
|
9
|
+
export declare const webgl1Device: WebGLDevice;
|
|
10
|
+
/** A WebGL 2 Device intended for testing. Can be null */
|
|
11
|
+
export declare const webgl2Device: WebGLDevice;
|
|
12
|
+
/** A WebGL 2 or WebGL 1 Device intended for testing. Best available. */
|
|
13
|
+
export declare const webglDevice: WebGLDevice;
|
|
10
14
|
/** Only available after getTestDevices() has completed */
|
|
11
|
-
export declare let
|
|
15
|
+
export declare let webgpuDevice: WebGPUDevice;
|
|
12
16
|
/** Synchronously get test devices (only WebGLDevices) */
|
|
13
17
|
export declare function getWebGLTestDevices(): WebGLDevice[];
|
|
14
18
|
/** Includes WebGPU device if available */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-test-device.d.ts","sourceRoot":"","sources":["../src/create-test-device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-test-device.d.ts","sourceRoot":"","sources":["../src/create-test-device.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAQ7C,kCAAkC;AAClC,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,qBAAqB,GAAG,IAAI,CAG9F;AAED,gCAAgC;AAChC,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,WAAgB,GAAG,WAAW,GAAG,IAAI,CAU5E;AAED,4CAA4C;AAC5C,eAAO,MAAM,YAAY,EAAE,WAAuF,CAAE;AACpH,yDAAyD;AACzD,eAAO,MAAM,YAAY,EAAE,WAAuF,CAAE;AACpH,wEAAwE;AACxE,eAAO,MAAM,WAAW,EAAE,WAA0C,CAAC;AAErE,0DAA0D;AAC1D,eAAO,IAAI,YAAY,EAAE,YAAY,CAAC;AAItC,yDAAyD;AACzD,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CASnD;AAED,0CAA0C;AAC1C,wBAAsB,cAAc,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAezD"}
|
|
@@ -1,53 +1,66 @@
|
|
|
1
|
-
import { luma } from '@luma.gl/
|
|
1
|
+
import { luma } from '@luma.gl/core';
|
|
2
2
|
import { WebGLDevice } from '@luma.gl/webgl';
|
|
3
3
|
const CONTEXT_DEFAULTS = {
|
|
4
4
|
width: 1,
|
|
5
5
|
height: 1,
|
|
6
6
|
debug: true
|
|
7
7
|
};
|
|
8
|
-
export function createTestContext(
|
|
8
|
+
export function createTestContext() {
|
|
9
|
+
let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
10
|
const device = createTestDevice(opts);
|
|
10
11
|
return device && device.gl;
|
|
11
12
|
}
|
|
12
|
-
export function createTestDevice(
|
|
13
|
+
export function createTestDevice() {
|
|
14
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
15
|
try {
|
|
14
|
-
props = {
|
|
16
|
+
props = {
|
|
17
|
+
...CONTEXT_DEFAULTS,
|
|
15
18
|
...props,
|
|
16
19
|
debug: true
|
|
17
20
|
};
|
|
18
21
|
return new WebGLDevice(props);
|
|
19
22
|
} catch (error) {
|
|
20
|
-
console.error(
|
|
23
|
+
console.error(`Failed to created device '${props.id}': ${error.message}`);
|
|
21
24
|
return null;
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
export const
|
|
27
|
+
export const webgl1Device = createTestDevice({
|
|
25
28
|
id: 'webgl1-test-device',
|
|
26
29
|
webgl1: true,
|
|
27
30
|
webgl2: false
|
|
28
31
|
});
|
|
29
|
-
export const
|
|
32
|
+
export const webgl2Device = createTestDevice({
|
|
30
33
|
id: 'webgl2-test-device',
|
|
31
34
|
webgl1: false,
|
|
32
35
|
webgl2: true
|
|
33
36
|
});
|
|
34
|
-
export
|
|
37
|
+
export const webglDevice = webgl2Device || webgl1Device;
|
|
38
|
+
export let webgpuDevice;
|
|
35
39
|
let webgpuCreated = false;
|
|
36
40
|
export function getWebGLTestDevices() {
|
|
37
|
-
|
|
41
|
+
const devices = [];
|
|
42
|
+
if (webgl2Device) {
|
|
43
|
+
devices.push(webgl2Device);
|
|
44
|
+
}
|
|
45
|
+
if (webgl1Device) {
|
|
46
|
+
devices.push(webgl1Device);
|
|
47
|
+
}
|
|
48
|
+
return devices;
|
|
38
49
|
}
|
|
39
50
|
export async function getTestDevices() {
|
|
40
51
|
if (!webgpuCreated) {
|
|
41
52
|
webgpuCreated = true;
|
|
42
|
-
|
|
43
53
|
try {
|
|
44
|
-
|
|
54
|
+
webgpuDevice = await luma.createDevice({
|
|
45
55
|
id: 'webgpu-test-device',
|
|
46
56
|
type: 'webgpu'
|
|
47
57
|
});
|
|
48
58
|
} catch {}
|
|
49
59
|
}
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
const devices = getWebGLTestDevices();
|
|
61
|
+
if (webgpuDevice) {
|
|
62
|
+
devices.unshift(webgpuDevice);
|
|
63
|
+
}
|
|
64
|
+
return devices;
|
|
52
65
|
}
|
|
53
66
|
//# sourceMappingURL=create-test-device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"create-test-device.js","names":["luma","WebGLDevice","CONTEXT_DEFAULTS","width","height","debug","createTestContext","opts","arguments","length","undefined","device","createTestDevice","gl","props","error","console","id","message","webgl1Device","webgl1","webgl2","webgl2Device","webglDevice","webgpuDevice","webgpuCreated","getWebGLTestDevices","devices","push","getTestDevices","createDevice","type","unshift"],"sources":["../src/create-test-device.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Device, DeviceProps} from '@luma.gl/core';\nimport {luma} from '@luma.gl/core';\nimport {WebGLDevice} from '@luma.gl/webgl';\nimport {WebGPUDevice} from '@luma.gl/webgpu';\n\nconst CONTEXT_DEFAULTS: Partial<DeviceProps> = {\n width: 1,\n height: 1,\n debug: true\n};\n\n/** Create a test WebGL context */\nexport function createTestContext(opts: Record<string, any> = {}): WebGLRenderingContext | null {\n const device = createTestDevice(opts);\n return device && device.gl;\n}\n\n/** Create a test WebGLDevice */\nexport function createTestDevice(props: DeviceProps = {}): WebGLDevice | null {\n try {\n props = {...CONTEXT_DEFAULTS, ...props, debug: true};\n // We dont use luma.createDevice since this tests current expect this context to be created synchronously\n return new WebGLDevice(props);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Failed to created device '${props.id}': ${(error as Error).message}`);\n return null;\n }\n}\n\n/** A WebGL 1 Device intended for testing */\nexport const webgl1Device: WebGLDevice = createTestDevice({id: 'webgl1-test-device', webgl1: true, webgl2: false}) ;\n/** A WebGL 2 Device intended for testing. Can be null */\nexport const webgl2Device: WebGLDevice = createTestDevice({id: 'webgl2-test-device', webgl1: false, webgl2: true}) ;\n/** A WebGL 2 or WebGL 1 Device intended for testing. Best available. */\nexport const webglDevice: WebGLDevice = webgl2Device || webgl1Device;\n\n/** Only available after getTestDevices() has completed */\nexport let webgpuDevice: WebGPUDevice;\n\nlet webgpuCreated = false;\n\n/** Synchronously get test devices (only WebGLDevices) */\nexport function getWebGLTestDevices(): WebGLDevice[] {\n const devices: WebGLDevice[] = [];\n if (webgl2Device) {\n devices.push(webgl2Device);\n }\n if (webgl1Device) {\n devices.push(webgl1Device);\n }\n return devices;\n}\n\n/** Includes WebGPU device if available */\nexport async function getTestDevices() : Promise<Device[]> {\n if (!webgpuCreated) {\n webgpuCreated = true;\n try {\n webgpuDevice = await luma.createDevice({id: 'webgpu-test-device', type: 'webgpu'}) as WebGPUDevice;\n } catch {\n // ignore (assume WebGPU was not available)\n }\n }\n\n const devices: Device[] = getWebGLTestDevices();\n if (webgpuDevice) {\n devices.unshift(webgpuDevice);\n }\n return devices;\n}\n"],"mappings":"AAIA,SAAQA,IAAI,QAAO,eAAe;AAClC,SAAQC,WAAW,QAAO,gBAAgB;AAG1C,MAAMC,gBAAsC,GAAG;EAC7CC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACT,CAAC;AAGD,OAAO,SAASC,iBAAiBA,CAAA,EAA+D;EAAA,IAA9DC,IAAyB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC9D,MAAMG,MAAM,GAAGC,gBAAgB,CAACL,IAAI,CAAC;EACrC,OAAOI,MAAM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IAAI;MACFD,YAAY,GAAG,MAAMxB,IAAI,CAAC8B,YAAY,CAAC;QAACb,EAAE,EAAE,oBAAoB;QAAEc,IAAI,EAAE;MAAQ,CAAC,CAAiB;IACpG,CAAC,CAAC,MAAM,CAER;EACF;EAEA,MAAMJ,OAAiB,GAAGD,mBAAmB,CAAC,CAAC;EAC/C,IAAIF,YAAY,EAAE;IAChBG,OAAO,CAACK,OAAO,CAACR,YAAY,CAAC;EAC/B;EACA,OAAOG,OAAO;AAChB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Device, DeviceProps } from '@luma.gl/core';
|
|
2
|
+
import { Timeline, AnimationProps } from '@luma.gl/engine';
|
|
3
|
+
import { Stats, Stat } from '@probe.gl/stats';
|
|
4
|
+
type ContextProps = DeviceProps;
|
|
5
|
+
/**
|
|
6
|
+
* Classic Animation Props.
|
|
7
|
+
* Contain a number of deprecated fields
|
|
8
|
+
* @deprecated Use new AnimationLoop in `@luma.gl/engine`
|
|
9
|
+
*/
|
|
10
|
+
export type ClassicAnimationProps = AnimationProps & {
|
|
11
|
+
animationLoop: ClassicAnimationLoop;
|
|
12
|
+
/** @deprecated Use .device */
|
|
13
|
+
stop: () => ClassicAnimationLoop;
|
|
14
|
+
/** @deprecated Use .device */
|
|
15
|
+
gl: WebGLRenderingContext;
|
|
16
|
+
/** @deprecated Will be removed */
|
|
17
|
+
framebuffer: unknown;
|
|
18
|
+
/** @deprecated Use .timeline */
|
|
19
|
+
_timeline: Timeline;
|
|
20
|
+
/** @deprecated Use .animationLoop */
|
|
21
|
+
_loop: ClassicAnimationLoop;
|
|
22
|
+
/** @deprecated Use .animationLoop */
|
|
23
|
+
_animationLoop: ClassicAnimationLoop;
|
|
24
|
+
};
|
|
25
|
+
/** ClassicAnimationLoop properties */
|
|
26
|
+
export type ClassicAnimationLoopProps = {
|
|
27
|
+
onCreateDevice?: (props: DeviceProps) => Promise<Device>;
|
|
28
|
+
onCreateContext?: (props: ContextProps) => WebGLRenderingContext;
|
|
29
|
+
onAddHTML?: (div: HTMLDivElement) => string;
|
|
30
|
+
onInitialize?: (animationProps: ClassicAnimationProps) => {} | void | Promise<{} | void>;
|
|
31
|
+
onRender?: (animationProps: ClassicAnimationProps) => void;
|
|
32
|
+
onFinalize?: (animationProps: ClassicAnimationProps) => void;
|
|
33
|
+
onError?: (reason: any) => void;
|
|
34
|
+
stats?: Stats;
|
|
35
|
+
device?: Device;
|
|
36
|
+
glOptions?: ContextProps;
|
|
37
|
+
autoResizeViewport?: boolean;
|
|
38
|
+
autoResizeDrawingBuffer?: boolean;
|
|
39
|
+
useDevicePixels?: number | boolean;
|
|
40
|
+
/** @deprecated Use .device */
|
|
41
|
+
gl?: WebGLRenderingContext | null;
|
|
42
|
+
/** @deprecated Will be removed */
|
|
43
|
+
createFramebuffer?: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Convenient animation loop
|
|
47
|
+
* @deprecated Use `@luma.gl/engine` AnimationLoop
|
|
48
|
+
*/
|
|
49
|
+
export declare class ClassicAnimationLoop {
|
|
50
|
+
device: Device;
|
|
51
|
+
canvas?: HTMLCanvasElement | OffscreenCanvas;
|
|
52
|
+
props: Required<ClassicAnimationLoopProps>;
|
|
53
|
+
animationProps: ClassicAnimationProps;
|
|
54
|
+
timeline: Timeline;
|
|
55
|
+
stats: Stats;
|
|
56
|
+
cpuTime: Stat;
|
|
57
|
+
gpuTime: Stat;
|
|
58
|
+
frameRate: Stat;
|
|
59
|
+
display: any;
|
|
60
|
+
needsRedraw: string | null;
|
|
61
|
+
_initialized: boolean;
|
|
62
|
+
_running: boolean;
|
|
63
|
+
_animationFrameId: any;
|
|
64
|
+
_pageLoadPromise: Promise<{}> | null;
|
|
65
|
+
_nextFramePromise: Promise<ClassicAnimationLoop> | null;
|
|
66
|
+
_resolveNextFrame: ((loop: ClassicAnimationLoop) => void) | null;
|
|
67
|
+
_cpuStartTime: number;
|
|
68
|
+
/** @deprecated */
|
|
69
|
+
gl: WebGLRenderingContext;
|
|
70
|
+
constructor(props?: ClassicAnimationLoopProps);
|
|
71
|
+
destroy(): void;
|
|
72
|
+
/** @deprecated Use .destroy() */
|
|
73
|
+
delete(): void;
|
|
74
|
+
setNeedsRedraw(reason: string): this;
|
|
75
|
+
setProps(props: ClassicAnimationLoopProps): this;
|
|
76
|
+
start(opts?: {}): this;
|
|
77
|
+
/** Starts a render loop if not already running */
|
|
78
|
+
_start(props: any): Promise<this>;
|
|
79
|
+
/** Explicitly draw a frame */
|
|
80
|
+
redraw(): this;
|
|
81
|
+
stop(): this;
|
|
82
|
+
attachTimeline(timeline: Timeline): Timeline;
|
|
83
|
+
detachTimeline(): void;
|
|
84
|
+
waitForRender(): Promise<ClassicAnimationLoop>;
|
|
85
|
+
toDataURL(): Promise<string>;
|
|
86
|
+
isContextLost(): boolean;
|
|
87
|
+
onCreateDevice(deviceProps: DeviceProps): Promise<Device>;
|
|
88
|
+
onInitialize(animationProps: ClassicAnimationProps): {} | void;
|
|
89
|
+
onRender(animationProps: ClassicAnimationProps): void;
|
|
90
|
+
onFinalize(animationProps: ClassicAnimationProps): void;
|
|
91
|
+
/** @deprecated Use .onCreateDevice() */
|
|
92
|
+
onCreateContext(props: ContextProps): WebGLRenderingContext;
|
|
93
|
+
/** @deprecated */
|
|
94
|
+
getHTMLControlValue(id: any, defaultValue?: number): number;
|
|
95
|
+
_initialize(props: ClassicAnimationLoopProps): void;
|
|
96
|
+
_getPageLoadPromise(): Promise<{}>;
|
|
97
|
+
_setDisplay(display: any): void;
|
|
98
|
+
_requestAnimationFrame(): void;
|
|
99
|
+
_cancelAnimationFrame(): void;
|
|
100
|
+
_animationFrame(): void;
|
|
101
|
+
_renderFrame(props: ClassicAnimationProps): void;
|
|
102
|
+
_clearNeedsRedraw(): void;
|
|
103
|
+
_setupFrame(): void;
|
|
104
|
+
_initializeCallbackData(): void;
|
|
105
|
+
_updateCallbackData(): void;
|
|
106
|
+
_finalizeCallbackData(): void;
|
|
107
|
+
/** Add application's data to the app context object */
|
|
108
|
+
_addCallbackData(appContext: any): void;
|
|
109
|
+
/** Either uses supplied or existing context, or calls provided callback to create one */
|
|
110
|
+
_createDevice(props: DeviceProps): Promise<void>;
|
|
111
|
+
_createInfoDiv(): void;
|
|
112
|
+
_getSizeAndAspect(): {
|
|
113
|
+
width: number;
|
|
114
|
+
height: number;
|
|
115
|
+
aspect: number;
|
|
116
|
+
};
|
|
117
|
+
/** Default viewport setup */
|
|
118
|
+
_resizeViewport(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Resize the render buffer of the canvas to match canvas client size
|
|
121
|
+
* Optionally multiplying with devicePixel ratio
|
|
122
|
+
*/
|
|
123
|
+
_resizeCanvasDrawingBuffer(): void;
|
|
124
|
+
_beginTimers(): void;
|
|
125
|
+
_endTimers(): void;
|
|
126
|
+
_startEventHandling(): void;
|
|
127
|
+
_onMousemove(e: any): void;
|
|
128
|
+
_onMouseleave(e: any): void;
|
|
129
|
+
/** @deprecated */
|
|
130
|
+
_createFramebuffer(): void;
|
|
131
|
+
/** @deprecated */
|
|
132
|
+
_resizeFramebuffer(): void;
|
|
133
|
+
}
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=classic-animation-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classic-animation-loop.d.ts","sourceRoot":"","sources":["../../src/engine/classic-animation-loop.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,WAAW,EAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAO5C,KAAK,YAAY,GAAG,WAAW,CAAC;AAahC;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,aAAa,EAAE,oBAAoB,CAAC;IAEpC,8BAA8B;IAC9B,IAAI,EAAE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