@bitmagic/cli 0.1.28 → 0.1.29
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.
|
@@ -101,7 +101,7 @@ export function renderEditorShell(options) {
|
|
|
101
101
|
padding: 4px 10px; font: inherit; cursor: pointer; }
|
|
102
102
|
button:hover { background: #30303a; }
|
|
103
103
|
button:disabled { opacity: .5; cursor: default; background: #26262e; }
|
|
104
|
-
|
|
104
|
+
/* .tab:hover is declared after .tab.active and would otherwise win on an active tab. */
|
|
105
105
|
#tabs .tab.active:hover { background: #3352c4; }
|
|
106
106
|
.banner { display: none; align-items: center; gap: 12px; flex: none; padding: 8px 12px;
|
|
107
107
|
background: #3a2c12; border-bottom: 1px solid #574018; color: #f0d9a8; }
|
|
@@ -233,6 +233,7 @@ export function renderEditorShell(options) {
|
|
|
233
233
|
var terrainBanner = document.getElementById('terrain-banner');
|
|
234
234
|
var buildBanner = document.getElementById('build-banner');
|
|
235
235
|
var autoToggle = document.getElementById('auto-toggle');
|
|
236
|
+
var tabButtons = document.querySelectorAll('.tab');
|
|
236
237
|
|
|
237
238
|
var loaded = false;
|
|
238
239
|
var saving = false;
|
|
@@ -294,23 +295,35 @@ export function renderEditorShell(options) {
|
|
|
294
295
|
});
|
|
295
296
|
}
|
|
296
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Ask the engine something and wait for its answer, or null on timeout.
|
|
300
|
+
*
|
|
301
|
+
* The waiter is armed before the post for the same reason boot() arms both of its own before
|
|
302
|
+
* navigating: nothing here may assume the reply cannot land early.
|
|
303
|
+
*/
|
|
304
|
+
function request(type, replyType, timeoutMs, data) {
|
|
305
|
+
var reply = await_(replyType, timeoutMs);
|
|
306
|
+
post(type, data);
|
|
307
|
+
return reply;
|
|
308
|
+
}
|
|
309
|
+
|
|
297
310
|
window.addEventListener('message', function (event) {
|
|
298
311
|
var message = event.data;
|
|
299
312
|
if (!message || typeof message.type !== 'string') return;
|
|
300
313
|
|
|
301
|
-
|
|
302
|
-
if (
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
314
|
+
waiters = waiters.filter(function (waiter) {
|
|
315
|
+
if (waiter.type !== message.type) return true;
|
|
316
|
+
clearTimeout(waiter.timer);
|
|
317
|
+
waiter.resolve(message);
|
|
318
|
+
return false;
|
|
319
|
+
});
|
|
308
320
|
|
|
309
321
|
switch (message.type) {
|
|
310
322
|
case 'GAME_STATE_CHANGED':
|
|
311
323
|
gameState = message.state || '';
|
|
312
324
|
if (activeTab === 'game' && loaded) {
|
|
313
|
-
|
|
325
|
+
var playing = gameState === 'playing';
|
|
326
|
+
setStatus(playing ? 'saved' : '', playing ? 'Playing' : 'Ready');
|
|
314
327
|
}
|
|
315
328
|
break;
|
|
316
329
|
|
|
@@ -389,7 +402,7 @@ export function renderEditorShell(options) {
|
|
|
389
402
|
try {
|
|
390
403
|
var project = await (await fetch('/api/game-data')).json();
|
|
391
404
|
var asset = ((project.gameData && project.gameData.assets) || [])
|
|
392
|
-
.
|
|
405
|
+
.find(function (a) { return a && a.id === assetId; });
|
|
393
406
|
if (asset && typeof asset.description === 'string') existing = asset.description;
|
|
394
407
|
} catch (error) {
|
|
395
408
|
// No description to prefill is a worse dialog, not a broken one.
|
|
@@ -415,9 +428,9 @@ export function renderEditorShell(options) {
|
|
|
415
428
|
return;
|
|
416
429
|
}
|
|
417
430
|
lastKnownMtime = result.worldMtimeMs || lastKnownMtime;
|
|
418
|
-
hqNote.classList.add('show');
|
|
419
431
|
|
|
420
|
-
// The description is saved either way; only what happens next differs.
|
|
432
|
+
// The description is saved either way; only what happens next differs. Every branch below
|
|
433
|
+
// ends in showHqNote, which is what reveals the note.
|
|
421
434
|
if (result.canGenerate === false) {
|
|
422
435
|
showHqNote('Description saved. ' + (result.reason || 'This asset cannot be regenerated.'), '');
|
|
423
436
|
setStatus('saved', 'Description saved');
|
|
@@ -536,8 +549,7 @@ export function renderEditorShell(options) {
|
|
|
536
549
|
|
|
537
550
|
if (activeTab === 'editor' && tab === 'game' && loaded && !fromEngine) {
|
|
538
551
|
await flush();
|
|
539
|
-
|
|
540
|
-
var terrain = await await_('TERRAIN_HAS_CHANGES', 2000);
|
|
552
|
+
var terrain = await request('CHECK_TERRAIN_CHANGES', 'TERRAIN_HAS_CHANGES', 2000);
|
|
541
553
|
if (terrain && terrain.hasChanges === true) {
|
|
542
554
|
terrainBanner.classList.add('show');
|
|
543
555
|
return;
|
|
@@ -546,10 +558,9 @@ export function renderEditorShell(options) {
|
|
|
546
558
|
|
|
547
559
|
activeTab = tab;
|
|
548
560
|
writePref(TAB_KEY, tab);
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
561
|
+
tabButtons.forEach(function (button) {
|
|
562
|
+
button.classList.toggle('active', button.getAttribute('data-tab') === tab);
|
|
563
|
+
});
|
|
553
564
|
if (!loaded) return;
|
|
554
565
|
applyTab(tab);
|
|
555
566
|
// One loop for both tabs; the work inside it is what differs (see runLoop()).
|
|
@@ -614,13 +625,11 @@ export function renderEditorShell(options) {
|
|
|
614
625
|
async function flush() {
|
|
615
626
|
if (!loaded || saving) return;
|
|
616
627
|
|
|
617
|
-
|
|
618
|
-
var changes = await await_('SCENE_HAS_CHANGES', 2000);
|
|
628
|
+
var changes = await request('CHECK_SCENE_CHANGES', 'SCENE_HAS_CHANGES', 2000);
|
|
619
629
|
if (!changes) return;
|
|
620
630
|
if (!changes.hasChanges && !markersDirty) return;
|
|
621
631
|
|
|
622
|
-
|
|
623
|
-
var status = await await_('SCENE_EDITING_STATUS', 5000);
|
|
632
|
+
var status = await request('GET_SCENE_EDITING_STATUS', 'SCENE_EDITING_STATUS', 5000);
|
|
624
633
|
if (!status) return;
|
|
625
634
|
|
|
626
635
|
saving = true;
|
|
@@ -663,8 +672,7 @@ export function renderEditorShell(options) {
|
|
|
663
672
|
*/
|
|
664
673
|
async function checkTerrainEdits() {
|
|
665
674
|
if (!loaded) return;
|
|
666
|
-
|
|
667
|
-
var terrain = await await_('TERRAIN_HAS_CHANGES', 2000);
|
|
675
|
+
var terrain = await request('CHECK_TERRAIN_CHANGES', 'TERRAIN_HAS_CHANGES', 2000);
|
|
668
676
|
if (!terrain) return;
|
|
669
677
|
terrainBanner.classList.toggle('show', terrain.hasChanges === true);
|
|
670
678
|
}
|
|
@@ -1074,8 +1082,7 @@ export function renderEditorShell(options) {
|
|
|
1074
1082
|
var shotButton = document.getElementById('shot');
|
|
1075
1083
|
|
|
1076
1084
|
async function captureGamePng() {
|
|
1077
|
-
|
|
1078
|
-
var response = await await_('SCREENSHOT_RESPONSE', 15000);
|
|
1085
|
+
var response = await request('CAPTURE_SCREENSHOT', 'SCREENSHOT_RESPONSE', 15000, { mode: 'immediate' });
|
|
1079
1086
|
if (!response) throw new Error('the game did not answer');
|
|
1080
1087
|
// The engine reports its own failures as a null screenshot rather than staying silent.
|
|
1081
1088
|
if (!response.screenshot) throw new Error('the engine could not capture a frame');
|
|
@@ -1187,11 +1194,14 @@ export function renderEditorShell(options) {
|
|
|
1187
1194
|
* loop here — a dropped stream degrades to the mtime poll above until the browser reopens it.
|
|
1188
1195
|
*/
|
|
1189
1196
|
function listenForEvents() {
|
|
1197
|
+
// An unparseable payload is a missing label, not a lost event: the event's NAME is what says
|
|
1198
|
+
// what happened, and every field read below has a fallback.
|
|
1199
|
+
function payloadOf(event) {
|
|
1200
|
+
try { return JSON.parse(event.data); } catch (error) { return {}; }
|
|
1201
|
+
}
|
|
1190
1202
|
var events = new EventSource('/api/events/stream');
|
|
1191
1203
|
events.addEventListener('reload', function (event) {
|
|
1192
|
-
|
|
1193
|
-
try { payload = JSON.parse(event.data); } catch (error) { /* reason is a label */ }
|
|
1194
|
-
onChangeSignal(payload.reason || 'change');
|
|
1204
|
+
onChangeSignal(payloadOf(event).reason || 'change');
|
|
1195
1205
|
});
|
|
1196
1206
|
// A bare "the list moved" ping: a generation started, made progress, failed, or world.json was
|
|
1197
1207
|
// rewritten. The panel re-reads rather than the server sending a diff, which keeps the whole
|
|
@@ -1200,8 +1210,7 @@ export function renderEditorShell(options) {
|
|
|
1200
1210
|
void refreshAssets();
|
|
1201
1211
|
});
|
|
1202
1212
|
events.addEventListener('build', function (event) {
|
|
1203
|
-
var payload =
|
|
1204
|
-
try { payload = JSON.parse(event.data); } catch (error) { /* see above */ }
|
|
1213
|
+
var payload = payloadOf(event);
|
|
1205
1214
|
if (payload.status === 'failed') {
|
|
1206
1215
|
document.getElementById('build-message').textContent = payload.message || 'The build failed.';
|
|
1207
1216
|
buildBanner.classList.add('show');
|
|
@@ -1220,12 +1229,11 @@ export function renderEditorShell(options) {
|
|
|
1220
1229
|
post('REVERT_TERRAIN_CHANGES');
|
|
1221
1230
|
terrainBanner.classList.remove('show');
|
|
1222
1231
|
});
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
void selectTab(event.currentTarget.getAttribute('data-tab'), {});
|
|
1232
|
+
tabButtons.forEach(function (button) {
|
|
1233
|
+
button.addEventListener('click', function () {
|
|
1234
|
+
void selectTab(button.getAttribute('data-tab'));
|
|
1227
1235
|
});
|
|
1228
|
-
}
|
|
1236
|
+
});
|
|
1229
1237
|
autoToggle.addEventListener('change', function () {
|
|
1230
1238
|
autoReload = autoToggle.checked;
|
|
1231
1239
|
writePref(AUTO_KEY, autoReload ? '1' : '0');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-page.js","sourceRoot":"","sources":["../../src/editor/shell-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,kGAAkG;AAClG,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2gC7C,CAAC;AACF,CAAC"}
|
|
@@ -6,7 +6,16 @@
|
|
|
6
6
|
* PLATFORM_GENERATED_FILES in project.ts), so this is the only source of truth upgrade has for
|
|
7
7
|
* telling a creator what to add by hand.
|
|
8
8
|
*/
|
|
9
|
-
export declare const DEPENDENCIES:
|
|
9
|
+
export declare const DEPENDENCIES: {
|
|
10
|
+
'@dimforge/rapier2d-compat': string;
|
|
11
|
+
'@dimforge/rapier3d-compat': string;
|
|
12
|
+
'@msgpack/msgpack': string;
|
|
13
|
+
fflate: string;
|
|
14
|
+
i18next: string;
|
|
15
|
+
'i18next-browser-languagedetector': string;
|
|
16
|
+
jszip: string;
|
|
17
|
+
three: string;
|
|
18
|
+
};
|
|
10
19
|
export declare const DEV_DEPENDENCIES: Record<string, string>;
|
|
11
20
|
export declare function renderPackageJson(name: string): string;
|
|
12
21
|
export declare function renderTsconfig(): string;
|
|
@@ -16,6 +16,9 @@ export const DEPENDENCIES = {
|
|
|
16
16
|
'i18next-browser-languagedetector': '^8.0.4',
|
|
17
17
|
jszip: '^3.10.1',
|
|
18
18
|
three: '^0.185.1',
|
|
19
|
+
// `satisfies` rather than a `Record<string, string>` annotation: it keeps the same contract
|
|
20
|
+
// while leaving the key names visible to the type system, so `esmUrl('fflate')` below cannot
|
|
21
|
+
// name a package this map does not install.
|
|
19
22
|
};
|
|
20
23
|
export const DEV_DEPENDENCIES = {
|
|
21
24
|
'@types/node': '^24.10.0',
|
|
@@ -29,13 +32,26 @@ export const DEV_DEPENDENCIES = {
|
|
|
29
32
|
vite: '^7.3.1',
|
|
30
33
|
'vite-plugin-singlefile': '^2.3.3',
|
|
31
34
|
};
|
|
35
|
+
/** The exact release a `^x.y.z` range in `DEPENDENCIES` installs. */
|
|
36
|
+
function pinnedVersion(name) {
|
|
37
|
+
return DEPENDENCIES[name].replace(/^\^/, '');
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The CDN URL the browser loads a package from, pinned to the version `DEPENDENCIES` installs
|
|
41
|
+
* for tsc. Derived rather than written a second time: the two must agree, and a bump that
|
|
42
|
+
* updates the npm range but not the URL leaves a project type-checking against one copy of a
|
|
43
|
+
* library while the game runs against another.
|
|
44
|
+
*/
|
|
45
|
+
function esmUrl(name) {
|
|
46
|
+
return `https://esm.sh/${name}@${pinnedVersion(name)}`;
|
|
47
|
+
}
|
|
32
48
|
/**
|
|
33
|
-
* The three.js release every `three*` import map entry below resolves to.
|
|
49
|
+
* The three.js release every `three*` import map entry below resolves to. Named once because
|
|
34
50
|
* the entries repeat it eight times, including four times inside the `three` shim, and a bump
|
|
35
51
|
* that updates some copies but not others splits the engine across two module instances — the
|
|
36
52
|
* exact failure the comments below describe.
|
|
37
53
|
*/
|
|
38
|
-
const THREE_VERSION = '
|
|
54
|
+
const THREE_VERSION = pinnedVersion('three');
|
|
39
55
|
/**
|
|
40
56
|
* `three` resolves to a shim, not straight to the webgpu build. r185's three.webgpu.js exports
|
|
41
57
|
* neither `UniformsUtils` (which every classic postprocessing pass imports from `three`) nor
|
|
@@ -70,12 +86,12 @@ const CDN_IMPORTS = {
|
|
|
70
86
|
'three/addons/': `https://esm.sh/*three@${THREE_VERSION}/addons/`,
|
|
71
87
|
'three/examples/jsm/': `https://esm.sh/*three@${THREE_VERSION}/examples/jsm/`,
|
|
72
88
|
'three/': `https://esm.sh/three@${THREE_VERSION}/`,
|
|
73
|
-
'@dimforge/rapier3d-compat': '
|
|
74
|
-
'@dimforge/rapier2d-compat': '
|
|
75
|
-
i18next: '
|
|
76
|
-
'i18next-browser-languagedetector': '
|
|
77
|
-
'@msgpack/msgpack': '
|
|
78
|
-
fflate: '
|
|
89
|
+
'@dimforge/rapier3d-compat': esmUrl('@dimforge/rapier3d-compat'),
|
|
90
|
+
'@dimforge/rapier2d-compat': esmUrl('@dimforge/rapier2d-compat'),
|
|
91
|
+
i18next: esmUrl('i18next'),
|
|
92
|
+
'i18next-browser-languagedetector': esmUrl('i18next-browser-languagedetector'),
|
|
93
|
+
'@msgpack/msgpack': esmUrl('@msgpack/msgpack'),
|
|
94
|
+
fflate: esmUrl('fflate'),
|
|
79
95
|
};
|
|
80
96
|
/** Every JSON file the scaffold writes is 2-space indented and newline-terminated. */
|
|
81
97
|
function renderJson(value) {
|
|
@@ -153,6 +169,20 @@ export function renderTsconfig() {
|
|
|
153
169
|
],
|
|
154
170
|
});
|
|
155
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* The Bitmagic mark, inlined. Same 16x16 PNG as game/Images/favicon.png — keep in step with
|
|
174
|
+
* game/index.html. A data URI rather than a file reference because a built game is a single
|
|
175
|
+
* self-contained index.html that gets served from a bucket with no /favicon.png of its own.
|
|
176
|
+
* Regenerate with: base64 -i game/Images/favicon.png
|
|
177
|
+
*/
|
|
178
|
+
const FAVICON_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1UlEQVQ4jX2TsW/aQBTGfxB7q' +
|
|
179
|
+
'JBiprYSd8ZEqmjE0IykC0ipVKlT/wOjRGLuyFKJLnSqS5amo+eygLIUJjME1iJFERuWRfZgZnQdwK5jhX7TvXfv+757p/' +
|
|
180
|
+
'cySimSME3xCWgAb3iMGdANgqWbTGYiAdMUJ0AfKPJ/zICPQbD0Y4Ed2QOMdLUQkjBcEYZhMr0CToJg6WdNU+R3zkaa6Dj' +
|
|
181
|
+
'f6XS+cnt7R7v9BfFM8Pm4za7WBdB2/RbT5MlkCoDneQCcn1/w/u4DF78bUVnNNEXjwDAOfwIvkwKVSoWbmwnz+ZxqtcpgM' +
|
|
182
|
+
'EDXdY5qR1xd/0i2kzkwjMOrf71uL05P32LbNvl8nvF4TKvVolQq8eLVc4rFIsPhMBJ4rUWOZ2fvGI1GNJtNNE2PX1Mul+l' +
|
|
183
|
+
'0OuRyOSzLQte1x78sZUFJWVCXl10VwbZttVgs4jh5VkqpiCNlQWUjoc1mE4u6rovv+/T7fQAsy2IPVhrbwUhPHfV6/UnG/' +
|
|
184
|
+
'f0yGXpZoAvQ6/VYr9f7nGI4jpMMuyilkLLwR8qCqlSOVa/3S4VhqNIIw1A5zrdk/55Sav8oCyGRUsRW0+k06TwD6kGwfEg' +
|
|
185
|
+
'vk/vUf6QwZrtMD5DYxgimKRpsx7uWIg6Afnqd/wLHH+fn7VRm6gAAAABJRU5ErkJggg==';
|
|
156
186
|
export function renderIndexHtml() {
|
|
157
187
|
const aliasImports = importMapEntries();
|
|
158
188
|
const imports = { ...CDN_IMPORTS, ...aliasImports };
|
|
@@ -170,10 +200,10 @@ export function renderIndexHtml() {
|
|
|
170
200
|
<meta charset="UTF-8">
|
|
171
201
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
172
202
|
<title>Bitmagic Game</title>
|
|
203
|
+
<link rel="icon" type="image/png" href="${FAVICON_DATA_URI}">
|
|
173
204
|
<style>
|
|
174
205
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
175
|
-
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
|
|
176
|
-
html, body { touch-action: none; }
|
|
206
|
+
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; touch-action: none; }
|
|
177
207
|
canvas { display: block; }
|
|
178
208
|
#game-container {
|
|
179
209
|
position: fixed;
|
|
@@ -211,7 +241,6 @@ function renderAliasEntries() {
|
|
|
211
241
|
.join(',\n');
|
|
212
242
|
}
|
|
213
243
|
export function renderViteConfig() {
|
|
214
|
-
const entries = renderAliasEntries();
|
|
215
244
|
return `import { defineConfig } from 'vite';
|
|
216
245
|
|
|
217
246
|
// Aliases mirror tsconfig paths but point at the COMPILED output: tsc emits to dist/ and the
|
|
@@ -223,7 +252,7 @@ export default defineConfig({
|
|
|
223
252
|
assetsInclude: ['**/*.wasm'],
|
|
224
253
|
resolve: {
|
|
225
254
|
alias: {
|
|
226
|
-
${
|
|
255
|
+
${renderAliasEntries()}
|
|
227
256
|
}
|
|
228
257
|
},
|
|
229
258
|
server: {
|
|
@@ -244,7 +273,6 @@ ${entries}
|
|
|
244
273
|
* versions with the engine it was written for.
|
|
245
274
|
*/
|
|
246
275
|
export function renderVitePublishConfig() {
|
|
247
|
-
const entries = renderAliasEntries();
|
|
248
276
|
return `import { defineConfig } from 'vite';
|
|
249
277
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
250
278
|
|
|
@@ -273,7 +301,7 @@ export default defineConfig({
|
|
|
273
301
|
define: { __BUNDLED__: true },
|
|
274
302
|
resolve: {
|
|
275
303
|
alias: {
|
|
276
|
-
${
|
|
304
|
+
${renderAliasEntries()}
|
|
277
305
|
}
|
|
278
306
|
},
|
|
279
307
|
build: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAA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