@mailwoman/core 10.5.0 → 10.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.
Files changed (41) hide show
  1. package/lib/geocode/result.ts +46 -0
  2. package/lib/git.ts +357 -55
  3. package/lib/layers/manifest.ts +31 -0
  4. package/lib/layers/schema.ts +14 -0
  5. package/lib/process.ts +320 -0
  6. package/lib/resources/git.ts +9 -5
  7. package/lib/utils/events.ts +23 -0
  8. package/out/geocode/result.d.ts +25 -0
  9. package/out/geocode/result.d.ts.map +1 -1
  10. package/out/geocode/result.js +40 -0
  11. package/out/geocode/result.js.map +1 -1
  12. package/out/git.d.ts +180 -4
  13. package/out/git.d.ts.map +1 -1
  14. package/out/git.js +227 -37
  15. package/out/git.js.map +1 -1
  16. package/out/layers/manifest.d.ts +19 -0
  17. package/out/layers/manifest.d.ts.map +1 -1
  18. package/out/layers/manifest.js +12 -0
  19. package/out/layers/manifest.js.map +1 -1
  20. package/out/layers/schema.d.ts +10 -0
  21. package/out/layers/schema.d.ts.map +1 -1
  22. package/out/layers/schema.js +4 -0
  23. package/out/layers/schema.js.map +1 -1
  24. package/out/process.d.ts +146 -0
  25. package/out/process.d.ts.map +1 -1
  26. package/out/process.js +158 -0
  27. package/out/process.js.map +1 -1
  28. package/out/resources/git.d.ts +5 -1
  29. package/out/resources/git.d.ts.map +1 -1
  30. package/out/resources/git.js +8 -5
  31. package/out/resources/git.js.map +1 -1
  32. package/out/tools/download/libpostal-resources.d.ts +2 -2
  33. package/out/tools/download/libpostal-resources.d.ts.map +1 -1
  34. package/out/tools/download/libpostal-resources.js +4 -4
  35. package/out/tools/download/libpostal-resources.js.map +1 -1
  36. package/out/utils/events.d.ts +13 -0
  37. package/out/utils/events.d.ts.map +1 -1
  38. package/out/utils/events.js +19 -0
  39. package/out/utils/events.js.map +1 -1
  40. package/package.json +7 -7
  41. package/tools/download/libpostal-resources.ts +4 -4
package/lib/process.ts CHANGED
@@ -34,6 +34,9 @@ import { promisify } from "node:util"
34
34
 
35
35
  import type { PathBuilderLike } from "path-ts"
36
36
 
37
+ import type { IRuntimeLogger } from "#logging"
38
+ import { TypedEventTarget } from "#utils/events"
39
+
37
40
  export type {
38
41
  ChildProcess,
39
42
  ChildProcessByStdio,
@@ -219,6 +222,323 @@ export function spawnProcessSync(
219
222
  )
220
223
  }
221
224
 
