@thi.ng/dsp-io-wav 1.0.7 → 2.0.4
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 +61 -5
- package/README.md +15 -5
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +37 -25
- package/write.d.ts +3 -3
- package/write.js +9 -4
- package/lib/index.js +0 -50
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [
|
|
6
|
+
## [2.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@2.0.3...@thi.ng/dsp-io-wav@2.0.4) (2021-10-25)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @thi.ng/dsp-io-wav
|
|
9
9
|
|
|
@@ -11,10 +11,66 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## [2.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@2.0.2...@thi.ng/dsp-io-wav@2.0.3) (2021-10-15)
|
|
15
15
|
|
|
16
|
+
**Note:** Version bump only for package @thi.ng/dsp-io-wav
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@2.0.1...@thi.ng/dsp-io-wav@2.0.2) (2021-10-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @thi.ng/dsp-io-wav
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@2.0.0...@thi.ng/dsp-io-wav@2.0.1) (2021-10-13)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @thi.ng/dsp-io-wav
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@1.0.7...@thi.ng/dsp-io-wav@2.0.0) (2021-10-12)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Build System
|
|
42
|
+
|
|
43
|
+
* major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### BREAKING CHANGES
|
|
47
|
+
|
|
48
|
+
* discontinue CommonJS & UMD versions
|
|
49
|
+
|
|
50
|
+
- only ESM modules will be published from now on
|
|
51
|
+
- CJS obsolete due to ESM support in recent versions of node:
|
|
52
|
+
- i.e. launch NodeJS via:
|
|
53
|
+
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
54
|
+
- in the node REPL use `await import(...)` instead of `require()`
|
|
55
|
+
- UMD obsolete due to widespread browser support for ESM
|
|
56
|
+
|
|
57
|
+
Also:
|
|
58
|
+
- normalize/restructure/reorg all package.json files
|
|
59
|
+
- cleanup all build scripts, remove obsolete
|
|
60
|
+
- switch from mocha to @thi.ng/testament for all tests
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## [1.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@1.0.6...@thi.ng/dsp-io-wav@1.0.7) (2021-09-03)
|
|
68
|
+
|
|
69
|
+
**Note:** Version bump only for package @thi.ng/dsp-io-wav
|
|
70
|
+
|
|
71
|
+
# 0.1.0 (2020-02-25)
|
|
16
72
|
|
|
17
|
-
###
|
|
73
|
+
### Features
|
|
18
74
|
|
|
19
|
-
|
|
20
|
-
|
|
75
|
+
- **dsp-io-wav:** add waveBytes() iterator ([bde667f](https://github.com/thi-ng/umbrella/commit/bde667fe4b08f03a7bbf4fa95d8e71c296d5bfb7))
|
|
76
|
+
- **dsp-io-wav:** initial import ([e9fb42e](https://github.com/thi-ng/umbrella/commit/e9fb42e5cb260997ff38055e713aebd82aaf3843))
|
package/README.md
CHANGED
|
@@ -33,20 +33,30 @@ WAV file format generation. This is a support package for [@thi.ng/dsp](https://
|
|
|
33
33
|
yarn add @thi.ng/dsp-io-wav
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
ES module import:
|
|
37
|
+
|
|
36
38
|
```html
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
<script type="module" src="https://cdn.skypack.dev/@thi.ng/dsp-io-wav"></script>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[Skypack documentation](https://docs.skypack.dev/)
|
|
43
|
+
|
|
44
|
+
For Node.js REPL:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
# with flag only for < v16
|
|
48
|
+
node --experimental-repl-await
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
<script src="https://unpkg.com/@thi.ng/dsp-io-wav/lib/index.umd.js" crossorigin></script>
|
|
50
|
+
> const dspIoWav = await import("@thi.ng/dsp-io-wav");
|
|
42
51
|
```
|
|
43
52
|
|
|
44
|
-
Package sizes (gzipped, pre-treeshake): ESM:
|
|
53
|
+
Package sizes (gzipped, pre-treeshake): ESM: 539 bytes
|
|
45
54
|
|
|
46
55
|
## Dependencies
|
|
47
56
|
|
|
48
57
|
- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
|
|
49
58
|
- [@thi.ng/binary](https://github.com/thi-ng/umbrella/tree/develop/packages/binary)
|
|
59
|
+
- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
|
|
50
60
|
- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
|
|
51
61
|
- [@thi.ng/transducers-binary](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers-binary)
|
|
52
62
|
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./api";
|
|
2
|
-
export * from "./write";
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./write.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./api";
|
|
2
|
-
export * from "./write";
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./write.js";
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dsp-io-wav",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "WAV file format generation",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"module": "./index.js",
|
|
6
|
-
"main": "./lib/index.js",
|
|
7
|
-
"umd:main": "./lib/index.umd.js",
|
|
8
7
|
"typings": "./index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
@@ -24,30 +24,25 @@
|
|
|
24
24
|
"author": "Karsten Schmidt <k+npm@thi.ng>",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "yarn clean &&
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"build:test": "rimraf build && tsc -p test/tsconfig.json",
|
|
31
|
-
"build:check": "tsc --isolatedModules --noEmit",
|
|
32
|
-
"test": "mocha test",
|
|
33
|
-
"cover": "nyc mocha test && nyc report --reporter=lcov",
|
|
34
|
-
"clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
|
|
35
|
-
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
|
|
27
|
+
"build": "yarn clean && tsc --declaration",
|
|
28
|
+
"clean": "rimraf *.js *.d.ts *.map doc",
|
|
29
|
+
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
36
30
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
|
|
37
|
-
"doc": "
|
|
38
|
-
"
|
|
31
|
+
"doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
|
|
32
|
+
"doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
|
|
33
|
+
"pub": "yarn build && yarn publish --access public",
|
|
34
|
+
"test": "testament test"
|
|
39
35
|
},
|
|
40
36
|
"dependencies": {
|
|
41
|
-
"@thi.ng/api": "^
|
|
42
|
-
"@thi.ng/binary": "^
|
|
43
|
-
"@thi.ng/
|
|
44
|
-
"@thi.ng/transducers
|
|
37
|
+
"@thi.ng/api": "^8.0.4",
|
|
38
|
+
"@thi.ng/binary": "^3.0.4",
|
|
39
|
+
"@thi.ng/errors": "^2.0.4",
|
|
40
|
+
"@thi.ng/transducers": "^8.0.4",
|
|
41
|
+
"@thi.ng/transducers-binary": "^2.0.4"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@thi.ng/testament": "^0.1.4"
|
|
45
45
|
},
|
|
46
|
-
"files": [
|
|
47
|
-
"*.js",
|
|
48
|
-
"*.d.ts",
|
|
49
|
-
"lib"
|
|
50
|
-
],
|
|
51
46
|
"keywords": [
|
|
52
47
|
"8bit",
|
|
53
48
|
"16bit",
|
|
@@ -67,10 +62,27 @@
|
|
|
67
62
|
"publishConfig": {
|
|
68
63
|
"access": "public"
|
|
69
64
|
},
|
|
70
|
-
"
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=12.7"
|
|
67
|
+
},
|
|
68
|
+
"files": [
|
|
69
|
+
"*.js",
|
|
70
|
+
"*.d.ts"
|
|
71
|
+
],
|
|
72
|
+
"exports": {
|
|
73
|
+
".": {
|
|
74
|
+
"import": "./index.js"
|
|
75
|
+
},
|
|
76
|
+
"./api": {
|
|
77
|
+
"import": "./api.js"
|
|
78
|
+
},
|
|
79
|
+
"./write": {
|
|
80
|
+
"import": "./write.js"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
71
83
|
"thi.ng": {
|
|
72
84
|
"parent": "@thi.ng/dsp",
|
|
73
85
|
"year": 2020
|
|
74
86
|
},
|
|
75
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "9ff00a103f76cc4917ef3f244132e218f2300a05"
|
|
76
88
|
}
|
package/write.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BinStructItem } from "@thi.ng/transducers-binary";
|
|
2
|
-
import type { WavSpec } from "./api";
|
|
1
|
+
import type { BinStructItem } from "@thi.ng/transducers-binary";
|
|
2
|
+
import type { WavSpec } from "./api.js";
|
|
3
3
|
export declare const wavHeader: (spec: WavSpec) => BinStructItem[];
|
|
4
4
|
/**
|
|
5
5
|
* Takes a {@link WavSpec} and iterable of normalized float samples,
|
|
@@ -41,5 +41,5 @@ export declare const wavByteArray: (spec: WavSpec, src: Iterable<number>) => Uin
|
|
|
41
41
|
* @param spec
|
|
42
42
|
* @param src
|
|
43
43
|
*/
|
|
44
|
-
export declare const wavBytes: (spec: WavSpec, src: Iterable<number>) =>
|
|
44
|
+
export declare const wavBytes: (spec: WavSpec, src: Iterable<number>) => Iterable<number>;
|
|
45
45
|
//# sourceMappingURL=write.d.ts.map
|
package/write.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { f32u16, f32u24, f32u32, f32u8 } from "@thi.ng/binary/float";
|
|
2
|
+
import { assert } from "@thi.ng/errors/assert";
|
|
3
|
+
import { asBytes, bytes, u16, u24, u32, u8, } from "@thi.ng/transducers-binary/bytes";
|
|
4
|
+
import { comp } from "@thi.ng/transducers/comp";
|
|
5
|
+
import { concat } from "@thi.ng/transducers/concat";
|
|
6
|
+
import { iterator } from "@thi.ng/transducers/iterator";
|
|
7
|
+
import { map } from "@thi.ng/transducers/map";
|
|
8
|
+
import { reduce } from "@thi.ng/transducers/reduce";
|
|
9
|
+
import { take } from "@thi.ng/transducers/take";
|
|
5
10
|
const HEADER_SIZE = 44;
|
|
6
11
|
const CONVERTERS = {
|
|
7
12
|
8: (x) => u8(f32u8(x)),
|
package/lib/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var api = require('@thi.ng/api');
|
|
6
|
-
var binary = require('@thi.ng/binary');
|
|
7
|
-
var transducers = require('@thi.ng/transducers');
|
|
8
|
-
var transducersBinary = require('@thi.ng/transducers-binary');
|
|
9
|
-
|
|
10
|
-
const HEADER_SIZE = 44;
|
|
11
|
-
const CONVERTERS = {
|
|
12
|
-
8: (x) => transducersBinary.u8(binary.f32u8(x)),
|
|
13
|
-
16: (x) => transducersBinary.u16(binary.f32u16(x), true),
|
|
14
|
-
24: (x) => transducersBinary.u24(binary.f32u24(x), true),
|
|
15
|
-
32: (x) => transducersBinary.u32(binary.f32u32(x), true),
|
|
16
|
-
};
|
|
17
|
-
const wavHeader = (spec) => {
|
|
18
|
-
const bytesPerSample = spec.bits >> 3;
|
|
19
|
-
const blockAlign = spec.channels * bytesPerSample;
|
|
20
|
-
const dataLength = spec.length * blockAlign;
|
|
21
|
-
return [
|
|
22
|
-
transducersBinary.u32(0x52494646, false),
|
|
23
|
-
transducersBinary.u32(dataLength + HEADER_SIZE - 8, true),
|
|
24
|
-
transducersBinary.u32(0x57415645, false),
|
|
25
|
-
transducersBinary.u32(0x666d7420, false),
|
|
26
|
-
transducersBinary.u32(16, true),
|
|
27
|
-
transducersBinary.u16(1, true),
|
|
28
|
-
transducersBinary.u16(spec.channels, true),
|
|
29
|
-
transducersBinary.u32(spec.sampleRate, true),
|
|
30
|
-
transducersBinary.u32(spec.sampleRate * blockAlign, true),
|
|
31
|
-
transducersBinary.u16(blockAlign, true),
|
|
32
|
-
transducersBinary.u16(spec.bits, true),
|
|
33
|
-
transducersBinary.u32(0x64617461, false),
|
|
34
|
-
transducersBinary.u32(dataLength, true),
|
|
35
|
-
];
|
|
36
|
-
};
|
|
37
|
-
const wavByteArray = (spec, src) => {
|
|
38
|
-
const convert = CONVERTERS[spec.bits];
|
|
39
|
-
api.assert(!!convert, `unsupported bits/sample: ${spec.bits}`);
|
|
40
|
-
return transducers.reduce(transducersBinary.bytes(), new Uint8Array(HEADER_SIZE + spec.length * spec.channels * (spec.bits >> 3)), transducers.concat(wavHeader(spec), transducers.iterator(transducers.comp(transducers.take(spec.length * spec.channels), transducers.map(convert)), src)));
|
|
41
|
-
};
|
|
42
|
-
const wavBytes = (spec, src) => {
|
|
43
|
-
const convert = CONVERTERS[spec.bits];
|
|
44
|
-
api.assert(!!convert, `unsupported bits/sample: ${spec.bits}`);
|
|
45
|
-
return transducersBinary.asBytes(transducers.concat(wavHeader(spec), transducers.iterator(transducers.comp(transducers.take(spec.length * spec.channels), transducers.map(convert)), src)));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.wavByteArray = wavByteArray;
|
|
49
|
-
exports.wavBytes = wavBytes;
|
|
50
|
-
exports.wavHeader = wavHeader;
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../write.js"],"sourcesContent":null,"names":["u8","f32u8","u16","f32u16","u24","f32u24","u32","f32u32","assert","reduce","bytes","concat","iterator","comp","take","map","asBytes"],"mappings":";;;;;;;;;AAIA,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,UAAU,GAAG;AACnB,IAAI,CAAC,EAAE,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AQ,CAAC,EAAEC,eAAG,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAClH;;;;;;"}
|
package/lib/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@thi.ng/api"),require("@thi.ng/binary"),require("@thi.ng/transducers"),require("@thi.ng/transducers-binary")):"function"==typeof define&&define.amd?define(["exports","@thi.ng/api","@thi.ng/binary","@thi.ng/transducers","@thi.ng/transducers-binary"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).thi=t.thi||{},t.thi.ng=t.thi.ng||{},t.thi.ng.dspIoWav={}),t.thi.ng.api,t.thi.ng.binary,t.thi.ng.transducers,t.thi.ng.transducersBinary)}(this,(function(t,e,n,i,s){"use strict";const r={8:t=>s.u8(n.f32u8(t)),16:t=>s.u16(n.f32u16(t),!0),24:t=>s.u24(n.f32u24(t),!0),32:t=>s.u32(n.f32u32(t),!0)},a=t=>{const e=t.bits>>3,n=t.channels*e,i=t.length*n;return[s.u32(1380533830,!1),s.u32(i+44-8,!0),s.u32(1463899717,!1),s.u32(1718449184,!1),s.u32(16,!0),s.u16(1,!0),s.u16(t.channels,!0),s.u32(t.sampleRate,!0),s.u32(t.sampleRate*n,!0),s.u16(n,!0),s.u16(t.bits,!0),s.u32(1684108385,!1),s.u32(i,!0)]};t.wavByteArray=(t,n)=>{const u=r[t.bits];return e.assert(!!u,`unsupported bits/sample: ${t.bits}`),i.reduce(s.bytes(),new Uint8Array(44+t.length*t.channels*(t.bits>>3)),i.concat(a(t),i.iterator(i.comp(i.take(t.length*t.channels),i.map(u)),n)))},t.wavBytes=(t,n)=>{const u=r[t.bits];return e.assert(!!u,`unsupported bits/sample: ${t.bits}`),s.asBytes(i.concat(a(t),i.iterator(i.comp(i.take(t.length*t.channels),i.map(u)),n)))},t.wavHeader=a,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/lib/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../write.js"],"sourcesContent":null,"names":["u8","f32u8","u16","f32u16","u24","f32u24","u32","f32u32","assert","reduce","bytes","concat","iterator","comp","take","map","asBytes"],"mappings":";;;;;;IAIA,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,MAAM,UAAU,GAAG;IACnB,IAAI,CAAC,EAAE,CAAC,CAAC,KAAKA,oBAAE,CAACC,YAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,EAAE,CAAC,CAAC,KAAKC,qBAAG,CAACC,aAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACnC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAKC,qBAAG,CAACC,aAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACnC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAKC,qBAAG,CAACC,aAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACnC,CAAC,CAAC;AACU,UAAC,SAAS,GAAG,CAAC,IAAI,KAAK;IACnC,IAAI,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;IAC1C,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;IACtD,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAChD,IAAI,OAAO;IACX,QAAQD,qBAAG,CAAC,UAAU,EAAE,KAAK,CAAC;IAC9B,QAAQA,qBAAG,CAAC,UAAU,GAAG,WAAW,GAAG,CAAC,EAAE,IAAI,CAAC;IAC/C,QAAQA,qBAAG,CAAC,UAAU,EAAE,KAAK,CAAC;IAC9B,QAAQA,qBAAG,CAAC,UAAU,EAAE,KAAK,CAAC;IAC9B,QAAQA,qBAAG,CAAC,EAAE,EAAE,IAAI,CAAC;IACrB,QAAQJ,qBAAG,CAAC,CAAC,EAAE,IAAI,C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