f7cloud_client/apps/assistant/js/MediaField-DHoRej3P.chunk.mjs.map
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

1 line
602 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"MediaField-DHoRej3P.chunk.mjs","sources":["../node_modules/vue-material-design-icons/Close.vue","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/ShareVariant.vue","../node_modules/vue-material-design-icons/ContentSaveOutline.vue","../src/components/fields/AudioDisplay.vue","../src/components/fields/ImageDisplay.vue","../src/components/fields/FileDisplay.vue","../node_modules/vue-material-design-icons/Check.vue","../node_modules/vue-material-design-icons/MicrophoneOutline.vue","../node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js","../node_modules/fast-unique-numbers/build/es2019/factories/cache.js","../node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js","../node_modules/fast-unique-numbers/build/es2019/module.js","../node_modules/broker-factory/build/es2019/guards/message-port.js","../node_modules/broker-factory/build/es2019/helpers/port-map.js","../node_modules/broker-factory/build/es2019/helpers/extend-broker-implementation.js","../node_modules/broker-factory/build/es2019/module.js","../node_modules/media-encoder-host-broker/build/es2019/module.js","../node_modules/media-encoder-host/build/es2019/worker/worker.js","../node_modules/media-encoder-host/build/es2019/module.js","../node_modules/extendable-media-recorder/build/es2019/factories/blob-event-factory.js","../node_modules/extendable-media-recorder/build/es2019/factories/decode-web-m-chunk.js","../node_modules/extendable-media-recorder/build/es2019/factories/event-target-constructor.js","../node_modules/extendable-media-recorder/build/es2019/factories/event-target-factory.js","../node_modules/extendable-media-recorder/build/es2019/factories/invalid-modification-error.js","../node_modules/extendable-media-recorder/build/es2019/factories/invalid-state-error.js","../node_modules/extendable-media-recorder/build/es2019/factories/media-recorder-constructor.js","../node_modules/extendable-media-recorder/build/es2019/factories/native-blob-event-constructor.js","../node_modules/extendable-media-recorder/build/es2019/factories/native-media-recorder-constructor.js","../node_modules/extendable-media-recorder/build/es2019/factories/native-media-recorder-factory.js","../node_modules/extendable-media-recorder/build/es2019/factories/not-supported-error.js","../node_modules/extendable-media-recorder/build/es2019/factories/read-element-content.js","../node_modules/extendable-media-recorder/build/es2019/factories/read-element-type.js","../node_modules/extendable-media-recorder/build/es2019/factories/read-variable-size-integer.js","../node_modules/rxjs-interop/dist/esm/symbols.js","../node_modules/rxjs-interop/dist/esm/patch.js","../node_modules/rxjs-interop/dist/esm/to-observer.js","../node_modules/subscribable-things/build/es2019/factories/on.js","../node_modules/subscribable-things/build/es2019/factories/wrap-subscribe-function.js","../node_modules/subscribable-things/build/es2019/module.js","../node_modules/recorder-audio-worklet/build/es2019/factories/add-recorder-audio-worklet-module.js","../node_modules/recorder-audio-worklet/build/es2019/factories/listener.js","../node_modules/recorder-audio-worklet/build/es2019/factories/post-message-factory.js","../node_modules/recorder-audio-worklet/build/es2019/factories/recorder-audio-worklet-node-factory.js","../node_modules/recorder-audio-worklet/build/es2019/functions/validate-state.js","../node_modules/recorder-audio-worklet/build/es2019/worklet/worklet.js","../node_modules/recorder-audio-worklet/build/es2019/module.js","../node_modules/automation-events/build/es2019/functions/create-extended-exponential-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-extended-linear-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-set-value-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-set-value-curve-automation-event.js","../node_modules/automation-events/build/es2019/functions/get-target-value-at-time.js","../node_modules/automation-events/build/es2019/guards/exponential-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/guards/linear-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/guards/any-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/guards/set-value-automation-event.js","../node_modules/automation-events/build/es2019/guards/set-value-curve-automation-event.js","../node_modules/automation-events/build/es2019/functions/get-value-of-automation-event-at-index-at-time.js","../node_modules/automation-events/build/es2019/functions/get-end-time-and-value-of-previous-automation-event.js","../node_modules/automation-events/build/es2019/guards/cancel-and-hold-automation-event.js","../node_modules/automation-events/build/es2019/guards/cancel-scheduled-values-automation-event.js","../node_modules/automation-events/build/es2019/functions/get-event-time.js","../node_modules/automation-events/build/es2019/functions/get-exponential-ramp-value-at-time.js","../node_modules/automation-events/build/es2019/functions/get-linear-ramp-value-at-time.js","../node_modules/automation-events/build/es2019/functions/interpolate-value.js","../node_modules/automation-events/build/es2019/functions/get-value-curve-value-at-time.js","../node_modules/automation-events/build/es2019/guards/set-target-automation-event.js","../node_modules/automation-events/build/es2019/classes/automation-event-list.js","../node_modules/automation-events/build/es2019/functions/create-cancel-and-hold-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-cancel-scheduled-values-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-exponential-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-linear-ramp-to-value-automation-event.js","../node_modules/automation-events/build/es2019/functions/create-set-target-automation-event.js","../node_modules/standardized-audio-context/build/es2019/factories/abort-error.js","../node_modules/standardized-audio-context/build/es2019/factories/add-active-input-connection-to-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/add-audio-node-connections.js","../node_modules/standardized-audio-context/build/es2019/factories/add-audio-param-connections.js","../node_modules/standardized-audio-context/build/es2019/globals.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-constructible.js","../node_modules/standardized-audio-context/build/es2019/helpers/split-import-statements.js","../node_modules/standardized-audio-context/build/es2019/factories/add-audio-worklet-module.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-value-for-key.js","../node_modules/standardized-audio-context/build/es2019/helpers/pick-element-from-set.js","../node_modules/standardized-audio-context/build/es2019/helpers/delete-passive-input-connection-to-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-event-listeners-of-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/set-internal-state-to-active.js","../node_modules/standardized-audio-context/build/es2019/guards/audio-worklet-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/set-internal-state-to-passive.js","../node_modules/standardized-audio-context/build/es2019/helpers/set-internal-state-to-passive-when-necessary.js","../node_modules/standardized-audio-context/build/es2019/factories/add-connection-to-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/add-passive-input-connection-to-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/add-silent-connection.js","../node_modules/standardized-audio-context/build/es2019/factories/add-unrendered-audio-worklet-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-owned-by-context.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-buffer-copy-channel-methods-out-of-bounds-support.js","../node_modules/standardized-audio-context/build/es2019/factories/index-size-error.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-buffer-get-channel-data-method.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-buffer-constructor.js","../node_modules/standardized-audio-context/build/es2019/constants.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-active-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-buffer-source-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-buffer-source-node-renderer-factory.js","../node_modules/standardized-audio-context/build/es2019/guards/audio-buffer-source-node.js","../node_modules/standardized-audio-context/build/es2019/guards/biquad-filter-node.js","../node_modules/standardized-audio-context/build/es2019/guards/constant-source-node.js","../node_modules/standardized-audio-context/build/es2019/guards/gain-node.js","../node_modules/standardized-audio-context/build/es2019/guards/oscillator-node.js","../node_modules/standardized-audio-context/build/es2019/guards/stereo-panner-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-audio-node-connections.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-audio-param-connections.js","../node_modules/standardized-audio-context/build/es2019/helpers/deactivate-active-audio-node-input-connections.js","../node_modules/standardized-audio-context/build/es2019/helpers/deactivate-audio-graph.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-valid-latency-hint.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-destination-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-destination-node-renderer-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-listener-factory.js","../node_modules/standardized-audio-context/build/es2019/guards/audio-node.js","../node_modules/standardized-audio-context/build/es2019/guards/audio-node-output-connection.js","../node_modules/standardized-audio-context/build/es2019/helpers/insert-element-in-set.js","../node_modules/standardized-audio-context/build/es2019/helpers/add-active-input-connection-to-audio-param.js","../node_modules/standardized-audio-context/build/es2019/helpers/add-passive-input-connection-to-audio-param.js","../node_modules/standardized-audio-context/build/es2019/guards/native-audio-node-faker.js","../node_modules/standardized-audio-context/build/es2019/helpers/connect-native-audio-node-to-native-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/delete-active-input-connection.js","../node_modules/standardized-audio-context/build/es2019/helpers/delete-active-input-connection-to-audio-param.js","../node_modules/standardized-audio-context/build/es2019/helpers/delete-event-listeners-of-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/delete-passive-input-connection-to-audio-param.js","../node_modules/standardized-audio-context/build/es2019/helpers/disconnect-native-audio-node-from-native-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-native-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-native-audio-param.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-part-of-a-cycle.js","../node_modules/standardized-audio-context/build/es2019/helpers/is-passive-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-node-disconnect-method-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/visit-each-audio-node-once.js","../node_modules/standardized-audio-context/build/es2019/guards/native-audio-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-node-disconnect-method.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-param-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-param-renderer.js","../node_modules/standardized-audio-context/build/es2019/read-only-map.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-worklet-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/helpers/copy-from-channel.js","../node_modules/standardized-audio-context/build/es2019/helpers/copy-to-channel.js","../node_modules/standardized-audio-context/build/es2019/helpers/create-nested-arrays.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-audio-worklet-processor.js","../node_modules/standardized-audio-context/build/es2019/factories/audio-worklet-node-renderer-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/cache-test-result.js","../node_modules/standardized-audio-context/build/es2019/factories/connect-audio-param.js","../node_modules/standardized-audio-context/build/es2019/factories/connect-multiple-outputs.js","../node_modules/standardized-audio-context/build/es2019/factories/convert-number-to-unsigned-long.js","../node_modules/standardized-audio-context/build/es2019/factories/decrement-cycle-counter.js","../node_modules/standardized-audio-context/build/es2019/factories/delete-active-input-connection-to-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/delete-unrendered-audio-worklet-node.js","../node_modules/standardized-audio-context/build/es2019/guards/delay-node.js","../node_modules/standardized-audio-context/build/es2019/factories/detect-cycles.js","../node_modules/standardized-audio-context/build/es2019/factories/disconnect-multiple-outputs.js","../node_modules/standardized-audio-context/build/es2019/factories/evaluate-source.js","../node_modules/standardized-audio-context/build/es2019/factories/event-target-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/expose-current-frame-and-current-time.js","../node_modules/standardized-audio-context/build/es2019/factories/fetch-source.js","../node_modules/standardized-audio-context/build/es2019/factories/get-active-audio-worklet-node-inputs.js","../node_modules/standardized-audio-context/build/es2019/factories/get-audio-node-renderer.js","../node_modules/standardized-audio-context/build/es2019/factories/get-audio-node-tail-time.js","../node_modules/standardized-audio-context/build/es2019/factories/get-audio-param-renderer.js","../node_modules/standardized-audio-context/build/es2019/factories/get-backup-offline-audio-context.js","../node_modules/standardized-audio-context/build/es2019/factories/invalid-state-error.js","../node_modules/standardized-audio-context/build/es2019/factories/get-native-context.js","../node_modules/standardized-audio-context/build/es2019/factories/get-or-create-backup-offline-audio-context.js","../node_modules/standardized-audio-context/build/es2019/factories/get-unrendered-audio-worklet-nodes.js","../node_modules/standardized-audio-context/build/es2019/factories/invalid-access-error.js","../node_modules/standardized-audio-context/build/es2019/factories/increment-cycle-counter-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/is-native-audio-context.js","../node_modules/standardized-audio-context/build/es2019/factories/is-native-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/is-native-audio-param.js","../node_modules/standardized-audio-context/build/es2019/factories/is-native-offline-audio-context.js","../node_modules/standardized-audio-context/build/es2019/factories/is-secure-context.js","../node_modules/standardized-audio-context/build/es2019/factories/media-stream-audio-source-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/minimal-audio-context-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/minimal-base-audio-context-constructor.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-promise-support.js","../node_modules/standardized-audio-context/build/es2019/factories/monitor-connections.js","../node_modules/standardized-audio-context/build/es2019/helpers/assign-native-audio-node-option.js","../node_modules/standardized-audio-context/build/es2019/helpers/assign-native-audio-node-options.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-buffer-constructor.js","../node_modules/standardized-audio-context/build/es2019/helpers/assign-native-audio-node-audio-param-value.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-buffer-source-node-start-method-consecutive-calls.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-scheduled-source-node-start-method-negative-parameters.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-scheduled-source-node-stop-method-negative-parameters.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-buffer-source-node-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-context-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-destination-node.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-worklet-node-constructor.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-clonability-of-audio-worklet-node-options.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-worklet-node-factory.js","../node_modules/standardized-audio-context/build/es2019/helpers/compute-buffer-size.js","../node_modules/standardized-audio-context/build/es2019/helpers/clone-audio-worklet-node-options.js","../node_modules/standardized-audio-context/build/es2019/helpers/create-audio-worklet-processor-promise.js","../node_modules/standardized-audio-context/build/es2019/helpers/create-audio-worklet-processor.js","../node_modules/standardized-audio-context/build/es2019/factories/native-audio-worklet-node-faker-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/native-channel-merger-node-factory.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-channel-splitter-node.js","../node_modules/standardized-audio-context/build/es2019/factories/native-channel-splitter-node.js","../node_modules/standardized-audio-context/build/es2019/factories/native-constant-source-node-factory.js","../node_modules/standardized-audio-context/build/es2019/helpers/intercept-connections.js","../node_modules/standardized-audio-context/build/es2019/factories/native-constant-source-node-faker-factory.js","../node_modules/standardized-audio-context/build/es2019/factories/native-gain-node.js","../node_modules/standardized-audio-context/build/es2019/factories/native-media-stream-audio-source-node.js","../node_modules/standardized-audio-context/build/es2019/factories/native-offline-audio-context-constructor.js","../node_modules/standardized-audio-context/build/es2019/factories/native-script-processor-node.js","../node_modules/standardized-audio-context/build/es2019/factories/not-supported-error.js","../node_modules/standardized-audio-context/build/es2019/factories/render-automation.js","../node_modules/standardized-audio-context/build/es2019/factories/render-inputs-of-audio-node.js","../node_modules/standardized-audio-context/build/es2019/factories/render-inputs-of-audio-param.js","../node_modules/standardized-audio-context/build/es2019/factories/render-native-offline-audio-context.js","../node_modules/standardized-audio-context/build/es2019/factories/set-active-audio-worklet-node-inputs.js","../node_modules/standardized-audio-context/build/es2019/factories/test-audio-buffer-constructor-support.js","../node_modules/standardized-audio-context/build/es2019/factories/test-audio-worklet-processor-post-message-support.js","../node_modules/standardized-audio-context/build/es2019/factories/test-offline-audio-context-current-time-support.js","../node_modules/standardized-audio-context/build/es2019/factories/unknown-error.js","../node_modules/standardized-audio-context/build/es2019/factories/window.js","../node_modules/standardized-audio-context/build/es2019/factories/wrap-audio-buffer-copy-channel-methods.js","../node_modules/standardized-audio-context/build/es2019/factories/wrap-audio-buffer-copy-channel-methods-out-of-bounds.js","../node_modules/standardized-audio-context/build/es2019/factories/wrap-audio-buffer-source-node-stop-method-nullified-buffer.js","../node_modules/standardized-audio-context/build/es2019/factories/wrap-channel-merger-node.js","../node_modules/standardized-audio-context/build/es2019/helpers/get-first-sample.js","../node_modules/standardized-audio-context/build/es2019/helpers/overwrite-accessors.js","../node_modules/standardized-audio-context/build/es2019/helpers/sanitize-audio-worklet-node-options.js","../node_modules/standardized-audio-context/build/es2019/helpers/set-value-at-time-until-possible.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-buffer-source-node-start-method-consecutive-calls-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-buffer-source-node-start-method-offset-clamping-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-buffer-source-node-stop-method-nullified-buffer-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-scheduled-source-node-start-method-negative-parameters-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-scheduled-source-node-stop-method-consecutive-calls-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-scheduled-source-node-stop-method-negative-parameters-support.js","../node_modules/standardized-audio-context/build/es2019/helpers/test-audio-worklet-node-options-clonability.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-buffer-source-node-start-method-offset-clamping.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-audio-scheduled-source-node-stop-method-consecutive-calls.js","../node_modules/standardized-audio-context/build/es2019/helpers/wrap-event-listener.js","../node_modules/standardized-audio-context/build/es2019/module.js","../node_modules/extendable-media-recorder/build/es2019/factories/web-audio-media-recorder.js","../node_modules/multi-buffer-data-view/build/es2019/classes/multi-buffer-data-view.js","../node_modules/extendable-media-recorder/build/es2019/factories/webm-pcm-media-recorder.js","../node_modules/extendable-media-recorder/build/es2019/factories/window.js","../node_modules/extendable-media-recorder/build/es2019/functions/read-variable-size-integer-length.js","../node_modules/extendable-media-recorder/build/es2019/functions/wrap-event-listener.js","../node_modules/extendable-media-recorder/build/es2019/module.js","../node_modules/extendable-media-recorder-wav-encoder-broker/build/es2019/module.js","../node_modules/extendable-media-recorder-wav-encoder/build/es2019/worker/worker.js","../node_modules/extendable-media-recorder-wav-encoder/build/es2019/module.js","../src/components/fields/AudioRecorderWrapper.vue","../node_modules/vue-material-design-icons/UploadOutline.vue","../src/components/fields/UploadInputFileButton.vue","../node_modules/vue-material-design-icons/FolderPlusOutline.vue","../src/components/fields/ChooseInputFileButton.vue","../src/components/fields/MediaField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon close-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CloseIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon tray-arrow-down-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"TrayArrowDownIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon share-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"ShareVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon content-save-outline-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3M19 19H5V5H16.17L19 7.83V19M12 12C10.34 12 9 13.34 9 15S10.34 18 12 18 15 16.66 15 15 13.66 12 12 12M6 6H15V10H6V6Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"ContentSaveOutlineIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<audio :src=\"audioUrl\"\n\t\tcontrols\n\t\t:autoplay=\"autoplay\"\n\t\t:class=\"{ shadowed: isOutput }\" />\n</template>\n\n<script>\nimport { generateOcsUrl } from '@nextcloud/router'\n// import { getRequestToken } from '@nextcloud/auth'\n\nexport default {\n\tname: 'AudioDisplay',\n\n\tcomponents: {\n\t},\n\n\tprops: {\n\t\tfileId: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\ttaskId: {\n\t\t\ttype: [Number, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tisOutput: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tautoplay: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [],\n\n\tdata() {\n\t\treturn {\n\t\t}\n\t},\n\n\tcomputed: {\n\t\taudioUrl() {\n\t\t\t// the assistant endpoint gets the file with the correct mimetype\n\t\t\treturn this.isOutput\n\t\t\t\t/*\n\t\t\t\t? generateOcsUrl('taskprocessing/tasks/{taskId}/file/{fileId}?requesttoken={rToken}', {\n\t\t\t\t\ttaskId: this.taskId,\n\t\t\t\t\tfileId: this.fileId,\n\t\t\t\t\trToken: getRequestToken(),\n\t\t\t\t})\n\t\t\t\t*/\n\t\t\t\t? generateOcsUrl('apps/assistant/api/v1/task/{taskId}/output-file/{fileId}/download', {\n\t\t\t\t\ttaskId: this.taskId,\n\t\t\t\t\tfileId: this.fileId,\n\t\t\t\t})\n\t\t\t\t: generateOcsUrl('apps/assistant/api/v1/file/{fileId}/display', { fileId: this.fileId })\n\t\t},\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t\tconsole.debug('CURRENT TASK', this.taskId)\n\t},\n\n\tmethods: {\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\naudio {\n\tborder-radius: 100px;\n\t&.shadowed {\n\t\tborder: 2px solid var(--color-primary-element);\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"image-display\">\n\t\t<img :src=\"imageUrl\"\n\t\t\t:style=\"style\"\n\t\t\t:class=\"{ clickable }\">\n\t</div>\n</template>\n\n<script>\nimport { generateOcsUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'ImageDisplay',\n\n\tcomponents: {\n\t},\n\n\tinject: [\n\t\t'providedCurrentTaskId',\n\t],\n\n\tprops: {\n\t\ttaskId: {\n\t\t\ttype: [Number, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tfileId: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tisOutput: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tborderRadius: {\n\t\t\ttype: [Number, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tclickable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [],\n\n\tdata() {\n\t\treturn {\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tmyCurrentTaskId() {\n\t\t\treturn this.taskId ?? this.providedCurrentTaskId()\n\t\t},\n\t\timageUrl() {\n\t\t\treturn this.isOutput\n\t\t\t\t? generateOcsUrl('apps/assistant/api/v1/task/{taskId}/output-file/{fileId}/preview?x=300&y=300', {\n\t\t\t\t\ttaskId: this.myCurrentTaskId,\n\t\t\t\t\tfileId: this.fileId,\n\t\t\t\t})\n\t\t\t\t: generateOcsUrl('apps/assistant/api/v1/file/{fileId}/display', { fileId: this.fileId })\n\t\t},\n\t\tstyle() {\n\t\t\treturn {\n\t\t\t\t'border-radius': this.borderRadius ? (this.borderRadius + 'px') : 'var(--border-radius-large)',\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t\tconsole.debug('CURRENT TASK', this.myCurrentTaskId)\n\t},\n\n\tmethods: {\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.image-display {\n\tdisplay: flex;\n\timg {\n\t\t// we could use object-fit:cover instead and keep width=200 but the image preview would just show a portion of the image\n\t\t// object-fit: cover;\n\t\t// width: 200px;\n\t\twidth: auto;\n\t\theight: 200px;\n\n\t\t&.clickable {\n\t\t\tcursor: pointer !important;\n\t\t}\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"file-display\">\n\t\t<div class=\"preview\">\n\t\t\t<img :src=\"imageUrl\" :class=\"{ clickable }\">\n\t\t\t<span v-if=\"fileName\"\n\t\t\t\tclass=\"file-name\"\n\t\t\t\t:title=\"fileName\">\n\t\t\t\t{{ fileName }}\n\t\t\t</span>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { generateOcsUrl, generateUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\n\nexport default {\n\tname: 'FileDisplay',\n\n\tcomponents: {\n\t},\n\n\tinject: [\n\t\t'providedCurrentTaskId',\n\t],\n\n\tprops: {\n\t\ttaskId: {\n\t\t\ttype: [Number, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tfileId: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tisOutput: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tclickable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [],\n\n\tdata() {\n\t\treturn {\n\t\t\tfileInfo: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tmyCurrentTaskId() {\n\t\t\treturn this.taskId ?? this.providedCurrentTaskId()\n\t\t},\n\t\timageUrl() {\n\t\t\t// TODO find a way to get a preview for an output file (no mimetype because it's deduced from the name in core)\n\t\t\treturn this.isOutput\n\t\t\t\t? generateOcsUrl('apps/assistant/api/v1/task/{taskId}/output-file/{fileId}/preview', {\n\t\t\t\t\ttaskId: this.myCurrentTaskId,\n\t\t\t\t\tfileId: this.fileId,\n\t\t\t\t})\n\t\t\t\t: generateUrl('core/preview?fileId={fileId}&x=100&y=100&mimeFallback=true&a=0', { fileId: this.fileId })\n\t\t},\n\t\tfileName() {\n\t\t\treturn this.fileInfo?.name\n\t\t},\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t\tconsole.debug('CURRENT TASK', this.myCurrentTaskId)\n\t\tthis.getFileInfo()\n\t},\n\n\tmethods: {\n\t\tgetFileInfo() {\n\t\t\tconst url = generateOcsUrl('apps/assistant/api/v1/file/{fileId}/info', { fileId: this.fileId })\n\t\t\taxios.get(url)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tthis.fileInfo = response.data.ocs.data\n\t\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.file-display {\n\tdisplay: flex;\n\t.preview {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\timg {\n\t\t\twidth: 100px;\n\n\t\t\t&.clickable {\n\t\t\t\tcursor: pointer !important;\n\t\t\t}\n\t\t}\n\t\t.file-name {\n\t\t\tmax-width: 100px;\n\t\t\tmax-height: 100px;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t}\n}\n</style>\n","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon check-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CheckIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon microphone-outline-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M17.3,11C17.3,14 14.76,16.1 12,16.1C9.24,16.1 6.7,14 6.7,11H5C5,14.41 7.72,17.23 11,17.72V21H13V17.72C16.28,17.23 19,14.41 19,11M10.8,4.9C10.8,4.24 11.34,3.7 12,3.7C12.66,3.7 13.2,4.24 13.2,4.9L13.19,11.1C13.19,11.76 12.66,12.3 12,12.3C11.34,12.3 10.8,11.76 10.8,11.1M12,14A3,3 0 0,0 15,11V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V11A3,3 0 0,0 12,14Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"MicrophoneOutlineIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","export const createAddUniqueNumber = (generateUniqueNumber) => {\n return (set) => {\n const number = generateUniqueNumber(set);\n set.add(number);\n return number;\n };\n};\n//# sourceMappingURL=add-unique-number.js.map","export const createCache = (lastNumberWeakMap) => {\n return (collection, nextNumber) => {\n lastNumberWeakMap.set(collection, nextNumber);\n return nextNumber;\n };\n};\n//# sourceMappingURL=cache.js.map","/*\n * The value of the constant Number.MAX_SAFE_INTEGER equals (2 ** 53 - 1) but it\n * is fairly new.\n */\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER === undefined ? 9007199254740991 : Number.MAX_SAFE_INTEGER;\nconst TWO_TO_THE_POWER_OF_TWENTY_NINE = 536870912;\nconst TWO_TO_THE_POWER_OF_THIRTY = TWO_TO_THE_POWER_OF_TWENTY_NINE * 2;\nexport const createGenerateUniqueNumber = (cache, lastNumberWeakMap) => {\n return (collection) => {\n const lastNumber = lastNumberWeakMap.get(collection);\n /*\n * Let's try the cheapest algorithm first. It might fail to produce a new\n * number, but it is so cheap that it is okay to take the risk. Just\n * increase the last number by one or reset it to 0 if we reached the upper\n * bound of SMIs (which stands for small integers). When the last number is\n * unknown it is assumed that the collection contains zero based consecutive\n * numbers.\n */\n let nextNumber = lastNumber === undefined ? collection.size : lastNumber < TWO_TO_THE_POWER_OF_THIRTY ? lastNumber + 1 : 0;\n if (!collection.has(nextNumber)) {\n return cache(collection, nextNumber);\n }\n /*\n * If there are less than half of 2 ** 30 numbers stored in the collection,\n * the chance to generate a new random number in the range from 0 to 2 ** 30\n * is at least 50%. It's benifitial to use only SMIs because they perform\n * much better in any environment based on V8.\n */\n if (collection.size < TWO_TO_THE_POWER_OF_TWENTY_NINE) {\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * TWO_TO_THE_POWER_OF_THIRTY);\n }\n return cache(collection, nextNumber);\n }\n // Quickly check if there is a theoretical chance to generate a new number.\n if (collection.size > MAX_SAFE_INTEGER) {\n throw new Error('Congratulations, you created a collection of unique numbers which uses all available integers!');\n }\n // Otherwise use the full scale of safely usable integers.\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * MAX_SAFE_INTEGER);\n }\n return cache(collection, nextNumber);\n };\n};\n//# sourceMappingURL=generate-unique-number.js.map","import { createAddUniqueNumber } from './factories/add-unique-number';\nimport { createCache } from './factories/cache';\nimport { createGenerateUniqueNumber } from './factories/generate-unique-number';\nconst LAST_NUMBER_WEAK_MAP = new WeakMap();\nconst cache = createCache(LAST_NUMBER_WEAK_MAP);\nconst generateUniqueNumber = createGenerateUniqueNumber(cache, LAST_NUMBER_WEAK_MAP);\nconst addUniqueNumber = createAddUniqueNumber(generateUniqueNumber);\nexport { addUniqueNumber, generateUniqueNumber };\n//# sourceMappingURL=module.js.map","export const isMessagePort = (sender) => {\n return typeof sender.start === 'function';\n};\n//# sourceMappingURL=message-port.js.map","export const PORT_MAP = new WeakMap();\n//# sourceMappingURL=port-map.js.map","import { PORT_MAP } from './port-map';\nexport const extendBrokerImplementation = (partialBrokerImplementation) => ({\n ...partialBrokerImplementation,\n connect: ({ call }) => {\n return async () => {\n const { port1, port2 } = new MessageChannel();\n const portId = await call('connect', { port: port1 }, [port1]);\n PORT_MAP.set(port2, portId);\n return port2;\n };\n },\n disconnect: ({ call }) => {\n return async (port) => {\n const portId = PORT_MAP.get(port);\n if (portId === undefined) {\n throw new Error('The given port is not connected.');\n }\n await call('disconnect', { portId });\n };\n },\n isSupported: ({ call }) => {\n return () => call('isSupported');\n }\n});\n//# sourceMappingURL=extend-broker-implementation.js.map","import { generateUniqueNumber } from 'fast-unique-numbers';\nimport { isMessagePort } from './guards/message-port';\nimport { extendBrokerImplementation } from './helpers/extend-broker-implementation';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst ONGOING_REQUESTS = new WeakMap();\nconst createOrGetOngoingRequests = (sender) => {\n if (ONGOING_REQUESTS.has(sender)) {\n // @todo TypeScript needs to be convinced that has() works as expected.\n return ONGOING_REQUESTS.get(sender);\n }\n const ongoingRequests = new Map();\n ONGOING_REQUESTS.set(sender, ongoingRequests);\n return ongoingRequests;\n};\nexport const createBroker = (brokerImplementation) => {\n const fullBrokerImplementation = extendBrokerImplementation(brokerImplementation);\n return (sender) => {\n const ongoingRequests = createOrGetOngoingRequests(sender);\n sender.addEventListener('message', (({ data: message }) => {\n const { id } = message;\n if (id !== null && ongoingRequests.has(id)) {\n const { reject, resolve } = ongoingRequests.get(id);\n ongoingRequests.delete(id);\n if (message.error === undefined) {\n resolve(message.result);\n }\n else {\n reject(new Error(message.error.message));\n }\n }\n }));\n if (isMessagePort(sender)) {\n sender.start();\n }\n const call = (method, params = null, transferables = []) => {\n return new Promise((resolve, reject) => {\n const id = generateUniqueNumber(ongoingRequests);\n ongoingRequests.set(id, { reject, resolve });\n if (params === null) {\n sender.postMessage({ id, method }, transferables);\n }\n else {\n sender.postMessage({ id, method, params }, transferables);\n }\n });\n };\n const notify = (method, params, transferables = []) => {\n sender.postMessage({ id: null, method, params }, transferables);\n };\n let functions = {};\n for (const [key, handler] of Object.entries(fullBrokerImplementation)) {\n functions = { ...functions, [key]: handler({ call, notify }) };\n }\n return { ...functions };\n };\n};\n//# sourceMappingURL=module.js.map","import { createBroker } from 'broker-factory';\nimport { addUniqueNumber } from 'fast-unique-numbers';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst encoderIds = new Set();\nconst encoderInstanceIds = new Set();\nconst messagePorts = new WeakMap();\nexport const wrap = createBroker({\n deregister: ({ call }) => {\n return async (port) => {\n const encoderId = messagePorts.get(port);\n if (encoderId === undefined) {\n throw new Error('There is no encoder registered with the given port.');\n }\n const result = await call('deregister', { encoderId });\n encoderIds.delete(encoderId);\n messagePorts.delete(port);\n return result;\n };\n },\n encode: ({ call }) => {\n return async (encoderInstanceId, timeslice) => {\n const arrayBuffers = await call('encode', { encoderInstanceId, timeslice });\n encoderInstanceIds.delete(encoderInstanceId);\n return arrayBuffers;\n };\n },\n instantiate: ({ call }) => {\n return async (mimeType, sampleRate) => {\n const encoderInstanceId = addUniqueNumber(encoderInstanceIds);\n const port = await call('instantiate', { encoderInstanceId, mimeType, sampleRate });\n return { encoderInstanceId, port };\n };\n },\n register: ({ call }) => {\n return async (port) => {\n if (messagePorts.has(port)) {\n throw new Error('');\n }\n const encoderId = addUniqueNumber(encoderIds);\n messagePorts.set(port, encoderId);\n try {\n return await call('register', { encoderId, port }, [port]);\n }\n catch (err) {\n encoderIds.delete(encoderId);\n messagePorts.delete(port);\n throw err;\n }\n };\n }\n});\nexport const load = (url) => {\n const worker = new Worker(url);\n return wrap(worker);\n};\n//# sourceMappingURL=module.js.map","// This is the minified and stringified code of the media-encoder-host-worker package.\nexport const worker = `(()=>{var e={455:function(e,t){!function(e){\"use strict\";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),c=void 0===a?r.size:a<s?a+1:0;if(!r.has(c))return e(r,c);if(r.size<o){for(;r.has(c);)c=Math.floor(Math.random()*s);return e(r,c)}if(r.size>n)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;r.has(c);)c=Math.floor(Math.random()*n);return e(r,c)}},c=new WeakMap,i=r(c),d=a(i,c),l=t(d);e.addUniqueNumber=l,e.generateUniqueNumber=d}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{\"use strict\";var e=r(455);const t=new WeakMap,n=new WeakMap,o=(r=>{const o=(s=r,{...s,connect:({call:e})=>async()=>{const{port1:r,port2:n}=new MessageChannel,o=await e(\"connect\",{port:r},[r]);return t.set(n,o),n},disconnect:({call:e})=>async r=>{const n=t.get(r);if(void 0===n)throw new Error(\"The given port is not connected.\");await e(\"disconnect\",{portId:n})},isSupported:({call:e})=>()=>e(\"isSupported\")});var s;return t=>{const r=(e=>{if(n.has(e))return n.get(e);const t=new Map;return n.set(e,t),t})(t);t.addEventListener(\"message\",({data:e})=>{const{id:t}=e;if(null!==t&&r.has(t)){const{reject:n,resolve:o}=r.get(t);r.delete(t),void 0===e.error?o(e.result):n(new Error(e.error.message))}}),(e=>\"function\"==typeof e.start)(t)&&t.start();const s=(n,o=null,s=[])=>new Promise((a,c)=>{const i=(0,e.generateUniqueNumber)(r);r.set(i,{reject:c,resolve:a}),null===o?t.postMessage({id:i,method:n},s):t.postMessage({id:i,method:n,params:o},s)}),a=(e,r,n=[])=>{t.postMessage({id:null,method:e,params:r},n)};let c={};for(const[e,t]of Object.entries(o))c={...c,[e]:t({call:s,notify:a})};return{...c}}})({characterize:({call:e})=>()=>e(\"characterize\"),encode:({call:e})=>(t,r)=>e(\"encode\",{recordingId:t,timeslice:r}),record:({call:e})=>async(t,r,n)=>{await e(\"record\",{recordingId:t,sampleRate:r,typedArrays:n},n.map(({buffer:e})=>e).filter(e=>e instanceof ArrayBuffer))}}),s=-32603,a=-32602,c=-32601,i=(e,t)=>Object.assign(new Error(e),{status:t}),d=e=>i('The handler of the method called \"'.concat(e,'\" returned an unexpected result.'),s),l=(e,t)=>async({data:{id:r,method:n,params:o}})=>{const a=t[n];try{if(void 0===a)throw(e=>i('The requested method called \"'.concat(e,'\" is not supported.'),c))(n);const t=void 0===o?a():a(o);if(void 0===t)throw(e=>i('The handler of the method called \"'.concat(e,'\" returned no required result.'),s))(n);const l=t instanceof Promise?await t:t;if(null===r){if(void 0!==l.result)throw d(n)}else{if(void 0===l.result)throw d(n);const{result:t,transferables:o=[]}=l;e.postMessage({id:r,result:t},o)}}catch(t){const{message:n,status:o=-32603}=t;e.postMessage({error:{code:o,message:n},id:r})}},u=new Map,h=(t,r,n)=>({...r,connect:({port:n})=>{n.start();const o=t(n,r),s=(0,e.generateUniqueNumber)(u);return u.set(s,()=>{o(),n.close(),u.delete(s)}),{result:s}},disconnect:({portId:e})=>{const t=u.get(e);if(void 0===t)throw(e=>i('The specified parameter called \"portId\" with the given value \"'.concat(e,'\" does not identify a port connected to this worker.'),a))(e);return t(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),f=(e,t,r=()=>!0)=>{const n=h(f,t,r),o=l(e,n);return e.addEventListener(\"message\",o),()=>e.removeEventListener(\"message\",o)},w=e=>{e.onmessage=null,e.close()},p=new Map,m=new Map,g=((e,t)=>r=>{const n=t.get(r);if(void 0===n)throw new Error(\"There was no encoder stored with the given id.\");e.delete(n),t.delete(r)})(p,m),v=new Map,y=(e=>t=>{const r=e.get(t);if(void 0===r)throw new Error(\"There was no instance of an encoder stored with the given id.\");return r})(v),M=((e,t)=>r=>{const n=t(r);return e.delete(r),n})(v,y),E=((e,t)=>r=>{const[n,o,s,a]=t(r);return s?new Promise(t=>{o.onmessage=({data:s})=>{0===s.length?(e(o),t(n.encode(r,null))):n.record(r,a,s)}}):n.encode(r,null)})(w,M),b=(e=>t=>{for(const[r,n]of Array.from(e.values()))if(r.test(t))return n;throw new Error(\"There is no encoder registered which could handle the given mimeType.\")})(p),T=((e,t,r)=>(n,o,s)=>{if(t.has(n))throw new Error('There is already an encoder instance registered with an id called \"'.concat(n,'\".'));const a=r(o),{port1:c,port2:i}=new MessageChannel,d=[a,c,!0,s];return t.set(n,d),c.onmessage=({data:t})=>{0===t.length?(e(c),d[2]=!1):a.record(n,s,t.map(e=>\"number\"==typeof e?new Float32Array(e):e))},i})(w,v,b),I=((e,t,r)=>async(n,o)=>{const s=r(o),a=await s.characterize(),c=a.toString();if(e.has(c))throw new Error(\"There is already an encoder stored which handles exactly the same mime types.\");if(t.has(n))throw new Error('There is already an encoder registered with an id called \"'.concat(n,'\".'));return e.set(c,[a,s]),t.set(n,c),a})(p,m,o),A=(e=>(t,r)=>{const[n]=e(t);return n.encode(t,r)})(y);f(self,{deregister:async({encoderId:e})=>(g(e),{result:null}),encode:async({encoderInstanceId:e,timeslice:t})=>{const r=null===t?await E(e):await A(e,t);return{result:r,transferables:r}},instantiate:({encoderInstanceId:e,mimeType:t,sampleRate:r})=>{const n=T(e,t,r);return{result:n,transferables:[n]}},register:async({encoderId:e,port:t})=>({result:await I(e,t)})})})()})();`; // tslint:disable-line:max-line-length\n//# sourceMappingURL=worker.js.map","import { load as loadWorker } from 'media-encoder-host-broker';\nimport { worker } from './worker/worker';\nconst blob = new Blob([worker], { type: 'application/javascript; charset=utf-8' });\nconst url = URL.createObjectURL(blob);\nconst mediaEncoderHost = loadWorker(url);\nexport const connect = mediaEncoderHost.connect;\nexport const deregister = mediaEncoderHost.deregister;\nexport const disconnect = mediaEncoderHost.disconnect;\nexport const encode = mediaEncoderHost.encode;\nexport const instantiate = mediaEncoderHost.instantiate;\nexport const isSupported = mediaEncoderHost.isSupported;\nexport const register = mediaEncoderHost.register;\nURL.revokeObjectURL(url);\n//# sourceMappingURL=module.js.map","export const createBlobEventFactory = (nativeBlobEventConstructor) => {\n return (type, blobEventInit) => {\n if (nativeBlobEventConstructor === null) {\n throw new Error('A native BlobEvent could not be created.');\n }\n return new nativeBlobEventConstructor(type, blobEventInit);\n };\n};\n//# sourceMappingURL=blob-event-factory.js.map","export const createDecodeWebMChunk = (readElementContent, readElementType) => {\n return (dataView, elementType, channelCount) => {\n const contents = [];\n let currentElementType = elementType;\n let offset = 0;\n while (offset < dataView.byteLength) {\n if (currentElementType === null) {\n const lengthAndType = readElementType(dataView, offset);\n if (lengthAndType === null) {\n break;\n }\n const { length, type } = lengthAndType;\n currentElementType = type;\n offset += length;\n }\n else {\n const contentAndLength = readElementContent(dataView, offset, currentElementType, channelCount);\n if (contentAndLength === null) {\n break;\n }\n const { content, length } = contentAndLength;\n currentElementType = null;\n offset += length;\n if (content !== null) {\n contents.push(content);\n }\n }\n }\n return { contents, currentElementType, offset };\n };\n};\n//# sourceMappingURL=decode-web-m-chunk.js.map","export const createEventTargetConstructor = (createEventTarget, wrapEventListener) => {\n return class EventTarget {\n constructor(nativeEventTarget = null) {\n this._listeners = new WeakMap();\n this._nativeEventTarget = nativeEventTarget === null ? createEventTarget() : nativeEventTarget;\n }\n addEventListener(type, listener, options) {\n if (listener !== null) {\n let wrappedEventListener = this._listeners.get(listener);\n if (wrappedEventListener === undefined) {\n wrappedEventListener = wrapEventListener(this, listener);\n if (typeof listener === 'function') {\n this._listeners.set(listener, wrappedEventListener);\n }\n }\n this._nativeEventTarget.addEventListener(type, wrappedEventListener, options);\n }\n }\n dispatchEvent(event) {\n return this._nativeEventTarget.dispatchEvent(event);\n }\n removeEventListener(type, listener, options) {\n const wrappedEventListener = listener === null ? undefined : this._listeners.get(listener);\n this._nativeEventTarget.removeEventListener(type, wrappedEventListener === undefined ? null : wrappedEventListener, options);\n }\n };\n};\n//# sourceMappingURL=event-target-constructor.js.map","export const createEventTargetFactory = (window) => {\n return () => {\n if (window === null) {\n throw new Error('A native EventTarget could not be created.');\n }\n return window.document.createElement('p');\n };\n};\n//# sourceMappingURL=event-target-factory.js.map","export const createInvalidModificationError = (message = '') => {\n try {\n return new DOMException(message, 'InvalidModificationError');\n }\n catch (err) {\n // @todo Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 13;\n err.message = message;\n err.name = 'InvalidModificationError';\n return err;\n }\n};\n//# sourceMappingURL=invalid-modification-error.js.map","export const createInvalidStateError = () => {\n try {\n return new DOMException('', 'InvalidStateError');\n }\n catch (err) {\n // Bug #122: Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 11;\n err.name = 'InvalidStateError';\n return err;\n }\n};\n//# sourceMappingURL=invalid-state-error.js.map","export const createMediaRecorderConstructor = (createNativeMediaRecorder, createNotSupportedError, createWebAudioMediaRecorder, createWebmPcmMediaRecorder, encoderRegexes, eventTargetConstructor, nativeMediaRecorderConstructor) => {\n return class MediaRecorder extends eventTargetConstructor {\n constructor(stream, options = {}) {\n const { mimeType } = options;\n if (nativeMediaRecorderConstructor !== null &&\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n (mimeType === undefined ||\n (nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported(mimeType)))) {\n const internalMediaRecorder = createNativeMediaRecorder(nativeMediaRecorderConstructor, stream, options);\n super(internalMediaRecorder);\n this._internalMediaRecorder = internalMediaRecorder;\n }\n else if (mimeType !== undefined && encoderRegexes.some((regex) => regex.test(mimeType))) {\n super();\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n if (nativeMediaRecorderConstructor !== null &&\n nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported('audio/webm; codecs=pcm')) {\n this._internalMediaRecorder = createWebmPcmMediaRecorder(this, nativeMediaRecorderConstructor, stream, mimeType);\n }\n else {\n this._internalMediaRecorder = createWebAudioMediaRecorder(this, stream, mimeType);\n }\n }\n else {\n // This is creating a native MediaRecorder just to provoke it to throw an error.\n if (nativeMediaRecorderConstructor !== null) {\n createNativeMediaRecorder(nativeMediaRecorderConstructor, stream, options);\n }\n throw createNotSupportedError();\n }\n this._ondataavailable = null;\n this._onerror = null;\n this._onpause = null;\n this._onresume = null;\n this._onstart = null;\n this._onstop = null;\n }\n get mimeType() {\n return this._internalMediaRecorder.mimeType;\n }\n get ondataavailable() {\n return this._ondataavailable === null ? this._ondataavailable : this._ondataavailable[0];\n }\n set ondataavailable(value) {\n if (this._ondataavailable !== null) {\n this.removeEventListener('dataavailable', this._ondataavailable[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('dataavailable', boundListener);\n this._ondataavailable = [value, boundListener];\n }\n else {\n this._ondataavailable = null;\n }\n }\n get onerror() {\n return this._onerror === null ? this._onerror : this._onerror[0];\n }\n set onerror(value) {\n if (this._onerror !== null) {\n this.removeEventListener('error', this._onerror[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('error', boundListener);\n this._onerror = [value, boundListener];\n }\n else {\n this._onerror = null;\n }\n }\n get onpause() {\n return this._onpause === null ? this._onpause : this._onpause[0];\n }\n set onpause(value) {\n if (this._onpause !== null) {\n this.removeEventListener('pause', this._onpause[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('pause', boundListener);\n this._onpause = [value, boundListener];\n }\n else {\n this._onpause = null;\n }\n }\n get onresume() {\n return this._onresume === null ? this._onresume : this._onresume[0];\n }\n set onresume(value) {\n if (this._onresume !== null) {\n this.removeEventListener('resume', this._onresume[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('resume', boundListener);\n this._onresume = [value, boundListener];\n }\n else {\n this._onresume = null;\n }\n }\n get onstart() {\n return this._onstart === null ? this._onstart : this._onstart[0];\n }\n set onstart(value) {\n if (this._onstart !== null) {\n this.removeEventListener('start', this._onstart[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('start', boundListener);\n this._onstart = [value, boundListener];\n }\n else {\n this._onstart = null;\n }\n }\n get onstop() {\n return this._onstop === null ? this._onstop : this._onstop[0];\n }\n set onstop(value) {\n if (this._onstop !== null) {\n this.removeEventListener('stop', this._onstop[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('stop', boundListener);\n this._onstop = [value, boundListener];\n }\n else {\n this._onstop = null;\n }\n }\n get state() {\n return this._internalMediaRecorder.state;\n }\n pause() {\n return this._internalMediaRecorder.pause();\n }\n resume() {\n return this._internalMediaRecorder.resume();\n }\n start(timeslice) {\n return this._internalMediaRecorder.start(timeslice);\n }\n stop() {\n return this._internalMediaRecorder.stop();\n }\n static isTypeSupported(mimeType) {\n return ((nativeMediaRecorderConstructor !== null &&\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported(mimeType)) ||\n encoderRegexes.some((regex) => regex.test(mimeType)));\n }\n };\n};\n//# sourceMappingURL=media-recorder-constructor.js.map","export const createNativeBlobEventConstructor = (window) => {\n if (window !== null && window.BlobEvent !== undefined) {\n return window.BlobEvent;\n }\n return null;\n};\n//# sourceMappingURL=native-blob-event-constructor.js.map","export const createNativeMediaRecorderConstructor = (window) => {\n if (window === null) {\n return null;\n }\n return window.MediaRecorder === undefined ? null : window.MediaRecorder;\n};\n//# sourceMappingURL=native-media-recorder-constructor.js.map","export const createNativeMediaRecorderFactory = (createNotSupportedError) => (nativeMediaRecorderConstructor, stream, mediaRecorderOptions) => {\n const bufferedBlobEventListeners = new Map();\n const dataAvailableListeners = new WeakMap();\n const errorListeners = new WeakMap();\n const flags = [];\n const nativeMediaRecorder = new nativeMediaRecorderConstructor(stream, mediaRecorderOptions);\n const stopListeners = new WeakMap();\n nativeMediaRecorder.addEventListener('stop', ({ isTrusted }) => {\n if (isTrusted) {\n setTimeout(() => flags.shift());\n }\n });\n nativeMediaRecorder.addEventListener = ((addEventListener) => {\n return (type, listener, options) => {\n let patchedEventListener = listener;\n if (typeof listener === 'function') {\n if (type === 'dataavailable') {\n const bufferedBlobEvents = [];\n // Bug #20: Firefox dispatches multiple dataavailable events while being inactive.\n patchedEventListener = (event) => {\n const [[isSliced, isActive] = [false, false]] = flags;\n if (isSliced && !isActive) {\n bufferedBlobEvents.push(event);\n }\n else {\n listener.call(nativeMediaRecorder, event);\n }\n };\n bufferedBlobEventListeners.set(listener, bufferedBlobEvents);\n dataAvailableListeners.set(listener, patchedEventListener);\n }\n else if (type === 'error') {\n // Bug #12 & #13: Firefox fires a regular event with an error property.\n patchedEventListener = (event) => {\n if (event instanceof ErrorEvent) {\n listener.call(nativeMediaRecorder, event);\n }\n else {\n listener.call(nativeMediaRecorder, new ErrorEvent('error', { error: event.error }));\n }\n };\n errorListeners.set(listener, patchedEventListener);\n }\n else if (type === 'stop') {\n // Bug #20: Firefox dispatches multiple dataavailable events while being inactive.\n patchedEventListener = (event) => {\n for (const [dataAvailableListener, bufferedBlobEvents] of bufferedBlobEventListeners.entries()) {\n if (bufferedBlobEvents.length > 0) {\n const [blobEvent] = bufferedBlobEvents;\n if (bufferedBlobEvents.length > 1) {\n Object.defineProperty(blobEvent, 'data', {\n value: new Blob(bufferedBlobEvents.map(({ data }) => data), { type: blobEvent.data.type })\n });\n }\n bufferedBlobEvents.length = 0;\n dataAvailableListener.call(nativeMediaRecorder, blobEvent);\n }\n }\n listener.call(nativeMediaRecorder, event);\n };\n stopListeners.set(listener, patchedEventListener);\n }\n }\n return addEventListener.call(nativeMediaRecorder, type, patchedEventListener, options);\n };\n })(nativeMediaRecorder.addEventListener);\n nativeMediaRecorder.removeEventListener = ((removeEventListener) => {\n return (type, listener, options) => {\n let patchedEventListener = listener;\n if (typeof listener === 'function') {\n if (type === 'dataavailable') {\n bufferedBlobEventListeners.delete(listener);\n const dataAvailableListener = dataAvailableListeners.get(listener);\n if (dataAvailableListener !== undefined) {\n patchedEventListener = dataAvailableListener;\n }\n }\n else if (type === 'error') {\n const errorListener = errorListeners.get(listener);\n if (errorListener !== undefined) {\n patchedEventListener = errorListener;\n }\n }\n else if (type === 'stop') {\n const stopListener = stopListeners.get(listener);\n if (stopListener !== undefined) {\n patchedEventListener = stopListener;\n }\n }\n }\n return removeEventListener.call(nativeMediaRecorder, type, patchedEventListener, options);\n };\n })(nativeMediaRecorder.removeEventListener);\n nativeMediaRecorder.start = ((start) => {\n return (timeslice) => {\n /*\n * Bug #6: Safari will emit a blob without any data when asked to encode a MediaStream with a video track into an audio\n * codec.\n */\n if (mediaRecorderOptions.mimeType !== undefined &&\n mediaRecorderOptions.mimeType.startsWith('audio/') &&\n stream.getVideoTracks().length > 0) {\n throw createNotSupportedError();\n }\n if (nativeMediaRecorder.state === 'inactive') {\n flags.push([timeslice !== undefined, true]);\n }\n return timeslice === undefined ? start.call(nativeMediaRecorder) : start.call(nativeMediaRecorder, timeslice);\n };\n })(nativeMediaRecorder.start);\n nativeMediaRecorder.stop = ((stop) => {\n return () => {\n if (nativeMediaRecorder.state !== 'inactive') {\n flags[0][1] = false;\n }\n stop.call(nativeMediaRecorder);\n };\n })(nativeMediaRecorder.stop);\n return nativeMediaRecorder;\n};\n//# sourceMappingURL=native-media-recorder-factory.js.map","export const createNotSupportedError = () => {\n try {\n return new DOMException('', 'NotSupportedError');\n }\n catch (err) {\n // @todo Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 9;\n err.name = 'NotSupportedError';\n return err;\n }\n};\n//# sourceMappingURL=not-supported-error.js.map","export const createReadElementContent = (readVariableSizeInteger) => {\n return (dataView, offset, type, channelCount = 2) => {\n const lengthAndValue = readVariableSizeInteger(dataView, offset);\n if (lengthAndValue === null) {\n return lengthAndValue;\n }\n const { length, value } = lengthAndValue;\n if (type === 'master') {\n return { content: null, length };\n }\n if (offset + length + value > dataView.byteLength) {\n return null;\n }\n if (type === 'binary') {\n const numberOfSamples = (value / Float32Array.BYTES_PER_ELEMENT - 1) / channelCount;\n const content = Array.from({ length: channelCount }, () => new Float32Array(numberOfSamples));\n for (let i = 0; i < numberOfSamples; i += 1) {\n const elementOffset = i * channelCount + 1;\n for (let j = 0; j < channelCount; j += 1) {\n content[j][i] = dataView.getFloat32(offset + length + (elementOffset + j) * Float32Array.BYTES_PER_ELEMENT, true);\n }\n }\n return { content, length: length + value };\n }\n return { content: null, length: length + value };\n };\n};\n//# sourceMappingURL=read-element-content.js.map","export const createReadElementType = (readVariableSizeInteger) => {\n return (dataView, offset) => {\n const lengthAndValue = readVariableSizeInteger(dataView, offset);\n if (lengthAndValue === null) {\n return lengthAndValue;\n }\n const { length, value } = lengthAndValue;\n if (value === 35) {\n return { length, type: 'binary' };\n }\n if (value === 46 ||\n value === 97 ||\n value === 88713574 ||\n value === 106212971 ||\n value === 139690087 ||\n value === 172351395 ||\n value === 256095861) {\n return { length, type: 'master' };\n }\n return { length, type: 'unknown' };\n };\n};\n//# sourceMappingURL=read-element-type.js.map","export const createReadVariableSizeInteger = (readVariableSizeIntegerLength) => {\n return (dataView, offset) => {\n const length = readVariableSizeIntegerLength(dataView, offset);\n if (length === null) {\n return length;\n }\n const firstDataByteOffset = offset + Math.floor((length - 1) / 8);\n if (firstDataByteOffset + length > dataView.byteLength) {\n return null;\n }\n const firstDataByte = dataView.getUint8(firstDataByteOffset);\n let value = firstDataByte & ((1 << (8 - (length % 8))) - 1); // tslint:disable-line:no-bitwise\n for (let i = 1; i < length; i += 1) {\n value = (value << 8) + dataView.getUint8(firstDataByteOffset + i); // tslint:disable-line:no-bitwise\n }\n return { length, value };\n };\n};\n//# sourceMappingURL=read-variable-size-integer.js.map","export const observable = Symbol.observable || \"@@observable\";\r\n//# sourceMappingURL=symbols.js.map","import { observable } from \"./symbols\";\r\nexport function patch(arg) {\r\n if (!Symbol.observable) {\r\n if (typeof arg === \"function\" &&\r\n arg.prototype &&\r\n arg.prototype[Symbol.observable]) {\r\n arg.prototype[observable] = arg.prototype[Symbol.observable];\r\n delete arg.prototype[Symbol.observable];\r\n }\r\n else {\r\n arg[observable] = arg[Symbol.observable];\r\n delete arg[Symbol.observable];\r\n }\r\n }\r\n return arg;\r\n}\r\n//# sourceMappingURL=patch.js.map","const noop = () => { };\r\nconst rethrow = (error) => {\r\n throw error;\r\n};\r\nexport function toObserver(observer) {\r\n if (observer) {\r\n if (observer.next && observer.error && observer.complete) {\r\n return observer;\r\n }\r\n return {\r\n complete: (observer.complete ?? noop).bind(observer),\r\n error: (observer.error ?? rethrow).bind(observer),\r\n next: (observer.next ?? noop).bind(observer),\r\n };\r\n }\r\n return {\r\n complete: noop,\r\n error: rethrow,\r\n next: noop,\r\n };\r\n}\r\n//# sourceMappingURL=to-observer.js.map","export const createOn = (wrapSubscribeFunction) => {\n return (target, type, options) => wrapSubscribeFunction((observer) => {\n const listener = (event) => observer.next(event);\n target.addEventListener(type, listener, options);\n return () => target.removeEventListener(type, listener, options);\n });\n};\n//# sourceMappingURL=on.js.map","export const createWrapSubscribeFunction = (patch, toObserver) => {\n const emptyFunction = () => { }; // tslint:disable-line:no-empty\n const isNextFunction = (args) => typeof args[0] === 'function';\n return (innerSubscribe) => {\n const subscribe = ((...args) => {\n const unsubscribe = innerSubscribe(isNextFunction(args) ? toObserver({ next: args[0] }) : toObserver(...args));\n if (unsubscribe !== undefined) {\n return unsubscribe;\n }\n return emptyFunction;\n });\n subscribe[Symbol.observable] = () => ({\n subscribe: (...args) => ({ unsubscribe: subscribe(...args) })\n });\n return patch(subscribe);\n };\n};\n//# sourceMappingURL=wrap-subscribe-function.js.map","import { patch, toObserver } from 'rxjs-interop';\nimport { createAnimationFrame } from './factories/animation-frame';\nimport { createAttribute } from './factories/attribute';\nimport { createGeolocation } from './factories/geolocation';\nimport { createIntersections } from './factories/intersections';\nimport { createMapSubscribableThing } from './factories/map-subscribable-thing';\nimport { createMediaDevices } from './factories/media-devices';\nimport { createMediaQueryMatch } from './factories/media-query-match';\nimport { createMetrics } from './factories/metrics';\nimport { createMidiInputs } from './factories/midi-inputs';\nimport { createMidiOutputs } from './factories/midi-outputs';\nimport { createMutations } from './factories/mutations';\nimport { createOn } from './factories/on';\nimport { createOnline } from './factories/online';\nimport { createPermissionState } from './factories/permission-state';\nimport { createPrependSubscribableThing } from './factories/prepend-subscribable-thing';\nimport { createReports } from './factories/reports';\nimport { createResizes } from './factories/resizes';\nimport { createUnhandledRejection } from './factories/unhandled-rejection';\nimport { createVideoFrame } from './factories/video-frame';\nimport { createWakeLock } from './factories/wake-lock';\nimport { createWindow } from './factories/window';\nimport { createWrapSubscribeFunction } from './factories/wrap-subscribe-function';\nimport { emitNotSupportedError } from './functions/emit-not-supported-error';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst window = createWindow();\nconst wrapSubscribeFunction = createWrapSubscribeFunction(patch, toObserver);\nexport const animationFrame = createAnimationFrame(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const mutations = createMutations(emitNotSupportedError, window, wrapSubscribeFunction);\nconst mapSubscribableThing = createMapSubscribableThing(wrapSubscribeFunction);\nconst prependSubscribableThing = createPrependSubscribableThing(wrapSubscribeFunction);\nexport const attribute = createAttribute(mapSubscribableThing, mutations, prependSubscribableThing);\nexport const geolocation = createGeolocation(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const intersections = createIntersections(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const mediaDevices = createMediaDevices(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const mediaQueryMatch = createMediaQueryMatch(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const metrics = createMetrics(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const midiInputs = createMidiInputs(wrapSubscribeFunction);\nexport const midiOutputs = createMidiOutputs(wrapSubscribeFunction);\nexport const on = createOn(wrapSubscribeFunction);\nexport const online = createOnline(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const permissionState = createPermissionState(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const reports = createReports(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const resizes = createResizes(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const unhandledRejection = createUnhandledRejection(emitNotSupportedError, window, wrapSubscribeFunction);\nexport const videoFrame = createVideoFrame(emitNotSupportedError, wrapSubscribeFunction);\nexport const wakeLock = createWakeLock(emitNotSupportedError, window, wrapSubscribeFunction);\n//# sourceMappingURL=module.js.map","export const createAddRecorderAudioWorkletModule = (blobConstructor, urlConstructor, worklet) => {\n return async (addAudioWorkletModule) => {\n const blob = new blobConstructor([worklet], { type: 'application/javascript; charset=utf-8' });\n const url = urlConstructor.createObjectURL(blob);\n try {\n await addAudioWorkletModule(url);\n }\n finally {\n urlConstructor.revokeObjectURL(url);\n }\n };\n};\n//# sourceMappingURL=add-recorder-audio-worklet-module.js.map","export const createListener = (ongoingRequests) => {\n return ({ data: message }) => {\n const { id } = message;\n if (id !== null) {\n const ongoingRequest = ongoingRequests.get(id);\n if (ongoingRequest !== undefined) {\n const { reject, resolve } = ongoingRequest;\n ongoingRequests.delete(id);\n if (message.error === undefined) {\n resolve(message.result);\n }\n else {\n reject(new Error(message.error.message));\n }\n }\n }\n };\n};\n//# sourceMappingURL=listener.js.map","export const createPostMessageFactory = (generateUniqueNumber) => {\n return (ongoingRequests, port) => {\n return (message, transferables = []) => {\n return new Promise((resolve, reject) => {\n const id = generateUniqueNumber(ongoingRequests);\n ongoingRequests.set(id, { reject, resolve });\n port.postMessage({ id, ...message }, transferables);\n });\n };\n };\n};\n//# sourceMappingURL=post-message-factory.js.map","export const createRecorderAudioWorkletNodeFactory = (createListener, createPostMessage, on, validateState) => {\n return (audioWorkletNodeConstructor, context, options = {}) => {\n const audioWorkletNode = new audioWorkletNodeConstructor(context, 'recorder-audio-worklet-processor', {\n ...options,\n channelCountMode: 'explicit',\n numberOfInputs: 1,\n numberOfOutputs: 0\n });\n const ongoingRequests = new Map();\n const postMessage = createPostMessage(ongoingRequests, audioWorkletNode.port);\n const unsubscribe = on(audioWorkletNode.port, 'message')(createListener(ongoingRequests));\n audioWorkletNode.port.start();\n let state = 'inactive';\n Object.defineProperties(audioWorkletNode, {\n pause: {\n get() {\n return async () => {\n validateState(['recording'], state);\n state = 'paused';\n return postMessage({\n method: 'pause'\n });\n };\n }\n },\n port: {\n get() {\n throw new Error(\"The port of a RecorderAudioWorkletNode can't be accessed.\");\n }\n },\n record: {\n get() {\n return async (encoderPort) => {\n validateState(['inactive'], state);\n state = 'recording';\n return postMessage({\n method: 'record',\n params: { encoderPort }\n }, [encoderPort]);\n };\n }\n },\n resume: {\n get() {\n return async () => {\n validateState(['paused'], state);\n state = 'recording';\n return postMessage({\n method: 'resume'\n });\n };\n }\n },\n stop: {\n get() {\n return async () => {\n validateState(['paused', 'recording'], state);\n state = 'stopped';\n try {\n await postMessage({ method: 'stop' });\n }\n finally {\n unsubscribe();\n }\n };\n }\n }\n });\n return audioWorkletNode;\n };\n};\n//# sourceMappingURL=recorder-audio-worklet-node-factory.js.map","export const validateState = (expectedStates, currentState) => {\n if (!expectedStates.includes(currentState)) {\n throw new Error(`Expected the state to be ${expectedStates\n .map((expectedState) => `\"${expectedState}\"`)\n .join(' or ')} but it was \"${currentState}\".`);\n }\n};\n//# sourceMappingURL=validate-state.js.map","// This is the minified and stringified code of the recorder-audio-worklet-processor package.\nexport const worklet = `(()=>{\"use strict\";class e extends AudioWorkletProcessor{constructor(){super(),this._encoderPort=null,this._numberOfChannels=0,this._state=\"inactive\",this.port.onmessage=({data:e})=>{\"pause\"===e.method?\"active\"===this._state||\"recording\"===this._state?(this._state=\"paused\",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):\"record\"===e.method?\"inactive\"===this._state?(this._encoderPort=e.params.encoderPort,this._state=\"active\",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):\"resume\"===e.method?\"paused\"===this._state?(this._state=\"active\",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):\"stop\"===e.method?\"active\"!==this._state&&\"paused\"!==this._state&&\"recording\"!==this._state||null===this._encoderPort?this._sendUnexpectedStateError(e.id):(this._stop(this._encoderPort),this._sendAcknowledgement(e.id)):\"number\"==typeof e.id&&this.port.postMessage({error:{code:-32601,message:\"The requested method is not supported.\"},id:e.id})}}process([e]){if(\"inactive\"===this._state||\"paused\"===this._state)return!0;if(\"active\"===this._state){if(void 0===e)throw new Error(\"No channelData was received for the first input.\");if(0===e.length)return!0;this._state=\"recording\"}if(\"recording\"===this._state&&null!==this._encoderPort){if(void 0===e)throw new Error(\"No channelData was received for the first input.\");return 0===e.length?this._encoderPort.postMessage(Array.from({length:this._numberOfChannels},()=>128)):(this._encoderPort.postMessage(e,e.map(({buffer:e})=>e)),this._numberOfChannels=e.length),!0}return!1}_sendAcknowledgement(e){this.port.postMessage({id:e,result:null})}_sendUnexpectedStateError(e){this.port.postMessage({error:{code:-32603,message:\"The internal state does not allow to process the given message.\"},id:e})}_stop(e){e.postMessage([]),e.close(),this._encoderPort=null,this._state=\"stopped\"}}e.parameterDescriptors=[],registerProcessor(\"recorder-audio-worklet-processor\",e)})();`; // tslint:disable-line:max-line-length\n//# sourceMappingURL=worklet.js.map","import { generateUniqueNumber } from 'fast-unique-numbers';\nimport { on } from 'subscribable-things';\nimport { isSupported } from 'worker-factory';\nimport { createAddRecorderAudioWorkletModule } from './factories/add-recorder-audio-worklet-module';\nimport { createListener } from './factories/listener';\nimport { createPostMessageFactory } from './factories/post-message-factory';\nimport { createRecorderAudioWorkletNodeFactory } from './factories/recorder-audio-worklet-node-factory';\nimport { validateState } from './functions/validate-state';\nimport { worklet } from './worklet/worklet';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nexport const addRecorderAudioWorkletModule = createAddRecorderAudioWorkletModule(Blob, URL, worklet);\nexport const createRecorderAudioWorkletNode = createRecorderAudioWorkletNodeFactory(createListener, createPostMessageFactory(generateUniqueNumber), on, validateState);\nexport { isSupported };\n//# sourceMappingURL=module.js.map","export const createExtendedExponentialRampToValueAutomationEvent = (value, endTime, insertTime) => {\n return { endTime, insertTime, type: 'exponentialRampToValue', value };\n};\n//# sourceMappingURL=create-extended-exponential-ramp-to-value-automation-event.js.map","export const createExtendedLinearRampToValueAutomationEvent = (value, endTime, insertTime) => {\n return { endTime, insertTime, type: 'linearRampToValue', value };\n};\n//# sourceMappingURL=create-extended-linear-ramp-to-value-automation-event.js.map","export const createSetValueAutomationEvent = (value, startTime) => {\n return { startTime, type: 'setValue', value };\n};\n//# sourceMappingURL=create-set-value-automation-event.js.map","export const createSetValueCurveAutomationEvent = (values, startTime, duration) => {\n return { duration, startTime, type: 'setValueCurve', values };\n};\n//# sourceMappingURL=create-set-value-curve-automation-event.js.map","export const getTargetValueAtTime = (time, valueAtStartTime, { startTime, target, timeConstant }) => {\n return target + (valueAtStartTime - target) * Math.exp((startTime - time) / timeConstant);\n};\n//# sourceMappingURL=get-target-value-at-time.js.map","export const isExponentialRampToValueAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'exponentialRampToValue';\n};\n//# sourceMappingURL=exponential-ramp-to-value-automation-event.js.map","export const isLinearRampToValueAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'linearRampToValue';\n};\n//# sourceMappingURL=linear-ramp-to-value-automation-event.js.map","import { isExponentialRampToValueAutomationEvent } from './exponential-ramp-to-value-automation-event';\nimport { isLinearRampToValueAutomationEvent } from './linear-ramp-to-value-automation-event';\nexport const isAnyRampToValueAutomationEvent = (automationEvent) => {\n return isExponentialRampToValueAutomationEvent(automationEvent) || isLinearRampToValueAutomationEvent(automationEvent);\n};\n//# sourceMappingURL=any-ramp-to-value-automation-event.js.map","export const isSetValueAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'setValue';\n};\n//# sourceMappingURL=set-value-automation-event.js.map","export const isSetValueCurveAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'setValueCurve';\n};\n//# sourceMappingURL=set-value-curve-automation-event.js.map","import { getTargetValueAtTime } from '../functions/get-target-value-at-time';\nimport { isAnyRampToValueAutomationEvent } from '../guards/any-ramp-to-value-automation-event';\nimport { isSetValueAutomationEvent } from '../guards/set-value-automation-event';\nimport { isSetValueCurveAutomationEvent } from '../guards/set-value-curve-automation-event';\nexport const getValueOfAutomationEventAtIndexAtTime = (automationEvents, index, time, defaultValue) => {\n const automationEvent = automationEvents[index];\n return automationEvent === undefined\n ? defaultValue\n : isAnyRampToValueAutomationEvent(automationEvent) || isSetValueAutomationEvent(automationEvent)\n ? automationEvent.value\n : isSetValueCurveAutomationEvent(automationEvent)\n ? automationEvent.values[automationEvent.values.length - 1]\n : getTargetValueAtTime(time, getValueOfAutomationEventAtIndexAtTime(automationEvents, index - 1, automationEvent.startTime, defaultValue), automationEvent);\n};\n//# sourceMappingURL=get-value-of-automation-event-at-index-at-time.js.map","import { getValueOfAutomationEventAtIndexAtTime } from '../functions/get-value-of-automation-event-at-index-at-time';\nimport { isAnyRampToValueAutomationEvent } from '../guards/any-ramp-to-value-automation-event';\nimport { isSetValueAutomationEvent } from '../guards/set-value-automation-event';\nimport { isSetValueCurveAutomationEvent } from '../guards/set-value-curve-automation-event';\nexport const getEndTimeAndValueOfPreviousAutomationEvent = (automationEvents, index, currentAutomationEvent, nextAutomationEvent, defaultValue) => {\n return currentAutomationEvent === undefined\n ? [nextAutomationEvent.insertTime, defaultValue]\n : isAnyRampToValueAutomationEvent(currentAutomationEvent)\n ? [currentAutomationEvent.endTime, currentAutomationEvent.value]\n : isSetValueAutomationEvent(currentAutomationEvent)\n ? [currentAutomationEvent.startTime, currentAutomationEvent.value]\n : isSetValueCurveAutomationEvent(currentAutomationEvent)\n ? [\n currentAutomationEvent.startTime + currentAutomationEvent.duration,\n currentAutomationEvent.values[currentAutomationEvent.values.length - 1]\n ]\n : [\n currentAutomationEvent.startTime,\n getValueOfAutomationEventAtIndexAtTime(automationEvents, index - 1, currentAutomationEvent.startTime, defaultValue)\n ];\n};\n//# sourceMappingURL=get-end-time-and-value-of-previous-automation-event.js.map","export const isCancelAndHoldAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'cancelAndHold';\n};\n//# sourceMappingURL=cancel-and-hold-automation-event.js.map","export const isCancelScheduledValuesAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'cancelScheduledValues';\n};\n//# sourceMappingURL=cancel-scheduled-values-automation-event.js.map","import { isCancelAndHoldAutomationEvent } from '../guards/cancel-and-hold-automation-event';\nimport { isCancelScheduledValuesAutomationEvent } from '../guards/cancel-scheduled-values-automation-event';\nimport { isExponentialRampToValueAutomationEvent } from '../guards/exponential-ramp-to-value-automation-event';\nimport { isLinearRampToValueAutomationEvent } from '../guards/linear-ramp-to-value-automation-event';\nexport const getEventTime = (automationEvent) => {\n if (isCancelAndHoldAutomationEvent(automationEvent) || isCancelScheduledValuesAutomationEvent(automationEvent)) {\n return automationEvent.cancelTime;\n }\n if (isExponentialRampToValueAutomationEvent(automationEvent) || isLinearRampToValueAutomationEvent(automationEvent)) {\n return automationEvent.endTime;\n }\n return automationEvent.startTime;\n};\n//# sourceMappingURL=get-event-time.js.map","export const getExponentialRampValueAtTime = (time, startTime, valueAtStartTime, { endTime, value }) => {\n if (valueAtStartTime === value) {\n return value;\n }\n if ((0 < valueAtStartTime && 0 < value) || (valueAtStartTime < 0 && value < 0)) {\n return valueAtStartTime * (value / valueAtStartTime) ** ((time - startTime) / (endTime - startTime));\n }\n return 0;\n};\n//# sourceMappingURL=get-exponential-ramp-value-at-time.js.map","export const getLinearRampValueAtTime = (time, startTime, valueAtStartTime, { endTime, value }) => {\n return valueAtStartTime + ((time - startTime) / (endTime - startTime)) * (value - valueAtStartTime);\n};\n//# sourceMappingURL=get-linear-ramp-value-at-time.js.map","export const interpolateValue = (values, theoreticIndex) => {\n const lowerIndex = Math.floor(theoreticIndex);\n const upperIndex = Math.ceil(theoreticIndex);\n if (lowerIndex === upperIndex) {\n return values[lowerIndex];\n }\n return (1 - (theoreticIndex - lowerIndex)) * values[lowerIndex] + (1 - (upperIndex - theoreticIndex)) * values[upperIndex];\n};\n//# sourceMappingURL=interpolate-value.js.map","import { interpolateValue } from './interpolate-value';\nexport const getValueCurveValueAtTime = (time, { duration, startTime, values }) => {\n const theoreticIndex = ((time - startTime) / duration) * (values.length - 1);\n return interpolateValue(values, theoreticIndex);\n};\n//# sourceMappingURL=get-value-curve-value-at-time.js.map","export const isSetTargetAutomationEvent = (automationEvent) => {\n return automationEvent.type === 'setTarget';\n};\n//# sourceMappingURL=set-target-automation-event.js.map","import { createExtendedExponentialRampToValueAutomationEvent } from '../functions/create-extended-exponential-ramp-to-value-automation-event';\nimport { createExtendedLinearRampToValueAutomationEvent } from '../functions/create-extended-linear-ramp-to-value-automation-event';\nimport { createSetValueAutomationEvent } from '../functions/create-set-value-automation-event';\nimport { createSetValueCurveAutomationEvent } from '../functions/create-set-value-curve-automation-event';\nimport { getEndTimeAndValueOfPreviousAutomationEvent } from '../functions/get-end-time-and-value-of-previous-automation-event';\nimport { getEventTime } from '../functions/get-event-time';\nimport { getExponentialRampValueAtTime } from '../functions/get-exponential-ramp-value-at-time';\nimport { getLinearRampValueAtTime } from '../functions/get-linear-ramp-value-at-time';\nimport { getTargetValueAtTime } from '../functions/get-target-value-at-time';\nimport { getValueCurveValueAtTime } from '../functions/get-value-curve-value-at-time';\nimport { getValueOfAutomationEventAtIndexAtTime } from '../functions/get-value-of-automation-event-at-index-at-time';\nimport { isAnyRampToValueAutomationEvent } from '../guards/any-ramp-to-value-automation-event';\nimport { isCancelAndHoldAutomationEvent } from '../guards/cancel-and-hold-automation-event';\nimport { isCancelScheduledValuesAutomationEvent } from '../guards/cancel-scheduled-values-automation-event';\nimport { isExponentialRampToValueAutomationEvent } from '../guards/exponential-ramp-to-value-automation-event';\nimport { isLinearRampToValueAutomationEvent } from '../guards/linear-ramp-to-value-automation-event';\nimport { isSetTargetAutomationEvent } from '../guards/set-target-automation-event';\nimport { isSetValueAutomationEvent } from '../guards/set-value-automation-event';\nimport { isSetValueCurveAutomationEvent } from '../guards/set-value-curve-automation-event';\nexport class AutomationEventList {\n constructor(defaultValue) {\n this._automationEvents = [];\n this._currenTime = 0;\n this._defaultValue = defaultValue;\n }\n [Symbol.iterator]() {\n return this._automationEvents[Symbol.iterator]();\n }\n add(automationEvent) {\n const eventTime = getEventTime(automationEvent);\n if (isCancelAndHoldAutomationEvent(automationEvent) || isCancelScheduledValuesAutomationEvent(automationEvent)) {\n const index = this._automationEvents.findIndex((currentAutomationEvent) => {\n if (isCancelScheduledValuesAutomationEvent(automationEvent) && isSetValueCurveAutomationEvent(currentAutomationEvent)) {\n return currentAutomationEvent.startTime + currentAutomationEvent.duration >= eventTime;\n }\n return getEventTime(currentAutomationEvent) >= eventTime;\n });\n const removedAutomationEvent = this._automationEvents[index];\n if (index !== -1) {\n this._automationEvents = this._automationEvents.slice(0, index);\n }\n if (isCancelAndHoldAutomationEvent(automationEvent)) {\n const lastAutomationEvent = this._automationEvents[this._automationEvents.length - 1];\n if (removedAutomationEvent !== undefined && isAnyRampToValueAutomationEvent(removedAutomationEvent)) {\n if (lastAutomationEvent !== undefined && isSetTargetAutomationEvent(lastAutomationEvent)) {\n throw new Error('The internal list is malformed.');\n }\n const startTime = lastAutomationEvent === undefined\n ? removedAutomationEvent.insertTime\n : isSetValueCurveAutomationEvent(lastAutomationEvent)\n ? lastAutomationEvent.startTime + lastAutomationEvent.duration\n : getEventTime(lastAutomationEvent);\n const startValue = lastAutomationEvent === undefined\n ? this._defaultValue\n : isSetValueCurveAutomationEvent(lastAutomationEvent)\n ? lastAutomationEvent.values[lastAutomationEvent.values.length - 1]\n : lastAutomationEvent.value;\n const value = isExponentialRampToValueAutomationEvent(removedAutomationEvent)\n ? getExponentialRampValueAtTime(eventTime, startTime, startValue, removedAutomationEvent)\n : getLinearRampValueAtTime(eventTime, startTime, startValue, removedAutomationEvent);\n const truncatedAutomationEvent = isExponentialRampToValueAutomationEvent(removedAutomationEvent)\n ? createExtendedExponentialRampToValueAutomationEvent(value, eventTime, this._currenTime)\n : createExtendedLinearRampToValueAutomationEvent(value, eventTime, this._currenTime);\n this._automationEvents.push(truncatedAutomationEvent);\n }\n if (lastAutomationEvent !== undefined && isSetTargetAutomationEvent(lastAutomationEvent)) {\n this._automationEvents.push(createSetValueAutomationEvent(this.getValue(eventTime), eventTime));\n }\n if (lastAutomationEvent !== undefined &&\n isSetValueCurveAutomationEvent(lastAutomationEvent) &&\n lastAutomationEvent.startTime + lastAutomationEvent.duration > eventTime) {\n const duration = eventTime - lastAutomationEvent.startTime;\n const ratio = (lastAutomationEvent.values.length - 1) / lastAutomationEvent.duration;\n const length = Math.max(2, 1 + Math.ceil(duration * ratio));\n const fraction = (duration / (length - 1)) * ratio;\n const values = lastAutomationEvent.values.slice(0, length);\n if (fraction < 1) {\n for (let i = 1; i < length; i += 1) {\n const factor = (fraction * i) % 1;\n values[i] = lastAutomationEvent.values[i - 1] * (1 - factor) + lastAutomationEvent.values[i] * factor;\n }\n }\n this._automationEvents[this._automationEvents.length - 1] = createSetValueCurveAutomationEvent(values, lastAutomationEvent.startTime, duration);\n }\n }\n }\n else {\n const index = this._automationEvents.findIndex((currentAutomationEvent) => getEventTime(currentAutomationEvent) > eventTime);\n const previousAutomationEvent = index === -1 ? this._automationEvents[this._automationEvents.length - 1] : this._automationEvents[index - 1];\n if (previousAutomationEvent !== undefined &&\n isSetValueCurveAutomationEvent(previousAutomationEvent) &&\n getEventTime(previousAutomationEvent) + previousAutomationEvent.duration > eventTime) {\n return false;\n }\n const persistentAutomationEvent = isExponentialRampToValueAutomationEvent(automationEvent)\n ? createExtendedExponentialRampToValueAutomationEvent(automationEvent.value, automationEvent.endTime, this._currenTime)\n : isLinearRampToValueAutomationEvent(automationEvent)\n ? createExtendedLinearRampToValueAutomationEvent(automationEvent.value, eventTime, this._currenTime)\n : automationEvent;\n if (index === -1) {\n this._automationEvents.push(persistentAutomationEvent);\n }\n else {\n if (isSetValueCurveAutomationEvent(automationEvent) &&\n eventTime + automationEvent.duration > getEventTime(this._automationEvents[index])) {\n return false;\n }\n this._automationEvents.splice(index, 0, persistentAutomationEvent);\n }\n }\n return true;\n }\n flush(time) {\n const index = this._automationEvents.findIndex((currentAutomationEvent) => getEventTime(currentAutomationEvent) > time);\n if (index > 1) {\n const remainingAutomationEvents = this._automationEvents.slice(index - 1);\n const firstRemainingAutomationEvent = remainingAutomationEvents[0];\n if (isSetTargetAutomationEvent(firstRemainingAutomationEvent)) {\n remainingAutomationEvents.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents, index - 2, firstRemainingAutomationEvent.startTime, this._defaultValue), firstRemainingAutomationEvent.startTime));\n }\n this._automationEvents = remainingAutomationEvents;\n }\n }\n getValue(time) {\n if (this._automationEvents.length === 0) {\n return this._defaultValue;\n }\n const indexOfNextEvent = this._automationEvents.findIndex((automationEvent) => getEventTime(automationEvent) > time);\n const nextAutomationEvent = this._automationEvents[indexOfNextEvent];\n const indexOfCurrentEvent = (indexOfNextEvent === -1 ? this._automationEvents.length : indexOfNextEvent) - 1;\n const currentAutomationEvent = this._automationEvents[indexOfCurrentEvent];\n if (currentAutomationEvent !== undefined &&\n isSetTargetAutomationEvent(currentAutomationEvent) &&\n (nextAutomationEvent === undefined ||\n !isAnyRampToValueAutomationEvent(nextAutomationEvent) ||\n nextAutomationEvent.insertTime > time)) {\n return getTargetValueAtTime(time, getValueOfAutomationEventAtIndexAtTime(this._automationEvents, indexOfCurrentEvent - 1, currentAutomationEvent.startTime, this._defaultValue), currentAutomationEvent);\n }\n if (currentAutomationEvent !== undefined &&\n isSetValueAutomationEvent(currentAutomationEvent) &&\n (nextAutomationEvent === undefined || !isAnyRampToValueAutomationEvent(nextAutomationEvent))) {\n return currentAutomationEvent.value;\n }\n if (currentAutomationEvent !== undefined &&\n isSetValueCurveAutomationEvent(currentAutomationEvent) &&\n (nextAutomationEvent === undefined ||\n !isAnyRampToValueAutomationEvent(nextAutomationEvent) ||\n currentAutomationEvent.startTime + currentAutomationEvent.duration > time)) {\n if (time < currentAutomationEvent.startTime + currentAutomationEvent.duration) {\n return getValueCurveValueAtTime(time, currentAutomationEvent);\n }\n return currentAutomationEvent.values[currentAutomationEvent.values.length - 1];\n }\n if (currentAutomationEvent !== undefined &&\n isAnyRampToValueAutomationEvent(currentAutomationEvent) &&\n (nextAutomationEvent === undefined || !isAnyRampToValueAutomationEvent(nextAutomationEvent))) {\n return currentAutomationEvent.value;\n }\n if (nextAutomationEvent !== undefined && isExponentialRampToValueAutomationEvent(nextAutomationEvent)) {\n const [startTime, value] = getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents, indexOfCurrentEvent, currentAutomationEvent, nextAutomationEvent, this._defaultValue);\n return getExponentialRampValueAtTime(time, startTime, value, nextAutomationEvent);\n }\n if (nextAutomationEvent !== undefined && isLinearRampToValueAutomationEvent(nextAutomationEvent)) {\n const [startTime, value] = getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents, indexOfCurrentEvent, currentAutomationEvent, nextAutomationEvent, this._defaultValue);\n return getLinearRampValueAtTime(time, startTime, value, nextAutomationEvent);\n }\n return this._defaultValue;\n }\n}\n//# sourceMappingURL=automation-event-list.js.map","export const createCancelAndHoldAutomationEvent = (cancelTime) => {\n return { cancelTime, type: 'cancelAndHold' };\n};\n//# sourceMappingURL=create-cancel-and-hold-automation-event.js.map","export const createCancelScheduledValuesAutomationEvent = (cancelTime) => {\n return { cancelTime, type: 'cancelScheduledValues' };\n};\n//# sourceMappingURL=create-cancel-scheduled-values-automation-event.js.map","export const createExponentialRampToValueAutomationEvent = (value, endTime) => {\n return { endTime, type: 'exponentialRampToValue', value };\n};\n//# sourceMappingURL=create-exponential-ramp-to-value-automation-event.js.map","export const createLinearRampToValueAutomationEvent = (value, endTime) => {\n return { endTime, type: 'linearRampToValue', value };\n};\n//# sourceMappingURL=create-linear-ramp-to-value-automation-event.js.map","export const createSetTargetAutomationEvent = (target, startTime, timeConstant) => {\n return { startTime, target, timeConstant, type: 'setTarget' };\n};\n//# sourceMappingURL=create-set-target-automation-event.js.map","export const createAbortError = () => new DOMException('', 'AbortError');\n//# sourceMappingURL=abort-error.js.map","export const createAddActiveInputConnectionToAudioNode = (insertElementInSet) => {\n return (activeInputs, source, [output, input, eventListener], ignoreDuplicates) => {\n insertElementInSet(activeInputs[input], [source, output, eventListener], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output, ignoreDuplicates);\n };\n};\n//# sourceMappingURL=add-active-input-connection-to-audio-node.js.map","export const createAddAudioNodeConnections = (audioNodeConnectionsStore) => {\n return (audioNode, audioNodeRenderer, nativeAudioNode) => {\n const activeInputs = [];\n for (let i = 0; i < nativeAudioNode.numberOfInputs; i += 1) {\n activeInputs.push(new Set());\n }\n audioNodeConnectionsStore.set(audioNode, {\n activeInputs,\n outputs: new Set(),\n passiveInputs: new WeakMap(),\n renderer: audioNodeRenderer\n });\n };\n};\n//# sourceMappingURL=add-audio-node-connections.js.map","export const createAddAudioParamConnections = (audioParamConnectionsStore) => {\n return (audioParam, audioParamRenderer) => {\n audioParamConnectionsStore.set(audioParam, { activeInputs: new Set(), passiveInputs: new WeakMap(), renderer: audioParamRenderer });\n };\n};\n//# sourceMappingURL=add-audio-param-connections.js.map","export const ACTIVE_AUDIO_NODE_STORE = new WeakSet();\nexport const AUDIO_NODE_CONNECTIONS_STORE = new WeakMap();\nexport const AUDIO_NODE_STORE = new WeakMap();\nexport const AUDIO_PARAM_CONNECTIONS_STORE = new WeakMap();\nexport const AUDIO_PARAM_STORE = new WeakMap();\nexport const CONTEXT_STORE = new WeakMap();\nexport const EVENT_LISTENERS = new WeakMap();\nexport const CYCLE_COUNTERS = new WeakMap();\n// This clunky name is borrowed from the spec. :-)\nexport const NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS = new WeakMap();\nexport const NODE_TO_PROCESSOR_MAPS = new WeakMap();\n//# sourceMappingURL=globals.js.map","const handler = {\n construct() {\n return handler;\n }\n};\nexport const isConstructible = (constructible) => {\n try {\n const proxy = new Proxy(constructible, handler);\n new proxy(); // tslint:disable-line:no-unused-expression\n }\n catch {\n return false;\n }\n return true;\n};\n//# sourceMappingURL=is-constructible.js.map","/*\n * This massive regex tries to cover all the following cases.\n *\n * import './path';\n * import defaultImport from './path';\n * import { namedImport } from './path';\n * import { namedImport as renamendImport } from './path';\n * import * as namespaceImport from './path';\n * import defaultImport, { namedImport } from './path';\n * import defaultImport, { namedImport as renamendImport } from './path';\n * import defaultImport, * as namespaceImport from './path';\n */\nconst IMPORT_STATEMENT_REGEX = /^import(?:(?:[\\s]+[\\w]+|(?:[\\s]+[\\w]+[\\s]*,)?[\\s]*\\{[\\s]*[\\w]+(?:[\\s]+as[\\s]+[\\w]+)?(?:[\\s]*,[\\s]*[\\w]+(?:[\\s]+as[\\s]+[\\w]+)?)*[\\s]*}|(?:[\\s]+[\\w]+[\\s]*,)?[\\s]*\\*[\\s]+as[\\s]+[\\w]+)[\\s]+from)?(?:[\\s]*)(\"([^\"\\\\]|\\\\.)+\"|'([^'\\\\]|\\\\.)+')(?:[\\s]*);?/; // tslint:disable-line:max-line-length\nexport const splitImportStatements = (source, url) => {\n const importStatements = [];\n let sourceWithoutImportStatements = source.replace(/^[\\s]+/, '');\n let result = sourceWithoutImportStatements.match(IMPORT_STATEMENT_REGEX);\n while (result !== null) {\n const unresolvedUrl = result[1].slice(1, -1);\n const importStatementWithResolvedUrl = result[0]\n .replace(/([\\s]+)?;?$/, '')\n .replace(unresolvedUrl, new URL(unresolvedUrl, url).toString());\n importStatements.push(importStatementWithResolvedUrl);\n sourceWithoutImportStatements = sourceWithoutImportStatements.slice(result[0].length).replace(/^[\\s]+/, '');\n result = sourceWithoutImportStatements.match(IMPORT_STATEMENT_REGEX);\n }\n return [importStatements.join(';'), sourceWithoutImportStatements];\n};\n//# sourceMappingURL=split-import-statements.js.map","import { NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS } from '../globals';\nimport { isConstructible } from '../helpers/is-constructible';\nimport { splitImportStatements } from '../helpers/split-import-statements';\nconst verifyParameterDescriptors = (parameterDescriptors) => {\n if (parameterDescriptors !== undefined && !Array.isArray(parameterDescriptors)) {\n throw new TypeError('The parameterDescriptors property of given value for processorCtor is not an array.');\n }\n};\nconst verifyProcessorCtor = (processorCtor) => {\n if (!isConstructible(processorCtor)) {\n throw new TypeError('The given value for processorCtor should be a constructor.');\n }\n if (processorCtor.prototype === null || typeof processorCtor.prototype !== 'object') {\n throw new TypeError('The given value for processorCtor should have a prototype.');\n }\n};\nexport const createAddAudioWorkletModule = (cacheTestResult, createNotSupportedError, evaluateSource, exposeCurrentFrameAndCurrentTime, fetchSource, getNativeContext, getOrCreateBackupOfflineAudioContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, ongoingRequests, resolvedRequests, testAudioWorkletProcessorPostMessageSupport, window) => {\n let index = 0;\n return (context, moduleURL, options = { credentials: 'omit' }) => {\n const resolvedRequestsOfContext = resolvedRequests.get(context);\n if (resolvedRequestsOfContext !== undefined && resolvedRequestsOfContext.has(moduleURL)) {\n return Promise.resolve();\n }\n const ongoingRequestsOfContext = ongoingRequests.get(context);\n if (ongoingRequestsOfContext !== undefined) {\n const promiseOfOngoingRequest = ongoingRequestsOfContext.get(moduleURL);\n if (promiseOfOngoingRequest !== undefined) {\n return promiseOfOngoingRequest;\n }\n }\n const nativeContext = getNativeContext(context);\n // Bug #59: Safari does not implement the audioWorklet property.\n const promise = nativeContext.audioWorklet === undefined\n ? fetchSource(moduleURL)\n .then(([source, absoluteUrl]) => {\n const [importStatements, sourceWithoutImportStatements] = splitImportStatements(source, absoluteUrl);\n /*\n * This is the unminified version of the code used below:\n *\n * ```js\n * ${ importStatements };\n * ((a, b) => {\n * (a[b] = a[b] || [ ]).push(\n * (AudioWorkletProcessor, global, registerProcessor, sampleRate, self, window) => {\n * ${ sourceWithoutImportStatements }\n * }\n * );\n * })(window, '_AWGS');\n * ```\n */\n // tslint:disable-next-line:max-line-length\n const wrappedSource = `${importStatements};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${sourceWithoutImportStatements}\n})})(window,'_AWGS')`;\n // @todo Evaluating the given source code is a possible security problem.\n return evaluateSource(wrappedSource);\n })\n .then(() => {\n const evaluateAudioWorkletGlobalScope = window._AWGS.pop();\n if (evaluateAudioWorkletGlobalScope === undefined) {\n // Bug #182 Chrome and Edge do throw an instance of a SyntaxError instead of a DOMException.\n throw new SyntaxError();\n }\n exposeCurrentFrameAndCurrentTime(nativeContext.currentTime, nativeContext.sampleRate, () => evaluateAudioWorkletGlobalScope(class AudioWorkletProcessor {\n }, undefined, (name, processorCtor) => {\n if (name.trim() === '') {\n throw createNotSupportedError();\n }\n const nodeNameToProcessorConstructorMap = NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(nativeContext);\n if (nodeNameToProcessorConstructorMap !== undefined) {\n if (nodeNameToProcessorConstructorMap.has(name)) {\n throw createNotSupportedError();\n }\n verifyProcessorCtor(processorCtor);\n verifyParameterDescriptors(processorCtor.parameterDescriptors);\n nodeNameToProcessorConstructorMap.set(name, processorCtor);\n }\n else {\n verifyProcessorCtor(processorCtor);\n verifyParameterDescriptors(processorCtor.parameterDescriptors);\n NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(nativeContext, new Map([[name, processorCtor]]));\n }\n }, nativeContext.sampleRate, undefined, undefined));\n })\n : Promise.all([\n fetchSource(moduleURL),\n Promise.resolve(cacheTestResult(testAudioWorkletProcessorPostMessageSupport, testAudioWorkletProcessorPostMessageSupport))\n ]).then(([[source, absoluteUrl], isSupportingPostMessage]) => {\n const currentIndex = index + 1;\n index = currentIndex;\n const [importStatements, sourceWithoutImportStatements] = splitImportStatements(source, absoluteUrl);\n /*\n * Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument.\n *\n * This is the unminified version of the code used below.\n *\n * ```js\n * class extends AudioWorkletProcessor {\n *\n * __buffers = new WeakSet();\n *\n * constructor () {\n * super();\n *\n * this.port.postMessage = ((postMessage) => {\n * return (message, transferables) => {\n * const filteredTransferables = (transferables)\n * ? transferables.filter((transferable) => !this.__buffers.has(transferable))\n * : transferables;\n *\n * return postMessage.call(this.port, message, filteredTransferables);\n * };\n * })(this.port.postMessage);\n * }\n * }\n * ```\n */\n const patchedAudioWorkletProcessor = isSupportingPostMessage\n ? 'AudioWorkletProcessor'\n : 'class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}';\n /*\n * Bug #170: Chrome and Edge do call process() with an array with empty channelData for each input if no input is connected.\n *\n * Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument.\n *\n * Bug #190: Safari doesn't throw an error when loading an unparsable module.\n *\n * This is the unminified version of the code used below:\n *\n * ```js\n * `${ importStatements };\n * ((AudioWorkletProcessor, registerProcessor) => {${ sourceWithoutImportStatements }\n * })(\n * ${ patchedAudioWorkletProcessor },\n * (name, processorCtor) => registerProcessor(name, class extends processorCtor {\n *\n * __collectBuffers = (array) => {\n * array.forEach((element) => this.__buffers.add(element.buffer));\n * };\n *\n * process (inputs, outputs, parameters) {\n * inputs.forEach(this.__collectBuffers);\n * outputs.forEach(this.__collectBuffers);\n * this.__collectBuffers(Object.values(parameters));\n *\n * return super.process(\n * (inputs.map((input) => input.some((channelData) => channelData.length === 0)) ? [ ] : input),\n * outputs,\n * parameters\n * );\n * }\n *\n * })\n * );\n *\n * registerProcessor(`__sac${currentIndex}`, class extends AudioWorkletProcessor{\n *\n * process () {\n * return false;\n * }\n *\n * })`\n * ```\n */\n const memberDefinition = isSupportingPostMessage ? '' : '__c = (a) => a.forEach(e=>this.__b.add(e.buffer));';\n const bufferRegistration = isSupportingPostMessage\n ? ''\n : 'i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));';\n const wrappedSource = `${importStatements};((AudioWorkletProcessor,registerProcessor)=>{${sourceWithoutImportStatements}\n})(${patchedAudioWorkletProcessor},(n,p)=>registerProcessor(n,class extends p{${memberDefinition}process(i,o,p){${bufferRegistration}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${currentIndex}',class extends AudioWorkletProcessor{process(){return !1}})`;\n const blob = new Blob([wrappedSource], { type: 'application/javascript; charset=utf-8' });\n const url = URL.createObjectURL(blob);\n return nativeContext.audioWorklet\n .addModule(url, options)\n .then(() => {\n if (isNativeOfflineAudioContext(nativeContext)) {\n return nativeContext;\n }\n // Bug #186: Chrome and Edge do not allow to create an AudioWorkletNode on a closed AudioContext.\n const backupOfflineAudioContext = getOrCreateBackupOfflineAudioContext(nativeContext);\n return backupOfflineAudioContext.audioWorklet.addModule(url, options).then(() => backupOfflineAudioContext);\n })\n .then((nativeContextOrBackupOfflineAudioContext) => {\n if (nativeAudioWorkletNodeConstructor === null) {\n throw new SyntaxError();\n }\n try {\n // Bug #190: Safari doesn't throw an error when loading an unparsable module.\n new nativeAudioWorkletNodeConstructor(nativeContextOrBackupOfflineAudioContext, `__sac${currentIndex}`); // tslint:disable-line:no-unused-expression\n }\n catch {\n throw new SyntaxError();\n }\n })\n .finally(() => URL.revokeObjectURL(url));\n });\n if (ongoingRequestsOfContext === undefined) {\n ongoingRequests.set(context, new Map([[moduleURL, promise]]));\n }\n else {\n ongoingRequestsOfContext.set(moduleURL, promise);\n }\n promise\n .then(() => {\n const updatedResolvedRequestsOfContext = resolvedRequests.get(context);\n if (updatedResolvedRequestsOfContext === undefined) {\n resolvedRequests.set(context, new Set([moduleURL]));\n }\n else {\n updatedResolvedRequestsOfContext.add(moduleURL);\n }\n })\n .finally(() => {\n const updatedOngoingRequestsOfContext = ongoingRequests.get(context);\n if (updatedOngoingRequestsOfContext !== undefined) {\n updatedOngoingRequestsOfContext.delete(moduleURL);\n }\n });\n return promise;\n };\n};\n//# sourceMappingURL=add-audio-worklet-module.js.map","export const getValueForKey = (map, key) => {\n const value = map.get(key);\n if (value === undefined) {\n throw new Error('A value with the given key could not be found.');\n }\n return value;\n};\n//# sourceMappingURL=get-value-for-key.js.map","export const pickElementFromSet = (set, predicate) => {\n const matchingElements = Array.from(set).filter(predicate);\n if (matchingElements.length > 1) {\n throw Error('More than one element was found.');\n }\n if (matchingElements.length === 0) {\n throw Error('No element was found.');\n }\n const [matchingElement] = matchingElements;\n set.delete(matchingElement);\n return matchingElement;\n};\n//# sourceMappingURL=pick-element-from-set.js.map","import { getValueForKey } from './get-value-for-key';\nimport { pickElementFromSet } from './pick-element-from-set';\nexport const deletePassiveInputConnectionToAudioNode = (passiveInputs, source, output, input) => {\n const passiveInputConnections = getValueForKey(passiveInputs, source);\n const matchingConnection = pickElementFromSet(passiveInputConnections, (passiveInputConnection) => passiveInputConnection[0] === output && passiveInputConnection[1] === input);\n if (passiveInputConnections.size === 0) {\n passiveInputs.delete(source);\n }\n return matchingConnection;\n};\n//# sourceMappingURL=delete-passive-input-connection-to-audio-node.js.map","import { EVENT_LISTENERS } from '../globals';\nimport { getValueForKey } from './get-value-for-key';\nexport const getEventListenersOfAudioNode = (audioNode) => {\n return getValueForKey(EVENT_LISTENERS, audioNode);\n};\n//# sourceMappingURL=get-event-listeners-of-audio-node.js.map","import { ACTIVE_AUDIO_NODE_STORE } from '../globals';\nimport { getEventListenersOfAudioNode } from './get-event-listeners-of-audio-node';\nexport const setInternalStateToActive = (audioNode) => {\n if (ACTIVE_AUDIO_NODE_STORE.has(audioNode)) {\n throw new Error('The AudioNode is already stored.');\n }\n ACTIVE_AUDIO_NODE_STORE.add(audioNode);\n getEventListenersOfAudioNode(audioNode).forEach((eventListener) => eventListener(true));\n};\n//# sourceMappingURL=set-internal-state-to-active.js.map","export const isAudioWorkletNode = (audioNode) => {\n return 'port' in audioNode;\n};\n//# sourceMappingURL=audio-worklet-node.js.map","import { ACTIVE_AUDIO_NODE_STORE } from '../globals';\nimport { getEventListenersOfAudioNode } from './get-event-listeners-of-audio-node';\nexport const setInternalStateToPassive = (audioNode) => {\n if (!ACTIVE_AUDIO_NODE_STORE.has(audioNode)) {\n throw new Error('The AudioNode is not stored.');\n }\n ACTIVE_AUDIO_NODE_STORE.delete(audioNode);\n getEventListenersOfAudioNode(audioNode).forEach((eventListener) => eventListener(false));\n};\n//# sourceMappingURL=set-internal-state-to-passive.js.map","import { isAudioWorkletNode } from '../guards/audio-worklet-node';\nimport { setInternalStateToPassive } from './set-internal-state-to-passive';\n// Set the internalState of the audioNode to 'passive' if it is not an AudioWorkletNode and if it has no 'active' input connections.\nexport const setInternalStateToPassiveWhenNecessary = (audioNode, activeInputs) => {\n if (!isAudioWorkletNode(audioNode) && activeInputs.every((connections) => connections.size === 0)) {\n setInternalStateToPassive(audioNode);\n }\n};\n//# sourceMappingURL=set-internal-state-to-passive-when-necessary.js.map","import { deletePassiveInputConnectionToAudioNode } from '../helpers/delete-passive-input-connection-to-audio-node';\nimport { setInternalStateToActive } from '../helpers/set-internal-state-to-active';\nimport { setInternalStateToPassiveWhenNecessary } from '../helpers/set-internal-state-to-passive-when-necessary';\nexport const createAddConnectionToAudioNode = (addActiveInputConnectionToAudioNode, addPassiveInputConnectionToAudioNode, connectNativeAudioNodeToNativeAudioNode, deleteActiveInputConnectionToAudioNode, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getAudioNodeTailTime, getEventListenersOfAudioNode, getNativeAudioNode, insertElementInSet, isActiveAudioNode, isPartOfACycle, isPassiveAudioNode) => {\n const tailTimeTimeoutIds = new WeakMap();\n return (source, destination, output, input, isOffline) => {\n const { activeInputs, passiveInputs } = getAudioNodeConnections(destination);\n const { outputs } = getAudioNodeConnections(source);\n const eventListeners = getEventListenersOfAudioNode(source);\n const eventListener = (isActive) => {\n const nativeDestinationAudioNode = getNativeAudioNode(destination);\n const nativeSourceAudioNode = getNativeAudioNode(source);\n if (isActive) {\n const partialConnection = deletePassiveInputConnectionToAudioNode(passiveInputs, source, output, input);\n addActiveInputConnectionToAudioNode(activeInputs, source, partialConnection, false);\n if (!isOffline && !isPartOfACycle(source)) {\n connectNativeAudioNodeToNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output, input);\n }\n if (isPassiveAudioNode(destination)) {\n setInternalStateToActive(destination);\n }\n }\n else {\n const partialConnection = deleteActiveInputConnectionToAudioNode(activeInputs, source, output, input);\n addPassiveInputConnectionToAudioNode(passiveInputs, input, partialConnection, false);\n if (!isOffline && !isPartOfACycle(source)) {\n disconnectNativeAudioNodeFromNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output, input);\n }\n const tailTime = getAudioNodeTailTime(destination);\n if (tailTime === 0) {\n if (isActiveAudioNode(destination)) {\n setInternalStateToPassiveWhenNecessary(destination, activeInputs);\n }\n }\n else {\n const tailTimeTimeoutId = tailTimeTimeoutIds.get(destination);\n if (tailTimeTimeoutId !== undefined) {\n clearTimeout(tailTimeTimeoutId);\n }\n tailTimeTimeoutIds.set(destination, setTimeout(() => {\n if (isActiveAudioNode(destination)) {\n setInternalStateToPassiveWhenNecessary(destination, activeInputs);\n }\n }, tailTime * 1000));\n }\n }\n };\n if (insertElementInSet(outputs, [destination, output, input], (outputConnection) => outputConnection[0] === destination && outputConnection[1] === output && outputConnection[2] === input, true)) {\n eventListeners.add(eventListener);\n if (isActiveAudioNode(source)) {\n addActiveInputConnectionToAudioNode(activeInputs, source, [output, input, eventListener], true);\n }\n else {\n addPassiveInputConnectionToAudioNode(passiveInputs, input, [source, output, eventListener], true);\n }\n return true;\n }\n return false;\n };\n};\n//# sourceMappingURL=add-connection-to-audio-node.js.map","export const createAddPassiveInputConnectionToAudioNode = (insertElementInSet) => {\n return (passiveInputs, input, [source, output, eventListener], ignoreDuplicates) => {\n const passiveInputConnections = passiveInputs.get(source);\n if (passiveInputConnections === undefined) {\n passiveInputs.set(source, new Set([[output, input, eventListener]]));\n }\n else {\n insertElementInSet(passiveInputConnections, [output, input, eventListener], (passiveInputConnection) => passiveInputConnection[0] === output && passiveInputConnection[1] === input, ignoreDuplicates);\n }\n };\n};\n//# sourceMappingURL=add-passive-input-connection-to-audio-node.js.map","export const createAddSilentConnection = (createNativeGainNode) => {\n return (nativeContext, nativeAudioScheduledSourceNode) => {\n const nativeGainNode = createNativeGainNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n gain: 0\n });\n nativeAudioScheduledSourceNode.connect(nativeGainNode).connect(nativeContext.destination);\n const disconnect = () => {\n nativeAudioScheduledSourceNode.removeEventListener('ended', disconnect);\n nativeAudioScheduledSourceNode.disconnect(nativeGainNode);\n nativeGainNode.disconnect();\n };\n nativeAudioScheduledSourceNode.addEventListener('ended', disconnect);\n };\n};\n//# sourceMappingURL=add-silent-connection.js.map","export const createAddUnrenderedAudioWorkletNode = (getUnrenderedAudioWorkletNodes) => {\n return (nativeContext, audioWorkletNode) => {\n getUnrenderedAudioWorkletNodes(nativeContext).add(audioWorkletNode);\n };\n};\n//# sourceMappingURL=add-unrendered-audio-worklet-node.js.map","export const isOwnedByContext = (nativeAudioNode, nativeContext) => {\n return nativeAudioNode.context === nativeContext;\n};\n//# sourceMappingURL=is-owned-by-context.js.map","export const testAudioBufferCopyChannelMethodsOutOfBoundsSupport = (nativeAudioBuffer) => {\n try {\n nativeAudioBuffer.copyToChannel(new Float32Array(1), 0, -1);\n }\n catch {\n return false;\n }\n return true;\n};\n//# sourceMappingURL=test-audio-buffer-copy-channel-methods-out-of-bounds-support.js.map","export const createIndexSizeError = () => new DOMException('', 'IndexSizeError');\n//# sourceMappingURL=index-size-error.js.map","import { createIndexSizeError } from '../factories/index-size-error';\nexport const wrapAudioBufferGetChannelDataMethod = (audioBuffer) => {\n audioBuffer.getChannelData = ((getChannelData) => {\n return (channel) => {\n try {\n return getChannelData.call(audioBuffer, channel);\n }\n catch (err) {\n if (err.code === 12) {\n throw createIndexSizeError();\n }\n throw err;\n }\n };\n })(audioBuffer.getChannelData);\n};\n//# sourceMappingURL=wrap-audio-buffer-get-channel-data-method.js.map","import { testAudioBufferCopyChannelMethodsOutOfBoundsSupport } from '../helpers/test-audio-buffer-copy-channel-methods-out-of-bounds-support';\nimport { wrapAudioBufferGetChannelDataMethod } from '../helpers/wrap-audio-buffer-get-channel-data-method';\nconst DEFAULT_OPTIONS = {\n numberOfChannels: 1\n};\nexport const createAudioBufferConstructor = (audioBufferStore, cacheTestResult, createNotSupportedError, nativeAudioBufferConstructor, nativeOfflineAudioContextConstructor, testNativeAudioBufferConstructorSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds) => {\n let nativeOfflineAudioContext = null;\n return class AudioBuffer {\n constructor(options) {\n if (nativeOfflineAudioContextConstructor === null) {\n throw new Error('Missing the native OfflineAudioContext constructor.');\n }\n const { length, numberOfChannels, sampleRate } = { ...DEFAULT_OPTIONS, ...options };\n if (nativeOfflineAudioContext === null) {\n nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100);\n }\n /*\n * Bug #99: Firefox does not throw a NotSupportedError when the numberOfChannels is zero. But it only does it when using the\n * factory function. But since Firefox also supports the constructor everything should be fine.\n */\n const audioBuffer = nativeAudioBufferConstructor !== null &&\n cacheTestResult(testNativeAudioBufferConstructorSupport, testNativeAudioBufferConstructorSupport)\n ? new nativeAudioBufferConstructor({ length, numberOfChannels, sampleRate })\n : nativeOfflineAudioContext.createBuffer(numberOfChannels, length, sampleRate);\n // Bug #99: Safari does not throw an error when the numberOfChannels is zero.\n if (audioBuffer.numberOfChannels === 0) {\n throw createNotSupportedError();\n }\n // Bug #5: Safari does not support copyFromChannel() and copyToChannel().\n // Bug #100: Safari does throw a wrong error when calling getChannelData() with an out-of-bounds value.\n if (typeof audioBuffer.copyFromChannel !== 'function') {\n wrapAudioBufferCopyChannelMethods(audioBuffer);\n wrapAudioBufferGetChannelDataMethod(audioBuffer);\n // Bug #157: Firefox does not allow the bufferOffset to be out-of-bounds.\n }\n else if (!cacheTestResult(testAudioBufferCopyChannelMethodsOutOfBoundsSupport, () => testAudioBufferCopyChannelMethodsOutOfBoundsSupport(audioBuffer))) {\n wrapAudioBufferCopyChannelMethodsOutOfBounds(audioBuffer);\n }\n audioBufferStore.add(audioBuffer);\n /*\n * This does violate all good pratices but it is necessary to allow this AudioBuffer to be used with native\n * (Offline)AudioContexts.\n */\n return audioBuffer;\n }\n static [Symbol.hasInstance](instance) {\n return ((instance !== null && typeof instance === 'object' && Object.getPrototypeOf(instance) === AudioBuffer.prototype) ||\n audioBufferStore.has(instance));\n }\n };\n};\n//# sourceMappingURL=audio-buffer-constructor.js.map","export const MOST_NEGATIVE_SINGLE_FLOAT = -3.4028234663852886e38;\nexport const MOST_POSITIVE_SINGLE_FLOAT = -MOST_NEGATIVE_SINGLE_FLOAT;\n//# sourceMappingURL=constants.js.map","import { ACTIVE_AUDIO_NODE_STORE } from '../globals';\nexport const isActiveAudioNode = (audioNode) => ACTIVE_AUDIO_NODE_STORE.has(audioNode);\n//# sourceMappingURL=is-active-audio-node.js.map","import { MOST_NEGATIVE_SINGLE_FLOAT, MOST_POSITIVE_SINGLE_FLOAT } from '../constants';\nimport { isActiveAudioNode } from '../helpers/is-active-audio-node';\nimport { setInternalStateToActive } from '../helpers/set-internal-state-to-active';\nimport { setInternalStateToPassive } from '../helpers/set-internal-state-to-passive';\nconst DEFAULT_OPTIONS = {\n buffer: null,\n channelCount: 2,\n channelCountMode: 'max',\n channelInterpretation: 'speakers',\n // Bug #149: Safari does not yet support the detune AudioParam.\n loop: false,\n loopEnd: 0,\n loopStart: 0,\n playbackRate: 1\n};\nexport const createAudioBufferSourceNodeConstructor = (audioNodeConstructor, createAudioBufferSourceNodeRenderer, createAudioParam, createInvalidStateError, createNativeAudioBufferSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener) => {\n return class AudioBufferSourceNode extends audioNodeConstructor {\n constructor(context, options) {\n const nativeContext = getNativeContext(context);\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n const nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeContext, mergedOptions);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n const audioBufferSourceNodeRenderer = ((isOffline ? createAudioBufferSourceNodeRenderer() : null));\n super(context, false, nativeAudioBufferSourceNode, audioBufferSourceNodeRenderer);\n this._audioBufferSourceNodeRenderer = audioBufferSourceNodeRenderer;\n this._isBufferNullified = false;\n this._isBufferSet = mergedOptions.buffer !== null;\n this._nativeAudioBufferSourceNode = nativeAudioBufferSourceNode;\n this._onended = null;\n // Bug #73: Safari does not export the correct values for maxValue and minValue.\n this._playbackRate = createAudioParam(this, isOffline, nativeAudioBufferSourceNode.playbackRate, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT);\n }\n get buffer() {\n if (this._isBufferNullified) {\n return null;\n }\n return this._nativeAudioBufferSourceNode.buffer;\n }\n set buffer(value) {\n this._nativeAudioBufferSourceNode.buffer = value;\n // Bug #72: Only Chrome & Edge do not allow to reassign the buffer yet.\n if (value !== null) {\n if (this._isBufferSet) {\n throw createInvalidStateError();\n }\n this._isBufferSet = true;\n }\n }\n get loop() {\n return this._nativeAudioBufferSourceNode.loop;\n }\n set loop(value) {\n this._nativeAudioBufferSourceNode.loop = value;\n }\n get loopEnd() {\n return this._nativeAudioBufferSourceNode.loopEnd;\n }\n set loopEnd(value) {\n this._nativeAudioBufferSourceNode.loopEnd = value;\n }\n get loopStart() {\n return this._nativeAudioBufferSourceNode.loopStart;\n }\n set loopStart(value) {\n this._nativeAudioBufferSourceNode.loopStart = value;\n }\n get onended() {\n return this._onended;\n }\n set onended(value) {\n const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null;\n this._nativeAudioBufferSourceNode.onended = wrappedListener;\n const nativeOnEnded = this._nativeAudioBufferSourceNode.onended;\n this._onended = nativeOnEnded !== null && nativeOnEnded === wrappedListener ? value : nativeOnEnded;\n }\n get playbackRate() {\n return this._playbackRate;\n }\n start(when = 0, offset = 0, duration) {\n this._nativeAudioBufferSourceNode.start(when, offset, duration);\n if (this._audioBufferSourceNodeRenderer !== null) {\n this._audioBufferSourceNodeRenderer.start = duration === undefined ? [when, offset] : [when, offset, duration];\n }\n if (this.context.state !== 'closed') {\n setInternalStateToActive(this);\n const resetInternalStateToPassive = () => {\n this._nativeAudioBufferSourceNode.removeEventListener('ended', resetInternalStateToPassive);\n if (isActiveAudioNode(this)) {\n setInternalStateToPassive(this);\n }\n };\n this._nativeAudioBufferSourceNode.addEventListener('ended', resetInternalStateToPassive);\n }\n }\n stop(when = 0) {\n this._nativeAudioBufferSourceNode.stop(when);\n if (this._audioBufferSourceNodeRenderer !== null) {\n this._audioBufferSourceNodeRenderer.stop = when;\n }\n }\n };\n};\n//# sourceMappingURL=audio-buffer-source-node-constructor.js.map","import { isOwnedByContext } from '../helpers/is-owned-by-context';\nexport const createAudioBufferSourceNodeRendererFactory = (connectAudioParam, createNativeAudioBufferSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => {\n return () => {\n const renderedNativeAudioBufferSourceNodes = new WeakMap();\n let start = null;\n let stop = null;\n const createAudioBufferSourceNode = async (proxy, nativeOfflineAudioContext) => {\n let nativeAudioBufferSourceNode = getNativeAudioNode(proxy);\n /*\n * If the initially used nativeAudioBufferSourceNode was not constructed on the same OfflineAudioContext it needs to be created\n * again.\n */\n const nativeAudioBufferSourceNodeIsOwnedByContext = isOwnedByContext(nativeAudioBufferSourceNode, nativeOfflineAudioContext);\n if (!nativeAudioBufferSourceNodeIsOwnedByContext) {\n const options = {\n buffer: nativeAudioBufferSourceNode.buffer,\n channelCount: nativeAudioBufferSourceNode.channelCount,\n channelCountMode: nativeAudioBufferSourceNode.channelCountMode,\n channelInterpretation: nativeAudioBufferSourceNode.channelInterpretation,\n // Bug #149: Safari does not yet support the detune AudioParam.\n loop: nativeAudioBufferSourceNode.loop,\n loopEnd: nativeAudioBufferSourceNode.loopEnd,\n loopStart: nativeAudioBufferSourceNode.loopStart,\n playbackRate: nativeAudioBufferSourceNode.playbackRate.value\n };\n nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeOfflineAudioContext, options);\n if (start !== null) {\n nativeAudioBufferSourceNode.start(...start);\n }\n if (stop !== null) {\n nativeAudioBufferSourceNode.stop(stop);\n }\n }\n renderedNativeAudioBufferSourceNodes.set(nativeOfflineAudioContext, nativeAudioBufferSourceNode);\n if (!nativeAudioBufferSourceNodeIsOwnedByContext) {\n // Bug #149: Safari does not yet support the detune AudioParam.\n await renderAutomation(nativeOfflineAudioContext, proxy.playbackRate, nativeAudioBufferSourceNode.playbackRate);\n }\n else {\n // Bug #149: Safari does not yet support the detune AudioParam.\n await connectAudioParam(nativeOfflineAudioContext, proxy.playbackRate, nativeAudioBufferSourceNode.playbackRate);\n }\n await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioBufferSourceNode);\n return nativeAudioBufferSourceNode;\n };\n return {\n set start(value) {\n start = value;\n },\n set stop(value) {\n stop = value;\n },\n render(proxy, nativeOfflineAudioContext) {\n const renderedNativeAudioBufferSourceNode = renderedNativeAudioBufferSourceNodes.get(nativeOfflineAudioContext);\n if (renderedNativeAudioBufferSourceNode !== undefined) {\n return Promise.resolve(renderedNativeAudioBufferSourceNode);\n }\n return createAudioBufferSourceNode(proxy, nativeOfflineAudioContext);\n }\n };\n };\n};\n//# sourceMappingURL=audio-buffer-source-node-renderer-factory.js.map","export const isAudioBufferSourceNode = (audioNode) => {\n return 'playbackRate' in audioNode;\n};\n//# sourceMappingURL=audio-buffer-source-node.js.map","export const isBiquadFilterNode = (audioNode) => {\n return 'frequency' in audioNode && 'gain' in audioNode;\n};\n//# sourceMappingURL=biquad-filter-node.js.map","export const isConstantSourceNode = (audioNode) => {\n return 'offset' in audioNode;\n};\n//# sourceMappingURL=constant-source-node.js.map","export const isGainNode = (audioNode) => {\n return !('frequency' in audioNode) && 'gain' in audioNode;\n};\n//# sourceMappingURL=gain-node.js.map","export const isOscillatorNode = (audioNode) => {\n return 'detune' in audioNode && 'frequency' in audioNode && !('gain' in audioNode);\n};\n//# sourceMappingURL=oscillator-node.js.map","export const isStereoPannerNode = (audioNode) => {\n return 'pan' in audioNode;\n};\n//# sourceMappingURL=stereo-panner-node.js.map","import { AUDIO_NODE_CONNECTIONS_STORE } from '../globals';\nimport { getValueForKey } from './get-value-for-key';\nexport const getAudioNodeConnections = (audioNode) => {\n return getValueForKey(AUDIO_NODE_CONNECTIONS_STORE, audioNode);\n};\n//# sourceMappingURL=get-audio-node-connections.js.map","import { AUDIO_PARAM_CONNECTIONS_STORE } from '../globals';\nimport { getValueForKey } from './get-value-for-key';\nexport const getAudioParamConnections = (audioParam) => {\n return getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE, audioParam);\n};\n//# sourceMappingURL=get-audio-param-connections.js.map","import { isAudioBufferSourceNode } from '../guards/audio-buffer-source-node';\nimport { isAudioWorkletNode } from '../guards/audio-worklet-node';\nimport { isBiquadFilterNode } from '../guards/biquad-filter-node';\nimport { isConstantSourceNode } from '../guards/constant-source-node';\nimport { isGainNode } from '../guards/gain-node';\nimport { isOscillatorNode } from '../guards/oscillator-node';\nimport { isStereoPannerNode } from '../guards/stereo-panner-node';\nimport { getAudioNodeConnections } from './get-audio-node-connections';\nimport { getAudioParamConnections } from './get-audio-param-connections';\nimport { isActiveAudioNode } from './is-active-audio-node';\nimport { setInternalStateToPassive } from './set-internal-state-to-passive';\nexport const deactivateActiveAudioNodeInputConnections = (audioNode, trace) => {\n const { activeInputs } = getAudioNodeConnections(audioNode);\n activeInputs.forEach((connections) => connections.forEach(([source]) => {\n if (!trace.includes(audioNode)) {\n deactivateActiveAudioNodeInputConnections(source, [...trace, audioNode]);\n }\n }));\n const audioParams = isAudioBufferSourceNode(audioNode)\n ? [\n // Bug #149: Safari does not yet support the detune AudioParam.\n audioNode.playbackRate\n ]\n : isAudioWorkletNode(audioNode)\n ? Array.from(audioNode.parameters.values())\n : isBiquadFilterNode(audioNode)\n ? [audioNode.Q, audioNode.detune, audioNode.frequency, audioNode.gain]\n : isConstantSourceNode(audioNode)\n ? [audioNode.offset]\n : isGainNode(audioNode)\n ? [audioNode.gain]\n : isOscillatorNode(audioNode)\n ? [audioNode.detune, audioNode.frequency]\n : isStereoPannerNode(audioNode)\n ? [audioNode.pan]\n : [];\n for (const audioParam of audioParams) {\n const audioParamConnections = getAudioParamConnections(audioParam);\n if (audioParamConnections !== undefined) {\n audioParamConnections.activeInputs.forEach(([source]) => deactivateActiveAudioNodeInputConnections(source, trace));\n }\n }\n if (isActiveAudioNode(audioNode)) {\n setInternalStateToPassive(audioNode);\n }\n};\n//# sourceMappingURL=deactivate-active-audio-node-input-connections.js.map","import { deactivateActiveAudioNodeInputConnections } from './deactivate-active-audio-node-input-connections';\nexport const deactivateAudioGraph = (context) => {\n deactivateActiveAudioNodeInputConnections(context.destination, []);\n};\n//# sourceMappingURL=deactivate-audio-graph.js.map","export const isValidLatencyHint = (latencyHint) => {\n return (latencyHint === undefined ||\n typeof latencyHint === 'number' ||\n (typeof latencyHint === 'string' && (latencyHint === 'balanced' || latencyHint === 'interactive' || latencyHint === 'playback')));\n};\n//# sourceMappingURL=is-valid-latency-hint.js.map","export const createAudioDestinationNodeConstructor = (audioNodeConstructor, createAudioDestinationNodeRenderer, createIndexSizeError, createInvalidStateError, createNativeAudioDestinationNode, getNativeContext, isNativeOfflineAudioContext, renderInputsOfAudioNode) => {\n return class AudioDestinationNode extends audioNodeConstructor {\n constructor(context, channelCount) {\n const nativeContext = getNativeContext(context);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n const nativeAudioDestinationNode = createNativeAudioDestinationNode(nativeContext, channelCount, isOffline);\n const audioDestinationNodeRenderer = ((isOffline ? createAudioDestinationNodeRenderer(renderInputsOfAudioNode) : null));\n super(context, false, nativeAudioDestinationNode, audioDestinationNodeRenderer);\n this._isNodeOfNativeOfflineAudioContext = isOffline;\n this._nativeAudioDestinationNode = nativeAudioDestinationNode;\n }\n get channelCount() {\n return this._nativeAudioDestinationNode.channelCount;\n }\n set channelCount(value) {\n // Bug #52: Chrome, Edge & Safari do not throw an exception at all.\n // Bug #54: Firefox does throw an IndexSizeError.\n if (this._isNodeOfNativeOfflineAudioContext) {\n throw createInvalidStateError();\n }\n // Bug #47: The AudioDestinationNode in Safari does not initialize the maxChannelCount property correctly.\n if (value > this._nativeAudioDestinationNode.maxChannelCount) {\n throw createIndexSizeError();\n }\n this._nativeAudioDestinationNode.channelCount = value;\n }\n get channelCountMode() {\n return this._nativeAudioDestinationNode.channelCountMode;\n }\n set channelCountMode(value) {\n // Bug #53: No browser does throw an exception yet.\n if (this._isNodeOfNativeOfflineAudioContext) {\n throw createInvalidStateError();\n }\n this._nativeAudioDestinationNode.channelCountMode = value;\n }\n get maxChannelCount() {\n return this._nativeAudioDestinationNode.maxChannelCount;\n }\n };\n};\n//# sourceMappingURL=audio-destination-node-constructor.js.map","export const createAudioDestinationNodeRenderer = (renderInputsOfAudioNode) => {\n const renderedNativeAudioDestinationNodes = new WeakMap();\n const createAudioDestinationNode = async (proxy, nativeOfflineAudioContext) => {\n const nativeAudioDestinationNode = nativeOfflineAudioContext.destination;\n renderedNativeAudioDestinationNodes.set(nativeOfflineAudioContext, nativeAudioDestinationNode);\n await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioDestinationNode);\n return nativeAudioDestinationNode;\n };\n return {\n render(proxy, nativeOfflineAudioContext) {\n const renderedNativeAudioDestinationNode = renderedNativeAudioDestinationNodes.get(nativeOfflineAudioContext);\n if (renderedNativeAudioDestinationNode !== undefined) {\n return Promise.resolve(renderedNativeAudioDestinationNode);\n }\n return createAudioDestinationNode(proxy, nativeOfflineAudioContext);\n }\n };\n};\n//# sourceMappingURL=audio-destination-node-renderer-factory.js.map","import { MOST_NEGATIVE_SINGLE_FLOAT, MOST_POSITIVE_SINGLE_FLOAT } from '../constants';\nexport const createAudioListenerFactory = (createAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeScriptProcessorNode, createNotSupportedError, getFirstSample, isNativeOfflineAudioContext, overwriteAccessors) => {\n return (context, nativeContext) => {\n const nativeListener = nativeContext.listener;\n // Bug #117: Only Chrome & Edge support the new interface already.\n const createFakeAudioParams = () => {\n const buffer = new Float32Array(1);\n const channelMergerNode = createNativeChannelMergerNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: 9\n });\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n let isScriptProcessorNodeCreated = false;\n let lastOrientation = [0, 0, -1, 0, 1, 0];\n let lastPosition = [0, 0, 0];\n const createScriptProcessorNode = () => {\n if (isScriptProcessorNodeCreated) {\n return;\n }\n isScriptProcessorNodeCreated = true;\n const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, 256, 9, 0);\n // tslint:disable-next-line:deprecation\n scriptProcessorNode.onaudioprocess = ({ inputBuffer }) => {\n const orientation = [\n getFirstSample(inputBuffer, buffer, 0),\n getFirstSample(inputBuffer, buffer, 1),\n getFirstSample(inputBuffer, buffer, 2),\n getFirstSample(inputBuffer, buffer, 3),\n getFirstSample(inputBuffer, buffer, 4),\n getFirstSample(inputBuffer, buffer, 5)\n ];\n if (orientation.some((value, index) => value !== lastOrientation[index])) {\n nativeListener.setOrientation(...orientation); // tslint:disable-line:deprecation\n lastOrientation = orientation;\n }\n const positon = [\n getFirstSample(inputBuffer, buffer, 6),\n getFirstSample(inputBuffer, buffer, 7),\n getFirstSample(inputBuffer, buffer, 8)\n ];\n if (positon.some((value, index) => value !== lastPosition[index])) {\n nativeListener.setPosition(...positon); // tslint:disable-line:deprecation\n lastPosition = positon;\n }\n };\n channelMergerNode.connect(scriptProcessorNode);\n };\n const createSetOrientation = (index) => (value) => {\n if (value !== lastOrientation[index]) {\n lastOrientation[index] = value;\n nativeListener.setOrientation(...lastOrientation); // tslint:disable-line:deprecation\n }\n };\n const createSetPosition = (index) => (value) => {\n if (value !== lastPosition[index]) {\n lastPosition[index] = value;\n nativeListener.setPosition(...lastPosition); // tslint:disable-line:deprecation\n }\n };\n const createFakeAudioParam = (input, initialValue, setValue) => {\n const constantSourceNode = createNativeConstantSourceNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n offset: initialValue\n });\n constantSourceNode.connect(channelMergerNode, 0, input);\n // @todo This should be stopped when the context is closed.\n constantSourceNode.start();\n Object.defineProperty(constantSourceNode.offset, 'defaultValue', {\n get() {\n return initialValue;\n }\n });\n /*\n * Bug #62 & #74: Safari does not support ConstantSourceNodes and does not export the correct values for maxValue and\n * minValue for GainNodes.\n */\n const audioParam = createAudioParam({ context }, isOffline, constantSourceNode.offset, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT);\n overwriteAccessors(audioParam, 'value', (get) => () => get.call(audioParam), (set) => (value) => {\n try {\n set.call(audioParam, value);\n }\n catch (err) {\n if (err.code !== 9) {\n throw err;\n }\n }\n createScriptProcessorNode();\n if (isOffline) {\n // Bug #117: Using setOrientation() and setPosition() doesn't work with an OfflineAudioContext.\n setValue(value);\n }\n });\n audioParam.cancelAndHoldAtTime = ((cancelAndHoldAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = cancelAndHoldAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.cancelAndHoldAtTime);\n audioParam.cancelScheduledValues = ((cancelScheduledValues) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = cancelScheduledValues.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.cancelScheduledValues);\n audioParam.exponentialRampToValueAtTime = ((exponentialRampToValueAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = exponentialRampToValueAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.exponentialRampToValueAtTime);\n audioParam.linearRampToValueAtTime = ((linearRampToValueAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = linearRampToValueAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.linearRampToValueAtTime);\n audioParam.setTargetAtTime = ((setTargetAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = setTargetAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.setTargetAtTime);\n audioParam.setValueAtTime = ((setValueAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = setValueAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.setValueAtTime);\n audioParam.setValueCurveAtTime = ((setValueCurveAtTime) => {\n if (isOffline) {\n return () => {\n throw createNotSupportedError();\n };\n }\n return (...args) => {\n const value = setValueCurveAtTime.apply(audioParam, args);\n createScriptProcessorNode();\n return value;\n };\n })(audioParam.setValueCurveAtTime);\n return audioParam;\n };\n return {\n forwardX: createFakeAudioParam(0, 0, createSetOrientation(0)),\n forwardY: createFakeAudioParam(1, 0, createSetOrientation(1)),\n forwardZ: createFakeAudioParam(2, -1, createSetOrientation(2)),\n positionX: createFakeAudioParam(6, 0, createSetPosition(0)),\n positionY: createFakeAudioParam(7, 0, createSetPosition(1)),\n positionZ: createFakeAudioParam(8, 0, createSetPosition(2)),\n upX: createFakeAudioParam(3, 0, createSetOrientation(3)),\n upY: createFakeAudioParam(4, 1, createSetOrientation(4)),\n upZ: createFakeAudioParam(5, 0, createSetOrientation(5))\n };\n };\n const { forwardX, forwardY, forwardZ, positionX, positionY, positionZ, upX, upY, upZ } = nativeListener.forwardX === undefined ? createFakeAudioParams() : nativeListener;\n return {\n get forwardX() {\n return forwardX;\n },\n get forwardY() {\n return forwardY;\n },\n get forwardZ() {\n return forwardZ;\n },\n get positionX() {\n return positionX;\n },\n get positionY() {\n return positionY;\n },\n get positionZ() {\n return positionZ;\n },\n get upX() {\n return upX;\n },\n get upY() {\n return upY;\n },\n get upZ() {\n return upZ;\n }\n };\n };\n};\n//# sourceMappingURL=audio-listener-factory.js.map","export const isAudioNode = (audioNodeOrAudioParam) => {\n return 'context' in audioNodeOrAudioParam;\n};\n//# sourceMappingURL=audio-node.js.map","import { isAudioNode } from './audio-node';\nexport const isAudioNodeOutputConnection = (outputConnection) => {\n return isAudioNode(outputConnection[0]);\n};\n//# sourceMappingURL=audio-node-output-connection.js.map","export const insertElementInSet = (set, element, predicate, ignoreDuplicates) => {\n for (const lmnt of set) {\n if (predicate(lmnt)) {\n if (ignoreDuplicates) {\n return false;\n }\n throw Error('The set contains at least one similar element.');\n }\n }\n set.add(element);\n return true;\n};\n//# sourceMappingURL=insert-element-in-set.js.map","import { insertElementInSet } from './insert-element-in-set';\nexport const addActiveInputConnectionToAudioParam = (activeInputs, source, [output, eventListener], ignoreDuplicates) => {\n insertElementInSet(activeInputs, [source, output, eventListener], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output, ignoreDuplicates);\n};\n//# sourceMappingURL=add-active-input-connection-to-audio-param.js.map","import { insertElementInSet } from './insert-element-in-set';\nexport const addPassiveInputConnectionToAudioParam = (passiveInputs, [source, output, eventListener], ignoreDuplicates) => {\n const passiveInputConnections = passiveInputs.get(source);\n if (passiveInputConnections === undefined) {\n passiveInputs.set(source, new Set([[output, eventListener]]));\n }\n else {\n insertElementInSet(passiveInputConnections, [output, eventListener], (passiveInputConnection) => passiveInputConnection[0] === output, ignoreDuplicates);\n }\n};\n//# sourceMappingURL=add-passive-input-connection-to-audio-param.js.map","export const isNativeAudioNodeFaker = (nativeAudioNodeOrNativeAudioNodeFaker) => {\n return 'inputs' in nativeAudioNodeOrNativeAudioNodeFaker;\n};\n//# sourceMappingURL=native-audio-node-faker.js.map","import { isNativeAudioNodeFaker } from '../guards/native-audio-node-faker';\nexport const connectNativeAudioNodeToNativeAudioNode = (nativeSourceAudioNode, nativeDestinationAudioNode, output, input) => {\n if (isNativeAudioNodeFaker(nativeDestinationAudioNode)) {\n const fakeNativeDestinationAudioNode = nativeDestinationAudioNode.inputs[input];\n nativeSourceAudioNode.connect(fakeNativeDestinationAudioNode, output, 0);\n return [fakeNativeDestinationAudioNode, output, 0];\n }\n nativeSourceAudioNode.connect(nativeDestinationAudioNode, output, input);\n return [nativeDestinationAudioNode, output, input];\n};\n//# sourceMappingURL=connect-native-audio-node-to-native-audio-node.js.map","export const deleteActiveInputConnection = (activeInputConnections, source, output) => {\n for (const activeInputConnection of activeInputConnections) {\n if (activeInputConnection[0] === source && activeInputConnection[1] === output) {\n activeInputConnections.delete(activeInputConnection);\n return activeInputConnection;\n }\n }\n return null;\n};\n//# sourceMappingURL=delete-active-input-connection.js.map","import { pickElementFromSet } from './pick-element-from-set';\nexport const deleteActiveInputConnectionToAudioParam = (activeInputs, source, output) => {\n return pickElementFromSet(activeInputs, (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output);\n};\n//# sourceMappingURL=delete-active-input-connection-to-audio-param.js.map","import { getEventListenersOfAudioNode } from './get-event-listeners-of-audio-node';\nexport const deleteEventListenerOfAudioNode = (audioNode, eventListener) => {\n const eventListeners = getEventListenersOfAudioNode(audioNode);\n if (!eventListeners.delete(eventListener)) {\n throw new Error('Missing the expected event listener.');\n }\n};\n//# sourceMappingURL=delete-event-listeners-of-audio-node.js.map","import { getValueForKey } from './get-value-for-key';\nimport { pickElementFromSet } from './pick-element-from-set';\nexport const deletePassiveInputConnectionToAudioParam = (passiveInputs, source, output) => {\n const passiveInputConnections = getValueForKey(passiveInputs, source);\n const matchingConnection = pickElementFromSet(passiveInputConnections, (passiveInputConnection) => passiveInputConnection[0] === output);\n if (passiveInputConnections.size === 0) {\n passiveInputs.delete(source);\n }\n return matchingConnection;\n};\n//# sourceMappingURL=delete-passive-input-connection-to-audio-param.js.map","import { isNativeAudioNodeFaker } from '../guards/native-audio-node-faker';\nexport const disconnectNativeAudioNodeFromNativeAudioNode = (nativeSourceAudioNode, nativeDestinationAudioNode, output, input) => {\n if (isNativeAudioNodeFaker(nativeDestinationAudioNode)) {\n nativeSourceAudioNode.disconnect(nativeDestinationAudioNode.inputs[input], output, 0);\n }\n else {\n nativeSourceAudioNode.disconnect(nativeDestinationAudioNode, output, input);\n }\n};\n//# sourceMappingURL=disconnect-native-audio-node-from-native-audio-node.js.map","import { AUDIO_NODE_STORE } from '../globals';\nimport { getValueForKey } from './get-value-for-key';\nexport const getNativeAudioNode = (audioNode) => {\n return getValueForKey(AUDIO_NODE_STORE, audioNode);\n};\n//# sourceMappingURL=get-native-audio-node.js.map","import { AUDIO_PARAM_STORE } from '../globals';\nimport { getValueForKey } from './get-value-for-key';\nexport const getNativeAudioParam = (audioParam) => {\n return getValueForKey(AUDIO_PARAM_STORE, audioParam);\n};\n//# sourceMappingURL=get-native-audio-param.js.map","import { CYCLE_COUNTERS } from '../globals';\nexport const isPartOfACycle = (audioNode) => {\n return CYCLE_COUNTERS.has(audioNode);\n};\n//# sourceMappingURL=is-part-of-a-cycle.js.map","import { ACTIVE_AUDIO_NODE_STORE } from '../globals';\nexport const isPassiveAudioNode = (audioNode) => {\n return !ACTIVE_AUDIO_NODE_STORE.has(audioNode);\n};\n//# sourceMappingURL=is-passive-audio-node.js.map","export const testAudioNodeDisconnectMethodSupport = (nativeAudioContext, nativeAudioWorkletNodeConstructor) => {\n return new Promise((resolve) => {\n /*\n * This bug existed in Safari up until v14.0.2. Since AudioWorklets were not supported in Safari until v14.1 the presence of the\n * constructor for an AudioWorkletNode can be used here to skip the test.\n */\n if (nativeAudioWorkletNodeConstructor !== null) {\n resolve(true);\n }\n else {\n const analyzer = nativeAudioContext.createScriptProcessor(256, 1, 1); // tslint:disable-line deprecation\n const dummy = nativeAudioContext.createGain();\n // Bug #95: Safari does not play one sample buffers.\n const ones = nativeAudioContext.createBuffer(1, 2, 44100);\n const channelData = ones.getChannelData(0);\n channelData[0] = 1;\n channelData[1] = 1;\n const source = nativeAudioContext.createBufferSource();\n source.buffer = ones;\n source.loop = true;\n source.connect(analyzer).connect(nativeAudioContext.destination);\n source.connect(dummy);\n source.disconnect(dummy);\n // tslint:disable-next-line:deprecation\n analyzer.onaudioprocess = (event) => {\n const chnnlDt = event.inputBuffer.getChannelData(0); // tslint:disable-line deprecation\n if (Array.prototype.some.call(chnnlDt, (sample) => sample === 1)) {\n resolve(true);\n }\n else {\n resolve(false);\n }\n source.stop();\n analyzer.onaudioprocess = null; // tslint:disable-line:deprecation\n source.disconnect(analyzer);\n analyzer.disconnect(nativeAudioContext.destination);\n };\n source.start();\n }\n });\n};\n//# sourceMappingURL=test-audio-node-disconnect-method-support.js.map","export const visitEachAudioNodeOnce = (cycles, visitor) => {\n const counts = new Map();\n for (const cycle of cycles) {\n for (const audioNode of cycle) {\n const count = counts.get(audioNode);\n counts.set(audioNode, count === undefined ? 1 : count + 1);\n }\n }\n counts.forEach((count, audioNode) => visitor(audioNode, count));\n};\n//# sourceMappingURL=visit-each-audio-node-once.js.map","export const isNativeAudioNode = (nativeAudioNodeOrAudioParam) => {\n return 'context' in nativeAudioNodeOrAudioParam;\n};\n//# sourceMappingURL=native-audio-node.js.map","import { isNativeAudioNode } from '../guards/native-audio-node';\nexport const wrapAudioNodeDisconnectMethod = (nativeAudioNode) => {\n const connections = new Map();\n nativeAudioNode.connect = ((connect) => {\n // tslint:disable-next-line:invalid-void no-inferrable-types\n return (destination, output = 0, input = 0) => {\n const returnValue = isNativeAudioNode(destination) ? connect(destination, output, input) : connect(destination, output);\n // Save the new connection only if the calls to connect above didn't throw an error.\n const connectionsToDestination = connections.get(destination);\n if (connectionsToDestination === undefined) {\n connections.set(destination, [{ input, output }]);\n }\n else {\n if (connectionsToDestination.every((connection) => connection.input !== input || connection.output !== output)) {\n connectionsToDestination.push({ input, output });\n }\n }\n return returnValue;\n };\n })(nativeAudioNode.connect.bind(nativeAudioNode));\n nativeAudioNode.disconnect = ((disconnect) => {\n return (destinationOrOutput, output, input) => {\n disconnect.apply(nativeAudioNode);\n if (destinationOrOutput === undefined) {\n connections.clear();\n }\n else if (typeof destinationOrOutput === 'number') {\n for (const [destination, connectionsToDestination] of connections) {\n const filteredConnections = connectionsToDestination.filter((connection) => connection.output !== destinationOrOutput);\n if (filteredConnections.length === 0) {\n connections.delete(destination);\n }\n else {\n connections.set(destination, filteredConnections);\n }\n }\n }\n else if (connections.has(destinationOrOutput)) {\n if (output === undefined) {\n connections.delete(destinationOrOutput);\n }\n else {\n const connectionsToDestination = connections.get(destinationOrOutput);\n if (connectionsToDestination !== undefined) {\n const filteredConnections = connectionsToDestination.filter((connection) => connection.output !== output && (connection.input !== input || input === undefined));\n if (filteredConnections.length === 0) {\n connections.delete(destinationOrOutput);\n }\n else {\n connections.set(destinationOrOutput, filteredConnections);\n }\n }\n }\n }\n for (const [destination, connectionsToDestination] of connections) {\n connectionsToDestination.forEach((connection) => {\n if (isNativeAudioNode(destination)) {\n nativeAudioNode.connect(destination, connection.output, connection.input);\n }\n else {\n nativeAudioNode.connect(destination, connection.output);\n }\n });\n }\n };\n })(nativeAudioNode.disconnect);\n};\n//# sourceMappingURL=wrap-audio-node-disconnect-method.js.map","import { AUDIO_NODE_STORE, EVENT_LISTENERS } from '../globals';\nimport { isAudioNode } from '../guards/audio-node';\nimport { isAudioNodeOutputConnection } from '../guards/audio-node-output-connection';\nimport { addActiveInputConnectionToAudioParam } from '../helpers/add-active-input-connection-to-audio-param';\nimport { addPassiveInputConnectionToAudioParam } from '../helpers/add-passive-input-connection-to-audio-param';\nimport { connectNativeAudioNodeToNativeAudioNode } from '../helpers/connect-native-audio-node-to-native-audio-node';\nimport { deleteActiveInputConnection } from '../helpers/delete-active-input-connection';\nimport { deleteActiveInputConnectionToAudioParam } from '../helpers/delete-active-input-connection-to-audio-param';\nimport { deleteEventListenerOfAudioNode } from '../helpers/delete-event-listeners-of-audio-node';\nimport { deletePassiveInputConnectionToAudioNode } from '../helpers/delete-passive-input-connection-to-audio-node';\nimport { deletePassiveInputConnectionToAudioParam } from '../helpers/delete-passive-input-connection-to-audio-param';\nimport { disconnectNativeAudioNodeFromNativeAudioNode } from '../helpers/disconnect-native-audio-node-from-native-audio-node';\nimport { getAudioNodeConnections } from '../helpers/get-audio-node-connections';\nimport { getAudioParamConnections } from '../helpers/get-audio-param-connections';\nimport { getEventListenersOfAudioNode } from '../helpers/get-event-listeners-of-audio-node';\nimport { getNativeAudioNode } from '../helpers/get-native-audio-node';\nimport { getNativeAudioParam } from '../helpers/get-native-audio-param';\nimport { insertElementInSet } from '../helpers/insert-element-in-set';\nimport { isActiveAudioNode } from '../helpers/is-active-audio-node';\nimport { isPartOfACycle } from '../helpers/is-part-of-a-cycle';\nimport { isPassiveAudioNode } from '../helpers/is-passive-audio-node';\nimport { setInternalStateToActive } from '../helpers/set-internal-state-to-active';\nimport { setInternalStateToPassiveWhenNecessary } from '../helpers/set-internal-state-to-passive-when-necessary';\nimport { testAudioNodeDisconnectMethodSupport } from '../helpers/test-audio-node-disconnect-method-support';\nimport { visitEachAudioNodeOnce } from '../helpers/visit-each-audio-node-once';\nimport { wrapAudioNodeDisconnectMethod } from '../helpers/wrap-audio-node-disconnect-method';\nconst addConnectionToAudioParamOfAudioContext = (source, destination, output, isOffline) => {\n const { activeInputs, passiveInputs } = getAudioParamConnections(destination);\n const { outputs } = getAudioNodeConnections(source);\n const eventListeners = getEventListenersOfAudioNode(source);\n const eventListener = (isActive) => {\n const nativeAudioNode = getNativeAudioNode(source);\n const nativeAudioParam = getNativeAudioParam(destination);\n if (isActive) {\n const partialConnection = deletePassiveInputConnectionToAudioParam(passiveInputs, source, output);\n addActiveInputConnectionToAudioParam(activeInputs, source, partialConnection, false);\n if (!isOffline && !isPartOfACycle(source)) {\n nativeAudioNode.connect(nativeAudioParam, output);\n }\n }\n else {\n const partialConnection = deleteActiveInputConnectionToAudioParam(activeInputs, source, output);\n addPassiveInputConnectionToAudioParam(passiveInputs, partialConnection, false);\n if (!isOffline && !isPartOfACycle(source)) {\n nativeAudioNode.disconnect(nativeAudioParam, output);\n }\n }\n };\n if (insertElementInSet(outputs, [destination, output], (outputConnection) => outputConnection[0] === destination && outputConnection[1] === output, true)) {\n eventListeners.add(eventListener);\n if (isActiveAudioNode(source)) {\n addActiveInputConnectionToAudioParam(activeInputs, source, [output, eventListener], true);\n }\n else {\n addPassiveInputConnectionToAudioParam(passiveInputs, [source, output, eventListener], true);\n }\n return true;\n }\n return false;\n};\nconst deleteInputConnectionOfAudioNode = (source, destination, output, input) => {\n const { activeInputs, passiveInputs } = getAudioNodeConnections(destination);\n const activeInputConnection = deleteActiveInputConnection(activeInputs[input], source, output);\n if (activeInputConnection === null) {\n const passiveInputConnection = deletePassiveInputConnectionToAudioNode(passiveInputs, source, output, input);\n return [passiveInputConnection[2], false];\n }\n return [activeInputConnection[2], true];\n};\nconst deleteInputConnectionOfAudioParam = (source, destination, output) => {\n const { activeInputs, passiveInputs } = getAudioParamConnections(destination);\n const activeInputConnection = deleteActiveInputConnection(activeInputs, source, output);\n if (activeInputConnection === null) {\n const passiveInputConnection = deletePassiveInputConnectionToAudioParam(passiveInputs, source, output);\n return [passiveInputConnection[1], false];\n }\n return [activeInputConnection[2], true];\n};\nconst deleteInputsOfAudioNode = (source, isOffline, destination, output, input) => {\n const [listener, isActive] = deleteInputConnectionOfAudioNode(source, destination, output, input);\n if (listener !== null) {\n deleteEventListenerOfAudioNode(source, listener);\n if (isActive && !isOffline && !isPartOfACycle(source)) {\n disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(source), getNativeAudioNode(destination), output, input);\n }\n }\n if (isActiveAudioNode(destination)) {\n const { activeInputs } = getAudioNodeConnections(destination);\n setInternalStateToPassiveWhenNecessary(destination, activeInputs);\n }\n};\nconst deleteInputsOfAudioParam = (source, isOffline, destination, output) => {\n const [listener, isActive] = deleteInputConnectionOfAudioParam(source, destination, output);\n if (listener !== null) {\n deleteEventListenerOfAudioNode(source, listener);\n if (isActive && !isOffline && !isPartOfACycle(source)) {\n getNativeAudioNode(source).disconnect(getNativeAudioParam(destination), output);\n }\n }\n};\nconst deleteAnyConnection = (source, isOffline) => {\n const audioNodeConnectionsOfSource = getAudioNodeConnections(source);\n const destinations = [];\n for (const outputConnection of audioNodeConnectionsOfSource.outputs) {\n if (isAudioNodeOutputConnection(outputConnection)) {\n deleteInputsOfAudioNode(source, isOffline, ...outputConnection);\n }\n else {\n deleteInputsOfAudioParam(source, isOffline, ...outputConnection);\n }\n destinations.push(outputConnection[0]);\n }\n audioNodeConnectionsOfSource.outputs.clear();\n return destinations;\n};\nconst deleteConnectionAtOutput = (source, isOffline, output) => {\n const audioNodeConnectionsOfSource = getAudioNodeConnections(source);\n const destinations = [];\n for (const outputConnection of audioNodeConnectionsOfSource.outputs) {\n if (outputConnection[1] === output) {\n if (isAudioNodeOutputConnection(outputConnection)) {\n deleteInputsOfAudioNode(source, isOffline, ...outputConnection);\n }\n else {\n deleteInputsOfAudioParam(source, isOffline, ...outputConnection);\n }\n destinations.push(outputConnection[0]);\n audioNodeConnectionsOfSource.outputs.delete(outputConnection);\n }\n }\n return destinations;\n};\nconst deleteConnectionToDestination = (source, isOffline, destination, output, input) => {\n const audioNodeConnectionsOfSource = getAudioNodeConnections(source);\n return Array.from(audioNodeConnectionsOfSource.outputs)\n .filter((outputConnection) => outputConnection[0] === destination &&\n (output === undefined || outputConnection[1] === output) &&\n (input === undefined || outputConnection[2] === input))\n .map((outputConnection) => {\n if (isAudioNodeOutputConnection(outputConnection)) {\n deleteInputsOfAudioNode(source, isOffline, ...outputConnection);\n }\n else {\n deleteInputsOfAudioParam(source, isOffline, ...outputConnection);\n }\n audioNodeConnectionsOfSource.outputs.delete(outputConnection);\n return outputConnection[0];\n });\n};\nexport const createAudioNodeConstructor = (addAudioNodeConnections, addConnectionToAudioNode, cacheTestResult, createIncrementCycleCounter, createIndexSizeError, createInvalidAccessError, createNotSupportedError, decrementCycleCounter, detectCycles, eventTargetConstructor, getNativeContext, isNativeAudioContext, isNativeAudioNode, isNativeAudioParam, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor) => {\n return class AudioNode extends eventTargetConstructor {\n constructor(context, isActive, nativeAudioNode, audioNodeRenderer) {\n super(nativeAudioNode);\n this._context = context;\n this._nativeAudioNode = nativeAudioNode;\n const nativeContext = getNativeContext(context);\n // Bug #12: Safari does not support to disconnect a specific destination.\n if (isNativeAudioContext(nativeContext) &&\n true !==\n cacheTestResult(testAudioNodeDisconnectMethodSupport, () => {\n return testAudioNodeDisconnectMethodSupport(nativeContext, nativeAudioWorkletNodeConstructor);\n })) {\n wrapAudioNodeDisconnectMethod(nativeAudioNode);\n }\n AUDIO_NODE_STORE.set(this, nativeAudioNode);\n EVENT_LISTENERS.set(this, new Set());\n if (context.state !== 'closed' && isActive) {\n setInternalStateToActive(this);\n }\n addAudioNodeConnections(this, audioNodeRenderer, nativeAudioNode);\n }\n get channelCount() {\n return this._nativeAudioNode.channelCount;\n }\n set channelCount(value) {\n this._nativeAudioNode.channelCount = value;\n }\n get channelCountMode() {\n return this._nativeAudioNode.channelCountMode;\n }\n set channelCountMode(value) {\n this._nativeAudioNode.channelCountMode = value;\n }\n get channelInterpretation() {\n return this._nativeAudioNode.channelInterpretation;\n }\n set channelInterpretation(value) {\n this._nativeAudioNode.channelInterpretation = value;\n }\n get context() {\n return this._context;\n }\n get numberOfInputs() {\n return this._nativeAudioNode.numberOfInputs;\n }\n get numberOfOutputs() {\n return this._nativeAudioNode.numberOfOutputs;\n }\n // tslint:disable-next-line:invalid-void\n connect(destination, output = 0, input = 0) {\n // Bug #174: Safari does expose a wrong numberOfOutputs for MediaStreamAudioDestinationNodes.\n if (output < 0 || output >= this._nativeAudioNode.numberOfOutputs) {\n throw createIndexSizeError();\n }\n const nativeContext = getNativeContext(this._context);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n if (isNativeAudioNode(destination) || isNativeAudioParam(destination)) {\n throw createInvalidAccessError();\n }\n if (isAudioNode(destination)) {\n const nativeDestinationAudioNode = getNativeAudioNode(destination);\n try {\n const connection = connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode, nativeDestinationAudioNode, output, input);\n const isPassive = isPassiveAudioNode(this);\n if (isOffline || isPassive) {\n this._nativeAudioNode.disconnect(...connection);\n }\n if (this.context.state !== 'closed' && !isPassive && isPassiveAudioNode(destination)) {\n setInternalStateToActive(destination);\n }\n }\n catch (err) {\n // Bug #41: Safari does not throw the correct exception so far.\n if (err.code === 12) {\n throw createInvalidAccessError();\n }\n throw err;\n }\n const isNewConnectionToAudioNode = addConnectionToAudioNode(this, destination, output, input, isOffline);\n // Bug #164: Only Firefox detects cycles so far.\n if (isNewConnectionToAudioNode) {\n const cycles = detectCycles([this], destination);\n visitEachAudioNodeOnce(cycles, createIncrementCycleCounter(isOffline));\n }\n return destination;\n }\n const nativeAudioParam = getNativeAudioParam(destination);\n /*\n * Bug #73, #147 & #153: Safari does not support to connect an input signal to the playbackRate AudioParam of an\n * AudioBufferSourceNode. This can't be easily detected and that's why the outdated name property is used here to identify\n * Safari. In addition to that the maxValue property is used to only detect the affected versions below v14.0.2.\n */\n if (nativeAudioParam.name === 'playbackRate' && nativeAudioParam.maxValue === 1024) {\n throw createNotSupportedError();\n }\n try {\n this._nativeAudioNode.connect(nativeAudioParam, output);\n if (isOffline || isPassiveAudioNode(this)) {\n this._nativeAudioNode.disconnect(nativeAudioParam, output);\n }\n }\n catch (err) {\n // Bug #58: Safari doesn't throw an InvalidAccessError yet.\n if (err.code === 12) {\n throw createInvalidAccessError();\n }\n throw err;\n }\n const isNewConnectionToAudioParam = addConnectionToAudioParamOfAudioContext(this, destination, output, isOffline);\n // Bug #164: Only Firefox detects cycles so far.\n if (isNewConnectionToAudioParam) {\n const cycles = detectCycles([this], destination);\n visitEachAudioNodeOnce(cycles, createIncrementCycleCounter(isOffline));\n }\n }\n disconnect(destinationOrOutput, output, input) {\n let destinations;\n const nativeContext = getNativeContext(this._context);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n if (destinationOrOutput === undefined) {\n destinations = deleteAnyConnection(this, isOffline);\n }\n else if (typeof destinationOrOutput === 'number') {\n if (destinationOrOutput < 0 || destinationOrOutput >= this.numberOfOutputs) {\n throw createIndexSizeError();\n }\n destinations = deleteConnectionAtOutput(this, isOffline, destinationOrOutput);\n }\n else {\n if (output !== undefined && (output < 0 || output >= this.numberOfOutputs)) {\n throw createIndexSizeError();\n }\n if (isAudioNode(destinationOrOutput) && input !== undefined && (input < 0 || input >= destinationOrOutput.numberOfInputs)) {\n throw createIndexSizeError();\n }\n destinations = deleteConnectionToDestination(this, isOffline, destinationOrOutput, output, input);\n if (destinations.length === 0) {\n throw createInvalidAccessError();\n }\n }\n // Bug #164: Only Firefox detects cycles so far.\n for (const destination of destinations) {\n const cycles = detectCycles([this], destination);\n visitEachAudioNodeOnce(cycles, decrementCycleCounter);\n }\n }\n };\n};\n//# sourceMappingURL=audio-node-constructor.js.map","import { AutomationEventList } from 'automation-events';\nexport const createAudioParamFactory = (addAudioParamConnections, audioParamAudioNodeStore, audioParamStore, createAudioParamRenderer, createCancelAndHoldAutomationEvent, createCancelScheduledValuesAutomationEvent, createExponentialRampToValueAutomationEvent, createLinearRampToValueAutomationEvent, createSetTargetAutomationEvent, createSetValueAutomationEvent, createSetValueCurveAutomationEvent, nativeAudioContextConstructor, setValueAtTimeUntilPossible) => {\n return (audioNode, isAudioParamOfOfflineAudioContext, nativeAudioParam, maxValue = null, minValue = null) => {\n // Bug #196 Only Safari sets the defaultValue to the initial value.\n const defaultValue = nativeAudioParam.value;\n const automationEventList = new AutomationEventList(defaultValue);\n const audioParamRenderer = isAudioParamOfOfflineAudioContext ? createAudioParamRenderer(automationEventList) : null;\n const audioParam = {\n get defaultValue() {\n return defaultValue;\n },\n get maxValue() {\n return maxValue === null ? nativeAudioParam.maxValue : maxValue;\n },\n get minValue() {\n return minValue === null ? nativeAudioParam.minValue : minValue;\n },\n get value() {\n return nativeAudioParam.value;\n },\n set value(value) {\n nativeAudioParam.value = value;\n // Bug #98: Firefox & Safari do not yet treat the value setter like a call to setValueAtTime().\n audioParam.setValueAtTime(value, audioNode.context.currentTime);\n },\n cancelAndHoldAtTime(cancelTime) {\n // Bug #28: Firefox & Safari do not yet implement cancelAndHoldAtTime().\n if (typeof nativeAudioParam.cancelAndHoldAtTime === 'function') {\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createCancelAndHoldAutomationEvent(cancelTime));\n nativeAudioParam.cancelAndHoldAtTime(cancelTime);\n }\n else {\n const previousLastEvent = Array.from(automationEventList).pop();\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createCancelAndHoldAutomationEvent(cancelTime));\n const currentLastEvent = Array.from(automationEventList).pop();\n nativeAudioParam.cancelScheduledValues(cancelTime);\n if (previousLastEvent !== currentLastEvent && currentLastEvent !== undefined) {\n if (currentLastEvent.type === 'exponentialRampToValue') {\n nativeAudioParam.exponentialRampToValueAtTime(currentLastEvent.value, currentLastEvent.endTime);\n }\n else if (currentLastEvent.type === 'linearRampToValue') {\n nativeAudioParam.linearRampToValueAtTime(currentLastEvent.value, currentLastEvent.endTime);\n }\n else if (currentLastEvent.type === 'setValue') {\n nativeAudioParam.setValueAtTime(currentLastEvent.value, currentLastEvent.startTime);\n }\n else if (currentLastEvent.type === 'setValueCurve') {\n nativeAudioParam.setValueCurveAtTime(currentLastEvent.values, currentLastEvent.startTime, currentLastEvent.duration);\n }\n }\n }\n return audioParam;\n },\n cancelScheduledValues(cancelTime) {\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createCancelScheduledValuesAutomationEvent(cancelTime));\n nativeAudioParam.cancelScheduledValues(cancelTime);\n return audioParam;\n },\n exponentialRampToValueAtTime(value, endTime) {\n // Bug #45: Safari does not throw an error yet.\n if (value === 0) {\n throw new RangeError();\n }\n // Bug #187: Safari does not throw an error yet.\n if (!Number.isFinite(endTime) || endTime < 0) {\n throw new RangeError();\n }\n const currentTime = audioNode.context.currentTime;\n if (audioParamRenderer === null) {\n automationEventList.flush(currentTime);\n }\n // Bug #194: Firefox does not implicitly call setValueAtTime() if there is no previous event.\n if (Array.from(automationEventList).length === 0) {\n automationEventList.add(createSetValueAutomationEvent(defaultValue, currentTime));\n nativeAudioParam.setValueAtTime(defaultValue, currentTime);\n }\n automationEventList.add(createExponentialRampToValueAutomationEvent(value, endTime));\n nativeAudioParam.exponentialRampToValueAtTime(value, endTime);\n return audioParam;\n },\n linearRampToValueAtTime(value, endTime) {\n const currentTime = audioNode.context.currentTime;\n if (audioParamRenderer === null) {\n automationEventList.flush(currentTime);\n }\n // Bug #195: Firefox does not implicitly call setValueAtTime() if there is no previous event.\n if (Array.from(automationEventList).length === 0) {\n automationEventList.add(createSetValueAutomationEvent(defaultValue, currentTime));\n nativeAudioParam.setValueAtTime(defaultValue, currentTime);\n }\n automationEventList.add(createLinearRampToValueAutomationEvent(value, endTime));\n nativeAudioParam.linearRampToValueAtTime(value, endTime);\n return audioParam;\n },\n setTargetAtTime(target, startTime, timeConstant) {\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createSetTargetAutomationEvent(target, startTime, timeConstant));\n nativeAudioParam.setTargetAtTime(target, startTime, timeConstant);\n return audioParam;\n },\n setValueAtTime(value, startTime) {\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createSetValueAutomationEvent(value, startTime));\n nativeAudioParam.setValueAtTime(value, startTime);\n return audioParam;\n },\n setValueCurveAtTime(values, startTime, duration) {\n // Bug 183: Safari only accepts a Float32Array.\n const convertedValues = values instanceof Float32Array ? values : new Float32Array(values);\n /*\n * Bug #152: Safari does not correctly interpolate the values of the curve.\n * @todo Unfortunately there is no way to test for this behavior in a synchronous fashion which is why testing for the\n * existence of the webkitAudioContext is used as a workaround here.\n */\n if (nativeAudioContextConstructor !== null && nativeAudioContextConstructor.name === 'webkitAudioContext') {\n const endTime = startTime + duration;\n const sampleRate = audioNode.context.sampleRate;\n const firstSample = Math.ceil(startTime * sampleRate);\n const lastSample = Math.floor(endTime * sampleRate);\n const numberOfInterpolatedValues = lastSample - firstSample;\n const interpolatedValues = new Float32Array(numberOfInterpolatedValues);\n for (let i = 0; i < numberOfInterpolatedValues; i += 1) {\n const theoreticIndex = ((convertedValues.length - 1) / duration) * ((firstSample + i) / sampleRate - startTime);\n const lowerIndex = Math.floor(theoreticIndex);\n const upperIndex = Math.ceil(theoreticIndex);\n interpolatedValues[i] =\n lowerIndex === upperIndex\n ? convertedValues[lowerIndex]\n : (1 - (theoreticIndex - lowerIndex)) * convertedValues[lowerIndex] +\n (1 - (upperIndex - theoreticIndex)) * convertedValues[upperIndex];\n }\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createSetValueCurveAutomationEvent(interpolatedValues, startTime, duration));\n nativeAudioParam.setValueCurveAtTime(interpolatedValues, startTime, duration);\n const timeOfLastSample = lastSample / sampleRate;\n if (timeOfLastSample < endTime) {\n setValueAtTimeUntilPossible(audioParam, interpolatedValues[interpolatedValues.length - 1], timeOfLastSample);\n }\n setValueAtTimeUntilPossible(audioParam, convertedValues[convertedValues.length - 1], endTime);\n }\n else {\n if (audioParamRenderer === null) {\n automationEventList.flush(audioNode.context.currentTime);\n }\n automationEventList.add(createSetValueCurveAutomationEvent(convertedValues, startTime, duration));\n nativeAudioParam.setValueCurveAtTime(convertedValues, startTime, duration);\n }\n return audioParam;\n }\n };\n audioParamStore.set(audioParam, nativeAudioParam);\n audioParamAudioNodeStore.set(audioParam, audioNode);\n addAudioParamConnections(audioParam, audioParamRenderer);\n return audioParam;\n };\n};\n//# sourceMappingURL=audio-param-factory.js.map","export const createAudioParamRenderer = (automationEventList) => {\n return {\n replay(audioParam) {\n for (const automationEvent of automationEventList) {\n if (automationEvent.type === 'exponentialRampToValue') {\n const { endTime, value } = automationEvent;\n audioParam.exponentialRampToValueAtTime(value, endTime);\n }\n else if (automationEvent.type === 'linearRampToValue') {\n const { endTime, value } = automationEvent;\n audioParam.linearRampToValueAtTime(value, endTime);\n }\n else if (automationEvent.type === 'setTarget') {\n const { startTime, target, timeConstant } = automationEvent;\n audioParam.setTargetAtTime(target, startTime, timeConstant);\n }\n else if (automationEvent.type === 'setValue') {\n const { startTime, value } = automationEvent;\n audioParam.setValueAtTime(value, startTime);\n }\n else if (automationEvent.type === 'setValueCurve') {\n const { duration, startTime, values } = automationEvent;\n audioParam.setValueCurveAtTime(values, startTime, duration);\n }\n else {\n throw new Error(\"Can't apply an unknown automation.\");\n }\n }\n }\n };\n};\n//# sourceMappingURL=audio-param-renderer.js.map","export class ReadOnlyMap {\n constructor(parameters) {\n this._map = new Map(parameters);\n }\n get size() {\n return this._map.size;\n }\n entries() {\n return this._map.entries();\n }\n forEach(callback, thisArg = null) {\n return this._map.forEach((value, key) => callback.call(thisArg, value, key, this));\n }\n get(name) {\n return this._map.get(name);\n }\n has(name) {\n return this._map.has(name);\n }\n keys() {\n return this._map.keys();\n }\n values() {\n return this._map.values();\n }\n}\n//# sourceMappingURL=read-only-map.js.map","import { NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS } from '../globals';\nimport { ReadOnlyMap } from '../read-only-map';\nconst DEFAULT_OPTIONS = {\n channelCount: 2,\n // Bug #61: The channelCountMode should be 'max' according to the spec but is set to 'explicit' to achieve consistent behavior.\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: 1,\n numberOfOutputs: 1,\n parameterData: {},\n processorOptions: {}\n};\nexport const createAudioWorkletNodeConstructor = (addUnrenderedAudioWorkletNode, audioNodeConstructor, createAudioParam, createAudioWorkletNodeRenderer, createNativeAudioWorkletNode, getAudioNodeConnections, getBackupOfflineAudioContext, getNativeContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, sanitizeAudioWorkletNodeOptions, setActiveAudioWorkletNodeInputs, testAudioWorkletNodeOptionsClonability, wrapEventListener) => {\n return class AudioWorkletNode extends audioNodeConstructor {\n constructor(context, name, options) {\n var _a;\n const nativeContext = getNativeContext(context);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n const mergedOptions = sanitizeAudioWorkletNodeOptions({ ...DEFAULT_OPTIONS, ...options });\n // Bug #191: Safari doesn't throw an error if the options aren't clonable.\n testAudioWorkletNodeOptionsClonability(mergedOptions);\n const nodeNameToProcessorConstructorMap = NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(nativeContext);\n const processorConstructor = nodeNameToProcessorConstructorMap === null || nodeNameToProcessorConstructorMap === void 0 ? void 0 : nodeNameToProcessorConstructorMap.get(name);\n // Bug #186: Chrome and Edge do not allow to create an AudioWorkletNode on a closed AudioContext.\n const nativeContextOrBackupOfflineAudioContext = isOffline || nativeContext.state !== 'closed'\n ? nativeContext\n : (_a = getBackupOfflineAudioContext(nativeContext)) !== null && _a !== void 0 ? _a : nativeContext;\n const nativeAudioWorkletNode = createNativeAudioWorkletNode(nativeContextOrBackupOfflineAudioContext, isOffline ? null : context.baseLatency, nativeAudioWorkletNodeConstructor, name, processorConstructor, mergedOptions);\n const audioWorkletNodeRenderer = ((isOffline ? createAudioWorkletNodeRenderer(name, mergedOptions, processorConstructor) : null));\n /*\n * @todo Add a mechanism to switch an AudioWorkletNode to passive once the process() function of the AudioWorkletProcessor\n * returns false.\n */\n super(context, true, nativeAudioWorkletNode, audioWorkletNodeRenderer);\n const parameters = [];\n nativeAudioWorkletNode.parameters.forEach((nativeAudioParam, nm) => {\n const audioParam = createAudioParam(this, isOffline, nativeAudioParam);\n parameters.push([nm, audioParam]);\n });\n this._nativeAudioWorkletNode = nativeAudioWorkletNode;\n this._onprocessorerror = null;\n this._parameters = new ReadOnlyMap(parameters);\n /*\n * Bug #86 & #87: Invoking the renderer of an AudioWorkletNode might be necessary if it has no direct or indirect connection to\n * the destination.\n */\n if (isOffline) {\n addUnrenderedAudioWorkletNode(nativeContext, this);\n }\n const { activeInputs } = getAudioNodeConnections(this);\n setActiveAudioWorkletNodeInputs(nativeAudioWorkletNode, activeInputs);\n }\n get onprocessorerror() {\n return this._onprocessorerror;\n }\n set onprocessorerror(value) {\n const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null;\n this._nativeAudioWorkletNode.onprocessorerror = wrappedListener;\n const nativeOnProcessorError = this._nativeAudioWorkletNode.onprocessorerror;\n this._onprocessorerror =\n nativeOnProcessorError !== null && nativeOnProcessorError === wrappedListener\n ? value\n : nativeOnProcessorError;\n }\n get parameters() {\n if (this._parameters === null) {\n // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods.\n return this._nativeAudioWorkletNode.parameters;\n }\n return this._parameters;\n }\n get port() {\n return this._nativeAudioWorkletNode.port;\n }\n };\n};\n//# sourceMappingURL=audio-worklet-node-constructor.js.map","export function copyFromChannel(audioBuffer, \n// @todo There is currently no way to define something like { [ key: number | string ]: Float32Array }\nparent, key, channelNumber, bufferOffset) {\n if (typeof audioBuffer.copyFromChannel === 'function') {\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (parent[key].byteLength === 0) {\n parent[key] = new Float32Array(128);\n }\n audioBuffer.copyFromChannel(parent[key], channelNumber, bufferOffset);\n // Bug #5: Safari does not support copyFromChannel().\n }\n else {\n const channelData = audioBuffer.getChannelData(channelNumber);\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (parent[key].byteLength === 0) {\n parent[key] = channelData.slice(bufferOffset, bufferOffset + 128);\n }\n else {\n const slicedInput = new Float32Array(channelData.buffer, bufferOffset * Float32Array.BYTES_PER_ELEMENT, 128);\n parent[key].set(slicedInput);\n }\n }\n}\n//# sourceMappingURL=copy-from-channel.js.map","export const copyToChannel = (audioBuffer, parent, key, channelNumber, bufferOffset) => {\n if (typeof audioBuffer.copyToChannel === 'function') {\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (parent[key].byteLength !== 0) {\n audioBuffer.copyToChannel(parent[key], channelNumber, bufferOffset);\n }\n // Bug #5: Safari does not support copyToChannel().\n }\n else {\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (parent[key].byteLength !== 0) {\n audioBuffer.getChannelData(channelNumber).set(parent[key], bufferOffset);\n }\n }\n};\n//# sourceMappingURL=copy-to-channel.js.map","export const createNestedArrays = (x, y) => {\n const arrays = [];\n for (let i = 0; i < x; i += 1) {\n const array = [];\n const length = typeof y === 'number' ? y : y[i];\n for (let j = 0; j < length; j += 1) {\n array.push(new Float32Array(128));\n }\n arrays.push(array);\n }\n return arrays;\n};\n//# sourceMappingURL=create-nested-arrays.js.map","import { NODE_TO_PROCESSOR_MAPS } from '../globals';\nimport { getNativeAudioNode } from './get-native-audio-node';\nimport { getValueForKey } from './get-value-for-key';\nexport const getAudioWorkletProcessor = (nativeOfflineAudioContext, proxy) => {\n const nodeToProcessorMap = getValueForKey(NODE_TO_PROCESSOR_MAPS, nativeOfflineAudioContext);\n const nativeAudioWorkletNode = getNativeAudioNode(proxy);\n return getValueForKey(nodeToProcessorMap, nativeAudioWorkletNode);\n};\n//# sourceMappingURL=get-audio-worklet-processor.js.map","import { copyFromChannel } from '../helpers/copy-from-channel';\nimport { copyToChannel } from '../helpers/copy-to-channel';\nimport { createNestedArrays } from '../helpers/create-nested-arrays';\nimport { getAudioNodeConnections } from '../helpers/get-audio-node-connections';\nimport { getAudioWorkletProcessor } from '../helpers/get-audio-worklet-processor';\nimport { isOwnedByContext } from '../helpers/is-owned-by-context';\nconst processBuffer = async (proxy, renderedBuffer, nativeOfflineAudioContext, options, outputChannelCount, processorConstructor, exposeCurrentFrameAndCurrentTime) => {\n // Ceil the length to the next full render quantum.\n // Bug #17: Safari does not yet expose the length.\n const length = renderedBuffer === null ? Math.ceil(proxy.context.length / 128) * 128 : renderedBuffer.length;\n const numberOfInputChannels = options.channelCount * options.numberOfInputs;\n const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0);\n const processedBuffer = numberOfOutputChannels === 0\n ? null\n : nativeOfflineAudioContext.createBuffer(numberOfOutputChannels, length, nativeOfflineAudioContext.sampleRate);\n if (processorConstructor === undefined) {\n throw new Error('Missing the processor constructor.');\n }\n const audioNodeConnections = getAudioNodeConnections(proxy);\n const audioWorkletProcessor = await getAudioWorkletProcessor(nativeOfflineAudioContext, proxy);\n const inputs = createNestedArrays(options.numberOfInputs, options.channelCount);\n const outputs = createNestedArrays(options.numberOfOutputs, outputChannelCount);\n const parameters = Array.from(proxy.parameters.keys()).reduce((prmtrs, name) => ({ ...prmtrs, [name]: new Float32Array(128) }), {});\n for (let i = 0; i < length; i += 128) {\n if (options.numberOfInputs > 0 && renderedBuffer !== null) {\n for (let j = 0; j < options.numberOfInputs; j += 1) {\n for (let k = 0; k < options.channelCount; k += 1) {\n copyFromChannel(renderedBuffer, inputs[j], k, k, i);\n }\n }\n }\n if (processorConstructor.parameterDescriptors !== undefined && renderedBuffer !== null) {\n processorConstructor.parameterDescriptors.forEach(({ name }, index) => {\n copyFromChannel(renderedBuffer, parameters, name, numberOfInputChannels + index, i);\n });\n }\n for (let j = 0; j < options.numberOfInputs; j += 1) {\n for (let k = 0; k < outputChannelCount[j]; k += 1) {\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (outputs[j][k].byteLength === 0) {\n outputs[j][k] = new Float32Array(128);\n }\n }\n }\n try {\n const potentiallyEmptyInputs = inputs.map((input, index) => {\n if (audioNodeConnections.activeInputs[index].size === 0) {\n return [];\n }\n return input;\n });\n const activeSourceFlag = exposeCurrentFrameAndCurrentTime(i / nativeOfflineAudioContext.sampleRate, nativeOfflineAudioContext.sampleRate, () => audioWorkletProcessor.process(potentiallyEmptyInputs, outputs, parameters));\n if (processedBuffer !== null) {\n for (let j = 0, outputChannelSplitterNodeOutput = 0; j < options.numberOfOutputs; j += 1) {\n for (let k = 0; k < outputChannelCount[j]; k += 1) {\n copyToChannel(processedBuffer, outputs[j], k, outputChannelSplitterNodeOutput + k, i);\n }\n outputChannelSplitterNodeOutput += outputChannelCount[j];\n }\n }\n if (!activeSourceFlag) {\n break;\n }\n }\n catch (error) {\n proxy.dispatchEvent(new ErrorEvent('processorerror', {\n colno: error.colno,\n filename: error.filename,\n lineno: error.lineno,\n message: error.message\n }));\n break;\n }\n }\n return processedBuffer;\n};\nexport const createAudioWorkletNodeRendererFactory = (connectAudioParam, connectMultipleOutputs, createNativeAudioBufferSourceNode, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, deleteUnrenderedAudioWorkletNode, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getNativeAudioNode, nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext) => {\n return (name, options, processorConstructor) => {\n const renderedNativeAudioNodes = new WeakMap();\n let processedBufferPromise = null;\n const createAudioNode = async (proxy, nativeOfflineAudioContext) => {\n let nativeAudioWorkletNode = getNativeAudioNode(proxy);\n let nativeOutputNodes = null;\n const nativeAudioWorkletNodeIsOwnedByContext = isOwnedByContext(nativeAudioWorkletNode, nativeOfflineAudioContext);\n const outputChannelCount = Array.isArray(options.outputChannelCount)\n ? options.outputChannelCount\n : Array.from(options.outputChannelCount);\n // Bug #61: Only Chrome, Edge & Firefox have an implementation of the AudioWorkletNode yet.\n if (nativeAudioWorkletNodeConstructor === null) {\n const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0);\n const outputChannelSplitterNode = createNativeChannelSplitterNode(nativeOfflineAudioContext, {\n channelCount: Math.max(1, numberOfOutputChannels),\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n numberOfOutputs: Math.max(1, numberOfOutputChannels)\n });\n const outputChannelMergerNodes = [];\n for (let i = 0; i < proxy.numberOfOutputs; i += 1) {\n outputChannelMergerNodes.push(createNativeChannelMergerNode(nativeOfflineAudioContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: outputChannelCount[i]\n }));\n }\n const outputGainNode = createNativeGainNode(nativeOfflineAudioContext, {\n channelCount: options.channelCount,\n channelCountMode: options.channelCountMode,\n channelInterpretation: options.channelInterpretation,\n gain: 1\n });\n outputGainNode.connect = connectMultipleOutputs.bind(null, outputChannelMergerNodes);\n outputGainNode.disconnect = disconnectMultipleOutputs.bind(null, outputChannelMergerNodes);\n nativeOutputNodes = [outputChannelSplitterNode, outputChannelMergerNodes, outputGainNode];\n }\n else if (!nativeAudioWorkletNodeIsOwnedByContext) {\n nativeAudioWorkletNode = new nativeAudioWorkletNodeConstructor(nativeOfflineAudioContext, name);\n }\n renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeOutputNodes === null ? nativeAudioWorkletNode : nativeOutputNodes[2]);\n if (nativeOutputNodes !== null) {\n if (processedBufferPromise === null) {\n if (processorConstructor === undefined) {\n throw new Error('Missing the processor constructor.');\n }\n if (nativeOfflineAudioContextConstructor === null) {\n throw new Error('Missing the native OfflineAudioContext constructor.');\n }\n // Bug #47: The AudioDestinationNode in Safari gets not initialized correctly.\n const numberOfInputChannels = proxy.channelCount * proxy.numberOfInputs;\n const numberOfParameters = processorConstructor.parameterDescriptors === undefined ? 0 : processorConstructor.parameterDescriptors.length;\n const numberOfChannels = numberOfInputChannels + numberOfParameters;\n const renderBuffer = async () => {\n const partialOfflineAudioContext = new nativeOfflineAudioContextConstructor(numberOfChannels, \n // Ceil the length to the next full render quantum.\n // Bug #17: Safari does not yet expose the length.\n Math.ceil(proxy.context.length / 128) * 128, nativeOfflineAudioContext.sampleRate);\n const gainNodes = [];\n const inputChannelSplitterNodes = [];\n for (let i = 0; i < options.numberOfInputs; i += 1) {\n gainNodes.push(createNativeGainNode(partialOfflineAudioContext, {\n channelCount: options.channelCount,\n channelCountMode: options.channelCountMode,\n channelInterpretation: options.channelInterpretation,\n gain: 1\n }));\n inputChannelSplitterNodes.push(createNativeChannelSplitterNode(partialOfflineAudioContext, {\n channelCount: options.channelCount,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n numberOfOutputs: options.channelCount\n }));\n }\n const constantSourceNodes = await Promise.all(Array.from(proxy.parameters.values()).map(async (audioParam) => {\n const constantSourceNode = createNativeConstantSourceNode(partialOfflineAudioContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n offset: audioParam.value\n });\n await renderAutomation(partialOfflineAudioContext, audioParam, constantSourceNode.offset);\n return constantSourceNode;\n }));\n const inputChannelMergerNode = createNativeChannelMergerNode(partialOfflineAudioContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: Math.max(1, numberOfInputChannels + numberOfParameters)\n });\n for (let i = 0; i < options.numberOfInputs; i += 1) {\n gainNodes[i].connect(inputChannelSplitterNodes[i]);\n for (let j = 0; j < options.channelCount; j += 1) {\n inputChannelSplitterNodes[i].connect(inputChannelMergerNode, j, i * options.channelCount + j);\n }\n }\n for (const [index, constantSourceNode] of constantSourceNodes.entries()) {\n constantSourceNode.connect(inputChannelMergerNode, 0, numberOfInputChannels + index);\n constantSourceNode.start(0);\n }\n inputChannelMergerNode.connect(partialOfflineAudioContext.destination);\n await Promise.all(gainNodes.map((gainNode) => renderInputsOfAudioNode(proxy, partialOfflineAudioContext, gainNode)));\n return renderNativeOfflineAudioContext(partialOfflineAudioContext);\n };\n processedBufferPromise = processBuffer(proxy, numberOfChannels === 0 ? null : await renderBuffer(), nativeOfflineAudioContext, options, outputChannelCount, processorConstructor, exposeCurrentFrameAndCurrentTime);\n }\n const processedBuffer = await processedBufferPromise;\n const audioBufferSourceNode = createNativeAudioBufferSourceNode(nativeOfflineAudioContext, {\n buffer: null,\n channelCount: 2,\n channelCountMode: 'max',\n channelInterpretation: 'speakers',\n loop: false,\n loopEnd: 0,\n loopStart: 0,\n playbackRate: 1\n });\n const [outputChannelSplitterNode, outputChannelMergerNodes, outputGainNode] = nativeOutputNodes;\n if (processedBuffer !== null) {\n audioBufferSourceNode.buffer = processedBuffer;\n audioBufferSourceNode.start(0);\n }\n audioBufferSourceNode.connect(outputChannelSplitterNode);\n for (let i = 0, outputChannelSplitterNodeOutput = 0; i < proxy.numberOfOutputs; i += 1) {\n const outputChannelMergerNode = outputChannelMergerNodes[i];\n for (let j = 0; j < outputChannelCount[i]; j += 1) {\n outputChannelSplitterNode.connect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j);\n }\n outputChannelSplitterNodeOutput += outputChannelCount[i];\n }\n return outputGainNode;\n }\n if (!nativeAudioWorkletNodeIsOwnedByContext) {\n for (const [nm, audioParam] of proxy.parameters.entries()) {\n await renderAutomation(nativeOfflineAudioContext, audioParam, \n // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods.\n nativeAudioWorkletNode.parameters.get(nm));\n }\n }\n else {\n for (const [nm, audioParam] of proxy.parameters.entries()) {\n await connectAudioParam(nativeOfflineAudioContext, audioParam, \n // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods.\n nativeAudioWorkletNode.parameters.get(nm));\n }\n }\n await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioWorkletNode);\n return nativeAudioWorkletNode;\n };\n return {\n render(proxy, nativeOfflineAudioContext) {\n deleteUnrenderedAudioWorkletNode(nativeOfflineAudioContext, proxy);\n const renderedNativeAudioWorkletNodeOrGainNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext);\n if (renderedNativeAudioWorkletNodeOrGainNode !== undefined) {\n return Promise.resolve(renderedNativeAudioWorkletNodeOrGainNode);\n }\n return createAudioNode(proxy, nativeOfflineAudioContext);\n }\n };\n };\n};\n//# sourceMappingURL=audio-worklet-node-renderer-factory.js.map","export const createCacheTestResult = (ongoingTests, testResults) => {\n return (tester, test) => {\n const cachedTestResult = testResults.get(tester);\n if (cachedTestResult !== undefined) {\n return cachedTestResult;\n }\n const ongoingTest = ongoingTests.get(tester);\n if (ongoingTest !== undefined) {\n return ongoingTest;\n }\n try {\n const synchronousTestResult = test();\n if (synchronousTestResult instanceof Promise) {\n ongoingTests.set(tester, synchronousTestResult);\n return synchronousTestResult\n .catch(() => false)\n .then((finalTestResult) => {\n ongoingTests.delete(tester);\n testResults.set(tester, finalTestResult);\n return finalTestResult;\n });\n }\n testResults.set(tester, synchronousTestResult);\n return synchronousTestResult;\n }\n catch {\n testResults.set(tester, false);\n return false;\n }\n };\n};\n//# sourceMappingURL=cache-test-result.js.map","export const createConnectAudioParam = (renderInputsOfAudioParam) => {\n return (nativeOfflineAudioContext, audioParam, nativeAudioParam) => {\n return renderInputsOfAudioParam(audioParam, nativeOfflineAudioContext, nativeAudioParam);\n };\n};\n//# sourceMappingURL=connect-audio-param.js.map","import { isNativeAudioNode } from '../guards/native-audio-node';\nexport const createConnectMultipleOutputs = (createIndexSizeError) => {\n return (outputAudioNodes, destination, output = 0, input = 0) => {\n const outputAudioNode = outputAudioNodes[output];\n if (outputAudioNode === undefined) {\n throw createIndexSizeError();\n }\n if (isNativeAudioNode(destination)) {\n return outputAudioNode.connect(destination, 0, input);\n }\n return outputAudioNode.connect(destination, 0);\n };\n};\n//# sourceMappingURL=connect-multiple-outputs.js.map","export const createConvertNumberToUnsignedLong = (unit32Array) => {\n return (value) => {\n unit32Array[0] = value;\n return unit32Array[0];\n };\n};\n//# sourceMappingURL=convert-number-to-unsigned-long.js.map","import { isAudioNodeOutputConnection } from '../guards/audio-node-output-connection';\nexport const createDecrementCycleCounter = (connectNativeAudioNodeToNativeAudioNode, cycleCounters, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, getNativeContext, isActiveAudioNode, isNativeOfflineAudioContext) => {\n return (audioNode, count) => {\n const cycleCounter = cycleCounters.get(audioNode);\n if (cycleCounter === undefined) {\n throw new Error('Missing the expected cycle count.');\n }\n const nativeContext = getNativeContext(audioNode.context);\n const isOffline = isNativeOfflineAudioContext(nativeContext);\n if (cycleCounter === count) {\n cycleCounters.delete(audioNode);\n if (!isOffline && isActiveAudioNode(audioNode)) {\n const nativeSourceAudioNode = getNativeAudioNode(audioNode);\n const { outputs } = getAudioNodeConnections(audioNode);\n for (const output of outputs) {\n if (isAudioNodeOutputConnection(output)) {\n const nativeDestinationAudioNode = getNativeAudioNode(output[0]);\n connectNativeAudioNodeToNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output[1], output[2]);\n }\n else {\n const nativeDestinationAudioParam = getNativeAudioParam(output[0]);\n nativeSourceAudioNode.connect(nativeDestinationAudioParam, output[1]);\n }\n }\n }\n }\n else {\n cycleCounters.set(audioNode, cycleCounter - count);\n }\n };\n};\n//# sourceMappingURL=decrement-cycle-counter.js.map","export const createDeleteActiveInputConnectionToAudioNode = (pickElementFromSet) => {\n return (activeInputs, source, output, input) => {\n return pickElementFromSet(activeInputs[input], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output);\n };\n};\n//# sourceMappingURL=delete-active-input-connection-to-audio-node.js.map","export const createDeleteUnrenderedAudioWorkletNode = (getUnrenderedAudioWorkletNodes) => {\n return (nativeContext, audioWorkletNode) => {\n getUnrenderedAudioWorkletNodes(nativeContext).delete(audioWorkletNode);\n };\n};\n//# sourceMappingURL=delete-unrendered-audio-worklet-node.js.map","export const isDelayNode = (audioNode) => {\n return 'delayTime' in audioNode;\n};\n//# sourceMappingURL=delay-node.js.map","import { isAudioNode } from '../guards/audio-node';\nimport { isDelayNode } from '../guards/delay-node';\nexport const createDetectCycles = (audioParamAudioNodeStore, getAudioNodeConnections, getValueForKey) => {\n return function detectCycles(chain, nextLink) {\n const audioNode = isAudioNode(nextLink) ? nextLink : getValueForKey(audioParamAudioNodeStore, nextLink);\n if (isDelayNode(audioNode)) {\n return [];\n }\n if (chain[0] === audioNode) {\n return [chain];\n }\n if (chain.includes(audioNode)) {\n return [];\n }\n const { outputs } = getAudioNodeConnections(audioNode);\n return Array.from(outputs)\n .map((outputConnection) => detectCycles([...chain, audioNode], outputConnection[0]))\n .reduce((mergedCycles, nestedCycles) => mergedCycles.concat(nestedCycles), []);\n };\n};\n//# sourceMappingURL=detect-cycles.js.map","import { isNativeAudioNode } from '../guards/native-audio-node';\nconst getOutputAudioNodeAtIndex = (createIndexSizeError, outputAudioNodes, output) => {\n const outputAudioNode = outputAudioNodes[output];\n if (outputAudioNode === undefined) {\n throw createIndexSizeError();\n }\n return outputAudioNode;\n};\nexport const createDisconnectMultipleOutputs = (createIndexSizeError) => {\n return (outputAudioNodes, destinationOrOutput = undefined, output = undefined, input = 0) => {\n if (destinationOrOutput === undefined) {\n return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect());\n }\n if (typeof destinationOrOutput === 'number') {\n return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, destinationOrOutput).disconnect();\n }\n if (isNativeAudioNode(destinationOrOutput)) {\n if (output === undefined) {\n return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect(destinationOrOutput));\n }\n if (input === undefined) {\n return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0);\n }\n return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0, input);\n }\n if (output === undefined) {\n return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect(destinationOrOutput));\n }\n return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0);\n };\n};\n//# sourceMappingURL=disconnect-multiple-outputs.js.map","export const createEvaluateSource = (window) => {\n return (source) => new Promise((resolve, reject) => {\n if (window === null) {\n // Bug #182 Chrome and Edge do throw an instance of a SyntaxError instead of a DOMException.\n reject(new SyntaxError());\n return;\n }\n const head = window.document.head;\n if (head === null) {\n // Bug #182 Chrome and Edge do throw an instance of a SyntaxError instead of a DOMException.\n reject(new SyntaxError());\n }\n else {\n const script = window.document.createElement('script');\n // @todo Safari doesn't like URLs with a type of 'application/javascript; charset=utf-8'.\n const blob = new Blob([source], { type: 'application/javascript' });\n const url = URL.createObjectURL(blob);\n const originalOnErrorHandler = window.onerror;\n const removeErrorEventListenerAndRevokeUrl = () => {\n window.onerror = originalOnErrorHandler;\n URL.revokeObjectURL(url);\n };\n window.onerror = (message, src, lineno, colno, error) => {\n // @todo Edge thinks the source is the one of the html document.\n if (src === url || (src === window.location.href && lineno === 1 && colno === 1)) {\n removeErrorEventListenerAndRevokeUrl();\n reject(error);\n return false;\n }\n if (originalOnErrorHandler !== null) {\n return originalOnErrorHandler(message, src, lineno, colno, error);\n }\n };\n script.onerror = () => {\n removeErrorEventListenerAndRevokeUrl();\n // Bug #182 Chrome and Edge do throw an instance of a SyntaxError instead of a DOMException.\n reject(new SyntaxError());\n };\n script.onload = () => {\n removeErrorEventListenerAndRevokeUrl();\n resolve();\n };\n script.src = url;\n script.type = 'module';\n head.appendChild(script);\n }\n });\n};\n//# sourceMappingURL=evaluate-source.js.map","export const createEventTargetConstructor = (wrapEventListener) => {\n return class EventTarget {\n constructor(_nativeEventTarget) {\n this._nativeEventTarget = _nativeEventTarget;\n this._listeners = new WeakMap();\n }\n addEventListener(type, listener, options) {\n if (listener !== null) {\n let wrappedEventListener = this._listeners.get(listener);\n if (wrappedEventListener === undefined) {\n wrappedEventListener = wrapEventListener(this, listener);\n if (typeof listener === 'function') {\n this._listeners.set(listener, wrappedEventListener);\n }\n }\n this._nativeEventTarget.addEventListener(type, wrappedEventListener, options);\n }\n }\n dispatchEvent(event) {\n return this._nativeEventTarget.dispatchEvent(event);\n }\n removeEventListener(type, listener, options) {\n const wrappedEventListener = listener === null ? undefined : this._listeners.get(listener);\n this._nativeEventTarget.removeEventListener(type, wrappedEventListener === undefined ? null : wrappedEventListener, options);\n }\n };\n};\n//# sourceMappingURL=event-target-constructor.js.map","export const createExposeCurrentFrameAndCurrentTime = (window) => {\n return (currentTime, sampleRate, fn) => {\n Object.defineProperties(window, {\n currentFrame: {\n configurable: true,\n get() {\n return Math.round(currentTime * sampleRate);\n }\n },\n currentTime: {\n configurable: true,\n get() {\n return currentTime;\n }\n }\n });\n try {\n return fn();\n }\n finally {\n if (window !== null) {\n delete window.currentFrame;\n delete window.currentTime;\n }\n }\n };\n};\n//# sourceMappingURL=expose-current-frame-and-current-time.js.map","export const createFetchSource = (createAbortError) => {\n return async (url) => {\n try {\n const response = await fetch(url);\n if (response.ok) {\n return [await response.text(), response.url];\n }\n }\n catch {\n // Ignore errors.\n } // tslint:disable-line:no-empty\n throw createAbortError();\n };\n};\n//# sourceMappingURL=fetch-source.js.map","export const createGetActiveAudioWorkletNodeInputs = (activeAudioWorkletNodeInputsStore, getValueForKey) => {\n return (nativeAudioWorkletNode) => getValueForKey(activeAudioWorkletNodeInputsStore, nativeAudioWorkletNode);\n};\n//# sourceMappingURL=get-active-audio-worklet-node-inputs.js.map","export const createGetAudioNodeRenderer = (getAudioNodeConnections) => {\n return (audioNode) => {\n const audioNodeConnections = getAudioNodeConnections(audioNode);\n if (audioNodeConnections.renderer === null) {\n throw new Error('Missing the renderer of the given AudioNode in the audio graph.');\n }\n return audioNodeConnections.renderer;\n };\n};\n//# sourceMappingURL=get-audio-node-renderer.js.map","export const createGetAudioNodeTailTime = (audioNodeTailTimeStore) => {\n return (audioNode) => { var _a; return (_a = audioNodeTailTimeStore.get(audioNode)) !== null && _a !== void 0 ? _a : 0; };\n};\n//# sourceMappingURL=get-audio-node-tail-time.js.map","export const createGetAudioParamRenderer = (getAudioParamConnections) => {\n return (audioParam) => {\n const audioParamConnections = getAudioParamConnections(audioParam);\n if (audioParamConnections.renderer === null) {\n throw new Error('Missing the renderer of the given AudioParam in the audio graph.');\n }\n return audioParamConnections.renderer;\n };\n};\n//# sourceMappingURL=get-audio-param-renderer.js.map","export const createGetBackupOfflineAudioContext = (backupOfflineAudioContextStore) => {\n return (nativeContext) => {\n return backupOfflineAudioContextStore.get(nativeContext);\n };\n};\n//# sourceMappingURL=get-backup-offline-audio-context.js.map","export const createInvalidStateError = () => new DOMException('', 'InvalidStateError');\n//# sourceMappingURL=invalid-state-error.js.map","import { createInvalidStateError } from './invalid-state-error';\nexport const createGetNativeContext = (contextStore) => {\n return (context) => {\n const nativeContext = contextStore.get(context);\n if (nativeContext === undefined) {\n throw createInvalidStateError();\n }\n return (nativeContext);\n };\n};\n//# sourceMappingURL=get-native-context.js.map","export const createGetOrCreateBackupOfflineAudioContext = (backupOfflineAudioContextStore, nativeOfflineAudioContextConstructor) => {\n return (nativeContext) => {\n let backupOfflineAudioContext = backupOfflineAudioContextStore.get(nativeContext);\n if (backupOfflineAudioContext !== undefined) {\n return backupOfflineAudioContext;\n }\n if (nativeOfflineAudioContextConstructor === null) {\n throw new Error('Missing the native OfflineAudioContext constructor.');\n }\n // Bug #141: Safari does not support creating an OfflineAudioContext with less than 44100 Hz.\n backupOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100);\n backupOfflineAudioContextStore.set(nativeContext, backupOfflineAudioContext);\n return backupOfflineAudioContext;\n };\n};\n//# sourceMappingURL=get-or-create-backup-offline-audio-context.js.map","export const createGetUnrenderedAudioWorkletNodes = (unrenderedAudioWorkletNodeStore) => {\n return (nativeContext) => {\n const unrenderedAudioWorkletNodes = unrenderedAudioWorkletNodeStore.get(nativeContext);\n if (unrenderedAudioWorkletNodes === undefined) {\n throw new Error('The context has no set of AudioWorkletNodes.');\n }\n return unrenderedAudioWorkletNodes;\n };\n};\n//# sourceMappingURL=get-unrendered-audio-worklet-nodes.js.map","export const createInvalidAccessError = () => new DOMException('', 'InvalidAccessError');\n//# sourceMappingURL=invalid-access-error.js.map","import { isAudioNodeOutputConnection } from '../guards/audio-node-output-connection';\nexport const createIncrementCycleCounterFactory = (cycleCounters, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, isActiveAudioNode) => {\n return (isOffline) => {\n return (audioNode, count) => {\n const cycleCounter = cycleCounters.get(audioNode);\n if (cycleCounter === undefined) {\n if (!isOffline && isActiveAudioNode(audioNode)) {\n const nativeSourceAudioNode = getNativeAudioNode(audioNode);\n const { outputs } = getAudioNodeConnections(audioNode);\n for (const output of outputs) {\n if (isAudioNodeOutputConnection(output)) {\n const nativeDestinationAudioNode = getNativeAudioNode(output[0]);\n disconnectNativeAudioNodeFromNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output[1], output[2]);\n }\n else {\n const nativeDestinationAudioParam = getNativeAudioParam(output[0]);\n nativeSourceAudioNode.disconnect(nativeDestinationAudioParam, output[1]);\n }\n }\n }\n cycleCounters.set(audioNode, count);\n }\n else {\n cycleCounters.set(audioNode, cycleCounter + count);\n }\n };\n };\n};\n//# sourceMappingURL=increment-cycle-counter-factory.js.map","export const createIsNativeAudioContext = (nativeAudioContextConstructor) => {\n return (anything) => {\n return nativeAudioContextConstructor !== null && anything instanceof nativeAudioContextConstructor;\n };\n};\n//# sourceMappingURL=is-native-audio-context.js.map","export const createIsNativeAudioNode = (window) => {\n return (anything) => {\n return window !== null && typeof window.AudioNode === 'function' && anything instanceof window.AudioNode;\n };\n};\n//# sourceMappingURL=is-native-audio-node.js.map","export const createIsNativeAudioParam = (window) => {\n return (anything) => {\n return window !== null && typeof window.AudioParam === 'function' && anything instanceof window.AudioParam;\n };\n};\n//# sourceMappingURL=is-native-audio-param.js.map","export const createIsNativeOfflineAudioContext = (nativeOfflineAudioContextConstructor) => {\n return (anything) => {\n return nativeOfflineAudioContextConstructor !== null && anything instanceof nativeOfflineAudioContextConstructor;\n };\n};\n//# sourceMappingURL=is-native-offline-audio-context.js.map","export const createIsSecureContext = (window) => window !== null && window.isSecureContext;\n//# sourceMappingURL=is-secure-context.js.map","export const createMediaStreamAudioSourceNodeConstructor = (audioNodeConstructor, createNativeMediaStreamAudioSourceNode, getNativeContext, isNativeOfflineAudioContext) => {\n return class MediaStreamAudioSourceNode extends audioNodeConstructor {\n constructor(context, options) {\n const nativeContext = getNativeContext(context);\n const nativeMediaStreamAudioSourceNode = createNativeMediaStreamAudioSourceNode(nativeContext, options);\n // Bug #172: Safari allows to create a MediaStreamAudioSourceNode with an OfflineAudioContext.\n if (isNativeOfflineAudioContext(nativeContext)) {\n throw new TypeError();\n }\n super(context, true, nativeMediaStreamAudioSourceNode, null);\n this._nativeMediaStreamAudioSourceNode = nativeMediaStreamAudioSourceNode;\n }\n get mediaStream() {\n return this._nativeMediaStreamAudioSourceNode.mediaStream;\n }\n };\n};\n//# sourceMappingURL=media-stream-audio-source-node-constructor.js.map","import { deactivateAudioGraph } from '../helpers/deactivate-audio-graph';\nimport { isValidLatencyHint } from '../helpers/is-valid-latency-hint';\nexport const createMinimalAudioContextConstructor = (createInvalidStateError, createNotSupportedError, createUnknownError, minimalBaseAudioContextConstructor, nativeAudioContextConstructor) => {\n return class MinimalAudioContext extends minimalBaseAudioContextConstructor {\n constructor(options = {}) {\n if (nativeAudioContextConstructor === null) {\n throw new Error('Missing the native AudioContext constructor.');\n }\n let nativeAudioContext;\n try {\n nativeAudioContext = new nativeAudioContextConstructor(options);\n }\n catch (err) {\n // Bug #192 Safari does throw a SyntaxError if the sampleRate is not supported.\n if (err.code === 12 && err.message === 'sampleRate is not in range') {\n throw createNotSupportedError();\n }\n throw err;\n }\n // Bug #131 Safari returns null when there are four other AudioContexts running already.\n if (nativeAudioContext === null) {\n throw createUnknownError();\n }\n // Bug #51 Only Chrome and Edge throw an error if the given latencyHint is invalid.\n if (!isValidLatencyHint(options.latencyHint)) {\n throw new TypeError(`The provided value '${options.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);\n }\n // Bug #150 Safari does not support setting the sampleRate.\n if (options.sampleRate !== undefined && nativeAudioContext.sampleRate !== options.sampleRate) {\n throw createNotSupportedError();\n }\n super(nativeAudioContext, 2);\n const { latencyHint } = options;\n const { sampleRate } = nativeAudioContext;\n // @todo The values for 'balanced', 'interactive' and 'playback' are just copied from Chrome's implementation.\n this._baseLatency =\n typeof nativeAudioContext.baseLatency === 'number'\n ? nativeAudioContext.baseLatency\n : latencyHint === 'balanced'\n ? 512 / sampleRate\n : latencyHint === 'interactive' || latencyHint === undefined\n ? 256 / sampleRate\n : latencyHint === 'playback'\n ? 1024 / sampleRate\n : /*\n * @todo The min (256) and max (16384) values are taken from the allowed bufferSize values of a\n * ScriptProcessorNode.\n */\n (Math.max(2, Math.min(128, Math.round((latencyHint * sampleRate) / 128))) * 128) / sampleRate;\n this._nativeAudioContext = nativeAudioContext;\n // Bug #188: Safari will set the context's state to 'interrupted' in case the user switches tabs.\n if (nativeAudioContextConstructor.name === 'webkitAudioContext') {\n this._nativeGainNode = nativeAudioContext.createGain();\n this._nativeOscillatorNode = nativeAudioContext.createOscillator();\n this._nativeGainNode.gain.value = 1e-37;\n this._nativeOscillatorNode.connect(this._nativeGainNode).connect(nativeAudioContext.destination);\n this._nativeOscillatorNode.start();\n }\n else {\n this._nativeGainNode = null;\n this._nativeOscillatorNode = null;\n }\n this._state = null;\n /*\n * Bug #34: Chrome and Edge pretend to be running right away, but fire an onstatechange event when the state actually changes\n * to 'running'.\n */\n if (nativeAudioContext.state === 'running') {\n this._state = 'suspended';\n const revokeState = () => {\n if (this._state === 'suspended') {\n this._state = null;\n }\n nativeAudioContext.removeEventListener('statechange', revokeState);\n };\n nativeAudioContext.addEventListener('statechange', revokeState);\n }\n }\n get baseLatency() {\n return this._baseLatency;\n }\n get state() {\n return this._state !== null ? this._state : this._nativeAudioContext.state;\n }\n close() {\n // Bug #35: Firefox does not throw an error if the AudioContext was closed before.\n if (this.state === 'closed') {\n return this._nativeAudioContext.close().then(() => {\n throw createInvalidStateError();\n });\n }\n // Bug #34: If the state was set to suspended before it should be revoked now.\n if (this._state === 'suspended') {\n this._state = null;\n }\n return this._nativeAudioContext.close().then(() => {\n if (this._nativeGainNode !== null && this._nativeOscillatorNode !== null) {\n this._nativeOscillatorNode.stop();\n this._nativeGainNode.disconnect();\n this._nativeOscillatorNode.disconnect();\n }\n deactivateAudioGraph(this);\n });\n }\n resume() {\n if (this._state === 'suspended') {\n return new Promise((resolve, reject) => {\n const resolvePromise = () => {\n this._nativeAudioContext.removeEventListener('statechange', resolvePromise);\n if (this._nativeAudioContext.state === 'running') {\n resolve();\n }\n else {\n this.resume().then(resolve, reject);\n }\n };\n this._nativeAudioContext.addEventListener('statechange', resolvePromise);\n });\n }\n return this._nativeAudioContext.resume().catch((err) => {\n // Bug #55: Chrome and Edge do throw an InvalidAccessError instead of an InvalidStateError.\n // Bug #56: Safari invokes the catch handler but without an error.\n if (err === undefined || err.code === 15) {\n throw createInvalidStateError();\n }\n throw err;\n });\n }\n suspend() {\n return this._nativeAudioContext.suspend().catch((err) => {\n // Bug #56: Safari invokes the catch handler but without an error.\n if (err === undefined) {\n throw createInvalidStateError();\n }\n throw err;\n });\n }\n };\n};\n//# sourceMappingURL=minimal-audio-context-constructor.js.map","import { CONTEXT_STORE } from '../globals';\nexport const createMinimalBaseAudioContextConstructor = (audioDestinationNodeConstructor, createAudioListener, eventTargetConstructor, isNativeOfflineAudioContext, unrenderedAudioWorkletNodeStore, wrapEventListener) => {\n return class MinimalBaseAudioContext extends eventTargetConstructor {\n constructor(_nativeContext, numberOfChannels) {\n super(_nativeContext);\n this._nativeContext = _nativeContext;\n CONTEXT_STORE.set(this, _nativeContext);\n if (isNativeOfflineAudioContext(_nativeContext)) {\n unrenderedAudioWorkletNodeStore.set(_nativeContext, new Set());\n }\n this._destination = new audioDestinationNodeConstructor(this, numberOfChannels);\n this._listener = createAudioListener(this, _nativeContext);\n this._onstatechange = null;\n }\n get currentTime() {\n return this._nativeContext.currentTime;\n }\n get destination() {\n return this._destination;\n }\n get listener() {\n return this._listener;\n }\n get onstatechange() {\n return this._onstatechange;\n }\n set onstatechange(value) {\n const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null;\n this._nativeContext.onstatechange = wrappedListener;\n const nativeOnStateChange = this._nativeContext.onstatechange;\n this._onstatechange = nativeOnStateChange !== null && nativeOnStateChange === wrappedListener ? value : nativeOnStateChange;\n }\n get sampleRate() {\n return this._nativeContext.sampleRate;\n }\n get state() {\n return this._nativeContext.state;\n }\n };\n};\n//# sourceMappingURL=minimal-base-audio-context-constructor.js.map","export const testPromiseSupport = (nativeContext) => {\n // This 12 numbers represent the 48 bytes of an empty WAVE file with a single sample.\n const uint32Array = new Uint32Array([1179011410, 40, 1163280727, 544501094, 16, 131073, 44100, 176400, 1048580, 1635017060, 4, 0]);\n try {\n // Bug #1: Safari requires a successCallback.\n const promise = nativeContext.decodeAudioData(uint32Array.buffer, () => {\n // Ignore the success callback.\n });\n if (promise === undefined) {\n return false;\n }\n promise.catch(() => {\n // Ignore rejected errors.\n });\n return true;\n }\n catch {\n // Ignore errors.\n }\n return false;\n};\n//# sourceMappingURL=test-promise-support.js.map","export const createMonitorConnections = (insertElementInSet, isNativeAudioNode) => {\n return (nativeAudioNode, whenConnected, whenDisconnected) => {\n const connections = new Set();\n nativeAudioNode.connect = ((connect) => {\n // tslint:disable-next-line:invalid-void no-inferrable-types\n return (destination, output = 0, input = 0) => {\n const wasDisconnected = connections.size === 0;\n if (isNativeAudioNode(destination)) {\n // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet.\n connect.call(nativeAudioNode, destination, output, input);\n insertElementInSet(connections, [destination, output, input], (connection) => connection[0] === destination && connection[1] === output && connection[2] === input, true);\n if (wasDisconnected) {\n whenConnected();\n }\n return destination;\n }\n connect.call(nativeAudioNode, destination, output);\n insertElementInSet(connections, [destination, output], (connection) => connection[0] === destination && connection[1] === output, true);\n if (wasDisconnected) {\n whenConnected();\n }\n return;\n };\n })(nativeAudioNode.connect);\n nativeAudioNode.disconnect = ((disconnect) => {\n return (destinationOrOutput, output, input) => {\n const wasConnected = connections.size > 0;\n if (destinationOrOutput === undefined) {\n disconnect.apply(nativeAudioNode);\n connections.clear();\n }\n else if (typeof destinationOrOutput === 'number') {\n // @todo TypeScript cannot infer the overloaded signature with 1 argument yet.\n disconnect.call(nativeAudioNode, destinationOrOutput);\n for (const connection of connections) {\n if (connection[1] === destinationOrOutput) {\n connections.delete(connection);\n }\n }\n }\n else {\n if (isNativeAudioNode(destinationOrOutput)) {\n // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet.\n disconnect.call(nativeAudioNode, destinationOrOutput, output, input);\n }\n else {\n // @todo TypeScript cannot infer the overloaded signature with 2 arguments yet.\n disconnect.call(nativeAudioNode, destinationOrOutput, output);\n }\n for (const connection of connections) {\n if (connection[0] === destinationOrOutput &&\n (output === undefined || connection[1] === output) &&\n (input === undefined || connection[2] === input)) {\n connections.delete(connection);\n }\n }\n }\n const isDisconnected = connections.size === 0;\n if (wasConnected && isDisconnected) {\n whenDisconnected();\n }\n };\n })(nativeAudioNode.disconnect);\n return nativeAudioNode;\n };\n};\n//# sourceMappingURL=monitor-connections.js.map","export const assignNativeAudioNodeOption = (nativeAudioNode, options, option) => {\n const value = options[option];\n if (value !== undefined && value !== nativeAudioNode[option]) {\n nativeAudioNode[option] = value;\n }\n};\n//# sourceMappingURL=assign-native-audio-node-option.js.map","import { assignNativeAudioNodeOption } from './assign-native-audio-node-option';\nexport const assignNativeAudioNodeOptions = (nativeAudioNode, options) => {\n assignNativeAudioNodeOption(nativeAudioNode, options, 'channelCount');\n assignNativeAudioNodeOption(nativeAudioNode, options, 'channelCountMode');\n assignNativeAudioNodeOption(nativeAudioNode, options, 'channelInterpretation');\n};\n//# sourceMappingURL=assign-native-audio-node-options.js.map","export const createNativeAudioBufferConstructor = (window) => {\n if (window === null) {\n return null;\n }\n if (window.hasOwnProperty('AudioBuffer')) {\n return window.AudioBuffer;\n }\n return null;\n};\n//# sourceMappingURL=native-audio-buffer-constructor.js.map","export const assignNativeAudioNodeAudioParamValue = (nativeAudioNode, options, audioParam) => {\n const value = options[audioParam];\n if (value !== undefined && value !== nativeAudioNode[audioParam].value) {\n nativeAudioNode[audioParam].value = value;\n }\n};\n//# sourceMappingURL=assign-native-audio-node-audio-param-value.js.map","import { createInvalidStateError } from '../factories/invalid-state-error';\nexport const wrapAudioBufferSourceNodeStartMethodConsecutiveCalls = (nativeAudioBufferSourceNode) => {\n nativeAudioBufferSourceNode.start = ((start) => {\n let isScheduled = false;\n return (when = 0, offset = 0, duration) => {\n if (isScheduled) {\n throw createInvalidStateError();\n }\n start.call(nativeAudioBufferSourceNode, when, offset, duration);\n isScheduled = true;\n };\n })(nativeAudioBufferSourceNode.start);\n};\n//# sourceMappingURL=wrap-audio-buffer-source-node-start-method-consecutive-calls.js.map","export const wrapAudioScheduledSourceNodeStartMethodNegativeParameters = (nativeAudioScheduledSourceNode) => {\n nativeAudioScheduledSourceNode.start = ((start) => {\n return (when = 0, offset = 0, duration) => {\n if ((typeof duration === 'number' && duration < 0) || offset < 0 || when < 0) {\n throw new RangeError(\"The parameters can't be negative.\");\n }\n // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet.\n start.call(nativeAudioScheduledSourceNode, when, offset, duration);\n };\n })(nativeAudioScheduledSourceNode.start);\n};\n//# sourceMappingURL=wrap-audio-scheduled-source-node-start-method-negative-parameters.js.map","export const wrapAudioScheduledSourceNodeStopMethodNegativeParameters = (nativeAudioScheduledSourceNode) => {\n nativeAudioScheduledSourceNode.stop = ((stop) => {\n return (when = 0) => {\n if (when < 0) {\n throw new RangeError(\"The parameter can't be negative.\");\n }\n stop.call(nativeAudioScheduledSourceNode, when);\n };\n })(nativeAudioScheduledSourceNode.stop);\n};\n//# sourceMappingURL=wrap-audio-scheduled-source-node-stop-method-negative-parameters.js.map","import { assignNativeAudioNodeAudioParamValue } from '../helpers/assign-native-audio-node-audio-param-value';\nimport { assignNativeAudioNodeOption } from '../helpers/assign-native-audio-node-option';\nimport { assignNativeAudioNodeOptions } from '../helpers/assign-native-audio-node-options';\nimport { wrapAudioBufferSourceNodeStartMethodConsecutiveCalls } from '../helpers/wrap-audio-buffer-source-node-start-method-consecutive-calls';\nimport { wrapAudioScheduledSourceNodeStartMethodNegativeParameters } from '../helpers/wrap-audio-scheduled-source-node-start-method-negative-parameters';\nimport { wrapAudioScheduledSourceNodeStopMethodNegativeParameters } from '../helpers/wrap-audio-scheduled-source-node-stop-method-negative-parameters';\nexport const createNativeAudioBufferSourceNodeFactory = (addSilentConnection, cacheTestResult, testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, testAudioBufferSourceNodeStartMethodOffsetClampingSupport, testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioBufferSourceNodeStartMethodOffsetClampling, wrapAudioBufferSourceNodeStopMethodNullifiedBuffer, wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls) => {\n return (nativeContext, options) => {\n const nativeAudioBufferSourceNode = nativeContext.createBufferSource();\n assignNativeAudioNodeOptions(nativeAudioBufferSourceNode, options);\n assignNativeAudioNodeAudioParamValue(nativeAudioBufferSourceNode, options, 'playbackRate');\n assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'buffer');\n // Bug #149: Safari does not yet support the detune AudioParam.\n assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loop');\n assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loopEnd');\n assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loopStart');\n // Bug #69: Safari does allow calls to start() of an already scheduled AudioBufferSourceNode.\n if (!cacheTestResult(testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, () => testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport(nativeContext))) {\n wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(nativeAudioBufferSourceNode);\n }\n // Bug #154 & #155: Safari does not handle offsets which are equal to or greater than the duration of the buffer.\n if (!cacheTestResult(testAudioBufferSourceNodeStartMethodOffsetClampingSupport, () => testAudioBufferSourceNodeStartMethodOffsetClampingSupport(nativeContext))) {\n wrapAudioBufferSourceNodeStartMethodOffsetClampling(nativeAudioBufferSourceNode);\n }\n // Bug #162: Safari does throw an error when stop() is called on an AudioBufferSourceNode which has no buffer assigned to it.\n if (!cacheTestResult(testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, () => testAudioBufferSourceNodeStopMethodNullifiedBufferSupport(nativeContext))) {\n wrapAudioBufferSourceNodeStopMethodNullifiedBuffer(nativeAudioBufferSourceNode, nativeContext);\n }\n // Bug #44: Safari does not throw a RangeError yet.\n if (!cacheTestResult(testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStartMethodNegativeParametersSupport(nativeContext))) {\n wrapAudioScheduledSourceNodeStartMethodNegativeParameters(nativeAudioBufferSourceNode);\n }\n // Bug #19: Safari does not ignore calls to stop() of an already stopped AudioBufferSourceNode.\n if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, () => testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport(nativeContext))) {\n wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls(nativeAudioBufferSourceNode, nativeContext);\n }\n // Bug #44: Only Firefox does not throw a RangeError yet.\n if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStopMethodNegativeParametersSupport(nativeContext))) {\n wrapAudioScheduledSourceNodeStopMethodNegativeParameters(nativeAudioBufferSourceNode);\n }\n // Bug #175: Safari will not fire an ended event if the AudioBufferSourceNode is unconnected.\n addSilentConnection(nativeContext, nativeAudioBufferSourceNode);\n return nativeAudioBufferSourceNode;\n };\n};\n//# sourceMappingURL=native-audio-buffer-source-node-factory.js.map","export const createNativeAudioContextConstructor = (window) => {\n if (window === null) {\n return null;\n }\n if (window.hasOwnProperty('AudioContext')) {\n return window.AudioContext;\n }\n return window.hasOwnProperty('webkitAudioContext') ? window.webkitAudioContext : null;\n};\n//# sourceMappingURL=native-audio-context-constructor.js.map","export const createNativeAudioDestinationNodeFactory = (createNativeGainNode, overwriteAccessors) => {\n return (nativeContext, channelCount, isNodeOfNativeOfflineAudioContext) => {\n const nativeAudioDestinationNode = nativeContext.destination;\n // Bug #132: Safari does not have the correct channelCount.\n if (nativeAudioDestinationNode.channelCount !== channelCount) {\n try {\n nativeAudioDestinationNode.channelCount = channelCount;\n }\n catch {\n // Bug #169: Safari throws an error on each attempt to change the channelCount.\n }\n }\n // Bug #83: Safari does not have the correct channelCountMode.\n if (isNodeOfNativeOfflineAudioContext && nativeAudioDestinationNode.channelCountMode !== 'explicit') {\n nativeAudioDestinationNode.channelCountMode = 'explicit';\n }\n // Bug #47: The AudioDestinationNode in Safari does not initialize the maxChannelCount property correctly.\n if (nativeAudioDestinationNode.maxChannelCount === 0) {\n Object.defineProperty(nativeAudioDestinationNode, 'maxChannelCount', {\n value: channelCount\n });\n }\n // Bug #168: No browser does yet have an AudioDestinationNode with an output.\n const gainNode = createNativeGainNode(nativeContext, {\n channelCount,\n channelCountMode: nativeAudioDestinationNode.channelCountMode,\n channelInterpretation: nativeAudioDestinationNode.channelInterpretation,\n gain: 1\n });\n overwriteAccessors(gainNode, 'channelCount', (get) => () => get.call(gainNode), (set) => (value) => {\n set.call(gainNode, value);\n try {\n nativeAudioDestinationNode.channelCount = value;\n }\n catch (err) {\n // Bug #169: Safari throws an error on each attempt to change the channelCount.\n if (value > nativeAudioDestinationNode.maxChannelCount) {\n throw err;\n }\n }\n });\n overwriteAccessors(gainNode, 'channelCountMode', (get) => () => get.call(gainNode), (set) => (value) => {\n set.call(gainNode, value);\n nativeAudioDestinationNode.channelCountMode = value;\n });\n overwriteAccessors(gainNode, 'channelInterpretation', (get) => () => get.call(gainNode), (set) => (value) => {\n set.call(gainNode, value);\n nativeAudioDestinationNode.channelInterpretation = value;\n });\n Object.defineProperty(gainNode, 'maxChannelCount', {\n get: () => nativeAudioDestinationNode.maxChannelCount\n });\n // @todo This should be disconnected when the context is closed.\n gainNode.connect(nativeAudioDestinationNode);\n return gainNode;\n };\n};\n//# sourceMappingURL=native-audio-destination-node.js.map","export const createNativeAudioWorkletNodeConstructor = (window) => {\n if (window === null) {\n return null;\n }\n return window.hasOwnProperty('AudioWorkletNode') ? window.AudioWorkletNode : null;\n};\n//# sourceMappingURL=native-audio-worklet-node-constructor.js.map","export const testClonabilityOfAudioWorkletNodeOptions = (audioWorkletNodeOptions) => {\n const { port1 } = new MessageChannel();\n try {\n // This will throw an error if the audioWorkletNodeOptions are not clonable.\n port1.postMessage(audioWorkletNodeOptions);\n }\n finally {\n port1.close();\n }\n};\n//# sourceMappingURL=test-clonability-of-audio-worklet-node-options.js.map","import { testClonabilityOfAudioWorkletNodeOptions } from '../helpers/test-clonability-of-audio-worklet-node-options';\nexport const createNativeAudioWorkletNodeFactory = (createInvalidStateError, createNativeAudioWorkletNodeFaker, createNativeGainNode, createNotSupportedError, monitorConnections) => {\n return (nativeContext, baseLatency, nativeAudioWorkletNodeConstructor, name, processorConstructor, options) => {\n if (nativeAudioWorkletNodeConstructor !== null) {\n try {\n const nativeAudioWorkletNode = new nativeAudioWorkletNodeConstructor(nativeContext, name, options);\n const patchedEventListeners = new Map();\n let onprocessorerror = null;\n Object.defineProperties(nativeAudioWorkletNode, {\n /*\n * Bug #61: Overwriting the property accessors for channelCount and channelCountMode is necessary as long as some\n * browsers have no native implementation to achieve a consistent behavior.\n */\n channelCount: {\n get: () => options.channelCount,\n set: () => {\n throw createInvalidStateError();\n }\n },\n channelCountMode: {\n get: () => 'explicit',\n set: () => {\n throw createInvalidStateError();\n }\n },\n // Bug #156: Chrome and Edge do not yet fire an ErrorEvent.\n onprocessorerror: {\n get: () => onprocessorerror,\n set: (value) => {\n if (typeof onprocessorerror === 'function') {\n nativeAudioWorkletNode.removeEventListener('processorerror', onprocessorerror);\n }\n onprocessorerror = typeof value === 'function' ? value : null;\n if (typeof onprocessorerror === 'function') {\n nativeAudioWorkletNode.addEventListener('processorerror', onprocessorerror);\n }\n }\n }\n });\n nativeAudioWorkletNode.addEventListener = ((addEventListener) => {\n return (...args) => {\n if (args[0] === 'processorerror') {\n const unpatchedEventListener = typeof args[1] === 'function'\n ? args[1]\n : typeof args[1] === 'object' && args[1] !== null && typeof args[1].handleEvent === 'function'\n ? args[1].handleEvent\n : null;\n if (unpatchedEventListener !== null) {\n const patchedEventListener = patchedEventListeners.get(args[1]);\n if (patchedEventListener !== undefined) {\n args[1] = patchedEventListener;\n }\n else {\n args[1] = (event) => {\n // Bug #178: Chrome and Edge do fire an event of type error.\n if (event.type === 'error') {\n Object.defineProperties(event, {\n type: { value: 'processorerror' }\n });\n unpatchedEventListener(event);\n }\n else {\n unpatchedEventListener(new ErrorEvent(args[0], { ...event }));\n }\n };\n patchedEventListeners.set(unpatchedEventListener, args[1]);\n }\n }\n }\n // Bug #178: Chrome and Edge do fire an event of type error.\n addEventListener.call(nativeAudioWorkletNode, 'error', args[1], args[2]);\n return addEventListener.call(nativeAudioWorkletNode, ...args);\n };\n })(nativeAudioWorkletNode.addEventListener);\n nativeAudioWorkletNode.removeEventListener = ((removeEventListener) => {\n return (...args) => {\n if (args[0] === 'processorerror') {\n const patchedEventListener = patchedEventListeners.get(args[1]);\n if (patchedEventListener !== undefined) {\n patchedEventListeners.delete(args[1]);\n args[1] = patchedEventListener;\n }\n }\n // Bug #178: Chrome and Edge do fire an event of type error.\n removeEventListener.call(nativeAudioWorkletNode, 'error', args[1], args[2]);\n return removeEventListener.call(nativeAudioWorkletNode, args[0], args[1], args[2]);\n };\n })(nativeAudioWorkletNode.removeEventListener);\n /*\n * Bug #86: Chrome and Edge do not invoke the process() function if the corresponding AudioWorkletNode is unconnected but\n * has an output.\n */\n if (options.numberOfOutputs !== 0) {\n const nativeGainNode = createNativeGainNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n gain: 0\n });\n nativeAudioWorkletNode.connect(nativeGainNode).connect(nativeContext.destination);\n const whenConnected = () => nativeGainNode.disconnect();\n const whenDisconnected = () => nativeGainNode.connect(nativeContext.destination);\n // @todo Disconnect the connection when the process() function of the AudioWorkletNode returns false.\n return monitorConnections(nativeAudioWorkletNode, whenConnected, whenDisconnected);\n }\n return nativeAudioWorkletNode;\n }\n catch (err) {\n // Bug #60: Chrome & Edge throw an InvalidStateError instead of a NotSupportedError.\n if (err.code === 11) {\n throw createNotSupportedError();\n }\n throw err;\n }\n }\n // Bug #61: Only Chrome & Edge have an implementation of the AudioWorkletNode yet.\n if (processorConstructor === undefined) {\n throw createNotSupportedError();\n }\n testClonabilityOfAudioWorkletNodeOptions(options);\n return createNativeAudioWorkletNodeFaker(nativeContext, baseLatency, processorConstructor, options);\n };\n};\n//# sourceMappingURL=native-audio-worklet-node-factory.js.map","export const computeBufferSize = (baseLatency, sampleRate) => {\n if (baseLatency === null) {\n return 512;\n }\n return Math.max(512, Math.min(16384, Math.pow(2, Math.round(Math.log2(baseLatency * sampleRate)))));\n};\n//# sourceMappingURL=compute-buffer-size.js.map","export const cloneAudioWorkletNodeOptions = (audioWorkletNodeOptions) => {\n return new Promise((resolve, reject) => {\n const { port1, port2 } = new MessageChannel();\n port1.onmessage = ({ data }) => {\n port1.close();\n port2.close();\n resolve(data);\n };\n port1.onmessageerror = ({ data }) => {\n port1.close();\n port2.close();\n reject(data);\n };\n // This will throw an error if the audioWorkletNodeOptions are not clonable.\n port2.postMessage(audioWorkletNodeOptions);\n });\n};\n//# sourceMappingURL=clone-audio-worklet-node-options.js.map","import { cloneAudioWorkletNodeOptions } from './clone-audio-worklet-node-options';\nexport const createAudioWorkletProcessorPromise = async (processorConstructor, audioWorkletNodeOptions) => {\n const clonedAudioWorkletNodeOptions = await cloneAudioWorkletNodeOptions(audioWorkletNodeOptions);\n return new processorConstructor(clonedAudioWorkletNodeOptions);\n};\n//# sourceMappingURL=create-audio-worklet-processor-promise.js.map","import { NODE_TO_PROCESSOR_MAPS } from '../globals';\nimport { createAudioWorkletProcessorPromise } from './create-audio-worklet-processor-promise';\nexport const createAudioWorkletProcessor = (nativeContext, nativeAudioWorkletNode, processorConstructor, audioWorkletNodeOptions) => {\n let nodeToProcessorMap = NODE_TO_PROCESSOR_MAPS.get(nativeContext);\n if (nodeToProcessorMap === undefined) {\n nodeToProcessorMap = new WeakMap();\n NODE_TO_PROCESSOR_MAPS.set(nativeContext, nodeToProcessorMap);\n }\n const audioWorkletProcessorPromise = createAudioWorkletProcessorPromise(processorConstructor, audioWorkletNodeOptions);\n nodeToProcessorMap.set(nativeAudioWorkletNode, audioWorkletProcessorPromise);\n return audioWorkletProcessorPromise;\n};\n//# sourceMappingURL=create-audio-worklet-processor.js.map","import { MOST_NEGATIVE_SINGLE_FLOAT, MOST_POSITIVE_SINGLE_FLOAT } from '../constants';\nimport { computeBufferSize } from '../helpers/compute-buffer-size';\nimport { copyFromChannel } from '../helpers/copy-from-channel';\nimport { copyToChannel } from '../helpers/copy-to-channel';\nimport { createAudioWorkletProcessor } from '../helpers/create-audio-worklet-processor';\nimport { createNestedArrays } from '../helpers/create-nested-arrays';\nimport { ReadOnlyMap } from '../read-only-map';\nexport const createNativeAudioWorkletNodeFakerFactory = (connectMultipleOutputs, createIndexSizeError, createInvalidStateError, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, createNativeScriptProcessorNode, createNotSupportedError, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getActiveAudioWorkletNodeInputs, monitorConnections) => {\n return (nativeContext, baseLatency, processorConstructor, options) => {\n if (options.numberOfInputs === 0 && options.numberOfOutputs === 0) {\n throw createNotSupportedError();\n }\n const outputChannelCount = Array.isArray(options.outputChannelCount)\n ? options.outputChannelCount\n : Array.from(options.outputChannelCount);\n // @todo Check if any of the channelCount values is greater than the implementation's maximum number of channels.\n if (outputChannelCount.some((channelCount) => channelCount < 1)) {\n throw createNotSupportedError();\n }\n if (outputChannelCount.length !== options.numberOfOutputs) {\n throw createIndexSizeError();\n }\n // Bug #61: This is not part of the standard but required for the faker to work.\n if (options.channelCountMode !== 'explicit') {\n throw createNotSupportedError();\n }\n const numberOfInputChannels = options.channelCount * options.numberOfInputs;\n const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0);\n const numberOfParameters = processorConstructor.parameterDescriptors === undefined ? 0 : processorConstructor.parameterDescriptors.length;\n // Bug #61: This is not part of the standard but required for the faker to work.\n if (numberOfInputChannels + numberOfParameters > 6 || numberOfOutputChannels > 6) {\n throw createNotSupportedError();\n }\n const messageChannel = new MessageChannel();\n const gainNodes = [];\n const inputChannelSplitterNodes = [];\n for (let i = 0; i < options.numberOfInputs; i += 1) {\n gainNodes.push(createNativeGainNode(nativeContext, {\n channelCount: options.channelCount,\n channelCountMode: options.channelCountMode,\n channelInterpretation: options.channelInterpretation,\n gain: 1\n }));\n inputChannelSplitterNodes.push(createNativeChannelSplitterNode(nativeContext, {\n channelCount: options.channelCount,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n numberOfOutputs: options.channelCount\n }));\n }\n const constantSourceNodes = [];\n if (processorConstructor.parameterDescriptors !== undefined) {\n for (const { defaultValue, maxValue, minValue, name } of processorConstructor.parameterDescriptors) {\n const constantSourceNode = createNativeConstantSourceNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n offset: options.parameterData[name] !== undefined\n ? options.parameterData[name]\n : defaultValue === undefined\n ? 0\n : defaultValue\n });\n Object.defineProperties(constantSourceNode.offset, {\n defaultValue: {\n get: () => (defaultValue === undefined ? 0 : defaultValue)\n },\n maxValue: {\n get: () => (maxValue === undefined ? MOST_POSITIVE_SINGLE_FLOAT : maxValue)\n },\n minValue: {\n get: () => (minValue === undefined ? MOST_NEGATIVE_SINGLE_FLOAT : minValue)\n }\n });\n constantSourceNodes.push(constantSourceNode);\n }\n }\n const inputChannelMergerNode = createNativeChannelMergerNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: Math.max(1, numberOfInputChannels + numberOfParameters)\n });\n const bufferSize = computeBufferSize(baseLatency, nativeContext.sampleRate);\n const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, bufferSize, numberOfInputChannels + numberOfParameters, \n // Bug #87: Only Firefox will fire an AudioProcessingEvent if there is no connected output.\n Math.max(1, numberOfOutputChannels));\n const outputChannelSplitterNode = createNativeChannelSplitterNode(nativeContext, {\n channelCount: Math.max(1, numberOfOutputChannels),\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n numberOfOutputs: Math.max(1, numberOfOutputChannels)\n });\n const outputChannelMergerNodes = [];\n for (let i = 0; i < options.numberOfOutputs; i += 1) {\n outputChannelMergerNodes.push(createNativeChannelMergerNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'speakers',\n numberOfInputs: outputChannelCount[i]\n }));\n }\n for (let i = 0; i < options.numberOfInputs; i += 1) {\n gainNodes[i].connect(inputChannelSplitterNodes[i]);\n for (let j = 0; j < options.channelCount; j += 1) {\n inputChannelSplitterNodes[i].connect(inputChannelMergerNode, j, i * options.channelCount + j);\n }\n }\n const parameterMap = new ReadOnlyMap(processorConstructor.parameterDescriptors === undefined\n ? []\n : processorConstructor.parameterDescriptors.map(({ name }, index) => {\n const constantSourceNode = constantSourceNodes[index];\n constantSourceNode.connect(inputChannelMergerNode, 0, numberOfInputChannels + index);\n constantSourceNode.start(0);\n return [name, constantSourceNode.offset];\n }));\n inputChannelMergerNode.connect(scriptProcessorNode);\n let channelInterpretation = options.channelInterpretation;\n let onprocessorerror = null;\n // Bug #87: Expose at least one output to make this node connectable.\n const outputAudioNodes = options.numberOfOutputs === 0 ? [scriptProcessorNode] : outputChannelMergerNodes;\n const nativeAudioWorkletNodeFaker = {\n get bufferSize() {\n return bufferSize;\n },\n get channelCount() {\n return options.channelCount;\n },\n set channelCount(_) {\n // Bug #61: This is not part of the standard but required for the faker to work.\n throw createInvalidStateError();\n },\n get channelCountMode() {\n return options.channelCountMode;\n },\n set channelCountMode(_) {\n // Bug #61: This is not part of the standard but required for the faker to work.\n throw createInvalidStateError();\n },\n get channelInterpretation() {\n return channelInterpretation;\n },\n set channelInterpretation(value) {\n for (const gainNode of gainNodes) {\n gainNode.channelInterpretation = value;\n }\n channelInterpretation = value;\n },\n get context() {\n return scriptProcessorNode.context;\n },\n get inputs() {\n return gainNodes;\n },\n get numberOfInputs() {\n return options.numberOfInputs;\n },\n get numberOfOutputs() {\n return options.numberOfOutputs;\n },\n get onprocessorerror() {\n return onprocessorerror;\n },\n set onprocessorerror(value) {\n if (typeof onprocessorerror === 'function') {\n nativeAudioWorkletNodeFaker.removeEventListener('processorerror', onprocessorerror);\n }\n onprocessorerror = typeof value === 'function' ? value : null;\n if (typeof onprocessorerror === 'function') {\n nativeAudioWorkletNodeFaker.addEventListener('processorerror', onprocessorerror);\n }\n },\n get parameters() {\n return parameterMap;\n },\n get port() {\n return messageChannel.port2;\n },\n addEventListener(...args) {\n return scriptProcessorNode.addEventListener(args[0], args[1], args[2]);\n },\n connect: connectMultipleOutputs.bind(null, outputAudioNodes),\n disconnect: disconnectMultipleOutputs.bind(null, outputAudioNodes),\n dispatchEvent(...args) {\n return scriptProcessorNode.dispatchEvent(args[0]);\n },\n removeEventListener(...args) {\n return scriptProcessorNode.removeEventListener(args[0], args[1], args[2]);\n }\n };\n const patchedEventListeners = new Map();\n messageChannel.port1.addEventListener = ((addEventListener) => {\n return (...args) => {\n if (args[0] === 'message') {\n const unpatchedEventListener = typeof args[1] === 'function'\n ? args[1]\n : typeof args[1] === 'object' && args[1] !== null && typeof args[1].handleEvent === 'function'\n ? args[1].handleEvent\n : null;\n if (unpatchedEventListener !== null) {\n const patchedEventListener = patchedEventListeners.get(args[1]);\n if (patchedEventListener !== undefined) {\n args[1] = patchedEventListener;\n }\n else {\n args[1] = (event) => {\n exposeCurrentFrameAndCurrentTime(nativeContext.currentTime, nativeContext.sampleRate, () => unpatchedEventListener(event));\n };\n patchedEventListeners.set(unpatchedEventListener, args[1]);\n }\n }\n }\n return addEventListener.call(messageChannel.port1, args[0], args[1], args[2]);\n };\n })(messageChannel.port1.addEventListener);\n messageChannel.port1.removeEventListener = ((removeEventListener) => {\n return (...args) => {\n if (args[0] === 'message') {\n const patchedEventListener = patchedEventListeners.get(args[1]);\n if (patchedEventListener !== undefined) {\n patchedEventListeners.delete(args[1]);\n args[1] = patchedEventListener;\n }\n }\n return removeEventListener.call(messageChannel.port1, args[0], args[1], args[2]);\n };\n })(messageChannel.port1.removeEventListener);\n let onmessage = null;\n Object.defineProperty(messageChannel.port1, 'onmessage', {\n get: () => onmessage,\n set: (value) => {\n if (typeof onmessage === 'function') {\n messageChannel.port1.removeEventListener('message', onmessage);\n }\n onmessage = typeof value === 'function' ? value : null;\n if (typeof onmessage === 'function') {\n messageChannel.port1.addEventListener('message', onmessage);\n messageChannel.port1.start();\n }\n }\n });\n processorConstructor.prototype.port = messageChannel.port1;\n let audioWorkletProcessor = null;\n const audioWorkletProcessorPromise = createAudioWorkletProcessor(nativeContext, nativeAudioWorkletNodeFaker, processorConstructor, options);\n audioWorkletProcessorPromise.then((dWrkltPrcssr) => (audioWorkletProcessor = dWrkltPrcssr));\n const inputs = createNestedArrays(options.numberOfInputs, options.channelCount);\n const outputs = createNestedArrays(options.numberOfOutputs, outputChannelCount);\n const parameters = processorConstructor.parameterDescriptors === undefined\n ? []\n : processorConstructor.parameterDescriptors.reduce((prmtrs, { name }) => ({ ...prmtrs, [name]: new Float32Array(128) }), {});\n let isActive = true;\n const disconnectOutputsGraph = () => {\n if (options.numberOfOutputs > 0) {\n scriptProcessorNode.disconnect(outputChannelSplitterNode);\n }\n for (let i = 0, outputChannelSplitterNodeOutput = 0; i < options.numberOfOutputs; i += 1) {\n const outputChannelMergerNode = outputChannelMergerNodes[i];\n for (let j = 0; j < outputChannelCount[i]; j += 1) {\n outputChannelSplitterNode.disconnect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j);\n }\n outputChannelSplitterNodeOutput += outputChannelCount[i];\n }\n };\n const activeInputIndexes = new Map();\n // tslint:disable-next-line:deprecation\n scriptProcessorNode.onaudioprocess = ({ inputBuffer, outputBuffer }) => {\n if (audioWorkletProcessor !== null) {\n const activeInputs = getActiveAudioWorkletNodeInputs(nativeAudioWorkletNodeFaker);\n for (let i = 0; i < bufferSize; i += 128) {\n for (let j = 0; j < options.numberOfInputs; j += 1) {\n for (let k = 0; k < options.channelCount; k += 1) {\n copyFromChannel(inputBuffer, inputs[j], k, k, i);\n }\n }\n if (processorConstructor.parameterDescriptors !== undefined) {\n processorConstructor.parameterDescriptors.forEach(({ name }, index) => {\n copyFromChannel(inputBuffer, parameters, name, numberOfInputChannels + index, i);\n });\n }\n for (let j = 0; j < options.numberOfInputs; j += 1) {\n for (let k = 0; k < outputChannelCount[j]; k += 1) {\n // The byteLength will be 0 when the ArrayBuffer was transferred.\n if (outputs[j][k].byteLength === 0) {\n outputs[j][k] = new Float32Array(128);\n }\n }\n }\n try {\n const potentiallyEmptyInputs = inputs.map((input, index) => {\n const activeInput = activeInputs[index];\n if (activeInput.size > 0) {\n activeInputIndexes.set(index, bufferSize / 128);\n return input;\n }\n const count = activeInputIndexes.get(index);\n if (count === undefined) {\n return [];\n }\n if (input.every((channelData) => channelData.every((sample) => sample === 0))) {\n if (count === 1) {\n activeInputIndexes.delete(index);\n }\n else {\n activeInputIndexes.set(index, count - 1);\n }\n }\n return input;\n });\n const activeSourceFlag = exposeCurrentFrameAndCurrentTime(nativeContext.currentTime + i / nativeContext.sampleRate, nativeContext.sampleRate, () => audioWorkletProcessor.process(potentiallyEmptyInputs, outputs, parameters));\n isActive = activeSourceFlag;\n for (let j = 0, outputChannelSplitterNodeOutput = 0; j < options.numberOfOutputs; j += 1) {\n for (let k = 0; k < outputChannelCount[j]; k += 1) {\n copyToChannel(outputBuffer, outputs[j], k, outputChannelSplitterNodeOutput + k, i);\n }\n outputChannelSplitterNodeOutput += outputChannelCount[j];\n }\n }\n catch (error) {\n isActive = false;\n nativeAudioWorkletNodeFaker.dispatchEvent(new ErrorEvent('processorerror', {\n colno: error.colno,\n filename: error.filename,\n lineno: error.lineno,\n message: error.message\n }));\n }\n if (!isActive) {\n for (let j = 0; j < options.numberOfInputs; j += 1) {\n gainNodes[j].disconnect(inputChannelSplitterNodes[j]);\n for (let k = 0; k < options.channelCount; k += 1) {\n inputChannelSplitterNodes[i].disconnect(inputChannelMergerNode, k, j * options.channelCount + k);\n }\n }\n if (processorConstructor.parameterDescriptors !== undefined) {\n const length = processorConstructor.parameterDescriptors.length;\n for (let j = 0; j < length; j += 1) {\n const constantSourceNode = constantSourceNodes[j];\n constantSourceNode.disconnect(inputChannelMergerNode, 0, numberOfInputChannels + j);\n constantSourceNode.stop();\n }\n }\n inputChannelMergerNode.disconnect(scriptProcessorNode);\n scriptProcessorNode.onaudioprocess = null; // tslint:disable-line:deprecation\n if (isConnected) {\n disconnectOutputsGraph();\n }\n else {\n disconnectFakeGraph();\n }\n break;\n }\n }\n }\n };\n let isConnected = false;\n // Bug #87: Only Firefox will fire an AudioProcessingEvent if there is no connected output.\n const nativeGainNode = createNativeGainNode(nativeContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n gain: 0\n });\n const connectFakeGraph = () => scriptProcessorNode.connect(nativeGainNode).connect(nativeContext.destination);\n const disconnectFakeGraph = () => {\n scriptProcessorNode.disconnect(nativeGainNode);\n nativeGainNode.disconnect();\n };\n const whenConnected = () => {\n if (isActive) {\n disconnectFakeGraph();\n if (options.numberOfOutputs > 0) {\n scriptProcessorNode.connect(outputChannelSplitterNode);\n }\n for (let i = 0, outputChannelSplitterNodeOutput = 0; i < options.numberOfOutputs; i += 1) {\n const outputChannelMergerNode = outputChannelMergerNodes[i];\n for (let j = 0; j < outputChannelCount[i]; j += 1) {\n outputChannelSplitterNode.connect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j);\n }\n outputChannelSplitterNodeOutput += outputChannelCount[i];\n }\n }\n isConnected = true;\n };\n const whenDisconnected = () => {\n if (isActive) {\n connectFakeGraph();\n disconnectOutputsGraph();\n }\n isConnected = false;\n };\n connectFakeGraph();\n return monitorConnections(nativeAudioWorkletNodeFaker, whenConnected, whenDisconnected);\n };\n};\n//# sourceMappingURL=native-audio-worklet-node-faker-factory.js.map","import { assignNativeAudioNodeOptions } from '../helpers/assign-native-audio-node-options';\nexport const createNativeChannelMergerNodeFactory = (nativeAudioContextConstructor, wrapChannelMergerNode) => {\n return (nativeContext, options) => {\n const nativeChannelMergerNode = nativeContext.createChannelMerger(options.numberOfInputs);\n /*\n * Bug #20: Safari requires a connection of any kind to treat the input signal correctly.\n * @todo Unfortunately there is no way to test for this behavior in a synchronous fashion which is why testing for the existence of\n * the webkitAudioContext is used as a workaround here.\n */\n if (nativeAudioContextConstructor !== null && nativeAudioContextConstructor.name === 'webkitAudioContext') {\n wrapChannelMergerNode(nativeContext, nativeChannelMergerNode);\n }\n assignNativeAudioNodeOptions(nativeChannelMergerNode, options);\n return nativeChannelMergerNode;\n };\n};\n//# sourceMappingURL=native-channel-merger-node-factory.js.map","import { createInvalidStateError } from '../factories/invalid-state-error';\nexport const wrapChannelSplitterNode = (channelSplitterNode) => {\n const channelCount = channelSplitterNode.numberOfOutputs;\n // Bug #97: Safari does not throw an error when attempting to change the channelCount to something other than its initial value.\n Object.defineProperty(channelSplitterNode, 'channelCount', {\n get: () => channelCount,\n set: (value) => {\n if (value !== channelCount) {\n throw createInvalidStateError();\n }\n }\n });\n // Bug #30: Safari does not throw an error when attempting to change the channelCountMode to something other than explicit.\n Object.defineProperty(channelSplitterNode, 'channelCountMode', {\n get: () => 'explicit',\n set: (value) => {\n if (value !== 'explicit') {\n throw createInvalidStateError();\n }\n }\n });\n // Bug #32: Safari does not throw an error when attempting to change the channelInterpretation to something other than discrete.\n Object.defineProperty(channelSplitterNode, 'channelInterpretation', {\n get: () => 'discrete',\n set: (value) => {\n if (value !== 'discrete') {\n throw createInvalidStateError();\n }\n }\n });\n};\n//# sourceMappingURL=wrap-channel-splitter-node.js.map","import { assignNativeAudioNodeOptions } from '../helpers/assign-native-audio-node-options';\nimport { wrapChannelSplitterNode } from '../helpers/wrap-channel-splitter-node';\nexport const createNativeChannelSplitterNode = (nativeContext, options) => {\n const nativeChannelSplitterNode = nativeContext.createChannelSplitter(options.numberOfOutputs);\n // Bug #96: Safari does not have the correct channelCount.\n // Bug #29: Safari does not have the correct channelCountMode.\n // Bug #31: Safari does not have the correct channelInterpretation.\n assignNativeAudioNodeOptions(nativeChannelSplitterNode, options);\n // Bug #29, #30, #31, #32, #96 & #97: Only Chrome, Edge & Firefox partially support the spec yet.\n wrapChannelSplitterNode(nativeChannelSplitterNode);\n return nativeChannelSplitterNode;\n};\n//# sourceMappingURL=native-channel-splitter-node.js.map","import { assignNativeAudioNodeAudioParamValue } from '../helpers/assign-native-audio-node-audio-param-value';\nimport { assignNativeAudioNodeOptions } from '../helpers/assign-native-audio-node-options';\nimport { wrapAudioScheduledSourceNodeStartMethodNegativeParameters } from '../helpers/wrap-audio-scheduled-source-node-start-method-negative-parameters';\nimport { wrapAudioScheduledSourceNodeStopMethodNegativeParameters } from '../helpers/wrap-audio-scheduled-source-node-stop-method-negative-parameters';\nexport const createNativeConstantSourceNodeFactory = (addSilentConnection, cacheTestResult, createNativeConstantSourceNodeFaker, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport) => {\n return (nativeContext, options) => {\n // Bug #62: Safari does not support ConstantSourceNodes.\n if (nativeContext.createConstantSource === undefined) {\n return createNativeConstantSourceNodeFaker(nativeContext, options);\n }\n const nativeConstantSourceNode = nativeContext.createConstantSource();\n assignNativeAudioNodeOptions(nativeConstantSourceNode, options);\n assignNativeAudioNodeAudioParamValue(nativeConstantSourceNode, options, 'offset');\n // Bug #44: Safari does not throw a RangeError yet.\n if (!cacheTestResult(testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStartMethodNegativeParametersSupport(nativeContext))) {\n wrapAudioScheduledSourceNodeStartMethodNegativeParameters(nativeConstantSourceNode);\n }\n // Bug #44: Only Firefox does not throw a RangeError yet.\n if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStopMethodNegativeParametersSupport(nativeContext))) {\n wrapAudioScheduledSourceNodeStopMethodNegativeParameters(nativeConstantSourceNode);\n }\n // Bug #175: Safari will not fire an ended event if the ConstantSourceNode is unconnected.\n addSilentConnection(nativeContext, nativeConstantSourceNode);\n return nativeConstantSourceNode;\n };\n};\n//# sourceMappingURL=native-constant-source-node-factory.js.map","export const interceptConnections = (original, interceptor) => {\n original.connect = interceptor.connect.bind(interceptor);\n original.disconnect = interceptor.disconnect.bind(interceptor);\n return original;\n};\n//# sourceMappingURL=intercept-connections.js.map","import { interceptConnections } from '../helpers/intercept-connections';\nexport const createNativeConstantSourceNodeFakerFactory = (addSilentConnection, createNativeAudioBufferSourceNode, createNativeGainNode, monitorConnections) => {\n return (nativeContext, { offset, ...audioNodeOptions }) => {\n const audioBuffer = nativeContext.createBuffer(1, 2, 44100);\n const audioBufferSourceNode = createNativeAudioBufferSourceNode(nativeContext, {\n buffer: null,\n channelCount: 2,\n channelCountMode: 'max',\n channelInterpretation: 'speakers',\n loop: false,\n loopEnd: 0,\n loopStart: 0,\n playbackRate: 1\n });\n const gainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: offset });\n // Bug #5: Safari does not support copyFromChannel() and copyToChannel().\n const channelData = audioBuffer.getChannelData(0);\n // Bug #95: Safari does not play or loop one sample buffers.\n channelData[0] = 1;\n channelData[1] = 1;\n audioBufferSourceNode.buffer = audioBuffer;\n audioBufferSourceNode.loop = true;\n const nativeConstantSourceNodeFaker = {\n get bufferSize() {\n return undefined;\n },\n get channelCount() {\n return gainNode.channelCount;\n },\n set channelCount(value) {\n gainNode.channelCount = value;\n },\n get channelCountMode() {\n return gainNode.channelCountMode;\n },\n set channelCountMode(value) {\n gainNode.channelCountMode = value;\n },\n get channelInterpretation() {\n return gainNode.channelInterpretation;\n },\n set channelInterpretation(value) {\n gainNode.channelInterpretation = value;\n },\n get context() {\n return gainNode.context;\n },\n get inputs() {\n return [];\n },\n get numberOfInputs() {\n return audioBufferSourceNode.numberOfInputs;\n },\n get numberOfOutputs() {\n return gainNode.numberOfOutputs;\n },\n get offset() {\n return gainNode.gain;\n },\n get onended() {\n return audioBufferSourceNode.onended;\n },\n set onended(value) {\n audioBufferSourceNode.onended = value;\n },\n addEventListener(...args) {\n return audioBufferSourceNode.addEventListener(args[0], args[1], args[2]);\n },\n dispatchEvent(...args) {\n return audioBufferSourceNode.dispatchEvent(args[0]);\n },\n removeEventListener(...args) {\n return audioBufferSourceNode.removeEventListener(args[0], args[1], args[2]);\n },\n start(when = 0) {\n audioBufferSourceNode.start.call(audioBufferSourceNode, when);\n },\n stop(when = 0) {\n audioBufferSourceNode.stop.call(audioBufferSourceNode, when);\n }\n };\n const whenConnected = () => audioBufferSourceNode.connect(gainNode);\n const whenDisconnected = () => audioBufferSourceNode.disconnect(gainNode);\n // Bug #175: Safari will not fire an ended event if the AudioBufferSourceNode is unconnected.\n addSilentConnection(nativeContext, audioBufferSourceNode);\n return monitorConnections(interceptConnections(nativeConstantSourceNodeFaker, gainNode), whenConnected, whenDisconnected);\n };\n};\n//# sourceMappingURL=native-constant-source-node-faker-factory.js.map","import { assignNativeAudioNodeAudioParamValue } from '../helpers/assign-native-audio-node-audio-param-value';\nimport { assignNativeAudioNodeOptions } from '../helpers/assign-native-audio-node-options';\nexport const createNativeGainNode = (nativeContext, options) => {\n const nativeGainNode = nativeContext.createGain();\n assignNativeAudioNodeOptions(nativeGainNode, options);\n assignNativeAudioNodeAudioParamValue(nativeGainNode, options, 'gain');\n return nativeGainNode;\n};\n//# sourceMappingURL=native-gain-node.js.map","export const createNativeMediaStreamAudioSourceNode = (nativeAudioContext, { mediaStream }) => {\n const audioStreamTracks = mediaStream.getAudioTracks();\n /*\n * Bug #151: Safari does not use the audio track as input anymore if it gets removed from the mediaStream after construction.\n * Bug #159: Safari picks the first audio track if the MediaStream has more than one audio track.\n */\n audioStreamTracks.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));\n const filteredAudioStreamTracks = audioStreamTracks.slice(0, 1);\n const nativeMediaStreamAudioSourceNode = nativeAudioContext.createMediaStreamSource(new MediaStream(filteredAudioStreamTracks));\n /*\n * Bug #151 & #159: The given mediaStream gets reconstructed before it gets passed to the native node which is why the accessor needs\n * to be overwritten as it would otherwise expose the reconstructed version.\n */\n Object.defineProperty(nativeMediaStreamAudioSourceNode, 'mediaStream', { value: mediaStream });\n return nativeMediaStreamAudioSourceNode;\n};\n//# sourceMappingURL=native-media-stream-audio-source-node.js.map","export const createNativeOfflineAudioContextConstructor = (window) => {\n if (window === null) {\n return null;\n }\n if (window.hasOwnProperty('OfflineAudioContext')) {\n return window.OfflineAudioContext;\n }\n return window.hasOwnProperty('webkitOfflineAudioContext') ? window.webkitOfflineAudioContext : null;\n};\n//# sourceMappingURL=native-offline-audio-context-constructor.js.map","export const createNativeScriptProcessorNode = (nativeContext, bufferSize, numberOfInputChannels, numberOfOutputChannels) => {\n return nativeContext.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels); // tslint:disable-line deprecation\n};\n//# sourceMappingURL=native-script-processor-node.js.map","export const createNotSupportedError = () => new DOMException('', 'NotSupportedError');\n//# sourceMappingURL=not-supported-error.js.map","export const createRenderAutomation = (getAudioParamRenderer, renderInputsOfAudioParam) => {\n return (nativeOfflineAudioContext, audioParam, nativeAudioParam) => {\n const audioParamRenderer = getAudioParamRenderer(audioParam);\n audioParamRenderer.replay(nativeAudioParam);\n return renderInputsOfAudioParam(audioParam, nativeOfflineAudioContext, nativeAudioParam);\n };\n};\n//# sourceMappingURL=render-automation.js.map","export const createRenderInputsOfAudioNode = (getAudioNodeConnections, getAudioNodeRenderer, isPartOfACycle) => {\n return async (audioNode, nativeOfflineAudioContext, nativeAudioNode) => {\n const audioNodeConnections = getAudioNodeConnections(audioNode);\n await Promise.all(audioNodeConnections.activeInputs\n .map((connections, input) => Array.from(connections).map(async ([source, output]) => {\n const audioNodeRenderer = getAudioNodeRenderer(source);\n const renderedNativeAudioNode = await audioNodeRenderer.render(source, nativeOfflineAudioContext);\n const destination = audioNode.context.destination;\n if (!isPartOfACycle(source) && (audioNode !== destination || !isPartOfACycle(audioNode))) {\n renderedNativeAudioNode.connect(nativeAudioNode, output, input);\n }\n }))\n .reduce((allRenderingPromises, renderingPromises) => [...allRenderingPromises, ...renderingPromises], []));\n };\n};\n//# sourceMappingURL=render-inputs-of-audio-node.js.map","export const createRenderInputsOfAudioParam = (getAudioNodeRenderer, getAudioParamConnections, isPartOfACycle) => {\n return async (audioParam, nativeOfflineAudioContext, nativeAudioParam) => {\n const audioParamConnections = getAudioParamConnections(audioParam);\n await Promise.all(Array.from(audioParamConnections.activeInputs).map(async ([source, output]) => {\n const audioNodeRenderer = getAudioNodeRenderer(source);\n const renderedNativeAudioNode = await audioNodeRenderer.render(source, nativeOfflineAudioContext);\n if (!isPartOfACycle(source)) {\n renderedNativeAudioNode.connect(nativeAudioParam, output);\n }\n }));\n };\n};\n//# sourceMappingURL=render-inputs-of-audio-param.js.map","import { testPromiseSupport } from '../helpers/test-promise-support';\nexport const createRenderNativeOfflineAudioContext = (cacheTestResult, createNativeGainNode, createNativeScriptProcessorNode, testOfflineAudioContextCurrentTimeSupport) => {\n return (nativeOfflineAudioContext) => {\n // Bug #21: Safari does not support promises yet.\n if (cacheTestResult(testPromiseSupport, () => testPromiseSupport(nativeOfflineAudioContext))) {\n // Bug #158: Chrome and Edge do not advance currentTime if it is not accessed while rendering the audio.\n return Promise.resolve(cacheTestResult(testOfflineAudioContextCurrentTimeSupport, testOfflineAudioContextCurrentTimeSupport)).then((isOfflineAudioContextCurrentTimeSupported) => {\n if (!isOfflineAudioContextCurrentTimeSupported) {\n const scriptProcessorNode = createNativeScriptProcessorNode(nativeOfflineAudioContext, 512, 0, 1);\n nativeOfflineAudioContext.oncomplete = () => {\n scriptProcessorNode.onaudioprocess = null; // tslint:disable-line:deprecation\n scriptProcessorNode.disconnect();\n };\n scriptProcessorNode.onaudioprocess = () => nativeOfflineAudioContext.currentTime; // tslint:disable-line:deprecation\n scriptProcessorNode.connect(nativeOfflineAudioContext.destination);\n }\n return nativeOfflineAudioContext.startRendering();\n });\n }\n return new Promise((resolve) => {\n // Bug #48: Safari does not render an OfflineAudioContext without any connected node.\n const gainNode = createNativeGainNode(nativeOfflineAudioContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n gain: 0\n });\n nativeOfflineAudioContext.oncomplete = (event) => {\n gainNode.disconnect();\n resolve(event.renderedBuffer);\n };\n gainNode.connect(nativeOfflineAudioContext.destination);\n nativeOfflineAudioContext.startRendering();\n });\n };\n};\n//# sourceMappingURL=render-native-offline-audio-context.js.map","export const createSetActiveAudioWorkletNodeInputs = (activeAudioWorkletNodeInputsStore) => {\n return (nativeAudioWorkletNode, activeInputs) => {\n activeAudioWorkletNodeInputsStore.set(nativeAudioWorkletNode, activeInputs);\n };\n};\n//# sourceMappingURL=set-active-audio-worklet-node-inputs.js.map","// Bug #33: Safari exposes an AudioBuffer but it can't be used as a constructor.\nexport const createTestAudioBufferConstructorSupport = (nativeAudioBufferConstructor) => {\n return () => {\n if (nativeAudioBufferConstructor === null) {\n return false;\n }\n try {\n new nativeAudioBufferConstructor({ length: 1, sampleRate: 44100 }); // tslint:disable-line:no-unused-expression\n }\n catch {\n return false;\n }\n return true;\n };\n};\n//# sourceMappingURL=test-audio-buffer-constructor-support.js.map","// Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument.\nexport const createTestAudioWorkletProcessorPostMessageSupport = (nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor) => {\n return async () => {\n // Bug #61: If there is no native AudioWorkletNode it gets faked and therefore it is no problem if the it doesn't exist.\n if (nativeAudioWorkletNodeConstructor === null) {\n return true;\n }\n if (nativeOfflineAudioContextConstructor === null) {\n return false;\n }\n const blob = new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor(\"a\",A)'], {\n type: 'application/javascript; charset=utf-8'\n });\n // Bug #141: Safari does not support creating an OfflineAudioContext with less than 44100 Hz.\n const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 128, 44100);\n const url = URL.createObjectURL(blob);\n let isEmittingMessageEvents = false;\n let isEmittingProcessorErrorEvents = false;\n try {\n await offlineAudioContext.audioWorklet.addModule(url);\n const audioWorkletNode = new nativeAudioWorkletNodeConstructor(offlineAudioContext, 'a', { numberOfOutputs: 0 });\n const oscillator = offlineAudioContext.createOscillator();\n audioWorkletNode.port.onmessage = () => (isEmittingMessageEvents = true);\n audioWorkletNode.onprocessorerror = () => (isEmittingProcessorErrorEvents = true);\n oscillator.connect(audioWorkletNode);\n oscillator.start(0);\n await offlineAudioContext.startRendering();\n // Bug #197: Safari does not deliver the messages before the promise returned by startRendering() resolves.\n await new Promise((resolve) => setTimeout(resolve));\n }\n catch {\n // Ignore errors.\n }\n finally {\n URL.revokeObjectURL(url);\n }\n return isEmittingMessageEvents && !isEmittingProcessorErrorEvents;\n };\n};\n//# sourceMappingURL=test-audio-worklet-processor-post-message-support.js.map","export const createTestOfflineAudioContextCurrentTimeSupport = (createNativeGainNode, nativeOfflineAudioContextConstructor) => {\n return () => {\n if (nativeOfflineAudioContextConstructor === null) {\n return Promise.resolve(false);\n }\n const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100);\n // Bug #48: Safari does not render an OfflineAudioContext without any connected node.\n const gainNode = createNativeGainNode(nativeOfflineAudioContext, {\n channelCount: 1,\n channelCountMode: 'explicit',\n channelInterpretation: 'discrete',\n gain: 0\n });\n // Bug #21: Safari does not support promises yet.\n return new Promise((resolve) => {\n nativeOfflineAudioContext.oncomplete = () => {\n gainNode.disconnect();\n resolve(nativeOfflineAudioContext.currentTime !== 0);\n };\n nativeOfflineAudioContext.startRendering();\n });\n };\n};\n//# sourceMappingURL=test-offline-audio-context-current-time-support.js.map","export const createUnknownError = () => new DOMException('', 'UnknownError');\n//# sourceMappingURL=unknown-error.js.map","export const createWindow = () => (typeof window === 'undefined' ? null : window);\n//# sourceMappingURL=window.js.map","export const createWrapAudioBufferCopyChannelMethods = (convertNumberToUnsignedLong, createIndexSizeError) => {\n return (audioBuffer) => {\n audioBuffer.copyFromChannel = (destination, channelNumberAsNumber, bufferOffsetAsNumber = 0) => {\n const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber);\n const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber);\n if (channelNumber >= audioBuffer.numberOfChannels) {\n throw createIndexSizeError();\n }\n const audioBufferLength = audioBuffer.length;\n const channelData = audioBuffer.getChannelData(channelNumber);\n const destinationLength = destination.length;\n for (let i = bufferOffset < 0 ? -bufferOffset : 0; i + bufferOffset < audioBufferLength && i < destinationLength; i += 1) {\n destination[i] = channelData[i + bufferOffset];\n }\n };\n audioBuffer.copyToChannel = (source, channelNumberAsNumber, bufferOffsetAsNumber = 0) => {\n const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber);\n const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber);\n if (channelNumber >= audioBuffer.numberOfChannels) {\n throw createIndexSizeError();\n }\n const audioBufferLength = audioBuffer.length;\n const channelData = audioBuffer.getChannelData(channelNumber);\n const sourceLength = source.length;\n for (let i = bufferOffset < 0 ? -bufferOffset : 0; i + bufferOffset < audioBufferLength && i < sourceLength; i += 1) {\n channelData[i + bufferOffset] = source[i];\n }\n };\n };\n};\n//# sourceMappingURL=wrap-audio-buffer-copy-channel-methods.js.map","export const createWrapAudioBufferCopyChannelMethodsOutOfBounds = (convertNumberToUnsignedLong) => {\n return (audioBuffer) => {\n audioBuffer.copyFromChannel = ((copyFromChannel) => {\n return (destination, channelNumberAsNumber, bufferOffsetAsNumber = 0) => {\n const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber);\n const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber);\n if (bufferOffset < audioBuffer.length) {\n return copyFromChannel.call(audioBuffer, destination, channelNumber, bufferOffset);\n }\n };\n })(audioBuffer.copyFromChannel);\n audioBuffer.copyToChannel = ((copyToChannel) => {\n return (source, channelNumberAsNumber, bufferOffsetAsNumber = 0) => {\n const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber);\n const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber);\n if (bufferOffset < audioBuffer.length) {\n return copyToChannel.call(audioBuffer, source, channelNumber, bufferOffset);\n }\n };\n })(audioBuffer.copyToChannel);\n };\n};\n//# sourceMappingURL=wrap-audio-buffer-copy-channel-methods-out-of-bounds.js.map","export const createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer = (overwriteAccessors) => {\n return (nativeAudioBufferSourceNode, nativeContext) => {\n const nullifiedBuffer = nativeContext.createBuffer(1, 1, 44100);\n if (nativeAudioBufferSourceNode.buffer === null) {\n nativeAudioBufferSourceNode.buffer = nullifiedBuffer;\n }\n overwriteAccessors(nativeAudioBufferSourceNode, 'buffer', (get) => () => {\n const value = get.call(nativeAudioBufferSourceNode);\n return value === nullifiedBuffer ? null : value;\n }, (set) => (value) => {\n return set.call(nativeAudioBufferSourceNode, value === null ? nullifiedBuffer : value);\n });\n };\n};\n//# sourceMappingURL=wrap-audio-buffer-source-node-stop-method-nullified-buffer.js.map","export const createWrapChannelMergerNode = (createInvalidStateError, monitorConnections) => {\n return (nativeContext, channelMergerNode) => {\n // Bug #15: Safari does not return the default properties.\n channelMergerNode.channelCount = 1;\n channelMergerNode.channelCountMode = 'explicit';\n // Bug #16: Safari does not throw an error when setting a different channelCount or channelCountMode.\n Object.defineProperty(channelMergerNode, 'channelCount', {\n get: () => 1,\n set: () => {\n throw createInvalidStateError();\n }\n });\n Object.defineProperty(channelMergerNode, 'channelCountMode', {\n get: () => 'explicit',\n set: () => {\n throw createInvalidStateError();\n }\n });\n // Bug #20: Safari requires a connection of any kind to treat the input signal correctly.\n const audioBufferSourceNode = nativeContext.createBufferSource();\n const whenConnected = () => {\n const length = channelMergerNode.numberOfInputs;\n for (let i = 0; i < length; i += 1) {\n audioBufferSourceNode.connect(channelMergerNode, 0, i);\n }\n };\n const whenDisconnected = () => audioBufferSourceNode.disconnect(channelMergerNode);\n monitorConnections(channelMergerNode, whenConnected, whenDisconnected);\n };\n};\n//# sourceMappingURL=wrap-channel-merger-node.js.map","export const getFirstSample = (audioBuffer, buffer, channelNumber) => {\n // Bug #5: Safari does not support copyFromChannel() and copyToChannel().\n if (audioBuffer.copyFromChannel === undefined) {\n return audioBuffer.getChannelData(channelNumber)[0];\n }\n audioBuffer.copyFromChannel(buffer, channelNumber);\n return buffer[0];\n};\n//# sourceMappingURL=get-first-sample.js.map","export const overwriteAccessors = (object, property, createGetter, createSetter) => {\n let prototype = object;\n while (!prototype.hasOwnProperty(property)) {\n prototype = Object.getPrototypeOf(prototype);\n }\n const { get, set } = Object.getOwnPropertyDescriptor(prototype, property);\n Object.defineProperty(object, property, { get: createGetter(get), set: createSetter(set) });\n};\n//# sourceMappingURL=overwrite-accessors.js.map","export const sanitizeAudioWorkletNodeOptions = (options) => {\n return {\n ...options,\n outputChannelCount: options.outputChannelCount !== undefined\n ? options.outputChannelCount\n : options.numberOfInputs === 1 && options.numberOfOutputs === 1\n ? /*\n * Bug #61: This should be the computedNumberOfChannels, but unfortunately that is almost impossible to fake. That's why\n * the channelCountMode is required to be 'explicit' as long as there is not a native implementation in every browser. That\n * makes sure the computedNumberOfChannels is equivilant to the channelCount which makes it much easier to compute.\n */\n [options.channelCount]\n : Array.from({ length: options.numberOfOutputs }, () => 1)\n };\n};\n//# sourceMappingURL=sanitize-audio-worklet-node-options.js.map","export const setValueAtTimeUntilPossible = (audioParam, value, startTime) => {\n try {\n audioParam.setValueAtTime(value, startTime);\n }\n catch (err) {\n if (err.code !== 9) {\n throw err;\n }\n setValueAtTimeUntilPossible(audioParam, value, startTime + 1e-7);\n }\n};\n//# sourceMappingURL=set-value-at-time-until-possible.js.map","export const testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport = (nativeContext) => {\n const nativeAudioBufferSourceNode = nativeContext.createBufferSource();\n nativeAudioBufferSourceNode.start();\n try {\n nativeAudioBufferSourceNode.start();\n }\n catch {\n return true;\n }\n return false;\n};\n//# sourceMappingURL=test-audio-buffer-source-node-start-method-consecutive-calls-support.js.map","export const testAudioBufferSourceNodeStartMethodOffsetClampingSupport = (nativeContext) => {\n const nativeAudioBufferSourceNode = nativeContext.createBufferSource();\n const nativeAudioBuffer = nativeContext.createBuffer(1, 1, 44100);\n nativeAudioBufferSourceNode.buffer = nativeAudioBuffer;\n try {\n nativeAudioBufferSourceNode.start(0, 1);\n }\n catch {\n return false;\n }\n return true;\n};\n//# sourceMappingURL=test-audio-buffer-source-node-start-method-offset-clamping-support.js.map","export const testAudioBufferSourceNodeStopMethodNullifiedBufferSupport = (nativeContext) => {\n const nativeAudioBufferSourceNode = nativeContext.createBufferSource();\n nativeAudioBufferSourceNode.start();\n try {\n nativeAudioBufferSourceNode.stop();\n }\n catch {\n return false;\n }\n return true;\n};\n//# sourceMappingURL=test-audio-buffer-source-node-stop-method-nullified-buffer-support.js.map","export const testAudioScheduledSourceNodeStartMethodNegativeParametersSupport = (nativeContext) => {\n const nativeAudioBufferSourceNode = nativeContext.createOscillator();\n try {\n nativeAudioBufferSourceNode.start(-1);\n }\n catch (err) {\n return err instanceof RangeError;\n }\n return false;\n};\n//# sourceMappingURL=test-audio-scheduled-source-node-start-method-negative-parameters-support.js.map","export const testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport = (nativeContext) => {\n const nativeAudioBuffer = nativeContext.createBuffer(1, 1, 44100);\n const nativeAudioBufferSourceNode = nativeContext.createBufferSource();\n nativeAudioBufferSourceNode.buffer = nativeAudioBuffer;\n nativeAudioBufferSourceNode.start();\n nativeAudioBufferSourceNode.stop();\n try {\n nativeAudioBufferSourceNode.stop();\n return true;\n }\n catch {\n return false;\n }\n};\n//# sourceMappingURL=test-audio-scheduled-source-node-stop-method-consecutive-calls-support.js.map","export const testAudioScheduledSourceNodeStopMethodNegativeParametersSupport = (nativeContext) => {\n const nativeAudioBufferSourceNode = nativeContext.createOscillator();\n try {\n nativeAudioBufferSourceNode.stop(-1);\n }\n catch (err) {\n return err instanceof RangeError;\n }\n return false;\n};\n//# sourceMappingURL=test-audio-scheduled-source-node-stop-method-negative-parameters-support.js.map","export const testAudioWorkletNodeOptionsClonability = (audioWorkletNodeOptions) => {\n const { port1, port2 } = new MessageChannel();\n try {\n // This will throw an error if the audioWorkletNodeOptions are not clonable.\n port1.postMessage(audioWorkletNodeOptions);\n }\n finally {\n port1.close();\n port2.close();\n }\n};\n//# sourceMappingURL=test-audio-worklet-node-options-clonability.js.map","export const wrapAudioBufferSourceNodeStartMethodOffsetClamping = (nativeAudioBufferSourceNode) => {\n nativeAudioBufferSourceNode.start = ((start) => {\n return (when = 0, offset = 0, duration) => {\n const buffer = nativeAudioBufferSourceNode.buffer;\n // Bug #154: Safari does not clamp the offset if it is equal to or greater than the duration of the buffer.\n const clampedOffset = buffer === null ? offset : Math.min(buffer.duration, offset);\n // Bug #155: Safari does not handle the offset correctly if it would cause the buffer to be not be played at all.\n if (buffer !== null && clampedOffset > buffer.duration - 0.5 / nativeAudioBufferSourceNode.context.sampleRate) {\n start.call(nativeAudioBufferSourceNode, when, 0, 0);\n }\n else {\n start.call(nativeAudioBufferSourceNode, when, clampedOffset, duration);\n }\n };\n })(nativeAudioBufferSourceNode.start);\n};\n//# sourceMappingURL=wrap-audio-buffer-source-node-start-method-offset-clamping.js.map","import { interceptConnections } from './intercept-connections';\nexport const wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls = (nativeAudioScheduledSourceNode, nativeContext) => {\n const nativeGainNode = nativeContext.createGain();\n nativeAudioScheduledSourceNode.connect(nativeGainNode);\n const disconnectGainNode = ((disconnect) => {\n return () => {\n // @todo TypeScript cannot infer the overloaded signature with 1 argument yet.\n disconnect.call(nativeAudioScheduledSourceNode, nativeGainNode);\n nativeAudioScheduledSourceNode.removeEventListener('ended', disconnectGainNode);\n };\n })(nativeAudioScheduledSourceNode.disconnect);\n nativeAudioScheduledSourceNode.addEventListener('ended', disconnectGainNode);\n interceptConnections(nativeAudioScheduledSourceNode, nativeGainNode);\n nativeAudioScheduledSourceNode.stop = ((stop) => {\n let isStopped = false;\n return (when = 0) => {\n if (isStopped) {\n try {\n stop.call(nativeAudioScheduledSourceNode, when);\n }\n catch {\n nativeGainNode.gain.setValueAtTime(0, when);\n }\n }\n else {\n stop.call(nativeAudioScheduledSourceNode, when);\n isStopped = true;\n }\n };\n })(nativeAudioScheduledSourceNode.stop);\n};\n//# sourceMappingURL=wrap-audio-scheduled-source-node-stop-method-consecutive-calls.js.map","export const wrapEventListener = (target, eventListener) => {\n return (event) => {\n const descriptor = { value: target };\n Object.defineProperties(event, {\n currentTarget: descriptor,\n target: descriptor\n });\n if (typeof eventListener === 'function') {\n return eventListener.call(target, event);\n }\n return eventListener.handleEvent.call(target, event);\n };\n};\n//# sourceMappingURL=wrap-event-listener.js.map","import { createCancelAndHoldAutomationEvent, createCancelScheduledValuesAutomationEvent, createExponentialRampToValueAutomationEvent, createLinearRampToValueAutomationEvent, createSetTargetAutomationEvent, createSetValueAutomationEvent, createSetValueCurveAutomationEvent } from 'automation-events';\nimport { createAbortError } from './factories/abort-error';\nimport { createAddActiveInputConnectionToAudioNode } from './factories/add-active-input-connection-to-audio-node';\nimport { createAddAudioNodeConnections } from './factories/add-audio-node-connections';\nimport { createAddAudioParamConnections } from './factories/add-audio-param-connections';\nimport { createAddAudioWorkletModule } from './factories/add-audio-worklet-module';\nimport { createAddConnectionToAudioNode } from './factories/add-connection-to-audio-node';\nimport { createAddPassiveInputConnectionToAudioNode } from './factories/add-passive-input-connection-to-audio-node';\nimport { createAddSilentConnection } from './factories/add-silent-connection';\nimport { createAddUnrenderedAudioWorkletNode } from './factories/add-unrendered-audio-worklet-node';\nimport { createAnalyserNodeConstructor } from './factories/analyser-node-constructor';\nimport { createAnalyserNodeRendererFactory } from './factories/analyser-node-renderer-factory';\nimport { createAudioBufferConstructor } from './factories/audio-buffer-constructor';\nimport { createAudioBufferSourceNodeConstructor } from './factories/audio-buffer-source-node-constructor';\nimport { createAudioBufferSourceNodeRendererFactory } from './factories/audio-buffer-source-node-renderer-factory';\nimport { createAudioContextConstructor } from './factories/audio-context-constructor';\nimport { createAudioDestinationNodeConstructor } from './factories/audio-destination-node-constructor';\nimport { createAudioDestinationNodeRenderer } from './factories/audio-destination-node-renderer-factory';\nimport { createAudioListenerFactory } from './factories/audio-listener-factory';\nimport { createAudioNodeConstructor } from './factories/audio-node-constructor';\nimport { createAudioParamFactory } from './factories/audio-param-factory';\nimport { createAudioParamRenderer } from './factories/audio-param-renderer';\nimport { createAudioWorkletNodeConstructor } from './factories/audio-worklet-node-constructor';\nimport { createAudioWorkletNodeRendererFactory } from './factories/audio-worklet-node-renderer-factory';\nimport { createBaseAudioContextConstructor } from './factories/base-audio-context-constructor';\nimport { createBiquadFilterNodeConstructor } from './factories/biquad-filter-node-constructor';\nimport { createBiquadFilterNodeRendererFactory } from './factories/biquad-filter-node-renderer-factory';\nimport { createCacheTestResult } from './factories/cache-test-result';\nimport { createChannelMergerNodeConstructor } from './factories/channel-merger-node-constructor';\nimport { createChannelMergerNodeRendererFactory } from './factories/channel-merger-node-renderer-factory';\nimport { createChannelSplitterNodeConstructor } from './factories/channel-splitter-node-constructor';\nimport { createChannelSplitterNodeRendererFactory } from './factories/channel-splitter-node-renderer-factory';\nimport { createConnectAudioParam } from './factories/connect-audio-param';\nimport { createConnectMultipleOutputs } from './factories/connect-multiple-outputs';\nimport { createConnectedNativeAudioBufferSourceNodeFactory } from './factories/connected-native-audio-buffer-source-node-factory';\nimport { createConstantSourceNodeConstructor } from './factories/constant-source-node-constructor';\nimport { createConstantSourceNodeRendererFactory } from './factories/constant-source-node-renderer-factory';\nimport { createConvertNumberToUnsignedLong } from './factories/convert-number-to-unsigned-long';\nimport { createConvolverNodeConstructor } from './factories/convolver-node-constructor';\nimport { createConvolverNodeRendererFactory } from './factories/convolver-node-renderer-factory';\nimport { createCreateNativeOfflineAudioContext } from './factories/create-native-offline-audio-context';\nimport { createDataCloneError } from './factories/data-clone-error';\nimport { createDecodeAudioData } from './factories/decode-audio-data';\nimport { createDecrementCycleCounter } from './factories/decrement-cycle-counter';\nimport { createDelayNodeConstructor } from './factories/delay-node-constructor';\nimport { createDelayNodeRendererFactory } from './factories/delay-node-renderer-factory';\nimport { createDeleteActiveInputConnectionToAudioNode } from './factories/delete-active-input-connection-to-audio-node';\nimport { createDeleteUnrenderedAudioWorkletNode } from './factories/delete-unrendered-audio-worklet-node';\nimport { createDetectCycles } from './factories/detect-cycles';\nimport { createDisconnectMultipleOutputs } from './factories/disconnect-multiple-outputs';\nimport { createDynamicsCompressorNodeConstructor } from './factories/dynamics-compressor-node-constructor';\nimport { createDynamicsCompressorNodeRendererFactory } from './factories/dynamics-compressor-node-renderer-factory';\nimport { createEncodingError } from './factories/encoding-error';\nimport { createEvaluateSource } from './factories/evaluate-source';\nimport { createEventTargetConstructor } from './factories/event-target-constructor';\nimport { createExposeCurrentFrameAndCurrentTime } from './factories/expose-current-frame-and-current-time';\nimport { createFetchSource } from './factories/fetch-source';\nimport { createGainNodeConstructor } from './factories/gain-node-constructor';\nimport { createGainNodeRendererFactory } from './factories/gain-node-renderer-factory';\nimport { createGetActiveAudioWorkletNodeInputs } from './factories/get-active-audio-worklet-node-inputs';\nimport { createGetAudioNodeRenderer } from './factories/get-audio-node-renderer';\nimport { createGetAudioNodeTailTime } from './factories/get-audio-node-tail-time';\nimport { createGetAudioParamRenderer } from './factories/get-audio-param-renderer';\nimport { createGetBackupOfflineAudioContext } from './factories/get-backup-offline-audio-context';\nimport { createGetNativeContext } from './factories/get-native-context';\nimport { createGetOrCreateBackupOfflineAudioContext } from './factories/get-or-create-backup-offline-audio-context';\nimport { createGetUnrenderedAudioWorkletNodes } from './factories/get-unrendered-audio-worklet-nodes';\nimport { createIIRFilterNodeConstructor } from './factories/iir-filter-node-constructor';\nimport { createIIRFilterNodeRendererFactory } from './factories/iir-filter-node-renderer-factory';\nimport { createIncrementCycleCounterFactory } from './factories/increment-cycle-counter-factory';\nimport { createIndexSizeError } from './factories/index-size-error';\nimport { createInvalidAccessError } from './factories/invalid-access-error';\nimport { createInvalidStateError } from './factories/invalid-state-error';\nimport { createIsAnyAudioContext } from './factories/is-any-audio-context';\nimport { createIsAnyAudioNode } from './factories/is-any-audio-node';\nimport { createIsAnyAudioParam } from './factories/is-any-audio-param';\nimport { createIsAnyOfflineAudioContext } from './factories/is-any-offline-audio-context';\nimport { createIsNativeAudioContext } from './factories/is-native-audio-context';\nimport { createIsNativeAudioNode } from './factories/is-native-audio-node';\nimport { createIsNativeAudioParam } from './factories/is-native-audio-param';\nimport { createIsNativeContext } from './factories/is-native-context';\nimport { createIsNativeOfflineAudioContext } from './factories/is-native-offline-audio-context';\nimport { createIsSecureContext } from './factories/is-secure-context';\nimport { createIsSupportedPromise } from './factories/is-supported-promise';\nimport { createMediaElementAudioSourceNodeConstructor } from './factories/media-element-audio-source-node-constructor';\nimport { createMediaStreamAudioDestinationNodeConstructor } from './factories/media-stream-audio-destination-node-constructor';\nimport { createMediaStreamAudioSourceNodeConstructor } from './factories/media-stream-audio-source-node-constructor';\nimport { createMediaStreamTrackAudioSourceNodeConstructor } from './factories/media-stream-track-audio-source-node-constructor';\nimport { createMinimalAudioContextConstructor } from './factories/minimal-audio-context-constructor';\nimport { createMinimalBaseAudioContextConstructor } from './factories/minimal-base-audio-context-constructor';\nimport { createMinimalOfflineAudioContextConstructor } from './factories/minimal-offline-audio-context-constructor';\nimport { createMonitorConnections } from './factories/monitor-connections';\nimport { createNativeAnalyserNodeFactory } from './factories/native-analyser-node-factory';\nimport { createNativeAudioBufferConstructor } from './factories/native-audio-buffer-constructor';\nimport { createNativeAudioBufferSourceNodeFactory } from './factories/native-audio-buffer-source-node-factory';\nimport { createNativeAudioContextConstructor } from './factories/native-audio-context-constructor';\nimport { createNativeAudioDestinationNodeFactory } from './factories/native-audio-destination-node';\nimport { createNativeAudioWorkletNodeConstructor } from './factories/native-audio-worklet-node-constructor';\nimport { createNativeAudioWorkletNodeFactory } from './factories/native-audio-worklet-node-factory';\nimport { createNativeAudioWorkletNodeFakerFactory } from './factories/native-audio-worklet-node-faker-factory';\nimport { createNativeBiquadFilterNode } from './factories/native-biquad-filter-node';\nimport { createNativeChannelMergerNodeFactory } from './factories/native-channel-merger-node-factory';\nimport { createNativeChannelSplitterNode } from './factories/native-channel-splitter-node';\nimport { createNativeConstantSourceNodeFactory } from './factories/native-constant-source-node-factory';\nimport { createNativeConstantSourceNodeFakerFactory } from './factories/native-constant-source-node-faker-factory';\nimport { createNativeConvolverNodeFactory } from './factories/native-convolver-node-factory';\nimport { createNativeDelayNode } from './factories/native-delay-node';\nimport { createNativeDynamicsCompressorNodeFactory } from './factories/native-dynamics-compressor-node-factory';\nimport { createNativeGainNode } from './factories/native-gain-node';\nimport { createNativeIIRFilterNodeFactory } from './factories/native-iir-filter-node-factory';\nimport { createNativeIIRFilterNodeFakerFactory } from './factories/native-iir-filter-node-faker-factory';\nimport { createNativeMediaElementAudioSourceNode } from './factories/native-media-element-audio-source-node';\nimport { createNativeMediaStreamAudioDestinationNode } from './factories/native-media-stream-audio-destination-node';\nimport { createNativeMediaStreamAudioSourceNode } from './factories/native-media-stream-audio-source-node';\nimport { createNativeMediaStreamTrackAudioSourceNodeFactory } from './factories/native-media-stream-track-audio-source-node-factory';\nimport { createNativeOfflineAudioContextConstructor } from './factories/native-offline-audio-context-constructor';\nimport { createNativeOscillatorNodeFactory } from './factories/native-oscillator-node-factory';\nimport { createNativePannerNodeFactory } from './factories/native-panner-node-factory';\nimport { createNativePannerNodeFakerFactory } from './factories/native-panner-node-faker-factory';\nimport { createNativePeriodicWaveFactory } from './factories/native-periodic-wave-factory';\nimport { createNativeScriptProcessorNode } from './factories/native-script-processor-node';\nimport { createNativeStereoPannerNodeFactory } from './factories/native-stereo-panner-node-factory';\nimport { createNativeStereoPannerNodeFakerFactory } from './factories/native-stereo-panner-node-faker-factory';\nimport { createNativeWaveShaperNodeFactory } from './factories/native-wave-shaper-node-factory';\nimport { createNativeWaveShaperNodeFakerFactory } from './factories/native-wave-shaper-node-faker-factory';\nimport { createNotSupportedError } from './factories/not-supported-error';\nimport { createOfflineAudioContextConstructor } from './factories/offline-audio-context-constructor';\nimport { createOscillatorNodeConstructor } from './factories/oscillator-node-constructor';\nimport { createOscillatorNodeRendererFactory } from './factories/oscillator-node-renderer-factory';\nimport { createPannerNodeConstructor } from './factories/panner-node-constructor';\nimport { createPannerNodeRendererFactory } from './factories/panner-node-renderer-factory';\nimport { createPeriodicWaveConstructor } from './factories/periodic-wave-constructor';\nimport { createRenderAutomation } from './factories/render-automation';\nimport { createRenderInputsOfAudioNode } from './factories/render-inputs-of-audio-node';\nimport { createRenderInputsOfAudioParam } from './factories/render-inputs-of-audio-param';\nimport { createRenderNativeOfflineAudioContext } from './factories/render-native-offline-audio-context';\nimport { createSetActiveAudioWorkletNodeInputs } from './factories/set-active-audio-worklet-node-inputs';\nimport { createSetAudioNodeTailTime } from './factories/set-audio-node-tail-time';\nimport { createStartRendering } from './factories/start-rendering';\nimport { createStereoPannerNodeConstructor } from './factories/stereo-panner-node-constructor';\nimport { createStereoPannerNodeRendererFactory } from './factories/stereo-panner-node-renderer-factory';\nimport { createTestAudioBufferConstructorSupport } from './factories/test-audio-buffer-constructor-support';\nimport { createTestAudioBufferCopyChannelMethodsSubarraySupport } from './factories/test-audio-buffer-copy-channel-methods-subarray-support';\nimport { createTestAudioContextCloseMethodSupport } from './factories/test-audio-context-close-method-support';\nimport { createTestAudioContextDecodeAudioDataMethodTypeErrorSupport } from './factories/test-audio-context-decode-audio-data-method-type-error-support';\nimport { createTestAudioContextOptionsSupport } from './factories/test-audio-context-options-support';\nimport { createTestAudioNodeConnectMethodSupport } from './factories/test-audio-node-connect-method-support';\nimport { createTestAudioWorkletProcessorNoOutputsSupport } from './factories/test-audio-worklet-processor-no-outputs-support';\nimport { createTestAudioWorkletProcessorPostMessageSupport } from './factories/test-audio-worklet-processor-post-message-support';\nimport { createTestChannelMergerNodeChannelCountSupport } from './factories/test-channel-merger-node-channel-count-support';\nimport { createTestConstantSourceNodeAccurateSchedulingSupport } from './factories/test-constant-source-node-accurate-scheduling-support';\nimport { createTestConvolverNodeBufferReassignabilitySupport } from './factories/test-convolver-node-buffer-reassignability-support';\nimport { createTestConvolverNodeChannelCountSupport } from './factories/test-convolver-node-channel-count-support';\nimport { createTestIsSecureContextSupport } from './factories/test-is-secure-context-support';\nimport { createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport } from './factories/test-media-stream-audio-source-node-media-stream-without-audio-track-support';\nimport { createTestOfflineAudioContextCurrentTimeSupport } from './factories/test-offline-audio-context-current-time-support';\nimport { createTestStereoPannerNodeDefaultValueSupport } from './factories/test-stereo-panner-node-default-value-support';\nimport { createUnknownError } from './factories/unknown-error';\nimport { createWaveShaperNodeConstructor } from './factories/wave-shaper-node-constructor';\nimport { createWaveShaperNodeRendererFactory } from './factories/wave-shaper-node-renderer-factory';\nimport { createWindow } from './factories/window';\nimport { createWrapAudioBufferCopyChannelMethods } from './factories/wrap-audio-buffer-copy-channel-methods';\nimport { createWrapAudioBufferCopyChannelMethodsOutOfBounds } from './factories/wrap-audio-buffer-copy-channel-methods-out-of-bounds';\nimport { createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer } from './factories/wrap-audio-buffer-source-node-stop-method-nullified-buffer';\nimport { createWrapChannelMergerNode } from './factories/wrap-channel-merger-node';\nimport { AUDIO_NODE_CONNECTIONS_STORE, AUDIO_NODE_STORE, AUDIO_PARAM_CONNECTIONS_STORE, AUDIO_PARAM_STORE, CONTEXT_STORE, CYCLE_COUNTERS } from './globals';\nimport { connectNativeAudioNodeToNativeAudioNode } from './helpers/connect-native-audio-node-to-native-audio-node';\nimport { disconnectNativeAudioNodeFromNativeAudioNode } from './helpers/disconnect-native-audio-node-from-native-audio-node';\nimport { getAudioNodeConnections } from './helpers/get-audio-node-connections';\nimport { getAudioParamConnections } from './helpers/get-audio-param-connections';\nimport { getEventListenersOfAudioNode } from './helpers/get-event-listeners-of-audio-node';\nimport { getFirstSample } from './helpers/get-first-sample';\nimport { getNativeAudioNode } from './helpers/get-native-audio-node';\nimport { getNativeAudioParam } from './helpers/get-native-audio-param';\nimport { getValueForKey } from './helpers/get-value-for-key';\nimport { insertElementInSet } from './helpers/insert-element-in-set';\nimport { isActiveAudioNode } from './helpers/is-active-audio-node';\nimport { isDCCurve } from './helpers/is-dc-curve';\nimport { isPartOfACycle } from './helpers/is-part-of-a-cycle';\nimport { isPassiveAudioNode } from './helpers/is-passive-audio-node';\nimport { overwriteAccessors } from './helpers/overwrite-accessors';\nimport { pickElementFromSet } from './helpers/pick-element-from-set';\nimport { sanitizeAudioWorkletNodeOptions } from './helpers/sanitize-audio-worklet-node-options';\nimport { sanitizeChannelSplitterOptions } from './helpers/sanitize-channel-splitter-options';\nimport { sanitizePeriodicWaveOptions } from './helpers/sanitize-periodic-wave-options';\nimport { setValueAtTimeUntilPossible } from './helpers/set-value-at-time-until-possible';\nimport { testAudioBufferCopyChannelMethodsOutOfBoundsSupport } from './helpers/test-audio-buffer-copy-channel-methods-out-of-bounds-support';\nimport { testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport } from './helpers/test-audio-buffer-source-node-start-method-consecutive-calls-support';\nimport { testAudioBufferSourceNodeStartMethodOffsetClampingSupport } from './helpers/test-audio-buffer-source-node-start-method-offset-clamping-support';\nimport { testAudioBufferSourceNodeStopMethodNullifiedBufferSupport } from './helpers/test-audio-buffer-source-node-stop-method-nullified-buffer-support';\nimport { testAudioScheduledSourceNodeStartMethodNegativeParametersSupport } from './helpers/test-audio-scheduled-source-node-start-method-negative-parameters-support';\nimport { testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport } from './helpers/test-audio-scheduled-source-node-stop-method-consecutive-calls-support';\nimport { testAudioScheduledSourceNodeStopMethodNegativeParametersSupport } from './helpers/test-audio-scheduled-source-node-stop-method-negative-parameters-support';\nimport { testAudioWorkletNodeOptionsClonability } from './helpers/test-audio-worklet-node-options-clonability';\nimport { testDomExceptionConstructorSupport } from './helpers/test-dom-exception-constructor-support';\nimport { testPromiseSupport } from './helpers/test-promise-support';\nimport { testTransferablesSupport } from './helpers/test-transferables-support';\nimport { wrapAudioBufferSourceNodeStartMethodOffsetClamping } from './helpers/wrap-audio-buffer-source-node-start-method-offset-clamping';\nimport { wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls } from './helpers/wrap-audio-scheduled-source-node-stop-method-consecutive-calls';\nimport { wrapEventListener } from './helpers/wrap-event-listener';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst addActiveInputConnectionToAudioNode = createAddActiveInputConnectionToAudioNode(insertElementInSet);\nconst addPassiveInputConnectionToAudioNode = createAddPassiveInputConnectionToAudioNode(insertElementInSet);\nconst deleteActiveInputConnectionToAudioNode = createDeleteActiveInputConnectionToAudioNode(pickElementFromSet);\nconst audioNodeTailTimeStore = new WeakMap();\nconst getAudioNodeTailTime = createGetAudioNodeTailTime(audioNodeTailTimeStore);\nconst cacheTestResult = createCacheTestResult(new Map(), new WeakMap());\nconst window = createWindow();\nconst createNativeAnalyserNode = createNativeAnalyserNodeFactory(cacheTestResult, createIndexSizeError);\nconst getAudioNodeRenderer = createGetAudioNodeRenderer(getAudioNodeConnections);\nconst renderInputsOfAudioNode = createRenderInputsOfAudioNode(getAudioNodeConnections, getAudioNodeRenderer, isPartOfACycle);\nconst createAnalyserNodeRenderer = createAnalyserNodeRendererFactory(createNativeAnalyserNode, getNativeAudioNode, renderInputsOfAudioNode);\nconst getNativeContext = createGetNativeContext(CONTEXT_STORE);\nconst nativeOfflineAudioContextConstructor = createNativeOfflineAudioContextConstructor(window);\nconst isNativeOfflineAudioContext = createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor);\nconst audioParamAudioNodeStore = new WeakMap();\nconst eventTargetConstructor = createEventTargetConstructor(wrapEventListener);\nconst nativeAudioContextConstructor = createNativeAudioContextConstructor(window);\nconst isNativeAudioContext = createIsNativeAudioContext(nativeAudioContextConstructor);\nconst isNativeAudioNode = createIsNativeAudioNode(window);\nconst isNativeAudioParam = createIsNativeAudioParam(window);\nconst nativeAudioWorkletNodeConstructor = createNativeAudioWorkletNodeConstructor(window);\nconst audioNodeConstructor = createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE), createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode, addPassiveInputConnectionToAudioNode, connectNativeAudioNodeToNativeAudioNode, deleteActiveInputConnectionToAudioNode, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getAudioNodeTailTime, getEventListenersOfAudioNode, getNativeAudioNode, insertElementInSet, isActiveAudioNode, isPartOfACycle, isPassiveAudioNode), cacheTestResult, createIncrementCycleCounterFactory(CYCLE_COUNTERS, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, isActiveAudioNode), createIndexSizeError, createInvalidAccessError, createNotSupportedError, createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode, CYCLE_COUNTERS, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, getNativeContext, isActiveAudioNode, isNativeOfflineAudioContext), createDetectCycles(audioParamAudioNodeStore, getAudioNodeConnections, getValueForKey), eventTargetConstructor, getNativeContext, isNativeAudioContext, isNativeAudioNode, isNativeAudioParam, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor);\nconst analyserNodeConstructor = createAnalyserNodeConstructor(audioNodeConstructor, createAnalyserNodeRenderer, createIndexSizeError, createNativeAnalyserNode, getNativeContext, isNativeOfflineAudioContext);\nexport { analyserNodeConstructor as AnalyserNode };\nconst audioBufferStore = new WeakSet();\nconst nativeAudioBufferConstructor = createNativeAudioBufferConstructor(window);\nconst convertNumberToUnsignedLong = createConvertNumberToUnsignedLong(new Uint32Array(1));\nconst wrapAudioBufferCopyChannelMethods = createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong, createIndexSizeError);\nconst wrapAudioBufferCopyChannelMethodsOutOfBounds = createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong);\nconst audioBufferConstructor = createAudioBufferConstructor(audioBufferStore, cacheTestResult, createNotSupportedError, nativeAudioBufferConstructor, nativeOfflineAudioContextConstructor, createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor), wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds);\nexport { audioBufferConstructor as AudioBuffer };\nconst addSilentConnection = createAddSilentConnection(createNativeGainNode);\nconst renderInputsOfAudioParam = createRenderInputsOfAudioParam(getAudioNodeRenderer, getAudioParamConnections, isPartOfACycle);\nconst connectAudioParam = createConnectAudioParam(renderInputsOfAudioParam);\nconst createNativeAudioBufferSourceNode = createNativeAudioBufferSourceNodeFactory(addSilentConnection, cacheTestResult, testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, testAudioBufferSourceNodeStartMethodOffsetClampingSupport, testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioBufferSourceNodeStartMethodOffsetClamping, createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors), wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls);\nconst renderAutomation = createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections), renderInputsOfAudioParam);\nconst createAudioBufferSourceNodeRenderer = createAudioBufferSourceNodeRendererFactory(connectAudioParam, createNativeAudioBufferSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst createAudioParam = createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE), audioParamAudioNodeStore, AUDIO_PARAM_STORE, createAudioParamRenderer, createCancelAndHoldAutomationEvent, createCancelScheduledValuesAutomationEvent, createExponentialRampToValueAutomationEvent, createLinearRampToValueAutomationEvent, createSetTargetAutomationEvent, createSetValueAutomationEvent, createSetValueCurveAutomationEvent, nativeAudioContextConstructor, setValueAtTimeUntilPossible);\nconst audioBufferSourceNodeConstructor = createAudioBufferSourceNodeConstructor(audioNodeConstructor, createAudioBufferSourceNodeRenderer, createAudioParam, createInvalidStateError, createNativeAudioBufferSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener);\nexport { audioBufferSourceNodeConstructor as AudioBufferSourceNode };\nconst audioDestinationNodeConstructor = createAudioDestinationNodeConstructor(audioNodeConstructor, createAudioDestinationNodeRenderer, createIndexSizeError, createInvalidStateError, createNativeAudioDestinationNodeFactory(createNativeGainNode, overwriteAccessors), getNativeContext, isNativeOfflineAudioContext, renderInputsOfAudioNode);\nconst createBiquadFilterNodeRenderer = createBiquadFilterNodeRendererFactory(connectAudioParam, createNativeBiquadFilterNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst setAudioNodeTailTime = createSetAudioNodeTailTime(audioNodeTailTimeStore);\nconst biquadFilterNodeConstructor = createBiquadFilterNodeConstructor(audioNodeConstructor, createAudioParam, createBiquadFilterNodeRenderer, createInvalidAccessError, createNativeBiquadFilterNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst monitorConnections = createMonitorConnections(insertElementInSet, isNativeAudioNode);\nconst wrapChannelMergerNode = createWrapChannelMergerNode(createInvalidStateError, monitorConnections);\nconst createNativeChannelMergerNode = createNativeChannelMergerNodeFactory(nativeAudioContextConstructor, wrapChannelMergerNode);\nconst createChannelMergerNodeRenderer = createChannelMergerNodeRendererFactory(createNativeChannelMergerNode, getNativeAudioNode, renderInputsOfAudioNode);\nconst channelMergerNodeConstructor = createChannelMergerNodeConstructor(audioNodeConstructor, createChannelMergerNodeRenderer, createNativeChannelMergerNode, getNativeContext, isNativeOfflineAudioContext);\nconst createChannelSplitterNodeRenderer = createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode, getNativeAudioNode, renderInputsOfAudioNode);\nconst channelSplitterNodeConstructor = createChannelSplitterNodeConstructor(audioNodeConstructor, createChannelSplitterNodeRenderer, createNativeChannelSplitterNode, getNativeContext, isNativeOfflineAudioContext, sanitizeChannelSplitterOptions);\nconst createNativeConstantSourceNodeFaker = createNativeConstantSourceNodeFakerFactory(addSilentConnection, createNativeAudioBufferSourceNode, createNativeGainNode, monitorConnections);\nconst createNativeConstantSourceNode = createNativeConstantSourceNodeFactory(addSilentConnection, cacheTestResult, createNativeConstantSourceNodeFaker, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport);\nconst createConstantSourceNodeRenderer = createConstantSourceNodeRendererFactory(connectAudioParam, createNativeConstantSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst constantSourceNodeConstructor = createConstantSourceNodeConstructor(audioNodeConstructor, createAudioParam, createConstantSourceNodeRenderer, createNativeConstantSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener);\nconst createNativeConvolverNode = createNativeConvolverNodeFactory(createNotSupportedError, overwriteAccessors);\nconst createConvolverNodeRenderer = createConvolverNodeRendererFactory(createNativeConvolverNode, getNativeAudioNode, renderInputsOfAudioNode);\nconst convolverNodeConstructor = createConvolverNodeConstructor(audioNodeConstructor, createConvolverNodeRenderer, createNativeConvolverNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst createDelayNodeRenderer = createDelayNodeRendererFactory(connectAudioParam, createNativeDelayNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst delayNodeConstructor = createDelayNodeConstructor(audioNodeConstructor, createAudioParam, createDelayNodeRenderer, createNativeDelayNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst createNativeDynamicsCompressorNode = createNativeDynamicsCompressorNodeFactory(createNotSupportedError);\nconst createDynamicsCompressorNodeRenderer = createDynamicsCompressorNodeRendererFactory(connectAudioParam, createNativeDynamicsCompressorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst dynamicsCompressorNodeConstructor = createDynamicsCompressorNodeConstructor(audioNodeConstructor, createAudioParam, createDynamicsCompressorNodeRenderer, createNativeDynamicsCompressorNode, createNotSupportedError, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst createGainNodeRenderer = createGainNodeRendererFactory(connectAudioParam, createNativeGainNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst gainNodeConstructor = createGainNodeConstructor(audioNodeConstructor, createAudioParam, createGainNodeRenderer, createNativeGainNode, getNativeContext, isNativeOfflineAudioContext);\nconst createNativeIIRFilterNodeFaker = createNativeIIRFilterNodeFakerFactory(createInvalidAccessError, createInvalidStateError, createNativeScriptProcessorNode, createNotSupportedError);\nconst renderNativeOfflineAudioContext = createRenderNativeOfflineAudioContext(cacheTestResult, createNativeGainNode, createNativeScriptProcessorNode, createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode, nativeOfflineAudioContextConstructor));\nconst createIIRFilterNodeRenderer = createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderInputsOfAudioNode, renderNativeOfflineAudioContext);\nconst createNativeIIRFilterNode = createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker);\nconst iIRFilterNodeConstructor = createIIRFilterNodeConstructor(audioNodeConstructor, createNativeIIRFilterNode, createIIRFilterNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst createAudioListener = createAudioListenerFactory(createAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeScriptProcessorNode, createNotSupportedError, getFirstSample, isNativeOfflineAudioContext, overwriteAccessors);\nconst unrenderedAudioWorkletNodeStore = new WeakMap();\nconst minimalBaseAudioContextConstructor = createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor, createAudioListener, eventTargetConstructor, isNativeOfflineAudioContext, unrenderedAudioWorkletNodeStore, wrapEventListener);\nconst createNativeOscillatorNode = createNativeOscillatorNodeFactory(addSilentConnection, cacheTestResult, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls);\nconst createOscillatorNodeRenderer = createOscillatorNodeRendererFactory(connectAudioParam, createNativeOscillatorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst oscillatorNodeConstructor = createOscillatorNodeConstructor(audioNodeConstructor, createAudioParam, createNativeOscillatorNode, createOscillatorNodeRenderer, getNativeContext, isNativeOfflineAudioContext, wrapEventListener);\nconst createConnectedNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode);\nconst createNativeWaveShaperNodeFaker = createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeGainNode, isDCCurve, monitorConnections);\nconst createNativeWaveShaperNode = createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeWaveShaperNodeFaker, isDCCurve, monitorConnections, nativeAudioContextConstructor, overwriteAccessors);\nconst createNativePannerNodeFaker = createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode, createInvalidStateError, createNativeChannelMergerNode, createNativeGainNode, createNativeScriptProcessorNode, createNativeWaveShaperNode, createNotSupportedError, disconnectNativeAudioNodeFromNativeAudioNode, getFirstSample, monitorConnections);\nconst createNativePannerNode = createNativePannerNodeFactory(createNativePannerNodeFaker);\nconst createPannerNodeRenderer = createPannerNodeRendererFactory(connectAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeGainNode, createNativePannerNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext);\nconst pannerNodeConstructor = createPannerNodeConstructor(audioNodeConstructor, createAudioParam, createNativePannerNode, createPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst createNativePeriodicWave = createNativePeriodicWaveFactory(createIndexSizeError);\nconst periodicWaveConstructor = createPeriodicWaveConstructor(createNativePeriodicWave, getNativeContext, new WeakSet(), sanitizePeriodicWaveOptions);\nconst nativeStereoPannerNodeFakerFactory = createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeGainNode, createNativeWaveShaperNode, createNotSupportedError, monitorConnections);\nconst createNativeStereoPannerNode = createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory, createNotSupportedError);\nconst createStereoPannerNodeRenderer = createStereoPannerNodeRendererFactory(connectAudioParam, createNativeStereoPannerNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode);\nconst stereoPannerNodeConstructor = createStereoPannerNodeConstructor(audioNodeConstructor, createAudioParam, createNativeStereoPannerNode, createStereoPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext);\nconst createWaveShaperNodeRenderer = createWaveShaperNodeRendererFactory(createNativeWaveShaperNode, getNativeAudioNode, renderInputsOfAudioNode);\nconst waveShaperNodeConstructor = createWaveShaperNodeConstructor(audioNodeConstructor, createInvalidStateError, createNativeWaveShaperNode, createWaveShaperNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime);\nconst isSecureContext = createIsSecureContext(window);\nconst exposeCurrentFrameAndCurrentTime = createExposeCurrentFrameAndCurrentTime(window);\nconst backupOfflineAudioContextStore = new WeakMap();\nconst getOrCreateBackupOfflineAudioContext = createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore, nativeOfflineAudioContextConstructor);\n// The addAudioWorkletModule() function is only available in a SecureContext.\nexport const addAudioWorkletModule = isSecureContext\n ? createAddAudioWorkletModule(cacheTestResult, createNotSupportedError, createEvaluateSource(window), exposeCurrentFrameAndCurrentTime, createFetchSource(createAbortError), getNativeContext, getOrCreateBackupOfflineAudioContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, new WeakMap(), new WeakMap(), createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor), \n // @todo window is guaranteed to be defined because isSecureContext checks that as well.\n window)\n : undefined;\nconst isNativeContext = createIsNativeContext(isNativeAudioContext, isNativeOfflineAudioContext);\nexport const decodeAudioData = createDecodeAudioData(audioBufferStore, cacheTestResult, createDataCloneError, createEncodingError, new WeakSet(), getNativeContext, isNativeContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, testPromiseSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds);\nconst baseAudioContextConstructor = createBaseAudioContextConstructor(addAudioWorkletModule, analyserNodeConstructor, audioBufferConstructor, audioBufferSourceNodeConstructor, biquadFilterNodeConstructor, channelMergerNodeConstructor, channelSplitterNodeConstructor, constantSourceNodeConstructor, convolverNodeConstructor, decodeAudioData, delayNodeConstructor, dynamicsCompressorNodeConstructor, gainNodeConstructor, iIRFilterNodeConstructor, minimalBaseAudioContextConstructor, oscillatorNodeConstructor, pannerNodeConstructor, periodicWaveConstructor, stereoPannerNodeConstructor, waveShaperNodeConstructor);\nconst mediaElementAudioSourceNodeConstructor = createMediaElementAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaElementAudioSourceNode, getNativeContext, isNativeOfflineAudioContext);\nconst mediaStreamAudioDestinationNodeConstructor = createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor, createNativeMediaStreamAudioDestinationNode, getNativeContext, isNativeOfflineAudioContext);\nconst mediaStreamAudioSourceNodeConstructor = createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaStreamAudioSourceNode, getNativeContext, isNativeOfflineAudioContext);\nconst createNativeMediaStreamTrackAudioSourceNode = createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError, isNativeOfflineAudioContext);\nconst mediaStreamTrackAudioSourceNodeConstructor = createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaStreamTrackAudioSourceNode, getNativeContext);\nconst audioContextConstructor = createAudioContextConstructor(baseAudioContextConstructor, createInvalidStateError, createNotSupportedError, createUnknownError, mediaElementAudioSourceNodeConstructor, mediaStreamAudioDestinationNodeConstructor, mediaStreamAudioSourceNodeConstructor, mediaStreamTrackAudioSourceNodeConstructor, nativeAudioContextConstructor);\nexport { audioContextConstructor as AudioContext };\nconst getUnrenderedAudioWorkletNodes = createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore);\nconst addUnrenderedAudioWorkletNode = createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes);\nconst connectMultipleOutputs = createConnectMultipleOutputs(createIndexSizeError);\nconst deleteUnrenderedAudioWorkletNode = createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes);\nconst disconnectMultipleOutputs = createDisconnectMultipleOutputs(createIndexSizeError);\nconst activeAudioWorkletNodeInputsStore = new WeakMap();\nconst getActiveAudioWorkletNodeInputs = createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore, getValueForKey);\nconst createNativeAudioWorkletNodeFaker = createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs, createIndexSizeError, createInvalidStateError, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, createNativeScriptProcessorNode, createNotSupportedError, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getActiveAudioWorkletNodeInputs, monitorConnections);\nconst createNativeAudioWorkletNode = createNativeAudioWorkletNodeFactory(createInvalidStateError, createNativeAudioWorkletNodeFaker, createNativeGainNode, createNotSupportedError, monitorConnections);\nconst createAudioWorkletNodeRenderer = createAudioWorkletNodeRendererFactory(connectAudioParam, connectMultipleOutputs, createNativeAudioBufferSourceNode, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, deleteUnrenderedAudioWorkletNode, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getNativeAudioNode, nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext);\nconst getBackupOfflineAudioContext = createGetBackupOfflineAudioContext(backupOfflineAudioContextStore);\nconst setActiveAudioWorkletNodeInputs = createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore);\n// The AudioWorkletNode constructor is only available in a SecureContext.\nconst audioWorkletNodeConstructor = isSecureContext\n ? createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode, audioNodeConstructor, createAudioParam, createAudioWorkletNodeRenderer, createNativeAudioWorkletNode, getAudioNodeConnections, getBackupOfflineAudioContext, getNativeContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, sanitizeAudioWorkletNodeOptions, setActiveAudioWorkletNodeInputs, testAudioWorkletNodeOptionsClonability, wrapEventListener)\n : undefined;\nexport { audioWorkletNodeConstructor as AudioWorkletNode };\nexport { biquadFilterNodeConstructor as BiquadFilterNode };\nexport { channelMergerNodeConstructor as ChannelMergerNode };\nexport { channelSplitterNodeConstructor as ChannelSplitterNode };\nexport { convolverNodeConstructor as ConvolverNode };\nexport { constantSourceNodeConstructor as ConstantSourceNode };\nexport { delayNodeConstructor as DelayNode };\nexport { dynamicsCompressorNodeConstructor as DynamicsCompressorNode };\nexport { gainNodeConstructor as GainNode };\nexport { iIRFilterNodeConstructor as IIRFilterNode };\nexport { mediaElementAudioSourceNodeConstructor as MediaElementAudioSourceNode };\nexport { mediaStreamAudioDestinationNodeConstructor as MediaStreamAudioDestinationNode };\nexport { mediaStreamAudioSourceNodeConstructor as MediaStreamAudioSourceNode };\nexport { mediaStreamTrackAudioSourceNodeConstructor as MediaStreamTrackAudioSourceNode };\nconst minimalAudioContextConstructor = createMinimalAudioContextConstructor(createInvalidStateError, createNotSupportedError, createUnknownError, minimalBaseAudioContextConstructor, nativeAudioContextConstructor);\nexport { minimalAudioContextConstructor as MinimalAudioContext };\nconst createNativeOfflineAudioContext = createCreateNativeOfflineAudioContext(createNotSupportedError, nativeOfflineAudioContextConstructor);\nconst startRendering = createStartRendering(audioBufferStore, cacheTestResult, getAudioNodeRenderer, getUnrenderedAudioWorkletNodes, renderNativeOfflineAudioContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds);\nconst minimalOfflineAudioContextConstructor = createMinimalOfflineAudioContextConstructor(cacheTestResult, createInvalidStateError, createNativeOfflineAudioContext, minimalBaseAudioContextConstructor, startRendering);\nexport { minimalOfflineAudioContextConstructor as MinimalOfflineAudioContext };\nconst offlineAudioContextConstructor = createOfflineAudioContextConstructor(baseAudioContextConstructor, cacheTestResult, createInvalidStateError, createNativeOfflineAudioContext, startRendering);\nexport { offlineAudioContextConstructor as OfflineAudioContext };\nexport { oscillatorNodeConstructor as OscillatorNode };\nexport { pannerNodeConstructor as PannerNode };\nexport { periodicWaveConstructor as PeriodicWave };\nexport { stereoPannerNodeConstructor as StereoPannerNode };\nexport { waveShaperNodeConstructor as WaveShaperNode };\nexport const isAnyAudioContext = createIsAnyAudioContext(CONTEXT_STORE, isNativeAudioContext);\nexport const isAnyAudioNode = createIsAnyAudioNode(AUDIO_NODE_STORE, isNativeAudioNode);\nexport const isAnyAudioParam = createIsAnyAudioParam(AUDIO_PARAM_STORE, isNativeAudioParam);\nexport const isAnyOfflineAudioContext = createIsAnyOfflineAudioContext(CONTEXT_STORE, isNativeOfflineAudioContext);\nexport const isSupported = () => createIsSupportedPromise(cacheTestResult, createTestAudioBufferCopyChannelMethodsSubarraySupport(nativeOfflineAudioContextConstructor), createTestAudioContextCloseMethodSupport(nativeAudioContextConstructor), createTestAudioContextDecodeAudioDataMethodTypeErrorSupport(nativeOfflineAudioContextConstructor), createTestAudioContextOptionsSupport(nativeAudioContextConstructor), createTestAudioNodeConnectMethodSupport(nativeOfflineAudioContextConstructor), createTestAudioWorkletProcessorNoOutputsSupport(nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor), createTestChannelMergerNodeChannelCountSupport(nativeOfflineAudioContextConstructor), createTestConstantSourceNodeAccurateSchedulingSupport(nativeOfflineAudioContextConstructor), createTestConvolverNodeBufferReassignabilitySupport(nativeOfflineAudioContextConstructor), createTestConvolverNodeChannelCountSupport(nativeOfflineAudioContextConstructor), testDomExceptionConstructorSupport, createTestIsSecureContextSupport(window), createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport(nativeAudioContextConstructor), createTestStereoPannerNodeDefaultValueSupport(nativeOfflineAudioContextConstructor), testTransferablesSupport);\n//# sourceMappingURL=module.js.map","import { encode, instantiate } from 'media-encoder-host';\nimport { addRecorderAudioWorkletModule, createRecorderAudioWorkletNode } from 'recorder-audio-worklet';\nimport { AudioBuffer, AudioBufferSourceNode, AudioWorkletNode, MediaStreamAudioSourceNode, MinimalAudioContext, addAudioWorkletModule } from 'standardized-audio-context';\nconst ERROR_MESSAGE = 'Missing AudioWorklet support. Maybe this is not running in a secure context.';\n// @todo This should live in a separate file.\nconst createPromisedAudioNodesEncoderInstanceIdAndPort = async (audioBuffer, audioContext, channelCount, mediaStream, mimeType) => {\n const { encoderInstanceId, port } = await instantiate(mimeType, audioContext.sampleRate);\n if (AudioWorkletNode === undefined) {\n throw new Error(ERROR_MESSAGE);\n }\n const audioBufferSourceNode = audioBuffer === null ? null : new AudioBufferSourceNode(audioContext, { buffer: audioBuffer });\n const mediaStreamAudioSourceNode = new MediaStreamAudioSourceNode(audioContext, { mediaStream });\n const recorderAudioWorkletNode = createRecorderAudioWorkletNode(AudioWorkletNode, audioContext, { channelCount });\n return { audioBufferSourceNode, encoderInstanceId, mediaStreamAudioSourceNode, port, recorderAudioWorkletNode };\n};\nexport const createWebAudioMediaRecorderFactory = (createBlobEvent, createInvalidModificationError, createInvalidStateError, createNotSupportedError) => {\n return (eventTarget, mediaStream, mimeType) => {\n var _a;\n const sampleRate = (_a = mediaStream.getAudioTracks()[0]) === null || _a === void 0 ? void 0 : _a.getSettings().sampleRate;\n const audioContext = new MinimalAudioContext({ latencyHint: 'playback', sampleRate });\n /*\n * Bug #22: Safari adds a certain number of leading zeros which need to be skipped.\n *\n * Bug #21: Firefox is the only browser not supporting audio/mp4. This is totally unrelated and just used to apply the fix only for\n * Safari.\n */\n const audioBuffer = MediaRecorder.isTypeSupported('audio/mp4')\n ? new AudioBuffer({ length: 2688, sampleRate: audioContext.sampleRate })\n : null;\n const bufferedArrayBuffers = [];\n const promisedAudioWorkletModule = addRecorderAudioWorkletModule((url) => {\n if (addAudioWorkletModule === undefined) {\n throw new Error(ERROR_MESSAGE);\n }\n return addAudioWorkletModule(audioContext, url);\n });\n let abortRecording = null;\n let intervalId = null;\n let promisedAudioNodesAndEncoderInstanceId = null;\n let promisedPartialRecording = null;\n let isAudioContextRunning = true;\n const dispatchDataAvailableEvent = (arrayBuffers) => {\n eventTarget.dispatchEvent(createBlobEvent('dataavailable', { data: new Blob(arrayBuffers, { type: mimeType }) }));\n };\n const requestNextPartialRecording = async (encoderInstanceId, timeslice) => {\n const arrayBuffers = await encode(encoderInstanceId, timeslice);\n if (promisedAudioNodesAndEncoderInstanceId === null) {\n bufferedArrayBuffers.push(...arrayBuffers);\n }\n else {\n dispatchDataAvailableEvent(arrayBuffers);\n promisedPartialRecording = requestNextPartialRecording(encoderInstanceId, timeslice);\n }\n };\n const resume = () => {\n isAudioContextRunning = true;\n return audioContext.resume();\n };\n const stop = () => {\n if (promisedAudioNodesAndEncoderInstanceId === null) {\n return;\n }\n if (abortRecording !== null) {\n mediaStream.removeEventListener('addtrack', abortRecording);\n mediaStream.removeEventListener('removetrack', abortRecording);\n }\n if (intervalId !== null) {\n clearTimeout(intervalId);\n }\n promisedAudioNodesAndEncoderInstanceId.then(async ({ encoderInstanceId, mediaStreamAudioSourceNode, recorderAudioWorkletNode }) => {\n if (promisedPartialRecording !== null) {\n promisedPartialRecording.catch(() => {\n /* @todo Only catch the errors caused by a duplicate call to encode. */\n });\n promisedPartialRecording = null;\n }\n await recorderAudioWorkletNode.stop();\n mediaStreamAudioSourceNode.disconnect(recorderAudioWorkletNode);\n const arrayBuffers = await encode(encoderInstanceId, null);\n if (promisedAudioNodesAndEncoderInstanceId === null) {\n await suspend();\n }\n dispatchDataAvailableEvent([...bufferedArrayBuffers, ...arrayBuffers]);\n bufferedArrayBuffers.length = 0;\n eventTarget.dispatchEvent(new Event('stop'));\n });\n promisedAudioNodesAndEncoderInstanceId = null;\n };\n const suspend = () => {\n isAudioContextRunning = false;\n return audioContext.suspend();\n };\n suspend();\n return {\n get mimeType() {\n return mimeType;\n },\n get state() {\n return promisedAudioNodesAndEncoderInstanceId === null ? 'inactive' : isAudioContextRunning ? 'recording' : 'paused';\n },\n pause() {\n if (promisedAudioNodesAndEncoderInstanceId === null) {\n throw createInvalidStateError();\n }\n if (isAudioContextRunning) {\n suspend();\n eventTarget.dispatchEvent(new Event('pause'));\n }\n },\n resume() {\n if (promisedAudioNodesAndEncoderInstanceId === null) {\n throw createInvalidStateError();\n }\n if (!isAudioContextRunning) {\n resume();\n eventTarget.dispatchEvent(new Event('resume'));\n }\n },\n start(timeslice) {\n var _a;\n if (promisedAudioNodesAndEncoderInstanceId !== null) {\n throw createInvalidStateError();\n }\n if (mediaStream.getVideoTracks().length > 0) {\n throw createNotSupportedError();\n }\n eventTarget.dispatchEvent(new Event('start'));\n const audioTracks = mediaStream.getAudioTracks();\n const channelCount = audioTracks.length === 0 ? 2 : ((_a = audioTracks[0].getSettings().channelCount) !== null && _a !== void 0 ? _a : 2);\n promisedAudioNodesAndEncoderInstanceId = Promise.all([\n resume(),\n promisedAudioWorkletModule.then(() => createPromisedAudioNodesEncoderInstanceIdAndPort(audioBuffer, audioContext, channelCount, mediaStream, mimeType))\n ]).then(async ([, { audioBufferSourceNode, encoderInstanceId, mediaStreamAudioSourceNode, port, recorderAudioWorkletNode }]) => {\n mediaStreamAudioSourceNode.connect(recorderAudioWorkletNode);\n if (audioBufferSourceNode !== null) {\n await new Promise((resolve) => {\n audioBufferSourceNode.onended = resolve;\n audioBufferSourceNode.connect(recorderAudioWorkletNode);\n audioBufferSourceNode.start();\n });\n audioBufferSourceNode.disconnect(recorderAudioWorkletNode);\n }\n await recorderAudioWorkletNode.record(port);\n if (timeslice !== undefined) {\n promisedPartialRecording = requestNextPartialRecording(encoderInstanceId, timeslice);\n }\n return { encoderInstanceId, mediaStreamAudioSourceNode, recorderAudioWorkletNode };\n });\n const tracks = mediaStream.getTracks();\n abortRecording = () => {\n stop();\n eventTarget.dispatchEvent(new ErrorEvent('error', { error: createInvalidModificationError() }));\n };\n mediaStream.addEventListener('addtrack', abortRecording);\n mediaStream.addEventListener('removetrack', abortRecording);\n intervalId = setInterval(() => {\n const currentTracks = mediaStream.getTracks();\n if ((currentTracks.length !== tracks.length || currentTracks.some((track, index) => track !== tracks[index])) &&\n abortRecording !== null) {\n abortRecording();\n }\n }, 1000);\n },\n stop\n };\n };\n};\n//# sourceMappingURL=web-audio-media-recorder.js.map","export class MultiBufferDataView {\n constructor(buffers, byteOffset = 0, byteLength) {\n if (byteOffset < 0 || (byteLength !== undefined && byteLength < 0)) {\n throw new RangeError();\n }\n const availableBytes = buffers.reduce((length, buffer) => length + buffer.byteLength, 0);\n if (byteOffset > availableBytes || (byteLength !== undefined && byteOffset + byteLength > availableBytes)) {\n throw new RangeError();\n }\n const dataViews = [];\n const effectiveByteLength = byteLength === undefined ? availableBytes - byteOffset : byteLength;\n const truncatedBuffers = [];\n let consumedByteLength = 0;\n let truncatedByteOffset = byteOffset;\n for (const buffer of buffers) {\n if (truncatedBuffers.length === 0) {\n if (buffer.byteLength > truncatedByteOffset) {\n consumedByteLength = buffer.byteLength - truncatedByteOffset;\n const byteLengthOfDataView = consumedByteLength > effectiveByteLength ? effectiveByteLength : consumedByteLength;\n dataViews.push(new DataView(buffer, truncatedByteOffset, byteLengthOfDataView));\n truncatedBuffers.push(buffer);\n }\n else {\n truncatedByteOffset -= buffer.byteLength;\n }\n }\n else if (consumedByteLength < effectiveByteLength) {\n consumedByteLength += buffer.byteLength;\n const byteLengthOfDataView = consumedByteLength > effectiveByteLength\n ? buffer.byteLength - consumedByteLength + effectiveByteLength\n : buffer.byteLength;\n dataViews.push(new DataView(buffer, 0, byteLengthOfDataView));\n truncatedBuffers.push(buffer);\n }\n }\n this._buffers = truncatedBuffers;\n this._byteLength = effectiveByteLength;\n this._byteOffset = truncatedByteOffset;\n this._dataViews = dataViews;\n this._internalBuffer = new DataView(new ArrayBuffer(8));\n }\n get buffers() {\n return this._buffers;\n }\n get byteLength() {\n return this._byteLength;\n }\n get byteOffset() {\n return this._byteOffset;\n }\n getFloat32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getFloat32(0, littleEndian);\n }\n getFloat64(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n this._internalBuffer.setUint8(4, this.getUint8(byteOffset + 4));\n this._internalBuffer.setUint8(5, this.getUint8(byteOffset + 5));\n this._internalBuffer.setUint8(6, this.getUint8(byteOffset + 6));\n this._internalBuffer.setUint8(7, this.getUint8(byteOffset + 7));\n return this._internalBuffer.getFloat64(0, littleEndian);\n }\n getInt16(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n return this._internalBuffer.getInt16(0, littleEndian);\n }\n getInt32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getInt32(0, littleEndian);\n }\n getInt8(byteOffset) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n return dataView.getInt8(byteOffset - byteOffsetOfDataView);\n }\n getUint16(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n return this._internalBuffer.getUint16(0, littleEndian);\n }\n getUint32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getUint32(0, littleEndian);\n }\n getUint8(byteOffset) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n return dataView.getUint8(byteOffset - byteOffsetOfDataView);\n }\n setFloat32(byteOffset, value, littleEndian) {\n this._internalBuffer.setFloat32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setFloat64(byteOffset, value, littleEndian) {\n this._internalBuffer.setFloat64(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n this.setUint8(byteOffset + 4, this._internalBuffer.getUint8(4));\n this.setUint8(byteOffset + 5, this._internalBuffer.getUint8(5));\n this.setUint8(byteOffset + 6, this._internalBuffer.getUint8(6));\n this.setUint8(byteOffset + 7, this._internalBuffer.getUint8(7));\n }\n setInt16(byteOffset, value, littleEndian) {\n this._internalBuffer.setInt16(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n }\n setInt32(byteOffset, value, littleEndian) {\n this._internalBuffer.setInt32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setInt8(byteOffset, value) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n dataView.setInt8(byteOffset - byteOffsetOfDataView, value);\n }\n setUint16(byteOffset, value, littleEndian) {\n this._internalBuffer.setUint16(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n }\n setUint32(byteOffset, value, littleEndian) {\n this._internalBuffer.setUint32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setUint8(byteOffset, value) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n dataView.setUint8(byteOffset - byteOffsetOfDataView, value);\n }\n _findDataViewWithOffset(byteOffset) {\n let byteOffsetOfDataView = 0;\n for (const dataView of this._dataViews) {\n const byteOffsetOfNextDataView = byteOffsetOfDataView + dataView.byteLength;\n if (byteOffset >= byteOffsetOfDataView && byteOffset < byteOffsetOfNextDataView) {\n return [dataView, byteOffsetOfDataView];\n }\n byteOffsetOfDataView = byteOffsetOfNextDataView;\n }\n throw new RangeError();\n }\n}\n//# sourceMappingURL=multi-buffer-data-view.js.map","import { encode, instantiate } from 'media-encoder-host';\nimport { MultiBufferDataView } from 'multi-buffer-data-view';\nimport { on } from 'subscribable-things';\nexport const createWebmPcmMediaRecorderFactory = (createBlobEvent, decodeWebMChunk, readVariableSizeInteger) => {\n return (eventTarget, nativeMediaRecorderConstructor, mediaStream, mimeType) => {\n const bufferedArrayBuffers = [];\n const nativeMediaRecorder = new nativeMediaRecorderConstructor(mediaStream, { mimeType: 'audio/webm; codecs=pcm' });\n let promisedPartialRecording = null;\n let stopRecording = () => { }; // tslint:disable-line:no-empty\n const dispatchDataAvailableEvent = (arrayBuffers) => {\n eventTarget.dispatchEvent(createBlobEvent('dataavailable', { data: new Blob(arrayBuffers, { type: mimeType }) }));\n };\n const requestNextPartialRecording = async (encoderInstanceId, timeslice) => {\n const arrayBuffers = await encode(encoderInstanceId, timeslice);\n if (nativeMediaRecorder.state === 'inactive') {\n bufferedArrayBuffers.push(...arrayBuffers);\n }\n else {\n dispatchDataAvailableEvent(arrayBuffers);\n promisedPartialRecording = requestNextPartialRecording(encoderInstanceId, timeslice);\n }\n };\n const stop = () => {\n if (nativeMediaRecorder.state === 'inactive') {\n return;\n }\n if (promisedPartialRecording !== null) {\n promisedPartialRecording.catch(() => {\n /* @todo Only catch the errors caused by a duplicate call to encode. */\n });\n promisedPartialRecording = null;\n }\n stopRecording();\n stopRecording = () => { }; // tslint:disable-line:no-empty\n nativeMediaRecorder.stop();\n };\n nativeMediaRecorder.addEventListener('error', (event) => {\n stop();\n eventTarget.dispatchEvent(new ErrorEvent('error', {\n error: event.error\n }));\n });\n nativeMediaRecorder.addEventListener('pause', () => eventTarget.dispatchEvent(new Event('pause')));\n nativeMediaRecorder.addEventListener('resume', () => eventTarget.dispatchEvent(new Event('resume')));\n nativeMediaRecorder.addEventListener('start', () => eventTarget.dispatchEvent(new Event('start')));\n return {\n get mimeType() {\n return mimeType;\n },\n get state() {\n return nativeMediaRecorder.state;\n },\n pause() {\n return nativeMediaRecorder.pause();\n },\n resume() {\n return nativeMediaRecorder.resume();\n },\n start(timeslice) {\n const [audioTrack] = mediaStream.getAudioTracks();\n if (audioTrack !== undefined && nativeMediaRecorder.state === 'inactive') {\n // Bug #19: Chrome does not expose the correct channelCount property right away.\n const { channelCount, sampleRate } = audioTrack.getSettings();\n if (channelCount === undefined) {\n throw new Error('The channelCount is not defined.');\n }\n if (sampleRate === undefined) {\n throw new Error('The sampleRate is not defined.');\n }\n let isRecording = false;\n let isStopped = false;\n // Bug #9: Chrome sometimes fires more than one dataavailable event while being inactive.\n let pendingInvocations = 0;\n let promisedDataViewElementTypeEncoderInstanceIdAndPort = instantiate(mimeType, sampleRate);\n stopRecording = () => {\n isStopped = true;\n };\n const removeEventListener = on(nativeMediaRecorder, 'dataavailable')(({ data }) => {\n pendingInvocations += 1;\n const promisedArrayBuffer = data.arrayBuffer();\n promisedDataViewElementTypeEncoderInstanceIdAndPort = promisedDataViewElementTypeEncoderInstanceIdAndPort.then(async ({ dataView = null, elementType = null, encoderInstanceId, port }) => {\n const arrayBuffer = await promisedArrayBuffer;\n pendingInvocations -= 1;\n const currentDataView = dataView === null\n ? new MultiBufferDataView([arrayBuffer])\n : new MultiBufferDataView([...dataView.buffers, arrayBuffer], dataView.byteOffset);\n if (!isRecording && nativeMediaRecorder.state === 'recording' && !isStopped) {\n const lengthAndValue = readVariableSizeInteger(currentDataView, 0);\n if (lengthAndValue === null) {\n return { dataView: currentDataView, elementType, encoderInstanceId, port };\n }\n const { value } = lengthAndValue;\n if (value !== 172351395) {\n return { dataView, elementType, encoderInstanceId, port };\n }\n isRecording = true;\n }\n const { currentElementType, offset, contents } = decodeWebMChunk(currentDataView, elementType, channelCount);\n const remainingDataView = offset < currentDataView.byteLength\n ? new MultiBufferDataView(currentDataView.buffers, currentDataView.byteOffset + offset)\n : null;\n contents.forEach((content) => port.postMessage(content, content.map(({ buffer }) => buffer)));\n if (pendingInvocations === 0 && (nativeMediaRecorder.state === 'inactive' || isStopped)) {\n encode(encoderInstanceId, null).then((arrayBuffers) => {\n dispatchDataAvailableEvent([...bufferedArrayBuffers, ...arrayBuffers]);\n bufferedArrayBuffers.length = 0;\n eventTarget.dispatchEvent(new Event('stop'));\n });\n port.postMessage([]);\n port.close();\n removeEventListener();\n }\n return { dataView: remainingDataView, elementType: currentElementType, encoderInstanceId, port };\n });\n });\n if (timeslice !== undefined) {\n promisedDataViewElementTypeEncoderInstanceIdAndPort.then(({ encoderInstanceId }) => {\n if (isStopped) {\n return;\n }\n promisedPartialRecording = requestNextPartialRecording(encoderInstanceId, timeslice);\n });\n }\n }\n nativeMediaRecorder.start(100);\n },\n stop\n };\n };\n};\n//# sourceMappingURL=webm-pcm-media-recorder.js.map","export const createWindow = () => (typeof window === 'undefined' ? null : window);\n//# sourceMappingURL=window.js.map","export const readVariableSizeIntegerLength = (dataView, offset) => {\n if (offset >= dataView.byteLength) {\n return null;\n }\n const byte = dataView.getUint8(offset);\n if (byte > 127) {\n return 1;\n }\n if (byte > 63) {\n return 2;\n }\n if (byte > 31) {\n return 3;\n }\n if (byte > 15) {\n return 4;\n }\n if (byte > 7) {\n return 5;\n }\n if (byte > 3) {\n return 6;\n }\n if (byte > 1) {\n return 7;\n }\n if (byte > 0) {\n return 8;\n }\n const length = readVariableSizeIntegerLength(dataView, offset + 1);\n return length === null ? null : length + 8;\n};\n//# sourceMappingURL=read-variable-size-integer-length.js.map","export const wrapEventListener = (target, eventListener) => {\n return (event) => {\n const descriptor = { value: target };\n Object.defineProperties(event, {\n currentTarget: descriptor,\n target: descriptor\n });\n if (typeof eventListener === 'function') {\n return eventListener.call(target, event);\n }\n return eventListener.handleEvent.call(target, event);\n };\n};\n//# sourceMappingURL=wrap-event-listener.js.map","import { deregister as drgstr, register as rgstr } from 'media-encoder-host';\nimport { createBlobEventFactory } from './factories/blob-event-factory';\nimport { createDecodeWebMChunk } from './factories/decode-web-m-chunk';\nimport { createEventTargetConstructor } from './factories/event-target-constructor';\nimport { createEventTargetFactory } from './factories/event-target-factory';\nimport { createInvalidModificationError } from './factories/invalid-modification-error';\nimport { createInvalidStateError } from './factories/invalid-state-error';\nimport { createIsSupportedPromise } from './factories/is-supported-promise';\nimport { createMediaRecorderConstructor } from './factories/media-recorder-constructor';\nimport { createNativeBlobEventConstructor } from './factories/native-blob-event-constructor';\nimport { createNativeMediaRecorderConstructor } from './factories/native-media-recorder-constructor';\nimport { createNativeMediaRecorderFactory } from './factories/native-media-recorder-factory';\nimport { createNotSupportedError } from './factories/not-supported-error';\nimport { createReadElementContent } from './factories/read-element-content';\nimport { createReadElementType } from './factories/read-element-type';\nimport { createReadVariableSizeInteger } from './factories/read-variable-size-integer';\nimport { createWebAudioMediaRecorderFactory } from './factories/web-audio-media-recorder';\nimport { createWebmPcmMediaRecorderFactory } from './factories/webm-pcm-media-recorder';\nimport { createWindow } from './factories/window';\nimport { readVariableSizeIntegerLength } from './functions/read-variable-size-integer-length';\nimport { wrapEventListener } from './functions/wrap-event-listener';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst encoderRegexes = [];\nconst window = createWindow();\nconst nativeBlobEventConstructor = createNativeBlobEventConstructor(window);\nconst createBlobEvent = createBlobEventFactory(nativeBlobEventConstructor);\nconst createWebAudioMediaRecorder = createWebAudioMediaRecorderFactory(createBlobEvent, createInvalidModificationError, createInvalidStateError, createNotSupportedError);\nconst readVariableSizeInteger = createReadVariableSizeInteger(readVariableSizeIntegerLength);\nconst readElementContent = createReadElementContent(readVariableSizeInteger);\nconst readElementType = createReadElementType(readVariableSizeInteger);\nconst decodeWebMChunk = createDecodeWebMChunk(readElementContent, readElementType);\nconst createWebmPcmMediaRecorder = createWebmPcmMediaRecorderFactory(createBlobEvent, decodeWebMChunk, readVariableSizeInteger);\nconst createEventTarget = createEventTargetFactory(window);\nconst nativeMediaRecorderConstructor = createNativeMediaRecorderConstructor(window);\nconst mediaRecorderConstructor = createMediaRecorderConstructor(createNativeMediaRecorderFactory(createNotSupportedError), createNotSupportedError, createWebAudioMediaRecorder, createWebmPcmMediaRecorder, encoderRegexes, createEventTargetConstructor(createEventTarget, wrapEventListener), nativeMediaRecorderConstructor);\nexport { mediaRecorderConstructor as MediaRecorder };\nconst ports = new WeakMap();\nexport const deregister = async (port) => {\n await drgstr(port);\n const encoderRegex = ports.get(port);\n if (encoderRegex !== undefined) {\n const index = encoderRegexes.indexOf(encoderRegex);\n encoderRegexes.splice(index, 1);\n }\n};\nexport const isSupported = () => createIsSupportedPromise(window);\nexport const register = async (port) => {\n const encoderRegex = await rgstr(port);\n encoderRegexes.push(encoderRegex);\n ports.set(port, encoderRegex);\n};\n//# sourceMappingURL=module.js.map","import { createBroker } from 'broker-factory';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nexport const wrap = createBroker({\n characterize: ({ call }) => {\n return () => call('characterize');\n },\n encode: ({ call }) => {\n return (recordingId, timeslice) => {\n return call('encode', { recordingId, timeslice });\n };\n },\n record: ({ call }) => {\n return async (recordingId, sampleRate, typedArrays) => {\n await call('record', { recordingId, sampleRate, typedArrays }, typedArrays.map(({ buffer }) => buffer).filter((buffer) => buffer instanceof ArrayBuffer));\n };\n }\n});\nexport const load = (url) => {\n const worker = new Worker(url);\n return wrap(worker);\n};\n//# sourceMappingURL=module.js.map","// This is the minified and stringified code of the extendable-media-recorder-wav-encoder-worker package.\nexport const worker = `(()=>{var e={455:function(e,t){!function(e){\"use strict\";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,s=536870912,a=2*s,o=function(e,t){return function(r){var o=t.get(r),i=void 0===o?r.size:o<a?o+1:0;if(!r.has(i))return e(r,i);if(r.size<s){for(;r.has(i);)i=Math.floor(Math.random()*a);return e(r,i)}if(r.size>n)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,c=r(i),l=o(c,i),u=t(l);e.addUniqueNumber=u,e.generateUniqueNumber=l}(t)}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(()=>{\"use strict\";const e=-32603,t=-32602,n=-32601,s=(e,t)=>Object.assign(new Error(e),{status:t}),a=t=>s('The handler of the method called \"'.concat(t,'\" returned an unexpected result.'),e),o=(t,r)=>async({data:{id:o,method:i,params:c}})=>{const l=r[i];try{if(void 0===l)throw(e=>s('The requested method called \"'.concat(e,'\" is not supported.'),n))(i);const r=void 0===c?l():l(c);if(void 0===r)throw(t=>s('The handler of the method called \"'.concat(t,'\" returned no required result.'),e))(i);const u=r instanceof Promise?await r:r;if(null===o){if(void 0!==u.result)throw a(i)}else{if(void 0===u.result)throw a(i);const{result:e,transferables:r=[]}=u;t.postMessage({id:o,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:o})}};var i=r(455);const c=new Map,l=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),s=(0,i.generateUniqueNumber)(c);return c.set(s,()=>{n(),t.close(),c.delete(s)}),{result:s}},disconnect:({portId:e})=>{const r=c.get(e);if(void 0===r)throw(e=>s('The specified parameter called \"portId\" with the given value \"'.concat(e,'\" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),u=(e,t,r=()=>!0)=>{const n=l(u,t,r),s=o(e,n);return e.addEventListener(\"message\",s),()=>e.removeEventListener(\"message\",s)},d=e=>e.reduce((e,t)=>e+t.length,0),h=(e,t)=>{const r=[];let n=0;e:for(;n<t;){const t=e.length;for(let s=0;s<t;s+=1){const t=e[s];void 0===r[s]&&(r[s]=[]);const a=t.shift();if(void 0===a)break e;r[s].push(a),0===s&&(n+=a.length)}}if(n>t){const s=n-t;r.forEach((t,r)=>{const n=t.pop(),a=n.length-s;t.push(n.subarray(0,a)),e[r].unshift(n.subarray(a))})}return r},f=new Map,m=(e=>(t,r,n)=>{const s=e.get(t);if(void 0===s){const s={channelDataArrays:n.map(e=>[e]),isComplete:!0,sampleRate:r};return e.set(t,s),s}return s.channelDataArrays.forEach((e,t)=>e.push(n[t])),s})(f),p=((e,t)=>(r,n,s,a)=>{const o=s>>3,i=\"subsequent\"===n?0:44,c=r.length,l=e(r[0]),u=new ArrayBuffer(l*c*o+i),d=new DataView(u);return\"subsequent\"!==n&&t(d,s,c,\"complete\"===n?l:Number.POSITIVE_INFINITY,a),r.forEach((e,t)=>{let r=i+t*o;e.forEach(e=>{const t=e.length;for(let n=0;n<t;n+=1){const t=e[n];d.setInt16(r,t<0?32768*Math.max(-1,t):32767*Math.min(1,t),!0),r+=c*o}})}),[u]})(d,(e,t,r,n,s)=>{const a=t>>3,o=Math.min(n*r*a,4294967251);e.setUint32(0,1380533830),e.setUint32(4,o+36,!0),e.setUint32(8,1463899717),e.setUint32(12,1718449184),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,r,!0),e.setUint32(24,s,!0),e.setUint32(28,s*r*a,!0),e.setUint16(32,r*a,!0),e.setUint16(34,t,!0),e.setUint32(36,1684108385),e.setUint32(40,o,!0)}),v=new Map;u(self,{characterize:()=>({result:/^audio\\\\/wav$/}),encode:({recordingId:e,timeslice:t})=>{const r=v.get(e);void 0!==r&&(v.delete(e),r.reject(new Error(\"Another request was made to initiate an encoding.\")));const n=f.get(e);if(null!==t){if(void 0===n||d(n.channelDataArrays[0])*(1e3/n.sampleRate)<t)return new Promise((r,n)=>{v.set(e,{reject:n,resolve:r,timeslice:t})});const r=h(n.channelDataArrays,Math.ceil(t*(n.sampleRate/1e3))),s=p(r,n.isComplete?\"initial\":\"subsequent\",16,n.sampleRate);return n.isComplete=!1,{result:s,transferables:s}}if(void 0!==n){const t=p(n.channelDataArrays,n.isComplete?\"complete\":\"subsequent\",16,n.sampleRate);return f.delete(e),{result:t,transferables:t}}return{result:[],transferables:[]}},record:({recordingId:e,sampleRate:t,typedArrays:r})=>{const n=m(e,t,r),s=v.get(e);if(void 0!==s&&d(n.channelDataArrays[0])*(1e3/t)>=s.timeslice){const r=h(n.channelDataArrays,Math.ceil(s.timeslice*(t/1e3))),a=p(r,n.isComplete?\"initial\":\"subsequent\",16,t);n.isComplete=!1,v.delete(e),s.resolve({result:a,transferables:a})}return{result:null}}})})()})();`; // tslint:disable-line:max-line-length\n//# sourceMappingURL=worker.js.map","import { load } from 'extendable-media-recorder-wav-encoder-broker';\nimport { worker } from './worker/worker';\nconst blob = new Blob([worker], { type: 'application/javascript; charset=utf-8' });\nconst url = URL.createObjectURL(blob);\nconst extendableMediaRecorderWavEncoder = load(url);\nexport const characterize = extendableMediaRecorderWavEncoder.characterize;\nexport const connect = extendableMediaRecorderWavEncoder.connect;\nexport const disconnect = extendableMediaRecorderWavEncoder.disconnect;\nexport const encode = extendableMediaRecorderWavEncoder.encode;\nexport const isSupported = extendableMediaRecorderWavEncoder.isSupported;\nexport const record = extendableMediaRecorderWavEncoder.record;\nURL.revokeObjectURL(url);\n//# sourceMappingURL=module.js.map","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"assistant-audio-recorder-wrapper\">\n\t\t<NcButton v-if=\"!isRecording\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:title=\"compact ? t('assistant', 'Start recording') : undefined\"\n\t\t\t@click=\"start\">\n\t\t\t<template #icon>\n\t\t\t\t<MicrophoneOutlineIcon />\n\t\t\t</template>\n\t\t\t<template v-if=\"!compact\" #default>\n\t\t\t\t{{ t('assistant', 'Start recording') }}\n\t\t\t</template>\n\t\t</NcButton>\n\t\t<NcButton v-if=\"isRecording\"\n\t\t\tvariant=\"error\"\n\t\t\t:title=\"t('assistant', 'Dismiss recording')\"\n\t\t\t@click=\"abortRecording\">\n\t\t\t<template #icon>\n\t\t\t\t<CloseIcon />\n\t\t\t</template>\n\t\t</NcButton>\n\t\t<div v-if=\"isRecording\" class=\"recording\">\n\t\t\t<div class=\"recording--indicator fadeOutIn\" />\n\t\t\t<span class=\"time\">\n\t\t\t\t{{ parsedRecordTime }}\n\t\t\t</span>\n\t\t</div>\n\t\t<NcButton v-if=\"isRecording\"\n\t\t\tvariant=\"success\"\n\t\t\t:title=\"t('assistant', 'End recording and send')\"\n\t\t\t@click=\"stop\">\n\t\t\t<template #icon>\n\t\t\t\t<CheckIcon />\n\t\t\t</template>\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport CloseIcon from 'vue-material-design-icons/Close.vue'\nimport MicrophoneOutlineIcon from 'vue-material-design-icons/MicrophoneOutline.vue'\n\nimport NcButton from '@nextcloud/vue/components/NcButton'\n\nimport { showError } from '@nextcloud/dialogs'\n\nimport { MediaRecorder, register } from 'extendable-media-recorder'\nimport { connect } from 'extendable-media-recorder-wav-encoder'\n\n/**\n * Slightly simpler than the talk NewMessageAudioRecorder\n */\nexport default {\n\tname: 'AudioRecorderWrapper',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tMicrophoneOutlineIcon,\n\t\tCheckIcon,\n\t\tCloseIcon,\n\t},\n\n\tprops: {\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tisRecording: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tcompact: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'new-recording',\n\t\t'update:is-recording',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\t// The audio stream object\n\t\t\taudioStream: null,\n\t\t\t// The media recorder which generate the recorded chunks\n\t\t\tmediaRecorder: null,\n\t\t\t// The chunks array\n\t\t\tchunks: [],\n\t\t\t// Switched to true if the recording is aborted\n\t\t\taborted: false,\n\t\t\t// recordTimer\n\t\t\trecordTimer: null,\n\t\t\t// the record timer\n\t\t\trecordTime: {\n\t\t\t\tminutes: 0,\n\t\t\t\tseconds: 0,\n\t\t\t},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tparsedRecordTime() {\n\t\t\tconst seconds = this.recordTime.seconds.toString().length === 2 ? this.recordTime.seconds : `0${this.recordTime.seconds}`\n\t\t\tconst minutes = this.recordTime.minutes.toString().length === 2 ? this.recordTime.minutes : `0${this.recordTime.minutes}`\n\t\t\treturn `${minutes}:${seconds}`\n\t\t},\n\t},\n\n\twatch: {\n\t\tisRecording(newValue) {\n\t\t\tconsole.debug('isRecording', newValue)\n\t\t},\n\t},\n\n\tmounted() {\n\t},\n\n\tbeforeUnmount() {\n\t\tthis.killStreams()\n\t},\n\n\tmethods: {\n\t\tasync start() {\n\t\t\tif (!OCA.Assistant.encoderRegistered) {\n\t\t\t\tawait register(await connect())\n\t\t\t\tOCA.Assistant.encoderRegistered = true\n\t\t\t}\n\t\t\t// Create new audio stream\n\t\t\ttry {\n\t\t\t\tthis.audioStream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false })\n\t\t\t} catch (exception) {\n\t\t\t\tconsole.debug(exception)\n\t\t\t\tthis.killStreams()\n\t\t\t\tif (exception.name === 'NotAllowedError') {\n\t\t\t\t\tshowError(t('assistant', 'Access to the microphone was denied. Please check you allowed this page to access the microphone.'))\n\t\t\t\t} else {\n\t\t\t\t\tshowError(t('assistant', 'Microphone either not available or disabled in settings. Check you are accessing this page with HTTPS or adjust your browser settings.'))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Create a media recorder to capture the stream\n\t\t\ttry {\n\t\t\t\tthis.mediaRecorder = new MediaRecorder(this.audioStream, { mimeType: 'audio/wav' })\n\t\t\t} catch (exception) {\n\t\t\t\tconsole.debug(exception)\n\t\t\t\tthis.killStreams()\n\t\t\t\tthis.audioStream = null\n\t\t\t\tshowError(\n\t\t\t\t\tt('assistant', 'Error while recording audio')\n\t\t\t\t\t\t+ '. ' + t('assistant', 'Please try again and inform the server administrators if this issue persists.'),\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Add event handler to onstop\n\t\t\tthis.mediaRecorder.onstop = this.generateFile\n\n\t\t\t// Add event handler to ondataavailable\n\t\t\tthis.mediaRecorder.ondataavailable = (e) => {\n\t\t\t\tthis.chunks.push(e.data)\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Start the recording\n\t\t\t\tthis.mediaRecorder.start()\n\t\t\t} catch (exception) {\n\t\t\t\tconsole.debug(exception)\n\t\t\t\tthis.aborted = true\n\t\t\t\tthis.stop()\n\t\t\t\tthis.killStreams()\n\t\t\t\tthis.resetComponentData()\n\t\t\t\tshowError(t('assistant', 'Error while recording audio'))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.debug(this.mediaRecorder.state)\n\n\t\t\t// Start the timer\n\t\t\tthis.recordTimer = setInterval(() => {\n\t\t\t\tif (this.recordTime.seconds === 59) {\n\t\t\t\t\tthis.recordTime.minutes++\n\t\t\t\t\tthis.recordTime.seconds = 0\n\t\t\t\t}\n\t\t\t\tthis.recordTime.seconds++\n\t\t\t}, 1000)\n\t\t\t// Forward an event to let the parent NewMessage component\n\t\t\t// that there's an undergoing recording operation\n\t\t\tthis.$emit('update:is-recording', true)\n\t\t},\n\n\t\tstop() {\n\t\t\tthis.mediaRecorder.stop()\n\t\t\tclearInterval(this.recordTimer)\n\t\t\tthis.$emit('update:is-recording', false)\n\t\t},\n\n\t\t/**\n\t\t * Generate the file\n\t\t */\n\t\tasync generateFile() {\n\t\t\tthis.killStreams()\n\t\t\tif (!this.aborted) {\n\t\t\t\tconst wavBlob = new Blob(this.chunks, { type: this.mediaRecorder.mimeType })\n\t\t\t\tthis.$emit('new-recording', wavBlob)\n\t\t\t\tthis.$emit('update:is-recording', false)\n\t\t\t}\n\t\t\tthis.resetComponentData()\n\t\t},\n\n\t\t/**\n\t\t * Aborts the recording operation.\n\t\t */\n\t\tabortRecording() {\n\t\t\tthis.aborted = true\n\t\t\tthis.stop()\n\t\t},\n\n\t\t/**\n\t\t * Resets this component to its initial state\n\t\t */\n\t\tresetComponentData() {\n\t\t\tthis.audioStream = null\n\t\t\tthis.mediaRecorder = null\n\t\t\tthis.chunks = []\n\t\t\tthis.aborted = false\n\t\t\tthis.recordTime = {\n\t\t\t\tminutes: 0,\n\t\t\t\tseconds: 0,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Stop the audio streams\n\t\t */\n\t\tkillStreams() {\n\t\t\tthis.audioStream?.getTracks().forEach(track => track.stop())\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.assistant-audio-recorder-wrapper {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\n\t.recording {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\n\t\t&--indicator {\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex: 0 0 16px;\n\t\t\tborder-radius: 8px;\n\t\t\tbackground-color: var(--color-error);\n\t\t}\n\n\t\t@keyframes fadeOutIn {\n\t\t\t0% {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t50% {\n\t\t\t\topacity: .3;\n\t\t\t}\n\t\t\t100% {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t.fadeOutIn {\n\t\t\tanimation: fadeOutIn 3s infinite;\n\t\t}\n\t}\n}\n</style>\n","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon upload-outline-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M9,10V16H15V10H19L12,3L5,10H9M12,5.8L14.2,8H13V14H11V8H9.8L12,5.8M19,18H5V20H19V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UploadOutlineIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div>\n\t\t<input ref=\"fileInput\"\n\t\t\ttype=\"file\"\n\t\t\t:accept=\"fileInputAccept\"\n\t\t\t:multiple=\"multiple\"\n\t\t\tstyle=\"display: none;\"\n\t\t\t@cancel.stop=\"onCancel\"\n\t\t\t@change=\"onUploadFileSelected\">\n\t\t<NcButton\n\t\t\tv-bind=\"$attrs\"\n\t\t\tvariant=\"secondary\"\n\t\t\t@click=\"onUploadFile\">\n\t\t\t<template #icon>\n\t\t\t\t<NcLoadingIcon v-if=\"isUploading\" />\n\t\t\t\t<UploadOutlineIcon v-else />\n\t\t\t</template>\n\t\t\t{{ label }}\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport UploadOutlineIcon from 'vue-material-design-icons/UploadOutline.vue'\n\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport NcButton from '@nextcloud/vue/components/NcButton'\n\nimport { showError } from '@nextcloud/dialogs'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\n\nconst uploadEndpointUrl = generateOcsUrl('/apps/assistant/api/v1/input-file')\n\nexport default {\n\tname: 'UploadInputFileButton',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tUploadOutlineIcon,\n\t\tNcLoadingIcon,\n\t},\n\n\tprops: {\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: t('assistant', 'Upload file'),\n\t\t},\n\t\taccept: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tisUploading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'files-uploaded',\n\t\t'update:is-uploading',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tfileInputAccept() {\n\t\t\treturn this.accept.length > 0\n\t\t\t\t? this.accept.join(',')\n\t\t\t\t: undefined\n\t\t},\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t},\n\n\tmethods: {\n\t\tonCancel() {\n\t\t\tconsole.debug('[assistant] file upload cancel')\n\t\t},\n\t\tonUploadFile() {\n\t\t\tthis.$refs.fileInput.click()\n\t\t},\n\t\tonUploadFileSelected(e) {\n\t\t\tif (this.$refs.fileInput.files.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst files = this.$refs.fileInput.files\n\t\t\tconsole.debug('FILES', this.$refs.fileInput.files)\n\t\t\tif (!this.multiple) {\n\t\t\t\tthis.$emit('update:is-uploading', true)\n\t\t\t\tconst file = files[0]\n\t\t\t\tthis.uploadFile(file).then(response => {\n\t\t\t\t\tthis.$emit('files-uploaded', response.data.ocs.data)\n\t\t\t\t}).catch(error => {\n\t\t\t\t\tshowError(t('assistant', 'Could not upload the file'))\n\t\t\t\t\tconsole.error(error)\n\t\t\t\t}).then(() => {\n\t\t\t\t\tthis.$emit('update:is-uploading', false)\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.$emit('update:is-uploading', true)\n\t\t\t\tPromise.all(Array.from(files).map(f => this.uploadFile(f)))\n\t\t\t\t\t.then(responses => {\n\t\t\t\t\t\tif (responses.some(response => response.code === 'ERR_CANCELED')) {\n\t\t\t\t\t\t\tconsole.debug('At least one request has been canceled, do nothing')\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.$emit('files-uploaded', responses.map(response => response.data.ocs.data))\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\tshowError(t('assistant', 'Could not upload the files'))\n\t\t\t\t\t\tconsole.error(error)\n\t\t\t\t\t}).then(() => {\n\t\t\t\t\t\tthis.$emit('update:is-uploading', false)\n\t\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tuploadFile(file) {\n\t\t\tconst formData = new FormData()\n\t\t\tformData.append('data', file)\n\t\t\tformData.append('filename', file.name)\n\t\t\treturn axios.post(uploadEndpointUrl, formData)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n// nothing yet\n</style>\n","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon folder-plus-outline-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.39 13.46 20.72 13.22 20 13.09V8H4V18H13.09C13.04 18.33 13 18.66 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"FolderPlusOutlineIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<NcButton\n\t\tv-bind=\"$attrs\"\n\t\tvariant=\"secondary\"\n\t\t@click=\"onButtonClick\">\n\t\t<template #icon>\n\t\t\t<FolderPlusOutlineIcon />\n\t\t</template>\n\t\t{{ label }}\n\t</NcButton>\n</template>\n\n<script>\nimport FolderPlusOutlineIcon from 'vue-material-design-icons/FolderPlusOutline.vue'\n\nimport NcButton from '@nextcloud/vue/components/NcButton'\n\nimport { getFilePickerBuilder, showError } from '@nextcloud/dialogs'\n\nexport default {\n\tname: 'ChooseInputFileButton',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tFolderPlusOutlineIcon,\n\t},\n\n\tprops: {\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: t('assistant', 'Choose file'),\n\t\t},\n\t\tpickerTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: t('assistant', 'Choose a file'),\n\t\t},\n\t\taccept: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'files-chosen',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tpicker: (callback) => getFilePickerBuilder(this.pickerTitle)\n\t\t\t\t.setMimeTypeFilter(this.accept)\n\t\t\t\t.setMultiSelect(this.multiple)\n\t\t\t\t.allowDirectories(false)\n\t\t\t\t.addButton({\n\t\t\t\t\tid: 'choose-input-file',\n\t\t\t\t\tlabel: t('assistant', 'Choose'),\n\t\t\t\t\tvariant: 'primary',\n\t\t\t\t\tcallback: callback(),\n\t\t\t\t})\n\t\t\t\t.build(),\n\t\t}\n\t},\n\n\tcomputed: {\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t},\n\n\tmethods: {\n\t\tasync onButtonClick() {\n\t\t\tawait this.picker(this.pickerSubmitted).pick()\n\t\t},\n\t\tpickerSubmitted() {\n\t\t\treturn (nodes) => {\n\t\t\t\tif (!nodes || nodes.length === 0 || !nodes[0].path) {\n\t\t\t\t\tshowError(t('assistant', 'No file selected'))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconsole.debug('[assistant] nodes', nodes)\n\t\t\t\tthis.$emit('files-chosen', this.multiple ? nodes : nodes[0])\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n// nothing yet\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"media-field\">\n\t\t<div class=\"label-row\">\n\t\t\t<label class=\"field-label\"\n\t\t\t\t:title=\"field.description\">\n\t\t\t\t{{ field.name }}\n\t\t\t</label>\n\t\t</div>\n\t\t<div v-if=\"!isOutput\"\n\t\t\tclass=\"select-media\">\n\t\t\t<UploadInputFileButton\n\t\t\t\tv-model:is-uploading=\"isUploading\"\n\t\t\t\t:accept=\"acceptedMimeTypes\"\n\t\t\t\t:label=\"t('assistant', 'Upload from device')\"\n\t\t\t\t:disabled=\"value !== null || isRecording || isUploading\"\n\t\t\t\t@files-uploaded=\"onFileUploaded\" />\n\t\t\t<ChooseInputFileButton\n\t\t\t\t:label=\"t('assistant', 'Select from storage')\"\n\t\t\t\t:picker-title=\"t('assistant', 'Pick a file')\"\n\t\t\t\t:accept=\"acceptedMimeTypes\"\n\t\t\t\t:disabled=\"value !== null || isRecording || isUploading\"\n\t\t\t\t@files-chosen=\"onFileChosen\" />\n\t\t\t<AudioRecorderWrapper v-if=\"isAudio\"\n\t\t\t\tv-model:is-recording=\"isRecording\"\n\t\t\t\t:disabled=\"value !== null || isUploading\"\n\t\t\t\t@new-recording=\"onNewRecording\" />\n\t\t</div>\n\t\t<div v-if=\"value !== null\"\n\t\t\tclass=\"media-value\"\n\t\t\t:class=\"{ row: isAudio }\">\n\t\t\t<!--div>\n\t\t\t\tFILE: {{ value }} PATH: {{ filePath }}\n\t\t\t</div-->\n\t\t\t<component :is=\"displayComponent\"\n\t\t\t\t:file-id=\"value\"\n\t\t\t\t:task-id=\"providedCurrentTaskId()\"\n\t\t\t\t:show-delete=\"false\"\n\t\t\t\t:is-output=\"isOutput\"\n\t\t\t\t:clickable=\"true\"\n\t\t\t\t@click.native=\"onPreviewClick\" />\n\t\t\t<div v-if=\"isOutput\"\n\t\t\t\tclass=\"buttons\">\n\t\t\t\t<a :href=\"getDownloadUrl()\"\n\t\t\t\t\ttarget=\"_blank\">\n\t\t\t\t\t<NcButton :title=\"t('assistant', 'Download this media')\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<TrayArrowDownIcon />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t</a>\n\t\t\t\t<NcButton\n\t\t\t\t\t:title=\"t('assistant', 'Save this media')\"\n\t\t\t\t\t@click=\"onSave\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ContentSaveOutlineIcon />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\t:title=\"t('assistant', 'Share this media')\"\n\t\t\t\t\t@click=\"onShare\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ShareVariantIcon />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<div v-else\n\t\t\t\tclass=\"buttons\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:title=\"t('assistant', 'Clear value')\"\n\t\t\t\t\t@click=\"onClear\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport CloseIcon from 'vue-material-design-icons/Close.vue'\nimport TrayArrowDownIcon from 'vue-material-design-icons/TrayArrowDown.vue'\nimport ShareVariantIcon from 'vue-material-design-icons/ShareVariant.vue'\nimport ContentSaveOutlineIcon from 'vue-material-design-icons/ContentSaveOutline.vue'\n\nimport NcButton from '@nextcloud/vue/components/NcButton'\n\nimport AudioDisplay from './AudioDisplay.vue'\nimport ImageDisplay from './ImageDisplay.vue'\n// import VideoDisplay from './VideoDisplay.vue'\nimport FileDisplay from './FileDisplay.vue'\nimport AudioRecorderWrapper from './AudioRecorderWrapper.vue'\nimport UploadInputFileButton from './UploadInputFileButton.vue'\nimport ChooseInputFileButton from './ChooseInputFileButton.vue'\n\nimport { SHAPE_TYPE_NAMES, VALID_AUDIO_MIME_TYPES, VALID_IMAGE_MIME_TYPES, VALID_VIDEO_MIME_TYPES } from '../../constants.js'\n\nimport { generateOcsUrl, generateUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\nimport { showError, showSuccess } from '@nextcloud/dialogs'\n\nexport default {\n\tname: 'MediaField',\n\n\tcomponents: {\n\t\tAudioRecorderWrapper,\n\t\tChooseInputFileButton,\n\t\tUploadInputFileButton,\n\t\tTrayArrowDownIcon,\n\t\tShareVariantIcon,\n\t\tCloseIcon,\n\t\tContentSaveOutlineIcon,\n\t\tNcButton,\n\t},\n\n\tinject: [\n\t\t'providedCurrentTaskId',\n\t],\n\n\tprops: {\n\t\tfieldKey: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tvalue: {\n\t\t\ttype: [Number, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tfield: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tisOutput: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tfilePath: null,\n\t\t\tisUploading: false,\n\t\t\tisRecording: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisAudio() {\n\t\t\treturn this.field.type === SHAPE_TYPE_NAMES.Audio\n\t\t},\n\t\tdisplayComponent() {\n\t\t\tif (this.field.type === SHAPE_TYPE_NAMES.Image) {\n\t\t\t\treturn ImageDisplay\n\t\t\t} else if (this.field.type === SHAPE_TYPE_NAMES.Audio) {\n\t\t\t\treturn AudioDisplay\n\t\t\t} else if (this.field.type === SHAPE_TYPE_NAMES.File) {\n\t\t\t\treturn FileDisplay\n\t\t\t/*\n\t\t\t} else if (this.field.type === SHAPE_TYPE_NAMES.Video) {\n\t\t\t\treturn VideoDisplay\n\t\t\t*/\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\t\tacceptedMimeTypes() {\n\t\t\tif (this.field.type === SHAPE_TYPE_NAMES.Image) {\n\t\t\t\treturn VALID_IMAGE_MIME_TYPES\n\t\t\t} else if (this.field.type === SHAPE_TYPE_NAMES.Audio) {\n\t\t\t\treturn VALID_AUDIO_MIME_TYPES\n\t\t\t} else if (this.field.type === SHAPE_TYPE_NAMES.Video) {\n\t\t\t\treturn VALID_VIDEO_MIME_TYPES\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t},\n\n\twatch: {\n\t},\n\n\tmounted() {\n\t},\n\n\tmethods: {\n\t\tonNewRecording(blob) {\n\t\t\tconst url = generateOcsUrl('/apps/assistant/api/v1/input-file')\n\t\t\tconst formData = new FormData()\n\t\t\tformData.append('data', blob)\n\t\t\tformData.append('filename', 'recording.wav')\n\t\t\taxios.post(url, formData).then(response => {\n\t\t\t\tthis.$emit('update:value', response.data.ocs.data.fileId)\n\t\t\t\tthis.filePath = response.data.ocs.data.filePath\n\t\t\t}).catch(error => {\n\t\t\t\tshowError(t('assistant', 'Could not upload the recorded file'))\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t},\n\t\tonFileUploaded(data) {\n\t\t\tthis.$emit('update:value', data.fileId)\n\t\t\tthis.filePath = data.filePath\n\t\t},\n\t\tonFileChosen(file) {\n\t\t\tthis.filePath = file.path\n\t\t\tthis.$emit('update:value', file.fileid)\n\t\t},\n\t\tonClear() {\n\t\t\tthis.$emit('update:value', null)\n\t\t},\n\t\tgetDownloadUrl() {\n\t\t\t// taskprocessing/tasks/{taskId}/file/{fileId} result has no mimetype\n\t\t\t/*\n\t\t\treturn generateOcsUrl('taskprocessing/tasks/{taskId}/file/{fileId}', {\n\t\t\t\ttaskId: this.providedCurrentTaskId(),\n\t\t\t\tfileId: this.value,\n\t\t\t})\n\t\t\t*/\n\t\t\treturn generateOcsUrl('apps/assistant/api/v1/task/{taskId}/output-file/{fileId}/download', {\n\t\t\t\ttaskId: this.providedCurrentTaskId(),\n\t\t\t\tfileId: this.value,\n\t\t\t})\n\t\t},\n\t\tonShare() {\n\t\t\tif (this.value === null) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst url = generateOcsUrl('/apps/assistant/api/v1/task/{taskId}/file/{fileId}/share', {\n\t\t\t\ttaskId: this.providedCurrentTaskId(),\n\t\t\t\tfileId: this.value,\n\t\t\t})\n\t\t\taxios.post(url).then(response => {\n\t\t\t\tconst shareToken = response.data.ocs.data.shareToken\n\t\t\t\tconst shareUrl = window.location.protocol + '//' + window.location.host + generateUrl('/s/{shareToken}', { shareToken })\n\t\t\t\tconsole.debug('[assistant] generated share link', shareUrl)\n\t\t\t\tconst message = t('assistant', 'Output file share link copied to clipboard')\n\t\t\t\tthis.copyString(shareUrl, message)\n\t\t\t}).catch(error => {\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t},\n\t\tonSave() {\n\t\t\tif (this.value === null) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst url = generateOcsUrl('/apps/assistant/api/v1/task/{taskId}/file/{fileId}/save', {\n\t\t\t\ttaskId: this.providedCurrentTaskId(),\n\t\t\t\tfileId: this.value,\n\t\t\t})\n\t\t\treturn axios.post(url).then(response => {\n\t\t\t\tconst savedPath = response.data.ocs.data.path\n\t\t\t\tconst savedFileId = response.data.ocs.data.fileId\n\t\t\t\tconsole.debug('[assistant] save output file', savedPath)\n\n\t\t\t\tconst directUrl = window.location.protocol + '//' + window.location.host + generateUrl('/f/{savedFileId}', { savedFileId })\n\t\t\t\tconst openMessage = `<a href=\"${directUrl}\" target=\"_blank\">${t('assistant', 'Click this to open the file')}</a>`\n\t\t\t\tshowSuccess(openMessage, { isHTML: true })\n\n\t\t\t\tconst afterCopyMessage = t('assistant', 'This output file has been saved in {path}', { path: savedPath })\n\t\t\t\tthis.copyString(directUrl, afterCopyMessage)\n\t\t\t}).catch(error => {\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t},\n\t\tasync copyString(content, message) {\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(content)\n\t\t\t\tshowSuccess(message)\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error)\n\t\t\t\tshowError(t('assistant', 'Could not copy to clipboard'))\n\t\t\t}\n\t\t},\n\t\tonPreviewClick() {\n\t\t\tif (this.value === null) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst url = generateOcsUrl('/apps/assistant/api/v1/task/{taskId}/file/{fileId}/save', {\n\t\t\t\ttaskId: this.providedCurrentTaskId(),\n\t\t\t\tfileId: this.value,\n\t\t\t})\n\t\t\treturn axios.post(url).then(response => {\n\t\t\t\tconst savedPath = response.data.ocs.data.path\n\t\t\t\tconsole.debug('[assistant] view output file', savedPath)\n\t\t\t\tOCA.Viewer.open({ path: savedPath })\n\t\t\t}).catch(error => {\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.media-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: start;\n\tgap: 12px;\n\n\t.label-row {\n\t\twidth: 100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: start;\n\n\t\t.field-label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n\n\t.select-media {\n\t\twidth: 100%;\n\t\tdisplay: flex;\n\t\talign-items: start;\n\t\tgap: 8px;\n\t}\n\n\t.media-value {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\tpadding: 12px;\n\t\tborder-radius: var(--border-radius-large);\n\n\t\t&.row {\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: var(--color-primary-element-light-hover);\n\t\t}\n\n\t\t.buttons {\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tjustify-content: center;\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","generateOcsUrl","$options","_hoisted_1","generateUrl","url","axios","response","_hoisted_2","_hoisted_4","createAddUniqueNumber","generateUniqueNumber","set","number","createCache","lastNumberWeakMap","collection","nextNumber","MAX_SAFE_INTEGER","TWO_TO_THE_POWER_OF_TWENTY_NINE","TWO_TO_THE_POWER_OF_THIRTY","createGenerateUniqueNumber","cache","lastNumber","LAST_NUMBER_WEAK_MAP","addUniqueNumber","isMessagePort","sender","PORT_MAP","extendBrokerImplementation","partialBrokerImplementation","call","port1","port2","portId","port","ONGOING_REQUESTS","createOrGetOngoingRequests","ongoingRequests","createBroker","brokerImplementation","fullBrokerImplementation","message","id","reject","resolve","method","params","transferables","notify","functions","key","handler","encoderIds","encoderInstanceIds","messagePorts","wrap","encoderId","result","encoderInstanceId","timeslice","arrayBuffers","mimeType","sampleRate","err","load","worker","blob","mediaEncoderHost","loadWorker","encode","instantiate","register","createBlobEventFactory","nativeBlobEventConstructor","type","blobEventInit","createDecodeWebMChunk","readElementContent","readElementType","dataView","elementType","channelCount","contents","currentElementType","offset","lengthAndType","length","contentAndLength","content","createEventTargetConstructor","createEventTarget","wrapEventListener","nativeEventTarget","listener","options","wrappedEventListener","event","createEventTargetFactory","window","createInvalidModificationError","createInvalidStateError","createMediaRecorderConstructor","createNativeMediaRecorder","createNotSupportedError","createWebAudioMediaRecorder","createWebmPcmMediaRecorder","encoderRegexes","eventTargetConstructor","nativeMediaRecorderConstructor","stream","internalMediaRecorder","regex","value","boundListener","createNativeBlobEventConstructor","createNativeMediaRecorderConstructor","createNativeMediaRecorderFactory","mediaRecorderOptions","bufferedBlobEventListeners","dataAvailableListeners","errorListeners","flags","nativeMediaRecorder","stopListeners","isTrusted","addEventListener","patchedEventListener","bufferedBlobEvents","isSliced","isActive","dataAvailableListener","blobEvent","data","removeEventListener","errorListener","stopListener","start","stop","createReadElementContent","readVariableSizeInteger","lengthAndValue","numberOfSamples","i","elementOffset","j","createReadElementType","createReadVariableSizeInteger","readVariableSizeIntegerLength","firstDataByteOffset","observable","patch","arg","noop","rethrow","error","toObserver","observer","createOn","wrapSubscribeFunction","target","createWrapSubscribeFunction","emptyFunction","isNextFunction","args","innerSubscribe","subscribe","unsubscribe","on","createAddRecorderAudioWorkletModule","blobConstructor","urlConstructor","worklet","addAudioWorkletModule","createListener","ongoingRequest","createPostMessageFactory","createRecorderAudioWorkletNodeFactory","createPostMessage","validateState","audioWorkletNodeConstructor","context","audioWorkletNode","postMessage","state","encoderPort","expectedStates","currentState","expectedState","addRecorderAudioWorkletModule","createRecorderAudioWorkletNode","createExtendedExponentialRampToValueAutomationEvent","endTime","insertTime","createExtendedLinearRampToValueAutomationEvent","createSetValueAutomationEvent","startTime","createSetValueCurveAutomationEvent","values","duration","getTargetValueAtTime","time","valueAtStartTime","timeConstant","isExponentialRampToValueAutomationEvent","automationEvent","isLinearRampToValueAutomationEvent","isAnyRampToValueAutomationEvent","isSetValueAutomationEvent","isSetValueCurveAutomationEvent","getValueOfAutomationEventAtIndexAtTime","automationEvents","index","defaultValue","getEndTimeAndValueOfPreviousAutomationEvent","currentAutomationEvent","nextAutomationEvent","isCancelAndHoldAutomationEvent","isCancelScheduledValuesAutomationEvent","getEventTime","getExponentialRampValueAtTime","getLinearRampValueAtTime","interpolateValue","theoreticIndex","lowerIndex","upperIndex","getValueCurveValueAtTime","isSetTargetAutomationEvent","AutomationEventList","eventTime","removedAutomationEvent","lastAutomationEvent","startValue","truncatedAutomationEvent","ratio","fraction","factor","previousAutomationEvent","persistentAutomationEvent","remainingAutomationEvents","firstRemainingAutomationEvent","indexOfNextEvent","indexOfCurrentEvent","createCancelAndHoldAutomationEvent","cancelTime","createCancelScheduledValuesAutomationEvent","createExponentialRampToValueAutomationEvent","createLinearRampToValueAutomationEvent","createSetTargetAutomationEvent","createAbortError","createAddActiveInputConnectionToAudioNode","insertElementInSet","activeInputs","source","output","input","eventListener","ignoreDuplicates","activeInputConnection","createAddAudioNodeConnections","audioNodeConnectionsStore","audioNode","audioNodeRenderer","nativeAudioNode","createAddAudioParamConnections","audioParamConnectionsStore","audioParam","audioParamRenderer","ACTIVE_AUDIO_NODE_STORE","AUDIO_NODE_CONNECTIONS_STORE","AUDIO_NODE_STORE","AUDIO_PARAM_CONNECTIONS_STORE","AUDIO_PARAM_STORE","CONTEXT_STORE","EVENT_LISTENERS","CYCLE_COUNTERS","NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS","NODE_TO_PROCESSOR_MAPS","isConstructible","constructible","proxy","IMPORT_STATEMENT_REGEX","splitImportStatements","importStatements","sourceWithoutImportStatements","unresolvedUrl","importStatementWithResolvedUrl","verifyParameterDescriptors","parameterDescriptors","verifyProcessorCtor","processorCtor","createAddAudioWorkletModule","cacheTestResult","evaluateSource","exposeCurrentFrameAndCurrentTime","fetchSource","getNativeContext","getOrCreateBackupOfflineAudioContext","isNativeOfflineAudioContext","nativeAudioWorkletNodeConstructor","resolvedRequests","testAudioWorkletProcessorPostMessageSupport","moduleURL","resolvedRequestsOfContext","ongoingRequestsOfContext","promiseOfOngoingRequest","nativeContext","promise","absoluteUrl","wrappedSource","evaluateAudioWorkletGlobalScope","name","nodeNameToProcessorConstructorMap","isSupportingPostMessage","currentIndex","backupOfflineAudioContext","nativeContextOrBackupOfflineAudioContext","updatedResolvedRequestsOfContext","updatedOngoingRequestsOfContext","getValueForKey","map","pickElementFromSet","predicate","matchingElements","matchingElement","deletePassiveInputConnectionToAudioNode","passiveInputs","passiveInputConnections","matchingConnection","passiveInputConnection","getEventListenersOfAudioNode","setInternalStateToActive","isAudioWorkletNode","setInternalStateToPassive","setInternalStateToPassiveWhenNecessary","connections","createAddConnectionToAudioNode","addActiveInputConnectionToAudioNode","addPassiveInputConnectionToAudioNode","connectNativeAudioNodeToNativeAudioNode","deleteActiveInputConnectionToAudioNode","disconnectNativeAudioNodeFromNativeAudioNode","getAudioNodeConnections","getAudioNodeTailTime","getNativeAudioNode","isActiveAudioNode","isPartOfACycle","isPassiveAudioNode","tailTimeTimeoutIds","destination","isOffline","outputs","eventListeners","nativeDestinationAudioNode","nativeSourceAudioNode","partialConnection","tailTime","tailTimeTimeoutId","outputConnection","createAddPassiveInputConnectionToAudioNode","createAddSilentConnection","createNativeGainNode","nativeAudioScheduledSourceNode","nativeGainNode","disconnect","createAddUnrenderedAudioWorkletNode","getUnrenderedAudioWorkletNodes","isOwnedByContext","testAudioBufferCopyChannelMethodsOutOfBoundsSupport","nativeAudioBuffer","createIndexSizeError","wrapAudioBufferGetChannelDataMethod","audioBuffer","getChannelData","channel","DEFAULT_OPTIONS","createAudioBufferConstructor","audioBufferStore","nativeAudioBufferConstructor","nativeOfflineAudioContextConstructor","testNativeAudioBufferConstructorSupport","wrapAudioBufferCopyChannelMethods","wrapAudioBufferCopyChannelMethodsOutOfBounds","nativeOfflineAudioContext","AudioBuffer","numberOfChannels","instance","MOST_NEGATIVE_SINGLE_FLOAT","MOST_POSITIVE_SINGLE_FLOAT","createAudioBufferSourceNodeConstructor","audioNodeConstructor","createAudioBufferSourceNodeRenderer","createAudioParam","createNativeAudioBufferSourceNode","mergedOptions","nativeAudioBufferSourceNode","audioBufferSourceNodeRenderer","wrappedListener","nativeOnEnded","when","resetInternalStateToPassive","createAudioBufferSourceNodeRendererFactory","connectAudioParam","renderAutomation","renderInputsOfAudioNode","renderedNativeAudioBufferSourceNodes","createAudioBufferSourceNode","nativeAudioBufferSourceNodeIsOwnedByContext","renderedNativeAudioBufferSourceNode","isAudioBufferSourceNode","isBiquadFilterNode","isConstantSourceNode","isGainNode","isOscillatorNode","isStereoPannerNode","getAudioParamConnections","deactivateActiveAudioNodeInputConnections","trace","audioParams","audioParamConnections","deactivateAudioGraph","isValidLatencyHint","latencyHint","createAudioDestinationNodeConstructor","createAudioDestinationNodeRenderer","createNativeAudioDestinationNode","nativeAudioDestinationNode","audioDestinationNodeRenderer","renderedNativeAudioDestinationNodes","createAudioDestinationNode","renderedNativeAudioDestinationNode","createAudioListenerFactory","createNativeChannelMergerNode","createNativeConstantSourceNode","createNativeScriptProcessorNode","getFirstSample","overwriteAccessors","nativeListener","createFakeAudioParams","buffer","channelMergerNode","isScriptProcessorNodeCreated","lastOrientation","lastPosition","createScriptProcessorNode","scriptProcessorNode","inputBuffer","orientation","positon","createSetOrientation","createSetPosition","createFakeAudioParam","initialValue","setValue","constantSourceNode","get","cancelAndHoldAtTime","cancelScheduledValues","exponentialRampToValueAtTime","linearRampToValueAtTime","setTargetAtTime","setValueAtTime","setValueCurveAtTime","forwardX","forwardY","forwardZ","positionX","positionY","positionZ","upX","upY","upZ","isAudioNode","audioNodeOrAudioParam","isAudioNodeOutputConnection","element","lmnt","addActiveInputConnectionToAudioParam","addPassiveInputConnectionToAudioParam","isNativeAudioNodeFaker","nativeAudioNodeOrNativeAudioNodeFaker","fakeNativeDestinationAudioNode","deleteActiveInputConnection","activeInputConnections","deleteActiveInputConnectionToAudioParam","deleteEventListenerOfAudioNode","deletePassiveInputConnectionToAudioParam","getNativeAudioParam","testAudioNodeDisconnectMethodSupport","nativeAudioContext","analyzer","dummy","ones","channelData","chnnlDt","sample","visitEachAudioNodeOnce","cycles","visitor","counts","cycle","count","isNativeAudioNode","nativeAudioNodeOrAudioParam","wrapAudioNodeDisconnectMethod","connect","returnValue","connectionsToDestination","connection","destinationOrOutput","filteredConnections","addConnectionToAudioParamOfAudioContext","nativeAudioParam","deleteInputConnectionOfAudioNode","deleteInputConnectionOfAudioParam","deleteInputsOfAudioNode","deleteInputsOfAudioParam","deleteAnyConnection","audioNodeConnectionsOfSource","destinations","deleteConnectionAtOutput","deleteConnectionToDestination","createAudioNodeConstructor","addAudioNodeConnections","addConnectionToAudioNode","createIncrementCycleCounter","createInvalidAccessError","decrementCycleCounter","detectCycles","isNativeAudioContext","isNativeAudioParam","isPassive","createAudioParamFactory","addAudioParamConnections","audioParamAudioNodeStore","audioParamStore","createAudioParamRenderer","nativeAudioContextConstructor","setValueAtTimeUntilPossible","isAudioParamOfOfflineAudioContext","maxValue","minValue","automationEventList","previousLastEvent","currentLastEvent","currentTime","convertedValues","firstSample","lastSample","numberOfInterpolatedValues","interpolatedValues","timeOfLastSample","ReadOnlyMap","parameters","callback","thisArg","createAudioWorkletNodeConstructor","addUnrenderedAudioWorkletNode","createAudioWorkletNodeRenderer","createNativeAudioWorkletNode","getBackupOfflineAudioContext","sanitizeAudioWorkletNodeOptions","setActiveAudioWorkletNodeInputs","testAudioWorkletNodeOptionsClonability","_a","processorConstructor","nativeAudioWorkletNode","audioWorkletNodeRenderer","nm","nativeOnProcessorError","copyFromChannel","parent","channelNumber","bufferOffset","slicedInput","copyToChannel","createNestedArrays","x","y","arrays","array","getAudioWorkletProcessor","nodeToProcessorMap","processBuffer","renderedBuffer","outputChannelCount","numberOfInputChannels","numberOfOutputChannels","sum","processedBuffer","audioNodeConnections","audioWorkletProcessor","inputs","prmtrs","k","potentiallyEmptyInputs","activeSourceFlag","outputChannelSplitterNodeOutput","createAudioWorkletNodeRendererFactory","connectMultipleOutputs","createNativeChannelSplitterNode","deleteUnrenderedAudioWorkletNode","disconnectMultipleOutputs","renderNativeOfflineAudioContext","renderedNativeAudioNodes","processedBufferPromise","createAudioNode","nativeOutputNodes","nativeAudioWorkletNodeIsOwnedByContext","outputChannelSplitterNode","outputChannelMergerNodes","outputGainNode","numberOfParameters","partialOfflineAudioContext","gainNodes","inputChannelSplitterNodes","constantSourceNodes","inputChannelMergerNode","gainNode","audioBufferSourceNode","outputChannelMergerNode","renderedNativeAudioWorkletNodeOrGainNode","createCacheTestResult","ongoingTests","testResults","tester","test","cachedTestResult","ongoingTest","synchronousTestResult","finalTestResult","createConnectAudioParam","renderInputsOfAudioParam","createConnectMultipleOutputs","outputAudioNodes","outputAudioNode","createConvertNumberToUnsignedLong","unit32Array","createDecrementCycleCounter","cycleCounters","cycleCounter","nativeDestinationAudioParam","createDeleteActiveInputConnectionToAudioNode","createDeleteUnrenderedAudioWorkletNode","isDelayNode","createDetectCycles","chain","nextLink","mergedCycles","nestedCycles","getOutputAudioNodeAtIndex","createDisconnectMultipleOutputs","createEvaluateSource","head","script","originalOnErrorHandler","removeErrorEventListenerAndRevokeUrl","src","lineno","colno","_nativeEventTarget","createExposeCurrentFrameAndCurrentTime","fn","createFetchSource","createGetActiveAudioWorkletNodeInputs","activeAudioWorkletNodeInputsStore","createGetAudioNodeRenderer","createGetAudioNodeTailTime","audioNodeTailTimeStore","createGetAudioParamRenderer","createGetBackupOfflineAudioContext","backupOfflineAudioContextStore","createGetNativeContext","contextStore","createGetOrCreateBackupOfflineAudioContext","createGetUnrenderedAudioWorkletNodes","unrenderedAudioWorkletNodeStore","unrenderedAudioWorkletNodes","createIncrementCycleCounterFactory","createIsNativeAudioContext","anything","createIsNativeAudioNode","createIsNativeAudioParam","createIsNativeOfflineAudioContext","createIsSecureContext","createMediaStreamAudioSourceNodeConstructor","createNativeMediaStreamAudioSourceNode","nativeMediaStreamAudioSourceNode","createMinimalAudioContextConstructor","createUnknownError","minimalBaseAudioContextConstructor","revokeState","resolvePromise","createMinimalBaseAudioContextConstructor","audioDestinationNodeConstructor","createAudioListener","_nativeContext","nativeOnStateChange","testPromiseSupport","uint32Array","createMonitorConnections","whenConnected","whenDisconnected","wasDisconnected","wasConnected","isDisconnected","assignNativeAudioNodeOption","option","assignNativeAudioNodeOptions","createNativeAudioBufferConstructor","assignNativeAudioNodeAudioParamValue","wrapAudioBufferSourceNodeStartMethodConsecutiveCalls","isScheduled","wrapAudioScheduledSourceNodeStartMethodNegativeParameters","wrapAudioScheduledSourceNodeStopMethodNegativeParameters","createNativeAudioBufferSourceNodeFactory","addSilentConnection","testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport","testAudioBufferSourceNodeStartMethodOffsetClampingSupport","testAudioBufferSourceNodeStopMethodNullifiedBufferSupport","testAudioScheduledSourceNodeStartMethodNegativeParametersSupport","testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport","testAudioScheduledSourceNodeStopMethodNegativeParametersSupport","wrapAudioBufferSourceNodeStartMethodOffsetClampling","wrapAudioBufferSourceNodeStopMethodNullifiedBuffer","wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls","createNativeAudioContextConstructor","createNativeAudioDestinationNodeFactory","isNodeOfNativeOfflineAudioContext","createNativeAudioWorkletNodeConstructor","testClonabilityOfAudioWorkletNodeOptions","audioWorkletNodeOptions","createNativeAudioWorkletNodeFactory","createNativeAudioWorkletNodeFaker","monitorConnections","baseLatency","patchedEventListeners","onprocessorerror","unpatchedEventListener","computeBufferSize","cloneAudioWorkletNodeOptions","createAudioWorkletProcessorPromise","clonedAudioWorkletNodeOptions","createAudioWorkletProcessor","audioWorkletProcessorPromise","createNativeAudioWorkletNodeFakerFactory","getActiveAudioWorkletNodeInputs","messageChannel","bufferSize","parameterMap","channelInterpretation","nativeAudioWorkletNodeFaker","_","onmessage","dWrkltPrcssr","disconnectOutputsGraph","activeInputIndexes","outputBuffer","isConnected","disconnectFakeGraph","connectFakeGraph","createNativeChannelMergerNodeFactory","wrapChannelMergerNode","nativeChannelMergerNode","wrapChannelSplitterNode","channelSplitterNode","nativeChannelSplitterNode","createNativeConstantSourceNodeFactory","createNativeConstantSourceNodeFaker","nativeConstantSourceNode","interceptConnections","original","interceptor","createNativeConstantSourceNodeFakerFactory","audioNodeOptions","nativeConstantSourceNodeFaker","mediaStream","audioStreamTracks","a","b","filteredAudioStreamTracks","createNativeOfflineAudioContextConstructor","createRenderAutomation","getAudioParamRenderer","createRenderInputsOfAudioNode","getAudioNodeRenderer","renderedNativeAudioNode","allRenderingPromises","renderingPromises","createRenderInputsOfAudioParam","createRenderNativeOfflineAudioContext","testOfflineAudioContextCurrentTimeSupport","isOfflineAudioContextCurrentTimeSupported","createSetActiveAudioWorkletNodeInputs","createTestAudioBufferConstructorSupport","createTestAudioWorkletProcessorPostMessageSupport","offlineAudioContext","isEmittingMessageEvents","isEmittingProcessorErrorEvents","oscillator","createTestOfflineAudioContextCurrentTimeSupport","createWindow","createWrapAudioBufferCopyChannelMethods","convertNumberToUnsignedLong","channelNumberAsNumber","bufferOffsetAsNumber","audioBufferLength","destinationLength","sourceLength","createWrapAudioBufferCopyChannelMethodsOutOfBounds","createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer","nullifiedBuffer","createWrapChannelMergerNode","object","property","createGetter","createSetter","prototype","wrapAudioBufferSourceNodeStartMethodOffsetClamping","clampedOffset","disconnectGainNode","isStopped","descriptor","audioBufferConstructor","audioBufferSourceNodeConstructor","isSecureContext","mediaStreamAudioSourceNodeConstructor","minimalAudioContextConstructor","ERROR_MESSAGE","createPromisedAudioNodesEncoderInstanceIdAndPort","audioContext","AudioWorkletNode","AudioBufferSourceNode","mediaStreamAudioSourceNode","MediaStreamAudioSourceNode","recorderAudioWorkletNode","createWebAudioMediaRecorderFactory","createBlobEvent","eventTarget","MinimalAudioContext","bufferedArrayBuffers","promisedAudioWorkletModule","abortRecording","intervalId","promisedAudioNodesAndEncoderInstanceId","promisedPartialRecording","isAudioContextRunning","dispatchDataAvailableEvent","requestNextPartialRecording","resume","suspend","audioTracks","tracks","currentTracks","track","MultiBufferDataView","buffers","byteOffset","byteLength","availableBytes","dataViews","effectiveByteLength","truncatedBuffers","consumedByteLength","truncatedByteOffset","byteLengthOfDataView","littleEndian","byteOffsetOfDataView","byteOffsetOfNextDataView","createWebmPcmMediaRecorderFactory","decodeWebMChunk","stopRecording","audioTrack","isRecording","pendingInvocations","promisedDataViewElementTypeEncoderInstanceIdAndPort","promisedArrayBuffer","arrayBuffer","currentDataView","remainingDataView","byte","mediaRecorderConstructor","ports","encoderRegex","rgstr","recordingId","typedArrays","extendableMediaRecorderWavEncoder","NcButton","MicrophoneOutlineIcon","CheckIcon","CloseIcon","seconds","newValue","exception","showError","MediaRecorder","wavBlob","_createBlock","_component_NcButton","_createVNode","_component_MicrophoneOutlineIcon","_component_CloseIcon","_toDisplayString","_component_CheckIcon","uploadEndpointUrl","UploadOutlineIcon","NcLoadingIcon","files","f","responses","file","formData","_component_NcLoadingIcon","_component_UploadOutlineIcon","_createTextVNode","FolderPlusOutlineIcon","getFilePickerBuilder","nodes","_component_FolderPlusOutlineIcon","AudioRecorderWrapper","ChooseInputFileButton","UploadInputFileButton","TrayArrowDownIcon","ShareVariantIcon","ContentSaveOutlineIcon","SHAPE_TYPE_NAMES","ImageDisplay","AudioDisplay","FileDisplay","VALID_IMAGE_MIME_TYPES","VALID_AUDIO_MIME_TYPES","VALID_VIDEO_MIME_TYPES","shareToken","shareUrl","savedPath","savedFileId","directUrl","openMessage","showSuccess","afterCopyMessage","_component_UploadInputFileButton","$data","_component_ChooseInputFileButton","_component_AudioRecorderWrapper","_normalizeClass","_resolveDynamicComponent","_hoisted_5","_component_TrayArrowDownIcon","_component_ContentSaveOutlineIcon","_component_ShareVariantIcon","_hoisted_7"],"mappings":"+hBAoBA,MAAKA,GAAU,CACb,KAAM,YACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,+GAA+G,iDAX3HC,EAeO,OAfPC,GAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,kCACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,M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kFAEPN,EAAA,QAAK,UAAhBH,EAiDM,MAAA,OAhDL,MAAKw7B,GAAA,CAAC,cAAa,CAAA,IACJ/6B,EAAA,QAAO,CAAA,KAItBF,EAAA,EAAAk4B,GAMkCgD,GANlBh7B,EAAA,gBAAgB,EAAA,CAC9B,UAASN,EAAA,MACT,UAASM,EAAA,sBAAqB,EAC9B,cAAa,GACb,YAAWN,EAAA,SACX,UAAW,GACX,QAAcM,EAAA,qEACLN,EAAA,UAAXI,IAAAP,EAwBM,MAxBN07B,GAwBM,CAtBLp7B,EAOI,IAAA,CAPA,KAAMG,EAAA,eAAc,EACvB,OAAO,WACPk4B,EAIWD,EAAA,CAJA,MAAOx4B,EAAA,EAAC,YAAA,qBAAA,IACP,QACV,IAAqB,CAArBy4B,EAAqBgD,CAAA,6BAIxBhD,EAMWD,EAAA,CALT,MAAOx4B,EAAA,EAAC,YAAA,iBAAA,EACR,QAAOO,EAAA,SACG,QACV,IAA0B,CAA1Bk4B,EAA0BiD,CAAA,gCAG5BjD,EAMWD,EAAA,CALT,MAAOx4B,EAAA,EAAC,YAAA,kBAAA,EACR,QAAOO,EAAA,UACG,QACV,IAAoB,CAApBk4B,EAAoBkD,CAAA,oCAIvBt7B,IAAAP,EAUM,MAVN87B,GAUM,CARLnD,EAOWD,EAAA,CANV,QAAQ,WACP,MAAOx4B,EAAA,EAAC,YAAA,aAAA,EACR,QAAOO,EAAA,UACG,QACV,IAAa,CAAbk4B,EAAaE,CAAA","x_google_ignoreList":[0,1,2,3,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,250,252]}