225
+ /**
226
+ * One step of a long-running command's progress, as a {@linkcode ProgressParser}
227
+ * reads it from a line of output.
228
+ */
229
+ export interface ProcessProgress {
230
+ /**
231
+ * The phase the command reports, such as git's `Receiving objects`.
232
+ */
233
+ stage: string
234
+ /**
235
+ * Completion of the stage, from 0 to 100, when the command states it.
236
+ */
237
+ percent?: number
238
+ processed?: number
239
+ total?: number
240
+ }
241
+
242
+ /**
243
+ * Reads one line of a command's stderr and answers the progress it reports, or `null` for any other line.
244
+ */
245
+ export type ProgressParser = (line: string) => ProcessProgress | null
246
+
247
+ /**
248
+ * How a {@linkcode ProcessTask} ended.
249
+ *
250
+ * `exitCode` is `null` when a signal ended the process, and `signal` is `null` when it exited on its own.
251
+ */
252
+ export interface ProcessResult extends ProcessOutput {
253
+ command: string
254
+ exitCode: number | null
255
+ signal: NodeJS.Signals | null
256
+ }
257
+
258
+ /**
259
+ * The stream a line of output arrived on.
260
+ */
261
+ export const OutputStream = {
262
+ Stdout: "stdout",
263
+ Stderr: "stderr",
264
+ } as const
265
+
266
+ export type OutputStream = (typeof OutputStream)[keyof typeof OutputStream]
267
+
268
+ /**
269
+ * The events a {@linkcode ProcessTask} dispatches, keyed by type, with each event's `detail`.
270
+ */
271
+ export interface ProcessTaskEventMap {
272
+ /**
273
+ * One line of piped output.
274
+ *
275
+ * A carriage return ends a line as a newline does, so each redraw of a progress meter arrives separately.
276
+ */
277
+ line: { stream: OutputStream; text: string }
278
+ progress: ProcessProgress
279
+ exit: ProcessResult
280
+ }
281
+
282
+ /**
283
+ * Options for {@linkcode ProcessTask}.
284
+ */
285
+ export interface ProcessTaskOptions extends Omit<SpawnOptions, "cwd" | "stdio" | "signal"> {
286
+ cwd?: PathBuilderLike
287
+ /**
288
+ * Aborting the signal stops the process as disposal does.
289
+ */
290
+ signal?: AbortSignal
291
+ /**
292
+ * Receives the command line at debug level when the process starts and the result when it ends.
293
+ */
294
+ logger?: IRuntimeLogger
295
+ /**
296
+ * Whether a non-zero exit or a terminating signal rejects `result` with a {@linkcode ProcessError}.
297
+ *
298
+ * With `false`, `result` resolves with the {@linkcode ProcessResult}, and the caller reads `exitCode`.
299
+ *
300
+ * A command that could not start always rejects with the spawn error.
301
+ *
302
+ * @defaultValue `true`
303
+ */
304
+ reject?: boolean
305
+ /**
306
+ * `"pipe"` captures a stream and dispatches its lines.
307
+ * `"inherit"` writes it to this process's terminal.
308
+ *
309
+ * @defaultValue `"ignore"` for stdin, `"pipe"` for stdout and stderr
310
+ */
311
+ stdin?: "ignore" | "inherit" | "pipe"
312
+ stdout?: "ignore" | "inherit" | "pipe"
313
+ stderr?: "ignore" | "inherit" | "pipe"
314
+ /**
315
+ * Leave a piped stdout unread, so the caller consumes `child.stdout` as bytes,
316
+ * such as an archive piped into another process.
317
+ *
318
+ * The task then dispatches no stdout lines, and `result.stdout` is empty.
319
+ */
320
+ rawStdout?: boolean
321
+ /**
322
+ * Reads each stderr line for progress and dispatches a `progress` event for each match.
323
+ */
324
+ progress?: ProgressParser
325
+ /**
326
+ * How long disposal waits after SIGTERM before it sends SIGKILL.
327
+ *
328
+ * @defaultValue 5000
329
+ */
330
+ killGraceMs?: number
331
+ }
332
+
333
+ const DEFAULT_KILL_GRACE_MS = 5000
334
+
335
+ /**
336
+ * A running command that reports its output as events, settles `result` with its
337
+ * {@linkcode ProcessResult}, and is stopped by disposal.
338
+ *
339
+ * It follows the shape of `APIClient`: an `EventTarget` that owns its work
340
+ * and implements `AsyncDisposable`.
341
+ * A caller renders the `line` and `progress` events while the command runs.
342
+ *
343
+ * `await using` stops the command when the caller's scope ends early.
344
+ *
345
+ * Reach for {@linkcode runFile} when the caller needs only the finished output.
346
+ */
347
+ export class ProcessTask extends TypedEventTarget<ProcessTaskEventMap> implements AsyncDisposable {
348
+ public readonly command: string
349
+ public readonly child: ChildProcess
350
+ /**
351
+ * Settles once the process has exited and both streams have closed.
352
+ */
353
+ public readonly result: Promise<ProcessResult>
354
+
355
+ readonly #exited: Promise<void>
356
+ readonly #killGraceMs: number
357
+ readonly #signal: AbortSignal | undefined
358
+ readonly #onAbort = (): void => {
359
+ void this[Symbol.asyncDispose]()
360
+ }
361
+
362
+ #disposePromise: Promise<void> | null = null
363
+
364
+ constructor(file: PathBuilderLike, args: readonly PathBuilderLike[] = [], options: ProcessTaskOptions = {}) {
365
+ super()
366
+
367
+ const {
368
+ cwd,
369
+ signal,
370
+ logger,
371
+ reject = true,
372
+ stdin = "ignore",
373
+ stdout = "pipe",
374
+ stderr = "pipe",
375
+ progress,
376
+ rawStdout = false,
377
+ killGraceMs = DEFAULT_KILL_GRACE_MS,
378
+ ...spawnOptions
379
+ } = options
380
+
381
+ const argStrings = args.map((arg) => arg.toString())
382
+
383
+ this.command = [file.toString(), ...argStrings].join(" ")
384
+ this.#killGraceMs = killGraceMs
385
+ this.#signal = signal
386
+
387
+ signal?.throwIfAborted()
388
+
389
+ logger?.debug(`$ ${this.command}`)
390
+
391
+ this.child = spawn(file.toString(), argStrings, {
392
+ ...spawnOptions,
393
+ cwd: cwd?.toString(),
394
+ stdio: [stdin, stdout, stderr],
395
+ })
396
+
397
+ const captured: Record<OutputStream, string[]> = { stdout: [], stderr: [] }
398
+
399
+ const readLines = (stream: OutputStream, readable: Readable | null): void => {
400
+ if (!readable) return
401
+
402
+ let pending = ""
403
+
404
+ const emit = (text: string): void => {
405
+ captured[stream].push(text)
406
+ this.emit("line", { stream, text })
407
+
408
+ if (stream === OutputStream.Stderr && progress) {
409
+ const step = progress(text)
410
+
411
+ if (step) {
412
+ this.emit("progress", step)
413
+ }
414
+ }
415
+ }
416
+
417
+ readable.setEncoding("utf8")
418
+
419
+ readable.on("data", (chunk: string) => {
420
+ const pieces = (pending + chunk).split(/\r\n|\r|\n/u)
421
+
422
+ pending = pieces.pop() ?? ""
423
+
424
+ for (const piece of pieces) {
425
+ emit(piece)
426
+ }
427
+ })
428
+
429
+ readable.on("end", () => {
430
+ if (pending) {
431
+ emit(pending)
432
+ }
433
+
434
+ pending = ""
435
+ })
436
+ }
437
+
438
+ readLines(OutputStream.Stdout, rawStdout ? null : this.child.stdout)
439
+ readLines(OutputStream.Stderr, this.child.stderr)
440
+
441
+ this.#exited = new Promise<void>((resolve) => {
442
+ this.child.once("close", () => resolve())
443
+ // A process that never started emits `error` and no `close`.
444
+ this.child.once("error", () => resolve())
445
+ })
446
+
447
+ this.result = new Promise<ProcessResult>((resolve, rejectCompletion) => {
448
+ this.child.once("error", rejectCompletion)
449
+
450
+ this.child.once("close", (exitCode: number | null, exitSignal: NodeJS.Signals | null) => {
451
+ const result: ProcessResult = {
452
+ command: this.command,
453
+ exitCode,
454
+ signal: exitSignal,
455
+ stdout: captured.stdout.join("\n"),
456
+ stderr: captured.stderr.join("\n"),
457
+ }
458
+
459
+ logger?.debug(`${this.command} exited with ${exitSignal ?? exitCode}`)
460
+ this.emit("exit", result)
461
+
462
+ if (reject && exitCode !== 0) {
463
+ const error = new Error(
464
+ `Command failed with ${exitSignal ? `signal ${exitSignal}` : `exit code ${exitCode}`}: ${this.command}`
465
+ ) as ProcessError
466
+
467
+ error.stdout = result.stdout
468
+ error.stderr = result.stderr
469
+ error.code = exitCode ?? undefined
470
+ error.signal = exitSignal ?? undefined
471
+
472
+ rejectCompletion(error)
473
+
474
+ return
475
+ }
476
+
477
+ resolve(result)
478
+ })
479
+ }).finally(() => {
480
+ this.#signal?.removeEventListener("abort", this.#onAbort)
481
+ })
482
+
483
+ // A task that is only disposed, never awaited, must not raise an unhandled rejection.
484
+ // Awaiting callers still receive the rejection through `result`.
485
+ this.result.catch(() => undefined)
486
+
487
+ signal?.addEventListener("abort", this.#onAbort, { once: true })
488
+ }
489
+
490
+ /**
491
+ * Disposal sends SIGTERM to a running process, sends SIGKILL if it has not exited
492
+ * after `killGraceMs`, and resolves once it has exited.
493
+ * A process that already exited is left alone.
494
+ *
495
+ * Disposal never rejects.
496
+ * The `result` promise still reports how the process ended.
497
+ * Repeated calls return the same promise.
498
+ */
499
+ public [Symbol.asyncDispose](): Promise<void> {
500
+ if (this.#disposePromise) return this.#disposePromise
501
+
502
+ this.#disposePromise = this.#stop()
503
+
504
+ return this.#disposePromise
505
+ }
506
+
507
+ async #stop(): Promise<void> {
508
+ const { child } = this
509
+
510
+ if (child.exitCode === null && child.signalCode === null && child.pid !== undefined) {
511
+ child.kill("SIGTERM")
512
+
513
+ const escalation = setTimeout(() => child.kill("SIGKILL"), this.#killGraceMs)
514
+
515
+ escalation.unref()
516
+ await this.#exited
517
+ clearTimeout(escalation)
518
+ } else {
519
+ await this.#exited
520
+ }
521
+ }
522
+
523
+ public override toString(): string {
524
+ return this.command
525
+ }
526
+ }
527
+
528
+ /**
529
+ * Run a command to completion as a {@linkcode ProcessTask} and answer its {@linkcode ProcessResult}.
530
+ *
531
+ * With `reject: false` a non-zero exit resolves, and the caller reads `exitCode`.
532
+ * Reach for the task itself when the caller renders its lines or progress while it runs.
533
+ */
534
+ export function runProcess(
535
+ file: PathBuilderLike,
536
+ args: readonly PathBuilderLike[] = [],
537
+ options: ProcessTaskOptions = {}
538
+ ): Promise<ProcessResult> {
539
+ return new ProcessTask(file, args, options).result
540
+ }
541
+
222
542
  /**
223
543
  * Options for {@linkcode forkProcess}.
224
544
  */
