allyhub 0.6.0 → 0.7.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/dist/audio-text.js +1 -1
- package/dist/commands/add.js +2 -2
- package/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/dev.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/render.js +1 -1
- package/dist/commands/sheet.js +5 -5
- package/dist/commands/site.js +3 -2
- package/dist/commands/skills.js +3 -3
- package/dist/commands/slides.js +2 -2
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
- package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
- package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
- package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
- package/dist/node_modules/@allyhub-next/build/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
- package/dist/node_modules/@allyhub-next/check/package.json +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
- package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
- package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
- package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/export/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +69 -18
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +847 -116
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +501 -38
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
- package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
- package/dist/node_modules/@allyhub-next/media/package.json +1 -1
- package/dist/node_modules/@allyhub-next/model/package.json +1 -1
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
- package/dist/node_modules/@allyhub-next/project/package.json +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +79 -5
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
- package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
- package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
- package/dist/node_modules/@allyhub-next/render/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
- package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
- package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +42 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +59 -39
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +27 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +179 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +2 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +21 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
- package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
- package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
- package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
- package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
- package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
- package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
- package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
- package/dist/node_modules/@allyhub-next/website/package.json +13 -0
- package/dist/text/facts-text.js +4 -4
- package/dist/works.js +1 -1
- package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
- package/editor-web/assets/dist-0emakyZE.js +36 -0
- package/editor-web/assets/dist-B3UoDUa5.js +37 -0
- package/editor-web/assets/dist-B6KzR3pN.js +10 -0
- package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
- package/editor-web/assets/dist-CTQIm8Im.js +10 -0
- package/editor-web/assets/dist-CiHNHwyq.js +2 -0
- package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
- package/editor-web/assets/index-CFt3ovRY.js +69 -0
- package/editor-web/assets/index-ujKjdu_s.css +2 -0
- package/editor-web/assets/minus-BhoPZC5P.js +1 -0
- package/editor-web/assets/react-C_-rEEBU.js +101 -0
- package/editor-web/assets/tabs-Den4gHrU.js +105 -0
- package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
- package/editor-web/index.html +5 -5
- package/package.json +8 -14
- package/dist/astro.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
- package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
- package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
- package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
- package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
- package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
- package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
- package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
- package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
- package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
- package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
- package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
- package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
- package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
- package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
- package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
- package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
- package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
- package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
- package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
- package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
- package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
- package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
- package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -178
- package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
- package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
- package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
- package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
- package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
- package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
- package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
- package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
- package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
- package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
- package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
- package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
- package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
- package/dist/node_modules/@allyhub-next/site/package.json +0 -25
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
- package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
- package/dist/site.d.ts +0 -2
- package/editor-web/assets/dist-BW2s9FMO.js +0 -4
- package/editor-web/assets/dist-C-6JmebI.js +0 -233
- package/editor-web/assets/dist-CCYMLMKN.js +0 -6
- package/editor-web/assets/dist-CHzurjMx.js +0 -33
- package/editor-web/assets/dist-DF7H1dxw.js +0 -1
- package/editor-web/assets/dist-Da5AUSKX.js +0 -2
- package/editor-web/assets/index-B7S9RZhL.css +0 -2
- package/editor-web/assets/index-CovQYWvD.js +0 -69
- package/editor-web/assets/minus-BrvjaJyO.js +0 -1
- package/editor-web/assets/react-DV5fPdiH.js +0 -101
- package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
- package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
- package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
- /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ZipLimits } from "@allyhub-next/formats";
|
|
2
|
-
import type { SheetConditional, SheetFilterColumn, SheetValidation } from "@allyhub-next/formats";
|
|
2
|
+
import type { SheetConditional, SheetFilterColumn, SheetHeaderFooter, SheetPrint, SheetValidation } from "@allyhub-next/formats";
|
|
3
3
|
import { type Area, type Place } from "../address.js";
|
|
4
4
|
import type { Node } from "../formula/ast.js";
|
|
5
5
|
import { type Scalar } from "../values.js";
|
|
@@ -32,6 +32,8 @@ export interface ReadColumn {
|
|
|
32
32
|
width?: number;
|
|
33
33
|
hidden?: boolean;
|
|
34
34
|
style?: number;
|
|
35
|
+
/** Its outline level. */
|
|
36
|
+
level?: number;
|
|
35
37
|
}
|
|
36
38
|
export interface ReadRow {
|
|
37
39
|
row: number;
|
|
@@ -39,6 +41,8 @@ export interface ReadRow {
|
|
|
39
41
|
height?: number;
|
|
40
42
|
hidden?: boolean;
|
|
41
43
|
style?: number;
|
|
44
|
+
/** Its outline level. */
|
|
45
|
+
level?: number;
|
|
42
46
|
}
|
|
43
47
|
/** A filter's columns by their place in it, and those that say what this cannot read. */
|
|
44
48
|
export interface ReadFilter {
|
|
@@ -59,6 +63,27 @@ export interface ReadTable {
|
|
|
59
63
|
/** Its filter buttons; nothing when it has none. */
|
|
60
64
|
filter?: ReadFilter;
|
|
61
65
|
}
|
|
66
|
+
/** A Note on a cell. */
|
|
67
|
+
export interface ReadNote {
|
|
68
|
+
ref: string;
|
|
69
|
+
text: string;
|
|
70
|
+
author?: string;
|
|
71
|
+
}
|
|
72
|
+
/** A picture of a sheet's drawing, with its image. */
|
|
73
|
+
export interface ReadPicture {
|
|
74
|
+
row: number;
|
|
75
|
+
col: number;
|
|
76
|
+
x?: number;
|
|
77
|
+
y?: number;
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
name?: string;
|
|
81
|
+
/** Its description: the file it was, when AllyHub wrote it. */
|
|
82
|
+
descr?: string;
|
|
83
|
+
/** Its image, and the extension its part has. */
|
|
84
|
+
bytes: Uint8Array;
|
|
85
|
+
type: string;
|
|
86
|
+
}
|
|
62
87
|
export interface ReadSheet {
|
|
63
88
|
name: string;
|
|
64
89
|
state: "visible" | "hidden" | "veryHidden";
|
|
@@ -87,6 +112,14 @@ export interface ReadSheet {
|
|
|
87
112
|
value: string;
|
|
88
113
|
}[];
|
|
89
114
|
}[];
|
|
115
|
+
/** By address (a range for a link over several cells): an address on the web, or `#Sheet!A1`. */
|
|
116
|
+
links: Record<string, string>;
|
|
117
|
+
notes: ReadNote[];
|
|
118
|
+
pictures: ReadPicture[];
|
|
119
|
+
/** Protect Sheet is on. */
|
|
120
|
+
protect?: boolean;
|
|
121
|
+
/** Page Layout. */
|
|
122
|
+
print?: SheetPrint;
|
|
90
123
|
}
|
|
91
124
|
export interface ReadName {
|
|
92
125
|
name: string;
|
|
@@ -94,6 +127,8 @@ export interface ReadName {
|
|
|
94
127
|
text: string;
|
|
95
128
|
/** The sheet it belongs to, by its place; absent: the workbook. */
|
|
96
129
|
sheet?: number;
|
|
130
|
+
/** Excel's Name Manager does not list it. */
|
|
131
|
+
hidden?: boolean;
|
|
97
132
|
}
|
|
98
133
|
export interface ReadBook {
|
|
99
134
|
sheets: ReadSheet[];
|
|
@@ -108,11 +143,17 @@ export interface ReadBook {
|
|
|
108
143
|
name?: string;
|
|
109
144
|
size?: number;
|
|
110
145
|
};
|
|
146
|
+
/** Its title, from its document properties. */
|
|
147
|
+
title?: string;
|
|
111
148
|
/** What this model holds nothing of, a line each. */
|
|
112
149
|
lost: string[];
|
|
113
150
|
}
|
|
114
151
|
/** Places as a line: the first few and how many more. */
|
|
115
152
|
export declare function placesLine(places: readonly string[]): string;
|
|
153
|
+
/** Where Excel's grid ends, as an error says it. */
|
|
154
|
+
export declare const GRID_END: string;
|
|
155
|
+
/** Excel's header or footer codes as its three parts: &L, &C, &R; what comes before any is the centre's. */
|
|
156
|
+
export declare function readHeaderFooter(text: string): SheetHeaderFooter;
|
|
116
157
|
/** What a .xlsx, .xlsm or .xltx file holds. */
|
|
117
158
|
export declare function readXlsx(bytes: Uint8Array, zip?: Partial<ZipLimits>): ReadBook;
|
|
118
159
|
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{strFromU8 as ie,unzipSync as ae}from"fflate";import{withinZip as le,ZipLimitError as ce}from"@allyhub-next/formats";import{SHEET_ICONS as de,SHEET_OPERATORS as ue,SHEET_VALIDATIONS as fe}from"@allyhub-next/formats";import{cellName as J,readAddress as K,readArea as H,readAreas as Q}from"../address.js";import{SHEET_CHART_DEFAULTS as Y}from"../chart.js";import{moveFormula as me,relativeKey as he}from"../formula/move.js";import{printFormula as ee}from"../formula/print.js";import{ERR as pe,errorOf as be,serialOfDate as ge}from"../values.js";import{OFFICE_THEME as xe,colorOf as A,paletteOf as te,themeColors as ye}from"./colors.js";import{chartAnchors as we,readChart as ve}from"./charts.js";import{readFileFormula as B}from"./formula.js";import{BUILTIN_FORMATS as ke}from"./numfmt.js";import{attr as d,flag as v,numberAttr as y,readXml as $e,readXstring as L,tag as l,tags as b,textOf as C}from"./xml.js";const ne=7,Se=n=>Math.floor((256*n+Math.floor(128/ne))/256*ne),Te=n=>Math.round(n*4/3),W=5;export function placesLine(n){const e=n.slice(0,W).join(", ");return n.length>W?`${e} and ${String(n.length-W)} more`:e}const _=(n,e,t=`${e}s`)=>`${String(n)} ${n===1?e:t}`;class Ee{parts;names;constructor(e,t){this.parts=ae(e,{filter:le(t)}),this.names=Object.keys(this.parts)}has(e){return this.parts[e]!==void 0}text(e){const t=this.parts[e];return t?ie(t):void 0}xml(e){const t=this.text(e);return t===void 0?void 0:$e(t)}rels(e){const t=e.lastIndexOf("/"),o=`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`,r=this.xml(o);return b(l(r?.Relationships)?.Relationship).map(s=>{const i=d(s,"Type")??"",c=d(s,"Target")??"",a=d(s,"TargetMode")==="External";return{id:d(s,"Id")??"",type:i.slice(i.lastIndexOf("/")+1),target:a?c:Oe(e,c),external:a}})}count(e){return this.names.filter(t=>e.test(t)).length}}function Oe(n,e){if(e.startsWith("/"))return e.slice(1);const t=n.split("/").slice(0,-1);for(const o of e.split("/"))o===".."?t.pop():o!=="."&&t.push(o);return t.join("/")}function Ie(n,e){const t=e===void 0?void 0:n.xml(e);return b(l(t?.sst)?.si).map(o=>{const r=b(o.r);return r.length>0?{text:L(r.map(s=>C(s.t)).join("")),rich:!0}:{text:L(C(o.t)),rich:!1}})}function j(n,e){const t=n[e];if(t===void 0)return!1;const o=d(l(t),"val");return o===void 0||o!=="0"&&o!=="false"}const Ae=new Set(["double","singleAccounting","doubleAccounting"]);function Ce(n,e,t){const o={},r=(a,m)=>d(l(a?.[m]),"val");if(j(n,"b")&&(o.bold=!0),j(n,"i")&&(o.italic=!0),j(n,"strike")&&(o.strike=!0),j(n,"u")){const a=r(n,"u");o.underline=a!==void 0&&Ae.has(a)?a:!0}const s=r(n,"name");s!==void 0&&s!==r(e,"name")&&(o.font=s);const i=r(n,"sz");i!==void 0&&i!==r(e,"sz")&&(o.size=Number(i));const c=A(l(n.color),t);return c!==void 0&&c!==A(l(e?.color),t)&&(o.color=c),o}function Fe(n,e){const t=l(n.patternFill),o=d(t,"patternType");if(o===void 0||o==="none")return;const r=A(l(t?.fgColor),e),s=A(l(t?.bgColor),e);return o==="solid"&&r!==void 0?r:{pattern:o,...r===void 0?{}:{color:r},...s===void 0?{}:{background:s}}}function oe(n,e){const t={};for(const o of["left","right","top","bottom"]){const r=l(n[o]),s=d(r,"style");if(s===void 0||s==="none")continue;const i=A(l(r?.color),e);t[o]={style:s,...i===void 0?{}:{color:i}}}return Object.keys(t).length===0?void 0:t}function Le(n){const e={},t=d(n,"horizontal");t!==void 0&&t!=="general"&&(e.align=t);const o=d(n,"vertical");o!==void 0&&o!=="bottom"&&(e.valign=o),v(n,"wrapText")===!0&&(e.wrap=!0),v(n,"shrinkToFit")===!0&&(e.shrink=!0);const r=y(n,"indent");r!==void 0&&r>0&&(e.indent=r);const s=y(n,"textRotation");return s!==void 0&&s>0&&s<=180&&(e.rotation=s),e}function Re(n,e){const t={},o=l(n.font);if(o){const a=(f,u)=>{o[f]!==void 0&&(t[u]=j(o,f))};a("b","bold"),a("i","italic"),a("strike","strike"),o.u!==void 0&&(t.underline=j(o,"u"));const m=A(l(o.color),e);m!==void 0&&(t.color=m)}const r=l(l(n.fill)?.patternFill),s=A(l(r?.bgColor),e)??A(l(r?.fgColor),e);s!==void 0&&(t.fill=s);const i=l(n.border),c=i&&oe(i,e);return c!==void 0&&(t.border=c),t}function Ne(n,e){const t=l(n?.styleSheet),o=te(e,t),r=new Map(b(l(t?.numFmts)?.numFmt).map(h=>[y(h,"numFmtId")??-1,d(h,"formatCode")??"General"])),s=b(l(t?.fonts)?.font),i=b(l(t?.fills)?.fill),c=b(l(t?.borders)?.border),a=b(l(t?.cellXfs)?.xf),m=s[y(a[0],"fontId")??0],f=new Set;i.some(h=>h.gradientFill!==void 0)&&f.add("gradient fills");const u=a.map(h=>{const k={},$=s[y(h,"fontId")??0];$&&(Object.assign(k,Ce($,m,o)),$.vertAlign!==void 0&&f.add("superscript and subscript"));const T=i[y(h,"fillId")??0],I=T&&Fe(T,o);I!==void 0&&(k.fill=I);const F=c[y(h,"borderId")??0],O=F&&oe(F,o);O!==void 0&&(k.border=O),F&&d(l(F.diagonal),"style")!==void 0&&f.add("diagonal borders");const N=l(h.alignment);N&&(Object.assign(k,Le(N)),y(N,"textRotation")===255&&f.add("vertical text"));const w=y(h,"numFmtId")??0,S=r.get(w)??ke[w];return S!==void 0&&S!=="General"&&(k.format=S),k}),p=d(l(m?.name),"val"),x=d(l(m?.sz),"val");return{looks:u,dxfs:b(l(t?.dxfs)?.dxf).map(h=>Re(h,o)),font:{...p===void 0?{}:{name:p},...x===void 0?{}:{size:Number(x)}},lost:[...f]}}function re(n){const e=new Map;let t=0;for(const o of b(n.filterColumn)){const r=y(o,"colId")??0,s=l(o.filters);if(!s){Object.keys(o).some(c=>c!=="colId"&&c!=="hiddenButton")&&(t+=1);continue}if(s.dateGroupItem!==void 0){t+=1;continue}const i=b(s.filter).map(c=>L(d(c,"val")??""));e.set(r,{...i.length===0?{}:{values:i},...v(s,"blank")===!0?{blanks:!0}:{}})}return{columns:e,unread:t}}function je(n){const e=l(n?.table),t=H(d(e,"ref")??""),o=d(e,"displayName")??d(e,"name");if(!t||o===void 0)return;const r=l(e?.tableStyleInfo),s=l(e?.autoFilter);return{name:o,ref:t,headers:y(e,"headerRowCount")??1,totals:y(e,"totalsRowCount")??0,columns:b(l(e?.tableColumns)?.tableColumn).map(i=>({name:L(d(i,"name")??"").trim(),calculated:i.calculatedColumnFormula!==void 0})),style:d(r,"name")??"none",...s?{filter:re(s)}:{}}}function q(n){const e=n.trim();if(e==="")return;const t=/^"((?:[^"]|"")*)"$/u.exec(e);if(t)return(t[1]??"").replaceAll('""','"');const o=Number(e);if(!Number.isNaN(o))return o;const r=B(e,!0);return r.ok?ee(r.node):void 0}const se=n=>n!==void 0&&ue.includes(n);function U(n){const e=d(n,"type")??"num",t=d(n,"val"),o=t===void 0?void 0:q(t);return{at:e,...o===void 0?{}:{value:o}}}const Me=de;function De(n,e,t,o){const r=d(n,"type")??"",s={range:e,...v(n,"stopIfTrue")===!0?{stop:!0}:{}},i=y(n,"dxfId"),c=i===void 0?{}:t[i]??{},a={...c.bold===void 0?{}:{bold:c.bold},...c.italic===void 0?{}:{italic:c.italic},...c.underline===void 0?{}:{underline:c.underline!==!1},...c.strike===void 0?{}:{strike:c.strike},...c.color===void 0?{}:{color:c.color},...typeof c.fill=="string"?{fill:c.fill}:{},...c.border===void 0?{}:{border:c.border}},m=n.formula,f=(Array.isArray(m)?m:m===void 0?[]:[m]).map(C);switch(r){case"cellIs":{const u=d(n,"operator"),p=f.flatMap(x=>{const h=q(x);return h===void 0?[]:[h]});return!se(u)||p.length===0?`a cellIs rule of ${u??"no operator"}`:{...s,...a,type:"cellIs",operator:u,formula:p}}case"containsText":case"notContainsText":case"beginsWith":case"endsWith":{const u=d(n,"text");return u===void 0?`a ${r} rule with no text`:{...s,...a,type:"containsText",...r==="containsText"?{}:{operator:r==="notContainsText"?"notContains":r},text:L(u)}}case"duplicateValues":case"uniqueValues":return{...s,...a,type:r};case"top10":return{...s,...a,type:"top10",rank:y(n,"rank")??10,...v(n,"percent")===!0?{percent:!0}:{},...v(n,"bottom")===!0?{bottom:!0}:{}};case"aboveAverage":return{...s,...a,type:"aboveAverage",...v(n,"aboveAverage")===!1?{below:!0}:{},...v(n,"equalAverage")===!0?{equal:!0}:{}};case"expression":{const u=f[0]===void 0?void 0:B(f[0],!0);return u?.ok?{...s,...a,type:"expression",formula:ee(u.node)}:"an expression rule that cannot be read"}case"dataBar":{const u=l(n.dataBar),p=A(l(u?.color),o),[x,h]=b(u?.cfvo).map(U);return p===void 0?"a data bar with no colour":{...s,type:"dataBar",color:p,...x&&x.at!=="min"?{min:x}:{},...h&&h.at!=="max"?{max:h}:{},...v(u,"showValue")===!1?{show:!1}:{}}}case"colorScale":{const u=l(n.colorScale),p=b(u?.cfvo).map(U),x=b(u?.color).map(k=>A(k,o)),h=p.flatMap((k,$)=>{const T=x[$];return T===void 0?[]:[{...k,color:T}]});return h.length<2?"a colour scale with too few stops":{...s,type:"colorScale",stops:h.slice(0,3)}}case"iconSet":{const u=l(n.iconSet),p=d(u,"iconSet")??"3TrafficLights1";if(!Me.includes(p))return`the icon set ${p}`;const x=b(u?.cfvo).map(U);return{...s,type:"iconSet",icons:p,...x.length>=3?{stops:x.slice(0,5)}:{},...v(u,"reverse")===!0?{reverse:!0}:{},...v(u,"showValue")===!1?{show:!1}:{}}}default:return`a ${r} rule`}}function Ve(n,e,t){const o=[],r=[];for(const s of b(n.conditionalFormatting)){const i=d(s,"sqref")??"";if(!Q(i)){r.push(`a rule on ${i}`);continue}for(const c of b(s.cfRule)){const a=De(c,i,e,t);typeof a=="string"?r.push(`${a} on ${i}`):o.push({priority:y(c,"priority")??0,rule:a})}}return{rules:o.sort((s,i)=>s.priority-i.priority).map(s=>s.rule),unread:r}}const ze=fe;function He(n){const e=[],t=[];for(const o of b(l(n.dataValidations)?.dataValidation)){const r=d(o,"sqref")??"",s=d(o,"type")??"none";if(s==="none"&&d(o,"prompt")===void 0)continue;if(!ze.includes(s)||!Q(r)){t.push(`a ${s} rule on ${r}`);continue}const i=C(o.formula1),c=C(o.formula2),a=/^"((?:[^"]|"")*)"$/u.exec(i.trim()),m=s==="list"&&a?(a[1]??"").replaceAll('""','"').split(","):void 0,f=[i,c].flatMap(T=>{const I=q(T);return I===void 0?[]:[I]}),u=d(o,"operator"),p=T=>Object.fromEntries(Object.entries(T).filter(([,I])=>I!==void 0)),x=p({title:d(o,"promptTitle"),message:d(o,"prompt")}),h=p({style:d(o,"errorStyle"),title:d(o,"errorTitle"),message:d(o,"error")}),k=v(o,"showInputMessage")!==!0,$=v(o,"showErrorMessage")!==!0;e.push({range:r,type:s,...se(u)&&u!=="between"?{operator:u}:{},...m?{values:m}:{formula:f},...v(o,"allowBlank")===!0?{}:{blank:!1},...v(o,"showDropDown")===!0?{dropdown:!1}:{},...k||Object.keys(x).length>0?{prompt:{...x,...k?{show:!1}:{}}}:{},...$||Object.keys(h).length>0?{error:{...h,...$?{show:!1}:{}}}:{}})}return{rules:e,unread:t}}function X(n,e){const t=B(n,e);return t.ok?{node:t.node}:{unread:n}}class _e{cells=[];rich=[];masters=new Map;strings;constructor(e){this.strings=e}value(e,t){const o=d(e,"t")??"n",r=e.v;if(o==="inlineStr"){const i=l(e.is),c=b(i?.r);return c.length>0?{value:L(c.map(a=>C(a.t)).join("")),rich:!0}:{value:L(C(i?.t))}}if(r===void 0)return{value:void 0};const s=C(r);switch(o){case"s":{const i=this.strings[Number(s)];return i?{value:i.text,...i.rich?{rich:!0}:{}}:{value:""}}case"str":return{value:L(s)};case"b":return{value:s.trim()==="1"||s.trim()==="true"};case"e":return{value:be(s.trim())??pe.VALUE};case"d":{const i=new Date(s.trim());return{value:Number.isNaN(i.getTime())?s:ge(i)}}default:{if(s.trim()==="")return{value:void 0};const i=Number(s);if(Number.isNaN(i))throw new Error(`${t} says it holds a number and holds ${s}.`);return{value:i}}}}formula(e,t,o,r){const s=e.f;if(s===void 0)return;const i=l(s),c=d(i,"t")??"normal",a=C(s);if(c==="dataTable"){r.unread=`a data table's {=TABLE(${d(i,"r1")??""})}`;return}if(c==="array"){const m=e.cm!==void 0;Object.assign(r,X(a,!0));const f=H(d(i,"ref")??"");f&&(r.array=f),m&&(r.dynamic=!0);return}if(c==="shared"){const m=d(i,"si")??"";if(a!==""){const u=X(a,!1);this.masters.set(m,{node:u.node,unread:u.unread,row:t,col:o,key:u.node?he(u.node,t,o):"",dynamicArray:!1}),Object.assign(r,u),u.node&&(r.key=this.masters.get(m)?.key??"");return}const f=this.masters.get(m);if(!f){r.unread=`a shared formula of a group that has no first cell (${m})`;return}f.node?(r.node=me(f.node,t-f.row,o-f.col),r.key=f.key):f.unread!==void 0&&(r.unread=f.unread);return}a!==""&&Object.assign(r,X(a,!1))}readRows(e){let t=0;for(const o of e){const r=y(o,"r"),s=r===void 0?t:r-1;t=s+1;let i=0;for(const c of b(o.c)){const a=d(c,"r"),f=(a===void 0?void 0:K(a))?.col??i;i=f+1;const u=a??J({row:s,col:f}),{value:p,rich:x}=this.value(c,u),h={row:s,col:f,value:p,style:y(c,"s")??0};x===!0&&(h.rich=!0,this.rich.push(u)),this.formula(c,s,f,h),this.cells.push(h)}}}}function Pe(n,e,t){const o=[],r=a=>o.push(`${n}: ${a}`);t.length>0&&r(`${_(t.length,"cell")} of rich text, kept as plain text (${placesLine(t)})`);const s=b(l(e.hyperlinks)?.hyperlink);s.length>0&&r(`${_(s.length,"hyperlink")} (${placesLine(s.map(a=>d(a,"ref")??""))})`),e.sortState!==void 0&&r("a sort"),v(l(e.sheetProtection),"sheet")===!0&&r("protection"),e.protectedRanges!==void 0&&r("protected ranges"),e.headerFooter!==void 0&&C(e.headerFooter).trim()!==""&&r("its print header and footer"),l(e.headerFooter)?.oddHeader!==void 0&&r("its print header"),l(e.headerFooter)?.oddFooter!==void 0&&r("its print footer"),(e.rowBreaks!==void 0||e.colBreaks!==void 0)&&r("its page breaks"),e.oleObjects!==void 0&&r("embedded objects"),e.controls!==void 0&&r("form controls"),e.dataConsolidate!==void 0&&r("a consolidation"),e.customSheetViews!==void 0&&r("custom views"),b(l(e.sheetViews)?.sheetView).some(a=>d(l(a.pane),"state")==="split")&&r("a split, not frozen, window");const c=JSON.stringify(e.extLst??"");return c.includes("sparklineGroups")&&r("sparklines"),G(e.extLst)&&r("conditional formats of Excel 2010 and later"),c.includes("dataValidations")&&r("data validations of Excel 2010 and later"),c.includes("slicerList")&&r("slicers"),o}function G(n){if(typeof n!="object"||n===null)return!1;if(Array.isArray(n))return n.some(G);const e=n;return b(e.cfRule).some(t=>d(t,"type")!=="dataBar")&&e.cfRule!==void 0?!0:Object.values(e).some(G)}function Be(n){const e=[],t=(o,r,s)=>{const i=n.count(o);i>0&&e.push(_(i,r,s))};return n.has("xl/vbaProject.bin")&&e.push("VBA macros"),t(/^xl\/pivotTables\/pivotTable\d*\.xml$/u,"pivot table"),t(/^xl\/chartsheets\/[^/]+\.xml$/u,"chart sheet"),t(/^xl\/dialogsheets\/[^/]+\.xml$/u,"dialog sheet"),t(/^xl\/macrosheets\/[^/]+\.xml$/u,"macro sheet"),t(/^xl\/media\//u,"image"),t(/^xl\/embeddings\//u,"embedded object"),t(/^xl\/comments\d*\.xml$/u,"sheet's comments","sheets' comments"),t(/^xl\/threadedComments\//u,"sheet's threaded comments","sheets' threaded comments"),t(/^xl\/slicers\/[^/]+\.xml$/u,"slicer part"),t(/^xl\/timelines\/[^/]+\.xml$/u,"timeline part"),t(/^xl\/ctrlProps\/[^/]+\.xml$/u,"form control"),t(/^xl\/activeX\/[^/]+\.xml$/u,"ActiveX control"),t(/^xl\/queryTables\/[^/]+\.xml$/u,"query table"),n.has("xl/connections.xml")&&e.push("data connections"),n.names.some(o=>o.startsWith("xl/richData/"))&&e.push("rich values (data types, pictures in cells)"),n.names.some(o=>/^customXml\/item\d+\.xml$/u.test(o)&&(n.text(o)??"").includes("DataMashup"))&&e.push("Power Query queries"),e}function We(n,e,t,o,r,s,i){const c=n.xml(e),a=l(c?.worksheet);if(!a)throw new Error(`${e} is not a worksheet.`);const m=new _e(r);m.readRows(b(l(a.sheetData)?.row));const f=b(l(a.cols)?.col).map(g=>{const E=y(g,"width"),D=y(g,"style");return{min:(y(g,"min")??1)-1,max:(y(g,"max")??1)-1,...E===void 0||v(g,"customWidth")===!1?{}:{width:Se(E)},...v(g,"hidden")===!0?{hidden:!0}:{},...D===void 0||D===0?{}:{style:D}}}),u=[];let p=b(l(a.cols)?.col).some(g=>(y(g,"outlineLevel")??0)>0);b(l(a.sheetData)?.row).forEach((g,E)=>{const D=(y(g,"r")??E+1)-1;(y(g,"outlineLevel")??0)>0&&(p=!0);const Z=y(g,"ht"),P=y(g,"s"),V={row:D};Z!==void 0&&v(g,"customHeight")===!0&&(V.height=Te(Z)),v(g,"hidden")===!0&&(V.hidden=!0),P!==void 0&&P!==0&&v(g,"customFormat")===!0&&(V.style=P),Object.keys(V).length>1&&u.push(V)});const x=b(l(a.mergeCells)?.mergeCell).flatMap(g=>{const E=H(d(g,"ref")??"");return E?[E]:[]}),h=b(l(a.sheetViews)?.sheetView)[0],k=l(h?.pane);let $;const T=d(k,"state");if(T==="frozen"||T==="frozenSplit"){const g=K(d(h,"topLeftCell")??"A1")??{row:0,col:0};$={row:g.row+(y(k,"ySplit")??0),col:g.col+(y(k,"xSplit")??0)}}const I=n.rels(e).filter(g=>g.type==="table").flatMap(g=>{const E=je(n.xml(g.target));return E?[E]:[]}),F=A(l(l(a.sheetPr)?.tabColor),s),O=Pe(t,a,m.rich);p&&O.push(`${t}: its grouped rows or columns, left ungrouped`);const N=Ve(a,i,s),w=He(a);for(const g of N.unread)O.push(`${t}: a conditional format, ${g}`);for(const g of w.unread)O.push(`${t}: a data validation, ${g}`);const S=l(a.autoFilter),M=H(d(S,"ref")??""),R=S&&M?{ref:M,...re(S)}:void 0;R&&R.unread>0&&O.push(`${t}: ${_(R.unread,"filter")} by condition on ${d(S,"ref")??""}, its rows left as they were hidden`);const z=Xe(n,e,t,f,u,O);return{sheet:{name:t,state:o,cells:m.cells,merges:x,...$?{freeze:$}:{},...d(h,"showGridLines")==="0"?{gridlines:!1}:{},...F===void 0?{}:{tab:F},columns:f,rows:u,tables:I,conditional:N.rules,validations:w.rules,scenarios:b(l(a.scenarios)?.scenario).map(g=>({name:d(g,"name")??"",cells:b(g.inputCells).map(E=>({at:d(E,"r")??"",value:d(E,"val")??""}))})),...R?{filter:R}:{},charts:z},lost:O}}const qe=64,Ue=20;function Xe(n,e,t,o,r,s){const i=m=>o.find(f=>m>=f.min&&m<=f.max)?.width??qe,c=m=>r.find(f=>f.row===m)?.height??Ue,a=[];for(const m of n.rels(e).filter(f=>f.type==="drawing")){const{anchors:f}=we(n.xml(m.target),i,c),u=n.rels(m.target);for(const p of f){const x=u.find($=>$.id===p.id),h=ve(x?n.xml(x.target):void 0),k=J(p.at);if(typeof h=="string"){s.push(`${t}: the chart at ${k}, as ${h}`);continue}a.push({...h,at:k,...p.x===void 0?{}:{x:p.x},...p.y===void 0?{}:{y:p.y},...p.width===Y.width?{}:{width:p.width},...p.height===Y.height?{}:{height:p.height}})}}return a}export function readXlsx(n,e){let t;try{t=new Ee(n,e)}catch(w){throw w instanceof ce?w:new Error("It is not a zip file, as an .xlsx file is.")}const r=t.rels("").find(w=>w.type==="officeDocument")?.target??"xl/workbook.xml";if(r.endsWith(".bin"))throw new Error("It is a binary workbook (.xlsb): save it as .xlsx.");const s=t.xml(r),i=l(s?.workbook);if(!i)throw new Error("It has no workbook part.");const c=t.rels(r),a=w=>c.find(S=>S.type===w)?.target,m=(()=>{const w=a("theme");return w===void 0?void 0:t.text(w)})(),f=m===void 0?xe:ye(m),u=a("styles"),p=u===void 0?void 0:t.xml(u),x=Ne(p,f),h=te(f,l(p?.styleSheet)),k=Ie(t,a("sharedStrings")),$=[...Be(t)];for(const w of x.lost)$.push(w);const T=l(i.workbookPr),I=l(i.calcPr);v(I,"iterate")===!0&&$.push("iterative calculation");const F=l(i.workbookProtection);(v(F,"lockStructure")===!0||v(F,"lockWindows")===!0)&&$.push("the workbook's protection"),i.fileSharing!==void 0&&$.push("its write protection");const O=[],N=new Map(c.map(w=>[w.id,w]));for(const w of b(l(i.sheets)?.sheet)){const S=N.get(d(w,"id")??""),M=L(d(w,"name")??"");if(S?.type!=="worksheet"){S?.type!=="chartsheet"&&S?.type!=="dialogsheet"&&$.push(`${M}: a sheet of a kind this cannot read`);continue}const R=d(w,"state"),z=We(t,S.target,M,R==="hidden"||R==="veryHidden"?R:"visible",k,h,x.dxfs);O.push(z.sheet),$.push(...z.lost)}return{sheets:O,names:b(l(i.definedNames)?.definedName).map(w=>{const S=y(w,"localSheetId");return{name:d(w,"name")??"",text:L(C(w)),...S===void 0?{}:{sheet:S}}}),looks:x.looks,dxfs:x.dxfs,date1904:v(T,"date1904")===!0,font:x.font,lost:$}}
|
|
2
|
+
import{ZipLimitError as ve}from"@allyhub-next/formats";import{SHEET_ICONS as Se,SHEET_MARGINS as de,SHEET_OPERATORS as Ce,SHEET_PAPERS as Ee,SHEET_VALIDATIONS as Ne}from"@allyhub-next/formats";import{MAX_COLUMNS as q,MAX_ROWS as K,cellName as Y,columnLetter as Ae,readAddress as Oe,readArea as G,readAreas as ee}from"../address.js";import{SHEET_CHART_DEFAULTS as ce}from"../chart.js";import{moveFormula as Te,relativeKey as Ie}from"../formula/move.js";import{printFormula as fe}from"../formula/print.js";import{ERR as Le,errorOf as Re,serialOfDate as Me}from"../values.js";import{OFFICE_THEME as Fe,colorOf as F,paletteOf as le,themeColors as De}from"./colors.js";import{chartAnchors as je,readChart as Pe}from"./charts.js";import{isRangeText as ze,readFileFormula as te}from"./formula.js";import{BUILTIN_FORMATS as _e}from"./numfmt.js";import{XmlStream as ue}from"./sax.js";import{attr as u,flag as v,numberAttr as k,readXml as he,readXstring as A,tag as d,tags as x,textOf as E}from"./xml.js";import{ZipIn as He}from"./zip.js";const pe=7,Ve=r=>Math.floor((256*r+Math.floor(128/pe))/256*pe),Ue=r=>Math.round(r*4/3),ne=5;export function placesLine(r){const e=r.slice(0,ne).join(", ");return r.length>ne?`${e} and ${String(r.length-ne)} more`:e}const H=(r,e,t=`${e}s`)=>`${String(r)} ${r===1?e:t}`;export const GRID_END=`Excel's grid ends at ${Ae(q-1)}${String(K)} (${K.toLocaleString("en-US")} rows, ${q.toLocaleString("en-US")} columns)`;function We(r,e){let t=0,n=0;const o=r.length;for(;t<o;t++){const i=r.charCodeAt(t),c=i>=65&&i<=90,a=i>=97&&i<=122;if(!c&&!a)break;n=n*26+(c?i-64:i-96)}if(t===0||t===o)return;let s=0;for(let i=t;i<o;i++){const c=r.charCodeAt(i);if(c<48||c>57)return;s=s*10+c-48}if(s!==0){if(t>3||n>q||s>K)throw new Error(`${e} has a cell at ${r}, and ${GRID_END}.`);return{row:s-1,col:n-1}}}class Be{zip;constructor(e,t){this.zip=new He(e,t)}get names(){return this.zip.names}has(e){return this.zip.has(e)}text(e){return this.zip.text(e)}bytes(e){return this.zip.bytesOf(e)}xml(e){const t=this.text(e);return t===void 0?void 0:he(t)}stream(e,t){const n=this.zip.streamText(e,o=>{t.push(o)});return n&&t.end(),n}rels(e){const t=e.lastIndexOf("/"),n=`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`,o=this.xml(n);return x(d(o?.Relationships)?.Relationship).map(s=>{const i=u(s,"Type")??"",c=u(s,"Target")??"",a=u(s,"TargetMode")==="External";return{id:u(s,"Id")??"",type:i.slice(i.lastIndexOf("/")+1),target:a?c:Xe(e,c),external:a}})}count(e){return this.names.filter(t=>e.test(t)).length}}function Xe(r,e){if(e.startsWith("/"))return e.slice(1);const t=r.split("/").slice(0,-1);for(const n of e.split("/"))n===".."?t.pop():n!=="."&&t.push(n);return t.join("/")}function qe(r,e){const t=[];if(e===void 0)return t;let n,o=0,s=!1;const i={open(c){if(c==="si"){n={text:"",rich:!1};return}if(n){if(o>0||c==="rPh"||c==="phoneticPr"||c==="extLst"){o+=1;return}c==="r"&&(n.rich=!0),c==="t"&&(s=!0)}},close(c){if(o>0){o-=1;return}if(c==="si"){n&&t.push({...n,text:A(n.text)}),n=void 0;return}c==="t"&&(s=!1)},text(c){n&&s&&o===0&&(n.text+=c)}};return r.stream(e,new ue(i)),t}function W(r,e){const t=r[e];if(t===void 0)return!1;const n=u(d(t),"val");return n===void 0||n!=="0"&&n!=="false"}const Ge=new Set(["double","singleAccounting","doubleAccounting"]);function Ze(r,e,t){const n={},o=(a,l)=>u(d(a?.[l]),"val");if(W(r,"b")&&(n.bold=!0),W(r,"i")&&(n.italic=!0),W(r,"strike")&&(n.strike=!0),W(r,"u")){const a=o(r,"u");n.underline=a!==void 0&&Ge.has(a)?a:!0}const s=o(r,"name");s!==void 0&&s!==o(e,"name")&&(n.font=s);const i=o(r,"sz");i!==void 0&&i!==o(e,"sz")&&(n.size=Number(i));const c=F(d(r.color),t);return c!==void 0&&c!==F(d(e?.color),t)&&(n.color=c),n}function Je(r,e){const t=d(r.patternFill),n=u(t,"patternType");if(n===void 0||n==="none")return;const o=F(d(t?.fgColor),e),s=F(d(t?.bgColor),e);return n==="solid"&&o!==void 0?o:{pattern:n,...o===void 0?{}:{color:o},...s===void 0?{}:{background:s}}}function me(r,e){const t={};for(const n of["left","right","top","bottom"]){const o=d(r[n]),s=u(o,"style");if(s===void 0||s==="none")continue;const i=F(d(o?.color),e);t[n]={style:s,...i===void 0?{}:{color:i}}}return Object.keys(t).length===0?void 0:t}function Ke(r){const e={},t=u(r,"horizontal");t!==void 0&&t!=="general"&&(e.align=t);const n=u(r,"vertical");n!==void 0&&n!=="bottom"&&(e.valign=n),v(r,"wrapText")===!0&&(e.wrap=!0),v(r,"shrinkToFit")===!0&&(e.shrink=!0);const o=k(r,"indent");o!==void 0&&o>0&&(e.indent=o);const s=k(r,"textRotation");return s!==void 0&&s>0&&s<=180&&(e.rotation=s),e}function ge(r,e){const t={},n=d(r.font);if(n){const a=(f,p)=>{n[f]!==void 0&&(t[p]=W(n,f))};a("b","bold"),a("i","italic"),a("strike","strike"),n.u!==void 0&&(t.underline=W(n,"u"));const l=F(d(n.color),e);l!==void 0&&(t.color=l)}const o=d(d(r.fill)?.patternFill),s=F(d(o?.bgColor),e)??F(d(o?.fgColor),e);s!==void 0&&(t.fill=s);const i=d(r.border),c=i&&me(i,e);return c!==void 0&&(t.border=c),t}function Qe(r,e){const t=d(r?.styleSheet),n=le(e,t),o=new Map(x(d(t?.numFmts)?.numFmt).map(w=>[k(w,"numFmtId")??-1,u(w,"formatCode")??"General"])),s=x(d(t?.fonts)?.font),i=x(d(t?.fills)?.fill),c=x(d(t?.borders)?.border),a=x(d(t?.cellXfs)?.xf),l=s[k(a[0],"fontId")??0],f=new Set;i.some(w=>w.gradientFill!==void 0)&&f.add("gradient fills");const p=a.map(w=>{const m={},$=s[k(w,"fontId")??0];$&&(Object.assign(m,Ze($,l,n)),$.vertAlign!==void 0&&f.add("superscript and subscript"));const S=i[k(w,"fillId")??0],O=S&&Je(S,n);O!==void 0&&(m.fill=O);const T=c[k(w,"borderId")??0],z=T&&me(T,n);z!==void 0&&(m.border=z),T&&u(d(T.diagonal),"style")!==void 0&&f.add("diagonal borders");const D=d(w.alignment);D&&(Object.assign(m,Ke(D)),k(D,"textRotation")===255&&f.add("vertical text"));const I=k(w,"numFmtId")??0,M=o.get(I)??_e[I];return M!==void 0&&M!=="General"&&(m.format=M),m}),h=u(d(l?.name),"val"),b=u(d(l?.sz),"val");return{looks:p,dxfs:x(d(t?.dxfs)?.dxf).map(w=>ge(w,n)),font:{...h===void 0?{}:{name:h},...b===void 0?{}:{size:Number(b)}},lost:[...f]}}function be(r){const e=new Map;let t=0;for(const n of x(r.filterColumn)){const o=k(n,"colId")??0,s=d(n.filters);if(!s){Object.keys(n).some(c=>c!=="colId"&&c!=="hiddenButton")&&(t+=1);continue}if(s.dateGroupItem!==void 0){t+=1;continue}const i=x(s.filter).map(c=>A(u(c,"val")??""));e.set(o,{...i.length===0?{}:{values:i},...v(s,"blank")===!0?{blanks:!0}:{}})}return{columns:e,unread:t}}function Ye(r){const e=d(r?.table),t=G(u(e,"ref")??""),n=u(e,"displayName")??u(e,"name");if(!t||n===void 0)return;const o=d(e?.tableStyleInfo),s=d(e?.autoFilter);return{name:n,ref:t,headers:k(e,"headerRowCount")??1,totals:k(e,"totalsRowCount")??0,columns:x(d(e?.tableColumns)?.tableColumn).map(i=>({name:A(u(i,"name")??"").trim(),calculated:i.calculatedColumnFormula!==void 0})),style:u(o,"name")??"none",...s?{filter:be(s)}:{}}}function oe(r){const e=r.trim();if(e==="")return;const t=/^"((?:[^"]|"")*)"$/u.exec(e);if(t)return(t[1]??"").replaceAll('""','"');const n=Number(e);if(!Number.isNaN(n))return n;const o=te(e,!0);return o.ok?fe(o.node):void 0}const xe=r=>r!==void 0&&Ce.includes(r);function re(r){const e=u(r,"type")??"num",t=u(r,"val")??(r.f===void 0?void 0:E(r.f)),n=t===void 0?void 0:oe(t);return{at:e,...n===void 0?{}:{value:n}}}const et=Se,tt=r=>{const e=r.formula??r.f;return(Array.isArray(e)?e:e===void 0?[]:[e]).map(E)};function nt(r,e,t,n){const o=u(r,"type")??"",s={range:e,...v(r,"stopIfTrue")===!0?{stop:!0}:{}},i={...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.underline===void 0?{}:{underline:t.underline!==!1},...t.strike===void 0?{}:{strike:t.strike},...t.color===void 0?{}:{color:t.color},...typeof t.fill=="string"?{fill:t.fill}:{},...t.border===void 0?{}:{border:t.border}},c=tt(r);switch(o){case"cellIs":{const a=u(r,"operator"),l=c.flatMap(f=>{const p=oe(f);return p===void 0?[]:[p]});return!xe(a)||l.length===0?`a cellIs rule of ${a??"no operator"}`:{...s,...i,type:"cellIs",operator:a,formula:l}}case"containsText":case"notContainsText":case"beginsWith":case"endsWith":{const a=u(r,"text");return a===void 0?`a ${o} rule with no text`:{...s,...i,type:"containsText",...o==="containsText"?{}:{operator:o==="notContainsText"?"notContains":o},text:A(a)}}case"duplicateValues":case"uniqueValues":return{...s,...i,type:o};case"top10":return{...s,...i,type:"top10",rank:k(r,"rank")??10,...v(r,"percent")===!0?{percent:!0}:{},...v(r,"bottom")===!0?{bottom:!0}:{}};case"aboveAverage":return{...s,...i,type:"aboveAverage",...v(r,"aboveAverage")===!1?{below:!0}:{},...v(r,"equalAverage")===!0?{equal:!0}:{}};case"expression":{const a=c[0]===void 0?void 0:te(c[0],!0);return a?.ok?{...s,...i,type:"expression",formula:fe(a.node)}:"an expression rule that cannot be read"}case"dataBar":{const a=d(r.dataBar),l=F(d(a?.color??a?.fillColor),n),[f,p]=x(a?.cfvo).map(re);return l===void 0?"a data bar with no colour":{...s,type:"dataBar",color:l,...f&&f.at!=="min"?{min:f}:{},...p&&p.at!=="max"?{max:p}:{},...v(a,"showValue")===!1?{show:!1}:{}}}case"colorScale":{const a=d(r.colorScale),l=x(a?.cfvo).map(re),f=x(a?.color).map(h=>F(h,n)),p=l.flatMap((h,b)=>{const w=f[b];return w===void 0?[]:[{...h,color:w}]});return p.length<2?"a colour scale with too few stops":{...s,type:"colorScale",stops:p.slice(0,3)}}case"iconSet":{const a=d(r.iconSet),l=u(a,"iconSet")??"3TrafficLights1";if(!et.includes(l))return`the icon set ${l}`;if(a?.cfIcon!==void 0)return"an icon set of icons chosen one by one";const f=x(a?.cfvo).map(re);return{...s,type:"iconSet",icons:l,...f.length>=3?{stops:f.slice(0,5)}:{},...v(a,"reverse")===!0?{reverse:!0}:{},...v(a,"showValue")===!1?{show:!1}:{}}}default:return`a ${o} rule`}}const we={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},ye=(r,e)=>x(d(r.extLst)?.ext).find(t=>u(t,"uri")?.toUpperCase()===e.toUpperCase());function ot(r,e,t){const n=[],o=[],s=new Set,i=(a,l,f)=>{const p=nt(a,l,f,t);typeof p=="string"?o.push(`${p} on ${l}`):n.push({priority:k(a,"priority")??0,rule:p})};for(const a of x(r.conditionalFormatting)){const l=u(a,"sqref")??"";if(!ee(l)){o.push(`a rule on ${l}`);continue}for(const f of x(a.cfRule)){const p=E(d(d(f.extLst)?.ext)?.id);p!==""&&s.add(p.toUpperCase());const h=k(f,"dxfId");i(f,l,h===void 0?{}:e[h]??{})}}const c=d(ye(r,we.conditional)?.conditionalFormattings);for(const a of x(c?.conditionalFormatting)){const l=E(a.sqref).trim();for(const f of x(a.cfRule)){if(s.has((u(f,"id")??"").toUpperCase()))continue;if(!ee(l)){o.push(`a rule on ${l}`);continue}const p=d(f.dxf);i(f,l,p?ge(p,t):{})}}return{rules:n.sort((a,l)=>a.priority-l.priority).map(a=>a.rule),unread:o}}const rt=Ne;function $e(r,e,t,n){const o=u(r,"type")??"none";if(o==="none"&&u(r,"prompt")===void 0)return;if(!rt.includes(o)||!ee(e))return`a ${o} rule on ${e}`;const s=/^"((?:[^"]|"")*)"$/u.exec(t.trim()),i=o==="list"&&s?(s[1]??"").replaceAll('""','"').split(","):void 0,c=[t,n].flatMap(w=>{const m=oe(w);return m===void 0?[]:[m]}),a=u(r,"operator"),l=w=>Object.fromEntries(Object.entries(w).filter(([,m])=>m!==void 0)),f=l({title:u(r,"promptTitle"),message:u(r,"prompt")}),p=l({style:u(r,"errorStyle"),title:u(r,"errorTitle"),message:u(r,"error")}),h=v(r,"showInputMessage")!==!0,b=v(r,"showErrorMessage")!==!0;return{range:e,type:o,...xe(a)&&a!=="between"?{operator:a}:{},...i?{values:i}:{formula:c},...v(r,"allowBlank")===!0?{}:{blank:!1},...v(r,"showDropDown")===!0?{dropdown:!1}:{},...h||Object.keys(f).length>0?{prompt:{...f,...h?{show:!1}:{}}}:{},...b||Object.keys(p).length>0?{error:{...p,...b?{show:!1}:{}}}:{}}}function st(r){const e=[],t=[],n=s=>{typeof s=="string"?t.push(s):s&&e.push(s)};for(const s of x(d(r.dataValidations)?.dataValidation))n($e(s,u(s,"sqref")??"",E(s.formula1),E(s.formula2)));const o=d(ye(r,we.validations)?.dataValidations);for(const s of x(o?.dataValidation))n($e(s,E(s.sqref).trim(),E(d(s.formula1)?.f),E(d(s.formula2)?.f)));return{rules:e,unread:t}}function it(r){const e=/^(-?\d{4,})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(r)??/^()()()(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(r);if(!e)return;const t=e[1]==="",n=t?1899:Number(e[1]),o=t?12:Number(e[2]),s=t?30:Number(e[3]),i=Number(e[4]??0)*3600+Number(e[5]??0)*60+Number(e[6]??0)+Number(e[7]??0),c=new Date(Date.UTC(n,o-1,s)+i*1e3);if(Number.isNaN(c.getTime()))return;const a=Me(c);return t?a-Math.floor(a):a}function se(r,e,t){const n=te(r,e,t);return n.ok?{node:n.node}:{unread:r}}class at{cells=[];rows=[];rich=[];outlined=!1;rest=[];xml;masters=new Map;strings;name;isRangeName;inData=!1;row=-1;nextRow=0;nextCol=0;cell;target;buffer="";skip=0;constructor(e,t,n){this.strings=e,this.name=t,this.isRangeName=n,this.xml=new ue(this),this.xml.capture=this.rest}open(e,t){if(!this.inData){e==="sheetData"&&(this.inData=!0,this.xml.capture=void 0);return}const n=this.cell;if(n){if(this.skip>0){this.skip+=1;return}switch(e){case"v":this.target="v",this.buffer="";return;case"f":n.f={...t,text:""},this.target="f",this.buffer="";return;case"is":n.inline={text:"",rich:!1};return;case"r":n.inline&&(n.inline.rich=!0);return;case"t":n.inline&&(this.target="t",this.buffer="");return;case"rPh":case"phoneticPr":case"extLst":this.skip=1;return;default:return}}e==="row"?this.openRow(t):e==="c"&&(this.cell={r:t.r,s:t.s,t:t.t,cm:t.cm,v:void 0,f:void 0,inline:void 0})}close(e){if(!this.inData)return;const t=this.cell;if(!t){e==="sheetData"&&(this.inData=!1,this.xml.capture=this.rest);return}if(this.skip>0){this.skip-=1;return}if(e===this.target){e==="v"?t.v=this.buffer:e==="f"&&t.f?t.f.text=this.buffer:t.inline&&(t.inline.text+=this.buffer),this.target=void 0;return}e==="c"&&(this.cell=void 0,this.readCell(t))}text(e){this.target!==void 0&&this.skip===0&&(this.buffer+=e)}openRow(e){const t=e.r,n=t===void 0?void 0:Number(t);if(n!==void 0&&Number.isInteger(n)&&n>K)throw new Error(`${this.name} has a row ${t??""}, and ${GRID_END}.`);const o=n!==void 0&&Number.isInteger(n)&&n>0?n-1:this.nextRow;this.row=o,this.nextRow=o+1,this.nextCol=0;const s={row:o},i=e.ht===void 0?void 0:Number(e.ht),c=f=>f==="1"||f==="true";i!==void 0&&Number.isFinite(i)&&c(e.customHeight)&&(s.height=Ue(i)),c(e.hidden)&&(s.hidden=!0);const a=e.s===void 0?void 0:Number(e.s);a!==void 0&&a!==0&&c(e.customFormat)&&(s.style=a);const l=Number(e.outlineLevel??0);l>0&&(s.level=Math.min(7,l),this.outlined=!0),Object.keys(s).length>1&&this.rows.push(s)}value(e,t){const n=e.t??"n";if(n==="inlineStr"){const s=e.inline;return s?{value:A(s.text),...s.rich?{rich:!0}:{}}:{value:e.v===void 0?"":A(e.v)}}const o=e.v;if(o===void 0)return{value:void 0};switch(n){case"s":{const s=this.strings[Number(o)];return s?{value:s.text,...s.rich?{rich:!0}:{}}:{value:""}}case"str":return{value:A(o)};case"b":return{value:o.trim()==="1"||o.trim()==="true"};case"e":return{value:Re(o.trim())??Le.VALUE};case"d":return{value:it(o.trim())??o};default:{if(o.trim()==="")return{value:void 0};const s=Number(o);if(Number.isNaN(s))throw new Error(`${t} says it holds a number and holds ${o}.`);return{value:s}}}}formula(e,t,n,o){const s=e.f;if(s===void 0)return;const i=s.t??"normal",c=s.text;if(i==="dataTable"){o.unread=`a data table's {=TABLE(${s.r1??""})}`;return}if(i==="array"){Object.assign(o,se(c,!0,this.isRangeName));const a=G(s.ref??"");a&&(o.array=a),e.cm!==void 0&&(o.dynamic=!0);return}if(i==="shared"){const a=s.si??"";if(c!==""){const f=se(c,!1,this.isRangeName),p=f.node?Ie(f.node,t,n):"";this.masters.set(a,{node:f.node,unread:f.unread,row:t,col:n,key:p}),Object.assign(o,f),f.node&&(o.key=p);return}const l=this.masters.get(a);if(!l){o.unread=`a shared formula of a group that has no first cell (${a})`;return}l.node?(o.node=Te(l.node,t-l.row,n-l.col),o.key=l.key):l.unread!==void 0&&(o.unread=l.unread);return}c!==""&&Object.assign(o,se(c,!1,this.isRangeName))}readCell(e){const t=e.r===void 0?void 0:We(e.r,this.name),n=t?.row??this.row,o=t?.col??this.nextCol;if(o>=q)throw new Error(`${this.name} has a cell past its last column, and ${GRID_END}.`);this.nextCol=o+1;const s=e.r??Y({row:n,col:o}),{value:i,rich:c}=this.value(e,s),a={row:n,col:o,value:i,style:e.s===void 0?0:Number(e.s)||0};c===!0&&(a.rich=!0,this.rich.push(s)),this.formula(e,n,o,a),this.cells.push(a)}}function dt(r,e,t){const n=[],o=p=>n.push(`${r}: ${p}`);t.length>0&&o(`${H(t.length,"cell")} of rich text, kept as plain text (${placesLine(t)})`);const s=x(d(e.hyperlinks)?.hyperlink).filter(p=>u(p,"tooltip")!==void 0);s.length>0&&o(`the tooltips of ${H(s.length,"link")} (${placesLine(s.map(p=>u(p,"ref")??""))})`),e.sortState!==void 0&&o("a sort");const i=d(e.sheetProtection);v(i,"sheet")===!0&&(u(i,"password")!==void 0||u(i,"hashValue")!==void 0)&&o("its protection's password: it is protected with none"),e.protectedRanges!==void 0&&o("protected ranges");const c=d(e.headerFooter);(c?.evenHeader!==void 0||c?.evenFooter!==void 0||c?.firstHeader!==void 0||c?.firstFooter!==void 0)&&o("its print header and footer of the first or even pages");const a=d(e.printOptions);a&&["gridLines","headings","horizontalCentered","verticalCentered"].some(p=>v(a,p)===!0)&&o("its print options (gridlines, headings, centring)"),(e.rowBreaks!==void 0||e.colBreaks!==void 0)&&o("its page breaks"),e.oleObjects!==void 0&&o("embedded objects"),e.controls!==void 0&&o("form controls"),e.dataConsolidate!==void 0&&o("a consolidation"),e.customSheetViews!==void 0&&o("custom views"),x(d(e.sheetViews)?.sheetView).some(p=>u(d(p.pane),"state")==="split")&&o("a split, not frozen, window");const f=JSON.stringify(e.extLst??"");return f.includes("sparklineGroups")&&o("sparklines"),f.includes("slicerList")&&o("slicers"),n}function ct(r,e){const t=[],n=(s,i,c)=>{const a=r.count(s);a>0&&t.push(H(a,i,c))};r.has("xl/vbaProject.bin")&&t.push("VBA macros"),n(/^xl\/pivotTables\/pivotTable\d*\.xml$/u,"pivot table"),n(/^xl\/chartsheets\/[^/]+\.xml$/u,"chart sheet"),n(/^xl\/dialogsheets\/[^/]+\.xml$/u,"dialog sheet"),n(/^xl\/macrosheets\/[^/]+\.xml$/u,"macro sheet");const o=r.names.filter(s=>s.startsWith("xl/media/")&&!e.has(s)).length;return o>0&&t.push(H(o,"image")),n(/^xl\/embeddings\//u,"embedded object"),n(/^xl\/slicers\/[^/]+\.xml$/u,"slicer part"),n(/^xl\/timelines\/[^/]+\.xml$/u,"timeline part"),n(/^xl\/ctrlProps\/[^/]+\.xml$/u,"form control"),n(/^xl\/activeX\/[^/]+\.xml$/u,"ActiveX control"),n(/^xl\/queryTables\/[^/]+\.xml$/u,"query table"),r.has("xl/connections.xml")&&t.push("data connections"),r.names.some(s=>s.startsWith("xl/richData/"))&&t.push("rich values (data types, pictures in cells)"),r.names.some(s=>/^customXml\/item\d+\.xml$/u.test(s)&&(r.text(s)??"").includes("DataMashup"))&&t.push("Power Query queries"),t}export function readHeaderFooter(r){const e={left:"",center:"",right:""};let t="center",n=new Set;for(let o=0;o<r.length;o++){const s=r[o],i=r[o+1];if(s==="&"&&(i==="L"||i==="C"||i==="R")){t=i==="L"?"left":i==="C"?"center":"right",n=new Set([...n,t]),o+=1;continue}if(s==="&"&&i==="&"){e[t]+="&&",o+=1;continue}e[t]+=s??""}return Object.fromEntries(Object.entries(e).filter(([o,s])=>s!==""||n.has(o)))}const ft=new Map(Object.entries(Ee).map(([r,e])=>[e,r]));function lt(r,e,t){const n={},o=d(r.pageSetup),s=u(o,"orientation");(s==="portrait"||s==="landscape")&&(n.orientation=s);const i=k(o,"paperSize");if(i!==void 0){const h=ft.get(i);h?n.paper=h:t.push(`${e}: its paper size, Excel's number ${String(i)}`)}v(d(d(r.sheetPr)?.pageSetUpPr),"fitToPage")===!0&&(n.fit={width:k(o,"fitToWidth")??1,height:k(o,"fitToHeight")??1});const c=d(r.pageMargins),a={};for(const h of Object.keys(de)){const b=k(c,h);b!==void 0&&b!==de[h]&&(a[h]=b)}Object.keys(a).length>0&&(n.margins=a);const l=d(r.headerFooter),f=E(l?.oddHeader),p=E(l?.oddFooter);return f!==""&&(n.header=readHeaderFooter(A(f))),p!==""&&(n.footer=readHeaderFooter(A(p))),n}function ut(r,e,t,n,o){const s=r.rels(e),i=new Map;for(const a of s.filter(l=>l.type==="comments")){const l=d(r.xml(a.target)?.comments),f=d(l?.authors)?.author,p=(Array.isArray(f)?f:f===void 0?[]:[f]).map(h=>A(E(h)));for(const h of x(d(l?.commentList)?.comment)){const b=u(h,"ref")??"",w=d(h.text),m=x(w?.r),$=A(m.length>0?m.map(O=>E(O.t)).join(""):E(w?.t)),S=p[k(h,"authorId")??-1];b!==""&&$!==""&&i.set(b,{ref:b,text:$,...S===void 0||S===""?{}:{author:S}})}}let c=0;for(const a of s.filter(l=>l.type==="threadedComment")){const l=d(r.xml(a.target)?.ThreadedComments),f=new Map;for(const p of x(l?.threadedComment)){const h=u(p,"ref")??"",b=A(E(p.text)),w=f.get(h)??{texts:[]};if(w.texts.length===0){const m=n.get(u(p,"personId")??"");m!==void 0&&(w.author=m)}w.texts.push(b),f.set(h,w)}for(const[p,h]of f)c+=1,i.set(p,{ref:p,text:h.texts.join(`
|
|
3
|
+
`),...h.author===void 0?{}:{author:h.author}})}return c>0&&o.push(`${t}: ${H(c,"threaded comment")}, kept as notes, replies after the first line`),[...i.values()]}function ht(r,e,t,n,o,s,i,c,a,l){const f=new at(o,t,a);if(!r.stream(e,f.xml))throw new Error(`${e} is not in the file.`);const p=he(f.rest.join("")),h=d(p.worksheet);if(!h)throw new Error(`${e} is not a worksheet.`);const b=x(d(h.cols)?.col).map(y=>{const C=k(y,"width"),R=k(y,"style"),P=k(y,"outlineLevel")??0,L=(k(y,"min")??1)-1,ie=(k(y,"max")??1)-1;if(ie>=q)throw new Error(`${t} sets a column past its last, and ${GRID_END}.`);const ae=v(y,"customWidth"),Q=C===void 0?void 0:Ve(C);return{min:L,max:ie,...Q!==void 0&&(ae===!0||ae===void 0&&Q!==ke)?{width:Q}:{},...v(y,"hidden")===!0?{hidden:!0}:{},...R===void 0||R===0?{}:{style:R},...P>0?{level:Math.min(7,P)}:{}}}),w=x(d(h.mergeCells)?.mergeCell).flatMap(y=>{const C=G(u(y,"ref")??"");return C?[C]:[]}),m=x(d(h.sheetViews)?.sheetView)[0],$=d(m?.pane);let S;const O=u($,"state");if(O==="frozen"||O==="frozenSplit"){const y=Oe(u(m,"topLeftCell")??"A1")??{row:0,col:0};S={row:y.row+(k($,"ySplit")??0),col:y.col+(k($,"xSplit")??0)}}const T=r.rels(e),z=T.filter(y=>y.type==="table").flatMap(y=>{const C=Ye(r.xml(y.target));return C?[C]:[]}),D=F(d(d(h.sheetPr)?.tabColor),s),I=dt(t,h,f.rich),M=ot(h,i,s),B=st(h);for(const y of M.unread)I.push(`${t}: a conditional format, ${y}`);for(const y of B.unread)I.push(`${t}: a data validation, ${y}`);const V=d(h.autoFilter),Z=G(u(V,"ref")??""),j=V&&Z?{ref:Z,...be(V)}:void 0;j&&j.unread>0&&I.push(`${t}: ${H(j.unread,"filter")} by condition on ${u(V,"ref")??""}, its rows left as they were hidden`);const{charts:X,pictures:J}=mt(r,e,t,b,f.rows,I,l),U={},g=new Map(T.map(y=>[y.id,y]));for(const y of x(d(h.hyperlinks)?.hyperlink)){const C=u(y,"ref");if(C===void 0)continue;const R=u(y,"location"),P=u(y,"id"),L=P===void 0?void 0:g.get(P)?.target;L!==void 0?U[C]=R===void 0?L:`${L}#${R}`:R!==void 0&&(U[C]=`#${R}`)}const N=d(h.sheetProtection),_=lt(h,t,I);return{sheet:{name:t,state:n,cells:f.cells,merges:w,...S?{freeze:S}:{},...u(m,"showGridLines")==="0"?{gridlines:!1}:{},...D===void 0?{}:{tab:D},columns:b,rows:f.rows,tables:z,conditional:M.rules,validations:B.rules,scenarios:x(d(h.scenarios)?.scenario).map(y=>({name:u(y,"name")??"",cells:x(y.inputCells).map(C=>({at:u(C,"r")??"",value:u(C,"val")??""}))})),...j?{filter:j}:{},charts:X,links:U,notes:ut(r,e,t,c,I),pictures:J,...v(N,"sheet")===!0?{protect:!0}:{},...Object.keys(_).length>0?{print:_}:{}},lost:I}}const ke=64,pt=20;function mt(r,e,t,n,o,s,i){const c=h=>n.find(b=>h>=b.min&&h<=b.max)?.width??ke,a=new Map(o.map(h=>[h.row,h.height])),l=h=>a.get(h)??pt,f=[],p=[];for(const h of r.rels(e).filter(b=>b.type==="drawing")){const b=je(r.xml(h.target),c,l),w=r.rels(h.target);for(const m of b.anchors){const $=w.find(T=>T.id===m.id),S=Pe($?r.xml($.target):void 0),O=Y(m.at);if(typeof S=="string"){s.push(`${t}: the chart at ${O}, as ${S}`);continue}f.push({...S,at:O,...m.x===void 0?{}:{x:m.x},...m.y===void 0?{}:{y:m.y},...m.width===ce.width?{}:{width:m.width},...m.height===ce.height?{}:{height:m.height}})}for(const m of b.pictures){const $=w.find(T=>T.id===m.id),S=$&&!$.external?r.bytes($.target):void 0;if(!$||!S){s.push(`${t}: the picture at ${Y(m.at)}, whose image is not in the file`);continue}i.add($.target);const O=$.target.slice($.target.lastIndexOf(".")+1).toLowerCase();p.push({row:m.at.row,col:m.at.col,...m.x===void 0?{}:{x:m.x},...m.y===void 0?{}:{y:m.y},width:m.width,height:m.height,...m.name===void 0?{}:{name:m.name},...m.descr===void 0?{}:{descr:m.descr},bytes:S,type:O})}b.others>0&&s.push(`${t}: ${H(b.others,"shape")} of its drawing`)}return{charts:f,pictures:p}}function gt(r,e,t){for(const n of r){if(n.sheet===void 0)continue;const o=e[n.sheet];if(!o)continue;const s=n.text.split(",").map(i=>i.slice(i.lastIndexOf("!")+1).replaceAll("$",""));if(n.name==="_xlnm.Print_Area"){const[i]=s;s.length>1&&t.push(`${o.name}: its print area's ranges after the first`),i!==void 0&&G(i)&&(o.print={...o.print,area:i})}else if(n.name==="_xlnm.Print_Titles")for(const i of s)/^\d+:\d+$/u.test(i)?o.print={...o.print,title_rows:i}:/^[A-Za-z]+:[A-Za-z]+$/u.test(i)&&(o.print={...o.print,title_cols:i})}}export function readXlsx(r,e){let t;try{t=new Be(r,e)}catch(g){throw g instanceof ve?g:new Error("It is not a zip file, as an .xlsx file is.")}const n=t.rels(""),o=n.find(g=>g.type==="officeDocument")?.target??"xl/workbook.xml";if(o.endsWith(".bin"))throw new Error("It is a binary workbook (.xlsb): save it as .xlsx.");const s=t.xml(o),i=d(s?.workbook);if(!i)throw new Error("It has no workbook part.");const c=t.rels(o),a=g=>c.find(N=>N.type===g)?.target,l=(()=>{const g=a("theme");return g===void 0?void 0:t.text(g)})(),f=l===void 0?Fe:De(l),p=a("styles"),h=p===void 0?void 0:t.xml(p),b=Qe(h,f),w=le(f,d(h?.styleSheet)),m=qe(t,a("sharedStrings")),$=[];for(const g of b.lost)$.push(g);const S=d(i.workbookPr),O=d(i.calcPr);v(O,"iterate")===!0&&$.push("iterative calculation");const T=d(i.workbookProtection);(v(T,"lockStructure")===!0||v(T,"lockWindows")===!0)&&$.push("the workbook's protection"),i.fileSharing!==void 0&&$.push("its write protection");const z=new Map,D=a("person");if(D!==void 0)for(const g of x(d(t.xml(D)?.personList)?.person))z.set(u(g,"id")??"",A(u(g,"displayName")??""));const I=x(d(i.definedNames)?.definedName).map(g=>{const N=k(g,"localSheetId");return{name:u(g,"name")??"",text:A(E(g)),...N===void 0?{}:{sheet:N},...v(g,"hidden")===!0?{hidden:!0}:{}}}),M=[],B=new Set,V=new Map(c.map(g=>[g.id,g])),Z=x(d(i.sheets)?.sheet);for(const[g,N]of Z.entries()){const _=V.get(u(N,"id")??""),y=A(u(N,"name")??"");if(_?.type!=="worksheet"){_?.type!=="chartsheet"&&_?.type!=="dialogsheet"&&$.push(`${y}: a sheet of a kind this cannot read`);continue}const C=new Map;for(const L of I)(L.sheet===void 0||L.sheet===g)&&(L.sheet!==void 0||!C.has(L.name.toLowerCase()))&&C.set(L.name.toLowerCase(),ze(L.text));const R=u(N,"state"),P=ht(t,_.target,y,R==="hidden"||R==="veryHidden"?R:"visible",m,w,b.dxfs,z,L=>C.get(L.toLowerCase())===!0,B);M[g]=P.sheet,$.push(...P.lost)}gt(I,M,$);const j=n.find(g=>g.type==="core-properties")?.target,X=j===void 0?void 0:E(d(t.xml(j)?.coreProperties)?.title).trim(),J=M.filter(g=>g!==void 0),U=new Map;return M.forEach((g,N)=>{g!==void 0&&U.set(N,J.indexOf(g))}),{sheets:J,names:I.flatMap(g=>{if(g.sheet===void 0)return[g];const N=U.get(g.sheet);return N===void 0?[]:[{...g,sheet:N}]}),looks:b.looks,dxfs:b.dxfs,date1904:v(S,"date1904")===!0,font:b.font,...X===void 0||X===""?{}:{title:X},lost:[...ct(t,B),...$]}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type XmlAttrs = Record<string, string>;
|
|
2
|
+
export interface XmlHandler {
|
|
3
|
+
open(name: string, attrs: XmlAttrs, empty: boolean): void;
|
|
4
|
+
close(name: string): void;
|
|
5
|
+
/** Text, its entities read. */
|
|
6
|
+
text(text: string): void;
|
|
7
|
+
}
|
|
8
|
+
/** Text with its entities read. */
|
|
9
|
+
export declare function unescapeXml(text: string): string;
|
|
10
|
+
/** An XML stream: text pushed in pieces, events out as soon as each is whole. */
|
|
11
|
+
export declare class XmlStream {
|
|
12
|
+
/** When set, the source text of each token is kept here as it is read. */
|
|
13
|
+
capture: string[] | undefined;
|
|
14
|
+
private buffer;
|
|
15
|
+
private readonly handler;
|
|
16
|
+
private depth;
|
|
17
|
+
constructor(handler: XmlHandler);
|
|
18
|
+
push(text: string): void;
|
|
19
|
+
end(): void;
|
|
20
|
+
private emitText;
|
|
21
|
+
private run;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sax.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
const b={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};export function unescapeXml(r){return r.includes("&")?r.replace(/&(#x[0-9A-Fa-f]+|#\d+|[A-Za-z]+);/gu,(e,o)=>o.startsWith("#x")?String.fromCodePoint(Number.parseInt(o.slice(2),16)):o.startsWith("#")?String.fromCodePoint(Number.parseInt(o.slice(1),10)):b[o]??e):r}const d=r=>{const e=r.indexOf(":");return e<0?r:r.slice(e+1)},p=r=>r===32||r===9||r===10||r===13;function x(r,e,o){let i=0;const t=r.length;for(;i<t&&!p(r.charCodeAt(i));)i++;const f=d(r.slice(0,i)),c={};for(;i<t;){for(;i<t&&p(r.charCodeAt(i));)i++;if(i>=t)break;const h=r.indexOf("=",i);if(h<0)throw new Error(`An attribute of <${f}> has no value.`);const u=r.slice(i,h).trim();let l=h+1;for(;l<t&&p(r.charCodeAt(l));)l++;const a=r[l];if(a!=='"'&&a!=="'")throw new Error(`An attribute of <${f}> is not quoted.`);const s=r.indexOf(a,l+1);if(s<0)throw new Error(`An attribute of <${f}> is not closed.`);u!=="xmlns"&&!u.startsWith("xmlns:")&&(c[d(u)]=unescapeXml(r.slice(l+1,s))),i=s+1}return e.open(f,c,o),f}export class XmlStream{capture;buffer="";handler;depth=0;constructor(e){this.handler=e}push(e){this.buffer=this.buffer===""?e:this.buffer+e,this.run()}end(){if(this.run(),this.buffer.trim()!=="")throw new Error("The XML ends inside a tag or a comment.");if(this.depth>0)throw new Error("The XML ends before its elements do.")}emitText(e){e!==""&&(this.capture?.push(e),this.handler.text(unescapeXml(e)))}run(){const e=this.buffer,o=e.length;let i=0;for(;;){const t=e.indexOf("<",i);if(t<0){const s=e.lastIndexOf("&"),n=s>=i&&!e.includes(";",s)?s:o;this.emitText(e.slice(i,n)),i=n;break}t>i&&this.emitText(e.slice(i,t)),i=t;const f=e.charCodeAt(t+1);if(Number.isNaN(f))break;if(f===33){if(e.startsWith("<!--",t)){const n=e.indexOf("-->",t+4);if(n<0)break;this.capture?.push(e.slice(t,n+3)),i=n+3;continue}if(e.startsWith("<![CDATA[",t)){const n=e.indexOf("]]>",t+9);if(n<0)break;this.capture?.push(e.slice(t,n+3)),this.handler.text(e.slice(t+9,n)),i=n+3;continue}if(o-t<9)break;const s=e.indexOf(">",t);if(s<0)break;if(e.lastIndexOf("[",s)>t){const n=e.indexOf("]>",t);if(n<0)break;i=n+2}else i=s+1;continue}if(f===63){const s=e.indexOf("?>",t+2);if(s<0)break;this.capture?.push(e.slice(t,s+2)),i=s+2;continue}if(f===47){const s=e.indexOf(">",t+2);if(s<0)break;this.capture?.push(e.slice(t,s+1)),this.depth-=1,this.handler.close(d(e.slice(t+2,s).trim())),i=s+1;continue}let c=t+1,h=0;for(;c<o;c++){const s=e.charCodeAt(c);if(h!==0)s===h&&(h=0);else if(s===34||s===39)h=s;else if(s===62)break}if(c>=o)break;const u=e.charCodeAt(c-1)===47,l=e.slice(t,c+1),a=x(e.slice(t+1,u?c-1:c),this.handler,u);this.capture?.push(l),u?this.handler.close(a):this.depth+=1,i=c+1}this.buffer=i>=o?"":e.slice(i)}}
|
|
@@ -18,6 +18,8 @@ export declare class Styles {
|
|
|
18
18
|
xf(look: CellLook): number;
|
|
19
19
|
/** The differential format of what a rule gives a cell. */
|
|
20
20
|
dxf(look: CellLook): number;
|
|
21
|
+
/** What a rule gives a cell, as an element of its own: Excel 2010's rules hold theirs. */
|
|
22
|
+
dxfXml(look: CellLook, name: string): string;
|
|
21
23
|
xml(): string;
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{FIRST_CUSTOM as
|
|
2
|
+
import{FIRST_CUSTOM as g,builtinId as y}from"./numfmt.js";import{NS as x,el as n}from"./xml.js";export const DEFAULT_FONT={name:"Calibri",size:11};const s=t=>`FF${t.slice(1).toUpperCase()}`;class f{items=[];index=new Map;add(e){const i=this.index.get(e);if(i!==void 0)return i;const r=this.items.length;return this.items.push(e),this.index.set(e,r),r}}function b(t){const{underline:e}=t;return n("font",{},t.bold===!0?"<b/>":"",t.italic===!0?"<i/>":"",t.strike===!0?"<strike/>":"",e===!0||e==="single"?"<u/>":e?n("u",{val:e}):"",n("sz",{val:t.size??DEFAULT_FONT.size}),t.color===void 0?n("color",{theme:1}):n("color",{rgb:s(t.color)}),n("name",{val:t.font??DEFAULT_FONT.name}),n("family",{val:2}),t.font===void 0?n("scheme",{val:"minor"}):"")}function F(t){const{pattern:e,color:i,background:r}=typeof t=="string"?{pattern:"solid",color:t,background:void 0}:t;return n("fill",{},n("patternFill",{patternType:e},i===void 0?"":n("fgColor",{rgb:s(i)}),r===void 0?e==="solid"?n("bgColor",{indexed:64}):"":n("bgColor",{rgb:s(r)})))}function o(t,e){return e?n(t,{style:e.style},e.color===void 0?n("color",{auto:1}):n("color",{rgb:s(e.color)})):n(t)}function h(t){return n("border",{},o("left",t.left),o("right",t.right),o("top",t.top),o("bottom",t.bottom),n("diagonal"))}function p(t,e="dxf"){const{underline:i}=t,r=[t.bold===void 0?"":n("b",{val:t.bold}),t.italic===void 0?"":n("i",{val:t.italic}),t.strike===void 0?"":n("strike",{val:t.strike}),i===!0?"<u/>":"",t.color===void 0?"":n("color",{rgb:s(t.color)})].join(""),{fill:d,border:l}=t;return n(e,{},r===""?"":n("font",{},r),typeof d=="string"?n("fill",{},n("patternFill",{},n("bgColor",{rgb:s(d)}))):"",l?h(l):"")}const I=t=>t<0?90-t:t;function v(t){const e={horizontal:t.align,vertical:t.valign,textRotation:t.rotation===void 0?void 0:I(t.rotation),wrapText:t.wrap===!0?!0:void 0,indent:t.indent,shrinkToFit:t.shrink===!0?!0:void 0};return Object.values(e).every(i=>i===void 0)?"":n("alignment",e)}export class Styles{fonts=new f;fills=new f;borders=new f;formats=new Map;xfs=new f;byLook=new Map;dxfs=new f;constructor(){this.fonts.add(b({})),this.fills.add(n("fill",{},n("patternFill",{patternType:"none"}))),this.fills.add(n("fill",{},n("patternFill",{patternType:"gray125"}))),this.borders.add(n("border",{},n("left"),n("right"),n("top"),n("bottom"),n("diagonal"))),this.xfs.add(n("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}))}format(e){if(e===void 0)return 0;const i=y(e);if(i!==void 0)return i;let r=this.formats.get(e);return r===void 0&&(r=g+this.formats.size,this.formats.set(e,r)),r}xf(e){const i=JSON.stringify(e),r=this.byLook.get(i);if(r!==void 0)return r;const d=this.format(e.format),l=this.fonts.add(b(e)),a=e.fill===void 0?0:this.fills.add(F(e.fill)),u=e.border===void 0?0:this.borders.add(h(e.border)),m=v(e),c=this.xfs.add(n("xf",{numFmtId:d,fontId:l,fillId:a,borderId:u,xfId:0,applyNumberFormat:d===0?void 0:!0,applyFont:l===0?void 0:!0,applyFill:a===0?void 0:!0,applyBorder:u===0?void 0:!0,applyAlignment:m===""?void 0:!0},m));return this.byLook.set(i,c),c}dxf(e){return this.dxfs.add(p(e))}dxfXml(e,i){return p(e,i)}xml(){const e=(r,d)=>n(r,{count:d.length},d.join("")),i=[...this.formats].map(([r,d])=>n("numFmt",{numFmtId:d,formatCode:r}));return n("styleSheet",{xmlns:x.main},i.length>0?e("numFmts",i):"",e("fonts",this.fonts.items),e("fills",this.fills.items),e("borders",this.borders.items),e("cellStyleXfs",[n("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0})]),e("cellXfs",this.xfs.items),e("cellStyles",[n("cellStyle",{name:"Normal",xfId:0,builtinId:0})]),this.dxfs.items.length===0?n("dxfs",{count:0}):e("dxfs",this.dxfs.items),n("tableStyles",{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}))}}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { Calc } from "../calc/engine.js";
|
|
2
2
|
/** A table's style when sheet.yaml names none. */
|
|
3
3
|
export declare const DEFAULT_TABLE_STYLE = "TableStyleMedium2";
|
|
4
|
+
/**
|
|
5
|
+
* The very hidden sheet a list's choices are written in when a validation
|
|
6
|
+
* cannot spell them out: one holds a comma, a quote, or all of them more
|
|
7
|
+
* than 255 characters. A reader finds the choices again by this name.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LISTS_SHEET = "AllyHub lists";
|
|
4
10
|
export interface WriteOptions {
|
|
5
11
|
/** false leaves out what formulas compute: the file has to be computed by what opens it. */
|
|
6
12
|
cached?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{zipSync as me}from"fflate";import{SHEET_PAPERS as fe}from"@allyhub-next/formats";import{cellName as j,columnIndex as ue,columnLetter as K,rangeName as L,readAddress as J,readArea as pe}from"../address.js";import{parseFormula as xe}from"../formula/parse.js";import{sheetPrefix as Q}from"../formula/print.js";import{fileCells as ge,isPicture as $e,pictureHeight as we,pictureSize as ee}from"../files.js";import{scenariosByCell as ye}from"../scenario.js";import{CellError as z,readTyped as be}from"../values.js";import{FormulaCell as ve}from"../workbook.js";import{chartPart as Se,drawingPart as ke}from"./charts.js";import{fileFormula as H,needsArray as X}from"./formula.js";import{Styles as Te}from"./styles.js";import{THEME_XML as Ce}from"./theme.js";import{HEAD as v,NS as A,el as s,xstring as x}from"./xml.js";const S={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},$=`${A.rel}/`,te=new Date(1980,0,1),Ae=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2";const Ee=64,Me=7,_e=l=>Math.min(255,Math.floor(l/Me*256)/256),Re=l=>Math.min(409.5,l*3/4),B=32767,q=255,Le=2e5,Ie=s("metadata",{xmlns:A.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},s("metadataTypes",{count:1},s("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),s("futureMetadata",{name:"XLDAPR",count:1},s("bk",{},s("extLst",{},s("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},s("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),s("cellMetadata",{count:1},s("bk",{},s("rc",{t:1,v:0}))));class Oe{index=new Map;count=0;of(n){this.count+=1;let e=this.index.get(n);return e===void 0&&(e=this.index.size,this.index.set(n,e)),e}xml(){const n=[...this.index.keys()].map(e=>`<si><t${/^\s|\s$|\n/u.test(e)?' xml:space="preserve"':""}>${x(e)}</t></si>`);return s("sst",{xmlns:A.main,count:this.count,uniqueCount:this.index.size},...n)}}const G=l=>x(l),Pe="Base case";function Fe(l){const n=new Map;for(const o of l.scenarios)for(const r of o.cells)n.set(j(r),r);const e=(o,r)=>s("inputCells",{r:j(o),val:r===null||r instanceof z?"":typeof r=="boolean"?r?"1":"0":String(r)}),t=(o,r)=>s("scenario",{name:o,locked:!0,count:r.length,user:"AllyHub"},...r);return s("scenarios",{current:0,show:0,sqref:[...n.keys()].join(" ")},t(Pe,[...n.values()].map(o=>e(o,o.base))),...l.scenarios.map(o=>t(o.name,o.cells.map(r=>e(r,r.value)))))}function De(l,n,e,t){const o=[];let r=0;for(const{row:d,col:h,paths:i,column:a}of ge(l,n)){let c=0;const u=we(a);for(const T of i){const w=$e(T)?e?.(T):void 0,E=w&&ee(w);if(!w||!E){r+=1;continue}const g=Math.round(E.width/E.height*u);o.push({row:d,col:h,x:c,width:g,height:u,name:T.split("/").pop()??T,file:`.${E.type==="jpeg"?"jpg":E.type}`,bytes:w}),c+=g+4}}for(const d of l.spec.pictures??[]){const h=J(d.at),i=e?.(d.file),a=i&&ee(i);if(!h||!i||!a)continue;const c=a.width/a.height,u=d.width??(d.height===void 0?a.width:d.height*c);o.push({row:h.row,col:h.col,x:d.x??0,y:d.y??0,width:Math.round(u),height:Math.round(d.height??u/c),name:d.file.split("/").pop()??d.file,file:`.${a.type==="jpeg"?"jpg":a.type}`,bytes:i})}return r>0&&t.push(`${l.name}: ${String(r)} file${r===1?"":"s"} in a cell, which stay${r===1?"s":""} a name`),o}class je{arrays=!1;places=new Map;sheet;calc;styles;strings;wb;cached;left;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;constructor(n,e,t,o,r,d,h=[],i){this.sheet=n,this.calc=e,this.wb=e.wb,this.styles=t,this.strings=o,this.cached=r,this.left=d,this.isTable=c=>this.wb.table(c)!==void 0,this.isRangeName=c=>{const u=this.wb.name(c)?.formula?.node;return this.isTable(c)||u!==void 0&&X({kind:"unary",op:"-",arg:u})},this.hiddenRows=e.filtered(n),this.scenarios=i,this.drawn=n.charts.length>0||h.length>0;const a=new Map;for(const c of h)c.y===void 0&&a.set(c.row,Math.max(a.get(c.row)??0,c.height));this.tall=a}add(n,e){let t=this.places.get(n);t||(t=new Set,this.places.set(n,t)),t.add(e)}gather(){const{sheet:n}=this;for(let e=0;e<n.columnsUsed;e++){const[t,o]=n.span(e,0,Number.MAX_SAFE_INTEGER);for(let r=t;r<=o;r++)(n.at(r,e)!==void 0||n.spillAt(r,e))&&this.add(r,e)}for(const{area:e}of n.styledAreas()){const t=(e.bottom-e.top+1)*(e.right-e.left+1);if(t>Le){this.left.push(`${n.name}!${L(e)}: its look on the cells that hold something, ${String(t)} cells being too many to write empty`);continue}for(let o=e.top;o<=e.bottom;o++)for(let r=e.left;r<=e.right;r++)this.add(o,r)}for(const e of n.keys.keys())this.add(Math.floor(e/16384),e%16384)}styleOf(n,e){const t=this.sheet.lookAt(n,e);return Object.keys(t).length===0?void 0:this.styles.xf(t)}held(n,e){return e.length<=B?e:(this.left.push(`${this.sheet.name}!${n} past Excel's ${String(B)} characters, of its ${String(e.length)}`),e.slice(0,B))}value(n,e,t){return t===null?s("c",{r:n,s:e}):typeof t=="number"?`<c r="${n}"${k(e)}><v>${String(t)}</v></c>`:typeof t=="boolean"?`<c r="${n}"${k(e)} t="b"><v>${t?"1":"0"}</v></c>`:t instanceof z?ie(t)?`<c r="${n}"${k(e)} t="e"><v>${t.code}</v></c>`:`<c r="${n}"${k(e)} t="s"><v>${String(this.strings.of(t.code))}</v></c>`:`<c r="${n}"${k(e)} t="s"><v>${String(this.strings.of(this.held(n,t)))}</v></c>`}table(n){return this.sheet.tableAt(n.row,n.col)?.name}formula(n,e,t){const o=this.calc.value(t.sheet,t.row,t.col),{node:r}=t.shared;if(!r)return`<c r="${n}"${k(e)} t="e"><v>#NAME?</v></c>`;const d=t.moved,h=t.array!==void 0||t.blocked!==void 0||X(d,this.isRangeName),i=H(d,{table:this.table(t),isTable:this.isTable,array:h});let a=`<f>${G(i)}</f>`,c="";if(h){this.arrays=!0;const u=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};a=`<f t="array" ref="${L(u)}">${G(i)}</f>`,c=' cm="1"'}return this.cached?o===null||typeof o=="number"?`<c r="${n}"${k(e)}${c}>${a}<v>${String(o??0)}</v></c>`:typeof o=="boolean"?`<c r="${n}"${k(e)} t="b"${c}>${a}<v>${o?"1":"0"}</v></c>`:o instanceof z?ie(o)?`<c r="${n}"${k(e)} t="e"${c}>${a}<v>${o.code}</v></c>`:`<c r="${n}"${k(e)}${c}>${a}<v>0</v></c>`:`<c r="${n}"${k(e)} t="str"${c}>${a}<v>${x(this.held(n,o))}</v></c>`:`<c r="${n}"${k(e)}${c}>${a}</c>`}cell(n,e){const t=j({row:n,col:e}),o=this.styleOf(n,e),r=this.sheet.at(n,e);return r instanceof ve?this.formula(t,o,r):r===void 0&&this.sheet.spillAt(n,e)&&this.cached?this.value(t,o,this.calc.value(this.sheet,n,e)):this.value(t,o,r??null)}columns(){const{sheet:n}=this,{spec:e}=n,t=new Map,o=new Map;for(const i of n.tables)for(const a of i.columns)a.spec?.width!==void 0&&o.set(i.at.col+a.index,a.spec.width);const r=new Set(o.keys()),d=new Map;for(const[i,a]of Object.entries(e.columns??{})){const c=ue(i);c!==void 0&&(d.set(c,a),r.add(c))}for(const i of r){const a=d.get(i),c=a?.width??o.get(i),u=ae(a);t.set(i,s("col",{min:i+1,max:i+1,width:_e(c??Ee),style:u===void 0?void 0:this.styles.xf(u),hidden:a?.hidden===!0?!0:void 0,customWidth:c===void 0?void 0:!0,outlineLevel:a?.level}))}const h=[...t.keys()].sort((i,a)=>i-a).map(i=>t.get(i)??"");return h.length===0?"":s("cols",{},...h)}rowAttrs(n){const e=this.sheet.spec.rows?.[String(n+1)],t=ae(e),o=e?.height??this.tall.get(n);return{r:n+1,s:t===void 0?void 0:this.styles.xf(t),customFormat:t===void 0?void 0:!0,ht:o===void 0?void 0:Re(o),customHeight:o===void 0?void 0:!0,hidden:e?.hidden===!0||this.hiddenRows.has(n)?!0:void 0,outlineLevel:e?.level}}rows(){const{sheet:n}=this,e=new Set(this.places.keys());for(const o of Object.keys(n.spec.rows??{}))e.add(Number(o)-1);for(const o of this.hiddenRows)e.add(o);const t=[];for(const o of[...e].sort((r,d)=>r-d)){const r=[...this.places.get(o)??[]].sort((i,a)=>i-a),d=s("row",this.rowAttrs(o)).slice(4,-2);if(r.length===0){t.push(`<row${d}/>`);continue}let h=`<row${d}>`;for(const i of r)h+=this.cell(o,i);t.push(`${h}</row>`)}return t.join("")}view(n){const{freeze:e}=this.sheet;let t="";if(e&&(e.row>0||e.col>0)){const o=e.row>0&&e.col>0?"bottomRight":e.row>0?"bottomLeft":"topRight";t=s("pane",{xSplit:e.col>0?e.col:void 0,ySplit:e.row>0?e.row:void 0,topLeftCell:j(e),activePane:o,state:"frozen"})}return s("sheetViews",{},s("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:n?!0:void 0,workbookViewId:0},t))}write(n,e){const{sheet:t}=this;this.gather();const o=Xe(this.places),r=this.rows(),d=t.merges.map(g=>s("mergeCell",{ref:L(g)})),h=t.tables.map((g,y)=>s("tablePart",{"r:id":`rId${String(y+1)}`})),{print:i}=t.spec,a=i?.fit,c=Object.keys(t.spec.notes??{}).length>0,u=h.length+1+(this.drawn?1:0)+(c?2:0);let T=0;const w=Object.entries(t.spec.links??{}).map(([g,y])=>y.startsWith("#")?s("hyperlink",{ref:g,location:y.slice(1)}):s("hyperlink",{ref:g,"r:id":`rId${String(u+T++)}`}));return{xml:v+s("worksheet",{xmlns:A.main,"xmlns:r":A.rel},t.spec.tab===void 0&&a===void 0?"":s("sheetPr",{},t.spec.tab===void 0?"":s("tabColor",{rgb:`FF${t.spec.tab.slice(1).toUpperCase()}`}),a===void 0?"":s("pageSetUpPr",{fitToPage:!0})),s("dimension",{ref:o?L(o):"A1"}),this.view(n),s("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:ne(t.spec.rows),outlineLevelCol:ne(t.spec.columns)}),this.columns(),r===""?s("sheetData"):`<sheetData>${r}</sheetData>`,t.spec.protect===!0?s("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"",this.scenarios?Fe(this.scenarios):"",this.sheetFilter(),d.length>0?s("mergeCells",{count:d.length},...d):"",...t.conditions.map((g,y)=>this.condition(g,y+1)),this.validations(),w.length>0?s("hyperlinks",{},...w):"",s("pageMargins",{...Ne,...i?.margins}),i?.orientation!==void 0||i?.paper!==void 0||a!==void 0?s("pageSetup",{paperSize:i?.paper===void 0?void 0:fe[i.paper],fitToWidth:a?.width,fitToHeight:a?.height,orientation:i?.orientation}):"",i?.header||i?.footer?s("headerFooter",{},i.header?s("oddHeader",{},x(se(i.header))):"",i.footer?s("oddFooter",{},x(se(i.footer))):""):"",this.drawn?s("drawing",{"r:id":`rId${String(h.length+1)}`}):"",c?s("legacyDrawing",{"r:id":`rId${String(h.length+(this.drawn?2:1))}`}):"",h.length>0?s("tableParts",{count:h.length},...h):""),tables:t.tables.map((g,y)=>this.tableXml(g,e+y))}}bound(n){if(n===void 0)return"";if(typeof n=="number")return String(n);if(!n.startsWith("=")){const t=be(n);return typeof t.value=="number"&&t.formula===void 0?String(t.value):`"${n.replaceAll('"','""')}"`}const e=xe(n);return e.ok?H(e.node,{isTable:this.isTable,array:!0}):n.slice(1)}cfvo(n){return s("cfvo",{type:n.at,val:n.value===void 0?void 0:typeof n.value=="number"?n.value:this.bound(n.value)})}condition(n,e){const{spec:t}=n,o=t.range,r=(a,...c)=>s("conditionalFormatting",{sqref:o},s("cfRule",{...a,priority:e,stopIfTrue:t.stop===!0?!0:void 0},...c)),d=()=>{const a=Ue(t);return Object.keys(a).length===0?void 0:this.styles.dxf(a)},h=n.areas[0],i=h?j({row:h.top,col:h.left}):"A1";switch(t.type){case"cellIs":return r({type:"cellIs",dxfId:d(),operator:t.operator},...t.formula.map(a=>s("formula",{},x(this.bound(a)))));case"containsText":{const a=t.operator??"contains",c=`"${t.text.replaceAll('"','""')}"`,u=a==="contains"?`NOT(ISERROR(SEARCH(${c},${i})))`:a==="notContains"?`ISERROR(SEARCH(${c},${i}))`:a==="beginsWith"?`LEFT(${i},LEN(${c}))=${c}`:`RIGHT(${i},LEN(${c}))=${c}`;return r({type:a==="contains"?"containsText":a==="notContains"?"notContainsText":a,dxfId:d(),operator:a==="contains"?"containsText":a,text:t.text},s("formula",{},x(u)))}case"duplicateValues":case"uniqueValues":return r({type:t.type,dxfId:d()});case"top10":return r({type:"top10",dxfId:d(),percent:t.percent===!0?!0:void 0,bottom:t.bottom===!0?!0:void 0,rank:t.rank});case"aboveAverage":return r({type:"aboveAverage",dxfId:d(),aboveAverage:t.below===!0?!1:void 0,equalAverage:t.equal===!0?!0:void 0});case"expression":return r({type:"expression",dxfId:d()},s("formula",{},x(this.bound(t.formula.startsWith("=")?t.formula:`=${t.formula}`))));case"dataBar":return r({type:"dataBar"},s("dataBar",{showValue:t.show===!1?!1:void 0},this.cfvo(t.min??{at:"min"}),this.cfvo(t.max??{at:"max"}),s("color",{rgb:re(t.color)})));case"colorScale":return r({type:"colorScale"},s("colorScale",{},...t.stops.map(a=>this.cfvo(a)),...t.stops.map(a=>s("color",{rgb:re(a.color)}))));case"iconSet":{const a=Number.parseInt(t.icons,10),c=t.stops??Array.from({length:a},(u,T)=>({at:"percent",value:Math.round(T*100/a)}));return r({type:"iconSet"},s("iconSet",{iconSet:t.icons,showValue:t.show===!1?!1:void 0,reverse:t.reverse===!0?!0:void 0},...c.map(u=>this.cfvo(u))))}}}validation(n){const{spec:e}=n;let t="";if(e.values){const h=e.values.join(",");(h.length>q||e.values.some(i=>i.includes(",")))&&this.left.push(`${this.sheet.name}!${e.range}: a list a file's cell cannot spell out, its values longer than ${String(q)} characters or holding a comma`),t=`"${h.slice(0,q)}"`}else t=this.bound(e.formula?.[0]);const o=this.bound(e.formula?.[1]),{error:r,prompt:d}=e;return e.multiple===!0&&this.left.push(`${this.sheet.name}!${e.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`),s("dataValidation",{type:e.type,errorStyle:r?.style===void 0||r.style==="stop"?void 0:r.style,operator:e.operator===void 0||e.operator==="between"?void 0:e.operator,allowBlank:e.blank===!1?void 0:!0,showDropDown:e.dropdown===!1?!0:void 0,showInputMessage:d?.show===!1?void 0:!0,showErrorMessage:r?.show===!1||e.multiple===!0?void 0:!0,errorTitle:r?.title,error:r?.message,promptTitle:d?.title,prompt:d?.message,sqref:e.range},t===""?"":s("formula1",{},x(t)),o===""?"":s("formula2",{},x(o)))}validations(){const n=this.sheet.validations;return n.length===0?"":s("dataValidations",{count:n.length},...n.map(e=>this.validation(e)))}filterColumns(n){return[...n.columns.entries()].sort(([e],[t])=>e-t).map(([e,t])=>We(e-n.area.left,t))}sheetFilter(){const n=this.sheet.filters.find(e=>!e.table);return n?s("autoFilter",{ref:L(n.area)},...this.filterColumns(n)):""}columnFormula(n,e){if(!e?.node)return"";const t=X(e.node,this.isRangeName),o=H(e.node,{table:n.name,isTable:this.isTable,array:t});return s("calculatedColumnFormula",{array:t?!0:void 0},G(o))}tableXml(n,e){const t=n.area,o=L({...t,bottom:Math.max(t.bottom,t.top+1)}),r=n.spec.style??DEFAULT_TABLE_STYLE,d=this.sheet.filters.find(h=>h.table===n);return v+s("table",{xmlns:A.main,id:e,name:n.name,displayName:n.name,ref:o,totalsRowShown:0},d?s("autoFilter",{ref:o},...this.filterColumns(d)):"",s("tableColumns",{count:n.columns.length},...n.columns.map((h,i)=>s("tableColumn",{id:i+1,name:h.name},this.columnFormula(n,h.formula)))),r==="none"?s("tableStyleInfo",{showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}):s("tableStyleInfo",{name:r,showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}))}}const Ne={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},ne=l=>{const n=Object.values(l??{}).flatMap(e=>e.level===void 0?[]:[e.level]);return n.length>0?Math.max(...n):void 0},se=l=>[l.left===void 0?"":`&L${l.left}`,l.center===void 0?"":`&C${l.center}`,l.right===void 0?"":`&R${l.right}`].join(""),ze=l=>typeof l=="string"?{text:l,author:oe}:{text:l.text,author:l.author??oe},oe="AllyHub";function He(l){const n=l.map(([t,o])=>({ref:t,...ze(o)})),e=[...new Set(n.map(t=>t.author))];return v+s("comments",{xmlns:A.main},s("authors",{},...e.map(t=>s("author",{},x(t)))),s("commentList",{},...n.map(t=>s("comment",{ref:t.ref,authorId:e.indexOf(t.author)},s("text",{},s("r",{},s("t",{},x(t.text))))))))}function Ve(l){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${l.flatMap(([e],t)=>{const o=J(e);return o?[`<v:shape id="_x0000_s${String(1025+t)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(t+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(o.col+1)}, 15, ${String(o.row)}, 2, ${String(o.col+3)}, 15, ${String(o.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(o.row)}</x:Row><x:Column>${String(o.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const re=l=>`FF${l.slice(1).toUpperCase()}`;function Ue(l){if(l.type==="dataBar"||l.type==="colorScale"||l.type==="iconSet")return{};const n={};for(const e of["bold","italic","underline","strike","color","fill","border"])l[e]!==void 0&&(n[e]=l[e]);return n}function We(l,n){return s("filterColumn",{colId:l},s("filters",{blank:n.blanks===!0?!0:void 0},...(n.values??[]).map(e=>s("filter",{val:e}))))}const k=l=>l===void 0?"":` s="${String(l)}"`,ie=l=>l.code!=="#CYCLE!";function Xe(l){let n;for(const[e,t]of l)for(const o of t)n?(n.top=Math.min(n.top,e),n.bottom=Math.max(n.bottom,e),n.left=Math.min(n.left,o),n.right=Math.max(n.right,o)):n={top:e,bottom:e,left:o,right:o};return n}const Be=new Set(["width","height","hidden"]);function ae(l){if(!l)return;const n=Object.fromEntries(Object.entries(l).filter(([e])=>!Be.has(e)));return Object.keys(n).length===0?void 0:n}const V=l=>v+s("Relationships",{xmlns:A.pkg},...l.map(([n,e,t],o)=>s("Relationship",{Id:`rId${String(o+1)}`,Type:n,Target:e,TargetMode:t})));function qe(l,n){const e=l.name(n);if(!e)return;const t=e.formula?.node;if(t)return H(t,{isTable:r=>l.table(r)!==void 0,array:!0});const{value:o}=e;return o==null?'""':typeof o=="string"?`"${o.replaceAll('"','""')}"`:typeof o=="boolean"?o?"TRUE":"FALSE":o instanceof z?o.code:String(o)}const Ge=(l,n)=>l.length===n.length&&l.every((e,t)=>e===n[t]),le=l=>`$${K(l.left)}$${String(l.top+1)}:$${K(l.right)}$${String(l.bottom+1)}`;export function writeXlsx(l,n={}){const e=l.wb,t=[];e.checks.length>0&&t.push(`${String(e.checks.length)} check${e.checks.length===1?"":"s"}: a file has no such thing`);const o=ye(l);t.push(...o.left);const r=new Te,d=new Oe,h=new TextEncoder,i={},a=[["/xl/workbook.xml",S.sheet]],c=Math.max(0,e.sheets.findIndex(m=>m.spec.hidden!==!0));let u=1,T=!1;const w=new Map;let E=0,g=0,y=0;for(const[m,f]of e.sheets.entries()){const R=String(m+1),M=De(f,l,n.file,t),_=f.charts.filter(({spec:p})=>[p.categories,...p.series.flatMap(C=>[C.values,C.x])].some(C=>C?.endsWith("#"))).length;_>0&&t.push(`${f.name}: ${String(_)} chart${_===1?"":"s"} on a spill: ${_===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const P=new je(f,l,r,d,n.cached!==!1,t,M,o.sheets.find(p=>p.sheet===f)),F=P.write(m===c,u);T||=P.arrays,i[`xl/worksheets/sheet${R}.xml`]=F.xml,a.push([`/xl/worksheets/sheet${R}.xml`,S.worksheet]);const b=[];for(const p of F.tables){const C=`table${String(u)}.xml`;u+=1,i[`xl/tables/${C}`]=p,a.push([`/xl/tables/${C}`,S.table]),b.push([`${$}table`,`../tables/${C}`])}if(f.charts.length>0||M.length>0){E+=1;const p=`drawing${String(E)}.xml`;i[`xl/drawings/${p}`]=ke(f.charts,M),a.push([`/xl/drawings/${p}`,S.drawing]),b.push([`${$}drawing`,`../drawings/${p}`]);const C=f.charts.map(D=>{g+=1;const N=`chart${String(g)}.xml`;return i[`xl/charts/${N}`]=Se(l,f,D),a.push([`/xl/charts/${N}`,S.chart]),[`${$}chart`,`../charts/${N}`]});for(const D of M){const Z=[...w].find(([,he])=>Ge(he,D.bytes))?.[0]??`image${String(w.size+1)}${D.file}`;w.set(Z,D.bytes),C.push([`${$}image`,`../media/${Z}`])}i[`xl/drawings/_rels/${p}.rels`]=V(C)}const W=Object.entries(f.spec.notes??{});if(W.length>0){y+=1;const p=String(y);i[`xl/comments${p}.xml`]=He(W),a.push([`/xl/comments${p}.xml`,S.comments]),i[`xl/drawings/vmlDrawing${p}.vml`]=Ve(W),b.push([`${$}vmlDrawing`,`../drawings/vmlDrawing${p}.vml`]),b.push([`${$}comments`,`../comments${p}.xml`])}for(const p of Object.values(f.spec.links??{}))p.startsWith("#")||b.push([`${$}hyperlink`,p,"External"]);b.length>0&&(i[`xl/worksheets/_rels/sheet${R}.xml.rels`]=V(b))}const ce=e.sheets.length,I=e.sheets.map((m,f)=>[`${$}worksheet`,`worksheets/sheet${String(f+1)}.xml`]);I.push([`${$}theme`,"theme/theme1.xml"]),I.push([`${$}styles`,"styles.xml"]),I.push([`${$}sharedStrings`,"sharedStrings.xml"]),T&&(I.push([`${$}sheetMetadata`,"metadata.xml"]),i["xl/metadata.xml"]=v+Ie,a.push(["/xl/metadata.xml",S.metadata]));const O=[...e.names.values()].flatMap(m=>{const f=qe(e,m.name);return f===void 0?[]:[s("definedName",{name:m.name},x(f))]});e.sheets.forEach((m,f)=>{const R=m.filters.find(b=>!b.table);R&&O.push(s("definedName",{name:"_xlnm._FilterDatabase",localSheetId:f,hidden:!0},x(`${Q(m.name)}${le(R.area)}`)));const M=Q(m.name),_=m.spec.print,P=_?.area===void 0?void 0:pe(_.area);P&&O.push(s("definedName",{name:"_xlnm.Print_Area",localSheetId:f},x(`${M}${le(P)}`)));const F=[_?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),_?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(b=>b===void 0?[]:[`${M}${b}`]);F.length>0&&O.push(s("definedName",{name:"_xlnm.Print_Titles",localSheetId:f},x(F.join(","))))}),i["xl/workbook.xml"]=v+s("workbook",{xmlns:A.main,"xmlns:r":A.rel},s("workbookPr",{}),s("bookViews",{},s("workbookView",{activeTab:c===0?void 0:c})),s("sheets",{},...e.sheets.map((m,f)=>s("sheet",{name:m.name,sheetId:f+1,state:m.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String(f+1)}`}))),O.length>0?s("definedNames",{},...O):"",s("calcPr",{calcId:Ae,fullCalcOnLoad:!0})),i["xl/_rels/workbook.xml.rels"]=V(I),i["xl/styles.xml"]=v+r.xml(),i["xl/sharedStrings.xml"]=v+d.xml(),i["xl/theme/theme1.xml"]=v+Ce,i["docProps/core.xml"]=v+s("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":s("dc:title",{},x(e.title))),i["docProps/app.xml"]=v+s("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},s("Application",{},"AllyHub")),i["_rels/.rels"]=V([[`${$}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${$}extended-properties`,"docProps/app.xml"]]),a.push(["/xl/styles.xml",S.styles],["/xl/sharedStrings.xml",S.strings],["/xl/theme/theme1.xml",S.theme],["/docProps/core.xml",S.core],["/docProps/app.xml",S.app]),i["[Content_Types].xml"]=v+s("Types",{xmlns:A.types},s("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),s("Default",{Extension:"xml",ContentType:"application/xml"}),y>0?s("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",...[...new Set([...w.keys()].map(m=>m.split(".").pop()??""))].sort().map(m=>s("Default",{Extension:m,ContentType:`image/${m==="jpg"?"jpeg":m}`})),...a.map(([m,f])=>s("Override",{PartName:m,ContentType:f})));const Y=["[Content_Types].xml","_rels/.rels","docProps/app.xml","docProps/core.xml","xl/workbook.xml","xl/_rels/workbook.xml.rels",...Array.from({length:ce},(m,f)=>`xl/worksheets/sheet${String(f+1)}.xml`)],de=[...Y,...Object.keys(i).filter(m=>!Y.includes(m)).sort()],U={};for(const m of de)U[m]=[h.encode(i[m]??""),{mtime:te}];for(const[m,f]of[...w].sort(([R],[M])=>R.localeCompare(M)))U[`xl/media/${m}`]=[f,{mtime:te}];return{bytes:me(U),left:t}}
|
|
2
|
+
import{SHEET_MARGINS as pe,SHEET_NOTE_AUTHOR as K,SHEET_PAPERS as we}from"@allyhub-next/formats";import{MAX_COLUMNS as Q,MAX_ROWS as ee,cellName as _,columnIndex as xe,columnLetter as D,rangeName as M,readAddress as te,readArea as ge}from"../address.js";import{parseFormula as $e}from"../formula/parse.js";import{sheetPrefix as X}from"../formula/print.js";import{walk as ye}from"../formula/walk.js";import{fileCells as be,isPicture as ve,pictureHeight as Se,pictureSize as se}from"../files.js";import{scenariosByCell as ke}from"../scenario.js";import{CellError as P,readTyped as Ae}from"../values.js";import{FormulaCell as Ce}from"../workbook.js";import{chartPart as Ee,drawingPart as Te}from"./charts.js";import{fileFormula as N,needsArray as B}from"./formula.js";import{GRID_END as W}from"./read.js";import{Styles as Me}from"./styles.js";import{THEME_XML as Re}from"./theme.js";import{HEAD as S,NS as k,el as o,xstring as x}from"./xml.js";import{ZipOut as _e}from"./zip.js";const A={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},v=`${k.rel}/`,ne="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",oe="http://schemas.microsoft.com/office/excel/2006/main",re={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},je=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2",LISTS_SHEET="AllyHub lists";const Le=64,Oe=7,Fe=a=>Math.min(255,Math.floor(a/Oe*256)/256),Ie=a=>Math.min(409.5,a*3/4),q=32767,De=255,Pe=2e5,Ne=o("metadata",{xmlns:k.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},o("metadataTypes",{count:1},o("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),o("futureMetadata",{name:"XLDAPR",count:1},o("bk",{},o("extLst",{},o("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},o("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),o("cellMetadata",{count:1},o("bk",{},o("rc",{t:1,v:0}))));class Ve{index=new Map;count=0;of(t){this.count+=1;let s=this.index.get(t);return s===void 0&&(s=this.index.size,this.index.set(t,s)),s}write(t){t.write(`${S}<sst xmlns="${k.main}" count="${String(this.count)}" uniqueCount="${String(this.index.size)}">`);for(const s of this.index.keys()){const e=/^\s|\s$|\n/u.test(s);t.write(`<si><t${e?' xml:space="preserve"':""}>${x(s)}</t></si>`)}t.write("</sst>"),t.end()}}function ze(a){for(const t in a)if(Object.hasOwn(a,t))return!1;return!0}const He=a=>o("x",a).slice(2,-2),Ue="Base case";function Xe(a){const t=new Map;for(const n of a.scenarios)for(const r of n.cells)t.set(_(r),r);const s=(n,r)=>o("inputCells",{r:_(n),val:r===null||r instanceof P?"":typeof r=="boolean"?r?"1":"0":String(r)}),e=(n,r)=>o("scenario",{name:n,locked:!0,count:r.length,user:"AllyHub"},r.join(""));return o("scenarios",{current:0,show:0,sqref:[...t.keys()].join(" ")},e(Ue,[...t.values()].map(n=>s(n,n.base))),...a.scenarios.map(n=>e(n.name,n.cells.map(r=>s(r,r.value)))))}function Be(a,t,s,e){const n=[];let r=0;for(const{row:l,col:h,paths:c,column:i}of be(a,t)){let d=0;const f=Se(i);for(const m of c){const u=ve(m)?s?.(m):void 0,$=u&&se(u);if(!u||!$){r+=1;continue}const T=Math.round($.width/$.height*f);n.push({row:l,col:h,x:d,width:T,height:f,name:m.split("/").pop()??m,path:m,file:`.${$.type==="jpeg"?"jpg":$.type}`,bytes:u}),d+=T+4}}for(const l of a.spec.pictures??[]){const h=te(l.at),c=s?.(l.file),i=c&&se(c);if(!h||!c||!i)continue;const d=i.width/i.height,f=l.width??(l.height===void 0?i.width:l.height*d);n.push({row:h.row,col:h.col,x:l.x??0,y:l.y??0,width:Math.round(f),height:Math.round(l.height??f/d),name:l.file.split("/").pop()??l.file,path:l.file,file:`.${i.type==="jpeg"?"jpg":i.type}`,bytes:c})}return r>0&&e.push(`${a.name}: ${String(r)} file${r===1?"":"s"} in a cell, which stay${r===1?"s":""} a name`),n}class We{name;columns=[];known=new Map;constructor(t){let s=LISTS_SHEET;for(let e=2;t.sheet(s);e++)s=`${LISTS_SHEET} (${String(e)})`;this.name=s}place(t){const s=JSON.stringify(t);let e=this.known.get(s);e===void 0&&(e=this.columns.length,this.columns.push(t),this.known.set(s,e));const n=D(e);return`${X(this.name)}$${n}$1:$${n}$${String(Math.max(1,t.length))}`}xml(t){const s=[],e=Math.max(0,...this.columns.map(n=>n.length));for(let n=0;n<e;n++){let r=`<row r="${String(n+1)}">`;this.columns.forEach((l,h)=>{const c=l[n];c!==void 0&&(r+=`<c r="${_({row:n,col:h})}" t="s"><v>${String(t.of(c))}</v></c>`)}),s.push(`${r}</row>`)}return`${S}<worksheet xmlns="${k.main}" xmlns:r="${k.rel}"><dimension ref="${M({top:0,left:0,bottom:Math.max(0,e-1),right:Math.max(0,this.columns.length-1)})}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${s.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`}}class qe{rows=new Int32Array(1024);cols=new Int32Array(1024);size=0;add(t,s){if(this.size===this.rows.length){const e=new Int32Array(this.size*2);e.set(this.rows),this.rows=e;const n=new Int32Array(this.size*2);n.set(this.cols),this.cols=n}this.rows[this.size]=t,this.cols[this.size]=s,this.size+=1}byRow(){const{size:t}=this;if(t===0)return{start:new Uint32Array(1),cols:new Int32Array(0),top:0,used:void 0};let s=1/0,e=-1,n=1/0,r=-1;for(let i=0;i<t;i++){const d=this.rows[i]??0,f=this.cols[i]??0;d<s&&(s=d),d>e&&(e=d),f<n&&(n=f),f>r&&(r=f)}const l=new Uint32Array(e-s+2);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-s+1;l[d]=(l[d]??0)+1}for(let i=1;i<l.length;i++)l[i]=(l[i]??0)+(l[i-1]??0);const h=l.slice(0,-1),c=new Int32Array(t);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-s,f=h[d]??0;c[f]=this.cols[i]??0,h[d]=f+1}return{start:l,cols:c,top:s,used:{top:s,bottom:e,left:n,right:r}}}}function Ge(a,t){if(!a)return!1;let s=!1;const e=t.toLowerCase();return ye(a,n=>{(n.kind==="ref"||n.kind==="name")&&n.sheet!==void 0&&n.sheet.toLowerCase()!==e&&(s=!0)}),s}const Ye=(a,t)=>`{00000000-0000-4000-8000-${(a*65536+t).toString(16).toUpperCase().padStart(12,"0")}}`;class Ze{arrays=!1;sheet;calc;styles;strings;wb;cached;left;lists;index;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;newerRules=[];newerValidations=[];shapes=new Map;groups=new Map;constructor(t,s,e,n,r,l,h,c,i=[],d){this.sheet=t,this.calc=s,this.wb=s.wb,this.styles=e,this.strings=n,this.cached=r,this.left=l,this.lists=h,this.index=c,this.isTable=m=>this.wb.table(m)!==void 0,this.isRangeName=m=>{const u=this.wb.name(m,t)?.formula?.node;return this.isTable(m)||u!==void 0&&B({kind:"unary",op:"-",arg:u})},this.hiddenRows=s.filtered(t),this.scenarios=d,this.drawn=t.charts.length>0||i.length>0;const f=new Map;for(const m of i)m.y===void 0&&f.set(m.row,Math.max(f.get(m.row)??0,m.height));this.tall=f}grid(){const{sheet:t}=this;if(t.lastRow>=ee)throw new Error(`${t.name} reaches row ${(t.lastRow+1).toLocaleString("en-US")}, and ${W}: an Excel file cannot hold it.`);if(t.columnsUsed>Q)throw new Error(`${t.name} reaches past column ${D(Q-1)}, and ${W}: an Excel file cannot hold it.`);for(const s of Object.keys(t.spec.rows??{}))if(Number(s)>ee)throw new Error(`${t.name} sets row ${s}, and ${W}: an Excel file cannot hold it.`)}gather(){const{sheet:t}=this,s=new qe;for(let e=0;e<t.columnsUsed;e++){const[n,r]=t.span(e,0,Number.MAX_SAFE_INTEGER);for(let l=n;l<=r;l++)(t.at(l,e)!==void 0||t.spillAt(l,e))&&s.add(l,e)}for(const{area:e}of t.styledAreas()){const n=(e.bottom-e.top+1)*(e.right-e.left+1);if(n>Pe){this.left.push(`${t.name}!${M(e)}: its look on the cells that hold something, ${String(n)} cells being too many to write empty`);continue}for(let r=e.top;r<=e.bottom;r++)for(let l=e.left;l<=e.right;l++)s.add(r,l)}for(const e of t.keys.keys())s.add(Math.floor(e/16384),e%16384);return s.byRow()}styleOf(t,s){const e=this.sheet.lookAt(t,s);return ze(e)?void 0:this.styles.xf(e)}held(t,s){return s.length<=q?s:(this.left.push(`${this.sheet.name}!${t} past Excel's ${String(q)} characters, of its ${String(s.length)}`),s.slice(0,q))}value(t,s,e){return e===null?`<c r="${t}"${C(s)}/>`:typeof e=="number"?`<c r="${t}"${C(s)}><v>${String(e)}</v></c>`:typeof e=="boolean"?`<c r="${t}"${C(s)} t="b"><v>${e?"1":"0"}</v></c>`:e instanceof P?ce(e)?`<c r="${t}"${C(s)} t="e"><v>${e.code}</v></c>`:`<c r="${t}"${C(s)} t="s"><v>${String(this.strings.of(e.code))}</v></c>`:`<c r="${t}"${C(s)} t="s"><v>${String(this.strings.of(this.held(t,e)))}</v></c>`}table(t){return this.sheet.tableAt(t.row,t.col)?.name}formula(t,s,e){const n=this.calc.value(e.sheet,e.row,e.col),{shared:r}=e,{node:l}=r;if(!l)return`<c r="${t}"${C(s)} t="e"><v>#NAME?</v></c>`;let h=this.shapes.get(r);h===void 0&&(h=B(l,this.isRangeName),this.shapes.set(r,h));const c=e.array!==void 0||e.blocked!==void 0||h;let i=c?void 0:this.groups.get(r);i?.written===!1&&(e.row!==i.ref.top||e.col!==i.ref.left)&&(i=void 0);let d,f="";if(i?.written===!0)d=`<f t="shared" si="${String(i.si)}"/>`;else{const m=N(e.moved,{table:this.table(e),isTable:this.isTable,array:c});d=i?`<f t="shared" ref="${M(i.ref)}" si="${String(i.si)}">${x(m)}</f>`:`<f>${x(m)}</f>`,i&&(i.written=!0),c&&(d=this.arrayFormula(e,m))}return c&&(this.arrays=!0,f=' cm="1"'),this.cached?n===null||typeof n=="number"?`<c r="${t}"${C(s)}${f}>${d}<v>${String(n??0)}</v></c>`:typeof n=="boolean"?`<c r="${t}"${C(s)} t="b"${f}>${d}<v>${n?"1":"0"}</v></c>`:n instanceof P?ce(n)?`<c r="${t}"${C(s)} t="e"${f}>${d}<v>${n.code}</v></c>`:`<c r="${t}"${C(s)}${f}>${d}<v>0</v></c>`:`<c r="${t}"${C(s)} t="str"${f}>${d}<v>${x(this.held(t,n))}</v></c>`:`<c r="${t}"${C(s)}${f}>${d}</c>`}arrayFormula(t,s){const e=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};return`<f t="array" ref="${M(e)}">${x(s)}</f>`}shareFormulas(){const t=new Map;for(const e of this.sheet.formulas){const n=t.get(e.shared);if(!n)t.set(e.shared,{area:{top:e.row,bottom:e.row,left:e.col,right:e.col},first:e,n:1});else{const{area:r}=n;e.row<r.top&&(r.top=e.row),e.row>r.bottom&&(r.bottom=e.row),e.col<r.left&&(r.left=e.col),e.col>r.right&&(r.right=e.col),(e.row<n.first.row||e.row===n.first.row&&e.col<n.first.col)&&(n.first=e),n.n+=1}}let s=0;for(const[e,{area:n,first:r,n:l}]of t)l>1&&r.row===n.top&&r.col===n.left&&(this.groups.set(e,{si:s,ref:n,written:!1}),s+=1)}cell(t,s){const e=_({row:t,col:s}),n=this.styleOf(t,s),r=this.sheet.at(t,s);return r instanceof Ce?this.formula(e,n,r):r===void 0&&this.cached&&this.sheet.spillAt(t,s)?this.value(e,n,this.calc.value(this.sheet,t,s)):this.value(e,n,r??null)}columns(){const{sheet:t}=this,{spec:s}=t,e=new Map,n=new Map;for(const c of t.tables)for(const i of c.columns)i.spec?.width!==void 0&&n.set(c.at.col+i.index,i.spec.width);const r=new Set(n.keys()),l=new Map;for(const[c,i]of Object.entries(s.columns??{})){const d=xe(c);d!==void 0&&(l.set(d,i),r.add(d))}for(const c of r){const i=l.get(c),d=i?.width??n.get(c),f=de(i);e.set(c,o("col",{min:c+1,max:c+1,width:Fe(d??Le),style:f===void 0?void 0:this.styles.xf(f),hidden:i?.hidden===!0?!0:void 0,customWidth:d===void 0?void 0:!0,outlineLevel:i?.level}))}const h=[...e.keys()].sort((c,i)=>c-i).map(c=>e.get(c)??"");return h.length===0?"":`<cols>${h.join("")}</cols>`}rowAttrs(t){const s=this.sheet.spec.rows?.[String(t+1)],e=de(s),n=s?.height??this.tall.get(t);return He({r:t+1,s:e===void 0?void 0:this.styles.xf(e),customFormat:e===void 0?void 0:!0,ht:n===void 0?void 0:Ie(n),customHeight:n===void 0?void 0:!0,hidden:s?.hidden===!0||this.hiddenRows.has(t)?!0:void 0,outlineLevel:s?.level})}rows(t,s){const{sheet:e}=this,n=new Set(this.hiddenRows);for(const d of Object.keys(e.spec.rows??{}))n.add(Number(d)-1);const{start:r,cols:l,top:h}=s;let c=s.used?h:1/0,i=s.used?s.used.bottom:-1;for(const d of n)d<c&&(c=d),d>i&&(i=d);for(let d=Math.max(0,c);d<=i;d++){const f=d-h,m=f>=0&&f<r.length-1?r[f]??0:0,u=f>=0&&f<r.length-1?r[f+1]??0:0;if(m===u&&!n.has(d))continue;if(m===u){t.write(`<row${this.rowAttrs(d)}/>`);continue}const $=l.subarray(m,u).sort();let T=`<row${this.rowAttrs(d)}>`,y=-1;for(const b of $)b!==y&&(y=b,T+=this.cell(d,b));t.write(`${T}</row>`)}}view(t){const{freeze:s}=this.sheet;let e="";if(s&&(s.row>0||s.col>0)){const n=s.row>0&&s.col>0?"bottomRight":s.row>0?"bottomLeft":"topRight";e=o("pane",{xSplit:s.col>0?s.col:void 0,ySplit:s.row>0?s.row:void 0,topLeftCell:_(s),activePane:n,state:"frozen"})}return o("sheetViews",{},o("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:t?!0:void 0,workbookViewId:0},e))}write(t,s,e){const{sheet:n}=this;this.grid();const r=this.gather();this.shareFormulas();const l=n.tables.map((y,b)=>o("tablePart",{"r:id":`rId${String(b+1)}`})),{print:h}=n.spec,c=h?.fit,i=Object.keys(n.spec.notes??{}).length>0;t.write(`${S}<worksheet xmlns="${k.main}" xmlns:r="${k.rel}">`+(n.spec.tab===void 0&&c===void 0?"":o("sheetPr",{},n.spec.tab===void 0?"":o("tabColor",{rgb:`FF${n.spec.tab.slice(1).toUpperCase()}`}),c===void 0?"":o("pageSetUpPr",{fitToPage:!0})))+o("dimension",{ref:r.used?M(r.used):"A1"})+this.view(s)+o("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:ie(n.spec.rows),outlineLevelCol:ie(n.spec.columns)})+this.columns()+"<sheetData>"),this.rows(t,r);const d=l.length+1+(this.drawn?1:0)+(i?2:0);let f=0;const m=Object.entries(n.spec.links??{}).map(([y,b])=>b.startsWith("#")?o("hyperlink",{ref:y,location:b.slice(1)}):o("hyperlink",{ref:y,"r:id":`rId${String(d+f++)}`})),u=n.merges.map(y=>o("mergeCell",{ref:M(y)})),$=n.conditions.map((y,b)=>this.condition(y,b+1)).join(""),T=this.validations();return t.write("</sheetData>"+(n.spec.protect===!0?o("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"")+(this.scenarios?Xe(this.scenarios):"")+this.sheetFilter()+(u.length>0?o("mergeCells",{count:u.length},u.join("")):"")+$+T+(m.length>0?o("hyperlinks",{},m.join("")):"")+o("pageMargins",{...pe,...h?.margins})+(h?.orientation!==void 0||h?.paper!==void 0||c!==void 0?o("pageSetup",{paperSize:h?.paper===void 0?void 0:we[h.paper],fitToWidth:c?.width,fitToHeight:c?.height,orientation:h?.orientation}):"")+(h?.header||h?.footer?o("headerFooter",{},h.header?o("oddHeader",{},x(ae(h.header))):"",h.footer?o("oddFooter",{},x(ae(h.footer))):""):"")+(this.drawn?o("drawing",{"r:id":`rId${String(l.length+1)}`}):"")+(i?o("legacyDrawing",{"r:id":`rId${String(l.length+(this.drawn?2:1))}`}):"")+(l.length>0?o("tableParts",{count:l.length},l.join("")):"")+this.extensions()+"</worksheet>"),t.end(),n.tables.map((y,b)=>this.tableXml(y,e+b))}extensions(){const t=[];return this.newerRules.length>0&&t.push(o("ext",{uri:re.conditional,"xmlns:x14":ne},o("x14:conditionalFormattings",{},this.newerRules.join("")))),this.newerValidations.length>0&&t.push(o("ext",{uri:re.validations,"xmlns:x14":ne},o("x14:dataValidations",{count:this.newerValidations.length,"xmlns:xm":oe},this.newerValidations.join("")))),t.length===0?"":o("extLst",{},t.join(""))}bound(t){if(t===void 0)return"";if(typeof t=="number")return String(t);if(!t.startsWith("=")){const e=Ae(t);return typeof e.value=="number"&&e.formula===void 0?String(e.value):`"${t.replaceAll('"','""')}"`}const s=$e(t);return s.ok?N(s.node,{isTable:this.isTable,array:!0}):t.slice(1)}cfvo(t,s){const e=t.value===void 0?void 0:typeof t.value=="number"?String(t.value):this.bound(t.value);return s?o("x14:cfvo",{type:t.at},e===void 0?"":o("xm:f",{},x(e))):o("cfvo",{type:t.at,val:e})}crosses(t){return t.some(s=>Ge(s?.node,this.sheet.name))}condition(t,s){const{spec:e}=t,n=e.range,r=e.type!=="dataBar"&&this.crosses(t.formulas),l=(f,m,...u)=>{if(!r){const $=Object.keys(m).length===0?void 0:this.styles.dxf(m);return o("conditionalFormatting",{sqref:n},o("cfRule",{...f,dxfId:$,priority:s,stopIfTrue:e.stop===!0?!0:void 0},...u))}return this.newerRules.push(o("x14:conditionalFormatting",{"xmlns:xm":oe},o("x14:cfRule",{...f,priority:s,stopIfTrue:e.stop===!0?!0:void 0,id:Ye(this.index,s)},...u.map($=>$.replace(/^<formula>(.*)<\/formula>$/su,"<xm:f>$1</xm:f>")),Object.keys(m).length===0?"":this.styles.dxfXml(m,"x14:dxf")),o("xm:sqref",{},n))),""},h=et(e),c=t.areas[0],i=c?_({row:c.top,col:c.left}):"A1",d=f=>o("formula",{},x(f));switch(e.type){case"cellIs":return l({type:"cellIs",operator:e.operator},h,...e.formula.map(f=>d(this.bound(f))));case"containsText":{const f=e.operator??"contains",m=`"${e.text.replaceAll('"','""')}"`,u=f==="contains"?`NOT(ISERROR(SEARCH(${m},${i})))`:f==="notContains"?`ISERROR(SEARCH(${m},${i}))`:f==="beginsWith"?`LEFT(${i},LEN(${m}))=${m}`:`RIGHT(${i},LEN(${m}))=${m}`;return l({type:f==="contains"?"containsText":f==="notContains"?"notContainsText":f,operator:f==="contains"?"containsText":f,text:e.text},h,d(u))}case"duplicateValues":case"uniqueValues":return l({type:e.type},h);case"top10":return l({type:"top10",percent:e.percent===!0?!0:void 0,bottom:e.bottom===!0?!0:void 0,rank:e.rank},h);case"aboveAverage":return l({type:"aboveAverage",aboveAverage:e.below===!0?!1:void 0,equalAverage:e.equal===!0?!0:void 0},h);case"expression":return l({type:"expression"},h,d(this.bound(e.formula.startsWith("=")?e.formula:`=${e.formula}`)));case"dataBar":return l({type:"dataBar"},{},o("dataBar",{showValue:e.show===!1?!1:void 0},this.cfvo(e.min??{at:"min"},!1),this.cfvo(e.max??{at:"max"},!1),o("color",{rgb:le(e.color)})));case"colorScale":{const f=r?"x14:":"";return l({type:"colorScale"},{},o(`${f}colorScale`,{},...e.stops.map(m=>this.cfvo(m,r)),...e.stops.map(m=>o(`${f}color`,{rgb:le(m.color)}))))}case"iconSet":{const f=Number.parseInt(e.icons,10),m=e.stops??Array.from({length:f},(u,$)=>({at:"percent",value:Math.round($*100/f)}));return l({type:"iconSet"},{},o(r?"x14:iconSet":"iconSet",{iconSet:e.icons,showValue:e.show===!1?!1:void 0,reverse:e.reverse===!0?!0:void 0},...m.map(u=>this.cfvo(u,r))))}}}validation(t){const{spec:s}=t;let e="",n=this.crosses(t.formulas);if(s.values){const i=s.values.join(",");i.length>De||s.values.some(d=>d.includes(",")||d.includes('"'))?(e=this.lists.place(s.values),n=!0):e=`"${i}"`}else e=this.bound(s.formula?.[0]);const r=this.bound(s.formula?.[1]),{error:l,prompt:h}=s;s.multiple===!0&&this.left.push(`${this.sheet.name}!${s.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`);const c={type:s.type,errorStyle:l?.style===void 0||l.style==="stop"?void 0:l.style,operator:s.operator===void 0||s.operator==="between"?void 0:s.operator,allowBlank:s.blank===!1?void 0:!0,showDropDown:s.dropdown===!1?!0:void 0,showInputMessage:h?.show===!1?void 0:!0,showErrorMessage:l?.show===!1||s.multiple===!0?void 0:!0,errorTitle:l?.title,error:l?.message,promptTitle:h?.title,prompt:h?.message};return n?(this.newerValidations.push(o("x14:dataValidation",c,e===""?"":o("x14:formula1",{},o("xm:f",{},x(e))),r===""?"":o("x14:formula2",{},o("xm:f",{},x(r))),o("xm:sqref",{},s.range))),""):o("dataValidation",{...c,sqref:s.range},e===""?"":o("formula1",{},x(e)),r===""?"":o("formula2",{},x(r)))}validations(){const t=this.sheet.validations.map(s=>this.validation(s)).filter(s=>s!=="");return t.length===0?"":o("dataValidations",{count:t.length},t.join(""))}filterColumns(t){return[...t.columns.entries()].sort(([s],[e])=>s-e).map(([s,e])=>tt(s-t.area.left,e))}sheetFilter(){const t=this.sheet.filters.find(s=>!s.table);return t?o("autoFilter",{ref:M(t.area)},...this.filterColumns(t)):""}columnFormula(t,s){if(!s?.node)return"";const e=B(s.node,this.isRangeName),n=N(s.node,{table:t.name,isTable:this.isTable,array:e});return o("calculatedColumnFormula",{array:e?!0:void 0},x(n))}tableXml(t,s){const e=t.area,n=M({...e,bottom:Math.max(e.bottom,e.top+1)}),r=t.spec.style??DEFAULT_TABLE_STYLE,l=this.sheet.filters.find(h=>h.table===t);return S+o("table",{xmlns:k.main,id:s,name:t.name,displayName:t.name,ref:n,totalsRowShown:0},l?o("autoFilter",{ref:n},...this.filterColumns(l)):"",o("tableColumns",{count:t.columns.length},t.columns.map((h,c)=>o("tableColumn",{id:c+1,name:h.name},this.columnFormula(t,h.formula))).join("")),r==="none"?o("tableStyleInfo",{showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}):o("tableStyleInfo",{name:r,showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}))}}const ie=a=>{let t;for(const s of Object.values(a??{}))s.level!==void 0&&(t=Math.max(t??0,s.level));return t},ae=a=>[a.left===void 0?"":`&L${a.left}`,a.center===void 0?"":`&C${a.center}`,a.right===void 0?"":`&R${a.right}`].join(""),Je=a=>typeof a=="string"?{text:a,author:K}:{text:a.text,author:a.author??K};function Ke(a){const t=a.map(([e,n])=>({ref:e,...Je(n)})),s=[...new Set(t.map(e=>e.author))];return S+o("comments",{xmlns:k.main},o("authors",{},s.map(e=>o("author",{},x(e))).join("")),o("commentList",{},t.map(e=>o("comment",{ref:e.ref,authorId:s.indexOf(e.author)},o("text",{},o("r",{},o("t",/^\s|\s$|\n/u.test(e.text)?{"xml:space":"preserve"}:{},x(e.text)))))).join("")))}function Qe(a){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${a.flatMap(([s],e)=>{const n=te(s);return n?[`<v:shape id="_x0000_s${String(1025+e)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(e+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(n.col+1)}, 15, ${String(n.row)}, 2, ${String(n.col+3)}, 15, ${String(n.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(n.row)}</x:Row><x:Column>${String(n.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const le=a=>`FF${a.slice(1).toUpperCase()}`;function et(a){if(a.type==="dataBar"||a.type==="colorScale"||a.type==="iconSet")return{};const t={};for(const s of["bold","italic","underline","strike","color","fill","border"])a[s]!==void 0&&(t[s]=a[s]);return t}function tt(a,t){return o("filterColumn",{colId:a},o("filters",{blank:t.blanks===!0?!0:void 0},(t.values??[]).map(s=>o("filter",{val:s})).join("")))}const C=a=>a===void 0?"":` s="${String(a)}"`,ce=a=>a.code!=="#CYCLE!",st=new Set(["width","height","hidden"]);function de(a){if(!a)return;const t=Object.fromEntries(Object.entries(a).filter(([s])=>!st.has(s)));return Object.keys(t).length===0?void 0:t}const V=a=>S+o("Relationships",{xmlns:k.pkg},a.map(([t,s,e],n)=>o("Relationship",{Id:`rId${String(n+1)}`,Type:t,Target:s,TargetMode:e})).join(""));function nt(a,t){const s=t.formula?.node;if(s)return N(s,{isTable:n=>a.table(n)!==void 0,array:!0});const{value:e}=t;return e==null?'""':typeof e=="string"?`"${e.replaceAll('"','""')}"`:typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof P?e.code:String(e)}const ot=(a,t)=>a.length===t.length&&a.every((s,e)=>s===t[e]),he=a=>`$${D(a.left)}$${String(a.top+1)}:$${D(a.right)}$${String(a.bottom+1)}`;function rt(a){const t=[],s=(e,n)=>o("definedName",{name:e.name,localSheetId:n,hidden:e.hidden===!0?!0:void 0},x(nt(a,e)));for(const e of a.names.values())t.push(s(e));return a.sheets.forEach((e,n)=>{for(const d of e.names.values())t.push(s(d,n));const r=e.filters.find(d=>!d.table);r&&t.push(o("definedName",{name:"_xlnm._FilterDatabase",localSheetId:n,hidden:!0},x(`${X(e.name)}${he(r.area)}`)));const l=X(e.name),h=e.spec.print,c=h?.area===void 0?void 0:ge(h.area);c&&t.push(o("definedName",{name:"_xlnm.Print_Area",localSheetId:n},x(`${l}${he(c)}`)));const i=[h?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),h?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(d=>d===void 0?[]:[`${l}${d}`]);i.length>0&&t.push(o("definedName",{name:"_xlnm.Print_Titles",localSheetId:n},x(i.join(","))))}),t}export function writeXlsx(a,t={}){const s=a.wb,e=[];s.checks.length>0&&e.push(`${String(s.checks.length)} check${s.checks.length===1?"":"s"}: a file has no such thing`);const n=ke(a);e.push(...n.left);const r=new Me,l=new Ve,h=new We(s),c=new _e,i=[["/xl/workbook.xml",A.sheet]],d=Math.max(0,s.sheets.findIndex(p=>p.spec.hidden!==!0));let f=1,m=!1;const u=new Map;let $=0,T=0,y=0;for(const[p,w]of s.sheets.entries()){const H=String(p+1),O=Be(w,a,t.file,e),F=w.charts.filter(({spec:g})=>[g.categories,...g.series.flatMap(E=>[E.values,E.x])].some(E=>E?.endsWith("#"))).length;F>0&&e.push(`${w.name}: ${String(F)} chart${F===1?"":"s"} on a spill: ${F===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const Z=new Ze(w,a,r,l,t.cached!==!1,e,h,p,O,n.sheets.find(g=>g.sheet===w)),me=Z.write(c.part(`xl/worksheets/sheet${H}.xml`),p===d,f);m||=Z.arrays,i.push([`/xl/worksheets/sheet${H}.xml`,A.worksheet]);const R=[];for(const g of me){const E=`table${String(f)}.xml`;f+=1,c.add(`xl/tables/${E}`,g),i.push([`/xl/tables/${E}`,A.table]),R.push([`${v}table`,`../tables/${E}`])}if(w.charts.length>0||O.length>0){$+=1;const g=`drawing${String($)}.xml`;c.add(`xl/drawings/${g}`,Te(w.charts,O)),i.push([`/xl/drawings/${g}`,A.drawing]),R.push([`${v}drawing`,`../drawings/${g}`]);const E=w.charts.map(L=>{T+=1;const I=`chart${String(T)}.xml`;return c.add(`xl/charts/${I}`,Ee(a,w,L)),i.push([`/xl/charts/${I}`,A.chart]),[`${v}chart`,`../charts/${I}`]});for(const L of O){const J=[...u].find(([,ue])=>ot(ue,L.bytes))?.[0]??`image${String(u.size+1)}${L.file}`;u.set(J,L.bytes),E.push([`${v}image`,`../media/${J}`])}c.add(`xl/drawings/_rels/${g}.rels`,V(E))}const U=Object.entries(w.spec.notes??{});if(U.length>0){y+=1;const g=String(y);c.add(`xl/comments${g}.xml`,Ke(U)),i.push([`/xl/comments${g}.xml`,A.comments]),c.add(`xl/drawings/vmlDrawing${g}.vml`,Qe(U)),R.push([`${v}vmlDrawing`,`../drawings/vmlDrawing${g}.vml`]),R.push([`${v}comments`,`../comments${g}.xml`])}for(const g of Object.values(w.spec.links??{}))g.startsWith("#")||R.push([`${v}hyperlink`,g,"External"]);R.length>0&&c.add(`xl/worksheets/_rels/sheet${H}.xml.rels`,V(R))}const b=s.sheets.length,z=h.columns.length>0;if(z){const p=`xl/worksheets/sheet${String(b+1)}.xml`;c.add(p,h.xml(l)),i.push([`/${p}`,A.worksheet])}const j=[...s.sheets,...z?[void 0]:[]].map((p,w)=>[`${v}worksheet`,`worksheets/sheet${String(w+1)}.xml`]);j.push([`${v}theme`,"theme/theme1.xml"]),j.push([`${v}styles`,"styles.xml"]),j.push([`${v}sharedStrings`,"sharedStrings.xml"]),m&&(j.push([`${v}sheetMetadata`,"metadata.xml"]),i.push(["/xl/metadata.xml",A.metadata]));const G=rt(s),Y=s.sheets.map((p,w)=>o("sheet",{name:p.name,sheetId:w+1,state:p.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String(w+1)}`}));z&&Y.push(o("sheet",{name:h.name,sheetId:b+1,state:"veryHidden","r:id":`rId${String(b+1)}`})),c.add("xl/workbook.xml",S+o("workbook",{xmlns:k.main,"xmlns:r":k.rel},o("workbookPr",{}),o("bookViews",{},o("workbookView",{activeTab:d===0?void 0:d})),o("sheets",{},Y.join("")),G.length>0?o("definedNames",{},G.join("")):"",o("calcPr",{calcId:je,fullCalcOnLoad:!0}))),c.add("xl/_rels/workbook.xml.rels",V(j)),c.add("xl/styles.xml",S+r.xml()),l.write(c.part("xl/sharedStrings.xml")),c.add("xl/theme/theme1.xml",S+Re),m&&c.add("xl/metadata.xml",S+Ne),c.add("docProps/core.xml",S+o("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},s.title===void 0?"":o("dc:title",{},x(s.title)))),c.add("docProps/app.xml",S+o("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},o("Application",{},"AllyHub"))),c.add("_rels/.rels",V([[`${v}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${v}extended-properties`,"docProps/app.xml"]])),i.push(["/xl/styles.xml",A.styles],["/xl/sharedStrings.xml",A.strings],["/xl/theme/theme1.xml",A.theme],["/docProps/core.xml",A.core],["/docProps/app.xml",A.app]);const fe=[...u].sort(([p],[w])=>p.localeCompare(w));for(const[p,w]of fe)c.add(`xl/media/${p}`,w);return c.add("[Content_Types].xml",S+o("Types",{xmlns:k.types},o("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),o("Default",{Extension:"xml",ContentType:"application/xml"}),y>0?o("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",[...new Set([...u.keys()].map(p=>p.split(".").pop()??""))].sort().map(p=>o("Default",{Extension:p,ContentType:`image/${p==="jpg"?"jpeg":p}`})).join(""),i.map(([p,w])=>o("Override",{PartName:p,ContentType:w})).join(""))),{bytes:c.finish(),left:e}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ZipLimits } from "@allyhub-next/formats";
|
|
2
|
+
/** A part being written: text in order, then its end. */
|
|
3
|
+
export interface PartWriter {
|
|
4
|
+
write(text: string): void;
|
|
5
|
+
end(): void;
|
|
6
|
+
}
|
|
7
|
+
/** A zip written a part at a time, one part after another. */
|
|
8
|
+
export declare class ZipOut {
|
|
9
|
+
private readonly chunks;
|
|
10
|
+
private readonly zip;
|
|
11
|
+
private readonly encoder;
|
|
12
|
+
private open;
|
|
13
|
+
constructor();
|
|
14
|
+
private entry;
|
|
15
|
+
/** A part written in pieces. */
|
|
16
|
+
part(path: string): PartWriter;
|
|
17
|
+
/** A whole part at once. */
|
|
18
|
+
add(path: string, content: string | Uint8Array): void;
|
|
19
|
+
/** The zip's bytes; nothing can be added after. */
|
|
20
|
+
finish(): Uint8Array;
|
|
21
|
+
}
|
|
22
|
+
/** A zip read through its central directory: any part, when it is asked for. */
|
|
23
|
+
export declare class ZipIn {
|
|
24
|
+
private readonly bytes;
|
|
25
|
+
private readonly entries;
|
|
26
|
+
private readonly lower;
|
|
27
|
+
constructor(bytes: Uint8Array, limits?: Partial<ZipLimits>);
|
|
28
|
+
get names(): string[];
|
|
29
|
+
private find;
|
|
30
|
+
has(path: string): boolean;
|
|
31
|
+
/** Its parts as the central directory lists them. */
|
|
32
|
+
private directory;
|
|
33
|
+
/** A part's bytes, a piece at a time; never more than the directory says it holds. */
|
|
34
|
+
stream(path: string, onBytes: (chunk: Uint8Array) => void): boolean;
|
|
35
|
+
/** A part's text, a piece at a time. */
|
|
36
|
+
streamText(path: string, onText: (text: string) => void): boolean;
|
|
37
|
+
bytesOf(path: string): Uint8Array | undefined;
|
|
38
|
+
text(path: string): string | undefined;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{Inflate as C,Zip as D,ZipDeflate as M}from"fflate";import{withinZip as U,ZipLimitError as E}from"@allyhub-next/formats";const O=new Date(1980,0,1),_=1<<20;export class ZipOut{chunks=[];zip;encoder=new TextEncoder;open=!1;constructor(){this.zip=new D((t,e)=>{if(t)throw t;this.chunks.push(e)})}entry(t){if(this.open)throw new Error(`${t} is written while a part is open.`);const e=new M(t,{level:6});return e.mtime=O,this.zip.add(e),e}part(t){const e=this.entry(t);this.open=!0;let n=[],s=0;const i=o=>{const r=n.length===1?n[0]??"":n.join("");n=[],s=0,e.push(this.encoder.encode(r),o)};return{write:o=>{n.push(o),s+=o.length,s>=_&&i(!1)},end:()=>{i(!0),this.open=!1}}}add(t,e){this.entry(t).push(typeof e=="string"?this.encoder.encode(e):e,!0)}finish(){this.zip.end();let t=0;for(const s of this.chunks)t+=s.length;const e=new Uint8Array(t);let n=0;for(const s of this.chunks)e.set(s,n),n+=s.length;return e}}const g=65536,h=(f,t)=>(f[t]??0)|(f[t+1]??0)<<8,a=(f,t)=>(h(f,t)|h(f,t+2)<<16)>>>0,d=(f,t)=>a(f,t)+a(f,t+4)*4294967296,A=f=>{let t="";for(const e of f)t+=String.fromCharCode(e);return t};export class ZipIn{bytes;entries=new Map;lower=new Map;constructor(t,e){this.bytes=t;const n=U(e);for(const s of this.directory())n({name:s.name,originalSize:s.size}),this.entries.set(s.name,s),this.lower.set(s.name.toLowerCase(),s)}get names(){return[...this.entries.keys()]}find(t){return this.entries.get(t)??this.lower.get(t.toLowerCase())}has(t){return this.find(t)!==void 0}*directory(){const t=this.bytes;let e=-1;for(let r=t.length-22;r>=Math.max(0,t.length-22-65535);r--)if(a(t,r)===101010256){e=r;break}if(e<0)throw new Error("It has no zip directory.");let n=h(t,e+10),s=a(t,e+16);if((n===65535||s===4294967295)&&a(t,e-20)===117853008){const r=d(t,e-12);if(a(t,r)!==101075792)throw new Error("Its zip64 end is lost.");n=d(t,r+32),s=d(t,r+48)}const i=new TextDecoder;let o=s;for(let r=0;r<n;r++){if(a(t,o)!==33639248)throw new Error("Its zip directory is damaged.");const I=h(t,o+8),Z=h(t,o+10);let w=a(t,o+20),m=a(t,o+24);const y=h(t,o+28),L=h(t,o+30),T=h(t,o+32);let c=a(t,o+42);const x=t.subarray(o+46,o+46+y),p=I&2048?i.decode(x):A(x);let l=o+46+y;const z=l+L;for(;l+4<=z;){const $=h(t,l),k=h(t,l+2);if($===1){let u=l+4;m===4294967295&&(m=d(t,u),u+=8),w===4294967295&&(w=d(t,u),u+=8),c===4294967295&&(c=d(t,u))}l+=4+k}if(o=z+T,a(t,c)!==67324752)throw new Error(`Its part ${p} is lost.`);const b=c+30+h(t,c+26)+h(t,c+28);if(b+w>t.length)throw new Error(`Its part ${p} is cut short.`);p.endsWith("/")||(yield{name:p,method:Z,start:b,compressed:w,size:m})}}stream(t,e){const n=this.find(t);if(!n)return!1;const s=this.bytes.subarray(n.start,n.start+n.compressed);if(n.method===0){if(s.length>n.size)throw new E(`${n.name} holds more than it says.`);return e(s),!0}if(n.method!==8)throw new Error(`${n.name} is compressed in a way a zip reader here does not know.`);let i=0;const o=new C(r=>{if(i+=r.length,i>n.size)throw new E(`${n.name} unzips to more than it says.`);e(r)});for(let r=0;r<s.length;r+=g)o.push(s.subarray(r,r+g),r+g>=s.length);return s.length===0&&o.push(s,!0),!0}streamText(t,e){const n=new TextDecoder;if(!this.stream(t,o=>{const r=n.decode(o,{stream:!0});r!==""&&e(r)}))return!1;const i=n.decode();return i!==""&&e(i),!0}bytesOf(t){const e=this.find(t);if(!e)return;const n=new Uint8Array(e.size);let s=0;return this.stream(t,i=>{n.set(i,s),s+=i.length}),s===n.length?n:n.subarray(0,s)}text(t){const e=this.bytesOf(t);return e===void 0?void 0:new TextDecoder().decode(e)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{pathSteps as
|
|
2
|
+
import{pathSteps as S}from"./path.js";import{EMU_PER_PT as h}from"./units.js";export const ANIMATION_DURATIONS={appear:0,fade:.5,wipe:.5,"fly-in":.5,zoom:.5,disappear:0,"fade-out":.5,"wipe-out":.5,"fly-out":.5,"zoom-out":.5,pulse:.5,path:2};const M=new Set(["disappear","fade-out","wipe-out","fly-out","zoom-out"]),w=new Set(["appear","fade","wipe","fly-in","zoom"]);export const isExit=t=>M.has(t),isEntrance=t=>w.has(t),TRANSITION_DURATIONS={fade:.7,push:1,wipe:1,morph:2},resolveTransition=t=>({type:t.type,direction:t.direction??"from-right",duration:t.duration??TRANSITION_DURATIONS[t.type]});const E={"from-left":{x:-1,y:0},"from-right":{x:1,y:0},"from-top":{x:0,y:-1},"from-bottom":{x:0,y:1}};export function transitionAt(t,o){const e={opacity:1,x:0,y:0};if(t.type==="fade")return{incoming:{...e,opacity:o},outgoing:{x:0,y:0}};if(t.type==="push"){const n=E[t.direction];return{incoming:{...e,x:n.x*(1-o),y:n.y*(1-o)},outgoing:{x:-n.x*o,y:-n.y*o}}}return t.type==="wipe"?{incoming:{...e,clip:m(t.direction,1-o)},outgoing:{x:0,y:0}}:{incoming:e,outgoing:{x:0,y:0}}}export function morphFrame(t,o,e){const n=e*e*(3-2*e),i=(p,f)=>p+(f-p)*n;return{left:i(t.left,o.left),top:i(t.top,o.top),width:i(t.width,o.width),height:i(t.height,o.height)}}export function resolveAnimation(t){const o=t.path===void 0?void 0:S(t.path);if(!(t.path!==void 0&&!o)&&!(t.effect==="path"&&!o))return{shape:t.shape,...t.paragraph===void 0?{}:{paragraph:t.paragraph},effect:t.effect,direction:t.direction??"from-bottom",start:t.start??"on-click",duration:t.duration??ANIMATION_DURATIONS[t.effect],delay:t.delay??0,...o?{path:o.map(e=>e.op==="close"?e:e.op!=="curve"?{...e,x:e.x*h,y:e.y*h}:{op:"curve",x1:e.x1*h,y1:e.y1*h,x2:e.x2*h,y2:e.y2*h,x:e.x*h,y:e.y*h})}:{}}}export function slideClock(t,o,e,n=0,i=0){const p=new Set(t.filter(s=>isEntrance(s.effect)).map(s=>s.shape));let f=i+(o.some(s=>!p.has(s))?e:0);if(t.length===0)return{timed:[],rests:[Math.max(e,i)]};const r=[],c=[];let a=0,u=i;for(const s of t){s.start==="on-click"?(r.push(f),a++,f+=n,u=f):s.start==="after-previous"&&(u=f);const y=u+s.delay,l=y+s.duration;c.push({...s,step:a,from:y,to:l}),f=Math.max(f,l),o.includes(s.shape)&&isEntrance(s.effect)&&(f=Math.max(f,y+e))}return r.push(f),{timed:c,rests:r}}export const SLIDE_SECONDS=4,DECK_FPS=30;const T=t=>Math.ceil(t*DECK_FPS-1e-6)/DECK_FPS;export function clockOf(t,o){const e=o?0:t.transition?.duration??0,n=slideClock(t.animations,t.shapes.flatMap(i=>i.component?[i.name]:[]),SLIDE_SECONDS-1/DECK_FPS,1/DECK_FPS,e);return{timed:n.timed,rests:n.rests.map(T),lead:e,comesOn:i=>n.timed.find(p=>p.shape===i&&isEntrance(p.effect))?.from??e,goesOff:i=>n.timed.find(p=>p.shape===i&&isExit(p.effect))?.to}}const d=1e-6,x={hidden:!1,opacity:1,x:0,y:0,scale:1},N=t=>1-(1-t)*(1-t);function A(t){const o=[];let e={x:0,y:0};for(const n of t){if(n.op==="close")continue;if(n.op!=="curve"){e={x:n.x,y:n.y},o.push(e);continue}const i=e;for(let p=1;p<=24;p++){const f=p/24,r=1-f,c=(a,u,s,y)=>r*r*r*a+3*r*r*f*u+3*r*f*f*s+f*f*f*y;o.push({x:c(i.x,n.x1,n.x2,n.x),y:c(i.y,n.y1,n.y2,n.y)})}e={x:n.x,y:n.y}}return o}export function pathPoint(t,o){const e=A(t),[n]=e;if(!n)return{x:0,y:0};let i=0;for(let f=1;f<e.length;f++){const[r,c]=[e[f-1]??n,e[f]??n];i+=Math.hypot(c.x-r.x,c.y-r.y)}let p=i*o;for(let f=1;f<e.length;f++){const[r,c]=[e[f-1]??n,e[f]??n],a=Math.hypot(c.x-r.x,c.y-r.y);if(p<=a&&a>0){const u=p/a;return{x:r.x+(c.x-r.x)*u,y:r.y+(c.y-r.y)*u}}p-=a}return e.at(-1)??n}function I(t,o,e){return t==="from-left"?{x:-(o.left+o.width),y:0}:t==="from-right"?{x:e.width-o.left,y:0}:t==="from-top"?{x:0,y:-(o.top+o.height)}:{x:0,y:e.height-o.top}}function m(t,o){const e={top:0,right:0,bottom:0,left:0};return t==="from-left"?e.right=o:t==="from-right"?e.left=o:t==="from-top"?e.bottom=o:e.top=o,e}function g(t,o,e,n){if(t.effect==="fade"||t.effect==="fade-out")return{opacity:o};if(t.effect==="zoom"||t.effect==="zoom-out")return{scale:o,opacity:o};if(t.effect==="wipe"||t.effect==="wipe-out")return{clip:m(t.direction,1-o)};if(t.effect==="fly-in"||t.effect==="fly-out"){const i=I(t.direction,e,n);return{x:i.x*(1-o),y:i.y*(1-o)}}return{}}export function drawnAt(t,o,e,n){let i={...x};const[p]=t,f=r=>o<r-d;if(p&&isEntrance(p.effect)&&f(p.from))return{...x,hidden:!0};for(const r of t){if(f(r.from))break;const c=r.to>r.from&&o<r.to-d?Math.min(1,(o-r.from)/(r.to-r.from)):1;if(r.effect==="path"&&r.path){const a=pathPoint(r.path,c);i={...i,x:a.x,y:a.y}}else r.effect==="pulse"?i={...i,scale:1+.05*Math.sin(c*Math.PI)}:isExit(r.effect)?i=c>=1?{...x,hidden:!0}:{...i,...g(r,1-(r.effect==="fly-out"?c*c:c),e,n)}:i={...x,...c<1?g(r,r.effect==="fly-in"?N(c):c,e,n):{}}}return i}export function animationTargets(t){const o=new Map;for(const e of t){const n=JSON.stringify([e.shape,e.paragraph??null]),i=o.get(n);i?i.animations.push(e):o.set(n,{shape:e.shape,...e.paragraph===void 0?{}:{paragraph:e.paragraph},animations:[e]})}return[...o.values()]}
|