@archipelagolab/lobi 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +164 -0
- package/SPEC-SUPPORT.md +116 -0
- package/api.ts +18 -0
- package/auth-presence.ts +56 -0
- package/channel-plugin-api.ts +3 -0
- package/cli-metadata.ts +11 -0
- package/contract-api.ts +17 -0
- package/helper-api.ts +3 -0
- package/index.test.ts +61 -0
- package/index.ts +51 -0
- package/openclaw.plugin.json +10 -10
- package/package.json +13 -19
- package/plugin-entry.handlers.runtime.ts +1 -0
- package/runtime-api.ts +54 -0
- package/runtime-heavy-api.ts +1 -0
- package/secret-contract-api.ts +5 -0
- package/setup-entry.ts +13 -0
- package/src/account-selection.test.ts +124 -0
- package/src/account-selection.ts +220 -0
- package/src/actions.account-propagation.test.ts +251 -0
- package/src/actions.test.ts +251 -0
- package/src/actions.ts +336 -0
- package/src/approval-auth.test.ts +23 -0
- package/src/approval-auth.ts +25 -0
- package/src/approval-handler.runtime.test.ts +46 -0
- package/src/approval-handler.runtime.ts +400 -0
- package/src/approval-ids.ts +6 -0
- package/src/approval-native.test.ts +329 -0
- package/src/approval-native.ts +336 -0
- package/src/approval-reactions.test.ts +107 -0
- package/src/approval-reactions.ts +158 -0
- package/src/auth-precedence.ts +61 -0
- package/src/channel-account-paths.ts +92 -0
- package/src/channel.account-paths.test.ts +102 -0
- package/src/channel.directory.test.ts +601 -0
- package/src/channel.resolve.test.ts +38 -0
- package/src/channel.runtime.ts +16 -0
- package/src/channel.setup.test.ts +269 -0
- package/src/channel.ts +570 -0
- package/src/cli-metadata.ts +19 -0
- package/src/cli.test.ts +1015 -0
- package/src/cli.ts +1198 -0
- package/src/config-adapter.ts +41 -0
- package/src/config-schema.test.ts +90 -0
- package/src/config-schema.ts +114 -0
- package/src/directory-live.test.ts +200 -0
- package/src/directory-live.ts +238 -0
- package/src/doctor-contract.ts +287 -0
- package/src/doctor.test.ts +440 -0
- package/src/doctor.ts +262 -0
- package/src/env-vars.ts +92 -0
- package/src/exec-approval-resolver.test.ts +68 -0
- package/src/exec-approval-resolver.ts +23 -0
- package/src/exec-approvals.test.ts +483 -0
- package/src/exec-approvals.ts +290 -0
- package/src/group-mentions.ts +41 -0
- package/src/legacy-crypto-inspector-availability.test.ts +81 -0
- package/src/legacy-crypto-inspector-availability.ts +60 -0
- package/src/legacy-crypto.test.ts +234 -0
- package/src/legacy-crypto.ts +549 -0
- package/src/legacy-state.test.ts +86 -0
- package/src/legacy-state.ts +156 -0
- package/src/matrix/account-config.ts +150 -0
- package/src/matrix/accounts.readiness.test.ts +27 -0
- package/src/matrix/accounts.test.ts +757 -0
- package/src/matrix/accounts.ts +194 -0
- package/src/matrix/actions/client.test.ts +215 -0
- package/src/matrix/actions/client.ts +31 -0
- package/src/matrix/actions/devices.test.ts +114 -0
- package/src/matrix/actions/devices.ts +34 -0
- package/src/matrix/actions/limits.test.ts +15 -0
- package/src/matrix/actions/limits.ts +6 -0
- package/src/matrix/actions/messages.test.ts +289 -0
- package/src/matrix/actions/messages.ts +123 -0
- package/src/matrix/actions/pins.test.ts +74 -0
- package/src/matrix/actions/pins.ts +64 -0
- package/src/matrix/actions/polls.test.ts +71 -0
- package/src/matrix/actions/polls.ts +109 -0
- package/src/matrix/actions/profile.test.ts +109 -0
- package/src/matrix/actions/profile.ts +37 -0
- package/src/matrix/actions/reactions.test.ts +135 -0
- package/src/matrix/actions/reactions.ts +59 -0
- package/src/matrix/actions/room.test.ts +79 -0
- package/src/matrix/actions/room.ts +71 -0
- package/src/matrix/actions/summary.test.ts +87 -0
- package/src/matrix/actions/summary.ts +88 -0
- package/src/matrix/actions/types.ts +82 -0
- package/src/matrix/actions/verification.test.ts +105 -0
- package/src/matrix/actions/verification.ts +237 -0
- package/src/matrix/actions.ts +37 -0
- package/src/matrix/active-client.ts +26 -0
- package/src/matrix/async-lock.ts +18 -0
- package/src/matrix/backup-health.ts +115 -0
- package/src/matrix/client/config-runtime-api.ts +14 -0
- package/src/matrix/client/config-secret-input.runtime.ts +1 -0
- package/src/matrix/client/config.ts +979 -0
- package/src/matrix/client/create-client.test.ts +115 -0
- package/src/matrix/client/create-client.ts +101 -0
- package/src/matrix/client/env-auth.ts +6 -0
- package/src/matrix/client/file-sync-store.test.ts +265 -0
- package/src/matrix/client/file-sync-store.ts +289 -0
- package/src/matrix/client/logging.ts +123 -0
- package/src/matrix/client/migration-snapshot.runtime.ts +1 -0
- package/src/matrix/client/private-network-host.ts +56 -0
- package/src/matrix/client/runtime.ts +4 -0
- package/src/matrix/client/shared.test.ts +344 -0
- package/src/matrix/client/shared.ts +306 -0
- package/src/matrix/client/storage.test.ts +634 -0
- package/src/matrix/client/storage.ts +544 -0
- package/src/matrix/client/types.ts +50 -0
- package/src/matrix/client-bootstrap.test.ts +84 -0
- package/src/matrix/client-bootstrap.ts +164 -0
- package/src/matrix/client-resolver.test-helpers.ts +147 -0
- package/src/matrix/client.test.ts +1521 -0
- package/src/matrix/client.ts +23 -0
- package/src/matrix/config-paths.ts +31 -0
- package/src/matrix/config-update.test.ts +237 -0
- package/src/matrix/config-update.ts +291 -0
- package/src/matrix/credentials-read.ts +206 -0
- package/src/matrix/credentials-write.runtime.ts +26 -0
- package/src/matrix/credentials.test.ts +501 -0
- package/src/matrix/credentials.ts +95 -0
- package/src/matrix/deps.test.ts +74 -0
- package/src/matrix/deps.ts +225 -0
- package/src/matrix/device-health.test.ts +45 -0
- package/src/matrix/device-health.ts +31 -0
- package/src/matrix/direct-management.test.ts +350 -0
- package/src/matrix/direct-management.ts +347 -0
- package/src/matrix/direct-room.test.ts +61 -0
- package/src/matrix/direct-room.ts +128 -0
- package/src/matrix/draft-stream.test.ts +406 -0
- package/src/matrix/draft-stream.ts +216 -0
- package/src/matrix/encryption-guidance.ts +27 -0
- package/src/matrix/errors.ts +21 -0
- package/src/matrix/format.test.ts +340 -0
- package/src/matrix/format.ts +428 -0
- package/src/matrix/legacy-crypto-inspector.ts +95 -0
- package/src/matrix/media-errors.ts +20 -0
- package/src/matrix/media-text.ts +169 -0
- package/src/matrix/monitor/access-state.test.ts +45 -0
- package/src/matrix/monitor/access-state.ts +77 -0
- package/src/matrix/monitor/ack-config.test.ts +57 -0
- package/src/matrix/monitor/ack-config.ts +26 -0
- package/src/matrix/monitor/allowlist.test.ts +45 -0
- package/src/matrix/monitor/allowlist.ts +94 -0
- package/src/matrix/monitor/auto-join.test.ts +203 -0
- package/src/matrix/monitor/auto-join.ts +86 -0
- package/src/matrix/monitor/config.test.ts +197 -0
- package/src/matrix/monitor/config.ts +303 -0
- package/src/matrix/monitor/context-summary.ts +43 -0
- package/src/matrix/monitor/direct.test.ts +529 -0
- package/src/matrix/monitor/direct.ts +270 -0
- package/src/matrix/monitor/events.test.ts +1524 -0
- package/src/matrix/monitor/events.ts +213 -0
- package/src/matrix/monitor/handler.body-for-agent.test.ts +396 -0
- package/src/matrix/monitor/handler.group-history.test.ts +648 -0
- package/src/matrix/monitor/handler.media-failure.test.ts +267 -0
- package/src/matrix/monitor/handler.test-helpers.ts +308 -0
- package/src/matrix/monitor/handler.test.ts +2952 -0
- package/src/matrix/monitor/handler.thread-root-media.test.ts +82 -0
- package/src/matrix/monitor/handler.ts +1679 -0
- package/src/matrix/monitor/inbound-dedupe.test.ts +146 -0
- package/src/matrix/monitor/inbound-dedupe.ts +267 -0
- package/src/matrix/monitor/index.test.ts +920 -0
- package/src/matrix/monitor/index.ts +434 -0
- package/src/matrix/monitor/legacy-crypto-restore.test.ts +206 -0
- package/src/matrix/monitor/legacy-crypto-restore.ts +139 -0
- package/src/matrix/monitor/location.ts +100 -0
- package/src/matrix/monitor/media.test.ts +159 -0
- package/src/matrix/monitor/media.ts +119 -0
- package/src/matrix/monitor/mentions.test.ts +289 -0
- package/src/matrix/monitor/mentions.ts +177 -0
- package/src/matrix/monitor/reaction-events.test.ts +326 -0
- package/src/matrix/monitor/reaction-events.ts +187 -0
- package/src/matrix/monitor/recent-invite.test.ts +92 -0
- package/src/matrix/monitor/recent-invite.ts +30 -0
- package/src/matrix/monitor/replies.test.ts +265 -0
- package/src/matrix/monitor/replies.ts +136 -0
- package/src/matrix/monitor/reply-context.test.ts +276 -0
- package/src/matrix/monitor/reply-context.ts +92 -0
- package/src/matrix/monitor/room-history.test.ts +258 -0
- package/src/matrix/monitor/room-history.ts +301 -0
- package/src/matrix/monitor/room-info.test.ts +201 -0
- package/src/matrix/monitor/room-info.ts +126 -0
- package/src/matrix/monitor/rooms.test.ts +121 -0
- package/src/matrix/monitor/rooms.ts +52 -0
- package/src/matrix/monitor/route.test.ts +255 -0
- package/src/matrix/monitor/route.ts +178 -0
- package/src/matrix/monitor/runtime-api.ts +31 -0
- package/src/matrix/monitor/startup-verification.test.ts +294 -0
- package/src/matrix/monitor/startup-verification.ts +237 -0
- package/src/matrix/monitor/startup.test.ts +257 -0
- package/src/matrix/monitor/startup.ts +218 -0
- package/src/matrix/monitor/status.ts +111 -0
- package/src/matrix/monitor/sync-lifecycle.test.ts +224 -0
- package/src/matrix/monitor/sync-lifecycle.ts +91 -0
- package/src/matrix/monitor/task-runner.ts +38 -0
- package/src/matrix/monitor/thread-context.test.ts +149 -0
- package/src/matrix/monitor/thread-context.ts +108 -0
- package/src/matrix/monitor/threads.test.ts +68 -0
- package/src/matrix/monitor/threads.ts +85 -0
- package/src/matrix/monitor/types.ts +30 -0
- package/src/matrix/monitor/verification-events.ts +627 -0
- package/src/matrix/monitor/verification-utils.test.ts +47 -0
- package/src/matrix/monitor/verification-utils.ts +46 -0
- package/src/matrix/outbound-media-runtime.ts +1 -0
- package/src/matrix/poll-summary.ts +110 -0
- package/src/matrix/poll-types.test.ts +205 -0
- package/src/matrix/poll-types.ts +433 -0
- package/src/matrix/probe.runtime.ts +4 -0
- package/src/matrix/probe.test.ts +154 -0
- package/src/matrix/probe.ts +96 -0
- package/src/matrix/profile.test.ts +154 -0
- package/src/matrix/profile.ts +184 -0
- package/src/matrix/reaction-common.test.ts +96 -0
- package/src/matrix/reaction-common.ts +147 -0
- package/src/matrix/sdk/crypto-bootstrap.test.ts +505 -0
- package/src/matrix/sdk/crypto-bootstrap.ts +341 -0
- package/src/matrix/sdk/crypto-facade.test.ts +197 -0
- package/src/matrix/sdk/crypto-facade.ts +207 -0
- package/src/matrix/sdk/crypto-node.runtime.test.ts +27 -0
- package/src/matrix/sdk/crypto-node.runtime.ts +9 -0
- package/src/matrix/sdk/crypto-runtime.ts +11 -0
- package/src/matrix/sdk/decrypt-bridge.ts +356 -0
- package/src/matrix/sdk/event-helpers.test.ts +60 -0
- package/src/matrix/sdk/event-helpers.ts +71 -0
- package/src/matrix/sdk/http-client.test.ts +134 -0
- package/src/matrix/sdk/http-client.ts +87 -0
- package/src/matrix/sdk/idb-persistence-lock.ts +51 -0
- package/src/matrix/sdk/idb-persistence.lock-order.test.ts +108 -0
- package/src/matrix/sdk/idb-persistence.test-helpers.ts +88 -0
- package/src/matrix/sdk/idb-persistence.test.ts +149 -0
- package/src/matrix/sdk/idb-persistence.ts +283 -0
- package/src/matrix/sdk/logger.test.ts +25 -0
- package/src/matrix/sdk/logger.ts +108 -0
- package/src/matrix/sdk/read-response-with-limit.ts +19 -0
- package/src/matrix/sdk/recovery-key-store.test.ts +385 -0
- package/src/matrix/sdk/recovery-key-store.ts +430 -0
- package/src/matrix/sdk/transport.test.ts +161 -0
- package/src/matrix/sdk/transport.ts +344 -0
- package/src/matrix/sdk/types.ts +236 -0
- package/src/matrix/sdk/verification-manager.test.ts +509 -0
- package/src/matrix/sdk/verification-manager.ts +694 -0
- package/src/matrix/sdk/verification-status.ts +23 -0
- package/src/matrix/sdk.test.ts +2568 -0
- package/src/matrix/sdk.ts +1789 -0
- package/src/matrix/send/client.test.ts +174 -0
- package/src/matrix/send/client.ts +90 -0
- package/src/matrix/send/formatting.ts +189 -0
- package/src/matrix/send/media.ts +244 -0
- package/src/matrix/send/targets.test.ts +254 -0
- package/src/matrix/send/targets.ts +104 -0
- package/src/matrix/send/types.ts +134 -0
- package/src/matrix/send.test.ts +958 -0
- package/src/matrix/send.ts +609 -0
- package/src/matrix/session-store-metadata.ts +108 -0
- package/src/matrix/startup-abort.ts +44 -0
- package/src/matrix/sync-state.ts +27 -0
- package/src/matrix/target-ids.ts +102 -0
- package/src/matrix/thread-bindings-shared.ts +201 -0
- package/src/matrix/thread-bindings.test.ts +673 -0
- package/src/matrix/thread-bindings.ts +577 -0
- package/src/matrix-migration.runtime.ts +9 -0
- package/src/migration-config.test.ts +228 -0
- package/src/migration-config.ts +243 -0
- package/src/migration-snapshot-backup.ts +117 -0
- package/src/migration-snapshot.test.ts +184 -0
- package/src/migration-snapshot.ts +55 -0
- package/src/onboarding.resolve.test.ts +55 -0
- package/src/onboarding.test-harness.ts +158 -0
- package/src/onboarding.test.ts +665 -0
- package/src/onboarding.ts +773 -0
- package/src/outbound.test.ts +173 -0
- package/src/outbound.ts +78 -0
- package/src/plugin-entry.runtime.js +159 -0
- package/src/plugin-entry.runtime.test.ts +108 -0
- package/src/plugin-entry.runtime.ts +68 -0
- package/src/profile-update.ts +68 -0
- package/src/record-shared.ts +3 -0
- package/src/resolve-targets.test.ts +178 -0
- package/src/resolve-targets.ts +175 -0
- package/src/resolver.ts +21 -0
- package/src/runtime-api.ts +144 -0
- package/src/runtime.ts +7 -0
- package/src/secret-contract.ts +174 -0
- package/src/session-route.test.ts +315 -0
- package/src/session-route.ts +113 -0
- package/src/setup-bootstrap.ts +94 -0
- package/src/setup-config.ts +222 -0
- package/src/setup-contract.ts +89 -0
- package/src/setup-core.test.ts +326 -0
- package/src/setup-core.ts +50 -0
- package/src/setup-surface.ts +4 -0
- package/src/startup-maintenance.test.ts +227 -0
- package/src/startup-maintenance.ts +114 -0
- package/src/storage-paths.ts +92 -0
- package/src/test-helpers.ts +42 -0
- package/src/test-mocks.ts +55 -0
- package/src/test-runtime.ts +72 -0
- package/src/test-support/monitor-route-test-support.ts +8 -0
- package/src/tool-actions.runtime.ts +1 -0
- package/src/tool-actions.test.ts +422 -0
- package/src/tool-actions.ts +498 -0
- package/src/types.ts +230 -0
- package/test-api.ts +2 -0
- package/thread-bindings-runtime.ts +4 -0
- package/tsconfig.json +16 -0
- package/LICENSE +0 -17
- package/README.md +0 -136
- package/dist/APEv2Parser-6EMKXRZS.js +0 -15
- package/dist/APEv2Parser-6EMKXRZS.js.map +0 -7
- package/dist/APEv2Parser-FYYGMFPI.js +0 -15
- package/dist/APEv2Parser-FYYGMFPI.js.map +0 -7
- package/dist/AiffParser-E6XWRTXM.js +0 -194
- package/dist/AiffParser-E6XWRTXM.js.map +0 -7
- package/dist/AiffParser-JHSDQA7T.js +0 -194
- package/dist/AiffParser-JHSDQA7T.js.map +0 -7
- package/dist/AsfParser-TPCQDEJB.js +0 -620
- package/dist/AsfParser-TPCQDEJB.js.map +0 -7
- package/dist/AsfParser-WSOH2JQY.js +0 -620
- package/dist/AsfParser-WSOH2JQY.js.map +0 -7
- package/dist/DsdiffParser-CGD3C3TL.js +0 -192
- package/dist/DsdiffParser-CGD3C3TL.js.map +0 -7
- package/dist/DsdiffParser-EUWJ4YAR.js +0 -192
- package/dist/DsdiffParser-EUWJ4YAR.js.map +0 -7
- package/dist/DsfParser-3UTIJVNF.js +0 -114
- package/dist/DsfParser-3UTIJVNF.js.map +0 -7
- package/dist/DsfParser-R6TPBJIY.js +0 -114
- package/dist/DsfParser-R6TPBJIY.js.map +0 -7
- package/dist/FlacParser-HLLYPJ76.js +0 -16
- package/dist/FlacParser-HLLYPJ76.js.map +0 -7
- package/dist/FlacParser-VDASGZ3E.js +0 -16
- package/dist/FlacParser-VDASGZ3E.js.map +0 -7
- package/dist/MP4Parser-64RGJLUM.js +0 -1145
- package/dist/MP4Parser-64RGJLUM.js.map +0 -7
- package/dist/MP4Parser-SM7HYL3Z.js +0 -1145
- package/dist/MP4Parser-SM7HYL3Z.js.map +0 -7
- package/dist/MatroskaParser-O6RXAKYA.js +0 -662
- package/dist/MatroskaParser-O6RXAKYA.js.map +0 -7
- package/dist/MatroskaParser-X7WRZ6D4.js +0 -662
- package/dist/MatroskaParser-X7WRZ6D4.js.map +0 -7
- package/dist/MpegParser-B6NX6DS3.js +0 -652
- package/dist/MpegParser-B6NX6DS3.js.map +0 -7
- package/dist/MpegParser-KXQEC6KD.js +0 -652
- package/dist/MpegParser-KXQEC6KD.js.map +0 -7
- package/dist/MusepackParser-NURI46TG.js +0 -331
- package/dist/MusepackParser-NURI46TG.js.map +0 -7
- package/dist/MusepackParser-WUBT63DS.js +0 -331
- package/dist/MusepackParser-WUBT63DS.js.map +0 -7
- package/dist/OggParser-5IYVBXPS.js +0 -448
- package/dist/OggParser-5IYVBXPS.js.map +0 -7
- package/dist/OggParser-ZY6E5C2P.js +0 -448
- package/dist/OggParser-ZY6E5C2P.js.map +0 -7
- package/dist/WavPackParser-5KTCSQEU.js +0 -209
- package/dist/WavPackParser-5KTCSQEU.js.map +0 -7
- package/dist/WavPackParser-RTEHKSJH.js +0 -209
- package/dist/WavPackParser-RTEHKSJH.js.map +0 -7
- package/dist/WaveParser-3R2NLXGP.js +0 -300
- package/dist/WaveParser-3R2NLXGP.js.map +0 -7
- package/dist/WaveParser-RZSHVQPZ.js +0 -300
- package/dist/WaveParser-RZSHVQPZ.js.map +0 -7
- package/dist/auth-presence.js +0 -46
- package/dist/auth-presence.js.map +0 -7
- package/dist/channel-plugin-api.js +0 -79
- package/dist/channel-plugin-api.js.map +0 -7
- package/dist/chunk-22WAAZ6I.js +0 -114
- package/dist/chunk-22WAAZ6I.js.map +0 -7
- package/dist/chunk-2A6HEFSO.js +0 -676
- package/dist/chunk-2A6HEFSO.js.map +0 -7
- package/dist/chunk-2GFROLI2.js +0 -261
- package/dist/chunk-2GFROLI2.js.map +0 -7
- package/dist/chunk-2IQWKATM.js +0 -127
- package/dist/chunk-2IQWKATM.js.map +0 -7
- package/dist/chunk-2KGHUHKU.js +0 -169
- package/dist/chunk-2KGHUHKU.js.map +0 -7
- package/dist/chunk-2NEQI4K6.js +0 -171
- package/dist/chunk-2NEQI4K6.js.map +0 -7
- package/dist/chunk-2OSJ3MTW.js +0 -175
- package/dist/chunk-2OSJ3MTW.js.map +0 -7
- package/dist/chunk-2Q626TDO.js +0 -27
- package/dist/chunk-2Q626TDO.js.map +0 -7
- package/dist/chunk-2U6OZ7N2.js +0 -155
- package/dist/chunk-2U6OZ7N2.js.map +0 -7
- package/dist/chunk-2V6Y4CAN.js +0 -25
- package/dist/chunk-2V6Y4CAN.js.map +0 -7
- package/dist/chunk-2WHRUMOM.js +0 -321
- package/dist/chunk-2WHRUMOM.js.map +0 -7
- package/dist/chunk-2Z4IOUDZ.js +0 -129
- package/dist/chunk-2Z4IOUDZ.js.map +0 -7
- package/dist/chunk-2ZEPAW7U.js +0 -154
- package/dist/chunk-2ZEPAW7U.js.map +0 -7
- package/dist/chunk-2ZI6JK5O.js +0 -63
- package/dist/chunk-2ZI6JK5O.js.map +0 -7
- package/dist/chunk-34UY6D6X.js +0 -36
- package/dist/chunk-34UY6D6X.js.map +0 -7
- package/dist/chunk-3GIK7SAA.js +0 -109
- package/dist/chunk-3GIK7SAA.js.map +0 -7
- package/dist/chunk-3JD6JSJD.js +0 -111
- package/dist/chunk-3JD6JSJD.js.map +0 -7
- package/dist/chunk-3OXOEMBS.js +0 -123
- package/dist/chunk-3OXOEMBS.js.map +0 -7
- package/dist/chunk-3R4ATE4Q.js +0 -176
- package/dist/chunk-3R4ATE4Q.js.map +0 -7
- package/dist/chunk-3TOEIHG5.js +0 -314
- package/dist/chunk-3TOEIHG5.js.map +0 -7
- package/dist/chunk-3TRKKAVT.js +0 -130
- package/dist/chunk-3TRKKAVT.js.map +0 -7
- package/dist/chunk-3UFTTK7C.js +0 -418
- package/dist/chunk-3UFTTK7C.js.map +0 -7
- package/dist/chunk-3XO6AAIC.js +0 -25
- package/dist/chunk-3XO6AAIC.js.map +0 -7
- package/dist/chunk-427SAQME.js +0 -321
- package/dist/chunk-427SAQME.js.map +0 -7
- package/dist/chunk-4CFQNJ7F.js +0 -7
- package/dist/chunk-4CFQNJ7F.js.map +0 -7
- package/dist/chunk-4COI4L2Y.js +0 -31
- package/dist/chunk-4COI4L2Y.js.map +0 -7
- package/dist/chunk-4EKKDVG3.js +0 -1662
- package/dist/chunk-4EKKDVG3.js.map +0 -7
- package/dist/chunk-4JVNTZAI.js +0 -80
- package/dist/chunk-4JVNTZAI.js.map +0 -7
- package/dist/chunk-4L2QI6AY.js +0 -71
- package/dist/chunk-4L2QI6AY.js.map +0 -7
- package/dist/chunk-4O3BEYYM.js +0 -187
- package/dist/chunk-4O3BEYYM.js.map +0 -7
- package/dist/chunk-4OXPPDV6.js +0 -676
- package/dist/chunk-4OXPPDV6.js.map +0 -7
- package/dist/chunk-4QTZHELX.js +0 -51
- package/dist/chunk-4QTZHELX.js.map +0 -7
- package/dist/chunk-4U42OJMK.js +0 -217
- package/dist/chunk-4U42OJMK.js.map +0 -7
- package/dist/chunk-4WCKVGQ5.js +0 -193
- package/dist/chunk-4WCKVGQ5.js.map +0 -7
- package/dist/chunk-4XXERLFH.js +0 -95
- package/dist/chunk-4XXERLFH.js.map +0 -7
- package/dist/chunk-4Z2N4GW6.js +0 -247
- package/dist/chunk-4Z2N4GW6.js.map +0 -7
- package/dist/chunk-4ZY2BOQ4.js +0 -123
- package/dist/chunk-4ZY2BOQ4.js.map +0 -7
- package/dist/chunk-56HN4SH6.js +0 -46
- package/dist/chunk-56HN4SH6.js.map +0 -7
- package/dist/chunk-57ROEOHB.js +0 -183
- package/dist/chunk-57ROEOHB.js.map +0 -7
- package/dist/chunk-5APBBTGW.js +0 -7
- package/dist/chunk-5APBBTGW.js.map +0 -7
- package/dist/chunk-5BQ6LLNU.js +0 -39
- package/dist/chunk-5BQ6LLNU.js.map +0 -7
- package/dist/chunk-5LNGMBWW.js +0 -93
- package/dist/chunk-5LNGMBWW.js.map +0 -7
- package/dist/chunk-5XFQSYZ4.js +0 -52
- package/dist/chunk-5XFQSYZ4.js.map +0 -7
- package/dist/chunk-62N5N4AC.js +0 -241
- package/dist/chunk-62N5N4AC.js.map +0 -7
- package/dist/chunk-63QTHDJL.js +0 -52
- package/dist/chunk-63QTHDJL.js.map +0 -7
- package/dist/chunk-65UUVZ6B.js +0 -151
- package/dist/chunk-65UUVZ6B.js.map +0 -7
- package/dist/chunk-6COVTMAO.js +0 -3586
- package/dist/chunk-6COVTMAO.js.map +0 -7
- package/dist/chunk-6EYPDJUD.js +0 -34
- package/dist/chunk-6EYPDJUD.js.map +0 -7
- package/dist/chunk-6HDYPVA4.js +0 -15
- package/dist/chunk-6HDYPVA4.js.map +0 -7
- package/dist/chunk-6HX3DEXK.js +0 -178
- package/dist/chunk-6HX3DEXK.js.map +0 -7
- package/dist/chunk-6NO5VEVV.js +0 -18
- package/dist/chunk-6NO5VEVV.js.map +0 -7
- package/dist/chunk-6OP3FK5F.js +0 -266
- package/dist/chunk-6OP3FK5F.js.map +0 -7
- package/dist/chunk-6PZGDVLR.js +0 -465
- package/dist/chunk-6PZGDVLR.js.map +0 -7
- package/dist/chunk-6RBDFNSX.js +0 -88
- package/dist/chunk-6RBDFNSX.js.map +0 -7
- package/dist/chunk-6SOGH3TW.js +0 -163
- package/dist/chunk-6SOGH3TW.js.map +0 -7
- package/dist/chunk-6TWWCETB.js +0 -70
- package/dist/chunk-6TWWCETB.js.map +0 -7
- package/dist/chunk-6WFHPMUF.js +0 -17
- package/dist/chunk-6WFHPMUF.js.map +0 -7
- package/dist/chunk-72TGY3LX.js +0 -104
- package/dist/chunk-72TGY3LX.js.map +0 -7
- package/dist/chunk-76IE55K7.js +0 -392
- package/dist/chunk-76IE55K7.js.map +0 -7
- package/dist/chunk-77BEEAPD.js +0 -86
- package/dist/chunk-77BEEAPD.js.map +0 -7
- package/dist/chunk-77JJ6QJK.js +0 -50
- package/dist/chunk-77JJ6QJK.js.map +0 -7
- package/dist/chunk-7BIUNV33.js +0 -62
- package/dist/chunk-7BIUNV33.js.map +0 -7
- package/dist/chunk-7F3242AO.js +0 -86
- package/dist/chunk-7F3242AO.js.map +0 -7
- package/dist/chunk-7FLQSTPG.js +0 -57
- package/dist/chunk-7FLQSTPG.js.map +0 -7
- package/dist/chunk-7L37R42D.js +0 -52
- package/dist/chunk-7L37R42D.js.map +0 -7
- package/dist/chunk-7MP46JBP.js +0 -177
- package/dist/chunk-7MP46JBP.js.map +0 -7
- package/dist/chunk-7MVZYR2T.js +0 -87
- package/dist/chunk-7MVZYR2T.js.map +0 -7
- package/dist/chunk-7N7ISMPG.js +0 -50
- package/dist/chunk-7N7ISMPG.js.map +0 -7
- package/dist/chunk-7S7LQQPX.js +0 -127
- package/dist/chunk-7S7LQQPX.js.map +0 -7
- package/dist/chunk-7TTNY5FK.js +0 -21
- package/dist/chunk-7TTNY5FK.js.map +0 -7
- package/dist/chunk-7W73QCTR.js +0 -244
- package/dist/chunk-7W73QCTR.js.map +0 -7
- package/dist/chunk-7XXLU33Y.js +0 -76
- package/dist/chunk-7XXLU33Y.js.map +0 -7
- package/dist/chunk-7ZP3KYVO.js +0 -104
- package/dist/chunk-7ZP3KYVO.js.map +0 -7
- package/dist/chunk-AAO7BQEV.js +0 -258
- package/dist/chunk-AAO7BQEV.js.map +0 -7
- package/dist/chunk-AH4MLRYT.js +0 -91
- package/dist/chunk-AH4MLRYT.js.map +0 -7
- package/dist/chunk-AHKR32FH.js +0 -7
- package/dist/chunk-AHKR32FH.js.map +0 -7
- package/dist/chunk-ALKRFDAW.js +0 -94
- package/dist/chunk-ALKRFDAW.js.map +0 -7
- package/dist/chunk-AQQGAE7N.js +0 -12
- package/dist/chunk-AQQGAE7N.js.map +0 -7
- package/dist/chunk-ARGF232V.js +0 -32
- package/dist/chunk-ARGF232V.js.map +0 -7
- package/dist/chunk-ATCJOK3K.js +0 -24
- package/dist/chunk-ATCJOK3K.js.map +0 -7
- package/dist/chunk-AUUABFHL.js +0 -124
- package/dist/chunk-AUUABFHL.js.map +0 -7
- package/dist/chunk-AWW3YUGJ.js +0 -193
- package/dist/chunk-AWW3YUGJ.js.map +0 -7
- package/dist/chunk-AX7VEEWJ.js +0 -158
- package/dist/chunk-AX7VEEWJ.js.map +0 -7
- package/dist/chunk-B3NTODO7.js +0 -57
- package/dist/chunk-B3NTODO7.js.map +0 -7
- package/dist/chunk-BAX7Q6GR.js +0 -55
- package/dist/chunk-BAX7Q6GR.js.map +0 -7
- package/dist/chunk-BBM6BR3Z.js +0 -28
- package/dist/chunk-BBM6BR3Z.js.map +0 -7
- package/dist/chunk-BHXZMHSX.js +0 -109
- package/dist/chunk-BHXZMHSX.js.map +0 -7
- package/dist/chunk-BIUXDLVY.js +0 -62
- package/dist/chunk-BIUXDLVY.js.map +0 -7
- package/dist/chunk-BM7J2W36.js +0 -86
- package/dist/chunk-BM7J2W36.js.map +0 -7
- package/dist/chunk-BMFZL2P4.js +0 -97
- package/dist/chunk-BMFZL2P4.js.map +0 -7
- package/dist/chunk-BQXEXK4H.js +0 -114
- package/dist/chunk-BQXEXK4H.js.map +0 -7
- package/dist/chunk-BU2CTWBG.js +0 -30
- package/dist/chunk-BU2CTWBG.js.map +0 -7
- package/dist/chunk-BVKSCLF7.js +0 -195
- package/dist/chunk-BVKSCLF7.js.map +0 -7
- package/dist/chunk-BWA3D22L.js +0 -88
- package/dist/chunk-BWA3D22L.js.map +0 -7
- package/dist/chunk-CE24RSPL.js +0 -506
- package/dist/chunk-CE24RSPL.js.map +0 -7
- package/dist/chunk-CEB5S2Z5.js +0 -127
- package/dist/chunk-CEB5S2Z5.js.map +0 -7
- package/dist/chunk-CEKNTCJD.js +0 -177
- package/dist/chunk-CEKNTCJD.js.map +0 -7
- package/dist/chunk-CETZGSCP.js +0 -71
- package/dist/chunk-CETZGSCP.js.map +0 -7
- package/dist/chunk-CGBWMONK.js +0 -412
- package/dist/chunk-CGBWMONK.js.map +0 -7
- package/dist/chunk-CGFDIH77.js +0 -94
- package/dist/chunk-CGFDIH77.js.map +0 -7
- package/dist/chunk-CPLEC5LJ.js +0 -26
- package/dist/chunk-CPLEC5LJ.js.map +0 -7
- package/dist/chunk-CPNIXMGX.js +0 -127
- package/dist/chunk-CPNIXMGX.js.map +0 -7
- package/dist/chunk-CSJO73LD.js +0 -84
- package/dist/chunk-CSJO73LD.js.map +0 -7
- package/dist/chunk-CTKBDSL6.js +0 -81
- package/dist/chunk-CTKBDSL6.js.map +0 -7
- package/dist/chunk-CY6WHUCW.js +0 -54
- package/dist/chunk-CY6WHUCW.js.map +0 -7
- package/dist/chunk-D4GYYYMW.js +0 -155
- package/dist/chunk-D4GYYYMW.js.map +0 -7
- package/dist/chunk-D64CZG54.js +0 -78
- package/dist/chunk-D64CZG54.js.map +0 -7
- package/dist/chunk-D7Q6Z74D.js +0 -123
- package/dist/chunk-D7Q6Z74D.js.map +0 -7
- package/dist/chunk-DSGPDHF2.js +0 -737
- package/dist/chunk-DSGPDHF2.js.map +0 -7
- package/dist/chunk-DZIM4OWK.js +0 -17
- package/dist/chunk-DZIM4OWK.js.map +0 -7
- package/dist/chunk-E3GC4V5V.js +0 -30
- package/dist/chunk-E3GC4V5V.js.map +0 -7
- package/dist/chunk-E5HPDHCW.js +0 -34
- package/dist/chunk-E5HPDHCW.js.map +0 -7
- package/dist/chunk-E75BJJZ2.js +0 -635
- package/dist/chunk-E75BJJZ2.js.map +0 -7
- package/dist/chunk-EBXHW7ZO.js +0 -108
- package/dist/chunk-EBXHW7ZO.js.map +0 -7
- package/dist/chunk-EE4DHUUZ.js +0 -472
- package/dist/chunk-EE4DHUUZ.js.map +0 -7
- package/dist/chunk-EHELTAAD.js +0 -198
- package/dist/chunk-EHELTAAD.js.map +0 -7
- package/dist/chunk-EKXPSI7Z.js +0 -135
- package/dist/chunk-EKXPSI7Z.js.map +0 -7
- package/dist/chunk-EO35SCFP.js +0 -7
- package/dist/chunk-EO35SCFP.js.map +0 -7
- package/dist/chunk-ER2XTD2S.js +0 -271
- package/dist/chunk-ER2XTD2S.js.map +0 -7
- package/dist/chunk-ERCH75SH.js +0 -292
- package/dist/chunk-ERCH75SH.js.map +0 -7
- package/dist/chunk-ERXO3674.js +0 -54
- package/dist/chunk-ERXO3674.js.map +0 -7
- package/dist/chunk-EVFWZGFL.js +0 -235
- package/dist/chunk-EVFWZGFL.js.map +0 -7
- package/dist/chunk-EVPBRKMZ.js +0 -45
- package/dist/chunk-EVPBRKMZ.js.map +0 -7
- package/dist/chunk-F43CC2X2.js +0 -49
- package/dist/chunk-F43CC2X2.js.map +0 -7
- package/dist/chunk-F64TXVJJ.js +0 -158
- package/dist/chunk-F64TXVJJ.js.map +0 -7
- package/dist/chunk-F6AFJHWV.js +0 -45
- package/dist/chunk-F6AFJHWV.js.map +0 -7
- package/dist/chunk-F6APWSAA.js +0 -51
- package/dist/chunk-F6APWSAA.js.map +0 -7
- package/dist/chunk-F7LNS7G3.js +0 -235
- package/dist/chunk-F7LNS7G3.js.map +0 -7
- package/dist/chunk-FCNWR7ZX.js +0 -16352
- package/dist/chunk-FCNWR7ZX.js.map +0 -7
- package/dist/chunk-FFCG5NRU.js +0 -87
- package/dist/chunk-FFCG5NRU.js.map +0 -7
- package/dist/chunk-FG4NVFKM.js +0 -455
- package/dist/chunk-FG4NVFKM.js.map +0 -7
- package/dist/chunk-FHNEN6IR.js +0 -14
- package/dist/chunk-FHNEN6IR.js.map +0 -7
- package/dist/chunk-FJFC6CRR.js +0 -446
- package/dist/chunk-FJFC6CRR.js.map +0 -7
- package/dist/chunk-FK6RGYBB.js +0 -46
- package/dist/chunk-FK6RGYBB.js.map +0 -7
- package/dist/chunk-FMY6KXK6.js +0 -251
- package/dist/chunk-FMY6KXK6.js.map +0 -7
- package/dist/chunk-FPH56SCM.js +0 -21
- package/dist/chunk-FPH56SCM.js.map +0 -7
- package/dist/chunk-FQ4R7IOX.js +0 -32
- package/dist/chunk-FQ4R7IOX.js.map +0 -7
- package/dist/chunk-FQPYAPJJ.js +0 -124
- package/dist/chunk-FQPYAPJJ.js.map +0 -7
- package/dist/chunk-FQTLJO4W.js +0 -335
- package/dist/chunk-FQTLJO4W.js.map +0 -7
- package/dist/chunk-FVLJSB2W.js +0 -124
- package/dist/chunk-FVLJSB2W.js.map +0 -7
- package/dist/chunk-FVSH4Z6T.js +0 -173
- package/dist/chunk-FVSH4Z6T.js.map +0 -7
- package/dist/chunk-FVWBLEAD.js +0 -44
- package/dist/chunk-FVWBLEAD.js.map +0 -7
- package/dist/chunk-FYRKBNTI.js +0 -18
- package/dist/chunk-FYRKBNTI.js.map +0 -7
- package/dist/chunk-FYSARMGS.js +0 -93
- package/dist/chunk-FYSARMGS.js.map +0 -7
- package/dist/chunk-FZJOJ6P4.js +0 -28
- package/dist/chunk-FZJOJ6P4.js.map +0 -7
- package/dist/chunk-G46GHNDU.js +0 -4890
- package/dist/chunk-G46GHNDU.js.map +0 -7
- package/dist/chunk-G4TIS2SC.js +0 -56
- package/dist/chunk-G4TIS2SC.js.map +0 -7
- package/dist/chunk-GD6L3SLC.js +0 -30
- package/dist/chunk-GD6L3SLC.js.map +0 -7
- package/dist/chunk-GGWS7NQP.js +0 -247
- package/dist/chunk-GGWS7NQP.js.map +0 -7
- package/dist/chunk-GI2ZANRY.js +0 -24
- package/dist/chunk-GI2ZANRY.js.map +0 -7
- package/dist/chunk-GK3XVKXT.js +0 -737
- package/dist/chunk-GK3XVKXT.js.map +0 -7
- package/dist/chunk-GKOWCDQV.js +0 -699
- package/dist/chunk-GKOWCDQV.js.map +0 -7
- package/dist/chunk-GLLRCKKE.js +0 -26
- package/dist/chunk-GLLRCKKE.js.map +0 -7
- package/dist/chunk-GNYG6I36.js +0 -175
- package/dist/chunk-GNYG6I36.js.map +0 -7
- package/dist/chunk-GRBJYAYF.js +0 -129
- package/dist/chunk-GRBJYAYF.js.map +0 -7
- package/dist/chunk-GVYGUH2V.js +0 -7
- package/dist/chunk-GVYGUH2V.js.map +0 -7
- package/dist/chunk-GXDQGBA2.js +0 -106
- package/dist/chunk-GXDQGBA2.js.map +0 -7
- package/dist/chunk-GZAGAWSU.js +0 -28
- package/dist/chunk-GZAGAWSU.js.map +0 -7
- package/dist/chunk-H23E72SB.js +0 -163
- package/dist/chunk-H23E72SB.js.map +0 -7
- package/dist/chunk-H2HY73I6.js +0 -122
- package/dist/chunk-H2HY73I6.js.map +0 -7
- package/dist/chunk-H5MLA6PA.js +0 -29
- package/dist/chunk-H5MLA6PA.js.map +0 -7
- package/dist/chunk-H6YVV7GE.js +0 -22
- package/dist/chunk-H6YVV7GE.js.map +0 -7
- package/dist/chunk-H7KAUMBC.js +0 -635
- package/dist/chunk-H7KAUMBC.js.map +0 -7
- package/dist/chunk-HDPICD3P.js +0 -4890
- package/dist/chunk-HDPICD3P.js.map +0 -7
- package/dist/chunk-HGHU3TVL.js +0 -174
- package/dist/chunk-HGHU3TVL.js.map +0 -7
- package/dist/chunk-HJ5E2JRL.js +0 -88
- package/dist/chunk-HJ5E2JRL.js.map +0 -7
- package/dist/chunk-HJW3CKZL.js +0 -94
- package/dist/chunk-HJW3CKZL.js.map +0 -7
- package/dist/chunk-HKF5EBER.js +0 -418
- package/dist/chunk-HKF5EBER.js.map +0 -7
- package/dist/chunk-HLUR35G5.js +0 -30
- package/dist/chunk-HLUR35G5.js.map +0 -7
- package/dist/chunk-HNIW2NZU.js +0 -120
- package/dist/chunk-HNIW2NZU.js.map +0 -7
- package/dist/chunk-HP5HMWOM.js +0 -123
- package/dist/chunk-HP5HMWOM.js.map +0 -7
- package/dist/chunk-HQSHS6IB.js +0 -88
- package/dist/chunk-HQSHS6IB.js.map +0 -7
- package/dist/chunk-HSXRCP25.js +0 -171
- package/dist/chunk-HSXRCP25.js.map +0 -7
- package/dist/chunk-HTV3R73W.js +0 -51
- package/dist/chunk-HTV3R73W.js.map +0 -7
- package/dist/chunk-I26OPZLO.js +0 -28
- package/dist/chunk-I26OPZLO.js.map +0 -7
- package/dist/chunk-I7JJQ4BQ.js +0 -30
- package/dist/chunk-I7JJQ4BQ.js.map +0 -7
- package/dist/chunk-IJ6Y4W7F.js +0 -392
- package/dist/chunk-IJ6Y4W7F.js.map +0 -7
- package/dist/chunk-IJCMYMZB.js +0 -239
- package/dist/chunk-IJCMYMZB.js.map +0 -7
- package/dist/chunk-IJH4NOQ4.js +0 -18
- package/dist/chunk-IJH4NOQ4.js.map +0 -7
- package/dist/chunk-IMHRZQRH.js +0 -76
- package/dist/chunk-IMHRZQRH.js.map +0 -7
- package/dist/chunk-INNENDEE.js +0 -472
- package/dist/chunk-INNENDEE.js.map +0 -7
- package/dist/chunk-IOTLSMEQ.js +0 -177
- package/dist/chunk-IOTLSMEQ.js.map +0 -7
- package/dist/chunk-IQYYEHSM.js +0 -300
- package/dist/chunk-IQYYEHSM.js.map +0 -7
- package/dist/chunk-IRA5NJ4Q.js +0 -21
- package/dist/chunk-IRA5NJ4Q.js.map +0 -7
- package/dist/chunk-IU7EXXK7.js +0 -1662
- package/dist/chunk-IU7EXXK7.js.map +0 -7
- package/dist/chunk-IUXAKDAY.js +0 -102
- package/dist/chunk-IUXAKDAY.js.map +0 -7
- package/dist/chunk-JB6ZQEVR.js +0 -465
- package/dist/chunk-JB6ZQEVR.js.map +0 -7
- package/dist/chunk-JCWNMWNY.js +0 -102
- package/dist/chunk-JCWNMWNY.js.map +0 -7
- package/dist/chunk-JGIZPU2Y.js +0 -39
- package/dist/chunk-JGIZPU2Y.js.map +0 -7
- package/dist/chunk-JIU4FXA7.js +0 -485
- package/dist/chunk-JIU4FXA7.js.map +0 -7
- package/dist/chunk-JMYIFYY5.js +0 -233
- package/dist/chunk-JMYIFYY5.js.map +0 -7
- package/dist/chunk-JSZBX2TA.js +0 -5853
- package/dist/chunk-JSZBX2TA.js.map +0 -7
- package/dist/chunk-JU2Y33DB.js +0 -60
- package/dist/chunk-JU2Y33DB.js.map +0 -7
- package/dist/chunk-JVLRI4RU.js +0 -62
- package/dist/chunk-JVLRI4RU.js.map +0 -7
- package/dist/chunk-JZ3AVNZC.js +0 -44117
- package/dist/chunk-JZ3AVNZC.js.map +0 -7
- package/dist/chunk-K3HEWOHN.js +0 -30
- package/dist/chunk-K3HEWOHN.js.map +0 -7
- package/dist/chunk-K5EK4WZV.js +0 -7
- package/dist/chunk-K5EK4WZV.js.map +0 -7
- package/dist/chunk-KAWXMSYC.js +0 -58
- package/dist/chunk-KAWXMSYC.js.map +0 -7
- package/dist/chunk-KEGPHS4C.js +0 -80
- package/dist/chunk-KEGPHS4C.js.map +0 -7
- package/dist/chunk-KHFWQ334.js +0 -138
- package/dist/chunk-KHFWQ334.js.map +0 -7
- package/dist/chunk-KJW6JLM6.js +0 -95
- package/dist/chunk-KJW6JLM6.js.map +0 -7
- package/dist/chunk-KSEANSJE.js +0 -40
- package/dist/chunk-KSEANSJE.js.map +0 -7
- package/dist/chunk-KVU54E6W.js +0 -63
- package/dist/chunk-KVU54E6W.js.map +0 -7
- package/dist/chunk-KXXVR3DC.js +0 -244
- package/dist/chunk-KXXVR3DC.js.map +0 -7
- package/dist/chunk-L5OUVMHK.js +0 -174
- package/dist/chunk-L5OUVMHK.js.map +0 -7
- package/dist/chunk-L5T6XUDP.js +0 -412
- package/dist/chunk-L5T6XUDP.js.map +0 -7
- package/dist/chunk-LIFXTQ4U.js +0 -7287
- package/dist/chunk-LIFXTQ4U.js.map +0 -7
- package/dist/chunk-LIVQ7GIO.js +0 -86
- package/dist/chunk-LIVQ7GIO.js.map +0 -7
- package/dist/chunk-LMD5UTKM.js +0 -169
- package/dist/chunk-LMD5UTKM.js.map +0 -7
- package/dist/chunk-LO4F6E3N.js +0 -163
- package/dist/chunk-LO4F6E3N.js.map +0 -7
- package/dist/chunk-LSVKDUNM.js +0 -151
- package/dist/chunk-LSVKDUNM.js.map +0 -7
- package/dist/chunk-LTXNC6JX.js +0 -27
- package/dist/chunk-LTXNC6JX.js.map +0 -7
- package/dist/chunk-LUGTGPT6.js +0 -138
- package/dist/chunk-LUGTGPT6.js.map +0 -7
- package/dist/chunk-LVMK2GPM.js +0 -18
- package/dist/chunk-LVMK2GPM.js.map +0 -7
- package/dist/chunk-LXVPETLK.js +0 -1405
- package/dist/chunk-LXVPETLK.js.map +0 -7
- package/dist/chunk-LZNW24OB.js +0 -78
- package/dist/chunk-LZNW24OB.js.map +0 -7
- package/dist/chunk-LZQFDJNW.js +0 -300
- package/dist/chunk-LZQFDJNW.js.map +0 -7
- package/dist/chunk-M4VQPIF4.js +0 -5853
- package/dist/chunk-M4VQPIF4.js.map +0 -7
- package/dist/chunk-M64QE4QC.js +0 -64
- package/dist/chunk-M64QE4QC.js.map +0 -7
- package/dist/chunk-MAF6PSCJ.js +0 -44
- package/dist/chunk-MAF6PSCJ.js.map +0 -7
- package/dist/chunk-MBIX6Z7U.js +0 -80
- package/dist/chunk-MBIX6Z7U.js.map +0 -7
- package/dist/chunk-MDLLXMC3.js +0 -183
- package/dist/chunk-MDLLXMC3.js.map +0 -7
- package/dist/chunk-MEI5HTWV.js +0 -127
- package/dist/chunk-MEI5HTWV.js.map +0 -7
- package/dist/chunk-MH74AJ3A.js +0 -82
- package/dist/chunk-MH74AJ3A.js.map +0 -7
- package/dist/chunk-MIFIM4PI.js +0 -163
- package/dist/chunk-MIFIM4PI.js.map +0 -7
- package/dist/chunk-MISZB5QJ.js +0 -22
- package/dist/chunk-MISZB5QJ.js.map +0 -7
- package/dist/chunk-MJ27XQYG.js +0 -125
- package/dist/chunk-MJ27XQYG.js.map +0 -7
- package/dist/chunk-MJ2GW6SU.js +0 -163
- package/dist/chunk-MJ2GW6SU.js.map +0 -7
- package/dist/chunk-MLQY5SKR.js +0 -52
- package/dist/chunk-MLQY5SKR.js.map +0 -7
- package/dist/chunk-MTMHGC3G.js +0 -39
- package/dist/chunk-MTMHGC3G.js.map +0 -7
- package/dist/chunk-MWBAW3YV.js +0 -244
- package/dist/chunk-MWBAW3YV.js.map +0 -7
- package/dist/chunk-MYSK3SIM.js +0 -55
- package/dist/chunk-MYSK3SIM.js.map +0 -7
- package/dist/chunk-MZGGB2YT.js +0 -50
- package/dist/chunk-MZGGB2YT.js.map +0 -7
- package/dist/chunk-N46MIZXB.js +0 -154
- package/dist/chunk-N46MIZXB.js.map +0 -7
- package/dist/chunk-N53537P6.js +0 -31
- package/dist/chunk-N53537P6.js.map +0 -7
- package/dist/chunk-N5CTFOLX.js +0 -40
- package/dist/chunk-N5CTFOLX.js.map +0 -7
- package/dist/chunk-N5SNGZJV.js +0 -217
- package/dist/chunk-N5SNGZJV.js.map +0 -7
- package/dist/chunk-NGCTBYQ3.js +0 -181
- package/dist/chunk-NGCTBYQ3.js.map +0 -7
- package/dist/chunk-NIFG55CE.js +0 -52
- package/dist/chunk-NIFG55CE.js.map +0 -7
- package/dist/chunk-NJ63ALPX.js +0 -7
- package/dist/chunk-NJ63ALPX.js.map +0 -7
- package/dist/chunk-NMUX7SGU.js +0 -676
- package/dist/chunk-NMUX7SGU.js.map +0 -7
- package/dist/chunk-NO7GMLNU.js +0 -292
- package/dist/chunk-NO7GMLNU.js.map +0 -7
- package/dist/chunk-NTOGVX2Y.js +0 -92
- package/dist/chunk-NTOGVX2Y.js.map +0 -7
- package/dist/chunk-NZVHE4IT.js +0 -3101
- package/dist/chunk-NZVHE4IT.js.map +0 -7
- package/dist/chunk-O5IVKDX7.js +0 -30
- package/dist/chunk-O5IVKDX7.js.map +0 -7
- package/dist/chunk-O7ORICEC.js +0 -82
- package/dist/chunk-O7ORICEC.js.map +0 -7
- package/dist/chunk-OBMBAM3N.js +0 -73
- package/dist/chunk-OBMBAM3N.js.map +0 -7
- package/dist/chunk-OFWMLQMU.js +0 -7287
- package/dist/chunk-OFWMLQMU.js.map +0 -7
- package/dist/chunk-OJ3ZUKBI.js +0 -73
- package/dist/chunk-OJ3ZUKBI.js.map +0 -7
- package/dist/chunk-OJJBD5K3.js +0 -45
- package/dist/chunk-OJJBD5K3.js.map +0 -7
- package/dist/chunk-OJTHE4B7.js +0 -50
- package/dist/chunk-OJTHE4B7.js.map +0 -7
- package/dist/chunk-OKDOVX4B.js +0 -699
- package/dist/chunk-OKDOVX4B.js.map +0 -7
- package/dist/chunk-OOYPYBTA.js +0 -446
- package/dist/chunk-OOYPYBTA.js.map +0 -7
- package/dist/chunk-OQP4W4AR.js +0 -105
- package/dist/chunk-OQP4W4AR.js.map +0 -7
- package/dist/chunk-OVMDMCZ5.js +0 -241
- package/dist/chunk-OVMDMCZ5.js.map +0 -7
- package/dist/chunk-OVTT2EKA.js +0 -516
- package/dist/chunk-OVTT2EKA.js.map +0 -7
- package/dist/chunk-OVU43GJK.js +0 -63
- package/dist/chunk-OVU43GJK.js.map +0 -7
- package/dist/chunk-P3TMARA6.js +0 -18
- package/dist/chunk-P3TMARA6.js.map +0 -7
- package/dist/chunk-P5N63LBS.js +0 -94
- package/dist/chunk-P5N63LBS.js.map +0 -7
- package/dist/chunk-PARITZ7F.js +0 -28
- package/dist/chunk-PARITZ7F.js.map +0 -7
- package/dist/chunk-PBQK4KY4.js +0 -195
- package/dist/chunk-PBQK4KY4.js.map +0 -7
- package/dist/chunk-PLMOTQ42.js +0 -335
- package/dist/chunk-PLMOTQ42.js.map +0 -7
- package/dist/chunk-PSL2AHIA.js +0 -27
- package/dist/chunk-PSL2AHIA.js.map +0 -7
- package/dist/chunk-Q5QT7JBM.js +0 -92
- package/dist/chunk-Q5QT7JBM.js.map +0 -7
- package/dist/chunk-Q6H5OV2R.js +0 -180
- package/dist/chunk-Q6H5OV2R.js.map +0 -7
- package/dist/chunk-Q7WA5DCR.js +0 -62
- package/dist/chunk-Q7WA5DCR.js.map +0 -7
- package/dist/chunk-QAR5POXD.js +0 -472
- package/dist/chunk-QAR5POXD.js.map +0 -7
- package/dist/chunk-QATEENP2.js +0 -7
- package/dist/chunk-QATEENP2.js.map +0 -7
- package/dist/chunk-QDT24CIA.js +0 -485
- package/dist/chunk-QDT24CIA.js.map +0 -7
- package/dist/chunk-QI3NB7D5.js +0 -455
- package/dist/chunk-QI3NB7D5.js.map +0 -7
- package/dist/chunk-QIDAVXSX.js +0 -106
- package/dist/chunk-QIDAVXSX.js.map +0 -7
- package/dist/chunk-QKIGQVP2.js +0 -104
- package/dist/chunk-QKIGQVP2.js.map +0 -7
- package/dist/chunk-QNJENPK2.js +0 -81
- package/dist/chunk-QNJENPK2.js.map +0 -7
- package/dist/chunk-R5S76YR5.js +0 -12
- package/dist/chunk-R5S76YR5.js.map +0 -7
- package/dist/chunk-R7ZBOXPS.js +0 -163
- package/dist/chunk-R7ZBOXPS.js.map +0 -7
- package/dist/chunk-RAL3KX76.js +0 -239
- package/dist/chunk-RAL3KX76.js.map +0 -7
- package/dist/chunk-REVXXWAS.js +0 -31
- package/dist/chunk-REVXXWAS.js.map +0 -7
- package/dist/chunk-RFH4HRZP.js +0 -94
- package/dist/chunk-RFH4HRZP.js.map +0 -7
- package/dist/chunk-RHITG64O.js +0 -50
- package/dist/chunk-RHITG64O.js.map +0 -7
- package/dist/chunk-RK5HZFP6.js +0 -111
- package/dist/chunk-RK5HZFP6.js.map +0 -7
- package/dist/chunk-RNGAGYCL.js +0 -49
- package/dist/chunk-RNGAGYCL.js.map +0 -7
- package/dist/chunk-RPCVN3JA.js +0 -261
- package/dist/chunk-RPCVN3JA.js.map +0 -7
- package/dist/chunk-RQ26XXFS.js +0 -45
- package/dist/chunk-RQ26XXFS.js.map +0 -7
- package/dist/chunk-RQQE5DDT.js +0 -193
- package/dist/chunk-RQQE5DDT.js.map +0 -7
- package/dist/chunk-RSA7PKZH.js +0 -187
- package/dist/chunk-RSA7PKZH.js.map +0 -7
- package/dist/chunk-RTSINQ4T.js +0 -78
- package/dist/chunk-RTSINQ4T.js.map +0 -7
- package/dist/chunk-RVOD3ESA.js +0 -38
- package/dist/chunk-RVOD3ESA.js.map +0 -7
- package/dist/chunk-SAOUP24A.js +0 -70
- package/dist/chunk-SAOUP24A.js.map +0 -7
- package/dist/chunk-SFZL2TCV.js +0 -55
- package/dist/chunk-SFZL2TCV.js.map +0 -7
- package/dist/chunk-SH6Y4CGQ.js +0 -175
- package/dist/chunk-SH6Y4CGQ.js.map +0 -7
- package/dist/chunk-SHBAAFFH.js +0 -74
- package/dist/chunk-SHBAAFFH.js.map +0 -7
- package/dist/chunk-SJPFUXBV.js +0 -45
- package/dist/chunk-SJPFUXBV.js.map +0 -7
- package/dist/chunk-SLIUQWAR.js +0 -58
- package/dist/chunk-SLIUQWAR.js.map +0 -7
- package/dist/chunk-SPNSM6SB.js +0 -36
- package/dist/chunk-SPNSM6SB.js.map +0 -7
- package/dist/chunk-SQUHLLK5.js +0 -125
- package/dist/chunk-SQUHLLK5.js.map +0 -7
- package/dist/chunk-SSEX66OL.js +0 -39
- package/dist/chunk-SSEX66OL.js.map +0 -7
- package/dist/chunk-SWWK35VQ.js +0 -84
- package/dist/chunk-SWWK35VQ.js.map +0 -7
- package/dist/chunk-SX2LOHOX.js +0 -251
- package/dist/chunk-SX2LOHOX.js.map +0 -7
- package/dist/chunk-T72EMFTX.js +0 -74
- package/dist/chunk-T72EMFTX.js.map +0 -7
- package/dist/chunk-TA2QJPPG.js +0 -169
- package/dist/chunk-TA2QJPPG.js.map +0 -7
- package/dist/chunk-TC5ZVFV6.js +0 -292
- package/dist/chunk-TC5ZVFV6.js.map +0 -7
- package/dist/chunk-TFD7ZIYD.js +0 -105
- package/dist/chunk-TFD7ZIYD.js.map +0 -7
- package/dist/chunk-TFEETDNY.js +0 -78
- package/dist/chunk-TFEETDNY.js.map +0 -7
- package/dist/chunk-TH6ONRWT.js +0 -516
- package/dist/chunk-TH6ONRWT.js.map +0 -7
- package/dist/chunk-THM2QV25.js +0 -108
- package/dist/chunk-THM2QV25.js.map +0 -7
- package/dist/chunk-TMQMQ67T.js +0 -81
- package/dist/chunk-TMQMQ67T.js.map +0 -7
- package/dist/chunk-TPYWUZOR.js +0 -178
- package/dist/chunk-TPYWUZOR.js.map +0 -7
- package/dist/chunk-TRWT2N6Z.js +0 -15
- package/dist/chunk-TRWT2N6Z.js.map +0 -7
- package/dist/chunk-TTXEM54Y.js +0 -76
- package/dist/chunk-TTXEM54Y.js.map +0 -7
- package/dist/chunk-U2O4LE6S.js +0 -22
- package/dist/chunk-U2O4LE6S.js.map +0 -7
- package/dist/chunk-U44IVNP2.js +0 -91
- package/dist/chunk-U44IVNP2.js.map +0 -7
- package/dist/chunk-U4LVIY5F.js +0 -1405
- package/dist/chunk-U4LVIY5F.js.map +0 -7
- package/dist/chunk-U767LCSG.js +0 -78
- package/dist/chunk-U767LCSG.js.map +0 -7
- package/dist/chunk-U7GKLHU6.js +0 -120
- package/dist/chunk-U7GKLHU6.js.map +0 -7
- package/dist/chunk-UAB5P5QO.js +0 -60
- package/dist/chunk-UAB5P5QO.js.map +0 -7
- package/dist/chunk-UDDWLWKZ.js +0 -82
- package/dist/chunk-UDDWLWKZ.js.map +0 -7
- package/dist/chunk-UEHPJQBL.js +0 -38
- package/dist/chunk-UEHPJQBL.js.map +0 -7
- package/dist/chunk-UIBV6IGR.js +0 -31
- package/dist/chunk-UIBV6IGR.js.map +0 -7
- package/dist/chunk-UIYFRUET.js +0 -16352
- package/dist/chunk-UIYFRUET.js.map +0 -7
- package/dist/chunk-UJS3TIVS.js +0 -52
- package/dist/chunk-UJS3TIVS.js.map +0 -7
- package/dist/chunk-UMMPB6FL.js +0 -506
- package/dist/chunk-UMMPB6FL.js.map +0 -7
- package/dist/chunk-UP42ACP7.js +0 -27
- package/dist/chunk-UP42ACP7.js.map +0 -7
- package/dist/chunk-UPEF7ETP.js +0 -92
- package/dist/chunk-UPEF7ETP.js.map +0 -7
- package/dist/chunk-UU5PSBSI.js +0 -176
- package/dist/chunk-UU5PSBSI.js.map +0 -7
- package/dist/chunk-UV63XYFU.js +0 -173
- package/dist/chunk-UV63XYFU.js.map +0 -7
- package/dist/chunk-UWPHOAOC.js +0 -29
- package/dist/chunk-UWPHOAOC.js.map +0 -7
- package/dist/chunk-UXDDOSJC.js +0 -52
- package/dist/chunk-UXDDOSJC.js.map +0 -7
- package/dist/chunk-V3VAOMCO.js +0 -465
- package/dist/chunk-V3VAOMCO.js.map +0 -7
- package/dist/chunk-VA7ENH2S.js +0 -38
- package/dist/chunk-VA7ENH2S.js.map +0 -7
- package/dist/chunk-VBDLTKI2.js +0 -130
- package/dist/chunk-VBDLTKI2.js.map +0 -7
- package/dist/chunk-VCWIKEJ7.js +0 -7
- package/dist/chunk-VCWIKEJ7.js.map +0 -7
- package/dist/chunk-VFPDFLVE.js +0 -516
- package/dist/chunk-VFPDFLVE.js.map +0 -7
- package/dist/chunk-VHG4FNIJ.js +0 -93
- package/dist/chunk-VHG4FNIJ.js.map +0 -7
- package/dist/chunk-VKOO6MIZ.js +0 -51
- package/dist/chunk-VKOO6MIZ.js.map +0 -7
- package/dist/chunk-VKXKRZG7.js +0 -62
- package/dist/chunk-VKXKRZG7.js.map +0 -7
- package/dist/chunk-VPQICZQR.js +0 -93
- package/dist/chunk-VPQICZQR.js.map +0 -7
- package/dist/chunk-VRBJNFPL.js +0 -114
- package/dist/chunk-VRBJNFPL.js.map +0 -7
- package/dist/chunk-VUOLPEUZ.js +0 -7
- package/dist/chunk-VUOLPEUZ.js.map +0 -7
- package/dist/chunk-VUU5KFH3.js +0 -38
- package/dist/chunk-VUU5KFH3.js.map +0 -7
- package/dist/chunk-VVBL5CFF.js +0 -7
- package/dist/chunk-VVBL5CFF.js.map +0 -7
- package/dist/chunk-VYZEQ6KY.js +0 -22
- package/dist/chunk-VYZEQ6KY.js.map +0 -7
- package/dist/chunk-W6SOBS7M.js +0 -138
- package/dist/chunk-W6SOBS7M.js.map +0 -7
- package/dist/chunk-WBPQVWSU.js +0 -198
- package/dist/chunk-WBPQVWSU.js.map +0 -7
- package/dist/chunk-WDOKKRTE.js +0 -7
- package/dist/chunk-WDOKKRTE.js.map +0 -7
- package/dist/chunk-WGXXKFN5.js +0 -7
- package/dist/chunk-WGXXKFN5.js.map +0 -7
- package/dist/chunk-WHPUUP3J.js +0 -25
- package/dist/chunk-WHPUUP3J.js.map +0 -7
- package/dist/chunk-WS6HWBKT.js +0 -30
- package/dist/chunk-WS6HWBKT.js.map +0 -7
- package/dist/chunk-XF7LD6VV.js +0 -122
- package/dist/chunk-XF7LD6VV.js.map +0 -7
- package/dist/chunk-XFTXM3RE.js +0 -64
- package/dist/chunk-XFTXM3RE.js.map +0 -7
- package/dist/chunk-XJABPO2T.js +0 -235
- package/dist/chunk-XJABPO2T.js.map +0 -7
- package/dist/chunk-XK6VF3H7.js +0 -3586
- package/dist/chunk-XK6VF3H7.js.map +0 -7
- package/dist/chunk-XOZPOHLG.js +0 -233
- package/dist/chunk-XOZPOHLG.js.map +0 -7
- package/dist/chunk-XQYIIPOJ.js +0 -266
- package/dist/chunk-XQYIIPOJ.js.map +0 -7
- package/dist/chunk-XR7DPSNX.js +0 -195
- package/dist/chunk-XR7DPSNX.js.map +0 -7
- package/dist/chunk-XYH4JC3U.js +0 -7
- package/dist/chunk-XYH4JC3U.js.map +0 -7
- package/dist/chunk-XZSAN55E.js +0 -58
- package/dist/chunk-XZSAN55E.js.map +0 -7
- package/dist/chunk-Y3KJR4OG.js +0 -64
- package/dist/chunk-Y3KJR4OG.js.map +0 -7
- package/dist/chunk-Y4JKH7FF.js +0 -45
- package/dist/chunk-Y4JKH7FF.js.map +0 -7
- package/dist/chunk-Y6CJN4ID.js +0 -31
- package/dist/chunk-Y6CJN4ID.js.map +0 -7
- package/dist/chunk-YABGJU5M.js +0 -271
- package/dist/chunk-YABGJU5M.js.map +0 -7
- package/dist/chunk-YB5UCHLN.js +0 -314
- package/dist/chunk-YB5UCHLN.js.map +0 -7
- package/dist/chunk-YEJH7ZC2.js +0 -34
- package/dist/chunk-YEJH7ZC2.js.map +0 -7
- package/dist/chunk-YF5DYD3X.js +0 -97
- package/dist/chunk-YF5DYD3X.js.map +0 -7
- package/dist/chunk-YFTE4H54.js +0 -44117
- package/dist/chunk-YFTE4H54.js.map +0 -7
- package/dist/chunk-YGVQZCE7.js +0 -30
- package/dist/chunk-YGVQZCE7.js.map +0 -7
- package/dist/chunk-YNHADHHS.js +0 -138
- package/dist/chunk-YNHADHHS.js.map +0 -7
- package/dist/chunk-YNJYMD43.js +0 -392
- package/dist/chunk-YNJYMD43.js.map +0 -7
- package/dist/chunk-YNYEQGVN.js +0 -251
- package/dist/chunk-YNYEQGVN.js.map +0 -7
- package/dist/chunk-YOAMBAM2.js +0 -70
- package/dist/chunk-YOAMBAM2.js.map +0 -7
- package/dist/chunk-YUPBD27Z.js +0 -70
- package/dist/chunk-YUPBD27Z.js.map +0 -7
- package/dist/chunk-YWE5AQPZ.js +0 -258
- package/dist/chunk-YWE5AQPZ.js.map +0 -7
- package/dist/chunk-YWHH3MB6.js +0 -1405
- package/dist/chunk-YWHH3MB6.js.map +0 -7
- package/dist/chunk-YXJ52FD5.js +0 -271
- package/dist/chunk-YXJ52FD5.js.map +0 -7
- package/dist/chunk-YZ6F5N7R.js +0 -455
- package/dist/chunk-YZ6F5N7R.js.map +0 -7
- package/dist/chunk-YZGORRQN.js +0 -3101
- package/dist/chunk-YZGORRQN.js.map +0 -7
- package/dist/chunk-Z6IVJ6ZW.js +0 -30
- package/dist/chunk-Z6IVJ6ZW.js.map +0 -7
- package/dist/chunk-ZFC44XJJ.js +0 -86
- package/dist/chunk-ZFC44XJJ.js.map +0 -7
- package/dist/chunk-ZFGRQIB6.js +0 -38
- package/dist/chunk-ZFGRQIB6.js.map +0 -7
- package/dist/chunk-ZGAUVPAB.js +0 -14
- package/dist/chunk-ZGAUVPAB.js.map +0 -7
- package/dist/chunk-ZGCATLM5.js +0 -18
- package/dist/chunk-ZGCATLM5.js.map +0 -7
- package/dist/chunk-ZJDJC5TP.js +0 -82
- package/dist/chunk-ZJDJC5TP.js.map +0 -7
- package/dist/chunk-ZJGZNPDK.js +0 -171
- package/dist/chunk-ZJGZNPDK.js.map +0 -7
- package/dist/chunk-ZJHBJWZX.js +0 -699
- package/dist/chunk-ZJHBJWZX.js.map +0 -7
- package/dist/chunk-ZNOTD65D.js +0 -95
- package/dist/chunk-ZNOTD65D.js.map +0 -7
- package/dist/chunk-ZQ2QIFXW.js +0 -122
- package/dist/chunk-ZQ2QIFXW.js.map +0 -7
- package/dist/chunk-ZRMXPQGY.js +0 -241
- package/dist/chunk-ZRMXPQGY.js.map +0 -7
- package/dist/chunk-ZSOPE7DO.js +0 -92
- package/dist/chunk-ZSOPE7DO.js.map +0 -7
- package/dist/chunk-ZVEE5IDC.js +0 -3101
- package/dist/chunk-ZVEE5IDC.js.map +0 -7
- package/dist/chunk-ZY247PXY.js +0 -135
- package/dist/chunk-ZY247PXY.js.map +0 -7
- package/dist/cli-metadata.js +0 -12
- package/dist/cli-metadata.js.map +0 -7
- package/dist/contract-api.js +0 -104
- package/dist/contract-api.js.map +0 -7
- package/dist/dist-DVBXHDB4.js +0 -549
- package/dist/dist-DVBXHDB4.js.map +0 -7
- package/dist/dist-F3K7S5SS.js +0 -549
- package/dist/dist-F3K7S5SS.js.map +0 -7
- package/dist/helper-api.js +0 -51
- package/dist/helper-api.js.map +0 -7
- package/dist/index.js +0 -70
- package/dist/index.js.map +0 -7
- package/dist/magic-string.es-ITIPPYGW.js +0 -1315
- package/dist/magic-string.es-ITIPPYGW.js.map +0 -7
- package/dist/magic-string.es-V5NOGTUV.js +0 -1315
- package/dist/magic-string.es-V5NOGTUV.js.map +0 -7
- package/dist/openclaw.plugin.json +0 -23
- package/dist/package.json +0 -59
- package/dist/plugin-entry.handlers.runtime-JLRK5XTV.js +0 -20
- package/dist/plugin-entry.handlers.runtime-JLRK5XTV.js.map +0 -7
- package/dist/plugin-entry.handlers.runtime-POD4CSHM.js +0 -20
- package/dist/plugin-entry.handlers.runtime-POD4CSHM.js.map +0 -7
- package/dist/plugin-entry.handlers.runtime-YOSG6V6U.js +0 -20
- package/dist/plugin-entry.handlers.runtime-YOSG6V6U.js.map +0 -7
- package/dist/runtime-api.js +0 -104
- package/dist/runtime-api.js.map +0 -7
- package/dist/rust-crypto-7KS7OJ3F.js +0 -5323
- package/dist/rust-crypto-7KS7OJ3F.js.map +0 -7
- package/dist/rust-crypto-H35BXWUU.js +0 -5323
- package/dist/rust-crypto-H35BXWUU.js.map +0 -7
- package/dist/secret-contract-api.js +0 -18
- package/dist/secret-contract-api.js.map +0 -7
- package/dist/setup-entry.js +0 -22
- package/dist/setup-entry.js.map +0 -7
- package/dist/src/account-selection.js +0 -19
- package/dist/src/account-selection.js.map +0 -7
- package/dist/src/actions.js +0 -24
- package/dist/src/actions.js.map +0 -7
- package/dist/src/approval-auth.js +0 -27
- package/dist/src/approval-auth.js.map +0 -7
- package/dist/src/approval-handler.runtime.js +0 -378
- package/dist/src/approval-handler.runtime.js.map +0 -7
- package/dist/src/approval-ids.js +0 -9
- package/dist/src/approval-ids.js.map +0 -7
- package/dist/src/approval-native.js +0 -28
- package/dist/src/approval-native.js.map +0 -7
- package/dist/src/approval-reactions.js +0 -20
- package/dist/src/approval-reactions.js.map +0 -7
- package/dist/src/auth-precedence.js +0 -8
- package/dist/src/auth-precedence.js.map +0 -7
- package/dist/src/channel-account-paths.js +0 -11
- package/dist/src/channel-account-paths.js.map +0 -7
- package/dist/src/channel.js +0 -74
- package/dist/src/channel.js.map +0 -7
- package/dist/src/channel.runtime.js +0 -82
- package/dist/src/channel.runtime.js.map +0 -7
- package/dist/src/cli-metadata.js +0 -8
- package/dist/src/cli-metadata.js.map +0 -7
- package/dist/src/cli.js +0 -936
- package/dist/src/cli.js.map +0 -7
- package/dist/src/config-adapter.js +0 -26
- package/dist/src/config-adapter.js.map +0 -7
- package/dist/src/config-schema.js +0 -8
- package/dist/src/config-schema.js.map +0 -7
- package/dist/src/directory-live.js +0 -35
- package/dist/src/directory-live.js.map +0 -7
- package/dist/src/doctor-contract.js +0 -11
- package/dist/src/doctor-contract.js.map +0 -7
- package/dist/src/doctor.js +0 -42
- package/dist/src/doctor.js.map +0 -7
- package/dist/src/env-vars.js +0 -12
- package/dist/src/env-vars.js.map +0 -7
- package/dist/src/exec-approval-resolver.js +0 -10
- package/dist/src/exec-approval-resolver.js.map +0 -7
- package/dist/src/exec-approvals.js +0 -51
- package/dist/src/exec-approvals.js.map +0 -7
- package/dist/src/group-mentions.js +0 -28
- package/dist/src/group-mentions.js.map +0 -7
- package/dist/src/legacy-crypto-inspector-availability.js +0 -8
- package/dist/src/legacy-crypto-inspector-availability.js.map +0 -7
- package/dist/src/legacy-crypto.js +0 -26
- package/dist/src/legacy-crypto.js.map +0 -7
- package/dist/src/legacy-state.js +0 -24
- package/dist/src/legacy-state.js.map +0 -7
- package/dist/src/matrix/account-config.js +0 -16
- package/dist/src/matrix/account-config.js.map +0 -7
- package/dist/src/matrix/accounts.js +0 -31
- package/dist/src/matrix/accounts.js.map +0 -7
- package/dist/src/matrix/actions/client.js +0 -40
- package/dist/src/matrix/actions/client.js.map +0 -7
- package/dist/src/matrix/actions/devices.js +0 -42
- package/dist/src/matrix/actions/devices.js.map +0 -7
- package/dist/src/matrix/actions/limits.js +0 -8
- package/dist/src/matrix/actions/limits.js.map +0 -7
- package/dist/src/matrix/actions/messages.js +0 -49
- package/dist/src/matrix/actions/messages.js.map +0 -7
- package/dist/src/matrix/actions/pins.js +0 -46
- package/dist/src/matrix/actions/pins.js.map +0 -7
- package/dist/src/matrix/actions/polls.js +0 -37
- package/dist/src/matrix/actions/polls.js.map +0 -7
- package/dist/src/matrix/actions/profile.js +0 -38
- package/dist/src/matrix/actions/profile.js.map +0 -7
- package/dist/src/matrix/actions/reactions.js +0 -40
- package/dist/src/matrix/actions/reactions.js.map +0 -7
- package/dist/src/matrix/actions/room.js +0 -40
- package/dist/src/matrix/actions/room.js.map +0 -7
- package/dist/src/matrix/actions/summary.js +0 -19
- package/dist/src/matrix/actions/summary.js.map +0 -7
- package/dist/src/matrix/actions/types.js +0 -13
- package/dist/src/matrix/actions/types.js.map +0 -7
- package/dist/src/matrix/actions/verification.js +0 -77
- package/dist/src/matrix/actions/verification.js.map +0 -7
- package/dist/src/matrix/actions.js +0 -126
- package/dist/src/matrix/actions.js.map +0 -7
- package/dist/src/matrix/active-client.js +0 -10
- package/dist/src/matrix/active-client.js.map +0 -7
- package/dist/src/matrix/async-lock.js +0 -8
- package/dist/src/matrix/async-lock.js.map +0 -7
- package/dist/src/matrix/backup-health.js +0 -10
- package/dist/src/matrix/backup-health.js.map +0 -7
- package/dist/src/matrix/client/config-runtime-api.js +0 -24
- package/dist/src/matrix/client/config-runtime-api.js.map +0 -7
- package/dist/src/matrix/client/config-secret-input.runtime.js +0 -11
- package/dist/src/matrix/client/config-secret-input.runtime.js.map +0 -7
- package/dist/src/matrix/client/config.js +0 -42
- package/dist/src/matrix/client/config.js.map +0 -7
- package/dist/src/matrix/client/create-client.js +0 -20
- package/dist/src/matrix/client/create-client.js.map +0 -7
- package/dist/src/matrix/client/env-auth.js +0 -26
- package/dist/src/matrix/client/env-auth.js.map +0 -7
- package/dist/src/matrix/client/file-sync-store.js +0 -23
- package/dist/src/matrix/client/file-sync-store.js.map +0 -7
- package/dist/src/matrix/client/logging.js +0 -17
- package/dist/src/matrix/client/logging.js.map +0 -7
- package/dist/src/matrix/client/migration-snapshot.runtime.js +0 -13
- package/dist/src/matrix/client/migration-snapshot.runtime.js.map +0 -7
- package/dist/src/matrix/client/private-network-host.js +0 -8
- package/dist/src/matrix/client/private-network-host.js.map +0 -7
- package/dist/src/matrix/client/runtime.js +0 -8
- package/dist/src/matrix/client/runtime.js.map +0 -7
- package/dist/src/matrix/client/shared.js +0 -34
- package/dist/src/matrix/client/shared.js.map +0 -7
- package/dist/src/matrix/client/storage.js +0 -26
- package/dist/src/matrix/client/storage.js.map +0 -7
- package/dist/src/matrix/client/types.js +0 -7
- package/dist/src/matrix/client/types.js.map +0 -7
- package/dist/src/matrix/client-bootstrap.js +0 -15
- package/dist/src/matrix/client-bootstrap.js.map +0 -7
- package/dist/src/matrix/client-resolver.test-helpers.js +0 -122
- package/dist/src/matrix/client-resolver.test-helpers.js.map +0 -7
- package/dist/src/matrix/client.js +0 -63
- package/dist/src/matrix/client.js.map +0 -7
- package/dist/src/matrix/config-paths.js +0 -12
- package/dist/src/matrix/config-paths.js.map +0 -7
- package/dist/src/matrix/config-update.js +0 -17
- package/dist/src/matrix/config-update.js.map +0 -7
- package/dist/src/matrix/credentials-read.js +0 -22
- package/dist/src/matrix/credentials-read.js.map +0 -7
- package/dist/src/matrix/credentials-write.runtime.js +0 -24
- package/dist/src/matrix/credentials-write.runtime.js.map +0 -7
- package/dist/src/matrix/credentials.js +0 -90
- package/dist/src/matrix/credentials.js.map +0 -7
- package/dist/src/matrix/deps.js +0 -12
- package/dist/src/matrix/deps.js.map +0 -7
- package/dist/src/matrix/device-health.js +0 -10
- package/dist/src/matrix/device-health.js.map +0 -7
- package/dist/src/matrix/direct-management.js +0 -18
- package/dist/src/matrix/direct-management.js.map +0 -7
- package/dist/src/matrix/direct-room.js +0 -18
- package/dist/src/matrix/direct-room.js.map +0 -7
- package/dist/src/matrix/draft-stream.js +0 -33
- package/dist/src/matrix/draft-stream.js.map +0 -7
- package/dist/src/matrix/encryption-guidance.js +0 -17
- package/dist/src/matrix/encryption-guidance.js.map +0 -7
- package/dist/src/matrix/errors.js +0 -12
- package/dist/src/matrix/errors.js.map +0 -7
- package/dist/src/matrix/format.js +0 -13
- package/dist/src/matrix/format.js.map +0 -7
- package/dist/src/matrix/legacy-crypto-inspector.js +0 -72
- package/dist/src/matrix/legacy-crypto-inspector.js.map +0 -7
- package/dist/src/matrix/media-errors.js +0 -12
- package/dist/src/matrix/media-errors.js.map +0 -7
- package/dist/src/matrix/media-text.js +0 -22
- package/dist/src/matrix/media-text.js.map +0 -7
- package/dist/src/matrix/monitor/access-state.js +0 -9
- package/dist/src/matrix/monitor/access-state.js.map +0 -7
- package/dist/src/matrix/monitor/ack-config.js +0 -10
- package/dist/src/matrix/monitor/ack-config.js.map +0 -7
- package/dist/src/matrix/monitor/allowlist.js +0 -12
- package/dist/src/matrix/monitor/allowlist.js.map +0 -7
- package/dist/src/matrix/monitor/auto-join.js +0 -9
- package/dist/src/matrix/monitor/auto-join.js.map +0 -7
- package/dist/src/matrix/monitor/config.js +0 -37
- package/dist/src/matrix/monitor/config.js.map +0 -7
- package/dist/src/matrix/monitor/context-summary.js +0 -13
- package/dist/src/matrix/monitor/context-summary.js.map +0 -7
- package/dist/src/matrix/monitor/direct.js +0 -13
- package/dist/src/matrix/monitor/direct.js.map +0 -7
- package/dist/src/matrix/monitor/events.js +0 -20
- package/dist/src/matrix/monitor/events.js.map +0 -7
- package/dist/src/matrix/monitor/handler.js +0 -76
- package/dist/src/matrix/monitor/handler.js.map +0 -7
- package/dist/src/matrix/monitor/handler.test-helpers.js +0 -268
- package/dist/src/matrix/monitor/handler.test-helpers.js.map +0 -7
- package/dist/src/matrix/monitor/inbound-dedupe.js +0 -17
- package/dist/src/matrix/monitor/inbound-dedupe.js.map +0 -7
- package/dist/src/matrix/monitor/index.js +0 -502
- package/dist/src/matrix/monitor/index.js.map +0 -7
- package/dist/src/matrix/monitor/legacy-crypto-restore.js +0 -99
- package/dist/src/matrix/monitor/legacy-crypto-restore.js.map +0 -7
- package/dist/src/matrix/monitor/location.js +0 -11
- package/dist/src/matrix/monitor/location.js.map +0 -7
- package/dist/src/matrix/monitor/media.js +0 -10
- package/dist/src/matrix/monitor/media.js.map +0 -7
- package/dist/src/matrix/monitor/mentions.js +0 -9
- package/dist/src/matrix/monitor/mentions.js.map +0 -7
- package/dist/src/matrix/monitor/reaction-events.js +0 -38
- package/dist/src/matrix/monitor/reaction-events.js.map +0 -7
- package/dist/src/matrix/monitor/recent-invite.js +0 -10
- package/dist/src/matrix/monitor/recent-invite.js.map +0 -7
- package/dist/src/matrix/monitor/replies.js +0 -33
- package/dist/src/matrix/monitor/replies.js.map +0 -7
- package/dist/src/matrix/monitor/reply-context.js +0 -14
- package/dist/src/matrix/monitor/reply-context.js.map +0 -7
- package/dist/src/matrix/monitor/room-history.js +0 -10
- package/dist/src/matrix/monitor/room-history.js.map +0 -7
- package/dist/src/matrix/monitor/room-info.js +0 -9
- package/dist/src/matrix/monitor/room-info.js.map +0 -7
- package/dist/src/matrix/monitor/rooms.js +0 -9
- package/dist/src/matrix/monitor/rooms.js.map +0 -7
- package/dist/src/matrix/monitor/route.js +0 -12
- package/dist/src/matrix/monitor/route.js.map +0 -7
- package/dist/src/matrix/monitor/runtime-api.js +0 -40
- package/dist/src/matrix/monitor/runtime-api.js.map +0 -7
- package/dist/src/matrix/monitor/startup-verification.js +0 -174
- package/dist/src/matrix/monitor/startup-verification.js.map +0 -7
- package/dist/src/matrix/monitor/startup.js +0 -9
- package/dist/src/matrix/monitor/startup.js.map +0 -7
- package/dist/src/matrix/monitor/status.js +0 -10
- package/dist/src/matrix/monitor/status.js.map +0 -7
- package/dist/src/matrix/monitor/sync-lifecycle.js +0 -9
- package/dist/src/matrix/monitor/sync-lifecycle.js.map +0 -7
- package/dist/src/matrix/monitor/task-runner.js +0 -8
- package/dist/src/matrix/monitor/task-runner.js.map +0 -7
- package/dist/src/matrix/monitor/thread-context.js +0 -14
- package/dist/src/matrix/monitor/thread-context.js.map +0 -7
- package/dist/src/matrix/monitor/threads.js +0 -16
- package/dist/src/matrix/monitor/threads.js.map +0 -7
- package/dist/src/matrix/monitor/types.js +0 -11
- package/dist/src/matrix/monitor/types.js.map +0 -7
- package/dist/src/matrix/monitor/verification-events.js +0 -13
- package/dist/src/matrix/monitor/verification-events.js.map +0 -7
- package/dist/src/matrix/monitor/verification-utils.js +0 -16
- package/dist/src/matrix/monitor/verification-utils.js.map +0 -7
- package/dist/src/matrix/outbound-media-runtime.js +0 -9
- package/dist/src/matrix/outbound-media-runtime.js.map +0 -7
- package/dist/src/matrix/poll-summary.js +0 -14
- package/dist/src/matrix/poll-summary.js.map +0 -7
- package/dist/src/matrix/poll-types.js +0 -55
- package/dist/src/matrix/poll-types.js.map +0 -7
- package/dist/src/matrix/probe.js +0 -9
- package/dist/src/matrix/probe.js.map +0 -7
- package/dist/src/matrix/probe.runtime.js +0 -30
- package/dist/src/matrix/probe.runtime.js.map +0 -7
- package/dist/src/matrix/profile.js +0 -16
- package/dist/src/matrix/profile.js.map +0 -7
- package/dist/src/matrix/reaction-common.js +0 -26
- package/dist/src/matrix/reaction-common.js.map +0 -7
- package/dist/src/matrix/sdk/crypto-bootstrap.js +0 -15
- package/dist/src/matrix/sdk/crypto-bootstrap.js.map +0 -7
- package/dist/src/matrix/sdk/crypto-facade.js +0 -8
- package/dist/src/matrix/sdk/crypto-facade.js.map +0 -7
- package/dist/src/matrix/sdk/crypto-node.runtime.js +0 -14
- package/dist/src/matrix/sdk/crypto-node.runtime.js.map +0 -7
- package/dist/src/matrix/sdk/crypto-runtime.js +0 -84
- package/dist/src/matrix/sdk/crypto-runtime.js.map +0 -7
- package/dist/src/matrix/sdk/decrypt-bridge.js +0 -11
- package/dist/src/matrix/sdk/decrypt-bridge.js.map +0 -7
- package/dist/src/matrix/sdk/event-helpers.js +0 -12
- package/dist/src/matrix/sdk/event-helpers.js.map +0 -7
- package/dist/src/matrix/sdk/http-client.js +0 -13
- package/dist/src/matrix/sdk/http-client.js.map +0 -7
- package/dist/src/matrix/sdk/idb-persistence-lock.js +0 -12
- package/dist/src/matrix/sdk/idb-persistence-lock.js.map +0 -7
- package/dist/src/matrix/sdk/idb-persistence.js +0 -13
- package/dist/src/matrix/sdk/idb-persistence.js.map +0 -7
- package/dist/src/matrix/sdk/idb-persistence.test-helpers.js +0 -83
- package/dist/src/matrix/sdk/idb-persistence.test-helpers.js.map +0 -7
- package/dist/src/matrix/sdk/logger.js +0 -15
- package/dist/src/matrix/sdk/logger.js.map +0 -7
- package/dist/src/matrix/sdk/read-response-with-limit.js +0 -8
- package/dist/src/matrix/sdk/read-response-with-limit.js.map +0 -7
- package/dist/src/matrix/sdk/recovery-key-store.js +0 -14
- package/dist/src/matrix/sdk/recovery-key-store.js.map +0 -7
- package/dist/src/matrix/sdk/transport.js +0 -13
- package/dist/src/matrix/sdk/transport.js.map +0 -7
- package/dist/src/matrix/sdk/types.js +0 -7
- package/dist/src/matrix/sdk/types.js.map +0 -7
- package/dist/src/matrix/sdk/verification-manager.js +0 -11
- package/dist/src/matrix/sdk/verification-manager.js.map +0 -7
- package/dist/src/matrix/sdk/verification-status.js +0 -12
- package/dist/src/matrix/sdk/verification-status.js.map +0 -7
- package/dist/src/matrix/sdk.js +0 -1375
- package/dist/src/matrix/sdk.js.map +0 -7
- package/dist/src/matrix/send/client.js +0 -14
- package/dist/src/matrix/send/client.js.map +0 -7
- package/dist/src/matrix/send/formatting.js +0 -29
- package/dist/src/matrix/send/formatting.js.map +0 -7
- package/dist/src/matrix/send/media.js +0 -26
- package/dist/src/matrix/send/media.js.map +0 -7
- package/dist/src/matrix/send/targets.js +0 -15
- package/dist/src/matrix/send/targets.js.map +0 -7
- package/dist/src/matrix/send/types.js +0 -17
- package/dist/src/matrix/send/types.js.map +0 -7
- package/dist/src/matrix/send.js +0 -51
- package/dist/src/matrix/send.js.map +0 -7
- package/dist/src/matrix/session-store-metadata.js +0 -15
- package/dist/src/matrix/session-store-metadata.js.map +0 -7
- package/dist/src/matrix/startup-abort.js +0 -14
- package/dist/src/matrix/startup-abort.js.map +0 -7
- package/dist/src/matrix/sync-state.js +0 -12
- package/dist/src/matrix/sync-state.js.map +0 -7
- package/dist/src/matrix/target-ids.js +0 -20
- package/dist/src/matrix/target-ids.js.map +0 -7
- package/dist/src/matrix/thread-bindings-shared.js +0 -34
- package/dist/src/matrix/thread-bindings-shared.js.map +0 -7
- package/dist/src/matrix/thread-bindings.js +0 -49
- package/dist/src/matrix/thread-bindings.js.map +0 -7
- package/dist/src/matrix-migration.runtime.js +0 -45
- package/dist/src/matrix-migration.runtime.js.map +0 -7
- package/dist/src/migration-config.js +0 -29
- package/dist/src/migration-config.js.map +0 -7
- package/dist/src/migration-snapshot-backup.js +0 -12
- package/dist/src/migration-snapshot-backup.js.map +0 -7
- package/dist/src/migration-snapshot.js +0 -38
- package/dist/src/migration-snapshot.js.map +0 -7
- package/dist/src/onboarding.js +0 -43
- package/dist/src/onboarding.js.map +0 -7
- package/dist/src/onboarding.test-harness.js +0 -124
- package/dist/src/onboarding.test-harness.js.map +0 -7
- package/dist/src/outbound.js +0 -33
- package/dist/src/outbound.js.map +0 -7
- package/dist/src/plugin-entry.runtime.js +0 -15
- package/dist/src/plugin-entry.runtime.js.map +0 -7
- package/dist/src/profile-update.js +0 -41
- package/dist/src/profile-update.js.map +0 -7
- package/dist/src/record-shared.js +0 -8
- package/dist/src/record-shared.js.map +0 -7
- package/dist/src/resolve-targets.js +0 -34
- package/dist/src/resolve-targets.js.map +0 -7
- package/dist/src/resolver.js +0 -8
- package/dist/src/resolver.js.map +0 -7
- package/dist/src/runtime-api.js +0 -120
- package/dist/src/runtime-api.js.map +0 -7
- package/dist/src/runtime.js +0 -10
- package/dist/src/runtime.js.map +0 -7
- package/dist/src/secret-contract.js +0 -13
- package/dist/src/secret-contract.js.map +0 -7
- package/dist/src/session-route.js +0 -25
- package/dist/src/session-route.js.map +0 -7
- package/dist/src/setup-bootstrap.js +0 -124
- package/dist/src/setup-bootstrap.js.map +0 -7
- package/dist/src/setup-config.js +0 -28
- package/dist/src/setup-config.js.map +0 -7
- package/dist/src/setup-contract.js +0 -16
- package/dist/src/setup-contract.js.map +0 -7
- package/dist/src/setup-core.js +0 -25
- package/dist/src/setup-core.js.map +0 -7
- package/dist/src/setup-surface.js +0 -45
- package/dist/src/setup-surface.js.map +0 -7
- package/dist/src/startup-maintenance.js +0 -29
- package/dist/src/startup-maintenance.js.map +0 -7
- package/dist/src/storage-paths.js +0 -24
- package/dist/src/storage-paths.js.map +0 -7
- package/dist/src/test-helpers.js +0 -49
- package/dist/src/test-helpers.js.map +0 -7
- package/dist/src/test-mocks.js +0 -40
- package/dist/src/test-mocks.js.map +0 -7
- package/dist/src/test-runtime.js +0 -65
- package/dist/src/test-runtime.js.map +0 -7
- package/dist/src/tool-actions.js +0 -68
- package/dist/src/tool-actions.js.map +0 -7
- package/dist/src/tool-actions.runtime.js +0 -73
- package/dist/src/tool-actions.runtime.js.map +0 -7
- package/dist/src/types.js +0 -7
- package/dist/src/types.js.map +0 -7
- package/dist/test-api.js +0 -82
- package/dist/test-api.js.map +0 -7
- package/dist/thread-bindings-runtime.js +0 -15
- package/dist/thread-bindings-runtime.js.map +0 -7
package/dist/chunk-G46GHNDU.js
DELETED
|
@@ -1,4890 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TrackType,
|
|
3
|
-
TrackTypeValueToKeyMap
|
|
4
|
-
} from "./chunk-N5CTFOLX.js";
|
|
5
|
-
import {
|
|
6
|
-
hasID3v1Header
|
|
7
|
-
} from "./chunk-YB5UCHLN.js";
|
|
8
|
-
import {
|
|
9
|
-
APEv2Parser
|
|
10
|
-
} from "./chunk-2WHRUMOM.js";
|
|
11
|
-
import {
|
|
12
|
-
EndOfStreamError,
|
|
13
|
-
fromBlob,
|
|
14
|
-
fromBuffer,
|
|
15
|
-
fromWebStream
|
|
16
|
-
} from "./chunk-H7KAUMBC.js";
|
|
17
|
-
import {
|
|
18
|
-
LyricsContentType,
|
|
19
|
-
TimestampFormat
|
|
20
|
-
} from "./chunk-65UUVZ6B.js";
|
|
21
|
-
import {
|
|
22
|
-
concatUint8Arrays,
|
|
23
|
-
decodeString,
|
|
24
|
-
getUintBE,
|
|
25
|
-
toRatio
|
|
26
|
-
} from "./chunk-WBPQVWSU.js";
|
|
27
|
-
import {
|
|
28
|
-
CouldNotDetermineFileTypeError,
|
|
29
|
-
INT32_BE,
|
|
30
|
-
InternalParserError,
|
|
31
|
-
StringType,
|
|
32
|
-
UINT16_BE,
|
|
33
|
-
UINT16_LE,
|
|
34
|
-
UINT32_BE,
|
|
35
|
-
UINT32_LE,
|
|
36
|
-
UINT64_LE,
|
|
37
|
-
UINT8,
|
|
38
|
-
UnsupportedFileTypeError,
|
|
39
|
-
require_src,
|
|
40
|
-
textDecode
|
|
41
|
-
} from "./chunk-4EKKDVG3.js";
|
|
42
|
-
import {
|
|
43
|
-
require_content_type
|
|
44
|
-
} from "./chunk-4ZY2BOQ4.js";
|
|
45
|
-
import {
|
|
46
|
-
getMatrixRuntime
|
|
47
|
-
} from "./chunk-ZGAUVPAB.js";
|
|
48
|
-
import {
|
|
49
|
-
__commonJS,
|
|
50
|
-
__toESM,
|
|
51
|
-
init_shims
|
|
52
|
-
} from "./chunk-G4TIS2SC.js";
|
|
53
|
-
|
|
54
|
-
// ../../node_modules/media-typer/index.js
|
|
55
|
-
var require_media_typer = __commonJS({
|
|
56
|
-
"../../node_modules/media-typer/index.js"(exports) {
|
|
57
|
-
"use strict";
|
|
58
|
-
init_shims();
|
|
59
|
-
var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/;
|
|
60
|
-
var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
|
61
|
-
var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
|
62
|
-
exports.format = format;
|
|
63
|
-
exports.parse = parse;
|
|
64
|
-
exports.test = test;
|
|
65
|
-
function format(obj) {
|
|
66
|
-
if (!obj || typeof obj !== "object") {
|
|
67
|
-
throw new TypeError("argument obj is required");
|
|
68
|
-
}
|
|
69
|
-
var subtype = obj.subtype;
|
|
70
|
-
var suffix = obj.suffix;
|
|
71
|
-
var type = obj.type;
|
|
72
|
-
if (!type || !TYPE_NAME_REGEXP.test(type)) {
|
|
73
|
-
throw new TypeError("invalid type");
|
|
74
|
-
}
|
|
75
|
-
if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) {
|
|
76
|
-
throw new TypeError("invalid subtype");
|
|
77
|
-
}
|
|
78
|
-
var string = type + "/" + subtype;
|
|
79
|
-
if (suffix) {
|
|
80
|
-
if (!TYPE_NAME_REGEXP.test(suffix)) {
|
|
81
|
-
throw new TypeError("invalid suffix");
|
|
82
|
-
}
|
|
83
|
-
string += "+" + suffix;
|
|
84
|
-
}
|
|
85
|
-
return string;
|
|
86
|
-
}
|
|
87
|
-
function test(string) {
|
|
88
|
-
if (!string) {
|
|
89
|
-
throw new TypeError("argument string is required");
|
|
90
|
-
}
|
|
91
|
-
if (typeof string !== "string") {
|
|
92
|
-
throw new TypeError("argument string is required to be a string");
|
|
93
|
-
}
|
|
94
|
-
return TYPE_REGEXP.test(string.toLowerCase());
|
|
95
|
-
}
|
|
96
|
-
function parse(string) {
|
|
97
|
-
if (!string) {
|
|
98
|
-
throw new TypeError("argument string is required");
|
|
99
|
-
}
|
|
100
|
-
if (typeof string !== "string") {
|
|
101
|
-
throw new TypeError("argument string is required to be a string");
|
|
102
|
-
}
|
|
103
|
-
var match = TYPE_REGEXP.exec(string.toLowerCase());
|
|
104
|
-
if (!match) {
|
|
105
|
-
throw new TypeError("invalid media type");
|
|
106
|
-
}
|
|
107
|
-
var type = match[1];
|
|
108
|
-
var subtype = match[2];
|
|
109
|
-
var suffix;
|
|
110
|
-
var index = subtype.lastIndexOf("+");
|
|
111
|
-
if (index !== -1) {
|
|
112
|
-
suffix = subtype.substr(index + 1);
|
|
113
|
-
subtype = subtype.substr(0, index);
|
|
114
|
-
}
|
|
115
|
-
return new MediaType(type, subtype, suffix);
|
|
116
|
-
}
|
|
117
|
-
function MediaType(type, subtype, suffix) {
|
|
118
|
-
this.type = type;
|
|
119
|
-
this.subtype = subtype;
|
|
120
|
-
this.suffix = suffix;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// src/matrix/send/media.ts
|
|
126
|
-
init_shims();
|
|
127
|
-
|
|
128
|
-
// ../../node_modules/music-metadata/lib/core.js
|
|
129
|
-
init_shims();
|
|
130
|
-
|
|
131
|
-
// ../../node_modules/music-metadata/lib/ParserFactory.js
|
|
132
|
-
init_shims();
|
|
133
|
-
|
|
134
|
-
// ../../node_modules/file-type/source/index.js
|
|
135
|
-
init_shims();
|
|
136
|
-
|
|
137
|
-
// ../../node_modules/@tokenizer/inflate/lib/index.js
|
|
138
|
-
init_shims();
|
|
139
|
-
|
|
140
|
-
// ../../node_modules/@tokenizer/inflate/lib/ZipHandler.js
|
|
141
|
-
init_shims();
|
|
142
|
-
var import_debug = __toESM(require_src(), 1);
|
|
143
|
-
|
|
144
|
-
// ../../node_modules/@tokenizer/inflate/lib/ZipToken.js
|
|
145
|
-
init_shims();
|
|
146
|
-
var Signature = {
|
|
147
|
-
LocalFileHeader: 67324752,
|
|
148
|
-
DataDescriptor: 134695760,
|
|
149
|
-
CentralFileHeader: 33639248,
|
|
150
|
-
EndOfCentralDirectory: 101010256
|
|
151
|
-
};
|
|
152
|
-
var DataDescriptor = {
|
|
153
|
-
get(array) {
|
|
154
|
-
return {
|
|
155
|
-
signature: UINT32_LE.get(array, 0),
|
|
156
|
-
compressedSize: UINT32_LE.get(array, 8),
|
|
157
|
-
uncompressedSize: UINT32_LE.get(array, 12)
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
len: 16
|
|
161
|
-
};
|
|
162
|
-
var LocalFileHeaderToken = {
|
|
163
|
-
get(array) {
|
|
164
|
-
const flags = UINT16_LE.get(array, 6);
|
|
165
|
-
return {
|
|
166
|
-
signature: UINT32_LE.get(array, 0),
|
|
167
|
-
minVersion: UINT16_LE.get(array, 4),
|
|
168
|
-
dataDescriptor: !!(flags & 8),
|
|
169
|
-
compressedMethod: UINT16_LE.get(array, 8),
|
|
170
|
-
compressedSize: UINT32_LE.get(array, 18),
|
|
171
|
-
uncompressedSize: UINT32_LE.get(array, 22),
|
|
172
|
-
filenameLength: UINT16_LE.get(array, 26),
|
|
173
|
-
extraFieldLength: UINT16_LE.get(array, 28),
|
|
174
|
-
filename: null
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
len: 30
|
|
178
|
-
};
|
|
179
|
-
var EndOfCentralDirectoryRecordToken = {
|
|
180
|
-
get(array) {
|
|
181
|
-
return {
|
|
182
|
-
signature: UINT32_LE.get(array, 0),
|
|
183
|
-
nrOfThisDisk: UINT16_LE.get(array, 4),
|
|
184
|
-
nrOfThisDiskWithTheStart: UINT16_LE.get(array, 6),
|
|
185
|
-
nrOfEntriesOnThisDisk: UINT16_LE.get(array, 8),
|
|
186
|
-
nrOfEntriesOfSize: UINT16_LE.get(array, 10),
|
|
187
|
-
sizeOfCd: UINT32_LE.get(array, 12),
|
|
188
|
-
offsetOfStartOfCd: UINT32_LE.get(array, 16),
|
|
189
|
-
zipFileCommentLength: UINT16_LE.get(array, 20)
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
len: 22
|
|
193
|
-
};
|
|
194
|
-
var FileHeader = {
|
|
195
|
-
get(array) {
|
|
196
|
-
const flags = UINT16_LE.get(array, 8);
|
|
197
|
-
return {
|
|
198
|
-
signature: UINT32_LE.get(array, 0),
|
|
199
|
-
minVersion: UINT16_LE.get(array, 6),
|
|
200
|
-
dataDescriptor: !!(flags & 8),
|
|
201
|
-
compressedMethod: UINT16_LE.get(array, 10),
|
|
202
|
-
compressedSize: UINT32_LE.get(array, 20),
|
|
203
|
-
uncompressedSize: UINT32_LE.get(array, 24),
|
|
204
|
-
filenameLength: UINT16_LE.get(array, 28),
|
|
205
|
-
extraFieldLength: UINT16_LE.get(array, 30),
|
|
206
|
-
fileCommentLength: UINT16_LE.get(array, 32),
|
|
207
|
-
relativeOffsetOfLocalHeader: UINT32_LE.get(array, 42),
|
|
208
|
-
filename: null
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
len: 46
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// ../../node_modules/@tokenizer/inflate/lib/ZipHandler.js
|
|
215
|
-
function signatureToArray(signature) {
|
|
216
|
-
const signatureBytes = new Uint8Array(UINT32_LE.len);
|
|
217
|
-
UINT32_LE.put(signatureBytes, 0, signature);
|
|
218
|
-
return signatureBytes;
|
|
219
|
-
}
|
|
220
|
-
var debug = (0, import_debug.default)("tokenizer:inflate");
|
|
221
|
-
var syncBufferSize = 256 * 1024;
|
|
222
|
-
var ddSignatureArray = signatureToArray(Signature.DataDescriptor);
|
|
223
|
-
var eocdSignatureBytes = signatureToArray(Signature.EndOfCentralDirectory);
|
|
224
|
-
var ZipHandler = class _ZipHandler {
|
|
225
|
-
constructor(tokenizer) {
|
|
226
|
-
this.tokenizer = tokenizer;
|
|
227
|
-
this.syncBuffer = new Uint8Array(syncBufferSize);
|
|
228
|
-
}
|
|
229
|
-
async isZip() {
|
|
230
|
-
return await this.peekSignature() === Signature.LocalFileHeader;
|
|
231
|
-
}
|
|
232
|
-
peekSignature() {
|
|
233
|
-
return this.tokenizer.peekToken(UINT32_LE);
|
|
234
|
-
}
|
|
235
|
-
async findEndOfCentralDirectoryLocator() {
|
|
236
|
-
const randomReadTokenizer = this.tokenizer;
|
|
237
|
-
const chunkLength = Math.min(16 * 1024, randomReadTokenizer.fileInfo.size);
|
|
238
|
-
const buffer = this.syncBuffer.subarray(0, chunkLength);
|
|
239
|
-
await this.tokenizer.readBuffer(buffer, { position: randomReadTokenizer.fileInfo.size - chunkLength });
|
|
240
|
-
for (let i = buffer.length - 4; i >= 0; i--) {
|
|
241
|
-
if (buffer[i] === eocdSignatureBytes[0] && buffer[i + 1] === eocdSignatureBytes[1] && buffer[i + 2] === eocdSignatureBytes[2] && buffer[i + 3] === eocdSignatureBytes[3]) {
|
|
242
|
-
return randomReadTokenizer.fileInfo.size - chunkLength + i;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return -1;
|
|
246
|
-
}
|
|
247
|
-
async readCentralDirectory() {
|
|
248
|
-
if (!this.tokenizer.supportsRandomAccess()) {
|
|
249
|
-
debug("Cannot reading central-directory without random-read support");
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
debug("Reading central-directory...");
|
|
253
|
-
const pos = this.tokenizer.position;
|
|
254
|
-
const offset = await this.findEndOfCentralDirectoryLocator();
|
|
255
|
-
if (offset > 0) {
|
|
256
|
-
debug("Central-directory 32-bit signature found");
|
|
257
|
-
const eocdHeader = await this.tokenizer.readToken(EndOfCentralDirectoryRecordToken, offset);
|
|
258
|
-
const files = [];
|
|
259
|
-
this.tokenizer.setPosition(eocdHeader.offsetOfStartOfCd);
|
|
260
|
-
for (let n = 0; n < eocdHeader.nrOfEntriesOfSize; ++n) {
|
|
261
|
-
const entry = await this.tokenizer.readToken(FileHeader);
|
|
262
|
-
if (entry.signature !== Signature.CentralFileHeader) {
|
|
263
|
-
throw new Error("Expected Central-File-Header signature");
|
|
264
|
-
}
|
|
265
|
-
entry.filename = await this.tokenizer.readToken(new StringType(entry.filenameLength, "utf-8"));
|
|
266
|
-
await this.tokenizer.ignore(entry.extraFieldLength);
|
|
267
|
-
await this.tokenizer.ignore(entry.fileCommentLength);
|
|
268
|
-
files.push(entry);
|
|
269
|
-
debug(`Add central-directory file-entry: n=${n + 1}/${files.length}: filename=${files[n].filename}`);
|
|
270
|
-
}
|
|
271
|
-
this.tokenizer.setPosition(pos);
|
|
272
|
-
return files;
|
|
273
|
-
}
|
|
274
|
-
this.tokenizer.setPosition(pos);
|
|
275
|
-
}
|
|
276
|
-
async unzip(fileCb) {
|
|
277
|
-
const entries = await this.readCentralDirectory();
|
|
278
|
-
if (entries) {
|
|
279
|
-
return this.iterateOverCentralDirectory(entries, fileCb);
|
|
280
|
-
}
|
|
281
|
-
let stop = false;
|
|
282
|
-
do {
|
|
283
|
-
const zipHeader = await this.readLocalFileHeader();
|
|
284
|
-
if (!zipHeader)
|
|
285
|
-
break;
|
|
286
|
-
const next = fileCb(zipHeader);
|
|
287
|
-
stop = !!next.stop;
|
|
288
|
-
let fileData;
|
|
289
|
-
await this.tokenizer.ignore(zipHeader.extraFieldLength);
|
|
290
|
-
if (zipHeader.dataDescriptor && zipHeader.compressedSize === 0) {
|
|
291
|
-
const chunks = [];
|
|
292
|
-
let len = syncBufferSize;
|
|
293
|
-
debug("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
|
|
294
|
-
let nextHeaderIndex = -1;
|
|
295
|
-
while (nextHeaderIndex < 0 && len === syncBufferSize) {
|
|
296
|
-
len = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: true });
|
|
297
|
-
nextHeaderIndex = indexOf(this.syncBuffer.subarray(0, len), ddSignatureArray);
|
|
298
|
-
const size = nextHeaderIndex >= 0 ? nextHeaderIndex : len;
|
|
299
|
-
if (next.handler) {
|
|
300
|
-
const data = new Uint8Array(size);
|
|
301
|
-
await this.tokenizer.readBuffer(data);
|
|
302
|
-
chunks.push(data);
|
|
303
|
-
} else {
|
|
304
|
-
await this.tokenizer.ignore(size);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
debug(`Found data-descriptor-signature at pos=${this.tokenizer.position}`);
|
|
308
|
-
if (next.handler) {
|
|
309
|
-
await this.inflate(zipHeader, mergeArrays(chunks), next.handler);
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
if (next.handler) {
|
|
313
|
-
debug(`Reading compressed-file-data: ${zipHeader.compressedSize} bytes`);
|
|
314
|
-
fileData = new Uint8Array(zipHeader.compressedSize);
|
|
315
|
-
await this.tokenizer.readBuffer(fileData);
|
|
316
|
-
await this.inflate(zipHeader, fileData, next.handler);
|
|
317
|
-
} else {
|
|
318
|
-
debug(`Ignoring compressed-file-data: ${zipHeader.compressedSize} bytes`);
|
|
319
|
-
await this.tokenizer.ignore(zipHeader.compressedSize);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
debug(`Reading data-descriptor at pos=${this.tokenizer.position}`);
|
|
323
|
-
if (zipHeader.dataDescriptor) {
|
|
324
|
-
const dataDescriptor = await this.tokenizer.readToken(DataDescriptor);
|
|
325
|
-
if (dataDescriptor.signature !== 134695760) {
|
|
326
|
-
throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - DataDescriptor.len}`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
} while (!stop);
|
|
330
|
-
}
|
|
331
|
-
async iterateOverCentralDirectory(entries, fileCb) {
|
|
332
|
-
for (const fileHeader of entries) {
|
|
333
|
-
const next = fileCb(fileHeader);
|
|
334
|
-
if (next.handler) {
|
|
335
|
-
this.tokenizer.setPosition(fileHeader.relativeOffsetOfLocalHeader);
|
|
336
|
-
const zipHeader = await this.readLocalFileHeader();
|
|
337
|
-
if (zipHeader) {
|
|
338
|
-
await this.tokenizer.ignore(zipHeader.extraFieldLength);
|
|
339
|
-
const fileData = new Uint8Array(fileHeader.compressedSize);
|
|
340
|
-
await this.tokenizer.readBuffer(fileData);
|
|
341
|
-
await this.inflate(zipHeader, fileData, next.handler);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
if (next.stop)
|
|
345
|
-
break;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
async inflate(zipHeader, fileData, cb) {
|
|
349
|
-
if (zipHeader.compressedMethod === 0) {
|
|
350
|
-
return cb(fileData);
|
|
351
|
-
}
|
|
352
|
-
if (zipHeader.compressedMethod !== 8) {
|
|
353
|
-
throw new Error(`Unsupported ZIP compression method: ${zipHeader.compressedMethod}`);
|
|
354
|
-
}
|
|
355
|
-
debug(`Decompress filename=${zipHeader.filename}, compressed-size=${fileData.length}`);
|
|
356
|
-
const uncompressedData = await _ZipHandler.decompressDeflateRaw(fileData);
|
|
357
|
-
return cb(uncompressedData);
|
|
358
|
-
}
|
|
359
|
-
static async decompressDeflateRaw(data) {
|
|
360
|
-
const input = new ReadableStream({
|
|
361
|
-
start(controller) {
|
|
362
|
-
controller.enqueue(data);
|
|
363
|
-
controller.close();
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
const ds = new DecompressionStream("deflate-raw");
|
|
367
|
-
const output = input.pipeThrough(ds);
|
|
368
|
-
try {
|
|
369
|
-
const response = new Response(output);
|
|
370
|
-
const buffer = await response.arrayBuffer();
|
|
371
|
-
return new Uint8Array(buffer);
|
|
372
|
-
} catch (err) {
|
|
373
|
-
const message = err instanceof Error ? `Failed to deflate ZIP entry: ${err.message}` : "Unknown decompression error in ZIP entry";
|
|
374
|
-
throw new TypeError(message);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
async readLocalFileHeader() {
|
|
378
|
-
const signature = await this.tokenizer.peekToken(UINT32_LE);
|
|
379
|
-
if (signature === Signature.LocalFileHeader) {
|
|
380
|
-
const header = await this.tokenizer.readToken(LocalFileHeaderToken);
|
|
381
|
-
header.filename = await this.tokenizer.readToken(new StringType(header.filenameLength, "utf-8"));
|
|
382
|
-
return header;
|
|
383
|
-
}
|
|
384
|
-
if (signature === Signature.CentralFileHeader) {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
if (signature === 3759263696) {
|
|
388
|
-
throw new Error("Encrypted ZIP");
|
|
389
|
-
}
|
|
390
|
-
throw new Error("Unexpected signature");
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
function indexOf(buffer, portion) {
|
|
394
|
-
const bufferLength = buffer.length;
|
|
395
|
-
const portionLength = portion.length;
|
|
396
|
-
if (portionLength > bufferLength)
|
|
397
|
-
return -1;
|
|
398
|
-
for (let i = 0; i <= bufferLength - portionLength; i++) {
|
|
399
|
-
let found = true;
|
|
400
|
-
for (let j = 0; j < portionLength; j++) {
|
|
401
|
-
if (buffer[i + j] !== portion[j]) {
|
|
402
|
-
found = false;
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (found) {
|
|
407
|
-
return i;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
return -1;
|
|
411
|
-
}
|
|
412
|
-
function mergeArrays(chunks) {
|
|
413
|
-
const totalLength = chunks.reduce((acc, curr) => acc + curr.length, 0);
|
|
414
|
-
const mergedArray = new Uint8Array(totalLength);
|
|
415
|
-
let offset = 0;
|
|
416
|
-
for (const chunk of chunks) {
|
|
417
|
-
mergedArray.set(chunk, offset);
|
|
418
|
-
offset += chunk.length;
|
|
419
|
-
}
|
|
420
|
-
return mergedArray;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
// ../../node_modules/@tokenizer/inflate/lib/GzipHandler.js
|
|
424
|
-
init_shims();
|
|
425
|
-
var GzipHandler = class {
|
|
426
|
-
constructor(tokenizer) {
|
|
427
|
-
this.tokenizer = tokenizer;
|
|
428
|
-
}
|
|
429
|
-
inflate() {
|
|
430
|
-
const tokenizer = this.tokenizer;
|
|
431
|
-
return new ReadableStream({
|
|
432
|
-
async pull(controller) {
|
|
433
|
-
const buffer = new Uint8Array(1024);
|
|
434
|
-
const size = await tokenizer.readBuffer(buffer, { mayBeLess: true });
|
|
435
|
-
if (size === 0) {
|
|
436
|
-
controller.close();
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
controller.enqueue(buffer.subarray(0, size));
|
|
440
|
-
}
|
|
441
|
-
}).pipeThrough(new DecompressionStream("gzip"));
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
// ../../node_modules/file-type/source/tokens.js
|
|
446
|
-
init_shims();
|
|
447
|
-
function stringToBytes(string, encoding) {
|
|
448
|
-
if (encoding === "utf-16le") {
|
|
449
|
-
const bytes = [];
|
|
450
|
-
for (let index = 0; index < string.length; index++) {
|
|
451
|
-
const code = string.charCodeAt(index);
|
|
452
|
-
bytes.push(code & 255, code >> 8 & 255);
|
|
453
|
-
}
|
|
454
|
-
return bytes;
|
|
455
|
-
}
|
|
456
|
-
if (encoding === "utf-16be") {
|
|
457
|
-
const bytes = [];
|
|
458
|
-
for (let index = 0; index < string.length; index++) {
|
|
459
|
-
const code = string.charCodeAt(index);
|
|
460
|
-
bytes.push(code >> 8 & 255, code & 255);
|
|
461
|
-
}
|
|
462
|
-
return bytes;
|
|
463
|
-
}
|
|
464
|
-
return [...string].map((character) => character.charCodeAt(0));
|
|
465
|
-
}
|
|
466
|
-
function tarHeaderChecksumMatches(arrayBuffer, offset = 0) {
|
|
467
|
-
const readSum = Number.parseInt(new StringType(6).get(arrayBuffer, 148).replace(new RegExp("\\0.*$", "v"), "").trim(), 8);
|
|
468
|
-
if (Number.isNaN(readSum)) {
|
|
469
|
-
return false;
|
|
470
|
-
}
|
|
471
|
-
let sum = 8 * 32;
|
|
472
|
-
for (let index = offset; index < offset + 148; index++) {
|
|
473
|
-
sum += arrayBuffer[index];
|
|
474
|
-
}
|
|
475
|
-
for (let index = offset + 156; index < offset + 512; index++) {
|
|
476
|
-
sum += arrayBuffer[index];
|
|
477
|
-
}
|
|
478
|
-
return readSum === sum;
|
|
479
|
-
}
|
|
480
|
-
var uint32SyncSafeToken = {
|
|
481
|
-
get: (buffer, offset) => buffer[offset + 3] & 127 | (buffer[offset + 2] & 127) << 7 | (buffer[offset + 1] & 127) << 14 | (buffer[offset] & 127) << 21,
|
|
482
|
-
len: 4
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
// ../../node_modules/file-type/source/supported.js
|
|
486
|
-
init_shims();
|
|
487
|
-
var extensions = [
|
|
488
|
-
"jpg",
|
|
489
|
-
"png",
|
|
490
|
-
"apng",
|
|
491
|
-
"gif",
|
|
492
|
-
"webp",
|
|
493
|
-
"flif",
|
|
494
|
-
"xcf",
|
|
495
|
-
"cr2",
|
|
496
|
-
"cr3",
|
|
497
|
-
"orf",
|
|
498
|
-
"arw",
|
|
499
|
-
"dng",
|
|
500
|
-
"nef",
|
|
501
|
-
"rw2",
|
|
502
|
-
"raf",
|
|
503
|
-
"tif",
|
|
504
|
-
"bmp",
|
|
505
|
-
"icns",
|
|
506
|
-
"jxr",
|
|
507
|
-
"psd",
|
|
508
|
-
"indd",
|
|
509
|
-
"zip",
|
|
510
|
-
"tar",
|
|
511
|
-
"rar",
|
|
512
|
-
"gz",
|
|
513
|
-
"bz2",
|
|
514
|
-
"7z",
|
|
515
|
-
"dmg",
|
|
516
|
-
"mp4",
|
|
517
|
-
"mid",
|
|
518
|
-
"mkv",
|
|
519
|
-
"webm",
|
|
520
|
-
"mov",
|
|
521
|
-
"avi",
|
|
522
|
-
"mpg",
|
|
523
|
-
"mp2",
|
|
524
|
-
"mp3",
|
|
525
|
-
"m4a",
|
|
526
|
-
"oga",
|
|
527
|
-
"ogg",
|
|
528
|
-
"ogv",
|
|
529
|
-
"opus",
|
|
530
|
-
"flac",
|
|
531
|
-
"wav",
|
|
532
|
-
"spx",
|
|
533
|
-
"amr",
|
|
534
|
-
"pdf",
|
|
535
|
-
"epub",
|
|
536
|
-
"elf",
|
|
537
|
-
"macho",
|
|
538
|
-
"exe",
|
|
539
|
-
"swf",
|
|
540
|
-
"rtf",
|
|
541
|
-
"wasm",
|
|
542
|
-
"woff",
|
|
543
|
-
"woff2",
|
|
544
|
-
"eot",
|
|
545
|
-
"ttf",
|
|
546
|
-
"otf",
|
|
547
|
-
"ttc",
|
|
548
|
-
"ico",
|
|
549
|
-
"flv",
|
|
550
|
-
"ps",
|
|
551
|
-
"xz",
|
|
552
|
-
"sqlite",
|
|
553
|
-
"nes",
|
|
554
|
-
"crx",
|
|
555
|
-
"xpi",
|
|
556
|
-
"cab",
|
|
557
|
-
"deb",
|
|
558
|
-
"ar",
|
|
559
|
-
"rpm",
|
|
560
|
-
"Z",
|
|
561
|
-
"lz",
|
|
562
|
-
"cfb",
|
|
563
|
-
"mxf",
|
|
564
|
-
"mts",
|
|
565
|
-
"blend",
|
|
566
|
-
"bpg",
|
|
567
|
-
"docx",
|
|
568
|
-
"pptx",
|
|
569
|
-
"xlsx",
|
|
570
|
-
"3gp",
|
|
571
|
-
"3g2",
|
|
572
|
-
"j2c",
|
|
573
|
-
"jp2",
|
|
574
|
-
"jpm",
|
|
575
|
-
"jpx",
|
|
576
|
-
"mj2",
|
|
577
|
-
"aif",
|
|
578
|
-
"qcp",
|
|
579
|
-
"odt",
|
|
580
|
-
"ods",
|
|
581
|
-
"odp",
|
|
582
|
-
"xml",
|
|
583
|
-
"mobi",
|
|
584
|
-
"heic",
|
|
585
|
-
"cur",
|
|
586
|
-
"ktx",
|
|
587
|
-
"ape",
|
|
588
|
-
"wv",
|
|
589
|
-
"dcm",
|
|
590
|
-
"ics",
|
|
591
|
-
"glb",
|
|
592
|
-
"pcap",
|
|
593
|
-
"dsf",
|
|
594
|
-
"lnk",
|
|
595
|
-
"alias",
|
|
596
|
-
"voc",
|
|
597
|
-
"ac3",
|
|
598
|
-
"m4v",
|
|
599
|
-
"m4p",
|
|
600
|
-
"m4b",
|
|
601
|
-
"f4v",
|
|
602
|
-
"f4p",
|
|
603
|
-
"f4b",
|
|
604
|
-
"f4a",
|
|
605
|
-
"mie",
|
|
606
|
-
"asf",
|
|
607
|
-
"ogm",
|
|
608
|
-
"ogx",
|
|
609
|
-
"mpc",
|
|
610
|
-
"arrow",
|
|
611
|
-
"shp",
|
|
612
|
-
"aac",
|
|
613
|
-
"mp1",
|
|
614
|
-
"it",
|
|
615
|
-
"s3m",
|
|
616
|
-
"xm",
|
|
617
|
-
"skp",
|
|
618
|
-
"avif",
|
|
619
|
-
"eps",
|
|
620
|
-
"lzh",
|
|
621
|
-
"pgp",
|
|
622
|
-
"asar",
|
|
623
|
-
"stl",
|
|
624
|
-
"chm",
|
|
625
|
-
"3mf",
|
|
626
|
-
"zst",
|
|
627
|
-
"jxl",
|
|
628
|
-
"vcf",
|
|
629
|
-
"jls",
|
|
630
|
-
"pst",
|
|
631
|
-
"dwg",
|
|
632
|
-
"parquet",
|
|
633
|
-
"class",
|
|
634
|
-
"arj",
|
|
635
|
-
"cpio",
|
|
636
|
-
"ace",
|
|
637
|
-
"avro",
|
|
638
|
-
"icc",
|
|
639
|
-
"fbx",
|
|
640
|
-
"vsdx",
|
|
641
|
-
"vtt",
|
|
642
|
-
"apk",
|
|
643
|
-
"drc",
|
|
644
|
-
"lz4",
|
|
645
|
-
"potx",
|
|
646
|
-
"xltx",
|
|
647
|
-
"dotx",
|
|
648
|
-
"xltm",
|
|
649
|
-
"ott",
|
|
650
|
-
"ots",
|
|
651
|
-
"otp",
|
|
652
|
-
"odg",
|
|
653
|
-
"otg",
|
|
654
|
-
"xlsm",
|
|
655
|
-
"docm",
|
|
656
|
-
"dotm",
|
|
657
|
-
"potm",
|
|
658
|
-
"pptm",
|
|
659
|
-
"jar",
|
|
660
|
-
"jmp",
|
|
661
|
-
"rm",
|
|
662
|
-
"sav",
|
|
663
|
-
"ppsm",
|
|
664
|
-
"ppsx",
|
|
665
|
-
"tar.gz",
|
|
666
|
-
"reg",
|
|
667
|
-
"dat",
|
|
668
|
-
"key",
|
|
669
|
-
"numbers",
|
|
670
|
-
"pages"
|
|
671
|
-
];
|
|
672
|
-
var mimeTypes = [
|
|
673
|
-
"image/jpeg",
|
|
674
|
-
"image/png",
|
|
675
|
-
"image/gif",
|
|
676
|
-
"image/webp",
|
|
677
|
-
"image/flif",
|
|
678
|
-
"image/x-xcf",
|
|
679
|
-
"image/x-canon-cr2",
|
|
680
|
-
"image/x-canon-cr3",
|
|
681
|
-
"image/tiff",
|
|
682
|
-
"image/bmp",
|
|
683
|
-
"image/vnd.ms-photo",
|
|
684
|
-
"image/vnd.adobe.photoshop",
|
|
685
|
-
"application/x-indesign",
|
|
686
|
-
"application/epub+zip",
|
|
687
|
-
"application/x-xpinstall",
|
|
688
|
-
"application/vnd.ms-powerpoint.slideshow.macroenabled.12",
|
|
689
|
-
"application/vnd.oasis.opendocument.text",
|
|
690
|
-
"application/vnd.oasis.opendocument.spreadsheet",
|
|
691
|
-
"application/vnd.oasis.opendocument.presentation",
|
|
692
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
693
|
-
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
694
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
695
|
-
"application/vnd.openxmlformats-officedocument.presentationml.slideshow",
|
|
696
|
-
"application/zip",
|
|
697
|
-
"application/x-tar",
|
|
698
|
-
"application/x-rar-compressed",
|
|
699
|
-
"application/gzip",
|
|
700
|
-
"application/x-bzip2",
|
|
701
|
-
"application/x-7z-compressed",
|
|
702
|
-
"application/x-apple-diskimage",
|
|
703
|
-
"application/vnd.apache.arrow.file",
|
|
704
|
-
"video/mp4",
|
|
705
|
-
"audio/midi",
|
|
706
|
-
"video/matroska",
|
|
707
|
-
"video/webm",
|
|
708
|
-
"video/quicktime",
|
|
709
|
-
"video/vnd.avi",
|
|
710
|
-
"audio/wav",
|
|
711
|
-
"audio/qcelp",
|
|
712
|
-
"audio/x-ms-asf",
|
|
713
|
-
"video/x-ms-asf",
|
|
714
|
-
"application/vnd.ms-asf",
|
|
715
|
-
"video/mpeg",
|
|
716
|
-
"video/3gpp",
|
|
717
|
-
"audio/mpeg",
|
|
718
|
-
"audio/mp4",
|
|
719
|
-
// RFC 4337
|
|
720
|
-
"video/ogg",
|
|
721
|
-
"audio/ogg",
|
|
722
|
-
"audio/ogg; codecs=opus",
|
|
723
|
-
"application/ogg",
|
|
724
|
-
"audio/flac",
|
|
725
|
-
"audio/ape",
|
|
726
|
-
"audio/wavpack",
|
|
727
|
-
"audio/amr",
|
|
728
|
-
"application/pdf",
|
|
729
|
-
"application/x-elf",
|
|
730
|
-
"application/x-mach-binary",
|
|
731
|
-
"application/x-msdownload",
|
|
732
|
-
"application/x-shockwave-flash",
|
|
733
|
-
"application/rtf",
|
|
734
|
-
"application/wasm",
|
|
735
|
-
"font/woff",
|
|
736
|
-
"font/woff2",
|
|
737
|
-
"application/vnd.ms-fontobject",
|
|
738
|
-
"font/ttf",
|
|
739
|
-
"font/otf",
|
|
740
|
-
"font/collection",
|
|
741
|
-
"image/x-icon",
|
|
742
|
-
"video/x-flv",
|
|
743
|
-
"application/postscript",
|
|
744
|
-
"application/eps",
|
|
745
|
-
"application/x-xz",
|
|
746
|
-
"application/x-sqlite3",
|
|
747
|
-
"application/x-nintendo-nes-rom",
|
|
748
|
-
"application/x-google-chrome-extension",
|
|
749
|
-
"application/vnd.ms-cab-compressed",
|
|
750
|
-
"application/x-deb",
|
|
751
|
-
"application/x-unix-archive",
|
|
752
|
-
"application/x-rpm",
|
|
753
|
-
"application/x-compress",
|
|
754
|
-
"application/lzip",
|
|
755
|
-
"application/x-cfb",
|
|
756
|
-
"application/x-mie",
|
|
757
|
-
"application/mxf",
|
|
758
|
-
"video/mp2t",
|
|
759
|
-
"application/x-blender",
|
|
760
|
-
"image/bpg",
|
|
761
|
-
"image/j2c",
|
|
762
|
-
"image/jp2",
|
|
763
|
-
"image/jpx",
|
|
764
|
-
"image/jpm",
|
|
765
|
-
"image/mj2",
|
|
766
|
-
"audio/aiff",
|
|
767
|
-
"application/xml",
|
|
768
|
-
"application/x-mobipocket-ebook",
|
|
769
|
-
"image/heif",
|
|
770
|
-
"image/heif-sequence",
|
|
771
|
-
"image/heic",
|
|
772
|
-
"image/heic-sequence",
|
|
773
|
-
"image/icns",
|
|
774
|
-
"image/ktx",
|
|
775
|
-
"application/dicom",
|
|
776
|
-
"audio/x-musepack",
|
|
777
|
-
"text/calendar",
|
|
778
|
-
"text/vcard",
|
|
779
|
-
"text/vtt",
|
|
780
|
-
"model/gltf-binary",
|
|
781
|
-
"application/vnd.tcpdump.pcap",
|
|
782
|
-
"audio/x-dsf",
|
|
783
|
-
// Non-standard
|
|
784
|
-
"application/x-ms-shortcut",
|
|
785
|
-
// Informal, used by freedesktop.org shared-mime-info
|
|
786
|
-
"application/x-ft-apple.alias",
|
|
787
|
-
"audio/x-voc",
|
|
788
|
-
"audio/vnd.dolby.dd-raw",
|
|
789
|
-
"audio/x-m4a",
|
|
790
|
-
"image/apng",
|
|
791
|
-
"image/x-olympus-orf",
|
|
792
|
-
"image/x-sony-arw",
|
|
793
|
-
"image/x-adobe-dng",
|
|
794
|
-
"image/x-nikon-nef",
|
|
795
|
-
"image/x-panasonic-rw2",
|
|
796
|
-
"image/x-fujifilm-raf",
|
|
797
|
-
"video/x-m4v",
|
|
798
|
-
"video/3gpp2",
|
|
799
|
-
"application/x-esri-shape",
|
|
800
|
-
"audio/aac",
|
|
801
|
-
"audio/x-it",
|
|
802
|
-
"audio/x-s3m",
|
|
803
|
-
"audio/x-xm",
|
|
804
|
-
"video/MP1S",
|
|
805
|
-
"video/MP2P",
|
|
806
|
-
"application/vnd.sketchup.skp",
|
|
807
|
-
"image/avif",
|
|
808
|
-
"application/x-lzh-compressed",
|
|
809
|
-
"application/pgp-encrypted",
|
|
810
|
-
"application/x-asar",
|
|
811
|
-
"model/stl",
|
|
812
|
-
"application/vnd.ms-htmlhelp",
|
|
813
|
-
"model/3mf",
|
|
814
|
-
"image/jxl",
|
|
815
|
-
"application/zstd",
|
|
816
|
-
"image/jls",
|
|
817
|
-
"application/vnd.ms-outlook",
|
|
818
|
-
"image/vnd.dwg",
|
|
819
|
-
"application/vnd.apache.parquet",
|
|
820
|
-
"application/java-vm",
|
|
821
|
-
"application/x-arj",
|
|
822
|
-
"application/x-cpio",
|
|
823
|
-
"application/x-ace-compressed",
|
|
824
|
-
"application/avro",
|
|
825
|
-
"application/vnd.iccprofile",
|
|
826
|
-
"application/x-ft-fbx",
|
|
827
|
-
"application/vnd.visio",
|
|
828
|
-
"application/vnd.android.package-archive",
|
|
829
|
-
"application/x-ft-draco",
|
|
830
|
-
"application/x-lz4",
|
|
831
|
-
// Informal, used by freedesktop.org shared-mime-info
|
|
832
|
-
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
833
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
834
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
|
|
835
|
-
"application/vnd.ms-excel.template.macroenabled.12",
|
|
836
|
-
"application/vnd.oasis.opendocument.text-template",
|
|
837
|
-
"application/vnd.oasis.opendocument.spreadsheet-template",
|
|
838
|
-
"application/vnd.oasis.opendocument.presentation-template",
|
|
839
|
-
"application/vnd.oasis.opendocument.graphics",
|
|
840
|
-
"application/vnd.oasis.opendocument.graphics-template",
|
|
841
|
-
"application/vnd.ms-excel.sheet.macroenabled.12",
|
|
842
|
-
"application/vnd.ms-word.document.macroenabled.12",
|
|
843
|
-
"application/vnd.ms-word.template.macroenabled.12",
|
|
844
|
-
"application/vnd.ms-powerpoint.template.macroenabled.12",
|
|
845
|
-
"application/vnd.ms-powerpoint.presentation.macroenabled.12",
|
|
846
|
-
"application/java-archive",
|
|
847
|
-
"application/vnd.rn-realmedia",
|
|
848
|
-
"application/x-spss-sav",
|
|
849
|
-
"application/x-ms-regedit",
|
|
850
|
-
"application/x-ft-windows-registry-hive",
|
|
851
|
-
"application/x-jmp-data",
|
|
852
|
-
"application/vnd.apple.keynote",
|
|
853
|
-
"application/vnd.apple.numbers",
|
|
854
|
-
"application/vnd.apple.pages"
|
|
855
|
-
];
|
|
856
|
-
|
|
857
|
-
// ../../node_modules/file-type/source/parser.js
|
|
858
|
-
init_shims();
|
|
859
|
-
var maximumUntrustedSkipSizeInBytes = 16 * 1024 * 1024;
|
|
860
|
-
var ParserHardLimitError = class extends Error {
|
|
861
|
-
};
|
|
862
|
-
function getSafeBound(value, maximum, reason) {
|
|
863
|
-
if (!Number.isFinite(value) || value < 0 || value > maximum) {
|
|
864
|
-
throw new ParserHardLimitError(`${reason} has invalid size ${value} (maximum ${maximum} bytes)`);
|
|
865
|
-
}
|
|
866
|
-
return value;
|
|
867
|
-
}
|
|
868
|
-
async function safeIgnore(tokenizer, length, { maximumLength = maximumUntrustedSkipSizeInBytes, reason = "skip" } = {}) {
|
|
869
|
-
const safeLength = getSafeBound(length, maximumLength, reason);
|
|
870
|
-
await tokenizer.ignore(safeLength);
|
|
871
|
-
}
|
|
872
|
-
async function safeReadBuffer(tokenizer, buffer, options, { maximumLength = buffer.length, reason = "read" } = {}) {
|
|
873
|
-
const length = options?.length ?? buffer.length;
|
|
874
|
-
const safeLength = getSafeBound(length, maximumLength, reason);
|
|
875
|
-
return tokenizer.readBuffer(buffer, {
|
|
876
|
-
...options,
|
|
877
|
-
length: safeLength
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
function checkBytes(buffer, headers, options) {
|
|
881
|
-
options = {
|
|
882
|
-
offset: 0,
|
|
883
|
-
...options
|
|
884
|
-
};
|
|
885
|
-
for (const [index, header] of headers.entries()) {
|
|
886
|
-
if (options.mask) {
|
|
887
|
-
if (header !== (options.mask[index] & buffer[index + options.offset])) {
|
|
888
|
-
return false;
|
|
889
|
-
}
|
|
890
|
-
} else if (header !== buffer[index + options.offset]) {
|
|
891
|
-
return false;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
return true;
|
|
895
|
-
}
|
|
896
|
-
function hasUnknownFileSize(tokenizer) {
|
|
897
|
-
const fileSize = tokenizer.fileInfo.size;
|
|
898
|
-
return !Number.isFinite(fileSize) || fileSize === Number.MAX_SAFE_INTEGER;
|
|
899
|
-
}
|
|
900
|
-
function hasExceededUnknownSizeScanBudget(tokenizer, startOffset, maximumBytes) {
|
|
901
|
-
return hasUnknownFileSize(tokenizer) && tokenizer.position - startOffset > maximumBytes;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
// ../../node_modules/file-type/source/detectors/zip.js
|
|
905
|
-
init_shims();
|
|
906
|
-
var maximumZipEntrySizeInBytes = 1024 * 1024;
|
|
907
|
-
var maximumZipEntryCount = 1024;
|
|
908
|
-
var maximumZipBufferedReadSizeInBytes = 2 ** 31 - 1;
|
|
909
|
-
var maximumZipTextEntrySizeInBytes = maximumZipEntrySizeInBytes;
|
|
910
|
-
var recoverableZipErrorMessages = /* @__PURE__ */ new Set([
|
|
911
|
-
"Unexpected signature",
|
|
912
|
-
"Encrypted ZIP",
|
|
913
|
-
"Expected Central-File-Header signature"
|
|
914
|
-
]);
|
|
915
|
-
var recoverableZipErrorMessagePrefixes = [
|
|
916
|
-
"ZIP entry count exceeds ",
|
|
917
|
-
"Unsupported ZIP compression method:",
|
|
918
|
-
"ZIP entry compressed data exceeds ",
|
|
919
|
-
"ZIP entry decompressed data exceeds ",
|
|
920
|
-
"Expected data-descriptor-signature at position "
|
|
921
|
-
];
|
|
922
|
-
var recoverableZipErrorCodes = /* @__PURE__ */ new Set([
|
|
923
|
-
"Z_BUF_ERROR",
|
|
924
|
-
"Z_DATA_ERROR",
|
|
925
|
-
"ERR_INVALID_STATE"
|
|
926
|
-
]);
|
|
927
|
-
async function decompressDeflateRawWithLimit(data, { maximumLength = maximumZipEntrySizeInBytes } = {}) {
|
|
928
|
-
const input = new ReadableStream({
|
|
929
|
-
start(controller) {
|
|
930
|
-
controller.enqueue(data);
|
|
931
|
-
controller.close();
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
const output = input.pipeThrough(new DecompressionStream("deflate-raw"));
|
|
935
|
-
const reader = output.getReader();
|
|
936
|
-
const chunks = [];
|
|
937
|
-
let totalLength = 0;
|
|
938
|
-
try {
|
|
939
|
-
for (; ; ) {
|
|
940
|
-
const { done, value } = await reader.read();
|
|
941
|
-
if (done) {
|
|
942
|
-
break;
|
|
943
|
-
}
|
|
944
|
-
totalLength += value.length;
|
|
945
|
-
if (totalLength > maximumLength) {
|
|
946
|
-
await reader.cancel();
|
|
947
|
-
throw new Error(`ZIP entry decompressed data exceeds ${maximumLength} bytes`);
|
|
948
|
-
}
|
|
949
|
-
chunks.push(value);
|
|
950
|
-
}
|
|
951
|
-
} finally {
|
|
952
|
-
reader.releaseLock();
|
|
953
|
-
}
|
|
954
|
-
const uncompressedData = new Uint8Array(totalLength);
|
|
955
|
-
let offset = 0;
|
|
956
|
-
for (const chunk of chunks) {
|
|
957
|
-
uncompressedData.set(chunk, offset);
|
|
958
|
-
offset += chunk.length;
|
|
959
|
-
}
|
|
960
|
-
return uncompressedData;
|
|
961
|
-
}
|
|
962
|
-
function mergeByteChunks(chunks, totalLength) {
|
|
963
|
-
const merged = new Uint8Array(totalLength);
|
|
964
|
-
let offset = 0;
|
|
965
|
-
for (const chunk of chunks) {
|
|
966
|
-
merged.set(chunk, offset);
|
|
967
|
-
offset += chunk.length;
|
|
968
|
-
}
|
|
969
|
-
return merged;
|
|
970
|
-
}
|
|
971
|
-
function getMaximumZipBufferedReadLength(tokenizer) {
|
|
972
|
-
const fileSize = tokenizer.fileInfo.size;
|
|
973
|
-
const remainingBytes = Number.isFinite(fileSize) ? Math.max(0, fileSize - tokenizer.position) : Number.MAX_SAFE_INTEGER;
|
|
974
|
-
return Math.min(remainingBytes, maximumZipBufferedReadSizeInBytes);
|
|
975
|
-
}
|
|
976
|
-
function isRecoverableZipError(error) {
|
|
977
|
-
if (error instanceof EndOfStreamError) {
|
|
978
|
-
return true;
|
|
979
|
-
}
|
|
980
|
-
if (error instanceof ParserHardLimitError) {
|
|
981
|
-
return true;
|
|
982
|
-
}
|
|
983
|
-
if (!(error instanceof Error)) {
|
|
984
|
-
return false;
|
|
985
|
-
}
|
|
986
|
-
if (recoverableZipErrorMessages.has(error.message)) {
|
|
987
|
-
return true;
|
|
988
|
-
}
|
|
989
|
-
if (recoverableZipErrorCodes.has(error.code)) {
|
|
990
|
-
return true;
|
|
991
|
-
}
|
|
992
|
-
for (const prefix of recoverableZipErrorMessagePrefixes) {
|
|
993
|
-
if (error.message.startsWith(prefix)) {
|
|
994
|
-
return true;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
return false;
|
|
998
|
-
}
|
|
999
|
-
function canReadZipEntryForDetection(zipHeader, maximumSize = maximumZipEntrySizeInBytes) {
|
|
1000
|
-
const sizes = [zipHeader.compressedSize, zipHeader.uncompressedSize];
|
|
1001
|
-
for (const size of sizes) {
|
|
1002
|
-
if (!Number.isFinite(size) || size < 0 || size > maximumSize) {
|
|
1003
|
-
return false;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
return true;
|
|
1007
|
-
}
|
|
1008
|
-
function createIWorkZipDetectionState() {
|
|
1009
|
-
return {
|
|
1010
|
-
hasDocumentEntry: false,
|
|
1011
|
-
hasMasterSlideEntry: false,
|
|
1012
|
-
hasTablesEntry: false,
|
|
1013
|
-
hasCalculationEngineEntry: false
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
function updateIWorkZipDetectionStateFromFilename(iWorkState, filename) {
|
|
1017
|
-
if (filename === "Index/Document.iwa") {
|
|
1018
|
-
iWorkState.hasDocumentEntry = true;
|
|
1019
|
-
}
|
|
1020
|
-
if (filename.startsWith("Index/MasterSlide")) {
|
|
1021
|
-
iWorkState.hasMasterSlideEntry = true;
|
|
1022
|
-
}
|
|
1023
|
-
if (filename.startsWith("Index/Tables/")) {
|
|
1024
|
-
iWorkState.hasTablesEntry = true;
|
|
1025
|
-
}
|
|
1026
|
-
if (filename === "Index/CalculationEngine.iwa") {
|
|
1027
|
-
iWorkState.hasCalculationEngineEntry = true;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
function getIWorkFileTypeFromZipEntries(iWorkState) {
|
|
1031
|
-
if (!iWorkState.hasDocumentEntry) {
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
if (iWorkState.hasMasterSlideEntry) {
|
|
1035
|
-
return { ext: "key", mime: "application/vnd.apple.keynote" };
|
|
1036
|
-
}
|
|
1037
|
-
if (iWorkState.hasTablesEntry) {
|
|
1038
|
-
return { ext: "numbers", mime: "application/vnd.apple.numbers" };
|
|
1039
|
-
}
|
|
1040
|
-
return { ext: "pages", mime: "application/vnd.apple.pages" };
|
|
1041
|
-
}
|
|
1042
|
-
function getFileTypeFromMimeType(mimeType) {
|
|
1043
|
-
mimeType = mimeType.toLowerCase();
|
|
1044
|
-
switch (mimeType) {
|
|
1045
|
-
case "application/epub+zip":
|
|
1046
|
-
return { ext: "epub", mime: mimeType };
|
|
1047
|
-
case "application/vnd.oasis.opendocument.text":
|
|
1048
|
-
return { ext: "odt", mime: mimeType };
|
|
1049
|
-
case "application/vnd.oasis.opendocument.text-template":
|
|
1050
|
-
return { ext: "ott", mime: mimeType };
|
|
1051
|
-
case "application/vnd.oasis.opendocument.spreadsheet":
|
|
1052
|
-
return { ext: "ods", mime: mimeType };
|
|
1053
|
-
case "application/vnd.oasis.opendocument.spreadsheet-template":
|
|
1054
|
-
return { ext: "ots", mime: mimeType };
|
|
1055
|
-
case "application/vnd.oasis.opendocument.presentation":
|
|
1056
|
-
return { ext: "odp", mime: mimeType };
|
|
1057
|
-
case "application/vnd.oasis.opendocument.presentation-template":
|
|
1058
|
-
return { ext: "otp", mime: mimeType };
|
|
1059
|
-
case "application/vnd.oasis.opendocument.graphics":
|
|
1060
|
-
return { ext: "odg", mime: mimeType };
|
|
1061
|
-
case "application/vnd.oasis.opendocument.graphics-template":
|
|
1062
|
-
return { ext: "otg", mime: mimeType };
|
|
1063
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.slideshow":
|
|
1064
|
-
return { ext: "ppsx", mime: mimeType };
|
|
1065
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
|
1066
|
-
return { ext: "xlsx", mime: mimeType };
|
|
1067
|
-
case "application/vnd.ms-excel.sheet.macroenabled":
|
|
1068
|
-
return { ext: "xlsm", mime: "application/vnd.ms-excel.sheet.macroenabled.12" };
|
|
1069
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.template":
|
|
1070
|
-
return { ext: "xltx", mime: mimeType };
|
|
1071
|
-
case "application/vnd.ms-excel.template.macroenabled":
|
|
1072
|
-
return { ext: "xltm", mime: "application/vnd.ms-excel.template.macroenabled.12" };
|
|
1073
|
-
case "application/vnd.ms-powerpoint.slideshow.macroenabled":
|
|
1074
|
-
return { ext: "ppsm", mime: "application/vnd.ms-powerpoint.slideshow.macroenabled.12" };
|
|
1075
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
|
|
1076
|
-
return { ext: "docx", mime: mimeType };
|
|
1077
|
-
case "application/vnd.ms-word.document.macroenabled":
|
|
1078
|
-
return { ext: "docm", mime: "application/vnd.ms-word.document.macroenabled.12" };
|
|
1079
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.template":
|
|
1080
|
-
return { ext: "dotx", mime: mimeType };
|
|
1081
|
-
case "application/vnd.ms-word.template.macroenabledtemplate":
|
|
1082
|
-
return { ext: "dotm", mime: "application/vnd.ms-word.template.macroenabled.12" };
|
|
1083
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.template":
|
|
1084
|
-
return { ext: "potx", mime: mimeType };
|
|
1085
|
-
case "application/vnd.ms-powerpoint.template.macroenabled":
|
|
1086
|
-
return { ext: "potm", mime: "application/vnd.ms-powerpoint.template.macroenabled.12" };
|
|
1087
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation":
|
|
1088
|
-
return { ext: "pptx", mime: mimeType };
|
|
1089
|
-
case "application/vnd.ms-powerpoint.presentation.macroenabled":
|
|
1090
|
-
return { ext: "pptm", mime: "application/vnd.ms-powerpoint.presentation.macroenabled.12" };
|
|
1091
|
-
case "application/vnd.ms-visio.drawing":
|
|
1092
|
-
return { ext: "vsdx", mime: "application/vnd.visio" };
|
|
1093
|
-
case "application/vnd.ms-package.3dmanufacturing-3dmodel+xml":
|
|
1094
|
-
return { ext: "3mf", mime: "model/3mf" };
|
|
1095
|
-
default:
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
function createOpenXmlZipDetectionState() {
|
|
1099
|
-
return {
|
|
1100
|
-
hasContentTypesEntry: false,
|
|
1101
|
-
hasParsedContentTypesEntry: false,
|
|
1102
|
-
isParsingContentTypes: false,
|
|
1103
|
-
hasUnparseableContentTypes: false,
|
|
1104
|
-
hasWordDirectory: false,
|
|
1105
|
-
hasPresentationDirectory: false,
|
|
1106
|
-
hasSpreadsheetDirectory: false,
|
|
1107
|
-
hasThreeDimensionalModelEntry: false
|
|
1108
|
-
};
|
|
1109
|
-
}
|
|
1110
|
-
function updateOpenXmlZipDetectionStateFromFilename(openXmlState, filename) {
|
|
1111
|
-
if (filename.startsWith("word/")) {
|
|
1112
|
-
openXmlState.hasWordDirectory = true;
|
|
1113
|
-
}
|
|
1114
|
-
if (filename.startsWith("ppt/")) {
|
|
1115
|
-
openXmlState.hasPresentationDirectory = true;
|
|
1116
|
-
}
|
|
1117
|
-
if (filename.startsWith("xl/")) {
|
|
1118
|
-
openXmlState.hasSpreadsheetDirectory = true;
|
|
1119
|
-
}
|
|
1120
|
-
if (filename.startsWith("3D/") && filename.endsWith(".model")) {
|
|
1121
|
-
openXmlState.hasThreeDimensionalModelEntry = true;
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
function getOpenXmlFileTypeFromDirectoryNames(openXmlState) {
|
|
1125
|
-
if (openXmlState.hasWordDirectory) {
|
|
1126
|
-
return {
|
|
1127
|
-
ext: "docx",
|
|
1128
|
-
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
if (openXmlState.hasPresentationDirectory) {
|
|
1132
|
-
return {
|
|
1133
|
-
ext: "pptx",
|
|
1134
|
-
mime: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
if (openXmlState.hasSpreadsheetDirectory) {
|
|
1138
|
-
return {
|
|
1139
|
-
ext: "xlsx",
|
|
1140
|
-
mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1141
|
-
};
|
|
1142
|
-
}
|
|
1143
|
-
if (openXmlState.hasThreeDimensionalModelEntry) {
|
|
1144
|
-
return {
|
|
1145
|
-
ext: "3mf",
|
|
1146
|
-
mime: "model/3mf"
|
|
1147
|
-
};
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
function getOpenXmlFileTypeFromZipEntries(openXmlState) {
|
|
1151
|
-
if (!openXmlState.hasContentTypesEntry || openXmlState.hasUnparseableContentTypes || openXmlState.isParsingContentTypes || openXmlState.hasParsedContentTypesEntry) {
|
|
1152
|
-
return;
|
|
1153
|
-
}
|
|
1154
|
-
return getOpenXmlFileTypeFromDirectoryNames(openXmlState);
|
|
1155
|
-
}
|
|
1156
|
-
function getOpenXmlMimeTypeFromContentTypesXml(xmlContent) {
|
|
1157
|
-
const endPosition = xmlContent.indexOf('.main+xml"');
|
|
1158
|
-
if (endPosition === -1) {
|
|
1159
|
-
const mimeType = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
|
|
1160
|
-
if (xmlContent.includes(`ContentType="${mimeType}"`)) {
|
|
1161
|
-
return mimeType;
|
|
1162
|
-
}
|
|
1163
|
-
return;
|
|
1164
|
-
}
|
|
1165
|
-
const truncatedContent = xmlContent.slice(0, endPosition);
|
|
1166
|
-
const firstQuotePosition = truncatedContent.lastIndexOf('"');
|
|
1167
|
-
return truncatedContent.slice(firstQuotePosition + 1);
|
|
1168
|
-
}
|
|
1169
|
-
var zipDataDescriptorSignature = 134695760;
|
|
1170
|
-
var zipDataDescriptorLengthInBytes = 16;
|
|
1171
|
-
var zipDataDescriptorOverlapLengthInBytes = zipDataDescriptorLengthInBytes - 1;
|
|
1172
|
-
function findZipDataDescriptorOffset(buffer, bytesConsumed) {
|
|
1173
|
-
if (buffer.length < zipDataDescriptorLengthInBytes) {
|
|
1174
|
-
return -1;
|
|
1175
|
-
}
|
|
1176
|
-
const lastPossibleDescriptorOffset = buffer.length - zipDataDescriptorLengthInBytes;
|
|
1177
|
-
for (let index = 0; index <= lastPossibleDescriptorOffset; index++) {
|
|
1178
|
-
if (UINT32_LE.get(buffer, index) === zipDataDescriptorSignature && UINT32_LE.get(buffer, index + 8) === bytesConsumed + index) {
|
|
1179
|
-
return index;
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
return -1;
|
|
1183
|
-
}
|
|
1184
|
-
async function readZipDataDescriptorEntryWithLimit(zipHandler, { shouldBuffer, maximumLength = maximumZipEntrySizeInBytes } = {}) {
|
|
1185
|
-
const { syncBuffer } = zipHandler;
|
|
1186
|
-
const { length: syncBufferLength } = syncBuffer;
|
|
1187
|
-
const chunks = [];
|
|
1188
|
-
let bytesConsumed = 0;
|
|
1189
|
-
for (; ; ) {
|
|
1190
|
-
const length = await zipHandler.tokenizer.peekBuffer(syncBuffer, { mayBeLess: true });
|
|
1191
|
-
const dataDescriptorOffset = findZipDataDescriptorOffset(syncBuffer.subarray(0, length), bytesConsumed);
|
|
1192
|
-
const retainedLength = dataDescriptorOffset >= 0 ? 0 : length === syncBufferLength ? Math.min(zipDataDescriptorOverlapLengthInBytes, length - 1) : 0;
|
|
1193
|
-
const chunkLength = dataDescriptorOffset >= 0 ? dataDescriptorOffset : length - retainedLength;
|
|
1194
|
-
if (chunkLength === 0) {
|
|
1195
|
-
break;
|
|
1196
|
-
}
|
|
1197
|
-
bytesConsumed += chunkLength;
|
|
1198
|
-
if (bytesConsumed > maximumLength) {
|
|
1199
|
-
throw new Error(`ZIP entry compressed data exceeds ${maximumLength} bytes`);
|
|
1200
|
-
}
|
|
1201
|
-
if (shouldBuffer) {
|
|
1202
|
-
const data = new Uint8Array(chunkLength);
|
|
1203
|
-
await zipHandler.tokenizer.readBuffer(data);
|
|
1204
|
-
chunks.push(data);
|
|
1205
|
-
} else {
|
|
1206
|
-
await zipHandler.tokenizer.ignore(chunkLength);
|
|
1207
|
-
}
|
|
1208
|
-
if (dataDescriptorOffset >= 0) {
|
|
1209
|
-
break;
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
if (!hasUnknownFileSize(zipHandler.tokenizer)) {
|
|
1213
|
-
zipHandler.knownSizeDescriptorScannedBytes += bytesConsumed;
|
|
1214
|
-
}
|
|
1215
|
-
if (!shouldBuffer) {
|
|
1216
|
-
return;
|
|
1217
|
-
}
|
|
1218
|
-
return mergeByteChunks(chunks, bytesConsumed);
|
|
1219
|
-
}
|
|
1220
|
-
function getRemainingZipScanBudget(zipHandler, startOffset) {
|
|
1221
|
-
if (hasUnknownFileSize(zipHandler.tokenizer)) {
|
|
1222
|
-
return Math.max(0, maximumUntrustedSkipSizeInBytes - (zipHandler.tokenizer.position - startOffset));
|
|
1223
|
-
}
|
|
1224
|
-
return Math.max(0, maximumZipEntrySizeInBytes - zipHandler.knownSizeDescriptorScannedBytes);
|
|
1225
|
-
}
|
|
1226
|
-
async function readZipEntryData(zipHandler, zipHeader, { shouldBuffer, maximumDescriptorLength = maximumZipEntrySizeInBytes } = {}) {
|
|
1227
|
-
if (zipHeader.dataDescriptor && zipHeader.compressedSize === 0) {
|
|
1228
|
-
return readZipDataDescriptorEntryWithLimit(zipHandler, {
|
|
1229
|
-
shouldBuffer,
|
|
1230
|
-
maximumLength: maximumDescriptorLength
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
if (!shouldBuffer) {
|
|
1234
|
-
await safeIgnore(zipHandler.tokenizer, zipHeader.compressedSize, {
|
|
1235
|
-
maximumLength: hasUnknownFileSize(zipHandler.tokenizer) ? maximumZipEntrySizeInBytes : zipHandler.tokenizer.fileInfo.size,
|
|
1236
|
-
reason: "ZIP entry compressed data"
|
|
1237
|
-
});
|
|
1238
|
-
return;
|
|
1239
|
-
}
|
|
1240
|
-
const maximumLength = getMaximumZipBufferedReadLength(zipHandler.tokenizer);
|
|
1241
|
-
if (!Number.isFinite(zipHeader.compressedSize) || zipHeader.compressedSize < 0 || zipHeader.compressedSize > maximumLength) {
|
|
1242
|
-
throw new Error(`ZIP entry compressed data exceeds ${maximumLength} bytes`);
|
|
1243
|
-
}
|
|
1244
|
-
const fileData = new Uint8Array(zipHeader.compressedSize);
|
|
1245
|
-
await zipHandler.tokenizer.readBuffer(fileData);
|
|
1246
|
-
return fileData;
|
|
1247
|
-
}
|
|
1248
|
-
ZipHandler.prototype.inflate = async function(zipHeader, fileData, callback) {
|
|
1249
|
-
if (zipHeader.compressedMethod === 0) {
|
|
1250
|
-
return callback(fileData);
|
|
1251
|
-
}
|
|
1252
|
-
if (zipHeader.compressedMethod !== 8) {
|
|
1253
|
-
throw new Error(`Unsupported ZIP compression method: ${zipHeader.compressedMethod}`);
|
|
1254
|
-
}
|
|
1255
|
-
const uncompressedData = await decompressDeflateRawWithLimit(fileData, { maximumLength: maximumZipEntrySizeInBytes });
|
|
1256
|
-
return callback(uncompressedData);
|
|
1257
|
-
};
|
|
1258
|
-
ZipHandler.prototype.unzip = async function(fileCallback) {
|
|
1259
|
-
let stop = false;
|
|
1260
|
-
let zipEntryCount = 0;
|
|
1261
|
-
const zipScanStart = this.tokenizer.position;
|
|
1262
|
-
this.knownSizeDescriptorScannedBytes = 0;
|
|
1263
|
-
do {
|
|
1264
|
-
if (hasExceededUnknownSizeScanBudget(this.tokenizer, zipScanStart, maximumUntrustedSkipSizeInBytes)) {
|
|
1265
|
-
throw new ParserHardLimitError(`ZIP stream probing exceeds ${maximumUntrustedSkipSizeInBytes} bytes`);
|
|
1266
|
-
}
|
|
1267
|
-
const zipHeader = await this.readLocalFileHeader();
|
|
1268
|
-
if (!zipHeader) {
|
|
1269
|
-
break;
|
|
1270
|
-
}
|
|
1271
|
-
zipEntryCount++;
|
|
1272
|
-
if (zipEntryCount > maximumZipEntryCount) {
|
|
1273
|
-
throw new Error(`ZIP entry count exceeds ${maximumZipEntryCount}`);
|
|
1274
|
-
}
|
|
1275
|
-
const next = fileCallback(zipHeader);
|
|
1276
|
-
stop = Boolean(next.stop);
|
|
1277
|
-
await this.tokenizer.ignore(zipHeader.extraFieldLength);
|
|
1278
|
-
const fileData = await readZipEntryData(this, zipHeader, {
|
|
1279
|
-
shouldBuffer: Boolean(next.handler),
|
|
1280
|
-
maximumDescriptorLength: Math.min(maximumZipEntrySizeInBytes, getRemainingZipScanBudget(this, zipScanStart))
|
|
1281
|
-
});
|
|
1282
|
-
if (next.handler) {
|
|
1283
|
-
await this.inflate(zipHeader, fileData, next.handler);
|
|
1284
|
-
}
|
|
1285
|
-
if (zipHeader.dataDescriptor) {
|
|
1286
|
-
const dataDescriptor = new Uint8Array(zipDataDescriptorLengthInBytes);
|
|
1287
|
-
await this.tokenizer.readBuffer(dataDescriptor);
|
|
1288
|
-
if (UINT32_LE.get(dataDescriptor, 0) !== zipDataDescriptorSignature) {
|
|
1289
|
-
throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - dataDescriptor.length}`);
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
if (hasExceededUnknownSizeScanBudget(this.tokenizer, zipScanStart, maximumUntrustedSkipSizeInBytes)) {
|
|
1293
|
-
throw new ParserHardLimitError(`ZIP stream probing exceeds ${maximumUntrustedSkipSizeInBytes} bytes`);
|
|
1294
|
-
}
|
|
1295
|
-
} while (!stop);
|
|
1296
|
-
};
|
|
1297
|
-
async function detectZip(tokenizer) {
|
|
1298
|
-
let fileType;
|
|
1299
|
-
const openXmlState = createOpenXmlZipDetectionState();
|
|
1300
|
-
const iWorkState = createIWorkZipDetectionState();
|
|
1301
|
-
try {
|
|
1302
|
-
await new ZipHandler(tokenizer).unzip((zipHeader) => {
|
|
1303
|
-
updateOpenXmlZipDetectionStateFromFilename(openXmlState, zipHeader.filename);
|
|
1304
|
-
updateIWorkZipDetectionStateFromFilename(iWorkState, zipHeader.filename);
|
|
1305
|
-
if (iWorkState.hasDocumentEntry && (iWorkState.hasMasterSlideEntry || iWorkState.hasTablesEntry)) {
|
|
1306
|
-
fileType = getIWorkFileTypeFromZipEntries(iWorkState);
|
|
1307
|
-
return { stop: true };
|
|
1308
|
-
}
|
|
1309
|
-
const isOpenXmlContentTypesEntry = zipHeader.filename === "[Content_Types].xml";
|
|
1310
|
-
const openXmlFileTypeFromEntries = getOpenXmlFileTypeFromZipEntries(openXmlState);
|
|
1311
|
-
if (!isOpenXmlContentTypesEntry && openXmlFileTypeFromEntries) {
|
|
1312
|
-
fileType = openXmlFileTypeFromEntries;
|
|
1313
|
-
return {
|
|
1314
|
-
stop: true
|
|
1315
|
-
};
|
|
1316
|
-
}
|
|
1317
|
-
switch (zipHeader.filename) {
|
|
1318
|
-
case "META-INF/mozilla.rsa":
|
|
1319
|
-
fileType = {
|
|
1320
|
-
ext: "xpi",
|
|
1321
|
-
mime: "application/x-xpinstall"
|
|
1322
|
-
};
|
|
1323
|
-
return {
|
|
1324
|
-
stop: true
|
|
1325
|
-
};
|
|
1326
|
-
case "META-INF/MANIFEST.MF":
|
|
1327
|
-
fileType = {
|
|
1328
|
-
ext: "jar",
|
|
1329
|
-
mime: "application/java-archive"
|
|
1330
|
-
};
|
|
1331
|
-
return {
|
|
1332
|
-
stop: true
|
|
1333
|
-
};
|
|
1334
|
-
case "mimetype":
|
|
1335
|
-
if (!canReadZipEntryForDetection(zipHeader, maximumZipTextEntrySizeInBytes)) {
|
|
1336
|
-
return {};
|
|
1337
|
-
}
|
|
1338
|
-
return {
|
|
1339
|
-
async handler(fileData) {
|
|
1340
|
-
const mimeType = new TextDecoder("utf-8").decode(fileData).trim();
|
|
1341
|
-
fileType = getFileTypeFromMimeType(mimeType);
|
|
1342
|
-
},
|
|
1343
|
-
stop: true
|
|
1344
|
-
};
|
|
1345
|
-
case "[Content_Types].xml": {
|
|
1346
|
-
openXmlState.hasContentTypesEntry = true;
|
|
1347
|
-
if (!canReadZipEntryForDetection(zipHeader, maximumZipTextEntrySizeInBytes)) {
|
|
1348
|
-
openXmlState.hasUnparseableContentTypes = true;
|
|
1349
|
-
return {};
|
|
1350
|
-
}
|
|
1351
|
-
openXmlState.isParsingContentTypes = true;
|
|
1352
|
-
return {
|
|
1353
|
-
async handler(fileData) {
|
|
1354
|
-
const xmlContent = new TextDecoder("utf-8").decode(fileData);
|
|
1355
|
-
const mimeType = getOpenXmlMimeTypeFromContentTypesXml(xmlContent);
|
|
1356
|
-
if (mimeType) {
|
|
1357
|
-
fileType = getFileTypeFromMimeType(mimeType);
|
|
1358
|
-
}
|
|
1359
|
-
openXmlState.hasParsedContentTypesEntry = true;
|
|
1360
|
-
openXmlState.isParsingContentTypes = false;
|
|
1361
|
-
},
|
|
1362
|
-
stop: true
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
default:
|
|
1366
|
-
if (new RegExp("classes\\d*\\.dex", "v").test(zipHeader.filename)) {
|
|
1367
|
-
fileType = {
|
|
1368
|
-
ext: "apk",
|
|
1369
|
-
mime: "application/vnd.android.package-archive"
|
|
1370
|
-
};
|
|
1371
|
-
return { stop: true };
|
|
1372
|
-
}
|
|
1373
|
-
return {};
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
} catch (error) {
|
|
1377
|
-
if (!isRecoverableZipError(error)) {
|
|
1378
|
-
throw error;
|
|
1379
|
-
}
|
|
1380
|
-
if (openXmlState.isParsingContentTypes) {
|
|
1381
|
-
openXmlState.isParsingContentTypes = false;
|
|
1382
|
-
openXmlState.hasUnparseableContentTypes = true;
|
|
1383
|
-
}
|
|
1384
|
-
if (!fileType && error instanceof EndOfStreamError && !openXmlState.hasContentTypesEntry) {
|
|
1385
|
-
fileType = getOpenXmlFileTypeFromDirectoryNames(openXmlState);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
const iWorkFileType = hasUnknownFileSize(tokenizer) && iWorkState.hasDocumentEntry && !iWorkState.hasMasterSlideEntry && !iWorkState.hasTablesEntry && !iWorkState.hasCalculationEngineEntry ? void 0 : getIWorkFileTypeFromZipEntries(iWorkState);
|
|
1389
|
-
return fileType ?? getOpenXmlFileTypeFromZipEntries(openXmlState) ?? iWorkFileType ?? {
|
|
1390
|
-
ext: "zip",
|
|
1391
|
-
mime: "application/zip"
|
|
1392
|
-
};
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
// ../../node_modules/file-type/source/detectors/ebml.js
|
|
1396
|
-
init_shims();
|
|
1397
|
-
var maximumEbmlDocumentTypeSizeInBytes = 64;
|
|
1398
|
-
var maximumEbmlElementPayloadSizeInBytes = 1024 * 1024;
|
|
1399
|
-
var maximumEbmlElementCount = 256;
|
|
1400
|
-
async function detectEbml(tokenizer) {
|
|
1401
|
-
async function readField() {
|
|
1402
|
-
const msb = await tokenizer.peekNumber(UINT8);
|
|
1403
|
-
let mask = 128;
|
|
1404
|
-
let ic = 0;
|
|
1405
|
-
while ((msb & mask) === 0 && mask !== 0) {
|
|
1406
|
-
++ic;
|
|
1407
|
-
mask >>= 1;
|
|
1408
|
-
}
|
|
1409
|
-
const id = new Uint8Array(ic + 1);
|
|
1410
|
-
await safeReadBuffer(tokenizer, id, void 0, {
|
|
1411
|
-
maximumLength: id.length,
|
|
1412
|
-
reason: "EBML field"
|
|
1413
|
-
});
|
|
1414
|
-
return id;
|
|
1415
|
-
}
|
|
1416
|
-
async function readElement() {
|
|
1417
|
-
const idField = await readField();
|
|
1418
|
-
const lengthField = await readField();
|
|
1419
|
-
lengthField[0] ^= 128 >> lengthField.length - 1;
|
|
1420
|
-
const nrLength = Math.min(6, lengthField.length);
|
|
1421
|
-
const idView = new DataView(idField.buffer);
|
|
1422
|
-
const lengthView = new DataView(lengthField.buffer, lengthField.length - nrLength, nrLength);
|
|
1423
|
-
return {
|
|
1424
|
-
id: getUintBE(idView),
|
|
1425
|
-
len: getUintBE(lengthView)
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
async function readChildren(children) {
|
|
1429
|
-
let ebmlElementCount = 0;
|
|
1430
|
-
while (children > 0) {
|
|
1431
|
-
ebmlElementCount++;
|
|
1432
|
-
if (ebmlElementCount > maximumEbmlElementCount) {
|
|
1433
|
-
return;
|
|
1434
|
-
}
|
|
1435
|
-
if (hasExceededUnknownSizeScanBudget(tokenizer, ebmlScanStart, maximumUntrustedSkipSizeInBytes)) {
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
const previousPosition = tokenizer.position;
|
|
1439
|
-
const element = await readElement();
|
|
1440
|
-
if (element.id === 17026) {
|
|
1441
|
-
if (element.len > maximumEbmlDocumentTypeSizeInBytes) {
|
|
1442
|
-
return;
|
|
1443
|
-
}
|
|
1444
|
-
const documentTypeLength = getSafeBound(element.len, maximumEbmlDocumentTypeSizeInBytes, "EBML DocType");
|
|
1445
|
-
const rawValue = await tokenizer.readToken(new StringType(documentTypeLength));
|
|
1446
|
-
return rawValue.replaceAll(new RegExp("\\0.*$", "gv"), "");
|
|
1447
|
-
}
|
|
1448
|
-
if (hasUnknownFileSize(tokenizer) && (!Number.isFinite(element.len) || element.len < 0 || element.len > maximumEbmlElementPayloadSizeInBytes)) {
|
|
1449
|
-
return;
|
|
1450
|
-
}
|
|
1451
|
-
await safeIgnore(tokenizer, element.len, {
|
|
1452
|
-
maximumLength: hasUnknownFileSize(tokenizer) ? maximumEbmlElementPayloadSizeInBytes : tokenizer.fileInfo.size,
|
|
1453
|
-
reason: "EBML payload"
|
|
1454
|
-
});
|
|
1455
|
-
--children;
|
|
1456
|
-
if (tokenizer.position <= previousPosition) {
|
|
1457
|
-
return;
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
const rootElement = await readElement();
|
|
1462
|
-
const ebmlScanStart = tokenizer.position;
|
|
1463
|
-
const documentType = await readChildren(rootElement.len);
|
|
1464
|
-
switch (documentType) {
|
|
1465
|
-
case "webm":
|
|
1466
|
-
return {
|
|
1467
|
-
ext: "webm",
|
|
1468
|
-
mime: "video/webm"
|
|
1469
|
-
};
|
|
1470
|
-
case "matroska":
|
|
1471
|
-
return {
|
|
1472
|
-
ext: "mkv",
|
|
1473
|
-
mime: "video/matroska"
|
|
1474
|
-
};
|
|
1475
|
-
default:
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
// ../../node_modules/file-type/source/detectors/png.js
|
|
1480
|
-
init_shims();
|
|
1481
|
-
var maximumPngChunkCount = 512;
|
|
1482
|
-
var maximumPngStreamScanBudgetInBytes = 16 * 1024 * 1024;
|
|
1483
|
-
var maximumPngChunkSizeInBytes = 1024 * 1024;
|
|
1484
|
-
function isPngAncillaryChunk(type) {
|
|
1485
|
-
return (type.codePointAt(0) & 32) !== 0;
|
|
1486
|
-
}
|
|
1487
|
-
async function detectPng(tokenizer) {
|
|
1488
|
-
const pngFileType = {
|
|
1489
|
-
ext: "png",
|
|
1490
|
-
mime: "image/png"
|
|
1491
|
-
};
|
|
1492
|
-
const apngFileType = {
|
|
1493
|
-
ext: "apng",
|
|
1494
|
-
mime: "image/apng"
|
|
1495
|
-
};
|
|
1496
|
-
await tokenizer.ignore(8);
|
|
1497
|
-
async function readChunkHeader() {
|
|
1498
|
-
return {
|
|
1499
|
-
length: await tokenizer.readToken(INT32_BE),
|
|
1500
|
-
type: await tokenizer.readToken(new StringType(4, "latin1"))
|
|
1501
|
-
};
|
|
1502
|
-
}
|
|
1503
|
-
const isUnknownPngStream = hasUnknownFileSize(tokenizer);
|
|
1504
|
-
const pngScanStart = tokenizer.position;
|
|
1505
|
-
let pngChunkCount = 0;
|
|
1506
|
-
let hasSeenImageHeader = false;
|
|
1507
|
-
do {
|
|
1508
|
-
pngChunkCount++;
|
|
1509
|
-
if (pngChunkCount > maximumPngChunkCount) {
|
|
1510
|
-
break;
|
|
1511
|
-
}
|
|
1512
|
-
if (hasExceededUnknownSizeScanBudget(tokenizer, pngScanStart, maximumPngStreamScanBudgetInBytes)) {
|
|
1513
|
-
break;
|
|
1514
|
-
}
|
|
1515
|
-
const previousPosition = tokenizer.position;
|
|
1516
|
-
const chunk = await readChunkHeader();
|
|
1517
|
-
if (chunk.length < 0) {
|
|
1518
|
-
return;
|
|
1519
|
-
}
|
|
1520
|
-
if (chunk.type === "IHDR") {
|
|
1521
|
-
if (chunk.length !== 13) {
|
|
1522
|
-
return;
|
|
1523
|
-
}
|
|
1524
|
-
hasSeenImageHeader = true;
|
|
1525
|
-
}
|
|
1526
|
-
switch (chunk.type) {
|
|
1527
|
-
case "IDAT":
|
|
1528
|
-
return pngFileType;
|
|
1529
|
-
case "acTL":
|
|
1530
|
-
return apngFileType;
|
|
1531
|
-
default:
|
|
1532
|
-
if (!hasSeenImageHeader && chunk.type !== "CgBI") {
|
|
1533
|
-
return;
|
|
1534
|
-
}
|
|
1535
|
-
if (isUnknownPngStream && chunk.length > maximumPngChunkSizeInBytes) {
|
|
1536
|
-
return hasSeenImageHeader && isPngAncillaryChunk(chunk.type) ? pngFileType : void 0;
|
|
1537
|
-
}
|
|
1538
|
-
try {
|
|
1539
|
-
await safeIgnore(tokenizer, chunk.length + 4, {
|
|
1540
|
-
maximumLength: isUnknownPngStream ? maximumPngChunkSizeInBytes + 4 : tokenizer.fileInfo.size,
|
|
1541
|
-
reason: "PNG chunk payload"
|
|
1542
|
-
});
|
|
1543
|
-
} catch (error) {
|
|
1544
|
-
if (!isUnknownPngStream && (error instanceof ParserHardLimitError || error instanceof EndOfStreamError)) {
|
|
1545
|
-
return pngFileType;
|
|
1546
|
-
}
|
|
1547
|
-
throw error;
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
if (tokenizer.position <= previousPosition) {
|
|
1551
|
-
break;
|
|
1552
|
-
}
|
|
1553
|
-
} while (tokenizer.position + 8 < tokenizer.fileInfo.size);
|
|
1554
|
-
return pngFileType;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
// ../../node_modules/file-type/source/detectors/asf.js
|
|
1558
|
-
init_shims();
|
|
1559
|
-
var maximumAsfHeaderObjectCount = 512;
|
|
1560
|
-
var maximumAsfHeaderPayloadSizeInBytes = 1024 * 1024;
|
|
1561
|
-
async function detectAsf(tokenizer) {
|
|
1562
|
-
let isMalformedAsf = false;
|
|
1563
|
-
try {
|
|
1564
|
-
async function readHeader() {
|
|
1565
|
-
const guid = new Uint8Array(16);
|
|
1566
|
-
await safeReadBuffer(tokenizer, guid, void 0, {
|
|
1567
|
-
maximumLength: guid.length,
|
|
1568
|
-
reason: "ASF header GUID"
|
|
1569
|
-
});
|
|
1570
|
-
return {
|
|
1571
|
-
id: guid,
|
|
1572
|
-
size: Number(await tokenizer.readToken(UINT64_LE))
|
|
1573
|
-
};
|
|
1574
|
-
}
|
|
1575
|
-
await safeIgnore(tokenizer, 30, {
|
|
1576
|
-
maximumLength: 30,
|
|
1577
|
-
reason: "ASF header prelude"
|
|
1578
|
-
});
|
|
1579
|
-
const isUnknownFileSize = hasUnknownFileSize(tokenizer);
|
|
1580
|
-
const asfHeaderScanStart = tokenizer.position;
|
|
1581
|
-
let asfHeaderObjectCount = 0;
|
|
1582
|
-
while (tokenizer.position + 24 < tokenizer.fileInfo.size) {
|
|
1583
|
-
asfHeaderObjectCount++;
|
|
1584
|
-
if (asfHeaderObjectCount > maximumAsfHeaderObjectCount) {
|
|
1585
|
-
break;
|
|
1586
|
-
}
|
|
1587
|
-
if (hasExceededUnknownSizeScanBudget(tokenizer, asfHeaderScanStart, maximumUntrustedSkipSizeInBytes)) {
|
|
1588
|
-
break;
|
|
1589
|
-
}
|
|
1590
|
-
const previousPosition = tokenizer.position;
|
|
1591
|
-
const header = await readHeader();
|
|
1592
|
-
let payload = header.size - 24;
|
|
1593
|
-
if (!Number.isFinite(payload) || payload < 0) {
|
|
1594
|
-
isMalformedAsf = true;
|
|
1595
|
-
break;
|
|
1596
|
-
}
|
|
1597
|
-
if (checkBytes(header.id, [145, 7, 220, 183, 183, 169, 207, 17, 142, 230, 0, 192, 12, 32, 83, 101])) {
|
|
1598
|
-
const typeId = new Uint8Array(16);
|
|
1599
|
-
payload -= await safeReadBuffer(tokenizer, typeId, void 0, {
|
|
1600
|
-
maximumLength: typeId.length,
|
|
1601
|
-
reason: "ASF stream type GUID"
|
|
1602
|
-
});
|
|
1603
|
-
if (checkBytes(typeId, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) {
|
|
1604
|
-
return {
|
|
1605
|
-
ext: "asf",
|
|
1606
|
-
mime: "audio/x-ms-asf"
|
|
1607
|
-
};
|
|
1608
|
-
}
|
|
1609
|
-
if (checkBytes(typeId, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) {
|
|
1610
|
-
return {
|
|
1611
|
-
ext: "asf",
|
|
1612
|
-
mime: "video/x-ms-asf"
|
|
1613
|
-
};
|
|
1614
|
-
}
|
|
1615
|
-
break;
|
|
1616
|
-
}
|
|
1617
|
-
if (isUnknownFileSize && payload > maximumAsfHeaderPayloadSizeInBytes) {
|
|
1618
|
-
isMalformedAsf = true;
|
|
1619
|
-
break;
|
|
1620
|
-
}
|
|
1621
|
-
await safeIgnore(tokenizer, payload, {
|
|
1622
|
-
maximumLength: isUnknownFileSize ? maximumAsfHeaderPayloadSizeInBytes : tokenizer.fileInfo.size,
|
|
1623
|
-
reason: "ASF header payload"
|
|
1624
|
-
});
|
|
1625
|
-
if (tokenizer.position <= previousPosition) {
|
|
1626
|
-
isMalformedAsf = true;
|
|
1627
|
-
break;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
} catch (error) {
|
|
1631
|
-
if (error instanceof EndOfStreamError || error instanceof ParserHardLimitError) {
|
|
1632
|
-
if (hasUnknownFileSize(tokenizer)) {
|
|
1633
|
-
isMalformedAsf = true;
|
|
1634
|
-
}
|
|
1635
|
-
} else {
|
|
1636
|
-
throw error;
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
if (isMalformedAsf) {
|
|
1640
|
-
return;
|
|
1641
|
-
}
|
|
1642
|
-
return {
|
|
1643
|
-
ext: "asf",
|
|
1644
|
-
mime: "application/vnd.ms-asf"
|
|
1645
|
-
};
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
// ../../node_modules/file-type/source/index.js
|
|
1649
|
-
var reasonableDetectionSizeInBytes = 4100;
|
|
1650
|
-
var maximumMpegOffsetTolerance = reasonableDetectionSizeInBytes - 2;
|
|
1651
|
-
var maximumNestedGzipDetectionSizeInBytes = maximumUntrustedSkipSizeInBytes;
|
|
1652
|
-
var maximumNestedGzipProbeDepth = 1;
|
|
1653
|
-
var unknownSizeGzipProbeTimeoutInMilliseconds = 100;
|
|
1654
|
-
var maximumId3HeaderSizeInBytes = maximumUntrustedSkipSizeInBytes;
|
|
1655
|
-
var maximumTiffTagCount = 512;
|
|
1656
|
-
var maximumDetectionReentryCount = 256;
|
|
1657
|
-
var maximumTiffStreamIfdOffsetInBytes = 1024 * 1024;
|
|
1658
|
-
var maximumTiffIfdOffsetInBytes = maximumUntrustedSkipSizeInBytes;
|
|
1659
|
-
function normalizeSampleSize(sampleSize) {
|
|
1660
|
-
if (!Number.isFinite(sampleSize)) {
|
|
1661
|
-
return reasonableDetectionSizeInBytes;
|
|
1662
|
-
}
|
|
1663
|
-
return Math.max(1, Math.trunc(sampleSize));
|
|
1664
|
-
}
|
|
1665
|
-
function normalizeMpegOffsetTolerance(mpegOffsetTolerance) {
|
|
1666
|
-
if (!Number.isFinite(mpegOffsetTolerance)) {
|
|
1667
|
-
return 0;
|
|
1668
|
-
}
|
|
1669
|
-
return Math.max(0, Math.min(maximumMpegOffsetTolerance, Math.trunc(mpegOffsetTolerance)));
|
|
1670
|
-
}
|
|
1671
|
-
function getKnownFileSizeOrMaximum(fileSize) {
|
|
1672
|
-
if (!Number.isFinite(fileSize)) {
|
|
1673
|
-
return Number.MAX_SAFE_INTEGER;
|
|
1674
|
-
}
|
|
1675
|
-
return Math.max(0, fileSize);
|
|
1676
|
-
}
|
|
1677
|
-
function importAtRuntime(specifier) {
|
|
1678
|
-
return import(specifier);
|
|
1679
|
-
}
|
|
1680
|
-
function toDefaultStream(stream) {
|
|
1681
|
-
return stream.pipeThrough(new TransformStream());
|
|
1682
|
-
}
|
|
1683
|
-
function readWithSignal(reader, signal) {
|
|
1684
|
-
if (signal === void 0) {
|
|
1685
|
-
return reader.read();
|
|
1686
|
-
}
|
|
1687
|
-
signal.throwIfAborted();
|
|
1688
|
-
return Promise.race([
|
|
1689
|
-
reader.read(),
|
|
1690
|
-
new Promise((_resolve, reject) => {
|
|
1691
|
-
signal.addEventListener("abort", () => {
|
|
1692
|
-
reject(signal.reason);
|
|
1693
|
-
reader.cancel(signal.reason).catch(() => {
|
|
1694
|
-
});
|
|
1695
|
-
}, { once: true });
|
|
1696
|
-
})
|
|
1697
|
-
]);
|
|
1698
|
-
}
|
|
1699
|
-
function createByteLimitedReadableStream(stream, maximumBytes) {
|
|
1700
|
-
const reader = stream.getReader();
|
|
1701
|
-
let emittedBytes = 0;
|
|
1702
|
-
let sourceDone = false;
|
|
1703
|
-
let sourceCanceled = false;
|
|
1704
|
-
const cancelSource = async (reason) => {
|
|
1705
|
-
if (sourceDone || sourceCanceled) {
|
|
1706
|
-
return;
|
|
1707
|
-
}
|
|
1708
|
-
sourceCanceled = true;
|
|
1709
|
-
await reader.cancel(reason);
|
|
1710
|
-
};
|
|
1711
|
-
return new ReadableStream({
|
|
1712
|
-
async pull(controller) {
|
|
1713
|
-
if (emittedBytes >= maximumBytes) {
|
|
1714
|
-
controller.close();
|
|
1715
|
-
await cancelSource();
|
|
1716
|
-
return;
|
|
1717
|
-
}
|
|
1718
|
-
const { done, value } = await reader.read();
|
|
1719
|
-
if (done || !value) {
|
|
1720
|
-
sourceDone = true;
|
|
1721
|
-
controller.close();
|
|
1722
|
-
return;
|
|
1723
|
-
}
|
|
1724
|
-
const remainingBytes = maximumBytes - emittedBytes;
|
|
1725
|
-
if (value.length > remainingBytes) {
|
|
1726
|
-
controller.enqueue(value.subarray(0, remainingBytes));
|
|
1727
|
-
emittedBytes += remainingBytes;
|
|
1728
|
-
controller.close();
|
|
1729
|
-
await cancelSource();
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
controller.enqueue(value);
|
|
1733
|
-
emittedBytes += value.length;
|
|
1734
|
-
},
|
|
1735
|
-
async cancel(reason) {
|
|
1736
|
-
await cancelSource(reason);
|
|
1737
|
-
}
|
|
1738
|
-
});
|
|
1739
|
-
}
|
|
1740
|
-
async function fileTypeFromBuffer(input, options) {
|
|
1741
|
-
return new FileTypeParser(options).fromBuffer(input);
|
|
1742
|
-
}
|
|
1743
|
-
var FileTypeParser = class _FileTypeParser {
|
|
1744
|
-
constructor(options) {
|
|
1745
|
-
const normalizedMpegOffsetTolerance = normalizeMpegOffsetTolerance(options?.mpegOffsetTolerance);
|
|
1746
|
-
this.options = {
|
|
1747
|
-
...options,
|
|
1748
|
-
mpegOffsetTolerance: normalizedMpegOffsetTolerance
|
|
1749
|
-
};
|
|
1750
|
-
this.detectors = [
|
|
1751
|
-
...this.options.customDetectors ?? [],
|
|
1752
|
-
{ id: "core", detect: this.detectConfident },
|
|
1753
|
-
{ id: "core.imprecise", detect: this.detectImprecise }
|
|
1754
|
-
];
|
|
1755
|
-
this.tokenizerOptions = {
|
|
1756
|
-
abortSignal: this.options.signal
|
|
1757
|
-
};
|
|
1758
|
-
this.gzipProbeDepth = 0;
|
|
1759
|
-
}
|
|
1760
|
-
getTokenizerOptions() {
|
|
1761
|
-
return {
|
|
1762
|
-
...this.tokenizerOptions
|
|
1763
|
-
};
|
|
1764
|
-
}
|
|
1765
|
-
createTokenizerFromWebStream(stream) {
|
|
1766
|
-
return fromWebStream(toDefaultStream(stream), this.getTokenizerOptions());
|
|
1767
|
-
}
|
|
1768
|
-
async parseTokenizer(tokenizer, detectionReentryCount = 0) {
|
|
1769
|
-
this.detectionReentryCount = detectionReentryCount;
|
|
1770
|
-
const initialPosition = tokenizer.position;
|
|
1771
|
-
for (const detector of this.detectors) {
|
|
1772
|
-
let fileType;
|
|
1773
|
-
try {
|
|
1774
|
-
fileType = await detector.detect(tokenizer);
|
|
1775
|
-
} catch (error) {
|
|
1776
|
-
if (error instanceof EndOfStreamError) {
|
|
1777
|
-
return;
|
|
1778
|
-
}
|
|
1779
|
-
if (error instanceof ParserHardLimitError) {
|
|
1780
|
-
return;
|
|
1781
|
-
}
|
|
1782
|
-
throw error;
|
|
1783
|
-
}
|
|
1784
|
-
if (fileType) {
|
|
1785
|
-
return fileType;
|
|
1786
|
-
}
|
|
1787
|
-
if (initialPosition !== tokenizer.position) {
|
|
1788
|
-
return void 0;
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
async fromTokenizer(tokenizer) {
|
|
1793
|
-
try {
|
|
1794
|
-
return await this.parseTokenizer(tokenizer);
|
|
1795
|
-
} finally {
|
|
1796
|
-
await tokenizer.close();
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
async fromBuffer(input) {
|
|
1800
|
-
if (!(input instanceof Uint8Array || input instanceof ArrayBuffer)) {
|
|
1801
|
-
throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof input}\``);
|
|
1802
|
-
}
|
|
1803
|
-
const buffer = input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
1804
|
-
if (!(buffer?.length > 1)) {
|
|
1805
|
-
return;
|
|
1806
|
-
}
|
|
1807
|
-
return this.fromTokenizer(fromBuffer(buffer, this.getTokenizerOptions()));
|
|
1808
|
-
}
|
|
1809
|
-
async fromBlob(blob) {
|
|
1810
|
-
this.options.signal?.throwIfAborted();
|
|
1811
|
-
const tokenizer = fromBlob(blob, this.getTokenizerOptions());
|
|
1812
|
-
return this.fromTokenizer(tokenizer);
|
|
1813
|
-
}
|
|
1814
|
-
async fromStream(stream) {
|
|
1815
|
-
this.options.signal?.throwIfAborted();
|
|
1816
|
-
const tokenizer = this.createTokenizerFromWebStream(stream);
|
|
1817
|
-
return this.fromTokenizer(tokenizer);
|
|
1818
|
-
}
|
|
1819
|
-
async fromFile(path) {
|
|
1820
|
-
this.options.signal?.throwIfAborted();
|
|
1821
|
-
const [{ default: fsPromises }, { FileTokenizer }] = await Promise.all([
|
|
1822
|
-
importAtRuntime("node:fs/promises"),
|
|
1823
|
-
importAtRuntime("strtok3")
|
|
1824
|
-
]);
|
|
1825
|
-
const fileHandle = await fsPromises.open(path, fsPromises.constants.O_RDONLY | fsPromises.constants.O_NONBLOCK);
|
|
1826
|
-
const fileStat = await fileHandle.stat();
|
|
1827
|
-
if (!fileStat.isFile()) {
|
|
1828
|
-
await fileHandle.close();
|
|
1829
|
-
return;
|
|
1830
|
-
}
|
|
1831
|
-
const tokenizer = new FileTokenizer(fileHandle, {
|
|
1832
|
-
...this.getTokenizerOptions(),
|
|
1833
|
-
fileInfo: { path, size: fileStat.size }
|
|
1834
|
-
});
|
|
1835
|
-
return this.fromTokenizer(tokenizer);
|
|
1836
|
-
}
|
|
1837
|
-
async toDetectionStream(stream, options) {
|
|
1838
|
-
this.options.signal?.throwIfAborted();
|
|
1839
|
-
const sampleSize = normalizeSampleSize(options?.sampleSize ?? reasonableDetectionSizeInBytes);
|
|
1840
|
-
let detectedFileType;
|
|
1841
|
-
let streamEnded = false;
|
|
1842
|
-
const reader = stream.getReader();
|
|
1843
|
-
const chunks = [];
|
|
1844
|
-
let totalSize = 0;
|
|
1845
|
-
try {
|
|
1846
|
-
while (totalSize < sampleSize) {
|
|
1847
|
-
const { value, done } = await readWithSignal(reader, this.options.signal);
|
|
1848
|
-
if (done || !value) {
|
|
1849
|
-
streamEnded = true;
|
|
1850
|
-
break;
|
|
1851
|
-
}
|
|
1852
|
-
chunks.push(value);
|
|
1853
|
-
totalSize += value.length;
|
|
1854
|
-
}
|
|
1855
|
-
if (!streamEnded && totalSize === sampleSize) {
|
|
1856
|
-
const { value, done } = await readWithSignal(reader, this.options.signal);
|
|
1857
|
-
if (done || !value) {
|
|
1858
|
-
streamEnded = true;
|
|
1859
|
-
} else {
|
|
1860
|
-
chunks.push(value);
|
|
1861
|
-
totalSize += value.length;
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
} finally {
|
|
1865
|
-
reader.releaseLock();
|
|
1866
|
-
}
|
|
1867
|
-
if (totalSize > 0) {
|
|
1868
|
-
const sample = chunks.length === 1 ? chunks[0] : concatUint8Arrays(chunks);
|
|
1869
|
-
try {
|
|
1870
|
-
detectedFileType = await this.fromBuffer(sample.subarray(0, sampleSize));
|
|
1871
|
-
} catch (error) {
|
|
1872
|
-
if (!(error instanceof EndOfStreamError)) {
|
|
1873
|
-
throw error;
|
|
1874
|
-
}
|
|
1875
|
-
detectedFileType = void 0;
|
|
1876
|
-
}
|
|
1877
|
-
if (!streamEnded && detectedFileType?.ext === "pages") {
|
|
1878
|
-
detectedFileType = {
|
|
1879
|
-
ext: "zip",
|
|
1880
|
-
mime: "application/zip"
|
|
1881
|
-
};
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
const transformStream = new TransformStream({
|
|
1885
|
-
start(controller) {
|
|
1886
|
-
for (const chunk of chunks) {
|
|
1887
|
-
controller.enqueue(chunk);
|
|
1888
|
-
}
|
|
1889
|
-
},
|
|
1890
|
-
transform(chunk, controller) {
|
|
1891
|
-
controller.enqueue(chunk);
|
|
1892
|
-
}
|
|
1893
|
-
});
|
|
1894
|
-
const newStream = stream.pipeThrough(transformStream);
|
|
1895
|
-
newStream.fileType = detectedFileType;
|
|
1896
|
-
return newStream;
|
|
1897
|
-
}
|
|
1898
|
-
async detectGzip(tokenizer) {
|
|
1899
|
-
if (this.gzipProbeDepth >= maximumNestedGzipProbeDepth) {
|
|
1900
|
-
return {
|
|
1901
|
-
ext: "gz",
|
|
1902
|
-
mime: "application/gzip"
|
|
1903
|
-
};
|
|
1904
|
-
}
|
|
1905
|
-
const gzipHandler = new GzipHandler(tokenizer);
|
|
1906
|
-
const limitedInflatedStream = createByteLimitedReadableStream(gzipHandler.inflate(), maximumNestedGzipDetectionSizeInBytes);
|
|
1907
|
-
const hasUnknownSize = hasUnknownFileSize(tokenizer);
|
|
1908
|
-
let timeout;
|
|
1909
|
-
let probeSignal;
|
|
1910
|
-
let probeParser;
|
|
1911
|
-
let compressedFileType;
|
|
1912
|
-
if (hasUnknownSize) {
|
|
1913
|
-
const timeoutController = new AbortController();
|
|
1914
|
-
timeout = setTimeout(() => {
|
|
1915
|
-
timeoutController.abort(new DOMException(`Operation timed out after ${unknownSizeGzipProbeTimeoutInMilliseconds} ms`, "TimeoutError"));
|
|
1916
|
-
}, unknownSizeGzipProbeTimeoutInMilliseconds);
|
|
1917
|
-
probeSignal = this.options.signal === void 0 ? timeoutController.signal : AbortSignal.any([this.options.signal, timeoutController.signal]);
|
|
1918
|
-
probeParser = new _FileTypeParser({
|
|
1919
|
-
...this.options,
|
|
1920
|
-
signal: probeSignal
|
|
1921
|
-
});
|
|
1922
|
-
probeParser.gzipProbeDepth = this.gzipProbeDepth + 1;
|
|
1923
|
-
} else {
|
|
1924
|
-
this.gzipProbeDepth++;
|
|
1925
|
-
}
|
|
1926
|
-
try {
|
|
1927
|
-
compressedFileType = await (probeParser ?? this).fromStream(limitedInflatedStream);
|
|
1928
|
-
} catch (error) {
|
|
1929
|
-
if (error?.name === "AbortError" && probeSignal?.reason?.name !== "TimeoutError") {
|
|
1930
|
-
throw error;
|
|
1931
|
-
}
|
|
1932
|
-
} finally {
|
|
1933
|
-
clearTimeout(timeout);
|
|
1934
|
-
if (!hasUnknownSize) {
|
|
1935
|
-
this.gzipProbeDepth--;
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
if (compressedFileType?.ext === "tar") {
|
|
1939
|
-
return {
|
|
1940
|
-
ext: "tar.gz",
|
|
1941
|
-
mime: "application/gzip"
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
|
-
return {
|
|
1945
|
-
ext: "gz",
|
|
1946
|
-
mime: "application/gzip"
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
check(header, options) {
|
|
1950
|
-
return checkBytes(this.buffer, header, options);
|
|
1951
|
-
}
|
|
1952
|
-
checkString(header, options) {
|
|
1953
|
-
return this.check(stringToBytes(header, options?.encoding), options);
|
|
1954
|
-
}
|
|
1955
|
-
// Detections with a high degree of certainty in identifying the correct file type
|
|
1956
|
-
detectConfident = async (tokenizer) => {
|
|
1957
|
-
this.buffer = new Uint8Array(reasonableDetectionSizeInBytes);
|
|
1958
|
-
if (tokenizer.fileInfo.size === void 0) {
|
|
1959
|
-
tokenizer.fileInfo.size = Number.MAX_SAFE_INTEGER;
|
|
1960
|
-
}
|
|
1961
|
-
this.tokenizer = tokenizer;
|
|
1962
|
-
if (hasUnknownFileSize(tokenizer)) {
|
|
1963
|
-
await tokenizer.peekBuffer(this.buffer, { length: 3, mayBeLess: true });
|
|
1964
|
-
if (this.check([31, 139, 8])) {
|
|
1965
|
-
return this.detectGzip(tokenizer);
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
await tokenizer.peekBuffer(this.buffer, { length: 32, mayBeLess: true });
|
|
1969
|
-
if (this.check([66, 77])) {
|
|
1970
|
-
return {
|
|
1971
|
-
ext: "bmp",
|
|
1972
|
-
mime: "image/bmp"
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
if (this.check([11, 119])) {
|
|
1976
|
-
return {
|
|
1977
|
-
ext: "ac3",
|
|
1978
|
-
mime: "audio/vnd.dolby.dd-raw"
|
|
1979
|
-
};
|
|
1980
|
-
}
|
|
1981
|
-
if (this.check([120, 1])) {
|
|
1982
|
-
return {
|
|
1983
|
-
ext: "dmg",
|
|
1984
|
-
mime: "application/x-apple-diskimage"
|
|
1985
|
-
};
|
|
1986
|
-
}
|
|
1987
|
-
if (this.check([77, 90])) {
|
|
1988
|
-
return {
|
|
1989
|
-
ext: "exe",
|
|
1990
|
-
mime: "application/x-msdownload"
|
|
1991
|
-
};
|
|
1992
|
-
}
|
|
1993
|
-
if (this.check([37, 33])) {
|
|
1994
|
-
await tokenizer.peekBuffer(this.buffer, { length: 24, mayBeLess: true });
|
|
1995
|
-
if (this.checkString("PS-Adobe-", { offset: 2 }) && this.checkString(" EPSF-", { offset: 14 })) {
|
|
1996
|
-
return {
|
|
1997
|
-
ext: "eps",
|
|
1998
|
-
mime: "application/eps"
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
|
-
return {
|
|
2002
|
-
ext: "ps",
|
|
2003
|
-
mime: "application/postscript"
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
if (this.check([31, 160]) || this.check([31, 157])) {
|
|
2007
|
-
return {
|
|
2008
|
-
ext: "Z",
|
|
2009
|
-
mime: "application/x-compress"
|
|
2010
|
-
};
|
|
2011
|
-
}
|
|
2012
|
-
if (this.check([199, 113])) {
|
|
2013
|
-
return {
|
|
2014
|
-
ext: "cpio",
|
|
2015
|
-
mime: "application/x-cpio"
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
if (this.check([96, 234])) {
|
|
2019
|
-
return {
|
|
2020
|
-
ext: "arj",
|
|
2021
|
-
mime: "application/x-arj"
|
|
2022
|
-
};
|
|
2023
|
-
}
|
|
2024
|
-
if (this.check([239, 187, 191])) {
|
|
2025
|
-
if (this.detectionReentryCount >= maximumDetectionReentryCount) {
|
|
2026
|
-
return;
|
|
2027
|
-
}
|
|
2028
|
-
this.detectionReentryCount++;
|
|
2029
|
-
await this.tokenizer.ignore(3);
|
|
2030
|
-
return this.detectConfident(tokenizer);
|
|
2031
|
-
}
|
|
2032
|
-
if (this.check([71, 73, 70])) {
|
|
2033
|
-
return {
|
|
2034
|
-
ext: "gif",
|
|
2035
|
-
mime: "image/gif"
|
|
2036
|
-
};
|
|
2037
|
-
}
|
|
2038
|
-
if (this.check([73, 73, 188])) {
|
|
2039
|
-
return {
|
|
2040
|
-
ext: "jxr",
|
|
2041
|
-
mime: "image/vnd.ms-photo"
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
2044
|
-
if (this.check([31, 139, 8])) {
|
|
2045
|
-
return this.detectGzip(tokenizer);
|
|
2046
|
-
}
|
|
2047
|
-
if (this.check([66, 90, 104])) {
|
|
2048
|
-
return {
|
|
2049
|
-
ext: "bz2",
|
|
2050
|
-
mime: "application/x-bzip2"
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
if (this.checkString("ID3")) {
|
|
2054
|
-
await safeIgnore(tokenizer, 6, {
|
|
2055
|
-
maximumLength: 6,
|
|
2056
|
-
reason: "ID3 header prefix"
|
|
2057
|
-
});
|
|
2058
|
-
const id3HeaderLength = await tokenizer.readToken(uint32SyncSafeToken);
|
|
2059
|
-
const isUnknownFileSize = hasUnknownFileSize(tokenizer);
|
|
2060
|
-
if (!Number.isFinite(id3HeaderLength) || id3HeaderLength < 0 || isUnknownFileSize && (id3HeaderLength > maximumId3HeaderSizeInBytes || tokenizer.position + id3HeaderLength > maximumId3HeaderSizeInBytes)) {
|
|
2061
|
-
return;
|
|
2062
|
-
}
|
|
2063
|
-
if (tokenizer.position + id3HeaderLength > tokenizer.fileInfo.size) {
|
|
2064
|
-
if (isUnknownFileSize) {
|
|
2065
|
-
return;
|
|
2066
|
-
}
|
|
2067
|
-
return {
|
|
2068
|
-
ext: "mp3",
|
|
2069
|
-
mime: "audio/mpeg"
|
|
2070
|
-
};
|
|
2071
|
-
}
|
|
2072
|
-
try {
|
|
2073
|
-
await safeIgnore(tokenizer, id3HeaderLength, {
|
|
2074
|
-
maximumLength: isUnknownFileSize ? maximumId3HeaderSizeInBytes : tokenizer.fileInfo.size,
|
|
2075
|
-
reason: "ID3 payload"
|
|
2076
|
-
});
|
|
2077
|
-
} catch (error) {
|
|
2078
|
-
if (error instanceof EndOfStreamError) {
|
|
2079
|
-
return;
|
|
2080
|
-
}
|
|
2081
|
-
throw error;
|
|
2082
|
-
}
|
|
2083
|
-
if (this.detectionReentryCount >= maximumDetectionReentryCount) {
|
|
2084
|
-
return;
|
|
2085
|
-
}
|
|
2086
|
-
this.detectionReentryCount++;
|
|
2087
|
-
return this.parseTokenizer(tokenizer, this.detectionReentryCount);
|
|
2088
|
-
}
|
|
2089
|
-
if (this.checkString("MP+")) {
|
|
2090
|
-
return {
|
|
2091
|
-
ext: "mpc",
|
|
2092
|
-
mime: "audio/x-musepack"
|
|
2093
|
-
};
|
|
2094
|
-
}
|
|
2095
|
-
if ((this.buffer[0] === 67 || this.buffer[0] === 70) && this.check([87, 83], { offset: 1 })) {
|
|
2096
|
-
return {
|
|
2097
|
-
ext: "swf",
|
|
2098
|
-
mime: "application/x-shockwave-flash"
|
|
2099
|
-
};
|
|
2100
|
-
}
|
|
2101
|
-
if (this.check([255, 216, 255])) {
|
|
2102
|
-
if (this.check([247], { offset: 3 })) {
|
|
2103
|
-
return {
|
|
2104
|
-
ext: "jls",
|
|
2105
|
-
mime: "image/jls"
|
|
2106
|
-
};
|
|
2107
|
-
}
|
|
2108
|
-
return {
|
|
2109
|
-
ext: "jpg",
|
|
2110
|
-
mime: "image/jpeg"
|
|
2111
|
-
};
|
|
2112
|
-
}
|
|
2113
|
-
if (this.check([79, 98, 106, 1])) {
|
|
2114
|
-
return {
|
|
2115
|
-
ext: "avro",
|
|
2116
|
-
mime: "application/avro"
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
|
-
if (this.checkString("FLIF")) {
|
|
2120
|
-
return {
|
|
2121
|
-
ext: "flif",
|
|
2122
|
-
mime: "image/flif"
|
|
2123
|
-
};
|
|
2124
|
-
}
|
|
2125
|
-
if (this.checkString("8BPS")) {
|
|
2126
|
-
return {
|
|
2127
|
-
ext: "psd",
|
|
2128
|
-
mime: "image/vnd.adobe.photoshop"
|
|
2129
|
-
};
|
|
2130
|
-
}
|
|
2131
|
-
if (this.checkString("MPCK")) {
|
|
2132
|
-
return {
|
|
2133
|
-
ext: "mpc",
|
|
2134
|
-
mime: "audio/x-musepack"
|
|
2135
|
-
};
|
|
2136
|
-
}
|
|
2137
|
-
if (this.checkString("FORM")) {
|
|
2138
|
-
return {
|
|
2139
|
-
ext: "aif",
|
|
2140
|
-
mime: "audio/aiff"
|
|
2141
|
-
};
|
|
2142
|
-
}
|
|
2143
|
-
if (this.checkString("icns", { offset: 0 })) {
|
|
2144
|
-
return {
|
|
2145
|
-
ext: "icns",
|
|
2146
|
-
mime: "image/icns"
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
if (this.check([80, 75, 3, 4])) {
|
|
2150
|
-
return detectZip(tokenizer);
|
|
2151
|
-
}
|
|
2152
|
-
if (this.checkString("OggS")) {
|
|
2153
|
-
await tokenizer.ignore(28);
|
|
2154
|
-
const type = new Uint8Array(8);
|
|
2155
|
-
await tokenizer.readBuffer(type);
|
|
2156
|
-
if (checkBytes(type, [79, 112, 117, 115, 72, 101, 97, 100])) {
|
|
2157
|
-
return {
|
|
2158
|
-
ext: "opus",
|
|
2159
|
-
mime: "audio/ogg; codecs=opus"
|
|
2160
|
-
};
|
|
2161
|
-
}
|
|
2162
|
-
if (checkBytes(type, [128, 116, 104, 101, 111, 114, 97])) {
|
|
2163
|
-
return {
|
|
2164
|
-
ext: "ogv",
|
|
2165
|
-
mime: "video/ogg"
|
|
2166
|
-
};
|
|
2167
|
-
}
|
|
2168
|
-
if (checkBytes(type, [1, 118, 105, 100, 101, 111, 0])) {
|
|
2169
|
-
return {
|
|
2170
|
-
ext: "ogm",
|
|
2171
|
-
mime: "video/ogg"
|
|
2172
|
-
};
|
|
2173
|
-
}
|
|
2174
|
-
if (checkBytes(type, [127, 70, 76, 65, 67])) {
|
|
2175
|
-
return {
|
|
2176
|
-
ext: "oga",
|
|
2177
|
-
mime: "audio/ogg"
|
|
2178
|
-
};
|
|
2179
|
-
}
|
|
2180
|
-
if (checkBytes(type, [83, 112, 101, 101, 120, 32, 32])) {
|
|
2181
|
-
return {
|
|
2182
|
-
ext: "spx",
|
|
2183
|
-
mime: "audio/ogg"
|
|
2184
|
-
};
|
|
2185
|
-
}
|
|
2186
|
-
if (checkBytes(type, [1, 118, 111, 114, 98, 105, 115])) {
|
|
2187
|
-
return {
|
|
2188
|
-
ext: "ogg",
|
|
2189
|
-
mime: "audio/ogg"
|
|
2190
|
-
};
|
|
2191
|
-
}
|
|
2192
|
-
return {
|
|
2193
|
-
ext: "ogx",
|
|
2194
|
-
mime: "application/ogg"
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
if (this.check([80, 75]) && (this.buffer[2] === 3 || this.buffer[2] === 5 || this.buffer[2] === 7) && (this.buffer[3] === 4 || this.buffer[3] === 6 || this.buffer[3] === 8)) {
|
|
2198
|
-
return {
|
|
2199
|
-
ext: "zip",
|
|
2200
|
-
mime: "application/zip"
|
|
2201
|
-
};
|
|
2202
|
-
}
|
|
2203
|
-
if (this.checkString("MThd")) {
|
|
2204
|
-
return {
|
|
2205
|
-
ext: "mid",
|
|
2206
|
-
mime: "audio/midi"
|
|
2207
|
-
};
|
|
2208
|
-
}
|
|
2209
|
-
if (this.checkString("wOFF") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 }))) {
|
|
2210
|
-
return {
|
|
2211
|
-
ext: "woff",
|
|
2212
|
-
mime: "font/woff"
|
|
2213
|
-
};
|
|
2214
|
-
}
|
|
2215
|
-
if (this.checkString("wOF2") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 }))) {
|
|
2216
|
-
return {
|
|
2217
|
-
ext: "woff2",
|
|
2218
|
-
mime: "font/woff2"
|
|
2219
|
-
};
|
|
2220
|
-
}
|
|
2221
|
-
if (this.check([212, 195, 178, 161]) || this.check([161, 178, 195, 212])) {
|
|
2222
|
-
return {
|
|
2223
|
-
ext: "pcap",
|
|
2224
|
-
mime: "application/vnd.tcpdump.pcap"
|
|
2225
|
-
};
|
|
2226
|
-
}
|
|
2227
|
-
if (this.checkString("DSD ")) {
|
|
2228
|
-
return {
|
|
2229
|
-
ext: "dsf",
|
|
2230
|
-
mime: "audio/x-dsf"
|
|
2231
|
-
// Non-standard
|
|
2232
|
-
};
|
|
2233
|
-
}
|
|
2234
|
-
if (this.checkString("LZIP")) {
|
|
2235
|
-
return {
|
|
2236
|
-
ext: "lz",
|
|
2237
|
-
mime: "application/lzip"
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
|
-
if (this.checkString("fLaC")) {
|
|
2241
|
-
return {
|
|
2242
|
-
ext: "flac",
|
|
2243
|
-
mime: "audio/flac"
|
|
2244
|
-
};
|
|
2245
|
-
}
|
|
2246
|
-
if (this.check([66, 80, 71, 251])) {
|
|
2247
|
-
return {
|
|
2248
|
-
ext: "bpg",
|
|
2249
|
-
mime: "image/bpg"
|
|
2250
|
-
};
|
|
2251
|
-
}
|
|
2252
|
-
if (this.checkString("wvpk")) {
|
|
2253
|
-
return {
|
|
2254
|
-
ext: "wv",
|
|
2255
|
-
mime: "audio/wavpack"
|
|
2256
|
-
};
|
|
2257
|
-
}
|
|
2258
|
-
if (this.checkString("%PDF")) {
|
|
2259
|
-
return {
|
|
2260
|
-
ext: "pdf",
|
|
2261
|
-
mime: "application/pdf"
|
|
2262
|
-
};
|
|
2263
|
-
}
|
|
2264
|
-
if (this.check([0, 97, 115, 109])) {
|
|
2265
|
-
return {
|
|
2266
|
-
ext: "wasm",
|
|
2267
|
-
mime: "application/wasm"
|
|
2268
|
-
};
|
|
2269
|
-
}
|
|
2270
|
-
if (this.check([73, 73])) {
|
|
2271
|
-
const fileType = await this.readTiffHeader(false);
|
|
2272
|
-
if (fileType) {
|
|
2273
|
-
return fileType;
|
|
2274
|
-
}
|
|
2275
|
-
}
|
|
2276
|
-
if (this.check([77, 77])) {
|
|
2277
|
-
const fileType = await this.readTiffHeader(true);
|
|
2278
|
-
if (fileType) {
|
|
2279
|
-
return fileType;
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
if (this.checkString("MAC ")) {
|
|
2283
|
-
return {
|
|
2284
|
-
ext: "ape",
|
|
2285
|
-
mime: "audio/ape"
|
|
2286
|
-
};
|
|
2287
|
-
}
|
|
2288
|
-
if (this.check([26, 69, 223, 163])) {
|
|
2289
|
-
return detectEbml(tokenizer);
|
|
2290
|
-
}
|
|
2291
|
-
if (this.checkString("SQLi")) {
|
|
2292
|
-
return {
|
|
2293
|
-
ext: "sqlite",
|
|
2294
|
-
mime: "application/x-sqlite3"
|
|
2295
|
-
};
|
|
2296
|
-
}
|
|
2297
|
-
if (this.check([78, 69, 83, 26])) {
|
|
2298
|
-
return {
|
|
2299
|
-
ext: "nes",
|
|
2300
|
-
mime: "application/x-nintendo-nes-rom"
|
|
2301
|
-
};
|
|
2302
|
-
}
|
|
2303
|
-
if (this.checkString("Cr24")) {
|
|
2304
|
-
return {
|
|
2305
|
-
ext: "crx",
|
|
2306
|
-
mime: "application/x-google-chrome-extension"
|
|
2307
|
-
};
|
|
2308
|
-
}
|
|
2309
|
-
if (this.checkString("MSCF") || this.checkString("ISc(")) {
|
|
2310
|
-
return {
|
|
2311
|
-
ext: "cab",
|
|
2312
|
-
mime: "application/vnd.ms-cab-compressed"
|
|
2313
|
-
};
|
|
2314
|
-
}
|
|
2315
|
-
if (this.check([237, 171, 238, 219])) {
|
|
2316
|
-
return {
|
|
2317
|
-
ext: "rpm",
|
|
2318
|
-
mime: "application/x-rpm"
|
|
2319
|
-
};
|
|
2320
|
-
}
|
|
2321
|
-
if (this.check([197, 208, 211, 198])) {
|
|
2322
|
-
return {
|
|
2323
|
-
ext: "eps",
|
|
2324
|
-
mime: "application/eps"
|
|
2325
|
-
};
|
|
2326
|
-
}
|
|
2327
|
-
if (this.check([40, 181, 47, 253])) {
|
|
2328
|
-
return {
|
|
2329
|
-
ext: "zst",
|
|
2330
|
-
mime: "application/zstd"
|
|
2331
|
-
};
|
|
2332
|
-
}
|
|
2333
|
-
if (this.check([127, 69, 76, 70])) {
|
|
2334
|
-
return {
|
|
2335
|
-
ext: "elf",
|
|
2336
|
-
mime: "application/x-elf"
|
|
2337
|
-
};
|
|
2338
|
-
}
|
|
2339
|
-
if (this.check([33, 66, 68, 78])) {
|
|
2340
|
-
return {
|
|
2341
|
-
ext: "pst",
|
|
2342
|
-
mime: "application/vnd.ms-outlook"
|
|
2343
|
-
};
|
|
2344
|
-
}
|
|
2345
|
-
if (this.checkString("PAR1") || this.checkString("PARE")) {
|
|
2346
|
-
return {
|
|
2347
|
-
ext: "parquet",
|
|
2348
|
-
mime: "application/vnd.apache.parquet"
|
|
2349
|
-
};
|
|
2350
|
-
}
|
|
2351
|
-
if (this.checkString("ttcf")) {
|
|
2352
|
-
return {
|
|
2353
|
-
ext: "ttc",
|
|
2354
|
-
mime: "font/collection"
|
|
2355
|
-
};
|
|
2356
|
-
}
|
|
2357
|
-
if (this.check([254, 237, 250, 206]) || this.check([254, 237, 250, 207]) || this.check([206, 250, 237, 254]) || this.check([207, 250, 237, 254])) {
|
|
2358
|
-
return {
|
|
2359
|
-
ext: "macho",
|
|
2360
|
-
mime: "application/x-mach-binary"
|
|
2361
|
-
};
|
|
2362
|
-
}
|
|
2363
|
-
if (this.check([4, 34, 77, 24])) {
|
|
2364
|
-
return {
|
|
2365
|
-
ext: "lz4",
|
|
2366
|
-
mime: "application/x-lz4"
|
|
2367
|
-
// Informal, used by freedesktop.org shared-mime-info
|
|
2368
|
-
};
|
|
2369
|
-
}
|
|
2370
|
-
if (this.checkString("regf")) {
|
|
2371
|
-
return {
|
|
2372
|
-
ext: "dat",
|
|
2373
|
-
mime: "application/x-ft-windows-registry-hive"
|
|
2374
|
-
};
|
|
2375
|
-
}
|
|
2376
|
-
if (this.checkString("$FL2") || this.checkString("$FL3")) {
|
|
2377
|
-
return {
|
|
2378
|
-
ext: "sav",
|
|
2379
|
-
mime: "application/x-spss-sav"
|
|
2380
|
-
};
|
|
2381
|
-
}
|
|
2382
|
-
if (this.check([79, 84, 84, 79, 0])) {
|
|
2383
|
-
return {
|
|
2384
|
-
ext: "otf",
|
|
2385
|
-
mime: "font/otf"
|
|
2386
|
-
};
|
|
2387
|
-
}
|
|
2388
|
-
if (this.checkString("#!AMR")) {
|
|
2389
|
-
return {
|
|
2390
|
-
ext: "amr",
|
|
2391
|
-
mime: "audio/amr"
|
|
2392
|
-
};
|
|
2393
|
-
}
|
|
2394
|
-
if (this.checkString(String.raw`{\rtf`)) {
|
|
2395
|
-
return {
|
|
2396
|
-
ext: "rtf",
|
|
2397
|
-
mime: "application/rtf"
|
|
2398
|
-
};
|
|
2399
|
-
}
|
|
2400
|
-
if (this.check([70, 76, 86, 1])) {
|
|
2401
|
-
return {
|
|
2402
|
-
ext: "flv",
|
|
2403
|
-
mime: "video/x-flv"
|
|
2404
|
-
};
|
|
2405
|
-
}
|
|
2406
|
-
if (this.checkString("IMPM")) {
|
|
2407
|
-
return {
|
|
2408
|
-
ext: "it",
|
|
2409
|
-
mime: "audio/x-it"
|
|
2410
|
-
};
|
|
2411
|
-
}
|
|
2412
|
-
if (this.checkString("-lh0-", { offset: 2 }) || this.checkString("-lh1-", { offset: 2 }) || this.checkString("-lh2-", { offset: 2 }) || this.checkString("-lh3-", { offset: 2 }) || this.checkString("-lh4-", { offset: 2 }) || this.checkString("-lh5-", { offset: 2 }) || this.checkString("-lh6-", { offset: 2 }) || this.checkString("-lh7-", { offset: 2 }) || this.checkString("-lzs-", { offset: 2 }) || this.checkString("-lz4-", { offset: 2 }) || this.checkString("-lz5-", { offset: 2 }) || this.checkString("-lhd-", { offset: 2 })) {
|
|
2413
|
-
return {
|
|
2414
|
-
ext: "lzh",
|
|
2415
|
-
mime: "application/x-lzh-compressed"
|
|
2416
|
-
};
|
|
2417
|
-
}
|
|
2418
|
-
if (this.check([0, 0, 1, 186])) {
|
|
2419
|
-
if (this.check([33], { offset: 4, mask: [241] })) {
|
|
2420
|
-
return {
|
|
2421
|
-
ext: "mpg",
|
|
2422
|
-
// May also be .ps, .mpeg
|
|
2423
|
-
mime: "video/MP1S"
|
|
2424
|
-
};
|
|
2425
|
-
}
|
|
2426
|
-
if (this.check([68], { offset: 4, mask: [196] })) {
|
|
2427
|
-
return {
|
|
2428
|
-
ext: "mpg",
|
|
2429
|
-
// May also be .mpg, .m2p, .vob or .sub
|
|
2430
|
-
mime: "video/MP2P"
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
if (this.checkString("ITSF")) {
|
|
2435
|
-
return {
|
|
2436
|
-
ext: "chm",
|
|
2437
|
-
mime: "application/vnd.ms-htmlhelp"
|
|
2438
|
-
};
|
|
2439
|
-
}
|
|
2440
|
-
if (this.check([202, 254, 186, 190])) {
|
|
2441
|
-
const machOArchitectureCount = UINT32_BE.get(this.buffer, 4);
|
|
2442
|
-
const javaClassFileMajorVersion = UINT16_BE.get(this.buffer, 6);
|
|
2443
|
-
if (machOArchitectureCount > 0 && machOArchitectureCount <= 30) {
|
|
2444
|
-
return {
|
|
2445
|
-
ext: "macho",
|
|
2446
|
-
mime: "application/x-mach-binary"
|
|
2447
|
-
};
|
|
2448
|
-
}
|
|
2449
|
-
if (javaClassFileMajorVersion > 30) {
|
|
2450
|
-
return {
|
|
2451
|
-
ext: "class",
|
|
2452
|
-
mime: "application/java-vm"
|
|
2453
|
-
};
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
if (this.checkString(".RMF")) {
|
|
2457
|
-
return {
|
|
2458
|
-
ext: "rm",
|
|
2459
|
-
mime: "application/vnd.rn-realmedia"
|
|
2460
|
-
};
|
|
2461
|
-
}
|
|
2462
|
-
if (this.checkString("DRACO")) {
|
|
2463
|
-
return {
|
|
2464
|
-
ext: "drc",
|
|
2465
|
-
mime: "application/x-ft-draco"
|
|
2466
|
-
};
|
|
2467
|
-
}
|
|
2468
|
-
if (this.check([253, 55, 122, 88, 90, 0])) {
|
|
2469
|
-
return {
|
|
2470
|
-
ext: "xz",
|
|
2471
|
-
mime: "application/x-xz"
|
|
2472
|
-
};
|
|
2473
|
-
}
|
|
2474
|
-
if (this.checkString("<?xml ")) {
|
|
2475
|
-
return {
|
|
2476
|
-
ext: "xml",
|
|
2477
|
-
mime: "application/xml"
|
|
2478
|
-
};
|
|
2479
|
-
}
|
|
2480
|
-
if (this.check([55, 122, 188, 175, 39, 28])) {
|
|
2481
|
-
return {
|
|
2482
|
-
ext: "7z",
|
|
2483
|
-
mime: "application/x-7z-compressed"
|
|
2484
|
-
};
|
|
2485
|
-
}
|
|
2486
|
-
if (this.check([82, 97, 114, 33, 26, 7]) && (this.buffer[6] === 0 || this.buffer[6] === 1)) {
|
|
2487
|
-
return {
|
|
2488
|
-
ext: "rar",
|
|
2489
|
-
mime: "application/x-rar-compressed"
|
|
2490
|
-
};
|
|
2491
|
-
}
|
|
2492
|
-
if (this.checkString("solid ")) {
|
|
2493
|
-
return {
|
|
2494
|
-
ext: "stl",
|
|
2495
|
-
mime: "model/stl"
|
|
2496
|
-
};
|
|
2497
|
-
}
|
|
2498
|
-
if (this.checkString("AC")) {
|
|
2499
|
-
const version = new StringType(4, "latin1").get(this.buffer, 2);
|
|
2500
|
-
if (new RegExp("^\\d+$", "v").test(version) && version >= 1e3 && version <= 1050) {
|
|
2501
|
-
return {
|
|
2502
|
-
ext: "dwg",
|
|
2503
|
-
mime: "image/vnd.dwg"
|
|
2504
|
-
};
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
if (this.checkString("070707")) {
|
|
2508
|
-
return {
|
|
2509
|
-
ext: "cpio",
|
|
2510
|
-
mime: "application/x-cpio"
|
|
2511
|
-
};
|
|
2512
|
-
}
|
|
2513
|
-
if (this.checkString("BLENDER")) {
|
|
2514
|
-
return {
|
|
2515
|
-
ext: "blend",
|
|
2516
|
-
mime: "application/x-blender"
|
|
2517
|
-
};
|
|
2518
|
-
}
|
|
2519
|
-
if (this.checkString("!<arch>")) {
|
|
2520
|
-
await tokenizer.ignore(8);
|
|
2521
|
-
const string = await tokenizer.readToken(new StringType(13, "ascii"));
|
|
2522
|
-
if (string === "debian-binary") {
|
|
2523
|
-
return {
|
|
2524
|
-
ext: "deb",
|
|
2525
|
-
mime: "application/x-deb"
|
|
2526
|
-
};
|
|
2527
|
-
}
|
|
2528
|
-
return {
|
|
2529
|
-
ext: "ar",
|
|
2530
|
-
mime: "application/x-unix-archive"
|
|
2531
|
-
};
|
|
2532
|
-
}
|
|
2533
|
-
if (this.checkString("WEBVTT") && // One of LF, CR, tab, space, or end of file must follow "WEBVTT" per the spec (see `fixture/fixture-vtt-*.vtt` for examples). Note that `\0` is technically the null character (there is no such thing as an EOF character). However, checking for `\0` gives us the same result as checking for the end of the stream.
|
|
2534
|
-
["\n", "\r", " ", " ", "\0"].some((char7) => this.checkString(char7, { offset: 6 }))) {
|
|
2535
|
-
return {
|
|
2536
|
-
ext: "vtt",
|
|
2537
|
-
mime: "text/vtt"
|
|
2538
|
-
};
|
|
2539
|
-
}
|
|
2540
|
-
if (this.check([137, 80, 78, 71, 13, 10, 26, 10])) {
|
|
2541
|
-
return detectPng(tokenizer);
|
|
2542
|
-
}
|
|
2543
|
-
if (this.check([65, 82, 82, 79, 87, 49, 0, 0])) {
|
|
2544
|
-
return {
|
|
2545
|
-
ext: "arrow",
|
|
2546
|
-
mime: "application/vnd.apache.arrow.file"
|
|
2547
|
-
};
|
|
2548
|
-
}
|
|
2549
|
-
if (this.check([103, 108, 84, 70, 2, 0, 0, 0])) {
|
|
2550
|
-
return {
|
|
2551
|
-
ext: "glb",
|
|
2552
|
-
mime: "model/gltf-binary"
|
|
2553
|
-
};
|
|
2554
|
-
}
|
|
2555
|
-
if (this.check([102, 114, 101, 101], { offset: 4 }) || this.check([109, 100, 97, 116], { offset: 4 }) || this.check([109, 111, 111, 118], { offset: 4 }) || this.check([119, 105, 100, 101], { offset: 4 })) {
|
|
2556
|
-
return {
|
|
2557
|
-
ext: "mov",
|
|
2558
|
-
mime: "video/quicktime"
|
|
2559
|
-
};
|
|
2560
|
-
}
|
|
2561
|
-
if (this.check([73, 73, 82, 79, 8, 0, 0, 0, 24])) {
|
|
2562
|
-
return {
|
|
2563
|
-
ext: "orf",
|
|
2564
|
-
mime: "image/x-olympus-orf"
|
|
2565
|
-
};
|
|
2566
|
-
}
|
|
2567
|
-
if (this.checkString("gimp xcf ")) {
|
|
2568
|
-
return {
|
|
2569
|
-
ext: "xcf",
|
|
2570
|
-
mime: "image/x-xcf"
|
|
2571
|
-
};
|
|
2572
|
-
}
|
|
2573
|
-
if (this.checkString("ftyp", { offset: 4 }) && (this.buffer[8] & 96) !== 0) {
|
|
2574
|
-
const brandMajor = new StringType(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim();
|
|
2575
|
-
switch (brandMajor) {
|
|
2576
|
-
case "avif":
|
|
2577
|
-
case "avis":
|
|
2578
|
-
return { ext: "avif", mime: "image/avif" };
|
|
2579
|
-
case "mif1":
|
|
2580
|
-
return { ext: "heic", mime: "image/heif" };
|
|
2581
|
-
case "msf1":
|
|
2582
|
-
return { ext: "heic", mime: "image/heif-sequence" };
|
|
2583
|
-
case "heic":
|
|
2584
|
-
case "heix":
|
|
2585
|
-
return { ext: "heic", mime: "image/heic" };
|
|
2586
|
-
case "hevc":
|
|
2587
|
-
case "hevx":
|
|
2588
|
-
return { ext: "heic", mime: "image/heic-sequence" };
|
|
2589
|
-
case "qt":
|
|
2590
|
-
return { ext: "mov", mime: "video/quicktime" };
|
|
2591
|
-
case "M4V":
|
|
2592
|
-
case "M4VH":
|
|
2593
|
-
case "M4VP":
|
|
2594
|
-
return { ext: "m4v", mime: "video/x-m4v" };
|
|
2595
|
-
case "M4P":
|
|
2596
|
-
return { ext: "m4p", mime: "video/mp4" };
|
|
2597
|
-
case "M4B":
|
|
2598
|
-
return { ext: "m4b", mime: "audio/mp4" };
|
|
2599
|
-
case "M4A":
|
|
2600
|
-
return { ext: "m4a", mime: "audio/x-m4a" };
|
|
2601
|
-
case "F4V":
|
|
2602
|
-
return { ext: "f4v", mime: "video/mp4" };
|
|
2603
|
-
case "F4P":
|
|
2604
|
-
return { ext: "f4p", mime: "video/mp4" };
|
|
2605
|
-
case "F4A":
|
|
2606
|
-
return { ext: "f4a", mime: "audio/mp4" };
|
|
2607
|
-
case "F4B":
|
|
2608
|
-
return { ext: "f4b", mime: "audio/mp4" };
|
|
2609
|
-
case "crx":
|
|
2610
|
-
return { ext: "cr3", mime: "image/x-canon-cr3" };
|
|
2611
|
-
default:
|
|
2612
|
-
if (brandMajor.startsWith("3g")) {
|
|
2613
|
-
if (brandMajor.startsWith("3g2")) {
|
|
2614
|
-
return { ext: "3g2", mime: "video/3gpp2" };
|
|
2615
|
-
}
|
|
2616
|
-
return { ext: "3gp", mime: "video/3gpp" };
|
|
2617
|
-
}
|
|
2618
|
-
return { ext: "mp4", mime: "video/mp4" };
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2621
|
-
if (this.checkString("REGEDIT4\r\n")) {
|
|
2622
|
-
return {
|
|
2623
|
-
ext: "reg",
|
|
2624
|
-
mime: "application/x-ms-regedit"
|
|
2625
|
-
};
|
|
2626
|
-
}
|
|
2627
|
-
if (this.check([82, 73, 70, 70])) {
|
|
2628
|
-
if (this.checkString("WEBP", { offset: 8 })) {
|
|
2629
|
-
return {
|
|
2630
|
-
ext: "webp",
|
|
2631
|
-
mime: "image/webp"
|
|
2632
|
-
};
|
|
2633
|
-
}
|
|
2634
|
-
if (this.check([65, 86, 73], { offset: 8 })) {
|
|
2635
|
-
return {
|
|
2636
|
-
ext: "avi",
|
|
2637
|
-
mime: "video/vnd.avi"
|
|
2638
|
-
};
|
|
2639
|
-
}
|
|
2640
|
-
if (this.check([87, 65, 86, 69], { offset: 8 })) {
|
|
2641
|
-
return {
|
|
2642
|
-
ext: "wav",
|
|
2643
|
-
mime: "audio/wav"
|
|
2644
|
-
};
|
|
2645
|
-
}
|
|
2646
|
-
if (this.check([81, 76, 67, 77], { offset: 8 })) {
|
|
2647
|
-
return {
|
|
2648
|
-
ext: "qcp",
|
|
2649
|
-
mime: "audio/qcelp"
|
|
2650
|
-
};
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
if (this.check([73, 73, 85, 0, 24, 0, 0, 0, 136, 231, 116, 216])) {
|
|
2654
|
-
return {
|
|
2655
|
-
ext: "rw2",
|
|
2656
|
-
mime: "image/x-panasonic-rw2"
|
|
2657
|
-
};
|
|
2658
|
-
}
|
|
2659
|
-
if (this.check([48, 38, 178, 117, 142, 102, 207, 17, 166, 217])) {
|
|
2660
|
-
return detectAsf(tokenizer);
|
|
2661
|
-
}
|
|
2662
|
-
if (this.check([171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10])) {
|
|
2663
|
-
return {
|
|
2664
|
-
ext: "ktx",
|
|
2665
|
-
mime: "image/ktx"
|
|
2666
|
-
};
|
|
2667
|
-
}
|
|
2668
|
-
if ((this.check([126, 16, 4]) || this.check([126, 24, 4])) && this.check([48, 77, 73, 69], { offset: 4 })) {
|
|
2669
|
-
return {
|
|
2670
|
-
ext: "mie",
|
|
2671
|
-
mime: "application/x-mie"
|
|
2672
|
-
};
|
|
2673
|
-
}
|
|
2674
|
-
if (this.check([39, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], { offset: 2 })) {
|
|
2675
|
-
return {
|
|
2676
|
-
ext: "shp",
|
|
2677
|
-
mime: "application/x-esri-shape"
|
|
2678
|
-
};
|
|
2679
|
-
}
|
|
2680
|
-
if (this.check([255, 79, 255, 81])) {
|
|
2681
|
-
return {
|
|
2682
|
-
ext: "j2c",
|
|
2683
|
-
mime: "image/j2c"
|
|
2684
|
-
};
|
|
2685
|
-
}
|
|
2686
|
-
if (this.check([0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10])) {
|
|
2687
|
-
await tokenizer.ignore(20);
|
|
2688
|
-
const type = await tokenizer.readToken(new StringType(4, "ascii"));
|
|
2689
|
-
switch (type) {
|
|
2690
|
-
case "jp2 ":
|
|
2691
|
-
return {
|
|
2692
|
-
ext: "jp2",
|
|
2693
|
-
mime: "image/jp2"
|
|
2694
|
-
};
|
|
2695
|
-
case "jpx ":
|
|
2696
|
-
return {
|
|
2697
|
-
ext: "jpx",
|
|
2698
|
-
mime: "image/jpx"
|
|
2699
|
-
};
|
|
2700
|
-
case "jpm ":
|
|
2701
|
-
return {
|
|
2702
|
-
ext: "jpm",
|
|
2703
|
-
mime: "image/jpm"
|
|
2704
|
-
};
|
|
2705
|
-
case "mjp2":
|
|
2706
|
-
return {
|
|
2707
|
-
ext: "mj2",
|
|
2708
|
-
mime: "image/mj2"
|
|
2709
|
-
};
|
|
2710
|
-
default:
|
|
2711
|
-
return;
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
if (this.check([255, 10]) || this.check([0, 0, 0, 12, 74, 88, 76, 32, 13, 10, 135, 10])) {
|
|
2715
|
-
return {
|
|
2716
|
-
ext: "jxl",
|
|
2717
|
-
mime: "image/jxl"
|
|
2718
|
-
};
|
|
2719
|
-
}
|
|
2720
|
-
if (this.check([254, 255])) {
|
|
2721
|
-
if (this.checkString("<?xml ", { offset: 2, encoding: "utf-16be" })) {
|
|
2722
|
-
return {
|
|
2723
|
-
ext: "xml",
|
|
2724
|
-
mime: "application/xml"
|
|
2725
|
-
};
|
|
2726
|
-
}
|
|
2727
|
-
return void 0;
|
|
2728
|
-
}
|
|
2729
|
-
if (this.check([208, 207, 17, 224, 161, 177, 26, 225])) {
|
|
2730
|
-
return {
|
|
2731
|
-
ext: "cfb",
|
|
2732
|
-
mime: "application/x-cfb"
|
|
2733
|
-
};
|
|
2734
|
-
}
|
|
2735
|
-
await tokenizer.peekBuffer(this.buffer, { length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true });
|
|
2736
|
-
if (this.check([97, 99, 115, 112], { offset: 36 })) {
|
|
2737
|
-
return {
|
|
2738
|
-
ext: "icc",
|
|
2739
|
-
mime: "application/vnd.iccprofile"
|
|
2740
|
-
};
|
|
2741
|
-
}
|
|
2742
|
-
if (this.checkString("**ACE", { offset: 7 }) && this.checkString("**", { offset: 12 })) {
|
|
2743
|
-
return {
|
|
2744
|
-
ext: "ace",
|
|
2745
|
-
mime: "application/x-ace-compressed"
|
|
2746
|
-
};
|
|
2747
|
-
}
|
|
2748
|
-
if (this.checkString("BEGIN:")) {
|
|
2749
|
-
if (this.checkString("VCARD", { offset: 6 })) {
|
|
2750
|
-
return {
|
|
2751
|
-
ext: "vcf",
|
|
2752
|
-
mime: "text/vcard"
|
|
2753
|
-
};
|
|
2754
|
-
}
|
|
2755
|
-
if (this.checkString("VCALENDAR", { offset: 6 })) {
|
|
2756
|
-
return {
|
|
2757
|
-
ext: "ics",
|
|
2758
|
-
mime: "text/calendar"
|
|
2759
|
-
};
|
|
2760
|
-
}
|
|
2761
|
-
}
|
|
2762
|
-
if (this.checkString("FUJIFILMCCD-RAW")) {
|
|
2763
|
-
return {
|
|
2764
|
-
ext: "raf",
|
|
2765
|
-
mime: "image/x-fujifilm-raf"
|
|
2766
|
-
};
|
|
2767
|
-
}
|
|
2768
|
-
if (this.checkString("Extended Module:")) {
|
|
2769
|
-
return {
|
|
2770
|
-
ext: "xm",
|
|
2771
|
-
mime: "audio/x-xm"
|
|
2772
|
-
};
|
|
2773
|
-
}
|
|
2774
|
-
if (this.checkString("Creative Voice File")) {
|
|
2775
|
-
return {
|
|
2776
|
-
ext: "voc",
|
|
2777
|
-
mime: "audio/x-voc"
|
|
2778
|
-
};
|
|
2779
|
-
}
|
|
2780
|
-
if (this.check([4, 0, 0, 0]) && this.buffer.length >= 16) {
|
|
2781
|
-
const jsonSize = new DataView(this.buffer.buffer).getUint32(12, true);
|
|
2782
|
-
if (jsonSize > 12 && this.buffer.length >= jsonSize + 16) {
|
|
2783
|
-
try {
|
|
2784
|
-
const header = new TextDecoder().decode(this.buffer.subarray(16, jsonSize + 16));
|
|
2785
|
-
const json = JSON.parse(header);
|
|
2786
|
-
if (json.files) {
|
|
2787
|
-
return {
|
|
2788
|
-
ext: "asar",
|
|
2789
|
-
mime: "application/x-asar"
|
|
2790
|
-
};
|
|
2791
|
-
}
|
|
2792
|
-
} catch {
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
if (this.check([6, 14, 43, 52, 2, 5, 1, 1, 13, 1, 2, 1, 1, 2])) {
|
|
2797
|
-
return {
|
|
2798
|
-
ext: "mxf",
|
|
2799
|
-
mime: "application/mxf"
|
|
2800
|
-
};
|
|
2801
|
-
}
|
|
2802
|
-
if (this.checkString("SCRM", { offset: 44 })) {
|
|
2803
|
-
return {
|
|
2804
|
-
ext: "s3m",
|
|
2805
|
-
mime: "audio/x-s3m"
|
|
2806
|
-
};
|
|
2807
|
-
}
|
|
2808
|
-
if (this.check([71]) && this.check([71], { offset: 188 })) {
|
|
2809
|
-
return {
|
|
2810
|
-
ext: "mts",
|
|
2811
|
-
mime: "video/mp2t"
|
|
2812
|
-
};
|
|
2813
|
-
}
|
|
2814
|
-
if (this.check([71], { offset: 4 }) && this.check([71], { offset: 196 })) {
|
|
2815
|
-
return {
|
|
2816
|
-
ext: "mts",
|
|
2817
|
-
mime: "video/mp2t"
|
|
2818
|
-
};
|
|
2819
|
-
}
|
|
2820
|
-
if (this.check([66, 79, 79, 75, 77, 79, 66, 73], { offset: 60 })) {
|
|
2821
|
-
return {
|
|
2822
|
-
ext: "mobi",
|
|
2823
|
-
mime: "application/x-mobipocket-ebook"
|
|
2824
|
-
};
|
|
2825
|
-
}
|
|
2826
|
-
if (this.check([68, 73, 67, 77], { offset: 128 })) {
|
|
2827
|
-
return {
|
|
2828
|
-
ext: "dcm",
|
|
2829
|
-
mime: "application/dicom"
|
|
2830
|
-
};
|
|
2831
|
-
}
|
|
2832
|
-
if (this.check([76, 0, 0, 0, 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70])) {
|
|
2833
|
-
return {
|
|
2834
|
-
ext: "lnk",
|
|
2835
|
-
mime: "application/x-ms-shortcut"
|
|
2836
|
-
// Informal, used by freedesktop.org shared-mime-info
|
|
2837
|
-
};
|
|
2838
|
-
}
|
|
2839
|
-
if (this.check([98, 111, 111, 107, 0, 0, 0, 0, 109, 97, 114, 107, 0, 0, 0, 0])) {
|
|
2840
|
-
return {
|
|
2841
|
-
ext: "alias",
|
|
2842
|
-
mime: "application/x-ft-apple.alias"
|
|
2843
|
-
};
|
|
2844
|
-
}
|
|
2845
|
-
if (this.checkString("Kaydara FBX Binary \0")) {
|
|
2846
|
-
return {
|
|
2847
|
-
ext: "fbx",
|
|
2848
|
-
mime: "application/x-ft-fbx"
|
|
2849
|
-
};
|
|
2850
|
-
}
|
|
2851
|
-
if (this.check([76, 80], { offset: 34 }) && (this.check([0, 0, 1], { offset: 8 }) || this.check([1, 0, 2], { offset: 8 }) || this.check([2, 0, 2], { offset: 8 }))) {
|
|
2852
|
-
return {
|
|
2853
|
-
ext: "eot",
|
|
2854
|
-
mime: "application/vnd.ms-fontobject"
|
|
2855
|
-
};
|
|
2856
|
-
}
|
|
2857
|
-
if (this.check([6, 6, 237, 245, 216, 29, 70, 229, 189, 49, 239, 231, 254, 116, 183, 29])) {
|
|
2858
|
-
return {
|
|
2859
|
-
ext: "indd",
|
|
2860
|
-
mime: "application/x-indesign"
|
|
2861
|
-
};
|
|
2862
|
-
}
|
|
2863
|
-
if (this.check([255, 255, 0, 0, 7, 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 0]) || this.check([0, 0, 255, 255, 0, 0, 0, 7, 0, 0, 0, 4, 0, 1, 0, 1])) {
|
|
2864
|
-
return {
|
|
2865
|
-
ext: "jmp",
|
|
2866
|
-
mime: "application/x-jmp-data"
|
|
2867
|
-
};
|
|
2868
|
-
}
|
|
2869
|
-
await tokenizer.peekBuffer(this.buffer, { length: Math.min(512, tokenizer.fileInfo.size), mayBeLess: true });
|
|
2870
|
-
if (this.checkString("ustar", { offset: 257 }) && (this.checkString("\0", { offset: 262 }) || this.checkString(" ", { offset: 262 })) || this.check([0, 0, 0, 0, 0, 0], { offset: 257 }) && tarHeaderChecksumMatches(this.buffer)) {
|
|
2871
|
-
return {
|
|
2872
|
-
ext: "tar",
|
|
2873
|
-
mime: "application/x-tar"
|
|
2874
|
-
};
|
|
2875
|
-
}
|
|
2876
|
-
if (this.check([255, 254])) {
|
|
2877
|
-
const encoding = "utf-16le";
|
|
2878
|
-
if (this.checkString("<?xml ", { offset: 2, encoding })) {
|
|
2879
|
-
return {
|
|
2880
|
-
ext: "xml",
|
|
2881
|
-
mime: "application/xml"
|
|
2882
|
-
};
|
|
2883
|
-
}
|
|
2884
|
-
if (this.check([255, 14], { offset: 2 }) && this.checkString("SketchUp Model", { offset: 4, encoding })) {
|
|
2885
|
-
return {
|
|
2886
|
-
ext: "skp",
|
|
2887
|
-
mime: "application/vnd.sketchup.skp"
|
|
2888
|
-
};
|
|
2889
|
-
}
|
|
2890
|
-
if (this.checkString("Windows Registry Editor Version 5.00\r\n", { offset: 2, encoding })) {
|
|
2891
|
-
return {
|
|
2892
|
-
ext: "reg",
|
|
2893
|
-
mime: "application/x-ms-regedit"
|
|
2894
|
-
};
|
|
2895
|
-
}
|
|
2896
|
-
return void 0;
|
|
2897
|
-
}
|
|
2898
|
-
if (this.checkString("-----BEGIN PGP MESSAGE-----")) {
|
|
2899
|
-
return {
|
|
2900
|
-
ext: "pgp",
|
|
2901
|
-
mime: "application/pgp-encrypted"
|
|
2902
|
-
};
|
|
2903
|
-
}
|
|
2904
|
-
};
|
|
2905
|
-
// Detections with limited supporting data, resulting in a higher likelihood of false positives
|
|
2906
|
-
detectImprecise = async (tokenizer) => {
|
|
2907
|
-
this.buffer = new Uint8Array(reasonableDetectionSizeInBytes);
|
|
2908
|
-
const fileSize = getKnownFileSizeOrMaximum(tokenizer.fileInfo.size);
|
|
2909
|
-
await tokenizer.peekBuffer(this.buffer, { length: Math.min(8, fileSize), mayBeLess: true });
|
|
2910
|
-
if (this.check([0, 0, 1, 186]) || this.check([0, 0, 1, 179])) {
|
|
2911
|
-
return {
|
|
2912
|
-
ext: "mpg",
|
|
2913
|
-
mime: "video/mpeg"
|
|
2914
|
-
};
|
|
2915
|
-
}
|
|
2916
|
-
if (this.check([0, 1, 0, 0, 0])) {
|
|
2917
|
-
return {
|
|
2918
|
-
ext: "ttf",
|
|
2919
|
-
mime: "font/ttf"
|
|
2920
|
-
};
|
|
2921
|
-
}
|
|
2922
|
-
if (this.check([0, 0, 1, 0])) {
|
|
2923
|
-
return {
|
|
2924
|
-
ext: "ico",
|
|
2925
|
-
mime: "image/x-icon"
|
|
2926
|
-
};
|
|
2927
|
-
}
|
|
2928
|
-
if (this.check([0, 0, 2, 0])) {
|
|
2929
|
-
return {
|
|
2930
|
-
ext: "cur",
|
|
2931
|
-
mime: "image/x-icon"
|
|
2932
|
-
};
|
|
2933
|
-
}
|
|
2934
|
-
await tokenizer.peekBuffer(this.buffer, { length: Math.min(2 + this.options.mpegOffsetTolerance, fileSize), mayBeLess: true });
|
|
2935
|
-
if (this.buffer.length >= 2 + this.options.mpegOffsetTolerance) {
|
|
2936
|
-
for (let depth = 0; depth <= this.options.mpegOffsetTolerance; ++depth) {
|
|
2937
|
-
const type = this.scanMpeg(depth);
|
|
2938
|
-
if (type) {
|
|
2939
|
-
return type;
|
|
2940
|
-
}
|
|
2941
|
-
}
|
|
2942
|
-
}
|
|
2943
|
-
};
|
|
2944
|
-
async readTiffTag(bigEndian) {
|
|
2945
|
-
const tagId = await this.tokenizer.readToken(bigEndian ? UINT16_BE : UINT16_LE);
|
|
2946
|
-
await this.tokenizer.ignore(10);
|
|
2947
|
-
switch (tagId) {
|
|
2948
|
-
case 50341:
|
|
2949
|
-
return {
|
|
2950
|
-
ext: "arw",
|
|
2951
|
-
mime: "image/x-sony-arw"
|
|
2952
|
-
};
|
|
2953
|
-
case 50706:
|
|
2954
|
-
return {
|
|
2955
|
-
ext: "dng",
|
|
2956
|
-
mime: "image/x-adobe-dng"
|
|
2957
|
-
};
|
|
2958
|
-
default:
|
|
2959
|
-
}
|
|
2960
|
-
}
|
|
2961
|
-
async readTiffIFD(bigEndian) {
|
|
2962
|
-
const numberOfTags = await this.tokenizer.readToken(bigEndian ? UINT16_BE : UINT16_LE);
|
|
2963
|
-
if (numberOfTags > maximumTiffTagCount) {
|
|
2964
|
-
return;
|
|
2965
|
-
}
|
|
2966
|
-
if (hasUnknownFileSize(this.tokenizer) && 2 + numberOfTags * 12 > maximumTiffIfdOffsetInBytes) {
|
|
2967
|
-
return;
|
|
2968
|
-
}
|
|
2969
|
-
for (let n = 0; n < numberOfTags; ++n) {
|
|
2970
|
-
const fileType = await this.readTiffTag(bigEndian);
|
|
2971
|
-
if (fileType) {
|
|
2972
|
-
return fileType;
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
}
|
|
2976
|
-
async readTiffHeader(bigEndian) {
|
|
2977
|
-
const tiffFileType = {
|
|
2978
|
-
ext: "tif",
|
|
2979
|
-
mime: "image/tiff"
|
|
2980
|
-
};
|
|
2981
|
-
const version = (bigEndian ? UINT16_BE : UINT16_LE).get(this.buffer, 2);
|
|
2982
|
-
const ifdOffset = (bigEndian ? UINT32_BE : UINT32_LE).get(this.buffer, 4);
|
|
2983
|
-
if (version === 42) {
|
|
2984
|
-
if (ifdOffset >= 6) {
|
|
2985
|
-
if (this.checkString("CR", { offset: 8 })) {
|
|
2986
|
-
return {
|
|
2987
|
-
ext: "cr2",
|
|
2988
|
-
mime: "image/x-canon-cr2"
|
|
2989
|
-
};
|
|
2990
|
-
}
|
|
2991
|
-
if (ifdOffset >= 8) {
|
|
2992
|
-
const someId1 = (bigEndian ? UINT16_BE : UINT16_LE).get(this.buffer, 8);
|
|
2993
|
-
const someId2 = (bigEndian ? UINT16_BE : UINT16_LE).get(this.buffer, 10);
|
|
2994
|
-
if (someId1 === 28 && someId2 === 254 || someId1 === 31 && someId2 === 11) {
|
|
2995
|
-
return {
|
|
2996
|
-
ext: "nef",
|
|
2997
|
-
mime: "image/x-nikon-nef"
|
|
2998
|
-
};
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
if (hasUnknownFileSize(this.tokenizer) && ifdOffset > maximumTiffStreamIfdOffsetInBytes) {
|
|
3003
|
-
return tiffFileType;
|
|
3004
|
-
}
|
|
3005
|
-
const maximumTiffOffset = hasUnknownFileSize(this.tokenizer) ? maximumTiffIfdOffsetInBytes : this.tokenizer.fileInfo.size;
|
|
3006
|
-
try {
|
|
3007
|
-
await safeIgnore(this.tokenizer, ifdOffset, {
|
|
3008
|
-
maximumLength: maximumTiffOffset,
|
|
3009
|
-
reason: "TIFF IFD offset"
|
|
3010
|
-
});
|
|
3011
|
-
} catch (error) {
|
|
3012
|
-
if (error instanceof EndOfStreamError) {
|
|
3013
|
-
return;
|
|
3014
|
-
}
|
|
3015
|
-
throw error;
|
|
3016
|
-
}
|
|
3017
|
-
let fileType;
|
|
3018
|
-
try {
|
|
3019
|
-
fileType = await this.readTiffIFD(bigEndian);
|
|
3020
|
-
} catch (error) {
|
|
3021
|
-
if (error instanceof EndOfStreamError) {
|
|
3022
|
-
return;
|
|
3023
|
-
}
|
|
3024
|
-
throw error;
|
|
3025
|
-
}
|
|
3026
|
-
return fileType ?? tiffFileType;
|
|
3027
|
-
}
|
|
3028
|
-
if (version === 43) {
|
|
3029
|
-
return tiffFileType;
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
/**
|
|
3033
|
-
Scan check MPEG 1 or 2 Layer 3 header, or 'layer 0' for ADTS (MPEG sync-word 0xFFE).
|
|
3034
|
-
|
|
3035
|
-
@param offset - Offset to scan for sync-preamble.
|
|
3036
|
-
@returns {{ext: string, mime: string}}
|
|
3037
|
-
*/
|
|
3038
|
-
scanMpeg(offset) {
|
|
3039
|
-
if (this.check([255, 224], { offset, mask: [255, 224] })) {
|
|
3040
|
-
if (this.check([16], { offset: offset + 1, mask: [22] })) {
|
|
3041
|
-
if (this.check([8], { offset: offset + 1, mask: [8] })) {
|
|
3042
|
-
return {
|
|
3043
|
-
ext: "aac",
|
|
3044
|
-
mime: "audio/aac"
|
|
3045
|
-
};
|
|
3046
|
-
}
|
|
3047
|
-
return {
|
|
3048
|
-
ext: "aac",
|
|
3049
|
-
mime: "audio/aac"
|
|
3050
|
-
};
|
|
3051
|
-
}
|
|
3052
|
-
if (this.check([2], { offset: offset + 1, mask: [6] })) {
|
|
3053
|
-
return {
|
|
3054
|
-
ext: "mp3",
|
|
3055
|
-
mime: "audio/mpeg"
|
|
3056
|
-
};
|
|
3057
|
-
}
|
|
3058
|
-
if (this.check([4], { offset: offset + 1, mask: [6] })) {
|
|
3059
|
-
return {
|
|
3060
|
-
ext: "mp2",
|
|
3061
|
-
mime: "audio/mpeg"
|
|
3062
|
-
};
|
|
3063
|
-
}
|
|
3064
|
-
if (this.check([6], { offset: offset + 1, mask: [6] })) {
|
|
3065
|
-
return {
|
|
3066
|
-
ext: "mp1",
|
|
3067
|
-
mime: "audio/mpeg"
|
|
3068
|
-
};
|
|
3069
|
-
}
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
};
|
|
3073
|
-
var supportedExtensions = new Set(extensions);
|
|
3074
|
-
var supportedMimeTypes = new Set(mimeTypes);
|
|
3075
|
-
|
|
3076
|
-
// ../../node_modules/music-metadata/lib/ParserFactory.js
|
|
3077
|
-
var import_content_type = __toESM(require_content_type(), 1);
|
|
3078
|
-
var import_media_typer = __toESM(require_media_typer(), 1);
|
|
3079
|
-
var import_debug3 = __toESM(require_src(), 1);
|
|
3080
|
-
|
|
3081
|
-
// ../../node_modules/music-metadata/lib/common/MetadataCollector.js
|
|
3082
|
-
init_shims();
|
|
3083
|
-
var import_debug2 = __toESM(require_src(), 1);
|
|
3084
|
-
|
|
3085
|
-
// ../../node_modules/music-metadata/lib/common/GenericTagTypes.js
|
|
3086
|
-
init_shims();
|
|
3087
|
-
var defaultTagInfo = {
|
|
3088
|
-
multiple: false
|
|
3089
|
-
};
|
|
3090
|
-
var commonTags = {
|
|
3091
|
-
year: defaultTagInfo,
|
|
3092
|
-
track: defaultTagInfo,
|
|
3093
|
-
disk: defaultTagInfo,
|
|
3094
|
-
title: defaultTagInfo,
|
|
3095
|
-
artist: defaultTagInfo,
|
|
3096
|
-
artists: { multiple: true, unique: true },
|
|
3097
|
-
albumartist: defaultTagInfo,
|
|
3098
|
-
albumartists: { multiple: true, unique: true },
|
|
3099
|
-
album: defaultTagInfo,
|
|
3100
|
-
date: defaultTagInfo,
|
|
3101
|
-
originaldate: defaultTagInfo,
|
|
3102
|
-
originalyear: defaultTagInfo,
|
|
3103
|
-
releasedate: defaultTagInfo,
|
|
3104
|
-
comment: { multiple: true, unique: false },
|
|
3105
|
-
genre: { multiple: true, unique: true },
|
|
3106
|
-
picture: { multiple: true, unique: true },
|
|
3107
|
-
composer: { multiple: true, unique: true },
|
|
3108
|
-
lyrics: { multiple: true, unique: false },
|
|
3109
|
-
albumsort: { multiple: false, unique: true },
|
|
3110
|
-
titlesort: { multiple: false, unique: true },
|
|
3111
|
-
work: { multiple: false, unique: true },
|
|
3112
|
-
artistsort: { multiple: false, unique: true },
|
|
3113
|
-
albumartistsort: { multiple: false, unique: true },
|
|
3114
|
-
composersort: { multiple: false, unique: true },
|
|
3115
|
-
lyricist: { multiple: true, unique: true },
|
|
3116
|
-
writer: { multiple: true, unique: true },
|
|
3117
|
-
conductor: { multiple: true, unique: true },
|
|
3118
|
-
remixer: { multiple: true, unique: true },
|
|
3119
|
-
arranger: { multiple: true, unique: true },
|
|
3120
|
-
engineer: { multiple: true, unique: true },
|
|
3121
|
-
producer: { multiple: true, unique: true },
|
|
3122
|
-
technician: { multiple: true, unique: true },
|
|
3123
|
-
djmixer: { multiple: true, unique: true },
|
|
3124
|
-
mixer: { multiple: true, unique: true },
|
|
3125
|
-
label: { multiple: true, unique: true },
|
|
3126
|
-
grouping: defaultTagInfo,
|
|
3127
|
-
subtitle: { multiple: true },
|
|
3128
|
-
discsubtitle: defaultTagInfo,
|
|
3129
|
-
totaltracks: defaultTagInfo,
|
|
3130
|
-
totaldiscs: defaultTagInfo,
|
|
3131
|
-
compilation: defaultTagInfo,
|
|
3132
|
-
rating: { multiple: true },
|
|
3133
|
-
bpm: defaultTagInfo,
|
|
3134
|
-
mood: defaultTagInfo,
|
|
3135
|
-
media: defaultTagInfo,
|
|
3136
|
-
catalognumber: { multiple: true, unique: true },
|
|
3137
|
-
tvShow: defaultTagInfo,
|
|
3138
|
-
tvShowSort: defaultTagInfo,
|
|
3139
|
-
tvSeason: defaultTagInfo,
|
|
3140
|
-
tvEpisode: defaultTagInfo,
|
|
3141
|
-
tvEpisodeId: defaultTagInfo,
|
|
3142
|
-
tvNetwork: defaultTagInfo,
|
|
3143
|
-
podcast: defaultTagInfo,
|
|
3144
|
-
podcasturl: defaultTagInfo,
|
|
3145
|
-
releasestatus: defaultTagInfo,
|
|
3146
|
-
releasetype: { multiple: true },
|
|
3147
|
-
releasecountry: defaultTagInfo,
|
|
3148
|
-
script: defaultTagInfo,
|
|
3149
|
-
language: defaultTagInfo,
|
|
3150
|
-
copyright: defaultTagInfo,
|
|
3151
|
-
license: defaultTagInfo,
|
|
3152
|
-
encodedby: defaultTagInfo,
|
|
3153
|
-
encodersettings: defaultTagInfo,
|
|
3154
|
-
gapless: defaultTagInfo,
|
|
3155
|
-
barcode: defaultTagInfo,
|
|
3156
|
-
isrc: { multiple: true },
|
|
3157
|
-
asin: defaultTagInfo,
|
|
3158
|
-
musicbrainz_recordingid: defaultTagInfo,
|
|
3159
|
-
musicbrainz_trackid: defaultTagInfo,
|
|
3160
|
-
musicbrainz_albumid: defaultTagInfo,
|
|
3161
|
-
musicbrainz_artistid: { multiple: true },
|
|
3162
|
-
musicbrainz_albumartistid: { multiple: true },
|
|
3163
|
-
musicbrainz_releasegroupid: defaultTagInfo,
|
|
3164
|
-
musicbrainz_workid: defaultTagInfo,
|
|
3165
|
-
musicbrainz_trmid: defaultTagInfo,
|
|
3166
|
-
musicbrainz_discid: defaultTagInfo,
|
|
3167
|
-
acoustid_id: defaultTagInfo,
|
|
3168
|
-
acoustid_fingerprint: defaultTagInfo,
|
|
3169
|
-
musicip_puid: defaultTagInfo,
|
|
3170
|
-
musicip_fingerprint: defaultTagInfo,
|
|
3171
|
-
website: defaultTagInfo,
|
|
3172
|
-
"performer:instrument": { multiple: true, unique: true },
|
|
3173
|
-
averageLevel: defaultTagInfo,
|
|
3174
|
-
peakLevel: defaultTagInfo,
|
|
3175
|
-
notes: { multiple: true, unique: false },
|
|
3176
|
-
key: defaultTagInfo,
|
|
3177
|
-
originalalbum: defaultTagInfo,
|
|
3178
|
-
originalartist: defaultTagInfo,
|
|
3179
|
-
discogs_artist_id: { multiple: true, unique: true },
|
|
3180
|
-
discogs_release_id: defaultTagInfo,
|
|
3181
|
-
discogs_label_id: defaultTagInfo,
|
|
3182
|
-
discogs_master_release_id: defaultTagInfo,
|
|
3183
|
-
discogs_votes: defaultTagInfo,
|
|
3184
|
-
discogs_rating: defaultTagInfo,
|
|
3185
|
-
replaygain_track_peak: defaultTagInfo,
|
|
3186
|
-
replaygain_track_gain: defaultTagInfo,
|
|
3187
|
-
replaygain_album_peak: defaultTagInfo,
|
|
3188
|
-
replaygain_album_gain: defaultTagInfo,
|
|
3189
|
-
replaygain_track_minmax: defaultTagInfo,
|
|
3190
|
-
replaygain_album_minmax: defaultTagInfo,
|
|
3191
|
-
replaygain_undo: defaultTagInfo,
|
|
3192
|
-
description: { multiple: true },
|
|
3193
|
-
longDescription: defaultTagInfo,
|
|
3194
|
-
category: { multiple: true },
|
|
3195
|
-
hdVideo: defaultTagInfo,
|
|
3196
|
-
keywords: { multiple: true },
|
|
3197
|
-
movement: defaultTagInfo,
|
|
3198
|
-
movementIndex: defaultTagInfo,
|
|
3199
|
-
movementTotal: defaultTagInfo,
|
|
3200
|
-
podcastId: defaultTagInfo,
|
|
3201
|
-
showMovement: defaultTagInfo,
|
|
3202
|
-
stik: defaultTagInfo,
|
|
3203
|
-
playCounter: defaultTagInfo
|
|
3204
|
-
};
|
|
3205
|
-
function isSingleton(alias) {
|
|
3206
|
-
return commonTags[alias] && !commonTags[alias].multiple;
|
|
3207
|
-
}
|
|
3208
|
-
function isUnique(alias) {
|
|
3209
|
-
return !commonTags[alias].multiple || commonTags[alias].unique || false;
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
|
-
// ../../node_modules/music-metadata/lib/common/CombinedTagMapper.js
|
|
3213
|
-
init_shims();
|
|
3214
|
-
|
|
3215
|
-
// ../../node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js
|
|
3216
|
-
init_shims();
|
|
3217
|
-
|
|
3218
|
-
// ../../node_modules/music-metadata/lib/common/GenericTagMapper.js
|
|
3219
|
-
init_shims();
|
|
3220
|
-
var CommonTagMapper = class {
|
|
3221
|
-
static toIntOrNull(str) {
|
|
3222
|
-
const cleaned = Number.parseInt(str, 10);
|
|
3223
|
-
return Number.isNaN(cleaned) ? null : cleaned;
|
|
3224
|
-
}
|
|
3225
|
-
// TODO: a string of 1of1 would fail to be converted
|
|
3226
|
-
// converts 1/10 to no : 1, of : 10
|
|
3227
|
-
// or 1 to no : 1, of : 0
|
|
3228
|
-
static normalizeTrack(origVal) {
|
|
3229
|
-
const split = origVal.toString().split("/");
|
|
3230
|
-
return {
|
|
3231
|
-
no: Number.parseInt(split[0], 10) || null,
|
|
3232
|
-
of: Number.parseInt(split[1], 10) || null
|
|
3233
|
-
};
|
|
3234
|
-
}
|
|
3235
|
-
constructor(tagTypes, tagMap2) {
|
|
3236
|
-
this.tagTypes = tagTypes;
|
|
3237
|
-
this.tagMap = tagMap2;
|
|
3238
|
-
}
|
|
3239
|
-
/**
|
|
3240
|
-
* Process and set common tags
|
|
3241
|
-
* write common tags to
|
|
3242
|
-
* @param tag Native tag
|
|
3243
|
-
* @param warnings Register warnings
|
|
3244
|
-
* @return common name
|
|
3245
|
-
*/
|
|
3246
|
-
mapGenericTag(tag, warnings) {
|
|
3247
|
-
tag = { id: tag.id, value: tag.value };
|
|
3248
|
-
this.postMap(tag, warnings);
|
|
3249
|
-
const id = this.getCommonName(tag.id);
|
|
3250
|
-
return id ? { id, value: tag.value } : null;
|
|
3251
|
-
}
|
|
3252
|
-
/**
|
|
3253
|
-
* Convert native tag key to common tag key
|
|
3254
|
-
* @param tag Native header tag
|
|
3255
|
-
* @return common tag name (alias)
|
|
3256
|
-
*/
|
|
3257
|
-
getCommonName(tag) {
|
|
3258
|
-
return this.tagMap[tag];
|
|
3259
|
-
}
|
|
3260
|
-
/**
|
|
3261
|
-
* Handle post mapping exceptions / correction
|
|
3262
|
-
* @param tag Tag e.g. {"©alb", "Buena Vista Social Club")
|
|
3263
|
-
* @param warnings Used to register warnings
|
|
3264
|
-
*/
|
|
3265
|
-
postMap(_tag, _warnings) {
|
|
3266
|
-
return;
|
|
3267
|
-
}
|
|
3268
|
-
};
|
|
3269
|
-
CommonTagMapper.maxRatingScore = 1;
|
|
3270
|
-
|
|
3271
|
-
// ../../node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js
|
|
3272
|
-
var id3v1TagMap = {
|
|
3273
|
-
title: "title",
|
|
3274
|
-
artist: "artist",
|
|
3275
|
-
album: "album",
|
|
3276
|
-
year: "year",
|
|
3277
|
-
comment: "comment",
|
|
3278
|
-
track: "track",
|
|
3279
|
-
genre: "genre"
|
|
3280
|
-
};
|
|
3281
|
-
var ID3v1TagMapper = class extends CommonTagMapper {
|
|
3282
|
-
constructor() {
|
|
3283
|
-
super(["ID3v1"], id3v1TagMap);
|
|
3284
|
-
}
|
|
3285
|
-
};
|
|
3286
|
-
|
|
3287
|
-
// ../../node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js
|
|
3288
|
-
init_shims();
|
|
3289
|
-
|
|
3290
|
-
// ../../node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js
|
|
3291
|
-
init_shims();
|
|
3292
|
-
var CaseInsensitiveTagMap = class extends CommonTagMapper {
|
|
3293
|
-
constructor(tagTypes, tagMap2) {
|
|
3294
|
-
const upperCaseMap = {};
|
|
3295
|
-
for (const tag of Object.keys(tagMap2)) {
|
|
3296
|
-
upperCaseMap[tag.toUpperCase()] = tagMap2[tag];
|
|
3297
|
-
}
|
|
3298
|
-
super(tagTypes, upperCaseMap);
|
|
3299
|
-
}
|
|
3300
|
-
/**
|
|
3301
|
-
* @tag Native header tag
|
|
3302
|
-
* @return common tag name (alias)
|
|
3303
|
-
*/
|
|
3304
|
-
getCommonName(tag) {
|
|
3305
|
-
return this.tagMap[tag.toUpperCase()];
|
|
3306
|
-
}
|
|
3307
|
-
};
|
|
3308
|
-
|
|
3309
|
-
// ../../node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js
|
|
3310
|
-
var id3v24TagMap = {
|
|
3311
|
-
// id3v2.3
|
|
3312
|
-
TIT2: "title",
|
|
3313
|
-
TPE1: "artist",
|
|
3314
|
-
"TXXX:Artists": "artists",
|
|
3315
|
-
TPE2: "albumartist",
|
|
3316
|
-
TALB: "album",
|
|
3317
|
-
TDRV: "date",
|
|
3318
|
-
// [ 'date', 'year' ] ToDo: improve 'year' mapping
|
|
3319
|
-
/**
|
|
3320
|
-
* Original release year
|
|
3321
|
-
*/
|
|
3322
|
-
TORY: "originalyear",
|
|
3323
|
-
TPOS: "disk",
|
|
3324
|
-
TCON: "genre",
|
|
3325
|
-
APIC: "picture",
|
|
3326
|
-
TCOM: "composer",
|
|
3327
|
-
USLT: "lyrics",
|
|
3328
|
-
TSOA: "albumsort",
|
|
3329
|
-
TSOT: "titlesort",
|
|
3330
|
-
TOAL: "originalalbum",
|
|
3331
|
-
TSOP: "artistsort",
|
|
3332
|
-
TSO2: "albumartistsort",
|
|
3333
|
-
TSOC: "composersort",
|
|
3334
|
-
TEXT: "lyricist",
|
|
3335
|
-
"TXXX:Writer": "writer",
|
|
3336
|
-
TPE3: "conductor",
|
|
3337
|
-
// 'IPLS:instrument': 'performer:instrument', // ToDo
|
|
3338
|
-
TPE4: "remixer",
|
|
3339
|
-
"IPLS:arranger": "arranger",
|
|
3340
|
-
"IPLS:engineer": "engineer",
|
|
3341
|
-
"IPLS:producer": "producer",
|
|
3342
|
-
"IPLS:DJ-mix": "djmixer",
|
|
3343
|
-
"IPLS:mix": "mixer",
|
|
3344
|
-
TPUB: "label",
|
|
3345
|
-
TIT1: "grouping",
|
|
3346
|
-
TIT3: "subtitle",
|
|
3347
|
-
TRCK: "track",
|
|
3348
|
-
TCMP: "compilation",
|
|
3349
|
-
POPM: "rating",
|
|
3350
|
-
TBPM: "bpm",
|
|
3351
|
-
TMED: "media",
|
|
3352
|
-
"TXXX:CATALOGNUMBER": "catalognumber",
|
|
3353
|
-
"TXXX:MusicBrainz Album Status": "releasestatus",
|
|
3354
|
-
"TXXX:MusicBrainz Album Type": "releasetype",
|
|
3355
|
-
/**
|
|
3356
|
-
* Release country as documented: https://picard.musicbrainz.org/docs/mappings/#cite_note-0
|
|
3357
|
-
*/
|
|
3358
|
-
"TXXX:MusicBrainz Album Release Country": "releasecountry",
|
|
3359
|
-
/**
|
|
3360
|
-
* Release country as implemented // ToDo: report
|
|
3361
|
-
*/
|
|
3362
|
-
"TXXX:RELEASECOUNTRY": "releasecountry",
|
|
3363
|
-
"TXXX:SCRIPT": "script",
|
|
3364
|
-
TLAN: "language",
|
|
3365
|
-
TCOP: "copyright",
|
|
3366
|
-
WCOP: "license",
|
|
3367
|
-
TENC: "encodedby",
|
|
3368
|
-
TSSE: "encodersettings",
|
|
3369
|
-
"TXXX:BARCODE": "barcode",
|
|
3370
|
-
"TXXX:ISRC": "isrc",
|
|
3371
|
-
TSRC: "isrc",
|
|
3372
|
-
"TXXX:ASIN": "asin",
|
|
3373
|
-
"TXXX:originalyear": "originalyear",
|
|
3374
|
-
"UFID:http://musicbrainz.org": "musicbrainz_recordingid",
|
|
3375
|
-
"TXXX:MusicBrainz Release Track Id": "musicbrainz_trackid",
|
|
3376
|
-
"TXXX:MusicBrainz Album Id": "musicbrainz_albumid",
|
|
3377
|
-
"TXXX:MusicBrainz Artist Id": "musicbrainz_artistid",
|
|
3378
|
-
"TXXX:MusicBrainz Album Artist Id": "musicbrainz_albumartistid",
|
|
3379
|
-
"TXXX:MusicBrainz Release Group Id": "musicbrainz_releasegroupid",
|
|
3380
|
-
"TXXX:MusicBrainz Work Id": "musicbrainz_workid",
|
|
3381
|
-
"TXXX:MusicBrainz TRM Id": "musicbrainz_trmid",
|
|
3382
|
-
"TXXX:MusicBrainz Disc Id": "musicbrainz_discid",
|
|
3383
|
-
"TXXX:ACOUSTID_ID": "acoustid_id",
|
|
3384
|
-
"TXXX:Acoustid Id": "acoustid_id",
|
|
3385
|
-
"TXXX:Acoustid Fingerprint": "acoustid_fingerprint",
|
|
3386
|
-
"TXXX:MusicIP PUID": "musicip_puid",
|
|
3387
|
-
"TXXX:MusicMagic Fingerprint": "musicip_fingerprint",
|
|
3388
|
-
WOAR: "website",
|
|
3389
|
-
// id3v2.4
|
|
3390
|
-
// ToDo: In same sequence as defined at http://id3.org/id3v2.4.0-frames
|
|
3391
|
-
TDRC: "date",
|
|
3392
|
-
// date YYYY-MM-DD
|
|
3393
|
-
TYER: "year",
|
|
3394
|
-
TDOR: "originaldate",
|
|
3395
|
-
// 'TMCL:instrument': 'performer:instrument',
|
|
3396
|
-
"TIPL:arranger": "arranger",
|
|
3397
|
-
"TIPL:engineer": "engineer",
|
|
3398
|
-
"TIPL:producer": "producer",
|
|
3399
|
-
"TIPL:DJ-mix": "djmixer",
|
|
3400
|
-
"TIPL:mix": "mixer",
|
|
3401
|
-
TMOO: "mood",
|
|
3402
|
-
// additional mappings:
|
|
3403
|
-
SYLT: "lyrics",
|
|
3404
|
-
TSST: "discsubtitle",
|
|
3405
|
-
TKEY: "key",
|
|
3406
|
-
COMM: "comment",
|
|
3407
|
-
TOPE: "originalartist",
|
|
3408
|
-
// Windows Media Player
|
|
3409
|
-
"PRIV:AverageLevel": "averageLevel",
|
|
3410
|
-
"PRIV:PeakLevel": "peakLevel",
|
|
3411
|
-
// Discogs
|
|
3412
|
-
"TXXX:DISCOGS_ARTIST_ID": "discogs_artist_id",
|
|
3413
|
-
"TXXX:DISCOGS_ARTISTS": "artists",
|
|
3414
|
-
"TXXX:DISCOGS_ARTIST_NAME": "artists",
|
|
3415
|
-
"TXXX:DISCOGS_ALBUM_ARTISTS": "albumartist",
|
|
3416
|
-
"TXXX:DISCOGS_CATALOG": "catalognumber",
|
|
3417
|
-
"TXXX:DISCOGS_COUNTRY": "releasecountry",
|
|
3418
|
-
"TXXX:DISCOGS_DATE": "originaldate",
|
|
3419
|
-
"TXXX:DISCOGS_LABEL": "label",
|
|
3420
|
-
"TXXX:DISCOGS_LABEL_ID": "discogs_label_id",
|
|
3421
|
-
"TXXX:DISCOGS_MASTER_RELEASE_ID": "discogs_master_release_id",
|
|
3422
|
-
"TXXX:DISCOGS_RATING": "discogs_rating",
|
|
3423
|
-
"TXXX:DISCOGS_RELEASED": "date",
|
|
3424
|
-
"TXXX:DISCOGS_RELEASE_ID": "discogs_release_id",
|
|
3425
|
-
"TXXX:DISCOGS_VOTES": "discogs_votes",
|
|
3426
|
-
"TXXX:CATALOGID": "catalognumber",
|
|
3427
|
-
"TXXX:STYLE": "genre",
|
|
3428
|
-
"TXXX:REPLAYGAIN_TRACK_PEAK": "replaygain_track_peak",
|
|
3429
|
-
"TXXX:REPLAYGAIN_TRACK_GAIN": "replaygain_track_gain",
|
|
3430
|
-
"TXXX:REPLAYGAIN_ALBUM_PEAK": "replaygain_album_peak",
|
|
3431
|
-
"TXXX:REPLAYGAIN_ALBUM_GAIN": "replaygain_album_gain",
|
|
3432
|
-
"TXXX:MP3GAIN_MINMAX": "replaygain_track_minmax",
|
|
3433
|
-
"TXXX:MP3GAIN_ALBUM_MINMAX": "replaygain_album_minmax",
|
|
3434
|
-
"TXXX:MP3GAIN_UNDO": "replaygain_undo",
|
|
3435
|
-
MVNM: "movement",
|
|
3436
|
-
MVIN: "movementIndex",
|
|
3437
|
-
PCST: "podcast",
|
|
3438
|
-
TCAT: "category",
|
|
3439
|
-
TDES: "description",
|
|
3440
|
-
TDRL: "releasedate",
|
|
3441
|
-
TGID: "podcastId",
|
|
3442
|
-
TKWD: "keywords",
|
|
3443
|
-
WFED: "podcasturl",
|
|
3444
|
-
GRP1: "grouping",
|
|
3445
|
-
PCNT: "playCounter"
|
|
3446
|
-
};
|
|
3447
|
-
var ID3v24TagMapper = class _ID3v24TagMapper extends CaseInsensitiveTagMap {
|
|
3448
|
-
static toRating(popm) {
|
|
3449
|
-
return {
|
|
3450
|
-
source: popm.email,
|
|
3451
|
-
rating: popm.rating > 0 ? (popm.rating - 1) / 254 * CommonTagMapper.maxRatingScore : void 0
|
|
3452
|
-
};
|
|
3453
|
-
}
|
|
3454
|
-
constructor() {
|
|
3455
|
-
super(["ID3v2.3", "ID3v2.4"], id3v24TagMap);
|
|
3456
|
-
}
|
|
3457
|
-
/**
|
|
3458
|
-
* Handle post mapping exceptions / correction
|
|
3459
|
-
* @param tag to post map
|
|
3460
|
-
* @param warnings Wil be used to register (collect) warnings
|
|
3461
|
-
*/
|
|
3462
|
-
postMap(tag, warnings) {
|
|
3463
|
-
switch (tag.id) {
|
|
3464
|
-
case "UFID":
|
|
3465
|
-
{
|
|
3466
|
-
const idTag = tag.value;
|
|
3467
|
-
if (idTag.owner_identifier === "http://musicbrainz.org") {
|
|
3468
|
-
tag.id += `:${idTag.owner_identifier}`;
|
|
3469
|
-
tag.value = decodeString(idTag.identifier, "latin1");
|
|
3470
|
-
}
|
|
3471
|
-
}
|
|
3472
|
-
break;
|
|
3473
|
-
case "PRIV":
|
|
3474
|
-
{
|
|
3475
|
-
const customTag = tag.value;
|
|
3476
|
-
switch (customTag.owner_identifier) {
|
|
3477
|
-
// decode Windows Media Player
|
|
3478
|
-
case "AverageLevel":
|
|
3479
|
-
case "PeakValue":
|
|
3480
|
-
tag.id += `:${customTag.owner_identifier}`;
|
|
3481
|
-
tag.value = customTag.data.length === 4 ? UINT32_LE.get(customTag.data, 0) : null;
|
|
3482
|
-
if (tag.value === null) {
|
|
3483
|
-
warnings.addWarning("Failed to parse PRIV:PeakValue");
|
|
3484
|
-
}
|
|
3485
|
-
break;
|
|
3486
|
-
default:
|
|
3487
|
-
warnings.addWarning(`Unknown PRIV owner-identifier: ${customTag.data}`);
|
|
3488
|
-
}
|
|
3489
|
-
}
|
|
3490
|
-
break;
|
|
3491
|
-
case "POPM":
|
|
3492
|
-
tag.value = _ID3v24TagMapper.toRating(tag.value);
|
|
3493
|
-
break;
|
|
3494
|
-
default:
|
|
3495
|
-
break;
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
};
|
|
3499
|
-
|
|
3500
|
-
// ../../node_modules/music-metadata/lib/asf/AsfTagMapper.js
|
|
3501
|
-
init_shims();
|
|
3502
|
-
var asfTagMap = {
|
|
3503
|
-
Title: "title",
|
|
3504
|
-
Author: "artist",
|
|
3505
|
-
"WM/AlbumArtist": "albumartist",
|
|
3506
|
-
"WM/AlbumTitle": "album",
|
|
3507
|
-
"WM/Year": "date",
|
|
3508
|
-
// changed to 'year' to 'date' based on Picard mappings; ToDo: check me
|
|
3509
|
-
"WM/OriginalReleaseTime": "originaldate",
|
|
3510
|
-
"WM/OriginalReleaseYear": "originalyear",
|
|
3511
|
-
Description: "comment",
|
|
3512
|
-
"WM/TrackNumber": "track",
|
|
3513
|
-
"WM/PartOfSet": "disk",
|
|
3514
|
-
"WM/Genre": "genre",
|
|
3515
|
-
"WM/Composer": "composer",
|
|
3516
|
-
"WM/Lyrics": "lyrics",
|
|
3517
|
-
"WM/AlbumSortOrder": "albumsort",
|
|
3518
|
-
"WM/TitleSortOrder": "titlesort",
|
|
3519
|
-
"WM/ArtistSortOrder": "artistsort",
|
|
3520
|
-
"WM/AlbumArtistSortOrder": "albumartistsort",
|
|
3521
|
-
"WM/ComposerSortOrder": "composersort",
|
|
3522
|
-
"WM/Writer": "lyricist",
|
|
3523
|
-
"WM/Conductor": "conductor",
|
|
3524
|
-
"WM/ModifiedBy": "remixer",
|
|
3525
|
-
"WM/Engineer": "engineer",
|
|
3526
|
-
"WM/Producer": "producer",
|
|
3527
|
-
"WM/DJMixer": "djmixer",
|
|
3528
|
-
"WM/Mixer": "mixer",
|
|
3529
|
-
"WM/Publisher": "label",
|
|
3530
|
-
"WM/ContentGroupDescription": "grouping",
|
|
3531
|
-
"WM/SubTitle": "subtitle",
|
|
3532
|
-
"WM/SetSubTitle": "discsubtitle",
|
|
3533
|
-
// 'WM/PartOfSet': 'totaldiscs',
|
|
3534
|
-
"WM/IsCompilation": "compilation",
|
|
3535
|
-
"WM/SharedUserRating": "rating",
|
|
3536
|
-
"WM/BeatsPerMinute": "bpm",
|
|
3537
|
-
"WM/Mood": "mood",
|
|
3538
|
-
"WM/Media": "media",
|
|
3539
|
-
"WM/CatalogNo": "catalognumber",
|
|
3540
|
-
"MusicBrainz/Album Status": "releasestatus",
|
|
3541
|
-
"MusicBrainz/Album Type": "releasetype",
|
|
3542
|
-
"MusicBrainz/Album Release Country": "releasecountry",
|
|
3543
|
-
"WM/Script": "script",
|
|
3544
|
-
"WM/Language": "language",
|
|
3545
|
-
Copyright: "copyright",
|
|
3546
|
-
LICENSE: "license",
|
|
3547
|
-
"WM/EncodedBy": "encodedby",
|
|
3548
|
-
"WM/EncodingSettings": "encodersettings",
|
|
3549
|
-
"WM/Barcode": "barcode",
|
|
3550
|
-
"WM/ISRC": "isrc",
|
|
3551
|
-
"MusicBrainz/Track Id": "musicbrainz_recordingid",
|
|
3552
|
-
"MusicBrainz/Release Track Id": "musicbrainz_trackid",
|
|
3553
|
-
"MusicBrainz/Album Id": "musicbrainz_albumid",
|
|
3554
|
-
"MusicBrainz/Artist Id": "musicbrainz_artistid",
|
|
3555
|
-
"MusicBrainz/Album Artist Id": "musicbrainz_albumartistid",
|
|
3556
|
-
"MusicBrainz/Release Group Id": "musicbrainz_releasegroupid",
|
|
3557
|
-
"MusicBrainz/Work Id": "musicbrainz_workid",
|
|
3558
|
-
"MusicBrainz/TRM Id": "musicbrainz_trmid",
|
|
3559
|
-
"MusicBrainz/Disc Id": "musicbrainz_discid",
|
|
3560
|
-
"Acoustid/Id": "acoustid_id",
|
|
3561
|
-
"Acoustid/Fingerprint": "acoustid_fingerprint",
|
|
3562
|
-
"MusicIP/PUID": "musicip_puid",
|
|
3563
|
-
"WM/ARTISTS": "artists",
|
|
3564
|
-
"WM/InitialKey": "key",
|
|
3565
|
-
ASIN: "asin",
|
|
3566
|
-
"WM/Work": "work",
|
|
3567
|
-
"WM/AuthorURL": "website",
|
|
3568
|
-
"WM/Picture": "picture"
|
|
3569
|
-
};
|
|
3570
|
-
var AsfTagMapper = class _AsfTagMapper extends CommonTagMapper {
|
|
3571
|
-
static toRating(rating) {
|
|
3572
|
-
return {
|
|
3573
|
-
rating: Number.parseFloat(rating + 1) / 5
|
|
3574
|
-
};
|
|
3575
|
-
}
|
|
3576
|
-
constructor() {
|
|
3577
|
-
super(["asf"], asfTagMap);
|
|
3578
|
-
}
|
|
3579
|
-
postMap(tag) {
|
|
3580
|
-
switch (tag.id) {
|
|
3581
|
-
case "WM/SharedUserRating": {
|
|
3582
|
-
const keys = tag.id.split(":");
|
|
3583
|
-
tag.value = _AsfTagMapper.toRating(tag.value);
|
|
3584
|
-
tag.id = keys[0];
|
|
3585
|
-
break;
|
|
3586
|
-
}
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
};
|
|
3590
|
-
|
|
3591
|
-
// ../../node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js
|
|
3592
|
-
init_shims();
|
|
3593
|
-
var id3v22TagMap = {
|
|
3594
|
-
TT2: "title",
|
|
3595
|
-
TP1: "artist",
|
|
3596
|
-
TP2: "albumartist",
|
|
3597
|
-
TAL: "album",
|
|
3598
|
-
TYE: "year",
|
|
3599
|
-
COM: "comment",
|
|
3600
|
-
TRK: "track",
|
|
3601
|
-
TPA: "disk",
|
|
3602
|
-
TCO: "genre",
|
|
3603
|
-
PIC: "picture",
|
|
3604
|
-
TCM: "composer",
|
|
3605
|
-
TOR: "originaldate",
|
|
3606
|
-
TOT: "originalalbum",
|
|
3607
|
-
TXT: "lyricist",
|
|
3608
|
-
TP3: "conductor",
|
|
3609
|
-
TPB: "label",
|
|
3610
|
-
TT1: "grouping",
|
|
3611
|
-
TT3: "subtitle",
|
|
3612
|
-
TLA: "language",
|
|
3613
|
-
TCR: "copyright",
|
|
3614
|
-
WCP: "license",
|
|
3615
|
-
TEN: "encodedby",
|
|
3616
|
-
TSS: "encodersettings",
|
|
3617
|
-
WAR: "website",
|
|
3618
|
-
PCS: "podcast",
|
|
3619
|
-
TCP: "compilation",
|
|
3620
|
-
TDR: "date",
|
|
3621
|
-
TS2: "albumartistsort",
|
|
3622
|
-
TSA: "albumsort",
|
|
3623
|
-
TSC: "composersort",
|
|
3624
|
-
TSP: "artistsort",
|
|
3625
|
-
TST: "titlesort",
|
|
3626
|
-
WFD: "podcasturl",
|
|
3627
|
-
TBP: "bpm",
|
|
3628
|
-
GP1: "grouping"
|
|
3629
|
-
};
|
|
3630
|
-
var ID3v22TagMapper = class extends CaseInsensitiveTagMap {
|
|
3631
|
-
constructor() {
|
|
3632
|
-
super(["ID3v2.2"], id3v22TagMap);
|
|
3633
|
-
}
|
|
3634
|
-
};
|
|
3635
|
-
|
|
3636
|
-
// ../../node_modules/music-metadata/lib/apev2/APEv2TagMapper.js
|
|
3637
|
-
init_shims();
|
|
3638
|
-
var apev2TagMap = {
|
|
3639
|
-
Title: "title",
|
|
3640
|
-
Artist: "artist",
|
|
3641
|
-
Artists: "artists",
|
|
3642
|
-
"Album Artist": "albumartist",
|
|
3643
|
-
Album: "album",
|
|
3644
|
-
Year: "date",
|
|
3645
|
-
Originalyear: "originalyear",
|
|
3646
|
-
Originaldate: "originaldate",
|
|
3647
|
-
Releasedate: "releasedate",
|
|
3648
|
-
Comment: "comment",
|
|
3649
|
-
Track: "track",
|
|
3650
|
-
Disc: "disk",
|
|
3651
|
-
DISCNUMBER: "disk",
|
|
3652
|
-
// ToDo: backwards compatibility', valid tag?
|
|
3653
|
-
Genre: "genre",
|
|
3654
|
-
"Cover Art (Front)": "picture",
|
|
3655
|
-
"Cover Art (Back)": "picture",
|
|
3656
|
-
Composer: "composer",
|
|
3657
|
-
Lyrics: "lyrics",
|
|
3658
|
-
ALBUMSORT: "albumsort",
|
|
3659
|
-
TITLESORT: "titlesort",
|
|
3660
|
-
WORK: "work",
|
|
3661
|
-
ARTISTSORT: "artistsort",
|
|
3662
|
-
ALBUMARTISTSORT: "albumartistsort",
|
|
3663
|
-
COMPOSERSORT: "composersort",
|
|
3664
|
-
Lyricist: "lyricist",
|
|
3665
|
-
Writer: "writer",
|
|
3666
|
-
Conductor: "conductor",
|
|
3667
|
-
// 'Performer=artist (instrument)': 'performer:instrument',
|
|
3668
|
-
MixArtist: "remixer",
|
|
3669
|
-
Arranger: "arranger",
|
|
3670
|
-
Engineer: "engineer",
|
|
3671
|
-
Producer: "producer",
|
|
3672
|
-
DJMixer: "djmixer",
|
|
3673
|
-
Mixer: "mixer",
|
|
3674
|
-
Label: "label",
|
|
3675
|
-
Grouping: "grouping",
|
|
3676
|
-
Subtitle: "subtitle",
|
|
3677
|
-
DiscSubtitle: "discsubtitle",
|
|
3678
|
-
Compilation: "compilation",
|
|
3679
|
-
BPM: "bpm",
|
|
3680
|
-
Mood: "mood",
|
|
3681
|
-
Media: "media",
|
|
3682
|
-
CatalogNumber: "catalognumber",
|
|
3683
|
-
MUSICBRAINZ_ALBUMSTATUS: "releasestatus",
|
|
3684
|
-
MUSICBRAINZ_ALBUMTYPE: "releasetype",
|
|
3685
|
-
RELEASECOUNTRY: "releasecountry",
|
|
3686
|
-
Script: "script",
|
|
3687
|
-
Language: "language",
|
|
3688
|
-
Copyright: "copyright",
|
|
3689
|
-
LICENSE: "license",
|
|
3690
|
-
EncodedBy: "encodedby",
|
|
3691
|
-
EncoderSettings: "encodersettings",
|
|
3692
|
-
Barcode: "barcode",
|
|
3693
|
-
ISRC: "isrc",
|
|
3694
|
-
ASIN: "asin",
|
|
3695
|
-
musicbrainz_trackid: "musicbrainz_recordingid",
|
|
3696
|
-
musicbrainz_releasetrackid: "musicbrainz_trackid",
|
|
3697
|
-
MUSICBRAINZ_ALBUMID: "musicbrainz_albumid",
|
|
3698
|
-
MUSICBRAINZ_ARTISTID: "musicbrainz_artistid",
|
|
3699
|
-
MUSICBRAINZ_ALBUMARTISTID: "musicbrainz_albumartistid",
|
|
3700
|
-
MUSICBRAINZ_RELEASEGROUPID: "musicbrainz_releasegroupid",
|
|
3701
|
-
MUSICBRAINZ_WORKID: "musicbrainz_workid",
|
|
3702
|
-
MUSICBRAINZ_TRMID: "musicbrainz_trmid",
|
|
3703
|
-
MUSICBRAINZ_DISCID: "musicbrainz_discid",
|
|
3704
|
-
Acoustid_Id: "acoustid_id",
|
|
3705
|
-
ACOUSTID_FINGERPRINT: "acoustid_fingerprint",
|
|
3706
|
-
MUSICIP_PUID: "musicip_puid",
|
|
3707
|
-
Weblink: "website",
|
|
3708
|
-
REPLAYGAIN_TRACK_GAIN: "replaygain_track_gain",
|
|
3709
|
-
REPLAYGAIN_TRACK_PEAK: "replaygain_track_peak",
|
|
3710
|
-
MP3GAIN_MINMAX: "replaygain_track_minmax",
|
|
3711
|
-
MP3GAIN_UNDO: "replaygain_undo"
|
|
3712
|
-
};
|
|
3713
|
-
var APEv2TagMapper = class extends CaseInsensitiveTagMap {
|
|
3714
|
-
constructor() {
|
|
3715
|
-
super(["APEv2"], apev2TagMap);
|
|
3716
|
-
}
|
|
3717
|
-
};
|
|
3718
|
-
|
|
3719
|
-
// ../../node_modules/music-metadata/lib/mp4/MP4TagMapper.js
|
|
3720
|
-
init_shims();
|
|
3721
|
-
var mp4TagMap = {
|
|
3722
|
-
"\xA9nam": "title",
|
|
3723
|
-
"\xA9ART": "artist",
|
|
3724
|
-
aART: "albumartist",
|
|
3725
|
-
/**
|
|
3726
|
-
* ToDo: Album artist seems to be stored here while Picard documentation says: aART
|
|
3727
|
-
*/
|
|
3728
|
-
"----:com.apple.iTunes:Band": "albumartist",
|
|
3729
|
-
"\xA9alb": "album",
|
|
3730
|
-
"\xA9day": "date",
|
|
3731
|
-
"\xA9cmt": "comment",
|
|
3732
|
-
"\xA9com": "comment",
|
|
3733
|
-
trkn: "track",
|
|
3734
|
-
disk: "disk",
|
|
3735
|
-
"\xA9gen": "genre",
|
|
3736
|
-
covr: "picture",
|
|
3737
|
-
"\xA9wrt": "composer",
|
|
3738
|
-
"\xA9lyr": "lyrics",
|
|
3739
|
-
soal: "albumsort",
|
|
3740
|
-
sonm: "titlesort",
|
|
3741
|
-
soar: "artistsort",
|
|
3742
|
-
soaa: "albumartistsort",
|
|
3743
|
-
soco: "composersort",
|
|
3744
|
-
"----:com.apple.iTunes:LYRICIST": "lyricist",
|
|
3745
|
-
"----:com.apple.iTunes:CONDUCTOR": "conductor",
|
|
3746
|
-
"----:com.apple.iTunes:REMIXER": "remixer",
|
|
3747
|
-
"----:com.apple.iTunes:ENGINEER": "engineer",
|
|
3748
|
-
"----:com.apple.iTunes:PRODUCER": "producer",
|
|
3749
|
-
"----:com.apple.iTunes:DJMIXER": "djmixer",
|
|
3750
|
-
"----:com.apple.iTunes:MIXER": "mixer",
|
|
3751
|
-
"----:com.apple.iTunes:LABEL": "label",
|
|
3752
|
-
"\xA9grp": "grouping",
|
|
3753
|
-
"----:com.apple.iTunes:SUBTITLE": "subtitle",
|
|
3754
|
-
"----:com.apple.iTunes:DISCSUBTITLE": "discsubtitle",
|
|
3755
|
-
cpil: "compilation",
|
|
3756
|
-
tmpo: "bpm",
|
|
3757
|
-
"----:com.apple.iTunes:MOOD": "mood",
|
|
3758
|
-
"----:com.apple.iTunes:MEDIA": "media",
|
|
3759
|
-
"----:com.apple.iTunes:CATALOGNUMBER": "catalognumber",
|
|
3760
|
-
tvsh: "tvShow",
|
|
3761
|
-
tvsn: "tvSeason",
|
|
3762
|
-
tves: "tvEpisode",
|
|
3763
|
-
sosn: "tvShowSort",
|
|
3764
|
-
tven: "tvEpisodeId",
|
|
3765
|
-
tvnn: "tvNetwork",
|
|
3766
|
-
pcst: "podcast",
|
|
3767
|
-
purl: "podcasturl",
|
|
3768
|
-
"----:com.apple.iTunes:MusicBrainz Album Status": "releasestatus",
|
|
3769
|
-
"----:com.apple.iTunes:MusicBrainz Album Type": "releasetype",
|
|
3770
|
-
"----:com.apple.iTunes:MusicBrainz Album Release Country": "releasecountry",
|
|
3771
|
-
"----:com.apple.iTunes:SCRIPT": "script",
|
|
3772
|
-
"----:com.apple.iTunes:LANGUAGE": "language",
|
|
3773
|
-
cprt: "copyright",
|
|
3774
|
-
"\xA9cpy": "copyright",
|
|
3775
|
-
"----:com.apple.iTunes:LICENSE": "license",
|
|
3776
|
-
"\xA9too": "encodedby",
|
|
3777
|
-
pgap: "gapless",
|
|
3778
|
-
"----:com.apple.iTunes:BARCODE": "barcode",
|
|
3779
|
-
"----:com.apple.iTunes:ISRC": "isrc",
|
|
3780
|
-
"----:com.apple.iTunes:ASIN": "asin",
|
|
3781
|
-
"----:com.apple.iTunes:NOTES": "comment",
|
|
3782
|
-
"----:com.apple.iTunes:MusicBrainz Track Id": "musicbrainz_recordingid",
|
|
3783
|
-
"----:com.apple.iTunes:MusicBrainz Release Track Id": "musicbrainz_trackid",
|
|
3784
|
-
"----:com.apple.iTunes:MusicBrainz Album Id": "musicbrainz_albumid",
|
|
3785
|
-
"----:com.apple.iTunes:MusicBrainz Artist Id": "musicbrainz_artistid",
|
|
3786
|
-
"----:com.apple.iTunes:MusicBrainz Album Artist Id": "musicbrainz_albumartistid",
|
|
3787
|
-
"----:com.apple.iTunes:MusicBrainz Release Group Id": "musicbrainz_releasegroupid",
|
|
3788
|
-
"----:com.apple.iTunes:MusicBrainz Work Id": "musicbrainz_workid",
|
|
3789
|
-
"----:com.apple.iTunes:MusicBrainz TRM Id": "musicbrainz_trmid",
|
|
3790
|
-
"----:com.apple.iTunes:MusicBrainz Disc Id": "musicbrainz_discid",
|
|
3791
|
-
"----:com.apple.iTunes:Acoustid Id": "acoustid_id",
|
|
3792
|
-
"----:com.apple.iTunes:Acoustid Fingerprint": "acoustid_fingerprint",
|
|
3793
|
-
"----:com.apple.iTunes:MusicIP PUID": "musicip_puid",
|
|
3794
|
-
"----:com.apple.iTunes:fingerprint": "musicip_fingerprint",
|
|
3795
|
-
"----:com.apple.iTunes:replaygain_track_gain": "replaygain_track_gain",
|
|
3796
|
-
"----:com.apple.iTunes:replaygain_track_peak": "replaygain_track_peak",
|
|
3797
|
-
"----:com.apple.iTunes:replaygain_album_gain": "replaygain_album_gain",
|
|
3798
|
-
"----:com.apple.iTunes:replaygain_album_peak": "replaygain_album_peak",
|
|
3799
|
-
"----:com.apple.iTunes:replaygain_track_minmax": "replaygain_track_minmax",
|
|
3800
|
-
"----:com.apple.iTunes:replaygain_album_minmax": "replaygain_album_minmax",
|
|
3801
|
-
"----:com.apple.iTunes:replaygain_undo": "replaygain_undo",
|
|
3802
|
-
// Additional mappings:
|
|
3803
|
-
gnre: "genre",
|
|
3804
|
-
// ToDo: check mapping
|
|
3805
|
-
"----:com.apple.iTunes:ALBUMARTISTSORT": "albumartistsort",
|
|
3806
|
-
"----:com.apple.iTunes:ARTISTS": "artists",
|
|
3807
|
-
"----:com.apple.iTunes:ORIGINALDATE": "originaldate",
|
|
3808
|
-
"----:com.apple.iTunes:ORIGINALYEAR": "originalyear",
|
|
3809
|
-
"----:com.apple.iTunes:RELEASEDATE": "releasedate",
|
|
3810
|
-
// '----:com.apple.iTunes:PERFORMER': 'performer'
|
|
3811
|
-
desc: "description",
|
|
3812
|
-
ldes: "longDescription",
|
|
3813
|
-
"\xA9mvn": "movement",
|
|
3814
|
-
"\xA9mvi": "movementIndex",
|
|
3815
|
-
"\xA9mvc": "movementTotal",
|
|
3816
|
-
"\xA9wrk": "work",
|
|
3817
|
-
catg: "category",
|
|
3818
|
-
egid: "podcastId",
|
|
3819
|
-
hdvd: "hdVideo",
|
|
3820
|
-
keyw: "keywords",
|
|
3821
|
-
shwm: "showMovement",
|
|
3822
|
-
stik: "stik",
|
|
3823
|
-
rate: "rating"
|
|
3824
|
-
};
|
|
3825
|
-
var tagType = "iTunes";
|
|
3826
|
-
var MP4TagMapper = class extends CaseInsensitiveTagMap {
|
|
3827
|
-
constructor() {
|
|
3828
|
-
super([tagType], mp4TagMap);
|
|
3829
|
-
}
|
|
3830
|
-
postMap(tag, _warnings) {
|
|
3831
|
-
switch (tag.id) {
|
|
3832
|
-
case "rate":
|
|
3833
|
-
tag.value = {
|
|
3834
|
-
source: void 0,
|
|
3835
|
-
rating: Number.parseFloat(tag.value) / 100
|
|
3836
|
-
};
|
|
3837
|
-
break;
|
|
3838
|
-
}
|
|
3839
|
-
}
|
|
3840
|
-
};
|
|
3841
|
-
|
|
3842
|
-
// ../../node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js
|
|
3843
|
-
init_shims();
|
|
3844
|
-
var vorbisTagMap = {
|
|
3845
|
-
TITLE: "title",
|
|
3846
|
-
ARTIST: "artist",
|
|
3847
|
-
ARTISTS: "artists",
|
|
3848
|
-
ALBUMARTIST: "albumartist",
|
|
3849
|
-
"ALBUM ARTIST": "albumartist",
|
|
3850
|
-
ALBUM: "album",
|
|
3851
|
-
DATE: "date",
|
|
3852
|
-
ORIGINALDATE: "originaldate",
|
|
3853
|
-
ORIGINALYEAR: "originalyear",
|
|
3854
|
-
RELEASEDATE: "releasedate",
|
|
3855
|
-
COMMENT: "comment",
|
|
3856
|
-
TRACKNUMBER: "track",
|
|
3857
|
-
DISCNUMBER: "disk",
|
|
3858
|
-
GENRE: "genre",
|
|
3859
|
-
METADATA_BLOCK_PICTURE: "picture",
|
|
3860
|
-
COMPOSER: "composer",
|
|
3861
|
-
LYRICS: "lyrics",
|
|
3862
|
-
ALBUMSORT: "albumsort",
|
|
3863
|
-
TITLESORT: "titlesort",
|
|
3864
|
-
WORK: "work",
|
|
3865
|
-
ARTISTSORT: "artistsort",
|
|
3866
|
-
ALBUMARTISTSORT: "albumartistsort",
|
|
3867
|
-
COMPOSERSORT: "composersort",
|
|
3868
|
-
LYRICIST: "lyricist",
|
|
3869
|
-
WRITER: "writer",
|
|
3870
|
-
CONDUCTOR: "conductor",
|
|
3871
|
-
// 'PERFORMER=artist (instrument)': 'performer:instrument', // ToDo
|
|
3872
|
-
REMIXER: "remixer",
|
|
3873
|
-
ARRANGER: "arranger",
|
|
3874
|
-
ENGINEER: "engineer",
|
|
3875
|
-
PRODUCER: "producer",
|
|
3876
|
-
DJMIXER: "djmixer",
|
|
3877
|
-
MIXER: "mixer",
|
|
3878
|
-
LABEL: "label",
|
|
3879
|
-
GROUPING: "grouping",
|
|
3880
|
-
SUBTITLE: "subtitle",
|
|
3881
|
-
DISCSUBTITLE: "discsubtitle",
|
|
3882
|
-
TRACKTOTAL: "totaltracks",
|
|
3883
|
-
DISCTOTAL: "totaldiscs",
|
|
3884
|
-
COMPILATION: "compilation",
|
|
3885
|
-
RATING: "rating",
|
|
3886
|
-
BPM: "bpm",
|
|
3887
|
-
KEY: "key",
|
|
3888
|
-
MOOD: "mood",
|
|
3889
|
-
MEDIA: "media",
|
|
3890
|
-
CATALOGNUMBER: "catalognumber",
|
|
3891
|
-
RELEASESTATUS: "releasestatus",
|
|
3892
|
-
RELEASETYPE: "releasetype",
|
|
3893
|
-
RELEASECOUNTRY: "releasecountry",
|
|
3894
|
-
SCRIPT: "script",
|
|
3895
|
-
LANGUAGE: "language",
|
|
3896
|
-
COPYRIGHT: "copyright",
|
|
3897
|
-
LICENSE: "license",
|
|
3898
|
-
ENCODEDBY: "encodedby",
|
|
3899
|
-
ENCODERSETTINGS: "encodersettings",
|
|
3900
|
-
BARCODE: "barcode",
|
|
3901
|
-
ISRC: "isrc",
|
|
3902
|
-
ASIN: "asin",
|
|
3903
|
-
MUSICBRAINZ_TRACKID: "musicbrainz_recordingid",
|
|
3904
|
-
MUSICBRAINZ_RELEASETRACKID: "musicbrainz_trackid",
|
|
3905
|
-
MUSICBRAINZ_ALBUMID: "musicbrainz_albumid",
|
|
3906
|
-
MUSICBRAINZ_ARTISTID: "musicbrainz_artistid",
|
|
3907
|
-
MUSICBRAINZ_ALBUMARTISTID: "musicbrainz_albumartistid",
|
|
3908
|
-
MUSICBRAINZ_RELEASEGROUPID: "musicbrainz_releasegroupid",
|
|
3909
|
-
MUSICBRAINZ_WORKID: "musicbrainz_workid",
|
|
3910
|
-
MUSICBRAINZ_TRMID: "musicbrainz_trmid",
|
|
3911
|
-
MUSICBRAINZ_DISCID: "musicbrainz_discid",
|
|
3912
|
-
ACOUSTID_ID: "acoustid_id",
|
|
3913
|
-
ACOUSTID_ID_FINGERPRINT: "acoustid_fingerprint",
|
|
3914
|
-
MUSICIP_PUID: "musicip_puid",
|
|
3915
|
-
// 'FINGERPRINT=MusicMagic Fingerprint {fingerprint}': 'musicip_fingerprint', // ToDo
|
|
3916
|
-
WEBSITE: "website",
|
|
3917
|
-
NOTES: "notes",
|
|
3918
|
-
TOTALTRACKS: "totaltracks",
|
|
3919
|
-
TOTALDISCS: "totaldiscs",
|
|
3920
|
-
// Discogs
|
|
3921
|
-
DISCOGS_ARTIST_ID: "discogs_artist_id",
|
|
3922
|
-
DISCOGS_ARTISTS: "artists",
|
|
3923
|
-
DISCOGS_ARTIST_NAME: "artists",
|
|
3924
|
-
DISCOGS_ALBUM_ARTISTS: "albumartist",
|
|
3925
|
-
DISCOGS_CATALOG: "catalognumber",
|
|
3926
|
-
DISCOGS_COUNTRY: "releasecountry",
|
|
3927
|
-
DISCOGS_DATE: "originaldate",
|
|
3928
|
-
DISCOGS_LABEL: "label",
|
|
3929
|
-
DISCOGS_LABEL_ID: "discogs_label_id",
|
|
3930
|
-
DISCOGS_MASTER_RELEASE_ID: "discogs_master_release_id",
|
|
3931
|
-
DISCOGS_RATING: "discogs_rating",
|
|
3932
|
-
DISCOGS_RELEASED: "date",
|
|
3933
|
-
DISCOGS_RELEASE_ID: "discogs_release_id",
|
|
3934
|
-
DISCOGS_VOTES: "discogs_votes",
|
|
3935
|
-
CATALOGID: "catalognumber",
|
|
3936
|
-
STYLE: "genre",
|
|
3937
|
-
//
|
|
3938
|
-
REPLAYGAIN_TRACK_GAIN: "replaygain_track_gain",
|
|
3939
|
-
REPLAYGAIN_TRACK_PEAK: "replaygain_track_peak",
|
|
3940
|
-
REPLAYGAIN_ALBUM_GAIN: "replaygain_album_gain",
|
|
3941
|
-
REPLAYGAIN_ALBUM_PEAK: "replaygain_album_peak",
|
|
3942
|
-
// To Sure if these (REPLAYGAIN_MINMAX, REPLAYGAIN_ALBUM_MINMAX & REPLAYGAIN_UNDO) are used for Vorbis:
|
|
3943
|
-
REPLAYGAIN_MINMAX: "replaygain_track_minmax",
|
|
3944
|
-
REPLAYGAIN_ALBUM_MINMAX: "replaygain_album_minmax",
|
|
3945
|
-
REPLAYGAIN_UNDO: "replaygain_undo"
|
|
3946
|
-
};
|
|
3947
|
-
var VorbisTagMapper = class _VorbisTagMapper extends CommonTagMapper {
|
|
3948
|
-
static toRating(email, rating, maxScore) {
|
|
3949
|
-
return {
|
|
3950
|
-
source: email ? email.toLowerCase() : void 0,
|
|
3951
|
-
rating: Number.parseFloat(rating) / maxScore * CommonTagMapper.maxRatingScore
|
|
3952
|
-
};
|
|
3953
|
-
}
|
|
3954
|
-
constructor() {
|
|
3955
|
-
super(["vorbis"], vorbisTagMap);
|
|
3956
|
-
}
|
|
3957
|
-
postMap(tag) {
|
|
3958
|
-
if (tag.id === "RATING") {
|
|
3959
|
-
tag.value = _VorbisTagMapper.toRating(void 0, tag.value, 100);
|
|
3960
|
-
} else if (tag.id.indexOf("RATING:") === 0) {
|
|
3961
|
-
const keys = tag.id.split(":");
|
|
3962
|
-
tag.value = _VorbisTagMapper.toRating(keys[1], tag.value, 1);
|
|
3963
|
-
tag.id = keys[0];
|
|
3964
|
-
}
|
|
3965
|
-
}
|
|
3966
|
-
};
|
|
3967
|
-
|
|
3968
|
-
// ../../node_modules/music-metadata/lib/riff/RiffInfoTagMap.js
|
|
3969
|
-
init_shims();
|
|
3970
|
-
var riffInfoTagMap = {
|
|
3971
|
-
IART: "artist",
|
|
3972
|
-
// Artist
|
|
3973
|
-
ICRD: "date",
|
|
3974
|
-
// DateCreated
|
|
3975
|
-
INAM: "title",
|
|
3976
|
-
// Title
|
|
3977
|
-
TITL: "title",
|
|
3978
|
-
IPRD: "album",
|
|
3979
|
-
// Product
|
|
3980
|
-
ITRK: "track",
|
|
3981
|
-
IPRT: "track",
|
|
3982
|
-
// Additional tag for track index
|
|
3983
|
-
COMM: "comment",
|
|
3984
|
-
// Comments
|
|
3985
|
-
ICMT: "comment",
|
|
3986
|
-
// Country
|
|
3987
|
-
ICNT: "releasecountry",
|
|
3988
|
-
GNRE: "genre",
|
|
3989
|
-
// Genre
|
|
3990
|
-
IWRI: "writer",
|
|
3991
|
-
// WrittenBy
|
|
3992
|
-
RATE: "rating",
|
|
3993
|
-
YEAR: "year",
|
|
3994
|
-
ISFT: "encodedby",
|
|
3995
|
-
// Software
|
|
3996
|
-
CODE: "encodedby",
|
|
3997
|
-
// EncodedBy
|
|
3998
|
-
TURL: "website",
|
|
3999
|
-
// URL,
|
|
4000
|
-
IGNR: "genre",
|
|
4001
|
-
// Genre
|
|
4002
|
-
IENG: "engineer",
|
|
4003
|
-
// Engineer
|
|
4004
|
-
ITCH: "technician",
|
|
4005
|
-
// Technician
|
|
4006
|
-
IMED: "media",
|
|
4007
|
-
// Original Media
|
|
4008
|
-
IRPD: "album"
|
|
4009
|
-
// Product, where the file was intended for
|
|
4010
|
-
};
|
|
4011
|
-
var RiffInfoTagMapper = class extends CommonTagMapper {
|
|
4012
|
-
constructor() {
|
|
4013
|
-
super(["exif"], riffInfoTagMap);
|
|
4014
|
-
}
|
|
4015
|
-
};
|
|
4016
|
-
|
|
4017
|
-
// ../../node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js
|
|
4018
|
-
init_shims();
|
|
4019
|
-
var ebmlTagMap = {
|
|
4020
|
-
"segment:title": "title",
|
|
4021
|
-
"album:ARTIST": "albumartist",
|
|
4022
|
-
"album:ARTISTSORT": "albumartistsort",
|
|
4023
|
-
"album:TITLE": "album",
|
|
4024
|
-
"album:DATE_RECORDED": "originaldate",
|
|
4025
|
-
"album:DATE_RELEASED": "releasedate",
|
|
4026
|
-
"album:PART_NUMBER": "disk",
|
|
4027
|
-
"album:TOTAL_PARTS": "totaltracks",
|
|
4028
|
-
"track:ARTIST": "artist",
|
|
4029
|
-
"track:ARTISTSORT": "artistsort",
|
|
4030
|
-
"track:TITLE": "title",
|
|
4031
|
-
"track:PART_NUMBER": "track",
|
|
4032
|
-
"track:MUSICBRAINZ_TRACKID": "musicbrainz_recordingid",
|
|
4033
|
-
"track:MUSICBRAINZ_ALBUMID": "musicbrainz_albumid",
|
|
4034
|
-
"track:MUSICBRAINZ_ARTISTID": "musicbrainz_artistid",
|
|
4035
|
-
"track:PUBLISHER": "label",
|
|
4036
|
-
"track:GENRE": "genre",
|
|
4037
|
-
"track:ENCODER": "encodedby",
|
|
4038
|
-
"track:ENCODER_OPTIONS": "encodersettings",
|
|
4039
|
-
"edition:TOTAL_PARTS": "totaldiscs",
|
|
4040
|
-
picture: "picture"
|
|
4041
|
-
};
|
|
4042
|
-
var MatroskaTagMapper = class extends CaseInsensitiveTagMap {
|
|
4043
|
-
constructor() {
|
|
4044
|
-
super(["matroska"], ebmlTagMap);
|
|
4045
|
-
}
|
|
4046
|
-
};
|
|
4047
|
-
|
|
4048
|
-
// ../../node_modules/music-metadata/lib/aiff/AiffTagMap.js
|
|
4049
|
-
init_shims();
|
|
4050
|
-
var tagMap = {
|
|
4051
|
-
NAME: "title",
|
|
4052
|
-
AUTH: "artist",
|
|
4053
|
-
"(c) ": "copyright",
|
|
4054
|
-
ANNO: "comment"
|
|
4055
|
-
};
|
|
4056
|
-
var AiffTagMapper = class extends CommonTagMapper {
|
|
4057
|
-
constructor() {
|
|
4058
|
-
super(["AIFF"], tagMap);
|
|
4059
|
-
}
|
|
4060
|
-
};
|
|
4061
|
-
|
|
4062
|
-
// ../../node_modules/music-metadata/lib/common/CombinedTagMapper.js
|
|
4063
|
-
var CombinedTagMapper = class {
|
|
4064
|
-
constructor() {
|
|
4065
|
-
this.tagMappers = {};
|
|
4066
|
-
[
|
|
4067
|
-
new ID3v1TagMapper(),
|
|
4068
|
-
new ID3v22TagMapper(),
|
|
4069
|
-
new ID3v24TagMapper(),
|
|
4070
|
-
new MP4TagMapper(),
|
|
4071
|
-
new MP4TagMapper(),
|
|
4072
|
-
new VorbisTagMapper(),
|
|
4073
|
-
new APEv2TagMapper(),
|
|
4074
|
-
new AsfTagMapper(),
|
|
4075
|
-
new RiffInfoTagMapper(),
|
|
4076
|
-
new MatroskaTagMapper(),
|
|
4077
|
-
new AiffTagMapper()
|
|
4078
|
-
].forEach((mapper) => {
|
|
4079
|
-
this.registerTagMapper(mapper);
|
|
4080
|
-
});
|
|
4081
|
-
}
|
|
4082
|
-
/**
|
|
4083
|
-
* Convert native to generic (common) tags
|
|
4084
|
-
* @param tagType Originating tag format
|
|
4085
|
-
* @param tag Native tag to map to a generic tag id
|
|
4086
|
-
* @param warnings
|
|
4087
|
-
* @return Generic tag result (output of this function)
|
|
4088
|
-
*/
|
|
4089
|
-
mapTag(tagType2, tag, warnings) {
|
|
4090
|
-
const tagMapper = this.tagMappers[tagType2];
|
|
4091
|
-
if (tagMapper) {
|
|
4092
|
-
return this.tagMappers[tagType2].mapGenericTag(tag, warnings);
|
|
4093
|
-
}
|
|
4094
|
-
throw new InternalParserError(`No generic tag mapper defined for tag-format: ${tagType2}`);
|
|
4095
|
-
}
|
|
4096
|
-
registerTagMapper(genericTagMapper) {
|
|
4097
|
-
for (const tagType2 of genericTagMapper.tagTypes) {
|
|
4098
|
-
this.tagMappers[tagType2] = genericTagMapper;
|
|
4099
|
-
}
|
|
4100
|
-
}
|
|
4101
|
-
};
|
|
4102
|
-
|
|
4103
|
-
// ../../node_modules/music-metadata/lib/lrc/LyricsParser.js
|
|
4104
|
-
init_shims();
|
|
4105
|
-
var TIMESTAMP_REGEX = /\[(\d{2}):(\d{2})\.(\d{2,3})]/;
|
|
4106
|
-
function parseLyrics(input) {
|
|
4107
|
-
if (TIMESTAMP_REGEX.test(input)) {
|
|
4108
|
-
return parseLrc(input);
|
|
4109
|
-
}
|
|
4110
|
-
return toUnsyncedLyrics(input);
|
|
4111
|
-
}
|
|
4112
|
-
function toUnsyncedLyrics(lyrics) {
|
|
4113
|
-
return {
|
|
4114
|
-
contentType: LyricsContentType.lyrics,
|
|
4115
|
-
timeStampFormat: TimestampFormat.notSynchronized,
|
|
4116
|
-
text: lyrics.trim(),
|
|
4117
|
-
syncText: []
|
|
4118
|
-
};
|
|
4119
|
-
}
|
|
4120
|
-
function parseLrc(lrcString) {
|
|
4121
|
-
const lines = lrcString.split("\n");
|
|
4122
|
-
const syncText = [];
|
|
4123
|
-
for (const line of lines) {
|
|
4124
|
-
const match = line.match(TIMESTAMP_REGEX);
|
|
4125
|
-
if (match) {
|
|
4126
|
-
const minutes = Number.parseInt(match[1], 10);
|
|
4127
|
-
const seconds = Number.parseInt(match[2], 10);
|
|
4128
|
-
const ms = match[3].length === 3 ? Number.parseInt(match[3], 10) : Number.parseInt(match[3], 10) * 10;
|
|
4129
|
-
const timestamp = (minutes * 60 + seconds) * 1e3 + ms;
|
|
4130
|
-
const text = line.replace(TIMESTAMP_REGEX, "").trim();
|
|
4131
|
-
syncText.push({ timestamp, text });
|
|
4132
|
-
}
|
|
4133
|
-
}
|
|
4134
|
-
return {
|
|
4135
|
-
contentType: LyricsContentType.lyrics,
|
|
4136
|
-
timeStampFormat: TimestampFormat.milliseconds,
|
|
4137
|
-
text: syncText.map((line) => line.text).join("\n"),
|
|
4138
|
-
syncText
|
|
4139
|
-
};
|
|
4140
|
-
}
|
|
4141
|
-
|
|
4142
|
-
// ../../node_modules/music-metadata/lib/common/MetadataCollector.js
|
|
4143
|
-
var debug2 = (0, import_debug2.default)("music-metadata:collector");
|
|
4144
|
-
var TagPriority = ["matroska", "APEv2", "vorbis", "ID3v2.4", "ID3v2.3", "ID3v2.2", "exif", "asf", "iTunes", "AIFF", "ID3v1"];
|
|
4145
|
-
var MetadataCollector = class {
|
|
4146
|
-
constructor(opts) {
|
|
4147
|
-
this.format = {
|
|
4148
|
-
tagTypes: [],
|
|
4149
|
-
trackInfo: []
|
|
4150
|
-
};
|
|
4151
|
-
this.native = {};
|
|
4152
|
-
this.common = {
|
|
4153
|
-
track: { no: null, of: null },
|
|
4154
|
-
disk: { no: null, of: null },
|
|
4155
|
-
movementIndex: { no: null, of: null }
|
|
4156
|
-
};
|
|
4157
|
-
this.quality = {
|
|
4158
|
-
warnings: []
|
|
4159
|
-
};
|
|
4160
|
-
this.commonOrigin = {};
|
|
4161
|
-
this.originPriority = {};
|
|
4162
|
-
this.tagMapper = new CombinedTagMapper();
|
|
4163
|
-
this.opts = opts;
|
|
4164
|
-
let priority = 1;
|
|
4165
|
-
for (const tagType2 of TagPriority) {
|
|
4166
|
-
this.originPriority[tagType2] = priority++;
|
|
4167
|
-
}
|
|
4168
|
-
this.originPriority.artificial = 500;
|
|
4169
|
-
this.originPriority.id3v1 = 600;
|
|
4170
|
-
}
|
|
4171
|
-
/**
|
|
4172
|
-
* @returns {boolean} true if one or more tags have been found
|
|
4173
|
-
*/
|
|
4174
|
-
hasAny() {
|
|
4175
|
-
return Object.keys(this.native).length > 0;
|
|
4176
|
-
}
|
|
4177
|
-
addStreamInfo(streamInfo) {
|
|
4178
|
-
debug2(`streamInfo: type=${streamInfo.type ? TrackTypeValueToKeyMap[streamInfo.type] : "?"}, codec=${streamInfo.codecName}`);
|
|
4179
|
-
this.format.trackInfo.push(streamInfo);
|
|
4180
|
-
}
|
|
4181
|
-
setFormat(key, value) {
|
|
4182
|
-
debug2(`format: ${key} = ${value}`);
|
|
4183
|
-
this.format[key] = value;
|
|
4184
|
-
if (this.opts?.observer) {
|
|
4185
|
-
this.opts.observer({ metadata: this, tag: { type: "format", id: key, value } });
|
|
4186
|
-
}
|
|
4187
|
-
}
|
|
4188
|
-
setAudioOnly() {
|
|
4189
|
-
this.setFormat("hasAudio", true);
|
|
4190
|
-
this.setFormat("hasVideo", false);
|
|
4191
|
-
}
|
|
4192
|
-
async addTag(tagType2, tagId, value) {
|
|
4193
|
-
debug2(`tag ${tagType2}.${tagId} = ${value}`);
|
|
4194
|
-
if (!this.native[tagType2]) {
|
|
4195
|
-
this.format.tagTypes.push(tagType2);
|
|
4196
|
-
this.native[tagType2] = [];
|
|
4197
|
-
}
|
|
4198
|
-
this.native[tagType2].push({ id: tagId, value });
|
|
4199
|
-
await this.toCommon(tagType2, tagId, value);
|
|
4200
|
-
}
|
|
4201
|
-
addWarning(warning) {
|
|
4202
|
-
this.quality.warnings.push({ message: warning });
|
|
4203
|
-
}
|
|
4204
|
-
async postMap(tagType2, tag) {
|
|
4205
|
-
switch (tag.id) {
|
|
4206
|
-
case "artist":
|
|
4207
|
-
return this.handleSingularArtistTag(tagType2, tag, "artist", "artists");
|
|
4208
|
-
case "albumartist":
|
|
4209
|
-
return this.handleSingularArtistTag(tagType2, tag, "albumartist", "albumartists");
|
|
4210
|
-
case "artists":
|
|
4211
|
-
return this.handlePluralArtistTag(tagType2, tag, "artist", "artists");
|
|
4212
|
-
case "albumartists":
|
|
4213
|
-
return this.handlePluralArtistTag(tagType2, tag, "albumartist", "albumartists");
|
|
4214
|
-
case "picture":
|
|
4215
|
-
return this.postFixPicture(tag.value).then((picture) => {
|
|
4216
|
-
if (picture !== null) {
|
|
4217
|
-
tag.value = picture;
|
|
4218
|
-
this.setGenericTag(tagType2, tag);
|
|
4219
|
-
}
|
|
4220
|
-
});
|
|
4221
|
-
case "totaltracks":
|
|
4222
|
-
this.common.track.of = CommonTagMapper.toIntOrNull(tag.value);
|
|
4223
|
-
return;
|
|
4224
|
-
case "totaldiscs":
|
|
4225
|
-
this.common.disk.of = CommonTagMapper.toIntOrNull(tag.value);
|
|
4226
|
-
return;
|
|
4227
|
-
case "movementTotal":
|
|
4228
|
-
this.common.movementIndex.of = CommonTagMapper.toIntOrNull(tag.value);
|
|
4229
|
-
return;
|
|
4230
|
-
case "track":
|
|
4231
|
-
case "disk":
|
|
4232
|
-
case "movementIndex": {
|
|
4233
|
-
const of = this.common[tag.id].of;
|
|
4234
|
-
this.common[tag.id] = CommonTagMapper.normalizeTrack(tag.value);
|
|
4235
|
-
this.common[tag.id].of = of != null ? of : this.common[tag.id].of;
|
|
4236
|
-
return;
|
|
4237
|
-
}
|
|
4238
|
-
case "bpm":
|
|
4239
|
-
case "year":
|
|
4240
|
-
case "originalyear":
|
|
4241
|
-
tag.value = Number.parseInt(tag.value, 10);
|
|
4242
|
-
break;
|
|
4243
|
-
case "date": {
|
|
4244
|
-
const year = Number.parseInt(tag.value.substr(0, 4), 10);
|
|
4245
|
-
if (!Number.isNaN(year)) {
|
|
4246
|
-
this.common.year = year;
|
|
4247
|
-
}
|
|
4248
|
-
break;
|
|
4249
|
-
}
|
|
4250
|
-
case "discogs_label_id":
|
|
4251
|
-
case "discogs_release_id":
|
|
4252
|
-
case "discogs_master_release_id":
|
|
4253
|
-
case "discogs_artist_id":
|
|
4254
|
-
case "discogs_votes":
|
|
4255
|
-
tag.value = typeof tag.value === "string" ? Number.parseInt(tag.value, 10) : tag.value;
|
|
4256
|
-
break;
|
|
4257
|
-
case "replaygain_track_gain":
|
|
4258
|
-
case "replaygain_track_peak":
|
|
4259
|
-
case "replaygain_album_gain":
|
|
4260
|
-
case "replaygain_album_peak":
|
|
4261
|
-
tag.value = toRatio(tag.value);
|
|
4262
|
-
break;
|
|
4263
|
-
case "replaygain_track_minmax":
|
|
4264
|
-
tag.value = tag.value.split(",").map((v) => Number.parseInt(v, 10));
|
|
4265
|
-
break;
|
|
4266
|
-
case "replaygain_undo": {
|
|
4267
|
-
const minMix = tag.value.split(",").map((v) => Number.parseInt(v, 10));
|
|
4268
|
-
tag.value = {
|
|
4269
|
-
leftChannel: minMix[0],
|
|
4270
|
-
rightChannel: minMix[1]
|
|
4271
|
-
};
|
|
4272
|
-
break;
|
|
4273
|
-
}
|
|
4274
|
-
case "gapless":
|
|
4275
|
-
// iTunes gap-less flag
|
|
4276
|
-
case "compilation":
|
|
4277
|
-
case "podcast":
|
|
4278
|
-
case "showMovement":
|
|
4279
|
-
tag.value = tag.value === "1" || tag.value === 1;
|
|
4280
|
-
break;
|
|
4281
|
-
case "isrc": {
|
|
4282
|
-
const commonTag = this.common[tag.id];
|
|
4283
|
-
if (commonTag && commonTag.indexOf(tag.value) !== -1)
|
|
4284
|
-
return;
|
|
4285
|
-
break;
|
|
4286
|
-
}
|
|
4287
|
-
case "comment":
|
|
4288
|
-
if (typeof tag.value === "string") {
|
|
4289
|
-
tag.value = { text: tag.value };
|
|
4290
|
-
}
|
|
4291
|
-
if (tag.value.descriptor === "iTunPGAP") {
|
|
4292
|
-
this.setGenericTag(tagType2, { id: "gapless", value: tag.value.text === "1" });
|
|
4293
|
-
}
|
|
4294
|
-
break;
|
|
4295
|
-
case "lyrics":
|
|
4296
|
-
if (typeof tag.value === "string") {
|
|
4297
|
-
tag.value = parseLyrics(tag.value);
|
|
4298
|
-
}
|
|
4299
|
-
break;
|
|
4300
|
-
default:
|
|
4301
|
-
}
|
|
4302
|
-
if (tag.value !== null) {
|
|
4303
|
-
this.setGenericTag(tagType2, tag);
|
|
4304
|
-
}
|
|
4305
|
-
}
|
|
4306
|
-
/**
|
|
4307
|
-
* Convert native tags to common tags
|
|
4308
|
-
* @returns {IAudioMetadata} Native + common tags
|
|
4309
|
-
*/
|
|
4310
|
-
toCommonMetadata() {
|
|
4311
|
-
return {
|
|
4312
|
-
format: this.format,
|
|
4313
|
-
native: this.native,
|
|
4314
|
-
quality: this.quality,
|
|
4315
|
-
common: this.common
|
|
4316
|
-
};
|
|
4317
|
-
}
|
|
4318
|
-
/**
|
|
4319
|
-
* Handle singular artist tags (artist, albumartist) and cross-populate to plural form
|
|
4320
|
-
*/
|
|
4321
|
-
handleSingularArtistTag(tagType2, tag, singularId, pluralId) {
|
|
4322
|
-
if (this.commonOrigin[singularId] === this.originPriority[tagType2]) {
|
|
4323
|
-
return this.postMap("artificial", { id: pluralId, value: tag.value });
|
|
4324
|
-
}
|
|
4325
|
-
if (!this.common[pluralId]) {
|
|
4326
|
-
this.setGenericTag("artificial", { id: pluralId, value: tag.value });
|
|
4327
|
-
}
|
|
4328
|
-
this.setGenericTag(tagType2, tag);
|
|
4329
|
-
}
|
|
4330
|
-
/**
|
|
4331
|
-
* Handle plural artist tags (artists, albumartists) and cross-populate to singular form
|
|
4332
|
-
*/
|
|
4333
|
-
handlePluralArtistTag(tagType2, tag, singularId, pluralId) {
|
|
4334
|
-
if (!this.common[singularId] || this.commonOrigin[singularId] === this.originPriority.artificial) {
|
|
4335
|
-
if (!this.common[pluralId] || this.common[pluralId].indexOf(tag.value) === -1) {
|
|
4336
|
-
const values = (this.common[pluralId] || []).concat([tag.value]);
|
|
4337
|
-
const value = joinArtists(values);
|
|
4338
|
-
this.setGenericTag("artificial", { id: singularId, value });
|
|
4339
|
-
}
|
|
4340
|
-
}
|
|
4341
|
-
this.setGenericTag(tagType2, tag);
|
|
4342
|
-
}
|
|
4343
|
-
/**
|
|
4344
|
-
* Fix some common issues with picture object
|
|
4345
|
-
* @param picture Picture
|
|
4346
|
-
*/
|
|
4347
|
-
async postFixPicture(picture) {
|
|
4348
|
-
if (picture.data && picture.data.length > 0) {
|
|
4349
|
-
if (!picture.format) {
|
|
4350
|
-
const fileType = await fileTypeFromBuffer(Uint8Array.from(picture.data));
|
|
4351
|
-
if (fileType) {
|
|
4352
|
-
picture.format = fileType.mime;
|
|
4353
|
-
} else {
|
|
4354
|
-
return null;
|
|
4355
|
-
}
|
|
4356
|
-
}
|
|
4357
|
-
picture.format = picture.format.toLocaleLowerCase();
|
|
4358
|
-
switch (picture.format) {
|
|
4359
|
-
case "image/jpg":
|
|
4360
|
-
picture.format = "image/jpeg";
|
|
4361
|
-
}
|
|
4362
|
-
return picture;
|
|
4363
|
-
}
|
|
4364
|
-
this.addWarning("Empty picture tag found");
|
|
4365
|
-
return null;
|
|
4366
|
-
}
|
|
4367
|
-
/**
|
|
4368
|
-
* Convert native tag to common tags
|
|
4369
|
-
*/
|
|
4370
|
-
async toCommon(tagType2, tagId, value) {
|
|
4371
|
-
const tag = { id: tagId, value };
|
|
4372
|
-
const genericTag = this.tagMapper.mapTag(tagType2, tag, this);
|
|
4373
|
-
if (genericTag) {
|
|
4374
|
-
await this.postMap(tagType2, genericTag);
|
|
4375
|
-
}
|
|
4376
|
-
}
|
|
4377
|
-
/**
|
|
4378
|
-
* Set generic tag
|
|
4379
|
-
*/
|
|
4380
|
-
setGenericTag(tagType2, tag) {
|
|
4381
|
-
debug2(`common.${tag.id} = ${tag.value}`);
|
|
4382
|
-
const prio0 = this.commonOrigin[tag.id] || 1e3;
|
|
4383
|
-
const prio1 = this.originPriority[tagType2];
|
|
4384
|
-
if (isSingleton(tag.id)) {
|
|
4385
|
-
if (prio1 <= prio0) {
|
|
4386
|
-
this.common[tag.id] = tag.value;
|
|
4387
|
-
this.commonOrigin[tag.id] = prio1;
|
|
4388
|
-
} else {
|
|
4389
|
-
return debug2(`Ignore native tag (singleton): ${tagType2}.${tag.id} = ${tag.value}`);
|
|
4390
|
-
}
|
|
4391
|
-
} else {
|
|
4392
|
-
if (prio1 === prio0) {
|
|
4393
|
-
if (!isUnique(tag.id) || this.common[tag.id].indexOf(tag.value) === -1) {
|
|
4394
|
-
this.common[tag.id].push(tag.value);
|
|
4395
|
-
} else {
|
|
4396
|
-
debug2(`Ignore duplicate value: ${tagType2}.${tag.id} = ${tag.value}`);
|
|
4397
|
-
}
|
|
4398
|
-
} else if (prio1 < prio0) {
|
|
4399
|
-
this.common[tag.id] = [tag.value];
|
|
4400
|
-
this.commonOrigin[tag.id] = prio1;
|
|
4401
|
-
} else {
|
|
4402
|
-
return debug2(`Ignore native tag (list): ${tagType2}.${tag.id} = ${tag.value}`);
|
|
4403
|
-
}
|
|
4404
|
-
}
|
|
4405
|
-
if (this.opts?.observer) {
|
|
4406
|
-
this.opts.observer({ metadata: this, tag: { type: "common", id: tag.id, value: tag.value } });
|
|
4407
|
-
}
|
|
4408
|
-
}
|
|
4409
|
-
};
|
|
4410
|
-
function joinArtists(artists) {
|
|
4411
|
-
if (artists.length > 2) {
|
|
4412
|
-
return `${artists.slice(0, artists.length - 1).join(", ")} & ${artists[artists.length - 1]}`;
|
|
4413
|
-
}
|
|
4414
|
-
return artists.join(" & ");
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
|
-
// ../../node_modules/music-metadata/lib/mpeg/MpegLoader.js
|
|
4418
|
-
init_shims();
|
|
4419
|
-
var mpegParserLoader = {
|
|
4420
|
-
parserType: "mpeg",
|
|
4421
|
-
extensions: [".mp2", ".mp3", ".m2a", ".aac", "aacp"],
|
|
4422
|
-
mimeTypes: ["audio/mpeg", "audio/mp3", "audio/aacs", "audio/aacp"],
|
|
4423
|
-
async load() {
|
|
4424
|
-
return (await import("./MpegParser-KXQEC6KD.js")).MpegParser;
|
|
4425
|
-
}
|
|
4426
|
-
};
|
|
4427
|
-
|
|
4428
|
-
// ../../node_modules/music-metadata/lib/apev2/Apev2Loader.js
|
|
4429
|
-
init_shims();
|
|
4430
|
-
var apeParserLoader = {
|
|
4431
|
-
parserType: "apev2",
|
|
4432
|
-
extensions: [".ape"],
|
|
4433
|
-
mimeTypes: ["audio/ape", "audio/monkeys-audio"],
|
|
4434
|
-
async load() {
|
|
4435
|
-
return (await import("./APEv2Parser-FYYGMFPI.js")).APEv2Parser;
|
|
4436
|
-
}
|
|
4437
|
-
};
|
|
4438
|
-
|
|
4439
|
-
// ../../node_modules/music-metadata/lib/asf/AsfLoader.js
|
|
4440
|
-
init_shims();
|
|
4441
|
-
var asfParserLoader = {
|
|
4442
|
-
parserType: "asf",
|
|
4443
|
-
extensions: [".asf", ".wma", ".wmv"],
|
|
4444
|
-
mimeTypes: ["audio/ms-wma", "video/ms-wmv", "audio/ms-asf", "video/ms-asf", "application/vnd.ms-asf"],
|
|
4445
|
-
async load() {
|
|
4446
|
-
return (await import("./AsfParser-TPCQDEJB.js")).AsfParser;
|
|
4447
|
-
}
|
|
4448
|
-
};
|
|
4449
|
-
|
|
4450
|
-
// ../../node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js
|
|
4451
|
-
init_shims();
|
|
4452
|
-
var dsdiffParserLoader = {
|
|
4453
|
-
parserType: "dsdiff",
|
|
4454
|
-
extensions: [".dff"],
|
|
4455
|
-
mimeTypes: ["audio/dsf", "audio/dsd"],
|
|
4456
|
-
async load() {
|
|
4457
|
-
return (await import("./DsdiffParser-CGD3C3TL.js")).DsdiffParser;
|
|
4458
|
-
}
|
|
4459
|
-
};
|
|
4460
|
-
|
|
4461
|
-
// ../../node_modules/music-metadata/lib/aiff/AiffLoader.js
|
|
4462
|
-
init_shims();
|
|
4463
|
-
var aiffParserLoader = {
|
|
4464
|
-
parserType: "aiff",
|
|
4465
|
-
extensions: [".aif", "aiff", "aifc"],
|
|
4466
|
-
mimeTypes: ["audio/aiff", "audio/aif", "audio/aifc", "application/aiff"],
|
|
4467
|
-
async load() {
|
|
4468
|
-
return (await import("./AiffParser-JHSDQA7T.js")).AIFFParser;
|
|
4469
|
-
}
|
|
4470
|
-
};
|
|
4471
|
-
|
|
4472
|
-
// ../../node_modules/music-metadata/lib/dsf/DsfLoader.js
|
|
4473
|
-
init_shims();
|
|
4474
|
-
var dsfParserLoader = {
|
|
4475
|
-
parserType: "dsf",
|
|
4476
|
-
extensions: [".dsf"],
|
|
4477
|
-
mimeTypes: ["audio/dsf"],
|
|
4478
|
-
async load() {
|
|
4479
|
-
return (await import("./DsfParser-3UTIJVNF.js")).DsfParser;
|
|
4480
|
-
}
|
|
4481
|
-
};
|
|
4482
|
-
|
|
4483
|
-
// ../../node_modules/music-metadata/lib/flac/FlacLoader.js
|
|
4484
|
-
init_shims();
|
|
4485
|
-
var flacParserLoader = {
|
|
4486
|
-
parserType: "flac",
|
|
4487
|
-
extensions: [".flac"],
|
|
4488
|
-
mimeTypes: ["audio/flac"],
|
|
4489
|
-
async load() {
|
|
4490
|
-
return (await import("./FlacParser-HLLYPJ76.js")).FlacParser;
|
|
4491
|
-
}
|
|
4492
|
-
};
|
|
4493
|
-
|
|
4494
|
-
// ../../node_modules/music-metadata/lib/matroska/MatroskaLoader.js
|
|
4495
|
-
init_shims();
|
|
4496
|
-
var matroskaParserLoader = {
|
|
4497
|
-
parserType: "matroska",
|
|
4498
|
-
extensions: [".mka", ".mkv", ".mk3d", ".mks", "webm"],
|
|
4499
|
-
mimeTypes: ["audio/matroska", "video/matroska", "audio/webm", "video/webm"],
|
|
4500
|
-
async load() {
|
|
4501
|
-
return (await import("./MatroskaParser-X7WRZ6D4.js")).MatroskaParser;
|
|
4502
|
-
}
|
|
4503
|
-
};
|
|
4504
|
-
|
|
4505
|
-
// ../../node_modules/music-metadata/lib/mp4/Mp4Loader.js
|
|
4506
|
-
init_shims();
|
|
4507
|
-
var mp4ParserLoader = {
|
|
4508
|
-
parserType: "mp4",
|
|
4509
|
-
extensions: [".mp4", ".m4a", ".m4b", ".m4pa", "m4v", "m4r", "3gp", ".mov", ".movie", ".qt"],
|
|
4510
|
-
mimeTypes: ["audio/mp4", "audio/m4a", "video/m4v", "video/mp4", "video/quicktime"],
|
|
4511
|
-
async load() {
|
|
4512
|
-
return (await import("./MP4Parser-SM7HYL3Z.js")).MP4Parser;
|
|
4513
|
-
}
|
|
4514
|
-
};
|
|
4515
|
-
|
|
4516
|
-
// ../../node_modules/music-metadata/lib/musepack/MusepackLoader.js
|
|
4517
|
-
init_shims();
|
|
4518
|
-
var musepackParserLoader = {
|
|
4519
|
-
parserType: "musepack",
|
|
4520
|
-
extensions: [".mpc"],
|
|
4521
|
-
mimeTypes: ["audio/musepack"],
|
|
4522
|
-
async load() {
|
|
4523
|
-
return (await import("./MusepackParser-NURI46TG.js")).MusepackParser;
|
|
4524
|
-
}
|
|
4525
|
-
};
|
|
4526
|
-
|
|
4527
|
-
// ../../node_modules/music-metadata/lib/ogg/OggLoader.js
|
|
4528
|
-
init_shims();
|
|
4529
|
-
var oggParserLoader = {
|
|
4530
|
-
parserType: "ogg",
|
|
4531
|
-
extensions: [".ogg", ".ogv", ".oga", ".ogm", ".ogx", ".opus", ".spx"],
|
|
4532
|
-
mimeTypes: ["audio/ogg", "audio/opus", "audio/speex", "video/ogg"],
|
|
4533
|
-
// RFC 7845, RFC 6716, RFC 5574
|
|
4534
|
-
async load() {
|
|
4535
|
-
return (await import("./OggParser-5IYVBXPS.js")).OggParser;
|
|
4536
|
-
}
|
|
4537
|
-
};
|
|
4538
|
-
|
|
4539
|
-
// ../../node_modules/music-metadata/lib/wavpack/WavPackLoader.js
|
|
4540
|
-
init_shims();
|
|
4541
|
-
var wavpackParserLoader = {
|
|
4542
|
-
parserType: "wavpack",
|
|
4543
|
-
extensions: [".wv", ".wvp"],
|
|
4544
|
-
mimeTypes: ["audio/wavpack"],
|
|
4545
|
-
async load() {
|
|
4546
|
-
return (await import("./WavPackParser-RTEHKSJH.js")).WavPackParser;
|
|
4547
|
-
}
|
|
4548
|
-
};
|
|
4549
|
-
|
|
4550
|
-
// ../../node_modules/music-metadata/lib/wav/WaveLoader.js
|
|
4551
|
-
init_shims();
|
|
4552
|
-
var riffParserLoader = {
|
|
4553
|
-
parserType: "riff",
|
|
4554
|
-
extensions: [".wav", "wave", ".bwf"],
|
|
4555
|
-
mimeTypes: ["audio/vnd.wave", "audio/wav", "audio/wave"],
|
|
4556
|
-
async load() {
|
|
4557
|
-
return (await import("./WaveParser-3R2NLXGP.js")).WaveParser;
|
|
4558
|
-
}
|
|
4559
|
-
};
|
|
4560
|
-
|
|
4561
|
-
// ../../node_modules/music-metadata/lib/ParserFactory.js
|
|
4562
|
-
var debug3 = (0, import_debug3.default)("music-metadata:parser:factory");
|
|
4563
|
-
function parseHttpContentType(contentType) {
|
|
4564
|
-
const type = import_content_type.default.parse(contentType);
|
|
4565
|
-
const mime = (0, import_media_typer.parse)(type.type);
|
|
4566
|
-
return {
|
|
4567
|
-
type: mime.type,
|
|
4568
|
-
subtype: mime.subtype,
|
|
4569
|
-
suffix: mime.suffix,
|
|
4570
|
-
parameters: type.parameters
|
|
4571
|
-
};
|
|
4572
|
-
}
|
|
4573
|
-
var ParserFactory = class {
|
|
4574
|
-
constructor() {
|
|
4575
|
-
this.parsers = [];
|
|
4576
|
-
[
|
|
4577
|
-
flacParserLoader,
|
|
4578
|
-
mpegParserLoader,
|
|
4579
|
-
apeParserLoader,
|
|
4580
|
-
mp4ParserLoader,
|
|
4581
|
-
matroskaParserLoader,
|
|
4582
|
-
riffParserLoader,
|
|
4583
|
-
oggParserLoader,
|
|
4584
|
-
asfParserLoader,
|
|
4585
|
-
aiffParserLoader,
|
|
4586
|
-
wavpackParserLoader,
|
|
4587
|
-
musepackParserLoader,
|
|
4588
|
-
dsfParserLoader,
|
|
4589
|
-
dsdiffParserLoader
|
|
4590
|
-
].forEach((parser) => {
|
|
4591
|
-
this.registerParser(parser);
|
|
4592
|
-
});
|
|
4593
|
-
}
|
|
4594
|
-
registerParser(parser) {
|
|
4595
|
-
this.parsers.push(parser);
|
|
4596
|
-
}
|
|
4597
|
-
async parse(tokenizer, parserLoader, opts) {
|
|
4598
|
-
if (tokenizer.supportsRandomAccess()) {
|
|
4599
|
-
debug3("tokenizer supports random-access, scanning for appending headers");
|
|
4600
|
-
await scanAppendingHeaders(tokenizer, opts);
|
|
4601
|
-
} else {
|
|
4602
|
-
debug3("tokenizer does not support random-access, cannot scan for appending headers");
|
|
4603
|
-
}
|
|
4604
|
-
if (!parserLoader) {
|
|
4605
|
-
const buf = new Uint8Array(4100);
|
|
4606
|
-
if (tokenizer.fileInfo.mimeType) {
|
|
4607
|
-
parserLoader = this.findLoaderForContentType(tokenizer.fileInfo.mimeType);
|
|
4608
|
-
}
|
|
4609
|
-
if (!parserLoader && tokenizer.fileInfo.path) {
|
|
4610
|
-
parserLoader = this.findLoaderForExtension(tokenizer.fileInfo.path);
|
|
4611
|
-
}
|
|
4612
|
-
if (!parserLoader) {
|
|
4613
|
-
debug3("Guess parser on content...");
|
|
4614
|
-
await tokenizer.peekBuffer(buf, { mayBeLess: true });
|
|
4615
|
-
const guessedType = await fileTypeFromBuffer(buf, { mpegOffsetTolerance: 10 });
|
|
4616
|
-
if (!guessedType || !guessedType.mime) {
|
|
4617
|
-
throw new CouldNotDetermineFileTypeError("Failed to determine audio format");
|
|
4618
|
-
}
|
|
4619
|
-
debug3(`Guessed file type is mime=${guessedType.mime}, extension=${guessedType.ext}`);
|
|
4620
|
-
parserLoader = this.findLoaderForContentType(guessedType.mime);
|
|
4621
|
-
if (!parserLoader) {
|
|
4622
|
-
throw new UnsupportedFileTypeError(`Guessed MIME-type not supported: ${guessedType.mime}`);
|
|
4623
|
-
}
|
|
4624
|
-
}
|
|
4625
|
-
}
|
|
4626
|
-
debug3(`Loading ${parserLoader.parserType} parser...`);
|
|
4627
|
-
const metadata = new MetadataCollector(opts);
|
|
4628
|
-
const ParserImpl = await parserLoader.load();
|
|
4629
|
-
const parser = new ParserImpl(metadata, tokenizer, opts ?? {});
|
|
4630
|
-
debug3(`Parser ${parserLoader.parserType} loaded`);
|
|
4631
|
-
await parser.parse();
|
|
4632
|
-
if (metadata.format.trackInfo) {
|
|
4633
|
-
if (metadata.format.hasAudio === void 0) {
|
|
4634
|
-
metadata.setFormat("hasAudio", !!metadata.format.trackInfo.find((track) => track.type === TrackType.audio));
|
|
4635
|
-
}
|
|
4636
|
-
if (metadata.format.hasVideo === void 0) {
|
|
4637
|
-
metadata.setFormat("hasVideo", !!metadata.format.trackInfo.find((track) => track.type === TrackType.video));
|
|
4638
|
-
}
|
|
4639
|
-
}
|
|
4640
|
-
return metadata.toCommonMetadata();
|
|
4641
|
-
}
|
|
4642
|
-
/**
|
|
4643
|
-
* @param filePath - Path, filename or extension to audio file
|
|
4644
|
-
* @return Parser submodule name
|
|
4645
|
-
*/
|
|
4646
|
-
findLoaderForExtension(filePath) {
|
|
4647
|
-
if (!filePath)
|
|
4648
|
-
return;
|
|
4649
|
-
const extension = getExtension(filePath).toLocaleLowerCase() || filePath;
|
|
4650
|
-
return this.parsers.find((parser) => parser.extensions.indexOf(extension) !== -1);
|
|
4651
|
-
}
|
|
4652
|
-
findLoaderForContentType(httpContentType) {
|
|
4653
|
-
let mime;
|
|
4654
|
-
if (!httpContentType)
|
|
4655
|
-
return;
|
|
4656
|
-
try {
|
|
4657
|
-
mime = parseHttpContentType(httpContentType);
|
|
4658
|
-
} catch (_err) {
|
|
4659
|
-
debug3(`Invalid HTTP Content-Type header value: ${httpContentType}`);
|
|
4660
|
-
return;
|
|
4661
|
-
}
|
|
4662
|
-
const subType = mime.subtype.indexOf("x-") === 0 ? mime.subtype.substring(2) : mime.subtype;
|
|
4663
|
-
return this.parsers.find((parser) => parser.mimeTypes.find((loader) => loader.indexOf(`${mime.type}/${subType}`) !== -1));
|
|
4664
|
-
}
|
|
4665
|
-
getSupportedMimeTypes() {
|
|
4666
|
-
const mimeTypeSet = /* @__PURE__ */ new Set();
|
|
4667
|
-
this.parsers.forEach((loader) => {
|
|
4668
|
-
loader.mimeTypes.forEach((mimeType) => {
|
|
4669
|
-
mimeTypeSet.add(mimeType);
|
|
4670
|
-
mimeTypeSet.add(mimeType.replace("/", "/x-"));
|
|
4671
|
-
});
|
|
4672
|
-
});
|
|
4673
|
-
return Array.from(mimeTypeSet);
|
|
4674
|
-
}
|
|
4675
|
-
};
|
|
4676
|
-
function getExtension(fname) {
|
|
4677
|
-
const i = fname.lastIndexOf(".");
|
|
4678
|
-
return i === -1 ? "" : fname.substring(i);
|
|
4679
|
-
}
|
|
4680
|
-
|
|
4681
|
-
// ../../node_modules/music-metadata/lib/lyrics3/Lyrics3.js
|
|
4682
|
-
init_shims();
|
|
4683
|
-
var endTag2 = "LYRICS200";
|
|
4684
|
-
async function getLyricsHeaderLength(tokenizer) {
|
|
4685
|
-
const fileSize = tokenizer.fileInfo.size;
|
|
4686
|
-
if (fileSize >= 143) {
|
|
4687
|
-
const buf = new Uint8Array(15);
|
|
4688
|
-
const position = tokenizer.position;
|
|
4689
|
-
await tokenizer.readBuffer(buf, { position: fileSize - 143 });
|
|
4690
|
-
tokenizer.setPosition(position);
|
|
4691
|
-
const txt = textDecode(buf, "latin1");
|
|
4692
|
-
const tag = txt.substring(6);
|
|
4693
|
-
if (tag === endTag2) {
|
|
4694
|
-
return Number.parseInt(txt.substring(0, 6), 10) + 15;
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
return 0;
|
|
4698
|
-
}
|
|
4699
|
-
|
|
4700
|
-
// ../../node_modules/music-metadata/lib/core.js
|
|
4701
|
-
async function parseBuffer(uint8Array, fileInfo, options = {}) {
|
|
4702
|
-
const tokenizer = fromBuffer(uint8Array, { fileInfo: typeof fileInfo === "string" ? { mimeType: fileInfo } : fileInfo });
|
|
4703
|
-
return parseFromTokenizer(tokenizer, options);
|
|
4704
|
-
}
|
|
4705
|
-
function parseFromTokenizer(tokenizer, options) {
|
|
4706
|
-
const parserFactory = new ParserFactory();
|
|
4707
|
-
return parserFactory.parse(tokenizer, void 0, options);
|
|
4708
|
-
}
|
|
4709
|
-
async function scanAppendingHeaders(tokenizer, options = {}) {
|
|
4710
|
-
let apeOffset = tokenizer.fileInfo.size;
|
|
4711
|
-
if (await hasID3v1Header(tokenizer)) {
|
|
4712
|
-
apeOffset -= 128;
|
|
4713
|
-
const lyricsLen = await getLyricsHeaderLength(tokenizer);
|
|
4714
|
-
apeOffset -= lyricsLen;
|
|
4715
|
-
}
|
|
4716
|
-
options.apeHeader = await APEv2Parser.findApeFooterOffset(tokenizer, apeOffset);
|
|
4717
|
-
}
|
|
4718
|
-
|
|
4719
|
-
// src/matrix/send/media.ts
|
|
4720
|
-
var getCore = () => getMatrixRuntime();
|
|
4721
|
-
function buildMatrixMediaInfo(params) {
|
|
4722
|
-
const base = {};
|
|
4723
|
-
if (Number.isFinite(params.size)) {
|
|
4724
|
-
base.size = params.size;
|
|
4725
|
-
}
|
|
4726
|
-
if (params.mimetype) {
|
|
4727
|
-
base.mimetype = params.mimetype;
|
|
4728
|
-
}
|
|
4729
|
-
if (params.imageInfo) {
|
|
4730
|
-
const dimensional = {
|
|
4731
|
-
...base,
|
|
4732
|
-
...params.imageInfo
|
|
4733
|
-
};
|
|
4734
|
-
if (typeof params.durationMs === "number") {
|
|
4735
|
-
const videoInfo = {
|
|
4736
|
-
...dimensional,
|
|
4737
|
-
duration: params.durationMs
|
|
4738
|
-
};
|
|
4739
|
-
return videoInfo;
|
|
4740
|
-
}
|
|
4741
|
-
return dimensional;
|
|
4742
|
-
}
|
|
4743
|
-
if (typeof params.durationMs === "number") {
|
|
4744
|
-
const timedInfo = {
|
|
4745
|
-
...base,
|
|
4746
|
-
duration: params.durationMs
|
|
4747
|
-
};
|
|
4748
|
-
return timedInfo;
|
|
4749
|
-
}
|
|
4750
|
-
if (Object.keys(base).length === 0) {
|
|
4751
|
-
return void 0;
|
|
4752
|
-
}
|
|
4753
|
-
return base;
|
|
4754
|
-
}
|
|
4755
|
-
function buildMediaContent(params) {
|
|
4756
|
-
const info = buildMatrixMediaInfo({
|
|
4757
|
-
size: params.size,
|
|
4758
|
-
mimetype: params.mimetype,
|
|
4759
|
-
durationMs: params.durationMs,
|
|
4760
|
-
imageInfo: params.imageInfo
|
|
4761
|
-
});
|
|
4762
|
-
const base = {
|
|
4763
|
-
msgtype: params.msgtype,
|
|
4764
|
-
body: params.body,
|
|
4765
|
-
filename: params.filename,
|
|
4766
|
-
info: info ?? void 0
|
|
4767
|
-
};
|
|
4768
|
-
if (!params.file && params.url) {
|
|
4769
|
-
base.url = params.url;
|
|
4770
|
-
}
|
|
4771
|
-
if (params.file) {
|
|
4772
|
-
base.file = params.file;
|
|
4773
|
-
}
|
|
4774
|
-
if (params.isVoice) {
|
|
4775
|
-
base["org.matrix.msc3245.voice"] = {};
|
|
4776
|
-
if (typeof params.durationMs === "number") {
|
|
4777
|
-
base["org.matrix.msc1767.audio"] = {
|
|
4778
|
-
duration: params.durationMs
|
|
4779
|
-
};
|
|
4780
|
-
}
|
|
4781
|
-
}
|
|
4782
|
-
if (params.relation) {
|
|
4783
|
-
base["m.relates_to"] = params.relation;
|
|
4784
|
-
}
|
|
4785
|
-
return base;
|
|
4786
|
-
}
|
|
4787
|
-
var THUMBNAIL_MAX_SIDE = 800;
|
|
4788
|
-
var THUMBNAIL_QUALITY = 80;
|
|
4789
|
-
async function prepareImageInfo(params) {
|
|
4790
|
-
const meta = await getCore().media.getImageMetadata(params.buffer).catch(() => null);
|
|
4791
|
-
if (!meta) {
|
|
4792
|
-
return void 0;
|
|
4793
|
-
}
|
|
4794
|
-
const imageInfo = { w: meta.width, h: meta.height };
|
|
4795
|
-
const maxDim = Math.max(meta.width, meta.height);
|
|
4796
|
-
if (maxDim > THUMBNAIL_MAX_SIDE) {
|
|
4797
|
-
try {
|
|
4798
|
-
const thumbBuffer = await getCore().media.resizeToJpeg({
|
|
4799
|
-
buffer: params.buffer,
|
|
4800
|
-
maxSide: THUMBNAIL_MAX_SIDE,
|
|
4801
|
-
quality: THUMBNAIL_QUALITY,
|
|
4802
|
-
withoutEnlargement: true
|
|
4803
|
-
});
|
|
4804
|
-
const thumbMeta = await getCore().media.getImageMetadata(thumbBuffer).catch(() => null);
|
|
4805
|
-
const result = await uploadMediaWithEncryption(params.client, thumbBuffer, {
|
|
4806
|
-
contentType: "image/jpeg",
|
|
4807
|
-
filename: "thumbnail.jpg",
|
|
4808
|
-
encrypted: params.encrypted === true
|
|
4809
|
-
});
|
|
4810
|
-
if (result.file) {
|
|
4811
|
-
imageInfo.thumbnail_file = result.file;
|
|
4812
|
-
} else {
|
|
4813
|
-
imageInfo.thumbnail_url = result.url;
|
|
4814
|
-
}
|
|
4815
|
-
if (thumbMeta) {
|
|
4816
|
-
imageInfo.thumbnail_info = {
|
|
4817
|
-
w: thumbMeta.width,
|
|
4818
|
-
h: thumbMeta.height,
|
|
4819
|
-
mimetype: "image/jpeg",
|
|
4820
|
-
size: thumbBuffer.byteLength
|
|
4821
|
-
};
|
|
4822
|
-
}
|
|
4823
|
-
} catch {
|
|
4824
|
-
}
|
|
4825
|
-
}
|
|
4826
|
-
return imageInfo;
|
|
4827
|
-
}
|
|
4828
|
-
async function resolveMediaDurationMs(params) {
|
|
4829
|
-
if (params.kind !== "audio" && params.kind !== "video") {
|
|
4830
|
-
return void 0;
|
|
4831
|
-
}
|
|
4832
|
-
try {
|
|
4833
|
-
const fileInfo = params.contentType || params.fileName ? {
|
|
4834
|
-
mimeType: params.contentType,
|
|
4835
|
-
size: params.buffer.byteLength,
|
|
4836
|
-
path: params.fileName
|
|
4837
|
-
} : void 0;
|
|
4838
|
-
const metadata = await parseBuffer(params.buffer, fileInfo, {
|
|
4839
|
-
duration: true,
|
|
4840
|
-
skipCovers: true
|
|
4841
|
-
});
|
|
4842
|
-
const durationSeconds = metadata.format.duration;
|
|
4843
|
-
if (typeof durationSeconds === "number" && Number.isFinite(durationSeconds)) {
|
|
4844
|
-
return Math.max(0, Math.round(durationSeconds * 1e3));
|
|
4845
|
-
}
|
|
4846
|
-
} catch {
|
|
4847
|
-
}
|
|
4848
|
-
return void 0;
|
|
4849
|
-
}
|
|
4850
|
-
async function uploadFile(client, file, params) {
|
|
4851
|
-
return await client.uploadContent(file, params.contentType, params.filename);
|
|
4852
|
-
}
|
|
4853
|
-
async function uploadMediaWithEncryption(client, buffer, params) {
|
|
4854
|
-
if (params.encrypted && client.crypto) {
|
|
4855
|
-
const encrypted = await client.crypto.encryptMedia(buffer);
|
|
4856
|
-
const mxc2 = await client.uploadContent(encrypted.buffer, params.contentType, params.filename);
|
|
4857
|
-
const file = { url: mxc2, ...encrypted.file };
|
|
4858
|
-
return {
|
|
4859
|
-
url: mxc2,
|
|
4860
|
-
file
|
|
4861
|
-
};
|
|
4862
|
-
}
|
|
4863
|
-
const mxc = await uploadFile(client, buffer, params);
|
|
4864
|
-
return { url: mxc };
|
|
4865
|
-
}
|
|
4866
|
-
async function uploadMediaMaybeEncrypted(client, roomId, buffer, params) {
|
|
4867
|
-
const isEncrypted = Boolean(client.crypto && await client.crypto.isRoomEncrypted(roomId));
|
|
4868
|
-
return await uploadMediaWithEncryption(client, buffer, {
|
|
4869
|
-
...params,
|
|
4870
|
-
encrypted: isEncrypted
|
|
4871
|
-
});
|
|
4872
|
-
}
|
|
4873
|
-
|
|
4874
|
-
export {
|
|
4875
|
-
buildMatrixMediaInfo,
|
|
4876
|
-
buildMediaContent,
|
|
4877
|
-
prepareImageInfo,
|
|
4878
|
-
resolveMediaDurationMs,
|
|
4879
|
-
uploadMediaMaybeEncrypted
|
|
4880
|
-
};
|
|
4881
|
-
/*! Bundled license information:
|
|
4882
|
-
|
|
4883
|
-
media-typer/index.js:
|
|
4884
|
-
(*!
|
|
4885
|
-
* media-typer
|
|
4886
|
-
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
4887
|
-
* MIT Licensed
|
|
4888
|
-
*)
|
|
4889
|
-
*/
|
|
4890
|
-
//# sourceMappingURL=chunk-G46GHNDU.js.map
|