@@ -8,7 +8,7 @@ import { PathBuilder, type PathBuilderLike } from "path-ts"
8
8
 
9
9
  import { tryStat } from "#fs/readers/stat"
10
10
  import { makeDirectories } from "#fs/writers"
11
- import { git } from "#git"
11
+ import { GitClient } from "#git"
12
12
 
13
13
  /**
14
14
  * Metadata for a repository source.
@@ -44,22 +44,26 @@ export type SynchronizeAction = "cloned" | "pulled" | "skipped"
44
44
 
45
45
  /**
46
46
  * Synchronize a repository source, i.e. clone or pull the repository.
47
+ *
48
+ * The transfer runs through `client`, so a caller that watches the client's `progress`
49
+ * events sees the clone or pull advance, and disposing the client stops it.
47
50
  */
48
51
  export async function synchronizeRepo(
49
52
  source: RepositorySource,
50
- localRepoDirectory: PathBuilderLike
53
+ localRepoDirectory: PathBuilderLike,
54
+ client: GitClient = new GitClient({ cwd: localRepoDirectory })
51
55
  ): Promise<SynchronizeAction> {
52
56
  if (source.name.includes("deprecated")) return "skipped"
53
57
 
54
- const { ownerDirectory, repoDirectory, exists } = await prepareRepositoryDirectories(source, localRepoDirectory)
58
+ const { repoDirectory, exists } = await prepareRepositoryDirectories(source, localRepoDirectory)
55
59
 
56
60
  if (exists) {
57
- await git("pull", repoDirectory)
61
+ await client.start(["-C", repoDirectory.toString(), "pull", "--progress"]).result
58
62
 
59
63
  return "pulled"
60
64
  }
61
65
 
62
- await git(["clone", "--depth=1", source.url], ownerDirectory)
66
+ await client.clone(source.url, repoDirectory, { depth: 1 })
63
67
 
64
68
  return "cloned"
65
69
  }
