@procore/core-scripts 11.4.5 → 11.6.0

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.
@@ -1,415 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- 'use strict';
8
- const address = require('address');
9
- const fs = require('fs');
10
- const path = require('path');
11
- const url = require('url');
12
- const chalk = require('chalk');
13
- const detect = require('detect-port-alt');
14
- const isRoot = require('is-root');
15
- const prompts = require('prompts');
16
- const clearConsole = require('react-dev-utils/clearConsole');
17
- const getProcessForPort = require('react-dev-utils/getProcessForPort');
18
- const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
19
- const forkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
20
- const formatWebpackMessages = require('./formatWebpackMessages');
21
- const isInteractive = process.stdout.isTTY;
22
- function prepareUrls(protocol, host, port, pathname = '/') {
23
- const formatUrl = (hostname) => url.format({
24
- protocol,
25
- hostname,
26
- port,
27
- pathname,
28
- });
29
- const prettyPrintUrl = (hostname) => url.format({
30
- protocol,
31
- hostname,
32
- port: chalk.bold(port),
33
- pathname,
34
- });
35
- const isUnspecifiedHost = host === '0.0.0.0' || host === '::';
36
- let prettyHost, lanUrlForConfig, lanUrlForTerminal;
37
- if (isUnspecifiedHost) {
38
- prettyHost = 'localhost';
39
- try {
40
- // This can only return an IPv4 address
41
- lanUrlForConfig = address.ip();
42
- if (lanUrlForConfig) {
43
- // Check if the address is a private ip
44
- // https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces
45
- if (/^10[.]|^172[.](1[6-9]|2[0-9]|3[0-1])[.]|^192[.]168[.]/.test(lanUrlForConfig)) {
46
- // Address is private, format it for later use
47
- lanUrlForTerminal = prettyPrintUrl(lanUrlForConfig);
48
- }
49
- else {
50
- // Address is not private, so we will discard it
51
- lanUrlForConfig = undefined;
52
- }
53
- }
54
- }
55
- catch (_e) {
56
- // ignored
57
- }
58
- }
59
- else {
60
- prettyHost = host;
61
- }
62
- const localUrlForTerminal = prettyPrintUrl(prettyHost);
63
- const localUrlForBrowser = formatUrl(prettyHost);
64
- return {
65
- lanUrlForConfig,
66
- lanUrlForTerminal,
67
- localUrlForTerminal,
68
- localUrlForBrowser,
69
- };
70
- }
71
- function printInstructions(appName, urls, useYarn) {
72
- console.log();
73
- console.log(`You can now view ${chalk.bold(appName)} in the browser.`);
74
- console.log();
75
- if (urls.lanUrlForTerminal) {
76
- console.log(` ${chalk.bold('Local:')} ${urls.localUrlForTerminal}`);
77
- console.log(` ${chalk.bold('On Your Network:')} ${urls.lanUrlForTerminal}`);
78
- }
79
- else {
80
- console.log(` ${urls.localUrlForTerminal}`);
81
- }
82
- console.log();
83
- console.log('Note that the development build is not optimized.');
84
- console.log(`To create a production build, use ` +
85
- `${chalk.cyan(`${useYarn ? 'yarn' : 'npm run'} build`)}.`);
86
- console.log();
87
- }
88
- function createCompiler({ appName, config, devSocket, urls, useYarn, useTypeScript, tscCompileOnError, webpack, }) {
89
- // "Compiler" is a low-level interface to webpack.
90
- // It lets us listen to some events and provide our own custom messages.
91
- let compiler;
92
- try {
93
- compiler = webpack(config);
94
- }
95
- catch (err) {
96
- console.log(chalk.red('Failed to compile.'));
97
- console.log();
98
- console.log(err.message || err);
99
- console.log();
100
- process.exit(1);
101
- }
102
- // "invalid" event fires when you have changed a file, and webpack is
103
- // recompiling a bundle. WebpackDevServer takes care to pause serving the
104
- // bundle, so if you refresh, it'll wait instead of serving the old one.
105
- // "invalid" is short for "bundle invalidated", it doesn't imply any errors.
106
- compiler.hooks.invalid.tap('invalid', () => {
107
- if (isInteractive) {
108
- clearConsole();
109
- }
110
- console.log('Compiling...');
111
- });
112
- let isFirstCompile = true;
113
- let tsMessagesPromise;
114
- let tsMessagesResolver;
115
- if (useTypeScript) {
116
- compiler.hooks.beforeCompile.tap('beforeCompile', () => {
117
- tsMessagesPromise = new Promise((resolve) => {
118
- tsMessagesResolver = (msgs) => resolve(msgs);
119
- });
120
- });
121
- forkTsCheckerWebpackPlugin
122
- .getCompilerHooks(compiler)
123
- .receive.tap('afterTypeScriptCheck', (diagnostics, lints) => {
124
- const allMsgs = [...diagnostics, ...lints];
125
- const format = (message) => `${message.file}\n${typescriptFormatter(message, true)}`;
126
- tsMessagesResolver({
127
- errors: allMsgs.filter((msg) => msg.severity === 'error').map(format),
128
- warnings: allMsgs
129
- .filter((msg) => msg.severity === 'warning')
130
- .map(format),
131
- });
132
- });
133
- }
134
- // "done" event fires when webpack has finished recompiling the bundle.
135
- // Whether or not you have warnings or errors, you will get this event.
136
- compiler.hooks.done.tap('done', async (stats) => {
137
- if (isInteractive) {
138
- clearConsole();
139
- }
140
- // We have switched off the default webpack output in WebpackDevServer
141
- // options so we are going to "massage" the warnings and errors and present
142
- // them in a readable focused way.
143
- // We only construct the warnings and errors for speed:
144
- // https://github.com/facebook/create-react-app/issues/4492#issuecomment-421959548
145
- const statsData = stats.toJson({
146
- all: false,
147
- warnings: true,
148
- errors: true,
149
- });
150
- if (useTypeScript && statsData.errors.length === 0) {
151
- const delayedMsg = setTimeout(() => {
152
- console.log(chalk.yellow('Files successfully emitted, waiting for typecheck results...'));
153
- }, 100);
154
- const messages = await tsMessagesPromise;
155
- clearTimeout(delayedMsg);
156
- if (tscCompileOnError) {
157
- statsData.warnings.push(...messages.errors);
158
- }
159
- else {
160
- statsData.errors.push(...messages.errors);
161
- }
162
- statsData.warnings.push(...messages.warnings);
163
- // Push errors and warnings into compilation result
164
- // to show them after page refresh triggered by user.
165
- if (tscCompileOnError) {
166
- stats.compilation.warnings.push(...messages.errors);
167
- }
168
- else {
169
- stats.compilation.errors.push(...messages.errors);
170
- }
171
- stats.compilation.warnings.push(...messages.warnings);
172
- if (messages.errors.length > 0) {
173
- if (tscCompileOnError) {
174
- devSocket.warnings(messages.errors);
175
- }
176
- else {
177
- devSocket.errors(messages.errors);
178
- }
179
- }
180
- else if (messages.warnings.length > 0) {
181
- devSocket.warnings(messages.warnings);
182
- }
183
- if (isInteractive) {
184
- clearConsole();
185
- }
186
- }
187
- const messages = formatWebpackMessages(statsData);
188
- const isSuccessful = !messages.errors.length && !messages.warnings.length;
189
- if (isSuccessful) {
190
- console.log(chalk.green('Compiled successfully!'));
191
- }
192
- if (isSuccessful && (isInteractive || isFirstCompile)) {
193
- printInstructions(appName, urls, useYarn);
194
- }
195
- isFirstCompile = false;
196
- // If errors exist, only show errors.
197
- if (messages.errors.length) {
198
- // Only keep the first error. Others are often indicative
199
- // of the same problem, but confuse the reader with noise.
200
- if (messages.errors.length > 1) {
201
- messages.errors.length = 1;
202
- }
203
- console.log(chalk.red('Failed to compile.\n'));
204
- console.log(messages.errors.join('\n\n'));
205
- return;
206
- }
207
- // Show warnings if no errors were found.
208
- if (messages.warnings.length) {
209
- console.log(chalk.yellow('Compiled with warnings.\n'));
210
- console.log(messages.warnings.join('\n\n'));
211
- // Teach some ESLint tricks.
212
- console.log('\nSearch for the ' +
213
- chalk.underline(chalk.yellow('keywords')) +
214
- ' to learn more about each warning.');
215
- console.log('To ignore, add ' +
216
- chalk.cyan('// eslint-disable-next-line') +
217
- ' to the line before.\n');
218
- }
219
- });
220
- // You can safely remove this after ejecting.
221
- // We only use this block for testing of Create React App itself:
222
- const isSmokeTest = process.argv.some((arg) => arg.indexOf('--smoke-test') > -1);
223
- if (isSmokeTest) {
224
- compiler.hooks.failed.tap('smokeTest', async () => {
225
- await tsMessagesPromise;
226
- process.exit(1);
227
- });
228
- compiler.hooks.done.tap('smokeTest', async (stats) => {
229
- await tsMessagesPromise;
230
- if (stats.hasErrors() || stats.hasWarnings()) {
231
- process.exit(1);
232
- }
233
- else {
234
- process.exit(0);
235
- }
236
- });
237
- }
238
- return compiler;
239
- }
240
- function resolveLoopback(proxy) {
241
- const o = url.parse(proxy);
242
- o.host = undefined;
243
- if (o.hostname !== 'localhost') {
244
- return proxy;
245
- }
246
- // Unfortunately, many languages (unlike node) do not yet support IPv6.
247
- // This means even though localhost resolves to ::1, the application
248
- // must fall back to IPv4 (on 127.0.0.1).
249
- // We can re-enable this in a few years.
250
- /*try {
251
- o.hostname = address.ipv6() ? '::1' : '127.0.0.1';
252
- } catch (_ignored) {
253
- o.hostname = '127.0.0.1';
254
- }*/
255
- try {
256
- // Check if we're on a network; if we are, chances are we can resolve
257
- // localhost. Otherwise, we can just be safe and assume localhost is
258
- // IPv4 for maximum compatibility.
259
- if (!address.ip()) {
260
- o.hostname = '127.0.0.1';
261
- }
262
- }
263
- catch (_ignored) {
264
- o.hostname = '127.0.0.1';
265
- }
266
- return url.format(o);
267
- }
268
- // We need to provide a custom onError function for httpProxyMiddleware.
269
- // It allows us to log custom error messages on the console.
270
- function onProxyError(proxy) {
271
- return (err, req, res) => {
272
- const host = req.headers && req.headers.host;
273
- console.log(chalk.red('Proxy error:') +
274
- ' Could not proxy request ' +
275
- chalk.cyan(req.url) +
276
- ' from ' +
277
- chalk.cyan(host) +
278
- ' to ' +
279
- chalk.cyan(proxy) +
280
- '.');
281
- console.log('See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (' +
282
- chalk.cyan(err.code) +
283
- ').');
284
- console.log();
285
- // And immediately send the proper error response to the client.
286
- // Otherwise, the request will eventually timeout with ERR_EMPTY_RESPONSE on the client side.
287
- if (res.writeHead && !res.headersSent) {
288
- res.writeHead(500);
289
- }
290
- res.end('Proxy error: Could not proxy request ' +
291
- req.url +
292
- ' from ' +
293
- host +
294
- ' to ' +
295
- proxy +
296
- ' (' +
297
- err.code +
298
- ').');
299
- };
300
- }
301
- function prepareProxy(proxy, appPublicFolder, servedPathname) {
302
- // `proxy` lets you specify alternate servers for specific requests.
303
- if (!proxy) {
304
- return undefined;
305
- }
306
- if (typeof proxy !== 'string') {
307
- console.log(chalk.red('When specified, "proxy" in package.json must be a string.'));
308
- console.log(chalk.red('Instead, the type of "proxy" was "' + typeof proxy + '".'));
309
- console.log(chalk.red('Either remove "proxy" from package.json, or make it a string.'));
310
- process.exit(1);
311
- }
312
- // If proxy is specified, let it handle any request except for
313
- // files in the public folder and requests to the WebpackDevServer socket endpoint.
314
- // https://github.com/facebook/create-react-app/issues/6720
315
- const sockPath = process.env.WDS_SOCKET_PATH || '/sockjs-node';
316
- const isDefaultSockHost = !process.env.WDS_SOCKET_HOST;
317
- function mayProxy(pathname) {
318
- const maybePublicPath = path.resolve(appPublicFolder, pathname.replace(new RegExp('^' + servedPathname), ''));
319
- const isPublicFileRequest = fs.existsSync(maybePublicPath);
320
- // used by webpackHotDevClient
321
- const isWdsEndpointRequest = isDefaultSockHost && pathname.startsWith(sockPath);
322
- return !(isPublicFileRequest || isWdsEndpointRequest);
323
- }
324
- if (!/^http(s)?:\/\//.test(proxy)) {
325
- console.log(chalk.red('When "proxy" is specified in package.json it must start with either http:// or https://'));
326
- process.exit(1);
327
- }
328
- let target;
329
- if (process.platform === 'win32') {
330
- target = resolveLoopback(proxy);
331
- }
332
- else {
333
- target = proxy;
334
- }
335
- return [
336
- {
337
- target,
338
- logLevel: 'silent',
339
- // For single page apps, we generally want to fallback to /index.html.
340
- // However we also want to respect `proxy` for API calls.
341
- // So if `proxy` is specified as a string, we need to decide which fallback to use.
342
- // We use a heuristic: We want to proxy all the requests that are not meant
343
- // for static assets and as all the requests for static assets will be using
344
- // `GET` method, we can proxy all non-`GET` requests.
345
- // For `GET` requests, if request `accept`s text/html, we pick /index.html.
346
- // Modern browsers include text/html into `accept` header when navigating.
347
- // However API calls like `fetch()` won’t generally accept text/html.
348
- // If this heuristic doesn’t work well for you, use `src/setupProxy.js`.
349
- context: function (pathname, req) {
350
- return (req.method !== 'GET' ||
351
- (mayProxy(pathname) &&
352
- req.headers.accept &&
353
- req.headers.accept.indexOf('text/html') === -1));
354
- },
355
- onProxyReq: (proxyReq) => {
356
- // Browsers may send Origin headers even with same-origin
357
- // requests. To prevent CORS issues, we have to change
358
- // the Origin to match the target URL.
359
- if (proxyReq.getHeader('origin')) {
360
- proxyReq.setHeader('origin', target);
361
- }
362
- },
363
- onError: onProxyError(target),
364
- secure: false,
365
- changeOrigin: true,
366
- ws: true,
367
- xfwd: true,
368
- },
369
- ];
370
- }
371
- function choosePort(host, defaultPort) {
372
- return detect(defaultPort, host).then((port) => new Promise((resolve) => {
373
- if (port === defaultPort) {
374
- return resolve(port);
375
- }
376
- const message = process.platform !== 'win32' && defaultPort < 1024 && !isRoot()
377
- ? `Admin permissions are required to run a server on a port below 1024.`
378
- : `Something is already running on port ${defaultPort}.`;
379
- if (isInteractive) {
380
- clearConsole();
381
- const existingProcess = getProcessForPort(defaultPort);
382
- const question = {
383
- type: 'confirm',
384
- name: 'shouldChangePort',
385
- message: chalk.yellow(message +
386
- `${existingProcess ? ` Probably:\n ${existingProcess}` : ''}`) + '\n\nWould you like to run the app on another port instead?',
387
- initial: true,
388
- };
389
- prompts(question).then((answer) => {
390
- if (answer.shouldChangePort) {
391
- resolve(port);
392
- }
393
- else {
394
- resolve(null);
395
- }
396
- });
397
- }
398
- else {
399
- console.log(chalk.red(message));
400
- resolve(null);
401
- }
402
- }), (err) => {
403
- throw new Error(chalk.red(`Could not find an open port at ${chalk.bold(host)}.`) +
404
- '\n' +
405
- ('Network error message: ' + err.message || err) +
406
- '\n');
407
- });
408
- }
409
- module.exports = {
410
- choosePort,
411
- createCompiler,
412
- prepareProxy,
413
- prepareUrls,
414
- };
415
- //# sourceMappingURL=WebpackDevServerUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebpackDevServerUtils.js","sourceRoot":"","sources":["../../src/procoreDevUtils/WebpackDevServerUtils.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAA;AAEZ,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,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,OAAO,CAAC,IAAI,CAAC,CAAA;SACd;IACH,CAAC,CAAC,EACJ,CAAC,GAAG,EAAE,EAAE;QACN,MAAM,IAAI,KAAK,CACb,KAAK,CAAC,GAAG,CAAC,kCAAkC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YAC9D,IAAI;YACJ,CAAC,yBAAyB,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC;YAChD,IAAI,CACP,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;IACV,cAAc;IACd,YAAY;IACZ,WAAW;CACZ,CAAA"}
@@ -1,96 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- 'use strict';
8
- // 1. postinstall monkeypatch
9
- // - requires copying the `formatWebpackMessages.js` file into our repo
10
- // 2. forking create-react-app and self-publishing `@procore/react-dev-utils` with the updates we need for webpack5
11
- // - kind of a DX pain
12
- // 3. copy over the scripts that are internally using `formatWebpackMessages.js` and point them to the local relative version
13
- // - there are two files inside of `react-dev-utils` which are internally using `formatWebpackMessages.js`
14
- // - we already have one of these files inside of our repository (`webpackHotDevClient.js`)
15
- // - we can copy the other file needed that we are using (WebpackDevServerUtils.js)
16
- const friendlySyntaxErrorLabel = 'Syntax error:';
17
- function isLikelyASyntaxError(message) {
18
- return message.indexOf(friendlySyntaxErrorLabel) !== -1;
19
- }
20
- // Cleans up webpack error messages.
21
- function formatMessage(message) {
22
- let lines = [];
23
- if (typeof message === 'string' || message instanceof String) {
24
- lines = message.split('\n');
25
- }
26
- else if ('message' in message) {
27
- lines = message['message'].split('\n');
28
- }
29
- // Strip webpack-added headers off errors/warnings
30
- // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
31
- lines = lines.filter((line) => !/Module [A-z ]+\(from/.test(line));
32
- // Transform parsing error into syntax error
33
- // TODO: move this to our ESLint formatter?
34
- lines = lines.map((line) => {
35
- const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(line);
36
- if (!parsingError) {
37
- return line;
38
- }
39
- const [, errorLine, errorColumn, errorMessage] = parsingError;
40
- return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
41
- });
42
- message = lines.join('\n');
43
- // Smoosh syntax errors (commonly found in CSS)
44
- message = message.replace(/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g, `${friendlySyntaxErrorLabel} $3 ($1:$2)\n`);
45
- // Clean up export errors
46
- message = message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm, `Attempted import error: '$1' is not exported from '$2'.`);
47
- message = message.replace(/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, `Attempted import error: '$2' does not contain a default export (imported as '$1').`);
48
- message = message.replace(/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, `Attempted import error: '$1' is not exported from '$3' (imported as '$2').`);
49
- lines = message.split('\n');
50
- // Remove leading newline
51
- if (lines.length > 2 && lines[1].trim() === '') {
52
- lines.splice(1, 1);
53
- }
54
- // Clean up file name
55
- lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1');
56
- // Cleans up verbose "module not found" messages for files and packages.
57
- if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {
58
- lines = [
59
- lines[0],
60
- lines[1]
61
- .replace('Error: ', '')
62
- .replace('Module not found: Cannot find file:', 'Cannot find file:'),
63
- ];
64
- }
65
- // Add helpful message for users trying to use Sass for the first time
66
- if (lines[1] && lines[1].match(/Cannot find module.+sass/)) {
67
- lines[1] = 'To import Sass files, you first need to install sass.\n';
68
- lines[1] +=
69
- 'Run `npm install sass` or `yarn add sass` inside your workspace.';
70
- }
71
- message = lines.join('\n');
72
- // Internal stacks are generally useless so we strip them... with the
73
- // exception of stacks containing `webpack:` because they're normally
74
- // from user code generated by webpack. For more information see
75
- // https://github.com/facebook/create-react-app/pull/1050
76
- message = message.replace(/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm, ''); // at ... ...:x:y
77
- message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, ''); // at <anonymous>
78
- lines = message.split('\n');
79
- // Remove duplicated newlines
80
- lines = lines.filter((line, index, arr) => index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim());
81
- // Reassemble the message
82
- message = lines.join('\n');
83
- return message.trim();
84
- }
85
- function formatWebpackMessages(json) {
86
- const formattedErrors = json.errors.map(formatMessage);
87
- const formattedWarnings = json.warnings.map(formatMessage);
88
- const result = { errors: formattedErrors, warnings: formattedWarnings };
89
- if (result.errors.some(isLikelyASyntaxError)) {
90
- // If there are any syntax errors, show just them.
91
- result.errors = result.errors.filter(isLikelyASyntaxError);
92
- }
93
- return result;
94
- }
95
- module.exports = formatWebpackMessages;
96
- //# sourceMappingURL=formatWebpackMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatWebpackMessages.js","sourceRoot":"","sources":["../../src/procoreDevUtils/formatWebpackMessages.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,CAAA;AAEZ,6BAA6B;AAC7B,wEAAwE;AACxE,mHAAmH;AACnH,uBAAuB;AACvB,6HAA6H;AAC7H,2GAA2G;AAC3G,4FAA4F;AAC5F,oFAAoF;AAEpF,MAAM,wBAAwB,GAAG,eAAe,CAAA;AAEhD,SAAS,oBAAoB,CAAC,OAAO;IACnC,OAAO,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;AACzD,CAAC;AAED,oCAAoC;AACpC,SAAS,aAAa,CAAC,OAAO;IAC5B,IAAI,KAAK,GAAG,EAAE,CAAA;IAEd,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,YAAY,MAAM,EAAE;QAC5D,KAAK,GAAG,OAAO,CAAC,KAAK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