@dcl/sdk-commands 7.5.1-9299912306.commit-7629bda → 7.5.1-9350870029.commit-b66059d
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.
@@ -20,10 +20,8 @@ export declare const args: {
|
|
20
20
|
'-b': string;
|
21
21
|
'-w': string;
|
22
22
|
'--skip-build': BooleanConstructor;
|
23
|
-
'--
|
23
|
+
'--desktop-client': BooleanConstructor;
|
24
24
|
'--data-layer': BooleanConstructor;
|
25
|
-
'-e': string;
|
26
|
-
'--customEntryPoint': BooleanConstructor;
|
27
25
|
};
|
28
26
|
export declare function help(options: Options): Promise<void>;
|
29
27
|
export declare function main(options: Options): Promise<void>;
|
@@ -51,7 +51,6 @@ const exit_signal_1 = require("../../components/exit-signal");
|
|
51
51
|
const workspace_validations_1 = require("../../logic/workspace-validations");
|
52
52
|
const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
53
53
|
const project_validations_1 = require("../../logic/project-validations");
|
54
|
-
const dao_explorer_1 = require("../../logic/dao-explorer");
|
55
54
|
exports.args = (0, args_1.declareArgs)({
|
56
55
|
'--dir': String,
|
57
56
|
'--help': Boolean,
|
@@ -68,10 +67,8 @@ exports.args = (0, args_1.declareArgs)({
|
|
68
67
|
'-b': '--no-browser',
|
69
68
|
'-w': '--no-watch',
|
70
69
|
'--skip-build': Boolean,
|
71
|
-
'--
|
72
|
-
'--data-layer': Boolean
|
73
|
-
'-e': '--no-dao-explorer',
|
74
|
-
'--customEntryPoint': Boolean
|
70
|
+
'--desktop-client': Boolean,
|
71
|
+
'--data-layer': Boolean
|
75
72
|
});
|
76
73
|
async function help(options) {
|
77
74
|
options.components.logger.log(`
|
@@ -106,17 +103,13 @@ async function main(options) {
|
|
106
103
|
const workingDirectory = path.resolve(process.cwd(), options.args['--dir'] || '.');
|
107
104
|
const isCi = options.args['--ci'] || process.env.CI || false;
|
108
105
|
const debug = !options.args['--no-debug'] && !isCi;
|
109
|
-
const
|
110
|
-
const openBrowser = (!experimentalDaoExplorer || !options.args['--no-browser']) && !isCi && !experimentalDaoExplorer;
|
106
|
+
const openBrowser = !options.args['--no-browser'] && !isCi;
|
111
107
|
const build = !options.args['--skip-build'];
|
112
108
|
const watch = !options.args['--no-watch'];
|
113
109
|
const withDataLayer = options.args['--data-layer'];
|
114
110
|
const enableWeb3 = options.args['--web3'];
|
115
111
|
let hasSmartWearable = false;
|
116
112
|
const workspace = await (0, workspace_validations_1.getValidWorkspace)(options.components, workingDirectory);
|
117
|
-
if (experimentalDaoExplorer) {
|
118
|
-
await (0, dao_explorer_1.ensureDaoExplorer)(options.components, workspace.rootWorkingDirectory);
|
119
|
-
}
|
120
113
|
/* istanbul ignore if */
|
121
114
|
if (workspace.projects.length > 1)
|
122
115
|
(0, beautiful_logs_1.printWarning)(options.components.logger, 'Support for multiple projects is still experimental.');
|
@@ -128,15 +121,7 @@ async function main(options) {
|
|
128
121
|
// first run `npm run build`, this can be disabled with --skip-build
|
129
122
|
// then start the embedded compiler, this can be disabled with --no-watch
|
130
123
|
if (watch || build) {
|
131
|
-
await (0, build_1.buildScene)({
|
132
|
-
...options,
|
133
|
-
args: {
|
134
|
-
'--dir': project.workingDirectory,
|
135
|
-
'--watch': watch,
|
136
|
-
_: [],
|
137
|
-
'--customEntryPoint': !!options.args['--customEntryPoint']
|
138
|
-
}
|
139
|
-
}, project);
|
124
|
+
await (0, build_1.buildScene)({ ...options, args: { '--dir': project.workingDirectory, '--watch': watch, _: [] } }, project);
|
140
125
|
await (0, project_validations_1.startValidations)(options.components, project.workingDirectory);
|
141
126
|
}
|
142
127
|
// track the event
|
@@ -207,36 +192,38 @@ async function main(options) {
|
|
207
192
|
(networkInterfaces[dev] || []).forEach((details) => {
|
208
193
|
if (details.family === 'IPv4') {
|
209
194
|
const oldBackpack = 'DISABLE_backpack_editor_v2=&ENABLE_backpack_editor_v1';
|
210
|
-
|
211
|
-
let url = `${baseUrl}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
195
|
+
let addr = `http://${details.address}:${port}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
212
196
|
if (debug) {
|
213
|
-
|
197
|
+
addr = `${addr}&SCENE_DEBUG_PANEL`;
|
214
198
|
}
|
215
199
|
if (enableWeb3 || hasSmartWearable) {
|
216
|
-
|
200
|
+
addr = `${addr}&ENABLE_WEB3`;
|
217
201
|
}
|
218
|
-
availableURLs.push(
|
202
|
+
availableURLs.push(addr);
|
219
203
|
}
|
220
204
|
});
|
221
205
|
});
|
222
206
|
// Push localhost and 127.0.0.1 at top
|
223
207
|
const sortedURLs = availableURLs.sort((a, _b) => {
|
224
|
-
return a.
|
225
|
-
? -1
|
226
|
-
: 1;
|
208
|
+
return a.toLowerCase().includes('localhost') || a.includes('127.0.0.1') || a.includes('0.0.0.0') ? -1 : 1;
|
227
209
|
});
|
228
210
|
for (const addr of sortedURLs) {
|
229
|
-
components.logger.log(` ${addr
|
211
|
+
components.logger.log(` ${addr}`);
|
212
|
+
}
|
213
|
+
if (options.args['--desktop-client']) {
|
214
|
+
components.logger.log('\n Desktop client:\n');
|
215
|
+
for (const addr of sortedURLs) {
|
216
|
+
const searchParams = new URLSearchParams();
|
217
|
+
searchParams.append('PREVIEW-MODE', addr);
|
218
|
+
components.logger.log(` dcl://${searchParams.toString()}&`);
|
219
|
+
}
|
230
220
|
}
|
231
221
|
components.logger.log('\n Details:\n');
|
232
222
|
components.logger.log('\nPress CTRL+C to exit\n');
|
233
|
-
if (experimentalDaoExplorer && sortedURLs.length) {
|
234
|
-
(0, dao_explorer_1.runDaoExplorer)(components, sortedURLs[0].base, `${baseCoords.x},${baseCoords.y}`, workingDirectory);
|
235
|
-
}
|
236
223
|
// Open preferably localhost/127.0.0.1
|
237
|
-
if (openBrowser && sortedURLs.length) {
|
224
|
+
if (openBrowser && sortedURLs.length && !options.args['--desktop-client']) {
|
238
225
|
try {
|
239
|
-
await (0, open_1.default)(sortedURLs[0]
|
226
|
+
await (0, open_1.default)(sortedURLs[0]);
|
240
227
|
}
|
241
228
|
catch (_) {
|
242
229
|
components.logger.warn('Unable to open browser automatically.');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,gDAAuB;AAGvB,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;AACvD,8CAA4D;AAC5D,sEAA0E;AAC1E,4CAA4C;AAC5C,oCAA+C;AAC/C,6DAA8D;AAC9D,0CAA6D;AAC7D,8DAAwE;AACxE,6EAAqE;AACrE,+DAAyG;AAEzG,yEAAkE;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,gDAAuB;AAGvB,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;AACvD,8CAA4D;AAC5D,sEAA0E;AAC1E,4CAA4C;AAC5C,oCAA+C;AAC/C,6DAA8D;AAC9D,0CAA6D;AAC7D,8DAAwE;AACxE,6EAAqE;AACrE,+DAAyG;AAEzG,yEAAkE;AAOrD,QAAA,IAAI,GAAG,IAAA,kBAAW,EAAC;IAC9B,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,OAAO;IACrB,cAAc,EAAE,OAAO;IACvB,YA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CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;iBAC/D;aACF;YAED,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;YACvC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YAEjD,sCAAsC;YACtC,IAAI,WAAW,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE;gBACzE,IAAI;oBACF,MAAM,IAAA,cAAI,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;iBAC1B;gBAAC,OAAO,CAAC,EAAE;oBACV,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAA;iBAChE;aACF;QACH,CAAC;KACF,CAAC,CAAA;IAEF,mEAAmE;IACnE,8EAA8E;IAC9E,UAAU;IACV,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAA;AACjD,CAAC;AA1JD,oBA0JC"}
|
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk-commands",
|
3
3
|
"description": "",
|
4
|
-
"version": "7.5.1-
|
4
|
+
"version": "7.5.1-9350870029.commit-b66059d",
|
5
5
|
"author": "Decentraland",
|
6
6
|
"bin": {
|
7
7
|
"sdk-commands": "./dist/index.js"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
10
|
"@dcl/crypto": "^3.4.4",
|
11
|
-
"@dcl/ecs": "7.5.1-
|
11
|
+
"@dcl/ecs": "7.5.1-9350870029.commit-b66059d",
|
12
12
|
"@dcl/hashing": "1.1.3",
|
13
|
-
"@dcl/inspector": "7.5.1-
|
13
|
+
"@dcl/inspector": "7.5.1-9350870029.commit-b66059d",
|
14
14
|
"@dcl/linker-dapp": "^0.12.0",
|
15
15
|
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
|
16
|
-
"@dcl/protocol": "1.0.0-
|
16
|
+
"@dcl/protocol": "1.0.0-9115457439.commit-926ebd1",
|
17
17
|
"@dcl/quests-client": "^1.0.3",
|
18
18
|
"@dcl/quests-manager": "^0.1.4",
|
19
19
|
"@dcl/rpc": "^1.1.1",
|
@@ -38,7 +38,6 @@
|
|
38
38
|
"open": "^8.4.0",
|
39
39
|
"portfinder": "^1.0.32",
|
40
40
|
"prompts": "^2.4.2",
|
41
|
-
"tar": "^7.1.0",
|
42
41
|
"typescript": "^5.0.2",
|
43
42
|
"undici": "^5.19.1",
|
44
43
|
"uuid": "^9.0.1"
|
@@ -74,5 +73,5 @@
|
|
74
73
|
"displayName": "SDK",
|
75
74
|
"tsconfig": "./tsconfig.json"
|
76
75
|
},
|
77
|
-
"commit": "
|
76
|
+
"commit": "b66059db17f126e8e416a7699e387b7e8ac79bdd"
|
78
77
|
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { CliComponents } from '../components';
|
2
|
-
export declare function ensureDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, workingDirectory: string): Promise<void>;
|
3
|
-
export declare function runDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, realmUrl: string, locationCoords: string, workingDirectory: string): void;
|
@@ -1,154 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.runDaoExplorer = exports.ensureDaoExplorer = void 0;
|
30
|
-
const fs_1 = require("./fs");
|
31
|
-
const path_1 = __importDefault(require("path"));
|
32
|
-
const os_1 = require("os");
|
33
|
-
const error_1 = require("./error");
|
34
|
-
const beautiful_logs_1 = require("./beautiful-logs");
|
35
|
-
const tar = __importStar(require("tar"));
|
36
|
-
const child_process_1 = __importDefault(require("child_process"));
|
37
|
-
var SupportedPlatform;
|
38
|
-
(function (SupportedPlatform) {
|
39
|
-
SupportedPlatform[SupportedPlatform["SP_MACOS_ARM64"] = 0] = "SP_MACOS_ARM64";
|
40
|
-
SupportedPlatform[SupportedPlatform["SP_MACOS_X64"] = 1] = "SP_MACOS_X64";
|
41
|
-
SupportedPlatform[SupportedPlatform["SP_LINUX_X64"] = 2] = "SP_LINUX_X64";
|
42
|
-
SupportedPlatform[SupportedPlatform["SP_WINDOWS_X64"] = 3] = "SP_WINDOWS_X64";
|
43
|
-
SupportedPlatform[SupportedPlatform["SP_UNSUPPORTED"] = 4] = "SP_UNSUPPORTED";
|
44
|
-
})(SupportedPlatform || (SupportedPlatform = {}));
|
45
|
-
const BEVY_BASE_URL = 'https://github.com/decentraland/bevy-explorer/releases/download/alpha-2024-05-28-11-15-26/bevy-explorer-2024-05-28-11-15-26';
|
46
|
-
const BEVY_URL_PLATFORM_SUFFIX = {
|
47
|
-
[SupportedPlatform.SP_LINUX_X64]: 'linux-x86_64.tar.gz',
|
48
|
-
[SupportedPlatform.SP_MACOS_ARM64]: 'macos-m1m2.tar.gz',
|
49
|
-
[SupportedPlatform.SP_MACOS_X64]: 'macos-x86_64.tar.gz',
|
50
|
-
[SupportedPlatform.SP_WINDOWS_X64]: 'windows-x86_64.zip',
|
51
|
-
[SupportedPlatform.SP_UNSUPPORTED]: 'empty'
|
52
|
-
};
|
53
|
-
function getPlatform() {
|
54
|
-
const os = (0, os_1.platform)();
|
55
|
-
const arch = process.arch;
|
56
|
-
switch (os) {
|
57
|
-
case 'darwin':
|
58
|
-
if (arch === 'arm64') {
|
59
|
-
return SupportedPlatform.SP_MACOS_ARM64;
|
60
|
-
}
|
61
|
-
else if (arch === 'x64') {
|
62
|
-
return SupportedPlatform.SP_MACOS_ARM64;
|
63
|
-
}
|
64
|
-
else {
|
65
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
66
|
-
}
|
67
|
-
case 'win32':
|
68
|
-
if (arch === 'x64') {
|
69
|
-
return SupportedPlatform.SP_WINDOWS_X64;
|
70
|
-
}
|
71
|
-
else {
|
72
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
73
|
-
}
|
74
|
-
case 'linux':
|
75
|
-
if (arch === 'x64') {
|
76
|
-
return SupportedPlatform.SP_LINUX_X64;
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
80
|
-
}
|
81
|
-
default:
|
82
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
function getDaoExplorerPath(workingDirectory) {
|
86
|
-
return path_1.default.resolve(workingDirectory, 'node_modules', '.bin', 'dao-explorer');
|
87
|
-
}
|
88
|
-
function getDaoExplorerExecutablePath(workingDirectory) {
|
89
|
-
const platform = getPlatform();
|
90
|
-
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
91
|
-
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
92
|
-
}
|
93
|
-
if (platform === SupportedPlatform.SP_WINDOWS_X64) {
|
94
|
-
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy.exe');
|
95
|
-
}
|
96
|
-
else {
|
97
|
-
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy');
|
98
|
-
}
|
99
|
-
}
|
100
|
-
async function ensureDaoExplorer(components, workingDirectory) {
|
101
|
-
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
102
|
-
const platform = getPlatform();
|
103
|
-
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
104
|
-
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
105
|
-
}
|
106
|
-
const url = `${BEVY_BASE_URL}-${BEVY_URL_PLATFORM_SUFFIX[platform]}`;
|
107
|
-
const versionFilePath = path_1.default.resolve(daoExplorerFolderPath, 'version');
|
108
|
-
if (await components.fs.fileExists(versionFilePath)) {
|
109
|
-
const versionContent = await components.fs.readFile(versionFilePath, 'utf-8');
|
110
|
-
if (versionContent === url) {
|
111
|
-
return;
|
112
|
-
}
|
113
|
-
}
|
114
|
-
const tempPackagePath = path_1.default.resolve(daoExplorerFolderPath, BEVY_URL_PLATFORM_SUFFIX[platform]);
|
115
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Downloading DAO Explorer ${BEVY_URL_PLATFORM_SUFFIX[platform]} from ${url}`);
|
116
|
-
if (await components.fs.directoryExists(daoExplorerFolderPath)) {
|
117
|
-
await components.fs.rm(daoExplorerFolderPath, { recursive: true, force: true });
|
118
|
-
}
|
119
|
-
await components.fs.mkdir(daoExplorerFolderPath, { recursive: true });
|
120
|
-
await (0, fs_1.download)(components, url, tempPackagePath);
|
121
|
-
if (tempPackagePath.endsWith('.zip')) {
|
122
|
-
await (0, fs_1.extract)(tempPackagePath, daoExplorerFolderPath);
|
123
|
-
}
|
124
|
-
else if (tempPackagePath.endsWith('.tar.gz') || tempPackagePath.endsWith('.tgz')) {
|
125
|
-
await tar.extract({
|
126
|
-
C: daoExplorerFolderPath,
|
127
|
-
f: tempPackagePath
|
128
|
-
});
|
129
|
-
}
|
130
|
-
await components.fs.writeFile(versionFilePath, url);
|
131
|
-
}
|
132
|
-
exports.ensureDaoExplorer = ensureDaoExplorer;
|
133
|
-
function runDaoExplorer(components, realmUrl, locationCoords, workingDirectory) {
|
134
|
-
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
135
|
-
const executablePath = getDaoExplorerExecutablePath(workingDirectory);
|
136
|
-
executablePath;
|
137
|
-
const ts = child_process_1.default.spawn(executablePath, ['--preview', '--server', realmUrl, '--location', locationCoords], {
|
138
|
-
env: process.env,
|
139
|
-
cwd: daoExplorerFolderPath
|
140
|
-
});
|
141
|
-
ts.on('close', (code) => {
|
142
|
-
/* istanbul ignore else */
|
143
|
-
if (code === 0) {
|
144
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Type checking completed without errors`);
|
145
|
-
}
|
146
|
-
else {
|
147
|
-
return;
|
148
|
-
}
|
149
|
-
});
|
150
|
-
ts.stdout.pipe(process.stdout);
|
151
|
-
ts.stderr.pipe(process.stderr);
|
152
|
-
}
|
153
|
-
exports.runDaoExplorer = runDaoExplorer;
|
154
|
-
//# sourceMappingURL=dao-explorer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dao-explorer.js","sourceRoot":"","sources":["../../src/logic/dao-explorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6BAAwC;AACxC,gDAAuB;AACvB,2BAA6B;AAC7B,mCAAkC;AAClC,qDAAoD;AACpD,yCAA0B;AAC1B,kEAAyC;AAEzC,IAAK,iBAMJ;AAND,WAAK,iBAAiB;IACpB,6EAAc,CAAA;IACd,yEAAY,CAAA;IACZ,yEAAY,CAAA;IACZ,6EA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