@@ -9,3 +9,26 @@
9
9
  * `await once(child, "exit")` — rejecting on its `error`.
10
10
  */
11
11
  export { once } from "node:events"
12
+
13
+ /**
14
+ * An `EventTarget` whose events hold a typed `detail`, keyed by type in `EventMap`.
15
+ *
16
+ * Subclasses dispatch with `emit`, and listeners subscribe with `on`.
17
+ * The base `addEventListener` still works for a caller that wants the `CustomEvent` itself.
18
+ */
19
+ export class TypedEventTarget<EventMap extends object> extends EventTarget {
20
+ /**
21
+ * Listen for one event type with its typed `detail`, answering a function that removes the listener.
22
+ */
23
+ public on<K extends keyof EventMap & string>(type: K, listener: (detail: EventMap[K]) => void): () => void {
24
+ const handler = (event: Event): void => listener((event as CustomEvent<EventMap[K]>).detail)
25
+
26
+ this.addEventListener(type, handler)
27
+
28
+ return () => this.removeEventListener(type, handler)
29
+ }
30
+
31
+ protected emit<K extends keyof EventMap & string>(type: K, detail: EventMap[K]): void {
32
+ this.dispatchEvent(new CustomEvent(type, { detail }))
33
+ }
34
+ }
@@ -192,6 +192,27 @@ export declare const RooftopSchema: z.ZodObject<{
192
192
  postcode: z.ZodNullable<z.ZodString>;
193
193
  }, z.core.$strip>;
