@detergent-software/atk 9.6.1-dev.8 → 9.6.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/CHANGELOG.md +108 -0
- package/README.md +8 -8
- package/build/commands/_app.d.ts +29 -0
- package/build/commands/_app.d.ts.map +1 -1
- package/build/commands/_app.js +62 -21
- package/build/commands/_app.js.map +1 -1
- package/build/commands/browse.d.ts +5 -2
- package/build/commands/browse.d.ts.map +1 -1
- package/build/commands/browse.js +22 -22
- package/build/commands/browse.js.map +1 -1
- package/build/commands/list.d.ts +5 -2
- package/build/commands/list.d.ts.map +1 -1
- package/build/commands/list.js +18 -15
- package/build/commands/list.js.map +1 -1
- package/build/commands/upgrade.d.ts +5 -2
- package/build/commands/upgrade.d.ts.map +1 -1
- package/build/commands/upgrade.js +2 -4
- package/build/commands/upgrade.js.map +1 -1
- package/build/components/BrowseList.d.ts.map +1 -1
- package/build/components/BrowseList.js +25 -33
- package/build/components/BrowseList.js.map +1 -1
- package/build/components/CutDetail.d.ts +14 -0
- package/build/components/CutDetail.d.ts.map +1 -0
- package/build/components/CutDetail.js +14 -0
- package/build/components/CutDetail.js.map +1 -0
- package/build/components/FilterBar.d.ts +17 -0
- package/build/components/FilterBar.d.ts.map +1 -1
- package/build/components/FilterBar.js +54 -6
- package/build/components/FilterBar.js.map +1 -1
- package/build/components/Header.d.ts +3 -1
- package/build/components/Header.d.ts.map +1 -1
- package/build/components/Header.js +4 -1
- package/build/components/Header.js.map +1 -1
- package/build/components/HelpBar.d.ts +24 -2
- package/build/components/HelpBar.d.ts.map +1 -1
- package/build/components/HelpBar.js +54 -16
- package/build/components/HelpBar.js.map +1 -1
- package/build/components/ListBrowseList.d.ts.map +1 -1
- package/build/components/ListBrowseList.js +17 -25
- package/build/components/ListBrowseList.js.map +1 -1
- package/build/components/ListHelpBar.d.ts +5 -5
- package/build/components/ListHelpBar.d.ts.map +1 -1
- package/build/components/ListHelpBar.js +31 -8
- package/build/components/ListHelpBar.js.map +1 -1
- package/build/components/MeasuredBox.d.ts +20 -0
- package/build/components/MeasuredBox.d.ts.map +1 -0
- package/build/components/MeasuredBox.js +14 -0
- package/build/components/MeasuredBox.js.map +1 -0
- package/build/hooks/useListState.d.ts.map +1 -1
- package/build/hooks/useListState.js +17 -15
- package/build/hooks/useListState.js.map +1 -1
- package/build/hooks/useMeasuredRows.d.ts +10 -0
- package/build/hooks/useMeasuredRows.d.ts.map +1 -0
- package/build/hooks/useMeasuredRows.js +23 -0
- package/build/hooks/useMeasuredRows.js.map +1 -0
- package/build/hooks/useRenderOnResize.d.ts +11 -0
- package/build/hooks/useRenderOnResize.d.ts.map +1 -0
- package/build/hooks/useRenderOnResize.js +35 -0
- package/build/hooks/useRenderOnResize.js.map +1 -0
- package/build/hooks/useShell.d.ts +23 -0
- package/build/hooks/useShell.d.ts.map +1 -0
- package/build/hooks/useShell.js +28 -0
- package/build/hooks/useShell.js.map +1 -0
- package/build/lib/atk-api/index.d.ts +2 -2
- package/build/lib/atk-api/index.d.ts.map +1 -1
- package/build/lib/atk-api/index.js +1 -1
- package/build/lib/atk-api/index.js.map +1 -1
- package/build/lib/atk-api/web-routes.d.ts +36 -9
- package/build/lib/atk-api/web-routes.d.ts.map +1 -1
- package/build/lib/atk-api/web-routes.js +59 -10
- package/build/lib/atk-api/web-routes.js.map +1 -1
- package/build/lib/ink-stdout.d.ts +32 -0
- package/build/lib/ink-stdout.d.ts.map +1 -0
- package/build/lib/ink-stdout.js +79 -0
- package/build/lib/ink-stdout.js.map +1 -0
- package/build/lib/list-window.d.ts +43 -0
- package/build/lib/list-window.d.ts.map +1 -0
- package/build/lib/list-window.js +58 -0
- package/build/lib/list-window.js.map +1 -0
- package/build/lib/pastel/read-custom-app.d.ts +11 -1
- package/build/lib/pastel/read-custom-app.d.ts.map +1 -1
- package/build/lib/pastel/read-custom-app.js +2 -1
- package/build/lib/pastel/read-custom-app.js.map +1 -1
- package/build/lib/pastel/render-command.d.ts.map +1 -1
- package/build/lib/pastel/render-command.js +4 -3
- package/build/lib/pastel/render-command.js.map +1 -1
- package/build/lib/screen-rows.d.ts +15 -0
- package/build/lib/screen-rows.d.ts.map +1 -0
- package/build/lib/screen-rows.js +17 -0
- package/build/lib/screen-rows.js.map +1 -0
- package/build/lib/update-check.d.ts +25 -19
- package/build/lib/update-check.d.ts.map +1 -1
- package/build/lib/update-check.js +50 -61
- package/build/lib/update-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const NPM_DIST_TAGS_URL = "https://registry.npmjs.org/-/package/@detergent-software%2fatk/dist-tags";
|
|
3
3
|
/** How long the cached dist-tags stand before the check asks npm again; not the registry's `cacheTtlMinutes`. */
|
|
4
4
|
export declare const UPDATE_CHECK_INTERVAL_MS: number;
|
|
5
|
-
/** The
|
|
5
|
+
/** The background refresh of a missing or stale cache makes one attempt and gives up after this long, so it barely delays exit. */
|
|
6
6
|
export declare const BACKGROUND_REFRESH_TIMEOUT_MS = 1500;
|
|
7
7
|
/** `atk doctor`'s npm read, made on every run, is one attempt that gives up after this long, as its `/health` probe does. */
|
|
8
8
|
export declare const VERSION_STATUS_TIMEOUT_MS = 5000;
|
|
@@ -36,14 +36,18 @@ export interface VersionStatus {
|
|
|
36
36
|
}
|
|
37
37
|
type BannerListener = () => void;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
|
|
39
|
+
* The newer version of @detergent-software/atk the cached npm dist-tags name, or null. It reads the cache of any age
|
|
40
|
+
* and never asks npm before it answers, so a run decides its update banner or notice at once. A missing cache, or one
|
|
41
|
+
* older than {@link UPDATE_CHECK_INTERVAL_MS}, starts one background fetch (no retries,
|
|
42
|
+
* {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that only rewrites the cache, for the next run. Null, reading nothing, when
|
|
43
|
+
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
44
|
+
*/
|
|
45
|
+
export declare function cachedUpdateInfo(): Promise<null | UpdateInfo>;
|
|
46
|
+
/**
|
|
47
|
+
* The TTY update banner for this run: what {@link loadUpdateBanner} found, or null once {@link hideUpdateBanner} ran.
|
|
48
|
+
* A stable snapshot for `useSyncExternalStore`.
|
|
45
49
|
*/
|
|
46
|
-
export declare function
|
|
50
|
+
export declare function getUpdateBanner(): null | UpdateInfo;
|
|
47
51
|
/**
|
|
48
52
|
* This CLI's version and its channel's version on npm, whether or not that is newer. npm is asked
|
|
49
53
|
* every time, never the cache first, since a cache under a day old can miss a version tagged a moment
|
|
@@ -55,21 +59,23 @@ export declare function getUpdateInfo(): Promise<null | UpdateInfo>;
|
|
|
55
59
|
*/
|
|
56
60
|
export declare function getVersionStatus(): Promise<VersionStatus>;
|
|
57
61
|
/**
|
|
58
|
-
* Hide the TTY update banner for the rest of the run.
|
|
59
|
-
*
|
|
62
|
+
* Hide the TTY update banner for the rest of the run. The banner names a version newer than the one this process
|
|
63
|
+
* loaded, so `atk upgrade` (before its first frame) and `atk doctor --fix` (after its upgrade) hide it: it would
|
|
60
64
|
* tell the user to run the command that just ran (ATK-877).
|
|
61
65
|
*/
|
|
62
66
|
export declare function hideUpdateBanner(): void;
|
|
63
67
|
/** Whether {@link hideUpdateBanner} ran in this process (a stable snapshot for `useSyncExternalStore`). */
|
|
64
68
|
export declare function isUpdateBannerHidden(): boolean;
|
|
65
69
|
/**
|
|
66
|
-
* The update
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
70
|
+
* The TTY update banner for this run, from {@link cachedUpdateInfo}. The App shell awaits it before its first frame,
|
|
71
|
+
* so the banner is in that frame and never arrives later: a print-once output already taller than the terminal would
|
|
72
|
+
* be written again, its top a second time (ATK-966). Never throws.
|
|
73
|
+
*/
|
|
74
|
+
export declare function loadUpdateBanner(read?: () => Promise<null | UpdateInfo>): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* The update check for JSON mode, which shows no banner. `cli.tsx` runs it before the command so the payload can
|
|
77
|
+
* carry the result: when {@link cachedUpdateInfo} names a newer version it records an `update-available` notice.
|
|
78
|
+
* Never throws.
|
|
73
79
|
*/
|
|
74
80
|
export declare function noteCachedUpdate(): Promise<void>;
|
|
75
81
|
/**
|
|
@@ -79,9 +85,9 @@ export declare function noteCachedUpdate(): Promise<void>;
|
|
|
79
85
|
* npm couldn't be read, or offline. For `atk upgrade`; doesn't throw.
|
|
80
86
|
*/
|
|
81
87
|
export declare function readDistTagsFresh(): Promise<DistTags | null>;
|
|
82
|
-
/**
|
|
88
|
+
/** Forget the run's banner and show it again once loaded. Intended for tests. */
|
|
83
89
|
export declare function resetUpdateBanner(): void;
|
|
84
|
-
/** Subscribe to {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
90
|
+
/** Subscribe to {@link loadUpdateBanner} and {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
85
91
|
export declare function subscribeUpdateBanner(listener: BannerListener): () => void;
|
|
86
92
|
/**
|
|
87
93
|
* The switch that turns the update check off, or null when it runs. An
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAWA,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,6EAA6E,CAAC;AAG5G,iHAAiH;AACjH,eAAO,MAAM,wBAAwB,QAAsB,CAAC;AAE5D,
|
|
1
|
+
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAWA,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,6EAA6E,CAAC;AAG5G,iHAAiH;AACjH,eAAO,MAAM,wBAAwB,QAAsB,CAAC;AAE5D,mIAAmI;AACnI,eAAO,MAAM,6BAA6B,OAAQ,CAAC;AAEnD,6HAA6H;AAC7H,eAAO,MAAM,yBAAyB,OAAQ,CAAC;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;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAStD;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAWlE;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,IAAI,IAAI,CASxC;AAED,4GAA4G;AAC5G,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,IAAI,GAAG,iBAAiB,CAK1B"}
|
|
@@ -12,21 +12,21 @@ export const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/@detergen
|
|
|
12
12
|
const NPM_CACHE_FILE = 'npm-version.json';
|
|
13
13
|
/** How long the cached dist-tags stand before the check asks npm again; not the registry's `cacheTtlMinutes`. */
|
|
14
14
|
export const UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
15
|
-
/** The
|
|
15
|
+
/** The background refresh of a missing or stale cache makes one attempt and gives up after this long, so it barely delays exit. */
|
|
16
16
|
export const BACKGROUND_REFRESH_TIMEOUT_MS = 1_500;
|
|
17
17
|
/** `atk doctor`'s npm read, made on every run, is one attempt that gives up after this long, as its `/health` probe does. */
|
|
18
18
|
export const VERSION_STATUS_TIMEOUT_MS = 5_000;
|
|
19
|
+
let bannerInfo = null;
|
|
19
20
|
let bannerHidden = false;
|
|
20
21
|
const bannerListeners = new Set();
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* network call.
|
|
23
|
+
* The newer version of @detergent-software/atk the cached npm dist-tags name, or null. It reads the cache of any age
|
|
24
|
+
* and never asks npm before it answers, so a run decides its update banner or notice at once. A missing cache, or one
|
|
25
|
+
* older than {@link UPDATE_CHECK_INTERVAL_MS}, starts one background fetch (no retries,
|
|
26
|
+
* {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that only rewrites the cache, for the next run. Null, reading nothing, when
|
|
27
|
+
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
28
28
|
*/
|
|
29
|
-
export async function
|
|
29
|
+
export async function cachedUpdateInfo() {
|
|
30
30
|
try {
|
|
31
31
|
const config = await loadConfig();
|
|
32
32
|
if (updateCheckSwitch(config)) {
|
|
@@ -36,32 +36,33 @@ export async function getUpdateInfo() {
|
|
|
36
36
|
const cacheDir = getCacheDir(config);
|
|
37
37
|
const cachePath = join(cacheDir, NPM_CACHE_FILE);
|
|
38
38
|
const cached = await readNpmCache(cachePath);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
await writeNpmCache(cachePath, cacheDir, tags);
|
|
39
|
+
if (!cached || cached.ageMs > UPDATE_CHECK_INTERVAL_MS) {
|
|
40
|
+
void fetchDistTags(BACKGROUND_REFRESH_TIMEOUT_MS).then(async (tags) => {
|
|
41
|
+
if (tags) {
|
|
42
|
+
await writeNpmCache(cachePath, cacheDir, tags);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
46
45
|
}
|
|
47
|
-
const latestVersion = tags[channel];
|
|
46
|
+
const latestVersion = cached?.tags[channel];
|
|
48
47
|
if (!latestVersion || !semverValid(CLI_VERSION) || !semverValid(latestVersion)) {
|
|
49
48
|
return null;
|
|
50
49
|
}
|
|
51
50
|
if (!semverGt(latestVersion, CLI_VERSION)) {
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
54
|
-
return {
|
|
55
|
-
channel,
|
|
56
|
-
currentVersion: CLI_VERSION,
|
|
57
|
-
latestVersion,
|
|
58
|
-
upgradeCommand: UPGRADE_COMMAND,
|
|
59
|
-
};
|
|
53
|
+
return { channel, currentVersion: CLI_VERSION, latestVersion, upgradeCommand: UPGRADE_COMMAND };
|
|
60
54
|
}
|
|
61
55
|
catch {
|
|
62
56
|
return null;
|
|
63
57
|
}
|
|
64
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The TTY update banner for this run: what {@link loadUpdateBanner} found, or null once {@link hideUpdateBanner} ran.
|
|
61
|
+
* A stable snapshot for `useSyncExternalStore`.
|
|
62
|
+
*/
|
|
63
|
+
export function getUpdateBanner() {
|
|
64
|
+
return bannerHidden ? null : bannerInfo;
|
|
65
|
+
}
|
|
65
66
|
/**
|
|
66
67
|
* This CLI's version and its channel's version on npm, whether or not that is newer. npm is asked
|
|
67
68
|
* every time, never the cache first, since a cache under a day old can miss a version tagged a moment
|
|
@@ -100,8 +101,8 @@ export async function getVersionStatus() {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
|
-
* Hide the TTY update banner for the rest of the run.
|
|
104
|
-
*
|
|
104
|
+
* Hide the TTY update banner for the rest of the run. The banner names a version newer than the one this process
|
|
105
|
+
* loaded, so `atk upgrade` (before its first frame) and `atk doctor --fix` (after its upgrade) hide it: it would
|
|
105
106
|
* tell the user to run the command that just ran (ATK-877).
|
|
106
107
|
*/
|
|
107
108
|
export function hideUpdateBanner() {
|
|
@@ -118,42 +119,29 @@ export function isUpdateBannerHidden() {
|
|
|
118
119
|
return bannerHidden;
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
|
-
* The update
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* notice, with no network call on the way. A missing or stale cache starts one
|
|
125
|
-
* background fetch (no retries, {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that
|
|
126
|
-
* only rewrites the cache, for the next run. Does nothing when
|
|
127
|
-
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
122
|
+
* The TTY update banner for this run, from {@link cachedUpdateInfo}. The App shell awaits it before its first frame,
|
|
123
|
+
* so the banner is in that frame and never arrives later: a print-once output already taller than the terminal would
|
|
124
|
+
* be written again, its top a second time (ATK-966). Never throws.
|
|
128
125
|
*/
|
|
129
|
-
export async function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const channel = isPreRelease() ? 'dev' : 'latest';
|
|
136
|
-
const cacheDir = getCacheDir(config);
|
|
137
|
-
const cachePath = join(cacheDir, NPM_CACHE_FILE);
|
|
138
|
-
const cached = await readNpmCache(cachePath);
|
|
139
|
-
const version = cached?.tags[channel];
|
|
140
|
-
if (version && semverValid(CLI_VERSION) && semverValid(version) && semverGt(version, CLI_VERSION)) {
|
|
141
|
-
addNotice({
|
|
142
|
-
command: UPGRADE_COMMAND,
|
|
143
|
-
kind: 'update-available',
|
|
144
|
-
text: `ATK ${version} is available (this is ${CLI_VERSION}). Run \`${UPGRADE_COMMAND}\` to update.`,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (!cached || cached.ageMs > UPDATE_CHECK_INTERVAL_MS) {
|
|
148
|
-
void fetchDistTags(BACKGROUND_REFRESH_TIMEOUT_MS).then(async (tags) => {
|
|
149
|
-
if (tags) {
|
|
150
|
-
await writeNpmCache(cachePath, cacheDir, tags);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
126
|
+
export async function loadUpdateBanner(read = cachedUpdateInfo) {
|
|
127
|
+
bannerInfo = await read().catch(() => null);
|
|
128
|
+
for (const listener of bannerListeners) {
|
|
129
|
+
listener();
|
|
154
130
|
}
|
|
155
|
-
|
|
156
|
-
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The update check for JSON mode, which shows no banner. `cli.tsx` runs it before the command so the payload can
|
|
134
|
+
* carry the result: when {@link cachedUpdateInfo} names a newer version it records an `update-available` notice.
|
|
135
|
+
* Never throws.
|
|
136
|
+
*/
|
|
137
|
+
export async function noteCachedUpdate() {
|
|
138
|
+
const info = await cachedUpdateInfo();
|
|
139
|
+
if (info) {
|
|
140
|
+
addNotice({
|
|
141
|
+
command: info.upgradeCommand,
|
|
142
|
+
kind: 'update-available',
|
|
143
|
+
text: `ATK ${info.latestVersion} is available (this is ${info.currentVersion}). Run \`${info.upgradeCommand}\` to update.`,
|
|
144
|
+
});
|
|
157
145
|
}
|
|
158
146
|
}
|
|
159
147
|
/**
|
|
@@ -175,17 +163,18 @@ export async function readDistTagsFresh() {
|
|
|
175
163
|
}
|
|
176
164
|
return tags;
|
|
177
165
|
}
|
|
178
|
-
/**
|
|
166
|
+
/** Forget the run's banner and show it again once loaded. Intended for tests. */
|
|
179
167
|
export function resetUpdateBanner() {
|
|
180
|
-
if (!bannerHidden) {
|
|
168
|
+
if (!bannerHidden && !bannerInfo) {
|
|
181
169
|
return;
|
|
182
170
|
}
|
|
183
171
|
bannerHidden = false;
|
|
172
|
+
bannerInfo = null;
|
|
184
173
|
for (const listener of bannerListeners) {
|
|
185
174
|
listener();
|
|
186
175
|
}
|
|
187
176
|
}
|
|
188
|
-
/** Subscribe to {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
177
|
+
/** Subscribe to {@link loadUpdateBanner} and {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
189
178
|
export function subscribeUpdateBanner(listener) {
|
|
190
179
|
bannerListeners.add(listener);
|
|
191
180
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD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