@embedpdf/engine-runtime 3.0.0-next.14 → 3.0.0-next.15

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/dist/build-id.cjs CHANGED
@@ -11,7 +11,7 @@ function isNodeLike() {
11
11
  }
12
12
 
13
13
  /**
14
- * Node-ONLY target detection. `detect-libc` (musl vs glibc for the native
14
+ * Node-only target detection. `detect-libc` (musl vs glibc for the native
15
15
  * addons) requires Node builtins at module load, so this file may only appear
16
16
  * in the `node` export condition's graph — never in the browser entry.
17
17
  */
@@ -41,13 +41,13 @@ function resolveRuntimeTarget() {
41
41
  }
42
42
 
43
43
  /**
44
- * The runtime's public build identity — a Node-only, SIDE-EFFECT-FREE
44
+ * The runtime's public build identity — a Node-only, side-effect-free
45
45
  * subpath (`@embedpdf/engine-runtime/build-id`): importing it never
46
46
  * touches native-addon loading, so supervisors and diagnostics can name
47
47
  * the engine without running it.
48
48
  *
49
49
  * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),
50
- * BOTH axes on purpose: deployments sharing one database can run
50
+ * both axes on purpose: deployments sharing one database can run
51
51
  * different native binaries (multi-arch images, mixed node pools), and
52
52
  * native crashers can be target-specific — consumers keying state on the
53
53
  * engine identity (e.g. crash quarantine) must never pool evidence
@@ -1 +1 @@
1
- {"version":3,"file":"build-id.cjs","sources":["../src/core/platform.ts","../src/core/platform.node.ts","../src/build-id.ts"],"sourcesContent":["/**\n * Environment-NEUTRAL platform vocabulary. This module must stay importable\n * from every graph (browser, worker, node) — so it carries no Node imports.\n * The node-only target detection (detect-libc) lives in `platform.node.ts`;\n * the browser graph pins `wasm32` in `index.browser.ts`.\n */\nexport type RuntimeTarget =\n | 'wasm32'\n | 'darwin-arm64'\n | 'darwin-x64'\n | 'linux-x64'\n | 'linux-arm64'\n | 'linuxmusl-x64'\n | 'linuxmusl-arm64'\n | 'win32-x64'\n | 'win32-arm64';\n\nexport function isNodeLike(): boolean {\n return (\n typeof process !== 'undefined' &&\n !!process.versions?.node &&\n typeof process.platform === 'string'\n );\n}\n\nexport function packageNameForTarget(target: RuntimeTarget): string {\n return `@embedpdf/engine-runtime-${target}`;\n}\n","/**\n * Node-ONLY target detection. `detect-libc` (musl vs glibc for the native\n * addons) requires Node builtins at module load, so this file may only appear\n * in the `node` export condition's graph — never in the browser entry.\n */\nimport { familySync, GLIBC, MUSL } from 'detect-libc';\nimport { isNodeLike, type RuntimeTarget } from './platform';\n\nexport function resolveRuntimeTarget(): RuntimeTarget | null {\n if (!isNodeLike()) return 'wasm32';\n\n const platform = process.platform;\n const arch = process.arch;\n\n if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';\n if (platform === 'darwin' && arch === 'x64') return 'darwin-x64';\n if (platform === 'win32' && arch === 'arm64') return 'win32-arm64';\n if (platform === 'win32' && arch === 'x64') return 'win32-x64';\n\n if (platform === 'linux') {\n const libc = familySync();\n const isMusl = libc === MUSL;\n const isGlibc = libc === GLIBC || libc == null;\n\n if (arch === 'arm64') return isMusl ? 'linuxmusl-arm64' : isGlibc ? 'linux-arm64' : null;\n if (arch === 'x64') return isMusl ? 'linuxmusl-x64' : isGlibc ? 'linux-x64' : null;\n }\n\n return null;\n}\n","/**\n * The runtime's public build identity — a Node-only, SIDE-EFFECT-FREE\n * subpath (`@embedpdf/engine-runtime/build-id`): importing it never\n * touches native-addon loading, so supervisors and diagnostics can name\n * the engine without running it.\n *\n * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),\n * BOTH axes on purpose: deployments sharing one database can run\n * different native binaries (multi-arch images, mixed node pools), and\n * native crashers can be target-specific — consumers keying state on the\n * engine identity (e.g. crash quarantine) must never pool evidence\n * across different binaries, nor reset it when only the *other* arch\n * upgraded.\n *\n * The version is read from this package's own manifest at import time —\n * a self-relative read, which the `exports` map does not govern — so\n * there is no generation step and nothing to drift.\n */\nimport { createRequire } from 'node:module';\n\nimport type { RuntimeTarget } from './core/platform';\nimport { resolveRuntimeTarget } from './core/platform.node';\n\nconst require = createRequire(import.meta.url);\n\nexport const ENGINE_RUNTIME_VERSION: string = (\n require('../package.json') as { version: string }\n).version;\n\n/** The native target this process would load (null: unsupported platform). */\nexport function engineRuntimeTarget(): RuntimeTarget | null {\n return resolveRuntimeTarget();\n}\n\n/** `version:target` — the engine identity for supervisors and journals. */\nexport function engineRuntimeBuildId(): string {\n return `${ENGINE_RUNTIME_VERSION}:${resolveRuntimeTarget() ?? 'unknown'}`;\n}\n"],"names":["familySync","MUSL","GLIBC","require","createRequire"],"mappings":";;;;;;SAiBgB,UAAU,GAAA;AACxB,IAAA,QACE,OAAO,OAAO,KAAK,WAAW;AAC9B,QAAA,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI;AACxB,QAAA,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;AAExC;;ACvBA;;;;AAIG;SAIa,oBAAoB,GAAA;IAClC,IAAI,CAAC,UAAU,EAAE;AAAE,QAAA,OAAO,QAAQ;AAElC,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ;AACjC,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;AAEzB,IAAA,IAAI,QAAQ,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO;AAAE,QAAA,OAAO,cAAc;AACpE,IAAA,IAAI,QAAQ,KAAK,QAAQ,IAAI,IAAI,KAAK,KAAK;AAAE,QAAA,OAAO,YAAY;AAChE,IAAA,IAAI,QAAQ,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO;AAAE,QAAA,OAAO,aAAa;AAClE,IAAA,IAAI,QAAQ,KAAK,OAAO,IAAI,IAAI,KAAK,KAAK;AAAE,QAAA,OAAO,WAAW;AAE9D,IAAA,IAAI,QAAQ,KAAK,OAAO,EAAE;AACxB,QAAA,MAAM,IAAI,GAAGA,qBAAU,EAAE;AACzB,QAAA,MAAM,MAAM,GAAG,IAAI,KAAKC,eAAI;QAC5B,MAAM,OAAO,GAAG,IAAI,KAAKC,gBAAK,IAAI,IAAI,IAAI,IAAI;QAE9C,IAAI,IAAI,KAAK,OAAO;AAAE,YAAA,OAAO,MAAM,GAAG,iBAAiB,GAAG,OAAO,GAAG,aAAa,GAAG,IAAI;QACxF,IAAI,IAAI,KAAK,KAAK;AAAE,YAAA,OAAO,MAAM,GAAG,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,IAAI;IACpF;AAEA,IAAA,OAAO,IAAI;AACb;;AC7BA;;;;;;;;;;;;;;;;;AAiBG;AAMH,MAAMC,SAAO,GAAGC,yBAAa,CAAC,8PAAe,CAAC;AAEvC,MAAM,sBAAsB,GACjCD,SAAO,CAAC,iBAAiB,CAC1B,CAAC;AAEF;SACgB,mBAAmB,GAAA;IACjC,OAAO,oBAAoB,EAAE;AAC/B;AAEA;SACgB,oBAAoB,GAAA;IAClC,OAAO,CAAA,EAAG,sBAAsB,CAAA,CAAA,EAAI,oBAAoB,EAAE,IAAI,SAAS,EAAE;AAC3E;;;;;;"}
1
+ {"version":3,"file":"build-id.cjs","sources":["../src/core/platform.ts","../src/core/platform.node.ts","../src/build-id.ts"],"sourcesContent":["/**\n * Environment-neutral platform vocabulary. This module must stay importable\n * from every graph (browser, worker, node) — so it carries no Node imports.\n * The node-only target detection (detect-libc) lives in `platform.node.ts`;\n * the browser graph pins `wasm32` in `index.browser.ts`.\n */\nexport type RuntimeTarget =\n | 'wasm32'\n | 'darwin-arm64'\n | 'darwin-x64'\n | 'linux-x64'\n | 'linux-arm64'\n | 'linuxmusl-x64'\n | 'linuxmusl-arm64'\n | 'win32-x64'\n | 'win32-arm64';\n\nexport function isNodeLike(): boolean {\n return (\n typeof process !== 'undefined' &&\n !!process.versions?.node &&\n typeof process.platform === 'string'\n );\n}\n\nexport function packageNameForTarget(target: RuntimeTarget): string {\n return `@embedpdf/engine-runtime-${target}`;\n}\n","/**\n * Node-only target detection. `detect-libc` (musl vs glibc for the native\n * addons) requires Node builtins at module load, so this file may only appear\n * in the `node` export condition's graph — never in the browser entry.\n */\nimport { familySync, GLIBC, MUSL } from 'detect-libc';\nimport { isNodeLike, type RuntimeTarget } from './platform';\n\nexport function resolveRuntimeTarget(): RuntimeTarget | null {\n if (!isNodeLike()) return 'wasm32';\n\n const platform = process.platform;\n const arch = process.arch;\n\n if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';\n if (platform === 'darwin' && arch === 'x64') return 'darwin-x64';\n if (platform === 'win32' && arch === 'arm64') return 'win32-arm64';\n if (platform === 'win32' && arch === 'x64') return 'win32-x64';\n\n if (platform === 'linux') {\n const libc = familySync();\n const isMusl = libc === MUSL;\n const isGlibc = libc === GLIBC || libc == null;\n\n if (arch === 'arm64') return isMusl ? 'linuxmusl-arm64' : isGlibc ? 'linux-arm64' : null;\n if (arch === 'x64') return isMusl ? 'linuxmusl-x64' : isGlibc ? 'linux-x64' : null;\n }\n\n return null;\n}\n","/**\n * The runtime's public build identity — a Node-only, side-effect-free\n * subpath (`@embedpdf/engine-runtime/build-id`): importing it never\n * touches native-addon loading, so supervisors and diagnostics can name\n * the engine without running it.\n *\n * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),\n * both axes on purpose: deployments sharing one database can run\n * different native binaries (multi-arch images, mixed node pools), and\n * native crashers can be target-specific — consumers keying state on the\n * engine identity (e.g. crash quarantine) must never pool evidence\n * across different binaries, nor reset it when only the *other* arch\n * upgraded.\n *\n * The version is read from this package's own manifest at import time —\n * a self-relative read, which the `exports` map does not govern — so\n * there is no generation step and nothing to drift.\n */\nimport { createRequire } from 'node:module';\n\nimport type { RuntimeTarget } from './core/platform';\nimport { resolveRuntimeTarget } from './core/platform.node';\n\nconst require = createRequire(import.meta.url);\n\nexport const ENGINE_RUNTIME_VERSION: string = (\n require('../package.json') as { version: string }\n).version;\n\n/** The native target this process would load (null: unsupported platform). */\nexport function engineRuntimeTarget(): RuntimeTarget | null {\n return resolveRuntimeTarget();\n}\n\n/** `version:target` — the engine identity for supervisors and journals. */\nexport function engineRuntimeBuildId():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GAAG,IAAI;IACpF;AAEA,IAAA,OAAO,IAAI;AACb;;AC7BA;;;;;;;;;;;;;;;;;AAiBG;AAMH,MAAMC,SAAO,GAAGC,yBAAa,CAAC,8PAAe,CAAC;AAEvC,MAAM,sBAAsB,GACjCD,SAAO,CAAC,iBAAiB,CAC1B,CAAC;AAEF;SACgB,mBAAmB,GAAA;IACjC,OAAO,oBAAoB,EAAE;AAC/B;AAEA;SACgB,oBAAoB,GAAA;IAClC,OAAO,CAAA,EAAG,sBAAsB,CAAA,CAAA,EAAI,oBAAoB,EAAE,IAAI,SAAS,EAAE;AAC3E;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Environment-NEUTRAL platform vocabulary. This module must stay importable
2
+ * Environment-neutral platform vocabulary. This module must stay importable
3
3
  * from every graph (browser, worker, node) — so it carries no Node imports.
4
4
  * The node-only target detection (detect-libc) lives in `platform.node.ts`;
5
5
  * the browser graph pins `wasm32` in `index.browser.ts`.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Environment-NEUTRAL platform vocabulary. This module must stay importable
2
+ * Environment-neutral platform vocabulary. This module must stay importable
3
3
  * from every graph (browser, worker, node) — so it carries no Node imports.
4
4
  * The node-only target detection (detect-libc) lives in `platform.node.ts`;
5
5
  * the browser graph pins `wasm32` in `index.browser.ts`.
package/dist/build-id.js CHANGED
@@ -8,7 +8,7 @@ function isNodeLike() {
8
8
  }
9
9
 
10
10
  /**
11
- * Node-ONLY target detection. `detect-libc` (musl vs glibc for the native
11
+ * Node-only target detection. `detect-libc` (musl vs glibc for the native
12
12
  * addons) requires Node builtins at module load, so this file may only appear
13
13
  * in the `node` export condition's graph — never in the browser entry.
14
14
  */
@@ -38,13 +38,13 @@ function resolveRuntimeTarget() {
38
38
  }
39
39
 
40
40
  /**
41
- * The runtime's public build identity — a Node-only, SIDE-EFFECT-FREE
41
+ * The runtime's public build identity — a Node-only, side-effect-free
42
42
  * subpath (`@embedpdf/engine-runtime/build-id`): importing it never
43
43
  * touches native-addon loading, so supervisors and diagnostics can name
44
44
  * the engine without running it.
45
45
  *
46
46
  * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),
47
- * BOTH axes on purpose: deployments sharing one database can run
47
+ * both axes on purpose: deployments sharing one database can run
48
48
  * different native binaries (multi-arch images, mixed node pools), and
49
49
  * native crashers can be target-specific — consumers keying state on the
50
50
  * engine identity (e.g. crash quarantine) must never pool evidence
@@ -1 +1 @@
1
- {"version":3,"file":"build-id.js","sources":["../src/core/platform.ts","../src/core/platform.node.ts","../src/build-id.ts"],"sourcesContent":["/**\n * Environment-NEUTRAL platform vocabulary. This module must stay importable\n * from every graph (browser, worker, node) — so it carries no Node imports.\n * The node-only target detection (detect-libc) lives in `platform.node.ts`;\n * the browser graph pins `wasm32` in `index.browser.ts`.\n */\nexport type RuntimeTarget =\n | 'wasm32'\n | 'darwin-arm64'\n | 'darwin-x64'\n | 'linux-x64'\n | 'linux-arm64'\n | 'linuxmusl-x64'\n | 'linuxmusl-arm64'\n | 'win32-x64'\n | 'win32-arm64';\n\nexport function isNodeLike(): boolean {\n return (\n typeof process !== 'undefined' &&\n !!process.versions?.node &&\n typeof process.platform === 'string'\n );\n}\n\nexport function packageNameForTarget(target: RuntimeTarget): string {\n return `@embedpdf/engine-runtime-${target}`;\n}\n","/**\n * Node-ONLY target detection. `detect-libc` (musl vs glibc for the native\n * addons) requires Node builtins at module load, so this file may only appear\n * in the `node` export condition's graph — never in the browser entry.\n */\nimport { familySync, GLIBC, MUSL } from 'detect-libc';\nimport { isNodeLike, type RuntimeTarget } from './platform';\n\nexport function resolveRuntimeTarget(): RuntimeTarget | null {\n if (!isNodeLike()) return 'wasm32';\n\n const platform = process.platform;\n const arch = process.arch;\n\n if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';\n if (platform === 'darwin' && arch === 'x64') return 'darwin-x64';\n if (platform === 'win32' && arch === 'arm64') return 'win32-arm64';\n if (platform === 'win32' && arch === 'x64') return 'win32-x64';\n\n if (platform === 'linux') {\n const libc = familySync();\n const isMusl = libc === MUSL;\n const isGlibc = libc === GLIBC || libc == null;\n\n if (arch === 'arm64') return isMusl ? 'linuxmusl-arm64' : isGlibc ? 'linux-arm64' : null;\n if (arch === 'x64') return isMusl ? 'linuxmusl-x64' : isGlibc ? 'linux-x64' : null;\n }\n\n return null;\n}\n","/**\n * The runtime's public build identity — a Node-only, SIDE-EFFECT-FREE\n * subpath (`@embedpdf/engine-runtime/build-id`): importing it never\n * touches native-addon loading, so supervisors and diagnostics can name\n * the engine without running it.\n *\n * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),\n * BOTH axes on purpose: deployments sharing one database can run\n * different native binaries (multi-arch images, mixed node pools), and\n * native crashers can be target-specific — consumers keying state on the\n * engine identity (e.g. crash quarantine) must never pool evidence\n * across different binaries, nor reset it when only the *other* arch\n * upgraded.\n *\n * The version is read from this package's own manifest at import time —\n * a self-relative read, which the `exports` map does not govern — so\n * there is no generation step and nothing to drift.\n */\nimport { createRequire } from 'node:module';\n\nimport type { RuntimeTarget } from './core/platform';\nimport { resolveRuntimeTarget } from './core/platform.node';\n\nconst require = createRequire(import.meta.url);\n\nexport const ENGINE_RUNTIME_VERSION: string = (\n require('../package.json') as { version: string }\n).version;\n\n/** The native target this process would load (null: unsupported platform). */\nexport function engineRuntimeTarget(): RuntimeTarget | null {\n return resolveRuntimeTarget();\n}\n\n/** `version:target` — the engine identity for supervisors and journals. */\nexport function engineRuntimeBuildId(): string {\n return `${ENGINE_RUNTIME_VERSION}:${resolveRuntimeTarget() ?? 'unknown'}`;\n}\n"],"names":["require"],"mappings":";;;SAiBgB,UAAU,GAAA;AACxB,IAAA,QACE,OAAO,OAAO,KAAK,WAAW;AAC9B,QAAA,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI;AACxB,QAAA,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;AAExC;;ACvBA;;;;AAIG;SAIa,oBAAoB,GAAA;IAClC,IAAI,CAAC,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I,oBAAoB,EAAE,IAAI,SAAS,EAAE;AAC3E;;;;"}
1
+ {"version":3,"file":"build-id.js","sources":["../src/core/platform.ts","../src/core/platform.node.ts","../src/build-id.ts"],"sourcesContent":["/**\n * Environment-neutral platform vocabulary. This module must stay importable\n * from every graph (browser, worker, node) — so it carries no Node imports.\n * The node-only target detection (detect-libc) lives in `platform.node.ts`;\n * the browser graph pins `wasm32` in `index.browser.ts`.\n */\nexport type RuntimeTarget =\n | 'wasm32'\n | 'darwin-arm64'\n | 'darwin-x64'\n | 'linux-x64'\n | 'linux-arm64'\n | 'linuxmusl-x64'\n | 'linuxmusl-arm64'\n | 'win32-x64'\n | 'win32-arm64';\n\nexport function isNodeLike(): boolean {\n return (\n typeof process !== 'undefined' &&\n !!process.versions?.node &&\n typeof process.platform === 'string'\n );\n}\n\nexport function packageNameForTarget(target: RuntimeTarget): string {\n return `@embedpdf/engine-runtime-${target}`;\n}\n","/**\n * Node-only target detection. `detect-libc` (musl vs glibc for the native\n * addons) requires Node builtins at module load, so this file may only appear\n * in the `node` export condition's graph — never in the browser entry.\n */\nimport { familySync, GLIBC, MUSL } from 'detect-libc';\nimport { isNodeLike, type RuntimeTarget } from './platform';\n\nexport function resolveRuntimeTarget(): RuntimeTarget | null {\n if (!isNodeLike()) return 'wasm32';\n\n const platform = process.platform;\n const arch = process.arch;\n\n if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';\n if (platform === 'darwin' && arch === 'x64') return 'darwin-x64';\n if (platform === 'win32' && arch === 'arm64') return 'win32-arm64';\n if (platform === 'win32' && arch === 'x64') return 'win32-x64';\n\n if (platform === 'linux') {\n const libc = familySync();\n const isMusl = libc === MUSL;\n const isGlibc = libc === GLIBC || libc == null;\n\n if (arch === 'arm64') return isMusl ? 'linuxmusl-arm64' : isGlibc ? 'linux-arm64' : null;\n if (arch === 'x64') return isMusl ? 'linuxmusl-x64' : isGlibc ? 'linux-x64' : null;\n }\n\n return null;\n}\n","/**\n * The runtime's public build identity — a Node-only, side-effect-free\n * subpath (`@embedpdf/engine-runtime/build-id`): importing it never\n * touches native-addon loading, so supervisors and diagnostics can name\n * the engine without running it.\n *\n * The identity is `version:target` (e.g. `3.0.0-next.7:linux-arm64`),\n * both axes on purpose: deployments sharing one database can run\n * different native binaries (multi-arch images, mixed node pools), and\n * native crashers can be target-specific — consumers keying state on the\n * engine identity (e.g. crash quarantine) must never pool evidence\n * across different binaries, nor reset it when only the *other* arch\n * upgraded.\n *\n * The version is read from this package's own manifest at import time —\n * a self-relative read, which the `exports` map does not govern — so\n * there is no generation step and nothing to drift.\n */\nimport { createRequire } from 'node:module';\n\nimport type { RuntimeTarget } from './core/platform';\nimport { resolveRuntimeTarget } from './core/platform.node';\n\nconst require = createRequire(import.meta.url);\n\nexport const ENGINE_RUNTIME_VERSION: string = (\n require('../package.json') as { version: string }\n).version;\n\n/** The native target this process would load (null: unsupported platform). */\nexport function engineRuntimeTarget(): RuntimeTarget | null {\n return resolveRuntimeTarget();\n}\n\n/** `version:target` — the engine identity for supervisors and journals. */\nexport function engineRuntimeBuildId(): string {\n return `${ENGINE_RUNTIME_VERSION}:${resolveRuntimeTarget() ?? 'unknown'}`;\n}\n"],"names":["require"],"mappings":";;;SAiBgB,UAAU,GAAA;AACxB,IAAA,QACE,OAAO,OAAO,KAAK,WAAW;AAC9B,QAAA,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI;AACxB,QAAA,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;AAExC;;ACvBA;;;;AAIG;SAIa,oBAAoB,GAAA;IAClC,IAAI,CAAC,UAAU,EAAE;AAAE,QAAA,OAAO,QAAQ;AAElC,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ;AACjC,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;AAEzB,IAAA,IAAI,QAAQ,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO;AAAE,QAAA,OAAO,cAAc;AACpE,IAAA,IAAI,QAAQ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