194
194
  export type Rooftop = z.infer<typeof RooftopSchema>;
195
+ /**
196
+ * The register row that supplied an `address_point` or `interpolated` coordinate,
197
+ * as the row itself records it.
198
+ */
199
+ export declare const CoordinateSourceSchema: z.ZodObject<{
200
+ source: z.ZodString;
201
+ release: z.ZodNullable<z.ZodString>;
202
+ }, z.core.$strip>;
203
+ export type CoordinateSource = z.infer<typeof CoordinateSourceSchema>;
204
+ /**
205
+ * The service-level credit the OpenStreetMap Foundation's Geocoding Guideline asks
206
+ * of a public geocoder that serves OpenStreetMap data.
207
+ */
208
+ export declare const OPENSTREETMAP_CREDIT = "\u00A9 OpenStreetMap contributors, ODbL 1.0, https://www.openstreetmap.org/copyright";
209
+ /**
210
+ * Whether a row's provenance stamp names an OpenStreetMap-derived row.
211
+ *
212
+ * `@mailwoman/osm` stamps every row it builds `openstreetmap:<cc>`, and a row the
213
+ * street-recovery pass placed `openstreetmap:<cc>#recovered`, so the prefix decides.
214
+ */
215
+ export declare function isOpenStreetMapSource(source: string | null | undefined): boolean;
195
216
  /**
196
217
  * The poi.db entity that supplied a `venue`-tier coordinate.
197
218
  */
