rx-player 3.26.2 → 3.27.0-dev.20220317
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/perfs.yml +22 -0
- package/CHANGELOG.md +33 -1
- package/FILES.md +5 -4
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/browser_detection.d.ts +4 -2
- package/dist/_esm5.processed/compat/browser_detection.js +4 -2
- package/dist/_esm5.processed/compat/eme/close_session.d.ts +11 -5
- package/dist/_esm5.processed/compat/eme/close_session.js +144 -36
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +3 -5
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +27 -24
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +53 -34
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +43 -41
- package/dist/_esm5.processed/compat/eme/generate_key_request.d.ts +2 -3
- package/dist/_esm5.processed/compat/eme/generate_key_request.js +22 -26
- package/dist/_esm5.processed/compat/eme/load_session.d.ts +1 -2
- package/dist/_esm5.processed/compat/eme/load_session.js +68 -17
- package/dist/_esm5.processed/compat/event_listeners.js +2 -1
- package/dist/_esm5.processed/compat/should_favour_custom_safari_EME.js +2 -2
- package/dist/_esm5.processed/config.d.ts +166 -1080
- package/dist/_esm5.processed/config.js +17 -1119
- package/dist/_esm5.processed/core/abr/bandwidth_estimator.js +4 -1
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.d.ts +28 -6
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.js +63 -12
- package/dist/_esm5.processed/core/abr/network_analyzer.d.ts +1 -1
- package/dist/_esm5.processed/core/abr/network_analyzer.js +2 -1
- package/dist/_esm5.processed/core/abr/pending_requests_store.js +3 -5
- package/dist/_esm5.processed/core/abr/representation_estimator.d.ts +1 -1
- package/dist/_esm5.processed/core/abr/representation_estimator.js +2 -2
- package/dist/_esm5.processed/core/api/get_player_state.js +1 -1
- package/dist/_esm5.processed/core/api/index.d.ts +2 -1
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.d.ts +6 -0
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.js +22 -4
- package/dist/_esm5.processed/core/api/option_utils.d.ts +3 -1
- package/dist/_esm5.processed/core/api/option_utils.js +19 -6
- package/dist/_esm5.processed/core/api/playback_observer.js +5 -1
- package/dist/_esm5.processed/core/api/public_api.d.ts +82 -71
- package/dist/_esm5.processed/core/api/public_api.js +72 -33
- package/dist/_esm5.processed/core/api/track_choice_manager.d.ts +6 -6
- package/dist/_esm5.processed/core/{eme → decrypt}/__tests__/__global__/utils.d.ts +7 -51
- package/dist/_esm5.processed/core/{eme → decrypt}/__tests__/__global__/utils.js +30 -75
- package/dist/_esm5.processed/core/{eme → decrypt}/attach_media_keys.d.ts +12 -12
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +104 -0
- package/dist/_esm5.processed/core/{eme/clear_eme_session.d.ts → decrypt/clear_on_stop.d.ts} +3 -4
- package/dist/_esm5.processed/core/decrypt/clear_on_stop.js +41 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +216 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +866 -0
- package/dist/_esm5.processed/core/{eme/get_session.d.ts → decrypt/create_or_load_session.d.ts} +28 -26
- package/dist/_esm5.processed/core/decrypt/create_or_load_session.js +124 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/create_session.d.ts +22 -19
- package/dist/_esm5.processed/core/decrypt/create_session.js +174 -0
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.d.ts +21 -0
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +81 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/find_key_system.d.ts +11 -14
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +300 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/get_current_key_system.d.ts +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/get_current_key_system.js +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt}/get_media_keys.d.ts +13 -5
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +153 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/index.d.ts +5 -6
- package/dist/_esm5.processed/core/{eme → decrypt}/index.js +5 -5
- package/dist/_esm5.processed/core/{eme → decrypt}/init_media_keys.d.ts +6 -4
- package/dist/_esm5.processed/core/decrypt/init_media_keys.js +82 -0
- package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +77 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/session_events_listener.js +25 -24
- package/dist/_esm5.processed/core/{eme → decrypt}/set_server_certificate.d.ts +15 -6
- package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +141 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/types.d.ts +120 -242
- package/dist/_esm5.processed/core/{eme → decrypt}/types.js +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/are_init_values_compatible.d.ts +3 -3
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/are_init_values_compatible.js +5 -5
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/check_key_statuses.d.ts +2 -2
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/check_key_statuses.js +4 -3
- package/dist/_esm5.processed/core/{eme/utils/close_session.d.ts → decrypt/utils/clean_old_loaded_sessions.d.ts} +8 -7
- package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +85 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.d.ts +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.js +2 -2
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/get_drm_system_id.d.ts +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/get_drm_system_id.js +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.d.ts +69 -0
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.js +99 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/is_session_usable.d.ts +0 -1
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/is_session_usable.js +4 -5
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.d.ts +44 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.js +77 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.d.ts +104 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.js +155 -0
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.d.ts +108 -0
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +303 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/media_keys_infos_store.d.ts +4 -4
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/media_keys_infos_store.js +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/persistent_sessions_store.d.ts +8 -18
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/persistent_sessions_store.js +119 -97
- package/dist/_esm5.processed/core/{eme/utils/init_data_container.d.ts → decrypt/utils/serializable_bytes.d.ts} +8 -5
- package/dist/_esm5.processed/core/{eme/utils/init_data_container.js → decrypt/utils/serializable_bytes.js} +9 -9
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/server_certificate_store.d.ts +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/server_certificate_store.js +1 -1
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +4 -4
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +3 -3
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +6 -2
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
- package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +1 -1
- package/dist/_esm5.processed/core/init/get_initial_time.js +1 -1
- package/dist/_esm5.processed/core/init/initialize_directfile.d.ts +3 -3
- package/dist/_esm5.processed/core/init/initialize_directfile.js +11 -17
- package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +5 -3
- package/dist/_esm5.processed/core/init/initialize_media_source.js +18 -69
- package/dist/_esm5.processed/core/init/link_drm_and_content.d.ts +61 -0
- package/dist/_esm5.processed/core/init/link_drm_and_content.js +94 -0
- package/dist/_esm5.processed/core/init/manifest_update_scheduler.d.ts +4 -4
- package/dist/_esm5.processed/core/init/manifest_update_scheduler.js +2 -1
- package/dist/_esm5.processed/core/init/stall_avoider.js +1 -1
- package/dist/_esm5.processed/core/init/stream_events_emitter/are_same_stream_events.d.ts +4 -4
- package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.js +1 -1
- package/dist/_esm5.processed/core/init/stream_events_emitter/types.d.ts +2 -2
- package/dist/_esm5.processed/core/init/types.d.ts +2 -4
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +3 -3
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +3 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +32 -31
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +4 -4
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +17 -1
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +22 -5
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +2 -1
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +6 -3
- package/dist/_esm5.processed/core/stream/events_generators.d.ts +8 -3
- package/dist/_esm5.processed/core/stream/events_generators.js +3 -2
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +1 -0
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.js +2 -1
- package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.js +1 -1
- package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +2 -1
- package/dist/_esm5.processed/core/stream/period/period_stream.js +3 -3
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +5 -6
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.d.ts +6 -1
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.js +12 -9
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.d.ts +19 -14
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.js +86 -10
- package/dist/_esm5.processed/core/stream/representation/get_segment_priority.js +1 -1
- package/dist/_esm5.processed/core/stream/representation/push_media_segment.js +3 -3
- package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +6 -0
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +19 -8
- package/dist/_esm5.processed/core/stream/types.d.ts +1 -1
- package/dist/_esm5.processed/default_config.d.ts +1114 -0
- package/dist/_esm5.processed/default_config.js +1145 -0
- package/dist/_esm5.processed/errors/request_error.js +3 -1
- package/dist/_esm5.processed/experimental/index.d.ts +2 -0
- package/dist/_esm5.processed/experimental/index.js +2 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/push_data.d.ts +1 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +2 -4
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +3 -3
- package/dist/_esm5.processed/features/features_object.js +1 -1
- package/dist/_esm5.processed/features/initialize_features.js +1 -1
- package/dist/_esm5.processed/features/list/eme.d.ts +3 -3
- package/dist/_esm5.processed/features/list/eme.js +5 -5
- package/dist/_esm5.processed/features/types.d.ts +3 -3
- package/dist/_esm5.processed/manifest/adaptation.d.ts +2 -2
- package/dist/_esm5.processed/manifest/adaptation.js +3 -1
- package/dist/_esm5.processed/manifest/manifest.d.ts +10 -23
- package/dist/_esm5.processed/manifest/manifest.js +10 -74
- package/dist/_esm5.processed/manifest/period.d.ts +3 -3
- package/dist/_esm5.processed/manifest/representation.d.ts +37 -5
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +18 -18
- package/dist/_esm5.processed/manifest/types.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_hdr_information.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +6 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/is_period_fulfilled.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +14 -14
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +17 -17
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +28 -20
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +20 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +17 -35
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +109 -96
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +8 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +18 -27
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +25 -23
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +21 -15
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +19 -19
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +15 -38
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +8 -8
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +30 -30
- package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +7 -7
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +1 -0
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +8 -8
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +28 -28
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +15 -5
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.d.ts +11 -1
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.js +31 -19
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.d.ts +2 -2
- package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_cue_block.d.ts +1 -1
- package/dist/_esm5.processed/public_types.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +2 -1
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +4 -1
- package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
- package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/dash/segment_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/segment_parser.js +6 -3
- package/dist/_esm5.processed/transports/dash/text_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/text_loader.js +1 -1
- package/dist/_esm5.processed/transports/dash/text_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/text_parser.js +8 -2
- package/dist/_esm5.processed/transports/local/segment_loader.d.ts +1 -2
- package/dist/_esm5.processed/transports/local/segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/local/segment_parser.js +4 -1
- package/dist/_esm5.processed/transports/local/text_parser.js +8 -2
- package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +1 -1
- package/dist/_esm5.processed/transports/smooth/pipelines.js +69 -11
- package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +0 -1
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/types.d.ts +58 -30
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -1
- package/dist/_esm5.processed/transports/utils/generate_manifest_loader.d.ts +1 -1
- package/dist/_esm5.processed/utils/cancellable_sleep.js +1 -1
- package/dist/_esm5.processed/utils/cast_to_observable.d.ts +1 -2
- package/dist/_esm5.processed/utils/cast_to_observable.js +1 -1
- package/dist/_esm5.processed/utils/deep_merge.d.ts +12 -0
- package/dist/_esm5.processed/utils/deep_merge.js +53 -0
- package/dist/_esm5.processed/utils/reference.d.ts +29 -0
- package/dist/_esm5.processed/utils/reference.js +72 -24
- package/dist/_esm5.processed/utils/request/fetch.d.ts +4 -5
- package/dist/_esm5.processed/utils/request/fetch.js +8 -6
- package/dist/_esm5.processed/utils/request/xhr.d.ts +6 -6
- package/dist/_esm5.processed/utils/request/xhr.js +3 -2
- package/dist/_esm5.processed/utils/rx-from_cancellable_promise.d.ts +1 -2
- package/dist/_esm5.processed/utils/rx-from_cancellable_promise.js +7 -2
- package/dist/_esm5.processed/utils/task_canceller.d.ts +5 -3
- package/dist/_esm5.processed/utils/task_canceller.js +3 -3
- package/dist/rx-player.js +5242 -3190
- package/dist/rx-player.min.js +1 -1
- package/dummy +1 -0
- package/{dist/_esm5.processed/core/eme/dispose_eme.d.ts → experimental/index.d.ts} +1 -4
- package/{dist/_esm5.processed/core/eme/dispose_media_keys.d.ts → experimental/index.js} +1 -6
- package/package.json +33 -36
- package/scripts/build/templates/experimental/index.d.ts +16 -0
- package/scripts/build/templates/experimental/index.js +16 -0
- package/scripts/doc-generator/generate_header_html.js +6 -7
- package/scripts/doc-generator/generate_page_html.js +3 -4
- package/scripts/doc-generator/generate_page_list_html.js +4 -5
- package/scripts/doc-generator/generate_sidebar_html.js +4 -7
- package/scripts/doc-generator/utils.js +0 -11
- package/scripts/generate_demo_list.js +3 -3
- package/scripts/generate_documentation_list.js +3 -3
- package/scripts/launch_static_server.js +127 -67
- package/scripts/run_standalone_demo.js +1 -0
- package/scripts/start_demo_web_server.js +1 -0
- package/sonar-project.properties +1 -1
- package/src/README.md +6 -6
- package/src/compat/__tests__/fullscreen.test.ts +7 -7
- package/src/compat/__tests__/is_vtt_cue.test.ts +1 -1
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +45 -5
- package/src/compat/browser_detection.ts +4 -2
- package/src/compat/eme/close_session.ts +90 -56
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +1 -1
- package/src/compat/eme/custom_media_keys/index.ts +28 -41
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +63 -46
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +51 -49
- package/src/compat/eme/generate_key_request.ts +25 -33
- package/src/compat/eme/load_session.ts +29 -31
- package/src/compat/event_listeners.ts +2 -1
- package/src/compat/should_favour_custom_safari_EME.ts +5 -2
- package/src/config.ts +17 -1210
- package/src/core/README.md +1 -1
- package/src/core/abr/__tests__/{get_estimate_from_buffer_levels.test.ts → buffer_based_chooser.test.ts} +94 -123
- package/src/core/abr/bandwidth_estimator.ts +4 -4
- package/src/core/abr/buffer_based_chooser.ts +85 -20
- package/src/core/abr/network_analyzer.ts +6 -7
- package/src/core/abr/pending_requests_store.ts +3 -5
- package/src/core/abr/representation_estimator.ts +6 -3
- package/src/core/api/__tests__/get_player_state.test.ts +3 -3
- package/src/core/api/__tests__/option_utils.test.ts +17 -17
- package/src/core/api/get_player_state.ts +1 -1
- package/src/core/api/index.ts +3 -0
- package/src/core/api/media_element_track_choice_manager.ts +22 -3
- package/src/core/api/option_utils.ts +37 -20
- package/src/core/api/playback_observer.ts +12 -8
- package/src/core/api/public_api.ts +152 -112
- package/src/core/api/track_choice_manager.ts +10 -9
- package/src/core/decrypt/README.md +22 -0
- package/src/core/decrypt/__tests__/__global__/get_license.test.ts +418 -0
- package/src/core/decrypt/__tests__/__global__/init_data.test.ts +675 -0
- package/src/core/{eme → decrypt}/__tests__/__global__/media_key_system_access.test.ts +99 -92
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +156 -0
- package/src/core/decrypt/__tests__/__global__/server_certificate.test.ts +262 -0
- package/src/core/{eme → decrypt}/__tests__/__global__/utils.ts +36 -103
- package/src/core/{eme → decrypt}/attach_media_keys.ts +49 -56
- package/src/core/decrypt/clear_on_stop.ts +48 -0
- package/src/core/decrypt/content_decryptor.ts +1158 -0
- package/src/core/decrypt/create_or_load_session.ts +130 -0
- package/src/core/decrypt/create_session.ts +175 -0
- package/src/core/decrypt/dispose_decryption_resources.ts +39 -0
- package/src/core/{eme → decrypt}/find_key_system.ts +126 -134
- package/src/core/{eme → decrypt}/get_current_key_system.ts +1 -1
- package/src/core/decrypt/get_media_keys.ts +145 -0
- package/src/core/{eme → decrypt}/index.ts +11 -8
- package/src/core/decrypt/init_media_keys.ts +51 -0
- package/src/core/{eme → decrypt}/session_events_listener.ts +93 -55
- package/src/core/decrypt/set_server_certificate.ts +104 -0
- package/src/core/{eme → decrypt}/types.ts +129 -259
- package/src/core/{eme → decrypt}/utils/__tests__/are_init_values_compatible.test.ts +1 -1
- package/src/core/{eme → decrypt/utils}/__tests__/clean_old_loaded_sessions.test.ts +29 -71
- package/src/core/{eme → decrypt/utils}/__tests__/clean_old_stored_persistent_info.test.ts +6 -6
- package/src/core/{eme → decrypt}/utils/are_init_values_compatible.ts +9 -9
- package/src/core/{eme → decrypt/utils}/check_key_statuses.ts +6 -5
- package/{dist/_esm5.processed/core/eme/clean_old_loaded_sessions.js → src/core/decrypt/utils/clean_old_loaded_sessions.ts} +20 -20
- package/src/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.ts +3 -3
- package/src/core/{eme → decrypt/utils}/get_drm_system_id.ts +1 -1
- package/src/core/decrypt/utils/init_data_values_container.ts +119 -0
- package/src/core/{eme → decrypt}/utils/is_session_usable.ts +4 -5
- package/src/core/decrypt/utils/key_id_comparison.ts +82 -0
- package/src/core/decrypt/utils/key_session_record.ts +175 -0
- package/src/core/decrypt/utils/loaded_sessions_store.ts +318 -0
- package/src/core/{eme → decrypt/utils}/media_keys_infos_store.ts +4 -4
- package/src/core/{eme → decrypt}/utils/persistent_sessions_store.ts +122 -104
- package/src/core/{eme/utils/init_data_container.ts → decrypt/utils/serializable_bytes.ts} +8 -5
- package/src/core/{eme → decrypt/utils}/server_certificate_store.ts +2 -2
- package/src/core/fetchers/manifest/manifest_fetcher.ts +9 -9
- package/src/core/fetchers/segment/segment_fetcher.ts +10 -7
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +2 -2
- package/src/core/fetchers/utils/try_urls_with_backoff.ts +1 -1
- package/src/core/init/.initialize_media_source.ts.un~ +0 -0
- package/src/core/init/get_initial_time.ts +2 -1
- package/src/core/init/initialize_directfile.ts +19 -22
- package/src/core/init/initialize_media_source.ts +43 -106
- package/src/core/init/link_drm_and_content.ts +176 -0
- package/src/core/init/manifest_update_scheduler.ts +12 -10
- package/src/core/init/stall_avoider.ts +6 -5
- package/src/core/init/stream_events_emitter/are_same_stream_events.ts +4 -4
- package/src/core/init/stream_events_emitter/stream_events_emitter.ts +2 -1
- package/src/core/init/stream_events_emitter/types.ts +2 -2
- package/src/core/init/types.ts +1 -39
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +2 -1
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +6 -7
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +32 -31
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +4 -4
- package/src/core/segment_buffers/inventory/segment_inventory.ts +42 -8
- package/src/core/stream/adaptation/adaptation_stream.ts +7 -1
- package/src/core/stream/events_generators.ts +9 -4
- package/src/core/stream/orchestrator/stream_orchestrator.ts +9 -4
- package/src/core/stream/period/create_empty_adaptation_stream.ts +2 -1
- package/src/core/stream/period/get_adaptation_switch_strategy.ts +1 -1
- package/src/core/stream/period/period_stream.ts +5 -2
- package/src/core/stream/representation/force_garbage_collection.ts +5 -7
- package/src/core/stream/representation/get_buffer_status.ts +28 -16
- package/src/core/stream/representation/get_needed_segments.ts +124 -28
- package/src/core/stream/representation/get_segment_priority.ts +1 -2
- package/src/core/stream/representation/push_media_segment.ts +3 -2
- package/src/core/stream/representation/representation_stream.ts +30 -7
- package/src/core/stream/types.ts +1 -1
- package/src/default_config.ts +1241 -0
- package/src/errors/request_error.ts +4 -1
- package/src/experimental/index.ts +5 -0
- package/src/experimental/tools/VideoThumbnailLoader/push_data.ts +1 -0
- package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +5 -7
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +3 -10
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +4 -4
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +1 -1
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +3 -3
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/types.ts +3 -3
- package/src/features/__tests__/initialize_features.test.ts +2 -2
- package/src/features/features_object.ts +1 -1
- package/src/features/initialize_features.ts +1 -1
- package/src/features/list/__tests__/eme.test.ts +5 -5
- package/src/features/list/eme.ts +5 -5
- package/src/features/types.ts +3 -10
- package/src/manifest/adaptation.ts +6 -4
- package/src/manifest/manifest.ts +16 -86
- package/src/manifest/period.ts +3 -3
- package/src/manifest/representation.ts +38 -5
- package/src/manifest/representation_index/types.ts +18 -18
- package/src/manifest/types.ts +3 -3
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +1 -0
- package/src/parsers/manifest/dash/common/get_hdr_information.ts +1 -1
- package/src/parsers/manifest/dash/common/get_periods_time_infos.ts +3 -3
- package/src/parsers/manifest/dash/common/indexes/base.ts +6 -6
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +4 -2
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +2 -2
- package/src/parsers/manifest/dash/common/indexes/is_period_fulfilled.ts +1 -2
- package/src/parsers/manifest/dash/common/indexes/list.ts +14 -14
- package/src/parsers/manifest/dash/common/indexes/template.ts +18 -18
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +1 -1
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +51 -23
- package/src/parsers/manifest/dash/common/infer_adaptation_type.ts +2 -2
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +1 -1
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +167 -134
- package/src/parsers/manifest/dash/common/parse_mpd.ts +9 -10
- package/src/parsers/manifest/dash/common/parse_periods.ts +80 -79
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +83 -75
- package/src/parsers/manifest/dash/common/parse_representations.ts +44 -63
- package/src/parsers/manifest/dash/node_parser_types.ts +30 -30
- package/src/parsers/manifest/dash/parsers_types.ts +3 -3
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -1
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +4 -4
- package/src/parsers/manifest/smooth/create_parser.ts +24 -21
- package/src/parsers/manifest/smooth/representation_index.ts +14 -14
- package/src/parsers/manifest/types.ts +28 -28
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +31 -33
- package/src/parsers/manifest/utils/clear_timeline_from_position.ts +15 -6
- package/src/parsers/manifest/utils/index_helpers.ts +2 -2
- package/src/parsers/manifest/utils/update_segment_timeline.ts +32 -21
- package/src/parsers/texttracks/webvtt/html/__tests__/create_styled_element.test.ts +1 -0
- package/src/parsers/texttracks/webvtt/html/to_html.ts +2 -2
- package/src/parsers/texttracks/webvtt/parse_cue_block.ts +1 -1
- package/src/public_types.ts +5 -1
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +2 -2
- package/src/transports/dash/image_pipelines.ts +4 -1
- package/src/transports/dash/init_segment_loader.ts +1 -1
- package/src/transports/dash/manifest_parser.ts +1 -1
- package/src/transports/dash/segment_loader.ts +7 -7
- package/src/transports/dash/segment_parser.ts +8 -1
- package/src/transports/dash/text_loader.ts +2 -2
- package/src/transports/dash/text_parser.ts +11 -1
- package/src/transports/local/segment_loader.ts +4 -4
- package/src/transports/local/segment_parser.ts +4 -0
- package/src/transports/local/text_parser.ts +8 -0
- package/src/transports/metaplaylist/manifest_loader.ts +1 -1
- package/src/transports/metaplaylist/pipelines.ts +1 -1
- package/src/transports/smooth/pipelines.ts +29 -16
- package/src/transports/smooth/segment_loader.ts +8 -8
- package/src/transports/types.ts +59 -30
- package/src/transports/utils/call_custom_manifest_loader.ts +6 -6
- package/src/transports/utils/generate_manifest_loader.ts +1 -1
- package/src/utils/__tests__/deep_merge.test.ts +48 -0
- package/src/utils/__tests__/flat_map.test.ts +12 -7
- package/src/utils/cancellable_sleep.ts +1 -1
- package/src/utils/cast_to_observable.ts +1 -2
- package/src/utils/deep_merge.ts +46 -0
- package/src/utils/reference.ts +116 -23
- package/src/utils/request/fetch.ts +17 -15
- package/src/utils/request/xhr.ts +11 -8
- package/src/utils/rx-from_cancellable_promise.ts +8 -4
- package/src/utils/task_canceller.ts +6 -4
- package/tsconfig.json +1 -2
- package/tsconfig.modules.json +1 -2
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.d.ts +0 -29
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.js +0 -67
- package/dist/_esm5.processed/core/eme/attach_media_keys.js +0 -57
- package/dist/_esm5.processed/core/eme/clean_old_loaded_sessions.d.ts +0 -59
- package/dist/_esm5.processed/core/eme/clear_eme_session.js +0 -50
- package/dist/_esm5.processed/core/eme/create_session.js +0 -126
- package/dist/_esm5.processed/core/eme/dispose_eme.js +0 -23
- package/dist/_esm5.processed/core/eme/dispose_media_keys.js +0 -36
- package/dist/_esm5.processed/core/eme/eme_manager.d.ts +0 -31
- package/dist/_esm5.processed/core/eme/eme_manager.js +0 -278
- package/dist/_esm5.processed/core/eme/find_key_system.js +0 -243
- package/dist/_esm5.processed/core/eme/get_media_keys.js +0 -85
- package/dist/_esm5.processed/core/eme/get_session.js +0 -68
- package/dist/_esm5.processed/core/eme/init_media_keys.js +0 -66
- package/dist/_esm5.processed/core/eme/session_events_listener.d.ts +0 -41
- package/dist/_esm5.processed/core/eme/set_server_certificate.js +0 -85
- package/dist/_esm5.processed/core/eme/utils/close_session.js +0 -81
- package/dist/_esm5.processed/core/eme/utils/init_data_store.d.ts +0 -115
- package/dist/_esm5.processed/core/eme/utils/init_data_store.js +0 -181
- package/dist/_esm5.processed/core/eme/utils/loaded_sessions_store.d.ts +0 -123
- package/dist/_esm5.processed/core/eme/utils/loaded_sessions_store.js +0 -173
- package/dist/_esm5.processed/core/init/create_eme_manager.d.ts +0 -34
- package/dist/_esm5.processed/core/init/create_eme_manager.js +0 -52
- package/src/core/abr/get_estimate_from_buffer_levels.ts +0 -85
- package/src/core/eme/README.md +0 -26
- package/src/core/eme/__tests__/__global__/get_license.test.ts +0 -414
- package/src/core/eme/__tests__/__global__/init_data.test.ts +0 -908
- package/src/core/eme/__tests__/__global__/media_keys.test.ts +0 -266
- package/src/core/eme/__tests__/__global__/server_certificate.test.ts +0 -364
- package/src/core/eme/__tests__/init_media_keys.test.ts +0 -182
- package/src/core/eme/clean_old_loaded_sessions.ts +0 -96
- package/src/core/eme/clear_eme_session.ts +0 -62
- package/src/core/eme/create_session.ts +0 -187
- package/src/core/eme/dispose_eme.ts +0 -25
- package/src/core/eme/dispose_media_keys.ts +0 -46
- package/src/core/eme/eme_manager.ts +0 -387
- package/src/core/eme/get_media_keys.ts +0 -141
- package/src/core/eme/get_session.ts +0 -135
- package/src/core/eme/init_media_keys.ts +0 -106
- package/src/core/eme/set_server_certificate.ts +0 -115
- package/src/core/eme/utils/close_session.ts +0 -113
- package/src/core/eme/utils/init_data_store.ts +0 -234
- package/src/core/eme/utils/loaded_sessions_store.ts +0 -235
- package/src/core/init/create_eme_manager.ts +0 -95
package/dist/rx-player.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see rx-player.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={7757:function(e,t,n){e.exports=n(5666)},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{kD:function(){return u},fq:function(){return o},YM:function(){return s},vU:function(){return l},G6:function(){return f},SB:function(){return p},op:function(){return c},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),p=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return L},Y:function(){return j}});var r,i=n(3610),a=n(2817),o=n(9917),s=n(3714),u=n(811),l=n(8117),c=n(3666),d=n(2203),f=n(5059),p=n(3144),v=n(9589),h=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new v.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,p.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),m=n(4578),g=n(6716),y=n(3071),_=n(3505),b=n(1959),T=n(8719);if(!d.Z){var E=window.MSMediaKeys;void 0!==E&&void 0!==E.prototype&&"function"==typeof E.isTypeSupported&&"function"==typeof E.prototype.createSession&&(r=E)}var S,w=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new g.x,n.closed=new v.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new v.Z((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,y.T)(T.GJ(n._ss),T.GV(n._ss),T.Xe(n._ss)).pipe((0,_.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new v.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(b.Z),k=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new w(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!d.Z){var A=window.MozMediaKeys;void 0!==A&&void 0!==A.prototype&&"function"==typeof A.isTypeSupported&&"function"==typeof A.prototype.createSession&&(S=A)}var I=n(9689),Z=n(3635);function x(e){return"function"==typeof e.webkitGenerateKeyRequest}var M=function(e){function t(t,n){var r;return(r=e.call(this)||this)._closeSession$=new g.x,r._vid=t,r._key=n,r.sessionId="",r.closed=new v.Z((function(e){r._closeSession$.subscribe(e)})),r.keyStatuses=new Map,r.expiration=NaN,(0,y.T)(T.GJ(t),T.GV(t),T.Xe(t)).pipe((0,_.R)(r._closeSession$)).subscribe((function(e){return r.trigger(e.type,e)})),r.update=function(e){return new v.Z((function(t,n){try{if(r._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,Z.uR)(i)),o=(0,I.K)(a.keys[0].k),s=(0,I.K)(a.keys[0].kid);t(r._vid.webkitAddKey(r._key,o,s,""))}else t(r._vid.webkitAddKey(r._key,e,null,""))}catch(e){n(e)}}))},r}(0,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new v.Z((function(t){e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},t}(b.Z),R=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!x(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var C=n(6968);var P=n(158);function N(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var O=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._closeSession$=new g.x,i._videoElement=t,i._keyType=n,i.closed=new v.Z((function(e){i._closeSession$.subscribe(e)})),i.keyStatuses=new Map,i.expiration=NaN,i.update=function(e){return new v.Z((function(t,n){if(void 0===i._nativeSession||void 0===i._nativeSession.update||"function"!=typeof i._nativeSession.update)return n("Unavailable WebKit key session.");try{var r;r=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),t(i._nativeSession.update(r))}catch(e){n(e)}}))},i}(0,m.Z)(t,e);var n=t.prototype;return n.listenEvent=function(e){var t=this;(0,y.T)(T.GJ(e),T.GV(e),T.Xe(e)).pipe((0,_.R)(this._closeSession$)).subscribe((function(e){t.trigger(e.type,e)}))},n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,C.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,Z.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,Z.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,C.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,C.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n.listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new v.Z((function(t,n){e._closeSession$.next(),e._closeSession$.complete(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(b.Z),D=function(){function e(e){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new P.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return N(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new O(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,v.Z.resolve()},e}();var L=null,U=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(d.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,f.Z)())L=function(e,t){return(0,l.Z)(navigator.requestMediaKeySystemAccess(e,t))};else{var B,F;if(x(HTMLVideoElement.prototype)){var z={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new R(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof R))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};B=z.isTypeSupported,F=z.createCustomMediaKeys,U=z.setMediaKeys}else if(void 0!==P.t){var K=function(){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:P.t.isTypeSupported,createCustomMediaKeys:function(e){return new D(e)},setMediaKeys:function(e,t){if(null===t)return N(e,t);if(!(t instanceof D))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();B=K.isTypeSupported,F=K.createCustomMediaKeys,U=K.setMediaKeys}else if(c.fq&&void 0!==r){var V={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new k(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof k))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};B=V.isTypeSupported,F=V.createCustomMediaKeys,U=V.setMediaKeys}else if(void 0!==S){var G={isTypeSupported:function(e,t){if(void 0===S)throw new Error("No MozMediaKeys API.");return void 0!==t?S.isTypeSupported(e,t):S.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===S)throw new Error("No MozMediaKeys API.");return new S(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};B=G.isTypeSupported,F=G.createCustomMediaKeys,U=G.setMediaKeys}else{var H=window.MediaKeys,W=function(){if(void 0===H)throw new s.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===H.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};B=function(e){return W(),(0,u.Z)("function"==typeof H.isTypeSupported),H.isTypeSupported(e)},F=function(e){return W(),new H(e)}}L=function(e,t){if(!B(e))return(0,i._)((function(){return new Error("Unsupported key type")}));for(var n=0;n<t.length;n++){var r=t[n],o=r.videoCapabilities,s=r.audioCapabilities,u=r.initDataTypes,l=r.distinctiveIdentifier,c=!0;if(c=(c=c&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var d={videoCapabilities:o,audioCapabilities:s,initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]},f=F(e);return(0,a.of)(new h(e,f,d))}}return(0,i._)((function(){return new Error("Unsupported configuration")}))}}function j(e,t){return(0,o.P)((function(){return(0,l.Z)(U(e,t))}))}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},8719:function(e,t,n){"use strict";n.d(t,{Nh:function(){return F},_K:function(){return V},Oh:function(){return re},C1:function(){return q},Q1:function(){return Y},GV:function(){return ae},Xe:function(){return oe},GJ:function(){return ie},eX:function(){return se},K4:function(){return H},yj:function(){return K},Qt:function(){return $},gg:function(){return ne},ik:function(){return j},d5:function(){return W},UG:function(){return J},ep:function(){return ee},ym:function(){return Q},UA:function(){return X},_E:function(){return te},$x:function(){return G}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(7991),s=n(6362),u=n(4727),l=n(533),c=n(3833),d=n(3994);function f(e,t){return t?function(n){return(0,s.z)(t.pipe((0,u.q)(1),(0,l.l)()),n.pipe(f(e)))}:(0,d.z)((function(t,n){return e(t,n).pipe((0,u.q)(1),(0,c.h)(t))}))}var p=n(6625);function v(e,t){void 0===t&&(t=o.z);var n=(0,p.H)(e,t);return f((function(){return n}))}var h=n(6798),m=n(2566),g=n(7878),y={leading:!0,trailing:!1};function _(e,t,n){void 0===t&&(t=o.z),void 0===n&&(n=y);var r,i,a,s,u,l=(0,p.H)(e,t);return r=function(){return l},s=(a=void 0===(i=n)?y:i).leading,u=a.trailing,(0,h.e)((function(e,t){var n=!1,i=null,a=null,o=!1,l=function(){null==a||a.unsubscribe(),a=null,u&&(f(),o&&t.complete())},c=function(){a=null,o&&t.complete()},d=function(e){return a=(0,g.Xf)(r(e)).subscribe(new m.Q(t,l,c))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!o&&d(e)}};e.subscribe(new m.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(s?f():d(e))}),(function(){o=!0,(!(u&&n&&a)||a.closed)&&t.complete()})))}))}var b=n(2401),T=n(3071),E=n(9917),S=n(9127),w=n(6108),k=n(3741),A=n(4978),I=n(2817),Z=n(2334),x=n(6697),M=n(944),R=n(6923),C=n(2203),P=n(5059),N=["","webkit","moz","ms"],O=M.Z.INACTIVITY_DELAY,D=C.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function L(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function U(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?N:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=L(e,r)),(0,R.Z)(n)?(0,b.R)(e,n):a):T.T.apply(void 0,r.map((function(t){return(0,b.R)(e,t)})))}}function B(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,E.P)((function(){var e=document[n];return(0,b.R)(document,r).pipe((0,S.U)((function(){return!document[n]})),(0,w.O)(!e),(0,k.x)())}))}function F(){return B().pipe((0,A.w)((function(e){return e?(0,I.of)(e):(0,I.of)(e).pipe(v(O))})))}function z(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function K(e){return(0,E.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,b.R)(t,"webkitpresentationmodechanged").pipe((0,S.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,w.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,T.T)((0,b.R)(t,"enterpictureinpicture").pipe((0,S.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,b.R)(t,"leavepictureinpicture").pipe((0,S.U)((function(){return{isEnabled:!1,pipWindow:null}})))).pipe((0,w.O)(r))}))}function V(e){return(0,Z.a)([B(),e]).pipe((0,A.w)((function(e){var t=e[0];return e[1].isEnabled||t?(0,I.of)(!0):(0,I.of)(!1).pipe(v(O))})),(0,k.x)())}function G(e,t){return(0,Z.a)([t,(0,x.F)(2e4).pipe((0,w.O)(null)),(0,b.R)(window,"resize").pipe(_(500),(0,w.O)(null))]).pipe((0,A.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=z(e,r);return(0,b.R)(r,"resize").pipe((0,w.O)(i*D),(0,S.U)((function(){return z(e,r)*D})))}return(0,I.of)(1/0)}return(0,I.of)(e.clientWidth*D)})),(0,k.x)())}var H=U(["loadedmetadata"]),W=U(["seeking"]),j=U(["seeked"]),q=U(["ended"]),Y=(U(["timeupdate"]),U(["fullscreenchange","FullscreenChange"],N.concat("MS"))),$=function(e){return(0,T.T)(U(["play"])(e),U(["pause"])(e))},X=function(e){return(0,T.T)(U(["addtrack"])(e),U(["removetrack"])(e))},Q=U(["sourceopen","webkitsourceopen"]),J=U(["sourceclose","webkitsourceclose"]),ee=U(["sourceended","webkitsourceended"]),te=U(["update"]),ne=U(["onremovesourcebuffer"]),re=U((0,P.Z)()?["needkey"]:["encrypted","needkey"]),ie=U(["keymessage","message"]),ae=U(["keyadded","ready"]),oe=U(["keyerror","error"]),se=U(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return r.G6&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},944:function(e,t){"use strict";t.Z={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:2,after:2.5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4578),i=n(1959),a=n(7829);function o(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function s(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:o.language,id:l,normalized:(0,a.ZP)(o.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:o})}return n}function u(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:o.language,id:l,normalized:(0,a.ZP)(o.language),closedCaption:"captions"===o.kind};n.push({track:c,nativeTrack:o})}return n}function l(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var c=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?s(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?l(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?u(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.enabled=!0,void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){d(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){p(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e].nativeTrack;if(t===this._audioTrackLockedOn)return void(t.enabled=!0)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,a.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var o=this._audioTracks[i];if(o.track.normalized===r&&o.track.audioDescription===n.audioDescription)return void(o.nativeTrack.enabled=!0)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return f(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else d(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void d(this._textTracks);for(var r=(0,a.ZP)(n.language),i=0;i<this._textTracks.length;i++){var o=this._textTracks[i];if(o.track.normalized===r&&o.track.closedCaption===n.closedCaption)return f(this._textTracks,o.nativeTrack),void("showing"!==o.nativeTrack.mode&&(o.nativeTrack.mode="showing"))}}d(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else p(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&p(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=s(e._nativeAudioTracks);if(o(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=s(e._nativeAudioTracks);if(o(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=u(e._nativeTextTracks);if(o(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=u(e._nativeTextTracks);if(o(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=l(e._nativeVideoTracks);if(o(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=l(e._nativeVideoTracks);if(o(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},t}(i.Z);function d(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function f(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function p(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},8281:function(e,t,n){"use strict";n.d(t,{ZP:function(){return tt}});var r=n(3994),i=n(2817),a=n(6362),o=n(8515),s=n(4975),u=n(4727),l=n(2006),c=n(3071),d=n(9127),f=n(3610),p=n(3),v=n(1545),h=n(9878),m=n(533),g=n(8719),y=n(3887),_=n(6490),b=n(4791),T=n(6968),E=n(3635),S=(0,T.pX)((0,E.tG)("pssh"),0);function w(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,b.Z)(t.data,r.data))return!0}return!1}function k(e){var t=e.initData,n=e.initDataType;return null==t?(y.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,T.pX)(e,n+4)!==S)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,T.pX)(new Uint8Array(e),n);if(n+r>e.length)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,_.Y)(i,8),data:i};w(t,a)?y.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var A=n(9917),I=n(2297),Z=n(8117);function x(e,t,n){return(0,A.P)((function(){var r;y.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){y.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,T.pX)(e,i+4)!==S)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,T.pX)(new Uint8Array(e),i);if(i+a>e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,I.Xj)(o),u=null===s?void 0:o[s[1]];y.Z.info("Compat: CENC PSSH found with version",u),void 0===u?y.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,T.zo)(n,o):1===u?(y.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):y.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,T.zo)(r,o);i+=a}if(i!==e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,T.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return(0,Z.Z)(e.generateRequest(i,r)).pipe((0,h.K)((function(t){if(""!==i||!(t instanceof TypeError))throw t;return y.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),(0,Z.Z)(e.generateRequest("cenc",r))})))}))}var M=n(944),R=n(5157),C=n(7714),P=n(7904),N=n(2793),O=n(1946);var D=n(3833),L=n(6108);var U=n(4181),B=n(6625),F=n(5561);function z(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,C.Z)(n,"expired")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,C.Z)(n,"internal-error")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(y.Z.debug("EME: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function K(e,t,n){return(0,A.P)((function(){var a=e.loadedSessionsStore,o=e.persistentSessionsStore;return"temporary"===n?V(a,t):null===o?(y.Z.warn("EME: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),V(a,t)):function(e,t,n){return(0,A.P)((function(){y.Z.info("EME: Creating persistent MediaKeySession");var a=e.createSession(n,"persistent-license"),o=t.getAndReuse(n);if(null===o)return(0,i.of)({type:"created-session",value:{mediaKeySession:a,sessionType:"persistent-license"}});var s=function(){return y.Z.info("EME: Removing previous persistent session."),null!==t.get(n)&&t.delete(n),e.closeSession(n).pipe((0,d.U)((function(){return{type:"created-session",value:{mediaKeySession:e.createSession(n,"persistent-license"),sessionType:"persistent-license"}}})))};return function(e,t){return(0,A.P)((function(){return y.Z.info("Compat/EME: Load persisted session",t),(0,F.Z)((function(){return(0,Z.Z)(e.load(t))}),void 0)})).pipe((0,r.z)((function(t){return!t||e.keyStatuses.size>0?(0,i.of)(t):(0,U.S)((0,B.H)(100),(0,g.eX)(e)).pipe((0,u.q)(1),(0,d.U)((function(){return t})))})))}(a,o.sessionId).pipe((0,r.z)((function(e){return e?e&&z(a)?(t.add(n,a),y.Z.info("EME: Succeeded to load persistent session."),(0,i.of)({type:"loaded-persistent-session",value:{mediaKeySession:a,sessionType:"persistent-license"}})):(y.Z.warn("EME: Previous persistent session not usable anymore."),s()):(y.Z.warn("EME: No data stored for the loaded session"),t.delete(n),(0,i.of)({type:"created-session",value:{mediaKeySession:a,sessionType:"persistent-license"}}))})),(0,h.K)((function(e){return y.Z.warn("EME: Unable to load persistent session: "+(e instanceof Error?e.toString():"Unknown Error")),s()})))}))}(a,o,t)}))}function V(e,t){return(0,A.P)((function(){y.Z.info("EME: Creating a new temporary session");var n=e.createSession(t,"temporary");return(0,i.of)({type:"created-session",value:{mediaKeySession:n,sessionType:"temporary"}})}))}function G(e,t,n,o){return(0,A.P)((function(){var s=null,u=t.loadedSessionsStore,l=t.persistentSessionsStore,f=u.getAndReuse(e);if(null!==f){if(z(s=f.mediaKeySession))return y.Z.info("EME: Reuse loaded session",s.sessionId),(0,i.of)({type:"loaded-open-session",value:{mediaKeySession:s,sessionType:f.sessionType,initializationData:e}});null!==l&&l.delete(e)}return(null!=s?u.closeSession(e):(0,i.of)(null)).pipe((0,r.z)((function(){return(0,a.z)(function(e,t){if(t<0||t>=e.getLength())return v.E;for(var n=[],r=e.getAll().slice(),i=r.length-t,a=0;a<i;a++){var o=r[a],s=e.closeSession(o.initializationData).pipe((0,D.h)({type:"cleaned-old-session",value:o}),(0,L.O)({type:"cleaning-old-session",value:o}));n.push(s)}return c.T.apply(void 0,n)}(u,o),K(t,e,n).pipe((0,d.U)((function(t){return{type:t.type,value:{mediaKeySession:t.value.mediaKeySession,sessionType:t.value.sessionType,initializationData:e}}}))))})))}))}var H=n(5095),W=n(6139),j=n(6033);var q=n(9252);var Y=n(3666);var $=n(9592),X=M.Z.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,Q=M.Z.EME_KEY_SYSTEMS;function J(e,t,n){var r=t.getConfiguration();if(Y.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function ee(e,t){return(0,A.P)((function(){y.Z.info("EME: Searching for compatible MediaKeySystemAccess");var n=j.Z.getState(e);if(null!=n){var r=J(t,n.mediaKeySystemAccess,n.keySystemOptions);if(null!==r)return y.Z.info("EME: Found cached compatible keySystem"),(0,i.of)({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:r.keySystemAccess,options:r.keySystemOptions}})}var a=t.reduce((function(e,t){var n,r=Q[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=0,n=Object.keys(Q);t<n.length;t++){var r=n[t];if((0,C.Z)(Q[r],e))return r}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return function e(t){if(t>=a.length){var n=new R.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");return(0,f._)((function(){return n}))}if(null==W.N){var r=Error("requestMediaKeySystemAccess is not implemented in your browser.");return(0,f._)((function(){return r}))}var i=a[t],o=i.keyName,s=i.keyType,u=i.keySystemOptions,l=function(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?X:[],o=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?X:[];return 0===a.length&&a.push(void 0),0===o.length&&o.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,$.Z)(a,(function(e){return[{contentType:'video/mp4;codecs="avc1.4d401e"',robustness:e},{contentType:'video/mp4;codecs="avc1.42e01e"',robustness:e},{contentType:'video/webm;codecs="vp8"',robustness:e}]})),audioCapabilities:(0,$.Z)(o,(function(e){return[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:e},{contentType:"audio/webm;codecs=opus",robustness:e}]})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}(o,u);return y.Z.debug("EME: Request keysystem access "+s+","+(t+1)+" of "+a.length,l),(0,W.N)(s,l).pipe((0,d.U)((function(e){return y.Z.info("EME: Found compatible keysystem",s,l),{type:"create-media-key-system-access",value:{options:u,mediaKeySystemAccess:e}}})),(0,h.K)((function(){return y.Z.debug("EME: Rejected access to keysystem",s,l),e(t+1)})))}(0)}))}var te=n(2870),ne=new WeakMap,re=function(e){ne.set(e,null)},ie=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,te.Z)(n);ne.set(e,{hash:r,serverCertificate:n})},ae=function(e){var t=ne.get(e);return void 0!==t&&(null!==t||void 0)},oe=function(e,t){var n=ne.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,te.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};var se=M.Z.EME_SESSION_CLOSING_MAX_RETRY,ue=M.Z.EME_SESSION_CLOSING_INITIAL_DELAY,le=M.Z.EME_SESSION_CLOSING_MAX_DELAY;function ce(e){return function n(a){return y.Z.debug("EME: Trying to close a MediaKeySession",e.sessionId,a),function(e){return(0,U.S)((0,Z.Z)(e.close()),(0,B.H)(1e3).pipe((0,r.z)((function(){return(0,Z.Z)(e.update(new Uint8Array(1))).pipe((0,d.U)((function(){throw new Error("Compat: Couldn't know if session is closed")})),(0,h.K)((function(t){if(t instanceof Error&&"The session is already closed."===t.message)return(0,i.of)(null);var n=(0,Z.Z)(e.closed);return(0,U.S)(n,(0,B.H)(1e3).pipe((0,d.U)((function(){throw new Error("Compat: Couldn't know if session is closed")}))))})))}))))}(e).pipe((0,l.b)((function(){y.Z.debug("EME: Succeeded to close MediaKeySession")})),(0,h.K)((function(i){if(!(i instanceof Error)||"InvalidStateError"!==i.name||""!==e.sessionId)return t(i);var o=a+1;if(o>se)return t(i);var s=Math.min(Math.pow(2,a)*ue,le);return y.Z.warn("EME: attempt to close a mediaKeySession failed, scheduling retry...",s),(0,U.S)([(0,B.H)(s),(0,g.eX)(e),(0,g.GJ)(e)]).pipe((0,u.q)(1),(0,r.z)((function(){return n(o)})))})))}(0);function t(e){return y.Z.error("EME: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),(0,i.of)(null)}}var de=n(9689),fe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}();function pe(e,t){var n,r;return null!==(r=null!==(n=ve(e,t))&&void 0!==n?n:ve(t,e))&&void 0!==r&&r}function ve(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?fe.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?fe.decode(a.data):a.data.initData;if(!(0,b.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var l=t[i];if(u.systemId===l.systemId){if(u.hash!==l.hash)return!1;var c=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?fe.decode(u.data):u.data.initData,d=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?fe.decode(l.data):l.data.initData;if(!(0,b.Z)(c,d))return!1;break}}if(r===t.length)return null}return!0}}return null}var he=function(){function e(){this._storage=[]}var t=e.prototype;return t.getAll=function(){return this._storage.map((function(e){return e.payload}))},t.getLength=function(){return this._storage.length},t.isEmpty=function(){return 0===this._storage.length},t.get=function(e){var t=this._findIndex(e);return t>=0?this._storage[t].payload:void 0},t.getAndReuse=function(e){var t=this._findIndex(e);if(-1!==t){var n=this._storage.splice(t,1)[0];return this._storage.push(n),n.payload}},t.store=function(e,t){var n=this._findIndex(e);n>=0&&this._storage.splice(n,1);var r=this._formatValuesForStore(e.values);this._storage.push({type:e.type,values:r,payload:t})},t.storeIfNone=function(e,t){if(this._findIndex(e)>=0)return!1;var n=this._formatValuesForStore(e.values);return this._storage.push({type:e.type,values:n,payload:t}),!0},t.remove=function(e){var t=this._findIndex(e);if(-1!==t)return this._storage.splice(t,1)[0].payload},t._findIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=this._storage.length-1;n>=0;n--){var r=this._storage[n];if(r.type===e.type&&pe(r.values,t))return n}return-1},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,te.Z)(n)}}))},e}(),me=function(){function e(e){this._mediaKeys=e,this._storage=new he}var t=e.prototype;return t.get=function(e){var t=this._storage.get(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.getAndReuse=function(e){var t=this._storage.getAndReuse(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.reuse=function(e){return void 0!==this._storage.getAndReuse(e)},t.createSession=function(e,t){var n=this;if(void 0!==this._storage.get(e))throw new R.Z("MULTIPLE_SESSIONS_SAME_INIT_DATA","This initialization data was already stored.");var r=this._mediaKeys.createSession(t),i={mediaKeySession:r,sessionType:t,initializationData:e};return(0,O.Z)(r.closed)||r.closed.then((function(){var t=n._storage.get(e);void 0!==t&&t.mediaKeySession===r&&n._storage.remove(e)})).catch((function(e){y.Z.warn("EME-LSS: MediaKeySession.closed rejected: "+e)})),y.Z.debug("EME-LSS: Add MediaKeySession",i.sessionType),this._storage.store(e,i),r},t.closeSession=function(e){var t=this;return(0,A.P)((function(){var n=t._storage.remove(e);return void 0===n?(y.Z.warn("EME-LSS: No MediaKeySession found with the given initData and initDataType"),v.E):ce(n.mediaKeySession)}))},t.getLength=function(){return this._storage.getLength()},t.getAll=function(){return this._storage.getAll()},t.closeAllSessions=function(){var e=this;return(0,A.P)((function(){var t=e._storage.getAll().map((function(e){return ce(e.mediaKeySession)}));return y.Z.debug("EME-LSS: Closing all current MediaKeySessions",t.length),e._storage=new he,(0,a.z)(c.T.apply(void 0,t).pipe((0,m.l)()),(0,i.of)(null))}))},e}(),ge=n(811),ye=n(6923);var _e=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}(),be=function(){function e(e){!function(e){(0,ge.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{this._entries=this._storage.load(),Array.isArray(this._entries)||(this._entries=[])}catch(e){y.Z.warn("EME-PSS: Could not get entries from license storage",e),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t){if(!(0,O.Z)(t)&&(0,ye.Z)(t.sessionId)){var n=t.sessionId,r=this.get(e);null!==r&&r.sessionId===n||(null!==r&&this.delete(e),y.Z.info("EME-PSS: Add new session",n),this._entries.push({version:3,sessionId:n,values:this._formatValuesForStore(e.values),initDataType:e.type}),this._save())}else y.Z.warn("EME-PSS: Invalid Persisten Session given.")},t.delete=function(e){var t=this._getIndex(e);if(-1!==t){var n=this._entries[t];y.Z.warn("EME-PSS: Delete session from store",n.sessionId),this._entries.splice(t,1),this._save()}else y.Z.warn("EME-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){y.Z.info("EME-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(y.Z.warn("EME-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=T.zo.apply(void 0,e.values.map((function(e){return e.data}))),r=(0,te.Z)(n),i=0;i<this._entries.length;i++){var a=this._entries[i];if(a.initDataType===e.type)switch(a.version){case 3:if(pe(t,a.values))return i;break;case 2:if(a.initDataHash===r)try{var o="string"==typeof a.initData?_e.decode(a.initData):a.initData.initData;if((0,b.Z)(o,n))return i}catch(e){y.Z.warn("EME-PSS: Could not decode initialization data.",e)}break;case 1:if(a.initDataHash===r){if(void 0===a.initData.length)return i;if((0,b.Z)(a.initData,n))return i}break;default:if(a.initData===r)return i}}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){y.Z.warn("EME-PSS: Could not save licenses in localStorage")}},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:new _e(n),hash:(0,te.Z)(n)}}))},e}();function Te(e,t){return ee(e,t).pipe((0,r.z)((function(t){var n=t.value,r=n.options,a=n.mediaKeySystemAccess,o=j.Z.getState(e),s=function(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new R.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return y.Z.debug("EME: Set the given license storage"),new be(t)}(r);if(null!==o&&"reuse-media-key-system-access"===t.type){var u=o.mediaKeys,l=o.loadedSessionsStore;if(!1===ae(u)||!(0,O.Z)(r.serverCertificate)&&oe(u,r.serverCertificate))return(0,i.of)({mediaKeys:u,mediaKeySystemAccess:a,stores:{loadedSessionsStore:l,persistentSessionsStore:s},options:r})}return function(e){return y.Z.info("EME: Calling createMediaKeys on the MediaKeySystemAccess"),(0,F.Z)((function(){return(0,Z.Z)(e.createMediaKeys())}),void 0).pipe((0,h.K)((function(e){var t=e instanceof Error?e.message:"Unknown error when creating MediaKeys.";throw new R.Z("CREATE_MEDIA_KEYS_ERROR",t)})))}(a).pipe((0,d.U)((function(e){y.Z.info("EME: MediaKeys created with success");var t=new me(e);return{mediaKeys:e,mediaKeySystemAccess:a,stores:{loadedSessionsStore:t,persistentSessionsStore:s},options:r}})))})))}function Ee(e,t){return Te(e,t).pipe((0,r.z)((function(t){var n,a,o=t.mediaKeys,c=t.mediaKeySystemAccess,d=t.stores,f=t.options;((0,O.Z)(f.licenseStorage)||!0===f.licenseStorage.disableRetroCompatibility)&&(a=c.keySystem,n=(0,q.Z)(a,"com.microsoft.playready")||"com.chromecast.playready"===a||"com.youtube.playready"===a?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===a?"edef8ba979d64acea3c827dcd51d21ed":(0,q.Z)(a,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,q.Z)(a,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0);var p=(0,H.Z)(!1),v=null!==e.mediaKeys&&void 0!==e.mediaKeys&&o!==e.mediaKeys,h=(0,i.of)(null);return v&&(y.Z.debug("EME: Disabling old MediaKeys"),h=function(e){return(0,A.P)((function(){return j.Z.setState(e,null),(0,W.Y)(e,null)}))}(e)),h.pipe((0,r.z)((function(){return y.Z.debug("EME: Attaching current MediaKeys"),p.asObservable().pipe((0,s.h)((function(e){return e})),(0,r.z)((function(){var t={loadedSessionsStore:d.loadedSessionsStore,mediaKeySystemAccess:c,mediaKeys:o,keySystemOptions:f};return function(e,t){var n=t.keySystemOptions,a=t.loadedSessionsStore,o=t.mediaKeySystemAccess,s=t.mediaKeys;return(0,A.P)((function(){var t=j.Z.getState(e);return(null!==t&&t.loadedSessionsStore!==a?t.loadedSessionsStore.closeAllSessions():(0,i.of)(null)).pipe((0,r.z)((function(){return j.Z.setState(e,{keySystemOptions:n,mediaKeySystemAccess:o,mediaKeys:s,loadedSessionsStore:a}),e.mediaKeys===s?(0,i.of)(null):(y.Z.info("EME: Attaching MediaKeys to the media element"),(0,W.Y)(e,s).pipe((0,l.b)((function(){y.Z.info("EME: MediaKeys attached with success")}))))})))}))}(e,t)})),(0,u.q)(1),(0,D.h)({type:"attached-media-keys",value:{mediaKeySystemAccess:c,mediaKeys:o,stores:d,options:f}}),(0,L.O)({type:"created-media-keys",value:{mediaKeySystemAccess:c,initializationDataSystemId:n,mediaKeys:o,stores:d,options:f,canAttachMediaKeys:p}}))})))})))}var Se=n(7326),we=n(4578),ke=n(2146),Ae=n(6716),Ie=n(7991),Ze=n(1454),xe=n(6798),Me=n(7878),Re=n(1819),Ce=n(2566),Pe=n(7845),Ne=(0,Re.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Oe(e){throw new Ne(e)}var De=n(278),Le=n(8474);var Ue=n(3505),Be=n(2572);var Fe="expired",ze="internal-error",Ke="output-restricted";function Ve(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(Y.YM||Y.kD)?(0,E.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case Fe:var d=new R.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,E.ci)(c)+")");if(!1!==u)throw d;r.push({type:"warning",value:d}),a.push(c);break;case ze:var f=new R.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,E.ci)(c)+")");if(!0!==s.keyInternalError)throw f;r.push({type:"warning",value:f}),i.push(c);break;case Ke:var p=new R.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,E.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw p;r.push({type:"warning",value:p}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var Ge=g.Xe,He=g.GJ,We=g.eX,je=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Se.Z)(r),t.prototype),r.sessionError=n,r}return(0,we.Z)(t,e),t}((0,ke.Z)(Error));function qe(e,t,n,a){y.Z.info("EME: Binding session events",e.sessionId);var o,s,u=new Ae.x,f=t.getLicenseConfig,p=void 0===f?{}:f,m=Ge(e).pipe((0,d.U)((function(e){throw new R.Z("KEY_ERROR",e.type)}))),g=We(e).pipe((0,r.z)((function(r){return function(e,t,n,r){y.Z.info("EME: keystatuseschange event received",e.sessionId);var i=(0,A.P)((function(){return(0,F.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?v.E:(0,Z.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,d.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=new R.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,O.Z)(e)&&(0,ye.Z)(e.message)&&(t.message=e.message),t})));return(0,c.T)(Ye(e,t,n),i)}(e,t,n,r)}))),_=He(e).pipe((0,r.z)((function(n){var i=new Uint8Array(n.message),o=(0,ye.Z)(n.messageType)?n.messageType:"license-request";y.Z.info("EME: Received message event, type "+o,e.sessionId,n);var s,l,c,f,v,m,g,_,b=(0,A.P)((function(){var e=t.getLicense(i,o),n=(0,O.Z)(p.timeout)?1e4:p.timeout;return(0,Z.Z)(e).pipe(n>=0?function(e,t){var n=(0,Ze.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?Oe:a,s=n.scheduler,u=void 0===s?null!=t?t:Ie.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,xe.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Pe.f)(t,u,(function(){try{n.unsubscribe(),(0,Me.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Ce.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):De.y)})),T=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ne||(0,O.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:$e(t)})}}}(u,p.retry);return(s=b,l=T,c=l.baseDelay,f=l.maxDelay,v=l.totalRetry,m=l.shouldRetry,g=l.onRetry,_=0,s.pipe((0,h.K)((function(e,t){if(!(0,O.Z)(m)&&!m(e)||_++>=v)throw e;"function"==typeof g&&g(e,_);var n=Math.min(c*Math.pow(2,_-1),f),i=(0,Be.Z)(n);return(0,B.H)(i).pipe((0,r.z)((function(){return t})))})))).pipe((0,d.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=$e(e);if(!(0,O.Z)(e)&&!0===e.fallbackOnLastTry)throw y.Z.warn("EME: Last `getLicense` attempt failed. Blacklisting the current session."),new je(t);throw t})),(0,L.O)({type:"session-message",value:{messageType:o,initializationData:a}}))}))),b=(0,c.T)(_,g).pipe((o=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return function(e,t,n){return(0,O.Z)(t)?(y.Z.info("EME: No message given, skipping session.update"),(0,i.of)({type:"no-update",value:{initializationData:n}})):(y.Z.info("EME: Updating MediaKeySession with message"),(0,Z.Z)(e.update(t)).pipe((0,h.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new R.Z("KEY_UPDATE_ERROR",t)})),(0,l.b)((function(){y.Z.info("EME: MediaKeySession update succeeded.")})),(0,d.U)((function(){return{type:"session-updated",value:{session:e,license:t,initializationData:n}}}))))}(e,t.value.license,a);default:return(0,i.of)(t)}},(0,Le.m)(s)?(0,r.z)(o,s,1):(0,r.z)(o,1))),T=(0,c.T)(Ye(e,t,n),b,m,u);return(0,O.Z)(e.closed)?T:T.pipe((0,Ue.R)((0,Z.Z)(e.closed)))}function Ye(e,t,n){return(0,A.P)((function(){if(0===e.keyStatuses.size)return v.E;var r=Ve(e,t,n),o=r.warnings,s=r.blacklistedKeyIDs,u=r.whitelistedKeyIds,l=o.length>0?i.of.apply(void 0,o):v.E,c=(0,i.of)({type:"keys-update",value:{whitelistedKeyIds:u,blacklistedKeyIDs:s}});return(0,a.z)(l,c)}))}function $e(e){if(e instanceof Ne)return new R.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new R.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,O.Z)(e)&&(0,ye.Z)(e.message)&&(t.message=e.message),t}function Xe(e,t){return(0,A.P)((function(){return"function"!=typeof e.setServerCertificate?(y.Z.warn("EME: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),v.E):!0===ae(e)?(y.Z.info("EME: The MediaKeys already has a server certificate, skipping..."),v.E):(y.Z.info("EME: Setting server certificate on the MediaKeys"),re(e),function(e,t){return(0,A.P)((function(){return(0,F.Z)((function(){return(0,Z.Z)(e.setServerCertificate(t))}),void 0).pipe((0,h.K)((function(e){y.Z.warn("EME: mediaKeys.setServerCertificate returned an error",e);var t=e instanceof Error?e.toString():"`setServerCertificate` error";throw new R.Z("LICENSE_SERVER_CERTIFICATE_ERROR",t)})))}))}(e,t).pipe((0,l.b)((function(){ie(e,t)})),(0,m.l)(),(0,h.K)((function(e){return(0,i.of)({type:"warning",value:e})}))))}))}var Qe=M.Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,Je=M.Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,et=g.Oh;var tt=function(e,t,n){y.Z.debug("EME: Starting EMEManager logic.");var g=new he,_=new he,E=Ee(e,t).pipe((0,r.z)((function(e){if("attached-media-keys"!==e.type)return(0,i.of)(e);var t=e.value,n=t.mediaKeys,r=t.options.serverCertificate;return(0,O.Z)(r)?(0,i.of)(e):(0,a.z)(Xe(n,r),(0,i.of)(e))})),(0,o.d)()),S=E.pipe((0,s.h)((function(e){return"attached-media-keys"===e.type})),(0,u.q)(1)),w=et(e).pipe((0,l.b)((function(){y.Z.debug("EME: Encrypted event received from media element.")})),(0,N.Z)((function(e){return k(e)}),null),(0,o.d)({refCount:!0})),A=n.pipe((0,l.b)((function(){y.Z.debug("EME: Encrypted event received from Player")}))),I=(0,c.T)(A,w).pipe((0,r.z)((function(e){return S.pipe((0,d.U)((function(t){return[e,t]})))})),(0,r.z)((function(e){var t=e[0],n=e[1],a=n.value,o=a.mediaKeySystemAccess,s=a.stores,u=a.options,l=_.get(t);if(void 0!==l){if(void 0===t.type){y.Z.error("EME: The current session has already been blacklisted but the current content is not known. Throwing.");var E=l.sessionError;return E.fatal=!0,(0,f._)((function(){return E}))}return y.Z.warn("EME: The current session has already been blacklisted. Blacklisting content."),(0,i.of)({type:"blacklist-protection-data",value:t})}var S,w=new p.t(1);if("content"===u.singleLicensePer&&!g.isEmpty()){var k=t.keyIds;if(void 0===k)return y.Z.warn("EME: Initialization data linked to unknown key id, we'll not able to fallback from it."),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}});var A=g.getAll()[0];return A.lastKeyUpdate$.pipe((0,r.z)((function(e){return k.every((function(t){for(var n=0;n<e.whitelistedKeyIds.length;n++)if((0,b.Z)(e.whitelistedKeyIds[n],t))return!0}))?(n.value.stores.loadedSessionsStore.reuse(A.initializationData),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}})):(0,i.of)({type:"keys-update",value:{blacklistedKeyIDs:k,whitelistedKeyIds:[]}})})))}if(!g.storeIfNone(t,{initializationData:t,lastKeyUpdate$:w}))return y.Z.debug("EME: Init data already received. Skipping it."),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}});!0!==u.persistentLicense?S="temporary":!function(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,C.Z)(t,"persistent-license")}(o)?(y.Z.warn('EME: Cannot create "persistent-license" session: not supported'),S="temporary"):S="persistent-license";var I="number"==typeof u.maxSessionCacheSize?u.maxSessionCacheSize:Qe;return G(t,s,S,I).pipe((0,r.z)((function(e){switch(e.type){case"cleaning-old-session":return g.remove(e.value.initializationData),v.E;case"cleaned-old-session":return v.E;case"created-session":case"loaded-open-session":case"loaded-persistent-session":break;default:(0,P.Z)(e)}var n=e.value,r=n.mediaKeySession,a=n.sessionType,l=!1,f=T.zo.apply(void 0,t.values.map((function(e){return e.data}))),p="created-session"!==e.type?v.E:x(r,t.type,f).pipe((0,h.K)((function(e){throw new R.Z("KEY_GENERATE_REQUEST_ERROR",e instanceof Error?e.toString():"Unknown error")})),(0,m.l)());return(0,c.T)(qe(r,u,o.keySystem,t),p).pipe((0,d.U)((function(e){if("keys-update"!==e.type)return e;var n=t.keyIds;if(void 0!==n&&"init-data"!==u.singleLicensePer){var i,o=n.filter((function(t){return!e.value.whitelistedKeyIds.some((function(e){return(0,b.Z)(e,t)}))&&!e.value.blacklistedKeyIDs.some((function(e){return(0,b.Z)(e,t)}))}));if(o.length>0)(i=e.value.blacklistedKeyIDs).push.apply(i,o)}if(w.next(e.value),0===e.value.whitelistedKeyIds.length&&0===e.value.blacklistedKeyIDs.length||"temporary"===a||null===s.persistentSessionsStore||l)return e;var c=s.persistentSessionsStore;return function(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;y.Z.info("EME: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}(c,Je-1),c.add(t,r),l=!0,e})),(0,h.K)((function(e){if(!(e instanceof je))throw e;_.store(t,e);var n=e.sessionError;if(void 0===t.type)throw y.Z.error("EME: Current session blacklisted and content not known. Throwing."),n.fatal=!0,n;return y.Z.warn("EME: Current session blacklisted. Blacklisting content."),(0,i.of)({type:"warning",value:n},{type:"blacklist-protection-data",value:t})})))})))})));return(0,c.T)(E,w.pipe((0,d.U)((function(e){return{type:"encrypted-event-received",value:e}}))),I)}},6033:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},4507:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(3071),i=n(9127),a=n(2817),o=n(6139);var s=n(8719),u=n(5157),l=n(7874),c=n(3887),d=s.Oh;function f(e,t,n){var s=(0,r.T)(d(e),n);return null==l.Z.emeManager?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),(0,a.of)({type:"eme-disabled"})):0===t.length?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),(0,a.of)({type:"eme-disabled"})):"function"!=typeof o.N?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),(0,a.of)({type:"eme-disabled"})):(c.Z.debug("Init: Creating EMEManager"),l.Z.emeManager(e,t,n))}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(3994),d=n(6108),f=n(6362),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(8719);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$)(!1),p=(0,T.$)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){b.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.observe(!0));var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.observe(!0)).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(p.setValue(!0),p.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),p.setValue(!0),p.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:p,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(3994),i=n(1545),a=n(5583),o=n(533),s=n(4975),u=n(4727),l=n(4978),c=n(2817),d=n(3071),f=n(1480),p=n(3887),v=n(5767);var h=n(8333),m=n(4507),g=n(5039),y=n(7920),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,v.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var I=function(e,t){return new f.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,v.Z)(e)}}))}(E,A);p.Z.debug("Init: Calculating initial time");var Z=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return p.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(E,k)};p.Z.debug("Init: Initial time calculated:",Z);var x=(0,y.Z)({mediaElement:E,playbackObserver:S,startTime:Z,mustAutoPlay:t}).seekAndPlay$,M=I.pipe((0,r.z)((function(){return(0,m.Z)(E,n,i.E)})),(0,h.Z)(),(0,a.B)()),R=(0,b.Z)(E),C=S.observe(!0),P=(0,T.Z)(E,w,C).pipe((0,o.l)()),N=(0,_.Z)(S,null,i.E,i.E),O=M.pipe((0,s.h)((function(e){return"created-media-keys"===e.type?(e.value.canAttachMediaKeys.setValue(!0),!0):"eme-disabled"===e.type||"attached-media-keys"===e.type})),(0,u.q)(1),(0,r.z)((function(){return x})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,g.Z)(C,E,null,!0)})));return(0,d.T)(O,M,R,P,N)}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(944),d=n(3714),f=n(3887),p=n(2829),v=n(8567),h=c.Z.BUFFER_DISCONTINUITY_THRESHOLD,m=c.Z.FORCE_DISCONTINUITY_SEEK_DELAY,g=c.Z.FREEZING_STALLED_DELAY,y=c.Z.UNFREEZING_SEEK_DELAY,_=c.Z.UNFREEZING_DELTA_POSITION,b=1/60;function T(e,t,n,c){var d,T=c.pipe((0,r.M)(e.observe(!0)),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return E(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return E(t)&&e.splice(a,0,t),e;E(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),w=null,k=null,A=n.pipe((0,r.M)(e.observe(!0)),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),I=e.observe(!0).pipe((0,r.M)(T),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,c=r.freezing;if(null!==c){var T=performance.now();if(T-(null===d?c.timestamp:d.attemptTimestamp)>y&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+_),d={attemptTimestamp:T}),T-c.timestamp>g)return{type:"stalled",value:"freezing"}}else d=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var E="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)w=r.position;else if(null!==w){var A=performance.now();if(null===k&&(k=A),l&&r.position<w&&A-k<m)return{type:"stalled",value:E};w=null}if(k=null,null===t)return{type:"stalled",value:E};var I=u.position;if(null!==I){var Z=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-b)if(null===d){var p=t.getPeriodAfter(a);null!==p?o=p.start+b:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+b&&(o=d+b);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,I);if(null!==Z){var x=Z+.001;if(!(x<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,x),e.setCurrentTime(x),v.Z.warning(S(I,x));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),x)}}var M=null!=I?I:o,R=(0,p.XS)(a,M);if(R<h){var C=M+R+b;if(e.getCurrentTime()<C)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",M,C,h),e.setCurrentTime(C),v.Z.warning(S(M,C))}for(var P=t.periods.length-2;P>=0;P--){var N=t.periods[P];if(void 0!==N.end&&N.end<=M){if(t.periods[P+1].start>M&&t.periods[P+1].start>e.getCurrentTime()){var O=t.periods[P+1];return e.setCurrentTime(O.start),v.Z.warning(S(M,O.start))}break}}return{type:"stalled",value:E}})));return(0,u.T)(A,I)}function E(e){return null!==e.discontinuity}function S(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(3994),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,c=u.end,d=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/d,h=c/d,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),p=n(9917),v=n(8719),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(944),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var I=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=w(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}for(s.cues=w(s.cues,t),s.end=t,s=r[o+1];void 0!==s&&n>s.end;)r.splice(o,1),s=r[o];return void a(o)}}r.push(i)},e}();function Z(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var x=v.C1,M=v.ik,R=v.d5,C=_.Z.MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,P=_.Z.TEXT_TRACK_SIZE_CHECKS_INTERVAL;function N(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function O(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new I,r._currentCues=[],function(e){var t=R(e),n=M(e),r=x(e),f=(0,i.T)(n,r),p=(0,a.F)(C).pipe((0,o.O)(null));return f.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(p.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=Math.max(r._videoElement.currentTime+C/1e3/2,0),n=r._buffer.get(t);0===n.length?r._disableCurrentCues():r._displayCues(n)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,p.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,p.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,p.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;g.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,c=o.end,d=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a),a}(f,d,i,p);if(0!==v&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=v;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<v;)m[y].start=v,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){g.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)N(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)N(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=O(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));s.length>0&&function(e,t){return(0,p.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))}(this._textTrackElement,P).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];Z(t,n,i.resolution,i.element)}}))}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new c.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,c=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=d.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return S},f:function(){return T}});var r=n(944),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=r.Z.BUFFERED_HISTORY_RETENTION_TIME,p=r.Z.BUFFERED_HISTORY_MAXIMUM_ENTRIES,v=r.Z.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,h=r.Z.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE,m=r.Z.MINIMUM_SEGMENT_SIZE;function g(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t;return Math.abs(t-e.bufferedStart)<=v&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(h,n/3))}function y(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,r=n-t;return Math.abs(n-e.bufferedEnd)<=v&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-r)<=Math.min(h,r/3)}function _(e,t,n,r){void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",r,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&g(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",r,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=v)?(i.Z.debug("SI: buffered start is end of previous segment",r,t,e.start,n.end),e.bufferedStart=n.end,g(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=v?(i.Z.debug("SI: found true buffered start",r,t,e.start),e.bufferedStart=t,g(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",r,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",r,e.bufferedStart,t),e.bufferedStart=t)}function b(e,t,n){void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=v&&y(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=v?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,y(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var T,E=function(){function e(){this._inventory=[],this._bufferedHistory=new l(f,p)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,r=t[0],a=null==r?void 0:r.infos.adaptation.type,s=e.length,u=0;u<s;u++){if(void 0===r)return;var l=e.start(u),c=e.end(u);if(c-l<m)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",a,l,c);else{for(var d=n;void 0!==r&&(0,o.Z)(r.bufferedEnd,r.end)-l<m;)r=t[++n];var f=null,p=n-d;if(p>0){var v=t[d+p-1];f={end:(0,o.Z)(v.bufferedEnd,v.end),precizeEnd:v.precizeEnd},i.Z.debug("SI: "+p+" segments GCed.",a),t.splice(d,p),n=d}if(void 0===r)return;if(c-(0,o.Z)(r.bufferedStart,r.start)>=m){if(_(r,l,f,a),n===t.length-1)return void b(r,c,a);r=t[++n];for(var h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end),y=u<s-1?e.start(u+1):void 0;void 0!==r&&c-h>=m&&(void 0===y||c-h>=g-y);){var T=t[n-1];void 0===T.bufferedEnd&&(T.bufferedEnd=r.precizeStart?r.start:T.end,i.Z.debug("SI: calculating buffered end of contiguous segment",a,T.bufferedEnd,T.end)),r.bufferedStart=T.bufferedEnd,void 0!==(r=t[++n])&&(h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end))}}var E=t[n-1];void 0!==E&&b(E,c,a)}}null!=r&&(i.Z.debug("SI: last segments have been GCed",a,n,t.length),t.splice(n,t.length-n)),void 0!==a&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+a+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,p=n[d],v=void 0;if(void 0===p)v=o(l.infos),n[d]=((c={})[f]=v,c);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.start,s=e.end;if(!a.isInit){var u=n.type;if(o>=s)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",u,o,s);else{for(var l=this._inventory,c={partiallyPushed:!0,splitted:!1,start:o,end:s,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},d=l.length-1;d>=0;d--){var f=l[d];if(f.start<=o){if(f.end<=o){for(i.Z.debug("SI: Pushing segment strictly after previous one.",u,o,f.end),this._inventory.splice(d+1,0,c),d+=2;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}if(f.start===o){if(f.end<=s){for(i.Z.debug("SI: Segment pushed replace another one",u,o,s,f.end),this._inventory.splice(d,1,c),d+=1;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",u,o,s,f.end),l.splice(d,0,c),f.start=c.end,f.bufferedStart=void 0,void(f.precizeStart=f.precizeStart&&c.precizeEnd)}if(f.end<=c.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",u,o,s,f.start,f.end),this._inventory.splice(d+1,0,c),f.end=c.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&c.precizeStart,d+=2;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}i.Z.debug("SI: Segment pushed is contained in a previous one",u,o,s,f.start,f.end);var p={partiallyPushed:f.partiallyPushed,splitted:!0,start:c.end,end:f.end,precizeStart:f.precizeStart&&f.precizeEnd&&c.precizeEnd,precizeEnd:f.precizeEnd,bufferedStart:void 0,bufferedEnd:f.end,infos:f.infos};return f.end=c.start,f.splitted=!0,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&c.precizeStart,l.splice(d+1,0,c),void l.splice(d+2,0,p)}}var v=this._inventory[0];if(void 0===v)return i.Z.debug("SI: first segment pushed",u,o,s),void this._inventory.push(c);if(!(v.start>=s)){if(v.end<=s){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",u,o,s,v.start,v.end),this._inventory.splice(0,1,c);l.length>1&&l[1].start<c.end;){if(l[1].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[1].start),l[1].start=c.end,l[1].bufferedStart=void 0,void(l[1].precizeStart=c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[1].start,l[1].end),l.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",u,o,s,v.start,v.end),v.start=s,v.bufferedStart=void 0,v.precizeStart=c.precizeEnd,void this._inventory.splice(0,0,c)}i.Z.debug("SI: Segment pushed comes before all previous ones",u,o,s,v.start),this._inventory.splice(0,0,c)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e),r[0].splitted=!0));var u=o;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);)o++;var l=o-1,d=l-u,f=n[l].end,p=n[l].bufferedEnd;d>0&&(this._inventory.splice(u+1,d),o-=d),this._inventory[u].partiallyPushed=!1,this._inventory[u].end=f,this._inventory[u].bufferedEnd=p,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var v,h=c(r);!(v=h()).done;){var m=v.value;void 0!==m.bufferedStart&&void 0!==m.bufferedEnd?this._bufferedHistory.addBufferedSegment(m.infos,m.bufferedStart,m.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",m)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),S=function(){function e(){this._segmentInventory=new E}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(T||(T={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t){"use strict";var n={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e){return{type:"encryption-data-encountered",value:e}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=n},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{ZB:function(){return r},br:function(){return i},SM:function(){return a}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,s.xhr=o,s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,emeManager:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return d},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791),c=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],c=void 0;for(c=0;c<a.length;c++)if(s.systemId===a[c].systemId){if((0,l.Z)(s.data,a[c].data))break;u.Z.warn("Manifest: different init data for the same system ID")}c===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),d=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.isTrickModeTrack=t.isTrickModeTrack,this.type=t.type,void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,d=[],f=!1,p=0;p<l.length;p++){var v=new c(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(d.push(v),!f&&v.isSupported&&(f=!0))}d.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=d,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(4791),s=n(3274),u=n(1959),l=n(908),c=n(8806),d=n(8999),f=n(1679),p=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new d.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,f.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,s.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},e}(),v=n(3887),h=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){v.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){v.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var m=n(5138);function g(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),o=function(e){var t=i[e],o=(0,s.Z)(a,(function(e){return e.id===t.id}));if(void 0===o)v.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=o.representations,c=function(e){var t=u[e],i=(0,s.Z)(l,(function(e){return e.id===t.id}));void 0===i?v.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)o(u)}var y=(0,l.Z)(),_=(0,l.Z)();function b(e,t){for(var n=[],r=0;r<e.periods.length;r++)for(var i=e.periods[r],a=i.getAdaptations(),o=0;o<a.length;o++)for(var s=a[o],u=s.representations,l=0;l<u.length;l++){var c=u[l],d=t(c);d!==c.decipherable&&(n.push({manifest:e,period:i,adaptation:s,representation:c}),c.decipherable=d)}return n}var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=_(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new p(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,s.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,s.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,s.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,s.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateDeciperabilitiesBasedOnKeyIds=function(e){var t=e.whitelistedKeyIds,n=e.blacklistedKeyIDs,r=b(this,(function(e){if(!1===e.decipherable||void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],s=0;s<n.length;s++)if((0,o.Z)(n[s],a.keyId))return!1;for(var u=0;u<t.length;u++)if((0,o.Z)(t[u],a.keyId))return!0}return e.decipherable}));r.length>0&&this.trigger("decipherabilityUpdate",r)},n.addUndecipherableProtectionData=function(e){var t=b(this,(function(t){var n,r;if(!1===t.decipherable)return!1;for(var i=null!==(r=null===(n=t.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(t){if((void 0===e.type||i[t].type===e.type)&&e.values.every((function(e){return i[t].values.some((function(t){return(void 0===e.systemId||t.systemId===e.systemId)&&(0,o.Z)(t.data,e.data)}))})))return{v:!1}},s=0;s<i.length;s++){var u=a(s);if("object"==typeof u)return u.v}return t.decipherable}));t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,c.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,c.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,c.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,s.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+y(),o="gen-image-rep-"+y(),s=new d.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new h({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,c=null!=s?[s]:null!=u?u:[];return e.concat(c.map((function(e){var n="gen-text-ada-"+y(),s="gen-text-rep-"+y(),u=new d.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new h({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var c=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(c)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){g(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)v.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");g(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),g(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(u.Z)},520:function(e,t,n){"use strict";n.d(t,{z:function(){return i},K:function(){return a}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{iz:function(){return u},t_:function(){return o},lp:function(){return s},Qy:function(){return l},Xj:function(){return d},nR:function(){return c}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n=l(e,t);return null!==n?e.subarray(n[1],n[2]):null}function s(e,t){for(var n=[],r=e;;){var a=l(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function u(e,t){var n=l(e,t);return null!==n?e.subarray(n[0],n[2]):null}function l(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function c(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function d(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{XA:function(){return i},uq:function(){return a},Le:function(){return o},fs:function(){return s},E3:function(){return u}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),c=u(l,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:l}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{LD:function(){return h},Qx:function(){return f},MM:function(){return v},Wf:function(){return d},J6:function(){return m},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+v-1]}),l+=h,r+=v}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function p(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function v(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var v=(0,i.QI)(c,d);d+=3;var h=(256&v)>0,m=0;if(!h&&void 0===(m=p(o)))return;var g=(1&v)>0,y=(4&v)>0,_=(512&v)>0,b=(1024&v)>0,T=(2048&v)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,p=d.string;c=f;var v=(0,a.DM)(o,c),h=v.end,m=v.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:p,width:v,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=u.map((function(e){return e.url})),h=(0,s.k6)(v,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(v,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:1,m=[],g=d.length,y=d.length>0&&null!=d[0].duration?d[0].duration:0,_=0;_<g;_++){var b=d[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,d[_+1],o),k=!1!==e.availabilityTimeComplete||_!==g-1&&0!==w,A=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),I=E+A*T;I<c&&A<=w;){var Z=h+A,x=null===p?null:p.map((0,i.QB)(I,Z)),M=I-e.indexTimeOffset,R={id:String(I),time:M/f,end:(M+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:x,number:Z,timestampOffset:-e.indexTimeOffset/f,complete:k,privateInfos:{isEMSGWhitelisted:a}};m.push(R),I=E+ ++A*T}if(I>=c)return m;h+=w+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{k6:function(){return o},QB:function(){return u}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return je}});var r=n(7904),i=n(1946),a=n(944),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function f(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function p(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=f(r);if(void 0===u)return;a=u}if(void 0!==i){var l=f(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}var v=n(9592),h=n(908),m=n(1679),g=n(3635);var y=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),_=n(7714),b=n(6923),T=n(8999);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(T.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,p=E(d);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,_.Z)(T.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,_.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var p=i(d,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var I=n(8026);var Z=n(7403),x=n(3911),M=n(1915),R=n(4784),C=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,c=u-r*l,d=i.map((function(e){return e.url})),f=e.list.map((function(e){return{mediaURLs:(0,R.k6)(d,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:f,timescale:l,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,R.k6)(d,e.initialization.media,a,o),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,x.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],p=Math.floor(l/r);p<=d;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),N=n(8232),O=n(1091),D=n(5505),L=n(6394),U=a.Z.DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR;function B(e,t,n){return t+U*e>=n}function F(e,t,n,r){var a=e.start,s=e.duration,u=e.repeatCount;return void 0===a&&(null===t?a=r:(0,i.Z)(t.duration)||(a=t.start+t.duration*(t.repeatCount+1))),void 0!==s&&!isNaN(s)||null===n||void 0===n.start||isNaN(n.start)||void 0===a||isNaN(a)||(s=n.start-a),void 0===a||isNaN(a)||void 0===s||isNaN(s)||void 0!==u&&isNaN(u)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:a,duration:s,repeatCount:void 0===u?0:u}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function K(e,t){for(var n=[],r=0;r<e.length;r++)n.push(z(e[r]));for(var i=[],a=0;a<n.length;a++){var o=F(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!=o&&i.push(o)}return i}function V(e,t,n){var r,i=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-c;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(v+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),K(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,c=t.length-a+s-1;if(c>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),K(e,n);var d=t.slice(a);if(u>0){var f=d[0];f.start+=f.duration*u,d[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),K(e,n);var p=d[d.length-1],v=z(e[c]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),K(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=c+1;y<e.length;y++)g.push(z(e[y]));for(var _=0;_<g.length;_++){var b=F(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return d.concat(m)}var G=a.Z.MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY,H=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.representationBaseURLs,c=n.representationId,d=n.representationBitrate,f=n.periodStart,p=n.periodEnd,v=n.isEMSGWhitelisted,h=null!==(r=t.timescale)&&void 0!==r?r:1,m=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-f*h;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=v,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var g=l.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:m,initialization:null==t.initialization?void 0:{mediaURLs:(0,R.k6)(g,t.initialization.media,c,d),range:t.initialization.range},mediaURLs:(0,R.k6)(g,t.media,c,d),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:h},this._scaledPeriodStart=(0,x.gT)(f,this._index),this._scaledPeriodEnd=null==p?void 0:(0,x.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,L.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,x.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,x.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,x._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,D.Z)(this._index.timeline,e._index.timeline),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate},t.isFinished=function(){if(!this._isDynamic)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,x.jH)(t,null,this._scaledPeriodEnd);return B(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,x.gT)(e,this._index);(0,N.Z)(this._index.timeline,t)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,x.jH)(e[e.length-1],null,t)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e,t=this._parseTimeline();return this._parseTimeline=null,null===this._unsafelyBaseOnPreviousIndex||t.length<G?K(t,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(e=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=e):e=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,V(t,e,this._scaledPeriodStart))},e}(),W=a.Z.MINIMUM_SEGMENT_SIZE,j=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1,v=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+v,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,R.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,R.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var p=Math.max(d,l),v=Math.min(f,c);if(v+r<=p)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,R.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var a=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+a-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var o=(i-this._periodStart)*r;if(o<0)return null;var s=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+a)*r,u=Math.floor((o+s)/n);return u<=0?null:(u-1)*n}var l=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,c=Math.ceil(l/n)-1,d=c*n;return l-d>W*r||0===c?d:(c-1)*n},e}();function q(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function Q(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,p=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),v=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=q(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,p=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:p};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new Z.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new C(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=I.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=H.isTimelineIndexArgument(T)?new H(T,m):new j(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new Z.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new C(w,m)}else i=new j({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:v,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r,i=[],a=Y(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(T.initData).length>0||T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=X({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=Y(e);!(l=f()).done;)d();return c}function J(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ee(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function te(e){if(null==e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function ne(e){return null!=e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function re(e){return null!=e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ie(e,t){if((0,b.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,b.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,b.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,b.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,b.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,b.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ae(e){if(null!=e.children.supplementalProperties)for(var t,n=J(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ue=(0,h.Z)();function le(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,h=new y({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||h.setLastPosition(t.duration);for(var T=function(y){var T=e[y],E=t.xlinkInfos.get(T),S=q(t.baseURLs,T.children.baseURLs),k=d[y],I=k.periodStart,Z=k.periodDuration,x=k.periodEnd,M=void 0;for(null==T.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),M="gen-dash-period-"+ue()):M=T.attributes.id;c.some((function(e){return e.id===M}));)M+="-dup";var R=void 0!==E?E.receivedTime:t.receivedTime,C=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(M))&&void 0!==r?r:null,P=null===(i=T.attributes.availabilityTimeComplete)||void 0===i||i,N=null!==(a=T.attributes.availabilityTimeOffset)&&void 0!==a?a:0,O={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:P,availabilityTimeOffset:N,baseURLs:S,manifestBoundsCalculator:h,end:x,isDynamic:f,manifestProfiles:t.manifestProfiles,receivedTime:R,segmentTemplate:T.children.segmentTemplate,start:I,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:C},D=function(e,t){var n,r,i,a,u,l,c,d={},f=[],p={},v=[],h={};e.sort((function(e,t){var n,r,i=null!==(n=e.attributes.selectionPriority)&&void 0!==n?n:1;return(null!==(r=t.attributes.selectionPriority)&&void 0!==r?r:1)-i}));for(var m,g=J(e);!(m=g()).done;){var y=m.value,T=y.children,E=T.essentialProperties,S=T.roles,k=Array.isArray(S)&&S.some((function(e){return"main"===e.value}))&&S.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),I=y.children.representations,Z=null!==(n=y.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,x=(null!==(r=y.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,M=y.attributes.mimeType,R=y.attributes.codecs,C=A(I,(0,b.Z)(M)?M:null,(0,b.Z)(R)?R:null,null!=T.roles?T.roles:null);if(void 0!==C){var P=y.attributes.id,N=void 0,O=ae(y),D=[];void 0!==t.segmentTemplate&&D.push(t.segmentTemplate),void 0!==y.children.segmentTemplate&&D.push(y.children.segmentTemplate);var L={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:Z,availabilityTimeOffset:x,baseURLs:q(t.baseURLs,T.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:D,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},U=Array.isArray(E)?(0,s.Z)(E,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,B=null===(i=null==U?void 0:U.value)||void 0===i?void 0:i.split(" "),F=void 0!==B;if("video"===C&&k&&void 0!==d.video&&d.video.length>0&&void 0!==h.video&&!F){var z,K=d.video[h.video];L.unsafelyBaseOnPreviousAdaptation=null!==(u=null===(a=t.unsafelyBaseOnPreviousPeriod)||void 0===a?void 0:a.getAdaptation(K.id))&&void 0!==u?u:null;var V=Q(I,y,L);(z=K.representations).push.apply(z,V),N=K.id}else{var G=T.accessibilities,H=void 0;void 0!==S&&S.some((function(e){return"dub"===e.value}))&&(H=!0);var W=void 0;"text"!==C?W=!1:void 0!==G&&(W=G.some(ne));var j=void 0;"audio"!==C?j=!1:void 0!==G&&(j=G.some(te));var Y=void 0;"video"!==C?Y=!1:void 0!==G&&(Y=G.some(re));for(var $=ie(y,{isAudioDescription:j,isClosedCaption:W,isSignInterpreted:Y,isTrickModeTrack:F,type:C});(0,_.Z)(v,$);)$+="-dup";N=$,v.push($),L.unsafelyBaseOnPreviousAdaptation=null!==(c=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation($))&&void 0!==c?c:null;var X={id:$,representations:Q(I,y,L),type:C,isTrickModeTrack:F};null!=y.attributes.language&&(X.language=y.attributes.language),null!=W&&(X.closedCaption=W),null!=j&&(X.audioDescription=j),!0===H&&(X.isDub=!0),!0===Y&&(X.isSignInterpreted=!0);var ee=d[C];if(void 0!==B)f.push({adaptation:X,trickModeAttachedAdaptationIds:B});else if(void 0===ee)d[C]=[X],k&&(h[C]=0);else{for(var oe,se=null,ue=function(){var e=oe.value,t=p[e];if(null!=t&&t.newID!==N&&(0,_.Z)(t.adaptationSetSwitchingIDs,P)){var n,r=(0,s.Z)(ee,(function(t){return t.id===e}));null!=r&&r.audioDescription===X.audioDescription&&r.closedCaption===X.closedCaption&&r.language===X.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',P,e),(n=r.representations).push.apply(n,X.representations),se=r)}},le=J(O);!(oe=le()).done;)ue();if(k){var ce=h[C],de=void 0===ce?0:ce+1;if(null===se)ee.splice(de,0,X),h[C]=de;else{var fe=ee.indexOf(se);fe<0?(ee.splice(de,0,X),h[C]=de):(void 0===ce||fe>ce)&&(ee.splice(fe,1),ee.splice(de,0,se),h[C]=de)}}else null===se&&ee.push(X)}}null!=P&&null==p[P]&&(p[P]={newID:N,adaptationSetSwitchingIDs:O})}}return w(d,f),d}(T.children.adaptations,O),L=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=T.attributes.namespaces)&&void 0!==l?l:[]),U=function(e,t,n){for(var r,i,a,o=[],s=oe(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,p=c.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=oe(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/v+t,b=void 0===y.duration?void 0:_+y.duration/v,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,g.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(T.children.eventStreams,I,L),B={id:M,start:I,end:x,duration:Z,adaptations:D,streamEvents:U};if(c.unshift(B),!h.lastPositionIsKnown()){var F=function(e){for(var t,n=null,r=!0,i=(0,m.Z)(e).filter((function(e){return null!=e})),a=oe((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=oe(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(D);if(f)if("number"==typeof F){var z=performance.now()/1e3;h.setLastPosition(F,z)}else{var K=ce(t,I);if(void 0!==K){var V=K[0],G=K[1];h.setLastPosition(V,G)}}else"number"==typeof F&&h.setLastPosition(F)}},E=e.length-1;E>=0;E--)T(E);if(t.isDynamic&&!h.lastPositionIsKnown()){var S=ce(t,0);if(void 0!==S){var k=S[0],I=S[1];h.setLastPosition(k,I)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];void 0===i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(c)}function ce(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function de(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pe=a.Z.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;var ve=function e(t,n,r,i,a){void 0===a&&(a=new WeakMap);var c=t.children,f=t.attributes;if(null==n.externalClockOffset){var v="dynamic"===f.type,h=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(v&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<c.periods.length;b++){var T=c.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,a,s,l,c,f,v=e.children,h=e.attributes,m="dynamic"===h.type,g=q(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],v.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=le(v.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(l=0===h.minimumUpdatePeriod?pe:h.minimumUpdatePeriod);var A=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[p(e),d(e)]}(S),I=A[0],Z=A[1],x=performance.now();if(m){var M;if(c=I,k=null!=_?_:null,void 0!==Z)M=Z;else{var R=null!=y?y:0,C=t.externalClockOffset;if(void 0===C)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-R;else M=(performance.now()+C)/1e3-R}f={isLinear:!0,value:M,time:x},null!==k&&void 0!==c&&M-c>k&&(k=M-c)}else{c=void 0!==I?I:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var P=null!=w?w:1/0;if(void 0!==S[S.length-1]){var N=S[S.length-1],O=null!==(a=N.end)&&void 0!==a?a:void 0!==N.duration?N.start+N.duration:void 0;void 0!==O&&O<P&&(P=O)}void 0!==Z&&Z<P&&(P=Z),f={isLinear:!1,value:P,time:x}}var D=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(s=S[S.length-1])||void 0===s?void 0:s.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:D,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:c,timeshiftDepth:k,maximumTimeData:f},lifetime:l,uris:null==t.url?v.locations:[t.url].concat(v.locations)},warnings:n}}}(t,n,r,a):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(o){if(o.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var s=o.length-1;s>=0;s--){var u,l=_[s].index,d=o[s],f=d.parsed,p=d.warnings,v=d.receivedTime,h=d.sendingTime,m=d.url;p.length>0&&r.push.apply(r,p);for(var g,y=de(f);!(g=y()).done;){var b=g.value;a.set(b,{receivedTime:v,sendingTime:h,url:m})}(u=c.periods).splice.apply(u,[l,1].concat(f))}return e(t,n,r,i,a)}}}},he=n(7326),me=n(4578),ge=n(2146),ye=n(9689),_e=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,be=/([0-9]+)-([0-9]+)/;function Te(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Re("`"+t+'` property is not a boolean value but "'+e+'"')]}function Ee(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Re("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Se(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Re("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Re("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function ke(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Re("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function Ae(e,t){if(!(0,b.Z)(e))return[0,new Re("`"+t+"` property is empty")];var n=_e.exec(e);return null===n?[null,new Re("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,b.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,b.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,b.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,b.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,b.Z)(n[10])?n[10]:"0")+parseFloat((0,b.Z)(n[12])?n[12]:"0"),null]}function Ie(e,t){var n=be.exec(e);return null===n?[null,new Re("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ze(e,t){try{return[(0,ye.K)(e),null]}catch(n){return[null,new Re("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function xe(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Me(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Re=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,he.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,me.Z)(t,e),t}((0,ge.Z)(Error));function Ce(e){var t={},n=e.textContent,r=[],i=Me(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Pe(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Ne(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ze(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:Ie,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function De(e){for(var t={},n=[],r=Me(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Oe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:Ee,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:Se,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:Te,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:Ee,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:Ee,dashName:"startNumber"})}}return[t,n]}function Le(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Ie,dashName:"mediaRange"})}}return[t,n]}function Ue(e){for(var t=De(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Le(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,I.Z)(n,{list:i}),r]}function Be(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Fe(e){for(var t,n=De(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Be(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Me(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:Te,dashName:"bitstreamSwitching"})}}return[s,i]}function ze(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Ce(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"SegmentBase":var l=De(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Ue(a),p=f[0],v=f[1];r=r.concat(v),t.segmentList=p;break;case"SegmentTemplate":var h=Fe(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ne(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:Ee,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Te,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Ee,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Se,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Se,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:Ee,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Ee,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Re("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ke(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[xe(a)]:t.accessibilities.push(xe(a));break;case"BaseURL":var o=Ce(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Pe(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[xe(a)]:t.essentialProperties.push(xe(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"Representation":var l=ze(a),c=l[0],d=l[1];t.representations.push(c),d.length>0&&(r=r.concat(d));break;case"Role":null==t.roles?t.roles=[xe(a)]:t.roles.push(xe(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[xe(a)]:t.supplementalProperties.push(xe(a));break;case"SegmentBase":var f=De(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Ue(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Fe(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=Ne(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),void 0!==E&&n.push(E)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:Ee,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:Ee,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Ee,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Ee,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Ee,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Ee,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Ee,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:Ee,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:we,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:we,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Te,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Te,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Ee,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Se,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Se,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Ee,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ve(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Me(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:Ee,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=Ge(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ge(e){for(var t={eventStreamData:e},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:Ee,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Ee,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function He(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ce(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Ke(s),f=d[0],p=d[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=Ve(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Fe(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:Ae,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:Ae,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Te,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function We(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ce(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=He(s),f=d[0],p=d[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=xe(s);i.push(v)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:ke,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:ke,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:ke,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:Ae,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:Ae,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:Ae,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:Ae,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:Ae,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:Ae,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:Ae,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var je=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=We(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(ve(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(;e.length>0;){var n=e[0];if(n.start>=t)return;if(n.repeatCount<=0)e.shift();else{var r=e[1];if(void 0!==r&&r.start<=t)e.shift();else{if(n.duration<=0)return;for(var i=n.start+n.duration,a=1;i<t&&a<=n.repeatCount;)i+=n.duration,a++;if(!(a>n.repeatCount)){var o=n.repeatCount-a;return n.start=i,void(n.repeatCount=o)}e.shift()}}}}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},jH:function(){return a},gT:function(){return o},zG:function(){return s},PZ:function(){return u},_j:function(){return l}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){var n=e.length;if(0!==e.length){if(0!==t.length){var o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o)return void e.splice.apply(e,[u,n-u].concat(t));if(l<o){var c=e[u];if(c.start+c.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),void e.splice.apply(e,[u,n-u].concat(t));if(void 0===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),void e.splice.apply(e,[u+1,n-(u+1)].concat(t));if(c.start+c.duration*(c.repeatCount+1)<=o)return void e.splice.apply(e,[u+1,n-(u+1)].concat(t));var d=(o-c.start)/c.duration-1;if(d%1==0&&c.duration===t[0].duration){var f=t[0].repeatCount<0?-1:t[0].repeatCount+d+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=c.start,void(e[u].repeatCount=f)}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(d),void e.splice.apply(e,[u+1,n-(u+1)].concat(t))}}var p=e[e.length-1],v=t[t.length-1];if(void 0!==p.repeatCount&&p.repeatCount<0)return p.start>v.start?void i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),void e.splice.apply(e,[0,n].concat(t)));p.start+p.duration*(p.repeatCount+1)>=v.start+v.duration*(v.repeatCount+1)?i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)))}}else e.splice.apply(e,[0,n].concat(t))}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=p.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if(" "===c)v[v.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&p.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),p.appendChild(y)}f.appendChild(p),d.appendChild(f),v.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,p=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=p.exec(e),f=v.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&(" "===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],p=0;p<d.length;p++){var v=(0,a.Z)(d[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},4123:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=v.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?p.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var I=t.unicodeBidi;if((0,l.Z)(I))switch(I){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var Z=t.visibility;(0,l.Z)(Z)&&(e.style.visibility=Z),"none"===t.display&&(e.style.display="none");var x=t.wrapOption;e.style.whiteSpace="noWrap"===x?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):p.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):p.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=v.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=v.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):p.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):p.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):p.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,d.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],d=0;d<s.length;d++){var p=s[d];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,c.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function d(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,d=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,d),v=p.start,h=p.end,m=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var l=u.trim();u=l=l.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c:t)}}return i}return n(e,t)}(t,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=c[a];e.positionAlign=void 0===s?"":s;var d=l[a];e.lineAlign=void 0===d?"":d}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=d(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var c=n(5138),d=n(7714);var f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),p=parseInt(d[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,c.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,d.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=0;I<=g.length-1;I++){var Z=g[I];if(Z instanceof Element){var x=Z.getAttribute("xml:id");null!==x&&function(){var e=(0,l.b)(Z),t=Z.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:x,style:e,extendsStyles:[]})}()}}for(var M=(0,l.U)(f,null!==h?[h]:[],b,A),R="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var N=(0,u.Z)(P,"div"),O=(0,a.Z)({},M,(0,l.U)(f,[P].concat(N),b,A)),D=P.getAttribute("xml:space"),L=(0,i.Z)(D)?"default"===D:R,U={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:O,ttParams:_,shouldTrimWhiteSpace:L};null!==U&&n.push(U)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{YU:function(){return f},Dq:function(){return d},GK:function(){return p},ev:function(){return v},eT:function(){return c},_0:function(){return l},KO:function(){return i},gu:function(){return r},wf:function(){return a},jb:function(){return o},te:function(){return u},Du:function(){return s}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,p,v,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return v.value+=y,p.setAttributeNode(v),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){p.appendChild(e)})),u.appendChild(d),d.appendChild(p),{start:n,end:r,element:u}}var I=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),p=0;p<d.length;p++){var v=(0,o.Z)(d[p],t);if(null!=v){var h=A(v,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{yE:function(){return i},tq:function(){return o},JF:function(){return a},$4:function(){return s}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=n(7874),i=n(8791),a=n(8555),o=n.n(a),s=n(4597),u=n(5278);function l(e,t,n,r){return t.segment.isInit||null===e?o().resolve({resultType:"segment-created",resultData:null}):(0,s.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}function c(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,u.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var d=n(8750),f=n(3887),p=n(1989),v=n(8026),h=n(3635);function m(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,u,l,c,m){var g,y=a.responseData,_=u.externalClockOffset,b=null!==(g=a.url)&&void 0!==g?g:u.originalUrl,T=null!=i?i:_,E={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:u.unsafeMode?u.previousManifest:null,url:b,referenceDateTime:n,externalClockOffset:T},S=r.Z.dashParsers;if(null===S.wasm||"uninitialized"===S.wasm.status||"failure"===S.wasm.status)return f.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),k();var w=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,h.tG)(e).buffer;if(e instanceof Document)return(0,h.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(y);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(w)?"initialized"===S.wasm.status?(f.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E))):(f.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),S.wasm.waitForInitialization().catch((function(){})).then((function(){return null===S.wasm||"initialized"!==S.wasm.status?(f.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),k()):(f.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E)))}))):(f.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),k());function k(){if(null===S.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,h.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(y);return A(S.js(e,E))}function A(t){if("done"===t.type)return t.value.warnings.length>0&&l(t.value.warnings),c.isCancelled?o().reject(c.cancellationError):{manifest:new p.ZP(t.value.parsed,e),url:b};var n=t.value,r=n.urls.map((function(e){return m((function(){return"string"===n.format?(0,s.ZP)({url:e,responseType:"text",cancelSignal:c}):(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:c})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,v.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,v.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,d.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,v.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return o().all(r).then((function(e){return n.format,A(n.continue(e))}))}}}var g=n(7839),y=n(5861),_=n(7757),b=n.n(_),T=n(944),E=n(9105),S=n(5992),w=n(1946),k=T.Z.DEFAULT_REQUEST_TIMEOUT,A="function"==typeof Headers?Headers:null,I="function"==typeof AbortController?AbortController:null;function Z(){return"function"==typeof window.fetch&&!(0,w.Z)(I)&&!(0,w.Z)(A)}var x=n(8806),M=n(281);function R(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var C=n(288),P=n(4460);function N(e){return function(t,n,r,i){return new Promise((function(a,o){var s=new C.ZP,u=r.register((function(e){s.cancel(),o(e)}));function l(e){if((e instanceof Array||e instanceof Uint8Array)&&"mp4"===R(n.adaptation.type,n.representation))try{(0,P.Z)(new Uint8Array(e),n.segment.isInit)}catch(e){u(),s.cancel(),o(e)}}e(t,n,s.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){l(e),s.isUsed||i.onNewChunk(e)}})).then((function(e){s.isUsed||(u(),"segment-loaded"===e.resultType&&l(e.resultData.responseData),a(e))}),(function(e){C.ZP.isCancellationError(e)||(u(),o(e))}))}))}}var O=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,s.ZP)({url:e,headers:{Range:(0,M.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return o().all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,O.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var L=n(8766);function U(e,t,n,r){var i=t.segment,a=void 0!==i.range?{Range:(0,M.Z)(i.range)}:void 0,o=null;return function(e){var t;if(!(0,w.Z)(e.headers))if((0,w.Z)(A))t=e.headers;else{t=new A;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}f.Z.debug("Fetch: Called with URL",e.url);var a=null,o=!1,s=performance.now(),u=(0,w.Z)(I)?null:new I;function l(){(0,w.Z)(u)?f.Z.warn("Fetch: AbortController API not available."):u.abort()}var c=(0,w.Z)(e.timeout)?k:e.timeout,d=window.setTimeout((function(){o=!0,l()}),c),p=e.cancelSignal.register((function(e){a=e,l()}));return fetch(e.url,{headers:t,method:"GET",signal:(0,w.Z)(u)?void 0:u.signal}).then((function(t){if((0,w.Z)(d)||clearTimeout(d),t.status>=300)throw f.Z.warn("Fetch: Request HTTP Error",t),new E.Z(t.url,t.status,S.br.ERROR_HTTP_CODE);if((0,w.Z)(t.body))throw new E.Z(t.url,t.status,S.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,w.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),a=0;return o();function o(){return u.apply(this,arguments)}function u(){return(u=(0,y.Z)(b().mark((function n(){var u,l,c,d,f;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((u=n.sent).done||(0,w.Z)(u.value)){n.next=11;break}return a+=u.value.byteLength,l=performance.now(),c={url:t.url,currentTime:l,duration:l-s,sendingTime:s,chunkSize:u.value.byteLength,chunk:u.value.buffer,size:a,totalSize:r},e.onData(c),n.abrupt("return",o());case 11:if(!u.done){n.next=16;break}return p(),d=performance.now(),f=d-s,n.abrupt("return",{requestDuration:f,receivedTime:d,sendingTime:s,size:a,status:t.status,url:t.url});case 16:return n.abrupt("return",o());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==a)throw a;if(p(),o)throw f.Z.warn("Fetch: Request timeouted."),new E.Z(e.url,0,S.br.TIMEOUT);if(t instanceof E.Z)throw t;throw f.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new E.Z(e.url,0,S.br.ERROR_EVENT)}))}({url:e,headers:a,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,L.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,O.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,O.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==o?(0,O.zo)(o,t):t),a=i[0];o=i[1];for(var s=0;s<a.length;s++)if(n.onNewChunk(a[s]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function B(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=R(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(Z())return U(e,t,r,i);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var o=t.segment;return(0,s.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,M.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(6490),z=n(4644),K=408125543,V=357149030;function G(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=q(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=Y(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return G(e,t.slice(p+1,t.length),n,[d,f])}o=f}return null}function H(e,t){var n=G(2807729,[K,V],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/$(e,n[0],r)}function W(e,t){var n=G(17545,[K,V],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function j(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function q(e,t){var n=j(e,t);if(null==n)return f.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return f.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function Y(e,t){var n=j(e,t);if(null==n)return f.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return f.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function $(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var X=n(7403);function Q(e,t,n,r){var i=(0,z.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,z.MM)(e);if(t||!n.complete)return void 0===s&&f.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function J(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,h.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function ee(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,s=n.segment,l=n.manifest,c=e.data,d=e.isChunked,f=[i.start,i.end];if(null===c)return s.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=c instanceof Uint8Array?c:new Uint8Array(c),v=R(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,F.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!s.isInit){var y=h?Q(p,d,s,r):null,_=(0,u.Z)(s.timestampOffset,0);if(h){var b=(0,z.s9)(p);if(void 0!==b){var T=J(b.filter((function(e){return void 0!==s.privateInfos&&void 0!==s.privateInfos.isEMSGWhitelisted&&s.privateInfos.isEMSGWhitelisted(e)})),l.publishTime);if(void 0!==T){var E=T.needsManifestRefresh;return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:T.inbandEvents,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var S=s.indexRange,k=null;if("webm"===v)k=function(e,t){var n=G(K,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=H(e,r);if(null==a)return null;var o=W(e,r);if(null==o)return null;var s=G(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=G(187,[],e,[l,s[1]]);if(null==c)break;var d=G(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=$(e,d[0],d[1]-d[0]),p=G(241,[183],e,[c[0],c[1]]);if(null==p)return null;var v=$(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(h&&(k=(0,z.Wf)(p,Array.isArray(S)?S[0]:0),!0===t&&null!==k&&k.length>0)){var A=k[k.length-1];Array.isArray(A.range)&&(A.range[1]=1/0)}o.index instanceof X.Z&&null!==k&&k.length>0&&o.index.initializeIndex(k);var I=h?(0,z.LD)(p):"webm"===v?H(p,0):void 0;return{segmentType:"init",initializationData:p,protectionDataUpdate:m,initTimescale:(0,w.Z)(I)?void 0:I}}}var te=n(6807);function ne(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):f.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,te.Le)(e);return null===t?"":(0,h.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function re(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?f.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration)),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function ie(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,l=n.segment,c=e.data,d=e.isChunked;if(null===c)return l.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:null!==(i=l.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=R(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,l=s.isInit,c=s.indexRange,d="string"==typeof e?(0,h.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,z.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var v=(0,z.LD)(d);return o.index instanceof X.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:v}}var m=Q(d,t,s,r);return{segmentType:"media",chunkData:ne(n,d,m,t),chunkInfos:m,chunkOffset:(0,u.Z)(s.timestampOffset,0),protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i=n.period,a=n.segment,o=a.timestampOffset,s=void 0===o?0:o;if(a.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var u=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,h.uR)(u)}else r=e;return{segmentType:"media",chunkData:re(n,r,t),chunkInfos:null,chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}(c,d,n)}}var ae=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=m(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:N(r);function r(e,r,i,a){if(null==e)return o().resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return B(e,r,t,a,i);var s={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(o,u){var l=!1,c=n(s,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new g.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),B(e,r,t,a,i).then(o,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),u=ee(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:u},video:{loadSegment:a,parseSegment:u},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:N(n);function n(e,n,r,i){var a=n.adaptation,u=n.representation,l=n.segment,c=l.range;if(null===e)return o().resolve({resultType:"segment-created",resultData:null});if(l.isInit)return D(e,l,r,i);var d=R(a.type,u),f="mp4"===d||void 0===d;if(t&&f){if(Z())return U(e,n,i,r);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return f?(0,s.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,M.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,s.ZP)({url:e,responseType:"text",headers:Array.isArray(c)?{Range:(0,M.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ie(e)},image:{loadSegment:l,parseSegment:c}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var r=n(8555),i=n.n(r),a=n(7874),o=n(3887),s=n(1989),u=n(6807),l=n(8999),c=n(7714),d=n(811),f=n(6968),p=n(6923),v=n(8026),h=n(9829),m=n(3635),g=n(5278),y=n(2689),_={};function b(e){if(null!=_[e])return _[e];var t=(0,m.tG)(e);return _[e]=t,t}function T(e,t){var n=t.length+8;return n<=y.s?(0,f.zo)((0,f.kh)(n),b(e),t):(0,f.zo)((0,f.kh)(1),b(e),(0,f.el)(n+8),t)}function E(e,t){return T(e,f.zo.apply(void 0,t))}function S(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,c.Z)(t,r)){o.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,S(e),t.push(i)}else t.push(r);var a=n.adaptations,s=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,c.Z)(s,n)){o.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),s.push(r)}else s.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,c.Z)(i,n)){o.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),i.push(r)}else i.push(n)}))}))}))}))}var w=n(9689);function k(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,f.zo)([8,1,18,16],e)}]}function A(e,t){if(void 0===t&&(t=k),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,w.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,f.qb)(e,8),n=(0,m.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,m.wO)((0,w.K)(i));return(0,m.ci)(a).toLowerCase()}(r),a=(0,m.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),x=n(3911),M=n(1091),R=n(5505);function C(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,x.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function P(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var D=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,x.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=O(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[P(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,x.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,x._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],s=n[n.length-1],u=(0,x.jH)(s,null);if(!((0,x.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,x.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==s.duration)return;var f=u-c.start;if(0===f)return o.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var p=f/c.duration-1,v=c.repeatCount-p;if(v<0)return;s.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,R.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)C(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function L(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},B={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4"};var F=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=L(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,L(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),s=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===B[l]||void 0===u)return o.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,p.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:v,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==s?parseInt(s,10):s,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?B[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var m=r("CodecPrivateData"),y=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==y&&void 0===B[y]||void 0===m)return o.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,p.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==y?B[y]:y,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?B[k]:k,codecPrivateData:(0,g.Z)(w,"")};default:return o.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function s(t){var r=t.root,i=t.timescale,s=t.rootURL,u=t.protections,g=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),E=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,c.Z)(l.r,S)||o.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),I=r.getAttribute("Url"),Z=null===I?"":I;var x,M=L(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=M.qualityLevels,C=M.cNodes,P={timeline:(x=C,x.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=x[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,p.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:E};(0,d.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var N=w+((0,p.Z)(A)?"_"+A:""),O=R.map((function(t){var n,r,i,a,o=(0,h.Z)(s,Z),l={timeline:P.timeline,timescale:P.timescale,media:(n=o,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,p.Z)(t.mimeType)?t.mimeType:U[w],d=t.codecs,b=N+"_"+(null!=w?w+"-":"")+(null!=c?c+"-":"")+(null!=d?d+"-":"")+String(t.bitrate),E=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){E.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new D(l,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:g}),I=(0,v.Z)({},t,{index:A,mimeType:c,codecs:d,id:b});if(E.length>0||void 0!==a){var x=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return T("pssh",(0,f.zo)([n,0,0,0],(0,m.nr)(e),(0,f.kh)(t.length),t))}(r,n)}}));if(x.length>0){var M=[{type:"cenc",values:x}];I.contentProtections={keyIds:E,initData:M}}else I.contentProtections={keyIds:E,initData:[]}}return I}));if("ADVT"===k)return null;var B={id:N,type:w,representations:O,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(B.closedCaption=!0),B}return function(n,r,a){var o=(0,h.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,f,v=u.getAttribute("Timescale"),m=(0,p.Z)(v)?isNaN(+v)?1e7:+v:1e7,g=L(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(A(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/m)}var E,w,k,I,Z,x,M=_.reduce((function(e,t){var n=s({root:t,rootURL:o,timescale:m,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),R=null,C=void 0!==M.video?M.video[0]:void 0,P=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],O=[];if(void 0!==C){var D=C.representations[0];if(void 0!==D){var U=D.index.getFirstPosition(),B=D.index.getLastPosition();null!=U&&N.push(U),null!=B&&O.push(B)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),K=F.index.getLastPosition();null!=z&&N.push(z),null!=K&&O.push(K)}}N.length>0&&(Z=Math.max.apply(Math,N)),O.length>0&&(x=Math.min.apply(Math,O))}var V=u.getAttribute("Duration"),G=null!=V&&0!=+V?+V/m:void 0;b?(E=e.suggestedPresentationDelay,w=t,k=null!=Z?Z:w,I={isLinear:!0,value:null!=x?x:Date.now()/1e3-w,time:performance.now()},R=null!=f?f:null):(k=null!=Z?Z:0,I={isLinear:!1,value:void 0!==x?x:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:I.value,j={availabilityStartTime:void 0===w?0:w,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:R,maximumTimeData:I},periods:[{adaptations:M,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return S(j),j}},z=n(4597),K=n(8806),V=n(4460),G=n(8791),H=n(4644),W=n(2297);function j(e,t,n,r,i){var a,s,l,c=[];if(i){var d=(0,u.XA)(e);null!==d?(l=function(e){var t=(0,W.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,f.pV)(t,16*a+5),o=(0,f.pV)(t,16*a+5+8)):(s=(0,f.pX)(t,8*a+5),o=(0,f.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),s=function(e){var t=(0,W.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,f.pV)(t,12),time:(0,f.pV)(t,4)}}(d)):o.Z.warn("smooth: could not find traf atom")}if(void 0!==l)for(var p=0;p<l.length;p++)c.push({time:l[p].time,duration:l[p].duration,timescale:n});if(void 0!==s)return{nextSegments:c,chunkInfos:{time:s.time/n,duration:s.duration/n},scaledSegmentTime:s.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,H.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var q=n(3666);function Y(e,t){return T("schm",(0,f.zo)(4,(0,m.tG)(e),(0,f.kh)(t)))}function $(e){return T("frma",(0,m.tG)(e))}function X(e){var t=[7,[e.length]];return T("stsd",f.zo.apply(void 0,t.concat(e)))}function Q(e,t,n){return T("tenc",(0,f.zo)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(T("senc",i),function(e){if(0===e.length)return T("saiz",new Uint8Array(0));var t=(0,f.pX)(e,0),n=(0,f.pX)(e,4),r=new Uint8Array(n+9);r.set((0,f.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,f.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return T("saiz",r)}(i),function(e,t,n,r){return T("saio",(0,f.zo)(4,[0,0,0,1],(0,f.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),E("traf",a)}function ee(e,t){var n=(0,W.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,W.iz)(r,1835427940),a=(0,W.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,W.Qy)(a,1952868452),s=(0,W.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return T("tfdt",(0,f.zo)([1,0,0,0],(0,f.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,H.J6)(n)}(l,s[1]-s[0]),p=J(u,c,d,i,(0,W.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=E("moof",[i,p]),h=(0,W.Qy)(v,1836019558),m=(0,W.Qy)(p,1953653094),g=(0,W.Qy)(d,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,S=(0,W.Qy)(e,1835295092);if(null===S)throw new Error("Smooth: Invalid ISOBMFF given");if(!q.YM&&(0===b||b<=-8)){var w=S[1];return v.set((0,f.kh)(w),y),e.set(v,n[0]),b<=-8&&e.set(T("free",new Uint8Array(-b-8)),v.length),e}var k=S[1]+b;v.set((0,f.kh)(k),y);var A=new Uint8Array(e.length+b),I=e.subarray(0,n[0]),Z=e.subarray(n[2],e.length);return A.set(I,0),A.set(v,I.length),A.set(Z,I.length+v.length),A}var te=n(7839),ne=n(281);function re(e,t,n,r,i,a){var o,s,u,l=E("stbl",[n,T("stts",new Uint8Array(8)),T("stsc",new Uint8Array(8)),T("stsz",new Uint8Array(12)),T("stco",new Uint8Array(8))]),c=E("dinf",[function(e){return T("dref",(0,f.zo)(7,[1],e))}(T("url ",new Uint8Array([0,0,0,1])))]),d=E("minf",[r,c,l]),p=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return T("hdlr",(0,f.zo)(8,(0,m.tG)(t),12,(0,m.tG)(n),1))}(t),v=E("mdia",[function(e){return T("mdhd",(0,f.zo)(12,(0,f.kh)(e),8))}(e),p,d]),h=E("trak",[function(e,t,n){return T("tkhd",(0,f.zo)((0,f.kh)(7),8,(0,f.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,f.XT)(e),2,(0,f.XT)(t),2))}(i,a,1),v]),g=E("mvex",[(o=1,T("trex",(0,f.zo)(4,(0,f.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return E("moov",[e,t,n])}(function(e,t){return T("mvhd",(0,f.zo)(12,(0,f.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,f.XT)(t+1)))}(e,1),g,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],T("ftyp",f.zo.apply(void 0,[(0,m.tG)(s),[0,0,0,1]].concat(u.map(m.tG)))));return(0,f.zo)(_,y)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,p,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return T("avcC",(0,f.zo)([1,i,a,o,252|r,225],(0,f.XT)(e.length),e,[1],(0,f.XT)(t.length),t))}((0,m.nr)(l),(0,m.nr)(c),a);if(void 0===s){d=X([function(e,t,n,r,i,a,o){return T("avc1",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=E("schi",[Q(1,8,s)]),g=Y("cenc",65536);d=X([function(e,t,n,r,i,a,o,s){return T("encv",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,E("sinf",[$("avc1"),g,h]))])}return re(e,"video",d,((p=new Uint8Array(12))[3]=1,T("vmhd",p)),t,n)}var ae=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function oe(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return T("esds",(0,f.zo)(4,[3,25],(0,f.XT)(e),[0,4,17,64,21],11,[5,2],(0,m.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&ae.indexOf(s))<<4)|31&u)<<3,(0,m.ci)((0,f.XT)(l))):a);return re(e,"audio",function(){if(void 0===o)return X([function(e,t,n,r,i,a){return T("mp4a",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a))}(1,t,n,r,i,c)]);var e=E("schi",[Q(1,8,o)]),a=Y("cenc",65536),s=E("sinf",[$("mp4a"),a,e]);return X([function(e,t,n,r,i,a,o){return T("enca",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a,o))}(1,t,n,r,i,c,s)])}(),T("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,p.Z)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function ce(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function de(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,ne.Z)(o)}),(0,z.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!ce(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,V.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var fe=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,a,o){var s=r.segment,u=r.manifest,l=r.period,c=r.adaptation,d=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,p=s.privateInfos.smoothInitSegment,v=p.codecPrivateData,h=p.timescale,m=p.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===v)throw new Error("Smooth: no codec private data.");switch(c.type){case"video":var y=d.width,_=void 0===y?0:y,b=d.height;f=ie(h,_,void 0===b?0:b,72,72,4,v,g.keyId);break;case"audio":var T=p.channels,E=void 0===T?0:T,S=p.bitsPerSample,w=void 0===S?0:S,k=p.packetSize,A=void 0===k?0:k,I=p.samplingRate;f=oe(h,E,w,A,void 0===I?0:I,v,g.keyId);break;default:0,f=new Uint8Array(0)}return i().resolve({resultType:"segment-created",resultData:f})}if(null===e)return i().resolve({resultType:"segment-created",resultData:null});var Z={adaptation:c,manifest:u,period:l,representation:d,segment:s,transport:"smooth",url:e};return"function"!=typeof n?de(e,r,o,a,t):new Promise((function(i,s){var u=!1,l=n(Z,{reject:function(e){var t,n,r;if(!u&&!a.isCancelled){u=!0,a.deregister(c);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new te.Z(o,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);s(l)}},resolve:function(e){if(!u&&!a.isCancelled){u=!0,a.deregister(c),ce(r.representation)&&!0===t||i({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,V.Z)(n,r.segment.isInit),i({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||a.isCancelled||(u=!0,a.deregister(c),de(e,r,o,a,t).then(i,s))},progress:function(e){u||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function ve(e,t,n){var r;o.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var s=i[a];s.index instanceof D&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?s.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):o.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var he=function(e){var t=F(e),n=fe(e),r={customManifestLoader:e.manifestLoader},l={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit)return{segmentType:"init",initializationData:u,initTimescale:null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale,protectionDataUpdate:!1};var d=void 0!==n?j(c,l,n,a,s.isLive):null;if(null===d||null===d.chunkInfos||void 0===d.scaledSegmentTime)throw new Error("Smooth Segment without time information");var f=d.nextSegments,p=d.chunkInfos,v=ee(c,d.scaledSegmentTime);return f.length>0&&ve(o,f,a),{segmentType:"media",chunkData:v,chunkInfos:p,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return i().resolve(void 0);var n;pe.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,z.ZP)({url:le(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=i().resolve(e);var r=function(e){var t=ue.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return le(function(e){return se.test(e)?((0,K.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(se,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,G.Z)(r,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,u=n.responseData,l="string"==typeof u?(new DOMParser).parseFromString(u,"text/xml"):u,c=t(l,a,o);return{manifest:new s.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:l,video:l,text:{loadSegment:function(t,n,r,a){var o=n.segment,s=n.representation;return o.isInit||null===t?i().resolve({resultType:"segment-created",resultData:null}):ce(s)?(0,z.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,V.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,z.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:a.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a=t.manifest,s=t.adaptation,l=t.representation,c=t.segment,d=s.language,f=ce(l),p=l.mimeType,v=void 0===p?"":p,h=l.codec,g=void 0===h?"":h,y=e.data,_=e.isChunked;if(c.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var b,T,E,S,w=null;if(f){var k;k="string"==typeof y?(0,m.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y);var A=void 0!==n?j(k,_,n,c,a.isLive):null;i=null==A?void 0:A.nextSegments,null===(w=null!==(r=null==A?void 0:A.chunkInfos)&&void 0!==r?r:null)?_?o.Z.warn("Smooth: Unavailable time data for current text track."):(b=c.time,T=c.end):(b=w.time,T=void 0!==w.duration?w.time+w.duration:c.end);var I=g.toLowerCase();if("application/ttml+xml+mp4"===v||"stpp"===I||"stpp.ttml.im1t"===I)S="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+v);S="vtt"}var Z=(0,u.Le)(k);E=null===Z?"":(0,m.uR)(Z)}else{var x;if(b=c.time,T=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);x=(0,m.uR)(M)}else x=y;switch(v){case"application/x-sami":case"application/smil":S="sami";break;case"application/ttml+xml":S="ttml";break;case"text/vtt":S="vtt"}if(void 0===S){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+v);S="srt"}E=x}return null!==w&&Array.isArray(i)&&i.length>0&&ve(s,i,c),{segmentType:"media",chunkData:{type:S,data:E,start:b,end:T,language:d},chunkInfos:w,chunkOffset:null!=b?b:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,r){return t.segment.isInit||null===e?i().resolve({resultType:"segment-created",resultData:null}):(0,z.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===a.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:a.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7904),i=n(4597),a=n(8555),o=n.n(a),s=n(7839);function u(e,t){var n=e.customManifestLoader,a=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?a:function(e,t){return function(n,r){return new(o())((function(i,a){var o=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var o=e,l=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new s.Z(l,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(i=null==o?void 0:o.isOfflineError)&&void 0!==i&&i,null==o?void 0:o.xhr);a(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-o:void 0,n=void 0!==e.sendingTime?e.sendingTime-o:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,a))}});function c(e){u||(u=!0,"function"==typeof l&&l(),a(e))}r.register(c)}))}}(n,a)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,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];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{zo:function(){return r},zK:function(){return i},QI:function(){return a},pX:function(){return o},pV:function(){return s},qb:function(){return d},dN:function(){return f},XT:function(){return u},kh:function(){return l},el:function(){return c},O_:function(){return p},_f:function(){return v}})},8117:function(e,t,n){"use strict";var r=n(8555),i=n.n(r),a=n(1480),o=n(3102),s=n(2817),u=n(1946);t.Z=function(e){return e instanceof a.y?e:e instanceof i()||e instanceof Promise||!(0,u.Z)(e)&&"function"==typeof e.then?(0,o.D)(e):(0,s.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(d.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(8720);function h(){return function(e){return e.pipe((0,v.R)(p))}}},1959:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},R:function(){return s}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{JN:function(){return c},uH:function(){return b},F_:function(){return p},L7:function(){return m},XS:function(){return f},DD:function(){return h},rx:function(){return d},at:function(){return v},kR:function(){return g},Ti:function(){return s},A1:function(){return o},tn:function(){return _}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function p(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(1480),i=n(3887);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(o)i.Z.error("Finished shared references cannot be updated");else if(t=e,0!==n.length)for(var r,s=a(n.slice());!(r=s()).done;){var u=r.value;try{u.hasBeenUnsubscribed||u.subscriber.next(e)}catch(e){}}},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={subscriber:r,hasBeenUnsubscribed:!1};return n.push(i),function(){i.hasBeenUnsubscribed=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenUnsubscribed||r.subscriber.complete()}catch(e){}}}}}t.Z=s},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(944),i=n(9105),a=n(6923),o=n(1946),s=r.Z.DEFAULT_REQUEST_TIMEOUT;var u=function(e){var t={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?s:e.timeout};return new Promise((function(n,r){var s=e.onProgress,u=e.cancelSignal,l=t.url,c=t.headers,d=t.responseType,f=t.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=d,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(c)){var v=c;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,c=p.status,d=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;if(t="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,o.Z)(t))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));n({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:t})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return d},TZ:function(){return s},wV:function(){return u},wO:function(){return v},DM:function(){return h}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var c=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(c),u=!0,s+=2}u||(t+=n[s])}}for(var d=new Uint8Array(t.length),f=0;f<t.length;f++)d[f]=255&t.charCodeAt(f);return d}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+c(u,4):"%"+c(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function p(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function v(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(){var e,t=(e=s.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this.isUsed=!1,this._trigger=n,this.signal=new l(r)}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},8555:function(e,t,n){"use strict";var r,i="pending",a="settled",o="fulfilled",s="rejected",u=function(){},l=void 0!==n.g&&void 0!==n.g.process&&"function"==typeof n.g.process.emit,c="undefined"==typeof setImmediate?setTimeout:setImmediate,d=[];function f(){for(var e=0;e<d.length;e++)d[e][0](d[e][1]);d=[],r=!1}function p(e,t){d.push([e,t]),r||(r=!0,c(f,0))}function v(e){var t=e.owner,n=t._state,r=t._data,i=e[n],a=e.then;if("function"==typeof i){n=o;try{r=i(r)}catch(e){y(a,e)}}h(a,r)||(n===o&&m(a,r),n===s&&y(a,r))}function h(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"==typeof t)){var r=t.then;if("function"==typeof r)return r.call(t,(function(r){n||(n=!0,t===r?g(e,r):m(e,r))}),(function(t){n||(n=!0,y(e,t))})),!0}}catch(t){return n||y(e,t),!0}return!1}function m(e,t){e!==t&&h(e,t)||g(e,t)}function g(e,t){e._state===i&&(e._state=a,e._data=t,p(b,e))}function y(e,t){e._state===i&&(e._state=a,e._data=t,p(T,e))}function _(e){e._then=e._then.forEach(v)}function b(e){e._state=o,_(e)}function T(e){e._state=s,_(e),!e._handled&&l&&n.g.process.emit("unhandledRejection",e._data,e)}function E(e){n.g.process.emit("rejectionHandled",e)}function S(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof S==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){y(t,e)}try{e((function(e){m(t,e)}),n)}catch(e){n(e)}}(e,this)}S.prototype={constructor:S,_state:i,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(u),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===s&&l&&p(E,this)),this._state===o||this._state===s?p(v,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},S.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new S((function(t,n){var r=[],i=0;function a(e){return i++,function(n){r[e]=n,--i||t(r)}}for(var o,s=0;s<e.length;s++)(o=e[s])&&"function"==typeof o.then?o.then(a(s),n):r[s]=o;i||t(r)}))},S.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new S((function(t,n){for(var r,i=0;i<e.length;i++)(r=e[i])&&"function"==typeof r.then?r.then(t,n):t(r)}))},S.resolve=function(e){return e&&"object"==typeof e&&e.constructor===S?e:new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},e.exports=S},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new Z(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return M()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(x([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Z(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function x(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:M}}function M(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=x,Z.prototype={constructor:Z,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),p=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),v=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return m}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(3102),c=n(278),d=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566),h=n(7845);function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.D)([],n);var v=new r.y(g(o,n,s?function(e){return p(s,e)}:c.y));return i?v.pipe((0,d.Z)(i)):v}function g(e,t,n){return void 0===n&&(n=c.y),function(r){y(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){y(t,(function(){var u=(0,l.D)(e[i],t),c=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function y(e,t,n){e?(0,h.f)(n,e,t):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var p=n(1764),v=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,p.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,v.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(7878),a=n(1480),o=n(3994),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(v(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return p(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),p=n(5),v=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[v.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,p.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},4181:function(e,t,n){"use strict";n.d(t,{S:function(){return u}});var r=n(1480),i=n(7878),a=Array.isArray;function o(e){return 1===e.length&&a(e[0])?e[0]:e}var s=n(2566);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o(e)).length?(0,i.Xf)(e[0]):new r.y(l(e))}function l(e){return function(t){for(var n=[],r=function(r){n.push((0,i.Xf)(e[r]).subscribe(new s.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},a=0;n&&!t.closed&&a<e.length;a++)r(a)}}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},3833:function(e,t,n){"use strict";n.d(t,{h:function(){return i}});var r=n(9127);function i(e){return(0,r.U)((function(){return e}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(3994),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},9007:function(e,t,n){"use strict";n.d(t,{p:function(){return o}});var r=n(7878),i=n(7845),a=n(2566);function o(e,t,n,o,s,u,l,c){var d=[],f=0,p=0,v=!1,h=function(){!v||d.length||f||t.complete()},m=function(e){return f<o?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,r.Xf)(n(e,p++)).subscribe(new a.Q(t,(function(e){null==s||s(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,i.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<o;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new a.Q(t,m,(function(){v=!0,h()}))),function(){null==c||c()}}},3994:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var r=n(9127),i=n(7878),a=n(6798),o=n(9007),s=n(8474);function u(e,t,n){return void 0===n&&(n=1/0),(0,s.m)(t)?u((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return(0,o.p)(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=c(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{z:function(){return i},P:function(){return a}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{jO:function(){return o},yG:function(){return s},_6:function(){return u}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{x:function(){return a},O:function(){return o}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{Q:function(){return a},L:function(){return o}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{ZT:function(){return i},mG:function(){return a},Jh:function(){return o},XA:function(){return s},CR:function(){return u},ev:function(){return l},qq:function(){return c},FC:function(){return d},KL:function(){return f}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return wi}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(3505),s=n(9127),u=n(3741),l=n(2817),c=n(3994),d=n(8515),f=n(1480),p=n(9917),v={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=v);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new f.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,p.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=n(2334),_=n(6108),b=n(6362),T=n(4727),E=n(3071),S=n(6798),w=n(2566);var k=n(4978),A=n(1545),I=n(8719);function Z(){if(x()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function x(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var M=n(3666),R=n(3887);function C(){if(!M.vU)return!0;var e=function(){if(!M.vU)return R.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var P=n(944),N=n(3714),O=n(8750),D=n(5992),L=n(7874),U=n(1989),B=n(4791),F=n(1959),z=n(1946),K=n(8026),V=n(9589),G=n(2829),H=n(5095),W=n(8806),j=n(8894),q=n(6139),Y=n(6033);function $(e){return(0,p.P)((function(){var t=Y.Z.getState(e);if(null===t)return(0,l.of)(null);R.Z.info("EME: Disposing of the current MediaKeys");var n=t.loadedSessionsStore;return Y.Z.clearState(e),n.closeAllSessions().pipe((0,c.z)((function(){return(0,q.Y)(e,null)})))}))}function X(e){var t=Y.Z.getState(e);return null==t?null:t.keySystemOptions.type}var Q=n(533);function J(e){return(0,p.P)((function(){if(R.Z.info("EME: Clearing-up EME session."),M.fq)return R.Z.info("EME: disposing current MediaKeys."),$(e).pipe((0,Q.l)());var t=Y.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(R.Z.info("EME: closing all current sessions."),t.loadedSessionsStore.closeAllSessions().pipe((0,Q.l)())):(R.Z.info("EME: Nothing to clear. Returning right away. No state =",null===t),A.E)}))}var ee=n(5861),te=n(7757),ne=n.n(te),re=n(8555),ie=n.n(re),ae=n(811),oe=n(288),se=n(9105),ue=n(9362);function le(e){return e instanceof se.Z?new ue.Z("PIPELINE_LOAD_ERROR",e):(0,O.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var ce=n(7839),de=n(9822);function fe(e,t){return new(ie())((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}var pe=n(2572);function ve(e){return e instanceof se.Z?e.type===D.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===D.br.TIMEOUT||e.type===D.br.ERROR_EVENT:e instanceof ce.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,de.Z)(e)&&"INTEGRITY_ERROR"===e.code}function he(e){return e instanceof se.Z?e.type===D.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof ce.Z&&e.isOfflineError}function me(e){return he(e)?2:1}function ge(e,t,n,r){if(r.isCancelled)return ie().reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(R.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),ie().reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,ee.Z)(ne().mark((function e(n,p){var v,h,m,g,y,_,b,T;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!oe.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(ve(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(p,1),h=p>=d.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=me(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(p<d.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,pe.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,fe(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function ye(e,t,n){return ge([null],e,t,n)}function _e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return be(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Te=P.Z.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,Ee=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Se=P.Z.INITIAL_BACKOFF_DELAY_BASE,we=P.Z.MAX_BACKOFF_DELAY_BASE;var ke=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new f.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new oe.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:le(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,ae.Z)(void 0!==i),ye((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(le(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return ye((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new f.y((function(r){var i,a=performance.now(),o=new oe.ZP,s=e.sendingTime,u=e.receivedTime,l=n._getBackoffSetting((function(e){r.next({type:"warning",value:le(e)})})),c={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var d=n._pipelines.parseManifest(e,c,p,o.signal,(function(e){return f.apply(this,arguments)}));(i=d)instanceof ie()||i instanceof Promise?d.then((function(e){return v(e.manifest)})).catch((function(e){o.isUsed||h(e,!0)})):v(d.manifest)}catch(e){if(o.isUsed)return;h(e,!0)}return function(){o.cancel()};function f(){return(f=(0,ee.Z)(ne().mark((function e(t){var n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ye(t,l,o.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),le(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function p(e){for(var t,n=_e(e);!(t=n()).done;){var r=t.value;if(o.isUsed)return;h(r,!1)}}function v(e){p(e.contentWarnings);var t=performance.now()-a;R.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:s,receivedTime:u,parsingTime:t}),r.complete()}function h(e,t){var n=(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=this._settings,n=t.lowLatencyMode,r=t.maxRetryRegular,i=t.maxRetryOffline;return{onRetry:e,baseDelay:n?Se.LOW_LATENCY:Se.REGULAR,maxDelay:n?we.LOW_LATENCY:we.REGULAR,maxRetryRegular:null!=r?r:Te,maxRetryOffline:null!=i?i:Ee}},e}();var Ae=n(5138),Ie=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new f.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ae.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ae.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void R.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ae.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)R.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?R.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Ze=n(520),xe=n(7714),Me=n(908),Re=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),Ce=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,Pe=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Ne=P.Z.INITIAL_BACKOFF_DELAY_BASE,Oe=P.Z.MAX_BACKOFF_DELAY_BASE,De=(0,Me.Z)();var Le=P.Z.MIN_CANCELABLE_PRIORITY,Ue=P.Z.MAX_HIGH_PRIORITY_LEVEL,Be=function(){function e(e,t){this._transport=e,this._prioritizer=new Ie({prioritySteps:{high:Ue,low:Le}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode;return{maxRetryRegular:"image"===e?0:null!=n?n:Ce,maxRetryOffline:null!=r?r:Pe,baseDelay:i?Ne.LOW_LATENCY:Ne.REGULAR,maxDelay:i?Oe.LOW_LATENCY:Oe.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,xe.Z)(["audio","video"],e)?new Re:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,Ze.K)(e);return new f.y((function(u){var l,c,d,f=De(),p=new oe.ZP,v=[],h=0,m=!1,g={onProgress:function(e){var t;void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(R.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(R.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),ge(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,K.Z)({onRetry:function(e){u.next({type:"retry",value:le(e)})}},r),p.signal).then((function(t){var r;if(R.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});R.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType&&(d=t.resultData,b()),p.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){R.Z.debug("SF: Segment request failed",s),d=null,u.error(le(e))})),function(){var e;void 0===d&&(R.Z.debug("SF: Segment request cancelled",s),d=null,p.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){v.push(!1);var r=v.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return v[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,v[r]=!0,b()),s}catch(e){throw(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,z.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&v.length>0&&v.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):R.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Fe=n(9007);var ze=n(7878);function Ke(e,t){return t?function(n){return n.pipe(Ke((function(n,r){return(0,ze.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,S.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new w.Q(n,(function(t){i||(i=new w.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,ze.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Ve=n(2006);function Ge(e){return(0,S.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var He=n(8333),We=n(2793),je=n(5278),qe=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}(),Ye=P.Z.ABR_MINIMUM_TOTAL_BYTES,$e=P.Z.ABR_MINIMUM_CHUNK_SIZE,Xe=P.Z.ABR_FAST_EMA,Qe=P.Z.ABR_SLOW_EMA,Je=function(){function e(){this._fastEWMA=new qe(Xe),this._slowEWMA=new qe(Qe),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<$e)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){if(!(this._bytesSampled<Ye))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){this._fastEWMA=new qe(Xe),this._slowEWMA=new qe(Qe),this._bytesSampled=0},e}(),et=n(3428);function tt(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}function nt(e,t){var n=tt(t);return R.Z.debug("ABR: Steps for buffer based chooser.",n.map((function(e,n){return{bufferLevel:e,bitrate:t[n]}}))),e.pipe((0,s.U)((function(e){return function(e,t,n){var r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return t[0];var s,u=(0,Ae.Z)(t,(function(e){return e===i}));if(u<0||t.length!==n.length)return R.Z.error("ABR: Current Bitrate not found in the calculated levels"),t[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=n[u],c=function(){for(var e=u+1;e<n.length;e++)if(n[e]>l)return e}();if(null!=c&&r>=n[c])return t[c]}if((null==s||s<1.15)&&r<n[u]){for(var d=u-1;d>=0;d--)if(t[d]<i)return t[d];return i}return i}(e,t,n)})))}var rt=n(3274),it=P.Z.ABR_REGULAR_FACTOR,at=P.Z.ABR_STARVATION_DURATION_DELTA,ot=P.Z.ABR_STARVATION_FACTOR,st=P.Z.ABR_STARVATION_GAP,ut=P.Z.OUT_OF_STARVATION_GAP;function lt(e){if(!(e.progress.length<5)){for(var t=new qe(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function ct(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var dt=function(){function e(e,t){this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:st.LOW_LATENCY,outOfStarvationGap:ut.LOW_LATENCY,starvationBitrateFactor:ot.LOW_LATENCY,regularBitrateFactor:it.LOW_LATENCY}:{starvationGap:st.DEFAULT,outOfStarvationGap:ut.DEFAULT,starvationBitrateFactor:ot.DEFAULT,regularBitrateFactor:it.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0;return isNaN(c)||d+l<c-at?!this._inStarvationMode&&d<=s.starvationGap?(R.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(R.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(R.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,p=lt(c);if(void 0!==f&&void 0!==p){var v=ct(f,p);if((d-f.timestamp)/1e3<=v&&v-u/o>2e3)return p}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(R.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position+r,a=(0,rt.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=lt(a);if(void 0===s||void 0===u)return!0;var l=ct(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function ft(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vt=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=ht(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(R.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,Ae.Z)(e,(function(e){return e.id===t.id}));if(n<0)return R.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=ht(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=ft(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=lt(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function ht(e,t){var n=e.length,r=(0,Ae.Z)(e,(function(e){return e.id===t.id}));if(r<0)return R.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var mt=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),gt=n(1679),yt=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):R.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&R.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,gt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),_t=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new qe(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(R.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function bt(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ae.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Tt(e,t){var n=e;return null!=t.bitrate&&(n=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ae.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,je.Z)(e.width,0)-(0,je.Z)(t.width,0)})),r=(0,rt.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(n,t.width)),n}function Et(e){var t=e.bandwidthEstimator,n=e.observation$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,u=e.minAutoBitrate$,c=e.maxAutoBitrate$,d=e.representations,f=e.streamEvents$,v=new _t,h=new dt(null==i?0:i,a),g=new yt;var b=f.pipe((0,m.h)((function(e){return"metrics"===e.type})),(0,Ve.b)((function(e){return function(e){var n=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(t.addSample(n,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,n/1e3,u)}}(e.value)})),(0,Q.l)()),T=f.pipe((0,Ve.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,Q.l)()),S=f.pipe((0,m.h)((function(e){return"representationChange"===e.type})),(0,s.U)((function(e){return e.value.representation})),(0,_.O)(null)),w=(0,p.P)((function(){if(0===d.length)throw new Error("ABRManager: no representation choice given");return 1===d.length?(0,l.of)({bitrate:void 0,representation:d[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,k.w)((function(e){if(e>=0){var i=bt(d,e,0,1/0);return(0,l.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var o=new mt,p=!1,b=new vt(v,o),T=nt(f.pipe((0,m.h)((function(e){return"added-segment"===e.type})),(0,et.M)(n),(0,s.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,G.L7)(a,i),s=t.content.representation,u=v.getEstimate(s),l=null==u?void 0:u[0];return{bufferGap:o,currentBitrate:s.bitrate,currentScore:l,speed:r}}))),d.map((function(e){return e.bitrate}))).pipe((0,_.O)(void 0));return(0,y.a)([n,u,c,r,T]).pipe((0,et.M)(S),(0,s.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],c=e[1],f=r.bufferGap,m=r.liveGap,y=Tt(d,u),_=g.getRequests(),T=h.getBandwidthEstimate(r,t,c,_,o.bandwidth),E=T.bandwidthEstimate,S=T.bitrateChosen,w=v.getLastStableRepresentation(),k=null===w?void 0:w.bitrate/(r.speed>0?r.speed:1);p&&f<=5?p=!1:!p&&isFinite(f)&&f>10&&(p=!0);var A=bt(y,S,i,s),I=A.bitrate,Z=null;p&&void 0!==l&&l>I&&(I=(Z=bt(y,l,i,s)).bitrate);var x=null;return a&&null!==c&&void 0!==m&&m<40&&(x=b.getGuess(d,r,c,I,_)),null!==x&&x.bitrate>I?(R.Z.debug("ABR: Choosing representation with guess-based estimation.",x.bitrate,x.id),o.update(x,E,2),{bitrate:E,representation:x,urgent:null===c||x.bitrate<c.bitrate,manual:!1,knownStableBitrate:k}):null!==Z?(R.Z.debug("ABR: Choosing representation with buffer-based estimation.",Z.bitrate,Z.id),o.update(Z,E,0),{bitrate:E,representation:Z,urgent:h.isUrgent(Z.bitrate,c,_,r),manual:!1,knownStableBitrate:k}):(R.Z.debug("ABR: Choosing representation with bandwidth estimation.",A.bitrate,A.id),o.update(A,E,1),{bitrate:E,representation:A,urgent:h.isUrgent(A.bitrate,c,_,r),manual:!1,knownStableBitrate:k})})))})))}));return(0,E.T)(b,T,w)}var St=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,u=this._getBandwidthEstimator(e),c=(0,je.Z)(null===(i=this._manualBitrates[e])||void 0===i?void 0:i.asObservable(),(0,l.of)(-1)),d=(0,je.Z)(null===(a=this._minAutoBitrates[e])||void 0===a?void 0:a.asObservable(),(0,l.of)(0)),f=(0,je.Z)(null===(o=this._maxAutoBitrates[e])||void 0===o?void 0:o.asObservable(),(0,l.of)(1/0)),p=(0,je.Z)(this._initialBitrates[e],0);return Et({bandwidthEstimator:u,streamEvents$:r,observation$:n,filters$:function(e,t,n){var r=[];null!=e&&r.push(e.pipe((0,s.U)((function(e){return{width:e}}))));null!=n&&r.push(n.pipe((0,s.U)((function(e){return{bitrate:e}}))));null!=t&&r.push(t.pipe((0,s.U)((function(e){return{bitrate:e}}))));return r.length>0?(0,y.a)(r).pipe((0,s.U)((function(e){return K.Z.apply(void 0,[{}].concat(e))}))):(0,l.of)({})}(this._throttlers.limitWidth[e],this._throttlers.throttleBitrate[e],this._throttlers.throttle[e]),initialBitrate:p,manualBitrate$:c,minAutoBitrate$:d,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){R.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Je;return this._bandwidthEstimators[e]=n,n}return t},e}(),wt=n(4507),kt=n(5767),At=n(3774),It=n(6923),Zt=I.ym;function xt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(R.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){R.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&R.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,kt.Z)(e),null!==n)try{R.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){R.Z.warn("Init: Error while revoking the media source URL",e)}}function Mt(e){return function(e){return new f.y((function(t){if(null==At.J)throw new N.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,It.Z)(e.src)?e.src:null;xt(e,null,n),R.Z.info("Init: Creating MediaSource");var r=new At.J,i=URL.createObjectURL(r);return R.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){xt(e,r,i)}}))}(e).pipe((0,c.z)((function(e){return Zt(e).pipe((0,T.q)(1),(0,s.U)((function(){return e})))})))}var Rt=n(8343),Ct=P.Z.DEFAULT_LIVE_GAP;var Pt=n(3610),Nt=n(6697),Ot=n(2401);var Dt=n(7904),Lt=n(6968),Ut=n(2870),Bt=n(9612),Ft=P.Z.SOURCE_BUFFER_FLUSHING_INTERVAL;var zt=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);return a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n,(0,Nt.F)(Ft).pipe((0,Ve.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"error").pipe((0,Ve.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"updateend").pipe((0,Ve.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return R.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,Ze.K)(e.inventoryInfos)),this._addToQueue({type:Bt.f.Push,value:e})},r.removeBuffer=function(e,t){return R.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Bt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return R.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,Ze.K)(e)),this._addToQueue({type:Bt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Bt.f.Push:case Bt.f.Remove:case Bt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){R.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new f.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,K.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Bt.f.Push||0===e.data.length){switch(e.type){case Bt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Bt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case Bt.f.Remove:this.synchronizeInventory();break;default:(0,Dt.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Bt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,K.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,K.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Bt.f.EndOfSegment:return R.Z.debug("AVSB: Acknowledging complete segment",(0,Ze.K)(this._pendingTask.value)),void this._flush();case Bt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();R.Z.debug("AVSB: pushing segment",this.bufferType,(0,Ze.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case Bt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;R.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Dt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(R.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return R.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:R.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;R.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Lt._f)(s);this._lastInitSegment={data:u,hash:(0,Ut.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Lt._f)(e);if((0,Ut.Z)(n)===this._lastInitSegment.hash&&(0,B.Z)(t,n))return!0}return!1},n}(Bt.C),Kt=["audio","video","text","image"];function Vt(e){return"audio"===e||"video"===e}var Gt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Vt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==L.Z.nativeTextTracksBuffer&&null==L.Z.htmlTextTracksBuffer||e.push("text"),null!=L.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,l.of)(void 0):new f.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else R.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(Vt(e)){if(null!=i)return i instanceof zt&&i.codec!==t?R.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):R.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;R.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new zt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return R.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(R.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==L.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new L.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==L.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new L.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==L.Z.imageBuffer)throw new Error("Image buffer feature not activated");return R.Z.info("SB: Creating a new image SegmentBuffer"),r=new L.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw R.Z.error("SB: Unknown buffer type:",e),new N.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(R.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):R.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Kt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Ht=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,rt.Z)(this._array,e)},t.has=function(e){return(0,xe.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Wt=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),jt=n(3102),qt=n(9834);function Yt(e){var t=e.segmentBuffer,n=e.currentTime$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,y.a)([n,r,i]).pipe((0,c.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return A.E;var i=[],a=(0,G.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,jt.D)(i.map((function(t){return R.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,qt.u)(),(0,Q.l)())}(t,n,r,i)})))}var $t=n(8567),Xt=n(9878);function Qt(e,t,n,r){return n.observe(!0).pipe((0,s.U)((function(i){var a,o=n.getCurrentTime()+r,s=Math.min(Math.max(e.start,o),null!==(a=e.end)&&void 0!==a?a:1/0);return $t.Z.waitingMediaSourceReload(t,e,s,!i.isPaused)})))}var Jt=n(7473),en=n.n(Jt);var tn=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,p.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,k.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():A.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,k.w)((function(t){return null===t.initSegment?A.E:e._requestInitSegment(t.initSegment)})));return(0,E.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,l.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,K.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,c.z)((function(n){switch(n.type){case"retry":return(0,l.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return R.Z.info("Stream: segment request interrupted temporarly.",r),A.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,l.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,T.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,ae.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,K.Z)({},t,{type:"parsed-media",segment:r})})),Ge((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,Dt.Z)(n)}})))};return(0,p.P)((function(){return n(t)})).pipe(Ge((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,A.E;var n=e.segment,r=e.priority,i=(0,K.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,l.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return R.Z.info("Stream: init segment request interrupted temporarly.",n),A.E;case"chunk":var r=e.parse(void 0);return(0,ae.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,b.z)((0,l.of)((0,K.Z)({},r,{type:"parsed-init",segment:n})),(0,p.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),A.E})));case"chunk-complete":return(0,l.of)({type:"end-of-segment",value:{segment:n}});case"ended":return A.E;default:(0,Dt.Z)(e)}}))).pipe(Ge((function(){t._initSegmentRequest=null})))},e}();function nn(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return R.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return R.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,p=i[d].bufferedStart;return R.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var v=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return R.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}var rn=P.Z.CONTENT_REPLACEMENT_PADDING,an=P.Z.BITRATE_REBUFFERING_RATIO,on=P.Z.MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT,sn=P.Z.MINIMUM_SEGMENT_SIZE,un=Math.min(1/60,sn);function ln(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=n.representation.index.getSegments(o.start,o.end-o.start),l=t.filter((function(e){return!dn(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){if(void 0===e.bufferedStart)return R.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>on)return R.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;R.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){if(void 0===e.bufferedEnd)return R.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>on)return R.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;R.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0}));return u.filter((function(e){var t=(0,K.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,Ze.z)(t,e)})))return!1;var a=e.duration,o=e.time,u=e.end;if(e.isInit)return!0;if(e.complete&&a<sn)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-un>o)&&(!(a.end+un<u)&&!dn(e,t,r,i))})))return!1;for(var c=0;c<l.length;c++){var d=l[c];if(d.infos.period.id===n.period.id){var f=d.infos.segment;if(o-f.time>-un&&f.end-u>-un)return!1}}for(var p=0;p<l.length;p++){var v=l[p];if(v.end>o)return v.start>o+un||cn(l,p).end<u-un}return!0}))}function cn(e,t){for(var n=t+1;n<e.length-1&&e[n-1].end+un>e[n].start;)n++;return e[--n]}function dn(e,t,n,r){return e.period.id===t.period.id&&(!(e.segment.time<n+rn)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate;if(void 0===n){var i=r*an;return t.bitrate>i}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}var fn=P.Z.SEGMENT_PRIORITIES_STEPS;function pn(e,t){for(var n=e-t,r=0;r<fn.length;r++)if(n<fn[r])return r;return fn.length}var vn=P.Z.MINIMUM_SEGMENT_SIZE;function hn(e,t,n,r,i,a){var o,s=e.period,u=e.representation;a.synchronizeInventory();var l,c,d=t+i,f={start:Math.max(t,s.start),end:Math.min(d,null!==(o=s.end)&&void 0!==o?o:1/0)},p=u.index.shouldRefresh(t,d),v=a.getPendingOperations().filter((function(e){return e.type===Bt.f.EndOfSegment})).map((function(e){return e.value})),h=function(e,t){for(var n=Math.max(1/60,vn),r=e.start+n,i=e.end-n,a=[],o=t.length-1;o>=0;o--){var s=t[o],u=s.infos.representation;if(!s.partiallyPushed&&!1!==u.decipherable&&u.isSupported){var l=s.infos.segment,c=l.time/l.timescale;((l.complete?c+l.duration/l.timescale:s.end)>r&&c<i||s.end>r&&s.start<i)&&a.unshift(s)}}return a}({start:Math.max(f.start-.5,0),end:f.end+.5},a.getInventory()),m=ln({content:e,bufferedSegments:h,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:a.getSegmentHistory.bind(a),neededRange:f,segmentsBeingPushed:v}).map((function(e){return{priority:pn(e.time,t),segment:e}})),g=u.index.getLastPosition();if(!u.index.isInitialized()||void 0===s.end||m.length>0)l=!1;else if(void 0===g)l=f.end>=s.end&&u.index.isFinished();else if(null===g)l=u.index.isFinished();else{var y=void 0!==s.end?Math.min(s.end,g):g;l=f.end>=y&&u.index.isFinished()}if(u.index.isInitialized()&&(u.index.areSegmentsChronologicallyGenerated()||l)){var _=null;v.length>0&&(_=Math.min.apply(Math,v.map((function(e){return e.segment.time})))),m.length>0&&(_=null!==_?Math.min(_,m[0].segment.time):m[0].segment.time),c=nn(e,f,_,l,h)}else c=null;return{imminentDiscontinuity:c,hasFinishedLoading:l,neededSegments:m,shouldRefreshManifest:p}}var mn=P.Z.BUFFER_GC_GAPS.CALM,gn=P.Z.BUFFER_GC_GAPS.BEEFY;function yn(e,t,n){for(var r=(0,G.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n<u.end||e+n>u.start)&&o.push(u)}return null!=i&&(R.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function _n(e,t,n){var r=t.pushChunk(n);return r.pipe((0,Xt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new N.Z("BUFFER_APPEND_ERROR",i)}return e.observe(!0).pipe((0,c.z)((function(e){var n,i,a=e.position+e.wantedTimeOffset;return(0,b.z)((n=a,i=t,(0,p.P)((function(){R.Z.warn("Stream: Running garbage collector");var e=i.getBufferedRanges(),t=yn(n,e,mn);return 0===t.length&&(t=yn(n,e,gn)),R.Z.debug("Stream: GC cleaning",t),(0,jt.D)(t.map((function(e){var t=e.start,n=e.end;return i.removeBuffer(t,n)}))).pipe((0,qt.u)())}))).pipe((0,Q.l)()),r).pipe((0,Xt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new N.Z("BUFFER_FULL_ERROR",t)})))})))})))}var bn=P.Z.APPEND_WINDOW_SECURITIES;var Tn=function(e){var t=e.content,n=e.options,r=e.playbackObserver,a=e.segmentBuffer,o=e.segmentFetcher,u=e.terminate$,d=t.period,f=t.adaptation,v=t.representation,h=n.bufferGoal$,m=n.drmSystemId,k=n.fastSwitchThreshold$,I=f.type,Z={segment:v.index.getInitSegment(),segmentData:null,isLoaded:!1},x=new i.x,M=(0,H.$)({initSegment:null,segmentQueue:[]}),C=null!==Z.segment,P=new tn(t,M,o,C);C||(Z.segmentData=null,Z.isLoaded=!0);var N=!1,O=A.E;if(void 0!==m){var D=v.getEncryptionData(m);D.length>0&&(O=l.of.apply(void 0,D.map((function(e){return $t.Z.encryptionDataEncountered(e)}))),N=!0)}var L,U,B=P.start().pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,b.z)((0,l.of)({type:"warning",value:e.value.error}),(0,p.P)((function(){var t=e.value.segment,n=v.index;if(!1===n.isSegmentStillAvailable(t))x.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,l.of)($t.Z.manifestMightBeOufOfSync());return A.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){en()((function(){x.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var n=v.getAllEncryptionData(),i=!N&&n.length>0?l.of.apply(void 0,n.map((function(e){return $t.Z.encryptionDataEncountered(e)}))):A.E,o=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,p.P)((function(){if(null===i)return A.E;var e=n.representation.getMimeTypeString();return _n(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return $t.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:a});return(0,E.T)(i,o)}var u=e.inbandEvents,c=e.needsManifestRefresh,d=e.protectionDataUpdate&&!N?l.of.apply(void 0,v.getAllEncryptionData().map((function(e){return $t.Z.encryptionDataEncountered(e)}))):A.E,f=!0===c?(0,l.of)($t.Z.needsManifestRefresh()):A.E,h=void 0!==u&&u.length>0?(0,l.of)({type:"inband-events",value:u}):A.E,m=Z.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,p.P)((function(){var e,u;if(null===i.chunkData)return A.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.appendWindow,p=n.representation.getMimeTypeString(),v=[void 0!==f[0]?Math.max(0,f[0]-bn.START):void 0,void 0!==f[1]?f[1]+bn.END:void 0],h={initSegment:r,chunk:l,timestampOffset:d,appendWindow:v,codec:p},m=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,g=m+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==v[0]&&(m=Math.max(m,v[0])),void 0!==v[1]&&(g=Math.min(g,v[1]));var y=(0,K.Z)({segment:a,start:m,end:g},n);return _n(t,o,{data:h,inventoryInfos:y}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return $t.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:a});return(0,b.z)(d,f,h,g)}(e);case"end-of-segment":var n=e.value.segment;return a.endOfSegment((0,K.Z)({segment:n},t)).pipe((0,Q.l)());case"end-of-queue":return x.next(),A.E;default:(0,Dt.Z)(e)}}))),F=(0,y.a)([r.observe(!0),h,u.pipe((0,T.q)(1),(0,_.O)(null)),x.pipe((0,_.O)(void 0))]).pipe((0,et.M)(k),(0,c.z)((function(e){var n=e[0],i=n[0],o=n[1],s=n[2],u=e[1],c=i.position+i.wantedTimeOffset,f=hn(t,c,r,u,o,a),p=f.neededSegments,h=null;if(v.index.isInitialized()){if(p.length>0&&!Z.isLoaded&&null!==Z.segment){var m=p[0].priority;h={segment:Z.segment,priority:m}}}else if(null===Z.segment)R.Z.warn("Stream: Uninitialized index without an initialization segment");else if(Z.isLoaded)R.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var g=i.position+i.wantedTimeOffset;h={segment:Z.segment,priority:pn(d.start,g)}}if(null===s)M.setValue({initSegment:h,segmentQueue:p});else{if(s.urgent)return R.Z.debug("Stream: Urgent switch, terminate now.",I),M.setValue({initSegment:null,segmentQueue:[]}),M.finish(),(0,l.of)($t.Z.streamTerminating());var y=p[0],_=P.getRequestedInitSegment(),T=P.getRequestedMediaSegment(),E=null===T||void 0===y||T.id!==y.segment.id?[]:[y],S=null===_?null:h;if(M.setValue({initSegment:S,segmentQueue:E}),0===E.length&&null===S)return R.Z.debug("Stream: No request left, terminate",I),M.finish(),(0,l.of)($t.Z.streamTerminating())}var w=(0,l.of)({type:"stream-status",value:{period:d,position:i.position,bufferType:I,imminentDiscontinuity:f.imminentDiscontinuity,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}});return f.shouldRefreshManifest?(0,b.z)((0,l.of)($t.Z.needsManifestRefresh()),w):w})),(L=function(e){return"stream-terminating"!==e.type},void 0===(U=!0)&&(U=!1),(0,S.e)((function(e,t){var n=0;e.subscribe(new w.Q(t,(function(e){var r=L(e,n++);(r||U)&&t.next(e),!r&&t.complete()})))}))));return(0,E.T)(F,B,O).pipe((0,g.B)())};var En=P.Z.DELTA_POSITION_AFTER_RELOAD;var Sn=function(e){var t=e.abrManager,n=e.playbackObserver,r=e.content,a=e.options,o=e.segmentBuffer,d=e.segmentFetcherCreator,f=e.wantedBufferAhead,v="direct"===a.manualBitrateSwitchingMode,h=r.manifest,y=r.period,_=r.adaptation,S={},w=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x;return{estimator$:(0,E.T)((0,F.R)(r,"decipherabilityUpdate"),(0,l.of)(null)).pipe((0,s.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new N.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,k.w)((function(e){return t.get$(a.type,e,n,o)}))),abrFeedbacks$:o}}(r,t,n.observe(!0)),I=w.estimator$,Z=w.abrFeedbacks$,x=d.createSegmentFetcher(_.type,{onRequestBegin:function(e){Z.next({type:"requestBegin",value:e})},onRequestEnd:function(e){Z.next({type:"requestEnd",value:e})},onProgress:function(e){Z.next({type:"progress",value:e})},onMetrics:function(e){Z.next({type:"metrics",value:e})}}),M=(0,H.$)(null),C=I.pipe((0,Ve.b)((function(e){M.setValue(e)})),(0,He.Z)(),(0,g.B)()),P=C.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return R.Z.debug("Stream: new "+_.type+" bitrate estimate",t),$t.Z.bitrateEstimationChange(_.type,t)}))),D=C.pipe(Ke((function(e,t){return L(e,0===t)})));return(0,E.T)(D,P);function L(e,t){var r=e.representation;if(v&&e.manual&&!t)return Qt(y,_.type,n,En.bitrateSwitch);var i=M.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,T.q)(1),(0,s.U)((function(e){return null===e?(R.Z.info("Stream: urgent Representation termination",_.type),{urgent:!0}):e.urgent?(R.Z.info("Stream: urgent Representation switch",_.type),{urgent:!0}):(R.Z.info("Stream: slow Representation switch",_.type),{urgent:!1})}))),o=a.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,l.of)(0),d=(0,l.of)($t.Z.representationChange(_.type,y,r));return(0,b.z)(d,U(r,i,o)).pipe((0,Ve.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,c.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?A.E:L(t,!1)}return(0,l.of)(e)})))}function U(e,t,r){return(0,p.P)((function(){var i=S[e.id],u=null!=i?i:1;S[e.id]=u;var l=f.asObservable().pipe((0,s.U)((function(e){return e*u})));return R.Z.info("Stream: changing representation",_.type,e.id,e.bitrate),Tn({playbackObserver:n,content:{representation:e,adaptation:_,period:y,manifest:h},segmentBuffer:o,segmentFetcher:x,terminate$:t,options:{bufferGoal$:l,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,Xt.K)((function(n){var i=(0,O.Z)(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=f.getValue(),o=u;if(o<=.25||a*o<=2)throw i;return S[e.id]=o-.25,U(e,t,r)}throw i})))}))}};function wn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable(),s=e.observe(!0);return(0,y.a)([s,o]).pipe((0,c.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(R.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,l.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var kn=n(9252);var An=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,rt.Z)(i,(function(e){return(0,kn.Z)(e,"codecs=")})),l=(0,rt.Z)(s,(function(e){return(0,kn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]},In=P.Z.ADAPTATION_SWITCH_BUFFER_PADDINGS;function Zn(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return An(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,G.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,G.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,G.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,G.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return An(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,G.A1)(d,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=In[g].before;null==y&&(y=0);var _=In[g].after;if(null==_&&(_=0),v||h.push({start:p-y,end:p+_}),void 0!==t.end){var b=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==b&&(void 0===b.bufferedStart||b.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var T=(0,G.uH)(f,h);return 0===T.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:T}:{type:"clean-buffer",value:T}}var xn=P.Z.DELTA_POSITION_AFTER_RELOAD;var Mn=function(e){var t=e.abrManager,n=e.bufferType,r=e.content,i=e.garbageCollectors,o=e.playbackObserver,u=e.segmentFetcherCreator,d=e.segmentBuffersStore,f=e.options,v=e.wantedBufferAhead,h=r.period,m=new a.t(1);return m.pipe((0,k.w)((function(e,a){var m=0===a?0:"audio"===n?xn.trackSwitch.audio:"video"===n?xn.trackSwitch.video:xn.trackSwitch.other;if(null===e){R.Z.info("Stream: Set no "+n+" Adaptation. P:",h.start);var g,y=d.getStatus(n);if("initialized"===y.type){if(R.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),Gt.isNative(n))return Qt(h,n,o,0);g=y.value.removeBuffer(h.start,null==h.end?1/0:h.end)}else"uninitialized"===y.type&&d.disableSegmentBuffer(n),g=(0,l.of)(null);return(0,b.z)(g.pipe((0,s.U)((function(){return $t.Z.adaptationChange(n,null,h)}))),wn(o,v,n,{period:h}))}if(Gt.isNative(n)&&"disabled"===d.getStatus(n).type)return Qt(h,n,o,m);R.Z.info("Stream: Updating "+n+" adaptation","A: "+e.id,"P: "+h.start);var _=(0,p.P)((function(){var a=o.getReadyState(),p=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return R.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(d,n,e,f),g={currentTime:o.getCurrentTime(),readyState:a},y=Zn(p,h,e,g,f);if("needs-reload"===y.type)return Qt(h,n,o,m);var _="flush-buffer"===y.type?(0,l.of)($t.Z.needsBufferFlush()):A.E,T="clean-buffer"===y.type||"flush-buffer"===y.type?b.z.apply(void 0,y.value.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n)}))).pipe((0,Q.l)()):A.E,S=i.get(p),w=function(e,i){var a=r.manifest,c=function(e,t){return e.deriveReadOnlyObserver((function(e){return e.pipe((0,s.U)(n))}),n);function n(e){var n=t.getBufferedRanges();return(0,K.Z)({},e,{bufferGap:(0,G.L7)(n,e.position)})}}(o,i);return Sn({abrManager:t,content:{manifest:a,period:h,adaptation:e},options:f,playbackObserver:c,segmentBuffer:i,segmentFetcherCreator:u,wantedBufferAhead:v}).pipe((0,Xt.K)((function(e){if(!Gt.isNative(n)){R.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),d.disposeSegmentBuffer(n);var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,b.z)((0,l.of)($t.Z.warning(t)),wn(o,v,n,{period:h}))}throw R.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,p);return d.waitForUsableBuffers().pipe((0,c.z)((function(){return(0,b.z)(T,_,(0,E.T)(w,S))})))}));return(0,b.z)((0,l.of)($t.Z.adaptationChange(n,e,h)),_)})),(0,_.O)($t.Z.periodStreamReady(n,h,m)))},Rn=n(3074);function Cn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,_.O)(!1),(0,u.x)())}));return(0,y.a)(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var Pn=P.Z.MAXIMUM_MAX_BUFFER_AHEAD,Nn=P.Z.MAXIMUM_MAX_BUFFER_BEHIND;var On=function(e,t,n,r,a,d){var f,v,h=e.manifest,S=e.initialPeriod,w=d.maxBufferAhead,k=d.maxBufferBehind,I=d.wantedBufferAhead,Z=new Wt((function(e){var n=e.bufferType,r=null!=Nn[n]?Nn[n]:1/0,i=null!=Pn[n]?Pn[n]:1/0;return Yt({segmentBuffer:e,currentTime$:t.observe(!0).pipe((0,s.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:k.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:w.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),x=t.observe(!0).pipe((0,We.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<h.getMinimumPosition()){var r=new N.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return $t.Z.warning(r)}if(n>h.getMaximumPosition()){var i=new N.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return $t.Z.warning(i)}return null}),null)),M=r.getBufferTypes().map((function(e){return function(e,n){var a=new Ht((function(e,t){return e.start-t.start})),o=new i.x,u=!1;function d(t){return D(e,t,o).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return $t.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return $t.Z.needsMediaSourceReload(r,i);case"periodStreamReady":u=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,g.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var v=t.observe(!0).pipe((0,We.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!u||!f(a))return null;var s=null!==(n=h.getPeriodForTime(a))&&void 0!==n?n:h.getNextPeriod(a);return void 0===s?null:(R.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),u=!1,o.next(),s)}),null),(0,c.z)((function(e){if(null==e)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(e)}))),m=(0,F.R)(h,"decipherabilityUpdate").pipe((0,c.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return A.E;var s=a.filter((function(e){return!1===e.representation.decipherable})),f=i.value,v=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){R.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(f,s);return 0===v.length?A.E:(u=!1,o.next(),b.z.apply(void 0,v.map((function(e){var t=e.start,n=e.end;return f.removeBuffer(t,n).pipe((0,Q.l)())})).concat([t.observe(!0).pipe((0,T.q)(1),(0,c.z)((function(e){return(0,b.z)((0,l.of)($t.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,p.P)((function(){var t=e.position+e.wantedTimeOffset,n=h.getPeriodForTime(t);if(null==n)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(n)})))})))])))})));return(0,E.T)(v,m,d(n))}(e,S).pipe((0,He.Z)(),(0,g.B)())})),C=(f=M,v=f.length,E.T.apply(void 0,f).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Rn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===v&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return R.Z.info("Stream: New active period",e.start),$t.Z.activePeriodChanged(e)}))),P=(0,F.R)(h,"manifestUpdate").pipe((0,s.U)((function(){return h.isLastPeriodKnown})),(0,_.O)(h.isLastPeriodKnown),(0,u.x)()),O=(0,y.a)([Cn.apply(void 0,M),P]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?$t.Z.endOfStream():$t.Z.resumeStream()})));return E.T.apply(void 0,M.concat([C,O,x]));function D(e,s,u){R.Z.info("SO: Creating new Stream for",e,s.start);var f=new i.x,p=new i.x,v=t.observe(!0).pipe((0,m.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),y=f.pipe(Ke((function(t){return D(e,t,p)}))),_=u.pipe((0,T.q)(1),(0,Ve.b)((function(){f.complete(),p.next(),p.complete()})),(0,g.B)()),S=(0,E.T)(v,_),w=Mn({abrManager:n,bufferType:e,content:{manifest:h,period:s},garbageCollectors:Z,segmentFetcherCreator:a,segmentBuffersStore:r,options:d,playbackObserver:t,wantedBufferAhead:I}).pipe((0,c.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=h.getPeriodAfter(s);if(null===n)return(0,b.z)((0,l.of)(t),(0,l.of)($t.Z.streamComplete(e)));f.next(n)}else p.next();return(0,l.of)(t)})),(0,g.B)()),k=(0,b.z)(w.pipe((0,o.R)(S)),(0,l.of)($t.Z.periodStreamCleared(e,s)).pipe((0,Ve.b)((function(){R.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,E.T)(k,y,_.pipe((0,Q.l)()))}};function Dn(e,t,n){return function(e){return(0,E.T)((0,I.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,I.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,I.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,_.O)("open"===e.readyState),(0,u.x)())}(e).pipe((0,k.w)((function(t){return t?function(e){if(0===e.length)return(0,l.of)(void 0);for(var t=[],n=function(n){var r=e[n];t.push((0,E.T)((0,Ot.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,Ot.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,Nt.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,_.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return(0,y.a)(t).pipe((0,m.h)((function(e){return e.every((function(e){return!e}))})),(0,s.U)((function(){})))}(e.sourceBuffers):A.E})),(0,T.q)(1),(0,s.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(R.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,Xt.K)((function(e){return R.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,l.of)(null)})))}var Ln=n(5039),Un=n(4181),Bn=n(5987);var Fn=I.gg,zn=I.ym,Kn=I._E;function Vn(e){return(0,p.P)((function(){if(R.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return R.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,l.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return R.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,l.of)(null);R.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return Kn(e).pipe((0,T.q)(1))}));return(0,Un.S)(E.T.apply(void 0,i).pipe((r=1,r<=0?function(){return A.E}:(0,S.e)((function(e,t){var n=[];e.subscribe(new w.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,Bn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),Fn(t).pipe((0,T.q)(1))).pipe((0,c.z)((function(){return Vn(e)})))}))}var Gn=n(7920),Hn=n(467);var Wn=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var jn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(Wn(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n},qn=P.Z.STREAM_EVENT_EMITTER_POLL_INTERVAL;function Yn(e){return void 0!==e.end}var $n=function(e,t,n){var r=new WeakMap,i=[];return(0,F.R)(e,"manifestUpdate").pipe((0,_.O)(null),(0,Rn.R)((function(t){return jn(t,e)}),[])).pipe((0,Ve.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,k.w)((function(e){return e?(0,y.a)([(0,Nt.F)(qn).pipe((0,_.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,S.e)((function(e,t){var n,r=!1;e.subscribe(new w.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,c.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],c=0;c<e.length;c++){var d=e[c],f=d.start,p=Yn(d)?d.end:void 0;r.has(d)?(f>o||void 0!==p&&o>=p)&&(Yn(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),Yn(d)&&u.push(d.publicEvent)))}return(0,b.z)(s.length>0?l.of.apply(void 0,s):A.E,u.length>0?l.of.apply(void 0,u).pipe((0,Ve.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,Q.l)()):A.E)}(i,t,n)}))):A.E})))},Xn=n(2983);function Qn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.abrManager,d=e.playbackObserver,f=e.segmentFetcherCreator;return function(e,v,h){var g,b=function(e,t){return(0,p.P)((function(){var n;return Dn(t,e).pipe((0,c.z)((function(r){return null!==r&&(n=r),(0,F.R)(e,"manifestUpdate").pipe((0,k.w)((function(){return Dn(t,e,n)})),(0,Ve.b)((function(e){null!==e&&(n=e)})))})),(0,Q.l)())}))}(n,e),T=null!==(g=n.getPeriodForTime(v))&&void 0!==g?g:n.getNextPeriod(v);if(void 0===T){var S=new N.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,Pt._)((function(){return S}))}var w=new Gt(t,e),I=(0,Gn.Z)({mediaElement:t,playbackObserver:d,startTime:v,mustAutoPlay:h}),Z=I.seekAndPlay$,x=I.initialPlayPerformed,M=I.initialSeekPerformed,C=d.observe(!0),P=x.asObservable().pipe((0,m.h)((function(e){return e})),(0,c.z)((function(){return $n(n,t,C)}))),O=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,u=n.startTime;return t.deriveReadOnlyObserver((function(t){return(0,y.a)([t,o.asObservable()]).pipe((0,s.U)((function(t){var n=t[0],o=t[1];return{liveGap:e.isLive?e.getMaximumPosition()-n.position:void 0,position:n.position,duration:n.duration,isPaused:i.getValue()?n.paused:!r,readyState:n.readyState,speed:o,wantedTimeOffset:a.getValue()?0:u-n.position}})))}))}(n,d,{autoPlay:h,initialPlayPerformed:x,initialSeekPerformed:M,speed:r,startTime:v}),D=new i.x,L=new i.x,U=new i.x,B=On({manifest:n,initialPeriod:T},O,u,w,f,a).pipe((0,c.z)((function(t){switch(t.type){case"end-of-stream":return R.Z.debug("Init: end-of-stream order received."),function(e){return zn(e).pipe((0,_.O)(null),(0,k.w)((function(){return Vn(e)})))}(e).pipe((0,Q.l)(),(0,o.R)(D));case"resume-stream":return R.Z.debug("Init: resume-stream order received."),D.next(null),A.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return L.next({period:r,bufferType:i,discontinuity:a,position:s}),A.E;case"locked-stream":return U.next(t.value),A.E;default:return(0,l.of)(t)}}))),z=(0,Xn.Z)(t,r,C).pipe((0,Q.l)()),K=(0,Hn.Z)(d,n,U,L),V=Z.pipe((0,k.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,Ln.Z)(C,t,w,!1)})));return(0,E.T)(b,V,z,K,B,P).pipe(Ge((function(){w.disposeAll()})))}}var Jn=n(6625);var er=P.Z.FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,tr=P.Z.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,nr=P.Z.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE;function rr(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,u=(t=function(e,t){return i.fetch(e).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new f.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),d=r.manifest,v=0;return(0,p.P)((function(){return h(r)}));function h(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,u=v>0?v<tr:void 0!==i&&i>=nr,f=void 0===t?0:performance.now()-t,p=Math.max(a-f,0),g=o.pipe((0,c.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&u;return ir(null!=r?r:0,a,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),y=null===d.expired?A.E:(0,Jn.H)(p).pipe((0,c.z)((function(){return null===d.expired?A.E:(0,jt.D)(d.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:u}}))),_=function(){if(void 0===d.lifetime||d.lifetime<0)return A.E;var e,t=1e3*d.lifetime-f;void 0===i?e=t:d.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-f,Math.max(t,0)+i),6*t),R.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*d.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),R.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,Jn.H)(Math.max(e,p)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:u}})))}();return(0,E.T)(_,g,y).pipe((0,T.q)(1),(0,c.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):h(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=d.updateUrl,i=t||void 0===r,o=i?d.getUrl():r,s=d.clockOffset;return n?(v+=1,R.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(v)+" consecutive time.")):v>0&&(R.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(v)+" consecutive times."),v=0),u(o,{externalClockOffset:s,previousManifest:d,unsafeMode:n}).pipe((0,c.z)((function(e){if("warning"===e.type)return(0,l.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)d.replace(t);else try{d.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return R.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),ir(er,a,n).pipe((0,c.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,l.of)({type:"parsed",manifest:d,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function ir(e,t,n){return(0,p.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,Jn.H)(Math.max(e-r,i))}))}var ar=n(2447),or=P.Z.OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;var sr=function(e){var t,n,r,a=e.adaptiveOptions,u=e.autoPlay,f=e.bufferOptions,p=e.keySystems,v=e.lowLatencyMode,h=e.manifest$,b=e.manifestFetcher,w=e.mediaElement,I=e.minimumManifestUpdateInterval,Z=e.playbackObserver,x=e.segmentFetcherCreator,M=e.speed,C=e.startAt,P=e.textTrackOptions,N=new St(a),O=Mt(w).pipe((0,d.d)({refCount:!0})),D=new i.x,L=(0,wt.Z)(w,p,D).pipe((0,He.Z)(),(0,g.B)()),U=(0,ar.Z)(w),B=L.pipe((t=function(e,t){switch(t.type){case"eme-disabled":case"attached-media-keys":return(0,l.of)({isEmeReady:!0,drmSystemId:e.drmSystemId});case"created-media-keys":var n=t.value.initializationDataSystemId;return O.pipe((0,c.z)((function(){return t.value.canAttachMediaKeys.setValue(!0),!0===t.value.options.disableMediaKeysAttachmentLock?(0,l.of)({isEmeReady:!0,drmSystemId:n}):A.E})),(0,_.O)({isEmeReady:!1,drmSystemId:n}));default:return A.E}},n={isEmeReady:!1,drmSystemId:void 0},void 0===r&&(r=1/0),(0,S.e)((function(e,i){var a=n;return(0,Fe.p)(e,i,(function(e,n){return t(a,e,n)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))),(0,m.h)((function(e){return e.isEmeReady})),(0,T.q)(1),Ke((function(e){var t=e.drmSystemId;return O.pipe((0,s.U)((function(e){return{mediaSource:e,drmSystemId:t}})))}))),z=(0,y.a)([h,B]).pipe((0,c.z)((function(e){var t=e[0],n=e[1];if("warning"===t.type)return(0,l.of)(t);var r=t.manifest,a=n.mediaSource,d=n.drmSystemId;R.Z.debug("Init: Calculating initial time");var p=function(e,t,n){if(null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return R.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){R.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){R.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){R.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){R.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var c=e.getMinimumPosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition();if(null==p)R.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=v;else{R.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var h=null==e.availabilityStartTime?0:e.availabilityStartTime,m=(performance.now()+p)/1e3-h;d=Math.min(v,m)}var g=void 0!==f?f:t?Ct.LOW_LATENCY:Ct.DEFAULT;return R.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+g),Math.max(d-g,c)}return R.Z.info("Init: starting at the minimum available position:",c),c}(r,v,C);R.Z.debug("Init: Initial time calculated:",p);var h=Qn({abrManager:N,bufferOptions:(0,K.Z)({textTrackOptions:P,drmSystemId:d},f),manifest:r,mediaElement:w,playbackObserver:Z,segmentFetcherCreator:x,speed:M}),m=function e(t,n,r){var a=new i.x,s=h(t,n,r).pipe((0,We.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return g.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":return g.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:or}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var t=X(w);if(null===(r=t)||r.indexOf("widevine")<0)return a.next(e.value),null;var n=e.value.position;return n+.001<e.value.duration?Z.setCurrentTime(w.currentTime+.001):Z.setCurrentTime(n),null;case"encryption-data-encountered":return D.next(e.value),null;case"needs-buffer-flush":return Z.setCurrentTime(w.currentTime+.001),null}var r;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,k.w)((function(t){return Mt(w).pipe((0,c.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,_.O)(Rt.Z.reloadingMediaSource()))})));return(0,E.T)(u,s)}(a,p,u),g=new i.x,y=rr({initialManifest:t,manifestFetcher:b,minimumManifestUpdateInterval:I,scheduleRefresh$:g}),T=(0,E.T)((0,F.R)(r,"manifestUpdate").pipe((0,s.U)((function(){return Rt.Z.manifestUpdate()}))),(0,F.R)(r,"decipherabilityUpdate").pipe((0,s.U)(Rt.Z.decipherabilityUpdate))),S=L.pipe((0,Ve.b)((function(e){"keys-update"===e.type?r.updateDeciperabilitiesBasedOnKeyIds(e.value):"blacklist-protection-data"===e.type&&(R.Z.info("Init: blacklisting Representations based on protection data."),r.addUndecipherableProtectionData(e.value))})),(0,Q.l)());return(0,E.T)(T,y,S,m).pipe((0,_.O)(Rt.Z.manifestReady(r)),Ge((function(){g.complete()})))})));return(0,E.T)(z,U,L)};var ur=P.Z.FORCED_ENDED_THRESHOLD,lr="STOPPED",cr="LOADED",dr="LOADING",fr="PLAYING",pr="PAUSED",vr="ENDED",hr="BUFFERING",mr="SEEKING",gr="RELOADING";var yr=n(5553);function _r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tr=P.Z.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,Er=P.Z.DEFAULT_AUTO_PLAY,Sr=P.Z.DEFAULT_CODEC_SWITCHING_BEHAVIOR,wr=P.Z.DEFAULT_ENABLE_FAST_SWITCHING,kr=P.Z.DEFAULT_INITIAL_BITRATES,Ar=P.Z.DEFAULT_LIMIT_VIDEO_WIDTH,Ir=P.Z.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,Zr=P.Z.DEFAULT_MIN_BITRATES,xr=P.Z.DEFAULT_MAX_BITRATES,Mr=P.Z.DEFAULT_MAX_BUFFER_AHEAD,Rr=P.Z.DEFAULT_MAX_BUFFER_BEHIND,Cr=P.Z.DEFAULT_SHOW_NATIVE_SUBTITLE,Pr=P.Z.DEFAULT_STOP_AT_END,Nr=P.Z.DEFAULT_TEXT_TRACK_MODE,Or=P.Z.DEFAULT_THROTTLE_WHEN_HIDDEN,Dr=P.Z.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,Lr=P.Z.DEFAULT_WANTED_BUFFER_AHEAD;var Ur=P.Z.SAMPLING_INTERVAL_MEDIASOURCE,Br=P.Z.SAMPLING_INTERVAL_LOW_LATENCY,Fr=P.Z.SAMPLING_INTERVAL_NO_MEDIASOURCE,zr=P.Z.RESUME_GAP_AFTER_SEEKING,Kr=P.Z.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,Vr=P.Z.RESUME_GAP_AFTER_BUFFERING,Gr=P.Z.REBUFFERING_GAP,Hr=P.Z.MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING,Wr=["canplay","play","seeking","seeked","loadedmetadata","ratechange"],jr=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._lastObservation=null,this._observation$=null}var t=e.prototype;return t.getCurrentTime=function(){return this._mediaElement.currentTime},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.observe=function(e){var t=this;return(0,p.P)((function(){return null===t._observation$||null===t._lastObservation?(t._lastObservation=t._generateInitialObservation(),t._observation$=t._createInnerObservable().pipe((0,g.B)()),t.observe(e)):e?t._observation$.pipe((0,_.O)(t._lastObservation)):t._observation$}))},t.deriveReadOnlyObserver=function(e){return $r(this,e)},t._createInnerObservable=function(){var e=this;return(0,p.P)((function(){var t=function(t){var n,r=t;"seeking"===r&&e._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",e._internalSeekingEventsIncomingCounter-=1);var i=null!==(n=e._lastObservation)&&void 0!==n?n:e._generateInitialObservation(),a=Yr(e._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=t.event,u=t.position,l=t.bufferGap,c=t.currentRange,d=t.duration,f=t.paused,p=t.readyState,v=t.ended,h=e.rebuffering,m=e.event,g=e.position,y=function(e,t,n){var r=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=Gr[r]}(c,d,o),_=p>=1&&"loadedmetadata"!==s&&null===h&&!(y||v),b=null,T=o?Gr.LOW_LATENCY:Gr.DEFAULT;if(a){if(_)l<=T?(r=!0,b=u+l):l===1/0&&(r=!0,b=u);else if(null!==h){var E=qr(h,o);!0!==r&&null!==h&&p>1&&(y||v||l<1/0&&l>E)?i=!0:(l===1/0||l<=E)&&(b=l===1/0?u:u+l)}}else _&&(!f&&"timeupdate"===s&&"timeupdate"===m&&u===g||"seeking"===s&&l===1/0)?r=!0:null!==h&&("seeking"!==s&&u!==g||"canplay"===s||l<1/0&&(l>qr(h,o)||y||v))&&(i=!0);if(!0===i)return null;var S;if(!0===r||null!==h)return S="seeking"===s||null!==h&&"seeking"===h.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==h&&h.reason===S?{reason:h.reason,timestamp:h.timestamp,position:b}:{reason:S,timestamp:performance.now(),position:b};return null}(i,a,{lowLatencyMode:e._lowLatencyMode,withMediaSource:e._withMediaSource}),u=function(e,t){if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>Hr&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,K.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return R.Z.debug("API: current media element state",l),l},n=Wr.map((function(t){return(0,Ot.R)(e._mediaElement,t).pipe((0,s.U)((function(){return t})))})),r=e._lowLatencyMode?Br:e._withMediaSource?Ur:Fr,i=(0,Nt.F)(r).pipe((0,s.U)((function(){return"timeupdate"})));return E.T.apply(void 0,[i].concat(n)).pipe((0,s.U)((function(n){var r=t(n);return"DEBUG"===R.Z.getLevel()&&R.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(r.buffered,r.position),"\n"+n),e._lastObservation=r,r})))}))},t._generateInitialObservation=function(){return(0,K.Z)(Yr(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function qr(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT";switch(e.reason){case"seeking":return zr[n];case"not-ready":return Kr[n];case"buffering":return Vr[n]}}function Yr(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,G.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function $r(e,t){var n=(0,p.P)((function(){return t(e.observe(!0))})).pipe((0,d.d)({bufferSize:1,refCount:!0}));return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},observe:function(e){return e?n:n.pipe((t=1,(0,m.h)((function(e,n){return t<=n}))));var t},deriveReadOnlyObserver:function(e){return $r(this,e)}}}var Xr=n(7829);function Qr(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Xr.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Jr(e){return e.map((function(e){return null===e?e:{normalized:(0,Xr.ZP)(e.language),closedCaption:e.closedCaption}}))}var ei=function(){function e(e){this._periods=new Ht((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=si(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void R.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):R.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else R.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,xe.Z)(r,i))n.adaptation$.next(i);else{var a=ni(r,Qr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,xe.Z)(r,i))n.adaptation$.next(i);else{var a=ii(r,Jr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,xe.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=oi(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=ci(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.audio:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.text:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ci(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=si(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,z.Z)(r))return null;var i={language:(0,je.Z)(r.language,""),normalized:(0,je.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(li)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,z.Z)(r)?null:{language:(0,je.Z)(r.language,""),normalized:(0,je.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,z.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(ui),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(ui)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,je.Z)(e.language,""),normalized:(0,je.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(li)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,je.Z)(e.language,""),normalized:(0,je.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(ui),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(ui)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=Qr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,xe.Z)(s,u))n(r+1);else{var l=ni(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Jr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,xe.Z)(s,u))n(r+1);else{var l=ii(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,xe.Z)(s,u.baseAdaptation)){var l=ci(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=oi(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=ci(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function ti(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function ni(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=ti(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return e[0]}function ri(e){return function(t){return(0,je.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function ii(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=ri(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return null}function ai(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function oi(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=ai(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return e[0]}function si(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ui(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function li(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function ci(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var di=P.Z.DEFAULT_UNMUTED_VOLUME,fi=I.Nh,pi=I._K,vi=I.C1,hi=I.Q1,mi=I.Qt,gi=I.yj,yi=I.d5,_i=I.UA,bi=I.$x,Ti=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p,v,h;if((0,z.Z)(e.maxBufferAhead))t=Mr;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxBufferBehind))n=Rr;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,z.Z)(e.wantedBufferAhead))r=Lr;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");var m=(0,z.Z)(e.limitVideoWidth)?Ar:!!e.limitVideoWidth;if((0,z.Z)(e.throttleWhenHidden)?i=Or:((0,W.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),i=!!e.throttleWhenHidden),a=!i&&((0,z.Z)(e.throttleVideoBitrateWhenHidden)?Dr:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?s=e.preferredTextTracks:((0,W.Z)("Invalid `preferredTextTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?o=e.preferredAudioTracks:((0,W.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),o=[]):o=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?u=e.preferredVideoTracks:((0,W.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),u=[]):u=[],(0,z.Z)(e.videoElement))l=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");l=e.videoElement}if((0,z.Z)(e.initialVideoBitrate))c=kr.video;else if(c=Number(e.initialVideoBitrate),isNaN(c))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.initialAudioBitrate))d=kr.audio;else if(d=Number(e.initialAudioBitrate),isNaN(d))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.minVideoBitrate))p=Zr.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.minAudioBitrate))f=Zr.audio;else if(f=Number(e.minAudioBitrate),isNaN(f))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.maxVideoBitrate))h=xr.video;else{if(h=Number(e.maxVideoBitrate),isNaN(h))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+h+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,z.Z)(e.maxAudioBitrate))v=xr.audio;else{if(v=Number(e.maxAudioBitrate),isNaN(v))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(f>v)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+v+'", is inferior to the set minAudioBitrate, "'+f+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:m,videoElement:l,wantedBufferAhead:r,throttleWhenHidden:i,throttleVideoBitrateWhenHidden:a,preferredAudioTracks:o,preferredTextTracks:s,preferredVideoTracks:u,initialAudioBitrate:d,initialVideoBitrate:c,minAudioBitrate:f,minVideoBitrate:p,maxAudioBitrate:v,maxVideoBitrate:h,stopAtEnd:(0,z.Z)(e.stopAtEnd)?Pr:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,p=r.minVideoBitrate,v=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.stopAtEnd;return S.preload="auto",t.version="3.26.2",t.log=R.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),gi(S).pipe((0,o.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),hi(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),_i(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_isPlaying=(0,H.Z)(!1),t._priv_speed=(0,H.Z)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,H.Z)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,H.Z)(w),maxBufferAhead:(0,H.Z)(h),maxBufferBehind:(0,H.Z)(m)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,H.Z)(f),video:(0,H.Z)(p)},maxAutoBitrates:{audio:(0,H.Z)(v),video:(0,H.Z)(g)},manualBitrates:{audio:(0,H.Z)(-1),video:(0,H.Z)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=di,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=k,t._priv_setPlayerState(lr),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var f=r.prototype;return f.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==lr&&this._priv_setPlayerState(lr)},f.dispose=function(){this.stop(),null!==this.videoElement&&$(this.videoElement).subscribe(j.Z),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_isPlaying.finish(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},f.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f;if((0,z.Z)(e))throw new Error("No option set on loadVideo");if((0,z.Z)(e.url)){if((0,z.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,z.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,z.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var p=(0,z.Z)(e.autoPlay)?Er:!!e.autoPlay;if((0,z.Z)(e.keySystems))l=[];else for(var v,h=_r(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(v=h()).done;){var m=v.value;if("string"!=typeof m.type||"function"!=typeof m.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var g=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,y="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},_=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,b=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,T=(0,z.Z)(e.audioTrackSwitchingMode)?Tr:e.audioTrackSwitchingMode;(0,xe.Z)(["seamless","direct"],T)||(R.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\nIf badly set, "+Tr+" strategy will be used as default"),T=Tr);var E=(0,z.Z)(e.onCodecSwitch)?Sr:e.onCodecSwitch;(0,xe.Z)(["continue","reload"],E)||(R.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+Sr+" will be used as default"),E=Sr);var S=(0,K.Z)({},y,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:g});if(delete S.initialManifest,delete S.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,W.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var w,k=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],A=_r(k);!(w=A()).done;){var I=w.value;if("string"!=typeof I.language||"string"!=typeof I.mimeType||"string"!=typeof I.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}S.supplementaryTextTracks=k}if(void 0!==e.supplementaryImageTracks){(0,W.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var Z,x=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],M=_r(x);!(Z=M()).done;){var C=Z.value;if("string"!=typeof C.mimeType||"string"!=typeof C.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}S.supplementaryImageTracks=x}if((0,z.Z)(e.textTrackMode))c=Nr;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,z.Z)(e.defaultAudioTrack)||(0,W.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var P=(0,yr.iH)(e.defaultAudioTrack);(0,z.Z)(e.defaultTextTrack)||(0,W.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var N=(0,yr.Y1)(e.defaultTextTrack),O=!Cr;(0,z.Z)(e.hideNativeSubtitle)||((0,W.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),O=!!e.hideNativeSubtitle);var D=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:Ir,L=(0,z.Z)(e.enableFastSwitching)?wr:e.enableFastSwitching;if("html"===c){if((0,z.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,z.Z)(e.textTrackElement)||R.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,z.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var U=e.startAt.wallClockTime.getTime()/1e3;f=(0,K.Z)({},e.startAt,{wallClockTime:U})}else f=e.startAt;return{autoPlay:p,defaultAudioTrack:P,defaultTextTrack:N,enableFastSwitching:L,hideNativeSubtitle:O,keySystems:l,initialManifest:_,lowLatencyMode:g,manualBitrateSwitchingMode:D,audioTrackSwitchingMode:T,minimumManifestUpdateInterval:b,networkConfig:(0,z.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:E,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:S,url:s}}(e);R.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},f.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},f._priv_initializeContentPlayback=function(e){var t,n,r,a=this,f=e.autoPlay,v=e.audioTrackSwitchingMode,I=e.defaultAudioTrack,Z=e.defaultTextTrack,x=e.enableFastSwitching,M=e.initialManifest,P=e.keySystems,N=e.lowLatencyMode,O=e.manualBitrateSwitchingMode,D=e.minimumManifestUpdateInterval,B=e.networkConfig,F=e.onCodecSwitch,z=e.startAt,V=e.transport,G=e.transportOptions,H=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var W,j="directfile"===V,q=new i.x,Y={url:H,stop$:q,isDirectFile:j,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:I,initialTextTrack:Z},$=this.videoElement,X=new jr($,{withMediaSource:!j,lowLatencyMode:N});if(j){if(this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),null===L.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=Y,this._priv_mediaElementTrackChoiceManager=new L.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var Q=void 0===I?this._priv_preferredAudioTracks:[I];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(Q,!0);var J=void 0===Z?this._priv_preferredTextTracks:[Z];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(J,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var ee=L.Z.directfile.initDirectFile({autoPlay:f,keySystems:P,mediaElement:$,speed:this._priv_speed,playbackObserver:X,startAt:z,url:H}).pipe((0,o.R)(q));W=h(ee,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var te=L.Z.transports[V];if("function"!=typeof te)throw this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),new Error('transport "'+V+'" not supported');var ne,re=te(G),ie=B.offlineRetry,ae=B.segmentRetry,oe=B.manifestRetry,se=new ke(H,re,{lowLatencyMode:N,maxRetryRegular:oe,maxRetryOffline:ie}),ue=new Be(re,{lowLatencyMode:N,maxRetryOffline:ie,maxRetryRegular:ae});(ne=(ne=M instanceof U.ZP?(0,l.of)({type:"parsed",manifest:M}):void 0!==M?se.parse(M,{previousManifest:null,unsafeMode:!1}):se.fetch(H).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(q),(0,d.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),this._priv_contentInfos=Y;var le=C(),ce={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(le?ce.throttle={video:fi().pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(q))}:R.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(le?ce.throttleBitrate={video:pi(this._priv_pictureInPictureEvent$).pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(q))}:R.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(le?ce.limitWidth={video:bi($,this._priv_pictureInPictureEvent$).pipe((0,o.R)(q))}:R.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var de={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:ce},fe="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},pe=(0,K.Z)({audioTrackSwitchingMode:v,enableFastSwitching:x,manualBitrateSwitchingMode:O,onCodecSwitch:F},this._priv_bufferOptions),ve=sr({adaptiveOptions:de,autoPlay:f,bufferOptions:pe,playbackObserver:X,keySystems:P,lowLatencyMode:N,manifest$:ne,manifestFetcher:se,mediaElement:$,minimumManifestUpdateInterval:D,segmentFetcherCreator:ue,speed:this._priv_speed,startAt:z,textTrackOptions:fe}).pipe((0,o.R)(q));W=h(ve,{connector:function(){return new i.x},resetOnDisconnect:!1})}var he,me,ge=W.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),ye=W.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),_e=W.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),be=vi($),Te=yi($),Ee=(0,y.a)([this._priv_isPlaying.asObservable(),ge.pipe((0,_.O)(null)),be.pipe((0,_.O)(null)),Te.pipe((0,_.O)(null))]).pipe((0,o.R)(q),(0,s.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){if(e.ended)return vr;if(null!==n){var r=Math.abs(e.duration-e.currentTime);return null!=ur&&r<ur?vr:"seeking"===n?mr:hr}return t?fr:pr}($,t,n)}))),Se=(0,b.z)((0,l.of)(dr),ye.pipe((0,T.q)(1),(0,s.U)((function(){return cr}))),(0,E.T)(Ee.pipe((0,o.R)(_e),(he=function(e){return e===pr},(0,S.e)((function(e,t){var n=!1,r=0;e.subscribe(new w.Q(t,(function(e){return(n||(n=!he(e,r++)))&&t.next(e)})))})))),_e.pipe((0,k.w)((function(){return ye.pipe((0,T.q)(1),(0,c.z)((function(){return Ee})),(0,_.O)(gr))}))))).pipe((0,u.x)());q.pipe((0,T.q)(1)).subscribe((function(){void 0!==me&&me.unsubscribe()})),mi($).pipe((0,o.R)(q)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)}));var we=X.observe(!0);we.pipe((0,o.R)(q)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),ye.pipe((0,k.w)((function(){return function(e,t){return(0,p.P)((function(){if(null===e)return A.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,_.O)("seeking")));var r=n.pipe((0,k.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,T.q)(1))})));return(0,E.T)(n,r)}))}(a.videoElement,we)})),(0,o.R)(q)).subscribe((function(e){R.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),Se.pipe((0,o.R)(q)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?vi($):A.E).pipe((0,o.R)(q)).subscribe((function(){q.next(),q.complete()})),W.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,T.q)(1),(0,o.R)(q)).subscribe((function(){me=W.connect()}))},f.getError=function(){return this._priv_currentError},f.getManifest=function(){return(0,W.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},f.getCurrentAdaptations=function(){if((0,W.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,z.Z)(n[t.id])?null:n[t.id]},f.getCurrentRepresentations=function(){return(0,W.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},f.getVideoElement=function(){return this.videoElement},f.getNativeTextTrack=function(){if((0,W.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},f.getPlayerState=function(){return this.state},f.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},f.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},f.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},f.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},f.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.L7)(e.buffered,e.currentTime)},f.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.at)(e.buffered,e.currentTime)},f.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.DD)(e.buffered,e.currentTime)},f.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?this.videoElement.currentTime:null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},f.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},f.getPlaybackRate=function(){return this._priv_speed.getValue()},f.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},f.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,z.Z)(r.video)?[]:r.video.getAvailableBitrates()},f.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,z.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},f.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},f.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},f.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.video))return e.video.bitrate},f.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.audio))return e.audio.bitrate},f.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},f.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},f.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},f.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},f.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,z.Z)(t)||"function"!=typeof t.catch?V.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new N.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},f.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},f.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,z.Z)(a.relative))if((0,z.Z)(a.position)){if((0,z.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},f.isFullscreen=function(){return(0,W.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),x()},f.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,W.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!x()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):Z()},f.exitFullscreen=function(){(0,W.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),Z()},f.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},f.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},f.isMute=function(){return 0===this.getVolume()},f.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},f.unMute=function(){0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?di:this._priv_mutedMemory)},f.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},f.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},f.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},f.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},f.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},f.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},f.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},f.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},f.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},f.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},f.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},f.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},f.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return X(this.videoElement)},f.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},f.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},f.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},f.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},f.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},f.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},f.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},f.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},f.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},f.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},f.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},f.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},f.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},f.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},f.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},f.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},f.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},f.getImageTrackData=function(){return(0,W.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},f.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumPosition():null},f.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.getMaximumPosition():null},f.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},f._priv_cleanUpCurrentContentState=function(){var e,t=this;R.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){R.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1)};(0,z.Z)(this.videoElement)?n():J(this.videoElement).subscribe({error:function(e){R.Z.error("API: An error arised when trying to clean-up the EME session:"+(e instanceof Error?e.toString():"Unknown Error")),n()},complete:function(){R.Z.debug("API: EME session cleaned-up with success!"),n()}})},f._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void R.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void R.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,z.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},f._priv_onPlaybackError=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,R.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(lr),this._priv_currentError===t&&this.trigger("error",t)},f._priv_onPlaybackFinished=function(){R.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(vr)},f._priv_onPlaybackWarning=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});R.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},f._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new ei({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(u,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,F.R)(n,"manifestUpdate").pipe((0,o.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else R.Z.error("API: The manifest is loaded but no content is.")},f._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else R.Z.error("API: The active period changed but no content is loaded")},f._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,z.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},f._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,z.Z)(i)&&!(0,z.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,z.Z)(a)&&!(0,z.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},f._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},f._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,z.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,z.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else R.Z.error("API: The adaptations changed but no content is loaded")},f._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,z.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,z.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else R.Z.error("API: The representations changed but no content is loaded")},f._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},f._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_isPlaying.setValue(e)},f._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},f._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,R.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},f._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==gr){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,z.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else R.Z.warn("API: Cannot perform time update: no content loaded.")},f._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,B.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,z.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return D.ZB}},{key:"ErrorCodes",get:function(){return D.SM}},{key:"LogLevel",get:function(){return R.Z.getLevel()},set:function(e){R.Z.setLevel(e)}}]),r}(F.Z);Ti.version="3.26.2";var Ei=Ti,Si=n(7273);!function(){Si.Z.emeManager=n(8281).ZP,Si.Z.imageBuffer=n(7127).Z,Si.Z.imageParser=n(3203).Z,Si.Z.transports.smooth=n(2339).Z,Si.Z.transports.dash=n(5877).Z,Si.Z.dashParsers.js=n(3501).Z,Si.Z.nativeTextTracksBuffer=n(9059).Z,Si.Z.nativeTextTracksParsers.vtt=n(9405).Z,Si.Z.nativeTextTracksParsers.ttml=n(1570).Z,Si.Z.nativeTextTracksParsers.sami=n(1812).Z,Si.Z.nativeTextTracksParsers.srt=n(8057).Z,Si.Z.htmlTextTracksBuffer=n(5192).Z,Si.Z.htmlTextTracksParsers.sami=n(5734).Z,Si.Z.htmlTextTracksParsers.ttml=n(7439).Z,Si.Z.htmlTextTracksParsers.srt=n(8675).Z,Si.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Si.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var wi=Ei}(),r=r.default}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={7757:function(e,t,n){e.exports=n(5666)},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return p},YM:function(){return s},fq:function(){return o},kD:function(){return u},op:function(){return c},vS:function(){return f},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),p=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return O},Y:function(){return L}});var r,i=n(8555),a=n.n(i),o=n(3714),s=n(811),u=n(3666),l=n(2203),c=n(5059),d=n(3144),f=n(9589),p=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new f.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,d.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),v=n(4578),h=n(6716),m=n(3071),g=n(3505),y=n(1959),_=n(4804);if(!l.Z){var b=window.MSMediaKeys;void 0!==b&&void 0!==b.prototype&&"function"==typeof b.isTypeSupported&&"function"==typeof b.prototype.createSession&&(r=b)}var T,E=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new h.x,n.closed=new f.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new f.Z((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,v.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new f.Z((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,m.T)(_.GJ(n._ss),_.GV(n._ss),_.Xe(n._ss)).pipe((0,g.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new f.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return f.Z.resolve(!1)},n.remove=function(){return f.Z.resolve()},(0,d.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(y.Z),S=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new E(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!l.Z){var w=window.MozMediaKeys;void 0!==w&&void 0!==w.prototype&&"function"==typeof w.isTypeSupported&&"function"==typeof w.prototype.createSession&&(T=w)}var k=n(9689),A=n(8894),I=n(3635);function x(e){return"function"==typeof e.webkitGenerateKeyRequest}var Z=function(e){function t(t,n){var r;return(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=A.Z,r.closed=new f.Z((function(e){r._closeSession=e})),r.keyStatuses=new Map,r.expiration=NaN,r._onSessionRelatedEvent=function(e){r.trigger(e.type,e)},["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){return t.addEventListener(e,r._onSessionRelatedEvent)})),r}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new f.Z((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,I.uR)(i)),o=(0,k.K)(a.keys[0].k),s=(0,k.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new f.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new f.Z((function(t){e._unbindSession(),e._closeSession(),t()}))},n.load=function(){return f.Z.resolve(!1)},n.remove=function(){return f.Z.resolve()},n._unbindSession=function(){var e=this;["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){return e._vid.removeEventListener(t,e._onSessionRelatedEvent)}))},t}(y.Z),R=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!x(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new Z(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var M=n(6968);var C=n(158);function D(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var P=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=A.Z,i._closeSession=A.Z,i.closed=new f.Z((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i._onEvent=function(e){i.trigger(e.type,e)},i}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new f.Z((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{n(t._nativeSession.update(e))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new f.Z((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,M.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,I.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,I.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,M.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,M.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new f.Z((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return f.Z.resolve(!1)},n.remove=function(){return f.Z.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession(),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(n){return e.addEventListener(n,t._onEvent)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(n){return e.removeEventListener(n,t._onEvent)}))}},(0,d.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(y.Z),N=function(){function e(e){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new C.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return D(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new P(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,f.Z.resolve()},e}();var O=null,L=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(l.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,c.Z)())O=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var B,U;if(x(HTMLVideoElement.prototype)){var F={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new R(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof R))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};B=F.isTypeSupported,U=F.createCustomMediaKeys,L=F.setMediaKeys}else if(void 0!==C.t){var z=function(){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:C.t.isTypeSupported,createCustomMediaKeys:function(e){return new N(e)},setMediaKeys:function(e,t){if(null===t)return D(e,t);if(!(t instanceof N))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();B=z.isTypeSupported,U=z.createCustomMediaKeys,L=z.setMediaKeys}else if(u.fq&&void 0!==r){var V={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new S(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof S))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};B=V.isTypeSupported,U=V.createCustomMediaKeys,L=V.setMediaKeys}else if(void 0!==T){var K={isTypeSupported:function(e,t){if(void 0===T)throw new Error("No MozMediaKeys API.");return void 0!==t?T.isTypeSupported(e,t):T.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===T)throw new Error("No MozMediaKeys API.");return new T(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};B=K.isTypeSupported,U=K.createCustomMediaKeys,L=K.setMediaKeys}else{var G=window.MediaKeys,H=function(){if(void 0===G)throw new o.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===G.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};B=function(e){return H(),(0,s.Z)("function"==typeof G.isTypeSupported),G.isTypeSupported(e)},U=function(e){return H(),new G(e)}}O=function(e,t){if(!B(e))return a().reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,o=r.audioCapabilities,s=r.initDataTypes,u=r.distinctiveIdentifier,l=!0;if(l=(l=l&&(null==s||s.some((function(e){return"cenc"===e}))))&&"required"!==u){var c={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(c.videoCapabilities=i),void 0!==o&&(c.audioCapabilities=o);var d=U(e);return a().resolve(new p(e,d,c))}}return a().reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},4804:function(e,t,n){"use strict";n.d(t,{Nh:function(){return B},_K:function(){return z},Oh:function(){return te},C1:function(){return W},Q1:function(){return j},GV:function(){return re},Xe:function(){return ie},GJ:function(){return ne},eX:function(){return ae},K4:function(){return K},yj:function(){return F},Qt:function(){return q},gg:function(){return ee},ik:function(){return H},d5:function(){return G},UG:function(){return X},ep:function(){return Q},ym:function(){return $},UA:function(){return Y},_E:function(){return J},$x:function(){return V}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(7991),s=n(6362),u=n(4727),l=n(533),c=n(9127);var d=n(7877);function f(e,t){return t?function(n){return(0,s.z)(t.pipe((0,u.q)(1),(0,l.l)()),n.pipe(f(e)))}:(0,d.z)((function(t,n){return e(t,n).pipe((0,u.q)(1),function(e){return(0,c.U)((function(){return e}))}(t))}))}var p=n(6625);function v(e,t){void 0===t&&(t=o.z);var n=(0,p.H)(e,t);return f((function(){return n}))}var h=n(6798),m=n(2566),g=n(7878),y={leading:!0,trailing:!1};function _(e,t,n){void 0===t&&(t=o.z),void 0===n&&(n=y);var r,i,a,s,u,l=(0,p.H)(e,t);return r=function(){return l},s=(a=void 0===(i=n)?y:i).leading,u=a.trailing,(0,h.e)((function(e,t){var n=!1,i=null,a=null,o=!1,l=function(){null==a||a.unsubscribe(),a=null,u&&(f(),o&&t.complete())},c=function(){a=null,o&&t.complete()},d=function(e){return a=(0,g.Xf)(r(e)).subscribe(new m.Q(t,l,c))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!o&&d(e)}};e.subscribe(new m.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(s?f():d(e))}),(function(){o=!0,(!(u&&n&&a)||a.closed)&&t.complete()})))}))}var b=n(2401),T=n(3071),E=n(9917),S=n(6108),w=n(3741),k=n(4978),A=n(2817),I=n(2334),x=n(6697),Z=n(6872),R=n(6923),M=n(2203),C=n(5059),D=["","webkit","moz","ms"],P=M.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function N(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function O(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?D:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=N(e,r)),(0,R.Z)(n)?(0,b.R)(e,n):a):T.T.apply(void 0,r.map((function(t){return(0,b.R)(e,t)})))}}function L(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,E.P)((function(){var e=document[n];return(0,b.R)(document,r).pipe((0,c.U)((function(){return!document[n]})),(0,S.O)(!e),(0,w.x)())}))}function B(){var e=Z.Z.getCurrent().INACTIVITY_DELAY;return L().pipe((0,k.w)((function(t){return t?(0,A.of)(t):(0,A.of)(t).pipe(v(e))})))}function U(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function F(e){return(0,E.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,b.R)(t,"webkitpresentationmodechanged").pipe((0,c.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,S.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,T.T)((0,b.R)(t,"enterpictureinpicture").pipe((0,c.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,b.R)(t,"leavepictureinpicture").pipe((0,c.U)((function(){return{isEnabled:!1,pipWindow:null}})))).pipe((0,S.O)(r))}))}function z(e){var t=Z.Z.getCurrent().INACTIVITY_DELAY;return(0,I.a)([L(),e]).pipe((0,k.w)((function(e){var n=e[0];return e[1].isEnabled||n?(0,A.of)(!0):(0,A.of)(!1).pipe(v(t))})),(0,w.x)())}function V(e,t){return(0,I.a)([t,(0,x.F)(2e4).pipe((0,S.O)(null)),(0,b.R)(window,"resize").pipe(_(500),(0,S.O)(null))]).pipe((0,k.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=U(e,r);return(0,b.R)(r,"resize").pipe((0,S.O)(i*P),(0,c.U)((function(){return U(e,r)*P})))}return(0,A.of)(1/0)}return(0,A.of)(e.clientWidth*P)})),(0,w.x)())}var K=O(["loadedmetadata"]),G=O(["seeking"]),H=O(["seeked"]),W=O(["ended"]),j=(O(["timeupdate"]),O(["fullscreenchange","FullscreenChange"],D.concat("MS"))),q=function(e){return(0,T.T)(O(["play"])(e),O(["pause"])(e))},Y=function(e){return(0,T.T)(O(["addtrack"])(e),O(["removetrack"])(e))},$=O(["sourceopen","webkitsourceopen"]),X=O(["sourceclose","webkitsourceclose"]),Q=O(["sourceended","webkitsourceended"]),J=O(["update"]),ee=O(["onremovesourcebuffer"]),te=O((0,C.Z)()?["needkey"]:["encrypted","needkey"]),ne=O(["keymessage","message"]),re=O(["keyadded","ready"]),ie=O(["keyerror","error"]),ae=O(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return(r.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,DEFAULT_MAX_VIDEO_BUFFER_SIZE:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after:5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_LENGTH:5,MIN_BUFFER_DISTANCE_BEFORE_CLEAN_UP:10,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l;if(void 0===e[u])(0,i.Z)(e,((l={})[u]={},l));var c=e[u];o(c,s[u])}else{var d;(0,i.Z)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=new(function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}())},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(4578),i=n(811),a=n(1959),o=n(7829);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:a})}return n}function d(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function f(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var p=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?c(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?f(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?d(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){v(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){m(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return h(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else v(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void v(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return h(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}v(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else m(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&m(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){(0,i.Z)(e<this._audioTracks.length);for(var t,n=s(this._audioTracks);!(t=n()).done;){t.value.nativeTrack.enabled=!1}this._audioTracks[e].nativeTrack.enabled=!0},t}(a.Z);function v(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function h(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function m(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7665:function(e,t,n){"use strict";n.d(t,{u:function(){return kt},Z:function(){return It}});var r=n(5861),i=n(4578),a=n(7757),o=n.n(a),s=n(8555),u=n.n(s),l=n(3887),c=n(6490),d=n(4791),f=n(6968),p=n(3635),v=(0,f.pX)((0,p.tG)("pssh"),0);function h(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,d.Z)(t.data,r.data))return!0}return!1}function m(e){var t=e.initData,n=e.initDataType;return null==t?(l.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,f.pX)(e,n+4)!==v)return l.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,f.pX)(new Uint8Array(e),n);if(n+r>e.length)return l.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,c.Y)(i,8),data:i};h(t,a)?l.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(l.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var g=n(2297);function y(e,t,n){var r;l.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){l.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,f.pX)(e,i+4)!==v)throw l.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,f.pX)(new Uint8Array(e),i);if(i+a>e.length)throw l.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,g.Xj)(o),u=null===s?void 0:o[s[1]];l.Z.info("Compat: CENC PSSH found with version",u),void 0===u?l.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,f.zo)(n,o):1===u?(l.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):l.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,f.zo)(r,o);i+=a}if(i!==e.length)throw l.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,f.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return l.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}var _=n(4804),b=n(6872),T=n(5157),E=n(5389),S=n(3274),w=n(7714),k=n(1959),A=n(1946),I=n(288),x=n(6139),Z=n(9589),R=n(770);function M(e){R.Z.setState(e,null),(0,x.Y)(e,null)}function C(){return(C=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,u,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,s=n.mediaKeySystemAccess,u=n.mediaKeys,c=R.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Z.Z.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(R.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:s,mediaKeys:u,loadedSessionsStore:a}),t.mediaKeys!==u){e.next=10;break}return e.abrupt("return");case 10:l.Z.info("DRM: Attaching MediaKeys to the media element"),(0,x.Y)(t,u),l.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new(u())((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(l.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,w.Z)(n,"expired")?(l.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,w.Z)(n,"internal-error")?(l.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(l.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function O(e,t,n){var r=e.loadedSessionsStore,i=e.persistentSessionsStore;return"temporary"===n?L(r,t):null===i?(l.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),L(r,t)):function(e,t,n){return B.apply(this,arguments)}(r,i,t)}function L(e,t){l.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return u().resolve({type:"created-session",value:n})}function B(){return(B=(0,r.Z)(o().mark((function e(t,n,i){var a,s,u,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=function(){return(d=(0,r.Z)(o().mark((function e(){var r,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.next=5,t.closeSession(a.mediaKeySession);case 5:return s=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:s});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},c=function(){return d.apply(this,arguments)},l.Z.info("DRM: Creating persistent MediaKeySession"),a=t.createSession(i,"persistent-license"),null!==(s=n.getAndReuse(i))){e.next=7;break}return e.abrupt("return",{type:"created-session",value:a});case 7:return e.prev=7,e.next=10,D(a.mediaKeySession,s.sessionId);case 10:if(u=e.sent){e.next=15;break}return l.Z.warn("DRM: No data stored for the loaded session"),n.delete(s.sessionId),e.abrupt("return",{type:"created-session",value:a});case 15:if(!u||!N(a.mediaKeySession)){e.next=19;break}return n.add(i,i.keyIds,a.mediaKeySession),l.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:a});case 19:return l.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",c());case 23:return e.prev=23,e.t0=e.catch(7),l.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",c());case 27:case"end":return e.stop()}}),e,null,[[7,23]])})))).apply(this,arguments)}function U(e,t){return F.apply(this,arguments)}function F(){return(F=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Z.Z.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t,n,r,i){return V.apply(this,arguments)}function V(){return(V=(0,r.Z)(o().mark((function e(t,n,r,i,a){var s,u,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null,u=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=u.reuse(t))){e.next=11;break}if(!N(s=d.mediaKeySession)){e.next=10;break}return l.Z.info("DRM: Reuse loaded session",s.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:s,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===s){e.next=16;break}return e.next=14,u.closeSession(s);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,U(u,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,O(n,t,r);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var K=n(3666);var G=n(9592);function H(e,t,n){var r=t.getConfiguration();if(K.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function W(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=b.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,G.Z)(s,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,G.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function j(e,t,n){l.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=R.Z.getState(e);if(null!=i){var a=H(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return l.Z.info("DRM: Found cached compatible keySystem"),Z.Z.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var s=t.reduce((function(e,t){var n,r=b.Z.getCurrent().EME_KEY_SYSTEMS[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=b.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,w.Z)(t[i],e))return i}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return u(0);function u(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=s.length)){e.next=2;break}throw new T.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=x.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=s[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=W(i,c),l.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+s.length,d),e.prev=7,e.next=10,(0,x.N)(a,d);case 10:return f=e.sent,l.Z.info("DRM: Found compatible keysystem",a,d),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),l.Z.debug("DRM: Rejected access to keysystem",a,d),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",u(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var q=n(7864);function Y(e){var t=new I.ZP;return Z.Z.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,q.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof I.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",l.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,q.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e,t){return e===t||(0,d.Z)(e,t)}function J(e,t){return t.some((function(t){return Q(t,e)}))}function ee(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return Q(t,e)})))return{v:!1}},i=$(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=te(this._keyIds);!(t=n()).done;){if(Q(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t){if(null!==this._keyIds&&ee(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return ee(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&void 0!==this._initializationData.keyIds?ee(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function ie(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ae(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oe=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new re(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r};return(0,A.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){l.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),l.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push({keySessionRecord:r,mediaKeySession:i,sessionType:t}),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),{keySessionRecord:n.keySessionRecord,mediaKeySession:n.mediaKeySession,sessionType:n.sessionType}}return null},t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=ie(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return l.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",u().resolve(!1));case 11:return e.next=13,se(n.mediaKeySession);case 13:return e.abrupt("return",u().resolve(!0));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,l.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return se(e.mediaKeySession)})),e.next=6,u().all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},e}();function se(e){return t(0);function t(e){return n.apply(this,arguments)}function n(){return(n=(0,r.Z)(o().mark((function n(r){var a,s,c,d,f,p,v,h,m,g,y,T;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l.Z.debug("DRM: Trying to close a MediaKeySession",e.sessionId,r),n.prev=1,n.next=4,Y(e);case 4:return l.Z.debug("DRM: Succeeded to close MediaKeySession"),n.abrupt("return",void 0);case 8:if(n.prev=8,n.t0=n.catch(1),n.t0 instanceof Error&&"InvalidStateError"===n.t0.name&&""===e.sessionId){n.next=12;break}return n.abrupt("return",i(n.t0));case 12:if(a=b.Z.getCurrent(),s=a.EME_SESSION_CLOSING_MAX_RETRY,c=a.EME_SESSION_CLOSING_INITIAL_DELAY,d=a.EME_SESSION_CLOSING_MAX_DELAY,!((f=r+1)>s)){n.next=16;break}return n.abrupt("return",i(n.t0));case 16:return p=Math.min(Math.pow(2,r)*c,d),l.Z.warn("DRM: attempt to close a mediaKeySession failed, scheduling retry...",p),h=new Promise((function(t){v=(0,_.eX)(e).subscribe(t)})),g=new Promise((function(t){m=(0,_.GJ)(e).subscribe(t)})),T=new Promise((function(e){y=window.setTimeout(e,p)})),n.next=23,u().race([h,g,T]);case 23:return null==v||v.unsubscribe(),null==m||m.unsubscribe(),clearTimeout(y),n.abrupt("return",t(f));case 27:case"end":return n.stop()}}),n,null,[[1,8]])})))).apply(this,arguments)}function i(e){return l.Z.error("DRM: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),u().resolve(null)}}var ue=n(811),le=n(9689),ce=n(2870),de=n(6923),fe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,le.J)(this.initData)},e.decode=function(e){return(0,le.K)(e)},e}();function pe(e,t){var n,r;return null!==(r=null!==(n=ve(e,t))&&void 0!==n?n:ve(t,e))&&void 0!==r&&r}function ve(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?fe.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?fe.decode(a.data):a.data.initData;if(!(0,d.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var l=t[i];if(u.systemId===l.systemId){if(u.hash!==l.hash)return!1;var c=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?fe.decode(u.data):u.data.initData,f=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?fe.decode(l.data):l.data.initData;if(!(0,d.Z)(c,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ge=function(){function e(e){!function(e){(0,ue.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){l.Z.warn("DRM-PSS: Could not get entries from license storage",e),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){if(!(0,A.Z)(n)&&(0,de.Z)(n.sessionId)){var r=n.sessionId,i=this.get(e);if(null===i||i.sessionId!==r){null!==i&&this.delete(i.sessionId),l.Z.info("DRM-PSS: Add new session",r);var a=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new fe(n)}}));void 0===t?this._entries.push({version:3,sessionId:r,values:a,initDataType:e.type}):this._entries.push({version:4,sessionId:r,keyIds:t.map((function(e){return new fe(e)})),values:a,initDataType:e.type}),this._save()}}else l.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];l.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else l.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){l.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(l.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,ce.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,le.J)(e),r=he(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if(Q(a.initData,e))return!0}return!1})))return{v:n}}else if(pe(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(pe(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,s=a.initDataHash;if(i.initDataHash===s)try{var u="string"==typeof i.initData?fe.decode(i.initData):i.initData.initData;if((0,d.Z)(u,o))return{v:n}}catch(e){l.Z.warn("DRM-PSS: Could not decode initialization data.",e)}break;case 1:var c=r(),f=c.initData,p=c.initDataHash;if(i.initDataHash===p){if(void 0===i.initData.length)return{v:n};if((0,d.Z)(i.initData,f))return{v:n}}break;default:var v=r().initDataHash;if(i.initData===v)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){l.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var ye=new WeakMap,_e=function(e){ye.set(e,null)},be=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ce.Z)(n);ye.set(e,{hash:r,serverCertificate:n})},Te=function(e){var t=ye.get(e);return void 0!==t&&(null!==t||void 0)},Ee=function(e,t){var n=ye.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ce.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Se(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new T.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return l.Z.debug("DRM: Set the given license storage"),new ge(t)}function we(e,t,n){return ke.apply(this,arguments)}function ke(){return(ke=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,u,c,d,f,p,v,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,s=a.options,u=a.mediaKeySystemAccess,c=R.Z.getState(t),d=Se(s),null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,p=c.loadedSessionsStore,!1!==Te(f)&&((0,A.Z)(s.serverCertificate)||!Ee(f,s.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:u,stores:{loadedSessionsStore:p,persistentSessionsStore:d},options:s});case 12:return e.next=14,Ae(u);case 14:return v=e.sent,l.Z.info("DRM: MediaKeys created with success"),h=new oe(v),e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:u,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:s});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(e){return Ie.apply(this,arguments)}function Ie(){return(Ie=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new T.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function xe(){return(xe=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,we(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(l.Z.debug("DRM: Disabling old MediaKeys"),M(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ze=n(7326),Re=n(2146),Me=n(6716),Ce=n(9127),De=n(7877),Pe=n(9917),Ne=n(7991),Oe=n(1454),Le=n(6798),Be=n(7878),Ue=n(1819),Fe=n(2566),ze=n(7845),Ve=(0,Ue.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ke(e){throw new Ve(e)}var Ge=n(278),He=n(9878),We=n(3071),je=n(8474);var qe=n(1545),Ye=n(2817),$e=n(3505),Xe=n(6362),Qe=n(2006),Je=n(533),et=n(8117),tt=n(6625),nt=n(2572);var rt=n(5561);var it="expired",at="internal-error",ot="output-restricted";function st(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(K.YM||K.kD)?(0,p.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case it:var d=new T.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,p.ci)(c)+")");if(!1!==u)throw d;r.push({type:"warning",value:d}),a.push(c);break;case at:var f=new T.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,p.ci)(c)+")");if(!0!==s.keyInternalError)throw f;r.push({type:"warning",value:f}),i.push(c);break;case ot:var v=new T.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,p.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw v;r.push({type:"warning",value:v}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var ut=_.Xe,lt=_.GJ,ct=_.eX,dt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ze.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Re.Z)(Error));function ft(e,t,n){l.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Me.x,o=t.getLicenseConfig,s=void 0===o?{}:o,u=ut(e).pipe((0,Ce.U)((function(e){throw new T.Z("KEY_ERROR",e.type)}))),c=ct(e).pipe((0,De.z)((function(r){return function(e,t,n,r){l.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Pe.P)((function(){return(0,rt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?qe.E:(0,et.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Ce.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,He.K)((function(e){var t=new T.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,A.Z)(e)&&(0,de.Z)(e.message)&&(t.message=e.message),t})));return(0,We.T)(pt(e,t,n),i)}(e,t,n,r)}))),d=lt(e).pipe((0,De.z)((function(n){var r=new Uint8Array(n.message),i=(0,de.Z)(n.messageType)?n.messageType:"license-request";l.Z.info("DRM: Received message event, type "+i,e.sessionId,n);var o,u,c,d,f,p,v,h,m=(0,Pe.P)((function(){var e=t.getLicense(r,i),n=(0,A.Z)(s.timeout)?1e4:s.timeout;return(0,et.Z)(e).pipe(n>=0?function(e,t){var n=(0,Oe.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?Ke:a,s=n.scheduler,u=void 0===s?null!=t?t:Ne.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Le.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,ze.f)(t,u,(function(){try{n.unsubscribe(),(0,Be.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Fe.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ge.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ve||(0,A.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:vt(t)})}}}(a,s.retry);return(o=m,u=g,c=u.baseDelay,d=u.maxDelay,f=u.totalRetry,p=u.shouldRetry,v=u.onRetry,h=0,o.pipe((0,He.K)((function(e,t){if(!(0,A.Z)(p)&&!p(e)||h++>=f)throw e;"function"==typeof v&&v(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,nt.Z)(n);return(0,tt.H)(r).pipe((0,De.z)((function(){return t})))})))).pipe((0,Ce.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,He.K)((function(e){var t=vt(e);if(!(0,A.Z)(e)&&!0===e.fallbackOnLastTry)throw l.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new dt(t);throw t})))}))),f=(0,We.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,A.Z)(t.value.license)?(l.Z.info("DRM: No message given, skipping session.update"),qe.E):function(e,t){return l.Z.info("DRM: Updating MediaKeySession with message"),(0,et.Z)(e.update(t)).pipe((0,He.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new T.Z("KEY_UPDATE_ERROR",t)})),(0,Qe.b)((function(){l.Z.info("DRM: MediaKeySession update succeeded.")})),(0,Je.l)())}(e,t.value.license);default:return(0,Ye.of)(t)}},(0,je.m)(i)?(0,De.z)(r,i,1):(0,De.z)(r,1))),p=(0,We.T)(pt(e,t,n),f,u,a);return(0,A.Z)(e.closed)?p:p.pipe((0,$e.R)((0,et.Z)(e.closed)))}function pt(e,t,n){return(0,Pe.P)((function(){if(0===e.keyStatuses.size)return qe.E;var r=st(e,t,n),i=r.warnings,a=r.blacklistedKeyIDs,o=r.whitelistedKeyIds,s=i.length>0?Ye.of.apply(void 0,i):qe.E,u=(0,Ye.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIDs:a}});return(0,Xe.z)(s,u)}))}function vt(e){if(e instanceof Ve)return new T.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new T.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,A.Z)(e)&&(0,de.Z)(e.message)&&(t.message=e.message),t}var ht=n(9822);function mt(e,t){return gt.apply(this,arguments)}function gt(){return(gt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),l.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new T.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function yt(e,t){return _t.apply(this,arguments)}function _t(){return(_t=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==Te(t)){e.next=3;break}return l.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return l.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return l.Z.info("DRM: Setting server certificate on the MediaKeys"),_e(t),e.prev=8,e.next=11,mt(t,n);case 11:return r=e.sent,be(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,ht.Z)(e.t0)?e.t0:new T.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function bt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;l.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var Tt=n(9252);var Et=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return f.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return pe(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ce.Z)(n)}}))),this._lazyFormattedValues},e}();function St(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kt,At=_.Oh,It=function(e){function t(t,n){var r;r=e.call(this)||this,l.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new I.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:kt.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=At(t).subscribe((function(e){l.Z.debug("DRM: Encrypted event received from media element.");var t=m(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return xe.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,A.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,Tt.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,Tt.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,Tt.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===kt.Initializing&&(r._stateData={state:kt.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==kt.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)l.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,s=i.mediaKeys,u=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:u,mediaKeys:s,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:kt.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(l.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return C.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,A.Z)(n)){t.next=6;break}return t.next=4,yt(s,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:u=e._stateData.state,e._stateData={state:kt.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},u!==kt.ReadyForContent&&e.trigger("stateChange",kt.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:kt.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new Et(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,c,d,f,v,h,m,g,_,E,w,k,A,I,x,Z,R,M,C,D,P,N,O,L,B,U,F,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(s=(0,S.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(c=t.keyIds)){e.next=10;break}return void 0===t.content?l.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):Rt(t.content.manifest,t),e.abrupt("return");case 10:return s.record.associateKeyIds(c),void 0!==t.content&&("DEBUG"===l.Z.getLevel()&&(d=c.reduce((function(e,t){return e+", "+(0,p.ci)(t)}),""),l.Z.debug("DRM: Blacklisting new key ids",d)),Zt(t.content.manifest,[],c)),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}f=t.content.period,v=this._currentSessions.filter((function(e){return"created-session"===e.source})),Dt(h=new Set,f),m=St(v);case 21:if((g=m()).done){e.next=37;break}_=g.value,E=Array.from(h),w=0,k=E;case 25:if(!(w<k.length)){e.next=35;break}if(A=k[w],!_.record.isAssociatedWithKeyId(A)){e.next=32;break}for(_.record.associateKeyIds(h.values()),I=St(E);!(x=I()).done;)J(Z=x.value,_.keyStatuses.whitelisted)||J(Z,_.keyStatuses.blacklisted)||_.keyStatuses.blacklisted.push(Z);return Zt(t.content.manifest,_.keyStatuses.whitelisted,_.keyStatuses.blacklisted),e.abrupt("return");case 32:w++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?R="temporary":xt(r)?R="persistent-license":(l.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),R="temporary"),M=b.Z.getCurrent(),C=M.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,D=M.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,P="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:C,e.next=43,z(t,i,R,P,this._canceller.signal);case 43:if(N=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(O={record:N.value.keySessionRecord,source:N.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(O),L=N.value,B=L.mediaKeySession,U=L.sessionType,F=!1,V=ft(B,a,r.keySystem).subscribe({next:function(e){switch(e.type){case"warning":return void G.trigger("warning",e.value)}var n;if(n="created-session"===O.source?Mt(t,a.singleLicensePer,e.value.whitelistedKeyIds,e.value.blacklistedKeyIDs):{whitelisted:e.value.whitelistedKeyIds,blacklisted:e.value.blacklistedKeyIDs},O.record.associateKeyIds(n.whitelisted),O.record.associateKeyIds(n.blacklisted),O.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==O.record.getAssociatedKeyIds().length&&"persistent-license"===U&&null!==i.persistentSessionsStore&&!F){var r=i.persistentSessionsStore;bt(r,D-1),r.add(t,O.record.getAssociatedKeyIds(),B),F=!0}void 0!==t.content&&Zt(t.content.manifest,n.whitelisted,n.blacklisted),G._unlockInitDataQueue()},error:function(e){if(e instanceof dt){if(O.blacklistedSessionError=e,void 0!==t.content){var n=t.content.manifest;l.Z.info("DRM: blacklisting Representations based on protection data."),Rt(n,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){V.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==N.type){e.next=63;break}return K=t.values.constructRequestData(),e.prev=55,e.next=58,y(B,t.type,K);case 58:e.next=63;break;case 60:throw e.prev=60,e.t0=e.catch(55),new T.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 63:return e.abrupt("return",u().resolve());case 64:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,S.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,A.Z)(a))return void 0===e.type||void 0===e.content?(l.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(l.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),Rt(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var s=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return Q(t,e)})))return{v:!0}},i=$(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,s)}else{var u=i.keyStatuses.whitelisted;o=!ee(e.keyIds,u)}if(o)return void 0===e.content?(l.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(l.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),Zt(e.content.manifest,[],e.keyIds),!0)}if(null!==n.loadedSessionsStore.reuse(e))return l.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?l.Z.error("DRM: Unable to remove processed init data: not found."):(l.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new E.Z("NONE","Unknown encryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:kt.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===kt.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===kt.Disposed||this._stateData.state===kt.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):l.Z.error("DRM: Trying to unlock in the wrong state")},t}(k.Z);function xt(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,w.Z)(t,"persistent-license")}function Zt(e,t,n){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],o=0;o<n.length;o++)if(Q(n[o],a.keyId))return!1;for(var s=0;s<t.length;s++)if(Q(t[s],a.keyId))return!0}return e.decipherable}))}function Rt(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,d.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Mt(e,t,n,r){var i,a=[].concat(n,r);if(void 0!==t&&"init-data"!==t){var o=e.keyIds,s=e.content;if(void 0!==o){var u=o.filter((function(e){return!a.some((function(t){return Q(t,e)}))}));u.length>0&&a.push.apply(a,u)}if(void 0!==s)if("content"===t){for(var l,c=new Set,d=St(s.manifest.periods);!(l=d()).done;){Dt(c,l.value)}Ct(c,a)}else if("periods"===t)for(var f,p=St(s.manifest.periods);!(f=p()).done;){var v=f.value,h=new Set;if(Dt(h,v),(null===(i=e.content)||void 0===i?void 0:i.period.id)===v.id)Ct(h,a);else for(var m=Array.from(h),g=function(){var e=_[y];if(a.some((function(t){return Q(t,e)})))return Ct(h,a),"break"},y=0,_=m;y<_.length;y++){if("break"===g())break}}}return{whitelisted:n,blacklisted:a.slice(n.length)}}function Ct(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return Q(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Dt(e,t){for(var n,r=St(t.getAdaptations());!(n=r()).done;)for(var i,a=St(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&o.contentProtections.keyIds.length>=-1)for(var s,u=St(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(kt||(kt={}))},1266:function(e,t,n){"use strict";var r=n(7665);t.ZP=r.Z},770:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(6362),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(4804);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$)(!1),p=(0,T.$)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){b.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.observe(!0));var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.observe(!0)).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(p.setValue(!0),p.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),p.setValue(!0),p.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:p,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(1545),i=n(5583),a=n(533),o=n(4975),s=n(4727),u=n(7877),l=n(4978),c=n(2817),d=n(3071),f=n(1480),p=n(3887),v=n(5767);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,v.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var I=function(e,t){return new f.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,v.Z)(e)}}))}(E,A);p.Z.debug("Init: Calculating initial time");var x=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return p.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(E,k)};p.Z.debug("Init: Initial time calculated:",x);var Z=(0,g.Z)({mediaElement:E,playbackObserver:S,startTime:x,mustAutoPlay:t}).seekAndPlay$,R=(0,y.Z)(E,n,r.E,I).pipe((0,h.Z)(),(0,i.B)()),M=(0,b.Z)(E),C=S.observe(!0),D=(0,T.Z)(E,w,C).pipe((0,a.l)()),P=(0,_.Z)(S,null,r.E,r.E),N=R.pipe((0,o.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.q)(1),(0,u.z)((function(){return Z})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,m.Z)(C,E,null,!0)})));return(0,d.T)(N,R.pipe((0,a.l)()),M,D,P)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3071),i=n(9127),a=n(1480),o=n(6139);var s=n(4804),u=n(5157),l=n(7874),c=n(3887),d=n(7665),f=s.Oh;function p(e,t,n,s){var p=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof o.N)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var v=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new v(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=s.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var o=n.subscribe((function(e){a.onInitializationData(e)}));return function(){o.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(6872),d=n(3714),f=n(3887),p=n(2829),v=n(8567),h=1/60;function m(e,t,n,d){var m,_=d.pipe((0,r.M)(e.observe(!0)),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return g(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return g(t)&&e.splice(a,0,t),e;g(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),b=null,T=null,E=n.pipe((0,r.M)(e.observe(!0)),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),S=e.observe(!0).pipe((0,r.M)(_),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing,g=c.Z.getCurrent(),_=g.BUFFER_DISCONTINUITY_THRESHOLD,E=g.FORCE_DISCONTINUITY_SEEK_DELAY,S=g.FREEZING_STALLED_DELAY,w=g.UNFREEZING_SEEK_DELAY,k=g.UNFREEZING_DELTA_POSITION;if(null!==d){var A=performance.now();if(A-(null===m?d.timestamp:m.attemptTimestamp)>w&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+k),m={attemptTimestamp:A}),A-d.timestamp>S)return{type:"stalled",value:"freezing"}}else m=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var I="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)b=r.position;else if(null!==b){var x=performance.now();if(null===T&&(T=x),l&&r.position<b&&x-T<E)return{type:"stalled",value:I};b=null}if(T=null,null===t)return{type:"stalled",value:I};var Z=u.position;if(null!==Z){var R=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-h)if(null===d){var p=t.getPeriodAfter(a);null!==p?o=p.start+h:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+h&&(o=d+h);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,Z);if(null!==R){var M=R+.001;if(!(M<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,M),e.setCurrentTime(M),v.Z.warning(y(Z,M));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),M)}}var C=null!=Z?Z:o,D=(0,p.XS)(a,C);if(D<_){var P=C+D+h;if(e.getCurrentTime()<P)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",C,P,_),e.setCurrentTime(P),v.Z.warning(y(C,P))}for(var N=t.periods.length-2;N>=0;N--){var O=t.periods[N];if(void 0!==O.end&&O.end<=C){if(t.periods[N+1].start>C&&t.periods[N+1].start>e.getCurrentTime()){var L=t.periods[N+1];return e.setCurrentTime(L.start),v.Z.warning(y(C,L.start))}break}}return{type:"stalled",value:I}})));return(0,u.T)(E,S)}function g(e){return null!==e.discontinuity}function y(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(7877),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,c=u.end,d=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/d,h=c/d,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),p=n(9917),v=n(4804),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(6872),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var I=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=w(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=w(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function x(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var Z=v.C1,R=v.ik,M=v.d5;function C(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function D(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var P=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new I,r._currentCues=[],function(e){var t=M(e),n=R(e),r=Z(e),f=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,p=(0,i.T)(n,r),v=(0,a.F)(f).pipe((0,o.O)(null));return p.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(v.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,n=Math.max(r._videoElement.currentTime+t/1e3/2,0),i=r._buffer.get(n);0===i.length?r._disableCurrentCues():r._displayCues(i)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,p.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,p.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,p.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;g.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,c=o.end,d=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a),a}(f,d,i,p);if(0!==v&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=v;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<v;)m[y].start=v,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){g.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)C(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)C(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=D(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));if(s.length>0){var u=_.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL;(function(e,t){return(0,p.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))})(this._textTrackElement,u).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];x(t,n,i.resolution,i.element)}}))}}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new c.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,c=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=d.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function p(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function v(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&f(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,f(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&p(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,p(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var m,g=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,c=0;c<l;c++){if(void 0===a)return;var d=e.start(c),f=e.end(c);if(f-d<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,d,f);else{for(var p=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-d<s;)a=t[++n];var m=null,g=n-p;if(g>0){var y=t[p+g-1];m={end:(0,o.Z)(y.bufferedEnd,y.end),precizeEnd:y.precizeEnd},i.Z.debug("SI: "+g+" segments GCed.",u),t.splice(p,g),n=p}if(void 0===a)return;if(f-(0,o.Z)(a.bufferedStart,a.start)>=s){if(v(a,d,m,u),n===t.length-1)return void h(a,f,u);a=t[++n];for(var _=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end),T=c<l-1?e.start(c+1):void 0;void 0!==a&&f-_>=s&&(void 0===T||f-_>=b-T);){var E=t[n-1];void 0===E.bufferedEnd&&(E.bufferedEnd=a.precizeStart?a.start:E.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,E.bufferedEnd,E.end)),a.bufferedStart=E.bufferedEnd,void 0!==(a=t[++n])&&(_=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end))}}var S=t[n-1];void 0!==S&&h(S,f,u)}}null!=a&&(i.Z.debug("SI: last segments have been GCed",u,n,t.length),t.splice(n,t.length-n)),void 0!==u&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+u+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,p=n[d],v=void 0;if(void 0===p)v=o(l.infos),n[d]=((c={})[f]=v,c);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var p=c[f];if(p.start<=s){if(p.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,p.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(p.start===s){if(p.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,p.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,p.end),c.splice(f,0,d),p.start=d.end,p.bufferedStart=void 0,void(p.precizeStart=p.precizeStart&&d.precizeEnd)}if(p.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,p.start,p.end),this._inventory.splice(f+1,0,d),p.end=d.start,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,p.start,p.end);var v={partiallyPushed:p.partiallyPushed,chunkSize:p.chunkSize,splitted:!0,start:d.end,end:p.end,precizeStart:p.precizeStart&&p.precizeEnd&&d.precizeEnd,precizeEnd:p.precizeEnd,bufferedStart:void 0,bufferedEnd:p.end,infos:p.infos};return p.end=d.start,p.splitted=!0,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,v)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,p=f-u,v=n[f].end,h=n[f].bufferedEnd;p>0&&(this._inventory.splice(u+1,p),o-=p),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=v,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,y.bufferedStart,y.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(m||(m={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t,n){"use strict";var r=n(8026),i={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},e)}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return d},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791),c=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],c=void 0;for(c=0;c<a.length;c++)if(s.systemId===a[c].systemId){if((0,l.Z)(s.data,a[c].data))break;u.Z.warn("Manifest: different init data for the same system ID")}c===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),d=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,d=[],f=!1,p=0;p<l.length;p++){var v=new c(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(d.push(v),!f&&v.isSupported&&(f=!0))}d.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=d,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(8806),c=n(8999),d=n(1679),f=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,d.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},e}(),p=n(3887),v=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){p.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){p.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var h=n(5138);function m(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)p.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?p.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=(0,u.Z)(),b=(0,u.Z)();var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=b(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new f(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=g(e.periods);!(n=i()).done;)for(var a,o=n.value,s=g(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=g(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,l.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,l.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,l.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new v({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+_(),s="gen-text-rep-"+_(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new v({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){m(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)p.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,h.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");m(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),m(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z)},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{Qy:function(){return l},Xj:function(){return d},iz:function(){return u},lp:function(){return s},nR:function(){return c},t_:function(){return o}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n=l(e,t);return null!==n?e.subarray(n[1],n[2]):null}function s(e,t){for(var n=[],r=e;;){var a=l(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function u(e,t){var n=l(e,t);return null!==n?e.subarray(n[0],n[2]):null}function l(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function c(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function d(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),c=u(l,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:l}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{J6:function(){return m},LD:function(){return h},MM:function(){return v},Qx:function(){return f},Wf:function(){return d},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+v-1]}),l+=h,r+=v}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function p(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function v(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var v=(0,i.QI)(c,d);d+=3;var h=(256&v)>0,m=0;if(!h&&void 0===(m=p(o)))return;var g=(1&v)>0,y=(4&v)>0,_=(512&v)>0,b=(1024&v)>0,T=(2048&v)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,p=d.string;c=f;var v=(0,a.DM)(o,c),h=v.end,m=v.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:p,width:v,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=u.map((function(e){return e.url})),h=(0,s.k6)(v,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(v,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:1,m=[],g=d.length,y=d.length>0&&null!=d[0].duration?d[0].duration:0,_=0;_<g;_++){var b=d[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,d[_+1],o),k=!1!==e.availabilityTimeComplete||_!==g-1&&0!==w,A=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),I=E+A*T;I<c&&A<=w;){var x=h+A,Z=null===p?null:p.map((0,i.QB)(I,x)),R=I-e.indexTimeOffset,M={id:String(I),time:R/f,end:(R+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:Z,number:x,timestampOffset:-e.indexTimeOffset/f,complete:k,privateInfos:{isEMSGWhitelisted:a}};m.push(M),I=E+ ++A*T}if(I>=c)return m;h+=w+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return u},k6:function(){return o}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return He}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function f(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function p(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=f(r);if(void 0===u)return;a=u}if(void 0!==i){var l=f(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}var v=n(9592),h=n(908),m=n(1679),g=n(3635);var y=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),_=n(8999),b=n(5138),T=n(7714),E=n(6923);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e,t){for(var n,r=S(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=S(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=S(_.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,p=S(d);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},A=["subtitle","caption"];function I(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,T.Z)(_.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,T.Z)(A,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var p=i(d,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var x=n(8026);var Z=n(7403),R=n(3911),M=n(1915),C=n(4784),D=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,c=u-r*l,d=i.map((function(e){return e.url})),f=e.list.map((function(e){return{mediaURLs:(0,C.k6)(d,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:f,timescale:l,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(d,e.initialization.media,a,o),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,R.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],p=Math.floor(l/r);p<=d;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),N=n(8232),O=n(1091),L=n(5505),B=n(6394);function U(e,t,n){return t+a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e>=n}function F(e,t,n,r){var a=e.start,s=e.duration,u=e.repeatCount;return void 0===a&&(null===t?a=r:(0,i.Z)(t.duration)||(a=t.start+t.duration*(t.repeatCount+1))),void 0!==s&&!isNaN(s)||null===n||void 0===n.start||isNaN(n.start)||void 0===a||isNaN(a)||(s=n.start-a),void 0===a||isNaN(a)||void 0===s||isNaN(s)||void 0!==u&&isNaN(u)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:a,duration:s,repeatCount:void 0===u?0:u}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e,t){for(var n=[],r=0;r<e.length;r++)n.push(z(e[r]));for(var i=[],a=0;a<n.length;a++){var o=F(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!==o&&i.push(o)}return i}function K(e,t,n){var r,i=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-c;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(v+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,c=t.length-a+s-1;if(c>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e,n);var d=t.slice(a);if(u>0){var f=d[0];f.start+=f.duration*u,d[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e,n);var p=d[d.length-1],v=z(e[c]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),V(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=c+1;y<e.length;y++)g.push(z(e[y]));for(var _=0;_<g.length;_++){var b=F(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return d.concat(m)}var G=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.isLastPeriod,c=n.representationBaseURLs,d=n.representationId,f=n.representationBitrate,p=n.periodStart,v=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-p*m;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=h,this._isLastPeriod=l,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=c.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{mediaURLs:(0,C.k6)(y,t.initialization.media,d,f),range:t.initialization.range},mediaURLs:(0,C.k6)(y,t.media,d,f),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:m},this._scaledPeriodStart=(0,R.gT)(p,this._index),this._scaledPeriodEnd=null==v?void 0:(0,R.gT)(v,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,R.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,R.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,R._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,L.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,R.jH)(t,null,this._scaledPeriodEnd);return U(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,R.gT)(e,this._index),n=(0,N.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,R.jH)(e[e.length-1],null,t)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?V(e,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,K(e,t,this._scaledPeriodStart))},e}(),H=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1,v=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+v,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,C.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var p=Math.max(d,l),v=Math.min(f,c);if(v+r<=p)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,C.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&U(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var o=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function W(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function $(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,p=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),v=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=W(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,p=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:p};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new Z.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new D(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=x.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=G.isTimelineIndexArgument(T)?new G(T,m):new H(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new Z.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new D(w,m)}else i=new H({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,x.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:v,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r,i=[],a=j(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(T.initData).length>0||T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=Y({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=j(e);!(l=f()).done;)d();return c}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function ee(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function te(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ne(e,t){if((0,E.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,E.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,E.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,E.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,E.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,E.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function re(e){if(null!=e.children.supplementalProperties)for(var t,n=X(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function ie(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function ae(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var se=(0,h.Z)();function ue(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,h=new y({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||h.setLastPosition(t.duration);for(var S=function(y){var S=y===e.length-1,w=e[y],A=t.xlinkInfos.get(w),x=W(t.baseURLs,w.children.baseURLs),Z=d[y],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,D=void 0;for(null==w.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),D="gen-dash-period-"+se()):D=w.attributes.id;c.some((function(e){return e.id===D}));)D+="-dup";var P=void 0!==A?A.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(D))&&void 0!==r?r:null,O=null===(i=w.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=w.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=w.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:x,manifestBoundsCalculator:h,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:P,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},p=[],v={},h=[],m=-1,g=0;g<e.length;g++){var y=e[g],S=y.children,w=S.essentialProperties,A=S.roles,x=Array.isArray(A)&&A.some((function(e){return"main"===e.value}))&&A.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),Z=y.children.representations,R=null!==(n=y.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,M=(null!==(r=y.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,C=y.attributes.mimeType,D=y.attributes.codecs,P=I(Z,(0,E.Z)(C)?C:null,(0,E.Z)(D)?D:null,null!=S.roles?S.roles:null);if(void 0!==P){var N=null!==(i=y.attributes.selectionPriority)&&void 0!==i?i:1,O=y.attributes.id,L=void 0,B=re(y),U=[];void 0!==t.segmentTemplate&&U.push(t.segmentTemplate),void 0!==y.children.segmentTemplate&&U.push(y.children.segmentTemplate);var F={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:R,availabilityTimeOffset:M,baseURLs:W(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:U,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},z=Array.isArray(w)?(0,s.Z)(w,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,V=null===(a=null==z?void 0:z.value)||void 0===a?void 0:a.split(" "),K=void 0!==V;if("video"===P&&x&&m>=0&&f.video.length>m&&!K){var G,H=f.video[m][0];F.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(H.id))&&void 0!==l?l:null;var j=$(Z,y,F);(G=H.representations).push.apply(G,j),L=H.id}else{var q=S.accessibilities,Y=void 0;void 0!==A&&A.some((function(e){return"dub"===e.value}))&&(Y=!0);var Q=void 0;"text"!==P?Q=!1:void 0!==q&&(Q=q.some(ee));var ae=void 0;"audio"!==P?ae=!1:void 0!==q&&(ae=q.some(J));var oe=void 0;"video"!==P?oe=!1:void 0!==q&&(oe=q.some(te));for(var se=ne(y,{isAudioDescription:ae,isClosedCaption:Q,isSignInterpreted:oe,isTrickModeTrack:K,type:P});(0,T.Z)(h,se);)se+="-dup";L=se,h.push(se),F.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(se))&&void 0!==d?d:null;var ue={id:se,representations:$(Z,y,F),type:P,isTrickModeTrack:K};if(null!=y.attributes.language&&(ue.language=y.attributes.language),null!=Q&&(ue.closedCaption=Q),null!=ae&&(ue.audioDescription=ae),!0===Y&&(ue.isDub=!0),!0===oe&&(ue.isSignInterpreted=!0),void 0!==V)p.push({adaptation:ue,trickModeAttachedAdaptationIds:V});else{for(var le,ce=-1,de=function(){var e=le.value,t=v[e];if(void 0!==t&&t.newID!==L&&(0,T.Z)(t.adaptationSetSwitchingIDs,O)){ce=(0,b.Z)(f[P],(function(t){return t[0].id===e}));var n,r=f[P][ce];void 0!==r&&r[0].audioDescription===ue.audioDescription&&r[0].closedCaption===ue.closedCaption&&r[0].language===ue.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',O,e),(n=r[0].representations).push.apply(n,ue.representations),"video"===P&&x&&!r[1].isMainAdaptation&&(m=Math.max(m,ce)),r[1]={priority:Math.max(N,r[1].priority),isMainAdaptation:x||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},fe=X(B);!(le=fe()).done;)de();ce<0&&(f[P].push([ue,{priority:N,isMainAdaptation:x,indexInMpd:g}]),"video"===P&&x&&(m=f.video.length-1))}}null!=O&&null==v[O]&&(v[O]={newID:L,adaptationSetSwitchingIDs:B})}}var pe=_.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(ie),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(ie),k(pe,p),pe}(w.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=w.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=ae(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,p=c.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ae(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/v+t,b=void 0===y.duration?void 0:_+y.duration/v,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,g.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(w.children.eventStreams,R,K),H={id:D,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(H),!h.lastPositionIsKnown()){var j=function(e){for(var t,n=null,r=!0,i=(0,m.Z)(e).filter((function(e){return null!=e})),a=ae((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=ae(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof j){var q=performance.now()/1e3;h.setLastPosition(j,q)}else{var Y=le(t,R);if(void 0!==Y){var Q=Y[0],oe=Y[1];h.setLastPosition(Q,oe)}}else"number"==typeof j&&h.setLastPosition(j)}},w=e.length-1;w>=0;w--)S(w);if(t.isDynamic&&!h.lastPositionIsKnown()){var A=le(t,0);if(void 0!==A){var x=A[0],Z=A[1];h.setLastPosition(x,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];void 0===i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(c)}function le(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function ce(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fe=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var f=t.children,v=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===v.type,m=(0,s.Z)(f.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?l(m.value):void 0,y=null==g||isNaN(g)?void 0:g;if(null!=y&&!0!==i)n.externalClockOffset=y;else if(h&&!0!==i){var _=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=_&&_.length>0)return{type:"needs-clock",value:{url:_,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var b=[],T=0;T<f.periods.length;T++){var E=f.periods[T].attributes,S=E.xlinkHref,w=E.xlinkActuate;null!=S&&"onLoad"===w&&b.push({index:T,ressource:S})}return 0===b.length?function(e,t,n,r){var i,s,l,c,f,v,h=e.children,m=e.attributes,g="dynamic"===m.type,y=W(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],h.baseURLs),_=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),b=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,S={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,baseURLs:y,clockOffset:T,duration:m.duration,isDynamic:g,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},w=ue(h.periods,S),k=m.duration,A=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(c=0===m.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var I=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[p(e),d(e)]}(w),x=I[0],Z=I[1],R=performance.now();if(g){var M;if(f=x,A=null!=b?b:null,void 0!==Z)M=Z;else{var C=null!=_?_:0,D=t.externalClockOffset;if(void 0===D)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-C;else M=(performance.now()+D)/1e3-C}v={isLinear:!0,value:M,time:R},null!==A&&void 0!==f&&M-f>A&&(A=M-f)}else{f=void 0!==x?x:void 0!==(null===(i=w[0])||void 0===i?void 0:i.start)?w[0].start:0;var P=null!=k?k:1/0;if(void 0!==w[w.length-1]){var N=w[w.length-1],O=null!==(s=N.end)&&void 0!==s?s:void 0!==N.duration?N.start+N.duration:void 0;void 0!==O&&O<P&&(P=O)}void 0!==Z&&Z<P&&(P=Z),v={isLinear:!1,value:P,time:R}}var L=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=w[w.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:L,periods:w,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:f,timeshiftDepth:A,maximumTimeData:v},lifetime:c,uris:null==t.url?h.locations:[t.url].concat(h.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(a){if(a.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=b[o].index,l=a[o],d=l.parsed,p=l.warnings,v=l.receivedTime,h=l.sendingTime,m=l.url;p.length>0&&r.push.apply(r,p);for(var g,y=ce(d);!(g=y()).done;){var _=g.value;c.set(_,{receivedTime:v,sendingTime:h,url:m})}(s=f.periods).splice.apply(s,[u,1].concat(d))}return e(t,n,r,i,c)}}}},pe=n(7326),ve=n(4578),he=n(2146),me=n(9689),ge=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ye=/([0-9]+)-([0-9]+)/;function _e(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ze("`"+t+'` property is not a boolean value but "'+e+'"')]}function be(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Te(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ee(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Se(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ze("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function we(e,t){if(!(0,E.Z)(e))return[0,new Ze("`"+t+"` property is empty")];var n=ge.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,E.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,E.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,E.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,E.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,E.Z)(n[10])?n[10]:"0")+parseFloat((0,E.Z)(n[12])?n[12]:"0"),null]}function ke(e,t){var n=ye.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ae(e,t){try{return[(0,me.K)(e),null]}catch(n){return[null,new Ze("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Ie(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function xe(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ze=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,pe.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ve.Z)(t,e),t}((0,he.Z)(Error));function Re(e){var t={},n=e.textContent,r=[],i=xe(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Me(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Ce(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ae(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function De(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:ke,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Pe(e){for(var t={},n=[],r=xe(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=De(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:Te,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:_e,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:be,dashName:"startNumber"})}}return[t,n]}function Ne(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:ke,dashName:"mediaRange"})}}return[t,n]}function Oe(e){for(var t=Pe(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Ne(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,x.Z)(n,{list:i}),r]}function Le(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Be(e){for(var t,n=Pe(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Le(o))}for(var s=(0,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=xe(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"})}}return[s,i]}function Ue(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ie(a));break;case"SegmentBase":var l=Pe(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Oe(a),p=f[0],v=f[1];r=r.concat(v),t.segmentList=p;break;case"SegmentTemplate":var h=Be(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ce(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:be,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:be,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ze("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Fe(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[Ie(a)]:t.accessibilities.push(Ie(a));break;case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Me(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Ie(a)]:t.essentialProperties.push(Ie(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ie(a));break;case"Representation":var l=Ue(a),c=l[0],d=l[1];t.representations.push(c),d.length>0&&(r=r.concat(d));break;case"Role":null==t.roles?t.roles=[Ie(a)]:t.roles.push(Ie(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ie(a)]:t.supplementalProperties.push(Ie(a));break;case"SegmentBase":var f=Pe(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Oe(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Be(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=Ce(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),void 0!==E&&n.push(E)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:be,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:be,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:be,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:be,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:be,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:be,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:be,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:be,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Ee,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Ee,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function ze(e){for(var t={children:{events:[]},attributes:{}},n=[],r=xe(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=Ve(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ve(e){for(var t={eventStreamData:e},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:be,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ke(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Fe(s),f=d[0],p=d[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=ze(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Be(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:we,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ge(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ke(s),f=d[0],p=d[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=Ie(s);i.push(v)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Se,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Se,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Se,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:we,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:we,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:we,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:we,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:we,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:we,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:we,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var He=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=Ge(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=Ke(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(fe(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var p=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=p,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var v=e[e.length-1],h=t[t.length-1];return void 0!==v.repeatCount&&v.repeatCount<0?v.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):v.start+v.duration*(v.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=p.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if(" "===c)v[v.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&p.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),p.appendChild(y)}f.appendChild(p),d.appendChild(f),v.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,p=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=p.exec(e),f=v.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&(" "===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],p=0;p<d.length;p++){var v=(0,a.Z)(d[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},4123:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=v.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?p.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var I=t.unicodeBidi;if((0,l.Z)(I))switch(I){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var x=t.visibility;(0,l.Z)(x)&&(e.style.visibility=x),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):p.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):p.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=v.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=v.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):p.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):p.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):p.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,d.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],d=0;d<s.length;d++){var p=s[d];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,c.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function d(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,d=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,d),v=p.start,h=p.end,m=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var l=u.trim();u=l=l.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c:t)}}return i}return n(e,t)}(t,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=c[a];e.positionAlign=void 0===s?"":s;var d=l[a];e.lineAlign=void 0===d?"":d}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=d(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var c=n(5138),d=n(7714);var f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),p=parseInt(d[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,c.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,d.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=0;I<=g.length-1;I++){var x=g[I];if(x instanceof Element){var Z=x.getAttribute("xml:id");null!==Z&&function(){var e=(0,l.b)(x),t=x.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,l.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var D=y[C];if(D instanceof Element){var P=(0,u.Z)(D,"div"),N=(0,a.Z)({},R,(0,l.U)(f,[D].concat(P),b,A)),O=D.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:D,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return p},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return v},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,p,v,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return v.value+=y,p.setAttributeNode(v),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){p.appendChild(e)})),u.appendChild(d),d.appendChild(p),{start:n,end:r,element:u}}var I=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),p=0;p<d.length;p++){var v=(0,o.Z)(d[p],t);if(null!=v){var h=A(v,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return re}});var r=n(7874),i=n(8791),a=n(9589),o=n(4597),s=n(5278);function u(e,t,n,r){return t.segment.isInit||null===e?a.Z.resolve({resultType:"segment-created",resultData:null}):(0,o.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}function l(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var u=(0,s.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var c=n(8750),d=n(3887),f=n(1989),p=n(8026),v=n(3635);function h(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(s,u,l,h,m){var g,y=s.responseData,_=u.externalClockOffset,b=null!==(g=s.url)&&void 0!==g?g:u.originalUrl,T=null!=i?i:_,E={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:u.unsafeMode?u.previousManifest:null,url:b,referenceDateTime:n,externalClockOffset:T},S=r.Z.dashParsers;if(null===S.wasm||"uninitialized"===S.wasm.status||"failure"===S.wasm.status)return d.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),k();var w=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,v.tG)(e).buffer;if(e instanceof Document)return(0,v.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(y);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(w)?"initialized"===S.wasm.status?(d.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E))):(d.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),S.wasm.waitForInitialization().catch((function(){})).then((function(){return null===S.wasm||"initialized"!==S.wasm.status?(d.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),k()):(d.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E)))}))):(d.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),k());function k(){if(null===S.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,v.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(y);return A(S.js(e,E))}function A(t){if("done"===t.type)return t.value.warnings.length>0&&l(t.value.warnings),h.isCancelled?a.Z.reject(h.cancellationError):{manifest:new f.ZP(t.value.parsed,e),url:b};var n=t.value,r=n.urls.map((function(e){return m((function(){return"string"===n.format?(0,o.ZP)({url:e,responseType:"text",cancelSignal:h}):(0,o.ZP)({url:e,responseType:"arraybuffer",cancelSignal:h})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,p.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,p.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,c.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,p.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return a.Z.all(r).then((function(e){return n.format,A(n.continue(e))}))}}}var m=n(7839),g=n(5861),y=n(7757),_=n.n(y),b=n(6872),T=n(9105),E=n(5992),S=n(1946),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function A(){return"function"==typeof window.fetch&&!(0,S.Z)(k)&&!(0,S.Z)(w)}var I=n(8806),x=n(281);function Z(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var R=n(288),M=n(4460);function C(e){return function(t,n,r,i){return new a.Z((function(a,o){var s=new R.ZP,u=r.register((function(e){s.cancel(),o(e)}));function l(e){if((e instanceof Array||e instanceof Uint8Array)&&"mp4"===Z(n.adaptation.type,n.representation))try{(0,M.Z)(new Uint8Array(e),n.segment.isInit)}catch(e){u(),s.cancel(),o(e)}}e(t,n,s.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){l(e),s.isUsed||i.onNewChunk(e)}})).then((function(e){s.isUsed||(u(),"segment-loaded"===e.resultType&&l(e.resultData.responseData),a(e))}),(function(e){R.ZP.isCancellationError(e)||(u(),o(e))}))}))}}var D=n(6968);function P(e,t,n,r){if(void 0===t.range)return(0,o.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,o.ZP)({url:e,headers:{Range:(0,x.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,o.ZP)({url:e,headers:{Range:(0,x.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,o.ZP)({url:e,headers:{Range:(0,x.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),s=(0,o.ZP)({url:e,headers:{Range:(0,x.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return a.Z.all([i,s]).then((function(t){var n=t[0],r=t[1],i=(0,D.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var N=n(8766);function O(e,t,n,r){var i=t.segment,a=void 0!==i.range?{Range:(0,x.Z)(i.range)}:void 0,o=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}d.Z.debug("Fetch: Called with URL",e.url);var a=null,o=!1,s=performance.now(),u=(0,S.Z)(k)?null:new k;function l(){(0,S.Z)(u)?d.Z.warn("Fetch: AbortController API not available."):u.abort()}var c=(0,S.Z)(e.timeout)?b.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:e.timeout,f=window.setTimeout((function(){o=!0,l()}),c),p=e.cancelSignal.register((function(e){a=e,l()})),v={method:"GET"};return void 0!==t&&(v.headers=t),v.signal=(0,S.Z)(u)?null:u.signal,fetch(e.url,v).then((function(t){if((0,S.Z)(f)||clearTimeout(f),t.status>=300)throw d.Z.warn("Fetch: Request HTTP Error",t),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),a=0;return o();function o(){return u.apply(this,arguments)}function u(){return(u=(0,g.Z)(_().mark((function n(){var u,l,c,d,f;return _().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((u=n.sent).done||(0,S.Z)(u.value)){n.next=11;break}return a+=u.value.byteLength,l=performance.now(),c={url:t.url,currentTime:l,duration:l-s,sendingTime:s,chunkSize:u.value.byteLength,chunk:u.value.buffer,size:a,totalSize:r},e.onData(c),n.abrupt("return",o());case 11:if(!u.done){n.next=16;break}return p(),d=performance.now(),f=d-s,n.abrupt("return",{requestDuration:f,receivedTime:d,sendingTime:s,size:a,status:t.status,url:t.url});case 16:return n.abrupt("return",o());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==a)throw a;if(p(),o)throw d.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw d.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:a,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,N.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,D.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,N.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,D.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==o?(0,D.zo)(o,t):t),a=i[0];o=i[1];for(var s=0;s<a.length;s++)if(n.onNewChunk(a[s]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function L(e,t,n,r,i){if(t.segment.isInit)return P(e,t.segment,i,r);var a=Z(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(A())return O(e,t,r,i);(0,I.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var s=t.segment;return(0,o.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==s.range?{Range:(0,x.Z)(s.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),U=n(4644),F=408125543,z=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=W(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=j(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return V(e,t.slice(p+1,t.length),n,[d,f])}o=f}return null}function K(e,t){var n=V(2807729,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/q(e,n[0],r)}function G(e,t){var n=V(17545,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function H(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function W(e,t){var n=H(e,t);if(null==n)return d.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return d.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function j(e,t){var n=H(e,t);if(null==n)return d.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return d.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function q(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var Y=n(7403);function $(e,t,n,r){var i=(0,U.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,U.MM)(e);if(t||!n.complete)return void 0===s&&d.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function X(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,v.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function Q(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,u=n.segment,l=n.manifest,c=e.data,d=e.isChunked,f=[i.start,i.end];if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=c instanceof Uint8Array?c:new Uint8Array(c),v=Z(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,B.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!u.isInit){var y=h?$(p,d,u,r):null,_=(0,s.Z)(u.timestampOffset,0);if(h){var b=(0,U.s9)(p);if(void 0!==b){var T=X(b.filter((function(e){return void 0!==u.privateInfos&&void 0!==u.privateInfos.isEMSGWhitelisted&&u.privateInfos.isEMSGWhitelisted(e)})),l.publishTime);if(void 0!==T){var E=T.needsManifestRefresh,w=T.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:w,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var k=u.indexRange,A=null;if("webm"===v)A=function(e,t){var n=V(F,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=K(e,r);if(null==a)return null;var o=G(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=V(187,[],e,[l,s[1]]);if(null==c)break;var d=V(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=q(e,d[0],d[1]-d[0]),p=V(241,[183],e,[c[0],c[1]]);if(null==p)return null;var v=q(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(h&&(A=(0,U.Wf)(p,Array.isArray(k)?k[0]:0),!0===t&&null!==A&&A.length>0)){var I=A[A.length-1];Array.isArray(I.range)&&(I.range[1]=1/0)}o.index instanceof Y.Z&&null!==A&&A.length>0&&o.index.initializeIndex(A);var x=h?(0,U.LD)(p):"webm"===v?K(p,0):void 0,R=(0,S.Z)(x)?void 0:x;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:m,initTimescale:R}}}var J=n(6807);function ee(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):d.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,J.Le)(e);return null===t?"":(0,v.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function te(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?d.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration)),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function ne(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,u=n.representation,l=n.segment,c=e.data,d=e.isChunked;if(null===c)return l.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=l.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=Z(o.type,u);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,u=n.segment,l=u.isInit,c=u.indexRange,d="string"==typeof e?(0,v.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,U.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var h=(0,U.LD)(d);return o.index instanceof Y.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:h}}var m=$(d,t,u,r),g=ee(n,d,m,t),y=(0,s.Z)(u.timestampOffset,0);return{segmentType:"media",chunkData:g,chunkSize:d.length,chunkInfos:m,chunkOffset:y,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,v.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:te(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var re=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=h(e),s=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:C(r);function r(e,r,i,o){if(null==e)return a.Z.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return L(e,r,t,o,i);var s={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new a.Z((function(a,u){var l=!1,c=n(s,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new m.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),a({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),L(e,r,t,o,i).then(a,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),c=Q(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:s,parseSegment:c},video:{loadSegment:s,parseSegment:c},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:C(n);function n(e,n,r,i){var s=n.adaptation,u=n.representation,l=n.segment,c=l.range;if(null===e)return a.Z.resolve({resultType:"segment-created",resultData:null});if(l.isInit)return P(e,l,r,i);var d=Z(s.type,u),f="mp4"===d||void 0===d;if(t&&f){if(A())return O(e,n,i,r);(0,I.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return f?(0,o.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,x.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,o.ZP)({url:e,responseType:"text",headers:Array.isArray(c)?{Range:(0,x.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ne(e)},image:{loadSegment:u,parseSegment:l}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return ge}});var r=n(5861),i=n(7757),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(8999),d=n(7714),f=n(811),p=n(6968),v=n(6923),h=n(8026),m=n(9829),g=n(3635),y=n(5278),_=n(2689),b={};function T(e){if(null!=b[e])return b[e];var t=(0,g.tG)(e);return b[e]=t,t}function E(e,t){var n=t.length+8;return n<=_.s?(0,p.zo)((0,p.kh)(n),T(e),t):(0,p.zo)((0,p.kh)(1),T(e),(0,p.el)(n+8),t)}function S(e,t){return E(e,p.zo.apply(void 0,t))}function w(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,w(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,d.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),i.push(r)}else i.push(n)}))}))}))}))}var k=n(9689);function A(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,p.zo)([8,1,18,16],e)}]}function I(e,t){if(void 0===t&&(t=A),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,k.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,p.qb)(e,8),n=(0,g.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,g.wO)((0,k.K)(i));return(0,g.ci)(a).toLowerCase()}(r),a=(0,g.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var x=n(9362),Z=n(8232),R=n(3911),M=n(1091),C=n(5505);function D(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,R.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function P(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var L=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,R.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=O(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[P(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,R.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,R._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof x.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,R.jH)(o,null);if(!((0,R.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,R.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var p=f/c.duration-1,v=c.repeatCount-p;if(v<0)return;o.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,C.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)D(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),p=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,v.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:p,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var m=r("CodecPrivateData"),g=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==g&&void 0===F[g]||void 0===m)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,v.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==g?F[g]:g,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?F[k]:k,codecPrivateData:(0,y.Z)(w,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.rootURL,u=t.protections,l=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),T=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(c.r,S)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),I=r.getAttribute("Url"),x=null===I?"":I;var Z,R=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,C=R.cNodes,D={timeline:(Z=C,Z.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=Z[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,v.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:T};(0,f.Z)(0!==M.length,"Adaptation should have at least one playable representation.");var P=w+((0,v.Z)(A)?"_"+A:""),N=M.map((function(t){var n,r,i,a,s=(0,m.Z)(o,x),c={timeline:D.timeline,timescale:D.timescale,media:(n=s,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,v.Z)(t.mimeType)?t.mimeType:U[w],f=t.codecs,b=P+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(null!=f?f+"-":"")+String(t.bitrate),T=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){T.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new L(c,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:l}),I=(0,h.Z)({},t,{index:A,mimeType:d,codecs:f,id:b});if(T.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return E("pssh",(0,p.zo)([n,0,0,0],(0,g.nr)(e),(0,p.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var R=[{type:"cenc",values:Z}];I.contentProtections={keyIds:T,initData:R}}else I.contentProtections={keyIds:T,initData:[]}}return I}));if("ADVT"===k)return null;var O={id:P,type:w,representations:N,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(O.closedCaption=!0),O}return function(n,r,a){var s=(0,m.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,f,p=u.getAttribute("Timescale"),h=(0,v.Z)(p)?isNaN(+p)?1e7:+p:1e7,g=B(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(I(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,S,k,A,x,Z,R=_.reduce((function(e,t){var n=o({root:t,rootURL:s,timescale:h,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),M=null,C=void 0!==R.video?R.video[0]:void 0,D=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==C||void 0!==D){var P=[],N=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var L=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=L&&P.push(L),null!=U&&N.push(U)}}if(void 0!==D){var F=D.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),V=F.index.getLastPosition();null!=z&&P.push(z),null!=V&&N.push(V)}}P.length>0&&(x=Math.max.apply(Math,P)),N.length>0&&(Z=Math.min.apply(Math,N))}var K=u.getAttribute("Duration"),G=null!=K&&0!=+K?+K/h:void 0;b?(E=e.suggestedPresentationDelay,S=t,k=null!=x?x:S,A={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-S,time:performance.now()},M=null!=f?f:null):(k=null!=x?x:0,A={isLinear:!1,value:void 0!==Z?Z:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:A.value,j={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:M,maximumTimeData:A},periods:[{adaptations:R,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return w(j),j}},V=n(9589),K=n(4597),G=n(8806),H=n(4460),W=n(8791),j=n(4644),q=n(2297);function Y(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,q.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,p.pV)(t,16*a+5),o=(0,p.pV)(t,16*a+5+8)):(s=(0,p.pX)(t,8*a+5),o=(0,p.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,q.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,p.pV)(t,12),time:(0,p.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,j.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var $=n(3666);function X(e,t){return E("schm",(0,p.zo)(4,(0,g.tG)(e),(0,p.kh)(t)))}function Q(e){return E("frma",(0,g.tG)(e))}function J(e){var t=[7,[e.length]];return E("stsd",p.zo.apply(void 0,t.concat(e)))}function ee(e,t,n){return E("tenc",(0,p.zo)(6,[e,t],n))}function te(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(E("senc",i),function(e){if(0===e.length)return E("saiz",new Uint8Array(0));var t=(0,p.pX)(e,0),n=(0,p.pX)(e,4),r=new Uint8Array(n+9);r.set((0,p.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,p.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return E("saiz",r)}(i),function(e,t,n,r){return E("saio",(0,p.zo)(4,[0,0,0,1],(0,p.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),S("traf",a)}function ne(e,t){var n=(0,q.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,q.iz)(r,1835427940),a=(0,q.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,q.Qy)(a,1952868452),s=(0,q.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return E("tfdt",(0,p.zo)([1,0,0,0],(0,p.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,j.J6)(n)}(l,s[1]-s[0]),f=te(u,c,d,i,(0,q.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=S("moof",[i,f]),h=(0,q.Qy)(v,1836019558),m=(0,q.Qy)(f,1953653094),g=(0,q.Qy)(d,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,T=(0,q.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!$.YM&&(0===b||b<=-8)){var w=T[1];return v.set((0,p.kh)(w),y),e.set(v,n[0]),b<=-8&&e.set(E("free",new Uint8Array(-b-8)),v.length),e}var k=T[1]+b;v.set((0,p.kh)(k),y);var A=new Uint8Array(e.length+b),I=e.subarray(0,n[0]),x=e.subarray(n[2],e.length);return A.set(I,0),A.set(v,I.length),A.set(x,I.length+v.length),A}var re=n(7839),ie=n(281);function ae(e,t,n,r,i,a){var o,s,u,l=S("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),c=S("dinf",[function(e){return E("dref",(0,p.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),d=S("minf",[r,c,l]),f=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return E("hdlr",(0,p.zo)(8,(0,g.tG)(t),12,(0,g.tG)(n),1))}(t),v=S("mdia",[function(e){return E("mdhd",(0,p.zo)(12,(0,p.kh)(e),8))}(e),f,d]),h=S("trak",[function(e,t,n){return E("tkhd",(0,p.zo)((0,p.kh)(7),8,(0,p.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,p.XT)(e),2,(0,p.XT)(t),2))}(i,a,1),v]),m=S("mvex",[(o=1,E("trex",(0,p.zo)(4,(0,p.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return S("moov",[e,t,n])}(function(e,t){return E("mvhd",(0,p.zo)(12,(0,p.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,p.XT)(t+1)))}(e,1),m,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],E("ftyp",p.zo.apply(void 0,[(0,g.tG)(s),[0,0,0,1]].concat(u.map(g.tG)))));return(0,p.zo)(_,y)}function oe(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,f,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return E("avcC",(0,p.zo)([1,i,a,o,252|r,225],(0,p.XT)(e.length),e,[1],(0,p.XT)(t.length),t))}((0,g.nr)(l),(0,g.nr)(c),a);if(void 0===s){d=J([function(e,t,n,r,i,a,o){return E("avc1",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=S("schi",[ee(1,8,s)]),m=X("cenc",65536);d=J([function(e,t,n,r,i,a,o,s){return E("encv",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,S("sinf",[Q("avc1"),m,h]))])}return ae(e,"video",d,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var se=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function ue(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return E("esds",(0,p.zo)(4,[3,25],(0,p.XT)(e),[0,4,17,64,21],11,[5,2],(0,g.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&se.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,p.XT)(l))):a);return ae(e,"audio",function(){if(void 0===o)return J([function(e,t,n,r,i,a){return E("mp4a",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a))}(1,t,n,r,i,c)]);var e=S("schi",[ee(1,8,o)]),a=X("cenc",65536),s=S("sinf",[Q("mp4a"),a,e]);return J([function(e,t,n,r,i,a,o){return E("enca",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a,o))}(1,t,n,r,i,c,s)])}(),E("smhd",new Uint8Array(8)),0,0)}var le=/(\.isml?)(\?token=\S+)?$/,ce=/\?token=(\S+)/;function de(e,t){return(0,v.Z)(t)?e.replace(ce,"?token="+t):e.replace(ce,"")}function fe(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function pe(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,ie.Z)(o)}),(0,K.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!fe(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,H.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var ve=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a){var o=r.segment,s=r.manifest,u=r.period,l=r.adaptation,c=r.representation;if(o.isInit){if(void 0===o.privateInfos||void 0===o.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var d,f=o.privateInfos.smoothInitSegment,p=f.codecPrivateData,v=f.timescale,h=f.protection,m=void 0===h?{keyId:void 0,keySystems:void 0}:h;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(l.type){case"video":var g=c.width,y=void 0===g?0:g,_=c.height;d=oe(v,y,void 0===_?0:_,72,72,4,p,m.keyId);break;case"audio":var b=f.channels,T=void 0===b?0:b,E=f.bitsPerSample,S=void 0===E?0:E,w=f.packetSize,k=void 0===w?0:w,A=f.samplingRate;d=ue(v,T,S,k,void 0===A?0:A,p,m.keyId);break;default:0,d=new Uint8Array(0)}return V.Z.resolve({resultType:"segment-created",resultData:d})}if(null===e)return V.Z.resolve({resultType:"segment-created",resultData:null});var I={adaptation:l,manifest:s,period:u,representation:c,segment:o,transport:"smooth",url:e};return"function"!=typeof n?pe(e,r,a,i,t):new V.Z((function(o,s){var u=!1,l=n(I,{reject:function(e){var t,n,r;if(!u&&!i.isCancelled){u=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new re.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);s(l)}},resolve:function(e){if(!u&&!i.isCancelled){u=!0,i.deregister(c),fe(r.representation)&&!0===t||o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,H.Z)(n,r.segment.isInit),o({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||i.isCancelled||(u=!0,i.deregister(c),pe(e,r,a,i,t).then(o,s))},progress:function(e){u||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}i.register(c)}))}},he=/\.wsx?(\?token=\S+)?/;function me(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof L&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var ge=function(e){var t=z(e),n=ve(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?Y(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var p=f.nextSegments,v=f.chunkInfos,h=ne(c,f.scaledSegmentTime);return p.length>0&&me(o,p,a),{segmentType:"media",chunkData:h,chunkInfos:v,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return V.Z.resolve(void 0);var n;he.test(e)?((0,G.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,K.ZP)({url:de(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=V.Z.resolve(e);var r=function(e){var t=ce.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return de(function(e){return le.test(e)?((0,G.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(le,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,W.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:{loadSegment:function(t,n,r,i){var a=n.segment,o=n.representation;return a.isInit||null===t?V.Z.resolve({resultType:"segment-created",resultData:null}):fe(o)?(0,K.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:i.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,H.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,K.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,p=fe(c),v=c.mimeType,h=void 0===v?"":v,m=c.codec,y=void 0===m?"":m,_=e.data,b=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===_)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var T,E,S,w,k=null;if(p){var A;i=(A="string"==typeof _?(0,g.tG)(_):_ instanceof Uint8Array?_:new Uint8Array(_)).length;var I=void 0!==n?Y(A,b,n,d,o.isLive):null;a=null==I?void 0:I.nextSegments,null===(k=null!==(r=null==I?void 0:I.chunkInfos)&&void 0!==r?r:null)?b?s.Z.warn("Smooth: Unavailable time data for current text track."):(T=d.time,E=d.end):(T=k.time,E=void 0!==k.duration?k.time+k.duration:d.end);var x=y.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===x||"stpp.ttml.im1t"===x)w="ttml";else{if("wvtt"!==x)throw new Error("could not find a text-track parser for the type "+h);w="vtt"}var Z=(0,l.Le)(A);S=null===Z?"":(0,g.uR)(Z)}else{var R;if(T=d.time,E=d.end,"string"!=typeof _){var M=_ instanceof Uint8Array?_:new Uint8Array(_);i=M.length,R=(0,g.uR)(M)}else R=_;switch(h){case"application/x-sami":case"application/smil":w="sami";break;case"application/ttml+xml":w="ttml";break;case"text/vtt":w="vtt"}if(void 0===w){if("srt"!==y.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);w="srt"}S=R}return null!==k&&Array.isArray(a)&&a.length>0&&me(u,a,d),{segmentType:"media",chunkData:{type:w,data:S,start:T,end:E,language:f},chunkSize:i,chunkInfos:k,chunkOffset:null!=T?T:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,i){return(0,r.Z)(a().mark((function r(){var o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.segment.isInit&&null!==e){r.next=2;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 2:return r.next=4,(0,K.ZP)({url:e,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:n});case 4:return o=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:o});case 6:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(7904),i=n(4597),a=n(7839),o=n(9589);function s(e,t){var n=e.customManifestLoader,s=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?s:function(e,t){return function(n,r){return new o.Z((function(i,o){var s=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var s=e,l=null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.Z(l,null!==(n=null==s?void 0:s.canRetry)&&void 0!==n&&n,null!==(i=null==s?void 0:s.isOfflineError)&&void 0!==i&&i,null==s?void 0:s.xhr);o(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-s:void 0,n=void 0!==e.sendingTime?e.sendingTime-s:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,o))}});function c(e){u||(u=!0,"function"==typeof l&&l(),o(e))}r.register(c)}))}}(n,s)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,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];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{O_:function(){return p},QI:function(){return a},XT:function(){return u},_f:function(){return v},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9589);function i(e,t){return new r.Z((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946),s=n(9589);t.Z=function(e){return e instanceof r.y?e:e instanceof s.Z||e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(d.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(8720);function h(){return function(e){return e.pipe((0,v.R)(p))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return p},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return v},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function p(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(1480),i=n(3887);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(o)i.Z.error("Finished shared references cannot be updated");else if(t=e,0!==n.length)for(var r,s=a(n.slice());!(r=s()).done;){var u=r.value;try{u.hasBeenCleared||u.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!o){var i={trigger:e,complete:a,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(a)}function a(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete()}catch(e){}}}}}t.Z=s},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(6872),i=n(9105),a=n(6923),o=n(1946),s=n(9589);var u=function(e){var t=r.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT,n={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?t:e.timeout};return new s.Z((function(t,r){var s=e.onProgress,u=e.cancelSignal,l=n.url,c=n.headers,d=n.responseType,f=n.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=d,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(c)){var v=c;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var n,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,c=p.status,d=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;if(n="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,o.Z)(n))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));t({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:n})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return v},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var c=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(c),u=!0,s+=2}u||(t+=n[s])}}for(var d=new Uint8Array(t.length),f=0;f<t.length;f++)d[f]=255&t.charCodeAt(f);return d}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+c(u,4):"%"+c(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function p(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function v(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(){var e,t=(e=s.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this.isUsed=!1,this._trigger=n,this.signal=new l(r)}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},8555:function(e,t,n){"use strict";var r,i="pending",a="settled",o="fulfilled",s="rejected",u=function(){},l=void 0!==n.g&&void 0!==n.g.process&&"function"==typeof n.g.process.emit,c="undefined"==typeof setImmediate?setTimeout:setImmediate,d=[];function f(){for(var e=0;e<d.length;e++)d[e][0](d[e][1]);d=[],r=!1}function p(e,t){d.push([e,t]),r||(r=!0,c(f,0))}function v(e){var t=e.owner,n=t._state,r=t._data,i=e[n],a=e.then;if("function"==typeof i){n=o;try{r=i(r)}catch(e){y(a,e)}}h(a,r)||(n===o&&m(a,r),n===s&&y(a,r))}function h(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"==typeof t)){var r=t.then;if("function"==typeof r)return r.call(t,(function(r){n||(n=!0,t===r?g(e,r):m(e,r))}),(function(t){n||(n=!0,y(e,t))})),!0}}catch(t){return n||y(e,t),!0}return!1}function m(e,t){e!==t&&h(e,t)||g(e,t)}function g(e,t){e._state===i&&(e._state=a,e._data=t,p(b,e))}function y(e,t){e._state===i&&(e._state=a,e._data=t,p(T,e))}function _(e){e._then=e._then.forEach(v)}function b(e){e._state=o,_(e)}function T(e){e._state=s,_(e),!e._handled&&l&&n.g.process.emit("unhandledRejection",e._data,e)}function E(e){n.g.process.emit("rejectionHandled",e)}function S(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof S==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){y(t,e)}try{e((function(e){m(t,e)}),n)}catch(e){n(e)}}(e,this)}S.prototype={constructor:S,_state:i,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(u),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===s&&l&&p(E,this)),this._state===o||this._state===s?p(v,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},S.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new S((function(t,n){var r=[],i=0;function a(e){return i++,function(n){r[e]=n,--i||t(r)}}for(var o,s=0;s<e.length;s++)(o=e[s])&&"function"==typeof o.then?o.then(a(s),n):r[s]=o;i||t(r)}))},S.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new S((function(t,n){for(var r,i=0;i<e.length;i++)(r=e[i])&&"function"==typeof r.then?r.then(t,n):t(r)}))},S.resolve=function(e){return e&&"object"==typeof e&&e.constructor===S?e:new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},e.exports=S},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new x(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return R()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(Z([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function Z(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:R}}function R(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=Z,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),p=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),v=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return m}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(3102),c=n(278),d=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566),h=n(7845);function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.D)([],n);var v=new r.y(g(o,n,s?function(e){return p(s,e)}:c.y));return i?v.pipe((0,d.Z)(i)):v}function g(e,t,n){return void 0===n&&(n=c.y),function(r){y(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){y(t,(function(){var u=(0,l.D)(e[i],t),c=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function y(e,t,n){e?(0,h.f)(n,e,t):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var p=n(1764),v=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,p.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,v.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(v(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return p(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),p=n(5),v=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[v.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,p.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,p=0,v=!1,h=function(){!v||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,p++)).subscribe(new s.Q(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new s.Q(t,m,(function(){v=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=c(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return lr}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(3505),s=n(9127),u=n(3741),l=n(2817),c=n(7877),d=n(8515),f=n(1480),p=n(9917),v={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=v);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new f.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,p.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=n(2334),_=n(6108),b=n(6362),T=n(4978),E=n(3071),S=n(1545),w=n(6798),k=n(2566);var A=n(4727),I=n(4804);function x(){if(Z()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function Z(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var R=n(3666),M=n(3887);function C(){if(!R.vU)return!0;var e=function(){if(!R.vU)return M.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var D=n(6872),P=n(3714),N=n(8750),O=n(5992),L=n(7874),B=n(1989),U=n(4791),F=n(1959),z=n(1946),V=n(8026),K=n(9589),G=n(2829),H=n(5095),W=n(8806),j=n(5861),q=n(7757),Y=n.n(q),$=n(6139),X=n(770);function Q(e){return J.apply(this,arguments)}function J(){return(J=(0,j.Z)(Y().mark((function e(t){var n,r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=X.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return M.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,X.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,$.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e){var t=X.Z.getState(e);return null==t?null:t.keySystemOptions.type}function te(e){if(M.Z.info("DRM: Clearing-up DRM session."),R.fq)return M.Z.info("DRM: disposing current MediaKeys."),Q(e);var t=X.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(M.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(M.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),K.Z.resolve())}var ne=n(811),re=n(288),ie=n(9105),ae=n(9362);function oe(e){return e instanceof ie.Z?new ae.Z("PIPELINE_LOAD_ERROR",e):(0,N.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var se=n(7839),ue=n(9822),le=n(7864),ce=n(2572);function de(e){return e instanceof ie.Z?e.type===O.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===O.br.TIMEOUT||e.type===O.br.ERROR_EVENT:e instanceof se.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,ue.Z)(e)&&"INTEGRITY_ERROR"===e.code}function fe(e){return e instanceof ie.Z?e.type===O.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof se.Z&&e.isOfflineError}function pe(e){return fe(e)?2:1}function ve(e,t,n,r){if(r.isCancelled)return K.Z.reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(M.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),K.Z.reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,j.Z)(Y().mark((function e(n,p){var v,h,m,g,y,_,b,T;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!re.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(de(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(p,1),h=p>=d.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=pe(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(p<d.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,ce.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,(0,le.Z)(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function he(e,t,n){return ve([null],e,t,n)}function me(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ye=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new f.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new re.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:oe(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,ne.Z)(void 0!==i),he((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(oe(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return he((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new f.y((function(r){var i,a=performance.now(),o=new re.ZP,s=e.sendingTime,u=e.receivedTime,l=n._getBackoffSetting((function(e){r.next({type:"warning",value:oe(e)})})),c={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var d=n._pipelines.parseManifest(e,c,p,o.signal,(function(e){return f.apply(this,arguments)}));(i=d)instanceof K.Z||i instanceof Promise?d.then((function(e){return v(e.manifest)})).catch((function(e){o.isUsed||h(e,!0)})):v(d.manifest)}catch(e){if(o.isUsed)return;h(e,!0)}return function(){o.cancel()};function f(){return(f=(0,j.Z)(Y().mark((function e(t){var n;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,he(t,l,o.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),oe(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function p(e){for(var t,n=me(e);!(t=n()).done;){var r=t.value;if(o.isUsed)return;h(r,!1)}}function v(e){p(e.contentWarnings);var t=performance.now()-a;M.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:s,receivedTime:u,parsingTime:t}),r.complete()}function h(e,t){var n=(0,N.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=D.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var _e=n(5138),be=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new f.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,_e.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,_e.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void M.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,_e.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,_e.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)M.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,_e.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?M.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,_e.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Te=n(520),Ee=n(7714),Se=n(908),we=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),ke=(0,Se.Z)();var Ae=function(){function e(e,t){var n=D.Z.getCurrent(),r=n.MIN_CANCELABLE_PRIORITY,i=n.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new be({prioritySteps:{high:i,low:r}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=D.Z.getCurrent(),o=a.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,s=a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,u=a.INITIAL_BACKOFF_DELAY_BASE,l=a.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:o,maxRetryOffline:null!=r?r:s,baseDelay:i?u.LOW_LATENCY:u.REGULAR,maxDelay:i?l.LOW_LATENCY:l.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Ee.Z)(["audio","video"],e)?new we:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,Te.K)(e);return new f.y((function(u){var l,c,d,f=ke(),p=new re.ZP,v=[],h=0,m=!1,g={onProgress:function(e){var t;void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(M.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(M.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),ve(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,V.Z)({onRetry:function(e){u.next({type:"retry",value:oe(e)})}},r),p.signal).then((function(t){var r;if(M.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});M.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType?(d=t.resultData,b()):d=null,p.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){M.Z.debug("SF: Segment request failed",s),d=null,u.error(oe(e))})),function(){var e;void 0===d&&(M.Z.debug("SF: Segment request cancelled",s),d=null,p.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){v.push(!1);var r=v.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return v[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,v[r]=!0,b()),s}catch(e){throw(0,N.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,z.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&v.length>0&&v.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):M.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}();function Ie(e){return(0,w.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var xe=n(533);var Ze=n(8333),Re=n(2793),Me=n(5278),Ce=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}(),De=function(){function e(){var e=D.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ce(t),this._slowEWMA=new Ce(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<D.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=D.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=D.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ce(t),this._slowEWMA=new Ce(n),this._bytesSampled=0},e}(),Pe=n(2006),Ne=n(3428);function Oe(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var Le=function(){function e(e){this._levelsMap=Oe(e),this._bitrates=e,M.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return{bufferLevel:t,bitrate:e[n]}})))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,_e.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return M.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),Be=n(3274);function Ue(e){if(!(e.progress.length<5)){for(var t=new Ce(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function Fe(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var ze=function(){function e(e,t){var n=D.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=D.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l<c-f?!this._inStarvationMode&&d<=s.starvationGap?(M.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(M.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(M.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,p=Ue(c);if(void 0!==f&&void 0!==p){var v=Fe(f,p);if((d-f.timestamp)/1e3<=v&&v-u/o>2e3)return p}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(M.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position+r,a=(0,Be.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=Ue(a);if(void 0===s||void 0===u)return!0;var l=Fe(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Ve(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ke(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ge=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=He(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(M.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,_e.Z)(e,(function(e){return e.id===t.id}));if(n<0)return M.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=He(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Ve(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=Ue(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function He(e,t){var n=e.length,r=(0,_e.Z)(e,(function(e){return e.id===t.id}));if(r<0)return M.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var We=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),je=n(1679),qe=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):M.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&M.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,je.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),Ye=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new Ce(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(M.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function $e(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,_e.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Xe(e,t){var n=e;return null!=t.bitrate&&(n=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,_e.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,Me.Z)(e.width,0)-(0,Me.Z)(t.width,0)})),r=(0,Be.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(n,t.width)),n}function Qe(e){var t=e.bandwidthEstimator,n=e.observation$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,u=e.minAutoBitrate$,c=e.maxAutoBitrate$,d=e.representations,f=e.streamEvents$,v=new Ye,h=new ze(null==i?0:i,a),g=new qe;var b=f.pipe((0,m.h)((function(e){return"metrics"===e.type})),(0,Pe.b)((function(e){return function(e){var n=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(t.addSample(n,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,n/1e3,u)}}(e.value)})),(0,xe.l)()),S=f.pipe((0,Pe.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,xe.l)()),w=f.pipe((0,m.h)((function(e){return"representationChange"===e.type})),(0,s.U)((function(e){return e.value.representation})),(0,_.O)(null)),k=(0,p.P)((function(){if(0===d.length)throw new Error("ABRManager: no representation choice given");return 1===d.length?(0,l.of)({bitrate:void 0,representation:d[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,T.w)((function(e){if(e>=0){var i=$e(d,e,0,1/0);return(0,l.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var o=new We,p=!1,b=new Ge(v,o),T=f.pipe((0,m.h)((function(e){return"added-segment"===e.type})),(0,Ne.M)(n),(0,s.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,G.L7)(a,i),s=t.content.representation,u=v.getEstimate(s),l=null==u?void 0:u[0];return{bufferGap:o,currentBitrate:s.bitrate,currentScore:l,speed:r}}))),E=d.map((function(e){return e.bitrate})),S=new Le(E),k=T.pipe((0,s.U)((function(e){return S.getEstimate(e)})),(0,_.O)(void 0));return(0,y.a)([n,u,c,r,k]).pipe((0,Ne.M)(w),(0,s.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],c=e[1],f=r.bufferGap,m=r.liveGap,y=Xe(d,u),_=g.getRequests(),T=h.getBandwidthEstimate(r,t,c,_,o.bandwidth),E=T.bandwidthEstimate,S=T.bitrateChosen,w=v.getLastStableRepresentation(),k=null===w?void 0:w.bitrate/(r.speed>0?r.speed:1);p&&f<=5?p=!1:!p&&isFinite(f)&&f>10&&(p=!0);var A=$e(y,S,i,s),I=A.bitrate,x=null;p&&void 0!==l&&l>I&&(I=(x=$e(y,l,i,s)).bitrate);var Z=null;return a&&null!==c&&void 0!==m&&m<40&&(Z=b.getGuess(d,r,c,I,_)),null!==Z&&Z.bitrate>I?(M.Z.debug("ABR: Choosing representation with guess-based estimation.",Z.bitrate,Z.id),o.update(Z,E,2),{bitrate:E,representation:Z,urgent:null===c||Z.bitrate<c.bitrate,manual:!1,knownStableBitrate:k}):null!==x?(M.Z.debug("ABR: Choosing representation with buffer-based estimation.",x.bitrate,x.id),o.update(x,E,0),{bitrate:E,representation:x,urgent:h.isUrgent(x.bitrate,c,_,r),manual:!1,knownStableBitrate:k}):(M.Z.debug("ABR: Choosing representation with bandwidth estimation.",A.bitrate,A.id),o.update(A,E,1),{bitrate:E,representation:A,urgent:h.isUrgent(A.bitrate,c,_,r),manual:!1,knownStableBitrate:k})})))})))}));return(0,E.T)(b,S,k)}var Je=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,u=this._getBandwidthEstimator(e),c=(0,Me.Z)(null===(i=this._manualBitrates[e])||void 0===i?void 0:i.asObservable(),(0,l.of)(-1)),d=(0,Me.Z)(null===(a=this._minAutoBitrates[e])||void 0===a?void 0:a.asObservable(),(0,l.of)(0)),f=(0,Me.Z)(null===(o=this._maxAutoBitrates[e])||void 0===o?void 0:o.asObservable(),(0,l.of)(1/0)),p=(0,Me.Z)(this._initialBitrates[e],0);return Qe({bandwidthEstimator:u,streamEvents$:r,observation$:n,filters$:function(e,t,n){var r=[];null!=e&&r.push(e.pipe((0,s.U)((function(e){return{width:e}}))));null!=n&&r.push(n.pipe((0,s.U)((function(e){return{bitrate:e}}))));null!=t&&r.push(t.pipe((0,s.U)((function(e){return{bitrate:e}}))));return r.length>0?(0,y.a)(r).pipe((0,s.U)((function(e){return V.Z.apply(void 0,[{}].concat(e))}))):(0,l.of)({})}(this._throttlers.limitWidth[e],this._throttlers.throttleBitrate[e],this._throttlers.throttle[e]),initialBitrate:p,manualBitrate$:c,minAutoBitrate$:d,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){M.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new De;return this._bandwidthEstimators[e]=n,n}return t},e}(),et=n(5767),tt=n(3774),nt=n(6923),rt=I.ym;function it(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(M.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){M.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&M.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,et.Z)(e),null!==n)try{M.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){M.Z.warn("Init: Error while revoking the media source URL",e)}}function at(e){return function(e){return new f.y((function(t){if(null==tt.J)throw new P.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,nt.Z)(e.src)?e.src:null;it(e,null,n),M.Z.info("Init: Creating MediaSource");var r=new tt.J,i=URL.createObjectURL(r);return M.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){it(e,r,i)}}))}(e).pipe((0,c.z)((function(e){return rt(e).pipe((0,A.q)(1),(0,s.U)((function(){return e})))})))}var ot=n(8343);var st=n(9607),ut=n(3610),lt=n(6697),ct=n(2401);var dt=n(7904),ft=n(6968),pt=n(2870),vt=n(9612);var ht=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n;var u=D.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL;return(0,lt.F)(u).pipe((0,Pe.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,ct.R)(a._sourceBuffer,"error").pipe((0,Pe.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,ct.R)(a._sourceBuffer,"updateend").pipe((0,Pe.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return M.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,Te.K)(e.inventoryInfos)),this._addToQueue({type:vt.f.Push,value:e})},r.removeBuffer=function(e,t){return M.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:vt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return M.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,Te.K)(e)),this._addToQueue({type:vt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case vt.f.Push:case vt.f.Remove:case vt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){M.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new f.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,V.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==vt.f.Push||0===e.data.length){switch(e.type){case vt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case vt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case vt.f.Remove:this.synchronizeInventory();break;default:(0,dt.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==vt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,V.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,V.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case vt.f.EndOfSegment:return M.Z.debug("AVSB: Acknowledging complete segment",(0,Te.K)(this._pendingTask.value)),void this._flush();case vt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();M.Z.debug("AVSB: pushing segment",this.bufferType,(0,Te.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case vt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;M.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,dt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(M.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return M.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:M.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;M.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,ft._f)(s);this._lastInitSegment={data:u,hash:(0,pt.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,ft._f)(e);if((0,pt.Z)(n)===this._lastInitSegment.hash&&(0,U.Z)(t,n))return!0}return!1},n}(vt.C),mt=["audio","video","text","image"];function gt(e){return"audio"===e||"video"===e}var yt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return gt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==L.Z.nativeTextTracksBuffer&&null==L.Z.htmlTextTracksBuffer||e.push("text"),null!=L.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,l.of)(void 0):new f.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else M.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(gt(e)){if(null!=i)return i instanceof ht&&i.codec!==t?M.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):M.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;M.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new ht(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return M.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(M.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==L.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new L.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==L.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new L.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==L.Z.imageBuffer)throw new Error("Image buffer feature not activated");return M.Z.info("SB: Creating a new image SegmentBuffer"),r=new L.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw M.Z.error("SB: Unknown buffer type:",e),new P.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(M.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):M.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;mt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),_t=n(7878);function bt(e,t){return t?function(n){return n.pipe(bt((function(n,r){return(0,_t.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,w.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new k.Q(n,(function(t){i||(i=new k.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,_t.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Tt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,Be.Z)(this._array,e)},t.has=function(e){return(0,Ee.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Et=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),St=n(3102),wt=n(9834);function kt(e){var t=e.segmentBuffer,n=e.currentTime$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,y.a)([n,r,i]).pipe((0,c.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return S.E;var i=[],a=(0,G.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,St.D)(i.map((function(t){return M.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,wt.u)(),(0,xe.l)())}(t,n,r,i)})))}var At=n(8567),It=n(9878);function xt(e,t,n,r){return n.observe(!0).pipe((0,s.U)((function(i){var a,o=n.getCurrentTime()+r,s=Math.min(Math.max(e.start,o),null!==(a=e.end)&&void 0!==a?a:1/0);return At.Z.waitingMediaSourceReload(t,e,s,!i.isPaused)})))}var Zt=n(7473),Rt=n.n(Zt);var Mt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,p.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,T.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():S.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,T.w)((function(t){return null===t.initSegment?S.E:e._requestInitSegment(t.initSegment)})));return(0,E.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,l.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,V.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,c.z)((function(n){switch(n.type){case"retry":return(0,l.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return M.Z.info("Stream: segment request interrupted temporarly.",r),S.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,l.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,A.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,ne.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,V.Z)({},t,{type:"parsed-media",segment:r})})),Ie((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,dt.Z)(n)}})))};return(0,p.P)((function(){return n(t)})).pipe(Ie((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,S.E;var n=e.segment,r=e.priority,i=(0,V.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,l.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return M.Z.info("Stream: init segment request interrupted temporarly.",n),S.E;case"chunk":var r=e.parse(void 0);return(0,ne.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,b.z)((0,l.of)((0,V.Z)({},r,{type:"parsed-init",segment:n})),(0,p.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),S.E})));case"chunk-complete":return(0,l.of)({type:"end-of-segment",value:{segment:n}});case"ended":return S.E;default:(0,dt.Z)(e)}}))).pipe(Ie((function(){t._initSegmentRequest=null})))},e}();function Ct(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return M.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return M.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,p=i[d].bufferedStart;return M.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var v=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return M.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}function Dt(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.representation,c=function(e,t,n){var r=n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate/8e3*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-t.chunkSize/8e3:e}),r)}(t,s,u),d=function(e,t){var n=e.reduce((function(e,t){return e+(t.end-t.start)}),0),r=t.reduce((function(e,t){return e+t.segment.duration}),0);return n+r}(t,s),f=l.index.getSegments(o.start,o.end-o.start),p=t.filter((function(e){return!Nt(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=D.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return M.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return M.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;M.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){var r=D.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return M.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return M.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.end)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;M.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0})),v=D.Z.getCurrent(),h=v.MINIMUM_SEGMENT_SIZE,m=v.MIN_BUFFER_LENGTH,g=v.MIN_BUFFER_DISTANCE_BEFORE_CLEAN_UP,y=!1,_=Math.min(1/60,h),b=!1;return{neededSegments:f.filter((function(e){var t=(0,V.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,Te.z)(t,e)})))return!1;var a=e.duration,u=e.time,l=e.end;if(e.isInit)return!0;if(y&&u<o.start+g&&(b=!0),y&&d>m)return!1;if(e.complete&&a<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-_>u)&&(!(a.end+_<l)&&!Nt(e,t,r,i))})))return!1;for(var f=0;f<p.length;f++){var v=p[f];if(v.infos.period.id===n.period.id){var T=v.infos.segment;if(u-T.time>-_&&T.end-l>-_)return!1}}for(var E=0;E<p.length;E++){var S=p[E];if(S.end>u)return S.start>u+_||Pt(p,E).end<l-_}var w=a*n.representation.bitrate/8e3;return c-w<0&&d>m?(y=!0,!1):(c-=w,d+=a,!0)})),isBufferFull:b}}function Pt(e,t){for(var n=t+1,r=D.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function Nt(e,t,n,r){var i=D.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=D.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function Ot(e,t){for(var n=e-t,r=D.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Lt(e,t,n,r,i,a,o){var s,u=e.period,l=e.representation;o.synchronizeInventory();var c,d,f=t+i,p={start:Math.max(t,u.start),end:Math.min(f,null!==(s=u.end)&&void 0!==s?s:1/0)},v=l.index.shouldRefresh(t,f),h=o.getPendingOperations().filter((function(e){return e.type===vt.f.EndOfSegment})).map((function(e){return e.value})),m=function(e,t){for(var n=D.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(p.start-.5,0),end:p.end+.5},o.getInventory()),g=Dt({content:e,bufferedSegments:m,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:p,segmentsBeingPushed:h,maxBufferSize:a}),y=g.neededSegments,_=g.isBufferFull,b=y.map((function(e){return{priority:Ot(e.time,t),segment:e}})),T=l.index.getLastPosition();if(!l.index.isInitialized()||void 0===u.end||b.length>0)c=!1;else if(void 0===T)c=p.end>=u.end&&l.index.isFinished();else if(null===T)c=l.index.isFinished();else{var E=void 0!==u.end?Math.min(u.end,T):T;c=p.end>=E&&l.index.isFinished()}if(l.index.isInitialized()&&(l.index.areSegmentsChronologicallyGenerated()||c)){var S=null;h.length>0&&(S=Math.min.apply(Math,h.map((function(e){return e.segment.time})))),b.length>0&&(S=null!==S?Math.min(S,b[0].segment.time):b[0].segment.time),d=Ct(e,p,S,c,m)}else d=null;return{imminentDiscontinuity:d,hasFinishedLoading:c,neededSegments:b,isBufferFull:_,shouldRefreshManifest:v}}function Bt(e,t,n){for(var r=(0,G.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(M.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function Ut(e,t,n){var r=t.pushChunk(n);return r.pipe((0,It.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new P.Z("BUFFER_APPEND_ERROR",i)}return e.observe(!0).pipe((0,c.z)((function(e){var n,i,a=e.position+e.wantedTimeOffset;return(0,b.z)((n=a,i=t,(0,p.P)((function(){var e=D.Z.getCurrent().BUFFER_GC_GAPS.CALM,t=D.Z.getCurrent().BUFFER_GC_GAPS.BEEFY;M.Z.warn("Stream: Running garbage collector");var r=i.getBufferedRanges(),a=Bt(n,r,e);return 0===a.length&&(a=Bt(n,r,t)),M.Z.debug("Stream: GC cleaning",a),(0,St.D)(a.map((function(e){var t=e.start,n=e.end;return i.removeBuffer(t,n)}))).pipe((0,wt.u)())}))).pipe((0,xe.l)()),r).pipe((0,It.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new P.Z("BUFFER_FULL_ERROR",t)})))})))})))}var Ft=function(e){var t=e.content,n=e.options,r=e.playbackObserver,a=e.segmentBuffer,o=e.segmentFetcher,u=e.terminate$,d=t.period,f=t.adaptation,v=t.representation,h=n.bufferGoal$,m=n.maxBufferSize$,T=n.drmSystemId,I=n.fastSwitchThreshold$,x=f.type,Z={segment:v.index.getInitSegment(),segmentData:null,isLoaded:!1},R=new i.x,C=(0,H.$)({initSegment:null,segmentQueue:[]}),P=null!==Z.segment,N=new Mt(t,C,o,P);P||(Z.segmentData=null,Z.isLoaded=!0);var O=!1,L=S.E;if(void 0!==T){var B=v.getEncryptionData(T);B.length>0&&(L=l.of.apply(void 0,B.map((function(e){return At.Z.encryptionDataEncountered(e,t)}))),O=!0)}var U,F,z=N.start().pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,b.z)((0,l.of)({type:"warning",value:e.value.error}),(0,p.P)((function(){var t=e.value.segment,n=v.index;if(!1===n.isSegmentStillAvailable(t))R.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,l.of)(At.Z.manifestMightBeOufOfSync());return S.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Rt()((function(){R.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var n=v.getAllEncryptionData(),i=!O&&n.length>0?l.of.apply(void 0,n.map((function(e){return At.Z.encryptionDataEncountered(e,t)}))):S.E,o=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,p.P)((function(){if(null===i)return S.E;var e=n.representation.getMimeTypeString();return Ut(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return At.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:a});return(0,E.T)(i,o)}var u=e.inbandEvents,c=e.needsManifestRefresh,d=e.protectionDataUpdate&&!O?l.of.apply(void 0,v.getAllEncryptionData().map((function(e){return At.Z.encryptionDataEncountered(e,t)}))):S.E,f=!0===c?(0,l.of)(At.Z.needsManifestRefresh()):S.E,h=void 0!==u&&u.length>0?(0,l.of)({type:"inband-events",value:u}):S.E,m=Z.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,p.P)((function(){var e,u;if(null===i.chunkData)return S.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,p=i.appendWindow,v=n.representation.getMimeTypeString(),h=D.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==p[0]?Math.max(0,p[0]-h.START):void 0,void 0!==p[1]?p[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:v},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,V.Z)({segment:a,chunkSize:f,start:y,end:_},n);return Ut(t,o,{data:g,inventoryInfos:b}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return At.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:a});return(0,b.z)(d,f,h,g)}(e);case"end-of-segment":var n=e.value.segment;return a.endOfSegment((0,V.Z)({segment:n},t)).pipe((0,xe.l)());case"end-of-queue":return R.next(),S.E;default:(0,dt.Z)(e)}}))),K=(0,y.a)([r.observe(!0),h,m,u.pipe((0,A.q)(1),(0,_.O)(null)),R.pipe((0,_.O)(void 0))]).pipe((0,Ne.M)(I),(0,c.z)((function(e){var n=e[0],i=n[0],o=n[1],s=n[2],u=n[3],c=e[1],f=i.position+i.wantedTimeOffset,p=Lt(t,f,r,c,o,s,a),h=p.neededSegments,m=null;if(v.index.isInitialized()){if(h.length>0&&!Z.isLoaded&&null!==Z.segment){var g=h[0].priority;m={segment:Z.segment,priority:g}}}else if(null===Z.segment)M.Z.warn("Stream: Uninitialized index without an initialization segment");else if(Z.isLoaded)M.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var y=i.position+i.wantedTimeOffset;m={segment:Z.segment,priority:Ot(d.start,y)}}if(null===u)C.setValue({initSegment:m,segmentQueue:h});else{if(u.urgent)return M.Z.debug("Stream: Urgent switch, terminate now.",x),C.setValue({initSegment:null,segmentQueue:[]}),C.finish(),(0,l.of)(At.Z.streamTerminating());var _=h[0],T=N.getRequestedInitSegment(),E=N.getRequestedMediaSegment(),w=null===E||void 0===_||E.id!==_.segment.id?[]:[_],k=null===T?null:m;if(C.setValue({initSegment:k,segmentQueue:w}),0===w.length&&null===k)return M.Z.debug("Stream: No request left, terminate",x),C.finish(),(0,l.of)(At.Z.streamTerminating())}var A=(0,l.of)({type:"stream-status",value:{period:d,position:i.position,bufferType:x,imminentDiscontinuity:p.imminentDiscontinuity,hasFinishedLoading:p.hasFinishedLoading,neededSegments:p.neededSegments}}),I=S.E,R=D.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(p.isBufferFull){var P=Math.max(0,f-R);I=a.removeBuffer(0,P).pipe((0,xe.l)())}return p.shouldRefreshManifest?(0,b.z)((0,l.of)(At.Z.needsManifestRefresh()),A,I):(0,b.z)(A,I)})),(U=function(e){return"stream-terminating"!==e.type},void 0===(F=!0)&&(F=!1),(0,w.e)((function(e,t){var n=0;e.subscribe(new k.Q(t,(function(e){var r=U(e,n++);(r||F)&&t.next(e),!r&&t.complete()})))}))));return(0,E.T)(K,z,L).pipe((0,g.B)())};var zt=function(e){var t=e.abrManager,n=e.playbackObserver,r=e.content,a=e.options,o=e.segmentBuffer,d=e.segmentFetcherCreator,f=e.wantedBufferAhead,v=e.maxVideoBufferSize,h="direct"===a.manualBitrateSwitchingMode,y=r.manifest,_=r.period,w=r.adaptation,k={},I=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x;return{estimator$:(0,E.T)((0,F.R)(r,"decipherabilityUpdate"),(0,l.of)(null)).pipe((0,s.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new P.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,T.w)((function(e){return t.get$(a.type,e,n,o)}))),abrFeedbacks$:o}}(r,t,n.observe(!0)),x=I.estimator$,Z=I.abrFeedbacks$,R=d.createSegmentFetcher(w.type,{onRequestBegin:function(e){Z.next({type:"requestBegin",value:e})},onRequestEnd:function(e){Z.next({type:"requestEnd",value:e})},onProgress:function(e){Z.next({type:"progress",value:e})},onMetrics:function(e){Z.next({type:"metrics",value:e})}}),C=(0,H.$)(null),O=x.pipe((0,Pe.b)((function(e){C.setValue(e)})),(0,Ze.Z)(),(0,g.B)()),L=O.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return M.Z.debug("Stream: new "+w.type+" bitrate estimate",t),At.Z.bitrateEstimationChange(w.type,t)}))),B=O.pipe(bt((function(e,t){return U(e,0===t)})));return(0,E.T)(B,L);function U(e,t){var r=e.representation;if(h&&e.manual&&!t){var i=D.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return xt(_,w.type,n,i.bitrateSwitch)}var o=C.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,A.q)(1),(0,s.U)((function(e){return null===e?(M.Z.info("Stream: urgent Representation termination",w.type),{urgent:!0}):e.urgent?(M.Z.info("Stream: urgent Representation switch",w.type),{urgent:!0}):(M.Z.info("Stream: slow Representation switch",w.type),{urgent:!1})}))),d=a.enableFastSwitching?C.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,l.of)(0),f=(0,l.of)(At.Z.representationChange(w.type,_,r));return(0,b.z)(f,z(r,o,d)).pipe((0,Pe.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,c.z)((function(e){if("stream-terminating"===e.type){var t=C.getValue();return null===t?S.E:U(t,!1)}return(0,l.of)(e)})))}function z(e,t,r){return(0,p.P)((function(){var i=k[e.id],u=null!=i?i:1;k[e.id]=u;var c=f.asObservable().pipe((0,s.U)((function(e){return e*u}))),d="video"===w.type?v.asObservable():(0,l.of)(1/0);return M.Z.info("Stream: changing representation",w.type,e.id,e.bitrate),Ft({playbackObserver:n,content:{representation:e,adaptation:w,period:_,manifest:y},segmentBuffer:o,segmentFetcher:R,terminate$:t,options:{bufferGoal$:c,maxBufferSize$:d,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,It.K)((function(n){var i=(0,N.Z)(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=f.getValue(),o=u;if(o<=.25||a*o<=2)throw i;return k[e.id]=o-.25,z(e,t,r)}throw i})))}))}};function Vt(e,t,n,r){var i=r.period,a=!1,o=t.asObservable(),s=e.observe(!0);return(0,y.a)([s,o]).pipe((0,c.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(M.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,l.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var Kt=n(9252);var Gt=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,Be.Z)(i,(function(e){return(0,Kt.Z)(e,"codecs=")})),l=(0,Be.Z)(s,(function(e){return(0,Kt.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function Ht(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return Gt(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,G.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,G.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,G.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,G.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return Gt(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,G.A1)(d,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=D.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,_=y[g].before;null==_&&(_=0);var b=y[g].after;if(null==b&&(b=0),v||h.push({start:p-_,end:p+b}),void 0!==t.end){var T=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==T&&(void 0===T.bufferedStart||T.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var E=(0,G.uH)(f,h);return 0===E.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:E}:{type:"clean-buffer",value:E}}var Wt=function(e){var t=e.abrManager,n=e.bufferType,r=e.content,i=e.garbageCollectors,o=e.playbackObserver,u=e.segmentFetcherCreator,d=e.segmentBuffersStore,f=e.options,v=e.wantedBufferAhead,h=e.maxVideoBufferSize,m=r.period,g=new a.t(1);return g.pipe((0,T.w)((function(e,a){var g=D.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===a?0:"audio"===n?g.trackSwitch.audio:"video"===n?g.trackSwitch.video:g.trackSwitch.other;if(null===e){M.Z.info("Stream: Set no "+n+" Adaptation. P:",m.start);var _,T=d.getStatus(n);if("initialized"===T.type){if(M.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),yt.isNative(n))return xt(m,n,o,0);_=T.value.removeBuffer(m.start,null==m.end?1/0:m.end)}else"uninitialized"===T.type&&d.disableSegmentBuffer(n),_=(0,l.of)(null);return(0,b.z)(_.pipe((0,s.U)((function(){return At.Z.adaptationChange(n,null,m)}))),Vt(o,v,n,{period:m}))}if(yt.isNative(n)&&"disabled"===d.getStatus(n).type)return xt(m,n,o,y);M.Z.info("Stream: Updating "+n+" adaptation","A: "+e.id,"P: "+m.start);var w=(0,p.P)((function(){var a=o.getReadyState(),p=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return M.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(d,n,e,f),g={currentTime:o.getCurrentTime(),readyState:a},_=Ht(p,m,e,g,f);if("needs-reload"===_.type)return xt(m,n,o,y);var T="flush-buffer"===_.type?(0,l.of)(At.Z.needsBufferFlush()):S.E,w="clean-buffer"===_.type||"flush-buffer"===_.type?b.z.apply(void 0,_.value.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n)}))).pipe((0,xe.l)()):S.E,k=i.get(p),A=function(e,i){var a=r.manifest,c=function(e,t){return e.deriveReadOnlyObserver((function(e){return e.pipe((0,s.U)(n))}),n);function n(e){var n=t.getBufferedRanges();return(0,V.Z)({},e,{bufferGap:(0,G.L7)(n,e.position)})}}(o,i);return zt({abrManager:t,content:{manifest:a,period:m,adaptation:e},options:f,playbackObserver:c,segmentBuffer:i,segmentFetcherCreator:u,wantedBufferAhead:v,maxVideoBufferSize:h}).pipe((0,It.K)((function(e){if(!yt.isNative(n)){M.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),d.disposeSegmentBuffer(n);var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,b.z)((0,l.of)(At.Z.warning(t)),Vt(o,v,n,{period:m}))}throw M.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,p);return d.waitForUsableBuffers().pipe((0,c.z)((function(){return(0,b.z)(w,T,(0,E.T)(A,k))})))}));return(0,b.z)((0,l.of)(At.Z.adaptationChange(n,e,m)),w)})),(0,_.O)(At.Z.periodStreamReady(n,m,g)))},jt=n(3074);function qt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,_.O)(!1),(0,u.x)())}));return(0,y.a)(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var Yt=function(e,t,n,r,a,d){var f,v,h=e.manifest,T=e.initialPeriod,w=d.maxBufferAhead,k=d.maxBufferBehind,I=d.wantedBufferAhead,x=d.maxVideoBufferSize,Z=D.Z.getCurrent(),R=Z.MAXIMUM_MAX_BUFFER_AHEAD,C=Z.MAXIMUM_MAX_BUFFER_BEHIND,N=new Et((function(e){var n=e.bufferType,r=null!=C[n]?C[n]:1/0,i=null!=R[n]?R[n]:1/0;return kt({segmentBuffer:e,currentTime$:t.observe(!0).pipe((0,s.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:k.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:w.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),O=t.observe(!0).pipe((0,Re.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<h.getMinimumPosition()){var r=new P.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return At.Z.warning(r)}if(n>h.getMaximumPosition()){var i=new P.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return At.Z.warning(i)}return null}),null)),L=r.getBufferTypes().map((function(e){return function(e,n){var a=new Tt((function(e,t){return e.start-t.start})),o=new i.x,u=!1;function d(t){return V(e,t,o).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return At.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return At.Z.needsMediaSourceReload(r,i);case"periodStreamReady":u=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,g.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var v=t.observe(!0).pipe((0,Re.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!u||!f(a))return null;var s=null!==(n=h.getPeriodForTime(a))&&void 0!==n?n:h.getNextPeriod(a);return void 0===s?null:(M.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),u=!1,o.next(),s)}),null),(0,c.z)((function(e){if(null==e)throw new P.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(e)}))),m=(0,F.R)(h,"decipherabilityUpdate").pipe((0,c.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return S.E;var s=a.filter((function(e){return!1===e.representation.decipherable})),f=i.value,v=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){M.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(f,s);return 0===v.length?S.E:(u=!1,o.next(),b.z.apply(void 0,v.map((function(e){var t=e.start,n=e.end;return f.removeBuffer(t,n).pipe((0,xe.l)())})).concat([t.observe(!0).pipe((0,A.q)(1),(0,c.z)((function(e){return(0,b.z)((0,l.of)(At.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,p.P)((function(){var t=e.position+e.wantedTimeOffset,n=h.getPeriodForTime(t);if(null==n)throw new P.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(n)})))})))])))})));return(0,E.T)(v,m,d(n))}(e,T).pipe((0,Ze.Z)(),(0,g.B)())})),B=(f=L,v=f.length,E.T.apply(void 0,f).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,jt.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===v&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return M.Z.info("Stream: New active period",e.start),At.Z.activePeriodChanged(e)}))),U=(0,F.R)(h,"manifestUpdate").pipe((0,s.U)((function(){return h.isLastPeriodKnown})),(0,_.O)(h.isLastPeriodKnown),(0,u.x)()),z=(0,y.a)([qt.apply(void 0,L),U]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?At.Z.endOfStream():At.Z.resumeStream()})));return E.T.apply(void 0,L.concat([B,z,O]));function V(e,s,u){M.Z.info("SO: Creating new Stream for",e,s.start);var f=new i.x,p=new i.x,v=t.observe(!0).pipe((0,m.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),y=f.pipe(bt((function(t){return V(e,t,p)}))),_=u.pipe((0,A.q)(1),(0,Pe.b)((function(){f.complete(),p.next(),p.complete()})),(0,g.B)()),T=(0,E.T)(v,_),S=Wt({abrManager:n,bufferType:e,content:{manifest:h,period:s},garbageCollectors:N,segmentFetcherCreator:a,segmentBuffersStore:r,options:d,playbackObserver:t,wantedBufferAhead:I,maxVideoBufferSize:x}).pipe((0,c.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=h.getPeriodAfter(s);if(null===n)return(0,b.z)((0,l.of)(t),(0,l.of)(At.Z.streamComplete(e)));f.next(n)}else p.next();return(0,l.of)(t)})),(0,g.B)()),w=(0,b.z)(S.pipe((0,o.R)(T)),(0,l.of)(At.Z.periodStreamCleared(e,s)).pipe((0,Pe.b)((function(){M.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,E.T)(w,y,_.pipe((0,xe.l)()))}};function $t(e,t,n){return function(e){return(0,E.T)((0,I.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,I.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,I.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,_.O)("open"===e.readyState),(0,u.x)())}(e).pipe((0,T.w)((function(t){return t?function(e){if(0===e.length)return(0,l.of)(void 0);for(var t=[],n=function(n){var r=e[n];t.push((0,E.T)((0,ct.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,ct.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,lt.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,_.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return(0,y.a)(t).pipe((0,m.h)((function(e){return e.every((function(e){return!e}))})),(0,s.U)((function(){})))}(e.sourceBuffers):S.E})),(0,A.q)(1),(0,s.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(M.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,It.K)((function(e){return M.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,l.of)(null)})))}var Xt=n(5039),Qt=Array.isArray;function Jt(e){return 1===e.length&&Qt(e[0])?e[0]:e}function en(e){return function(t){for(var n=[],r=function(r){n.push((0,_t.Xf)(e[r]).subscribe(new k.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var tn=n(5987);var nn=I.gg,rn=I.ym,an=I._E;function on(e){return(0,p.P)((function(){if(M.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return M.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,l.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return M.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,l.of)(null);M.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return an(e).pipe((0,A.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Jt(e)).length?(0,_t.Xf)(e[0]):new f.y(en(e))}(E.T.apply(void 0,i).pipe((r=1,r<=0?function(){return S.E}:(0,w.e)((function(e,t){var n=[];e.subscribe(new k.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,tn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),nn(t).pipe((0,A.q)(1))).pipe((0,c.z)((function(){return on(e)})))}))}var sn=n(7920),un=n(467);var ln=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var cn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(ln(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function dn(e){return void 0!==e.end}var fn=function(e,t,n){var r=new WeakMap,i=[];return(0,F.R)(e,"manifestUpdate").pipe((0,_.O)(null),(0,jt.R)((function(t){return cn(t,e)}),[])).pipe((0,Pe.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,T.w)((function(e){if(!e)return S.E;var a=D.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL;return(0,y.a)([(0,lt.F)(a).pipe((0,_.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,w.e)((function(e,t){var n,r=!1;e.subscribe(new k.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,c.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],c=0;c<e.length;c++){var d=e[c],f=d.start,p=dn(d)?d.end:void 0;r.has(d)?(f>o||void 0!==p&&o>=p)&&(dn(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),dn(d)&&u.push(d.publicEvent)))}return(0,b.z)(s.length>0?l.of.apply(void 0,s):S.E,u.length>0?l.of.apply(void 0,u).pipe((0,Pe.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,xe.l)()):S.E)}(i,t,n)})))})))},pn=n(2983);function vn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.abrManager,d=e.playbackObserver,f=e.segmentFetcherCreator;return function(e,v,h){var g,b=function(e,t){return(0,p.P)((function(){var n;return $t(t,e).pipe((0,c.z)((function(r){return null!==r&&(n=r),(0,F.R)(e,"manifestUpdate").pipe((0,T.w)((function(){return $t(t,e,n)})),(0,Pe.b)((function(e){null!==e&&(n=e)})))})),(0,xe.l)())}))}(n,e),w=null!==(g=n.getPeriodForTime(v))&&void 0!==g?g:n.getNextPeriod(v);if(void 0===w){var k=new P.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,ut._)((function(){return k}))}var A=new yt(t,e),I=(0,sn.Z)({mediaElement:t,playbackObserver:d,startTime:v,mustAutoPlay:h}),x=I.seekAndPlay$,Z=I.initialPlayPerformed,R=I.initialSeekPerformed,C=d.observe(!0),D=Z.asObservable().pipe((0,m.h)((function(e){return e})),(0,c.z)((function(){return fn(n,t,C)}))),N=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,u=n.startTime;return t.deriveReadOnlyObserver((function(t){return(0,y.a)([t,o.asObservable()]).pipe((0,s.U)((function(t){var n=t[0],o=t[1];return{liveGap:e.isLive?e.getMaximumPosition()-n.position:void 0,position:n.position,duration:n.duration,isPaused:i.getValue()?n.paused:!r,readyState:n.readyState,speed:o,wantedTimeOffset:a.getValue()?0:u-n.position}})))}))}(n,d,{autoPlay:h,initialPlayPerformed:Z,initialSeekPerformed:R,speed:r,startTime:v}),O=new i.x,L=new i.x,B=new i.x,U=Yt({manifest:n,initialPeriod:w},N,u,A,f,a).pipe((0,c.z)((function(t){switch(t.type){case"end-of-stream":return M.Z.debug("Init: end-of-stream order received."),function(e){return rn(e).pipe((0,_.O)(null),(0,T.w)((function(){return on(e)})))}(e).pipe((0,xe.l)(),(0,o.R)(O));case"resume-stream":return M.Z.debug("Init: resume-stream order received."),O.next(null),S.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return L.next({period:r,bufferType:i,discontinuity:a,position:s}),S.E;case"locked-stream":return B.next(t.value),S.E;default:return(0,l.of)(t)}}))),z=(0,pn.Z)(t,r,C).pipe((0,xe.l)()),V=(0,un.Z)(d,n,B,L),K=x.pipe((0,T.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,Xt.Z)(C,t,A,!1)})));return(0,E.T)(b,K,z,V,U,D).pipe(Ie((function(){A.disposeAll()})))}}var hn=n(6625);function mn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,u=(t=function(e,t){return i.fetch(e).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new f.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),d=r.manifest,v=0;return(0,p.P)((function(){return h(r)}));function h(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,u=D.Z.getCurrent(),f=u.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,p=u.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,g=v>0?v<f:void 0!==i&&i>=p,y=void 0===t?0:performance.now()-t,_=Math.max(a-y,0),b=o.pipe((0,c.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&g;return gn(null!=r?r:0,a,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),T=null===d.expired?S.E:(0,hn.H)(_).pipe((0,c.z)((function(){return null===d.expired?S.E:(0,St.D)(d.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:g}}))),w=function(){if(void 0===d.lifetime||d.lifetime<0)return S.E;var e,t=1e3*d.lifetime-y;void 0===i?e=t:d.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-y,Math.max(t,0)+i),6*t),M.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*d.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),M.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,hn.H)(Math.max(e,_)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:g}})))}();return(0,E.T)(w,b,T).pipe((0,A.q)(1),(0,c.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):h(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=d.updateUrl,i=t||void 0===r,o=i?d.getUrl():r,s=d.clockOffset;return n?(v+=1,M.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(v)+" consecutive time.")):v>0&&(M.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(v)+" consecutive times."),v=0),u(o,{externalClockOffset:s,previousManifest:d,unsafeMode:n}).pipe((0,c.z)((function(e){if("warning"===e.type)return(0,l.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)d.replace(t);else try{d.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return M.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),gn(D.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,a,n).pipe((0,c.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,l.of)({type:"parsed",manifest:d,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function gn(e,t,n){return(0,p.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,hn.H)(Math.max(e-r,i))}))}var yn=n(2447);var _n=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,a=e.keySystems,u=e.lowLatencyMode,f=e.manifest$,p=e.manifestFetcher,v=e.mediaElement,h=e.minimumManifestUpdateInterval,b=e.playbackObserver,S=e.segmentFetcherCreator,w=e.speed,k=e.startAt,I=e.textTrackOptions,x=new Je(t),Z=at(v).pipe((0,d.d)({refCount:!0})),R=new i.x,C=(0,st.Z)(v,a,R,Z).pipe((0,Ze.Z)(),(0,g.B)()),P=(0,yn.Z)(v),N=C.pipe((0,m.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,A.q)(1)),O=(0,y.a)([f,N]).pipe((0,c.z)((function(e){var t=e[0],a=e[1],d=a.drmSystemId,f=a.mediaSource;if("warning"===t.type)return(0,l.of)(t);var m=t.manifest;M.Z.debug("Init: Calculating initial time");var g=function(e,t,n){if(null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return M.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){M.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){M.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){M.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){M.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var c=e.getMinimumPosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition(),h=D.Z.getCurrent().DEFAULT_LIVE_GAP;if(null==p)M.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=v;else{M.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=null==e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+p)/1e3-m;d=Math.min(v,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return M.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return M.Z.info("Init: starting at the minimum available position:",c),c}(m,u,k);M.Z.debug("Init: Initial time calculated:",g);var y=vn({abrManager:x,bufferOptions:(0,V.Z)({textTrackOptions:I,drmSystemId:d},r),manifest:m,mediaElement:v,playbackObserver:b,segmentFetcherCreator:S,speed:w}),A=function e(t,n,r){var a=new i.x,s=y(t,n,r).pipe((0,Re.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return Z.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=D.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return Z.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=ee(v);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?b.setCurrentTime(v.currentTime+.001):b.setCurrentTime(r),null;case"encryption-data-encountered":return R.next(e.value),null;case"needs-buffer-flush":return b.setCurrentTime(v.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,T.w)((function(t){return at(v).pipe((0,c.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,_.O)(ot.Z.reloadingMediaSource()))})));return(0,E.T)(u,s)}(f,g,n),Z=new i.x,C=mn({initialManifest:t,manifestFetcher:p,minimumManifestUpdateInterval:h,scheduleRefresh$:Z}),P=(0,E.T)((0,F.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return ot.Z.manifestUpdate()}))),(0,F.R)(m,"decipherabilityUpdate").pipe((0,s.U)(ot.Z.decipherabilityUpdate)));return(0,E.T)(P,C,A).pipe((0,_.O)(ot.Z.manifestReady(m)),Ie((function(){Z.complete()})))})));return(0,E.T)(O,P,C.pipe((0,xe.l)()))};var bn="STOPPED",Tn="LOADED",En="LOADING",Sn="PLAYING",wn="PAUSED",kn="ENDED",An="BUFFERING",In="SEEKING",xn="RELOADING";var Zn=n(5553);function Rn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cn=["canplay","play","seeking","seeked","loadedmetadata","ratechange"],Dn=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._lastObservation=null,this._observation$=null}var t=e.prototype;return t.getCurrentTime=function(){return this._mediaElement.currentTime},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.observe=function(e){var t=this;return(0,p.P)((function(){return null===t._observation$||null===t._lastObservation?(t._lastObservation=t._generateInitialObservation(),t._observation$=t._createInnerObservable().pipe((0,g.B)()),t.observe(e)):e?t._observation$.pipe((0,_.O)(t._lastObservation)):t._observation$}))},t.deriveReadOnlyObserver=function(e){return On(this,e)},t._createInnerObservable=function(){var e=this;return(0,p.P)((function(){var t=D.Z.getCurrent(),n=t.SAMPLING_INTERVAL_MEDIASOURCE,r=t.SAMPLING_INTERVAL_LOW_LATENCY,i=t.SAMPLING_INTERVAL_NO_MEDIASOURCE,a=function(t){var n,r=t;"seeking"===r&&e._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",e._internalSeekingEventsIncomingCounter-=1);var i=null!==(n=e._lastObservation)&&void 0!==n?n:e._generateInitialObservation(),a=Nn(e._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=D.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,p=t.paused,v=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=D.Z.getCurrent().REBUFFERING_GAP,i=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=r[i]}(d,f,o),b=v>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c<=E?(r=!0,T=l+c):c===1/0&&(r=!0,T=l);else if(null!==m){var S=Pn(m,o);!0!==r&&null!==m&&v>1&&(_||h||c<1/0&&c>S)?i=!0:(c===1/0||c<=S)&&(T=c===1/0?l:l+c)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&c===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||c<1/0&&(c>Pn(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(i,a,{lowLatencyMode:e._lowLatencyMode,withMediaSource:e._withMediaSource}),u=function(e,t){var n=D.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,V.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return M.Z.debug("API: current media element state",l),l},o=Cn.map((function(t){return(0,ct.R)(e._mediaElement,t).pipe((0,s.U)((function(){return t})))})),u=e._lowLatencyMode?r:e._withMediaSource?n:i,l=(0,lt.F)(u).pipe((0,s.U)((function(){return"timeupdate"})));return E.T.apply(void 0,[l].concat(o)).pipe((0,s.U)((function(t){var n=a(t);return"DEBUG"===M.Z.getLevel()&&M.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e._lastObservation=n,n})))}))},t._generateInitialObservation=function(){return(0,V.Z)(Nn(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function Pn(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=D.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function Nn(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,G.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function On(e,t){var n=(0,p.P)((function(){return t(e.observe(!0))})).pipe((0,d.d)({bufferSize:1,refCount:!0}));return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},observe:function(e){return e?n:n.pipe((t=1,(0,m.h)((function(e,n){return t<=n}))));var t},deriveReadOnlyObserver:function(e){return On(this,e)}}}var Ln=n(7829);function Bn(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Ln.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Un(e){return e.map((function(e){return null===e?e:{normalized:(0,Ln.ZP)(e.language),closedCaption:e.closedCaption}}))}var Fn=function(){function e(e){this._periods=new Tt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=jn(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void M.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):M.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else M.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ee.Z)(r,i))n.adaptation$.next(i);else{var a=Vn(r,Bn(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ee.Z)(r,i))n.adaptation$.next(i);else{var a=Gn(r,Un(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,Ee.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=Wn(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=$n(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=jn(this._periods,e),r=void 0!==n?n.audio:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Be.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=jn(this._periods,e),r=void 0!==n?n.text:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Be.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=jn(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,Be.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=$n(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=jn(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,z.Z)(r))return null;var i={language:(0,Me.Z)(r.language,""),normalized:(0,Me.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(Yn)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,z.Z)(r)?null:{language:(0,Me.Z)(r.language,""),normalized:(0,Me.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,z.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(qn),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(qn)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,Me.Z)(e.language,""),normalized:(0,Me.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(Yn)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,Me.Z)(e.language,""),normalized:(0,Me.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=jn(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(qn),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(qn)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=Bn(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ee.Z)(s,u))n(r+1);else{var l=Vn(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Un(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ee.Z)(s,u))n(r+1);else{var l=Gn(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Ee.Z)(s,u.baseAdaptation)){var l=$n(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=Wn(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=$n(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function zn(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function Vn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=zn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return e[0]}function Kn(e){return function(t){return(0,Me.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function Gn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Kn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return null}function Hn(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function Wn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Hn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return e[0]}function jn(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function qn(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function Yn(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function $n(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var Xn=I.Nh,Qn=I._K,Jn=I.C1,er=I.Q1,tr=I.Qt,nr=I.yj,rr=I.d5,ir=I.UA,ar=I.$x,or=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p,v,h,m,g=D.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,I=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,x=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,z.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,z.Z)(e.wantedBufferAhead))r=x;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,z.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,z.Z)(e.throttleWhenHidden)?a=A:((0,W.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,z.Z)(e.throttleVideoBitrateWhenHidden)?I:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,W.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,W.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,W.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,z.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,z.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.minVideoBitrate))v=b.video;else if(v=Number(e.minVideoBitrate),isNaN(v))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.minAudioBitrate))p=b.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(v>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+v+'"')}if((0,z.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:p,minVideoBitrate:v,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,z.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,p=r.minVideoBitrate,v=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,I=D.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;return S.preload="auto",t.version="3.27.0-dev.2022031700",t.log=M.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),nr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),er(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),ir(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_isPlaying=(0,H.Z)(!1),t._priv_speed=(0,H.Z)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,H.Z)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,H.Z)(w),maxBufferAhead:(0,H.Z)(h),maxBufferBehind:(0,H.Z)(m),maxVideoBufferSize:(0,H.Z)(k)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,H.Z)(f),video:(0,H.Z)(p)},maxAutoBitrates:{audio:(0,H.Z)(v),video:(0,H.Z)(g)},manualBitrates:{audio:(0,H.Z)(-1),video:(0,H.Z)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=I,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(bn),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var f=r.prototype;return f.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==bn&&this._priv_setPlayerState(bn)},f.dispose=function(){this.stop(),null!==this.videoElement&&Q(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";M.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_isPlaying.finish(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},f.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p=D.Z.getCurrent(),v=p.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,h=p.DEFAULT_AUTO_PLAY,m=p.DEFAULT_CODEC_SWITCHING_BEHAVIOR,g=p.DEFAULT_ENABLE_FAST_SWITCHING,y=p.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,_=p.DEFAULT_SHOW_NATIVE_SUBTITLE,b=p.DEFAULT_TEXT_TRACK_MODE;if((0,z.Z)(e))throw new Error("No option set on loadVideo");if((0,z.Z)(e.url)){if((0,z.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,z.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,z.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var T=(0,z.Z)(e.autoPlay)?h:!!e.autoPlay;if((0,z.Z)(e.keySystems))l=[];else for(var E,S=Rn(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(E=S()).done;){var w=E.value;if("string"!=typeof w.type||"function"!=typeof w.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var k=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,A="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},I=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,x=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,Z=(0,z.Z)(e.audioTrackSwitchingMode)?v:e.audioTrackSwitchingMode;(0,Ee.Z)(["seamless","direct"],Z)||(M.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\nIf badly set, "+v+" strategy will be used as default"),Z=v);var R=(0,z.Z)(e.onCodecSwitch)?m:e.onCodecSwitch;(0,Ee.Z)(["continue","reload"],R)||(M.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+m+" will be used as default"),R=m);var C=(0,V.Z)({},A,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:k});if(delete C.initialManifest,delete C.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,W.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var P,N=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],O=Rn(N);!(P=O()).done;){var L=P.value;if("string"!=typeof L.language||"string"!=typeof L.mimeType||"string"!=typeof L.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}C.supplementaryTextTracks=N}if(void 0!==e.supplementaryImageTracks){(0,W.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var B,U=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],F=Rn(U);!(B=F()).done;){var K=B.value;if("string"!=typeof K.mimeType||"string"!=typeof K.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}C.supplementaryImageTracks=U}if((0,z.Z)(e.textTrackMode))c=b;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,z.Z)(e.defaultAudioTrack)||(0,W.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var G=(0,Zn.iH)(e.defaultAudioTrack);(0,z.Z)(e.defaultTextTrack)||(0,W.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var H=(0,Zn.Y1)(e.defaultTextTrack),j=!_;(0,z.Z)(e.hideNativeSubtitle)||((0,W.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),j=!!e.hideNativeSubtitle);var q=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:y,Y=(0,z.Z)(e.enableFastSwitching)?g:e.enableFastSwitching;if("html"===c){if((0,z.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,z.Z)(e.textTrackElement)||M.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,z.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var $=e.startAt.wallClockTime.getTime()/1e3;f=(0,V.Z)({},e.startAt,{wallClockTime:$})}else f=e.startAt;return{autoPlay:T,defaultAudioTrack:G,defaultTextTrack:H,enableFastSwitching:Y,hideNativeSubtitle:j,keySystems:l,initialManifest:I,lowLatencyMode:k,manualBitrateSwitchingMode:q,audioTrackSwitchingMode:Z,minimumManifestUpdateInterval:x,networkConfig:(0,z.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:R,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:C,url:s}}(e);M.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},f.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},f._priv_initializeContentPlayback=function(e){var t,n,r,a=this,f=e.autoPlay,v=e.audioTrackSwitchingMode,I=e.defaultAudioTrack,x=e.defaultTextTrack,Z=e.enableFastSwitching,R=e.initialManifest,P=e.keySystems,N=e.lowLatencyMode,O=e.manualBitrateSwitchingMode,U=e.minimumManifestUpdateInterval,F=e.networkConfig,z=e.onCodecSwitch,K=e.startAt,G=e.transport,H=e.transportOptions,W=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var j,q="directfile"===G,Y=new i.x,$={url:W,stop$:Y,isDirectFile:q,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:I,initialTextTrack:x},X=this.videoElement,Q=new Dn(X,{withMediaSource:!q,lowLatencyMode:N});if(q){if(this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),null===L.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=$,this._priv_mediaElementTrackChoiceManager=new L.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var J=void 0===I?this._priv_preferredAudioTracks:[I];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(J,!0);var ee=void 0===x?this._priv_preferredTextTracks:[x];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ee,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var te=L.Z.directfile.initDirectFile({autoPlay:f,keySystems:P,mediaElement:X,speed:this._priv_speed,playbackObserver:Q,startAt:K,url:W}).pipe((0,o.R)(Y));j=h(te,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var ne=L.Z.transports[G];if("function"!=typeof ne)throw this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),new Error('transport "'+G+'" not supported');var re,ie=ne(H),ae=F.offlineRetry,oe=F.segmentRetry,se=F.manifestRetry,ue=new ye(W,ie,{lowLatencyMode:N,maxRetryRegular:se,maxRetryOffline:ae}),le=new Ae(ie,{lowLatencyMode:N,maxRetryOffline:ae,maxRetryRegular:oe});(re=(re=R instanceof B.ZP?(0,l.of)({type:"parsed",manifest:R}):void 0!==R?ue.parse(R,{previousManifest:null,unsafeMode:!1}):ue.fetch(W).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(Y),(0,d.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),this._priv_contentInfos=$;var ce=C(),de={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ce?de.throttle={video:Xn().pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:M.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ce?de.throttleBitrate={video:Qn(this._priv_pictureInPictureEvent$).pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:M.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ce?de.limitWidth={video:ar(X,this._priv_pictureInPictureEvent$).pipe((0,o.R)(Y))}:M.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var fe={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:de},pe="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ve=(0,V.Z)({audioTrackSwitchingMode:v,enableFastSwitching:Z,manualBitrateSwitchingMode:O,onCodecSwitch:z},this._priv_bufferOptions),he=_n({adaptiveOptions:fe,autoPlay:f,bufferOptions:ve,playbackObserver:Q,keySystems:P,lowLatencyMode:N,manifest$:re,manifestFetcher:ue,mediaElement:X,minimumManifestUpdateInterval:U,segmentFetcherCreator:le,speed:this._priv_speed,startAt:K,textTrackOptions:pe}).pipe((0,o.R)(Y));j=h(he,{connector:function(){return new i.x},resetOnDisconnect:!1})}var me,ge=j.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),_e=j.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),be=j.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),Te=Jn(X),Ee=rr(X),Se=(0,y.a)([this._priv_isPlaying.asObservable(),ge.pipe((0,_.O)(null)),Te.pipe((0,_.O)(null)),Ee.pipe((0,_.O)(null))]).pipe((0,o.R)(Y),(0,s.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){var r=D.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return kn;if(null!==n){var i=Math.abs(e.duration-e.currentTime);return null!=r&&i<r?kn:"seeking"===n?In:An}return t?Sn:wn}(X,t,n)}))),we=(0,b.z)((0,l.of)(En),_e.pipe((0,T.w)((function(e,t){var n,r=0===t;return(0,E.T)(be.pipe((0,s.U)((function(){return xn}))),r?(0,l.of)(Tn):S.E,Se.pipe((0,o.R)(be),(n=function(e){return r&&e===wn},(0,w.e)((function(e,t){var r=!1,i=0;e.subscribe(new k.Q(t,(function(e){return(r||(r=!n(e,i++)))&&t.next(e)})))})))))})))).pipe((0,u.x)());Y.pipe((0,A.q)(1)).subscribe((function(){void 0!==me&&me.unsubscribe()})),tr(X).pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)}));var ke=Q.observe(!0);ke.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),_e.pipe((0,T.w)((function(){return function(e,t){return(0,p.P)((function(){if(null===e)return S.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,_.O)("seeking")));var r=n.pipe((0,T.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,A.q)(1))})));return(0,E.T)(n,r)}))}(a.videoElement,ke)})),(0,o.R)(Y)).subscribe((function(e){M.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),we.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?Jn(X):S.E).pipe((0,o.R)(Y)).subscribe((function(){Y.next(),Y.complete()})),j.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,A.q)(1),(0,o.R)(Y)).subscribe((function(){me=j.connect()}))},f.getError=function(){return this._priv_currentError},f.getManifest=function(){return(0,W.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},f.getCurrentAdaptations=function(){if((0,W.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,z.Z)(n[t.id])?null:n[t.id]},f.getCurrentRepresentations=function(){return(0,W.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},f.getVideoElement=function(){return this.videoElement},f.getNativeTextTrack=function(){if((0,W.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},f.getPlayerState=function(){return this.state},f.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},f.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},f.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},f.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},f.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.L7)(e.buffered,e.currentTime)},f.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.at)(e.buffered,e.currentTime)},f.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.DD)(e.buffered,e.currentTime)},f.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){var r=this.videoElement;if("function"==typeof r.getStartDate){var i=r.getStartDate();if("number"==typeof i&&!isNaN(i))return i+r.currentTime}return r.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},f.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},f.getPlaybackRate=function(){return this._priv_speed.getValue()},f.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},f.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,z.Z)(r.video)?[]:r.video.getAvailableBitrates()},f.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,z.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},f.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},f.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},f.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.video))return e.video.bitrate},f.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.audio))return e.audio.bitrate},f.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},f.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},f.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},f.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},f.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,z.Z)(t)||"function"!=typeof t.catch?K.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new P.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},f.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},f.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,z.Z)(a.relative))if((0,z.Z)(a.position)){if((0,z.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},f.isFullscreen=function(){return(0,W.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),Z()},f.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,W.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!Z()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):x()},f.exitFullscreen=function(){(0,W.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),x()},f.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},f.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},f.isMute=function(){return 0===this.getVolume()},f.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},f.unMute=function(){var e=D.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},f.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},f.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},f.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},f.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},f.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},f.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},f.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},f.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},f.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},f.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},f.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},f.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},f.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},f.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},f.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return ee(this.videoElement)},f.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},f.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},f.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},f.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},f.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},f.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},f.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},f.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},f.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},f.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},f.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},f.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},f.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},f.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},f.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},f.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},f.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},f.getImageTrackData=function(){return(0,W.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},f.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumPosition():null},f.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.getMaximumPosition():null},f.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},f._priv_cleanUpCurrentContentState=function(){var e,t=this;M.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){M.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1)};(0,z.Z)(this.videoElement)?n():te(this.videoElement).then((function(){M.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){M.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},f._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void M.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void M.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,z.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},f._priv_onPlaybackError=function(e){var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,M.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(bn),this._priv_currentError===t&&this.trigger("error",t)},f._priv_onPlaybackFinished=function(){M.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(kn)},f._priv_onPlaybackWarning=function(e){var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});M.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},f._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new Fn({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(u,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,F.R)(n,"manifestUpdate").pipe((0,o.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else M.Z.error("API: The manifest is loaded but no content is.")},f._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else M.Z.error("API: The active period changed but no content is loaded")},f._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,z.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},f._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,z.Z)(i)&&!(0,z.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,z.Z)(a)&&!(0,z.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},f._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},f._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,z.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,z.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else M.Z.error("API: The adaptations changed but no content is loaded")},f._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,z.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,z.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else M.Z.error("API: The representations changed but no content is loaded")},f._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},f._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_isPlaying.setValue(e)},f._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},f._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,M.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},f._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==xn){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,z.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else M.Z.warn("API: Cannot perform time update: no content loaded.")},f._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,U.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,z.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return O.ZB}},{key:"ErrorCodes",get:function(){return O.SM}},{key:"LogLevel",get:function(){return M.Z.getLevel()},set:function(e){M.Z.setLevel(e)}}]),r}(F.Z);or.version="3.27.0-dev.2022031700";var sr=or,ur=n(7273);!function(){ur.Z.ContentDecryptor=n(1266).ZP,ur.Z.imageBuffer=n(7127).Z,ur.Z.imageParser=n(3203).Z,ur.Z.transports.smooth=n(2339).Z,ur.Z.transports.dash=n(5877).Z,ur.Z.dashParsers.js=n(3501).Z,ur.Z.nativeTextTracksBuffer=n(9059).Z,ur.Z.nativeTextTracksParsers.vtt=n(9405).Z,ur.Z.nativeTextTracksParsers.ttml=n(1570).Z,ur.Z.nativeTextTracksParsers.sami=n(1812).Z,ur.Z.nativeTextTracksParsers.srt=n(8057).Z,ur.Z.htmlTextTracksBuffer=n(5192).Z,ur.Z.htmlTextTracksParsers.sami=n(5734).Z,ur.Z.htmlTextTracksParsers.ttml=n(7439).Z,ur.Z.htmlTextTracksParsers.srt=n(8675).Z,ur.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;ur.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var lr=sr}(),r=r.default}()}));
|