@oh-just-another/exporter 0.57.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @oh-just-another/exporter
2
+
3
+ ## 0.57.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Version bump just for publishing.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @oh-just-another/headless@0.57.0
13
+ - @oh-just-another/renderer-svg@0.57.0
14
+ - @oh-just-another/scene@0.57.0
15
+ - @oh-just-another/serialization@0.57.0
16
+ - @oh-just-another/types@0.57.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rustam Garifulin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # @oh-just-another/exporter
2
+
3
+ Document-grade export of `@oh-just-another/scene` documents — high-resolution PNG with DPI metadata, vector PDF, world-coordinate cropping. Builds on top of `@headless` (which itself uses `@renderer-svg`).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @oh-just-another/exporter
9
+ # Peer deps — install only the ones you need:
10
+ pnpm add @resvg/resvg-js # PNG (~3 MB wasm)
11
+ pnpm add pdfkit svg-to-pdfkit # PDF
12
+ ```
13
+
14
+ All three peers are **optional** — the package only requires the ones for the formats you call into.
15
+
16
+ ## Usage
17
+
18
+ ```ts
19
+ import { writeFile, readFile } from "node:fs/promises";
20
+ import { exportPng, exportPdf } from "@oh-just-another/exporter";
21
+
22
+ const scene = await readFile("scene.json", "utf8");
23
+
24
+ // High-resolution PNG with print DPI metadata.
25
+ await writeFile(
26
+ "scene@2x.png",
27
+ await exportPng(scene, { scale: 2, dpi: 300, background: "#ffffff" }),
28
+ );
29
+
30
+ // Crop a region of the scene.
31
+ await writeFile(
32
+ "thumb.png",
33
+ await exportPng(scene, { region: { x: 0, y: 0, width: 400, height: 300 } }),
34
+ );
35
+
36
+ // PDF for printing — A4 portrait by default.
37
+ await writeFile(
38
+ "scene.pdf",
39
+ await exportPdf(scene, { pageSize: "Letter", orientation: "landscape", title: "Diagram" }),
40
+ );
41
+ ```
42
+
43
+ ## API
44
+
45
+ | Name | Purpose |
46
+ | ----------------------------- | ----------------------------------------------------------------------------------------------- |
47
+ | `exportPng(scene, options?)` | Scene → PNG `Uint8Array`. Optional `region`, `scale`, `background`, `dpi`. |
48
+ | `exportPdf(scene, options?)` | Scene → PDF `Uint8Array`. Optional `region`, `pageSize`, `orientation`, `margin`, doc metadata. |
49
+ | `setPngDpi(png, dpi)` | Standalone helper to embed a `pHYs` chunk into any PNG. |
50
+ | `BaseExportOptions` | Shared: `region`, `width`, `height`, `background`. |
51
+ | `ExportPngOptions` | Adds `scale`, `dpi`. |
52
+ | `ExportPdfOptions` | Adds `pageSize`, `orientation`, `margin`, `title`, `author`, `subject`. |
53
+ | `ExportRegion`, `PdfPageSize` | Type aliases re-exported for convenience. |
54
+
55
+ ## Design notes
56
+
57
+ - **Crop = synthetic viewport.** A `region` is implemented by handing the
58
+ renderer a viewport with `pan = -region` and `size = region.{w,h}`. No
59
+ extra clip-rect logic in the SVG/PDF pipeline — the renderer naturally
60
+ produces an image of the right size.
61
+ - **DPI metadata via direct PNG chunk insertion.** resvg-js doesn't expose
62
+ output `pHYs`, so `setPngDpi` walks the PNG byte stream, drops any
63
+ existing `pHYs`, and writes a fresh one (with a hand-rolled CRC32) right
64
+ before the first `IDAT`. Zero deps, ~100 lines.
65
+ - **PDF via pdfkit + svg-to-pdfkit, not via PNG-embed.** Embedding a raster
66
+ PNG into a PDF would lose vector quality and inflate file size. Going
67
+ through SVG keeps fonts and shapes crisp at any zoom.
68
+ - **Optional peer deps over direct deps.** Consumers pulling only `exportPng`
69
+ don't get pdfkit's footprint; PDF-only callers don't drag in resvg. Each
70
+ entry point loads its peers dynamically via `import(/* @vite-ignore */
71
+ specifier)` so bundlers don't bake them in.
72
+ - **`A4` / `Letter` etc. as string constants.** Custom sizes via `{ width,
73
+ height }` in PDF points (1pt = 1/72in). The CLI accepts the same plus a
74
+ `WxH` shorthand.
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../types/dist/vec2.d.ts","../../types/dist/bounds.d.ts","../../types/dist/transform.d.ts","../../types/dist/color.d.ts","../../types/dist/ids.d.ts","../../types/dist/events.d.ts","../../types/dist/index.d.ts","../../scene/dist/style.d.ts","../../scene/dist/constants.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/types.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/generate.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/jitter.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/digits.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/errors.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/index.d.ts","../../scene/dist/edge.d.ts","../../scene/dist/shape.d.ts","../../scene/dist/edge-curve.d.ts","../../scene/dist/annotation.d.ts","../../scene/dist/file.d.ts","../../scene/dist/layer.d.ts","../../scene/dist/viewport.d.ts","../../scene/dist/patch.d.ts","../../scene/dist/scene.d.ts","../../scene/dist/edge-geometry.d.ts","../../scene/dist/operations.d.ts","../../scene/dist/render-bounds.d.ts","../../scene/dist/text-measure.d.ts","../../scene/dist/anchors.d.ts","../../scene/dist/snap.d.ts","../../scene/dist/outline.d.ts","../../scene/dist/annotation-geometry.d.ts","../../scene/dist/spatial.d.ts","../../scene/dist/queries.d.ts","../../scene/dist/a11y.d.ts","../../scene/dist/layout.d.ts","../../scene/dist/layout-registry.d.ts","../../scene/dist/elbow-router.d.ts","../../scene/dist/elbow-link.d.ts","../../scene/dist/heading.d.ts","../../scene/dist/diff.d.ts","../../scene/dist/three-way-merge.d.ts","../../scene/dist/container.d.ts","../../scene/dist/index.d.ts","../../renderer-core/dist/render-target.d.ts","../../renderer-core/dist/shape-renderer.d.ts","../../renderer-core/dist/layers.d.ts","../../renderer-core/dist/shape-cache.d.ts","../../renderer-core/dist/layer-cache-composite.d.ts","../../renderer-core/dist/scene-renderer.d.ts","../../renderer-core/dist/edge-cache.d.ts","../../renderer-core/dist/edge-cache-bitmap.d.ts","../../renderer-core/dist/edge-renderer.d.ts","../../renderer-core/dist/grid-renderer.d.ts","../../renderer-core/dist/built-in-renderers.d.ts","../../renderer-core/dist/text-shaper.d.ts","../../renderer-core/dist/text-layout.d.ts","../../renderer-core/dist/text-editing.d.ts","../../renderer-core/dist/shape-cache-bitmap.d.ts","../../renderer-core/dist/animation-adapter.d.ts","../../renderer-core/dist/rasterizer.d.ts","../../renderer-core/dist/js-rasterizer.d.ts","../../renderer-core/dist/worker-render.d.ts","../../renderer-core/dist/tile-renderer.d.ts","../../renderer-core/dist/constants.d.ts","../../renderer-core/dist/index.d.ts","../../renderer-svg/dist/svg-target.d.ts","../../renderer-svg/dist/measure-text.d.ts","../../renderer-svg/dist/render-scene-to-svg.d.ts","../../renderer-svg/dist/index.d.ts","../../headless/dist/render-to-svg.d.ts","../../headless/dist/render-to-png.d.ts","../../headless/dist/index.d.ts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typealiases.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/zoderror.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/enumutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/partialutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/standard-schema.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.d.cts","../../serialization/dist/schema.d.ts","../../serialization/dist/serialize.d.ts","../../serialization/dist/deserialize.d.ts","../../serialization/dist/migrations.d.ts","../../serialization/dist/files.d.ts","../../serialization/dist/index.d.ts","../src/options.ts","../src/region.ts","../src/export-pdf.ts","../src/png-dpi.ts","../src/export-png.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sea.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sqlite.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/index.d.ts","../../../node_modules/.pnpm/@types+pdfkit@0.13.9/node_modules/@types/pdfkit/index.d.ts","../../../node_modules/.pnpm/@types+svg-to-pdfkit@0.1.4/node_modules/@types/svg-to-pdfkit/index.d.ts"],"fileIdsList":[[162,208,209,211,228,229],[162,210,211,228,229],[211,228,229],[162,211,216,228,229,246],[162,211,212,217,222,228,229,231,243,254],[162,211,212,213,222,228,229,231],[162,211,228,229],[157,158,159,162,211,228,229],[162,211,214,228,229,255],[162,211,215,216,223,228,229,232],[162,211,216,228,229,243,251],[162,211,217,219,222,228,229,231],[162,210,211,218,228,229],[162,211,219,220,228,229],[162,211,221,222,228,229],[162,210,211,222,228,229],[162,211,222,223,224,228,229,243,254],[162,211,222,223,224,228,229,238,243,246],[162,204,211,219,222,225,228,229,231,243,254],[162,211,222,223,225,226,228,229,231,243,251,254],[162,211,225,227,228,229,243,251,254],[160,161,162,163,164,165,166,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],[162,211,222,228,229],[162,211,228,229,230,254],[162,211,219,222,228,229,231,243],[162,211,228,229,232],[162,211,228,229,233],[162,210,211,228,229,234],[162,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],[162,211,228,229,236],[162,211,228,229,237],[162,211,222,228,229,238,239],[162,211,228,229,238,240,255,257],[162,211,223,228,229],[162,211,222,228,229,243,244,246],[162,211,228,229,245,246],[162,211,228,229,243,244],[162,211,228,229,246],[162,211,228,229,247],[162,208,211,228,229,243,248,254],[162,211,222,228,229,249,250],[162,211,228,229,249,250],[162,211,216,228,229,231,243,251],[162,211,228,229,252],[162,211,228,229,231,253],[162,211,225,228,229,237,254],[162,211,216,228,229,255],[162,211,228,229,243,256],[162,211,228,229,230,257],[162,211,228,229,258],[162,204,211,228,229],[162,204,211,222,224,228,229,234,243,246,254,256,257,259],[162,211,228,229,243,260],[162,211,228,229,261],[162,211,228,229,262],[67,162,211,228,229],[67,68,69,70,71,162,211,228,229],[162,176,180,211,228,229,254],[162,176,211,228,229,243,254],[162,171,211,228,229],[162,173,176,211,228,229,251,254],[162,211,228,229,231,251],[162,171,211,228,229,261],[162,173,176,211,228,229,231,254],[162,168,169,172,175,211,222,228,229,243,254],[162,176,183,211,228,229],[162,168,174,211,228,229],[162,176,197,198,211,228,229],[162,172,176,211,228,229,246,254,261],[162,197,211,228,229,261],[162,170,171,211,228,229,261],[162,176,211,228,229],[162,170,171,172,173,174,175,176,177,178,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,198,199,200,201,202,203,211,228,229],[162,176,191,211,228,229],[162,176,183,184,211,228,229],[162,174,176,184,185,211,228,229],[162,175,211,228,229],[162,168,171,176,211,228,229],[162,176,180,184,185,211,228,229],[162,180,211,228,229],[162,174,176,179,211,228,229,254],[162,168,173,176,183,211,228,229],[162,211,228,229,243],[162,171,176,197,211,228,229,259,261],[143,162,211,228,229],[134,135,162,211,228,229],[131,132,134,136,137,142,162,211,228,229],[132,134,162,211,228,229],[142,162,211,228,229],[134,162,211,228,229],[131,132,134,137,138,139,140,141,162,211,228,229],[131,132,133,162,211,228,229],[101,130,151,152,162,211,228,229,243],[101,130,151,152,154,162,211,228,229],[151,152,153,154,155,162,211,228,229],[64,162,211,228,229],[64,101,150,151,162,211,228,229],[128,129,162,211,228,229],[101,127,162,211,228,229],[107,162,211,228,229],[101,162,211,228,229],[64,101,162,211,228,229],[64,101,102,108,109,162,211,228,229],[101,102,162,211,228,229],[102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,162,211,228,229],[118,162,211,228,229],[64,101,102,105,106,162,211,228,229],[102,162,211,228,229],[102,113,162,211,228,229],[124,125,126,162,211,228,229],[101,123,125,162,211,228,229],[64,123,162,211,228,229],[74,162,211,228,229],[64,73,74,162,211,228,229],[64,76,81,162,211,228,229],[64,74,81,162,211,228,229],[64,81,162,211,228,229],[64,73,75,81,162,211,228,229],[64,65,72,162,211,228,229],[64,73,81,162,211,228,229],[64,74,162,211,228,229],[65,66,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,162,211,228,229],[64,72,162,211,228,229],[64,80,81,162,211,228,229],[64,74,80,81,162,211,228,229],[64,73,74,76,78,79,80,81,162,211,228,229],[64,73,74,76,77,78,79,162,211,228,229],[64,73,74,78,81,90,162,211,228,229],[64,72,73,74,76,77,78,79,80,162,211,228,229],[64,65,72,73,162,211,228,229],[145,146,147,148,149,162,211,228,229],[144,162,211,228,229],[101,145,162,211,228,229],[58,162,211,228,229],[58,59,60,61,62,63,162,211,228,229]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"a9dc2e59fb40b94411bd995a0013c15385b99599a18b7141cf3eafd80c7f0f96","4015dc819b09b93f989d4df8f1f0f36cb99cb2aad8102ab8b4b27fb6020beb5f","ed06a7b359e2125c375f6bada6631fd038473dd624309b8a43a824693a6f6c89","46fa0b276ad58dc963c574f72bb9456b881f3d61bc0fe6827c24f3f02baa6038","1f0260dbafda11af88b11f1b6d662ee45517d44c8cc9a7248bd61d2d8ab1f880","502657b9a54e290098ba4f955efa476b91648b24d5310b8c6e7aa0d4cf8945ae","90755de39a18e2894ad3cced6cdf4cb670e09868b01a6f6465af558d865bf848","b8e3c1f3a85e05bcbc56fa28558cffc68ac40e4158afdc2d702ea825ce21d14d","c196961c4aa13e3bf28a7e56ac7fa0b0cbfc668eca4496292d629dd18f43296b",{"version":"bce89d3ef847715b91ffd525a157c779be8fafebe823671815f7ce96f27afcda","impliedFormat":99},{"version":"c67f9d85070618f586d632cf184b986eb604f426b90aa68ecdad1ac68ca3151c","impliedFormat":99},{"version":"c656cc6ded557aff87a6c823142852e3548c6a14f84bb48ee35c3e57b6ebc03b","impliedFormat":99},{"version":"0e34130243c29d8d826f868c4e00ff586b349627cb241b3d89f0459a6cdeff4d","impliedFormat":99},{"version":"d555c6cb465cc5cf8127adbbc496720d5200c9dfafa777bbf9dfdea74ebfe3a3","impliedFormat":99},{"version":"27a6936a863edf777150af3ebc65939fa34f51d68385f8a7f198d8ea53685a4d","impliedFormat":99},"17ee722c53770caad5479081a3db9f0df8135a8f061ea9ce57a507ca0c424cce","78bde316dcb094df77d06b893e0b965d318ac5708d09e7cf6206931263be32e6","d081374b0bf74e2748138e8b0a56458e12e2ee7bd07fb239b92c97a33bba8d70","b85f83aa4b7fb1abc375a73cb706295a146b9f22cf9fa5ec89105fcff6ea1495","fd0cd0a179e95f7d4d5f7370209f6b413006242a045137d33ca230ae015ba760","fa716666e5bedc99e38d37def5182924b9dd9e6298c2751f8cebe0fc631ef697","48280d2635c39dd226b7e5bb71d0519f355b60d4d92e9f6b5b4a427aa28412f8","8bdcd8a58fead736e81808193884907482c8d354f13a0516e9b236a07622c727","8ebfa15cb2e79b885a21ae5f92507b5b9dd9b01041143554903c163f86611849","4233c4d8ac9cb79b3b71e4923eb486f08f5f2c6508fc177192081a402bee38b3","dfa88df7638cc24634255691d0a3fb72a4910b73211da89fab8f2362730cb3b2","75ea946ee4d31489f494b0def56b2db669c3aac052713387d6edc51dc2ca86db","26ce9aa6f798212e39770c45142239f3a54fa63697ba90bae90c6d7ac7da825a","eceda86937454d399a4e4cd4a3e25835a4ac80ab930f399b20f53d8f1c772457","8b12bcaa49f76ee1ce7f77943a297078dba53abedd344da6d370012eab482c07","ebfed381c5296dbb1ebae8265ca08dbce33929fa829f6ac11f2f591beb1f4485","ae557ba7a3d28e8909ac395365eb5f8ff63bc28eb2eaace61650ed51f1bc1808","95784f449b26dbdf4aadd2f99a5c2f6c419d80f993ececa6c0c3e0159b452aa5","89c0f7c64772fcb38eda1e15b26da3e53e4101c968a0eeb14954f154aee4dac1","6e7e44d7615d2899c2dd6be4e15bbb2cd0b7f4afec2379c08db14b9eac5c9b43","a1f5b4a129cd4b8f013533f200baf74615d690c41f1ef2147bd40ef6110c4a1b","d1b901b618ec72bff0fcb657edf03d83e2bcbb2687a9cddadea48a24ab23faf2","9a02cb3cccc3eeb3fea9327c47dbda2076e21f3da7b2eb659871dc91b8572f42","1778dfd35a7d5885896c436792662c8d602ea8cf03aeed97b0381b6e82c4e980","f730ff4577c8d45cb4a587d078ee5b692613c3de57f26a27a4be74c183adc226","60bd456f1b63861f880c386ddf1b3916098bbafbf4b5a46a5e5ebc4fcb9434c4","f2c0b5b634eed4010d9396710281a7fdc7019fe47507e8bcb706a58af985548a","baeb8f9be968778478ffa26099ec4211dd28c6dea1633fd8fd1560c34fdd0269","5df76ca2d799039334a825b621129061b89022808e0943397e045bc6feec894c","799b9bc7d88f13ae6e51415c1e663e685fcbe77164eb2be78b08893d9b299bf0","9b6e1a724771bd1fb7ea1a2551ed5b13b92d87aeaba331d520716e725d7b63a5","66c6888608b17316a09ede6335f5568748a24af4090990c9cf8050ac8b318c34","e89c865ca4785f4a56fbfe95b04df807ebf6d320b174b484f3a08d54321447a7","403e6bc805dc2cdcbb3f6bb38cf78bd70d4202ebe405178fd8dc917bf84dd124","fcf3b586398c415038922a229576ddc3c9ac81f17113f4564f860b90222fc463","e6a79d0cfe8e75f37a20cb36e05795fa8116c4510a4b3cfc3fa89a427f356b3c","6aee942b8a0c7c10cd2315315b0b88b85daf969ed761cda7d1c045badba8b058","2a113e6e70cb236e8f367e088f0470fe9155b04ea16ce315606095ea7f9a06c1","b505287deeb59270e8d172f30f625adf6e8394c16e68f1caeff1d933fb6a239a","f9bdf17d1b11f604f4c3db96f3ab31d1a5d0e81f95765ba3eaf60069b6892f49","d84043e3d658e5b2fd1351c18cefeeed153fa37c5828c234c2c343e89511ce34","8bfb061a2c3561bd22bdf252a4a32e504cd1cf1af601e377d51fc006104e927d","28bc1aaad7be71d47e0e278e97f43ab7b736e4f042a3c086a239543e7d0f9b24","71441b9d36fd4591e4606665559a533274dc04ebabfa841a45362ef273f2e8ce","2b7e1ab6757e4fed93a787ff649719bc13aaf8607e12c0b3c8c3e8c190d65680","6257c11ddda8274e26d5e46fb41272edddd4a8d6a9686ddd79c86b0f5484ba8f","5f442f7b5b287323065b77d9e991937bc10f974bfd65a0f36d2ccc10bb490a6c","e2467441777ecea9f274b465d652ac217fb76872b2403a2fd049929a57a9e15d","54f06de0591cca133a51d2004cb4d3f6370315e1e1dd6618280524fe91f8a01c","9dae069538bed39f3ffbe84975f1deac55843f229314982ee15a4b8ed4d9a98d","d9579c3abb9e4ed7d64b4619f2732191a1917989e63120156adcbfaff100b001","307e9aab91c66eefa68a2e9d82ba128a7faab0610aa317c93f51d717cd4ac6af","13babdca228d463f6932c6690ce95d18d437713e23ea5ef9a1df024ebf2d9e77","32ad60ecb714081eb9e5460bf65dc094e4862f43949b4e72bf7ce35ab58f2bfa","081dcd50db7b36e603affccae9b91d3430bf310a280faf82191ccd116a9811ad","db2f868f2997aca3c129ceb980fb5d0af2e3ce6a48a66b19f7b5dc2ae9521fa1","bc535bc597886d15f8d4c7e7b220fb6e99a57b409e220d1a9e54ba58fccc327d","a3cf1f77280fb2f30251c346c2e2ca0a09681af6e76d8ccbab158c3176242379",{"version":"d3cfde44f8089768ebb08098c96d01ca260b88bccf238d55eee93f1c620ff5a5","impliedFormat":1},{"version":"293eadad9dead44c6fd1db6de552663c33f215c55a1bfa2802a1bceed88ff0ec","impliedFormat":1},{"version":"833e92c058d033cde3f29a6c7603f517001d1ddd8020bc94d2067a3bc69b2a8e","impliedFormat":1},{"version":"08b2fae7b0f553ad9f79faec864b179fc58bc172e295a70943e8585dd85f600c","impliedFormat":1},{"version":"f12edf1672a94c578eca32216839604f1e1c16b40a1896198deabf99c882b340","impliedFormat":1},{"version":"e3498cf5e428e6c6b9e97bd88736f26d6cf147dedbfa5a8ad3ed8e05e059af8a","impliedFormat":1},{"version":"dba3f34531fd9b1b6e072928b6f885aa4d28dd6789cbd0e93563d43f4b62da53","impliedFormat":1},{"version":"f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","impliedFormat":1},{"version":"e4b03ddcf8563b1c0aee782a185286ed85a255ce8a30df8453aade2188bbc904","impliedFormat":1},{"version":"2329d90062487e1eaca87b5e06abcbbeeecf80a82f65f949fd332cfcf824b87b","impliedFormat":1},{"version":"25b3f581e12ede11e5739f57a86e8668fbc0124f6649506def306cad2c59d262","impliedFormat":1},{"version":"4fdb529707247a1a917a4626bfb6a293d52cd8ee57ccf03830ec91d39d606d6d","impliedFormat":1},{"version":"a9ebb67d6bbead6044b43714b50dcb77b8f7541ffe803046fdec1714c1eba206","impliedFormat":1},{"version":"5780b706cece027f0d4444fbb4e1af62dc51e19da7c3d3719f67b22b033859b9","impliedFormat":1},"fabffe8163cb796911400ca0c9b16eb5254365df1327053a47f0b61606f91556","43c88c7da4f2fa63d6c384389d800eec434c87634631234e6689f9e1b66286c7","b8a77950ffef9eeba0134b6eb0d66d9b29b50631c9ed83926cfc68c60b4dacc6","7db2302e2dc9d8e8946f1f3f1c95e102842074c5fd630bc1d22d57c2c5c1e2ac","1217640af9bd12e58da3db7936121c85b3f2427bd6d234907954d9fc61b09166","fafa8a0cab8927c5d19b2f38e0f32c3427e7ea5468c5dc252ddcec3c085abc18",{"version":"5efb25c27699788ecd1cfb869f4160a8a78870c258dca09c2e7c42bb5d86fe91","signature":"edfe40d17205314c61a11b23cf79ef166ef1b1c88d7b342e645dc7f10595d994"},{"version":"0e3330f89c59159ccee5f53112009299b63b7baa3804421c0b93df115ee0d02f","signature":"f3a16dc65ad57ce74b7ce56b4ee297672017bccec4a6db388b483d6c8b6d2ee3"},{"version":"a4969adebd3c9a319bb017c1072b1652afeeac11a3265f62115de89b1f9d8c8a","signature":"9ec0678834ae84628e4d2868d9f27517be255e97a8440d15311d35d6871f7b80"},{"version":"62d0b0f2f5045e98f35ac8764ef088ef481750564e7bbcbb6aff7b610f070e74","signature":"048783bd57dfb62563915c9075e3629a874f3bcf951077d3ffd6ef106f4b789c"},{"version":"5cd182c3f6e9fcdd346061fa13b602c2aa789cdb59525c6d295b7e12dd68d213","signature":"f166f5087487a412730ce682a8c55a449a664834631e69adc6055de668cb8fa8"},{"version":"ba172e9fc9794478318f297112a1199ab1af2bd78273e6cf48f5707c92eea844","signature":"8c1c0a87cda7f4002ea5defaa3aae73f02eb2ad466f8fd9115d9ed7ec75b9970"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"73b5fa37db36eeac90c4d752e39586f1b57187400c4f5280fd05f16437287a45","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"3727b9f1e2582a26c99d29ed1caf6d72cf19d178c39316b8446c086c45debcff","affectsGlobalScope":true,"impliedFormat":1},{"version":"771280ed7ee2d7a86ddc7a8cc6133409b4f51299356aeca920cc1f6560898185","impliedFormat":1}],"root":[[151,156]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":false,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[208,1],[209,1],[210,2],[162,3],[211,4],[212,5],[213,6],[157,7],[160,8],[158,7],[159,7],[214,9],[215,10],[216,11],[217,12],[218,13],[219,14],[220,14],[221,15],[222,16],[223,17],[224,18],[163,7],[161,7],[225,19],[226,20],[227,21],[261,22],[228,23],[229,7],[230,24],[231,25],[232,26],[233,27],[234,28],[235,29],[236,30],[237,31],[238,32],[239,32],[240,33],[241,7],[242,34],[243,35],[245,36],[244,37],[246,38],[247,39],[248,40],[249,41],[250,42],[251,43],[252,44],[253,45],[254,46],[255,47],[256,48],[257,49],[258,50],[164,7],[165,7],[166,7],[205,51],[206,7],[207,7],[259,52],[260,53],[262,54],[263,55],[167,7],[70,7],[71,7],[68,56],[72,57],[69,56],[67,7],[56,7],[57,7],[11,7],[10,7],[2,7],[12,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[3,7],[20,7],[21,7],[4,7],[22,7],[26,7],[23,7],[24,7],[25,7],[27,7],[28,7],[29,7],[5,7],[30,7],[31,7],[32,7],[33,7],[6,7],[37,7],[34,7],[35,7],[36,7],[38,7],[7,7],[39,7],[44,7],[45,7],[40,7],[41,7],[42,7],[43,7],[8,7],[49,7],[46,7],[47,7],[48,7],[50,7],[9,7],[51,7],[52,7],[53,7],[55,7],[54,7],[1,7],[183,58],[193,59],[182,58],[203,60],[174,61],[173,62],[202,54],[196,63],[201,64],[176,65],[190,66],[175,67],[199,68],[171,69],[170,54],[200,70],[172,71],[177,72],[178,7],[181,72],[168,7],[204,73],[194,74],[185,75],[186,76],[188,77],[184,78],[187,79],[197,54],[179,80],[180,81],[189,82],[169,83],[192,74],[191,72],[195,7],[198,84],[144,85],[136,86],[143,87],[138,7],[139,7],[137,88],[140,89],[131,7],[132,7],[133,85],[135,90],[141,7],[142,91],[134,92],[153,93],[155,94],[156,95],[151,96],[154,7],[152,97],[130,98],[129,99],[128,99],[117,7],[112,7],[122,100],[109,101],[108,102],[110,103],[111,104],[123,105],[119,106],[106,96],[104,7],[118,102],[102,96],[107,107],[116,101],[105,102],[103,104],[115,108],[114,109],[113,108],[121,96],[120,102],[127,110],[125,7],[126,111],[124,112],[92,113],[86,114],[89,115],[76,96],[66,7],[100,116],[98,117],[75,96],[82,118],[73,119],[96,120],[95,96],[77,96],[97,121],[101,122],[78,123],[94,124],[93,125],[83,126],[88,121],[80,127],[91,128],[84,121],[81,129],[74,130],[87,117],[90,96],[65,96],[85,7],[99,116],[79,96],[147,101],[149,102],[150,131],[148,7],[145,132],[146,133],[59,7],[61,7],[63,134],[62,7],[64,135],[60,7],[58,7]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
@@ -0,0 +1,15 @@
1
+ import type { Scene } from "@oh-just-another/scene";
2
+ import type { ExportPdfOptions } from "./options.js";
3
+ /**
4
+ * Render a `Scene` (or JSON document) to a PDF `Uint8Array`. Vector pipeline:
5
+ * scene → SVG (via `renderToSvg`) → embedded into a PDF page via `pdfkit` +
6
+ * `svg-to-pdfkit`.
7
+ *
8
+ * Page size defaults to A4; the rendered SVG is fitted into the page's
9
+ * content area (with `margin` applied), preserving aspect ratio.
10
+ *
11
+ * Requires the optional peer dependencies `pdfkit` and `svg-to-pdfkit` —
12
+ * throws a helpful error if either is missing.
13
+ */
14
+ export declare const exportPdf: (scene: Scene | string, options?: ExportPdfOptions) => Promise<Uint8Array>;
15
+ //# sourceMappingURL=export-pdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-pdf.d.ts","sourceRoot":"","sources":["../src/export-pdf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAoBlE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GACpB,OAAO,KAAK,GAAG,MAAM,EACrB,UAAS,gBAAqB,KAC7B,OAAO,CAAC,UAAU,CAqEpB,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { renderToSvg } from "@oh-just-another/headless";
2
+ import { resolveScene, sceneForFrame, sceneForRegion } from "./region.js";
3
+ /**
4
+ * Render a `Scene` (or JSON document) to a PDF `Uint8Array`. Vector pipeline:
5
+ * scene → SVG (via `renderToSvg`) → embedded into a PDF page via `pdfkit` +
6
+ * `svg-to-pdfkit`.
7
+ *
8
+ * Page size defaults to A4; the rendered SVG is fitted into the page's
9
+ * content area (with `margin` applied), preserving aspect ratio.
10
+ *
11
+ * Requires the optional peer dependencies `pdfkit` and `svg-to-pdfkit` —
12
+ * throws a helpful error if either is missing.
13
+ */
14
+ export const exportPdf = async (scene, options = {}) => {
15
+ const { PDFDocument, svgToPdfKit } = await loadPdfDeps();
16
+ const resolved = resolveScene(scene);
17
+ const cropped = options.frameId
18
+ ? sceneForFrame(resolved, options.frameId) ?? sceneForRegion(resolved, options.region)
19
+ : sceneForRegion(resolved, options.region);
20
+ const svgWidth = options.width ?? cropped.viewport.size.width;
21
+ const svgHeight = options.height ?? cropped.viewport.size.height;
22
+ const svg = renderToSvg(cropped, { width: svgWidth, height: svgHeight });
23
+ const margin = options.margin ?? 36;
24
+ const pageSize = options.pageSize ?? "A4";
25
+ const orientation = options.orientation ?? "portrait";
26
+ const doc = new PDFDocument({
27
+ size: typeof pageSize === "string" ? pageSize : [pageSize.width, pageSize.height],
28
+ layout: orientation,
29
+ margin,
30
+ info: stripUndefined({
31
+ Title: options.title,
32
+ Author: options.author,
33
+ Subject: options.subject,
34
+ }),
35
+ });
36
+ // Paint a filled rect under the SVG so the page isn't see-through.
37
+ // PDFKit doesn't expose page width/height directly via `doc.page` typings, so
38
+ // we recompute from the requested size.
39
+ const [pageWidth, pageHeight] = pageDimensions(pageSize, orientation);
40
+ if (options.background !== undefined) {
41
+ const anyDoc = doc;
42
+ anyDoc.rect(0, 0, pageWidth, pageHeight).fill(options.background);
43
+ }
44
+ const contentWidth = pageWidth - 2 * margin;
45
+ const contentHeight = pageHeight - 2 * margin;
46
+ const scaleFactor = Math.min(contentWidth / svgWidth, contentHeight / svgHeight);
47
+ const renderedWidth = svgWidth * scaleFactor;
48
+ const renderedHeight = svgHeight * scaleFactor;
49
+ const offsetX = margin + (contentWidth - renderedWidth) / 2;
50
+ const offsetY = margin + (contentHeight - renderedHeight) / 2;
51
+ svgToPdfKit(doc, svg, offsetX, offsetY, {
52
+ width: renderedWidth,
53
+ height: renderedHeight,
54
+ preserveAspectRatio: "xMidYMid meet",
55
+ });
56
+ // PDFKit pipes to a node `Writable`. Collect chunks into a buffer and
57
+ // resolve when the doc's `end` event fires.
58
+ const chunks = [];
59
+ const { Writable } = await import("node:stream");
60
+ const sink = new Writable({
61
+ write(chunk, _enc, cb) {
62
+ chunks.push(chunk);
63
+ cb();
64
+ },
65
+ });
66
+ return new Promise((resolve, reject) => {
67
+ sink.on("finish", () => { resolve(Buffer.concat(chunks)); });
68
+ sink.on("error", (err) => { reject(err); });
69
+ doc.pipe(sink);
70
+ doc.end();
71
+ });
72
+ };
73
+ let pdfDepsPromise = null;
74
+ const loadPdfDeps = async () => {
75
+ if (pdfDepsPromise)
76
+ return pdfDepsPromise;
77
+ pdfDepsPromise = (async () => {
78
+ try {
79
+ const pdfkitSpec = "pdfkit";
80
+ const svgSpec = "svg-to-pdfkit";
81
+ const [pdfkit, svgToPdfKitModule] = (await Promise.all([
82
+ import(/* @vite-ignore */ pdfkitSpec),
83
+ import(/* @vite-ignore */ svgSpec),
84
+ ]));
85
+ const PDFDocument = pdfkit.default;
86
+ const svgToPdfKit = svgToPdfKitModule.default;
87
+ if (typeof PDFDocument !== "function" || typeof svgToPdfKit !== "function") {
88
+ throw new Error("loaded modules do not expose the expected default exports");
89
+ }
90
+ return { PDFDocument, svgToPdfKit };
91
+ }
92
+ catch (err) {
93
+ throw new Error("@oh-just-another/exporter: PDF rendering requires optional peer deps " +
94
+ "'pdfkit' and 'svg-to-pdfkit'. Install them with " +
95
+ "`pnpm add pdfkit svg-to-pdfkit`.\n" +
96
+ `Underlying error: ${err instanceof Error ? err.message : String(err)}`);
97
+ }
98
+ })();
99
+ return pdfDepsPromise;
100
+ };
101
+ // PDFKit sizes in points (72 / inch).
102
+ const STANDARD_SIZES = {
103
+ A4: [595.28, 841.89],
104
+ A5: [419.53, 595.28],
105
+ Letter: [612, 792],
106
+ Legal: [612, 1008],
107
+ Tabloid: [792, 1224],
108
+ };
109
+ const pageDimensions = (size, orientation) => {
110
+ const base = typeof size === "string"
111
+ ? (STANDARD_SIZES[size] ?? STANDARD_SIZES.A4 ?? [595.28, 841.89])
112
+ : [size.width, size.height];
113
+ const [w, h] = base;
114
+ return orientation === "landscape" ? [h, w] : [w, h];
115
+ };
116
+ const stripUndefined = (obj) => {
117
+ const out = {};
118
+ for (const [k, v] of Object.entries(obj))
119
+ if (v !== undefined)
120
+ out[k] = v;
121
+ return out;
122
+ };
123
+ //# sourceMappingURL=export-pdf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-pdf.js","sourceRoot":"","sources":["../src/export-pdf.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAqB1E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,KAAqB,EACrB,UAA4B,EAAE,EACT,EAAE;IACvB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,WAAW,EAAE,CAAC;IAEzD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO;QAC7B,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;QACtF,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;IACjE,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ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IAClB,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;IAClB,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,cAAc,GAAG,CACrB,IAAiB,EACjB,WAAqC,EACnB,EAAE;IACpB,MAAM,IAAI,GACR,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IACpB,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAoC,GAAM,EAAK,EAAE;IACtE,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,IAAI,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1E,OAAO,GAAQ,CAAC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Scene } from "@oh-just-another/scene";
2
+ import type { ExportPngOptions } from "./options.js";
3
+ /**
4
+ * Render a `Scene` (or JSON document) to a PNG `Uint8Array` with optional
5
+ * crop region, scale and DPI metadata. Wraps `renderToPng` and adds
6
+ * world-coordinate cropping and physical-pixel metadata.
7
+ *
8
+ * `scale` and the optional `dpi` are independent: `scale` controls the
9
+ * actual pixel dimensions; `dpi` only writes a `pHYs` chunk so document
10
+ * viewers know how big to print the image.
11
+ */
12
+ export declare const exportPng: (scene: Scene | string, options?: ExportPngOptions) => Promise<Uint8Array>;
13
+ //# sourceMappingURL=export-png.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-png.d.ts","sourceRoot":"","sources":["../src/export-png.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAIpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GACpB,OAAO,KAAK,GAAG,MAAM,EACrB,UAAS,gBAAqB,KAC7B,OAAO,CAAC,UAAU,CAoBpB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { renderToPng } from "@oh-just-another/headless";
2
+ import { resolveScene, sceneForFrame, sceneForRegion } from "./region.js";
3
+ import { setPngDpi } from "./png-dpi.js";
4
+ /**
5
+ * Render a `Scene` (or JSON document) to a PNG `Uint8Array` with optional
6
+ * crop region, scale and DPI metadata. Wraps `renderToPng` and adds
7
+ * world-coordinate cropping and physical-pixel metadata.
8
+ *
9
+ * `scale` and the optional `dpi` are independent: `scale` controls the
10
+ * actual pixel dimensions; `dpi` only writes a `pHYs` chunk so document
11
+ * viewers know how big to print the image.
12
+ */
13
+ export const exportPng = async (scene, options = {}) => {
14
+ const resolved = resolveScene(scene);
15
+ const cropped = options.frameId
16
+ ? sceneForFrame(resolved, options.frameId) ?? sceneForRegion(resolved, options.region)
17
+ : sceneForRegion(resolved, options.region);
18
+ const renderOpts = {};
19
+ if (options.width !== undefined)
20
+ renderOpts.width = options.width;
21
+ if (options.height !== undefined)
22
+ renderOpts.height = options.height;
23
+ if (options.scale !== undefined)
24
+ renderOpts.scale = options.scale;
25
+ if (options.background !== undefined)
26
+ renderOpts.background = options.background;
27
+ let png = await renderToPng(cropped, renderOpts);
28
+ if (options.dpi !== undefined)
29
+ png = setPngDpi(png, options.dpi);
30
+ return png;
31
+ };
32
+ //# s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AAS,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { exportPng } from "./export-png.js";
2
+ export { exportPdf } from "./export-pdf.js";
3
+ export { setPngDpi } from "./png-dpi.js";
4
+ export { sceneForFrame, sceneForRegion } from "./region.js";
5
+ export type { BaseExportOptions, ExportRegion, ExportPngOptions, ExportPdfOptions, PdfPageSize, PdfOrientation, } from "./options.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { exportPng } from "./export-png.js";
2
+ export { exportPdf } from "./export-pdf.js";
3
+ export { setPngDpi } from "./png-dpi.js";
4
+ export { sceneForFrame, sceneForRegion } from "./region.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,65 @@
1
+ import type { Bounds, ElementId } from "@oh-just-another/types";
2
+ /**
3
+ * Rectangle in scene-world coordinates to clip the exported image to.
4
+ * The output canvas is sized to match `region.width × region.height`
5
+ * (multiplied by `scale` / `dpi`).
6
+ */
7
+ export type ExportRegion = Bounds;
8
+ /**
9
+ * Format-agnostic export options. Concrete `exportPng` / `exportPdf` extend
10
+ * this with their own knobs.
11
+ */
12
+ export interface BaseExportOptions {
13
+ /**
14
+ * Crop rectangle in world coordinates. Defaults to the scene's
15
+ * `viewport.size` (the full visible area at zoom = 1). Conflicts with
16
+ * `frameId` — when both are supplied, `frameId` wins.
17
+ */
18
+ readonly region?: ExportRegion;
19
+ /**
20
+ * Export only the content of a specific frame. The exporter looks up
21
+ * the frame by id, uses its world bounds as the crop region, and
22
+ * renders only shapes whose `frameId` matches.
23
+ */
24
+ readonly frameId?: ElementId;
25
+ /**
26
+ * Output width override in CSS pixels. Defaults to `region.width` (or the
27
+ * scene viewport width).
28
+ */
29
+ readonly width?: number;
30
+ /** Output height override in CSS pixels. Defaults similar to `width`. */
31
+ readonly height?: number;
32
+ /** Background colour painted under the scene. Default: white. */
33
+ readonly background?: string;
34
+ }
35
+ export interface ExportPngOptions extends BaseExportOptions {
36
+ /**
37
+ * Device-pixel multiplier. `2` ⇒ retina quality. Overrides any `width` /
38
+ * `height`. Default: 1.
39
+ */
40
+ readonly scale?: number;
41
+ /**
42
+ * Print-quality DPI. Embeds a `pHYs` chunk into the PNG so apps that read
43
+ * physical dimensions (Word, InDesign, browsers' print) reflow correctly.
44
+ * Default: omitted (96 DPI implied — screen resolution).
45
+ */
46
+ readonly dpi?: number;
47
+ }
48
+ export type PdfPageSize = "A4" | "A5" | "Letter" | "Legal" | "Tabloid" | {
49
+ width: number;
50
+ height: number;
51
+ };
52
+ export type PdfOrientation = "portrait" | "landscape";
53
+ export interface ExportPdfOptions extends BaseExportOptions {
54
+ /** PDF page size. Default: `"A4"`. */
55
+ readonly pageSize?: PdfPageSize;
56
+ /** Page orientation. Default: `"portrait"`. */
57
+ readonly orientation?: PdfOrientation;
58
+ /** Page margin in PDF points (1pt = 1/72in). Default: 36 (0.5in). */
59
+ readonly margin?: number;
60
+ /** PDF metadata. */
61
+ readonly title?: string;
62
+ readonly author?: string;
63
+ readonly subject?: string;
64
+ }
65
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GACnB,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,OAAO,GACP,SAAS,GACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;IACtC,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Insert (or replace) a `pHYs` chunk in a PNG byte stream so apps that read
3
+ * physical pixel dimensions (Word, InDesign, browsers' print preview) reflow
4
+ * the image at the requested DPI.
5
+ *
6
+ * Walks PNG chunks after the 8-byte signature, skips any existing `pHYs`,
7
+ * and inserts a freshly-computed `pHYs` immediately before the first `IDAT`.
8
+ * The CRC table is generated lazily; no third-party dependency.
9
+ */
10
+ export declare const setPngDpi: (png: Uint8Array, dpi: number) => Uint8Array;
11
+ //# sourceMappingURL=png-dpi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png-dpi.d.ts","sourceRoot":"","sources":["../src/png-dpi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,eAAO,MAAM,SAAS,GAAI,KAAK,UAAU,EAAE,KAAK,MAAM,KAAG,UAiCxD,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Insert (or replace) a `pHYs` chunk in a PNG byte stream so apps that read
3
+ * physical pixel dimensions (Word, InDesign, browsers' print preview) reflow
4
+ * the image at the requested DPI.
5
+ *
6
+ * Walks PNG chunks after the 8-byte signature, skips any existing `pHYs`,
7
+ * and inserts a freshly-computed `pHYs` immediately before the first `IDAT`.
8
+ * The CRC table is generated lazily; no third-party dependency.
9
+ */
10
+ const PNG_SIGNATURE = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
11
+ const PHYS = 0x70_48_59_73; // ASCII "pHYs"
12
+ const IDAT = 0x49_44_41_54; // ASCII "IDAT"
13
+ const METERS_PER_INCH = 39.3700787;
14
+ export const setPngDpi = (png, dpi) => {
15
+ if (!startsWith(png, PNG_SIGNATURE)) {
16
+ throw new Error("setPngDpi: input is not a PNG (signature mismatch)");
17
+ }
18
+ const ppm = Math.round(dpi * METERS_PER_INCH);
19
+ const newPhys = buildPhys(ppm);
20
+ const out = [PNG_SIGNATURE];
21
+ let offset = PNG_SIGNATURE.length;
22
+ let inserted = false;
23
+ while (offset < png.length) {
24
+ const len = readUint32(png, offset);
25
+ const type = readUint32(png, offset + 4);
26
+ const totalLen = 4 + 4 + len + 4; // length + type + data + crc
27
+ if (type === PHYS) {
28
+ // Drop existing pHYs; the freshly-built one replaces it.
29
+ offset += totalLen;
30
+ continue;
31
+ }
32
+ if (type === IDAT && !inserted) {
33
+ out.push(newPhys);
34
+ inserted = true;
35
+ }
36
+ out.push(png.subarray(offset, offset + totalLen));
37
+ offset += totalLen;
38
+ }
39
+ if (!inserted) {
40
+ // No IDAT found: malformed PNG, return original unchanged.
41
+ return png;
42
+ }
43
+ return concat(out);
44
+ };
45
+ // --- helpers ---
46
+ const startsWith = (a, b) => {
47
+ if (a.length < b.length)
48
+ return false;
49
+ for (let i = 0; i < b.length; i++)
50
+ if (a[i] !== b[i])
51
+ return false;
52
+ return true;
53
+ };
54
+ const readUint32 = (b, i) => ((b[i] ?? 0) << 24) | ((b[i + 1] ?? 0) << 16) | ((b[i + 2] ?? 0) << 8) | (b[i + 3] ?? 0);
55
+ const writeUint32 = (b, i, value) => {
56
+ b[i] = (value >>> 24) & 0xff;
57
+ b[i + 1] = (value >>> 16) & 0xff;
58
+ b[i + 2] = (value >>> 8) & 0xff;
59
+ b[i + 3] = value & 0xff;
60
+ };
61
+ const buildPhys = (ppm) => {
62
+ // pHYs payload = 4 (x ppm) + 4 (y ppm) + 1 (unit = 1 ≡ meters)
63
+ const data = new Uint8Array(9);
64
+ writeUint32(data, 0, ppm);
65
+ writeUint32(data, 4, ppm);
66
+ data[8] = 1;
67
+ // length (4) + type (4) + data (9) + crc (4) = 21
68
+ const chunk = new Uint8Array(21);
69
+ writeUint32(chunk, 0, 9);
70
+ // "pHYs"
71
+ chunk[4] = 0x70;
72
+ chunk[5] = 0x48;
73
+ chunk[6] = 0x59;
74
+ chunk[7] = 0x73;
75
+ chunk.set(data, 8);
76
+ const crc = crc32(chunk.subarray(4, 4 + 4 + 9));
77
+ writeUint32(chunk, 4 + 4 + 9, crc);
78
+ return chunk;
79
+ };
80
+ let CRC_TABLE = null;
81
+ const getCrcTable = () => {
82
+ if (CRC_TABLE)
83
+ return CRC_TABLE;
84
+ const table = new Uint32Array(256);
85
+ for (let n = 0; n < 256; n++) {
86
+ let c = n;
87
+ for (let k = 0; k < 8; k++) {
88
+ c = c & 1 ? 0xed_b8_83_20 ^ (c >>> 1) : c >>> 1;
89
+ }
90
+ table[n] = c;
91
+ }
92
+ CRC_TABLE = table;
93
+ return table;
94
+ };
95
+ const crc32 = (bytes) => {
96
+ const table = getCrcTable();
97
+ let c = 0xff_ff_ff_ff;
98
+ for (const byte of bytes)
99
+ c = (table[(c ^ byte) & 0xff] ?? 0) ^ (c >>> 8);
100
+ return (c ^ 0xff_ff_ff_ff) >>> 0;
101
+ };
102
+ const concat = (parts) => {
103
+ let total = 0;
104
+ for (const p of parts)
105
+ total += p.length;
106
+ const out = new Uint8Array(total);
107
+ let i = 0;
108
+ for (const p of parts) {
109
+ out.set(p, i);
110
+ i += p.length;
111
+ }
112
+ return out;
113
+ };
114
+ //# sourceMappingURL=png-dpi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png-dpi.js","source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AAE;IAC1D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACd,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { ElementId } from "@oh-just-another/types";
2
+ import { type Scene } from "@oh-just-another/scene";
3
+ import type { ExportRegion } from "./options.js";
4
+ /**
5
+ * Normalise a scene argument (object or JSON string) into a real `Scene`.
6
+ */
7
+ export declare const resolveScene: (scene: Scene | string) => Scene;
8
+ /**
9
+ * Apply a crop `region` to a scene's viewport, returning a new scene whose
10
+ * `viewport.pan` shifts world-coordinate `(region.x, region.y)` to the
11
+ * renderer's `(0, 0)` and whose `viewport.size` matches the crop, so the
12
+ * renderer produces an image clipped to the region.
13
+ *
14
+ * Returns the original scene if no region is supplied and the viewport
15
+ * already has a non-zero size.
16
+ */
17
+ export declare const sceneForRegion: (scene: Scene, region: ExportRegion | undefined) => Scene;
18
+ /**
19
+ * Clip the scene to shapes whose `frameId` matches the given id, and shift
20
+ * the viewport so the frame's world bbox lands at the renderer's origin.
21
+ * Returns `null` when the frame doesn't exist or isn't a `"frame"` shape,
22
+ * letting callers fall back to `sceneForRegion`.
23
+ *
24
+ * Layers, edges and annotations are retained unchanged (edges with one
25
+ * endpoint outside the frame are still rendered; the render-time
26
+ * `viewportWorld` cull drops the off-screen parts). Only shapes are filtered.
27
+ */
28
+ export declare const sceneForFrame: (scene: Scene, frameId: ElementId) => Scene | null;
29
+ //# sourceMappingURL=region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../src/region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAqC,KAAK,KAAK,EAAgB,MAAM,wBAAwB,CAAC;AAErG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,GAAG,MAAM,KAAG,KAEpD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,QAAQ,YAAY,GAAG,SAAS,KAAG,KAmB/E,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,EAAE,SAAS,SAAS,KAAG,KAAK,GAAG,IAqBxE,CAAC"}
package/dist/region.js ADDED
@@ -0,0 +1,103 @@
1
+ import { getElement, getElementWorldBounds } from "@oh-just-another/scene";
2
+ import { parseScene } from "@oh-just-another/serialization";
3
+ /**
4
+ * Normalise a scene argument (object or JSON string) into a real `Scene`.
5
+ */
6
+ export const resolveScene = (scene) => {
7
+ return typeof scene === "string" ? parseScene(scene) : scene;
8
+ };
9
+ /**
10
+ * Apply a crop `region` to a scene's viewport, returning a new scene whose
11
+ * `viewport.pan` shifts world-coordinate `(region.x, region.y)` to the
12
+ * renderer's `(0, 0)` and whose `viewport.size` matches the crop, so the
13
+ * renderer produces an image clipped to the region.
14
+ *
15
+ * Returns the original scene if no region is supplied and the viewport
16
+ * already has a non-zero size.
17
+ */
18
+ export const sceneForRegion = (scene, region) => {
19
+ if (!region) {
20
+ // No crop: keep the scene if it has a meaningful viewport size,
21
+ // otherwise infer one from shape bounds (whole-scene export).
22
+ if (scene.viewport.size.width > 0 && scene.viewport.size.height > 0)
23
+ return scene;
24
+ const inferred = inferSceneSize(scene);
25
+ return {
26
+ ...scene,
27
+ viewport: { ...scene.viewport, size: inferred },
28
+ };
29
+ }
30
+ return {
31
+ ...scene,
32
+ viewport: {
33
+ ...scene.viewport,
34
+ pan: { x: -region.x, y: -region.y },
35
+ size: { width: region.width, height: region.height },
36
+ },
37
+ };
38
+ };
39
+ /**
40
+ * Clip the scene to shapes whose `frameId` matches the given id, and shift
41
+ * the viewport so the frame's world bbox lands at the renderer's origin.
42
+ * Returns `null` when the frame doesn't exist or isn't a `"frame"` shape,
43
+ * letting callers fall back to `sceneForRegion`.
44
+ *
45
+ * Layers, edges and annotations are retained unchanged (edges with one
46
+ * endpoint outside the frame are still rendered; the render-time
47
+ * `viewportWorld` cull drops the off-screen parts). Only shapes are filtered.
48
+ */
49
+ export const sceneForFrame = (scene, frameId) => {
50
+ const frame = getElement(scene, frameId);
51
+ if (frame?.type !== "frame")
52
+ return null;
53
+ const bounds = getElementWorldBounds(frame);
54
+ const elements = new Map();
55
+ for (const s of scene.elements.values()) {
56
+ if (s.id === frameId)
57
+ continue;
58
+ if (s.frameId !== frameId)
59
+ continue;
60
+ elements.set(s.id, s);
61
+ }
62
+ return {
63
+ ...scene,
64
+ elements,
65
+ viewport: {
66
+ ...scene.viewport,
67
+ pan: { x: -bounds.x, y: -bounds.y },
68
+ size: { width: bounds.width, height: bounds.height },
69
+ },
70
+ };
71
+ };
72
+ /**
73
+ * Fallback when the scene has no explicit viewport size: union of every
74
+ * shape's `position` plus a small margin. Empty scenes fall back to
75
+ * 800 × 600 so callers always get a non-degenerate image.
76
+ */
77
+ const inferSceneSize = (scene) => {
78
+ if (scene.elements.size === 0)
79
+ return { width: 800, height: 600 };
80
+ let minX = Infinity;
81
+ let minY = Infinity;
82
+ let maxX = -Infinity;
83
+ let maxY = -Infinity;
84
+ for (const shape of scene.elements.values()) {
85
+ const x = shape.position.x;
86
+ const y = shape.position.y;
87
+ if (x < minX)
88
+ minX = x;
89
+ if (y < minY)
90
+ minY = y;
91
+ // Shape bounds aren't available without a bounder registry; estimate
92
+ // 100 px on each axis as a coarse guard.
93
+ if (x + 100 > maxX)
94
+ maxX = x + 100;
95
+ if (y + 100 > maxY)
96
+ maxY = y + 100;
97
+ }
98
+ return {
99
+ width: Math.max(100, Math.ceil(maxX - Math.min(0, minX))),
100
+ height: Math.max(100, Math.ceil(maxY - Math.min(0, minY))),
101
+ };
102
+ };
103
+ //# sourceMappingURL=region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"region.js","sourceRoot":"","sources":["../src/region.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAA4B,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAqB,EAAS,EAAE;IAC3D,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,MAAgC,EAAS,EAAE;IACtF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,gEAAgE;QAChE,8DAA8D;QAC9D,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAClF,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO;YACL,GAAG,KAAK;YACR,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;SAChD,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,KAAK;QACR,QAAQ,EAAE;YACR,GAAG,KAAK,CAAC,QAAQ;YACjB,GAAG,EAAE,EAAE,C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",
4
+ "description": "Hi-res image and PDF export for @oh-just-another/scene documents.",
5
+ "license": "MIT",
6
+ "author": "Rustam Garifulin <rustam@n69.in>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/oh-just-another/diagram.git",
10
+ "directory": "packages/exporter"
11
+ },
12
+ "homepage": "https://github.com/oh-just-another/diagram#readme",
13
+ "bugs": "https://github.com/oh-just-another/diagram/issues",
14
+ "keywords": [
15
+ "diagram",
16
+ "canvas",
17
+ "svg",
18
+ "editor",
19
+ "graph",
20
+ "drawing"
21
+ ],
22
+ "type": "module",
23
+ "main": "./dist/index.js",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "CHANGELOG.md"
36
+ ],
37
+ "sideEffects": false,
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "dependencies": {
42
+ "@oh-just-another/types": "0.57.0",
43
+ "@oh-just-another/serialization": "0.57.0",
44
+ "@oh-just-another/headless": "0.57.0",
45
+ "@oh-just-another/renderer-svg": "0.57.0",
46
+ "@oh-just-another/scene": "0.57.0"
47
+ },
48
+ "peerDependencies": {
49
+ "@resvg/resvg-js": "^2.6.0",
50
+ "pdfkit": "^0.15.0",
51
+ "svg-to-pdfkit": "^0.1.8"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@resvg/resvg-js": {
55
+ "optional": true
56
+ },
57
+ "pdfkit": {
58
+ "optional": true
59
+ },
60
+ "svg-to-pdfkit": {
61
+ "optional": true
62
+ }
63
+ },
64
+ "devDependencies": {
65
+ "@resvg/resvg-js": "^2.6.0",
66
+ "pdfkit": "^0.15.0",
67
+ "svg-to-pdfkit": "^0.1.8",
68
+ "@types/pdfkit": "^0.13.0",
69
+ "@types/svg-to-pdfkit": "^0.1.4"
70
+ },
71
+ "scripts": {
72
+ "build": "tsc -b tsconfig.build.json",
73
+ "typecheck": "tsc --noEmit",
74
+ "test": "vitest run",
75
+ "test:watch": "vitest",
76
+ "lint": "eslint src tests",
77
+ "clean": "rm -rf dist *.tsbuildinfo"
78
+ }
79
+ }