@@ -380,6 +401,10 @@ export declare const GeocodeResultSchema: z.ZodObject<{
380
401
  localityNorm: z.ZodNullable<z.ZodString>;
381
402
  postcode: z.ZodNullable<z.ZodString>;
382
403
  }, z.core.$strip>>;
404
+ coordinate_source: z.ZodNullable<z.ZodObject<{
405
+ source: z.ZodString;
406
+ release: z.ZodNullable<z.ZodString>;
407
+ }, z.core.$strip>>;
383
408
  uncertainty_m: z.ZodNullable<z.ZodNumber>;
384
409
  locality: z.ZodNullable<z.ZodString>;
385
410
  region: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../lib/ge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CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;iBAa8D,CAAA;AAEjG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yFAAoF,CAAA;AAErH;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEhF;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqKkF,CAAA;AAElH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -134,6 +134,38 @@ export const UnfollowedComponentSchema = z.object({
134
134
  * The locality key and postcode stored on the matched address-point row.
135
135
  */
136
136
  export const RooftopSchema = z.object({ localityNorm: z.string().nullable(), postcode: z.string().nullable() });
137
+ /**
138
+ * The register row that supplied an `address_point` or `interpolated` coordinate,
139
+ * as the row itself records it.
140
+ */
141
+ export const CoordinateSourceSchema = z
142
+ .object({
143
+ /**
144
+ * The row's provenance stamp, verbatim: `openstreetmap:nz` for a row an operator built
145
+ * from an OpenStreetMap extract, `overture:NAD` for an Overture row, and so on.
146
+ */
147
+ source: z.string(),
148
+ /**
149
+ * The data release the row came from, as the row records it, or null when the resolved
150
+ * tree carries none, as a tree a client sent to `/v1/resolve` may not.
151
+ */
152
+ release: z.string().nullable(),
153
+ })
154
+ .meta({ id: "CoordinateSource", description: "The register row that supplied the coordinate." });
155
+ /**
156
+ * The service-level credit the OpenStreetMap Foundation's Geocoding Guideline asks
157
+ * of a public geocoder that serves OpenStreetMap data.
158
+ */
159
+ export const OPENSTREETMAP_CREDIT = "© OpenStreetMap contributors, ODbL 1.0, https://www.openstreetmap.org/copyright";
160
+ /**
161
+ * Whether a row's provenance stamp names an OpenStreetMap-derived row.
162
+ *
163
+ * `@mailwoman/osm` stamps every row it builds `openstreetmap:<cc>`, and a row the
164
+ * street-recovery pass placed `openstreetmap:<cc>#recovered`, so the prefix decides.
165
+ */
166
+ export function isOpenStreetMapSource(source) {
167
+ return typeof source === "string" && source.startsWith("openstreetmap:");
168
+ }
137
169
  /**
138
170
  * The poi.db entity that supplied a `venue`-tier coordinate.
139
171
  */
@@ -194,6 +226,14 @@ export const GeocodeResultSchema = z
194
226
  * Consumers may display them but must not filter on them.
195
227
  */
196
228
  rooftop: RooftopSchema.nullable(),
229
+ /**
230
+ * The register row that supplied the coordinate, with its provenance stamp and release.
231
+ *
232
+ * Set on the `address_point` and `interpolated` tiers, whose coordinate comes from one register row.
233
+ * It is null on every other tier, including a coordinate a later pass moved to a venue
234
+ * or a plus code, because that coordinate no longer comes from the row.
235
+ */
236
+ coordinate_source: CoordinateSourceSchema.nullable(),
197
237
  /**
198
238
  * The uncertainty radius in meters, or null when the tier reports none.
199
239
  */
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../lib/geocode/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,qBAA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