rx-player 3.33.4-dev.2024083000 → 3.33.4

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.
Files changed (730) hide show
  1. package/.prettierignore +1 -0
  2. package/.prettierrc +4 -0
  3. package/.vscode/settings.json +9 -0
  4. package/CHANGELOG.md +1662 -1076
  5. package/MAINTAINERS.md +9 -12
  6. package/README.md +111 -127
  7. package/VERSION +1 -1
  8. package/dist/_esm5.processed/compat/add_class_name.js +4 -3
  9. package/dist/_esm5.processed/compat/add_text_track.d.ts +1 -1
  10. package/dist/_esm5.processed/compat/add_text_track.js +4 -4
  11. package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +2 -1
  12. package/dist/_esm5.processed/compat/browser_compatibility_types.js +15 -10
  13. package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
  14. package/dist/_esm5.processed/compat/browser_detection.js +18 -10
  15. package/dist/_esm5.processed/compat/can_reuse_media_keys.d.ts +4 -0
  16. package/dist/_esm5.processed/compat/can_reuse_media_keys.js +6 -2
  17. package/dist/_esm5.processed/compat/change_source_buffer_type.d.ts +1 -1
  18. package/dist/_esm5.processed/compat/eme/close_session.d.ts +1 -1
  19. package/dist/_esm5.processed/compat/eme/close_session.js +17 -13
  20. package/dist/_esm5.processed/compat/eme/custom_key_system_access.d.ts +1 -1
  21. package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.d.ts +1 -1
  22. package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +8 -9
  23. package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +3 -2
  24. package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +1 -1
  25. package/dist/_esm5.processed/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts +1 -1
  26. package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
  27. package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +7 -9
  28. package/dist/_esm5.processed/compat/eme/custom_media_keys/types.d.ts +4 -1
  29. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.d.ts +2 -2
  30. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +6 -12
  31. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts +2 -1
  32. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +3 -3
  33. package/dist/_esm5.processed/compat/eme/eme-api-implementation.d.ts +4 -4
  34. package/dist/_esm5.processed/compat/eme/eme-api-implementation.js +26 -11
  35. package/dist/_esm5.processed/compat/eme/generate_key_request.d.ts +1 -1
  36. package/dist/_esm5.processed/compat/eme/generate_key_request.js +17 -20
  37. package/dist/_esm5.processed/compat/eme/get_init_data.d.ts +3 -1
  38. package/dist/_esm5.processed/compat/eme/get_init_data.js +7 -9
  39. package/dist/_esm5.processed/compat/eme/get_uuid_kid_from_keystatus_kid.js +2 -3
  40. package/dist/_esm5.processed/compat/eme/get_webkit_fairplay_initdata.js +12 -13
  41. package/dist/_esm5.processed/compat/eme/index.d.ts +8 -5
  42. package/dist/_esm5.processed/compat/eme/index.js +1 -1
  43. package/dist/_esm5.processed/compat/eme/load_session.d.ts +1 -1
  44. package/dist/_esm5.processed/compat/enable_audio_track.d.ts +1 -1
  45. package/dist/_esm5.processed/compat/event_listeners.d.ts +26 -24
  46. package/dist/_esm5.processed/compat/event_listeners.js +14 -29
  47. package/dist/_esm5.processed/compat/fullscreen.d.ts +1 -1
  48. package/dist/_esm5.processed/compat/fullscreen.js +1 -1
  49. package/dist/_esm5.processed/compat/generate_init_data.js +3 -5
  50. package/dist/_esm5.processed/compat/index.d.ts +6 -3
  51. package/dist/_esm5.processed/compat/index.js +2 -2
  52. package/dist/_esm5.processed/compat/is_vtt_cue.d.ts +1 -1
  53. package/dist/_esm5.processed/compat/make_vtt_cue.d.ts +1 -1
  54. package/dist/_esm5.processed/compat/on_height_width_change.d.ts +2 -2
  55. package/dist/_esm5.processed/compat/on_height_width_change.js +3 -2
  56. package/dist/_esm5.processed/compat/patch_webkit_source_buffer.js +28 -29
  57. package/dist/_esm5.processed/compat/should_favour_custom_safari_EME.js +2 -2
  58. package/dist/_esm5.processed/compat/should_reload_media_source_on_decipherability_update.js +1 -2
  59. package/dist/_esm5.processed/config.d.ts +1 -1
  60. package/dist/_esm5.processed/config.js +0 -15
  61. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +7 -6
  62. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +45 -22
  63. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +1 -1
  64. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +11 -10
  65. package/dist/_esm5.processed/core/adaptive/guess_based_chooser.d.ts +4 -4
  66. package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +7 -6
  67. package/dist/_esm5.processed/core/adaptive/index.d.ts +3 -2
  68. package/dist/_esm5.processed/core/adaptive/network_analyzer.d.ts +4 -4
  69. package/dist/_esm5.processed/core/adaptive/network_analyzer.js +43 -38
  70. package/dist/_esm5.processed/core/adaptive/utils/bandwidth_estimator.js +1 -1
  71. package/dist/_esm5.processed/core/adaptive/utils/ewma.js +1 -2
  72. package/dist/_esm5.processed/core/adaptive/utils/filter_by_bitrate.d.ts +1 -1
  73. package/dist/_esm5.processed/core/adaptive/utils/filter_by_width.d.ts +1 -1
  74. package/dist/_esm5.processed/core/adaptive/utils/filter_by_width.js +3 -6
  75. package/dist/_esm5.processed/core/adaptive/utils/get_buffer_levels.js +7 -4
  76. package/dist/_esm5.processed/core/adaptive/utils/last_estimate_storage.d.ts +1 -1
  77. package/dist/_esm5.processed/core/adaptive/utils/pending_requests_store.d.ts +2 -1
  78. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.d.ts +1 -1
  79. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.js +8 -5
  80. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +1 -1
  81. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +5 -3
  82. package/dist/_esm5.processed/core/api/debug/buffer_graph.d.ts +1 -1
  83. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +3 -8
  84. package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +1 -2
  85. package/dist/_esm5.processed/core/api/debug/modules/general_info.d.ts +2 -2
  86. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +17 -13
  87. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.d.ts +3 -3
  88. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +4 -2
  89. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.d.ts +2 -2
  90. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
  91. package/dist/_esm5.processed/core/api/debug/render.d.ts +2 -2
  92. package/dist/_esm5.processed/core/api/debug/utils.d.ts +5 -5
  93. package/dist/_esm5.processed/core/api/index.d.ts +1 -1
  94. package/dist/_esm5.processed/core/api/option_utils.d.ts +3 -3
  95. package/dist/_esm5.processed/core/api/option_utils.js +85 -48
  96. package/dist/_esm5.processed/core/api/playback_observer.d.ts +16 -18
  97. package/dist/_esm5.processed/core/api/playback_observer.js +65 -42
  98. package/dist/_esm5.processed/core/api/public_api.d.ts +10 -9
  99. package/dist/_esm5.processed/core/api/public_api.js +103 -94
  100. package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.d.ts +1 -1
  101. package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +25 -14
  102. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +3 -3
  103. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +72 -80
  104. package/dist/_esm5.processed/core/api/utils.d.ts +5 -5
  105. package/dist/_esm5.processed/core/api/utils.js +5 -8
  106. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +12 -54
  107. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +55 -66
  108. package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +10 -5
  109. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +16 -8
  110. package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +11 -2
  111. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +136 -65
  112. package/dist/_esm5.processed/core/decrypt/create_or_load_session.d.ts +5 -4
  113. package/dist/_esm5.processed/core/decrypt/create_or_load_session.js +18 -7
  114. package/dist/_esm5.processed/core/decrypt/create_session.d.ts +5 -4
  115. package/dist/_esm5.processed/core/decrypt/create_session.js +6 -12
  116. package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +1 -2
  117. package/dist/_esm5.processed/core/decrypt/find_key_system.d.ts +13 -3
  118. package/dist/_esm5.processed/core/decrypt/find_key_system.js +45 -22
  119. package/dist/_esm5.processed/core/decrypt/get_key_system_configuration.js +1 -2
  120. package/dist/_esm5.processed/core/decrypt/get_media_keys.d.ts +9 -4
  121. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +17 -6
  122. package/dist/_esm5.processed/core/decrypt/init_media_keys.d.ts +3 -3
  123. package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +2 -2
  124. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +12 -16
  125. package/dist/_esm5.processed/core/decrypt/set_server_certificate.d.ts +3 -3
  126. package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +6 -7
  127. package/dist/_esm5.processed/core/decrypt/types.d.ts +11 -5
  128. package/dist/_esm5.processed/core/decrypt/utils/are_init_values_compatible.js +20 -12
  129. package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.d.ts +2 -2
  130. package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.js +5 -4
  131. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.d.ts +1 -1
  132. package/dist/_esm5.processed/core/decrypt/utils/clean_old_stored_persistent_info.d.ts +1 -1
  133. package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.d.ts +1 -1
  134. package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.js +16 -9
  135. package/dist/_esm5.processed/core/decrypt/utils/is_session_usable.d.ts +1 -1
  136. package/dist/_esm5.processed/core/decrypt/utils/is_session_usable.js +1 -2
  137. package/dist/_esm5.processed/core/decrypt/utils/key_session_record.d.ts +1 -1
  138. package/dist/_esm5.processed/core/decrypt/utils/key_session_record.js +1 -2
  139. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.d.ts +11 -13
  140. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +13 -13
  141. package/dist/_esm5.processed/core/decrypt/utils/media_keys_infos_store.d.ts +8 -3
  142. package/dist/_esm5.processed/core/decrypt/utils/media_keys_infos_store.js +1 -2
  143. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +3 -3
  144. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +27 -16
  145. package/dist/_esm5.processed/core/decrypt/utils/serializable_bytes.js +1 -1
  146. package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.d.ts +1 -1
  147. package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.js +19 -12
  148. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +2 -2
  149. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +5 -6
  150. package/dist/_esm5.processed/core/fetchers/index.d.ts +6 -3
  151. package/dist/_esm5.processed/core/fetchers/index.js +1 -1
  152. package/dist/_esm5.processed/core/fetchers/manifest/index.d.ts +3 -2
  153. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +2 -2
  154. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +68 -61
  155. package/dist/_esm5.processed/core/fetchers/segment/index.d.ts +4 -3
  156. package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.d.ts +4 -3
  157. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +9 -8
  158. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +41 -29
  159. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +5 -5
  160. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +2 -3
  161. package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.d.ts +1 -1
  162. package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.js +19 -18
  163. package/dist/_esm5.processed/core/fetchers/utils/error_selector.d.ts +1 -1
  164. package/dist/_esm5.processed/core/fetchers/utils/error_selector.js +1 -1
  165. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +3 -3
  166. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +25 -25
  167. package/dist/_esm5.processed/core/init/directfile_content_initializer.d.ts +4 -4
  168. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +21 -17
  169. package/dist/_esm5.processed/core/init/index.d.ts +2 -1
  170. package/dist/_esm5.processed/core/init/index.js +1 -1
  171. package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +9 -9
  172. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +64 -32
  173. package/dist/_esm5.processed/core/init/types.d.ts +10 -12
  174. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +6 -5
  175. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +20 -19
  176. package/dist/_esm5.processed/core/init/utils/create_media_source.d.ts +1 -1
  177. package/dist/_esm5.processed/core/init/utils/create_media_source.js +2 -3
  178. package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.d.ts +6 -6
  179. package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.js +5 -3
  180. package/dist/_esm5.processed/core/init/utils/end_of_stream.d.ts +1 -1
  181. package/dist/_esm5.processed/core/init/utils/get_initial_time.d.ts +1 -1
  182. package/dist/_esm5.processed/core/init/utils/get_initial_time.js +12 -15
  183. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.d.ts +3 -3
  184. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +1 -2
  185. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.d.ts +9 -9
  186. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +39 -3
  187. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.d.ts +9 -8
  188. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +12 -9
  189. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +10 -7
  190. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +7 -6
  191. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +24 -24
  192. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/are_same_stream_events.js +1 -3
  193. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/index.d.ts +1 -1
  194. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
  195. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +14 -6
  196. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -3
  197. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +12 -19
  198. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/types.d.ts +1 -1
  199. package/dist/_esm5.processed/core/init/utils/throw_on_media_error.d.ts +1 -1
  200. package/dist/_esm5.processed/core/init/utils/throw_on_media_error.js +11 -6
  201. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.d.ts +6 -6
  202. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +12 -13
  203. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +3 -2
  204. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +6 -9
  205. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +3 -2
  206. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +1 -1
  207. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +2 -1
  208. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +7 -7
  209. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.d.ts +1 -1
  210. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +4 -4
  211. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/update_proportional_elements.js +1 -2
  212. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.d.ts +1 -1
  213. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.js +2 -6
  214. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +2 -1
  215. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +2 -2
  216. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/parsers.d.ts +1 -1
  217. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +5 -7
  218. package/dist/_esm5.processed/core/segment_buffers/implementations/utils/manual_time_ranges.js +1 -1
  219. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +8 -4
  220. package/dist/_esm5.processed/core/segment_buffers/index.js +2 -2
  221. package/dist/_esm5.processed/core/segment_buffers/inventory/buffered_history.d.ts +1 -1
  222. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +6 -4
  223. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +4 -4
  224. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +63 -54
  225. package/dist/_esm5.processed/core/segment_buffers/inventory/types.d.ts +1 -1
  226. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +2 -2
  227. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +17 -23
  228. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +3 -3
  229. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +49 -22
  230. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +8 -7
  231. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.d.ts +7 -6
  232. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +2 -1
  233. package/dist/_esm5.processed/core/stream/index.d.ts +6 -5
  234. package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.d.ts +3 -3
  235. package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.js +2 -2
  236. package/dist/_esm5.processed/core/stream/orchestrator/index.d.ts +3 -2
  237. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +9 -7
  238. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +47 -34
  239. package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +3 -3
  240. package/dist/_esm5.processed/core/stream/period/period_stream.js +49 -16
  241. package/dist/_esm5.processed/core/stream/period/types.d.ts +15 -12
  242. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +9 -9
  243. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +26 -25
  244. package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +3 -3
  245. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +47 -23
  246. package/dist/_esm5.processed/core/stream/representation/types.d.ts +9 -8
  247. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +4 -4
  248. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +10 -7
  249. package/dist/_esm5.processed/core/stream/representation/utils/check_for_discontinuity.d.ts +4 -3
  250. package/dist/_esm5.processed/core/stream/representation/utils/check_for_discontinuity.js +16 -18
  251. package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.d.ts +7 -6
  252. package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +11 -11
  253. package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.d.ts +2 -2
  254. package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.js +6 -8
  255. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.d.ts +5 -4
  256. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +40 -19
  257. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.d.ts +4 -3
  258. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +27 -28
  259. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.d.ts +6 -5
  260. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +7 -5
  261. package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.d.ts +8 -7
  262. package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +13 -10
  263. package/dist/_esm5.processed/default_config.js +20 -16
  264. package/dist/_esm5.processed/errors/encrypted_media_error.d.ts +2 -2
  265. package/dist/_esm5.processed/errors/encrypted_media_error.js +1 -1
  266. package/dist/_esm5.processed/errors/error_codes.d.ts +1 -1
  267. package/dist/_esm5.processed/errors/error_codes.js +1 -1
  268. package/dist/_esm5.processed/errors/format_error.d.ts +2 -2
  269. package/dist/_esm5.processed/errors/format_error.js +1 -2
  270. package/dist/_esm5.processed/errors/index.d.ts +6 -3
  271. package/dist/_esm5.processed/errors/index.js +2 -2
  272. package/dist/_esm5.processed/errors/is_known_error.d.ts +1 -1
  273. package/dist/_esm5.processed/errors/is_known_error.js +2 -2
  274. package/dist/_esm5.processed/errors/media_error.d.ts +3 -3
  275. package/dist/_esm5.processed/errors/media_error.js +4 -7
  276. package/dist/_esm5.processed/errors/network_error.d.ts +2 -2
  277. package/dist/_esm5.processed/errors/network_error.js +3 -3
  278. package/dist/_esm5.processed/errors/other_error.d.ts +1 -1
  279. package/dist/_esm5.processed/errors/other_error.js +1 -1
  280. package/dist/_esm5.processed/errors/request_error.d.ts +1 -1
  281. package/dist/_esm5.processed/experimental/features/dash_wasm.d.ts +2 -2
  282. package/dist/_esm5.processed/experimental/features/debug_element.d.ts +1 -1
  283. package/dist/_esm5.processed/experimental/features/local.d.ts +1 -1
  284. package/dist/_esm5.processed/experimental/features/metaplaylist.d.ts +1 -1
  285. package/dist/_esm5.processed/experimental/index.d.ts +1 -1
  286. package/dist/_esm5.processed/experimental/index.js +1 -1
  287. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/features/dash.d.ts +1 -1
  288. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/features/metaplaylist.d.ts +1 -1
  289. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/index.d.ts +1 -1
  290. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/index.js +2 -2
  291. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
  292. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +7 -3
  293. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +1 -1
  294. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +1 -2
  295. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +2 -2
  296. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +2 -2
  297. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/types.d.ts +3 -2
  298. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.d.ts +2 -2
  299. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +12 -18
  300. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +13 -23
  301. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.d.ts +1 -1
  302. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.js +8 -7
  303. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.d.ts +1 -1
  304. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.js +9 -13
  305. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +4 -3
  306. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +5 -3
  307. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/capabilities.d.ts +1 -1
  308. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/capabilities.js +10 -47
  309. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts +2 -1
  310. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +8 -5
  311. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.d.ts +2 -1
  312. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +21 -13
  313. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts +2 -1
  314. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +22 -18
  315. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +4 -7
  316. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/index.d.ts +1 -1
  317. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts +2 -1
  318. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +3 -5
  319. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.d.ts +1 -1
  320. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.js +4 -10
  321. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts +2 -1
  322. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -3
  323. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts +2 -1
  324. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +2 -3
  325. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +2 -2
  326. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/utils.d.ts +1 -1
  327. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/utils.js +6 -6
  328. package/dist/_esm5.processed/experimental/tools/parseBIFThumbnails.js +5 -4
  329. package/dist/_esm5.processed/features/add_features.d.ts +1 -1
  330. package/dist/_esm5.processed/features/features_object.d.ts +1 -1
  331. package/dist/_esm5.processed/features/features_object.js +4 -3
  332. package/dist/_esm5.processed/features/index.d.ts +3 -2
  333. package/dist/_esm5.processed/features/index.js +1 -1
  334. package/dist/_esm5.processed/features/list/bif_parser.d.ts +1 -1
  335. package/dist/_esm5.processed/features/list/dash.d.ts +1 -1
  336. package/dist/_esm5.processed/features/list/directfile.d.ts +1 -1
  337. package/dist/_esm5.processed/features/list/eme.d.ts +1 -1
  338. package/dist/_esm5.processed/features/list/html_sami_parser.d.ts +1 -1
  339. package/dist/_esm5.processed/features/list/html_srt_parser.d.ts +1 -1
  340. package/dist/_esm5.processed/features/list/html_text_buffer.d.ts +1 -1
  341. package/dist/_esm5.processed/features/list/html_ttml_parser.d.ts +1 -1
  342. package/dist/_esm5.processed/features/list/html_vtt_parser.d.ts +1 -1
  343. package/dist/_esm5.processed/features/list/image_buffer.d.ts +1 -1
  344. package/dist/_esm5.processed/features/list/native_sami_parser.d.ts +1 -1
  345. package/dist/_esm5.processed/features/list/native_srt_parser.d.ts +1 -1
  346. package/dist/_esm5.processed/features/list/native_text_buffer.d.ts +1 -1
  347. package/dist/_esm5.processed/features/list/native_ttml_parser.d.ts +1 -1
  348. package/dist/_esm5.processed/features/list/native_vtt_parser.d.ts +1 -1
  349. package/dist/_esm5.processed/features/list/smooth.d.ts +1 -1
  350. package/dist/_esm5.processed/features/types.d.ts +11 -11
  351. package/dist/_esm5.processed/manifest/adaptation.d.ts +3 -3
  352. package/dist/_esm5.processed/manifest/adaptation.js +24 -14
  353. package/dist/_esm5.processed/manifest/index.d.ts +9 -5
  354. package/dist/_esm5.processed/manifest/index.js +4 -8
  355. package/dist/_esm5.processed/manifest/manifest.d.ts +8 -7
  356. package/dist/_esm5.processed/manifest/manifest.js +37 -33
  357. package/dist/_esm5.processed/manifest/period.d.ts +4 -4
  358. package/dist/_esm5.processed/manifest/period.js +7 -14
  359. package/dist/_esm5.processed/manifest/representation.d.ts +4 -4
  360. package/dist/_esm5.processed/manifest/representation.js +5 -5
  361. package/dist/_esm5.processed/manifest/representation_index/index.d.ts +3 -2
  362. package/dist/_esm5.processed/manifest/representation_index/index.js +1 -1
  363. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +1 -1
  364. package/dist/_esm5.processed/manifest/representation_index/static.js +6 -2
  365. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +6 -5
  366. package/dist/_esm5.processed/manifest/update_period_in_place.d.ts +3 -3
  367. package/dist/_esm5.processed/manifest/update_period_in_place.js +9 -9
  368. package/dist/_esm5.processed/manifest/update_periods.d.ts +2 -2
  369. package/dist/_esm5.processed/manifest/update_periods.js +6 -3
  370. package/dist/_esm5.processed/manifest/utils.d.ts +4 -4
  371. package/dist/_esm5.processed/manifest/utils.js +6 -4
  372. package/dist/_esm5.processed/parsers/containers/isobmff/create_box.d.ts +1 -1
  373. package/dist/_esm5.processed/parsers/containers/isobmff/create_box.js +5 -4
  374. package/dist/_esm5.processed/parsers/containers/isobmff/drm/playready.js +2 -3
  375. package/dist/_esm5.processed/parsers/containers/isobmff/get_box.js +3 -5
  376. package/dist/_esm5.processed/parsers/containers/isobmff/index.d.ts +5 -4
  377. package/dist/_esm5.processed/parsers/containers/isobmff/index.js +4 -4
  378. package/dist/_esm5.processed/parsers/containers/isobmff/read.d.ts +1 -1
  379. package/dist/_esm5.processed/parsers/containers/isobmff/read.js +9 -9
  380. package/dist/_esm5.processed/parsers/containers/isobmff/take_pssh_out.js +3 -4
  381. package/dist/_esm5.processed/parsers/containers/isobmff/utils.js +51 -41
  382. package/dist/_esm5.processed/parsers/containers/matroska/index.d.ts +2 -1
  383. package/dist/_esm5.processed/parsers/containers/matroska/index.js +1 -1
  384. package/dist/_esm5.processed/parsers/containers/matroska/utils.js +29 -16
  385. package/dist/_esm5.processed/parsers/images/bif.js +15 -5
  386. package/dist/_esm5.processed/parsers/manifest/dash/common/attach_trickmode_track.d.ts +1 -1
  387. package/dist/_esm5.processed/parsers/manifest/dash/common/convert_supplemental_codecs.js +1 -3
  388. package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.d.ts +1 -1
  389. package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.js +1 -1
  390. package/dist/_esm5.processed/parsers/manifest/dash/common/get_hdr_information.js +4 -12
  391. package/dist/_esm5.processed/parsers/manifest/dash/common/get_http_utc-timing_url.d.ts +1 -1
  392. package/dist/_esm5.processed/parsers/manifest/dash/common/get_http_utc-timing_url.js +4 -5
  393. package/dist/_esm5.processed/parsers/manifest/dash/common/get_minimum_and_maximum_positions.d.ts +1 -1
  394. package/dist/_esm5.processed/parsers/manifest/dash/common/get_minimum_and_maximum_positions.js +5 -2
  395. package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.d.ts +1 -1
  396. package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.js +5 -6
  397. package/dist/_esm5.processed/parsers/manifest/dash/common/index.d.ts +3 -2
  398. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +4 -4
  399. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +34 -28
  400. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +2 -2
  401. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.js +7 -4
  402. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +4 -4
  403. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -11
  404. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/index.d.ts +10 -5
  405. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -2
  406. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +30 -18
  407. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +3 -3
  408. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +56 -55
  409. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +1 -1
  410. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +2 -6
  411. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -1
  412. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +11 -15
  413. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.d.ts +1 -1
  414. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.js +12 -9
  415. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +1 -1
  416. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +29 -19
  417. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/index.d.ts +3 -2
  418. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +6 -6
  419. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +73 -59
  420. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.js +2 -4
  421. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +1 -1
  422. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.js +7 -8
  423. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +4 -4
  424. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +52 -50
  425. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_availability_start_time.d.ts +1 -1
  426. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +6 -6
  427. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +52 -31
  428. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +4 -4
  429. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +41 -30
  430. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +4 -4
  431. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +1 -2
  432. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +4 -4
  433. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +63 -64
  434. package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.d.ts +1 -1
  435. package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.js +4 -2
  436. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.d.ts +1 -1
  437. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +73 -37
  438. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.d.ts +1 -1
  439. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.js +1 -2
  440. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/ContentComponent.d.ts +1 -1
  441. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/ContentProtection.d.ts +1 -1
  442. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/EventStream.d.ts +1 -1
  443. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/EventStream.js +13 -7
  444. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Initialization.d.ts +1 -1
  445. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Initialization.js +5 -3
  446. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/MPD.d.ts +1 -1
  447. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/MPD.js +44 -27
  448. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Period.d.ts +1 -1
  449. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Period.js +14 -8
  450. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.d.ts +1 -1
  451. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +36 -18
  452. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.d.ts +1 -1
  453. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.js +36 -18
  454. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentList.d.ts +1 -1
  455. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.d.ts +1 -1
  456. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.js +17 -8
  457. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTimeline.d.ts +1 -1
  458. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.d.ts +1 -1
  459. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.js +9 -5
  460. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +8 -26
  461. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +6 -12
  462. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.d.ts +2 -2
  463. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +9 -4
  464. package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +2 -2
  465. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/index.d.ts +3 -2
  466. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
  467. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +29 -16
  468. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts +3 -2
  469. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +22 -35
  470. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.d.ts +2 -2
  471. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentComponent.d.ts +2 -2
  472. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts +2 -2
  473. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +3 -1
  474. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts +3 -2
  475. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +2 -4
  476. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts +3 -0
  477. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Label.js +9 -0
  478. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts +3 -2
  479. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +5 -5
  480. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts +3 -2
  481. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +9 -6
  482. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.d.ts +3 -2
  483. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +8 -16
  484. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Scheme.d.ts +2 -2
  485. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.d.ts +2 -2
  486. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.js +5 -10
  487. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.d.ts +3 -2
  488. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.d.ts +2 -2
  489. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.js +11 -18
  490. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.d.ts +2 -2
  491. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.js +2 -4
  492. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/XLink.d.ts +3 -2
  493. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/XLink.js +5 -5
  494. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts +2 -2
  495. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/root.js +5 -6
  496. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/parsers_stack.d.ts +1 -1
  497. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/parsers_stack.js +1 -2
  498. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  499. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/utils.d.ts +1 -1
  500. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/utils.js +2 -4
  501. package/dist/_esm5.processed/parsers/manifest/local/index.d.ts +1 -1
  502. package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.d.ts +2 -2
  503. package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +25 -16
  504. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +2 -2
  505. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +5 -10
  506. package/dist/_esm5.processed/parsers/manifest/metaplaylist/index.d.ts +3 -2
  507. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +2 -2
  508. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +33 -29
  509. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +2 -2
  510. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +9 -7
  511. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +3 -3
  512. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +136 -109
  513. package/dist/_esm5.processed/parsers/manifest/smooth/get_codecs.js +3 -3
  514. package/dist/_esm5.processed/parsers/manifest/smooth/index.d.ts +4 -2
  515. package/dist/_esm5.processed/parsers/manifest/smooth/index.js +1 -1
  516. package/dist/_esm5.processed/parsers/manifest/smooth/parse_C_nodes.js +6 -6
  517. package/dist/_esm5.processed/parsers/manifest/smooth/parse_protection_node.js +12 -8
  518. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +2 -2
  519. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +48 -53
  520. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +10 -7
  521. package/dist/_esm5.processed/parsers/manifest/smooth/utils/tokens.d.ts +1 -1
  522. package/dist/_esm5.processed/parsers/manifest/smooth/utils/tokens.js +2 -3
  523. package/dist/_esm5.processed/parsers/manifest/types.d.ts +2 -2
  524. package/dist/_esm5.processed/parsers/manifest/utils/check_manifest_ids.d.ts +1 -1
  525. package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.d.ts +1 -1
  526. package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +9 -6
  527. package/dist/_esm5.processed/parsers/manifest/utils/get_first_time_from_adaptation.d.ts +1 -1
  528. package/dist/_esm5.processed/parsers/manifest/utils/get_first_time_from_adaptation.js +5 -4
  529. package/dist/_esm5.processed/parsers/manifest/utils/get_last_time_from_adaptation.d.ts +1 -1
  530. package/dist/_esm5.processed/parsers/manifest/utils/get_last_time_from_adaptation.js +5 -4
  531. package/dist/_esm5.processed/parsers/manifest/utils/get_maximum_positions.d.ts +1 -1
  532. package/dist/_esm5.processed/parsers/manifest/utils/get_maximum_positions.js +10 -16
  533. package/dist/_esm5.processed/parsers/manifest/utils/get_minimum_position.d.ts +1 -1
  534. package/dist/_esm5.processed/parsers/manifest/utils/get_minimum_position.js +4 -10
  535. package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +1 -1
  536. package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.js +4 -5
  537. package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.d.ts +1 -1
  538. package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.js +18 -18
  539. package/dist/_esm5.processed/parsers/texttracks/index.d.ts +1 -1
  540. package/dist/_esm5.processed/parsers/texttracks/sami/html.d.ts +1 -1
  541. package/dist/_esm5.processed/parsers/texttracks/sami/html.js +15 -15
  542. package/dist/_esm5.processed/parsers/texttracks/sami/native.d.ts +1 -1
  543. package/dist/_esm5.processed/parsers/texttracks/sami/native.js +7 -14
  544. package/dist/_esm5.processed/parsers/texttracks/srt/html.js +6 -6
  545. package/dist/_esm5.processed/parsers/texttracks/srt/native.d.ts +1 -1
  546. package/dist/_esm5.processed/parsers/texttracks/srt/native.js +1 -7
  547. package/dist/_esm5.processed/parsers/texttracks/srt/parse_cue.js +4 -8
  548. package/dist/_esm5.processed/parsers/texttracks/ttml/get_parameters.js +4 -8
  549. package/dist/_esm5.processed/parsers/texttracks/ttml/get_time_delimiters.d.ts +1 -1
  550. package/dist/_esm5.processed/parsers/texttracks/ttml/get_time_delimiters.js +6 -8
  551. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_default_ttml_paragraph_style.js +2 -2
  552. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +2 -6
  553. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_font_size.js +3 -4
  554. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +2 -6
  555. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_padding.js +2 -6
  556. package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.d.ts +2 -2
  557. package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.js +22 -21
  558. package/dist/_esm5.processed/parsers/texttracks/ttml/html/generate_css_test_outline.js +2 -2
  559. package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_cue.d.ts +1 -1
  560. package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_cue.js +5 -3
  561. package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_ttml_to_div.d.ts +1 -1
  562. package/dist/_esm5.processed/parsers/texttracks/ttml/html/ttml_color_to_css_color.js +34 -19
  563. package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_cue.d.ts +2 -2
  564. package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_cue.js +9 -10
  565. package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts +1 -1
  566. package/dist/_esm5.processed/parsers/texttracks/ttml/parse_ttml.d.ts +3 -3
  567. package/dist/_esm5.processed/parsers/texttracks/ttml/parse_ttml.js +28 -16
  568. package/dist/_esm5.processed/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts +1 -1
  569. package/dist/_esm5.processed/parsers/texttracks/ttml/time_parsing.d.ts +1 -1
  570. package/dist/_esm5.processed/parsers/texttracks/ttml/time_parsing.js +2 -2
  571. package/dist/_esm5.processed/parsers/texttracks/types.d.ts +1 -1
  572. package/dist/_esm5.processed/parsers/texttracks/webvtt/get_cue_blocks.js +1 -1
  573. package/dist/_esm5.processed/parsers/texttracks/webvtt/get_style_blocks.js +2 -1
  574. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/convert_payload_to_html.d.ts +1 -1
  575. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_default_style_elements.d.ts +1 -1
  576. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_style_attribute.js +6 -12
  577. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_styled_element.d.ts +1 -1
  578. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_styled_element.js +7 -8
  579. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/index.d.ts +1 -1
  580. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/parse_style_block.js +4 -4
  581. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/parse_webvtt_to_div.d.ts +1 -1
  582. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.d.ts +1 -1
  583. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.js +4 -10
  584. package/dist/_esm5.processed/parsers/texttracks/webvtt/native/parse_vtt_to_cues.d.ts +1 -1
  585. package/dist/_esm5.processed/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -6
  586. package/dist/_esm5.processed/parsers/texttracks/webvtt/native/set_settings_on_cue.d.ts +1 -1
  587. package/dist/_esm5.processed/parsers/texttracks/webvtt/native/to_native_cue.d.ts +1 -1
  588. package/dist/_esm5.processed/parsers/texttracks/webvtt/native/to_native_cue.js +1 -1
  589. package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_cue_block.js +2 -4
  590. package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_timestamp.js +1 -2
  591. package/dist/_esm5.processed/parsers/texttracks/webvtt/utils.js +6 -6
  592. package/dist/_esm5.processed/public_types.d.ts +13 -11
  593. package/dist/_esm5.processed/tools/TextTrackRenderer/index.d.ts +3 -2
  594. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +2 -2
  595. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +15 -10
  596. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.d.ts +1 -1
  597. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +2 -3
  598. package/dist/_esm5.processed/transports/dash/construct_segment_url.d.ts +2 -2
  599. package/dist/_esm5.processed/transports/dash/construct_segment_url.js +5 -3
  600. package/dist/_esm5.processed/transports/dash/extract_complete_chunks.js +2 -2
  601. package/dist/_esm5.processed/transports/dash/get_events_out_of_emsgs.d.ts +2 -2
  602. package/dist/_esm5.processed/transports/dash/get_events_out_of_emsgs.js +9 -10
  603. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +3 -3
  604. package/dist/_esm5.processed/transports/dash/image_pipelines.js +32 -19
  605. package/dist/_esm5.processed/transports/dash/init_segment_loader.d.ts +3 -3
  606. package/dist/_esm5.processed/transports/dash/init_segment_loader.js +46 -22
  607. package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.d.ts +2 -2
  608. package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.js +13 -9
  609. package/dist/_esm5.processed/transports/dash/manifest_parser.d.ts +2 -2
  610. package/dist/_esm5.processed/transports/dash/manifest_parser.js +35 -22
  611. package/dist/_esm5.processed/transports/dash/pipelines.d.ts +1 -1
  612. package/dist/_esm5.processed/transports/dash/pipelines.js +11 -15
  613. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +4 -4
  614. package/dist/_esm5.processed/transports/dash/segment_loader.js +30 -21
  615. package/dist/_esm5.processed/transports/dash/segment_parser.d.ts +2 -2
  616. package/dist/_esm5.processed/transports/dash/segment_parser.js +47 -21
  617. package/dist/_esm5.processed/transports/dash/text_loader.d.ts +2 -2
  618. package/dist/_esm5.processed/transports/dash/text_loader.js +19 -19
  619. package/dist/_esm5.processed/transports/dash/text_parser.d.ts +2 -2
  620. package/dist/_esm5.processed/transports/dash/text_parser.js +45 -24
  621. package/dist/_esm5.processed/transports/local/pipelines.d.ts +1 -1
  622. package/dist/_esm5.processed/transports/local/pipelines.js +7 -8
  623. package/dist/_esm5.processed/transports/local/segment_loader.d.ts +3 -3
  624. package/dist/_esm5.processed/transports/local/segment_loader.js +14 -6
  625. package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
  626. package/dist/_esm5.processed/transports/local/segment_parser.js +31 -13
  627. package/dist/_esm5.processed/transports/local/text_parser.d.ts +1 -1
  628. package/dist/_esm5.processed/transports/local/text_parser.js +44 -19
  629. package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.d.ts +4 -4
  630. package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.js +9 -5
  631. package/dist/_esm5.processed/transports/metaplaylist/pipelines.d.ts +1 -1
  632. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +25 -18
  633. package/dist/_esm5.processed/transports/smooth/extract_timings_infos.d.ts +2 -2
  634. package/dist/_esm5.processed/transports/smooth/extract_timings_infos.js +16 -15
  635. package/dist/_esm5.processed/transports/smooth/isobmff/create_audio_init_segment.js +3 -3
  636. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.js +14 -32
  637. package/dist/_esm5.processed/transports/smooth/isobmff/create_init_segment.js +2 -2
  638. package/dist/_esm5.processed/transports/smooth/isobmff/create_traf_box.js +2 -2
  639. package/dist/_esm5.processed/transports/smooth/isobmff/get_aaces_header.js +4 -16
  640. package/dist/_esm5.processed/transports/smooth/isobmff/index.d.ts +4 -2
  641. package/dist/_esm5.processed/transports/smooth/isobmff/parse_tfrf.js +2 -2
  642. package/dist/_esm5.processed/transports/smooth/isobmff/parse_tfxd.js +1 -1
  643. package/dist/_esm5.processed/transports/smooth/isobmff/patch_segment.js +11 -10
  644. package/dist/_esm5.processed/transports/smooth/pipelines.d.ts +1 -1
  645. package/dist/_esm5.processed/transports/smooth/pipelines.js +121 -79
  646. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +3 -3
  647. package/dist/_esm5.processed/transports/smooth/segment_loader.js +53 -27
  648. package/dist/_esm5.processed/transports/smooth/utils.d.ts +2 -2
  649. package/dist/_esm5.processed/transports/smooth/utils.js +7 -5
  650. package/dist/_esm5.processed/transports/types.d.ts +11 -25
  651. package/dist/_esm5.processed/transports/utils/byte_range.js +1 -2
  652. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.d.ts +3 -3
  653. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +13 -7
  654. package/dist/_esm5.processed/transports/utils/check_isobmff_integrity.js +3 -3
  655. package/dist/_esm5.processed/transports/utils/find_complete_box.js +3 -2
  656. package/dist/_esm5.processed/transports/utils/generate_manifest_loader.d.ts +3 -3
  657. package/dist/_esm5.processed/transports/utils/generate_manifest_loader.js +18 -6
  658. package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.d.ts +2 -2
  659. package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.js +12 -11
  660. package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +1 -1
  661. package/dist/_esm5.processed/transports/utils/infer_segment_container.js +1 -3
  662. package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +4 -4
  663. package/dist/_esm5.processed/transports/utils/parse_text_track.js +9 -6
  664. package/dist/_esm5.processed/utils/are_codecs_compatible.js +5 -1
  665. package/dist/_esm5.processed/utils/array_includes.js +2 -6
  666. package/dist/_esm5.processed/utils/assert.js +3 -4
  667. package/dist/_esm5.processed/utils/base64.js +87 -29
  668. package/dist/_esm5.processed/utils/byte_parsing.js +60 -56
  669. package/dist/_esm5.processed/utils/cancellable_sleep.d.ts +1 -1
  670. package/dist/_esm5.processed/utils/create_cancellable_promise.d.ts +1 -1
  671. package/dist/_esm5.processed/utils/deep_merge.js +4 -4
  672. package/dist/_esm5.processed/utils/event_emitter.d.ts +1 -1
  673. package/dist/_esm5.processed/utils/get_fuzzed_delay.js +1 -1
  674. package/dist/_esm5.processed/utils/hash_buffer.js +1 -1
  675. package/dist/_esm5.processed/utils/initialization_segment_cache.d.ts +2 -2
  676. package/dist/_esm5.processed/utils/languages/index.d.ts +4 -2
  677. package/dist/_esm5.processed/utils/languages/index.js +2 -2
  678. package/dist/_esm5.processed/utils/languages/normalize.d.ts +2 -1
  679. package/dist/_esm5.processed/utils/languages/normalize.js +5 -3
  680. package/dist/_esm5.processed/utils/logger.js +7 -14
  681. package/dist/_esm5.processed/utils/object_assign.js +5 -5
  682. package/dist/_esm5.processed/utils/object_values.d.ts +1 -1
  683. package/dist/_esm5.processed/utils/object_values.js +2 -3
  684. package/dist/_esm5.processed/utils/ranges.d.ts +2 -1
  685. package/dist/_esm5.processed/utils/ranges.js +19 -23
  686. package/dist/_esm5.processed/utils/reference.d.ts +3 -3
  687. package/dist/_esm5.processed/utils/reference.js +1 -3
  688. package/dist/_esm5.processed/utils/request/fetch.d.ts +1 -1
  689. package/dist/_esm5.processed/utils/request/fetch.js +34 -23
  690. package/dist/_esm5.processed/utils/request/index.d.ts +6 -3
  691. package/dist/_esm5.processed/utils/request/index.js +2 -2
  692. package/dist/_esm5.processed/utils/request/xhr.d.ts +1 -1
  693. package/dist/_esm5.processed/utils/request/xhr.js +28 -17
  694. package/dist/_esm5.processed/utils/retry_promise_with_backoff.d.ts +2 -2
  695. package/dist/_esm5.processed/utils/slice_uint8array.js +3 -3
  696. package/dist/_esm5.processed/utils/starts_with.js +3 -3
  697. package/dist/_esm5.processed/utils/string_parsing.js +16 -18
  698. package/dist/_esm5.processed/utils/task_canceller.js +1 -2
  699. package/dist/_esm5.processed/utils/uniq.d.ts +1 -1
  700. package/dist/_esm5.processed/utils/uniq.js +4 -3
  701. package/dist/_esm5.processed/utils/weak_map_memory.js +0 -1
  702. package/dist/_esm5.processed/utils/wrapInPromise.d.ts +1 -1
  703. package/dist/mpd-parser.wasm +0 -0
  704. package/dist/rx-player.js +345 -236
  705. package/dist/rx-player.min.js +1 -1
  706. package/experimental/features/index.d.ts-E +16 -0
  707. package/experimental/features/index.js-E +16 -0
  708. package/experimental/index.d.ts +1 -1
  709. package/experimental/index.d.ts-E +16 -0
  710. package/experimental/index.js +1 -1
  711. package/experimental/index.js-E +16 -0
  712. package/experimental/tools/VideoThumbnailLoader/index.d.ts-E +18 -0
  713. package/experimental/tools/VideoThumbnailLoader/index.js-E +18 -0
  714. package/experimental/tools/index.d.ts-E +16 -0
  715. package/experimental/tools/index.js-E +16 -0
  716. package/features/index.d.ts-E +16 -0
  717. package/features/index.js-E +16 -0
  718. package/logger/index.d.ts-E +17 -0
  719. package/logger/index.js-E +17 -0
  720. package/minimal/index.d.ts-E +17 -0
  721. package/minimal/index.js-E +17 -0
  722. package/package.json +29 -14
  723. package/tools/TextTrackRenderer.d.ts-E +18 -0
  724. package/tools/TextTrackRenderer.js-E +18 -0
  725. package/tools/index.d.ts-E +16 -0
  726. package/tools/index.js-E +16 -0
  727. package/tools/string-utils.d.ts-E +18 -0
  728. package/tools/string-utils.js-E +18 -0
  729. package/types/index.d.ts-E +16 -0
  730. package/types/index.js-E +15 -0
@@ -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={9770:function(e,t,n){"use strict";n.d(t,{j:function(){return a},t:function(){return o}});var r=n(6787),i=n(2186).A?void 0:window,a=void 0===i?void 0:(0,r.A)(i.MediaSource)?(0,r.A)(i.MozMediaSource)?(0,r.A)(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}},443:function(e,t,n){"use strict";n.d(t,{A7:function(){return y},Fr:function(){return c},NV:function(){return g},P5:function(){return m},Pb:function(){return v},ZN:function(){return p},dX:function(){return f},gm:function(){return d},h$:function(){return l},hF:function(){return h},lw:function(){return u},op:function(){return s},qe:function(){return A}});var r,i,a,o=n(2186),s=!1,u=!1,l=!1,d=!1,c=!1,f=!1,v=!1,p=!1,h=!1,m=!1,g=!1,y=!1,A=!1;o.A||(void 0!==window.MSInputMethodContext&&void 0!==document.documentMode?(u=!0,l=!0):"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)?l=!0:-1!==navigator.userAgent.toLowerCase().indexOf("edg/")?s=!0:-1!==navigator.userAgent.toLowerCase().indexOf("firefox")?d=!0:"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)?f=!0:(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())||/Safari\/(\d+)/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&-1!==(null===(a=navigator.vendor)||void 0===a?void 0:a.indexOf("Apple"))&&!/Chrome\/(\d+)/.test(navigator.userAgent)&&!/Chromium\/(\d+)/.test(navigator.userAgent))&&(c=!0),/SamsungBrowser/.test(navigator.userAgent)&&(v=!0),-1!==navigator.userAgent.indexOf("PlayStation 5")?y=!0:/Tizen/.test(navigator.userAgent)?p=!0:/[Ww]eb[O0]S/.test(navigator.userAgent)?(h=!0,/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent)||/[Cc]hr[o0]me\/87/.test(navigator.userAgent)||(/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent)||/[Cc]hr[o0]me\/79/.test(navigator.userAgent))):-1!==navigator.userAgent.indexOf("NETTV")&&-1!==navigator.userAgent.indexOf("Philips")?g=!0:/[Pp]anasonic/.test(navigator.userAgent)?m=!0:-1!==navigator.userAgent.indexOf("Xbox")&&(A=!0))},3116:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787);function a(e){var t=e.textTracks;if(!(0,i.A)(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.A.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},5121:function(e,t,n){"use strict";n.d(t,{Ah:function(){return _},Bi:function(){return P},G1:function(){return w},HQ:function(){return R},ID:function(){return M},R5:function(){return x},Sb:function(){return p},VS:function(){return C},Vb:function(){return y},XC:function(){return E},Z1:function(){return T},bF:function(){return S},c_:function(){return b},g9:function(){return D},jf:function(){return f},ng:function(){return g},o8:function(){return m},qF:function(){return I},rR:function(){return A},yS:function(){return k}});var r=n(5151),i=n(2384),a=n(6787),o=n(8060),s=n(8315),u=n(2186),l=["","webkit","moz","ms"],d=u.A||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function c(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 f(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((void 0===t?l:t).map((function(e){return e+n})))}),[])}(e,t);return function(e,t,a){if(!a.isCancelled()){if(e instanceof HTMLElement){if(void 0===n&&(n=c(e,r)),!(0,i.A)(n))return void 0;e.addEventListener(n,t),a.register((function(){void 0!==n&&e.removeEventListener(n,t)}))}r.forEach((function(n){var r=!1;"function"==typeof e.addEventListener?e.addEventListener(n,t):(r=!0,e["on"+n]=t),a.register((function(){"function"==typeof e.removeEventListener&&e.removeEventListener(n,t),r&&delete e["on"+n]}))}))}}}function v(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,i.A)(t)?t+"Hidden":"hidden",a=(0,i.A)(t)?t+"visibilitychange":"visibilitychange",o=document[r],u=new s.A(!o,e);return N(document,a,(function(){var e=!document[r];u.setValueIfChanged(e)}),e),u}function p(e){var t,n=v(e),i=new s.A(!0,e);return e.register((function(){clearTimeout(t),t=void 0})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=r.A.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){i.setValueIfChanged(!1)}),n)}i.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),i}function h(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function m(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=new s.A({isEnabled:r,pipWindow:null},t);return N(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),i}var a=document.pictureInPictureElement===n,o=new s.A({isEnabled:a,pipWindow:null},t);return N(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),N(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),o}function g(e,t){var n,i=v(t),a=new s.A(!0,t);return t.register((function(){clearTimeout(n),n=void 0})),i.onUpdate(o,{clearSignal:t}),e.onUpdate(o,{clearSignal:t}),o(),a;function o(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||i.getValue())a.setValueIfChanged(!0);else{var t=r.A.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){a.setValueIfChanged(!1)}),t)}}}function y(e,t,n){var r=new s.A(e.clientWidth*d,n),i=o.A;t.onUpdate(l,{clearSignal:n}),N(window,"resize",l,n);var u=window.setInterval(l,2e4);return l(),n.register((function(){i(),clearInterval(u)})),r;function l(){i();var n=t.getValue();if(n.isEnabled)if((0,a.A)(n.pipWindow))r.setValueIfChanged(1/0);else{var s=n.pipWindow,u=h(e,s),l=function(){r.setValueIfChanged(h(e,s)*d)};s.addEventListener("resize",l),i=function(){s.removeEventListener("resize",l),i=o.A},r.setValueIfChanged(u*d)}else r.setValueIfChanged(e.clientWidth*d)}}f(["loadedmetadata"]),f(["timeupdate"]);var A=f(["fullscreenchange","FullscreenChange"],l.concat("MS")),_=f(["addtrack"]),b=f(["removetrack"]),S=f(["sourceopen","webkitsourceopen"]),E=f(["sourceclose","webkitsourceclose"]),T=f(["sourceended","webkitsourceended"]),w=f(["update"]),k=f(["removesourcebuffer"]),I=f(["keymessage","message"]),x=f(["keyadded","ready"]),R=f(["keyerror","error"]),C=f(["keystatuseschange"]),M=f(["seeking"]),P=f(["seeked"]),D=f(["ended"]);function N(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2186:function(e,t){"use strict";var n="undefined"==typeof window;t.A=n},7913:function(e,t,n){"use strict";var r=n(443).ZN;t.A=r},7402:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{A:function(){return r}})},8068:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787);function a(e,t,n){if(e>=t)return r.A.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.A)(window.VTTCue)){if((0,i.A)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},2097:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(443);function i(){return r.Pb}},5151:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});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},MINIMUM_MAX_BUFFER_AHEAD:{text:120},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:5e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_CDN_DOWNGRADE_TIME:60,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_ENTER_BUFFER_BASED_ALGO:10,ABR_EXIT_BUFFER_BASED_ALGO:5,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},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,SEGMENT_SYNCHRONIZATION_DELAY:1500,MISSING_DATA_TRIGGER_SYNC_DELAY:.1,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_VIDEO_CODECS:['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'],EME_DEFAULT_AUDIO_CODECS:['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"],EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_DEFAULT_PLAYREADY_ROBUSTNESSES:["3000","2000"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready.recommendation","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_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_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8935);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=e[u];void 0===l&&(l={},e[u]=l),o(l,s[u])}else{var d;(0,i.A)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=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}(),u=new s},3568:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(7387),i=n(443);var a=n(79),o=n(8202);function s(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 u(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 d={language:a.language,id:l,normalized:(0,o.Ay)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:d,nativeTrack:a})}return n}function l(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 d="forced"===a.kind||void 0,c={language:a.language,forced:d,label:a.label,id:l,normalized:(0,o.Ay)(a.language),closedCaption:"captions"===a.kind};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],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?u(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?d(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?l(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.A)(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(){f(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,label:t.label,forced:t.forced,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.Ay)(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 v(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else f(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 f(this._textTracks);for(var r=(0,o.Ay)(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 v(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}f(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=u(e._nativeAudioTracks);if(s(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=u(e._nativeAudioTracks);if(s(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=l(e._nativeTextTracks);if(s(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=l(e._nativeTextTracks);if(s(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=d(e._nativeVideoTracks);if(s(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=d(e._nativeVideoTracks);if(s(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){!function(e,t){for(var n=0;n<e.length;n++)i.ZN&&n===t||(e[n].enabled=!1);t<0||t>=e.length||(e[t].enabled=!0)}(this._audioTracks.map((function(e){return e.nativeTrack})),e)},t}(a.A);function f(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function v(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}}},5283:function(e,t,n){"use strict";n.d(t,{A:function(){return i},c:function(){return a}});var r=n(7365);function i(e){var t=r.A.getState(e);return null===t?null:[t.mediaKeySystemAccess.keySystem,t.mediaKeySystemAccess.getConfiguration()]}function a(e){var t=r.A.getState(e);return null==t?null:t.keySystemOptions.type}},6699:function(e,t,n){"use strict";n.d(t,{Ay:function(){return Mt}});var r,i=n(467),a=n(7387),o=n(4756),s=n.n(o),u=n(5575),l=n(7994),d=n(6787),c=n(443),f=n(5121),v=n(2186);if(!v.A){var p=window.WebKitMediaKeys;void 0!==p&&"function"==typeof p.isTypeSupported&&"function"==typeof p.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=p)}var h,m=n(2212),g=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 Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,m.A)(e,[{key:"keySystem",get:function(){return this._keyType}}])}();if(!v.A){var y=window.MSMediaKeys;void 0!==y&&void 0!==y.prototype&&"function"==typeof y.isTypeSupported&&"function"==typeof y.prototype.createSession&&(h=y)}var A=n(79),_=n(2507);function b(e){try{var t=e();return"object"==typeof t&&null!==t&&"function"==typeof t.then?t:Promise.resolve(t)}catch(e){return Promise.reject(e)}}var S,E=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._sessionClosingCanceller=new _.Ay,n.closed=new Promise((function(e){n._sessionClosingCanceller.signal.register((function(){return e()}))})),n.update=function(e){return new Promise((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,a.A)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((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),f.qF(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"message",e)}),n._sessionClosingCanceller.signal),f.R5(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyadded",e)}),n._sessionClosingCanceller.signal),f.HQ(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyerror",e)}),n._sessionClosingCanceller.signal),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._sessionClosingCanceller.cancel(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,m.A)(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:""}}])}(A.A),T=function(){function e(e){if(void 0===h)throw new Error("No MSMediaKeys API.");this._mediaKeys=new h(e)}var t=e.prototype;return t._setVideo=function(e){var t=this;return b((function(){t._videoElement=e,void 0!==t._videoElement.msSetMediaKeys&&t._videoElement.msSetMediaKeys(t._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(!v.A){var w=window.MozMediaKeys;void 0!==w&&void 0!==w.prototype&&"function"==typeof w.isTypeSupported&&"function"==typeof w.prototype.createSession&&(S=w)}var k=n(603),I=n(8060),x=n(4670);function R(e){return"function"==typeof e.webkitGenerateKeyRequest}var C=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=I.A,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,a.A)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,x.Es)(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 Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(A.A),M=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){var t=this;return b((function(){if(!R(e))throw new Error("Video not attached to the MediaKeys");t._videoElement=e}))},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new C(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var P=n(9828),D=n(5553);function N(e,t){var n=e;return b((function(){if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");n.webkitSetMediaKeys(t)}))}var O=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=I.A,i._closeSession=I.A,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,a.A)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((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{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((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(a=n._keyType,(0,P.A)(a,"com.apple.fps")){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,D.eR)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,x.Yg)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,x.kY)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,D.Wz)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,D.Wz)(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 Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,m.A)(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:""}}])}(A.A),L=function(){function e(e){if(void 0===r)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new r(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,Promise.resolve()},e}();function U(){if(void 0===r)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:r.isTypeSupported,createCustomMediaKeys:function(e){return new L(e)},setMediaKeys:function(e,t){if(null===t)return N(e,t);if(!(t instanceof L))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}var B=function(e){var t,n,i,a=F;if("standard"!==e&&("auto"!==e||(c.Fr||c.dX)&&void 0!==r)||!v.A&&(0,d.A)(navigator.requestMediaKeySystemAccess)){var o,s;if("webkit"===e&&void 0!==r){n=(0,f.jf)(["needkey"]);var p=U();o=p.isTypeSupported,s=p.createCustomMediaKeys,a=p.setMediaKeys,i="webkit"}else if(R(HTMLVideoElement.prototype)){n=(0,f.jf)(["needkey"]);var m={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 M(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof M))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}};o=m.isTypeSupported,s=m.createCustomMediaKeys,a=m.setMediaKeys,i="older-webkit"}else if(void 0!==r){n=(0,f.jf)(["needkey"]);var y=U();o=y.isTypeSupported,s=y.createCustomMediaKeys,a=y.setMediaKeys,i="webkit"}else if(c.lw&&void 0!==h){n=(0,f.jf)(["encrypted","needkey"]);var A={isTypeSupported:function(e,t){if(void 0===h)throw new Error("No MSMediaKeys API.");return void 0!==t?h.isTypeSupported(e,t):h.isTypeSupported(e)},createCustomMediaKeys:function(e){return new T(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof T))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}};o=A.isTypeSupported,s=A.createCustomMediaKeys,a=A.setMediaKeys,i="ms"}else if(void 0!==S){n=(0,f.jf)(["encrypted","needkey"]);var _={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){return b((function(){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)}))}};o=_.isTypeSupported,s=_.createCustomMediaKeys,a=_.setMediaKeys,i="moz"}else{n=(0,f.jf)(["encrypted","needkey"]);var E=window.MediaKeys,w=function(){if(void 0===E)throw new u.A("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===E.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.")}};o=function(e){return w(),(0,l.h)("function"==typeof E.isTypeSupported),E.isTypeSupported(e)},s=function(e){return w(),new E(e)},i="unknown"}t=function(e,t){if(!o(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,u=r.initDataTypes,l=r.distinctiveIdentifier,d=!0;if(d=(d=d&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var c={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(c.videoCapabilities=i),void 0!==a&&(c.audioCapabilities=a);var f=s(e);return Promise.resolve(new g(e,f,c))}}return Promise.reject(new Error("Unsupported configuration"))}}else t=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)},n=(0,f.jf)(["encrypted"]),i="standard";return{requestMediaKeySystemAccess:t,onEncrypted:n,setMediaKeys:a,implementation:i}}("auto");function F(e,t){try{var n,r=e;return"function"==typeof r.setMediaKeys?n=r.setMediaKeys(t):"function"==typeof r.webkitSetMediaKeys?n=r.webkitSetMediaKeys(t):"function"==typeof r.mozSetMediaKeys?n=r.mozSetMediaKeys(t):"function"==typeof r.msSetMediaKeys&&null!==t&&(n=r.msSetMediaKeys(t)),"object"==typeof n&&null!==n&&"function"==typeof n.then?n:Promise.resolve(n)}catch(e){return Promise.reject(e)}}var V=B,z=n(9477),K=n(2948),W=n(987),G=(0,D.mq)((0,x.eb)("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,W.A)(t.data,r.data))return!0}return!1}function q(e){var t=e.initData,n=e.initDataType;if(null==t)return z.A.warn("Compat: No init data found on media encrypted event."),null;var r=function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,D.mq)(e,n+4)!==G)return z.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,D.mq)(new Uint8Array(e),n);if(n+r>e.length)return z.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,K.L)(i,8),data:i};H(t,a)?z.A.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(z.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:r}}var j=n(5151),Y=n(1956),Q=n(1858),$=n(1729),X=n(4031),Z=n(7365);function J(e){return Z.A.setState(e,null),V.setMediaKeys(e,null).then((function(){z.A.info("DRM: MediaKeys disabled with success")})).catch((function(e){z.A.error("DRM: Could not disable MediaKeys",e instanceof Error?e:"Unknown Error")}))}function ee(){return(ee=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.emeImplementation,a=n.keySystemOptions,o=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,d=Z.A.getState(t),c=null!==d&&d.loadedSessionsStore!==o?d.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,c;case 5:if(!r.isCancelled()){e.next=7;break}throw r.cancellationError;case 7:if(Z.A.setState(t,{emeImplementation:i,keySystemOptions:a,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:o}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:z.A.info("DRM: Attaching MediaKeys to the media element"),i.setMediaKeys(t,l).then((function(){z.A.info("DRM: MediaKeys attached with success")})).catch((function(e){z.A.error("DRM: Could not set MediaKeys",e instanceof Error?e:"Unknown Error")}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(z.A.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,X.A)(n,"expired")?(z.A.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,X.A)(n,"internal-error")?(z.A.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(z.A.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function ne(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?re(i,t):null===a?(z.A.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),re(i,t)):function(e,t,n,r){return ie.apply(this,arguments)}(i,a,t,r)}function re(e,t){z.A.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function ie(){return ie=(0,i.A)(s().mark((function e(t,n,r,a){var o,u,l,d,c,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return f=(0,i.A)(s().mark((function e(){var i,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return z.A.info("DRM: Removing previous persistent session."),null!==(i=n.get(r))&&n.delete(i.sessionId),e.prev=5,e.next=8,t.closeSession(o.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===o.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(o.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return u=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:u});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),f.apply(this,arguments)},c=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(z.A.info("DRM: Creating persistent MediaKeySession"),o=t.createSession(r,"persistent-license"),null!==(u=n.getAndReuse(r))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:o});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(o.mediaKeySession,u.sessionId);case 12:if(l=e.sent){e.next=19;break}return z.A.warn("DRM: No data stored for the loaded session"),n.delete(u.sessionId),t.removeSessionWithoutClosingIt(o.mediaKeySession),d=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!l||!te(o.mediaKeySession)){e.next=23;break}return n.add(r,r.keyIds,o.mediaKeySession),z.A.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:o});case 23:return z.A.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",c());case 27:return e.prev=27,e.t0=e.catch(9),z.A.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",c());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),ie.apply(this,arguments)}function ae(e,t){return oe.apply(this,arguments)}function oe(){return(oe=(0,i.A)(s().mark((function e(t,n){var r,i,a,o,u;return s().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(z.A.info("DRM: LSS cache limit exceeded",n,t.getLength()),r=[],i=t.getAll().slice(),a=i.length-n,o=0;o<a;o++)u=i[o],r.push(t.closeSession(u.mediaKeySession));return e.next=9,Promise.all(r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e,t,n,r,i){return ue.apply(this,arguments)}function ue(){return(ue=(0,i.A)(s().mark((function e(t,n,r,i,a){var o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,u=n.loadedSessionsStore,l=n.persistentSessionsStore,null===(d=u.reuse(t))){e.next=11;break}if(!te(o=d.mediaKeySession)){e.next=10;break}return z.A.info("DRM: Reuse loaded session",o.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:o,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==l&&""!==d.mediaKeySession.sessionId&&l.delete(d.mediaKeySession.sessionId);case 11:if(null===o){e.next=16;break}return e.next=14,u.closeSession(o);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,ae(u,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,ne(n,t,r,a);case 22:return c=e.sent,e.abrupt("return",{type:c.type,value:{mediaKeySession:c.value.mediaKeySession,sessionType:c.value.sessionType,keySessionRecord:c.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var le='<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>ckB07BNLskeUq0qd83fTbA==</KID><DS_ID>yYIPDBca1kmMfL60IsfgAQ==</DS_ID><CUSTOMATTRIBUTES xmlns=""><encryptionref>312_4024_2018127108</encryptionref></CUSTOMATTRIBUTES><CHECKSUM>U/tsUYRgMzw=</CHECKSUM></DATA></WRMHEADER>';function de(e){var t,n,r,i,a,o,s=(0,x.kY)(e),u=(0,D.WO)(s.length),l=new Uint8Array([1,0]),d=new Uint8Array([1,0]),c=(0,D.Wz)(s.length+6),f=(0,D.xW)(c,d,l,u,s),v=(0,x.aT)("9a04f07998404286ab92e65be0885f95");return t=f,n=v,r=(0,x.eb)("pssh"),i=new Uint8Array([0,0,0,0]),a=(0,D.KS)(t.length),o=(0,D.KS)(32+t.length),(0,D.xW)(o,r,i,n,a,t)}var ce=n(3262);function fe(e,t,n){var r=t.getConfiguration();if(c.lw||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 ve(e,t,n){var r=["temporary"],i="optional",a="optional";!0===n.persistentLicense&&(i="required",r.push("persistent-license")),!0===n.persistentStateRequired&&(i="required"),!0===n.distinctiveIdentifierRequired&&(a="required");var o,s,u=j.A.getCurrent(),l=u.EME_DEFAULT_AUDIO_CODECS,c=u.EME_DEFAULT_VIDEO_CODECS,f=u.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,v=u.EME_DEFAULT_PLAYREADY_ROBUSTNESSES;o=(0,d.A)(n.videoRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.videoRobustnesses,s=(0,d.A)(n.audioRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.audioRobustnesses,0===o.length&&o.push(void 0),0===s.length&&s.push(void 0);var p={initDataTypes:["cenc"],videoCapabilities:(0,ce.A)(o,(function(e){return c.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),audioCapabilities:(0,ce.A)(s,(function(e){return l.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),distinctiveIdentifier:a,persistentState:i,sessionTypes:r};return[p,Object.assign(Object.assign({},p),{audioCapabilities:void 0,videoCapabilities:void 0})]}function pe(e,t,n){z.A.info("DRM: Searching for compatible MediaKeySystemAccess");var r=Z.A.getState(e);if(null!==r&&V.implementation===r.emeImplementation.implementation){var a=fe(t,r.mediaKeySystemAccess,r.keySystemOptions);if(null!==a)return z.A.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var o=t.reduce((function(e,t){var n,r=j.A.getCurrent().EME_KEY_SYSTEMS[t.type];if(null!=r)n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}}));else{var i=function(e){for(var t=j.A.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,X.A)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return u(0);function u(e){return l.apply(this,arguments)}function l(){return(l=(0,i.A)(s().mark((function e(t){var r,i,a,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=o.length)){e.next=2;break}throw new Y.A("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=V.requestMediaKeySystemAccess){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=o[t],i=r.keyName,a=r.keyType,l=r.keySystemOptions,d=ve(i,a,l),z.A.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+o.length),e.prev=7,e.next=10,he(a,d);case 10:return c=e.sent,z.A.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:c}});case 15:if(e.prev=15,e.t0=e.catch(7),z.A.debug("DRM: Rejected access to keysystem",a,t+1),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)}}function he(e,t){return me.apply(this,arguments)}function me(){return(me=(0,i.A)(s().mark((function e(t,n){var r,i,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V.requestMediaKeySystemAccess(t,n);case 2:if(r=e.sent,s=t,!c.op||-1===s.indexOf("playready")){e.next=18;break}return e.prev=4,e.next=7,r.createMediaKeys();case 7:return i=e.sent,a=i.createSession(),o=de(le),e.next=12,a.generateRequest("cenc",o);case 12:e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(4),z.A.debug("DRM: KeySystemAccess was granted but it is not usable"),e.t0;case 18:return e.abrupt("return",r);case 19:case"end":return e.stop()}var s}),e,null,[[4,14]])})))).apply(this,arguments)}var ge=n(8797);function ye(e,t,n){var r;z.A.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){z.A.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,D.mq)(e,i+4)!==G)throw z.A.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,D.mq)(new Uint8Array(e),i);if(i+a>e.length)throw z.A.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,ge.fP)(o),u=null===s?void 0:o[s[1]];z.A.info("Compat: CENC PSSH found with version",u),void 0===u?z.A.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,D.xW)(n,o):1===u?(z.A.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):z.A.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,D.xW)(r,o);i+=a}if(i!==e.length)throw z.A.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,D.xW)(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 z.A.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}var Ae=100;function _e(e,t){return be.apply(this,arguments)}function be(){return(be=(0,i.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z.A.info("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 Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,Ae);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Se=n(2432);function Ee(e){var t=new _.Ay;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,i.A)(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,Se.A)(1e3,t.signal);case 3:return e.next=5,r();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof _.AL)){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",z.A.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function r(){return a.apply(this,arguments)}function a(){return(a=(0,i.A)(s().mark((function n(){return s().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,Se.A)(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 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){if("string"==typeof e)return we(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?we(e,t):void 0}}(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 we(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ke(e,t){for(var n,r,i=function(){var e=r.value;if(!t.some((function(t){return(0,W.A)(t,e)})))return{v:!1}},a=Te(e);!(r=a()).done;)if(n=i())return n.v;return!0}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){if("string"==typeof e)return xe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}(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 xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=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=Ie(this._keyIds);!(t=n()).done;){var r=t.value;if((0,W.A)(r,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&&t.length>0){if(null!==this._keyIds&&ke(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return ke(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?ke(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();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){if("string"==typeof e)return Me(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var Pe=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);z.A.debug("DRM-LSS: calling `createSession`",t);var i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,d.A)(i.closed)||i.closed.then((function(){z.A.info("DRM-LSS: session was closed, removing it.",i.sessionId);var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){z.A.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),this._storage.push(Object.assign({},a)),z.A.debug("DRM-LSS: MediaKeySession added",a.sessionType,this._storage.length),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),z.A.debug("DRM-LSS: Reusing session:",n.mediaKeySession.sessionId,n.sessionType),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Ce(this._storage);case 1:if((o=a()).done){e.next=8;break}if((u=o.value).mediaKeySession!==t){e.next=6;break}return i=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return z.A.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",ye(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,ye(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,i.A)(s().mark((function e(t,n){var r,i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Ce(this._storage);case 1:if((a=i()).done){e.next=8;break}if((o=a.value).mediaKeySession!==t){e.next=6;break}return r=o,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return z.A.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",_e(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,_e(t,n);case 17:u=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",u);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",u);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,i.A)(s().mark((function e(t){var n,r,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Ce(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 z.A.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12: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,i.A)(s().mark((function e(){var t,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,z.A.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.removeSessionWithoutClosingIt=function(e){(0,l.h)(""===e.sessionId,"Initialized `MediaKeySession`s should always be properly closed");for(var t=this._storage.length-1;t>=0;t--){if(this._storage[t].mediaKeySession===e)return z.A.debug("DRM-LSS: Removing session without closing it",e.sessionId),this._storage.splice(t,1),!0}return!1},t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,i.A)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),De(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function De(e){return Ne.apply(this,arguments)}function Ne(){return(Ne=(0,i.A)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z.A.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,Ee(t);case 4:return z.A.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),z.A.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Oe(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t|=0;return t}var Le=n(2384),Ue=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,k.i)(this.initData)},e.decode=function(e){return(0,k.K)(e)},e}();function Be(e,t){var n,r;return null!==(r=null!==(n=Fe(e,t))&&void 0!==n?n:Fe(t,e))&&void 0!==r&&r}function Fe(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?Ue.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?Ue.decode(a.data):a.data.initData;if(!(0,W.A)(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 d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?Ue.decode(u.data):u.data.initData,c=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?Ue.decode(l.data):l.data.initData;if(!(0,W.A)(d,c))return!1;break}}if(r===t.length)return null}return!0}}return null}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){if("string"==typeof e)return ze(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ze(e,t):void 0}}(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 ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ke=function(){function e(e){!function(e){(0,l.A)(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){z.A.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?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){var r;if(!(0,d.A)(n)&&(0,Le.A)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,s=this._entries[a];if((null!==(r=s.version)&&void 0!==r?r:-1)>=o&&i===s.sessionId)return;z.A.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else z.A.info("DRM-PSS: Add new session",i);var u=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new Ue(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:u,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new Ue(e)})),values:u,initDataType:e.type}),this._save()}else z.A.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];z.A.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else z.A.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){z.A.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(z.A.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:Oe(t)}}return n}for(var i,a=function(){var n=t._entries[o];if(n.initDataType===e.type)switch(n.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,r=(0,k.i)(e),i=Ve(n.keyIds);!(t=i()).done;){var a=t.value;if("string"==typeof a){if(r===a)return!0}else if((0,W.A)(a.initData,e))return!0}return!1})))return{v:o}}else if(Be(e.values.getFormattedValues(),n.values))return{v:o};break;case 3:if(Be(e.values.getFormattedValues(),n.values))return{v:o};break;case 2:var i=r(),a=i.initData,s=i.initDataHash;if(n.initDataHash===s)try{var u="string"==typeof n.initData?Ue.decode(n.initData):n.initData.initData;if((0,W.A)(u,a))return{v:o}}catch(e){z.A.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var l=r(),d=l.initData,c=l.initDataHash;if(n.initDataHash===c){if(void 0===n.initData.length)return{v:o};if((0,W.A)(n.initData,d))return{v:o}}break;default:var f=r().initDataHash;if(n.initData===f)return{v:o}}},o=0;o<this._entries.length;o++)if(i=a())return i.v;return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){z.A.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var We=new WeakMap,Ge={prepare:function(e){We.set(e,null)},set:function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=Oe(n);We.set(e,{hash:r,serverCertificate:n})},hasOne:function(e){var t=We.get(e);return void 0!==t&&(null!==t||void 0)},has:function(e,t){var n=We.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(Oe(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 He(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new Y.A("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return z.A.debug("DRM: Set the given license storage"),new Ke(t)}function qe(e,t,n){return je.apply(this,arguments)}function je(){return(je=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u,l,f,v,p,h,m;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(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,o=a.options,u=a.mediaKeySystemAccess,l=Z.A.getState(t),f=He(o),c.hF||c.NV||c.P5||null===l||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(v=l.mediaKeys,p=l.loadedSessionsStore,!1!==Ge.hasOne(v)&&((0,d.A)(o.serverCertificate)||!Ge.has(v,o.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:u,stores:{loadedSessionsStore:p,persistentSessionsStore:f},options:o});case 12:return e.next=14,Ye(u);case 14:return h=e.sent,z.A.info("DRM: MediaKeys created with success"),m=new Pe(h),e.abrupt("return",{mediaKeys:h,mediaKeySystemAccess:u,stores:{loadedSessionsStore:m,persistentSessionsStore:f},options:o});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(e){return Qe.apply(this,arguments)}function Qe(){return(Qe=(0,i.A)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z.A.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 Y.A("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function $e(){return($e=(0,i.A)(s().mark((function e(t,n,r){var i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe(t,n,r);case 2:if(i=e.sent,a=i.mediaKeys,!(null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys)){e.next=13;break}if(z.A.debug("DRM: Disabling old MediaKeys"),!c.hF){e.next=12;break}return e.next=10,J(t);case 10:e.next=13;break;case 12:J(t).catch(I.A);case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xe=n(8593),Ze=n(7021),Je=n(8801);function et(e,t,n){var r=e*Math.pow(2,t-1),i=(0,Ze.A)(r);return Math.min(i,n)}var tt=n(2038),nt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf(r,t.prototype),r.reason=n,r}return(0,a.A)(t,e),t}((0,Xe.A)(Error)),rt={EXPIRED:"expired",INTERNAL_ERROR:"internal-error",OUTPUT_RESTRICTED:"output-restricted"};function it(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],d=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],f=function(e,t){return-1!==e.indexOf("playready")&&(c.h$||c.op)?(0,x.KZ)(t):t}(n,new Uint8Array(r[1])),v={keyId:f.buffer,keyStatus:i};switch(z.A.hasLevel("DEBUG")&&z.A.debug("DRM: key status update ("+(0,x.My)(f)+"): "+i),i){case rt.EXPIRED:var p=new Y.A("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,x.My)(f)+")",{keyStatuses:[v].concat(d)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new nt(p);case"fallback":u.push(f);break;default:"continue"===s||void 0===s?l.push(f):(0,tt.A)(s)}d.push(v);break;case rt.INTERNAL_ERROR:if(!0!==a.keyInternalError)throw new Y.A("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,x.My)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;case rt.OUTPUT_RESTRICTED:if(!0!==a.keyOutputRestricted)throw new Y.A("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,x.My)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;default:l.push(f)}})),d.length>0&&(r=new Y.A("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:d})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var at=f.HQ,ot=f.qF,st=f.VS;function ut(e,t,n,r,a){z.A.info("DRM: Binding session events",e.sessionId);var o=t.getLicenseConfig,u=void 0===o?{}:o,l=new _.Ay;return l.linkToSignal(a),(0,d.A)(e.closed)||e.closed.then((function(){return l.cancel()})).catch((function(e){a.isCancelled()||(l.cancel(),r.onError(e))})),at(e,(function(e){l.cancel(),r.onError(new Y.A("KEY_ERROR",e.type))}),l.signal),st(e,(function(e){(function(e){return c.apply(this,arguments)})(e).catch((function(e){a.isCancelled()||l.isUsed()&&e instanceof _.AK||(l.cancel(),r.onError(e))}))}),l.signal),ot(e,(function(n){var a,o=n,c=new Uint8Array(o.message),f=(0,Le.A)(o.messageType)?o.messageType:"license-request";z.A.info("DRM: Received message event, type "+f,e.sessionId),function(e,t,n){var r=t.baseDelay,a=t.maxDelay,o=t.totalRetry,u=t.shouldRetry,l=t.onRetry,c=0;return f();function f(){return v.apply(this,arguments)}function v(){return(v=(0,i.A)(s().mark((function t(){var i,v,p;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===n.cancellationError){t.next=2;break}throw n.cancellationError;case 2:return t.prev=2,t.next=5,e();case 5:return i=t.sent,t.abrupt("return",i);case 9:if(t.prev=9,t.t0=t.catch(2),null===n.cancellationError){t.next=13;break}throw n.cancellationError;case 13:if(!(!(0,d.A)(u)&&!u(t.t0)||c++>=o)){t.next=15;break}throw t.t0;case 15:return"function"==typeof l&&l(t.t0,c),v=et(r,c,a),t.next=19,(0,Je.A)(v);case 19:return p=f(),t.abrupt("return",p);case 21:case"end":return t.stop()}}),t,null,[[2,9]])})))).apply(this,arguments)}}((function(){return function(e,n){var r;return new Promise((function(i,a){try{z.A.debug("DRM: Calling `getLicense`",n);var o=t.getLicense(e,n),s=(0,d.A)(u.timeout)?1e4:u.timeout;s>=0&&(r=setTimeout((function(){a(new vt('"getLicense" timeout exceeded ('+s+" ms)"))}),s)),Promise.resolve(o).then(l,c)}catch(e){c(e)}function l(e){void 0!==r&&clearTimeout(r),i(e)}function c(e){void 0!==r&&clearTimeout(r),a(e)}}))}(c,f)}),{totalRetry:null!=(a=u.retry)?a:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof vt||(0,d.A)(e)||!0!==e.noRetry},onRetry:function(e){return r.onWarning(lt(e))}},l.signal).then((function(t){if(l.isUsed())return Promise.resolve();if((0,d.A)(t))z.A.info("DRM: No license given, skipping session.update");else try{return dt(e,t)}catch(e){l.cancel(),r.onError(e)}})).catch((function(e){if(!l.isUsed()){l.cancel();var t=lt(e);if(!(0,d.A)(e))if(!0===e.fallbackOnLastTry)return z.A.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),void r.onError(new ft(t));r.onError(t)}}))}),l.signal),void f();function c(){return c=(0,i.A)(s().mark((function n(r){var o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=function(){return(u=(0,i.A)(s().mark((function n(){var i,o;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!l.isUsed()){n.next=2;break}return n.abrupt("return");case 2:if("function"!=typeof t.onKeyStatusesChange){n.next=24;break}return n.prev=3,n.next=6,t.onKeyStatusesChange(r,e);case 6:if(i=n.sent,!l.isUsed()){n.next=9;break}return n.abrupt("return");case 9:n.next=18;break;case 11:if(n.prev=11,n.t0=n.catch(3),!a.isCancelled()){n.next=15;break}return n.abrupt("return");case 15:throw o=new Y.A("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error"),!(0,d.A)(n.t0)&&(0,Le.A)(n.t0.message)&&(o.message=n.t0.message),o;case 18:if(!(0,d.A)(i)){n.next=22;break}z.A.info("DRM: No license given, skipping session.update"),n.next=24;break;case 22:return n.next=24,dt(e,i);case 24:case"end":return n.stop()}}),n,null,[[3,11]])})))).apply(this,arguments)},o=function(){return u.apply(this,arguments)},z.A.info("DRM: keystatuseschange event received",e.sessionId),n.next=5,Promise.all([o(),Promise.resolve(f())]);case 5:case"end":return n.stop()}}),n)}))),c.apply(this,arguments)}function f(){if(!l.isUsed()&&0!==e.keyStatuses.size){var i=it(e,t,n),a=i.warning,o=i.blacklistedKeyIds,s=i.whitelistedKeyIds;void 0!==a&&(r.onWarning(a),l.isUsed())||r.onKeyUpdate({whitelistedKeyIds:s,blacklistedKeyIds:o})}}}function lt(e){if(e instanceof vt)return new Y.A("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new Y.A("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,d.A)(e)&&(0,Le.A)(e.message)&&(t.message=e.message),t}function dt(e,t){return ct.apply(this,arguments)}function ct(){return(ct=(0,i.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z.A.info("DRM: Updating MediaKeySession with message"),e.prev=1,e.next=4,t.update(n);case 4:e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.toString():"`session.update` failed",new Y.A("KEY_UPDATE_ERROR",r);case 10:z.A.info("DRM: MediaKeySession update succeeded.");case 11:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}var ft=function(e){function t(n){var r;return r=e.call(this,n.message)||this,Object.setPrototypeOf(r,t.prototype),r.sessionError=n,r}return(0,a.A)(t,e),t}((0,Xe.A)(Error)),vt=function(e){function t(t){var n;return n=e.call(this,t)||this,Object.setPrototypeOf(n,ft.prototype),n.message=t,n}return(0,a.A)(t,e),t}((0,Xe.A)(Error)),pt=n(4637);function ht(e,t){return mt.apply(this,arguments)}function mt(){return(mt=(0,i.A)(s().mark((function e(t,n){var r,i;return s().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),z.A.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new Y.A("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function gt(e,t){return yt.apply(this,arguments)}function yt(){return(yt=(0,i.A)(s().mark((function e(t,n){var r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==Ge.hasOne(t)){e.next=3;break}return z.A.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 z.A.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return z.A.info("DRM: Setting server certificate on the MediaKeys"),Ge.prepare(t),e.prev=8,e.next=11,ht(t,n);case 11:return r=e.sent,Ge.set(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,pt.A)(e.t0)?e.t0:new Y.A("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)}var At=n(2137);function _t(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;z.A.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var bt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return D.xW.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return Be(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:Oe(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){if("string"==typeof e)return Et(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(e,t):void 0}}(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 Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Tt=function(e){function t(t,n){var r;r=e.call(this)||this,z.A.debug("DRM: Starting ContentDecryptor logic.");var i=new _.Ay;return r._currentSessions=[],r._canceller=i,r._initDataQueue=[],r._stateData={state:At.R.Initializing,isMediaKeysAttached:0,isInitDataQueueLocked:!0,data:null},r.error=null,V.onEncrypted(t,(function(e){z.A.debug("DRM: Encrypted event received from media element.");var t=q(e);null!==t&&r.onInitializationData(t)}),i.signal),function(e,t,n){return $e.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,d.A)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,P.A)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,P.A)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,P.A)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===At.R.Initializing&&(r._stateData={state:At.R.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:0,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,a.A)(t,e),t.hasEmeApis=function(){return!(0,d.A)(V.requestMediaKeySystemAccess)};var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==At.R.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(0===this._stateData.isMediaKeysAttached){var t=this._stateData.data,n=t.mediaElement,r=t.mediaKeysInfo,a=r.options,o=r.mediaKeys,u=r.mediaKeySystemAccess,l=r.stores;if(!(!0===a.disableMediaKeysAttachmentLock)||(this._stateData={state:At.R.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:1,data:{mediaKeysInfo:r,mediaElement:n}},this.trigger("stateChange",this._stateData.state),!this._isStopped())){this._stateData.isMediaKeysAttached=1;var c={emeImplementation:V,loadedSessionsStore:l.loadedSessionsStore,mediaKeySystemAccess:u,mediaKeys:o,keySystemOptions:a};z.A.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return ee.apply(this,arguments)}(n,c,this._canceller.signal).then((0,i.A)(s().mark((function t(){var n,i,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._stateData.isMediaKeysAttached=2,n=a.serverCertificate,(0,d.A)(n)){t.next=7;break}return t.next=5,gt(o,n);case 5:"error"===(i=t.sent).type&&e.trigger("warning",i.value);case 7:if(!e._isStopped()){t.next=9;break}return t.abrupt("return");case 9:u=e._stateData.state,e._stateData={state:At.R.ReadyForContent,isMediaKeysAttached:2,isInitDataQueueLocked:!1,data:{mediaKeysData:r}},u!==At.R.ReadyForContent&&e.trigger("stateChange",At.R.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 13:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)}))}}else z.A.warn("DRM: ContentDecryptor's `attach` method called more than once.")},n.dispose=function(){this.removeEventListener(),this._stateData={state:At.R.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 bt(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,i.A)(s().mark((function e(t,n){var r,i,a,o,u,l,d,c,f,v,p,h,m,g,y,A,_,b,S,E,T,w,k,I,R,C,M,P,D,N,O,L,U,B=this;return s().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===(o=(0,$.A)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(u=t.keyIds)){e.next=10;break}return void 0===t.content?z.A.warn("DRM: Unable to fallback from a non-decipherable quality."):It(t.content.manifest,t),e.abrupt("return");case 10:return o.record.associateKeyIds(u),void 0!==t.content&&(z.A.hasLevel("DEBUG")&&(l=u.reduce((function(e,t){return e+", "+(0,x.My)(t)}),""),z.A.debug("DRM: Blacklisting new key ids",l)),kt(t.content.manifest,[],u,[])),e.abrupt("return");case 13:e.next=42;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=42;break}d=t.content.period,c=this._currentSessions.filter((function(e){return"created-session"===e.source})),Ct(f=new Set,d),v=St(c);case 21:if((p=v()).done){e.next=42;break}h=p.value,m=Array.from(f),g=0,y=m;case 25:if(!(g<y.length)){e.next=40;break}if(A=y[g],!h.record.isAssociatedWithKeyId(A)){e.next=37;break}h.record.associateKeyIds(f.values()),_=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S.value,h.keyStatuses.whitelisted.some((function(e){return(0,W.A)(e,t)}))||h.keyStatuses.blacklisted.some((function(e){return(0,W.A)(e,t)}))||h.keyStatuses.blacklisted.push(t);case 2:case"end":return e.stop()}}),e)})),b=St(m);case 31:if((S=b()).done){e.next=35;break}return e.delegateYield(_(),"t0",33);case 33:e.next=31;break;case 35:return kt(t.content.manifest,h.keyStatuses.whitelisted,h.keyStatuses.blacklisted,[]),e.abrupt("return");case 37:g++,e.next=25;break;case 40:e.next=21;break;case 42:return this._lockInitDataQueue(),!0!==a.persistentLicense?E="temporary":wt(r)?E="persistent-license":(z.A.warn('DRM: Cannot create "persistent-license" session: not supported'),E="temporary"),T=j.A.getCurrent(),w=T.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,k=T.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,I="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:w,e.next=48,se(t,i,E,I,this._canceller.signal);case 48:if(R=e.sent,!this._isStopped()){e.next=51;break}return e.abrupt("return");case 51:if(C={record:R.value.keySessionRecord,source:R.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(C),M=R.value,P=M.mediaKeySession,D=M.sessionType,N=!1,ut(P,a,r.keySystem,{onKeyUpdate:function(e){var n=xt(t,C.record,a.singleLicensePer,"created-session"===C.source,e.whitelistedKeyIds,e.blacklistedKeyIds);if(C.record.associateKeyIds(n.whitelisted),C.record.associateKeyIds(n.blacklisted),C.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==C.record.getAssociatedKeyIds().length&&"persistent-license"===D&&null!==i.persistentSessionsStore&&!N){var r=i.persistentSessionsStore;_t(r,k-1),r.add(t,C.record.getAssociatedKeyIds(),P),N=!0}void 0!==t.content&&kt(t.content.manifest,n.whitelisted,n.blacklisted,[]),B._unlockInitDataQueue()},onWarning:function(e){B.trigger("warning",e)},onError:function(e){var n;if(e instanceof nt){z.A.warn("DRM: A session's closing condition has been triggered"),B._lockInitDataQueue();var r=B._currentSessions.indexOf(C);return r>=0&&B._currentSessions.splice(r),void 0!==t.content&&kt(t.content.manifest,[],[],C.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(P.sessionId),i.loadedSessionsStore.closeSession(P).catch((function(e){var t=e instanceof Error?e:"unknown error";z.A.warn("DRM: failed to close expired session",t)})).then((function(){return B._unlockInitDataQueue()})).catch((function(e){return B._onFatalError(e)})),void(B._isStopped()||B.trigger("warning",e.reason))}if(e instanceof ft){if(C.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;z.A.info("DRM: blacklisting Representations based on protection data."),It(a,t)}B._unlockInitDataQueue()}else B._onFatalError(e)}},this._canceller.signal),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==R.type){e.next=72;break}return O=t.values.constructRequestData(),e.prev=59,e.next=62,i.loadedSessionsStore.generateLicenseRequest(P,t.type,O);case 62:e.next=72;break;case 64:if(e.prev=64,e.t1=e.catch(59),null!==(L=i.loadedSessionsStore.getEntryForSession(P))&&"none"===L.closingStatus.type){e.next=71;break}return(U=this._currentSessions.indexOf(C))>=0&&this._currentSessions.splice(U,1),e.abrupt("return",Promise.resolve());case 71:throw new Y.A("KEY_GENERATE_REQUEST_ERROR",e.t1 instanceof Error?e.t1.toString():"Unknown error");case 72:return e.abrupt("return",Promise.resolve());case 73:case"end":return e.stop()}}),e,this,[[59,64]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,$.A)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,d.A)(a))return void 0===e.type||void 0===e.content?(z.A.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(z.A.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),It(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,i=function(){var e=r.value;if(t.some((function(t){return(0,W.A)(t,e)})))return{v:!0}},a=Te(e);!(r=a()).done;)if(n=i())return n.v;return!1}(e.keyIds,s)}else{var u=i.keyStatuses.whitelisted;o=!ke(e.keyIds,u)}if(o)return void 0===e.content?(z.A.error("DRM: Cannot forbid key id, the content is unknown."),!0):(z.A.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),kt(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return z.A.debug("DRM: Init data already processed. Skipping it."),!0;var l=this._currentSessions.indexOf(i);return-1===l?z.A.error("DRM: Unable to remove processed init data: not found."):(z.A.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(l,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed()){var t=e instanceof Error?e:new Q.A("NONE","Unknown decryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:At.R.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===At.R.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===At.R.Disposed||this._stateData.state===At.R.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(){2===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):z.A.error("DRM: Trying to unlock in the wrong state")},t}(A.A);function wt(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,X.A)(t,"persistent-license")}function kt(e,t,n,r){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var i=e.contentProtections.keyIds;if(void 0!==i)for(var a,o=St(i);!(a=o()).done;){for(var s,u=a.value,l=St(n);!(s=l()).done;){var d=s.value;if((0,W.A)(d,u.keyId))return!1}for(var c,f=St(t);!(c=f()).done;){var v=c.value;if((0,W.A)(v,u.keyId))return!0}for(var p,h=St(r);!(p=h()).done;){var m=p.value;if((0,W.A)(m,u.keyId))return}}return e.decipherable}))}function It(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i,a,o=function(){var e=a.value;if((void 0===t.type||e.type===t.type)&&t.values.getFormattedValues().every((function(t){return e.values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,W.A)(e.data,t.data)}))})))return{v:!1}},s=St(null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[]);!(a=s()).done;)if(i=o())return i.v;return e.decipherable}))}function xt(e,t,n,r,i,a){for(var o,s,u=[].concat(i,a),l=function(){var e=s.value;u.some((function(t){return(0,W.A)(t,e)}))||(z.A.hasLevel("DEBUG")&&z.A.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,x.My)(e)),u.push(e))},d=St(t.getAssociatedKeyIds());!(s=d()).done;)l();if(void 0!==n&&"init-data"!==n){var c=e.keyIds,f=e.content;if(void 0!==c){var v=c.filter((function(e){return!u.some((function(t){return(0,W.A)(t,e)}))}));v.length>0&&(z.A.hasLevel("DEBUG")&&z.A.debug("DRM: init data keys missing in the license, blacklisting them",v.map((function(e){return(0,x.My)(e)})).join(", ")),u.push.apply(u,v))}if(r&&void 0!==f)if("content"===n){for(var p,h=new Set,m=St(f.manifest.periods);!(p=m()).done;){Ct(h,p.value)}Rt(h,u)}else if("periods"===n)for(var g,y=St(f.manifest.periods);!(g=y()).done;){var A=g.value,_=new Set;if(Ct(_,A),(null===(o=e.content)||void 0===o?void 0:o.period.id)===A.id)Rt(_,u);else for(var b=Array.from(_),S=function(){var e=T[E];if(u.some((function(t){return(0,W.A)(t,e)})))return Rt(_,u),1},E=0,T=b;E<T.length&&!S();E++);}}return{whitelisted:i,blacklisted:u.slice(i.length)}}function Rt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return(0,W.A)(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Ct(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&&void 0!==o.contentProtections.keyIds)for(var s,u=St(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}var Mt=Tt},2137:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),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"}(r||(r={}))},7365:function(e,t){"use strict";var n=new WeakMap;t.A={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)}}},5963:function(e,t,n){"use strict";n.d(t,{A:function(){return m}});var r=n(7387),i=n(3116),a=n(9477),o=n(7994),s=n(6787),u=n(8315),l=n(2507),d=n(4640),c=n(5097),f=n(107),v=n(6899),p=n(3137),h=n(8345),m=function(e){function t(t){var n;return(n=e.call(this)||this)._settings=t,n._initCanceller=new l.Ay,n}(0,r.A)(t,e);var n=t.prototype;return n.prepare=function(){},n.start=function(e,t){var n=this,r=this._initCanceller.signal,s=this._settings,l=s.keySystems,d=s.speed,c=s.url;(0,i.A)(e);var f=new u.A(null);f.finish();var m=(0,v.A)(e,l,f,{onError:function(e){return n._onFatalError(e)},onWarning:function(e){return n.trigger("warning",e)}},r);(0,h.A)(e,(function(e){return n._onFatalError(e)}),r);var g=new p.A(t,null,d);g.addEventListener("stalled",(function(e){return n.trigger("stalled",e)})),g.addEventListener("unstalled",(function(){return n.trigger("unstalled",null)})),g.addEventListener("warning",(function(e){return n.trigger("warning",e)})),r.register((function(){g.destroy()})),g.start(),m.onUpdate((function(s,u){"uninitialized"!==s.initializationState.type&&(u(),a.A.info("Setting URL to HTMLMediaElement",c),e.src=c,r.register((function(){a.A.info("Init: Removing directfile src from media element",e.src),(0,i.A)(e)})),"awaiting-media-link"===s.initializationState.type?(s.initializationState.value.isMediaLinked.setValue(!0),m.onUpdate((function(r,i){"initialized"===r.initializationState.type&&(i(),n._seekAndPlay(e,t))}),{emitCurrentValue:!0,clearSignal:r})):((0,o.h)("initialized"===s.initializationState.type),n._seekAndPlay(e,t)))}),{emitCurrentValue:!0,clearSignal:r})},n.updateContentUrls=function(e,t){throw new Error("Cannot update content URL of directfile contents")},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.cancel(),this.trigger("error",e)},n._seekAndPlay=function(e,t){var n=this,r=this._initCanceller.signal,i=this._settings,o=i.autoPlay,u=i.startAt;(0,f.A)(e,t,(function(){a.A.debug("Init: Calculating initial time");var t=function(e,t){if((0,s.A)(t))return 0;if(!(0,s.A)(t.position))return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if("number"==typeof t.fromLastPosition)return(0,s.A)(n)||!isFinite(n)?(a.A.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0):Math.max(0,n+t.fromLastPosition);if("number"==typeof t.fromLivePosition){var r=e.seekable.length>0?e.seekable.end(0):n;return(0,s.A)(r)?(a.A.warn("startAt.fromLivePosition set but no known live position, beginning at 0."),0):Math.max(0,r+t.fromLivePosition)}if(null!=t.percentage){if((0,s.A)(n)||!isFinite(n))return a.A.warn("startAt.percentage set but no known duration, beginning at 0."),0;var i=t.percentage;return i>=100?n:i<=0?0:n*(+i/100)}return 0}(e,u);return a.A.debug("Init: Initial time calculated:",t),t}),o,(function(e){return n.trigger("warning",e)}),!0,r).autoPlayResult.then((function(){return(0,c.A)(t,e,!0,r).onUpdate((function(e,t){e&&(t(),n.trigger("loaded",{segmentBuffersStore:null}))}),{emitCurrentValue:!0,clearSignal:r})})).catch((function(e){r.isCancelled()||n._onFatalError(e)}))},t}(d.Y)},1737:function(e,t,n){"use strict";n.d(t,{A:function(){return nn}});var r=n(467),i=n(7387),a=n(4756),o=n.n(a);var s=n(443),u=s.A7,l=n(5151),d=n(5575),c=n(9477),f=n(7994),v=n(4339),p=n(8935),h=n(8315),m=n(2507),g=n(8060),y=n(3650),A=n(3786);function _(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 b=function(){function e(e){this._levelsMap=_(e).map((function(e){return e+4})),this._bitrates=e,this._lastUnsuitableQualityTimestamp=void 0,this._blockRaiseDelay=6e3,c.A.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}var t=e.prototype;return t.onAddedSegment=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null!=i){for(var s,u=-1,l=0;l<n.length;l++){var d=n[l];if(d===i)u=l;else if(d>i)break}if(u<0||n.length!==t.length)return c.A.error("ABR: Current Bitrate not found in the calculated levels"),void(this._currentEstimate=n[0]);void 0!==a&&(s=0===o?a.score:a.score/o);var f=isFinite(r)?r:0,v=performance.now();if(f<t[u]||void 0!==s&&s<1&&1===(null==a?void 0:a.confidenceLevel)){if((void 0===this._lastUnsuitableQualityTimestamp?-1:v-this._lastUnsuitableQualityTimestamp)<this._blockRaiseDelay+9e3){var p=this._blockRaiseDelay+3e3;this._blockRaiseDelay=Math.min(p,15e3),c.A.debug("ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality",this._blockRaiseDelay)}else{var h=this._blockRaiseDelay-1e3;this._blockRaiseDelay=Math.max(6e3,h),c.A.debug("ABR: Lowering quality in BufferBasedChooser",this._blockRaiseDelay)}this._lastUnsuitableQualityTimestamp=v;for(var m=(0,A.A)(n,(function(e){return e===i}))-1;m>=0;m--)if(f>=t[m])return void(this._currentEstimate=n[m]);this._currentEstimate=n[0]}else if(void 0!==this._lastUnsuitableQualityTimestamp&&v-this._lastUnsuitableQualityTimestamp<this._blockRaiseDelay||void 0===s||s<1.15||1!==(null==a?void 0:a.confidenceLevel))this._currentEstimate=i;else{var g=t[u],y=function(){for(var e=u+1;e<t.length;e++)if(t[e]>g)return e}();if(void 0!==y)if(r>=t[y])return c.A.debug("ABR: Raising quality in BufferBasedChooser",n[y]),void(this._currentEstimate=n[y]);this._currentEstimate=i}}else this._currentEstimate=n[0]},t.getLastEstimate=function(){return this._currentEstimate},e}(),S=n(1729),E=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}();function T(e){if(!(e.progress.length<5)){for(var t=new E(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 w(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var k=function(){function e(e,t){var n=l.A.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,d=e.position,f=e.duration,v=isFinite(u)?u:0,p=l.A.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(f)||v+d.last<f-p?!this._inStarvationMode&&v<=s.starvationGap?(c.A.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&v>=s.outOfStarvationGap&&(c.A.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(c.A.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&(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.last+u);if(1===l.length){var d=l[0],c=performance.now(),f=1.5*d.content.segment.duration;if(f=Math.min(f,3e3),f=Math.max(f,12e3),!(c-d.requestTimestamp<f)){var v=d.progress.length>0?d.progress[d.progress.length-1]:void 0,p=T(d);if(void 0!==v&&void 0!==p){var h=w(v,p);if((c-v.timestamp)/1e3<=h&&h-u/o>2500)return p}if(d.content.segment.complete){var m=d.content.segment.duration,g=(c-d.requestTimestamp)/1e3;if(null!=n&&!(g<=(1.5*m+2)/o)){var y=m/g,A=n.bitrate*Math.min(.7,y);return void 0===i||A<i?A:void 0}}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(c.A.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)&&function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,S.A)(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=T(a);if(void 0===s||void 0===u)return!0;var l=w(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode)},e}();function I(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){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var R=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=C(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(c.A.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,A.A)(e,(function(e){return e.id===t.id}));if(n<0)return c.A.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 d=C(e,n);if(null!==d)return d}return n},t._canGuessHigher=function(e,t,n){var r=n.score,i=n.confidenceLevel;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.score<1.01)return!0;if((void 0===t||t.score<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=I(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 d=T(u);if(void 0!==d&&d<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n.confidenceLevel&&n.score>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function C(e,t){var n=e.length,r=(0,A.A)(e,(function(e){return e.id===t.id}));if(r<0)return c.A.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var M=function(){function e(){var e=l.A.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new E(t),this._slowEWMA=new E(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<l.A.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=l.A.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=l.A.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new E(t),this._slowEWMA=new E(n),this._bytesSampled=0},e}();var P=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}(),D=n(4324),N=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):c.A.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&c.A.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,D.A)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),O=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 E(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(c.A.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{score:n.getEstimate(),confidenceLevel:r>=5&&i>=10?1:0}}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function L(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,A.A)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var U=new h.A(-1);U.finish();var B=new h.A(0);B.finish();var F=new h.A(1/0);F.finish();var V=new h.A(void 0);V.finish();var z=new h.A(1/0);z.finish();var K=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,d,f,v){var p,_,E,T,w,I,x,C=e.adaptation.type,D=function(e){var n=t[e];if(null==n){c.A.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new M;return t[e]=r,r}return n}(C),K=null!==(p=n[C])&&void 0!==p?p:U,W=null!==(_=r[C])&&void 0!==_?_:B,G=null!==(E=i[C])&&void 0!==E?E:F,H=null!==(T=a[C])&&void 0!==T?T:0;return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,d=e.maxAutoBitrate,f=e.minAutoBitrate,v=e.playbackObserver,p=e.representations,_=new O,E=new k(null!=o?o:0,s),T=new N,w=g.A,I={metrics:U,requestBegin:B,requestProgress:F,requestEnd:V,addedSegment:function(e){w(e)}},x=new m.Ay;x.linkToSignal(t);var C=M(p.getValue(),x.signal);return p.onUpdate(D,{clearSignal:t}),{estimates:C,callbacks:I};function M(e,t){if(0===e.length)return new h.A({representation:null,bitrate:void 0,knownStableBitrate:void 0,manual:!1,urgent:!0});if(1===e.length)return new h.A({bitrate:void 0,representation:e[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var o=!1,p=new b(e.map((function(e){return e.bitrate}))),m=new P,k=new R(_,m),I=v.getReference().getValue(),x=new h.A(M());return v.listen((function(e){I=e,C()}),{includeLastObservation:!1,clearSignal:t}),w=function(e){if(null!==I){var t=I,n=t.position,r=t.speed,i=e.buffered,a=(0,y.vK)(i,n.last),o=e.content.representation,s=_.getEstimate(o),u={bufferGap:a,currentBitrate:o.bitrate,currentScore:s,speed:r};p.onAddedSegment(u),C()}},t.register((function(){w=g.A})),u.onUpdate(C,{clearSignal:t}),f.onUpdate(C,{clearSignal:t}),d.onUpdate(C,{clearSignal:t}),a.limitWidth.onUpdate(C,{clearSignal:t}),a.limitWidth.onUpdate(C,{clearSignal:t}),x;function C(){x.setValue(M())}function M(){var t=u.getValue();if(t>=0)return{representation:L(e,t,0,1/0),bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0};var v=I,h=v.bufferGap,g=v.position,y=v.maximumPosition,b=a.limitWidth.getValue(),w=a.throttleBitrate.getValue(),x=i.getValue(),R=f.getValue(),C=d.getValue(),M=function(e,t,n){var r=e;n<1/0&&(r=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,A.A)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){var n,r;return(null!==(n=e.width)&&void 0!==n?n:0)-(null!==(r=t.width)&&void 0!==r?r:0)})),r=(0,S.A)(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}))}(r,t));return r}(e,b,w),P=T.getRequests(),D=E.getBandwidthEstimate(I,n,x,P,m.bandwidth),N=D.bandwidthEstimate,O=D.bitrateChosen,U=_.getLastStableRepresentation(),B=null===U?void 0:U.bitrate/(I.speed>0?I.speed:1),F=l.A.getCurrent(),V=F.ABR_ENTER_BUFFER_BASED_ALGO,z=F.ABR_EXIT_BUFFER_BASED_ALGO;o&&h<=z?o=!1:!o&&isFinite(h)&&h>=V&&(o=!0);var K=L(M,O,R,C),W=p.getLastEstimate(),G=K.bitrate,H=null;o&&void 0!==W&&W>G&&(G=(H=L(M,W,R,C)).bitrate);var q=null;return s&&null!==x&&r.manifest.isDynamic&&y-g.last<40&&(q=k.getGuess(e,I,x,G,P)),null!==q&&q.bitrate>G?(c.A.debug("ABR: Choosing representation with guess-based estimation.",q.bitrate,q.id),m.update(q,N,2),{bitrate:N,representation:q,urgent:null===x||q.bitrate<x.bitrate,manual:!1,knownStableBitrate:B}):null!==H?(c.A.debug("ABR: Choosing representation with buffer-based estimation.",H.bitrate,H.id),m.update(H,N,0),{bitrate:N,representation:H,urgent:E.isUrgent(H.bitrate,x,P,I),manual:!1,knownStableBitrate:B}):(c.A.debug("ABR: Choosing representation with bandwidth estimation.",K.bitrate,K.id),m.update(K,N,1),{bitrate:N,representation:K,urgent:E.isUrgent(K.bitrate,x,P,I),manual:!1,knownStableBitrate:B})}}function D(){var e=p.getValue();x.cancel(),(x=new m.Ay).linkToSignal(t),M(e,x.signal).onUpdate((function(e){C.setValue(e)}),{clearSignal:x.signal,emitCurrentValue:!0})}function U(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,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;_.addSample(s,t/1e3,u)}}function B(e){T.add(e)}function F(e){T.addProgress(e)}function V(e){T.remove(e.id)}}({bandwidthEstimator:D,context:e,currentRepresentation:u,filters:{limitWidth:null!==(w=o.limitWidth[C])&&void 0!==w?w:V,throttleBitrate:null!==(x=null!==(I=o.throttleBitrate[C])&&void 0!==I?I:o.throttle[C])&&void 0!==x?x:z},initialBitrate:H,manualBitrate:K,minAutoBitrate:W,maxAutoBitrate:G,playbackObserver:f,representations:d,lowLatencyMode:s},v)}},W=n(5283),G=n(874),H=n(8568),q=n(79),j=n(6787),Y=n(3506),Q=n(7941);function $(e){return e instanceof Y.A?new Q.A("PIPELINE_LOAD_ERROR",e):(0,G.A)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var X=n(5497),Z=n(7004),J=n(4637),ee=n(2432),te=n(7021);function ne(e){return e instanceof Y.A?e.type===X.yl.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===X.yl.TIMEOUT||e.type===X.yl.ERROR_EVENT:e instanceof Z.A?"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,J.A)(e)&&"INTEGRITY_ERROR"===e.code}function re(e){return e instanceof Y.A?e.type===X.yl.ERROR_EVENT&&!1===navigator.onLine:e instanceof Z.A&&e.isOfflineError}function ie(e,t,n,r,i){return ae.apply(this,arguments)}function ae(){return ae=(0,r.A)(o().mark((function e(t,n,i,a,s){var u,l,d,f,v,p,h,y,A,_,b,S,E,T;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T=function(e){var t;if(0===p.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=p.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=p.get(t))||void 0===r?void 0:r.blockedUntil;return void 0!==i&&i<=n&&(i=void 0),void 0===e?[t,i]:void 0===i?void 0===e[1]?e:[t,void 0]:void 0===e[1]?e:i<e[1]?[t,i]:e}),void 0))||void 0===t?void 0:t[0]},E=function(e,t){var r=p.get(e);if(void 0===r||void 0===r.blockedUntil)return A(e);var i=performance.now(),a=r.blockedUntil-i;if(a<=0)return A(e);var o=new m.Ay,u=o.linkToSignal(s);return new Promise((function(r,i){function l(e){u(),r(e)}function d(e){u(),i(e)}null==n||n.addEventListener("priorityChange",(function(){var n=y();if(s.isCancelled())throw s.cancellationError;if(void 0===n)return d(t);n!==e&&(o.cancel(),E(n,t).then(l,d))}),o.signal),(0,ee.A)(a,o.signal).then((function(){return A(e).then(l,d)}),g.A)}))},S=function(){return(S=(0,r.A)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=y(),!s.isCancelled()){e.next=3;break}throw s.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(v(t),!s.isCancelled()){e.next=8;break}throw s.cancellationError;case 8:return e.abrupt("return",E(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},b=function(e){return S.apply(this,arguments)},_=function(){return(_=(0,r.A)(o().mark((function e(t){var r,a,c,v,h,g,y;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i(t,s);case 3:return r=e.sent,e.abrupt("return",r);case 7:if(e.prev=7,e.t0=e.catch(0),!m.Ay.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),o=e.t0,a=re(o)?2:1,void 0===(c=p.get(t))?(c={errorCounter:1,lastErrorType:a,blockedUntil:void 0,isBlacklisted:!1},p.set(t,c)):a!==c.lastErrorType?(c.errorCounter=1,c.lastErrorType=a):c.errorCounter++,ne(e.t0)){e.next=19;break}return c.blockedUntil=void 0,c.isBlacklisted=!0,e.abrupt("return",b(e.t0));case 19:return v=2===a?f:d,c.errorCounter>v?(c.blockedUntil=void 0,c.isBlacklisted=!0):(h=c.errorCounter,g=Math.min(u*Math.pow(2,h-1),l),y=(0,te.A)(g),c.blockedUntil=performance.now()+y),e.abrupt("return",b(e.t0));case 22:case"end":return e.stop()}var o}),e,null,[[0,7]])})))).apply(this,arguments)},A=function(e){return _.apply(this,arguments)},y=function(){if(null===t){var e=p.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return T(t);var r=n.getCdnPreferenceForResource(t);return T(r)},null===s.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(s.cancellationError));case 9:if(u=a.baseDelay,l=a.maxDelay,d=a.maxRetryRegular,f=a.maxRetryOffline,v=a.onRetry,null!==t&&0===t.length&&c.A.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),p=new Map,void 0!==(h=y())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",A(h));case 16:case"end":return e.stop()}}),e)}))),ae.apply(this,arguments)}function oe(e,t,n){return ie(null,null,e,t,n)}function se(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){if("string"==typeof e)return ue(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}(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 ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var le=function(e){function t(t,n,r){var i;return(i=e.call(this)||this).scheduleManualRefresh=g.A,i._manifestUrls=t,i._pipelines=n.manifest,i._settings=r,i._canceller=new m.Ay,i._isStarted=!1,i._isRefreshPending=!1,i._consecutiveUnsafeMode=0,i._prioritizedContentUrl=null,i}(0,i.A)(t,e);var n=t.prototype;return n.dispose=function(){this._canceller.cancel(),this.removeEventListener()},n.start=function(){var e=this;if(!this._isStarted){this._isStarted=!0;var t=this._settings.initialManifest;(t instanceof H.Ay?Promise.resolve({manifest:t}):void 0!==t?this.parse(t,{previousManifest:null,unsafeMode:!1},void 0):this._fetchManifest(void 0).then((function(e){return e.parse({previousManifest:null,unsafeMode:!1})}))).then((function(t){e.trigger("manifestReady",t.manifest),e._canceller.isUsed()||e._recursivelyRefreshManifest(t.manifest,t)})).catch((function(t){return e._onFatalError(t)}))}},n.updateContentUrls=function(e,t){var n;this._prioritizedContentUrl=null!==(n=null==e?void 0:e[0])&&void 0!==n?n:void 0,t&&this.scheduleManualRefresh({enablePartialRefresh:!1,delay:0,canUseUnsafeMode:!1})},n._fetchManifest=function(){var e=(0,r.A)(o().mark((function e(t){var n,r,i,a,s,u,d,c,v,p,h=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=function(e){var t=a.loadManifest,n=(0,j.A)(i.requestTimeout)?l.A.getCurrent().DEFAULT_REQUEST_TIMEOUT:i.requestTimeout;n<0&&(n=void 0);return oe((function(){return t(e,{timeout:n},r)}),u,r)},v=function(e){var t=a.resolveManifestUrl;(0,f.h)(void 0!==t);return oe((function(){return t(e,r)}),u,r)},r=this._canceller.signal,i=this._settings,a=this._pipelines,s=null!=t?t:null===(n=this._manifestUrls)||void 0===n?void 0:n[0],u=this._getBackoffSetting((function(e){h.trigger("warning",$(e))})),d=void 0===a.resolveManifestUrl?p(s):v(s).then(p),e.prev=8,e.next=11,d;case 11:return c=e.sent,e.abrupt("return",{parse:function(e){return h._parseLoadedManifest(c,e,s)}});case 15:throw e.prev=15,e.t0=e.catch(8),$(e.t0);case 18:case"end":return e.stop()}}),e,this,[[8,15]])})));return function(t){return e.apply(this,arguments)}}(),n.parse=function(e,t,n){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t,n)},n._parseLoadedManifest=function(){var e=(0,r.A)(o().mark((function e(t,n,i){var a,s,u,l,d,f,v,p,h,m,g,y,A,_,b,S,E=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S=function(e){b(e.contentWarnings);var t=performance.now()-s;return c.A.info("MF: Manifest parsed in "+t+"ms"),{manifest:e,sendingTime:d,receivedTime:f,parsingTime:t}},b=function(e){for(var t,n=se(e);!(t=n()).done;){var r=t.value;if(u.isCancelled())return;var i=(0,G.A)(r,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});l("warning",i)}},_=function(){return(_=(0,r.A)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,oe(t,v,u);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),$(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},A=function(e){return _.apply(this,arguments)},s=performance.now(),u=this._canceller.signal,l=this.trigger.bind(this),d=t.sendingTime,f=t.receivedTime,v=this._getBackoffSetting((function(e){E.trigger("warning",$(e))})),p=null!=i?i:null===(a=this._manifestUrls)||void 0===a?void 0:a[0],h={externalClockOffset:n.externalClockOffset,unsafeMode:n.unsafeMode,previousManifest:n.previousManifest,originalUrl:p},e.prev=11,m=this._pipelines.parseManifest(t,h,b,u,A),m instanceof Promise){e.next=17;break}return e.abrupt("return",S(m.manifest));case 17:return e.next=19,m;case 19:return g=e.sent,y=g.manifest,e.abrupt("return",S(y));case 22:e.next=28;break;case 24:throw e.prev=24,e.t0=e.catch(11),(0,G.A)(e.t0,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});case 28:case"end":return e.stop()}}),e,this,[[11,24]])})));return function(t,n,r){return e.apply(this,arguments)}}(),n._getBackoffSetting=function(e){var t=l.A.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,d=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!=d?d:r}},n._recursivelyRefreshManifest=function(e,t){var n=this,r=t.sendingTime,i=t.parsingTime,a=t.updatingTime,o=l.A.getCurrent(),s=o.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,u=o.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,d=void 0!==i?i+(null!=a?a:0):void 0,f=this._consecutiveUnsafeMode>0?this._consecutiveUnsafeMode<s:void 0!==d&&d>=u,v=void 0===r?0:performance.now()-r,p=Math.max(this._settings.minimumManifestUpdateInterval-v,0),h=new m.Ay;if(h.linkToSignal(this._canceller.signal),this.scheduleManualRefresh=function(t){var i=t.enablePartialRefresh,a=t.delay,o=t.canUseUnsafeMode&&f,s=void 0===r?0:performance.now()-r,u=Math.max(n._settings.minimumManifestUpdateInterval-s,0),l=setTimeout((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:i,unsafeMode:o})}),Math.max((null!=a?a:0)-s,u));h.signal.register((function(){clearTimeout(l)}))},null!==e.expired){var y=setTimeout((function(){var t;null===(t=e.expired)||void 0===t||t.then((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),g.A)}),p);h.signal.register((function(){clearTimeout(y)}))}if(void 0!==e.lifetime&&e.lifetime>=0){var A,_=1e3*e.lifetime-v;void 0===d?A=_:e.lifetime<3&&d>=100?(A=Math.min(Math.max(3e3-v,Math.max(_,0)+d),6*_),c.A.info("MUS: Manifest update rythm is too frequent. Postponing next request.",_,A)):d>=1e3*e.lifetime/10?(A=Math.min(Math.max(_,0)+d,6*_),c.A.info("MUS: Manifest took too long to parse. Postponing next request",A,A)):A=_;var b=setTimeout((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),Math.max(A,p));h.signal.register((function(){clearTimeout(b)}))}},n._triggerNextManifestRefresh=function(e,t){var n,r,i=this,a=t.enablePartialRefresh,o=t.unsafeMode,s=e.updateUrl;null!==this._prioritizedContentUrl?(n=!0,r=this._prioritizedContentUrl,this._prioritizedContentUrl=null):r=(n=!a||void 0===s)?e.getUrl():s;var u=e.clockOffset;o?(this._consecutiveUnsafeMode+=1,c.A.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(this._consecutiveUnsafeMode)+" consecutive time.")):this._consecutiveUnsafeMode>0&&(c.A.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(this._consecutiveUnsafeMode)+" consecutive times."),this._consecutiveUnsafeMode=0),this._isRefreshPending||(this._isRefreshPending=!0,this._fetchManifest(r).then((function(t){return t.parse({externalClockOffset:u,previousManifest:e,unsafeMode:o})})).then((function(t){i._isRefreshPending=!1;var r=t.manifest,a=t.sendingTime,o=t.parsingTime,s=performance.now();if(n)e.replace(r);else try{e.update(r)}catch(t){var u=t instanceof Error?t.message:"unknown error";c.A.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully");var d=l.A.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,f=void 0===a?0:performance.now()-a,v=Math.max(i._settings.minimumManifestUpdateInterval-f,0),p=g.A,h=setTimeout((function(){p(),i._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:!1})}),Math.max(d-f,v));return void(p=i._canceller.signal.register((function(){clearTimeout(h)})))}var m=performance.now()-s;i._recursivelyRefreshManifest(e,{sendingTime:a,parsingTime:o,updatingTime:m})})).catch((function(e){i._isRefreshPending=!1,i._onFatalError(e)})))},n._onFatalError=function(e){this._canceller.isUsed()||(this.trigger("error",e),this.dispose())},t}(q.A);var de=le;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){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var ve=function(e){function t(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=ce(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,i.A)(t,e);var n=t.prototype;return n.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},n.downgradeCdn=function(e){var t=this,n=pe(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=l.A.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=pe(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},n._innerGetCdnPreferenceForResource=function(e){var t=this,n=e.reduce((function(e,n){return t._downgradedCdnList.metadata.some((function(e){return e.id===n.id&&e.baseUrl===n.baseUrl}))?e[1].push(n):e[0].push(n),e}),[[],[]]),r=n[0],i=n[1];return r.concat(i)},n._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},t}(q.A);function pe(e,t){return 0===e.length?-1:void 0!==t.id?(0,A.A)(e,(function(e){return e.id===t.id})):(0,A.A)(e,(function(e){return e.baseUrl===t.baseUrl}))}var he=n(7841),me=n(4031),ge=n(8795),ye=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}(),Ae=(0,ge.A)();var _e=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("TP: 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,n,r){var i,a=this;return(0,v.A)(r,(function(o,s){return i={hasEnded:!1,priority:t,trigger:function(){if(!i.hasEnded){var e=function(){u(),a._endTask(i)},t=new m.Ay,u=t.linkToSignal(r);i.interrupter=t,t.signal.register((function(){i.interrupter=null,r.isCancelled()||n.beforeInterrupted()})),a._minPendingPriority=null===a._minPendingPriority?i.priority:Math.min(a._minPendingPriority,i.priority),a._pendingTasks.push(i),i.taskFn(t.signal).then((function(t){n.beforeEnded(),e(),o(t)})).catch((function(n){!r.isCancelled()&&t.isUsed()&&n instanceof m.AL||function(t){e(),s(t)}(n)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i),function(){return a._endTask(i)}}))},t._endTask=function(e){e.hasEnded=!0;var t=be(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=be(e.taskFn,this._pendingTasks);if(n<0)return;this._pendingTasks.splice(n,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.updatePriority=function(e,t){var n=be(e,this._waitingQueue);if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._findAndRunWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=be(e,this._pendingTasks);if(i<0)c.A.warn("TP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority?this._minPendingPriority=t:this._minPendingPriority===o&&(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._findAndRunWaitingQueueTask(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._findAndRunWaitingQueueTask=function(e){return e>=this._waitingQueue.length||e<0?(c.A.warn("TP : Tried to start a non existing task"),!1):(this._waitingQueue.splice(e,1)[0].trigger(),!0)},t._interruptPendingTask=function(e){var t,n=be(e.taskFn,this._pendingTasks);n<0?c.A.warn("TP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(n,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})))),null===(t=e.interrupter)||void 0===t||t.cancel())},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}();function be(e,t){return(0,A.A)(t,(function(t){return t.taskFn===e}))}var Se=function(){function e(e,t,n){var r=new ve(n),i=l.A.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new _e({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,i,a,s=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=l.A.getCurrent(),s=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,u=o.DEFAULT_REQUEST_TIMEOUT,d=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,f=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:s,maxRetryOffline:null!=r?r:d,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?f.LOW_LATENCY:f.REGULAR,requestTimeout:(0,j.A)(a)?u:a}}(e,this._backoffOptions),u=function(e,t,n,i,a){var s={timeout:a.requestTimeout<0?void 0:a.requestTimeout},u=(0,me.A)(["audio","video"],e)?new ye:void 0,l=t.loadSegment,d=t.parseSegment;return function(){var e=(0,r.A)(o().mark((function e(t,r,f){var v,h,g,y,A,_,b,S,E,T,w,k,I,x,R,C,M,P;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P=function(){var e;E||!(0,j.A)(_)&&void 0!==_.size&&void 0!==_.requestDuration&&b.length>0&&b.every((function(e){return e}))&&(E=!0,null===(e=i.onMetrics)||void 0===e||e.call(i,{size:_.size,requestDuration:_.requestDuration,content:t,segmentDuration:S}))},M=function(e){r.onRetry($(e))},C=function(e,n){b.push(!1);var r=b.length-1;return function(i){var a={data:e,isChunked:n};try{var o=d(a,t,i);return b[r]||(S=void 0!==S&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?S+o.chunkInfos.duration:void 0,b[r]=!0,P()),o}catch(e){throw(0,G.A)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},R=function(e){return l(e,t,s,f,T)},x=function(){var e;void 0===_&&(c.A.debug("SF: Segment request cancelled",y),_=null,null===(e=i.onRequestEnd)||void 0===e||e.call(i,{id:A}))},y=(0,he.M)(t),A=Ae(),b=[],S=0,E=!1,T={onProgress:function(e){var t;void 0===_&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=i.onProgress)||void 0===t||t.call(i,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:A}))},onNewChunk:function(e){r.onChunk(C(e,!0))}},null===(w=void 0!==u?u.get(t):null)){e.next=16;break}return c.A.debug("SF: Found wanted segment in cache",y),r.onChunk(C(w,!1)),e.abrupt("return",Promise.resolve());case 16:return c.A.debug("SF: Beginning request",y),null===(v=i.onRequestBegin)||void 0===v||v.call(i,{requestTimestamp:performance.now(),id:A,content:t}),f.register(x),e.prev=19,e.next=22,ie(t.representation.cdnMetadata,n,R,(0,p.A)({onRetry:M},a),f);case 22:"segment-loaded"===(k=e.sent).resultType?(I=k.resultData.responseData,void 0!==u&&u.add(t,k.resultData.responseData),r.onChunk(C(I,!1))):"segment-created"===k.resultType&&r.onChunk(C(k.resultData,!1)),c.A.debug("SF: Segment request ended with success",y),r.onAllChunksReceived(),"segment-created"!==k.resultType?(_=k.resultData,P()):_=null,f.isCancelled()||null===(h=i.onRequestEnd)||void 0===h||h.call(i,{id:A}),f.deregister(x),e.next=41;break;case 31:if(e.prev=31,e.t0=e.catch(19),f.deregister(x),_=null,!(e.t0 instanceof m.AL)){e.next=38;break}throw c.A.debug("SF: Segment request aborted",y),e.t0;case 38:throw c.A.debug("SF: Segment request failed",y),null===(g=i.onRequestEnd)||void 0===g||g.call(i,{id:A}),$(e.t0);case 41:case"end":return e.stop()}}),e,null,[[19,31]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,s);return n=this._prioritizer,i=u,a=new WeakMap,{createRequest:function(e,t,r,o){var s=function(t){return i(e,r,t)},u=n.create(s,t,r,o);return a.set(u,s),u},updatePriority:function(e,t){var r=a.get(e);void 0!==r?n.updatePriority(r,t):c.A.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Ee=Se,Te=n(418);var we=n(2038),ke=n(7500);function Ie(e){}var xe=function(e){function t(t,n,r){var i;i=e.call(this)||this,c.A.info("AVSB: calling `mediaSource.addSourceBuffer`",n);var a=r.addSourceBuffer(n);i._canceller=new m.Ay,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegmentUniqueId=null,i.codec=n,i._initSegmentsMap=new Map;var o=i._onPendingTaskError.bind(i),s=i._flush.bind(i),u=l.A.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,d=setInterval(s,u);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",s),i._canceller.signal.register((function(){clearInterval(d),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",s)})),i}(0,i.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e,t){Ie(t),this._initSegmentsMap.set(e,t)},n.freeInitSegment=function(e){this._initSegmentsMap.delete(e)},n.pushChunk=function(e,t){return Ie(e.data.chunk),c.A.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,he.M)(e.inventoryInfos)),this._addToQueue({type:ke.B.Push,value:e},t)},n.removeBuffer=function(e,t,n){return c.A.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:ke.B.Remove,value:{start:e,end:t}},n)},n.endOfSegment=function(e,t){return c.A.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,he.M)(e)),this._addToQueue({type:ke.B.EndOfSegment,value:e},t)},n.getBufferedRanges=function(){return this._sourceBuffer.buffered},n.getPendingOperations=function(){var e=function(e){switch(e.type){case ke.B.Push:case ke.B.Remove:case ke.B.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},n.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new m.AL),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new m.AL)}if("open"===this._mediaSource.readyState)try{c.A.debug("AVSB: Calling `abort` on the SourceBuffer"),this._sourceBuffer.abort()}catch(e){c.A.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},n._onPendingTaskError=function(e){if(this._lastInitSegmentUniqueId=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer"),n=this._pendingTask;n.type===ke.B.Push&&0===n.data.length&&null!==n.inventoryData&&this._segmentInventory.insertChunk(n.inventoryData,!1,performance.now()),this._pendingTask=null,n.reject(t)}},n._addToQueue=function(e,t){var n=this;return(0,v.A)(t,(function(t,r){var i=0===n._queue.length&&null===n._pendingTask,a=(0,p.A)({resolve:t,reject:r},e);return n._queue.push(a),i&&n._flush(),function(){var e=n._queue.indexOf(a);e>=0&&n._queue.splice(e,1),a.resolve=g.A,a.reject=g.A}}))},n._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==ke.B.Push||0===e.data.length){switch(e.type){case ke.B.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData,!0,performance.now());break;case ke.B.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case ke.B.Remove:this.synchronizeInventory();break;default:(0,we.A)(e)}var t=e.resolve;return this._pendingTask=null,t(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==ke.B.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,p.A)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegmentUniqueId=null,void n.reject(a)}this._pendingTask=(0,p.A)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case ke.B.EndOfSegment:return c.A.debug("AVSB: Acknowledging complete segment",(0,he.M)(this._pendingTask.value)),void this._flush();case ke.B.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();c.A.debug("AVSB: pushing segment",this.bufferType,(0,he.M)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case ke.B.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;c.A.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,we.A)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},n._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(c.A.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return c.A.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n),a?this.codec=n:c.A.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;c.A.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0])this._sourceBuffer.appendWindowStart>0&&(c.A.debug("AVSB: re-setting `appendWindowStart` to `0`"),this._sourceBuffer.appendWindowStart=0);else if(i[0]!==this._sourceBuffer.appendWindowStart){if(i[0]>=this._sourceBuffer.appendWindowEnd){var s=i[0]+1;c.A.debug("AVSB: pre-updating `appendWindowEnd`",s),this._sourceBuffer.appendWindowEnd=s}c.A.debug("AVSB: setting `appendWindowStart`",i[0]),this._sourceBuffer.appendWindowStart=i[0]}if(void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(c.A.debug("AVSB: re-setting `appendWindowEnd` to `Infinity`"),this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(c.A.debug("AVSB: setting `appendWindowEnd`",i[1]),this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegmentUniqueId&&(a||!this._isLastInitSegment(e.initSegmentUniqueId))){var u=this._initSegmentsMap.get(e.initSegmentUniqueId);if(void 0===u)throw new Error("Invalid initialization segment uniqueId");t.push(u),this._lastInitSegmentUniqueId=e.initSegmentUniqueId}return null!==e.chunk&&t.push(e.chunk),t},n._isLastInitSegment=function(e){return null!==this._lastInitSegmentUniqueId&&this._lastInitSegmentUniqueId===e},t}(ke.K),Re=["audio","video","text","image"];function Ce(e){return"audio"===e||"video"===e}var Me=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Ce(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==Te.A.nativeTextTracksBuffer&&null==Te.A.htmlTextTracksBuffer||e.push("text"),null!=Te.A.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(e){var t=this;return this._areNativeBuffersUsable()?Promise.resolve():(0,v.A)(e,(function(e){var n,r=function(){var e=t._onNativeBufferAddedOrDisabled.indexOf(n);e>=0&&t._onNativeBufferAddedOrDisabled.splice(e,1)};return n=function(){t._areNativeBuffersUsable()&&(r(),e())},t._onNativeBufferAddedOrDisabled.push(n),r}))},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 c.A.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(Ce(e)){if(null!=i)return i instanceof xe&&i.codec!==t?c.A.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):c.A.info("SB: Reusing native SegmentBuffer with codec",t),i;c.A.info("SB: Adding native SegmentBuffer with codec",t);var a=new xe(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return c.A.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(c.A.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==Te.A.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new Te.A.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==Te.A.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new Te.A.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==Te.A.imageBuffer)throw new Error("Image buffer feature not activated");return c.A.info("SB: Creating a new image SegmentBuffer"),r=new Te.A.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw c.A.error("SB: Unknown buffer type:",e),new d.A("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?(c.A.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):c.A.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Re.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}(),Pe=n(6826),De=n.n(Pe),Ne=n(7296),Oe=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}();function Le(e,t){var n,r=e.segmentBuffer,i=e.playbackObserver,a=e.maxBufferBehind,o=e.maxBufferAhead;function s(){(function(e,t,n,r,i){return Ue.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";c.A.error("Could not run BufferGarbageCollector:",t)}))}i.listen((function(e){var t;n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,s()}),{includeLastObservation:!0,clearSignal:t}),a.onUpdate(s,{clearSignal:t}),o.onUpdate(s,{clearSignal:t}),s()}function Ue(){return(Ue=(0,r.A)(o().mark((function e(t,n,r,i,a){var s,u,l,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(isFinite(r)||isFinite(i)){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:s=[],u=(0,y.OT)(t.getBufferedRanges(),n),l=u.innerRange,d=u.outerRanges,f=function(){if(isFinite(i)){for(var e=0;e<d.length;e++){var t=d[e];n+i<=t.start?s.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&s.push({start:n+i,end:t.end})}null!=l&&n+i<l.end&&s.push({start:n+i,end:l.end})}},function(){if(isFinite(r)){for(var e=0;e<d.length;e++){var t=d[e];n-r>=t.end?s.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&s.push({start:t.start,end:n-r})}null!=l&&n-r>l.start&&s.push({start:l.start,end:n-r})}}(),f(),v=0,p=s;case 9:if(!(v<p.length)){e.next=20;break}if(!((h=p[v]).start<h.end)){e.next=17;break}if(c.A.debug("GC: cleaning range from SegmentBuffer",h.start,h.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(h.start,h.end,a);case 17:v++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Be=function(e){function t(t,n,r,i){var a;return(a=e.call(this)||this)._content=t,a._currentCanceller=null,a._downloadQueue=n,a._initSegmentRequest=null,a._mediaSegmentRequest=null,a._segmentFetcher=r,a._initSegmentInfoRef=new h.A(void 0),a._mediaSegmentAwaitingInitMetadata=null,i||a._initSegmentInfoRef.setValue(null),a}(0,i.A)(t,e);var n=t.prototype;return n.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},n.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},n.start=function(){var e=this;null===this._currentCanceller&&(this._currentCanceller=new m.Ay,this._downloadQueue.onUpdate((function(t){var n=t.segmentQueue;if(!(n.length>0&&n[0].segment.id===e._mediaSegmentAwaitingInitMetadata)){var r=e._mediaSegmentRequest;if(0===n.length){if(null===r)return;return c.A.debug("Stream: no more media segment to request. Cancelling queue.",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()}if(null===r)return c.A.debug("Stream: Media segments now need to be requested. Starting queue.",e._content.adaptation.type,n.length),void e._restartMediaSegmentDownloadingQueue();var i=n[0];return r.segment.id!==i.segment.id?(c.A.debug("Stream: Next media segment changed, cancelling previous",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()):void(r.priority!==i.priority&&(c.A.debug("Stream: Priority of next media segment changed, updating",e._content.adaptation.type,r.priority,i.priority),e._segmentFetcher.updatePriority(r.request,i.priority)))}}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}),this._downloadQueue.onUpdate((function(t){var n,r=e._initSegmentRequest;null===t.initSegment||null===r?(null===(n=t.initSegment)||void 0===n?void 0:n.segment.id)!==(null==r?void 0:r.segment.id)&&(null===t.initSegment&&c.A.debug("Stream: no more init segment to request. Cancelling queue.",e._content.adaptation.type),e._restartInitSegmentDownloadingQueue(t.initSegment)):t.initSegment.priority!==r.priority&&e._segmentFetcher.updatePriority(r.request,t.initSegment.priority)}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}))},n.stop=function(){var e;null===(e=this._currentCanceller)||void 0===e||e.cancel(),this._currentCanceller=null},n._restartMediaSegmentDownloadingQueue=function(){var e=this;null!==this._mediaSegmentRequest&&this._mediaSegmentRequest.canceller.cancel();!function t(n){if(null!==e._currentCanceller&&e._currentCanceller.isUsed())e._mediaSegmentRequest=null;else{if(void 0===n)return e._mediaSegmentRequest=null,void e.trigger("emptyQueue",null);var r=new m.Ay,i=null===e._currentCanceller?g.A:r.linkToSignal(e._currentCanceller.signal),a=n.segment,o=n.priority,s=(0,p.A)({segment:a},e._content),u=!1,l=!1;r.signal.register((function(){e._mediaSegmentRequest=null,u||(e._mediaSegmentAwaitingInitMetadata===a.id&&(e._mediaSegmentAwaitingInitMetadata=null),u=!0,l=!1)}));var d=function(t){(0,f.h)("media"===t.segmentType,"Should have loaded a media segment."),e.trigger("parsedMediaSegment",(0,p.A)({},t,{segment:a}))},v=function(){var n=e._downloadQueue.getValue().segmentQueue;if(0===n.length)return u=!0,void e.trigger("emptyQueue",null);n[0].segment.id===a.id&&n.shift(),u=!0,t(n[0])},h=e._segmentFetcher.createRequest(s,o,{onRetry:function(t){e.trigger("requestRetry",{segment:a,error:t})},beforeInterrupted:function(){c.A.info("Stream: segment request interrupted temporarly.",a.id,a.time)},onChunk:function(t){var n=e._initSegmentInfoRef.getValue();void 0!==n?d(t(null!=n?n:void 0)):(l=!0,e._initSegmentInfoRef.waitUntilDefined((function(e){d(t(null!=e?e:void 0))}),{clearSignal:r.signal}))},onAllChunksReceived:function(){l?(e._mediaSegmentAwaitingInitMetadata=a.id,e._initSegmentInfoRef.waitUntilDefined((function(){e._mediaSegmentAwaitingInitMetadata=null,l=!1,e.trigger("fullyLoadedSegment",a)}),{clearSignal:r.signal})):e.trigger("fullyLoadedSegment",a)},beforeEnded:function(){i(),e._mediaSegmentRequest=null,l?e._initSegmentInfoRef.waitUntilDefined(v,{clearSignal:r.signal}):v()}},r.signal);h.catch((function(t){i(),u||(u=!0,e.stop(),e.trigger("error",t))})),e._mediaSegmentRequest={segment:a,priority:o,request:h,canceller:r}}}(this._downloadQueue.getValue().segmentQueue[0])},n._restartInitSegmentDownloadingQueue=function(e){var t=this;if((null===this._currentCanceller||!this._currentCanceller.isUsed())&&(null!==this._initSegmentRequest&&this._initSegmentRequest.canceller.cancel(),null!==e)){var n=new m.Ay,r=null===this._currentCanceller?g.A:n.linkToSignal(this._currentCanceller.signal),i=e.segment,a=e.priority,o=(0,p.A)({segment:i},this._content),s=!1,u=this._segmentFetcher.createRequest(o,a,{onRetry:function(e){t.trigger("requestRetry",{segment:i,error:e})},beforeInterrupted:function(){c.A.info("Stream: init segment request interrupted temporarly.",i.id)},beforeEnded:function(){r(),t._initSegmentRequest=null,s=!0},onChunk:function(e){var n,r=e(void 0);(0,f.h)("init"===r.segmentType,"Should have loaded an init segment."),t.trigger("parsedInitSegment",(0,p.A)({},r,{segment:i})),"init"===r.segmentType&&t._initSegmentInfoRef.setValue(null!==(n=r.initTimescale)&&void 0!==n?n:null)},onAllChunksReceived:function(){t.trigger("fullyLoadedSegment",i)}},n.signal);u.catch((function(e){r(),s||(s=!0,t.stop(),t.trigger("error",e))})),n.signal.register((function(){t._initSegmentRequest=null,s||(s=!0)})),this._initSegmentRequest={segment:i,priority:a,request:u,canceller:n}}},t}(q.A);function Fe(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 d=i[u];if(void 0!==d.bufferedStart&&d.bufferedStart>t.start&&(null===n||d.infos.segment.end<=n)){var f=d.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,f)?(c.A.debug("RS: current discontinuity encountered",o.type,d.bufferedStart),{start:void 0,end:f}):null}var v=function(e,t,n){if(n<=0)return c.A.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!==v){var p=i[v-1],h=i[v];if(null===n||h.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(p.infos.segment.end,h.infos.segment.time))return null;var m=p.bufferedEnd,g=h.bufferedStart;return c.A.debug("RS: future discontinuity encountered",o.type,m,g),{start:m,end:g}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var y=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!==y){var A=i[y];if(void 0!==A.bufferedEnd&&A.bufferedEnd<a.end)return c.A.debug("RS: discontinuity encountered at the end of the current period",o.type,A.bufferedEnd,a.end),{start:A.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var _=i.length-1;_>=0;_--){var b=i[_];if(void 0===b.bufferedStart)break;if(b.bufferedStart<t.end){if(void 0!==b.bufferedEnd&&b.bufferedEnd<t.end){var S=s.index.checkDiscontinuity(t.end);if(null!==S)return{start:b.bufferedEnd,end:S}}return null}}}return null}function Ve(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,d=n.adaptation,f=n.representation,v=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),h=f.index.getSegments(o.start,o.end-o.start),m=t.filter((function(e){return!Ke(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=l.A.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return!1;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return c.A.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;c.A.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=l.A.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return!1;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return c.A.info("Stream: The end of the wanted segment has been garbage collected",e.end,e.bufferedEnd),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;c.A.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),g=l.A.getCurrent(),y=g.MINIMUM_SEGMENT_SIZE,A=g.MIN_BUFFER_AHEAD,_=!1,b=Math.min(1/60,y),S=!1,E=[],T=h.filter((function(e){var t=(0,p.A)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,he.Q)(t,e)})))return!1;var u=e.duration,l=e.time,h=e.end;if(e.isInit)return!0;if(_)return E.push(e),!1;if(e.complete&&u<y)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;if(a.time-b>l)return!1;if(a.complete){if(a.end+b<h)return!1}else if(Math.abs(l-a.time)>l)return!1;return!Ke(e,t,r,i)})))return!1;for(var g=0;g<m.length;g++){var T=m[g],w=T.infos.period.id===n.period.id;if(1===T.status&&w){var k=T.infos.segment;if(l-k.time>-b)if(k.complete){if(k.end-h>-b)return!1}else if(Math.abs(l-k.time)<b)return!1}}var I=u*n.representation.bitrate;if(v-I<0&&(S=!0,l>o.start+A))return _=!0,E.push(e),!1;var x=a(t);if(x.length>1){var R=x[x.length-1],C=x[x.length-2];if(null===R.buffered&&null===C.buffered)return c.A.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+d.type,f.id,e.time),!1}for(var M=0;M<m.length;M++){var P=m[M];if(P.end+b>l){var D=P.start>l+b||ze(m,M).end<h-b;return D&&(v-=I),D}}return v-=I,!0}));return{segmentsToLoad:T,segmentsOnHold:E,isBufferFull:S}}function ze(e,t){for(var n=t+1,r=l.A.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 Ke(e,t,n,r){var i=l.A.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=l.A.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 We(e,t){for(var n=e-t,r=l.A.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Ge(e,t,n,r,i,a,o){o.synchronizeInventory();var s=e.representation,u=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastAvailablePosition(),l=s.index;i=!(0,j.A)(u)&&Me.isNative(e.adaptation.type)&&t>=u&&l.isInitialized()&&!l.isStillAwaitingFutureSegments()&&function(e,t,n){var r,i=e.getPeriodAfter(t);return t.containsTime(n,i)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t-.1;var d,c=i+n;d=!(!s.index.isInitialized()||s.index.isStillAwaitingFutureSegments()||void 0===o.end)&&(void 0===u?c>=o.end:null===u||c>=u);return{start:Math.max(i,o.start),end:Math.min(c,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:d}}(e,u,i),d=s.index.shouldRefresh(l.start,l.end),c=o.getPendingOperations().filter((function(e){return e.type===ke.B.EndOfSegment})).map((function(e){return e.value})),f=o.getInventory(),v=Ve({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:c,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:We(e.time,u),segment:e}})),y=s.index.isInitialized()&&!s.index.isStillAwaitingFutureSegments()&&l.hasReachedPeriodEnd&&0===g.length&&0===h.length,A=null;return c.length>0&&(A=Math.min.apply(Math,c.map((function(e){return e.segment.time})))),h.length>0&&(A=null!==A?Math.min(A,h[0].time):h[0].time),g.length>0&&(A=null!==A?Math.min(A,g[0].segment.time):g[0].segment.time),{imminentDiscontinuity:Fe(e,l,A,y,f),hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:d}}var He=n(8801);function qe(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){if("string"==typeof e)return je(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(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 je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ye(e,t,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=(0,r.A)(o().mark((function e(t,n,r){var i,a,s,u,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=l.A.getCurrent().BUFFER_GC_GAPS.CALM,a=l.A.getCurrent().BUFFER_GC_GAPS.BEEFY,c.A.warn("Stream: Running garbage collector"),s=n.getBufferedRanges(),0===(u=$e(t,s,i)).length&&(u=$e(t,s,a)),c.A.hasLevel("DEBUG")&&c.A.debug("Stream: GC cleaning",u.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),d=qe(u);case 8:if((f=d()).done){e.next=16;break}if(v=f.value,p=v.start,h=v.end,!(p<h)){e.next=14;break}return e.next=14,n.removeBuffer(p,h,r);case 14:e.next=8;break;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $e(e,t,n){for(var r=(0,y.OT)(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&&(c.A.hasLevel("DEBUG")&&c.A.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),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 Xe(e,t,n,r){return Ze.apply(this,arguments)}function Ze(){return(Ze=(0,r.A)(o().mark((function e(t,n,r,i){var a,s,u,l,c,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.pushChunk(r,i);case 3:case 25:e.next=31;break;case 5:if(e.prev=5,e.t0=e.catch(0),!(i.isCancelled()&&e.t0 instanceof m.AL)){e.next=11;break}throw e.t0;case 11:if(e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=14;break}throw s=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new d.A("BUFFER_APPEND_ERROR",s,{adaptation:r.inventoryInfos.adaptation});case 14:return u=t.getReference().getValue(),l=u.position,c=null!==(a=l.pending)&&void 0!==a?a:l.last,e.prev=16,e.next=19,Ye(c,n,i);case 19:return e.next=21,(0,He.A)(200);case 21:if(null===i.cancellationError){e.next=23;break}throw i.cancellationError;case 23:return e.next=25,n.pushChunk(r,i);case 27:throw e.prev=27,e.t1=e.catch(16),f=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new d.A("BUFFER_FULL_ERROR",f,{adaptation:r.inventoryInfos.adaptation});case 31:case"end":return e.stop()}}),e,null,[[0,5],[16,27]])})))).apply(this,arguments)}function Je(){return Je=(0,r.A)(o().mark((function e(t,n){var r,i,a,s,u,l,d,c,f,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.segment,u=t.segmentData,l=t.segmentBuffer,null===n.cancellationError){e.next=3;break}throw n.cancellationError;case 3:return d=i.representation.getMimeTypeString(),c={initSegmentUniqueId:a,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:d},f=(0,p.A)({segment:s,chunkSize:void 0,start:0,end:0},i),e.next=8,Xe(r,l,{data:c,inventoryInfos:f},n);case 8:return v=l.getBufferedRanges(),e.abrupt("return",{content:i,segment:s,buffered:v,segmentData:u});case 10:case"end":return e.stop()}}),e)}))),Je.apply(this,arguments)}function et(){return et=(0,r.A)(o().mark((function e(t,n){var r,i,a,s,u,d,c,f,v,h,m,g,y,A,_,b,S,E,T,w,k,I,x;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.parsedSegment,u=t.segment,d=t.segmentBuffer,null!==s.chunkData){e.next=3;break}return e.abrupt("return",null);case 3:if(null===n.cancellationError){e.next=5;break}throw n.cancellationError;case 5:return v=s.chunkData,h=s.chunkInfos,m=s.chunkOffset,g=s.chunkSize,y=s.appendWindow,A=i.representation.getMimeTypeString(),_=l.A.getCurrent(),b=_.APPEND_WINDOW_SECURITIES,S=[void 0!==y[0]?Math.max(0,y[0]-b.START):void 0,void 0!==y[1]?y[1]+b.END:void 0],E={initSegmentUniqueId:a,chunk:v,timestampOffset:m,appendWindow:S,codec:A},T=null!==(c=null==h?void 0:h.time)&&void 0!==c?c:u.time,w=null!==(f=null==h?void 0:h.duration)&&void 0!==f?f:u.duration,k=T+w,void 0!==S[0]&&(T=Math.max(T,S[0])),void 0!==S[1]&&(k=Math.min(k,S[1])),I=(0,p.A)({segment:u,chunkSize:g,start:T,end:k},i),e.next=18,Xe(r,d,{data:E,inventoryInfos:I},n);case 18:return x=d.getBufferedRanges(),e.abrupt("return",{content:i,segment:u,buffered:x,segmentData:v});case 20:case"end":return e.stop()}}),e)}))),et.apply(this,arguments)}var tt=function(e,t,n){var r=e.content,i=e.options,a=e.playbackObserver,o=e.segmentBuffer,s=e.segmentFetcher,u=e.terminate,d=r.period,f=r.adaptation,v=r.representation,g=i.bufferGoal,y=i.maxBufferSize,A=i.drmSystemId,_=i.fastSwitchThreshold,b=f.type,S=new m.Ay;S.linkToSignal(n);var E=new m.Ay;E.linkToSignal(S.signal);var T={segment:v.index.getInitSegment(),uniqueId:null,isLoaded:!1};S.signal.register((function(){null!==T.uniqueId&&o.freeInitSegment(T.uniqueId)}));var w=new h.A({initSegment:null,segmentQueue:[]},E.signal),k=null!==T.segment;k||(T.isLoaded=!0);var I=!1;if(void 0!==A){var x=v.getEncryptionData(A);if(x.length>0&&x.every((function(e){return void 0!==e.keyIds}))&&(I=!0,t.encryptionDataEncountered(x.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}var R=new Be(r,w,s,k);return R.addEventListener("error",(function(e){E.signal.isCancelled()||(S.cancel(),t.error(e))})),R.addEventListener("parsedInitSegment",M),R.addEventListener("parsedMediaSegment",M),R.addEventListener("emptyQueue",C),R.addEventListener("requestRetry",(function(e){if(t.warning(e.error),!E.signal.isCancelled()){var n=e.segment,r=v.index;!1===r.isSegmentStillAvailable(n)?C():r.canBeOutOfSyncError(e.error,n)&&t.manifestMightBeOufOfSync()}})),R.addEventListener("fullyLoadedSegment",(function(e){o.endOfSegment((0,p.A)({segment:e},r),S.signal).catch(P)})),R.start(),E.signal.register((function(){R.removeEventListener(),R.stop()})),a.listen(C,{includeLastObservation:!1,clearSignal:E.signal}),r.manifest.addEventListener("manifestUpdate",C,E.signal),g.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),y.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),u.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),void C();function C(){var e,n;if(!E.isUsed()){var i=a.getReference().getValue(),s=null!==(e=i.position.pending)&&void 0!==e?e:i.position.last,f=Ge(r,s,a,_.getValue(),g.getValue(),y.getValue(),o),p=f.neededSegments,h=null;if(v.index.isInitialized()){if(p.length>0&&!T.isLoaded&&null!==T.segment){var m=p[0].priority;h={segment:T.segment,priority:m}}}else if(null===T.segment)c.A.warn("Stream: Uninitialized index without an initialization segment");else if(T.isLoaded)c.A.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var A=null!==(n=i.position.pending)&&void 0!==n?n:i.position.last;h={segment:T.segment,priority:We(d.start,A)}}var k=u.getValue();if(null===k)w.setValue({initSegment:h,segmentQueue:p});else{if(k.urgent)return c.A.debug("Stream: Urgent switch, terminate now.",b),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),E.cancel(),void t.terminating();var I=p[0],x=R.getRequestedInitSegment(),C=R.getRequestedMediaSegment(),M=null===C||void 0===I||C.id!==I.segment.id?[]:[I],D=null===x?null:h;if(w.setValue({initSegment:D,segmentQueue:M}),0===M.length&&null===D)return c.A.debug("Stream: No request left, terminate",b),w.finish(),E.cancel(),void t.terminating()}if(t.streamStatusUpdate({period:d,position:i.position.last,bufferType:b,imminentDiscontinuity:f.imminentDiscontinuity,isEmptyStream:!1,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}),!E.signal.isCancelled()){var N=l.A.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(f.isBufferFull){var O=Math.max(0,s-N);O>0&&o.removeBuffer(0,O,S.signal).catch(P)}f.shouldRefreshManifest&&t.needsManifestRefresh()}}}function M(e){if(!S.isUsed())if("init"===e.segmentType){if(T.isLoaded=!0,!I){var n=v.getAllEncryptionData();if(n.length>0&&(t.encryptionDataEncountered(n.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}if(null!==e.initializationData){var i=v.uniqueId;T.uniqueId=i,o.declareInitSegment(i,e.initializationData),function(e,t){return Je.apply(this,arguments)}({playbackObserver:a,content:r,initSegmentUniqueId:i,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o},S.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(P)}C()}else{var s=e.inbandEvents,u=e.needsManifestRefresh,l=e.protectionDataUpdate;if(!I&&l){var d=v.getAllEncryptionData();if(d.length>0&&(t.encryptionDataEncountered(d.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}if(!0===u&&(t.needsManifestRefresh(),S.isUsed()))return;if(void 0!==s&&s.length>0&&(t.inbandEvent(s),S.isUsed()))return;var c=T.uniqueId;(function(e,t){return et.apply(this,arguments)})({playbackObserver:a,content:r,initSegmentUniqueId:c,parsedSegment:e,segment:e.segment,segmentBuffer:o},S.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(P)}}function P(e){S.isUsed()&&e instanceof m.AL||(S.cancel(),t.error(e))}};var nt=function(e,t,n){var r=e.playbackObserver,i=e.content,a=e.options,o=e.representationEstimator,s=e.segmentBuffer,u=e.segmentFetcherCreator,f=e.wantedBufferAhead,v=e.maxVideoBufferSize,y="direct"===a.manualBitrateSwitchingMode,A=i.manifest,_=i.period,b=i.adaptation,S=new m.Ay;S.linkToSignal(n);var E,T=new Map,w=new h.A(null,S.signal),k=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=new h.A([],a);v(),o.addEventListener("decipherabilityUpdate",v);var l=a.register(p),c=t(e,n,u,r,a),f=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:f};function v(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new d.A("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played",{adaptation:s});return p(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function p(){o.removeEventListener("decipherabilityUpdate",v),void 0!==l&&l()}}(i,o,w,r,(function(e){S.cancel(),t.error(e)}),S.signal),I=k.estimateRef,x=k.abrCallbacks,R=u.createSegmentFetcher(b.type,{onRequestBegin:x.requestBegin,onRequestEnd:x.requestEnd,onProgress:x.requestProgress,onMetrics:x.metrics});function C(e,t,n,i){var o=new m.Ay;o.linkToSignal(S.signal);var u=(0,h.D)(f,(function(t){return t*function(e){var t=T.get(e.id),n=void 0!==t?t:1;void 0===t&&T.set(e.id,n);return n}(e)}),o.signal),l="video"===b.type?v:new h.A(1/0);c.A.info("Stream: changing representation",b.type,e.id,e.bitrate);var d=(0,p.A)({},i,{error:function(r){var a,o=(0,G.A)(r,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"!==o.code)i.error(r);else{var s=f.getValue(),u=.7*(null!==(a=T.get(e.id))&&void 0!==a?a:1);if(u<=.05||s*u<=2)throw o;T.set(e.id,u),(0,ee.A)(4e3,S.signal).then((function(){return C(e,t,n,i)})).catch(g.A)}},terminating:function(){o.cancel(),i.terminating()}});tt({playbackObserver:r,content:{representation:e,adaptation:b,period:_,manifest:A},segmentBuffer:s,segmentFetcher:R,terminate:t,options:{bufferGoal:u,maxBufferSize:l,drmSystemId:a.drmSystemId,fastSwitchThreshold:n}},d,S.signal)}I.onUpdate((function(e){var n=e.bitrate;void 0!==n&&n!==E&&(E=n,c.A.debug("Stream: new "+b.type+" bitrate estimate",n),t.bitrateEstimationChange({type:b.type,bitrate:n}))}),{emitCurrentValue:!0,clearSignal:S.signal}),function e(n){var r=new m.Ay;r.linkToSignal(S.signal);var i=I.getValue(),o=i.representation,s=i.manual;if(null===o)return;if(y&&s&&!n){var u=l.A.getCurrent().DELTA_POSITION_AFTER_RELOAD;return De()((function(){if(!r.isUsed()&&I.getValue().manual){var e=u.bitrateSwitch;return t.waitingMediaSourceReload({bufferType:b.type,period:_,timeOffset:e,stayInPeriod:!0})}}))}var d=new h.A(null,r.signal);I.onUpdate((function(e){if(null!==e.representation&&e.representation.id!==o.id)return e.urgent?(c.A.info("Stream: urgent Representation switch",b.type),d.setValue({urgent:!0})):(c.A.info("Stream: slow Representation switch",b.type),d.setValue({urgent:!1}))}),{clearSignal:r.signal,emitCurrentValue:!0});var f=new h.A(0);a.enableFastSwitching&&I.onUpdate((function(e){f.setValueIfChanged(null==e?void 0:e.knownStableBitrate)}),{clearSignal:r.signal,emitCurrentValue:!0});var v={type:b.type,period:_,representation:o};if(w.setValue(o),S.isUsed())return;if(t.representationChange(v),S.isUsed())return;var p={streamStatusUpdate:t.streamStatusUpdate,encryptionDataEncountered:t.encryptionDataEncountered,manifestMightBeOufOfSync:t.manifestMightBeOufOfSync,needsManifestRefresh:t.needsManifestRefresh,inbandEvent:t.inbandEvent,warning:t.warning,error:function(e){m.Ay.isCancellationError(e)&&S.isUsed()||(S.cancel(),t.error(e))},addedSegment:function(e){x.addedSegment(e),S.isUsed()||t.addedSegment(e)},terminating:function(){if(!r.isUsed())return r.cancel(),e(!1)}};C(o,d,f,p)}(!0)},rt=n(9828);var it=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,S.A)(i,(function(e){return(0,rt.A)(e,"codecs=")})),l=(0,S.A)(s,(function(e){return(0,rt.A)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7);return d.split(".")[0]===c.split(".")[0]};function at(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return it(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,y.Nn)(a),s=t.start,u=null==t.end?1/0:t.end,d=(0,y.aW)(o,[{start:s,end:u}]);if(0===d.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 f=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),v=(0,y.bo)(d,f);if(0===v.length)return{type:"continue",value:void 0};var p=r.currentTime,h=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===h)&&(0,y.gV)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return it(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,y.Hh)(f,p))return{type:"needs-reload",value:void 0};var m="audio"===n.type&&"direct"===h,g=[],A=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!==A&&(void 0===A.bufferedEnd||t.start-A.bufferedEnd<1)&&g.push({start:0,end:t.start+1});var _=n.type,b=l.A.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,S=b[_].before;null==S&&(S=0);var E=b[_].after;if(null==E&&(E=0),m||g.push({start:p-S,end:p+E}),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)&&g.push({start:t.end-1,end:Number.MAX_VALUE})}var w=(0,y.bo)(v,g);return 0===w.length?{type:"continue",value:void 0}:m?{type:"flush-buffer",value:w}:{type:"clean-buffer",value:w}}function ot(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){if("string"==typeof e)return st(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}(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 st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return c.A.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new d.A("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played",{adaptation:e})}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}function lt(e,t,n,r,i,a){var o=r.period,s=!1;function u(){var r=e.getReference().getValue(),a=t.getValue(),u=r.position.last;void 0!==o.end&&u+a>=o.end&&(c.A.debug('Stream: full "empty" AdaptationStream',n),s=!0),i.streamStatusUpdate({period:o,bufferType:n,position:u,imminentDiscontinuity:null,isEmptyStream:!0,hasFinishedLoading:s,neededSegments:[]})}t.onUpdate(u,{emitCurrentValue:!1,clearSignal:a}),e.listen(u,{includeLastObservation:!1,clearSignal:a}),u()}var dt=function(e,t,n){var i=e.bufferType,a=e.content,s=e.garbageCollectors,u=e.playbackObserver,d=e.representationEstimator,f=e.segmentFetcherCreator,v=e.segmentBuffersStore,g=e.options,A=e.wantedBufferAhead,_=e.maxVideoBufferSize,b=a.period,S=new h.A(void 0,n);if(t.periodStreamReady({type:i,period:b,adaptationRef:S}),!n.isCancelled()){var E,T=!0;S.onUpdate((function(e){(0,r.A)(o().mark((function r(){var a,d,f,p,h,y,_,S,I,x,R,C,M,P,D,N;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==e){r.next=2;break}return r.abrupt("return");case 2:if((d=new m.Ay).linkToSignal(n),null==E||E.cancel(),E=d,null!==e){r.next=34;break}if(c.A.info("Stream: Set no "+i+" Adaptation. P:",b.start),"initialized"!==(f=v.getStatus(i)).type){r.next=26;break}if(c.A.info("Stream: Clearing previous "+i+" SegmentBuffer"),!Me.isNative(i)){r.next=15;break}return r.abrupt("return",k(0,!0,d.signal));case 15:if(p=null!==(a=b.end)&&void 0!==a?a:1/0,!(b.start>p)){r.next=20;break}c.A.warn("Stream: Can't free buffer: period's start is after its end"),r.next=24;break;case 20:return r.next=22,f.value.removeBuffer(b.start,p,d.signal);case 22:if(!d.isUsed()){r.next=24;break}return r.abrupt("return");case 24:r.next=30;break;case 26:if("uninitialized"!==f.type){r.next=30;break}if(v.disableSegmentBuffer(i),!d.isUsed()){r.next=30;break}return r.abrupt("return");case 30:if(t.adaptationChange({type:i,adaptation:null,period:b}),!d.isUsed()){r.next=33;break}return r.abrupt("return");case 33:return r.abrupt("return",lt(u,A,i,{period:b},t,d.signal));case 34:if(h=l.A.getCurrent(),y=h.DELTA_POSITION_AFTER_RELOAD,_=T?0:"audio"===i?y.trackSwitch.audio:"video"===i?y.trackSwitch.video:y.trackSwitch.other,T=!1,!Me.isNative(i)||"disabled"!==v.getStatus(i).type){r.next=39;break}return r.abrupt("return",k(_,!0,d.signal));case 39:if(c.A.info("Stream: Updating "+i+" adaptation","A: "+e.id,"P: "+b.start),t.adaptationChange({type:i,adaptation:e,period:b}),!d.isUsed()){r.next=43;break}return r.abrupt("return");case 43:if(S=u.getReadyState(),I=ut(v,i,e,g),x={currentTime:u.getCurrentTime(),readyState:S},"needs-reload"!==(R=at(I,b,e,x,g)).type){r.next=49;break}return r.abrupt("return",k(_,!0,d.signal));case 49:return r.next=51,v.waitForUsableBuffers(d.signal);case 51:if(!d.isUsed()){r.next=53;break}return r.abrupt("return");case 53:if("flush-buffer"!==R.type&&"clean-buffer"!==R.type){r.next=67;break}C=ot(R.value);case 55:if((M=C()).done){r.next=63;break}return P=M.value,D=P.start,N=P.end,r.next=59,I.removeBuffer(D,N,d.signal);case 59:if(!d.isUsed()){r.next=61;break}return r.abrupt("return");case 61:r.next=55;break;case 63:if("flush-buffer"!==R.type){r.next=67;break}if(t.needsBufferFlush(),!d.isUsed()){r.next=67;break}return r.abrupt("return");case 67:s.get(I)(d.signal),w(e,I,d.signal);case 69:case"end":return r.stop()}}),r)})))().catch((function(e){e instanceof m.AL||(null==E||E.cancel(),t.error(e))}))}),{clearSignal:n,emitCurrentValue:!0})}function w(e,n,r){var o=a.manifest,s=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=new h.A(i(),n);return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,y.vK)(r,n.position.last);return(0,p.A)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(u,n);nt({content:{manifest:o,period:b,adaptation:e},options:g,playbackObserver:s,representationEstimator:d,segmentBuffer:n,segmentFetcherCreator:f,wantedBufferAhead:A,maxVideoBufferSize:_},Object.assign(Object.assign({},t),{error:function(e){if(!Me.isNative(i)){c.A.error("Stream: "+i+" Stream crashed. Aborting it.",e instanceof Error?e:""),v.disposeSegmentBuffer(i);var n=(0,G.A)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});if(t.warning(n),r.isCancelled())return;return lt(u,A,i,{period:b},t,r)}c.A.error("Stream: "+i+" Stream crashed. Stopping playback.",e instanceof Error?e:""),t.error(e)}}),r)}function k(e,n,r){De()((function(){u.listen((function(){t.waitingMediaSourceReload({bufferType:i,period:b,timeOffset:e,stayInPeriod:n})}),{includeLastObservation:!0,clearSignal:r})}))}};function ct(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n,r=[],i=e.getInventory(),a=function(){var e=i[o];if(t.some((function(t){return e.infos.period.id===t.period.id&&e.infos.adaptation.id===t.adaptation.id&&e.infos.representation.id===t.representation.id}))){var n=e.bufferedStart,a=e.bufferedEnd;if(void 0===n||void 0===a)return c.A.warn("SO: No buffered start or end found from a segment."),{v:[{start:0,end:Number.MAX_VALUE}]};var s=r[r.length-1];void 0!==s&&s.end===n?s.end=a:r.push({start:n,end:a})}},o=0;o<i.length;o++)if(n=a())return n.v;return r}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){if("string"==typeof e)return vt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vt(e,t):void 0}}(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 vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e,t){if(0===t.length)return!1;var n=e.position.last;return e.speed>=0?t[t.length-1].end>=n-5:t[0].start<=n+5}var ht=function(e,t,n,i,a,s,u,f){for(var v,p=e.manifest,g=e.initialPeriod,y=s.maxBufferAhead,A=s.maxBufferBehind,_=s.wantedBufferAhead,b=s.maxVideoBufferSize,S=l.A.getCurrent(),E=S.MINIMUM_MAX_BUFFER_AHEAD,T=S.MAXIMUM_MAX_BUFFER_AHEAD,w=S.MAXIMUM_MAX_BUFFER_BEHIND,k=new Oe((function(e){var n,r,i=e.bufferType,a=null!==(n=w[i])&&void 0!==n?n:1/0,o=null!==(r=T[i])&&void 0!==r?r:1/0;return function(n){Le({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,h.D)(A,(function(e){return Math.min(e,a)}),n),maxBufferAhead:(0,h.D)(y,(function(e){var t,n=Math.max(e,null!==(t=E[i])&&void 0!==t?t:0);return Math.min(n,o)}),n)},n)}})),I=ft(i.getBufferTypes());!(v=I()).done;){x(v.value,g)}function x(e,n){var a=new Ne.A((function(e,t){return e.start-t.start})),s=!1,l=new m.Ay;return l.linkToSignal(f),t.listen((function(t){var n,r,i=t.position,o=null!==(n=i.pending)&&void 0!==n?n:i.last;if(s&&function(e){var t=a.head(),n=a.last();if(null==t||null==n)return!0;return t.start>e||(null==n.end?1/0:n.end)<e}(o)){for(c.A.info("Stream: Destroying all PeriodStreams due to out of bounds situation",e,o),s=!1;a.length()>0;){var d=a.get(a.length()-1);a.removeElement(d),u.periodStreamCleared({type:e,period:d})}l.cancel(),(l=new m.Ay).linkToSignal(f);var h=null!==(r=p.getPeriodForTime(o))&&void 0!==r?r:p.getNextPeriod(o);if(void 0===h)return c.A.warn("Stream: The wanted position is not found in the Manifest."),void(s=!0);v(h)}}),{clearSignal:f,includeLastObservation:!0}),p.addEventListener("decipherabilityUpdate",(function(e){(function(e){return h.apply(this,arguments)})(e).catch((function(e){l.cancel(),u.error(e)}))}),f),v(n);function v(t){var n=Object.assign(Object.assign({},u),{waitingMediaSourceReload:function(e){var t=a.head();void 0===t||t.id!==e.period.id?u.lockedStream({bufferType:e.bufferType,period:e.period}):u.needsMediaSourceReload({timeOffset:e.timeOffset,minimumPosition:e.stayInPeriod?e.period.start:void 0,maximumPosition:e.stayInPeriod?e.period.end:void 0})},periodStreamReady:function(e){s=!0,a.add(e.period),u.periodStreamReady(e)},periodStreamCleared:function(e){a.removeElement(e.period),u.periodStreamCleared(e)},error:function(e){l.cancel(),u.error(e)}});R(e,t,n,l.signal)}function h(){return h=(0,r.A)(o().mark((function n(r){var h,g,y,A,_,b,S,E,T,w,k,I,x;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h=i.getStatus(e),0!==(g=r.filter((function(t){return t.adaptation.type===e}))).length&&"initialized"===h.type&&!g.every((function(e){return!0===e.representation.decipherable}))){n.next=4;break}return n.abrupt("return");case 4:for(y=h.value,A=g.filter((function(e){return void 0===e.representation.decipherable})),_=g.filter((function(e){return!1===e.representation.decipherable})),b=ct(y,_),S=ct(y,A),s=!1,c.A.info("Stream: Destroying all PeriodStreams for decipherability matters",e);a.length()>0;)E=a.get(a.length()-1),a.removeElement(E),u.periodStreamCleared({type:e,period:E});l.cancel(),(l=new m.Ay).linkToSignal(f),T=0,w=[].concat(b,S);case 16:if(!(T<w.length)){n.next=26;break}if(k=w[T],I=k.start,x=k.end,!(I<x)){n.next=23;break}if(!f.isCancelled()){n.next=21;break}return n.abrupt("return");case 21:return n.next=23,y.removeBuffer(I,x,f);case 23:T++,n.next=16;break;case 26:De()((function(){var e;if(!f.isCancelled()){var n=t.getReference().getValue();if(pt(n,b)){if(u.needsDecipherabilityFlush(),f.isCancelled())return}else if(pt(n,S)&&(u.needsBufferFlush(),f.isCancelled()))return;var r=null!==(e=n.position.pending)&&void 0!==e?e:n.position.last,i=p.getPeriodForTime(r);null!=i?v(i):u.error(new d.A("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest."))}}));case 27:case"end":return n.stop()}}),n)}))),h.apply(this,arguments)}}function R(e,r,o,u){c.A.info("Stream: Creating new Stream for",e,r.start);var l=null,d=new m.Ay;d.linkToSignal(u),t.listen((function(t,n){var i,a,s=t.position,u=null!==(i=s.pending)&&void 0!==i?i:s.last;if(void 0!==r.end&&u>=r.end){var l=p.getPeriodAfter(r);if(r.containsTime(u,l))return;c.A.info("Stream: Destroying PeriodStream as the current playhead moved above it",e,r.start,null!==(a=s.pending)&&void 0!==a?a:s.last,r.end),n(),o.periodStreamCleared({type:e,period:r}),d.cancel()}}),{clearSignal:u,includeLastObservation:!0});var f={bufferType:e,content:{manifest:p,period:r},garbageCollectors:k,maxVideoBufferSize:b,segmentFetcherCreator:a,segmentBuffersStore:i,options:s,playbackObserver:t,representationEstimator:n,wantedBufferAhead:_},v=Object.assign(Object.assign({},o),{streamStatusUpdate:function(t){if(t.hasFinishedLoading){var n=p.getPeriodAfter(r);null!==n&&function(t){if(null!==l){if(l.period.id===t.id)return;c.A.warn("Stream: Creating next `PeriodStream` while one was already created.",e,t.id,l.period.id),o.periodStreamCleared({type:e,period:l.period}),l.canceller.cancel()}var n=new m.Ay;n.linkToSignal(u),l={canceller:n,period:t},R(e,t,o,l.canceller.signal)}(n)}else null!==l&&(c.A.info("Stream: Destroying next PeriodStream due to current one being active",e,l.period.start),o.periodStreamCleared({type:e,period:l.period}),l.canceller.cancel(),l=null);o.streamStatusUpdate(t)},error:function(e){null!==l&&(l.canceller.cancel(),l=null),d.cancel(),o.error(e)}});dt(f,v,d.signal)}},mt=ht,gt=n(4640);function yt(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){if("string"==typeof e)return At(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}(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 At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _t=function(e){function t(t,n,r){var i;(i=e.call(this)||this)._canceller=new m.Ay,i._manifest=t,i._activeStreams=new Map,i._allBufferTypes=r,i._lastCurrentPeriodId=null;var a=new bt(t);i._maximumPositionCalculator=a;var o=i._canceller.signal;return n.listen((function(e){var n,r=e.position,o=null!==(n=r.pending)&&void 0!==n?n:r.last;if(o<t.getMinimumSafePosition()){var s=new d.A("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");i.trigger("warning",s)}else if(o>a.getMaximumAvailablePosition()){var u=new d.A("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");i.trigger("warning",u)}}),{includeLastObservation:!0,clearSignal:o}),t.addEventListener("manifestUpdate",(function(){i.trigger("endingPositionChange",i._getManifestEndTime()),o.isCancelled()||i._checkEndOfStream()}),o),i}(0,i.A)(t,e);var n=t.prototype;return n.getCurrentEndingTime=function(){return this._getManifestEndTime()},n.onAdaptationChange=function(e,t,n){if(this._manifest.isLastPeriodKnown){var r=this._manifest.periods[this._manifest.periods.length-1];if(t.id===(null==r?void 0:r.id)&&("audio"===e||"video"===e)){"audio"===e?this._maximumPositionCalculator.updateLastAudioAdaptation(n):this._maximumPositionCalculator.updateLastVideoAdaptation(n);var i=this._maximumPositionCalculator.getEndingPosition(),a=void 0!==i?{isEnd:!0,endingPosition:i}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()};this.trigger("endingPositionChange",a)}}this._canceller.isUsed()||null===n&&this._addActivelyLoadedPeriod(t,e)},n.onRepresentationChange=function(e,t){this._addActivelyLoadedPeriod(t,e)},n.onPeriodCleared=function(e,t){this._removeActivelyLoadedPeriod(t,e)},n.onLastSegmentFinishedLoading=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod||(t.hasFinishedLoadingLastPeriod=!0,this._checkEndOfStream())},n.onLastSegmentLoadingResume=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod&&(t.hasFinishedLoadingLastPeriod=!1,this._checkEndOfStream())},n.dispose=function(){this.removeEventListener(),this._canceller.cancel()},n._addActivelyLoadedPeriod=function(e,t){var n=this._lazilyCreateActiveStreamInfo(t);n.activePeriods.has(e)||(n.activePeriods.add(e),this._checkCurrentPeriod())},n._removeActivelyLoadedPeriod=function(e,t){var n=this._activeStreams.get(t);void 0!==n&&n.activePeriods.has(e)&&(n.activePeriods.removeElement(e),this._checkCurrentPeriod())},n._checkCurrentPeriod=function(){var e=this;if(0!==this._allBufferTypes.length){var t=this._activeStreams.get(this._allBufferTypes[0]);if(void 0!==t)for(var n,r,i=function(){for(var t=r.value,n=!0,i=1;i<e._allBufferTypes.length;i++){var a=e._activeStreams.get(e._allBufferTypes[i]);if(void 0===a)return{v:void 0};if(!a.activePeriods.toArray().some((function(e){return e.id===t.id}))){n=!1;break}}if(n)return e._lastCurrentPeriodId!==t.id&&(e._lastCurrentPeriodId=t.id,e.trigger("periodChange",t)),{v:void 0}},a=yt(t.activePeriods.toArray());!(r=a()).done;)if(n=i())return n.v}},n._getManifestEndTime=function(){var e=this._maximumPositionCalculator.getEndingPosition();return void 0!==e?{isEnd:!0,endingPosition:e}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()}},n._lazilyCreateActiveStreamInfo=function(e){var t=this._activeStreams.get(e);return void 0===t&&(t={activePeriods:new Ne.A((function(e,t){return e.start-t.start})),hasFinishedLoadingLastPeriod:!1},this._activeStreams.set(e,t)),t},n._checkEndOfStream=function(){var e=this;this._manifest.isLastPeriodKnown&&(this._allBufferTypes.every((function(t){var n=e._activeStreams.get(t);return void 0!==n&&n.hasFinishedLoadingLastPeriod}))?this.trigger("endOfStream",null):this.trigger("resumeStream",null))},t}(q.A),bt=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getMaximumAvailablePosition=function(){if(this._manifest.isDynamic)return this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var e=St(this._lastVideoAdaptation);return"number"!=typeof e?this._manifest.getMaximumSafePosition():e}if(null===this._lastVideoAdaptation){var t=St(this._lastAudioAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}var n=St(this._lastAudioAdaptation),r=St(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?this._manifest.getMaximumSafePosition():Math.min(n,r)},t.getEndingPosition=function(){var e,t;if(!this._manifest.isDynamic)return this.getMaximumAvailablePosition();if(void 0!==this._lastVideoAdaptation&&void 0!==this._lastAudioAdaptation){if(null===this._lastAudioAdaptation)return null===this._lastVideoAdaptation?void 0:null!==(e=Et(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=Et(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=Et(this._lastAudioAdaptation),r=Et(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function St(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastAvailablePosition();if(void 0===a)return;null!==a&&(r=(0,j.A)(r)?a:Math.min(r,a))}return r}function Et(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getEnd();if(void 0===a)return;null!==a&&(r=(0,j.A)(r)?a:Math.min(r,a))}return r}var Tt=n(3116),wt=n(9770),kt=n(5121),It=n(2384);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&&(c.A.info("Init: Aborting SourceBuffer before removing"),o.abort()),c.A.info("Init: Removing SourceBuffer from mediaSource"),t.removeSourceBuffer(o)}catch(e){c.A.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&c.A.warn("Init: Not all SourceBuffers could have been removed.")}if(c.A.info("Init: Clearing HTMLMediaElement's src"),(0,Tt.A)(e),null!==n)try{c.A.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){c.A.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function Rt(e,t){return(0,v.A)(t,(function(n){var r=function(e,t){if(null==wt.j)throw new d.A("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,It.A)(e.src)?e.src:null;xt(e,null,n),c.A.info("Init: Creating MediaSource");var r=new wt.j,i=URL.createObjectURL(r);return c.A.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.register((function(){xt(e,r,i)})),r}(e,t);kt.bF(r,(function(){c.A.info("Init: MediaSource opened"),n(r)}),t)}))}function Ct(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){if("string"==typeof e)return Mt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(e,t):void 0}}(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 Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Pt=kt.yS,Dt=kt.bF,Nt=kt.G1;function Ot(e,t){if(c.A.debug("Init: Trying to call endOfStream"),"open"===e.readyState){var n=e.sourceBuffers,r=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(n);if(0===r.length)return c.A.info("Init: Triggering end of stream"),void e.endOfStream();c.A.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var i=new m.Ay;i.linkToSignal(t);for(var a,o=Ct(r);!(a=o()).done;){var s=a.value;Nt(s,(function(){i.cancel(),Ot(e,t)}),i.signal)}Pt(n,(function(){i.cancel(),Ot(e,t)}),i.signal)}else c.A.debug("Init: MediaSource not open, cancel endOfStream")}function Lt(e,t,n){var r;if(!(0,j.A)(n)){var i=e.getMinimumSafePosition(),a=e.getMaximumSafePosition();if(!(0,j.A)(n.position))return c.A.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,a),i);if(!(0,j.A)(n.wallClockTime)){c.A.debug("Init: using startAt.wallClockTime");var o=void 0===e.availabilityStartTime?0:e.availabilityStartTime,s=n.wallClockTime-o;return Math.max(Math.min(s,a),i)}if(!(0,j.A)(n.fromFirstPosition)){c.A.debug("Init: using startAt.fromFirstPosition");var u=n.fromFirstPosition;return u<=0?i:Math.min(a,i+u)}if(!(0,j.A)(n.fromLastPosition)){c.A.debug("Init: using startAt.fromLastPosition");var d=n.fromLastPosition;return d>=0?a:Math.max(i,a+d)}if(!(0,j.A)(n.fromLivePosition)){c.A.debug("Init: using startAt.fromLivePosition");var f=null!==(r=e.getLivePosition())&&void 0!==r?r:a,v=n.fromLivePosition;return v>=0?f:Math.max(i,f+v)}if(!(0,j.A)(n.percentage)){c.A.debug("Init: using startAt.percentage");var p=n.percentage;return p>100?a:p<0?i:i+(a-i)*(+p/100)}}var h=e.getMinimumSafePosition();if(e.isLive){var m,g=e.suggestedPresentationDelay,y=e.clockOffset,A=e.getMaximumSafePosition(),_=l.A.getCurrent().DEFAULT_LIVE_GAP;if(void 0===y)c.A.info("Init: no clock offset found for a live content, starting close to maximum available position"),m=A;else{c.A.info("Init: clock offset found for a live content, checking if we can start close to it");var b=void 0===e.availabilityStartTime?0:e.availabilityStartTime,S=(performance.now()+y)/1e3-b;m=Math.min(A,S)}var E=void 0!==g?g:t?_.LOW_LATENCY:_.DEFAULT;return c.A.debug("Init: "+m+" defined as the live time, applying a live gap of "+E),Math.max(m-E,h)}return c.A.info("Init: starting at the minimum available position:",h),h}var Ut=n(5097),Bt=n(107),Ft=n(6899);var Vt=31536e3,zt=function(){function e(e){this._mediaSource=e,this._currentMediaSourceDurationUpdateCanceller=null}var t=e.prototype;return t.updateDuration=function(e,t){null!==this._currentMediaSourceDurationUpdateCanceller&&this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=new m.Ay;var n=this._mediaSource,r=this._currentMediaSourceDurationUpdateCanceller.signal,i=function(e,t){var n=new h.A("open"===e.readyState,t);return(0,kt.bF)(e,(function(){c.A.debug("Init: Reacting to MediaSource open in duration updater"),n.setValueIfChanged(!0)}),t),(0,kt.Z1)(e,(function(){c.A.debug("Init: Reacting to MediaSource ended in duration updater"),n.setValueIfChanged(!1)}),t),(0,kt.XC)(e,(function(){c.A.debug("Init: Reacting to MediaSource close in duration updater"),n.setValueIfChanged(!1)}),t),n}(n,r),a=new m.Ay;a.linkToSignal(r),i.onUpdate((function(){if(a.cancel(),!i.getValue())return;(a=new m.Ay).linkToSignal(r);var o=function(e,t){if(0===e.length){var n=new h.A(!1);return n.finish(),n}var r=new h.A(!1,t);o();for(var i=function(){var n=e[a];n.addEventListener("updatestart",o),n.addEventListener("update",o),t.register((function(){n.removeEventListener("updatestart",o),n.removeEventListener("update",o)}))},a=0;a<e.length;a++)i();return r;function o(){for(var t=0;t<e.length;t++){if(e[t].updating)return void r.setValueIfChanged(!0)}r.setValueIfChanged(!1)}}(n.sourceBuffers,a.signal),s=new m.Ay;return s.linkToSignal(a.signal),o.onUpdate((function(r){s.cancel(),(s=new m.Ay).linkToSignal(a.signal),r||Wt(n,e,t,s.signal)}),{clearSignal:a.signal,emitCurrentValue:!0})}),{emitCurrentValue:!0,clearSignal:r})},t.stopUpdating=function(){null!==this._currentMediaSourceDurationUpdateCanceller&&(this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=null)},e}();function Kt(e,t,n){var r=t;n||(r=s.A7?1/0:Gt(t));for(var i=0,a=0;a<e.sourceBuffers.length;a++){var o=e.sourceBuffers[a],u=o.buffered.length;u>0&&(i=Math.max(o.buffered.end(u-1)))}if(r===e.duration)return"success";if(i>r){if(i<e.duration)try{c.A.info("Init: Updating duration to what is currently buffered",i),e.duration=i}catch(e){return c.A.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var l=e.duration;try{if(c.A.info("Init: Updating duration",r),e.duration=r,"open"===e.readyState&&!isFinite(r)){var d=Gt(t);c.A.info("Init: calling `mediaSource.setLiveSeekableRange`",d),e.setLiveSeekableRange(0,d)}}catch(e){return c.A.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var f=Math.abs(e.duration-r);return f>=.1?f<Math.abs(e.duration-l)?"partial":"failed":"success"}function Wt(e,t,n,r){if("success"!==Kt(e,t,n))var i=setTimeout((function(){a(),Wt(e,t,n,r)}),2e3),a=r.register((function(){clearTimeout(i)}))}function Gt(e){return Math.max(Math.pow(2,32),e+Vt)}var Ht=n(3137);var qt=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var jt=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(qt(u,{id:a,start:r,end:i}))return void n.push(u)}var l=o.value.element,d={type:o.type,value:Object.assign(Object.assign({},o.value),{element:l})};if(void 0===i){var c={start:r,id:a,data:d,publicEvent:{start:r,data:d}};n.push(c)}else{var f={start:r,end:i,id:a,data:d,publicEvent:{start:r,end:i,data:d}};n.push(f)}}))}return n};function Yt(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){if("string"==typeof e)return Qt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qt(e,t):void 0}}(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 Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $t=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._manifest=t,i._mediaElement=n,i._playbackObserver=r,i._canceller=null,i._scheduledEventsRef=new h.A([]),i._eventsBeingPlayed=new WeakMap,i}(0,i.A)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(null===this._canceller){this._canceller=new m.Ay;var t=this._canceller.signal,n=this._playbackObserver,r=this._mediaElement,i=!1,a=new m.Ay;a.linkToSignal(t),this._manifest.addEventListener("manifestUpdate",(function(){var t=e._scheduledEventsRef.getValue();e._scheduledEventsRef.setValue(jt(t,e._manifest))}),this._canceller.signal),this._scheduledEventsRef.setValue(jt([],this._manifest)),this._scheduledEventsRef.onUpdate((function(o){if(0!==o.length){if(!i){i=!0;var s=f(),u=function(){var t=f();e._emitStreamEvents(e._scheduledEventsRef.getValue(),s,t,a.signal),s=t},d=l.A.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL,c=setInterval(u,d);n.listen(u,{includeLastObservation:!1,clearSignal:a.signal}),a.signal.register((function(){clearInterval(c)}))}}else i&&(a.cancel(),(a=new m.Ay).linkToSignal(t),i=!1);function f(){var e=n.getReference().getValue().seeking;return{currentTime:r.currentTime,isSeeking:e}}}),{emitCurrentValue:!0,clearSignal:t})}},n.stop=function(){null!==this._canceller&&(this._canceller.cancel(),this._canceller=null)},n._emitStreamEvents=function(e,t,n,r){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],c=d.start,f=Xt(d)?d.end:void 0;this._eventsBeingPlayed.has(d)?(c>o||void 0!==f&&o>=f)&&(Xt(d)&&u.push(d.publicEvent),this._eventsBeingPlayed.delete(d)):c<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:d.publicEvent}),this._eventsBeingPlayed.set(d,!0)):i<c&&o>=(null!=f?f:c)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),Xt(d)&&u.push(d.publicEvent)))}if(s.length>0)for(var v,p=Yt(s);!(v=p()).done;){var h=v.value;if("stream-event"===h.type?this.trigger("event",h.value):this.trigger("eventSkip",h.value),r.isCancelled())return}if(u.length>0)for(var m,g=Yt(u);!(m=g()).done;){var y=m.value;if("function"==typeof y.onExit&&y.onExit(),r.isCancelled())return}},t}(q.A);function Xt(e){return void 0!==e.end}var Zt=$t,Jt=n(8345);function en(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){if("string"==typeof e)return tn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tn(e,t):void 0}}(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 tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nn=function(e){function t(t){var n;(n=e.call(this)||this)._settings=t,n._initCanceller=new m.Ay,n._initialManifestProm=null;var r=void 0===t.url?void 0:[t.url];return n._manifestFetcher=new de(r,t.transport,t.manifestRequestSettings),n}(0,i.A)(t,e);var n=t.prototype;return n.prepare=function(){var e=this;null===this._initialManifestProm&&(this._initialManifestProm=(0,v.A)(this._initCanceller.signal,(function(t,n){e._manifestFetcher.addEventListener("warning",(function(t){return e.trigger("warning",t)})),e._manifestFetcher.addEventListener("error",(function(t){e.trigger("error",t),n(t)})),e._manifestFetcher.addEventListener("manifestReady",(function(e){t(e)}))})),this._manifestFetcher.start(),this._initCanceller.signal.register((function(){e._manifestFetcher.dispose()})))},n.start=function(e,t){var n=this;this.prepare(),(0,Jt.A)(e,(function(e){return n._onFatalError(e)}),this._initCanceller.signal);var r=new h.A(null,this._initCanceller.signal);this._initializeMediaSourceAndDecryption(e,r).then((function(i){return n._onInitialMediaSourceReady(e,i.mediaSource,t,i.drmSystemId,r,i.unlinkMediaSource)})).catch((function(e){n._onFatalError(e)}))},n.updateContentUrls=function(e,t){this._manifestFetcher.updateContentUrls(e,t)},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.isUsed()||(this._initCanceller.cancel(),this.trigger("error",e))},n._initializeMediaSourceAndDecryption=function(e,t){var n=this,r=this._initCanceller;return(0,v.A)(r.signal,(function(i){var a=n._settings.keySystems,o=(0,Ft.A)(e,a,t,{onWarning:function(e){return n.trigger("warning",e)},onError:function(e){return n._onFatalError(e)}},r.signal);o.onUpdate((function(t,a){if("uninitialized"!==t.initializationState.type){a();var s=new m.Ay;s.linkToSignal(r.signal),Rt(e,s.signal).then((function(e){var n=o.getValue();if("awaiting-media-link"===n.initializationState.type)n.initializationState.value.isMediaLinked.setValue(!0),o.onUpdate((function(t,n){if("initialized"===t.initializationState.type)return n(),void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})}),{emitCurrentValue:!0,clearSignal:r.signal});else if("initialized"===t.initializationState.type)return void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})})).catch((function(e){s.isUsed()||n._onFatalError(e)}))}}),{emitCurrentValue:!0,clearSignal:r.signal})}))},n._onInitialMediaSourceReady=function(){var e=(0,r.A)(o().mark((function e(t,n,r,i,a,s){var u,l,d,v,h,g,y,A,_,b,S,E,T,w,k,I,x,R,C,M,P,D=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P=function(e,n,i,o){R({mediaElement:t,playbackObserver:r,mediaSource:e,initialTime:n,autoPlay:i,manifest:T,representationEstimator:k,segmentFetcherCreator:x,speed:y,protectionRef:a,bufferOptions:I},(function(e){if(o.cancel(),S.isUsed())return;if(C("reloadingMediaSource",e),S.isUsed())return;var n=new m.Ay;n.linkToSignal(S.signal),Rt(t,n.signal).then((function(t){P(t,e.position,e.autoPlay,n)})).catch((function(e){n.isUsed()||M(e)}))}),o.signal)},u=this._settings,l=u.adaptiveOptions,d=u.autoPlay,v=u.bufferOptions,h=u.lowLatencyMode,g=u.segmentRequestOptions,y=u.speed,A=u.startAt,_=u.textTrackOptions,b=u.transport,S=this._initCanceller,(0,f.h)(null!==this._initialManifestProm),E=this._initialManifestProm,e.prev=5,e.next=8,E;case 8:T=e.sent,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return");case 14:if(T.addEventListener("manifestUpdate",(function(){D.trigger("manifestUpdate",null)}),S.signal),T.addEventListener("decipherabilityUpdate",(function(e){D.trigger("decipherabilityUpdate",e)}),S.signal),c.A.debug("Init: Calculating initial time"),w=Lt(T,h,A),c.A.debug("Init: Initial time calculated:",w),k=K(l),I=(0,p.A)({textTrackOptions:_,drmSystemId:i},v),x=new Ee(b,g,S.signal),this.trigger("manifestReady",T),!S.isUsed()){e.next=25;break}return e.abrupt("return");case 25:R=this._startBufferingOnMediaSource.bind(this),C=this.trigger.bind(this),M=this._onFatalError.bind(this),P(n,w,d,s);case 29:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}(),n._startBufferingOnMediaSource=function(e,t,n){var r,i=this,a=e.autoPlay,o=e.bufferOptions,s=e.initialTime,c=e.manifest,f=e.mediaElement,v=e.mediaSource,p=e.playbackObserver,g=e.protectionRef,y=e.representationEstimator,A=e.segmentFetcherCreator,_=e.speed,b=null!==(r=c.getPeriodForTime(s))&&void 0!==r?r:c.getNextPeriod(s);if(void 0===b){var S=new d.A("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return this._onFatalError(S)}var E=new Me(f,v);n.register((function(){E.disposeAll()}));var T=(0,Bt.A)(f,p,s,a,(function(e){return i.trigger("warning",e)}),!0,n),w=T.autoPlayResult,k=T.initialPlayPerformed,I=T.initialSeekPerformed;if(!n.isCancelled()){k.onUpdate((function(e,t){if(e){t();var r=new Zt(c,f,p);r.addEventListener("event",(function(e){i.trigger("streamEvent",e)}),n),r.addEventListener("eventSkip",(function(e){i.trigger("streamEventSkip",e)}),n),r.start(),n.register((function(){r.stop()}))}}),{clearSignal:n,emitCurrentValue:!0});var x=function(e,t,n){var r=t.autoPlay,i=t.initialPlayPerformed,a=t.initialSeekPerformed,o=t.manifest,s=t.speed,u=t.startTime;return e.deriveReadOnlyObserver((function(e,t){var l=new m.Ay;l.linkToSignal(t),l.linkToSignal(n);var d=new h.A(c(),l.signal);return s.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),e.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),d;function c(){var t,n=e.getValue(),l=s.getValue();if(a.getValue()){if(!o.isDynamic||o.isLastPeriodKnown){var d=o.periods[o.periods.length-1];void 0!==d&&void 0!==d.end&&n.position>d.end&&(t=d.end-1)}}else t=u;return{maximumPosition:o.getMaximumSafePosition(),position:{last:n.position,pending:t},duration:n.duration,paused:{last:n.paused,pending:i.getValue()||!r===n.paused?void 0:!r},readyState:n.readyState,speed:l}}function f(){d.setValue(c())}}))}(p,{autoPlay:a,manifest:c,initialPlayPerformed:k,initialSeekPerformed:I,speed:_,startTime:s},n),R=this._createRebufferingController(p,c,_,n),C=this._createContentTimeBoundariesObserver(c,v,x,E,n);u&&c.addEventListener("decipherabilityUpdate",(function(e){e.some((function(e){return!0!==e.representation.decipherable}))&&P(0,void 0,void 0)}),n),w.then((function(){(0,Ut.A)(p,f,!1,n).onUpdate((function(e,t){e&&(t(),i.trigger("loaded",{segmentBuffersStore:E}))}),{emitCurrentValue:!0,clearSignal:n})})).catch((function(e){n.isCancelled()||i._onFatalError(e)}));var M=this;mt({manifest:c,initialPeriod:b},x,y,E,A,o,{needsBufferFlush:function(){var e=f.currentTime+.001;p.setCurrentTime(e),p.listen((function(t,n){(null!==t.currentRange||t.position>e+.1)&&(n(),p.setCurrentTime(t.position+.001))}),{includeLastObservation:!1,clearSignal:n})},streamStatusUpdate:function(e){var t=e.period,r=e.bufferType,i=e.imminentDiscontinuity,a=e.position;R.updateDiscontinuityInfo({period:t,bufferType:r,discontinuity:i,position:a}),n.isCancelled()||c.isLastPeriodKnown&&e.period.id===c.periods[c.periods.length-1].id&&(e.hasFinishedLoading||e.isEmptyStream?C.onLastSegmentFinishedLoading(e.bufferType):C.onLastSegmentLoadingResume(e.bufferType))},needsManifestRefresh:function(){return M._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!0,canUseUnsafeMode:!0})},manifestMightBeOufOfSync:function(){var e=l.A.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;M._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!1,canUseUnsafeMode:!1,delay:e})},lockedStream:function(e){return R.onLockedStream(e.bufferType,e.period)},adaptationChange:function(e){M.trigger("adaptationChange",e),n.isCancelled()||C.onAdaptationChange(e.type,e.period,e.adaptation)},representationChange:function(e){M.trigger("representationChange",e),n.isCancelled()||C.onRepresentationChange(e.type,e.period)},inbandEvent:function(e){return M.trigger("inbandEvents",e)},warning:function(e){return M.trigger("warning",e)},periodStreamReady:function(e){return M.trigger("periodStreamReady",e)},periodStreamCleared:function(e){C.onPeriodCleared(e.type,e.period),n.isCancelled()||M.trigger("periodStreamCleared",e)},bitrateEstimationChange:function(e){return M.trigger("bitrateEstimationChange",e)},addedSegment:function(e){return M.trigger("addedSegment",e)},needsMediaSourceReload:function(e){P(e.timeOffset,e.minimumPosition,e.maximumPosition)},needsDecipherabilityFlush:function(){var e,n,r,i,a=(0,W.A)(f);if(void 0===(i=null==a?void 0:a[0])||i.indexOf("widevine")<0){var o=x.getReference().getValue(),s=null!==(e=o.position.pending)&&void 0!==e?e:x.getCurrentTime(),u=null!==(n=o.paused.pending)&&void 0!==n?n:x.getIsPaused();t({position:s,autoPlay:!u})}else{var l=x.getReference().getValue(),d=null!==(r=l.position.pending)&&void 0!==r?r:x.getCurrentTime();d+.001<l.duration?p.setCurrentTime(f.currentTime+.001):p.setCurrentTime(d)}},encryptionDataEncountered:function(e){for(var t,r=en(e);!(t=r()).done;){var i=t.value;if(g.setValue(i),n.isCancelled())return}},error:function(e){return M._onFatalError(e)}},n)}function P(e,n,r){var i,a,o=x.getReference().getValue(),s=null!==(i=o.position.pending)&&void 0!==i?i:x.getCurrentTime(),u=null!==(a=o.paused.pending)&&void 0!==a?a:x.getIsPaused(),l=s+e;void 0!==n&&(l=Math.max(n,l)),void 0!==r&&(l=Math.min(r,l)),t({position:l,autoPlay:!u})}},n._createContentTimeBoundariesObserver=function(e,t,n,r,i){var a=this,o=new zt(t);i.register((function(){o.stopUpdating()}));var s=null,u=new _t(e,n,r.getBufferTypes());i.register((function(){u.dispose()})),u.addEventListener("warning",(function(e){return a.trigger("warning",e)})),u.addEventListener("periodChange",(function(e){a.trigger("activePeriodChanged",{period:e})})),u.addEventListener("endingPositionChange",(function(e){return o.updateDuration(e.endingPosition,e.isEnd)})),u.addEventListener("endOfStream",(function(){null===s&&((s=new m.Ay).linkToSignal(i),c.A.debug("Init: end-of-stream order received."),function(e,t){var n=new m.Ay;n.linkToSignal(t),Dt(e,(function(){c.A.debug("Init: MediaSource re-opened while end-of-stream is active"),n.cancel(),(n=new m.Ay).linkToSignal(t),Ot(e,n.signal)}),t),Ot(e,n.signal)}(t,s.signal))})),u.addEventListener("resumeStream",(function(){null!==s&&(c.A.debug("Init: resume-stream order received."),s.cancel(),s=null)}));var l=u.getCurrentEndingTime();return o.updateDuration(l.endingPosition,l.isEnd),u},n._createRebufferingController=function(e,t,n,r){var i=this,a=new Ht.A(e,t,n);return a.addEventListener("stalled",(function(e){return i.trigger("stalled",e)})),a.addEventListener("unstalled",(function(){return i.trigger("unstalled",null)})),a.addEventListener("warning",(function(e){return i.trigger("warning",e)})),r.register((function(){return a.destroy()})),a.start(),a},t}(gt.Y)},4640:function(e,t,n){"use strict";n.d(t,{Y:function(){return i}});var r=n(7387),i=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t}(n(79).A)},5097:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(443);var i=n(2097),a=n(8315),o=n(2507);function s(e,t,n,s){var u=new o.Ay;u.linkToSignal(s);var l=new a.A(!1,u.signal);return e.listen((function(e){if(null===e.rebuffering&&null===e.freezing&&0!==e.readyState){if(!function(e){return!e||!r.dX}(n)){if(isNaN(t.duration))return;if(t.duration>0)return l.setValue(!0),void u.cancel()}var a=r.A7?4:3;return e.readyState>=a&&(null!==e.currentRange||e.ended)&&(!(0,i.A)()||t.duration>0)?(l.setValue(!0),void u.cancel()):void 0}}),{includeLastObservation:!0,clearSignal:u.signal}),l}},107:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(2097),i=n(9770),a=n(443),o=n(7913);var s=n(5575),u=n(9477),l=n(8315);function d(e,t,n,d,c,f,v){var p,h,m=new Promise((function(e,t){p=e,h=t})),g=new l.A(!1,v),y=new l.A(!1,v);e.addEventListener("loadedmetadata",_);var A=v.register((function(t){e.removeEventListener("loadedmetadata",_),h(t)}));return e.readyState>=i.t.HAVE_METADATA&&_(),{autoPlayResult:m,initialPlayPerformed:y,initialSeekPerformed:g};function _(){e.removeEventListener("loadedmetadata",_);var i=!1,l=function(e){u.A.info("Init: Set initial time",e),t.setCurrentTime(e),i=!0,g.setValue(!0),g.finish()},m="function"==typeof n?n():n;if((a.qe||a.h$)&&0===m?(g.setValue(!0),g.finish()):f&&a.dX?setTimeout((function(){l(m)}),0):l(m),(0,r.A)()&&0===e.duration){var b=new s.A("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");c(b)}if(!v.isCancelled()){var S=i;t.listen((function(t,n){!i||!t.seeking&&"seeking"!==t.event&&"internal-seeking"!==t.event?!S&&!t.seeking&&(o.A&&t.readyState>=3||null===t.rebuffering)&&t.readyState>=1&&(n(),function(){var t,n;if(u.A.info("Init: Can begin to play content"),!d)return e.autoplay&&u.A.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),y.setValue(!0),y.finish(),A(),p({type:"skipped"});if(e.ended)return u.A.warn("Init: autoplay is enabled but the video is ended. Skipping autoplay to prevent video to start again"),y.setValue(!0),y.finish(),A(),p({type:"skipped"});try{n=null!==(t=e.play())&&void 0!==t?t:Promise.resolve()}catch(e){return A(),h(e)}n.then((function(){if(!v.isCancelled())return y.setValue(!0),y.finish(),A(),p({type:"autoplay"})})).catch((function(e){if(A(),!v.isCancelled()){if(e instanceof Error&&"NotAllowedError"===e.name){u.A.warn("Init: Media element can't play. It may be due to browser auto-play policies.");var t=new s.A("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");if(c(t),v.isCancelled())return;return p({type:"autoplay-blocked"})}h(e)}}))}()):S=!1}),{includeLastObservation:!0,clearSignal:v})}}}},6899:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(1956),i=n(418),a=n(9477),o=n(8315),s=n(2507),u=n(2137);function l(e,t,n,l,d){if(0===t.length)return h("No `keySystems` option given.");if(null===i.A.decrypt)return h("EME feature not activated.");var c=new s.Ay;c.linkToSignal(d);var f=new o.A({initializationState:{type:"uninitialized",value:null},drmSystemId:void 0},d),v=i.A.decrypt;if(!v.hasEmeApis())return h("EME API not available on the current page.");a.A.debug("Init: Creating ContentDecryptor");var p=new v(e,t);return p.addEventListener("stateChange",(function(e){if(e===u.R.WaitingForAttachment){var t=new o.A(!1);t.onUpdate((function(t,n){t&&(n(),e===u.R.WaitingForAttachment&&p.attach())}),{clearSignal:c.signal}),f.setValue({initializationState:{type:"awaiting-media-link",value:{isMediaLinked:t}},drmSystemId:p.systemId})}else e===u.R.ReadyForContent&&(f.setValue({initializationState:{type:"initialized",value:null},drmSystemId:p.systemId}),p.removeEventListener("stateChange"))})),p.addEventListener("error",(function(e){c.cancel(),l.onError(e)})),p.addEventListener("warning",(function(e){l.onWarning(e)})),n.onUpdate((function(e){null!==e&&p.onInitializationData(e)}),{clearSignal:c.signal}),c.signal.register((function(){p.dispose()})),f;function h(e){n.onUpdate((function(t,n){if(null!==t){n();var i=new r.A("MEDIA_IS_ENCRYPTED_ERROR",e);l.onError(i)}}),{clearSignal:d});var t=new o.A({initializationState:{type:"initialized",value:null},drmSystemId:void 0});return t.finish(),t}}},3137:function(e,t,n){"use strict";n.d(t,{A:function(){return f}});var r=n(7387),i=n(7913),a=n(5151),o=n(5575),s=n(9477),u=n(79),l=n(3650),d=n(2507),c=1/60,f=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._playbackObserver=t,i._manifest=n,i._speed=r,i._discontinuitiesStore=[],i._isStarted=!1,i._canceller=new d.Ay,i}(0,r.A)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(!this._isStarted){var t;this._isStarted=!0;var n=null,r=new h(this._playbackObserver,this._speed);this._canceller.signal.register((function(){r.dispose()}));var o=null;this._playbackObserver.listen((function(u){var d,f,v=e._discontinuitiesStore,h=u.buffered,m=u.position,g=u.readyState,y=u.rebuffering,A=u.freezing,_=a.A.getCurrent(),b=_.BUFFER_DISCONTINUITY_THRESHOLD,S=_.FORCE_DISCONTINUITY_SEEK_DELAY,E=_.FREEZING_STALLED_DELAY,T=_.UNFREEZING_SEEK_DELAY,w=_.UNFREEZING_DELTA_POSITION;if(!u.seeking&&i.A&&null===n&&null!==t&&u.position<t){s.A.debug("Init: the device appeared to have seeked back by itself.");var k=performance.now();n=k}if(t=u.seeking?Math.max(null!==(d=u.pendingInternalSeek)&&void 0!==d?d:0,u.position):null,null!==A){var I=performance.now();if(I-(null===o?A.timestamp:o.attemptTimestamp)>T&&(s.A.warn("Init: trying to seek to un-freeze player"),e._playbackObserver.setCurrentTime(e._playbackObserver.getCurrentTime()+w),o={attemptTimestamp:I}),I-A.timestamp>E)return null===y||null!==n?r.stopRebuffering():r.startRebuffering(),void e.trigger("stalled","freezing")}else o=null;if(null===y)return r.stopRebuffering(),1===g?(f=u.seeking?null!==u.pendingInternalSeek?"internal-seek":"seeking":"not-ready",void e.trigger("stalled",f)):void e.trigger("unstalled",null);var x="seeking"===y.reason&&null!==u.pendingInternalSeek?"internal-seek":y.reason;if(null!==n){var R=performance.now();if(R-n<S)return r.stopRebuffering(),s.A.debug("Init: letting the device get out of a stall by itself"),void e.trigger("stalled",x);s.A.warn("Init: ignored stall for too long, checking discontinuity",R-n)}if(n=null,r.startRebuffering(),null!==e._manifest){var C=y.position;if(null!=C&&e._speed.getValue()>0){var M=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 u=e[i],l=u.discontinuity,d=u.position,f=l.start,v=l.end;if(n>=(null!=f?f:d)-c)if(null===v){var p=t.getPeriodAfter(a);null!==p?o=p.start+c:s.A.warn("Init: discontinuity at Period's end but no next Period")}else n<v+c&&(o=v+c);void 0!==o&&(s.A.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(v,e._manifest,C);if(null!==M){var P=M+.001;if(!(P<=e._playbackObserver.getCurrentTime()))return s.A.warn("SA: skippable discontinuity found in the stream",m,P),e._playbackObserver.setCurrentTime(P),void e.trigger("warning",p(C,P));s.A.info("Init: position to seek already reached, no seeking",e._playbackObserver.getCurrentTime(),P)}}var D=null!=C?C:m,N=(0,l.Td)(h,D);if(e._speed.getValue()>0&&N<b){var O=D+N+c;if(e._playbackObserver.getCurrentTime()<O)return s.A.warn("Init: discontinuity encountered inferior to the threshold",D,O,b),e._playbackObserver.setCurrentTime(O),void e.trigger("warning",p(D,O))}for(var L=e._manifest.periods.length-2;L>=0;L--){var U=e._manifest.periods[L];if(void 0!==U.end&&U.end<=D){if(e._manifest.periods[L+1].start>D&&e._manifest.periods[L+1].start>e._playbackObserver.getCurrentTime()){var B=e._manifest.periods[L+1];return e._playbackObserver.setCurrentTime(B.start),void e.trigger("warning",p(D,B.start))}break}}e.trigger("stalled",x)}else e.trigger("stalled",x)}),{includeLastObservation:!0,clearSignal:this._canceller.signal})}},n.updateDiscontinuityInfo=function(e){this._isStarted||this.start();var t=this._playbackObserver.getReference().getValue();!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;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return void(v(t)?e[a]=t:e.splice(a,1))}else if(e[a].period.start>r.start)return void(v(t)&&e.splice(a,0,t));v(t)&&e.push(t)}(this._discontinuitiesStore,e,t)},n.onLockedStream=function(e,t){var n;this._isStarted||this.start();var r=this._playbackObserver.getReference().getValue();if(!(!r.rebuffering||r.paused||this._speed.getValue()<=0||"audio"!==e&&"video"!==e)){var i=r.position,a=null!==(n=r.rebuffering.position)&&void 0!==n?n:i,o=t.start;i<o&&Math.abs(a-o)<1&&(s.A.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),this._playbackObserver.setCurrentTime(o+.001))}},n.destroy=function(){this._canceller.cancel()},t}(u.A);function v(e){return null!==e.discontinuity}function p(e,t){return new o.A("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var h=function(){function e(e,t){this._speedUpdateCanceller=new d.Ay,this._isRebuffering=!1,this._playbackObserver=e,this._isDisposed=!1,this._speed=t,this._updateSpeed()}var t=e.prototype;return t.startRebuffering=function(){this._isRebuffering||this._isDisposed||(this._isRebuffering=!0,this._speedUpdateCanceller.cancel(),s.A.info("Init: Pause playback to build buffer"),this._playbackObserver.setPlaybackRate(0))},t.stopRebuffering=function(){this._isRebuffering&&!this._isDisposed&&(this._isRebuffering=!1,this._speedUpdateCanceller=new d.Ay,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){s.A.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},8345:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(5575),i=n(6787);function a(e,t,n){function a(){var n,a,o=e.error;switch((0,i.A)(o)||(n=o.code,a=o.message),n){case 1:return a=null!=a?a:"The fetching of the associated resource was aborted by the user's request.",t(new r.A("MEDIA_ERR_ABORTED",a));case 2:return a=null!=a?a:"A network error occurred which prevented the media from being successfully fetched",t(new r.A("MEDIA_ERR_NETWORK",a));case 3:return a=null!=a?a:"An error occurred while trying to decode the media resource",t(new r.A("MEDIA_ERR_DECODE",a));case 4:return a=null!=a?a:"The media resource has been found to be unsuitable.",t(new r.A("MEDIA_ERR_SRC_NOT_SUPPORTED",a));default:return a=null!=a?a:"The HTMLMediaElement errored due to an unknown reason.",t(new r.A("MEDIA_ERR_UNKNOWN",a))}}n.isCancelled()||(e.addEventListener("error",a),n.register((function(){e.removeEventListener("error",a)})))}},4166:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(9477),a=n(7500),o=n(3481),s=function(e){function t(){var t;return i.A.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new o.A,t}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){i.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){i.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){var t,n;if(i.A.debug("ISB: appending new data."),null===e.data.chunk)return Promise.resolve();var r=e.data,a=r.appendWindow,o=r.chunk,s=o.start,u=o.end,l=o.timescale,d=null!==(t=a[0])&&void 0!==t?t:0,c=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(d,f),h=Math.min(c,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0,performance.now())}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return i.A.info("ISB: ignored image data remove order",e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){i.A.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(a.K)},7938:function(e,t,n){"use strict";n.d(t,{A:function(){return T}});var r=n(7387),i=n(5121),a=n(9477),o=n(8315),s=n(2186).A?void 0:window.ResizeObserver;var u=n(5151),l=n(2507),d=n(7500),c=n(3481),f=n(418);function v(e,t,n){return void 0===n&&(n=.2),Math.abs(e-t)<=Math.min(n,.2)}function p(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function h(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function m(e,t,n){var r=Math.max(e.start,t),i=p(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=h(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var g=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);if(0===n.length&&a.length>0)for(var s=0;s<a.length;s++)(v(e,a[s].start,.001)||v(e,a[s].end,.001))&&n.push(a[s].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=h(a.cues,n),a.start=n;else{var o=m(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=p(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r,i,a,o,s=this._cuesBuffer,u={start:t,end:n,cues:e},l=Math.abs(t-n)/5;function d(e){var t=s[e];void 0===t||v(u.end,t.end,l)?s[e]=u:(t.start>=u.end||(t.cues=h(t.cues,u.end),t.start=u.end),s.splice(e,0,u))}for(var c=0;c<s.length;c++){var f=s[c];if(t<f.end){if(i=f,a=void 0,o=void 0,a=(r=u).end-r.start,o=i.end-i.start,Math.abs(r.start-i.start)/Math.min(a,o,.2)<=.05){if(v(n,f.end,l))return void(s[c]=u);if(n<f.end)return f.cues=h(f.cues,n),f.start=n,void s.splice(c,0,u);do{s.splice(c,1),f=s[c]}while(void 0!==f&&n>f.end);return void d(c)}if(t<f.start){if(n<f.start)return void s.splice(c,0,u);if(v(n,f.start,l))return f.start=n,void s.splice(c,0,u);if(v(n,f.end,l))return void s.splice(c,1,u);if(n<f.end)return f.cues=h(f.cues,n),f.start=n,void s.splice(c,0,u);do{s.splice(c,1),f=s[c]}while(void 0!==f&&n>f.end);return void d(c)}if(v(f.end,n,l))return f.cues=p(f.cues,t),f.end=t,void s.splice(c+1,0,u);if(f.end>n){var g=m(f,t,n),y=g[0],A=g[1];return this._cuesBuffer[c]=y,s.splice(c+1,0,u),void s.splice(c+2,0,A)}f.cues=p(f.cues,t),f.end=t;var _=c+1;for(f=s[_];void 0!==f&&n>f.end;)s.splice(_,1),f=s[_];return void d(_)}}if(s.length){var b=s[s.length-1];v(b.end,t,l)&&(b.end=t)}s.push(u)},e}();function y(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 d=s.getAttribute("data-proportional-height");null===d||isNaN(+d)||(s.style.height=String(+d*i[1])+"px");var c=s.getAttribute("data-proportional-line-height");null===c||isNaN(+c)||(s.style.lineHeight=String(+c*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*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 A=i.g9,_=i.Bi,b=i.ID;function S(e,t){try{e.removeChild(t)}catch(e){a.A.warn("HTSB: Can't remove text track: not in the element.")}}function E(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 T=function(e){function t(t,n){var r;return a.A.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new c.A,r._videoElement=t,r._textTrackElement=n,r._sizeUpdateCanceller=new l.Ay,r._canceller=new l.Ay,r._buffer=new g,r._currentCues=[],r.autoRefreshSubtitles(r._canceller.signal),r}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){a.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){try{this.pushChunkSync(e)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this.removeBufferSync(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.A.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._canceller.cancel()},n.pushChunkSync=function(e){var t,n;a.A.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk;if(null!==s){var u,l,d=s.start,c=s.end,v=s.data,p=s.type,h=s.language,m=null!==(t=o[0])&&void 0!==t?t:0,g=null!==(n=o[1])&&void 0!==n?n:1/0,y=function(e,t,n,r){a.A.debug("HTSB: Finding parser for html text tracks:",e);var i=f.A.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.A.debug("HTSB: Parser found, parsing...");var o=i(t,n,r);return a.A.debug("HTTB: Parsed successfully!",o.length),o}(p,v,i,h);if(0!==m&&g!==1/0){for(var A=0;A<y.length&&y[A].end<=m;)A++;for(y.splice(0,A),A=0;A<y.length&&y[A].start<m;)y[A].start=m,A++;for(A=y.length-1;A>=0&&y[A].start>=g;)A--;for(y.splice(A,y.length),A=y.length-1;A>=0&&y[A].end>g;)y[A].end=g,A--}if(void 0!==d)u=Math.max(m,d);else{if(y.length<=0)return void a.A.warn("HTSB: Current text tracks have no cues nor start time. Aborting");a.A.warn("HTSB: No start time given. Guessing from cues."),u=y[0].start}if(void 0!==c)l=Math.min(g,c);else{if(y.length<=0)return void a.A.warn("HTSB: Current text tracks have no cues nor end time. Aborting");a.A.warn("HTSB: No end time given. Guessing from cues."),l=y[y.length-1].end}l<=u?a.A.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,!0,performance.now()),this._buffer.insert(y,u,l),this._buffered.insert(u,l))}},n.removeBufferSync=function(e,t){a.A.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._sizeUpdateCanceller.cancel(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)S(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._sizeUpdateCanceller.cancel();for(var t=0;t<this._currentCues.length;t++)S(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=E(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var d=this._currentCues.filter((function(e){return null!==e.resolution}));if(d.length>0){this._sizeUpdateCanceller=new l.Ay,this._sizeUpdateCanceller.linkToSignal(this._canceller.signal);var c=u.A.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=new o.A({height:i,width:u},n),d=i,c=u;if(void 0!==s){var f=new s((function(e){if(0!==e.length){var t=e[0].contentRect,n=t.height,r=t.width;n===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}else a.A.error("Compat: Resized but no observed element.")}));f.observe(e),n.register((function(){f.disconnect()}))}else{var v=setInterval((function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;n===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,c,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<d.length;r++){var i=d[r];y(t,n,i.resolution,i.element)}}),{clearSignal:this._sizeUpdateCanceller.signal,emitCurrentValue:!0})}}},n.autoRefreshSubtitles=function(e){var t=this,n=null,r=u.A.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,i=function(){a(),(n=new l.Ay).linkToSignal(e);var i=setInterval((function(){return t.refreshSubtitles()}),r);n.signal.register((function(){clearInterval(i)})),t.refreshSubtitles()};function a(){null!==n&&(n.cancel(),n=null)}b(this._videoElement,(function(){a(),t._disableCurrentCues()}),e),_(this._videoElement,i,e),A(this._videoElement,i,e),i()},n.refreshSubtitles=function(){var e,t=u.A.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL;e=this._videoElement.paused||this._videoElement.playbackRate<=0?this._videoElement.currentTime:Math.max(this._videoElement.currentTime+t/1e3/2,0);var n=this._buffer.get(e);0===n.length?this._disableCurrentCues():this._displayCues(n)},t}(d.K)},8385:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(7387),i=n(443);var a=n(9477);function o(e,t){if(i.gm&&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){a.A.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){a.A.warn("Compat: Could not remove cue from text track.")}}var s=n(7500),u=n(3481),l=n(418);var d=function(e){function t(t,n){var r;a.A.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var o=function(e,t){var n,r,a,o,s="subtitles";if(i.h$){var u=e.textTracks.length;(a=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=a.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=a.SHOWING)&&void 0!==r?r:"showing"}else o=document.createElement("track"),e.appendChild(o),a=o.track,o.kind=s,a.mode=t?"hidden":"showing";return{track:a,trackElement:o}}(t,n),s=o.track,l=o.trackElement;return r.bufferType="text",r._buffered=new u.A,r._videoElement=t,r._track=s,r._trackElement=l,r}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){a.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){var t,n;if(a.A.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return Promise.resolve();var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk,u=s.start,d=s.end,c=s.data,f=s.type,v=s.language,p=null!==(t=o[0])&&void 0!==t?t:0,h=null!==(n=o[1])&&void 0!==n?n:1/0;try{var m,g,y=function(e,t,n,r){a.A.debug("NTSB: Finding parser for native text tracks:",e);var i=l.A.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.A.debug("NTSB: Parser found, parsing...");var o=i(t,n,r);return a.A.debug("NTSB: Parsed successfully!",o.length),o}(f,c,i,v);if(0!==p&&h!==1/0){for(var A=0;A<y.length&&y[A].endTime<=p;)A++;for(y.splice(0,A),A=0;A<y.length&&y[A].startTime<p;)y[A].startTime=p,A++;for(A=y.length-1;A>=0&&y[A].startTime>=h;)A--;for(y.splice(A,y.length),A=y.length-1;A>=0&&y[A].endTime>h;)y[A].endTime=h,A--}if(void 0!==u)m=Math.max(p,u);else{if(y.length<=0)return a.A.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),Promise.resolve();a.A.warn("NTSB: No start time given. Guessing from cues."),m=y[0].startTime}if(void 0!==d)g=Math.min(h,d);else{if(y.length<=0)return a.A.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),Promise.resolve();a.A.warn("NTSB: No end time given. Guessing from cues."),g=y[y.length-1].endTime}if(g<=m)return a.A.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),Promise.resolve();if(y.length>0){var _=y[0],b=this._track.cues;null!==b&&b.length>0&&_.startTime<b[b.length-1].startTime&&this._removeData(_.startTime,1/0);for(var S=0;S<y.length;S++)this._track.addCue(y[S])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0,performance.now())}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this._removeData(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.A.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){a.A.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){a.A.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 s=r[i],u=s.startTime,l=s.endTime;u>=e&&u<=t&&l<=t&&o(n,s)}this._buffered.remove(e,t)},t}(s.K)},7500:function(e,t,n){"use strict";n.d(t,{K:function(){return y},B:function(){return m}});var r=n(5151),i=n(9477),a=n(7841);function o(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){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.Q)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=o(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 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){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var c=function(){function e(){var e=r.A.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new u(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e,t){var n,a,o,s,u,d,c;void 0===t&&(t=!1);for(var f=this._inventory,v=0,m=f[0],g=r.A.getCurrent().MINIMUM_SEGMENT_SIZE,y=null==m?void 0:m.infos.adaptation.type,A=e.length,_=0;_<A;_++){if(void 0===m)return;var b=e.start(_),S=e.end(_);if(S-b<g)i.A.warn("SI: skipped TimeRange when synchronizing because it was too small",y,b,S);else{for(var E=v;void 0!==m&&(null!==(n=m.bufferedEnd)&&void 0!==n?n:m.end)-b<g;)m=f[++v];var T=null,w=v-E;if(w>0){var k=f[E+w-1];T={end:null!==(a=k.bufferedEnd)&&void 0!==a?a:k.end,precizeEnd:k.precizeEnd},i.A.debug("SI: "+w+" segments GCed.",y);for(var I,x=l(f.splice(E,w));!(I=x()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&2!==R.status&&this._bufferedHistory.addBufferedSegment(R.infos,null)}v=E}if(void 0===m)return;if(S-(null!==(o=m.bufferedStart)&&void 0!==o?o:m.start)>=g){if(p(m,b,T,y),v===f.length-1)return void h(m,S,y);for(var C=null!==(s=(m=f[++v]).bufferedStart)&&void 0!==s?s:m.start,M=null!==(u=m.bufferedEnd)&&void 0!==u?u:m.end,P=_<A-1?e.start(_+1):void 0;void 0!==m&&S-C>=g&&(void 0===P||S-C>=M-P);){var D=f[v-1];void 0===D.bufferedEnd&&(m.precizeStart?D.bufferedEnd=m.start:D.infos.segment.complete?D.bufferedEnd=D.end:D.bufferedEnd=m.start,i.A.debug("SI: calculating buffered end of contiguous segment",y,D.bufferedEnd,D.end)),m.bufferedStart=D.bufferedEnd,void 0!==(m=f[++v])&&(C=null!==(d=m.bufferedStart)&&void 0!==d?d:m.start,M=null!==(c=m.bufferedEnd)&&void 0!==c?c:m.end)}}var N=f[v-1];void 0!==N&&h(N,S,y)}}if(null!=m){i.A.debug("SI: last segments have been GCed",y,v,f.length);for(var O,L=l(f.splice(v,f.length-v));!(O=L()).done;){var U=O.value;void 0===U.bufferedStart&&void 0===U.bufferedEnd&&2!==U.status&&this._bufferedHistory.addBufferedSegment(U.infos,null)}}!t&&void 0!==y&&i.A.hasLevel("DEBUG")&&i.A.debug("SI: current "+y+" 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 d,c=l.infos.period.id,f=l.infos.representation.id,v=n[c],p=void 0;if(void 0===v)p=o(l.infos),n[c]=((d={})[f]=p,d);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}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,t,n){var r=e.period,a=e.adaptation,o=e.representation,s=e.segment,u=e.chunkSize,l=e.start,d=e.end;if(!s.isInit){var c=a.type;if(l>=d)i.A.warn("SI: Invalid chunked inserted: starts before it ends",c,l,d);else{for(var f=this._inventory,v={status:t?0:2,insertionTs:n,chunkSize:u,splitted:!1,start:l,end:d,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:s,period:r,adaptation:a,representation:o}},p=f.length-1;p>=0;p--){var h=f[p];if(h.start<=l){if(h.end<=l){for(i.A.debug("SI: Pushing segment strictly after previous one.",c,l,h.end),this._inventory.splice(p+1,0,v),p+=2;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}if(h.start===l){if(h.end<=d){for(i.A.debug("SI: Segment pushed replace another one",c,l,d,h.end),this._inventory.splice(p,1,v),p+=1;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}return i.A.debug("SI: Segment pushed ends before another with the same start",c,l,d,h.end),f.splice(p,0,v),h.start=v.end,h.bufferedStart=void 0,void(h.precizeStart=h.precizeStart&&v.precizeEnd)}if(h.end<=v.end){for(i.A.debug("SI: Segment pushed updates end of previous one",c,l,d,h.start,h.end),this._inventory.splice(p+1,0,v),h.end=v.start,h.bufferedEnd=void 0,h.precizeEnd=h.precizeEnd&&v.precizeStart,p+=2;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}i.A.warn("SI: Segment pushed is contained in a previous one",c,l,d,h.start,h.end);var m={status:h.status,insertionTs:h.insertionTs,chunkSize:h.chunkSize,splitted:!0,start:v.end,end:h.end,precizeStart:h.precizeStart&&h.precizeEnd&&v.precizeEnd,precizeEnd:h.precizeEnd,bufferedStart:void 0,bufferedEnd:h.end,infos:h.infos};return h.end=v.start,h.splitted=!0,h.bufferedEnd=void 0,h.precizeEnd=h.precizeEnd&&v.precizeStart,f.splice(p+1,0,v),void f.splice(p+2,0,m)}}var g=this._inventory[0];if(void 0===g)return i.A.debug("SI: first segment pushed",c,l,d),void this._inventory.push(v);if(!(g.start>=d)){if(g.end<=d){for(i.A.debug("SI: Segment pushed starts before and completely recovers the previous first one",c,l,d,g.start,g.end),this._inventory.splice(0,1,v);f.length>1&&f[1].start<v.end;){if(f[1].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[1].start),f[1].start=v.end,f[1].bufferedStart=void 0,void(f[1].precizeStart=v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[1].start,f[1].end),f.splice(1,1)}return}return i.A.debug("SI: Segment pushed start of the next one",c,l,d,g.start,g.end),g.start=d,g.bufferedStart=void 0,g.precizeStart=v.precizeEnd,void this._inventory.splice(0,0,v)}i.A.debug("SI: Segment pushed comes before all previous ones",c,l,d,g.start),this._inventory.splice(0,0,v)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.Q)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.A.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,d=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.Q)(n[o].infos,e);){var c=n[o].chunkSize;void 0!==d&&void 0!==c&&(d+=c),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),0===this._inventory[u].status&&(this._inventory[u].status=1),this._inventory[u].chunkSize=d,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.A.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=l(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?2!==y.status&&this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.A.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}();function f(e){if(void 0===e.bufferedStart||1!==e.status)return!1;var t=e.start,n=e.end-t,i=r.A.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 v(e){if(void 0===e.bufferedEnd||!e.infos.segment.complete||1!==e.status)return!1;var t=e.start,n=e.end,i=n-t,a=r.A.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 p(e,t,n,a){var o=r.A.getCurrent(),s=o.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,u=o.MISSING_DATA_TRIGGER_SYNC_DELAY,l=o.SEGMENT_SYNCHRONIZATION_DELAY;if(void 0!==e.bufferedStart)e.bufferedStart<t&&(i.A.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);else if(e.precizeStart)i.A.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start;else if(null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=s))i.A.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);else if(e.start-t<=s){var d=performance.now();if(e.start-t>=u&&d-e.insertionTs<l)return void i.A.debug("SI: Ignored bufferedStart synchronization",a,t,e.start,d-e.insertionTs);i.A.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)}else if(t<e.start)i.A.debug("SI: range start too far from expected start",a,t,e.start),e.bufferedStart=e.start;else{var c=performance.now();if(e.start-t>=u&&c-e.insertionTs<l)return void i.A.debug("SI: Ignored bufferedStart synchronization",a,t,e.start,c-e.insertionTs);i.A.debug("SI: Segment appears immediately garbage collected at the start",a,t,e.start),e.bufferedStart=t}}function h(e,t,n){var a=r.A.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MISSING_DATA_TRIGGER_SYNC_DELAY,u=a.SEGMENT_SYNCHRONIZATION_DELAY;if(void 0!==e.bufferedEnd)e.bufferedEnd>t&&(i.A.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=o&&v(e)&&(e.precizeEnd=!0,e.end=t);else if(e.precizeEnd)i.A.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end;else if(t-e.end<=o||!e.infos.segment.complete){var l=performance.now();if(t-e.end>=s&&l-e.insertionTs<u)return void i.A.debug("SI: Ignored bufferedEnd synchronization",n,t,e.end,l-e.insertionTs);i.A.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,v(e)&&(e.end=t,e.precizeEnd=!0)}else if(t>e.end)i.A.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end;else{var d=performance.now();if(t-e.end>=s&&d-e.insertionTs<u)return void i.A.debug("SI: Ignored bufferedEnd synchronization",n,t,e.end,d-e.insertionTs);i.A.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t}}var m,g=c,y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(e){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges(),e)},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={}))},3481:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(3650),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.C$)(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.aW)(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}()},7004:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(7387),i=function(e){function t(n,r,i,a){var o;return o=e.call(this,n)||this,Object.setPrototypeOf(o,t.prototype),o.name="CustomLoaderError",o.canRetry=r,o.isOfflineError=i,o.xhr=a,o}return(0,r.A)(t,e),t}((0,n(8593).A)(Error))},1956:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r,i){var s;return s=e.call(this,(0,o.A)("EncryptedMediaError",n,r))||this,Object.setPrototypeOf(s,t.prototype),s.name="EncryptedMediaError",s.type=a.wU.ENCRYPTED_MEDIA_ERROR,s.code=n,s.fatal=!1,"string"==typeof(null==i?void 0:i.keyStatuses)&&(s.keyStatuses=i.keyStatuses),s}return(0,r.A)(t,e),t}((0,i.A)(Error))},5497:function(e,t,n){"use strict";n.d(t,{tG:function(){return a},wU:function(){return r},yl: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"}},2620:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{A:function(){return r}})},874:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(4637),i=n(1858);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.A)(e))return e;var o=e instanceof Error?e.toString():a;return new i.A(n,o)}},4637:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});var r=n(1956),i=n(5497),a=n(5575),o=n(7941),s=n(1858);function u(e){return(e instanceof r.A||e instanceof a.A||e instanceof s.A||e instanceof o.A)&&Object.keys(i.wU).indexOf(e.type)>=0}},5575:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r,i){var s;s=e.call(this,(0,o.A)("MediaError",n,r))||this,Object.setPrototypeOf(s,t.prototype),s.name="MediaError",s.type=a.wU.MEDIA_ERROR,s.code=n,s.fatal=!1;var u=null==i?void 0:i.adaptation;if(void 0!==u)switch(u.type){case"audio":s.trackInfo={type:"audio",track:u.toAudioTrack()};break;case"video":s.trackInfo={type:"video",track:u.toVideoTrack()};break;case"text":s.trackInfo={type:"text",track:u.toTextTrack()}}return s}return(0,r.A)(t,e),t}((0,i.A)(Error))},7941:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r){var i;return i=e.call(this,(0,o.A)("NetworkError",n,r.message))||this,Object.setPrototypeOf(i,t.prototype),i.name="NetworkError",i.type=a.wU.NETWORK_ERROR,i.xhr=void 0===r.xhr?null:r.xhr,i.url=r.url,i.status=r.status,i.errorType=r.type,i.code=n,i.fatal=!1,i}return(0,r.A)(t,e),t.prototype.isHttpError=function(e){return this.errorType===a.yl.ERROR_HTTP_CODE&&this.status===e},t}((0,i.A)(Error))},1858:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r){var i;return i=e.call(this,(0,o.A)("OtherError",n,r))||this,Object.setPrototypeOf(i,t.prototype),i.name="OtherError",i.type=a.wU.OTHER_ERROR,i.code=n,i.fatal=!1,i}return(0,r.A)(t,e),t}((0,i.A)(Error))},3506:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(7387),i=function(e){function t(n,r,i,a){var o,s;switch(i){case"TIMEOUT":s="The request timed out";break;case"ERROR_EVENT":s="An error prevented the request to be performed successfully";break;case"PARSE_ERROR":s="An error happened while formatting the response data";break;case"ERROR_HTTP_CODE":s="An HTTP status code indicating failure was received: "+String(r)}return o=e.call(this,s)||this,Object.setPrototypeOf(o,t.prototype),o.name="RequestError",o.url=n,void 0!==a&&(o.xhr=a),o.status=r,o.type=i,o}return(0,r.A)(t,e),t}((0,n(8593).A)(Error))},8589:function(e,t){"use strict";t.A={dashParsers:{wasm:null,js:null},createDebugElement:null,directfile:null,decrypt:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,mediaSourceInit:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},418:function(e,t,n){"use strict";var r=n(8589);t.A=r.A},9477:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(8060),i=new(function(){function e(){this.error=r.A,this.warn=r.A,this.info=r.A,this.debug=r.A,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.A,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.A,this.info=t>=this._levels.INFO?console.info.bind(console):r.A,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.A},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},4129:function(e,t,n){"use strict";n.d(t,{B:function(){return h},A:function(){return m}});var r=n(9477),i=n(1729),a=n(6787),o=n(8202);var s="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}))},u=n(9770);function l(e){return null!=u.j&&("function"!=typeof u.j.isTypeSupported||u.j.isTypeSupported(e))}var d=n(987);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){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=(0,n(8795).A)(),p=function(){function e(e,t){var n;if(this.id=e.id,this.uniqueId=v(),this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.isSpatialAudio&&(this.isSpatialAudio=e.isSpatialAudio),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.cdnMetadata=e.cdnMetadata,this.index=e.index,"audio"===t.type||"video"===t.type){if(this.isSupported=!1,void 0!==e.supplementalCodecs)l((null!==(n=this.mimeType)&&void 0!==n?n:"")+';codecs="'+e.supplementalCodecs+'"')&&(this.codec=e.supplementalCodecs,this.isSupported=!0);if(!this.isSupported){var i=this.getMimeTypeString(),a=l(i);a||r.A.info("Unsupported Representation",i,this.id,this.bitrate),this.isSupported=a}}else this.isSupported=!0}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,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var i=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var a=this.contentProtections.keyIds;if(void 0===a)this.contentProtections.keyIds=[{keyId:t}];else{for(var o,s=!1,u=c(a);!(o=u()).done;){var l=o.value;(0,d.A)(l.keyId,t)&&(s=!0)}s||(r.A.warn("Manifest: found unanounced key id."),a.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,d.A)(m.data,p[g].data))break;r.A.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),i=!0)}return i}return this.contentProtections.initData.push({type:e,values:n}),!0},t.toAudioRepresentation=function(){return{id:this.id,isSpatialAudio:this.isSpatialAudio,bitrate:this.bitrate,codec:this.codec}},t.toVideoRepresentation=function(){return{id:this.id,bitrate:this.bitrate,frameRate:this.frameRate,width:this.width,height:this.height,codec:this.codec,hdrInfo:this.hdrInfo}},e}(),h=["audio","video","text","image"],m=function(){function e(t,n){void 0===n&&(n={});var i=t.trickModeTracks,s=n,u=s.representationFilter,l=s.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,o.Ay)(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.forcedSubtitles&&(this.isForcedSubtitles=t.forcedSubtitles),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==i&&i.length>0&&(this.trickModeTracks=i.map((function(t){return new e(t)})));for(var d=t.representations,c=[],f=!1,v=0;v<d.length;v++){var h=new p(d[v],{type:this.type});(0,a.A)(u)||u(h,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted})?(c.push(h),!f&&h.isSupported&&(f=!0)):r.A.debug("Filtering Representation due to representationFilter",this.type,"Adaptation: "+this.id,"Representation: "+h.id,"("+h.bitrate+")")}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=f,this.manuallyAdded=!0===l}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 s(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,i.A)(this.representations,(function(t){var n=t.id;return e===n}))},t.toAudioTrack=function(){var e,t,n={language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",audioDescription:!0===this.isAudioDescription,id:this.id,representations:this.representations.map((function(e){return e.toAudioRepresentation()})),label:this.label};return!0===this.isDub&&(n.dub=!0),n},t.toTextTrack=function(){var e,t;return{language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",closedCaption:!0===this.isClosedCaption,id:this.id,label:this.label,forced:this.isForcedSubtitles}},t.toVideoTrack=function(){var e=void 0!==this.trickModeTracks?this.trickModeTracks.map((function(e){var t=e.representations.map((function(e){return e.toVideoRepresentation()})),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,t={id:this.id,representations:this.representations.map((function(e){return e.toVideoRepresentation()})),label:this.label};return!0===this.isSignInterpreted&&(t.signInterpreted=!0),!0===this.isTrickModeTrack&&(t.isTrickModeTrack=!0),void 0!==e&&(t.trickModeTracks=e),t},e}()},8568:function(e,t,n){"use strict";n.d(t,{Ay:function(){return w}});var r,i=n(7387),a=n(5575),o=n(9477),s=n(1729),u=n(79),l=n(8795),d=n(2716),c=n(5950),f=n(4129),v=n(4324),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 f.A(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:r});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.A("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.A("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,v.A)(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.A)(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}))},t.containsTime=function(e,t){return e>=this.start&&(void 0===this.end||e<this.end)||e===this.end&&(null===t||t.start>this.end)},e}(),h=function(){function e(e){this._url=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,url:this._url,time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,privateInfos:{},timescale:1}]},t.getFirstAvailablePosition=function(){},t.getLastAvailablePosition=function(){},t.getEnd=function(){},t.awaitSegmentBetween=function(){return!1},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(){o.A.warn("Tried to replace a static RepresentationIndex")},t._update=function(){o.A.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(3786);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){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t,n){var i={updatedAdaptations:[],removedAdaptations:[],addedAdaptations:[]};e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var a=e.getAdaptations(),s=t.getAdaptations(),u=function(e){var t=a[e],u=(0,m.A)(s,(function(e){return e.id===t.id}));if(-1===u){o.A.warn('Manifest: Adaptation "'+a[e].id+'" not found when merging.');var d=a.splice(e,1)[0];e--,i.removedAdaptations.push(d)}else{var c=s.splice(u,1)[0],f=[],v=[],p=[];i.updatedAdaptations.push({adaptation:t,updatedRepresentations:f,addedRepresentations:v,removedRepresentations:p});for(var h,g=t.representations,y=c.representations.slice(),A=function(e){var t=g[e],i=(0,m.A)(y,(function(e){return e.id===t.id}));if(-1===i){o.A.warn('Manifest: Representation "'+g[e].id+'" not found when merging.');var a=g.splice(e,1)[0];e--,p.push(a)}else{var s=y.splice(i,1)[0];f.push(t),t.cdnMetadata=s.cdnMetadata,n===r.Full?t.index._replace(s.index):t.index._update(s.index)}_=e},_=0;_<g.length;_++)A(_);if(y.length>0)o.A.warn("Manifest: "+y.length+" new Representations found when merging."),(h=t.representations).push.apply(h,y),v.push.apply(v,y)}l=e},l=0;l<a.length;l++)u(l);if(s.length>0){o.A.warn("Manifest: "+s.length+" new Adaptations found when merging.");for(var d,c=g(s);!(d=c()).done;){var f=d.value,v=e.adaptations[f.type];void 0===v?e.adaptations[f.type]=[f]:v.push(f),i.addedAdaptations.push(f)}}return i}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){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(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 b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var S=(0,l.A)(),E=(0,l.A)(),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,d=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=E(),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=d,r.lifetime=t.lifetime,r.clockOffset=t.clockOffset,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.A)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,s.A)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){for(var t=null,n=this.periods.length-1;n>=0;n--){var r=this.periods[n];if(r.containsTime(e,t))return r;t=r}},n.getNextPeriod=function(e){return(0,s.A)(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.A)(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.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=_(e.periods);!(n=i()).done;)for(var a,s=n.value,u=_(s.getAdaptations());!(a=u()).done;)for(var l,d=a.value,c=_(d.representations);!(l=c()).done;){var f=l.value,v=t(f);v!==f.decipherable&&(r.push({manifest:e,period:s,adaptation:d,representation:f}),f.decipherable=v,o.A.debug('Decipherability changed for "'+f.id+'"',"("+f.bitrate+")",String(f.decipherable)))}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,c.A)("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.A)("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.A)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,s.A)(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-"+S(),o="gen-image-rep-"+S(),s=(0,d.Cl)(r),u=r.substring(0,s),l=r.substring(s),c=new f.A({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:l})}]},{isManuallyAdded:!0});if(c.representations.length>0&&!c.isSupported){var v=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:c});t.contentWarnings.push(v)}return c}));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:[],v=(0,d.Cl)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(c.map((function(e){var n="gen-text-ada-"+S(),o="gen-text-rep-"+S(),s=new f.A({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,cdnMetadata:[{baseUrl:p}],id:o,mimeType:r,codecs:i,index:new h({media:m})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:s});t.contentWarnings.push(u)}return s})))}),[]);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){var n;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,n=function(e,t){for(var n={updatedPeriods:[],addedPeriods:[],removedPeriods:[]},i=0,a=0;a<t.length;a++){for(var s=t[a],u=i,l=e[u];null!=l&&l.id!==s.id;)l=e[++u];if(null!=l){var d,c,f=A(l,s,r.Full);n.updatedPeriods.push({period:l,result:f});var v=t.slice(i,a),p=u-i,h=e.splice.apply(e,[i,p].concat(v));(d=n.removedPeriods).push.apply(d,h),(c=n.addedPeriods).push.apply(c,v),i=a+1}}if(i>e.length)return o.A.error("Manifest: error when updating Periods"),n;if(i<e.length){var m,g=e.splice(i,e.length-i);(m=n.removedPeriods).push.apply(m,g)}var y,_=t.slice(i,t.length);return _.length>0&&(e.push.apply(e,_),(y=n.addedPeriods).push.apply(y,_)),n}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],n=function(e,t){var n,i={updatedPeriods:[],addedPeriods:[],removedPeriods:[]};if(0===e.length)return e.splice.apply(e,[0,0].concat(t)),(n=i.addedPeriods).push.apply(n,t),i;if(0===t.length)return i;var s=e[e.length-1];if(s.start<t[0].start){var u;if(s.end!==t[0].start)throw new a.A("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");return e.push.apply(e,t),(u=i.addedPeriods).push.apply(u,t),i}var l=(0,m.A)(e,(function(e){return e.id===t[0].id}));if(l<0)throw new a.A("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");var d=A(e[l],t[0],r.Partial);i.updatedPeriods.push({period:e[l],result:d});for(var c=l+1,f=1;f<t.length;f++){for(var v=t[f],p=-1,h=c;h<e.length;h++)if(v.id===e[h].id){p=h;break}if(p<0){for(var g,y=-1,_=c;_<e.length;_++)if(v.start<e[_].start){y=_;break}var b=y-c,S=e.splice(c,b,v);i.addedPeriods.push(v),(g=i.removedPeriods).push.apply(g,S)}else{if(p>c){var E;o.A.warn("Manifest: old Periods not found in new when updating, removing");var T=e.splice(c,p-c);(E=i.removedPeriods).push.apply(E,T),p=c}var w=A(e[p],v,r.Full);i.updatedPeriods.push({period:e[p],result:w})}c++}if(c<e.length){var k;o.A.warn("Manifest: Ending Periods not found in new when updating, removing");var I=e.splice(c,e.length-c);(k=i.removedPeriods).push.apply(k,I)}return i}(this.periods,e.periods);for(var i=this.getMinimumSafePosition();this.periods.length>0;){var s=this.periods[0];if(void 0===s.end||s.end>i)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",n)},t}(u.A);var w=T},7841:function(e,t,n){"use strict";n.d(t,{M:function(){return a},Q:function(){return i}});var r=n(6787);function i(e,t){return e.segment.id===t.segment.id&&e.representation.uniqueId===t.representation.uniqueId}function a(e){if((0,r.A)(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)}},3058:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=Math.pow(2,32)-1},8797:function(e,t,n){"use strict";n.d(t,{$H:function(){return v},QL:function(){return f},YH:function(){return c},fP:function(){return p},fZ:function(){return l},fj:function(){return d},o$:function(){return u}});var r=n(9477),i=n(7994),a=n(5553);function o(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){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function d(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.h)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function c(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.mq)(e,r),r+=4,n=(0,a.mq)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.CQ)(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 v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.mq)(e,l),l+=4;var d=(0,a.mq)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.CQ)(e,l),l+=8}if(1970628964===d&&l+16<=s&&(0,a.mq)(e,l)===t&&(0,a.mq)(e,l+4)===n&&(0,a.mq)(e,l+8)===r&&(0,a.mq)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.A.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.mq)(e,n);n+=4;var o=(0,a.mq)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.A.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.CQ)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},2875:function(e,t,n){"use strict";n.d(t,{Y2:function(){return i},hZ:function(){return u},ht:function(){return a},iA:function(){return s},j8:function(){return o}});var r=n(8797);function i(e){var t=(0,r.fZ)(e,1836019558);return null===t?null:(0,r.fZ)(t,1953653094)}function a(e){return(0,r.fj)(e,1836019558).reduce((function(e,t){var n=(0,r.fZ)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.fZ)(e,1835295092)}function s(e){var t=(0,r.fZ)(e,1836019574);if(null===t)return null;var n=(0,r.fZ)(t,1953653099);return null===n?null:(0,r.fZ)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.fZ)(e.subarray(t),1701671783)}},2948:function(e,t,n){"use strict";n.d(t,{A:function(){return s},L:function(){return u}});var r=n(9477);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(4670),o=n(8797);function s(e){var t=0,n=(0,o.fZ)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.QL)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.A.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var d=i(n,s[0],s[2]),c=u(d,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:d}),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.A.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.My)(o)}}}},1134:function(e,t,n){"use strict";n.d(t,{D1:function(){return f},J_:function(){return m},Tr:function(){return c},a5:function(){return y},cS:function(){return p},pk:function(){return g},zS:function(){return h}});var r=n(9477),i=n(5553),a=n(4670),o=n(3058),s=n(8797),u=n(2875);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){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){var n=(0,s.QL)(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,d=(0,i.mq)(e,o);if(o+=4,0===u)l=(0,i.mq)(e,o),o+=4,r+=(0,i.mq)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.CQ)(e,o),o+=8,r+=(0,i.CQ)(e,o)+a,o+=8}var c=[];o+=2;var f=(0,i.UU)(e,o);for(o+=2;--f>=0;){var v=(0,i.mq)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.mq)(e,o);o+=4,o+=4,c.push({time:l,duration:h,timescale:d,range:[r,r+p-1]}),l+=h,r+=p}return c}function f(e){var t=(0,u.Y2)(e);if(null!==t){var n=(0,s.fZ)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.CQ)(n,4):0===r?(0,i.mq)(n,4):void 0}}}function v(e){var t=(0,s.fZ)(e,1952868452);if(null!==t){var n=1,r=(0,i.tb)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.mq)(t,n)}}function p(e){var t=(0,u.ht)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,d=(0,s.fZ)(o,1953658222);if(null===d)return;var c=0,f=d[c];if(c+=1,f>1)return;var p=(0,i.tb)(d,c);c+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,A=(512&p)>0,_=(1024&p)>0,b=(2048&p)>0,S=(0,i.mq)(d,c);c+=4,g&&(c+=4),y&&(c+=4);for(var E=S,T=0;E-- >0;)h?(T+=(0,i.mq)(d,c),c+=4):T+=m,A&&(c+=4),_&&(c+=4),b&&(c+=4);r+=T}return r}}function h(e){var t=(0,u.iA)(e);if(null!==t){var n=(0,s.fZ)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.mq)(n,r+16):0===a?(0,i.mq)(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.mq)(e,0);if(0===n){if(t>o.Z){var r=new Uint8Array(t+8);return r.set((0,i.KS)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.Kk)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.KS)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.Kk)(t),8),e}if(t<=o.Z)return e.set((0,i.KS)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.KS)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.Kk)(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.hZ)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.A.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var d=4,c=(0,a.Yn)(o,d),f=c.end,v=c.string;d=f;var p=(0,a.Yn)(o,d),h=p.end,m=p.string;d=h;var g=(0,i.mq)(o,d);d+=4;var y=(0,i.mq)(o,d);d+=4;var A=(0,i.mq)(o,d);d+=4;var _=(0,i.mq)(o,d);d+=4;var b={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:A,id:_,messageData:o.subarray(d,s)};t.push(b)}}if(0!==t.length)return t}function y(e){var t=(0,s.o$)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.fZ)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.fZ)(n,1701733217)):i=78,null===r)return null;var a=(0,s.o$)(r.subarray(i),[1936289382,1935894633,1952804451]);if(null===a||a.byteLength<24)return null;var o=a.subarray(8,24);return o.every((function(e){return 0===e}))?null:o}},1755:function(e,t,n){"use strict";var r=n(5553),i=n(4670);t.A=function(e){var t=0,n=e.length,a=(0,i.Es)(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 d=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var c=(0,r.eR)(e,t);t+=4;var f=(0,r.eR)(e,t);t+=4;var v=(0,i.Es)(e.subarray(t,t+4));t+=4;var p=(0,r.AT)(e,t);t+=2;var h=(0,r.AT)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===c)throw new Error("bif: no images to parse");for(var A=0,_=null;t<n;){var b=(0,r.eR)(e,t);t+=4;var S=(0,r.eR)(e,t);if(t+=4,null!==_){var E=_.timestamp*f,T=f,w=e.slice(_.offset,S);y.push({index:A,duration:T,ts:E,data:w}),A++}if(4294967295===b)break;_={timestamp:b,offset:S}}return{fileFormat:"BIF",version:d,imageCount:c,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},9044:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(9477),i=n(3877),a=n(1160),o=n(5403),s=n(9955);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,o=t.periodStart,u=t.periodEnd,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-o*f,p=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,s.I1)(e.initialization.media,l,d),h=void 0===e.media?null:(0,s.I1)(e.media,l,d),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:v,initialization:{url:p,range:m},segmentUrlTemplate:h,startNumber:e.startNumber,endNumber:e.endNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._manifestBoundsCalculator=t.manifestBoundsCalculator,this._scaledPeriodStart=(0,i.vb)(o,this._index),this._scaledPeriodEnd=null==u?void 0:(0,i.vb)(u,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,a.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.A)(this._index,e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i._l)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastAvailablePosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.Rb)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i._l)(r,this._index)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},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.isStillAwaitingFutureSegments=function(){return!1},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.A.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1160:function(e,t,n){"use strict";function r(e,t){var n,r=e.initialization,i={};return void 0!==t&&(i.isEMSGWhitelisted=t),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=r?r.range:void 0,indexRange:e.indexRange,url:null!==(n=null==r?void 0:r.url)&&void 0!==n?n:null,complete:!0,privateInfos:i,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{A:function(){return r}})},5403:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(3877),i=n(9955);function a(e,t,n,a,o,s){for(var u,l,d,c=a.getEstimatedMaximumPosition(null!==(u=e.availabilityTimeOffset)&&void 0!==u?u:0),f=Math.min(t+n,null!=c?c:1/0),v=(0,r.vb)(t,e),p=(0,r.vb)(f,e),h=e.timeline,m=e.timescale,g=e.segmentUrlTemplate,y=e.startNumber,A=e.endNumber,_=null!=y?y:1,b=[],S=h.length,E=0;E<S;E++){var T=h[E],w=T.duration,k=T.start,I=T.range,x=void 0;x=void 0===c?o:Math.min(c*m,null!=o?o:1/0);for(var R=(0,r.yi)(T,h[E+1],x),C=!1!==e.availabilityTimeComplete||E!==S-1&&0!==R,M=(l=w,d=void 0,(d=v-k)>0?Math.floor(d/l):0),P=k+M*w;P<p&&M<=R;){var D=_+M;if(void 0!==A&&D>A)break;var N=null===g?null:(0,i.Qy)(P,D)(g),O=P-e.indexTimeOffset,L=w;O<0&&(L=w+O,O=0);var U={id:String(P),time:O/m,end:(O+L)/m,duration:L/m,isInit:!1,range:I,timescale:1,url:N,number:D,timestampOffset:-e.indexTimeOffset/m,complete:C,privateInfos:{isEMSGWhitelisted:s}};b.push(U),P=k+ ++M*w}if(P>=p)return b;if(_+=R+1,void 0!==A&&_>A)return b}return b}},9955:function(e,t,n){"use strict";n.d(t,{I1:function(){return a},Qy:function(){return o}});var r=n(2384);function i(e){return function(t,n,i){var a,o,s,u=(0,r.A)(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 a(e,t,n){return function(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,i(void 0===n?0:n))}(e,t,n)}function o(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 i(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 i(e)(t,n,r)}))}}},95:function(e,t,n){"use strict";n.d(t,{A:function(){return je}});var r=n(2038),i=n(6787),a=n(5151),o=n(9477),s=n(1729),u=n(2716);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.A.warn("DASH Parser: Invalid clock received: ",e)}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(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=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.A.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}}}(e),n=function(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=d(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=d(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.A.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null,this._serverTimestampOffset=e.serverTimestampOffset,this._availabilityStartTime=e.availabilityStartTime}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.getEstimatedMinimumSegmentTime=function(e){var t;if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var n=null!==(t=this.getEstimatedLiveEdge())&&void 0!==t?t:this.getEstimatedMaximumPosition(0);return void 0!==n?n-(this._timeShiftBufferDepth+e):void 0},t.getEstimatedLiveEdge=function(){if(this._isDynamic&&void 0!==this._serverTimestampOffset)return(performance.now()+this._serverTimestampOffset)/1e3-this._availabilityStartTime},t.getEstimatedMaximumPosition=function(e){if(!this._isDynamic)return this._lastPosition;var t=this.getEstimatedLiveEdge();return void 0!==t&&e!==1/0?t+e:void 0!==this._positionTime&&void 0!==this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}();var p=n(3262),h=n(8795),m=n(4324),g=n(4670);var y=n(4129),A=n(3786),_=n(4031),b=n(2384);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){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=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,d=S(y.B);!(u=d()).done;){var c=e[u.value];if(void 0!==c)for(var f,v=S(c);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},w=["subtitle","caption"];function k(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,_.A)(y.B,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.A)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,_.A)(w,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 d=e[l].attributes,c=d.mimeType,f=d.codecs;if(void 0!==c){var v=i(c,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var I=n(8935),x=/[, ]+/g;var R=n(9044),C=n(3877),M=n(1160),P=n(9955),D=function(){function e(e,t){var n,r;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var i=t.periodStart,a=t.periodEnd,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=i,this._periodEnd=a;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,d=null!==(n=e.timescale)&&void 0!==n?n:1,c=l-i*d,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,P.I1)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,P.I1)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:d,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{url:f,range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.A)(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,C.jX)(s,t,a),l=u[0],d=u[1],c=Math.min(i.length-1,Math.floor(d/r)),f=[],v=Math.floor(l/r);v<=c;){var p=i[v].mediaRange,h=i[v].url,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,url:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstAvailablePosition=function(){return this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.canBeOutOfSyncError=function(){return!1},t.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.A.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),N=n(7941),O=n(7994),L=n(5019),U=n(860),B=n(5403);function F(e){return a.A.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e}function V(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.A)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.A.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}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.A.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.A.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.A.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function K(e){for(var t=[],n=0;n<e.length;n++)t.push(z(e[n]));for(var r=[],i=0;i<t.length;i++){var a=V(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function W(e,t){var n,r=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],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-d;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(p+1)}else d+=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;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===r)return o.A.warn('DASH: Cannot perform "based" update. Common segment not found.'),K(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.A.info('DASH: Cannot perform "based" update. New timeline too short'),K(e);var d=t.slice(i);if(s>0){var c=d[0];c.start+=c.duration*s,d[0].repeatCount-=s}if(u>0&&0!==a)return o.A.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),K(e);var f=d[d.length-1],v=z(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.A.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),K(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(z(e[g]));for(var y=0;y<m.length;y++){var A=V(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==A&&h.push(A)}return d.concat(h)}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.availabilityTimeOffset,u=n.manifestBoundsCalculator,l=n.isDynamic,d=n.isLastPeriod,c=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=u,this._isEMSGWhitelisted=h,this._isLastPeriod=d,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=l,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y,A=void 0===(null===(a=t.initialization)||void 0===a?void 0:a.media)?null:(0,P.I1)(t.initialization.media,c,f),_=void 0===t.media?null:(0,P.I1)(t.media,c,f);y=void 0===s&&void 0===o?1/0:null!=s?s:0,this._index={availabilityTimeComplete:null==o||o,availabilityTimeOffset:y,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:A,range:t.initialization.range},segmentUrlTemplate:_,startNumber:t.startNumber,endNumber:t.endNumber,timeline:void 0===t.timeline?null:H(t.timeline,t.startNumber,t.endNumber),timescale:m},this._scaledPeriodStart=(0,C.vb)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,C.vb)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),(0,B.A)(this._index,e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,C._l)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){var e;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null===t)return null;var n=Math.min(t.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,C._l)(n,this._index)},t.getEnd=function(){var e;if(!this._isDynamic||this._isLastPeriod){if(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._index.timeline.length<=0)return null;var t=this._index.timeline[this._index.timeline.length-1],n=Math.min((0,C.Rb)(t,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,C._l)(n,this._index)}},t.awaitSegmentBetween=function(e,t){var n,r;if((0,O.h)(e<=t),!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var i=this._index,a=i.timescale,o=i.timeline,s=F(a),u=(0,C.vb)(t,this._index),l=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==l&&Math.min(l.end,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0)+s>=Math.min(u,null!==(r=this._scaledPeriodEnd)&&void 0!==r?r:1/0))return!1;var d=(0,C.vb)(e,this._index);if(o.length>0&&null!==l&&!l.isLastOfTimeline){var c=o[o.length-1];if(d<(0,C.Rb)(c,null,this._scaledPeriodEnd)+s+s)return!0}return!!this._isLastPeriod&&(void 0===this._scaledPeriodEnd?u+s>this._scaledPeriodStart&&void 0:d-s<this._scaledPeriodEnd&&u+s>this._scaledPeriodStart)},t.isSegmentStillAvailable=function(e){return!!e.isInit||(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),function(e,t,n,r){var i=q(t,n,r);if(null===i)return!1;for(var a=0;a<t.timeline.length;a++){if(i.timelineIdx<a)return!1;var o=t.timeline[a],s=(o.start-t.indexTimeOffset)/t.timescale;if(s>e.time)return!1;if(s===e.time)return void 0===o.range?void 0===e.range:null!=e.range&&o.range[0]===e.range[0]&&o.range[1]===e.range[1];if(o.repeatCount>=0&&void 0!==o.duration){var u=(s-o.start)/o.duration-1;return u%1==0&&u<=i.newRepeatCount}}return!1}(e,this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd))},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,C.ph)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof N.A&&e.isHttpError(404))},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,U.A)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._index.availabilityTimeOffset=e._index.availabilityTimeOffset,this._index.availabilityTimeComplete=e._index.availabilityTimeComplete,this._index.endNumber=e._index.endNumber,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isStillAwaitingFutureSegments=function(){var e;if(!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index.timeline;if(0===t.length){if(void 0!==this._scaledPeriodEnd){var n=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==n&&(0,C.vb)(n,this._index)>this._scaledPeriodEnd)return!1}return this._isLastPeriod}var r=F(this._index.timescale),i=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==i&&!i.isLastOfTimeline){var a=Math.min(i.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return!(void 0!==this._scaledPeriodEnd&&a+r>=this._scaledPeriodEnd)}if(!this._isLastPeriod)return!1;if(void 0===this._scaledPeriodEnd)return!0;var o=t[t.length-1];return(0,C.Rb)(o,null,this._scaledPeriodEnd)+r<this._scaledPeriodEnd},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){var e,t;if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var n=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime((null!==(t=null===(e=this._index.timeline[0])||void 0===e?void 0:e.duration)&&void 0!==t?t:0)/this._index.timescale);if(!(0,i.A)(n)){var r=(0,C.vb)(n,this._index),a=(0,L.A)(this._index.timeline,r);void 0!==this._index.startNumber?this._index.startNumber+=a:void 0!==this._index.endNumber&&(this._index.startNumber=a+1)}}},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.A.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.A.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?H(K(e),this._index.startNumber,this._index.endNumber):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,H(W(e,t),this._index.startNumber,this._index.endNumber))},e}();function H(e,t,n){if(void 0===n)return e;for(var r=null!=t?t:1,i=0;i<e.length;i++){var a=e[i];if((r+=a.repeatCount+1)>n){if(r===n+1)return e.slice(0,i+1);var o=e.slice(0,i),s=Object.assign({},a),u=r-a.repeatCount-1;return s.repeatCount=Math.max(0,n-u),o.push(s),o}}return e}function q(e,t,n){if(e.timeline.length<=0)return null;if(e.availabilityTimeOffset===1/0){var r=e.timeline.length-1,i=e.timeline[r];return{isLastOfTimeline:!0,timelineIdx:r,newRepeatCount:i.repeatCount,end:(0,C.Rb)(i,null,n)}}var a=t.getEstimatedMaximumPosition(e.availabilityTimeOffset);if(void 0===a){var o=e.timeline.length-1,s=e.timeline[o];return{isLastOfTimeline:!0,timelineIdx:o,newRepeatCount:s.repeatCount,end:(0,C.Rb)(s,null,n)}}for(var u=e.timeline.length-1;u>=e.timeline.length;u--){var l=e.timeline[u],d=l.start+l.duration;if((0,C._l)(d,e)<=a){var c=(0,C.Rb)(l,e.timeline[u+1],n);if((0,C._l)(c,e)<=a)return{isLastOfTimeline:u===e.timeline.length-1,timelineIdx:u,newRepeatCount:l.repeatCount,end:d};var f=(0,C.vb)(a,e)-l.start,v=Math.floor(f/l.duration);return(0,O.h)(v>=1),{isLastOfTimeline:!1,timelineIdx:u,newRepeatCount:v-1,end:l.start+v*l.duration}}}return null}var j=G,Y=function(){function e(e,t){var n,r,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=i,this._manifestBoundsCalculator=a;var v=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,p=v-u*f;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var h=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,P.I1)(e.initialization.media,l,d),m=void 0===e.media?null:(0,P.I1)(e.media,l,d);this._index={duration:e.duration,timescale:f,indexRange:e.indexRange,indexTimeOffset:p,initialization:null==e.initialization?void 0:{url:h,range:e.initialization.range},url:m,presentationTimeOffset:v,startNumber:e.startNumber,endNumber:e.endNumber},this._isDynamic=o,this._periodStart=u,this._scaledRelativePeriodEnd=void 0===s?void 0:(s-u)*f,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,M.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.endNumber,o=n.timescale,s=n.url,u=this._periodStart*o,l=this._scaledRelativePeriodEnd,d=e*o-u,c=(e+t)*o-u,f=this._getFirstSegmentStart(),v=this._getLastSegmentStart();if(null==f||null==v)return[];var p=Math.max(f,d),h=Math.min(v,c);if(h+r<=p)return[];for(var m=[],g=null!=i?i:1,y=Math.floor(p/r),A=y*r;A<=h;A+=r){var _=y+g;if(void 0!==a&&_>a)return m;var b=null!=l&&A+r>l?l-A:r,S=A+u,E=A+this._index.presentationTimeOffset,T=null===s?null:(0,P.Qy)(E,_)(s),w={id:String(_),number:_,time:S/o,end:(S+b)/o,duration:b/o,timescale:1,isInit:!1,scaledDuration:b/o,url:T,timestampOffset:-n.indexTimeOffset/o,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};m.push(w),y++}return m},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e=this._getLastSegmentStart();if((0,i.A)(e))return e;var t=this._estimateRelativeScaledEnd();return Math.min(e+this._index.duration,null!=t?t:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();var e=this._estimateRelativeScaledEnd();if(void 0!==e){var t=this._index.timescale;return(e+this._periodStart*t)/t}},t.awaitSegmentBetween=function(e,t){if((0,O.h)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=F(n),a=this._periodStart*n,o=e*n-a,s=t*n-a,u=this._getLastSegmentStart();if((0,i.A)(u)){var l=this._estimateRelativeScaledEnd();return void 0===l?s+r>=0:s+r>=0&&o<l-r}var d=u+this._index.duration,c=this._estimateRelativeScaledEnd();return void 0===c?s>d-r:s>d-r&&o<c-r},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},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.isStillAwaitingFutureSegments=function(){if(!this._isDynamic)return!1;var e=this._estimateRelativeScaledEnd();if(void 0===e)return!0;var t=this._index.timescale,n=this._getLastSegmentStart();return!!(0,i.A)(n)||n+this._index.duration+F(t)<e},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledRelativePeriodEnd=e._scaledRelativePeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){var e;if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var t=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0!==t&&t<this._periodStart)return null}var n=this._index,r=n.duration,i=n.timescale,a=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime(r/i);if(void 0!==a){var o=a>this._periodStart?(a-this._periodStart)*i:0;return Math.floor(o/r)*r}},t._getLastSegmentStart=function(){var e,t,n=this._index,r=n.duration,i=n.timescale,o=n.endNumber,s=n.startNumber,u=void 0===s?1:s;if(this._isDynamic){var l=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==l&&void 0!==this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<l-this._periodStart*this._index.timescale){var d=Math.ceil(this._scaledRelativePeriodEnd/r);return void 0!==o&&o-u+1<d&&(d=o-u+1),(d-1)*r}var c=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0===c)return;var f=(c-this._periodStart)*i;if(f<0)return null;var v=Math.floor(f/r);return void 0!==o&&o-u+1<v&&(v=o-u+1),v<=0?null:(v-1)*r}var p=null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:0,h=Math.ceil(p/r);void 0!==o&&o-u+1<h&&(h=o-u+1);var m=(h-1)*r,g=a.A.getCurrent().MINIMUM_SEGMENT_SIZE*i;return void 0!==o||p-m>g||h<2?m:(h-2)*r},t._estimateRelativeScaledEnd=function(){var e,t;if(void 0!==this._index.endNumber){var n=this._index.endNumber-(null!==(e=this._index.startNumber)&&void 0!==e?e:1)+1;return Math.max(Math.min(n*this._index.duration,null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:1/0),0)}if(void 0!==this._scaledRelativePeriodEnd)return Math.max(this._scaledRelativePeriodEnd,0)},e}();function Q(e,t){var n;if(0===t.length)return e;var r=t.map((function(e){return{url:e.value}}));if(0===e.length)return r;for(var i=[],a=0;a<e.length;a++)for(var o=e[a],s=0;s<r.length;s++){var l=r[s],d=(0,u.Ay)(o.url,l.url);i.push({url:d,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}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){if("string"==typeof e)return X(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function Z(e){var t=e.adaptationProfiles,n=e.essentialProperties,r=e.supplementalProperties,i=e.manifestProfiles,a=e.codecs;if(-1!==((null!=t?t:"")+(null!=i?i:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&("hvc1.2.4.L153.B0"===a||"hev1.2.4.L153.B0"===a))return{colorDepth:10,eotf:"pq",colorSpace:"rec2020"};var o=(0,s.A)([].concat(null!=n?n:[],null!=r?r:[]),(function(e){return"urn:mpeg:mpegB:cicp:TransferCharacteristics"===e.schemeIdUri}));if(void 0!==o)switch(o.value){case"15":return;case"16":return{eotf:"pq"};case"18":return{eotf:"hlg"}}return void 0!==a&&/^vp(08|09|10)/.exec(a)?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}}(a):void 0}function J(e,t,n){for(var r,i,a,u,l,d,c=[],f=function(){for(var e=d.value,f=void 0!==e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(void 0!==e.attributes.height?"-"+e.attributes.height:"")+(void 0!==e.attributes.width?"-"+e.attributes.width:"")+(void 0!==e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(void 0!==e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===f}));)f+="-dup";var v,p=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(f))&&void 0!==i?i:null,h=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),m=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete;void 0===e.attributes.availabilityTimeOffset&&void 0===n.availabilityTimeOffset||(v=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+(null!==(l=n.availabilityTimeOffset)&&void 0!==l?l:0));var g,y=function(e,t){var n,r,i,a,o=t.availabilityTimeOffset,s=t.manifestBoundsCalculator,u=t.isDynamic,l=t.end,d=t.start,c=t.receivedTime,f=t.unsafelyBaseOnPreviousRepresentation,v=t.inbandEventStreams,p={availabilityTimeComplete:void 0,availabilityTimeOffset:o,unsafelyBaseOnPreviousRepresentation:f,isEMSGWhitelisted:function(e){return void 0!==v&&v.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:s,isDynamic:u,periodEnd:l,periodStart:d,receivedTime:c,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id};if(void 0!==e.children.segmentBase){var h=e.children.segmentBase;a=new R.A(h,p)}else if(void 0!==e.children.segmentList){var m=e.children.segmentList;a=new D(m,p)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var g=t.parentSegmentTemplates.slice(),y=e.children.segmentTemplate;void 0!==y&&g.push(y);var A=I.A.apply(void 0,[{}].concat(g));void 0===A.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(p.availabilityTimeOffset=(null!==(n=A.availabilityTimeOffset)&&void 0!==n?n:0)+(null!==(r=t.availabilityTimeOffset)&&void 0!==r?r:0)),void 0===A.availabilityTimeComplete&&void 0===t.availabilityTimeComplete||(p.availabilityTimeComplete=null!==(i=A.availabilityTimeComplete)&&void 0!==i?i:t.availabilityTimeComplete),a=j.isTimelineIndexArgument(A)?new j(A,p):new Y(A,p)}else{var _=t.adaptation.children;if(void 0!==_.segmentBase){var b=_.segmentBase;a=new R.A(b,p)}else if(void 0!==_.segmentList){var S=_.segmentList;a=new D(S,p)}else a=new Y({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},p)}return a}(e,(0,I.A)({},n,{availabilityTimeOffset:v,availabilityTimeComplete:m,unsafelyBaseOnPreviousRepresentation:p,adaptation:t,inbandEventStreams:h}));void 0===e.attributes.bitrate?(o.A.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var A,_,S,E=Q(n.baseURLs,e.children.baseURLs),T={bitrate:g,cdnMetadata:0===E.length?[{baseUrl:"",id:void 0}]:E.map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:y,id:f};void 0!==e.children.supplementalProperties&&(0,s.A)(e.children.supplementalProperties,(function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===e.schemeIdUri&&"JOC"===e.value}))&&(T.isSpatialAudio=!0),void 0!==e.attributes.codecs?A=e.attributes.codecs:void 0!==t.attributes.codecs&&(A=t.attributes.codecs),void 0!==A&&(A="mp4a.40.02"===A?"mp4a.40.2":A,T.codecs=A),void 0!==e.attributes.supplementalCodecs?_=e.attributes.supplementalCodecs:void 0!==t.attributes.supplementalCodecs&&(_=t.attributes.supplementalCodecs),void 0!==_&&(T.supplementalCodecs=(S=_,(0,b.A)(S)?S.trim().replace(x,", "):"")),void 0!==e.attributes.frameRate?T.frameRate=e.attributes.frameRate:void 0!==t.attributes.frameRate&&(T.frameRate=t.attributes.frameRate),void 0!==e.attributes.height?T.height=e.attributes.height:void 0!==t.attributes.height&&(T.height=t.attributes.height),void 0!==e.attributes.mimeType?T.mimeType=e.attributes.mimeType:void 0!==t.attributes.mimeType&&(T.mimeType=t.attributes.mimeType),void 0!==e.attributes.width?T.width=e.attributes.width:void 0!==t.attributes.width&&(T.width=t.attributes.width);var w=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&w.push.apply(w,e.children.contentProtections),w.length>0){var k=w.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){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=$(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,d=(0,s.A)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===d)e.initData.push({type:"cenc",values:a});else(l=d.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(k.initData).length>0||void 0!==k.keyIds&&k.keyIds.length>0)&&(T.contentProtections=k)}T.hdrInfo=Z({adaptationProfiles:t.attributes.profiles,supplementalProperties:t.children.supplementalProperties,essentialProperties:t.children.essentialProperties,manifestProfiles:n.manifestProfiles,codecs:A}),c.push(T)},v=$(e);!(d=v()).done;)f();return c}function ee(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){if("string"==typeof e)return te(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(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 te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ne(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 re(e,t){if(void 0!==e&&e.some((function(e){return"urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value})))return!0;if(void 0!==t&&t.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&"caption"===e.value})))return!0;return!1}function ie(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ae(e,t){if((0,b.A)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isForcedSubtitle,i=t.isAudioDescription,a=t.isSignInterpreted,o=t.isTrickModeTrack,s=t.type;return(0,b.A)(e.attributes.language)&&(s+="-"+e.attributes.language),!0===n&&(s+="-cc"),!0===r&&(s+="-cc"),!0===i&&(s+="-ad"),!0===a&&(s+="-si"),o&&(s+="-trickMode"),(0,b.A)(e.attributes.contentType)&&(s+="-"+e.attributes.contentType),(0,b.A)(e.attributes.codecs)&&(s+="-"+e.attributes.codecs),(0,b.A)(e.attributes.mimeType)&&(s+="-"+e.attributes.mimeType),(0,b.A)(e.attributes.frameRate)&&(s+="-"+e.attributes.frameRate),s}function oe(e){if(null!=e.children.supplementalProperties)for(var t,n=ee(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 se(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 ue(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){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}(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 le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var de=(0,h.A)();function ce(e,t){var n,r,a,u,l=[],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 c=t.isDynamic,f=t.manifestBoundsCalculator;c||(0,i.A)(t.duration)||f.setLastPosition(t.duration);for(var v=function(){var v,S=h===e.length-1,E=e[h],w=t.xlinkInfos.get(E),I=Q(t.baseURLs,E.children.baseURLs),x=d[h],R=x.periodStart,C=x.periodDuration,M=x.periodEnd;for((0,i.A)(E.attributes.id)?(o.A.warn("DASH: No usable id found in the Period. Generating one."),v="gen-dash-period-"+de()):v=E.attributes.id;l.some((function(e){return e.id===v}));)v+="-dup";var P=void 0!==w?w.receivedTime:t.receivedTime,D=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(v))&&void 0!==r?r:null,N=E.attributes.availabilityTimeComplete,O=E.attributes.availabilityTimeOffset,L=t.manifestProfiles,U=E.children.segmentTemplate,B={availabilityTimeComplete:N,availabilityTimeOffset:O,baseURLs:I,manifestBoundsCalculator:f,end:M,isDynamic:c,isLastPeriod:S,manifestProfiles:L,receivedTime:P,segmentTemplate:U,start:R,unsafelyBaseOnPreviousPeriod:D},F=function(e,t){for(var n,r,i,a,u,l,d,c={video:[],audio:[],text:[],image:[]},f=[],v={},p=[],h=0;h<e.length;h++){var m=e[h],g=m.children,S=g.essentialProperties,E=g.roles,w=g.label,I=Array.isArray(E)&&E.some((function(e){return"main"===e.value}))&&E.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),x=m.children.representations,R=null!==(n=m.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=void 0;void 0===m.attributes.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(C=(null!==(r=m.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+(null!==(i=t.availabilityTimeOffset)&&void 0!==i?i:0));var M=m.attributes.mimeType,P=m.attributes.codecs,D=k(x,(0,b.A)(M)?M:null,(0,b.A)(P)?P:null,null!=g.roles?g.roles:null);if(void 0!==D){var N=null!==(a=m.attributes.selectionPriority)&&void 0!==a?a:1,O=m.attributes.id,L=oe(m),U=[];void 0!==t.segmentTemplate&&U.push(t.segmentTemplate),void 0!==m.children.segmentTemplate&&U.push(m.children.segmentTemplate);var B={availabilityTimeComplete:R,availabilityTimeOffset:C,baseURLs:Q(t.baseURLs,g.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:U,receivedTime:t.receivedTime,start:t.start,unsafelyBaseOnPreviousAdaptation:null},F=Array.isArray(S)?(0,s.A)(S,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,V=null===(u=null==F?void 0:F.value)||void 0===u?void 0:u.split(" "),z=void 0!==V,K=g.accessibilities,W=void 0;void 0!==E&&E.some((function(e){return"dub"===e.value}))&&(W=!0);var G=void 0;G="text"===D&&re(K,E);var H=void 0;"text"===D&&void 0!==E&&E.some((function(e){return"forced-subtitle"===e.value||"forced_subtitle"===e.value}))&&(H=!0);var q=void 0;"audio"!==D?q=!1:void 0!==K&&(q=K.some(ne));var j=void 0;"video"!==D?j=!1:void 0!==K&&(j=K.some(ie));for(var Y=ae(m,{isAudioDescription:q,isForcedSubtitle:H,isClosedCaption:G,isSignInterpreted:j,isTrickModeTrack:z,type:D});(0,_.A)(p,Y);)Y+="-dup";var $=Y;p.push(Y),B.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation(Y))&&void 0!==d?d:null;var X={id:Y,representations:J(x,m,B),type:D,isTrickModeTrack:z};if(null!=m.attributes.language&&(X.language=m.attributes.language),null!=G&&(X.closedCaption=G),null!=q&&(X.audioDescription=q),!0===W&&(X.isDub=!0),void 0!==H&&(X.forcedSubtitles=H),!0===j&&(X.isSignInterpreted=!0),void 0!==w&&(X.label=w),void 0!==V)f.push({adaptation:X,trickModeAttachedAdaptationIds:V});else{for(var Z,te=-1,ue=function(){var e=Z.value,t=v[e];if(void 0!==t&&t.newID!==$&&(0,_.A)(t.adaptationSetSwitchingIDs,O)){te=(0,A.A)(c[D],(function(t){return t[0].id===e}));var n,r=c[D][te];if(void 0!==r&&r[0].audioDescription===X.audioDescription&&r[0].closedCaption===X.closedCaption&&r[0].language===X.language)return o.A.info('DASH Parser: merging "switchable" AdaptationSets',O,e),(n=r[0].representations).push.apply(n,X.representations),r[1]={priority:Math.max(N,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(h,r[1].indexInMpd)},1}},le=ee(L);!(Z=le()).done&&!ue(););te<0&&c[D].push([X,{priority:N,isMainAdaptation:I,indexInMpd:h}])}null!=O&&null==v[O]&&(v[O]={newID:$,adaptationSetSwitchingIDs:L})}}var de=y.B.reduce((function(e,t){var n=c[t];return n.length>0&&(n.sort(se),e[t]=n.map((function(e){return e[0]}))),e}),{});return c.video.sort(se),T(de,f),de}(E.children.adaptations,B),V=(null!==(a=t.xmlNamespaces)&&void 0!==a?a:[]).concat(null!==(u=E.attributes.namespaces)&&void 0!==u?u:[]),z=function(e,t,n){for(var r,i,a,o=[],s=ue(e);!(a=s()).done;)for(var u,l=a.value,d=l.attributes,c=d.schemeIdUri,f=void 0===c?"":c,v=d.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ue(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var A=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,_=void 0===y.duration?void 0:A+y.duration/p,b=void 0;if(y.eventStreamData instanceof Element)b=y.eventStreamData;else{var S=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");S+=">";var E=(0,g.Es)(new Uint8Array(y.eventStreamData));b=(new DOMParser).parseFromString(S+E+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:A,end:_,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:b}}})}}return o}(E.children.eventStreams,R,V),K={id:v,start:R,end:M,duration:C,adaptations:F,streamEvents:z};if(l.unshift(K),!f.lastPositionIsKnown()){var W=function(e){for(var t,n=null,r=!0,a=(0,m.A)(e).filter((function(e){return!(0,i.A)(e)})),o=ue((0,p.A)(a,(function(e){return e})));!(t=o()).done;)for(var s,u=ue(t.value.representations);!(s=u()).done;){var l=s.value.index.getLastAvailablePosition();null!==l&&(r=!1,"number"==typeof l&&(n=(0,i.A)(n)?l:Math.max(n,l)))}if(!(0,i.A)(n))return n;if(r)return null;return}(F);if(c)if("number"==typeof W){var G=performance.now()/1e3;f.setLastPosition(W,G)}else{var H=fe(t,R);if(void 0!==H){var q=H[0],j=H[1];f.setLastPosition(q,j)}}else"number"==typeof W&&f.setLastPosition(W)}},h=e.length-1;h>=0;h--)v();if(t.isDynamic&&!f.lastPositionIsKnown()){var S=fe(t,0);if(void 0!==S){var E=S[0],w=S[1];f.setLastPosition(E,w)}}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.A.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(),0!==t.length);)i=t[t.length-1];t.push(r)}return t}(l)}function fe(e,t){if((0,i.A)(e.clockOffset)){var n=Date.now()/1e3;if(n>=t)return o.A.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[n-e.availabilityStartTime,performance.now()/1e3]}else{var r=e.clockOffset/1e3-e.availabilityStartTime,a=performance.now()/1e3,s=a+r;if(s>=t)return[s,a]}}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){if("string"==typeof e)return pe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,t):void 0}}(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 pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var he=function e(t,n,r,i,d){void 0===d&&(d=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.A)(c.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 A=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!=A&&A.length>0)return{type:"needs-clock",value:{url:A,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.A.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 S=c.periods[b].attributes,E=S.xlinkHref,T=S.xlinkActuate;null!=E&&"onLoad"===T&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,d,c,p,h=e.children,m=e.attributes,g="dynamic"===m.type,y=void 0!==t.url?[{url:t.url.substring(0,(0,u.Cl)(t.url))}]:[],A=Q(y,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,S=m.maxSegmentDuration,E=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,w=t.externalClockOffset,k=new v({availabilityStartTime:_,isDynamic:g,timeShiftBufferDepth:b,serverTimestampOffset:w}),I={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,baseURLs:A,clockOffset:E,duration:m.duration,isDynamic:g,manifestBoundsCalculator:k,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},x=ce(h.periods,I),R=m.duration,C=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(d=0===m.minimumUpdatePeriod?a.A.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var M=f(x),P=M.minimumSafePosition,D=M.maximumSafePosition,N=M.maximumUnsafePosition,O=performance.now();if(g){var L;if(void 0!==D)L=D;else if(void 0===w)o.A.warn("DASH Parser: use system clock to define maximum position"),L=Date.now()/1e3-_;else L=(performance.now()+w)/1e3-_;var U=k.getEstimatedLiveEdge();void 0===U&&(U=void 0!==N?N:L),p={isLinear:!0,maximumSafePosition:L,livePosition:U,time:O},c=P,null!==(C=null!=b?b:null)&&(C+=null!=S?S:0),null!==C&&void 0!==c&&U-c>C&&(C=U-c)}else{c=void 0!==P?P:void 0!==(null===(i=x[0])||void 0===i?void 0:i.start)?x[0].start:0;var B=null!=R?R:1/0;if(void 0!==x[x.length-1]){var F=x[x.length-1],V=null!==(s=F.end)&&void 0!==s?s:void 0!==F.duration?F.start+F.duration:void 0;void 0!==V&&V<B&&(B=V)}void 0!==D&&D<B&&(B=D),p={isLinear:!1,maximumSafePosition:B,livePosition:void 0,time:O}}var z=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=x[x.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration),K={availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:z,periods:x,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:c,timeshiftDepth:C,maximumTimeData:p},lifetime:d,uris:null==t.url?h.locations:[t.url].concat(h.locations)};return{type:"done",value:{parsed:K,warnings:n}}}(t,n,r,d):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=ve(f);!(g=y()).done;){var A=g.value;d.set(A,{receivedTime:p,sendingTime:h,url:m})}(s=c.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,d)}}}};function me(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function ge(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}var ye=n(7387),Ae=n(8593),_e=n(603),be=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Se=/([0-9]+)-([0-9]+)/;function Ee(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new De("`"+t+'` property is not a boolean value but "'+e+'"')]}function Te(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function ke(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ie(e,t){var n=Date.parse(e);return isNaN(n)?[null,new De("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,b.A)(e))return[0,new De("`"+t+"` property is empty")];var n=be.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,b.A)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,b.A)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,b.A)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,b.A)(n[8])?n[8]:"0")*60+60*parseFloat((0,b.A)(n[10])?n[10]:"0")+parseFloat((0,b.A)(n[12])?n[12]:"0"),null]}function Re(e,t){var n=Se.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ce(e,t){try{return[(0,_e.K)(e),null]}catch(n){return[null,new De("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Me(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 Pe(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.A.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var De=function(e){function t(n){var r;return r=e.call(this,n)||this,Object.setPrototypeOf(r,t.prototype),r.name="MPDError",r}return(0,ye.A)(t,e),t}((0,Ae.A)(Error));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=Ce(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.A.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.aT)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Pe(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:Re,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Le(e){for(var t={},n=[],r=Pe(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 d=0;d<e.attributes.length;d++){var c=e.attributes[d];switch(c.name){case"timescale":r(c.value,{asKey:"timescale",parser:Te,dashName:"timescale"});break;case"presentationTimeOffset":r(c.value,{asKey:"presentationTimeOffset",parser:we,dashName:"presentationTimeOffset"});break;case"indexRange":r(c.value,{asKey:"indexRange",parser:Re,dashName:"indexRange"});break;case"indexRangeExact":r(c.value,{asKey:"indexRangeExact",parser:Ee,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(c.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(c.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"duration":r(c.value,{asKey:"duration",parser:Te,dashName:"duration"});break;case"startNumber":r(c.value,{asKey:"startNumber",parser:Te,dashName:"startNumber"});break;case"endNumber":r(c.value,{asKey:"endNumber",parser:Te,dashName:"endNumber"})}}return[t,n]}function Ue(e){for(var t={},n=[],r=Pe(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:Re,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Re,dashName:"mediaRange"})}}return[t,n]}function Be(e){for(var t=Le(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=Ue(s),l=u[0],d=u[1];i.push(l),r=r.concat(d)}}return[(0,I.A)(n,{list:i}),r]}function Fe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ve(e){for(var t,n=Le(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=Fe(o))}for(var s=(0,I.A)({},r,{duration:r.duration,timelineParser:t}),u=Pe(s,i),l=0;l<e.attributes.length;l++){var d=e.attributes[l];switch(d.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:d.value});break;case"index":s.index=d.value;break;case"availabilityTimeOffset":u(d.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(d.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"media":s.media=d.value;break;case"bitstreamSwitching":u(d.value,{asKey:"bitstreamSwitching",parser:Ee,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=me(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(Me(a));break;case"SegmentBase":var l=Le(a),d=l[0],c=l[1];t.segmentBase=d,c.length>0&&(r=r.concat(c));break;case"SegmentList":var f=Be(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ve(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ne(a),A=y[0],_=y[1];_.length>0&&(r=r.concat(_)),void 0!==A&&n.push(A);break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Me(a)]:t.supplementalProperties.push(Me(a))}}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=Pe(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:Te,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Te,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,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:Te,dashName:"qualityRanking"});break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Te,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new De("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=[Me(a)]:t.accessibilities.push(Me(a));break;case"BaseURL":var o=me(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=ge(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Me(a)]:t.essentialProperties.push(Me(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Me(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var d=ze(a),c=d[0],f=d[1];t.representations.push(c),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Me(a)]:t.roles.push(Me(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Me(a)]:t.supplementalProperties.push(Me(a));break;case"SegmentBase":var v=Le(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Be(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var A=Ve(a),_=A[0],b=A[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var S=Ne(a),E=S[0],T=S[1];T.length>0&&(r=r.concat(T)),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=Pe(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:Te,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:Te,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Te,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Te,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Te,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Te,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Te,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:Te,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:ke,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:ke,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Te,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,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:Te,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function We(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Pe(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:Te,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];if("Event"===s.nodeName){var u=Ge(s),l=u[0],d=u[1];t.children.events.push(l),d.length>0&&(n=n.concat(d))}}return[t,n]}function Ge(e){for(var t={eventStreamData:e},n=[],r=Pe(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:Te,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Te,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=me(s),l=u[0],d=u[1];void 0!==l&&n.push(l),i=i.concat(d);break;case"AdaptationSet":var c=Ke(s),f=c[0],v=c[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=We(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ve(s),y=g[0],A=g[1];t=y,A.length>0&&(i=i.concat(A))}}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=Pe(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:xe,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:xe,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,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 qe(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=me(s),l=u[0],d=u[1];void 0!==l&&t.push(l),a=a.concat(d);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var c=He(s),f=c[0],v=c[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Me(s);i.push(p)}}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=Pe(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:Ie,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ie,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ie,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:xe,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:xe,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:xe,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:xe,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:xe,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:xe,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:xe,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.A)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=qe(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 d="<root>"+o.data+"</root>",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var A=t.value.continue(r);return e(A)}}};(0,r.A)(t)}(he(o,t,s))}},5019: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,{A:function(){return r}})},3877:function(e,t,n){"use strict";n.d(t,{Rb:function(){return a},_l:function(){return s},jX:function(){return u},ph:function(){return l},vb:function(){return o},yi:function(){return i}});var r=n(6787);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.A)(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 d=r[u+1];if(void 0===d)return null;var c=d.start;return i>=a(l,d,n)&&i<c?s(c,e):null}},860:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(5575),i=n(9477),a=n(3877);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.Rb)(s,t[0])<o)throw new r.A("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 d=n-u;return e.splice.apply(e,[u,d].concat(t)),!1}if(l<o){var c=e[u];if(c.start+c.duration>o)return i.A.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(c.start+c.duration*(c.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-c.start)/c.duration-1;if(f%1==0&&c.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=c.start,e[u].repeatCount=v,!1}return i.A.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 p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.A.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.A.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.A.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.A.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},9561:function(e,t,n){"use strict";var r=n(2384),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.A=function(e,t,n){var d,c,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.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),A=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.A)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=f.exec(e),c=v.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var _=e.slice(d.index,c.index),b=u.exec(_);if(!Array.isArray(b))throw new Error("parse error (sync time attribute)");var S=+b[1];if(isNaN(S))throw new Error("parse error (sync time attribute NaN)");E(_.split("\n"),S/1e3)}return p;function E(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if("&nbsp;"===d)p[p.length-1].end=n;else{var c=document.createElement("DIV");c.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 v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.A)(A)&&(v.style.cssText=A);for(var h=d.split(a),m=0;m<h.length;m++){0!==m&&v.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))})),v.appendChild(y)}f.appendChild(v),c.appendChild(f),p.push({element:c,start:n+t,end:-1})}}}}}},7275:function(e,t,n){"use strict";var r=n(8068),i=n(2384),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 d(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.A=function(e,t,n){var c,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,A=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=d(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.A)(n)&&void 0===(y=A[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=v.exec(e),f=p.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var _=e.slice(c.index,f.index),b=l.exec(_);if(null===b)throw new Error("parse error (sync time attribute)");var S=+b[1];if(isNaN(S))throw new Error("parse error (sync time attribute NaN)");E(_.split("\n"),S/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.A)(u)&&null!=s){var l=(0,r.A)(o,s,u);null!=l&&t.push(l)}}return t}(h);function E(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&("&nbsp;"===c?h[h.length-1].end=n:h.push({text:(i=c,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},9413:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e,t){for(var n=t+1;(0,r.A)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.A)(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}},1650:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9413),i=n(5842);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.A)(n),s=[],u=0;u<a.length;u++){var l=(0,i.A)(a[u],t);if(null!=l){var d=o(l);null!=d&&s.push(d)}}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 d=e(a);d.style.fontWeight="bold",r.appendChild(d)}else if("I"===a.nodeName){var c=e(a);c.style.fontStyle="italic",r.appendChild(c)}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 v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},5992:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(8068),i=n(9413),a=n(5842);function o(e,t){for(var n,o,s,u,l,d=e.split(/\r\n|\n|\r/),c=(0,i.A)(d),f=[],v=0;v<c.length;v++){var p=(0,a.A)(c[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.A)(o,s,l));null!==h&&f.push(h)}}return f}},5842:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e){var t=e.split(":");if((0,r.A)(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.A)(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.A)(n)||!(0,r.A)(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.A)(n)||!(0,r.A)(a))return null;var l=i(n),d=i(a);return void 0===l||void 0===d?null:{start:l+t,end:d+t,payload:o}}},2632:function(e,t,n){"use strict";n.d(t,{d:function(){return u},i:function(){return s}});var r=n(1729),i=n(4031),a=n(2384),o=n(9828);function s(e,t,n,o){for(var s,u={},l=e.slice(),d=function(){var e=t[c];if(void 0!==e){var s,d;if(e.nodeType===Node.ELEMENT_NODE)for(var f=e,v=0;v<=f.attributes.length-1;v++){var p=f.attributes[v],h=p.name;if("style"===h)s=p.value;else if("region"===h)d=p.value;else{var m=h.substring(4);if((0,i.A)(l,m)&&(u[m]=p.value,l.splice(v,1),0===l.length))return{v:u}}}if((0,a.A)(s)){var g=(0,r.A)(n,(function(e){return e.id===s}));if(void 0!==g)for(var y=0;y<=l.length-1;y++){var A=l[y];if(!(0,a.A)(u[A])&&(0,a.A)(g.style[A])){if(u[A]=g.style[A],l.splice(y,1),0===l.length)return{v:u};y--}}}if((0,a.A)(d)){var _=(0,r.A)(o,(function(e){return e.id===d}));if(void 0!==_)for(var b=0;b<=l.length-1;b++){var S=l[b];if(!(0,a.A)(u[S])&&(0,a.A)(_.style[S])){if(u[S]=_.style[S],l.splice(b,1),0===l.length)return{v:u};b--}}}}},c=0;c<=t.length-1;c++)if(s=d())return s.v;return u}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.A)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},9750:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(2384),i=n(8623);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.Cn.test(e)?function(e,t){var n=i.Cn.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,o+60*a+3600*r}(t,e):i.lP.test(e)?a(i.lP,e):i.uA.test(e)?a(i.uA,e):i.s_.test(e)?function(e,t){var n=i.s_.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Nm.test(e)?function(e,t){var n=i.Nm.exec(t);return Number(n[1])/e.tickRate}(t,e):i.QF.test(e)?a(i.QF,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.A)(n)?o(n,t):null,u=(0,r.A)(i)?o(i,t):null,l=(0,r.A)(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}}},8342:function(e,t,n){"use strict";n.d(t,{A:function(){return T}});var r=n(3487);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(9750);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(2384),d=n(8935),c=n(2632),f=n(4666),v=n(9477),p=n(8623);function h(e,t){var n=t;return(0,l.A)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.UR.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=p.Ce.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=p.PL.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p._Y.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.A)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.A)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.A)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var d=m(o[0]),c=o[1];e.style.textShadow=h(d,c)}else if((0,l.A)(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]),A=o[1];e.style.textShadow=h(y,A)}else if((0,l.A)(r)){var _=o[0];e.style.textShadow=h(r,_)}}}var b=t.textDecoration;if((0,l.A)(b))switch(b){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=b}var S=t.fontFamily;if((0,l.A)(S))switch(S){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=S}var E=t.fontStyle;(0,l.A)(E)&&(e.style.fontStyle=E);var T=t.fontWeight;(0,l.A)(T)&&(e.style.fontWeight=T);var w=t.fontSize;(0,l.A)(w)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.iP.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)?v.A.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 v.A.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,w):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var k=t.direction;(0,l.A)(k)&&(e.style.direction=k);var I=t.unicodeBidi;if((0,l.A)(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.A)(x)&&(e.style.visibility=x),"none"===t.display&&(e.style.display="none");var R=t.wrapOption;e.style.whiteSpace="noWrap"===R?n?"nowrap":"pre":n?"normal":"pre-wrap"}function A(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.A)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.iP.exec(r[0]),a=p.iP.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])):v.A.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])):v.A.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.A)(r);var i=t.overflow;e.style.overflow=(0,l.A)(i)?i:"hidden";var a=t.padding;(0,l.A)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var d=p.iP.exec(n[3]);if(null!==d)if("px"===d[2]||"%"===d[2]||"em"===d[2]){var c=d[1]+d[2];e.style.paddingLeft=c}else"c"===d[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",d[1])):v.A.warn("TTML Parser: unhandled padding unit:",d[2])}}}}}}}}(e,a);var o=t.origin;(0,l.A)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.iP.exec(r[0]),a=p.iP.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])):v.A.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])):v.A.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.A)(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 d=t.opacity;(0,l.A)(d)&&(e.style.opacity=d);var c=t.visibility;(0,l.A)(c)&&(e.style.visibility=c),"none"===t.display&&(e.style.display="none")}function _(e,t){e.style.margin="0px",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1");var n=t.backgroundColor;(0,l.A)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.A)(r)&&function(e,t){var n=t.trim(),r=n.split(" ");if("auto"!==n){var i=p.iP.exec(r[0]);null!==i&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.lineHeight=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",i[1])):v.A.warn("TTML Parser: unhandled lineHeight unit:",i[2]))}}(e,r);var i=t.textAlign;if((0,l.A)(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 b(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," ")}var o=document.createTextNode(i);return r.appendChild(o),r.className="rxp-texttrack-span",y(r,t,n),r}function S(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.Ft)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),A(v,i),null!==t){var p=(0,c.i)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.A)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",_(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,c.i)(["backgroundColor"],a,n,t).backgroundColor;(0,l.A)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=b(p,i,o);u.push(m)}else if((0,f.SV)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.f_)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var A=p.getAttribute("xml:space"),_=(0,l.A)(A)?"default"===A:o,S=(0,d.A)({},i,(0,c.i)(g,[p],n,t));u.push.apply(u,e(p,S,[p].concat(a),_))}}return u}(e,(0,d.A)({},r),[],i)}(e,n,r,i,s),S=0;S<y.length;S++)h.appendChild(y[S]);return v.appendChild(h),v}function E(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 d=n.cellResolution,c=(0,s.A)(t,n);return{start:c.start+u,end:c.end+u,element:S(t,r,i,a,o,{cellResolution:d,shouldTrimWhiteSpace:l})}}var T=function(e,t){for(var n=(0,r.A)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=E(n[s]);null!==l&&o.push(l)}return o}},5084:function(e,t,n){"use strict";n.d(t,{A:function(){return v}});var r=n(3487),i=n(8068),a=n(7402),o=n(2384),s=n(9750),u=n(8623),l=n(4666),d={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.A)(t,f),h=p.start,m=p.end,g=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 d=u.trim();u=d=d.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if((0,l.SV)(s))i+="\n";else if((0,l.f_)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.A)(c)?"default"===c:t)}}return i}return n(e,t)}(t,v),y=(0,i.A)(h+n,m+n,g);return null===y?null:((0,a.A)(y)&&function(e,t){var n=t.extent;if((0,o.A)(n)){var r=u.KP.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.A)(i))u.KP.exec(i);var a=t.align;if((0,o.A)(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 l=d[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.A)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},3487:function(e,t,n){"use strict";n.d(t,{A:function(){return v}});var r=n(1729),i=n(2384),a=n(8935),o=n(9477),s=/(\d+) (\d+)/;var u=n(2632),l=n(3786),d=n(4031);var c=n(4666),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 v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,c.$K)(p),m=(0,c.bL)(p),g=(0,c.Y$)(p),y=(0,c.zn)(p),A=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"),d={columns:32,rows:15};if(null!==l){var c=s.exec(l);if(null===c||c.length<3)o.A.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(c[1],10),v=parseInt(c[2],10);isNaN(f)||isNaN(v)?o.A.warn("TTML Parser: Invalid cellResolution"):d={columns:f,rows:v}}}if((0,i.A)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,A=null!==u?u:"default",_=void 0!==m?m:p*h;if(null!==a){var b=/^(\d+) (\d+)$/g.exec(a);null!==b&&(g=p*(Number(b[1])/Number(b[2])))}return{cellResolution:d,tickRate:_,frameRate:g,subFrameRate:y,spaceStyle:A}}(p),_=[],b=0;b<=m.length-1;b++){var S=m[b];if(S instanceof Element){var E=S.getAttribute("xml:id");if(null!==E){var T=S.getAttribute("style"),w=null===T?[]:T.split(" ");_.push({id:E,style:(0,u.d)(S),extendsStyles:w})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(){var i=r.extendsStyles[u],s=(0,l.A)(e,(function(e){return e.id===i}));if(s<0)o.A.warn("TTML Parser: unknown style inheritance: "+i);else{var c=e[s];(0,d.A)(t,s)?o.A.warn("TTML Parser: infinite style inheritance loop avoided"):n(c,s),r.style=(0,a.A)({},c.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s();r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(_);for(var k=[],I=function(){var e=g[x];if(e instanceof Element){var t=e.getAttribute("xml:id");if(null!==t){var n=(0,u.d)(e),o=e.getAttribute("style");if((0,i.A)(o)){var s=(0,r.A)(_,(function(e){return e.id===o}));void 0!==s&&(n=(0,a.A)({},s.style,n))}k.push({id:t,style:n,extendsStyles:[]})}}},x=0;x<=g.length-1;x++)I();for(var R=(0,u.i)(f,null!==h?[h]:[],_,k),C="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===A.spaceStyle,M=0;M<y.length;M++){var P=y[M];if(P instanceof Element){var D=(0,c.Ft)(P),N=(0,a.A)({},R,(0,u.i)(f,[P].concat(D),_,k)),O=P.getAttribute("xml:space"),L=(0,i.A)(O)?"default"===O:C,U={paragraph:P,timeOffset:t,idStyles:_,regionStyles:k,body:h,paragraphStyle:N,ttParams:A,shouldTrimWhiteSpace:L};null!==U&&n.push(U)}}}return n}},8623:function(e,t,n){"use strict";n.d(t,{Ce:function(){return f},Cn:function(){return r},KP:function(){return l},Nm:function(){return s},PL:function(){return v},QF:function(){return u},UR:function(){return c},_Y:function(){return p},iP:function(){return d},lP:function(){return i},s_:function(){return o},uA: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)%$/,d=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,c=/^#([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])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},4666: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)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function d(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{$K:function(){return a},Ft:function(){return i},SV:function(){return l},Y$:function(){return s},bL:function(){return o},f_:function(){return d},zn:function(){return u}})},7093:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384),i=n(6525);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.GX)(e,a)){var o=(0,i.o4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.A)(e[a]))for(;(0,r.A)(e[a]);)a++;return n}},8977:function(e,t,n){"use strict";n.d(t,{A:function(){return I}});var r=n(7093),i=n(2384),a=n(6525);var o=n(8786),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=function(r){var o=e[r];if(Array.isArray(/::cue {/.exec(o)))for(o=e[++r];(0,i.A)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)n+=o,o=e[++r];else{for(var s=[],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);(0,i.A)(o)&&Array.isArray(u);)s.push(u[1]),o=e[++r],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);for(var l="";(0,i.A)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)l+=o,o=e[++r];s.forEach((function(e){void 0===t[e]?t[e]=l:t[e]+=l}))}a=r},a=1;a<e.length;a++)r(a)})),{classes:t,global:n}}var l=n(4031);function d(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.A)(["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 c=e.nodeName.toLowerCase().split("."),f=[];if(c.forEach((function(e){(0,i.A)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.A)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.A)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=d(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var A=d(e.childNodes[y],t);n.appendChild(A)}}return n}var c=n(4324);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,c.A)(e).length))return"text-align:center";var t=m(e),n=A(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+E(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+S(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"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=w(e.position);if(null!==n)return n;var r=S(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.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={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?S(e.align):v.CENTER]},A=function(e){return{position:_(e.line),offset:b(e.line)}},_=function(e){return w(e)},b=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.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[p.START]},S=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},E=function(e){return T(e,100)},T=function(e,t){var n=w(e);return null!==n?n:t},w=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 k(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 c=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);c.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.A)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),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(d(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(c),c.appendChild(v),{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.yW)(n),d=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.iq)(e,r)){var o=r;for(r++;(0,i.A)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.A)(e[r]))for(;(0,i.A)(e[r]);)r++;return n}(n,l),c=(0,r.A)(n,l),f=u(d),v=0;v<c.length;v++){var p=(0,o.A)(c[v],t);if(null!=p){var h=k(p,f);s.push(h)}}return s}},2537:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(7402),i=n(7093),a=n(8786),o=n(6525),s=n(4031),u=n(2384);function l(e,t){if(!(0,u.A)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.A)(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.A)(["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.A)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.A)(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.A)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.A)(["start","center","end","left"],e.align)&&(t.align=e.align)}var d=n(8068);var c=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,c,f,v=(0,o.yW)(n),p=(0,i.A)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.A)(p[m],t);if(null!=g){var y=(u=void 0,c=void 0,f=void 0,u=(s=g).start,c=s.end,f=s.payload.join("\n"),(0,d.A)(u,c,f));null!=y&&((0,r.A)(y)&&l(g.settings,y),h.push(y))}}return h}},8786:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e){var t=e.split(":").reverse();if((0,r.A)(t[2])||(0,r.A)(t[1])){var n=(0,r.A)(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}}},6525:function(e,t,n){"use strict";n.d(t,{GX:function(){return o},iq:function(){return a},o4:function(){return s},yW:function(){return i}});var r=n(2384);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.A)(e[n]);)n++;return n}},9502:function(e,t,n){"use strict";n.d(t,{A:function(){return ce}});var r=n(418),i=n(1856),a=n(467),o=n(4756),s=n.n(o),u=n(4389),l=n(2716);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,l.Ay)(e.baseUrl,t.url)}function c(e,t,n,r,i){return f.apply(this,arguments)}function f(){return(f=(0,a.A)(s().mark((function e(t,n,r,i,a){var o,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.segment,l=d(t,o),!o.isInit&&null!==l){e.next=4;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return e.next=6,(0,u.Ay)({url:l,responseType:"arraybuffer",timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i});case 6:return c=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:c});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t){var n,i=t.segment,a=t.period,o=e.data,s=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(s)throw new Error("Image data should not be downloaded in chunks");var u=null!==(n=i.timestampOffset)&&void 0!==n?n:0;return null===o||null===r.A.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}:{segmentType:"media",chunkData:{data:r.A.imageParser(new Uint8Array(o)).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:[a.start,a.end]}}var p=n(5151),h=n(874),m=n(9477),g=n(8568),y=n(8935),A=n(4670);function _(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,d){var c,f=a.responseData,v=o.externalClockOffset,_=null!==(c=a.url)&&void 0!==c?c:o.originalUrl,b=null!=i?i:v,S={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.A.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return m.A.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var T=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,A.eb)(e).buffer;if(e instanceof Document)return(0,A.eb)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);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}(T)?"initialized"===E.wasm.status?(m.A.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(T,S))):(m.A.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(m.A.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(m.A.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(T,S)))}))):(m.A.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,A.Es)(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")}(f);return k(E.js(e,S))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled()?Promise.reject(l.cancellationError):{manifest:new g.Ay(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return d((function(){var t=p.A.getCurrent().DEFAULT_REQUEST_TIMEOUT;return"string"===n.format?(0,u.Ay)({url:e,responseType:"text",timeout:t,cancelSignal:l}):(0,u.Ay)({url:e,responseType:"arraybuffer",timeout:t,cancelSignal:l})})).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,y.A)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,y.A)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,h.A)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,y.A)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var b=n(7004),S=n(3506),E=n(5497),T=n(6787),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,T.A)(k)&&!(0,T.A)(w)}var x=n(5950),R=n(3233);function C(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 M=n(2507),P=n(3598);function D(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new M.Ay,d=l.linkToSignal(i);function c(){l.signal.deregister(u),d()}l.signal.register(u),e(t,n,r,l.signal,Object.assign(Object.assign({},a),{onNewChunk:function(e){try{o(e),a.onNewChunk(e)}catch(e){c(),l.cancel(),u(e)}}})).then((function(e){if(c(),!l.isUsed()){if("segment-loaded"===e.resultType)try{o(e.resultData.responseData)}catch(e){return void u(e)}s(e)}}),(function(e){c(),u(e)}))}));function o(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===C(n.adaptation.type,n.representation)&&(0,P.A)(new Uint8Array(e),n.segment.isInit)}}}var N=n(5553);function O(e,t,n,r,i){if(void 0===t.range)return(0,u.Ay)({url:e,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.Ay)({url:e,headers:{Range:(0,R.A)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var a=(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.indexRange)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress});return Promise.all([a,o]).then((function(t){var n=t[0],r=t[1],i=(0,N.xW)(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(1688);function U(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,R.A)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,T.A)(e.headers))if((0,T.A)(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])}}m.A.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,d=performance.now(),c=(0,T.A)(k)?null:new k;function f(){(0,T.A)(c)?m.A.warn("Fetch: AbortController API not available."):c.abort()}void 0!==e.timeout&&(o=window.setTimeout((function(){l=!0,f()}),e.timeout));var v=e.cancelSignal.register((function(e){u=e,f()})),p={method:"GET"};return void 0!==t&&(p.headers=t),p.signal=(0,T.A)(c)?null:c.signal,fetch(e.url,p).then((function(t){if((0,T.A)(o)||clearTimeout(o),t.status>=300)throw m.A.warn("Fetch: Request HTTP Error",t.status,t.url),new S.A(t.url,t.status,E.yl.ERROR_HTTP_CODE);if((0,T.A)(t.body))throw new S.A(t.url,t.status,E.yl.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,T.A)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),u=0;return l();function l(){return c.apply(this,arguments)}function c(){return(c=(0,a.A)(s().mark((function n(){var a,o,c,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,T.A)(a.value)){n.next=11;break}return u+=a.value.byteLength,o=performance.now(),c={url:t.url,currentTime:o,duration:o-d,sendingTime:d,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(c),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-d,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:d,size:u,status:t.status,url:t.url});case 16:return n.abrupt("return",l());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==u)throw u;if(v(),l)throw m.A.warn("Fetch: Request timeouted."),new S.A(e.url,0,E.yl.TIMEOUT);if(t instanceof S.A)throw t;throw m.A.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new S.A(e.url,0,E.yl.ERROR_EVENT)}))}({url:e,headers:u,onData:function(e){var t=new Uint8Array(e.chunk),n=function(e){for(var t=0,n=[],r=null;t<e.length;){r=e.subarray(t,1/0);var i=(0,L.A)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,N.mq)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.A)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,N.mq)(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 0===n.length?[null,r]:[n,r]}(null!==l?(0,N.xW)(l,t):t),a=n[0];l=n[1],null!==a&&(a.forEach((function(e){r.onNewChunk(e)})),i.isCancelled())||(r.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),i.isCancelled())},timeout:n.timeout,cancelSignal:i}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function B(e,t,n,r,i,a){if(t.segment.isInit)return O(e,t.segment,r,a,i);var o=C(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return U(e,t,r,i,a);(0,x.A)("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,u.Ay)({url:e,responseType:"arraybuffer",headers:void 0!==s.range?{Range:(0,R.A)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(2948),V=n(1134),z=408125543,K=357149030,W=2807729,G=17545,H=475249515,q=187,j=179,Y=183,Q=241;function $(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=ee(n,o);if(null==s)return null;var u=s.value,l=o+s.length,d=te(n,l);if(null==d)return null;var c=l+d.length,f=c+d.value;if(u===e)return[c,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return $(e,t.slice(v+1,t.length),n,[c,f])}o=f}return null}function X(e,t){var n=$(W,[z,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/ne(e,n[0],r)}function Z(e,t){var n=$(G,[z,K],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 ee(e,t){var n=J(e,t);if(null==n)return m.A.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.A.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 te(e,t){var n=J(e,t);if(null==n)return m.A.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.A.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 ne(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 re=n(9044);function ie(e,t,n,r){var i=(0,V.D1)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,V.cS)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&m.A.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 ae(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,a=null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),o=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,A.Es)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t);return{inbandEvents:a,needsManifestRefresh:o}}}function oe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a,o=n.period,s=n.adaptation,u=n.representation,l=n.segment,d=n.manifest,c=e.data,f=e.isChunked,v=[o.start,o.end];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:0,protectionDataUpdate:!1,appendWindow:v};var p=c instanceof Uint8Array?c:new Uint8Array(c),h=C(s.type,u),m="mp4"===h||void 0===h,g=!1;if(m){var y,A=(0,F.A)(p);l.isInit&&(y=null!==(i=(0,V.a5)(p))&&void 0!==i?i:void 0),(A.length>0||void 0!==y)&&(g=u._addProtectionData("cenc",y,A))}if(!l.isInit){var _=m?ie(p,f,l,r):null,b=null!==(a=l.timestampOffset)&&void 0!==a?a:0;if(m){var S=(0,V.pk)(p);if(void 0!==S){var E=ae(S.filter((function(e){return void 0!==l.privateInfos&&void 0!==l.privateInfos.isEMSGWhitelisted&&l.privateInfos.isEMSGWhitelisted(e)})),d.publishTime);if(void 0!==E){var w=E.needsManifestRefresh,k=E.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:_,chunkOffset:b,appendWindow:v,inbandEvents:k,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:_,chunkOffset:b,protectionDataUpdate:g,appendWindow:v}}var I=l.indexRange,x=null;if("webm"===h)x=function(e,t){var n=$(z,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=X(e,r);if(null==a)return null;var o=Z(e,r);if(null==o)return null;var s=$(H,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var d=$(q,[],e,[l,s[1]]);if(null==d)break;var c=$(j,[],e,[d[0],d[1]]);if(null==c)return null;var f=ne(e,c[0],c[1]-c[0]),v=$(Q,[Y],e,[d[0],d[1]]);if(null==v)return null;var p=ne(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=d[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(m&&(x=(0,V.Tr)(p,Array.isArray(I)?I[0]:0),!0===t&&null!==x&&x.length>0)){var R=x[x.length-1];Array.isArray(R.range)&&(R.range[1]=1/0)}u.index instanceof re.A&&null!==x&&x.length>0&&u.index.initializeIndex(x);var M=m?(0,V.zS)(p):"webm"===h?X(p,0):void 0,P=(0,T.A)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:P}}}var se=n(2875);function ue(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):m.A.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),d=function(e){var t=(0,se.j8)(e);return null===t?"":(0,A.Es)(t)}(t);return{data:d,type:l,language:s.language,start:i,end:a}}function le(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?m.A.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration));var u=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);return{data:t,type:u,language:o.language,start:r,end:i}}function de(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,l=e.data,d=e.isChunked;if(null===l)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var c=C(o.type,s);if("webm"===c)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===c?function(e,t,n,r,i){var a,o=n.period,s=n.representation,u=n.segment,l=u.isInit,d=u.indexRange,c="string"==typeof e?(0,A.eb)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,V.Tr)(c,Array.isArray(d)?d[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,V.zS)(c);return s.index instanceof re.A&&null!==f&&f.length>0&&s.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=ie(c,t,u,r),m=ue(n,c,h,t),g=null!==(a=u.timestampOffset)&&void 0!==a?a:0;return{segmentType:"media",chunkData:m,chunkSize:c.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[o.start,o.end]}}(l,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,A.Es)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:le(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(l,d,n)}}var ce=function(e){var t=(0,i.A)({customManifestLoader:e.manifestLoader},null===r.A.dashParsers.wasm||"initialized"!==r.A.dashParsers.wasm.status&&"initializing"!==r.A.dashParsers.wasm.status?"arraybuffer":"text"),n=_(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:D(r);function r(e,r,i,a,o){var s=d(e,r.segment);if(null==s)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return B(s,r,t,i,o,a);var u={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",timeout:i.timeout,url:s};return new Promise((function(e,l){var d=!1,c=n(u,{reject:function(e){var t,n,r;if(!d&&!a.isCancelled()){d=!0,a.deregister(f);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new b.A(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);l(s)}},resolve:function(t){d||a.isCancelled()||(d=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){d||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){d||a.isCancelled()||(d=!0,a.deregister(f),B(s,r,t,i,o,a).then(e,l))}});function f(e){d||(d=!0,"function"==typeof c&&c(),l(e))}a.register(f)}))}}(e),o=oe(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:D(n);function n(e,n,r,i,a){var o=n.adaptation,s=n.representation,l=n.segment,c=l.range,f=d(e,l);if(null===f)return Promise.resolve({resultType:"segment-created",resultData:null});if(l.isInit)return O(f,l,r,i,a);var v=C(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return U(f,n,r,a,i);(0,x.A)("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 p?(0,u.Ay)({url:f,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,R.A)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.Ay)({url:f,responseType:"text",headers:Array.isArray(c)?{Range:(0,R.A)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:s,parseSegment:de(e)},image:{loadSegment:c,parseSegment:v}}}},5564:function(e,t,n){"use strict";n.d(t,{A:function(){return me}});var r=n(467),i=n(4756),a=n.n(i),o=n(418),s=n(9477),u=n(8568),l=n(2875),d=n(7941),c=n(7994),f=n(5019),v=n(3877),p=n(860);function h(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,v.Rb)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function m(e,t){return e.replace(/\{start time\}/g,String(t))}function g(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function y(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 A=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,v.Rb)(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},url: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,d=this._isAggressiveMode,c=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],A=h.duration,_=h.start,b=y(h,s[p+1]),S=g(_,i,A),E=_+S*A,T=d?0:A;E<a&&S<=b&&(null==v||E+T<=v);){var w=E,k=null!=n?n+S:void 0,I={id:String(E),isInit:!1,time:w/u,end:(w+A)/u,duration:A/u,timescale:1,number:k,url:m(l,w),complete:!0,privateInfos:{smoothMediaSegment:{time:w,duration:A}}};c.push(I),E=_+ ++S*A}if(E>=a)return c;null!=n&&(n+=b+1)}return c},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.getFirstAvailablePosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastAvailablePosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,v.Rb)(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.getEnd=function(){if(!this._isLive)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,c.h)(e<=t),this.isStillAwaitingFutureSegments())return!1;var r=this.getLastAvailablePosition();return!(void 0!==r&&t<r)&&(t>(null!==(n=this.getFirstAvailablePosition())&&void 0!==n?n:0)&&void 0)},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,v.ph)(this._index,e,void 0)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();for(var t=this._index,n=t.timeline,r=t.timescale,i=0;i<n.length;i++){var a=n[i],o=a.start/r;if(o>e.time)return!1;if(o===e.time)return!0;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},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof d.A&&(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,v.Rb)(o,null);if(!((0,v.Rb)(a,null)<=u))for(var l=0;l<t.length;l++){var d=t[l],c=(0,v.Rb)(d,null);if(c===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(c>u){if(d.duration!==o.duration)return;var f=u-d.start;if(0===f)return s.A.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%d.duration!=0)return;var p=f/d.duration-1,h=d.repeatCount-p;if(h<0)return;o.repeatCount+=h;var m=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(m))}}}},t._update=function(e){(0,p.A)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isStillAwaitingFutureSegments=function(){return this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)h(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,f.A)(e.timeline,r)}}},e}(),_=n(4129),b=n(4031),S=n(5553),E=n(2384),T=n(8935),w=n(2716),k=n(4670),I=n(3058),x={};function R(e){if(null!=x[e])return x[e];var t=(0,k.eb)(e);return x[e]=t,t}function C(e,t){var n=t.length+8;return n<=I.Z?(0,S.xW)((0,S.KS)(n),R(e),t):(0,S.xW)((0,S.KS)(1),R(e),(0,S.Kk)(n+8),t)}function M(e,t){return C(e,S.xW.apply(void 0,t))}function P(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,b.A)(t,r)){s.A.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,P(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,b.A)(o,n)){s.A.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,P(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,b.A)(i,n)){s.A.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,P(e),i.push(r)}else i.push(n)}))}))}))}))}var D=n(603);function N(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,S.xW)([8,1,18,16],e)}]}function O(e,t){if(void 0===t&&(t=N),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,D.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,S.AT)(e,8),n=(0,k.Yg)(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,k.KZ)((0,D.K)(i));return(0,k.My)(a).toLowerCase()}(r),a=(0,k.aT)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}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",DFXP:"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"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),d=r("PacketSize"),c=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 s.A.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var p=function(e,t){var n;return 0==(n="AACH"===t?5:(0,E.A)(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!==o?parseInt(o,10):o,codecPrivateData:u,codecs:p,customAttributes:n,mimeType:void 0!==l?B[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};case"video":var h=r("CodecPrivateData"),m=r("FourCC"),g=r("MaxWidth"),y=r("MaxHeight"),A=r("Bitrate"),_=void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10);if(void 0!==m&&void 0===B[m]||void 0===h)return s.A.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var b=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,E.A)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:_,customAttributes:n,mimeType:void 0!==m?B[m]:m,codecPrivateData:h,codecs:b,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var S=r("CodecPrivateData"),T=r("FourCC"),w=r("Bitrate");return{bitrate:void 0===w||isNaN(parseInt(w,10))?0:parseInt(w,10),customAttributes:n,mimeType:void 0!==T?B[T]:T,codecPrivateData:null!=S?S:""};default:return s.A.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.baseUrl,u=t.protections,l=t.timeShiftBufferDepth,d=t.manifestReceivedTime,f=t.isLive,v=r.getAttribute("Timescale"),p=null===v||isNaN(+v)?i:+v,h=r.getAttribute("Type");if(null===h)throw new Error("StreamIndex without type.");(0,b.A)(_.B,h)||s.A.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),w=r.getAttribute("Url"),I=null===w?"":w;var x,R=L(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,m);if(null===i)return e;("video"!==m||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,P=R.cNodes,D={timeline:(x=P,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 d=x[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,E.A)(c)?+c: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:p};(0,c.h)(0!==M.length,"Adaptation should have at least one playable representation.");var N=m+((0,E.A)(y)?"_"+y:""),O=M.map((function(t){var n,r,i,a,s={timeline:D.timeline,timescale:D.timescale,media:(n=I,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,E.A)(t.mimeType)?t.mimeType:U[m],v=t.codecs,p=N+"_"+(null!=m?m+"-":"")+(null!=c?c+"-":"")+(null!=v?v+"-":"")+String(t.bitrate),h=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){h.push({keyId:t,systemId:e.systemId})}))})));var g={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},y=null!=e.aggressiveMode&&e.aggressiveMode,_=new A(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:d,segmentPrivateInfos:g,timeShiftBufferDepth:l}),b=(0,T.A)({},t,{index:_,cdnMetadata:[{baseUrl:o}],mimeType:c,codecs:v,id:p});if(h.length>0||void 0!==a){var w=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,""),i=function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return C("pssh",(0,S.xW)([n,0,0,0],(0,k.aT)(e),(0,S.KS)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(w.length>0){var x=[{type:"cenc",values:w}];b.contentProtections={keyIds:h,initData:x}}else b.contentProtections={keyIds:h,initData:[]}}return b}));if("ADVT"===g)return null;var B={id:N,type:m,representations:O,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(B.closedCaption=!0),B}return function(n,r,a){var s="";if(void 0!==r){var u=(0,w.Cl)(r);s=r.substring(0,u)}var l=n.documentElement;if(null==l||"SmoothStreamingMedia"!==l.nodeName)throw new Error("document root should be SmoothStreamingMedia");var d=l.getAttribute("MajorVersion"),c=l.getAttribute("MinorVersion");if(null===d||null===c||!/^[2]-[0-2]$/.test(d+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,E.A)(p)?isNaN(+p)?1e7:+p:1e7,m=L(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(O(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),g=m.protections,y=m.adaptationNodes,A="boolean"==typeof(f=l.getAttribute("IsLive"))?f:"string"==typeof f&&"TRUE"===f.toUpperCase();if(A){var _=l.getAttribute("DVRWindowLength");null==_||isNaN(+_)||0==+_||(v=+_/h)}var b,S,T,k,I,x,R,C=y.reduce((function(e,t){var n=o({root:t,baseUrl:s,timescale:h,protections:g,isLive:A,timeShiftBufferDepth:v,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,D=void 0!==C.video?C.video[0]:void 0,N=void 0!==C.audio?C.audio[0]:void 0;if(void 0!==D||void 0!==N){var U=[],B=[];if(void 0!==D){var F=D.representations[0];if(void 0!==F){var V=F.index.getFirstAvailablePosition(),z=F.index.getLastAvailablePosition();null!=V&&U.push(V),null!=z&&B.push(z)}}if(void 0!==N){var K=N.representations[0];if(void 0!==K){var W=K.index.getFirstAvailablePosition(),G=K.index.getLastAvailablePosition();null!=W&&U.push(W),null!=G&&B.push(G)}}U.length>0&&(I=Math.max.apply(Math,U)),B.length>0&&(x=Math.min.apply(Math,B),R=Math.max.apply(Math,B))}var H=l.getAttribute("Duration"),q=null!==H&&0!=+H?+H/h:void 0;if(A){b=e.suggestedPresentationDelay,S=t,T=null!=I?I:S;var j=R;void 0===j&&(j=Date.now()/1e3-S);var Y=x;void 0===Y&&(Y=j),k={isLinear:!0,maximumSafePosition:Y,livePosition:j,time:performance.now()},M=null!=v?v:null}else{T=null!=I?I:0,k={isLinear:!1,maximumSafePosition:void 0!==x?x:void 0!==q?T+q:1/0,livePosition:void 0,time:performance.now()}}var Q=A?0:T,$=A?void 0:k.maximumSafePosition,X={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:A,isDynamic:A,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:T,timeshiftDepth:M,maximumTimeData:k},periods:[{adaptations:C,duration:void 0!==$?$-Q:q,end:$,id:"gen-smooth-period-0",start:Q}],suggestedPresentationDelay:b,transportType:"smooth",uris:null==r?[]:[r]};return P(X),X}},V=F,z=n(4389),K=n(5950),W=n(3598),G=n(1856),H=n(1134),q=n(8797);function j(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.Y2)(e);null!==c?(u=function(e){var t=(0,q.$H)(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,S.CQ)(t,16*a+5),o=(0,S.CQ)(t,16*a+5+8)):(s=(0,S.mq)(t,8*a+5),o=(0,S.mq)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(c),o=function(e){var t=(0,q.$H)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,S.CQ)(t,12),time:(0,S.CQ)(t,4)}}(c)):s.A.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)d.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:d,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:d,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,H.cS)(e),m=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:d,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var Y=n(443);function Q(e,t){return C("schm",(0,S.xW)(4,(0,k.eb)(e),(0,S.KS)(t)))}function $(e){return C("frma",(0,k.eb)(e))}function X(e){var t=[7,[e.length]];return C("stsd",S.xW.apply(void 0,t.concat(e)))}function Z(e,t,n){return C("tenc",(0,S.xW)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(C("senc",i),function(e){if(0===e.length)return C("saiz",new Uint8Array(0));var t=(0,S.mq)(e,0),n=(0,S.mq)(e,4),r=new Uint8Array(n+9);r.set((0,S.KS)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2&~t?(i=0,a=0):(a=2,s+=6*(i=(0,S.UU)(e,s))+2),r[o]=6*i+8+a,o++;return C("saiz",r)}(i),function(e,t,n,r){return C("saio",(0,S.xW)(4,[0,0,0,1],(0,S.KS)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),M("traf",a)}function ee(e,t){var n=(0,q.QL)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,q.YH)(r,1835427940),a=(0,q.fZ)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,q.QL)(a,1952868452),s=(0,q.QL)(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 d=function(e){return C("tfdt",(0,S.xW)([1,0,0,0],(0,S.Kk)(e)))}(t),c=function(e,t){var n=(1&e[t+3])>0;if(n)return e;var r=new Uint8Array(e.length+4);return r.set(e.subarray(0,t+8),0),r[t+3]=1|r[t+3],r.set([0,0,0,0],t+8),r.set(e.subarray(t+8,e.length),t+12),(0,H.J_)(r)}(l,s[1]-s[0]),f=J(u,d,c,i,(0,q.$H)(a,2721664850,1520127764,2722393154,2086964724)),v=M("moof",[i,f]),p=(0,q.QL)(v,1836019558),h=(0,q.QL)(f,1953653094),m=(0,q.QL)(c,1953658222);if(null===p||null===h||null===m)throw new Error("Smooth: Invalid moof, trun or traf generation");var g=p[1]-p[0]+i.length+(h[1]-h[0])+u.length+d.length+(m[1]-m[0])+8,y=n[2]-n[0],A=v.length-y,_=(0,q.QL)(e,1835295092);if(null===_)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.h$&&(0===A||A<=-8)){var b=_[1];return v.set((0,S.KS)(b),g),e.set(v,n[0]),A<=-8&&e.set(C("free",new Uint8Array(-A-8)),v.length),e}var E=_[1]+A;v.set((0,S.KS)(E),g);var T=new Uint8Array(e.length+A),w=e.subarray(0,n[0]),k=e.subarray(n[2],e.length);return T.set(w,0),T.set(v,w.length),T.set(k,w.length+v.length),T}var te=n(7004),ne=n(3233);function re(e,t,n,r,i,a){var o,s,u,l=M("stbl",[n,C("stts",new Uint8Array(8)),C("stsc",new Uint8Array(8)),C("stsz",new Uint8Array(12)),C("stco",new Uint8Array(8))]),d=function(e){return C("dref",(0,S.xW)(7,[1],e))}(C("url ",new Uint8Array([0,0,0,1]))),c=M("dinf",[d]),f=M("minf",[r,c,l]),v=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 C("hdlr",(0,S.xW)(8,(0,k.eb)(t),12,(0,k.eb)(n),1))}(t),p=function(e){return C("mdhd",(0,S.xW)(12,(0,S.KS)(e),8))}(e),h=M("mdia",[p,v,f]),m=function(e,t,n){return C("tkhd",(0,S.xW)((0,S.KS)(7),8,(0,S.KS)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,S.ww)(e),2,(0,S.ww)(t),2))}(i,a,1),g=M("trak",[m,h]),y=M("mvex",[(o=1,C("trex",(0,S.xW)(4,(0,S.KS)(o),[0,0,0,1],12)))]),A=function(e,t){return C("mvhd",(0,S.xW)(12,(0,S.KS)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,S.ww)(t+1)))}(e,1),_=function(e,t,n){return M("moov",[e,t,n])}(A,y,g),b=(s="isom",u=["isom","iso2","iso6","avc1","dash"],C("ftyp",S.xW.apply(void 0,[(0,k.eb)(s),[0,0,0,1]].concat(u.map(k.eb)))));return(0,S.xW)(b,_)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,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 C("avcC",(0,S.xW)([1,i,a,o,252|r,225],(0,S.ww)(e.length),e,[1],(0,S.ww)(t.length),t))}((0,k.aT)(l),(0,k.aT)(d),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return C("avc1",(0,S.xW)(6,(0,S.ww)(1),16,(0,S.ww)(e),(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),6,[0,1,i.length],(0,k.eb)(i),31-i.length,(0,S.ww)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);c=X([p])}else{var h=M("schi",[Z(1,8,s)]),m=Q("cenc",65536),g=function(e,t,n,r,i,a,o,s){return C("encv",(0,S.xW)(6,(0,S.ww)(1),16,(0,S.ww)(e),(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),6,[0,1,i.length],(0,k.eb)(i),31-i.length,(0,S.ww)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,M("sinf",[$("avc1"),m,h]));c=X([g])}return re(e,"video",c,((f=new Uint8Array(12))[3]=1,C("vmhd",f)),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,d=function(e,t){return C("esds",(0,S.xW)(4,[3,25],(0,S.ww)(e),[0,4,17,64,21],11,[5,2],(0,k.aT)(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,k.My)((0,S.ww)(l))):a),c=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return C("mp4a",(0,S.xW)(6,(0,S.ww)(e),8,(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),(0,S.ww)(i),2,a))}(1,t,n,r,i,d);return X([e])}var a=M("schi",[Z(1,8,o)]),s=Q("cenc",65536),u=M("sinf",[$("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return C("enca",(0,S.xW)(6,(0,S.ww)(e),8,(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),(0,S.ww)(i),2,a,o))}(1,t,n,r,i,d,u);return X([l])}();return re(e,"audio",c,C("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,E.A)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ce(e,t){return null===e?null:null===t.url?e.baseUrl:(0,w.Ay)(e.baseUrl,t.url)}function fe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ne.A)(s)}),(0,z.Ay)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,W.A)(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,o){var s=r.segment,u=r.manifest,l=r.period,d=r.adaptation,c=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,v=s.privateInfos.smoothInitSegment,p=v.codecPrivateData,h=v.timescale,m=v.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(d.type){case"video":var y=c.width,A=void 0===y?0:y,_=c.height;f=ie(h,A,void 0===_?0:_,72,72,4,p,g.keyId);break;case"audio":var b=v.channels,S=void 0===b?0:b,E=v.bitsPerSample,T=void 0===E?0:E,w=v.packetSize,k=void 0===w?0:w,I=v.samplingRate;f=oe(h,S,T,k,void 0===I?0:I,p,g.keyId);break;default:0,f=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:f})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:d,manifest:u,period:l,representation:c,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?fe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,d=n(x,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled()){l=!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.",s=new te.A(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);u(s)}},resolve:function(e){if(!l&&!a.isCancelled()){l=!0,a.deregister(c),de(r.representation)&&!0===t||s({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,W.A)(n,r.segment.isInit),s({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){l||a.isCancelled()||(l=!0,a.deregister(c),fe(e,r,o,i,a,t).then(s,u))},progress:function(e){l||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){l||((l=!0)||"function"!=typeof d||d(),u(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.A.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof A&&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.A.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=V(e),n=ve(e),i={customManifestLoader:e.manifestLoader},d={loadSegment:function(e,t,r,i,a){var o=ce(e,t.segment);return n(o,t,r,i,a)},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 d=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var c=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:c,protectionDataUpdate:!1}}var f=void 0!==n?j(d,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 v=f.nextSegments,p=f.chunkInfos,h=ee(d,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},c={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ce(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):de(s)?(0,z.Ay)({url:u,responseType:"arraybuffer",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,W.A)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,z.Ay)({url:u,responseType:"text",timeout:r.timeout,cancelSignal:i,onProgress:a.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,d=t.representation,c=t.segment,f=u.language,v=de(d),p=d.mimeType,h=void 0===p?"":p,m=d.codec,g=void 0===m?"":m,y=e.data,A=e.isChunked;if(c.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var _,b,S,E,T=null;if(v){var w;i=(w="string"==typeof y?(0,k.eb)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var I=void 0!==n?j(w,A,n,c,o.isLive):null;a=null==I?void 0:I.nextSegments,null===(T=null!==(r=null==I?void 0:I.chunkInfos)&&void 0!==r?r:null)?A?s.A.warn("Smooth: Unavailable time data for current text track."):(_=c.time,b=c.end):(_=T.time,b=void 0!==T.duration?T.time+T.duration:c.end);var x=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===x||"stpp.ttml.im1t"===x)E="ttml";else{if("wvtt"!==x)throw new Error("could not find a text-track parser for the type "+h);E="vtt"}var R=(0,l.j8)(w);S=null===R?"":(0,k.Es)(R)}else{var C;if(_=c.time,b=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,C=(0,k.Es)(M)}else C=y;switch(h){case"application/x-sami":case"application/smil":E="sami";break;case"application/ttml+xml":E="ttml";break;case"text/vtt":E="vtt"}if(void 0===E){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);E="srt"}S=C}return null!==T&&Array.isArray(a)&&a.length>0&&he(u,a,c),{segmentType:"media",chunkData:{type:E,data:S,start:_,end:b,language:f},chunkSize:i,chunkInfos:T,chunkOffset:null!=_?_:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;pe.test(e)?((0,K.A)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,z.Ay)({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=Promise.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.A)("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.A)(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,d=t(l,a,o);return{manifest:new u.Ay(d,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:d,video:d,text:c,image:{loadSegment:function(e,t,n,i,o){return(0,r.A)(a().mark((function r(){var s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s=t.segment,u=ce(e,s),!s.isInit&&null!==u){r.next=4;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return r.next=6,(0,z.Ay)({url:u,responseType:"arraybuffer",timeout:n.timeout,onProgress:o.onProgress,cancelSignal:i});case 6:return l=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:l});case 8: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.A.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.A.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]}}}}}},3233: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,{A:function(){return r}})},3598:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(1858),i=n(1688);function a(e,t){if(t){if((0,i.A)(e,1718909296)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.A)(e,1836019574)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.A)(e,1836019558)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.A)(e,1835295092)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `mdat` box")}}},1688:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(5553);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.mq)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.CQ)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.mq)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},1856:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(2038),i=n(4389),a=n(7004);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n,a){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.Ay)({url:t,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:a});case"text":return(0,i.Ay)({url:t,responseType:"text",timeout:n.timeout,cancelSignal:a});case"document":return(0,i.Ay)({url:t,responseType:"document",timeout:n.timeout,cancelSignal:a});default:(0,r.A)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r,i){return new Promise((function(o,s){var u=Date.now()-performance.now(),l=!1,d=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled()){l=!0,i.deregister(c);var o=e,u=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.A(u,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(r=null==o?void 0:o.isOfflineError)&&void 0!==r&&r,null==o?void 0:o.xhr);s(d)}},resolve:function(e){if(!l&&!i.isCancelled()){l=!0,i.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-u:void 0,n=void 0!==e.sendingTime?e.sendingTime-u:void 0;o({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){l||i.isCancelled()||(l=!0,i.deregister(c),t(n,r,i).then(o,s))}},{timeout:r.timeout});function c(e){l||(l=!0,"function"==typeof d&&d(),s(e))}i.register(c)}))}}(n,o)}},987:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;if(e===t)return!0;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{A:function(){return r}})},1729: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,{A:function(){return r}})},3786: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,{A:function(){return r}})},4031: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,{A:function(){return r}})},7994:function(e,t,n){"use strict";n.d(t,{A:function(){return a},h:function(){return i}});var r=n(6787);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.A)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},2038:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(7387),i=function(e){function t(n){var r;return r=e.call(this,n)||this,Object.setPrototypeOf(r,t.prototype),r.name="AssertionError",r}return(0,r.A)(t,e),t}((0,n(8593).A)(Error));function a(e){throw new i("Unreachable path taken")}},603:function(e,t,n){"use strict";n.d(t,{K:function(){return u},i:function(){return s}});var r=n(9477),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.A.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),d=0,c=0;d<u;d+=4,c+=3)a=o(n.charCodeAt(d))<<18|o(n.charCodeAt(d+1))<<12|o(n.charCodeAt(d+2))<<6|o(n.charCodeAt(d+3)),l[c]=a>>16,l[c+1]=a>>8&255,l[c+2]=255&a;return l.subarray(0,l.length-s)}},5553: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 d(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 c(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 v(e){return new Uint8Array([255&e,e>>>8&255])}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}n.d(t,{AT:function(){return c},CQ:function(){return s},KS:function(){return l},Kk:function(){return d},UU:function(){return i},WO:function(){return v},Wz:function(){return p},eR:function(){return f},mq:function(){return o},tb:function(){return a},ww:function(){return u},xW:function(){return r}})},2432:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(4339);function i(e,t){return(0,r.A)(t,(function(t){var n=setTimeout((function(){return t()}),e);return function(){return clearTimeout(n)}}))}},4339:function(e,t,n){"use strict";function r(e,t){var n;return new Promise((function(r,i){if(null!==e.cancellationError)return i(e.cancellationError);var a=!1;function o(e){void 0!==n&&n(),i(e)}n=t((function(t){e.deregister(o),a=!0,r(t)}),(function(t){e.deregister(o),a=!0,i(t)})),a||e.register(o)}))}n.d(t,{A:function(){return r}})},79:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787),a=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,i.A)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,i.A)(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){r.A.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}()},3262: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,{A:function(){return r}})},7021:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=.3;function i(e){return e*((2*Math.random()-1)*r+1)}},8795: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,{A:function(){return r}})},2384:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{A:function(){return r}})},6787:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{A:function(){return r}})},8202:function(e,t,n){"use strict";var r=n(4971);t.Ay=r.Ay},4971:function(e,t,n){"use strict";n.d(t,{Ay:function(){return d},BU:function(){return l},E4:function(){return u}});var r=n(2384),i=n(6787),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.A)(e)||""===e)return"und";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.A)(t)?t:e}function u(e){if(!(0,i.A)(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.A)(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 d=s},8060:function(e,t,n){"use strict";function r(){}n.d(t,{A:function(){return r}})},8935:function(e,t){"use strict";t.A="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}},4324:function(e,t,n){"use strict";t.A="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},3650:function(e,t,n){"use strict";n.d(t,{C$:function(){return y},D3:function(){return m},Hh:function(){return s},Nn:function(){return c},OT:function(){return p},Td:function(){return v},UL:function(){return h},aW:function(){return _},bo:function(){return b},eO:function(){return f},gV:function(){return u},vK:function(){return g}});var r=1/60;function i(e,t){return Math.abs(e-t)<r}function a(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function o(e,t){return e.end<=t.start}function s(e,t){for(var n=0;n<e.length;n++)if(u(e[n],t))return!0;return!1}function u(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function l(e,t){return u(e,t.start)||e.start<t.end&&t.end<e.end||u(t,e.start)}function d(e,t){return i(t.start,e.end)||i(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 f(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 v(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 h(e,t){var n=f(e,t);return null!==n?n.end-n.start:0}function m(e,t){var n=f(e,t);return null!==n?t-n.start:0}function g(e,t){var n=f(e,t);return null!==n?n.end-t:1/0}function y(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var i=e[r],s=l(n,i),u=d(n,i);if(s||u)n=a(n,i),e.splice(r--,1);else if(0===r){if(o(n,e[0]))break}else if(o(e[r-1],n)&&o(n,i))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(d(n,r)){var i=a(n,r);e.splice(--t,2,i)}}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 A(e,t){for(var n=[],r=0;r<t.length;r++)l(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=A(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=A(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,d=0;d<a.length;d++)a[d].start>l&&n.push({start:l,end:a[d].start}),l=a[d].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},8315:function(e,t,n){"use strict";n.d(t,{D:function(){return u}});var r=n(3786),i=n(8060);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){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var s=function(){function e(e,t){var n=this;this._value=e,this._listeners=[],this._isFinished=!1,this._onFinishCbs=[],void 0!==t&&(this._deregisterCancellation=t.register((function(){return n.finish()})))}var t=e.prototype;return t.getValue=function(){return this._value},t.setValue=function(e){if(!this._isFinished&&(this._value=e,0!==this._listeners.length))for(var t,n=a(this._listeners.slice());!(t=n()).done;){var r=t.value;try{r.hasBeenCleared||r.trigger(e,r.complete)}catch(e){}}},t.setValueIfChanged=function(e){e!==this._value&&this.setValue(e)},t.onUpdate=function(e,t){var n=this,r=function e(){if(void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.deregister(e),!i.hasBeenCleared){i.hasBeenCleared=!0;var r=n._listeners.indexOf(i);r>=0&&n._listeners.splice(r,1)}},i={trigger:e,complete:r,hasBeenCleared:!1};this._listeners.push(i),!0===(null==t?void 0:t.emitCurrentValue)&&e(this._value,r),this._isFinished||i.hasBeenCleared?r():void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.register(r)},t.waitUntilDefined=function(e,t){var n=this;this.onUpdate((function(t,r){void 0!==t&&(r(),e(n._value))}),{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:!0})},t._onFinished=function(e,t){var n=this;if(t.isCancelled())return i.A;var a=function(){var e=(0,r.A)(n._onFinishCbs,(function(e){return e.trigger===o}));e>=0&&(n._onFinishCbs[e].hasBeenCleared=!0,n._onFinishCbs.splice(e,1))},o=function(){a(),e()},s=t.register(a);return this._onFinishCbs.push({trigger:o,hasBeenCleared:!1}),s},t.finish=function(){void 0!==this._deregisterCancellation&&this._deregisterCancellation(),this._isFinished=!0;for(var e,t=a(this._listeners.slice());!(e=t()).done;){var n=e.value;try{n.hasBeenCleared||(n.complete(),n.hasBeenCleared=!0)}catch(e){}}if(this._listeners.length=0,this._onFinishCbs.length>0){for(var r,i=a(this._onFinishCbs.slice());!(r=i()).done;){var o=r.value;try{o.hasBeenCleared||(o.trigger(),o.hasBeenCleared=!0)}catch(e){}}this._onFinishCbs.length=0}},e}();function u(e,t,n){var r=new s(t(e.getValue()),n);return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),e._onFinished((function(){r.finish()}),n),r}t.A=s},4389:function(e,t,n){"use strict";n.d(t,{Ay:function(){return o}});var r=n(3506),i=n(2384),a=n(6787);var o=function(e){var t={url:e.url,headers:e.headers,responseType:(0,a.A)(e.responseType)?"json":e.responseType,timeout:e.timeout};return new Promise((function(n,o){var s,u=e.onProgress,l=e.cancelSignal,d=t.url,c=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",d,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){A(),o(new r.A(d,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.A)(c)){var h=c;for(var m in h)h.hasOwnProperty(m)&&p.setRequestHeader(m,h[m])}var g=performance.now(),y=null;function A(){void 0!==s&&clearTimeout(s),null!==y&&y()}void 0!==l&&(y=l.register((function(e){A(),(0,a.A)(p)||4===p.readyState||p.abort(),o(e)})),l.isCancelled())||(p.onerror=function(){A(),o(new r.A(d,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){A(),o(new r.A(d,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:d,duration:t-g,sendingTime:g,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(A(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,l=p.status,c=p.responseType,f=(0,i.A)(p.responseURL)?p.responseURL:d;if(t="json"===c?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,a.A)(t))return void o(new r.A(d,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:c,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.A(d,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},2716:function(e,t,n){"use strict";n.d(t,{Cl:function(){return o}});var r=n(9828),i=/^(?:[a-z]+:)?\/\//i,a=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;function o(e){var t=e.lastIndexOf("/");if(t<0)return e.length;if(i.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e.length}var r=e.indexOf("?");return r>=0&&r<t?o(e.substring(0,r)):t+1}var s=new Map,u=200;function l(e){var t,n,r,i,o;if(s.has(e))return s.get(e);var l,d=e.match(a);return l=null===d?{scheme:"",authority:"",path:"",query:"",fragment:""}:{scheme:null!==(t=d[1])&&void 0!==t?t:"",authority:null!==(n=d[2])&&void 0!==n?n:"",path:null!==(r=d[3])&&void 0!==r?r:"",query:null!==(i=d[4])&&void 0!==i?i:"",fragment:null!==(o=d[5])&&void 0!==o?o:""},s.size>=u&&s.clear(),s.set(e,l),l}function d(e){var t="";return e.scheme&&(t+=e.scheme+":"),e.authority&&(t+="//"+e.authority),t+=e.path,e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function c(e){for(var t=e.split(/(?=\/)/),n=[],r=0;r<t.length;r++){var i=t[r];".."!==i&&"."!==i&&""!==i&&("/.."!==i?"/."!==i?n.push(i):r===t.length-1&&n.push("/"):(n.pop(),r===t.length-1&&n.push("/")))}return n.join("")}t.Ay=function e(){for(var t,n,i,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var u=o.filter((function(e){return""!==e})),f=u.length;if(0===f)return"";if(1===f)return null!==(t=u[0])&&void 0!==t?t:"";var v=function(e,t){var n=l(e),i=l(t);if(i.scheme)return d(i);var a={scheme:n.scheme,authority:n.authority,path:"",query:i.query,fragment:i.fragment};return i.authority?(a.authority=i.authority,a.path=c(i.path),d(a)):(""===i.path?(a.path=n.path,i.query||(a.query=n.query)):(0,r.A)(i.path,"/")?a.path=c(i.path):a.path=c(function(e,t){if(e.authority&&""===e.path)return"/"+t;var n=e.path;return n.substring(0,n.lastIndexOf("/")+1)+t}(n,i.path)),d(a))}(null!==(n=u[0])&&void 0!==n?n:"",null!==(i=u[1])&&void 0!==i?i:""),p=u.slice(2);return e.apply(void 0,[v].concat(p))}},8801:function(e,t,n){"use strict";function r(e){return new Promise((function(t){setTimeout(t,e)}))}n.d(t,{A:function(){return r}})},7296:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(1729),i=n(4031),a=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.toArray=function(){return this._array.slice()},t.findFirst=function(e){return(0,r.A)(this._array,e)},t.has=function(e){return(0,i.A)(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}()},9828: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,{A:function(){return r}})},4670:function(e,t,n){"use strict";n.d(t,{Es:function(){return c},KZ:function(){return p},My:function(){return v},Yg:function(){return u},Yn:function(){return h},aT:function(){return f},eb:function(){return l},kY:function(){return s}});var r=n(9477),i=n(7994),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){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var d=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(d),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var c=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(c),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function d(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function c(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=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}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+d(l,4):"%"+d(l,2)}}return decodeURIComponent(i)}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 v(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 p(e){(0,i.h)(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],d=new Uint8Array(16);return d[0]=a,d[1]=r,d[2]=n,d[3]=t,d[4]=s,d[5]=o,d[6]=l,d[7]=u,d.set(e.subarray(8,16),8),d}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:c(e.subarray(t,n))}}},2507:function(e,t,n){"use strict";n.d(t,{AK:function(){return l},AL:function(){return d},Ay:function(){return u}});var r=n(7387),i=n(8593),a=n(9477),o=n(7994),s=n(8060),u=function(){function e(){var e,t=(e=s.A,[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)}var t=e.prototype;return t.isUsed=function(){return this._isUsed},t.linkToSignal=function(e){var t=this,n=e.register((function(){t.cancel()}));return this.signal.register(n),n},t.cancel=function(e){if(!this._isUsed){this._isUsed=!0;var t=null!=e?e:new d;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof d},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;)try{var n=t._listeners.pop();null==n||n(e)}catch(e){a.A.error("Error while calling clean up listener",e instanceof Error?e.toString():"Unknown error")}}))}var t=e.prototype;return t.isCancelled=function(){return this._isCancelled},t.register=function(e){var t=this;return this._isCancelled?((0,o.h)(null!==this.cancellationError),e(this.cancellationError),s.A):(this._listeners.push(e),function(){return t.deregister(e)})},t.deregister=function(e){for(var t=this._listeners.length-1;t>=0;t--)this._listeners[t]===e&&this._listeners.splice(t,1)},e}(),d=function(e){function t(){var n;return n=e.call(this,"This task was cancelled.")||this,Object.setPrototypeOf(n,t.prototype),n.name="CancellationError",n}return(0,r.A)(t,e),t}((0,i.A)(Error))},5950:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(4031),i=[];function a(e){(0,r.A)(i,e)||(console.warn(e),i.push(e))}},6826: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}()},4633:function(e,t,n){var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof _?t:_,a=Object.create(i.prototype),o=new D(r||[]);return s(a,"_invoke",{value:R(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=v;var h="suspendedStart",m="suspendedYield",g="executing",y="completed",A={};function _(){}function b(){}function S(){}var E={};f(E,l,(function(){return this}));var T=Object.getPrototypeOf,w=T&&T(T(N([])));w&&w!==a&&o.call(w,l)&&(E=w);var k=S.prototype=_.prototype=Object.create(E);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,a,s,u){var l=p(e[i],e,a);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==r(c)&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(c).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value: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 R(e,n,r){var i=h;return function(a,o){if(i===g)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=C(s,r);if(u){if(u===A)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=g;var l=p(e,n,r);if("normal"===l.type){if(i=r.done?y:m,l.arg===A)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),A;var a=p(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,A;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,A):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function M(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 P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=S,s(k,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:b,configurable:!0}),b.displayName=f(S,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,f(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},I(x.prototype),f(x.prototype,d,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new x(v(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},I(k),f(k,c,"Generator"),f(k,l,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=N,D.prototype={constructor:D,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(P),!e)for(var n in this)"t"===n.charAt(0)&&o.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 r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,A):this.complete(a)},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),A},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),P(n),A}},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;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),A}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:function(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},467: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,{A:function(){return i}})},2212:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function a(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,i(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{A:function(){return o}})},7387:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(3662);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}},3662:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:function(){return r}})},8593:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:function(){return o}});var i=n(3662);function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;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,n)}function n(){return function(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&(0,i.A)(o,n.prototype),o}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.A)(n,e)},o(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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return _e}});var e=n(2212),t=n(7387),i=n(5121);function a(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function o(){if(s()){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 s(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var u=n(443),l=n(9477);function d(){if(!u.gm)return!0;var e=function(){if(!u.gm)return l.A.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 c=n(5151),f=n(874),v=n(5575),p=n(5497),h=n(6787),m=n(8589);var g=n(418),y=n(987),A=n(4031),_=n(7994),b=n(79),S=n(8795),E=n(8935),T=n(3650),w=n(8315),k=n(2507),I=n(5950),x=n(467),R=n(4756),C=n.n(R),M=n(8801),P=n(7365);function D(e){return N.apply(this,arguments)}function N(){return(N=(0,x.A)(C().mark((function e(t){var n,r;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=P.A.getState(t))){e.next=3;break}return e.abrupt("return",void 0);case 3:return l.A.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,P.A.clearState(t),e.next=8,r.closeAllSessions();case 8:return e.abrupt("return",Promise.race([n.emeImplementation.setMediaKeys(t,null).catch((function(e){l.A.error("DRM: Could not reset MediaKeys",e instanceof Error?e:"Unknown Error")})),(0,M.A)(1e3)]));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(5283);function L(e){if(l.A.info("DRM: Clearing-up DRM session."),u.lw)return l.A.info("DRM: disposing current MediaKeys."),D(e);var t=P.A.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(l.A.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(l.A.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var U=n(4971);function B(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){if("string"==typeof e)return F(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}(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 F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V=n(8060),z=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],K=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new k.Ay,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getPlaybackRate=function(){return this._mediaElement.playbackRate},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeeksIncoming.push(e),l.A.info("API: Seeking internally",e),this._mediaElement.currentTime=e},t.setPlaybackRate=function(e){this._mediaElement.playbackRate=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed()||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled()))return V.A;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return H(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=c.A.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r,i=n;"seeking"===i&&t._internalSeeksIncoming.length>0&&(i="internal-seeking",r=t._internalSeeksIncoming.shift());var a=null!=e?e:t._generateInitialObservation(),o=G(t._mediaElement,i,t._withMediaSource),s=null;o.seeking&&("number"==typeof r?s=r:null!==a.pendingInternalSeek&&"seeking"!==n&&(s=a.pendingInternalSeek));var u=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=c.A.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,d=t.bufferGap,f=t.currentRange,v=t.duration,p=t.paused,h=t.readyState,m=t.ended,g=e.rebuffering,y=e.event,A=e.position,_=function(e,t,n,r,i){var a=c.A.getCurrent().REBUFFERING_GAP,o=i?"LOW_LATENCY":"DEFAULT";if(void 0===t)return n&&Math.abs(r-e)<=a[o];return null!==t&&r-t.end<=a[o]}(l,f,m,v,o),b=h>=1&&"loadedmetadata"!==u&&null===g&&!(_||m),S=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)d===1/0?(r=!0,S=l):void 0===d?h<3&&(r=!0,S=void 0):d<=E&&(r=!0,S=l+d);else if(null!==g){var T=W(g,o);!0!==r&&null!==g&&h>1&&(_||m||void 0!==d&&isFinite(d)&&d>T)||void 0===d&&h>=3?i=!0:void 0===d?S=void 0:d===1/0?S=l:d<=T&&(S=l+d)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===y&&l===A||"seeking"===u&&(d===1/0||void 0===d&&h<3))?r=!0:null!==g&&("seeking"!==u&&l!==A||"canplay"===u||void 0===d&&h>=3||void 0!==d&&d<1/0&&(d>W(g,o)||_||m))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==g)return w="seeking"===u||null!==g&&"seeking"===g.reason||t.seeking?"seeking":1===h?"not-ready":"buffering",null!==g&&g.reason===w?{reason:g.reason,timestamp:g.timestamp,position:S}:{reason:w,timestamp:performance.now(),position:S};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),d=function(e,t){var n=c.A.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&&void 0!==t.bufferGap&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(a,o),f=(0,E.A)({},{rebuffering:u,freezing:d,pendingInternalSeek:s},o);return l.A.hasLevel("DEBUG")&&l.A.debug("API: current media element state tick","event",f.event,"position",f.position,"seeking",f.seeking,"internalSeek",f.pendingInternalSeek,"rebuffering",null!==f.rebuffering,"freezing",null!==f.freezing,"ended",f.ended,"paused",f.paused,"playbackRate",f.playbackRate,"readyState",f.readyState),f},s=new w.A(o("init"),this._canceller.signal),u=function(t){var n=o(t);l.A.hasLevel("DEBUG")&&l.A.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 d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i<e.length-1){var c=e.start(i+1),f=" ~"+(c-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<c){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},d=this._lowLatencyMode?i:this._withMediaSource?r:a,f=setInterval(p,d),v=z.map((function(e){function n(){clearInterval(f),f=setInterval(p,d),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(f),v.forEach((function(e){return e()})),s.finish()})),s;function p(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,E.A)(G(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function W(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=c.A.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 G(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,d=e.playbackRate,c=e.readyState,f=e.seeking;return!n&&0===a.length&&c>=3?(r=void 0,i=void 0):i=null!==(r=(0,T.eO)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:d,readyState:c,seeking:f,event:t}}function H(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getPlaybackRate:function(){return e.getPlaybackRate()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled()||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled())||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return H(this,e,n)}}}var q=n(1729),j=n(8202),Y=n(7296);function Q(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,j.Ay)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function $(e){return e.map((function(e){return null===e?e:{normalized:(0,j.Ay)(e.language),forced:e.forced,closedCaption:e.closedCaption}}))}var X=function(){function e(e){this._periods=new Y.A((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=ie(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void l.A.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptationRef:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptationRef: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)):l.A.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else l.A.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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(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.adaptationRef.setValue(null);else if(void 0!==i&&(0,A.A)(r,i))n.adaptationRef.setValue(i);else{var a=J(r,Q(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(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.adaptationRef.setValue(null);else if(void 0!==i&&(0,A.A)(r,i))n.adaptationRef.setValue(i);else{var a=te(r,$(this._preferredTextTracks),this._audioChoiceMemory.get(e));this._textChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.A)(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,A.A)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=re(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptationRef.setValue(null);var o=ae(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptationRef.setValue(o)},t.setAudioTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.audio:null;if((0,h.A)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,q.A)(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.adaptationRef.setValue(i))},t.setTextTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.text:null;if((0,h.A)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,q.A)(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.adaptationRef.setValue(i))},t.setVideoTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.A)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,q.A)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ae(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptationRef.setValue(a)},t.disableTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptationRef.setValue(null))},t.disableVideoTrack=function(e){var t=ie(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.adaptationRef.setValue(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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(n))return null;var r=this._audioChoiceMemory.get(e);return(0,h.A)(r)?null:r.toAudioTrack()},t.getChosenTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))return null;var r=this._textChoiceMemory.get(e);return(0,h.A)(r)?null:r.toTextTrack()},t.getChosenVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.A)(n))return null;var r=this._videoChoiceMemory.get(e);return(0,h.A)(r)?null:r.adaptation.toVideoTrack()},t.getAvailableAudioTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,h.A)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.A)(e.toAudioTrack(),{active:t})}))},t.getAvailableTextTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,h.A)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.A)(e.toTextTrack(),{active:t})}))},t.getAvailableVideoTracks=function(e){var t,n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.A)(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=null!==a&&a===e.id,n=e.toVideoTrack(),r=void 0!==n.trickModeTracks?n.trickModeTracks.map((function(e){var t=null!==a&&a===e.id;return(0,E.A)(e,{active:t})})):[],i=(0,E.A)(n,{active:t});return void 0!==r&&(i.trickModeTracks=r),i}))},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=Q(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.A)(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,A.A)(s,u))n(r+1);else{var l=J(s,t);e._audioChoiceMemory.set(a,l),o.adaptationRef.setValue(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=$(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.A)(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,A.A)(s,u))n(r+1);else{var l=te(s,t,e._audioChoiceMemory.get(a));e._textChoiceMemory.set(a,l),o.adaptationRef.setValue(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,h.A)(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,A.A)(s,u.baseAdaptation)){var l=ae(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptationRef.setValue(l),n(0))}var d=re(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptationRef.setValue(null),n(0);var c=ae(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptationRef.setValue(c),n(0)}n(r+1)}}}(0)},e}();function Z(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 J(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=Z(r),a=(0,q.A)(e,i);if(void 0!==a)return a}return e[0]}function ee(e){return function(t){var n;return(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)&&(!0===e.forced?!0===t.isForcedSubtitles:!0!==t.isForcedSubtitles)}}function te(e,t,n){var r;if(0===e.length)return null;for(var i=0;i<t.length;i++){var a=t[i];if(null===a)return null;var o=ee(a),s=(0,q.A)(e,o);if(void 0!==s)return s}var u=e.filter((function(e){return!0===e.isForcedSubtitles}));if(u.length>0){if(null!=n){var l=(0,q.A)(u,(function(e){return e.normalizedLanguage===n.normalizedLanguage}));if(void 0!==l)return l}return null!==(r=(0,q.A)(u,(function(e){return void 0===e.normalizedLanguage})))&&void 0!==r?r:null}return null}function ne(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 re(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=ne(r),a=(0,q.A)(e,i);if(void 0!==a)return a}return e[0]}function ie(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ae(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}function oe(e,t){var n=c.A.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return"ENDED";if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?"ENDED":"seeking"===t?"SEEKING":"BUFFERING"}return e.paused?"PAUSED":"PLAYING"}function se(e){return"LOADING"!==e&&"RELOADING"!==e&&"STOPPED"!==e}function ue(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){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}(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 le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var de=(0,S.A)(),ce=i.Sb,fe=i.o8,ve=i.ng,pe=i.Vb,he=i.rR,me=i.Ah,ge=i.c_,ye=function(n){function r(e){var t,i,a;void 0===e&&(e={}),t=n.call(this)||this;var o=function(e){var t,n,r,i,a,o,s,u,l,d,f,v,p,m,g,y,A=c.A.getCurrent(),_=A.DEFAULT_INITIAL_BITRATES,b=A.DEFAULT_LIMIT_VIDEO_WIDTH,S=A.DEFAULT_MIN_BITRATES,E=A.DEFAULT_MAX_BITRATES,T=A.DEFAULT_MAX_BUFFER_AHEAD,w=A.DEFAULT_MAX_BUFFER_BEHIND,k=A.DEFAULT_MAX_VIDEO_BUFFER_SIZE,x=A.DEFAULT_STOP_AT_END,R=A.DEFAULT_THROTTLE_WHEN_HIDDEN,C=A.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,M=A.DEFAULT_WANTED_BUFFER_AHEAD;if((0,h.A)(e.maxBufferAhead))t=T;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,h.A)(e.maxBufferBehind))n=w;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,h.A)(e.wantedBufferAhead))r=M;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,h.A)(e.maxVideoBufferSize))i=k;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var P=(0,h.A)(e.limitVideoWidth)?b:!!e.limitVideoWidth;if((0,h.A)(e.throttleWhenHidden)?a=R:((0,I.A)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,h.A)(e.throttleVideoBitrateWhenHidden)?C:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,I.A)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,I.A)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,I.A)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,h.A)(e.videoElement))d=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");d=e.videoElement}if((0,h.A)(e.initialVideoBitrate))f=_.video;else if(f=Number(e.initialVideoBitrate),isNaN(f))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,h.A)(e.initialAudioBitrate))v=_.audio;else if(v=Number(e.initialAudioBitrate),isNaN(v))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,h.A)(e.minVideoBitrate))m=S.video;else if(m=Number(e.minVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,h.A)(e.minAudioBitrate))p=S.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,h.A)(e.maxVideoBitrate))y=E.video;else{if(y=Number(e.maxVideoBitrate),isNaN(y))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(m>y)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+y+'", is inferior to the set minVideoBitrate, "'+m+'"')}if((0,h.A)(e.maxAudioBitrate))g=E.audio;else{if(g=Number(e.maxAudioBitrate),isNaN(g))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>g)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+g+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:P,videoElement:d,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:v,initialVideoBitrate:f,minAudioBitrate:p,minVideoBitrate:m,maxAudioBitrate:g,maxVideoBitrate:y,stopAtEnd:(0,h.A)(e.stopAtEnd)?x:!!e.stopAtEnd}}(e),s=o.initialAudioBitrate,u=o.initialVideoBitrate,d=o.limitVideoWidth,f=o.minAudioBitrate,v=o.minVideoBitrate,p=o.maxAudioBitrate,m=o.maxBufferAhead,g=o.maxBufferBehind,y=o.maxVideoBitrate,A=o.preferredAudioTracks,_=o.preferredTextTracks,b=o.preferredVideoTracks,S=o.throttleWhenHidden,E=o.throttleVideoBitrateWhenHidden,T=o.videoElement,x=o.wantedBufferAhead,R=o.maxVideoBufferSize,C=o.stopAtEnd,M=c.A.getCurrent().DEFAULT_UNMUTED_VOLUME;T.preload="auto",t.version="3.33.4-dev.2024083000",t.log=l.A,t.state="STOPPED",t.videoElement=T,r._priv_registerVideoElement(t.videoElement);var P=new k.Ay;t._destroyCanceller=P,t._priv_pictureInPictureRef=fe(T,P.signal),he(T,(function(){t.trigger("fullscreenChange",t.isFullscreen())}),P.signal);for(var D=[],N=0;N<(null===(i=T.textTracks)||void 0===i?void 0:i.length);N++){var O=null===(a=T.textTracks)||void 0===a?void 0:a[N];(0,h.A)(O)||D.push(O)}var L=function(e){for(var n=e.target,r=[],i=0;i<n.length;i++){var a=n[i];r.push(a)}var o=D;if(D=r,o.length===r.length){for(var s=0;s<o.length;s++)if(o[s]!==r[s])return void t._priv_onNativeTextTracksNext(r)}else t._priv_onNativeTextTracksNext(r)};return(0,h.A)(T.textTracks)||(me(T.textTracks,L,P.signal),ge(T.textTracks,L,P.signal)),t._priv_speed=new w.A(T.playbackRate,t._destroyCanceller.signal),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=new w.A(!1,t._destroyCanceller.signal),t._priv_bufferOptions={wantedBufferAhead:new w.A(x,t._destroyCanceller.signal),maxBufferAhead:new w.A(m,t._destroyCanceller.signal),maxBufferBehind:new w.A(g,t._destroyCanceller.signal),maxVideoBufferSize:new w.A(R,t._destroyCanceller.signal)},t._priv_bitrateInfos={lastBitrates:{audio:s,video:u},minAutoBitrates:{audio:new w.A(f,t._destroyCanceller.signal),video:new w.A(v,t._destroyCanceller.signal)},maxAutoBitrates:{audio:new w.A(p,t._destroyCanceller.signal),video:new w.A(y,t._destroyCanceller.signal)},manualBitrates:{audio:new w.A(-1,t._destroyCanceller.signal),video:new w.A(-1,t._destroyCanceller.signal)}},t._priv_throttleWhenHidden=S,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=M,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=C,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=A,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t._priv_lastAutoPlay=!1,t}(0,t.A)(r,n),r.addFeatures=function(e){!function(e){for(var t=0;t<e.length;t++){var n=e[t];if("function"==typeof n)n(m.A);else{if((0,h.A)(n)||"function"!=typeof n._addFeature)throw new Error("Unrecognized feature");n._addFeature(m.A)}}}(e)},r._priv_registerVideoElement=function(e){if(r._priv_currentlyUsedVideoElements.has(e)){console.warn("The video element is already attached to another RxPlayer instance.\nMake sure to dispose the previous instance with player.dispose() before creating a new player instance attaching that video element.")}r._priv_currentlyUsedVideoElements.add(e)},r._priv_deregisterVideoElement=function(e){r._priv_currentlyUsedVideoElements.has(e)&&r._priv_currentlyUsedVideoElements.delete(e)};var i=r.prototype;return i.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},i.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},i.dispose=function(){this.stop(),null!==this.videoElement&&(r._priv_deregisterVideoElement(this.videoElement),D(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.A.error("API: Could not dispose decryption resources: "+t)}))),this._destroyCanceller.cancel(),this._priv_reloadingMetadata={},this.videoElement=null},i.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,d,f,v,p,m,g,y,_=c.A.getCurrent(),b=_.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,S=_.DEFAULT_AUTO_PLAY,T=_.DEFAULT_CODEC_SWITCHING_BEHAVIOR,w=_.DEFAULT_ENABLE_FAST_SWITCHING,k=_.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,x=_.DEFAULT_SHOW_NATIVE_SUBTITLE,R=_.DEFAULT_TEXT_TRACK_MODE;if((0,h.A)(e))throw new Error("No option set on loadVideo");if((0,h.A)(e.url)){if((0,h.A)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,h.A)(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 f=String(e.url);if((0,h.A)(e.transport))throw new Error("No transport set on loadVideo");v=String(e.transport),(0,h.A)(null===(r=e.transportOptions)||void 0===r?void 0:r.aggressiveMode)||(0,I.A)("`transportOptions.aggressiveMode` is deprecated and won't be present in the next major version. Please open an issue if you still need this.");var C=(0,h.A)(e.autoPlay)?S:!!e.autoPlay;if((0,h.A)(e.keySystems))p=[];else for(var M,P=B(p=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(M=P()).done;){var D=M.value;if("string"!=typeof D.type||"function"!=typeof D.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback");(0,h.A)(D.onKeyStatusesChange)||(0,I.A)("`keySystems[].onKeyStatusesChange` is deprecated and won't be present in the next major version. Please open an issue if you still need this."),(0,h.A)(D.throwOnLicenseExpiration)||(0,I.A)("`keySystems[].throwOnLicenseExpiration` is deprecated and won't be present in the next major version. Please open an issue if you still need this.")}var N=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,O="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},L=null===(i=e.transportOptions)||void 0===i?void 0:i.initialManifest,F=null!==(o=null===(a=e.transportOptions)||void 0===a?void 0:a.minimumManifestUpdateInterval)&&void 0!==o?o:0,V=(0,h.A)(e.audioTrackSwitchingMode)?b:e.audioTrackSwitchingMode;(0,A.A)(["seamless","direct","reload"],V)||(l.A.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+b+" strategy will be used as default"),V=b);var z=(0,h.A)(e.onCodecSwitch)?T:e.onCodecSwitch;(0,A.A)(["continue","reload"],z)||(l.A.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+T+" will be used as default"),z=T);var K=(0,E.A)({},O,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:N});if(delete K.initialManifest,delete K.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,I.A)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var W,G=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],H=B(G);!(W=H()).done;){var q=W.value;if("string"!=typeof q.language||"string"!=typeof q.mimeType||"string"!=typeof q.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}K.supplementaryTextTracks=G}if(void 0!==e.supplementaryImageTracks){(0,I.A)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var j,Y=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],Q=B(Y);!(j=Q()).done;){var $=j.value;if("string"!=typeof $.mimeType||"string"!=typeof $.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}K.supplementaryImageTracks=Y}if((0,h.A)(null===(s=e.transportOptions)||void 0===s?void 0:s.manifestUpdateUrl)||(0,I.A)("`manifestUpdateUrl` API is deprecated, please open an issue if you still rely on this."),(0,h.A)(e.textTrackMode))m=R;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");m=e.textTrackMode}(0,h.A)(e.defaultAudioTrack)||(0,I.A)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var X=(0,U.BU)(e.defaultAudioTrack);(0,h.A)(e.defaultTextTrack)||(0,I.A)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var Z=(0,U.E4)(e.defaultTextTrack),J=!x;(0,h.A)(e.hideNativeSubtitle)||((0,I.A)("The `hideNativeSubtitle` loadVideo option is deprecated"),J=!!e.hideNativeSubtitle);var ee=null!==(u=e.manualBitrateSwitchingMode)&&void 0!==u?u:k,te=(0,h.A)(e.enableFastSwitching)?w:e.enableFastSwitching;if("html"===m){if((0,h.A)(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.");g=e.textTrackElement}else(0,h.A)(e.textTrackElement)||l.A.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,h.A)(e.startAt))if("wallClockTime"in e.startAt&&e.startAt.wallClockTime instanceof Date){var ne=e.startAt.wallClockTime.getTime()/1e3;y=(0,E.A)({},e.startAt,{wallClockTime:ne})}else y=e.startAt;return{autoPlay:C,defaultAudioTrack:X,defaultTextTrack:Z,enableFastSwitching:te,hideNativeSubtitle:J,keySystems:p,initialManifest:L,lowLatencyMode:N,manualBitrateSwitchingMode:ee,audioTrackSwitchingMode:V,minimumManifestUpdateInterval:F,networkConfig:null!==(d=e.networkConfig)&&void 0!==d?d:{},onCodecSwitch:z,startAt:y,textTrackElement:g,textTrackMode:m,transport:v,transportOptions:K,url:f}}(e);l.A.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t),this._priv_lastAutoPlay=t.autoPlay},i.reload=function(e){var t,n,r,i,a,o,s=this._priv_reloadingMetadata,u=s.options,l=s.manifest,d=s.reloadPosition,c=s.reloadInPause;if(void 0===u)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.");if(!Array.isArray(null==e?void 0:e.keySystems)&&void 0!==(null==e?void 0:e.keySystems))throw new Error("API: reload - Invalid 'keySystems' option format.");if(void 0!==(null==e?void 0:e.autoPlay)&&"boolean"!=typeof e.autoPlay)throw new Error("API: reload - Invalid 'autoPlay' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))i={position:e.reloadAt.position};else if(void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.relative)){if(void 0===d)throw new Error("Can't reload to a relative position when previous content was not loaded.");i={position:e.reloadAt.relative+d}}else void 0!==d&&(i={position:d});void 0!==(null==e?void 0:e.autoPlay)?a=e.autoPlay:void 0!==c&&(a=!c),void 0!==(null==e?void 0:e.keySystems)?o=e.keySystems:void 0!==(null===(r=this._priv_reloadingMetadata.options)||void 0===r?void 0:r.keySystems)&&(o=this._priv_reloadingMetadata.options.keySystems);var f=Object.assign(Object.assign({},u),{initialManifest:l});void 0!==i&&(f.startAt=i),void 0!==a&&(f.autoPlay=a),void 0!==o&&(f.keySystems=o),this._priv_initializeContentPlayback(f)},i.createDebugElement=function(e){if(null===g.A.createDebugElement)throw new Error("Feature `DEBUG_ELEMENT` not added to the RxPlayer");var t=new k.Ay;return g.A.createDebugElement(e,this,t.signal),{dispose:function(){t.cancel()}}},i._priv_initializeContentPlayback=function(e){var t=this,n=e.autoPlay,r=e.audioTrackSwitchingMode,i=e.defaultAudioTrack,a=e.defaultTextTrack,o=e.enableFastSwitching,s=e.initialManifest,u=e.keySystems,c=e.lowLatencyMode,v=e.manualBitrateSwitchingMode,p=e.minimumManifestUpdateInterval,m=e.networkConfig,y=e.onCodecSwitch,_=e.startAt,b=e.transport,S=e.transportOptions,T=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var I,x="directfile"===b,R=new k.Ay,C=this.videoElement,M=null;if(x){if(null===g.A.directfile)throw this.stop(),this._priv_currentError=null,new Error("DirectFile feature not activated in your build.");if((0,h.A)(T))throw new Error("No URL for a DirectFile content");if(M=this._priv_initializeMediaElementTrackChoiceManager(i,a,R.signal),R.isUsed())return;I=new g.A.directfile.initDirectFile({autoPlay:n,keySystems:u,speed:this._priv_speed,startAt:_,url:T})}else{var P=g.A.transports[b];if("function"!=typeof P)throw this.stop(),this._priv_currentError=null,new Error('transport "'+b+'" not supported');if(null===g.A.mediaSourceInit)throw new Error("MediaSource streaming not supported");var D=P(S),N=m.offlineRetry,O=m.segmentRetry,L=m.manifestRetry,U=m.manifestRequestTimeout,B=m.segmentRequestTimeout,F={lowLatencyMode:c,maxRetryRegular:L,maxRetryOffline:N,requestTimeout:U,minimumManifestUpdateInterval:p,initialManifest:s},V=d(),z={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(V?z.throttle={video:(0,w.D)(ce(R.signal),(function(e){return e?1/0:0}),R.signal)}:l.A.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(V?z.throttleBitrate={video:(0,w.D)(ve(this._priv_pictureInPictureRef,R.signal),(function(e){return e?1/0:0}),R.signal)}:l.A.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(V?z.limitWidth={video:pe(C,this._priv_pictureInPictureRef,R.signal)}:l.A.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var W={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:c,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:z},G="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},H=(0,E.A)({audioTrackSwitchingMode:r,enableFastSwitching:o,manualBitrateSwitchingMode:v,onCodecSwitch:y},this._priv_bufferOptions),q={lowLatencyMode:c,maxRetryRegular:O,requestTimeout:B,maxRetryOffline:N};I=new g.A.mediaSourceInit({adaptiveOptions:W,autoPlay:n,bufferOptions:H,keySystems:u,lowLatencyMode:c,manifestRequestSettings:F,transport:D,segmentRequestOptions:q,speed:this._priv_speed,startAt:_,textTrackOptions:G,url:T})}var j={contentId:de(),originalUrl:T,currentContentCanceller:R,initializer:I,isDirectFile:x,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:i,initialTextTrack:a,trackChoiceManager:null,mediaElementTrackChoiceManager:M};I.addEventListener("error",(function(e){var n=(0,f.A)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});n.fatal=!0,j.currentContentCanceller.cancel(),t._priv_cleanUpCurrentContentState(),t._priv_currentError=n,l.A.error("API: The player stopped because of an error",e instanceof Error?e:""),t._priv_setPlayerState("STOPPED"),t._priv_currentError===n&&t.trigger("error",n)})),I.addEventListener("warning",(function(e){var n=(0,f.A)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});l.A.warn("API: Sending warning:",n),t.trigger("warning",n)})),I.addEventListener("reloadingMediaSource",(function(e){j.segmentBuffersStore=null,null!==j.trackChoiceManager&&j.trackChoiceManager.resetPeriods(),t._priv_lastAutoPlay=e.autoPlay})),I.addEventListener("inbandEvents",(function(e){return t.trigger("inbandEvents",e)})),I.addEventListener("streamEvent",(function(e){return t.trigger("streamEvent",e)})),I.addEventListener("streamEventSkip",(function(e){return t.trigger("streamEventSkip",e)})),I.addEventListener("decipherabilityUpdate",(function(e){return t.trigger("decipherabilityUpdate",e)})),I.addEventListener("activePeriodChanged",(function(e){return t._priv_onActivePeriodChanged(j,e)})),I.addEventListener("periodStreamReady",(function(e){return t._priv_onPeriodStreamReady(j,e)})),I.addEventListener("periodStreamCleared",(function(e){return t._priv_onPeriodStreamCleared(j,e)})),I.addEventListener("representationChange",(function(e){return t._priv_onRepresentationChange(j,e)})),I.addEventListener("adaptationChange",(function(e){return t._priv_onAdaptationChange(j,e)})),I.addEventListener("bitrateEstimationChange",(function(e){return t._priv_onBitrateEstimationChange(e)})),I.addEventListener("manifestReady",(function(e){return t._priv_onManifestReady(j,e)})),I.addEventListener("loaded",(function(e){j.segmentBuffersStore=e.segmentBuffersStore})),I.addEventListener("addedSegment",(function(e){var n=e.content,r=e.segmentData;if("image"===n.adaptation.type&&!(0,h.A)(r)&&"bif"===r.type){var i=r.data;j.thumbnails=i,t.trigger("imageTrackUpdate",{data:j.thumbnails})}})),I.prepare(),this.stop();var Y=new K(C,{withMediaSource:!x,lowLatencyMode:c});R.signal.register((function(){Y.stop()}));var Q=function(e,t,n,r){var i=new w.A("LOADING",r);e.addEventListener("loaded",(function(){if("LOADING"===i.getValue()){if(i.setValue("LOADED"),!r.isCancelled()){var e=oe(t,null);"PAUSED"!==e&&i.setValue(e)}}else i.setValueIfChanged(oe(t,null))}),r),e.addEventListener("reloadingMediaSource",(function(){se(i.getValue())&&i.setValueIfChanged("RELOADING")}),r);var a=null;return e.addEventListener("stalled",(function(e){e!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,e)),a=e)}),r),e.addEventListener("unstalled",(function(){null!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,null)),a=null)}),r),n.listen((function(e){se(i.getValue())&&(0,A.A)(["seeking","ended","play","pause"],e.event)&&i.setValueIfChanged(oe(t,a))}),{clearSignal:r}),i}(I,C,Y,R.signal);R.signal.register((function(){I.dispose()}));var $=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":t._priv_reloadingMetadata.reloadInPause=!0,t._priv_reloadingMetadata.reloadPosition=Y.getReference().getValue().position;break;default:var n=Y.getReference().getValue();t._priv_reloadingMetadata.reloadInPause=n.paused,t._priv_reloadingMetadata.reloadPosition=n.position}},X=null,Z=function(e){null!==X&&(X.cancel(),X=null),Q.onUpdate((function(n,r){var i,a,o,s;se(n)&&(r(),null!==X&&X.cancel(),(X=new k.Ay).linkToSignal(R.signal),e!==!C.paused&&(C.paused?t.trigger("pause",null):t.trigger("play",null)),i=C,a=function(){return t.trigger("play",null)},o=function(){return t.trigger("pause",null)},(s=R.signal).isCancelled()||null===i||(i.addEventListener("play",a),i.addEventListener("pause",o),s.register((function(){i.removeEventListener("play",a),i.removeEventListener("pause",o)}))))}),{emitCurrentValue:!1,clearSignal:R.signal})};Z(n),I.addEventListener("reloadingMediaSource",(function(e){Z(e.autoPlay)}));var J=null;Q.onUpdate((function(e){$(e),t._priv_setPlayerState(e),R.isUsed()||(null!==J?se(t.state)||(J.cancel(),J=null):se(t.state)&&((J=new k.Ay).linkToSignal(R.signal),function(e,t,n,r,i){if(!i.isCancelled()&&null!==e){var a=t.getReference().getValue().seeking;a&&(n(),i.isCancelled())||t.listen((function(e){"seeking"===e.event?(a=!0,n()):a&&"seeked"===e.event&&(a=!1,r())}),{includeLastObservation:!0,clearSignal:i})}}(C,Y,(function(){return t.trigger("seeking",null)}),(function(){return t.trigger("seeked",null)}),J.signal)),"ENDED"===t.state&&t._priv_stopAtEnd&&t.stop())}),{emitCurrentValue:!0,clearSignal:R.signal}),Y.listen((function(e){$(t.state),t._priv_triggerPositionUpdate(j,e)}),{clearSignal:R.signal}),this._priv_currentError=null,this._priv_contentInfos=j,R.signal.register((function(){I.removeEventListener()})),this._priv_contentLock.onUpdate((function(e,t){e||(t(),I.start(C,Y))}),{emitCurrentValue:!0,clearSignal:R.signal})},i.getError=function(){return this._priv_currentError},i.getManifest=function(){return(0,I.A)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},i.getCurrentAdaptations=function(){if((0,I.A)("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,h.A)(n[t.id])?null:n[t.id]},i.getCurrentRepresentations=function(){return(0,I.A)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},i.getVideoElement=function(){return this.videoElement},i.getNativeTextTrack=function(){if((0,I.A)("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},i.getPlayerState=function(){return this.state},i.isContentLoaded=function(){return!(0,A.A)(["LOADING","RELOADING","STOPPED"],this.state)},i.isBuffering=function(){return(0,A.A)(["BUFFERING","SEEKING","LOADING","RELOADING"],this.state)},i.isPaused=function(){return!this.videoElement||((0,A.A)(["LOADING","RELOADING"],this.state)?!this._priv_lastAutoPlay:this.videoElement.paused)},i.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},i.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},i.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.originalUrl;return t?r:null!==n?n.getUrl():void 0}},i.updateContentUrls=function(e,t){if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=!0===(null==t?void 0:t.refresh);this._priv_contentInfos.initializer.updateContentUrls(e,n)},i.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},i.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.vK)(e.buffered,e.currentTime)},i.getVideoLoadedTime=function(){if((0,I.A)("`getVideoLoadedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.UL)(e.buffered,e.currentTime)},i.getVideoPlayedTime=function(){if((0,I.A)("`getVideoPlayedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.D3)(e.buffered,e.currentTime)},i.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=a(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},i.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},i.getLastStoredContentPosition=function(){return this._priv_reloadingMetadata.reloadPosition},i.getPlaybackRate=function(){return this._priv_speed.getValue()},i.setPlaybackRate=function(e,t){var n;e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var r=null==t?void 0:t.preferTrickModeTracks;if("boolean"==typeof r){this._priv_preferTrickModeTracks=r;var i=null===(n=this._priv_contentInfos)||void 0===n?void 0:n.trackChoiceManager;(0,h.A)(i)||(r&&!i.isTrickModeEnabled()?i.enableVideoTrickModeTracks():!r&&i.isTrickModeEnabled()&&i.disableVideoTrickModeTracks())}},i.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,h.A)(r.video)?[]:r.video.getAvailableBitrates()},i.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,h.A)(r.audio)?[]:r.audio.getAvailableBitrates()},i.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},i.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},i.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.A)(e.video))return e.video.bitrate},i.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.A)(e.audio))return e.audio.bitrate},i.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},i.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},i.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},i.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},i.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,h.A)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new v.A("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},i.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},i.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,o=r.manifest;if(!i&&null===o)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var s=e,u=this.videoElement.currentTime;if((0,h.A)(s.relative))if((0,h.A)(s.position)){if((0,h.A)(s.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==o)n=s.wallClockTime-(null!==(t=o.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var d=a(this.videoElement);void 0!==d&&(n=s.wallClockTime-d)}void 0===n&&(n=s.wallClockTime)}else n=s.position;else n=u+s.relative}if(void 0===n)throw new Error("invalid time given");return l.A.info("API: API Seek to",n),this.videoElement.currentTime=n,n},i.isFullscreen=function(){return(0,I.A)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),s()},i.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,I.A)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!s()){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):o()},i.exitFullscreen=function(){(0,I.A)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),o()},i.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},i.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))},i.isMute=function(){return 0===this.getVolume()},i.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},i.unMute=function(){var e=c.A.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},i.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},i.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},i.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)},i.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)},i.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)},i.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)},i.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},i.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},i.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},i.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},i.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},i.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},i.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},i.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},i.getCurrentKeySystem=function(){if((0,I.A)("`getCurrentKeySystem` is deprecated.Please use the `getKeySystemConfiguration` method instead."),null===this.videoElement)throw new Error("Disposed player");return(0,O.c)(this.videoElement)},i.getKeySystemConfiguration=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=(0,O.A)(this.videoElement);return null===e?null:{keySystem:e[0],configuration:e[1]}},i.getAvailableAudioTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableAudioTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableAudioTracks(n)},i.getAvailableTextTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableTextTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableTextTracks(n)},i.getAvailableVideoTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableVideoTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableVideoTracks(n)},i.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenAudioTrack()}if(null!==r&&null!==t)return r.getChosenAudioTrack(t)}},i.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenTextTrack()}if(null!==r&&null!==t)return r.getChosenTextTrack(t)}},i.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenVideoTrack()}if(null!==r&&null!==t)return r.getChosenVideoTrack(t)}},i.setAudioTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setAudioTrackByID(n,e)}catch(e){throw new Error("player: unknown audio track")}},i.setTextTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setTextTrackByID(n,e)}catch(e){throw new Error("player: unknown text track")}},i.disableTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n)null==i||i.disableTextTrack();else if(null!==r&&null!==t)return r.disableTextTrack(t)}},i.setVideoTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setVideoTrackByID(n,e)}catch(e){throw new Error("player: unknown video track")}},i.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n&&null!==i)return i.disableVideoTrack();if(null!==r&&null!==t)return r.disableVideoTrack(t)}},i.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},i.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},i.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t):null==n||n.trackChoiceManager.setPreferredAudioTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredTextTracks(e,t):null==n||n.trackChoiceManager.setPreferredTextTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t):null==n||n.trackChoiceManager.setPreferredVideoTracks(e,t)},i.getImageTrackData=function(){return(0,I.A)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},i.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.getMinimumSafePosition():null},i.getLivePosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?void 0:!0!==(null==n?void 0:n.isLive)?null:n.getLivePosition()},i.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.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},i.__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.synchronizeInventory(!0),t.value.getInventory()):null},i._priv_cleanUpCurrentContentState=function(){var e,t,n=this;l.A.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),null===(t=null===(e=this._priv_contentInfos)||void 0===e?void 0:e.mediaElementTrackChoiceManager)||void 0===t||t.dispose(),this._priv_contentInfos=null,this._priv_contentEventsMemory={};var r=function(){null!==n.videoElement&&(l.A.debug("Unlocking `contentLock`. Next content can begin."),n._priv_contentLock.setValue(!1))};(0,h.A)(this.videoElement)?r():L(this.videoElement).then((function(){l.A.debug("API: DRM session cleaned-up with success!"),r()}),(function(e){l.A.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),r()}))},i._priv_onManifestReady=function(e,t){var n,r=this;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.manifest=t;var i=e.currentContentCanceller.signal;this._priv_reloadingMetadata.manifest=t;var a=e.initialAudioTrack,o=e.initialTextTrack;e.trackChoiceManager=new X({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===a?this._priv_preferredAudioTracks:[a];e.trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===o?this._priv_preferredTextTracks:[o];e.trackChoiceManager.setPreferredTextTracks(u,!0),e.trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),t.addEventListener("manifestUpdate",(function(t){var n,a,o;null!==e.trackChoiceManager&&e.trackChoiceManager.update();var s=null!==(a=null===(n=r._priv_contentInfos)||void 0===n?void 0:n.currentPeriod)&&void 0!==a?a:void 0,u=null===(o=r._priv_contentInfos)||void 0===o?void 0:o.trackChoiceManager;if(void 0!==s&&!(0,h.A)(u))for(var l,d=ue(t.updatedPeriods);!(l=d()).done;){var c=l.value;if(c.period.id===s.id&&(c.result.addedAdaptations.length>0||c.result.removedAdaptations.length>0)){var f=u.getAvailableAudioTracks(s);r._priv_triggerEventIfNotStopped("availableAudioTracksChange",null!=f?f:[],i);var v=u.getAvailableTextTracks(s);r._priv_triggerEventIfNotStopped("availableTextTracksChange",null!=v?v:[],i);var p=u.getAvailableVideoTracks(s);r._priv_triggerEventIfNotStopped("availableVideoTracksChange",null!=p?p:[],i)}return}}),e.currentContentCanceller.signal)}},i._priv_onActivePeriodChanged=function(e,t){var n,r,i,a,o,s,u,l,d=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.currentPeriod=d;var c=e.currentContentCanceller.signal;this._priv_contentEventsMemory.periodChange!==d&&(this._priv_contentEventsMemory.periodChange=d,this._priv_triggerEventIfNotStopped("periodChange",d,c)),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",this.getAvailableAudioTracks(),c),this._priv_triggerEventIfNotStopped("availableTextTracksChange",this.getAvailableTextTracks(),c),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",this.getAvailableVideoTracks(),c);var f=null===(r=this._priv_contentInfos)||void 0===r?void 0:r.trackChoiceManager;if((0,h.A)(f))this._priv_triggerEventIfNotStopped("audioTrackChange",null,c),this._priv_triggerEventIfNotStopped("textTrackChange",null,c),this._priv_triggerEventIfNotStopped("videoTrackChange",null,c);else{var v=f.getChosenAudioTrack(d);this._priv_triggerEventIfNotStopped("audioTrackChange",v,c);var p=f.getChosenTextTrack(d);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);var m=f.getChosenVideoTrack(d);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c)}if(this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates(),c),!e.currentContentCanceller.isUsed()&&(this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates(),c),!e.currentContentCanceller.isUsed())){var g=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.audio)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;if(this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",g,c),!e.currentContentCanceller.isUsed()){var y=null!==(l=null===(u=null===(s=this._priv_getCurrentRepresentations())||void 0===s?void 0:s.video)||void 0===u?void 0:u.bitrate)&&void 0!==l?l:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",y,c)}}}},i._priv_onPeriodStreamReady=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=t.adaptationRef,o=e.trackChoiceManager;switch(r){case"video":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new video period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialVideoTrack(i));break;case"audio":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialAudioTrack(i));break;case"text":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialTextTrack(i));break;default:var s=i.adaptations[r];!(0,h.A)(s)&&s.length>0?a.setValue(s[0]):a.setValue(null)}}},i._priv_onPeriodStreamCleared=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=e.trackChoiceManager;switch(r){case"audio":case"text":case"video":(0,h.A)(a)||a.removePeriod(r,i)}var o=e.activeAdaptations,s=e.activeRepresentations;if(!(0,h.A)(o)&&!(0,h.A)(o[i.id])){var u=o[i.id];delete u[r],0===Object.keys(u).length&&delete o[i.id]}if(!(0,h.A)(s)&&!(0,h.A)(s[i.id])){var l=s[i.id];delete l[r],0===Object.keys(l).length&&delete s[i.id]}}},i._priv_onAdaptationChange=function(e,t){var n,r=t.type,i=t.adaptation,a=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeAdaptations&&(e.activeAdaptations={});var o,s=e.activeAdaptations,u=e.currentPeriod,l=s[a.id];if((0,h.A)(l))s[a.id]=((o={})[r]=i,o);else l[r]=i;var d=e.trackChoiceManager,c=e.currentContentCanceller.signal;if(null!==d&&null!==u&&!(0,h.A)(a)&&a.id===u.id)switch(r){case"audio":var f=d.getChosenAudioTrack(u);this._priv_triggerEventIfNotStopped("audioTrackChange",f,c);var v=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",v,c);break;case"text":var p=d.getChosenTextTrack(u);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);break;case"video":var m=d.getChosenVideoTrack(u);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c);var g=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",g,c)}}},i._priv_onRepresentationChange=function(e,t){var n,r,i=t.type,a=t.period,o=t.representation;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeRepresentations&&(e.activeRepresentations={});var s,u=e.activeRepresentations,l=e.currentPeriod,d=u[a.id];if((0,h.A)(d))u[a.id]=((s={})[i]=o,s);else d[i]=o;var c=null!==(r=null==o?void 0:o.bitrate)&&void 0!==r?r:-1;if(!(0,h.A)(a)&&null!==l&&l.id===a.id){var f=this._priv_contentInfos.currentContentCanceller.signal;"video"===i?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c,f):"audio"===i&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c,f)}}},i._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})},i._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},i._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,l.A.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},i._priv_triggerPositionUpdate=function(e,t){var n,r;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var i=e.isDirectFile,o=e.manifest;if((i||null!==o)&&!(0,h.A)(t)){var s=null!==o?o.getMaximumSafePosition():void 0,u={position:t.position,duration:t.duration,playbackRate:t.playbackRate,maximumBufferTime:s,bufferGap:void 0!==t.bufferGap&&isFinite(t.bufferGap)?t.bufferGap:0};if(null!==o&&o.isLive&&t.position>0){var l=null!==(r=o.availabilityStartTime)&&void 0!==r?r:0;u.wallClockTime=t.position+l;var d=o.getLivePosition();void 0!==d&&(u.liveGap=d-t.position)}else if(i&&null!==this.videoElement){var c=a(this.videoElement);void 0!==c&&(u.wallClockTime=c+t.position)}this.trigger("positionUpdate",u)}}},i._priv_triggerAvailableBitratesChangeEvent=function(e,t,n){var r=this._priv_contentEventsMemory[e];n.isCancelled()||void 0!==r&&(0,y.A)(t,r)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._priv_triggerCurrentBitrateChangeEvent=function(e,t,n){n.isCancelled()||t===this._priv_contentEventsMemory[e]||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._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,h.A)(n[t.id])?null:n[t.id]},i._priv_triggerEventIfNotStopped=function(e,t,n){n.isCancelled()||this.trigger(e,t)},i._priv_initializeMediaElementTrackChoiceManager=function(e,t,n){var r,i,a,o=this;(0,_.h)(null!==g.A.directfile,"Initializing `MediaElementTrackChoiceManager` without Directfile feature"),(0,_.h)(null!==this.videoElement,"Initializing `MediaElementTrackChoiceManager` on a disposed RxPlayer");var s=new g.A.directfile.mediaElementTrackChoiceManager(this.videoElement),u=void 0===e?this._priv_preferredAudioTracks:[e];s.setPreferredAudioTracks(u,!0);var l=void 0===t?this._priv_preferredTextTracks:[t];return s.setPreferredTextTracks(l,!0),s.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",s.getAvailableAudioTracks(),n),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",s.getAvailableVideoTracks(),n),this._priv_triggerEventIfNotStopped("availableTextTracksChange",s.getAvailableTextTracks(),n),this._priv_triggerEventIfNotStopped("audioTrackChange",null!==(r=s.getChosenAudioTrack())&&void 0!==r?r:null,n),this._priv_triggerEventIfNotStopped("textTrackChange",null!==(i=s.getChosenTextTrack())&&void 0!==i?i:null,n),this._priv_triggerEventIfNotStopped("videoTrackChange",null!==(a=s.getChosenVideoTrack())&&void 0!==a?a:null,n),s.addEventListener("availableVideoTracksChange",(function(e){return o.trigger("availableVideoTracksChange",e)})),s.addEventListener("availableAudioTracksChange",(function(e){return o.trigger("availableAudioTracksChange",e)})),s.addEventListener("availableTextTracksChange",(function(e){return o.trigger("availableTextTracksChange",e)})),s.addEventListener("audioTrackChange",(function(e){return o.trigger("audioTrackChange",e)})),s.addEventListener("videoTrackChange",(function(e){return o.trigger("videoTrackChange",e)})),s.addEventListener("textTrackChange",(function(e){return o.trigger("textTrackChange",e)})),s},(0,e.A)(r,null,[{key:"ErrorTypes",get:function(){return p.wU}},{key:"ErrorCodes",get:function(){return p.tG}},{key:"LogLevel",get:function(){return l.A.getLevel()},set:function(e){l.A.setLevel(e)}}])}(b.A);ye._priv_currentlyUsedVideoElements=new WeakSet,ye.version="3.33.4-dev.2024083000";var Ae=ye;!function(){m.A.mediaSourceInit=n(1737).A,m.A.decrypt=n(6699).Ay,m.A.imageBuffer=n(4166).A,m.A.imageParser=n(1755).A,m.A.transports.smooth=n(5564).A,m.A.transports.dash=n(9502).A,m.A.dashParsers.js=n(95).A,m.A.nativeTextTracksBuffer=n(8385).A,m.A.nativeTextTracksParsers.vtt=n(2537).A,m.A.nativeTextTracksParsers.ttml=n(5084).A,m.A.nativeTextTracksParsers.sami=n(7275).A,m.A.nativeTextTracksParsers.srt=n(5992).A,m.A.htmlTextTracksBuffer=n(7938).A,m.A.htmlTextTracksParsers.sami=n(9561).A,m.A.htmlTextTracksParsers.ttml=n(8342).A,m.A.htmlTextTracksParsers.srt=n(1650).A,m.A.htmlTextTracksParsers.vtt=n(8977).A;var e=n(5963).A,t=n(3568).A;m.A.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&l.A.setLevel("DEBUG");var _e=Ae}(),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={9770:function(e,t,n){"use strict";n.d(t,{j:function(){return a},t:function(){return o}});var r=n(6787),i=n(2186).A?void 0:window,a=void 0===i?void 0:(0,r.A)(i.MediaSource)?(0,r.A)(i.MozMediaSource)?(0,r.A)(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}},443:function(e,t,n){"use strict";n.d(t,{A7:function(){return y},Fr:function(){return c},NV:function(){return g},P5:function(){return m},Pb:function(){return v},ZN:function(){return p},dX:function(){return f},gm:function(){return d},h$:function(){return l},hF:function(){return h},lw:function(){return u},op:function(){return s},qe:function(){return A},x1:function(){return _}});var r,i,a,o=n(2186),s=!1,u=!1,l=!1,d=!1,c=!1,f=!1,v=!1,p=!1,h=!1,m=!1,g=!1,y=!1,A=!1,_=!1;o.A||(void 0!==window.MSInputMethodContext&&void 0!==document.documentMode?(u=!0,l=!0):"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)?l=!0:-1!==navigator.userAgent.toLowerCase().indexOf("edg/")?s=!0:-1!==navigator.userAgent.toLowerCase().indexOf("firefox")?d=!0:"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)?f=!0:(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())||/Safari\/(\d+)/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&-1!==(null===(a=navigator.vendor)||void 0===a?void 0:a.indexOf("Apple"))&&!/Chrome\/(\d+)/.test(navigator.userAgent)&&!/Chromium\/(\d+)/.test(navigator.userAgent))&&(c=!0),/SamsungBrowser/.test(navigator.userAgent)&&(v=!0),-1!==navigator.userAgent.indexOf("PlayStation 5")?y=!0:/Tizen/.test(navigator.userAgent)?p=!0:/[Ww]eb[O0]S/.test(navigator.userAgent)?(h=!0,/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent)||/[Cc]hr[o0]me\/87/.test(navigator.userAgent)||(/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent)||/[Cc]hr[o0]me\/79/.test(navigator.userAgent))):-1!==navigator.userAgent.indexOf("NETTV")&&-1!==navigator.userAgent.indexOf("Philips")?g=!0:/[Pp]anasonic/.test(navigator.userAgent)?m=!0:-1!==navigator.userAgent.indexOf("Xbox")?A=!0:navigator.userAgent.indexOf("Model/a1-kstb40xx")&&(_=!0))},3116:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787);function a(e){var t=e.textTracks;if(!(0,i.A)(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.A.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},5121:function(e,t,n){"use strict";n.d(t,{Ah:function(){return _},Bi:function(){return P},G1:function(){return w},HQ:function(){return R},ID:function(){return M},R5:function(){return x},Sb:function(){return p},VS:function(){return C},Vb:function(){return y},XC:function(){return E},Z1:function(){return T},bF:function(){return S},c_:function(){return b},g9:function(){return D},jf:function(){return f},ng:function(){return g},o8:function(){return m},qF:function(){return I},rR:function(){return A},yS:function(){return k}});var r=n(5151),i=n(2384),a=n(6787),o=n(8060),s=n(8315),u=n(2186),l=["","webkit","moz","ms"],d=u.A||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function c(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 f(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((void 0===t?l:t).map((function(e){return e+n})))}),[])}(e,t);return function(e,t,a){if(!a.isCancelled()){if(e instanceof HTMLElement){if(void 0===n&&(n=c(e,r)),!(0,i.A)(n))return void 0;e.addEventListener(n,t),a.register((function(){void 0!==n&&e.removeEventListener(n,t)}))}r.forEach((function(n){var r=!1;"function"==typeof e.addEventListener?e.addEventListener(n,t):(r=!0,e["on"+n]=t),a.register((function(){"function"==typeof e.removeEventListener&&e.removeEventListener(n,t),r&&delete e["on"+n]}))}))}}}function v(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,i.A)(t)?t+"Hidden":"hidden",a=(0,i.A)(t)?t+"visibilitychange":"visibilitychange",o=document[r],u=new s.A(!o,e);return N(document,a,(function(){var e=!document[r];u.setValueIfChanged(e)}),e),u}function p(e){var t,n=v(e),i=new s.A(!0,e);return e.register((function(){clearTimeout(t),t=void 0})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=r.A.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){i.setValueIfChanged(!1)}),n)}i.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),i}function h(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function m(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=new s.A({isEnabled:r,pipWindow:null},t);return N(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),i}var a=document.pictureInPictureElement===n,o=new s.A({isEnabled:a,pipWindow:null},t);return N(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),N(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),o}function g(e,t){var n,i=v(t),a=new s.A(!0,t);return t.register((function(){clearTimeout(n),n=void 0})),i.onUpdate(o,{clearSignal:t}),e.onUpdate(o,{clearSignal:t}),o(),a;function o(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||i.getValue())a.setValueIfChanged(!0);else{var t=r.A.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){a.setValueIfChanged(!1)}),t)}}}function y(e,t,n){var r=new s.A(e.clientWidth*d,n),i=o.A;t.onUpdate(l,{clearSignal:n}),N(window,"resize",l,n);var u=window.setInterval(l,2e4);return l(),n.register((function(){i(),clearInterval(u)})),r;function l(){i();var n=t.getValue();if(n.isEnabled)if((0,a.A)(n.pipWindow))r.setValueIfChanged(1/0);else{var s=n.pipWindow,u=h(e,s),l=function(){r.setValueIfChanged(h(e,s)*d)};s.addEventListener("resize",l),i=function(){s.removeEventListener("resize",l),i=o.A},r.setValueIfChanged(u*d)}else r.setValueIfChanged(e.clientWidth*d)}}f(["loadedmetadata"]),f(["timeupdate"]);var A=f(["fullscreenchange","FullscreenChange"],l.concat("MS")),_=f(["addtrack"]),b=f(["removetrack"]),S=f(["sourceopen","webkitsourceopen"]),E=f(["sourceclose","webkitsourceclose"]),T=f(["sourceended","webkitsourceended"]),w=f(["update"]),k=f(["removesourcebuffer"]),I=f(["keymessage","message"]),x=f(["keyadded","ready"]),R=f(["keyerror","error"]),C=f(["keystatuseschange"]),M=f(["seeking"]),P=f(["seeked"]),D=f(["ended"]);function N(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2186:function(e,t){"use strict";var n="undefined"==typeof window;t.A=n},7913:function(e,t,n){"use strict";var r=n(443).ZN;t.A=r},7402:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{A:function(){return r}})},8068:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787);function a(e,t,n){if(e>=t)return r.A.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.A)(window.VTTCue)){if((0,i.A)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},2097:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(443);function i(){return r.Pb}},5151:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});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},MINIMUM_MAX_BUFFER_AHEAD:{text:120},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:5e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_CDN_DOWNGRADE_TIME:60,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_ENTER_BUFFER_BASED_ALGO:10,ABR_EXIT_BUFFER_BASED_ALGO:5,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},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,SEGMENT_SYNCHRONIZATION_DELAY:1500,MISSING_DATA_TRIGGER_SYNC_DELAY:.1,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_VIDEO_CODECS:['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'],EME_DEFAULT_AUDIO_CODECS:['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"],EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_DEFAULT_PLAYREADY_ROBUSTNESSES:["3000","2000"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready.recommendation","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_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_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8935);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=e[u];void 0===l&&(l={},e[u]=l),o(l,s[u])}else{var d;(0,i.A)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=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}(),u=new s},3568:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(7387),i=n(443);var a=n(79),o=n(8202);function s(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 u(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 d={language:a.language,id:l,normalized:(0,o.Ay)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:d,nativeTrack:a})}return n}function l(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 d="forced"===a.kind||void 0,c={language:a.language,forced:d,label:a.label,id:l,normalized:(0,o.Ay)(a.language),closedCaption:"captions"===a.kind};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],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?u(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?d(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?l(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.A)(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(){f(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,label:t.label,forced:t.forced,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.Ay)(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 v(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else f(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 f(this._textTracks);for(var r=(0,o.Ay)(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 v(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}f(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=u(e._nativeAudioTracks);if(s(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=u(e._nativeAudioTracks);if(s(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=l(e._nativeTextTracks);if(s(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=l(e._nativeTextTracks);if(s(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=d(e._nativeVideoTracks);if(s(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=d(e._nativeVideoTracks);if(s(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){!function(e,t){for(var n=0;n<e.length;n++)i.ZN&&n===t||(e[n].enabled=!1);t<0||t>=e.length||(e[t].enabled=!0)}(this._audioTracks.map((function(e){return e.nativeTrack})),e)},t}(a.A);function f(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function v(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}}},5283:function(e,t,n){"use strict";n.d(t,{A:function(){return i},c:function(){return a}});var r=n(7365);function i(e){var t=r.A.getState(e);return null===t?null:[t.mediaKeySystemAccess.keySystem,t.mediaKeySystemAccess.getConfiguration()]}function a(e){var t=r.A.getState(e);return null==t?null:t.keySystemOptions.type}},6699:function(e,t,n){"use strict";n.d(t,{Ay:function(){return Dt}});var r,i=n(467),a=n(7387),o=n(4756),s=n.n(o),u=n(5575),l=n(7994),d=n(6787),c=n(8935),f=n(443),v=n(5121),p=n(2186);if(!p.A){var h=window.WebKitMediaKeys;void 0!==h&&"function"==typeof h.isTypeSupported&&"function"==typeof h.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=h)}var m,g=n(2212),y=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 Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,g.A)(e,[{key:"keySystem",get:function(){return this._keyType}}])}();if(!p.A){var A=window.MSMediaKeys;void 0!==A&&void 0!==A.prototype&&"function"==typeof A.isTypeSupported&&"function"==typeof A.prototype.createSession&&(m=A)}var _=n(79),b=n(2507);function S(e){try{var t=e();return"object"==typeof t&&null!==t&&"function"==typeof t.then?t:Promise.resolve(t)}catch(e){return Promise.reject(e)}}var E,T=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._sessionClosingCanceller=new b.Ay,n.closed=new Promise((function(e){n._sessionClosingCanceller.signal.register((function(){return e()}))})),n.update=function(e){return new Promise((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,a.A)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((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),v.qF(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"message",e)}),n._sessionClosingCanceller.signal),v.R5(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyadded",e)}),n._sessionClosingCanceller.signal),v.HQ(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyerror",e)}),n._sessionClosingCanceller.signal),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._sessionClosingCanceller.cancel(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,g.A)(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:""}}])}(_.A),w=function(){function e(e){if(void 0===m)throw new Error("No MSMediaKeys API.");this._mediaKeys=new m(e)}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){t._videoElement=e,void 0!==t._videoElement.msSetMediaKeys&&t._videoElement.msSetMediaKeys(t._mediaKeys)}))},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new T(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!p.A){var k=window.MozMediaKeys;void 0!==k&&void 0!==k.prototype&&"function"==typeof k.isTypeSupported&&"function"==typeof k.prototype.createSession&&(E=k)}var I=n(603),x=n(8060),R=n(4670);function C(e){return"function"==typeof e.webkitGenerateKeyRequest}var M=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=x.A,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,a.A)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,R.Es)(i)),o=(0,I.K)(a.keys[0].k),s=(0,I.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 Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(_.A),P=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){if(!C(e))throw new Error("Video not attached to the MediaKeys");t._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 D=n(9828),N=n(5553);function O(e,t){var n=e;return S((function(){if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");n.webkitSetMediaKeys(t)}))}var L=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=x.A,i._closeSession=x.A,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,a.A)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((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{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((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(a=n._keyType,(0,D.A)(a,"com.apple.fps")){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,N.eR)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,R.Yg)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,R.kY)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,N.Wz)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,N.Wz)(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 Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,g.A)(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:""}}])}(_.A),U=function(){function e(e){if(void 0===r)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new r(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 O(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 L(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();function B(){if(void 0===r)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:r.isTypeSupported,createCustomMediaKeys:function(e){return new U(e)},setMediaKeys:function(e,t){if(null===t)return O(e,t);if(!(t instanceof U))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}var F=function(e){var t,n,i,a=z;if("standard"!==e&&("auto"!==e||(f.Fr||f.dX)&&void 0!==r)||!p.A&&(0,d.A)(navigator.requestMediaKeySystemAccess)){var o,s;if("webkit"===e&&void 0!==r){var c=B();n=V(),o=c.isTypeSupported,s=c.createCustomMediaKeys,a=c.setMediaKeys,i="webkit"}else if(C(HTMLVideoElement.prototype)){n=(0,v.jf)(["needkey"]);var h={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 P(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof P))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}};o=h.isTypeSupported,s=h.createCustomMediaKeys,a=h.setMediaKeys,i="older-webkit"}else if(void 0!==r){n=V();var g=B();o=g.isTypeSupported,s=g.createCustomMediaKeys,a=g.setMediaKeys,i="webkit"}else if(f.lw&&void 0!==m){n=(0,v.jf)(["encrypted","needkey"]);var A={isTypeSupported:function(e,t){if(void 0===m)throw new Error("No MSMediaKeys API.");return void 0!==t?m.isTypeSupported(e,t):m.isTypeSupported(e)},createCustomMediaKeys:function(e){return new w(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof w))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}};o=A.isTypeSupported,s=A.createCustomMediaKeys,a=A.setMediaKeys,i="ms"}else if(void 0!==E){n=(0,v.jf)(["encrypted","needkey"]);var _={isTypeSupported:function(e,t){if(void 0===E)throw new Error("No MozMediaKeys API.");return void 0!==t?E.isTypeSupported(e,t):E.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===E)throw new Error("No MozMediaKeys API.");return new E(e)},setMediaKeys:function(e,t){return S((function(){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)}))}};o=_.isTypeSupported,s=_.createCustomMediaKeys,a=_.setMediaKeys,i="moz"}else{n=(0,v.jf)(["encrypted","needkey"]);var b=window.MediaKeys,T=function(){if(void 0===b)throw new u.A("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===b.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.")}};o=function(e){return T(),(0,l.h)("function"==typeof b.isTypeSupported),b.isTypeSupported(e)},s=function(e){return T(),new b(e)},i="unknown"}t=function(e,t){if(!o(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,u=r.initDataTypes,l=r.distinctiveIdentifier,d=!0;if(d=(d=d&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var c={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(c.videoCapabilities=i),void 0!==a&&(c.audioCapabilities=a);var f=s(e);return Promise.resolve(new y(e,f,c))}}return Promise.reject(new Error("Unsupported configuration"))}}else t=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)},n=(0,v.jf)(["encrypted"]),i="standard";return{requestMediaKeySystemAccess:t,onEncrypted:n,setMediaKeys:a,implementation:i}}("auto");function V(){var e=(0,v.jf)(["needkey"],void 0);return function(t,n,r){e(t,(function(e){var t=(0,c.A)(e,{forceSessionRecreation:!0});n(t)}),r)}}function z(e,t){try{var n,r=e;return"function"==typeof r.setMediaKeys?n=r.setMediaKeys(t):"function"==typeof r.webkitSetMediaKeys?n=r.webkitSetMediaKeys(t):"function"==typeof r.mozSetMediaKeys?n=r.mozSetMediaKeys(t):"function"==typeof r.msSetMediaKeys&&null!==t&&(n=r.msSetMediaKeys(t)),"object"==typeof n&&null!==n&&"function"==typeof n.then?n:Promise.resolve(n)}catch(e){return Promise.reject(e)}}var K=F,W=n(9477),G=n(2948),H=n(987),q=(0,N.mq)((0,R.eb)("pssh"),0);function j(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,H.A)(t.data,r.data))return!0}return!1}function Y(e){var t=e.initData,n=e.initDataType,r=e.forceSessionRecreation;if((0,d.A)(t))return W.A.warn("Compat: No init data found on media encrypted event."),null;var i=function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,N.mq)(e,n+4)!==q)return W.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,N.mq)(new Uint8Array(e),n);if(n+r>e.length)return W.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,G.L)(i,8),data:i};j(t,a)?W.A.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(W.A.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:i,forceSessionRecreation:r}}var Q=n(5151),X=n(1956),$=n(1858),Z=n(1729),J=n(4031),ee=n(7365);function te(e){return ee.A.setState(e,null),K.setMediaKeys(e,null).then((function(){W.A.info("DRM: MediaKeys disabled with success")})).catch((function(e){W.A.error("DRM: Could not disable MediaKeys",e instanceof Error?e:"Unknown Error")}))}function ne(){return(ne=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u,l,d,c,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.emeImplementation,a=n.keySystemOptions,o=n.askedConfiguration,u=n.loadedSessionsStore,l=n.mediaKeySystemAccess,d=n.mediaKeys,c=ee.A.getState(t),f=null!==c&&c.loadedSessionsStore!==u?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,f;case 5:if(!r.isCancelled()){e.next=7;break}throw r.cancellationError;case 7:if(ee.A.setState(t,{emeImplementation:i,keySystemOptions:a,mediaKeySystemAccess:l,mediaKeys:d,loadedSessionsStore:u,askedConfiguration:o}),t.mediaKeys!==d){e.next=10;break}return e.abrupt("return");case 10:W.A.info("DRM: Attaching MediaKeys to the media element"),i.setMediaKeys(t,d).then((function(){W.A.info("DRM: MediaKeys attached with success")})).catch((function(e){W.A.error("DRM: Could not set MediaKeys",e instanceof Error?e:"Unknown Error")}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(W.A.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,J.A)(n,"expired")?(W.A.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,J.A)(n,"internal-error")?(W.A.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(W.A.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function ie(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?ae(i,t):null===a?(W.A.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),ae(i,t)):function(e,t,n,r){return oe.apply(this,arguments)}(i,a,t,r)}function ae(e,t){W.A.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function oe(){return oe=(0,i.A)(s().mark((function e(t,n,r,a){var o,u,l,d,c,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return f=(0,i.A)(s().mark((function e(){var i,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return W.A.info("DRM: Removing previous persistent session."),null!==(i=n.get(r))&&n.delete(i.sessionId),e.prev=5,e.next=8,t.closeSession(o.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===o.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(o.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return u=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:u});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),f.apply(this,arguments)},c=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(W.A.info("DRM: Creating persistent MediaKeySession"),o=t.createSession(r,"persistent-license"),null!==(u=n.getAndReuse(r))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:o});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(o.mediaKeySession,u.sessionId);case 12:if(l=e.sent){e.next=19;break}return W.A.warn("DRM: No data stored for the loaded session"),n.delete(u.sessionId),t.removeSessionWithoutClosingIt(o.mediaKeySession),d=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!l||!re(o.mediaKeySession)){e.next=23;break}return n.add(r,r.keyIds,o.mediaKeySession),W.A.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:o});case 23:return W.A.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",c());case 27:return e.prev=27,e.t0=e.catch(9),W.A.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",c());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),oe.apply(this,arguments)}function se(e,t){return ue.apply(this,arguments)}function ue(){return(ue=(0,i.A)(s().mark((function e(t,n){var r,i,a,o,u;return s().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(W.A.info("DRM: LSS cache limit exceeded",n,t.getLength()),r=[],i=t.getAll().slice(),a=i.length-n,o=0;o<a;o++)u=i[o],r.push(t.closeSession(u.mediaKeySession));return e.next=9,Promise.all(r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e,t,n,r,i){return de.apply(this,arguments)}function de(){return(de=(0,i.A)(s().mark((function e(t,n,r,i,a){var o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,u=n.loadedSessionsStore,l=n.persistentSessionsStore,null===(d=u.reuse(t))){e.next=11;break}if(!re(o=d.mediaKeySession)){e.next=10;break}return W.A.info("DRM: Reuse loaded session",o.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:o,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==l&&""!==d.mediaKeySession.sessionId&&l.delete(d.mediaKeySession.sessionId);case 11:if(null===o){e.next=16;break}return e.next=14,u.closeSession(o);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,se(u,i<=0?i:i-1);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,ie(n,t,r,a);case 22:return c=e.sent,e.abrupt("return",{type:c.type,value:{mediaKeySession:c.value.mediaKeySession,sessionType:c.value.sessionType,keySessionRecord:c.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ce='<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>ckB07BNLskeUq0qd83fTbA==</KID><DS_ID>yYIPDBca1kmMfL60IsfgAQ==</DS_ID><CUSTOMATTRIBUTES xmlns=""><encryptionref>312_4024_2018127108</encryptionref></CUSTOMATTRIBUTES><CHECKSUM>U/tsUYRgMzw=</CHECKSUM></DATA></WRMHEADER>';function fe(e){var t,n,r,i,a,o,s=(0,R.kY)(e),u=(0,N.WO)(s.length),l=new Uint8Array([1,0]),d=new Uint8Array([1,0]),c=(0,N.Wz)(s.length+6),f=(0,N.xW)(c,d,l,u,s),v=(0,R.aT)("9a04f07998404286ab92e65be0885f95");return t=f,n=v,r=(0,R.eb)("pssh"),i=new Uint8Array([0,0,0,0]),a=(0,N.KS)(t.length),o=(0,N.KS)(32+t.length),(0,N.xW)(o,r,i,n,a,t)}var ve=n(3262);function pe(e,t,n,r){var i=n.getConfiguration();if(f.lw||null==i)return null;var a=e.filter((function(e){return e.type===r.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===i.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===i.distinctiveIdentifier))}))[0];return null!=a?{keySystemOptions:a,keySystemAccess:n,askedConfiguration:t}:null}function he(e,t,n){var r=["temporary"],i="optional",a="optional";!0===n.persistentLicense&&(i="required",r.push("persistent-license")),!0===n.persistentStateRequired&&(i="required"),!0===n.distinctiveIdentifierRequired&&(a="required");var o,s,u=Q.A.getCurrent(),l=u.EME_DEFAULT_AUDIO_CODECS,c=u.EME_DEFAULT_VIDEO_CODECS,f=u.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,v=u.EME_DEFAULT_PLAYREADY_ROBUSTNESSES;o=(0,d.A)(n.videoRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.videoRobustnesses,s=(0,d.A)(n.audioRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.audioRobustnesses,0===o.length&&o.push(void 0),0===s.length&&s.push(void 0);var p={initDataTypes:["cenc"],videoCapabilities:(0,ve.A)(o,(function(e){return c.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),audioCapabilities:(0,ve.A)(s,(function(e){return l.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),distinctiveIdentifier:a,persistentState:i,sessionTypes:r};return(0,d.A)(n.audioRobustnesses)&&(0,d.A)(n.videoRobustnesses)?[p,Object.assign(Object.assign({},p),{audioCapabilities:void 0,videoCapabilities:void 0})]:[p]}function me(e,t,n){W.A.info("DRM: Searching for compatible MediaKeySystemAccess");var r=ee.A.getState(e);if(null!==r&&K.implementation===r.emeImplementation.implementation){var a=pe(t,r.askedConfiguration,r.mediaKeySystemAccess,r.keySystemOptions);if(null!==a)return W.A.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,askedConfiguration:a.askedConfiguration,options:a.keySystemOptions}})}var o=t.reduce((function(e,t){var n,r=Q.A.getCurrent().EME_KEY_SYSTEMS[t.type];if(null!=r)n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}}));else{var i=function(e){for(var t=Q.A.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,J.A)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return u(0);function u(e){return l.apply(this,arguments)}function l(){return(l=(0,i.A)(s().mark((function e(t){var r,i,a,l,d,c,f,v;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=o.length)){e.next=2;break}throw new X.A("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=K.requestMediaKeySystemAccess){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:r=o[t],i=r.keyName,a=r.keyType,l=r.keySystemOptions,d=he(i,a,l),W.A.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+o.length),f=0;case 8:if(!(f<d.length)){e.next=26;break}return v=d[f],e.prev=10,e.next=13,ge(a,[v]);case 13:return c=e.sent,W.A.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:l,askedConfiguration:v,mediaKeySystemAccess:c}});case 18:if(e.prev=18,e.t0=e.catch(10),W.A.debug("DRM: Rejected access to keysystem",a,t+1,f),null===n.cancellationError){e.next=23;break}throw n.cancellationError;case 23:f++,e.next=8;break;case 26:return e.abrupt("return",u(t+1));case 27:case"end":return e.stop()}}),e,null,[[10,18]])})))).apply(this,arguments)}}function ge(e,t){return ye.apply(this,arguments)}function ye(){return(ye=(0,i.A)(s().mark((function e(t,n){var r,i,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.requestMediaKeySystemAccess(t,n);case 2:if(r=e.sent,s=t,!f.op||-1===s.indexOf("playready")){e.next=18;break}return e.prev=4,e.next=7,r.createMediaKeys();case 7:return i=e.sent,a=i.createSession(),o=fe(ce),e.next=12,a.generateRequest("cenc",o);case 12:e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(4),W.A.debug("DRM: KeySystemAccess was granted but it is not usable"),e.t0;case 18:return e.abrupt("return",r);case 19:case"end":return e.stop()}var s}),e,null,[[4,14]])})))).apply(this,arguments)}var Ae=n(8797);function _e(e,t,n){var r;W.A.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){W.A.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,N.mq)(e,i+4)!==q)throw W.A.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,N.mq)(new Uint8Array(e),i);if(i+a>e.length)throw W.A.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,Ae.fP)(o),u=null===s?void 0:o[s[1]];W.A.info("Compat: CENC PSSH found with version",u),void 0===u?W.A.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,N.xW)(n,o):1===u?(W.A.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):W.A.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,N.xW)(r,o);i+=a}if(i!==e.length)throw W.A.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,N.xW)(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 W.A.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}var be=100;function Se(e,t){return Ee.apply(this,arguments)}function Ee(){return(Ee=(0,i.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W.A.info("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 Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,be);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Te=n(2432);function we(e){var t=new b.Ay;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,i.A)(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,Te.A)(1e3,t.signal);case 3:return e.next=5,r();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof b.AL)){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",W.A.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function r(){return a.apply(this,arguments)}function a(){return(a=(0,i.A)(s().mark((function n(){return s().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,Te.A)(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 ke(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){if("string"==typeof e)return Ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(e,t):void 0}}(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 Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t){for(var n,r,i=function(){var e=r.value;if(!t.some((function(t){return(0,H.A)(t,e)})))return{v:!1}},a=ke(e);!(r=a()).done;)if(n=i())return n.v;return!0}function Re(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){if("string"==typeof e)return Ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}(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 Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Me=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=Re(this._keyIds);!(t=n()).done;){var r=t.value;if((0,H.A)(r,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&&t.length>0){if(null!==this._keyIds&&xe(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return xe(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?xe(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function Pe(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){if("string"==typeof e)return De(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var Ne=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new Me(e);W.A.debug("DRM-LSS: calling `createSession`",t);var i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,d.A)(i.closed)||i.closed.then((function(){W.A.info("DRM-LSS: session was closed, removing it.",i.sessionId);var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){W.A.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),this._storage.push(Object.assign({},a)),W.A.debug("DRM-LSS: MediaKeySession added",a.sessionType,this._storage.length),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),W.A.debug("DRM-LSS: Reusing session:",n.mediaKeySession.sessionId,n.sessionType),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Pe(this._storage);case 1:if((o=a()).done){e.next=8;break}if((u=o.value).mediaKeySession!==t){e.next=6;break}return i=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return W.A.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",_e(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,_e(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,i.A)(s().mark((function e(t,n){var r,i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Pe(this._storage);case 1:if((a=i()).done){e.next=8;break}if((o=a.value).mediaKeySession!==t){e.next=6;break}return r=o,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return W.A.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Se(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,Se(t,n);case 17:u=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",u);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",u);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,i.A)(s().mark((function e(t){var n,r,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Pe(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 W.A.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12: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,i.A)(s().mark((function e(){var t,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,W.A.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.removeSessionWithoutClosingIt=function(e){(0,l.h)(""===e.sessionId,"Initialized `MediaKeySession`s should always be properly closed");for(var t=this._storage.length-1;t>=0;t--){if(this._storage[t].mediaKeySession===e)return W.A.debug("DRM-LSS: Removing session without closing it",e.sessionId),this._storage.splice(t,1),!0}return!1},t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,i.A)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),Oe(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function Oe(e){return Le.apply(this,arguments)}function Le(){return(Le=(0,i.A)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W.A.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,we(t);case 4:return W.A.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),W.A.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ue(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t|=0;return t}var Be=n(2384),Fe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,I.i)(this.initData)},e.decode=function(e){return(0,I.K)(e)},e}();function Ve(e,t){var n,r;return null!==(r=null!==(n=ze(e,t))&&void 0!==n?n:ze(t,e))&&void 0!==r&&r}function ze(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,H.A)(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 d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?Fe.decode(u.data):u.data.initData,c=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?Fe.decode(l.data):l.data.initData;if(!(0,H.A)(d,c))return!1;break}}if(r===t.length)return null}return!0}}return null}function Ke(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){if("string"==typeof e)return We(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(e,t):void 0}}(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 We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ge=function(){function e(e){!function(e){(0,l.A)(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){W.A.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?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){var r;if(!(0,d.A)(n)&&(0,Be.A)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,s=this._entries[a];if((null!==(r=s.version)&&void 0!==r?r:-1)>=o&&i===s.sessionId)return;W.A.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else W.A.info("DRM-PSS: Add new session",i);var u=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:i,values:u,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new Fe(e)})),values:u,initDataType:e.type}),this._save()}else W.A.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];W.A.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else W.A.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){W.A.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(W.A.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:Ue(t)}}return n}for(var i,a=function(){var n=t._entries[o];if(n.initDataType===e.type)switch(n.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,r=(0,I.i)(e),i=Ke(n.keyIds);!(t=i()).done;){var a=t.value;if("string"==typeof a){if(r===a)return!0}else if((0,H.A)(a.initData,e))return!0}return!1})))return{v:o}}else if(Ve(e.values.getFormattedValues(),n.values))return{v:o};break;case 3:if(Ve(e.values.getFormattedValues(),n.values))return{v:o};break;case 2:var i=r(),a=i.initData,s=i.initDataHash;if(n.initDataHash===s)try{var u="string"==typeof n.initData?Fe.decode(n.initData):n.initData.initData;if((0,H.A)(u,a))return{v:o}}catch(e){W.A.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var l=r(),d=l.initData,c=l.initDataHash;if(n.initDataHash===c){if(void 0===n.initData.length)return{v:o};if((0,H.A)(n.initData,d))return{v:o}}break;default:var f=r().initDataHash;if(n.initData===f)return{v:o}}},o=0;o<this._entries.length;o++)if(i=a())return i.v;return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){W.A.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var He=new WeakMap,qe={prepare:function(e){He.set(e,null)},set:function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=Ue(n);He.set(e,{hash:r,serverCertificate:n})},hasOne:function(e){var t=He.get(e);return void 0!==t&&(null!==t||void 0)},has:function(e,t){var n=He.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(Ue(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 je(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new X.A("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return W.A.debug("DRM: Set the given license storage"),new Ge(t)}function Ye(e,t,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=(0,i.A)(s().mark((function e(t,n,r){var i,a,o,u,l,c,v,p,h,m,g;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,me(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,o=a.options,u=a.mediaKeySystemAccess,l=a.askedConfiguration,c=ee.A.getState(t),v=je(o),f.hF||f.NV||f.P5||f.x1||null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(p=c.mediaKeys,h=c.loadedSessionsStore,!1!==qe.hasOne(p)&&((0,d.A)(o.serverCertificate)||!qe.has(p,o.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:p,mediaKeySystemAccess:u,askedConfiguration:l,stores:{loadedSessionsStore:h,persistentSessionsStore:v},options:o});case 12:return e.next=14,Xe(u);case 14:return m=e.sent,W.A.info("DRM: MediaKeys created with success"),g=new Ne(m),e.abrupt("return",{mediaKeys:m,mediaKeySystemAccess:u,askedConfiguration:l,stores:{loadedSessionsStore:g,persistentSessionsStore:v},options:o});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(e){return $e.apply(this,arguments)}function $e(){return($e=(0,i.A)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W.A.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 X.A("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ze(){return(Ze=(0,i.A)(s().mark((function e(t,n,r){var i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ye(t,n,r);case 2:if(i=e.sent,a=i.mediaKeys,!(null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys)){e.next=13;break}if(W.A.debug("DRM: Disabling old MediaKeys"),!f.hF){e.next=12;break}return e.next=10,te(t);case 10:e.next=13;break;case 12:te(t).catch(x.A);case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Je=n(8593),et=n(7021),tt=n(8801);function nt(e,t,n){var r=e*Math.pow(2,t-1),i=(0,et.A)(r);return Math.min(i,n)}var rt=n(2038),it=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf(r,t.prototype),r.reason=n,r}return(0,a.A)(t,e),t}((0,Je.A)(Error)),at={EXPIRED:"expired",INTERNAL_ERROR:"internal-error",OUTPUT_RESTRICTED:"output-restricted"};function ot(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],d=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],c=function(e,t){return-1!==e.indexOf("playready")&&(f.h$||f.op)?(0,R.KZ)(t):t}(n,new Uint8Array(r[1])),v={keyId:c.buffer,keyStatus:i};switch(W.A.hasLevel("DEBUG")&&W.A.debug("DRM: key status update ("+(0,R.My)(c)+"): "+i),i){case at.EXPIRED:var p=new X.A("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,R.My)(c)+")",{keyStatuses:[v].concat(d)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new it(p);case"fallback":u.push(c);break;default:"continue"===s||void 0===s?l.push(c):(0,rt.A)(s)}d.push(v);break;case at.INTERNAL_ERROR:if(!0!==a.keyInternalError)throw new X.A("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,R.My)(c)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(c);break;case at.OUTPUT_RESTRICTED:if(!0!==a.keyOutputRestricted)throw new X.A("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,R.My)(c)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(c);break;default:l.push(c)}})),d.length>0&&(r=new X.A("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:d})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var st=v.HQ,ut=v.qF,lt=v.VS;function dt(e,t,n,r,a){W.A.info("DRM: Binding session events",e.sessionId);var o=t.getLicenseConfig,u=void 0===o?{}:o,l=new b.Ay;return l.linkToSignal(a),(0,d.A)(e.closed)||e.closed.then((function(){return l.cancel()})).catch((function(e){a.isCancelled()||(l.cancel(),r.onError(e))})),st(e,(function(e){l.cancel(),r.onError(new X.A("KEY_ERROR",e.type))}),l.signal),lt(e,(function(e){(function(e){return c.apply(this,arguments)})(e).catch((function(e){a.isCancelled()||l.isUsed()&&e instanceof b.AK||(l.cancel(),r.onError(e))}))}),l.signal),ut(e,(function(n){var a,o=n,c=new Uint8Array(o.message),f=(0,Be.A)(o.messageType)?o.messageType:"license-request";W.A.info("DRM: Received message event, type "+f,e.sessionId),function(e,t,n){var r=t.baseDelay,a=t.maxDelay,o=t.totalRetry,u=t.shouldRetry,l=t.onRetry,c=0;return f();function f(){return v.apply(this,arguments)}function v(){return(v=(0,i.A)(s().mark((function t(){var i,v,p;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===n.cancellationError){t.next=2;break}throw n.cancellationError;case 2:return t.prev=2,t.next=5,e();case 5:return i=t.sent,t.abrupt("return",i);case 9:if(t.prev=9,t.t0=t.catch(2),null===n.cancellationError){t.next=13;break}throw n.cancellationError;case 13:if(!(!(0,d.A)(u)&&!u(t.t0)||c++>=o)){t.next=15;break}throw t.t0;case 15:return"function"==typeof l&&l(t.t0,c),v=nt(r,c,a),t.next=19,(0,tt.A)(v);case 19:return p=f(),t.abrupt("return",p);case 21:case"end":return t.stop()}}),t,null,[[2,9]])})))).apply(this,arguments)}}((function(){return function(e,n){var r;return new Promise((function(i,a){try{W.A.debug("DRM: Calling `getLicense`",n);var o=t.getLicense(e,n),s=(0,d.A)(u.timeout)?1e4:u.timeout;s>=0&&(r=setTimeout((function(){a(new ht('"getLicense" timeout exceeded ('+s+" ms)"))}),s)),Promise.resolve(o).then(l,c)}catch(e){c(e)}function l(e){void 0!==r&&clearTimeout(r),i(e)}function c(e){void 0!==r&&clearTimeout(r),a(e)}}))}(c,f)}),{totalRetry:null!=(a=u.retry)?a:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof ht||(0,d.A)(e)||!0!==e.noRetry},onRetry:function(e){return r.onWarning(ct(e))}},l.signal).then((function(t){if(l.isUsed())return Promise.resolve();if((0,d.A)(t))W.A.info("DRM: No license given, skipping session.update");else try{return ft(e,t)}catch(e){l.cancel(),r.onError(e)}})).catch((function(e){if(!l.isUsed()){l.cancel();var t=ct(e);if(!(0,d.A)(e))if(!0===e.fallbackOnLastTry)return W.A.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),void r.onError(new pt(t));r.onError(t)}}))}),l.signal),void f();function c(){return c=(0,i.A)(s().mark((function n(r){var o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=function(){return(u=(0,i.A)(s().mark((function n(){var i,o;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!l.isUsed()){n.next=2;break}return n.abrupt("return");case 2:if("function"!=typeof t.onKeyStatusesChange){n.next=24;break}return n.prev=3,n.next=6,t.onKeyStatusesChange(r,e);case 6:if(i=n.sent,!l.isUsed()){n.next=9;break}return n.abrupt("return");case 9:n.next=18;break;case 11:if(n.prev=11,n.t0=n.catch(3),!a.isCancelled()){n.next=15;break}return n.abrupt("return");case 15:throw o=new X.A("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error"),!(0,d.A)(n.t0)&&(0,Be.A)(n.t0.message)&&(o.message=n.t0.message),o;case 18:if(!(0,d.A)(i)){n.next=22;break}W.A.info("DRM: No license given, skipping session.update"),n.next=24;break;case 22:return n.next=24,ft(e,i);case 24:case"end":return n.stop()}}),n,null,[[3,11]])})))).apply(this,arguments)},o=function(){return u.apply(this,arguments)},W.A.info("DRM: keystatuseschange event received",e.sessionId),n.next=5,Promise.all([o(),Promise.resolve(f())]);case 5:case"end":return n.stop()}}),n)}))),c.apply(this,arguments)}function f(){if(!l.isUsed()&&0!==e.keyStatuses.size){var i=ot(e,t,n),a=i.warning,o=i.blacklistedKeyIds,s=i.whitelistedKeyIds;void 0!==a&&(r.onWarning(a),l.isUsed())||r.onKeyUpdate({whitelistedKeyIds:s,blacklistedKeyIds:o})}}}function ct(e){if(e instanceof ht)return new X.A("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new X.A("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,d.A)(e)&&(0,Be.A)(e.message)&&(t.message=e.message),t}function ft(e,t){return vt.apply(this,arguments)}function vt(){return(vt=(0,i.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W.A.info("DRM: Updating MediaKeySession with message"),e.prev=1,e.next=4,t.update(n);case 4:e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.toString():"`session.update` failed",new X.A("KEY_UPDATE_ERROR",r);case 10:W.A.info("DRM: MediaKeySession update succeeded.");case 11:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}var pt=function(e){function t(n){var r;return r=e.call(this,n.message)||this,Object.setPrototypeOf(r,t.prototype),r.sessionError=n,r}return(0,a.A)(t,e),t}((0,Je.A)(Error)),ht=function(e){function t(t){var n;return n=e.call(this,t)||this,Object.setPrototypeOf(n,pt.prototype),n.message=t,n}return(0,a.A)(t,e),t}((0,Je.A)(Error)),mt=n(4637);function gt(e,t){return yt.apply(this,arguments)}function yt(){return(yt=(0,i.A)(s().mark((function e(t,n){var r,i;return s().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),W.A.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new X.A("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function At(e,t){return _t.apply(this,arguments)}function _t(){return(_t=(0,i.A)(s().mark((function e(t,n){var r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==qe.hasOne(t)){e.next=3;break}return W.A.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 W.A.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return W.A.info("DRM: Setting server certificate on the MediaKeys"),qe.prepare(t),e.prev=8,e.next=11,gt(t,n);case 11:return r=e.sent,qe.set(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,mt.A)(e.t0)?e.t0:new X.A("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)}var bt=n(2137);function St(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;W.A.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var Et=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return N.xW.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return Ve(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:Ue(n)}}))),this._lazyFormattedValues},e}();function Tt(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){if("string"==typeof e)return wt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wt(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var kt=function(e){function t(t,n){var r;r=e.call(this)||this,W.A.debug("DRM: Starting ContentDecryptor logic.");var i=new b.Ay;return r._currentSessions=[],r._canceller=i,r._initDataQueue=[],r._stateData={state:bt.R.Initializing,isMediaKeysAttached:0,isInitDataQueueLocked:!0,data:null},r.error=null,K.onEncrypted(t,(function(e){W.A.debug("DRM: Encrypted event received from media element.");var t=Y(e);null!==t&&r.onInitializationData(t)}),i.signal),function(e,t,n){return Ze.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,d.A)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,D.A)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,D.A)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,D.A)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===bt.R.Initializing&&(r._stateData={state:bt.R.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:0,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,a.A)(t,e),t.hasEmeApis=function(){return!(0,d.A)(K.requestMediaKeySystemAccess)};var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==bt.R.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(0===this._stateData.isMediaKeysAttached){var t=this._stateData.data,n=t.mediaElement,r=t.mediaKeysInfo,a=r.options,o=r.mediaKeys,u=r.mediaKeySystemAccess,l=r.stores,c=r.askedConfiguration;if(!(!0===a.disableMediaKeysAttachmentLock)||(this._stateData={state:bt.R.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:1,data:{mediaKeysInfo:r,mediaElement:n}},this.trigger("stateChange",this._stateData.state),!this._isStopped())){this._stateData.isMediaKeysAttached=1;var f={emeImplementation:K,loadedSessionsStore:l.loadedSessionsStore,mediaKeySystemAccess:u,mediaKeys:o,askedConfiguration:c,keySystemOptions:a};W.A.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return ne.apply(this,arguments)}(n,f,this._canceller.signal).then((0,i.A)(s().mark((function t(){var n,i,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._stateData.isMediaKeysAttached=2,n=a.serverCertificate,(0,d.A)(n)){t.next=7;break}return t.next=5,At(o,n);case 5:"error"===(i=t.sent).type&&e.trigger("warning",i.value);case 7:if(!e._isStopped()){t.next=9;break}return t.abrupt("return");case 9:u=e._stateData.state,e._stateData={state:bt.R.ReadyForContent,isMediaKeysAttached:2,isInitDataQueueLocked:!1,data:{mediaKeysData:r}},u!==bt.R.ReadyForContent&&e.trigger("stateChange",bt.R.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 13:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)}))}}else W.A.warn("DRM: ContentDecryptor's `attach` method called more than once.")},n.dispose=function(){this.removeEventListener(),this._stateData={state:bt.R.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,i.A)(s().mark((function e(t,n){var r,i,a,o,u,l,d,c,f,v,p,h,m,g,y,A,_,b,S,E,T,w,k,I,x,C,M,P,D,N,O,L,U,B=this;return s().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===(o=(0,Z.A)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(u=t.keyIds)){e.next=10;break}return void 0===t.content?W.A.warn("DRM: Unable to fallback from a non-decipherable quality."):Rt(t.content.manifest,t),e.abrupt("return");case 10:return o.record.associateKeyIds(u),void 0!==t.content&&(W.A.hasLevel("DEBUG")&&(l=u.reduce((function(e,t){return e+", "+(0,R.My)(t)}),""),W.A.debug("DRM: Blacklisting new key ids",l)),xt(t.content.manifest,[],u,[])),e.abrupt("return");case 13:e.next=42;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=42;break}d=t.content.period,c=this._currentSessions.filter((function(e){return"created-session"===e.source})),Pt(f=new Set,d),v=Tt(c);case 21:if((p=v()).done){e.next=42;break}h=p.value,m=Array.from(f),g=0,y=m;case 25:if(!(g<y.length)){e.next=40;break}if(A=y[g],!h.record.isAssociatedWithKeyId(A)){e.next=37;break}h.record.associateKeyIds(f.values()),_=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S.value,h.keyStatuses.whitelisted.some((function(e){return(0,H.A)(e,t)}))||h.keyStatuses.blacklisted.some((function(e){return(0,H.A)(e,t)}))||h.keyStatuses.blacklisted.push(t);case 2:case"end":return e.stop()}}),e)})),b=Tt(m);case 31:if((S=b()).done){e.next=35;break}return e.delegateYield(_(),"t0",33);case 33:e.next=31;break;case 35:return xt(t.content.manifest,h.keyStatuses.whitelisted,h.keyStatuses.blacklisted,[]),e.abrupt("return");case 37:g++,e.next=25;break;case 40:e.next=21;break;case 42:return this._lockInitDataQueue(),!0!==a.persistentLicense?E="temporary":It(r)?E="persistent-license":(W.A.warn('DRM: Cannot create "persistent-license" session: not supported'),E="temporary"),T=Q.A.getCurrent(),w=T.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,k=T.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,I="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:w,e.next=48,le(t,i,E,I,this._canceller.signal);case 48:if(x=e.sent,!this._isStopped()){e.next=51;break}return e.abrupt("return");case 51:if(C={record:x.value.keySessionRecord,source:x.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(C),M=x.value,P=M.mediaKeySession,D=M.sessionType,N=!1,dt(P,a,r.keySystem,{onKeyUpdate:function(e){var n=Ct(t,C.record,a.singleLicensePer,"created-session"===C.source,e.whitelistedKeyIds,e.blacklistedKeyIds);if(C.record.associateKeyIds(n.whitelisted),C.record.associateKeyIds(n.blacklisted),C.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==C.record.getAssociatedKeyIds().length&&"persistent-license"===D&&null!==i.persistentSessionsStore&&!N){var r=i.persistentSessionsStore;St(r,k-1),r.add(t,C.record.getAssociatedKeyIds(),P),N=!0}void 0!==t.content&&xt(t.content.manifest,n.whitelisted,n.blacklisted,[]),B._unlockInitDataQueue()},onWarning:function(e){B.trigger("warning",e)},onError:function(e){var n;if(e instanceof it){W.A.warn("DRM: A session's closing condition has been triggered"),B._lockInitDataQueue();var r=B._currentSessions.indexOf(C);return r>=0&&B._currentSessions.splice(r),void 0!==t.content&&xt(t.content.manifest,[],[],C.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(P.sessionId),i.loadedSessionsStore.closeSession(P).catch((function(e){var t=e instanceof Error?e:"unknown error";W.A.warn("DRM: failed to close expired session",t)})).then((function(){return B._unlockInitDataQueue()})).catch((function(e){return B._onFatalError(e)})),void(B._isStopped()||B.trigger("warning",e.reason))}if(e instanceof pt){if(C.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;W.A.info("DRM: blacklisting Representations based on protection data."),Rt(a,t)}B._unlockInitDataQueue()}else B._onFatalError(e)}},this._canceller.signal),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==x.type){e.next=72;break}return O=t.values.constructRequestData(),e.prev=59,e.next=62,i.loadedSessionsStore.generateLicenseRequest(P,t.type,O);case 62:e.next=72;break;case 64:if(e.prev=64,e.t1=e.catch(59),null!==(L=i.loadedSessionsStore.getEntryForSession(P))&&"none"===L.closingStatus.type){e.next=71;break}return(U=this._currentSessions.indexOf(C))>=0&&this._currentSessions.splice(U,1),e.abrupt("return",Promise.resolve());case 71:throw new X.A("KEY_GENERATE_REQUEST_ERROR",e.t1 instanceof Error?e.t1.toString():"Unknown error");case 72:return e.abrupt("return",Promise.resolve());case 73:case"end":return e.stop()}}),e,this,[[59,64]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,Z.A)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;if(!0===e.forceSessionRecreation)return this.removeSessionForInitData(e,t),!1;var a=i.blacklistedSessionError;if(!(0,d.A)(a))return void 0===e.type||void 0===e.content?(W.A.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(W.A.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,i=function(){var e=r.value;if(t.some((function(t){return(0,H.A)(t,e)})))return{v:!0}},a=ke(e);!(r=a()).done;)if(n=i())return n.v;return!1}(e.keyIds,s)}else{var u=i.keyStatuses.whitelisted;o=!xe(e.keyIds,u)}if(o)return void 0===e.content?(W.A.error("DRM: Cannot forbid key id, the content is unknown."),!0):(W.A.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),xt(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return W.A.debug("DRM: Init data already processed. Skipping it."),!0;var l=this._currentSessions.indexOf(i);return-1===l?W.A.error("DRM: Unable to remove processed init data: not found."):(W.A.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(l,1)),!1},n.removeSessionForInitData=function(e,t){var n=t.stores,r=n.loadedSessionsStore.reuse(e);null!==r&&n.loadedSessionsStore.closeSession(r.mediaKeySession).catch((function(){return W.A.error("DRM: Cannot close the session from the loaded session store")}));var i=(0,Z.A)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0!==i){var a=this._currentSessions.indexOf(i);-1!==a&&(W.A.debug("DRM: A session from a processed init is removed due to forceSessionRecreation policy."),this._currentSessions.splice(a,1))}},n._onFatalError=function(e){if(!this._canceller.isUsed()){var t=e instanceof Error?e:new $.A("NONE","Unknown decryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:bt.R.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===bt.R.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===bt.R.Disposed||this._stateData.state===bt.R.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(){2===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):W.A.error("DRM: Trying to unlock in the wrong state")},t}(_.A);function It(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,J.A)(t,"persistent-license")}function xt(e,t,n,r){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var i=e.contentProtections.keyIds;if(void 0!==i)for(var a,o=Tt(i);!(a=o()).done;){for(var s,u=a.value,l=Tt(n);!(s=l()).done;){var d=s.value;if((0,H.A)(d,u.keyId))return!1}for(var c,f=Tt(t);!(c=f()).done;){var v=c.value;if((0,H.A)(v,u.keyId))return!0}for(var p,h=Tt(r);!(p=h()).done;){var m=p.value;if((0,H.A)(m,u.keyId))return}}return e.decipherable}))}function Rt(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i,a,o=function(){var e=a.value;if((void 0===t.type||e.type===t.type)&&t.values.getFormattedValues().every((function(t){return e.values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,H.A)(e.data,t.data)}))})))return{v:!1}},s=Tt(null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[]);!(a=s()).done;)if(i=o())return i.v;return e.decipherable}))}function Ct(e,t,n,r,i,a){for(var o,s,u=[].concat(i,a),l=function(){var e=s.value;u.some((function(t){return(0,H.A)(t,e)}))||(W.A.hasLevel("DEBUG")&&W.A.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,R.My)(e)),u.push(e))},d=Tt(t.getAssociatedKeyIds());!(s=d()).done;)l();if(void 0!==n&&"init-data"!==n){var c=e.keyIds,f=e.content;if(void 0!==c){var v=c.filter((function(e){return!u.some((function(t){return(0,H.A)(t,e)}))}));v.length>0&&(W.A.hasLevel("DEBUG")&&W.A.debug("DRM: init data keys missing in the license, blacklisting them",v.map((function(e){return(0,R.My)(e)})).join(", ")),u.push.apply(u,v))}if(r&&void 0!==f)if("content"===n){for(var p,h=new Set,m=Tt(f.manifest.periods);!(p=m()).done;){Pt(h,p.value)}Mt(h,u)}else if("periods"===n)for(var g,y=Tt(f.manifest.periods);!(g=y()).done;){var A=g.value,_=new Set;if(Pt(_,A),(null===(o=e.content)||void 0===o?void 0:o.period.id)===A.id)Mt(_,u);else for(var b=Array.from(_),S=function(){var e=T[E];if(u.some((function(t){return(0,H.A)(t,e)})))return Mt(_,u),1},E=0,T=b;E<T.length&&!S();E++);}}return{whitelisted:i,blacklisted:u.slice(i.length)}}function Mt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return(0,H.A)(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Pt(e,t){for(var n,r=Tt(t.getAdaptations());!(n=r()).done;)for(var i,a=Tt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=Tt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}var Dt=kt},2137:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),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"}(r||(r={}))},7365:function(e,t){"use strict";var n=new WeakMap;t.A={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)}}},5963:function(e,t,n){"use strict";n.d(t,{A:function(){return m}});var r=n(7387),i=n(3116),a=n(9477),o=n(7994),s=n(6787),u=n(8315),l=n(2507),d=n(4640),c=n(5097),f=n(107),v=n(6899),p=n(3137),h=n(8345),m=function(e){function t(t){var n;return(n=e.call(this)||this)._settings=t,n._initCanceller=new l.Ay,n}(0,r.A)(t,e);var n=t.prototype;return n.prepare=function(){},n.start=function(e,t){var n=this,r=this._initCanceller.signal,s=this._settings,l=s.keySystems,d=s.speed,c=s.url;(0,i.A)(e);var f=new u.A(null);f.finish();var m=(0,v.A)(e,l,f,{onError:function(e){return n._onFatalError(e)},onWarning:function(e){return n.trigger("warning",e)}},r);(0,h.A)(e,(function(e){return n._onFatalError(e)}),r);var g=new p.A(t,null,d);g.addEventListener("stalled",(function(e){return n.trigger("stalled",e)})),g.addEventListener("unstalled",(function(){return n.trigger("unstalled",null)})),g.addEventListener("warning",(function(e){return n.trigger("warning",e)})),r.register((function(){g.destroy()})),g.start(),m.onUpdate((function(s,u){"uninitialized"!==s.initializationState.type&&(u(),a.A.info("Setting URL to HTMLMediaElement",c),e.src=c,r.register((function(){a.A.info("Init: Removing directfile src from media element",e.src),(0,i.A)(e)})),"awaiting-media-link"===s.initializationState.type?(s.initializationState.value.isMediaLinked.setValue(!0),m.onUpdate((function(r,i){"initialized"===r.initializationState.type&&(i(),n._seekAndPlay(e,t))}),{emitCurrentValue:!0,clearSignal:r})):((0,o.h)("initialized"===s.initializationState.type),n._seekAndPlay(e,t)))}),{emitCurrentValue:!0,clearSignal:r})},n.updateContentUrls=function(e,t){throw new Error("Cannot update content URL of directfile contents")},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.cancel(),this.trigger("error",e)},n._seekAndPlay=function(e,t){var n=this,r=this._initCanceller.signal,i=this._settings,o=i.autoPlay,u=i.startAt;(0,f.A)(e,t,(function(){a.A.debug("Init: Calculating initial time");var t=function(e,t){if((0,s.A)(t))return 0;if(!(0,s.A)(t.position))return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if("number"==typeof t.fromLastPosition){if(!(0,s.A)(n)&&isFinite(n))return Math.max(0,n+t.fromLastPosition);if(e.seekable.length>0){var r=e.seekable.end(e.seekable.length-1);if(isFinite(r))return Math.max(0,r+t.fromLastPosition)}return void a.A.warn("Init: startAt.fromLastPosition set but no known duration, it may be too soon to seek")}if("number"==typeof t.fromLivePosition){var i=e.seekable.length>0?e.seekable.end(0):n;return(0,s.A)(i)?(a.A.warn("Init: startAt.fromLivePosition set but no known live position, beginning at 0."),0):Math.max(0,i+t.fromLivePosition)}if(null!=t.percentage){if((0,s.A)(n)||!isFinite(n))return a.A.warn("Init: startAt.percentage set but no known duration, beginning at 0."),0;var o=t.percentage;return o>=100?n:o<=0?0:n*(+o/100)}return 0}(e,u);return a.A.debug("Init: Initial time calculated:",t),t}),o,(function(e){return n.trigger("warning",e)}),!0,r).autoPlayResult.then((function(){return(0,c.A)(t,e,!0,r).onUpdate((function(e,t){e&&(t(),n.trigger("loaded",{segmentBuffersStore:null}))}),{emitCurrentValue:!0,clearSignal:r})})).catch((function(e){r.isCancelled()||n._onFatalError(e)}))},t}(d.Y)},1737:function(e,t,n){"use strict";n.d(t,{A:function(){return nn}});var r=n(467),i=n(7387),a=n(4756),o=n.n(a);var s=n(443),u=s.A7,l=n(5151),d=n(5575),c=n(9477),f=n(7994),v=n(4339),p=n(8935),h=n(8315),m=n(2507),g=n(8060),y=n(3650),A=n(3786);function _(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 b=function(){function e(e){this._levelsMap=_(e).map((function(e){return e+4})),this._bitrates=e,this._lastUnsuitableQualityTimestamp=void 0,this._blockRaiseDelay=6e3,c.A.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}var t=e.prototype;return t.onAddedSegment=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null!=i){for(var s,u=-1,l=0;l<n.length;l++){var d=n[l];if(d===i)u=l;else if(d>i)break}if(u<0||n.length!==t.length)return c.A.error("ABR: Current Bitrate not found in the calculated levels"),void(this._currentEstimate=n[0]);void 0!==a&&(s=0===o?a.score:a.score/o);var f=isFinite(r)?r:0,v=performance.now();if(f<t[u]||void 0!==s&&s<1&&1===(null==a?void 0:a.confidenceLevel)){if((void 0===this._lastUnsuitableQualityTimestamp?-1:v-this._lastUnsuitableQualityTimestamp)<this._blockRaiseDelay+9e3){var p=this._blockRaiseDelay+3e3;this._blockRaiseDelay=Math.min(p,15e3),c.A.debug("ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality",this._blockRaiseDelay)}else{var h=this._blockRaiseDelay-1e3;this._blockRaiseDelay=Math.max(6e3,h),c.A.debug("ABR: Lowering quality in BufferBasedChooser",this._blockRaiseDelay)}this._lastUnsuitableQualityTimestamp=v;for(var m=(0,A.A)(n,(function(e){return e===i}))-1;m>=0;m--)if(f>=t[m])return void(this._currentEstimate=n[m]);this._currentEstimate=n[0]}else if(void 0!==this._lastUnsuitableQualityTimestamp&&v-this._lastUnsuitableQualityTimestamp<this._blockRaiseDelay||void 0===s||s<1.15||1!==(null==a?void 0:a.confidenceLevel))this._currentEstimate=i;else{var g=t[u],y=function(){for(var e=u+1;e<t.length;e++)if(t[e]>g)return e}();if(void 0!==y)if(r>=t[y])return c.A.debug("ABR: Raising quality in BufferBasedChooser",n[y]),void(this._currentEstimate=n[y]);this._currentEstimate=i}}else this._currentEstimate=n[0]},t.getLastEstimate=function(){return this._currentEstimate},e}(),S=n(1729),E=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}();function T(e){if(!(e.progress.length<5)){for(var t=new E(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 w(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var k=function(){function e(e,t){var n=l.A.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,d=e.position,f=e.duration,v=isFinite(u)?u:0,p=l.A.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(f)||v+d.last<f-p?!this._inStarvationMode&&v<=s.starvationGap?(c.A.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&v>=s.outOfStarvationGap&&(c.A.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(c.A.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&(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.last+u);if(1===l.length){var d=l[0],c=performance.now(),f=1.5*d.content.segment.duration;if(f=Math.min(f,3e3),f=Math.max(f,12e3),!(c-d.requestTimestamp<f)){var v=d.progress.length>0?d.progress[d.progress.length-1]:void 0,p=T(d);if(void 0!==v&&void 0!==p){var h=w(v,p);if((c-v.timestamp)/1e3<=h&&h-u/o>2500)return p}if(d.content.segment.complete){var m=d.content.segment.duration,g=(c-d.requestTimestamp)/1e3;if(null!=n&&!(g<=(1.5*m+2)/o)){var y=m/g,A=n.bitrate*Math.min(.7,y);return void 0===i||A<i?A:void 0}}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(c.A.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)&&function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,S.A)(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=T(a);if(void 0===s||void 0===u)return!0;var l=w(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode)},e}();function I(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){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var R=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=C(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(c.A.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,A.A)(e,(function(e){return e.id===t.id}));if(n<0)return c.A.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 d=C(e,n);if(null!==d)return d}return n},t._canGuessHigher=function(e,t,n){var r=n.score,i=n.confidenceLevel;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.score<1.01)return!0;if((void 0===t||t.score<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=I(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 d=T(u);if(void 0!==d&&d<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n.confidenceLevel&&n.score>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function C(e,t){var n=e.length,r=(0,A.A)(e,(function(e){return e.id===t.id}));if(r<0)return c.A.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var M=function(){function e(){var e=l.A.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new E(t),this._slowEWMA=new E(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<l.A.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=l.A.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=l.A.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new E(t),this._slowEWMA=new E(n),this._bytesSampled=0},e}();var P=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}(),D=n(4324),N=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):c.A.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&c.A.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,D.A)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),O=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 E(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(c.A.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{score:n.getEstimate(),confidenceLevel:r>=5&&i>=10?1:0}}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function L(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,A.A)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var U=new h.A(-1);U.finish();var B=new h.A(0);B.finish();var F=new h.A(1/0);F.finish();var V=new h.A(void 0);V.finish();var z=new h.A(1/0);z.finish();var K=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,d,f,v){var p,_,E,T,w,I,x,C=e.adaptation.type,D=function(e){var n=t[e];if(null==n){c.A.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new M;return t[e]=r,r}return n}(C),K=null!==(p=n[C])&&void 0!==p?p:U,W=null!==(_=r[C])&&void 0!==_?_:B,G=null!==(E=i[C])&&void 0!==E?E:F,H=null!==(T=a[C])&&void 0!==T?T:0;return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,d=e.maxAutoBitrate,f=e.minAutoBitrate,v=e.playbackObserver,p=e.representations,_=new O,E=new k(null!=o?o:0,s),T=new N,w=g.A,I={metrics:U,requestBegin:B,requestProgress:F,requestEnd:V,addedSegment:function(e){w(e)}},x=new m.Ay;x.linkToSignal(t);var C=M(p.getValue(),x.signal);return p.onUpdate(D,{clearSignal:t}),{estimates:C,callbacks:I};function M(e,t){if(0===e.length)return new h.A({representation:null,bitrate:void 0,knownStableBitrate:void 0,manual:!1,urgent:!0});if(1===e.length)return new h.A({bitrate:void 0,representation:e[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var o=!1,p=new b(e.map((function(e){return e.bitrate}))),m=new P,k=new R(_,m),I=v.getReference().getValue(),x=new h.A(M());return v.listen((function(e){I=e,C()}),{includeLastObservation:!1,clearSignal:t}),w=function(e){if(null!==I){var t=I,n=t.position,r=t.speed,i=e.buffered,a=(0,y.vK)(i,n.last),o=e.content.representation,s=_.getEstimate(o),u={bufferGap:a,currentBitrate:o.bitrate,currentScore:s,speed:r};p.onAddedSegment(u),C()}},t.register((function(){w=g.A})),u.onUpdate(C,{clearSignal:t}),f.onUpdate(C,{clearSignal:t}),d.onUpdate(C,{clearSignal:t}),a.limitWidth.onUpdate(C,{clearSignal:t}),a.limitWidth.onUpdate(C,{clearSignal:t}),x;function C(){x.setValue(M())}function M(){var t=u.getValue();if(t>=0)return{representation:L(e,t,0,1/0),bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0};var v=I,h=v.bufferGap,g=v.position,y=v.maximumPosition,b=a.limitWidth.getValue(),w=a.throttleBitrate.getValue(),x=i.getValue(),R=f.getValue(),C=d.getValue(),M=function(e,t,n){var r=e;n<1/0&&(r=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,A.A)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){var n,r;return(null!==(n=e.width)&&void 0!==n?n:0)-(null!==(r=t.width)&&void 0!==r?r:0)})),r=(0,S.A)(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}))}(r,t));return r}(e,b,w),P=T.getRequests(),D=E.getBandwidthEstimate(I,n,x,P,m.bandwidth),N=D.bandwidthEstimate,O=D.bitrateChosen,U=_.getLastStableRepresentation(),B=null===U?void 0:U.bitrate/(I.speed>0?I.speed:1),F=l.A.getCurrent(),V=F.ABR_ENTER_BUFFER_BASED_ALGO,z=F.ABR_EXIT_BUFFER_BASED_ALGO;o&&h<=z?o=!1:!o&&isFinite(h)&&h>=V&&(o=!0);var K=L(M,O,R,C),W=p.getLastEstimate(),G=K.bitrate,H=null;o&&void 0!==W&&W>G&&(G=(H=L(M,W,R,C)).bitrate);var q=null;return s&&null!==x&&r.manifest.isDynamic&&y-g.last<40&&(q=k.getGuess(e,I,x,G,P)),null!==q&&q.bitrate>G?(c.A.debug("ABR: Choosing representation with guess-based estimation.",q.bitrate,q.id),m.update(q,N,2),{bitrate:N,representation:q,urgent:null===x||q.bitrate<x.bitrate,manual:!1,knownStableBitrate:B}):null!==H?(c.A.debug("ABR: Choosing representation with buffer-based estimation.",H.bitrate,H.id),m.update(H,N,0),{bitrate:N,representation:H,urgent:E.isUrgent(H.bitrate,x,P,I),manual:!1,knownStableBitrate:B}):(c.A.debug("ABR: Choosing representation with bandwidth estimation.",K.bitrate,K.id),m.update(K,N,1),{bitrate:N,representation:K,urgent:E.isUrgent(K.bitrate,x,P,I),manual:!1,knownStableBitrate:B})}}function D(){var e=p.getValue();x.cancel(),(x=new m.Ay).linkToSignal(t),M(e,x.signal).onUpdate((function(e){C.setValue(e)}),{clearSignal:x.signal,emitCurrentValue:!0})}function U(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,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;_.addSample(s,t/1e3,u)}}function B(e){T.add(e)}function F(e){T.addProgress(e)}function V(e){T.remove(e.id)}}({bandwidthEstimator:D,context:e,currentRepresentation:u,filters:{limitWidth:null!==(w=o.limitWidth[C])&&void 0!==w?w:V,throttleBitrate:null!==(x=null!==(I=o.throttleBitrate[C])&&void 0!==I?I:o.throttle[C])&&void 0!==x?x:z},initialBitrate:H,manualBitrate:K,minAutoBitrate:W,maxAutoBitrate:G,playbackObserver:f,representations:d,lowLatencyMode:s},v)}},W=n(5283),G=n(874),H=n(8568),q=n(79),j=n(6787),Y=n(3506),Q=n(7941);function X(e){return e instanceof Y.A?new Q.A("PIPELINE_LOAD_ERROR",e):(0,G.A)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var $=n(5497),Z=n(7004),J=n(4637),ee=n(2432),te=n(7021);function ne(e){return e instanceof Y.A?e.type===$.yl.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===$.yl.TIMEOUT||e.type===$.yl.ERROR_EVENT:e instanceof Z.A?"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,J.A)(e)&&"INTEGRITY_ERROR"===e.code}function re(e){return e instanceof Y.A?e.type===$.yl.ERROR_EVENT&&!1===navigator.onLine:e instanceof Z.A&&e.isOfflineError}function ie(e,t,n,r,i){return ae.apply(this,arguments)}function ae(){return ae=(0,r.A)(o().mark((function e(t,n,i,a,s){var u,l,d,f,v,p,h,y,A,_,b,S,E,T;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T=function(e){var t;if(0===p.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=p.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=p.get(t))||void 0===r?void 0:r.blockedUntil;return void 0!==i&&i<=n&&(i=void 0),void 0===e?[t,i]:void 0===i?void 0===e[1]?e:[t,void 0]:void 0===e[1]?e:i<e[1]?[t,i]:e}),void 0))||void 0===t?void 0:t[0]},E=function(e,t){var r=p.get(e);if(void 0===r||void 0===r.blockedUntil)return A(e);var i=performance.now(),a=r.blockedUntil-i;if(a<=0)return A(e);var o=new m.Ay,u=o.linkToSignal(s);return new Promise((function(r,i){function l(e){u(),r(e)}function d(e){u(),i(e)}null==n||n.addEventListener("priorityChange",(function(){var n=y();if(s.isCancelled())throw s.cancellationError;if(void 0===n)return d(t);n!==e&&(o.cancel(),E(n,t).then(l,d))}),o.signal),(0,ee.A)(a,o.signal).then((function(){return A(e).then(l,d)}),g.A)}))},S=function(){return(S=(0,r.A)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=y(),!s.isCancelled()){e.next=3;break}throw s.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(v(t),!s.isCancelled()){e.next=8;break}throw s.cancellationError;case 8:return e.abrupt("return",E(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},b=function(e){return S.apply(this,arguments)},_=function(){return(_=(0,r.A)(o().mark((function e(t){var r,a,c,v,h,g,y;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i(t,s);case 3:return r=e.sent,e.abrupt("return",r);case 7:if(e.prev=7,e.t0=e.catch(0),!m.Ay.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),o=e.t0,a=re(o)?2:1,void 0===(c=p.get(t))?(c={errorCounter:1,lastErrorType:a,blockedUntil:void 0,isBlacklisted:!1},p.set(t,c)):a!==c.lastErrorType?(c.errorCounter=1,c.lastErrorType=a):c.errorCounter++,ne(e.t0)){e.next=19;break}return c.blockedUntil=void 0,c.isBlacklisted=!0,e.abrupt("return",b(e.t0));case 19:return v=2===a?f:d,c.errorCounter>v?(c.blockedUntil=void 0,c.isBlacklisted=!0):(h=c.errorCounter,g=Math.min(u*Math.pow(2,h-1),l),y=(0,te.A)(g),c.blockedUntil=performance.now()+y),e.abrupt("return",b(e.t0));case 22:case"end":return e.stop()}var o}),e,null,[[0,7]])})))).apply(this,arguments)},A=function(e){return _.apply(this,arguments)},y=function(){if(null===t){var e=p.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return T(t);var r=n.getCdnPreferenceForResource(t);return T(r)},null===s.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(s.cancellationError));case 9:if(u=a.baseDelay,l=a.maxDelay,d=a.maxRetryRegular,f=a.maxRetryOffline,v=a.onRetry,null!==t&&0===t.length&&c.A.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),p=new Map,void 0!==(h=y())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",A(h));case 16:case"end":return e.stop()}}),e)}))),ae.apply(this,arguments)}function oe(e,t,n){return ie(null,null,e,t,n)}function se(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){if("string"==typeof e)return ue(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}(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 ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var le=function(e){function t(t,n,r){var i;return(i=e.call(this)||this).scheduleManualRefresh=g.A,i._manifestUrls=t,i._pipelines=n.manifest,i._settings=r,i._canceller=new m.Ay,i._isStarted=!1,i._isRefreshPending=!1,i._consecutiveUnsafeMode=0,i._prioritizedContentUrl=null,i}(0,i.A)(t,e);var n=t.prototype;return n.dispose=function(){this._canceller.cancel(),this.removeEventListener()},n.start=function(){var e=this;if(!this._isStarted){this._isStarted=!0;var t=this._settings.initialManifest;(t instanceof H.Ay?Promise.resolve({manifest:t}):void 0!==t?this.parse(t,{previousManifest:null,unsafeMode:!1},void 0):this._fetchManifest(void 0).then((function(e){return e.parse({previousManifest:null,unsafeMode:!1})}))).then((function(t){e.trigger("manifestReady",t.manifest),e._canceller.isUsed()||e._recursivelyRefreshManifest(t.manifest,t)})).catch((function(t){return e._onFatalError(t)}))}},n.updateContentUrls=function(e,t){var n;this._prioritizedContentUrl=null!==(n=null==e?void 0:e[0])&&void 0!==n?n:void 0,t&&this.scheduleManualRefresh({enablePartialRefresh:!1,delay:0,canUseUnsafeMode:!1})},n._fetchManifest=function(){var e=(0,r.A)(o().mark((function e(t){var n,r,i,a,s,u,d,c,v,p,h=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=function(e){var t=a.loadManifest,n=(0,j.A)(i.requestTimeout)?l.A.getCurrent().DEFAULT_REQUEST_TIMEOUT:i.requestTimeout;n<0&&(n=void 0);return oe((function(){return t(e,{timeout:n},r)}),u,r)},v=function(e){var t=a.resolveManifestUrl;(0,f.h)(void 0!==t);return oe((function(){return t(e,r)}),u,r)},r=this._canceller.signal,i=this._settings,a=this._pipelines,s=null!=t?t:null===(n=this._manifestUrls)||void 0===n?void 0:n[0],u=this._getBackoffSetting((function(e){h.trigger("warning",X(e))})),d=void 0===a.resolveManifestUrl?p(s):v(s).then(p),e.prev=8,e.next=11,d;case 11:return c=e.sent,e.abrupt("return",{parse:function(e){return h._parseLoadedManifest(c,e,s)}});case 15:throw e.prev=15,e.t0=e.catch(8),X(e.t0);case 18:case"end":return e.stop()}}),e,this,[[8,15]])})));return function(t){return e.apply(this,arguments)}}(),n.parse=function(e,t,n){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t,n)},n._parseLoadedManifest=function(){var e=(0,r.A)(o().mark((function e(t,n,i){var a,s,u,l,d,f,v,p,h,m,g,y,A,_,b,S,E=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S=function(e){b(e.contentWarnings);var t=performance.now()-s;return c.A.info("MF: Manifest parsed in "+t+"ms"),{manifest:e,sendingTime:d,receivedTime:f,parsingTime:t}},b=function(e){for(var t,n=se(e);!(t=n()).done;){var r=t.value;if(u.isCancelled())return;var i=(0,G.A)(r,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});l("warning",i)}},_=function(){return(_=(0,r.A)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,oe(t,v,u);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),X(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},A=function(e){return _.apply(this,arguments)},s=performance.now(),u=this._canceller.signal,l=this.trigger.bind(this),d=t.sendingTime,f=t.receivedTime,v=this._getBackoffSetting((function(e){E.trigger("warning",X(e))})),p=null!=i?i:null===(a=this._manifestUrls)||void 0===a?void 0:a[0],h={externalClockOffset:n.externalClockOffset,unsafeMode:n.unsafeMode,previousManifest:n.previousManifest,originalUrl:p},e.prev=11,m=this._pipelines.parseManifest(t,h,b,u,A),m instanceof Promise){e.next=17;break}return e.abrupt("return",S(m.manifest));case 17:return e.next=19,m;case 19:return g=e.sent,y=g.manifest,e.abrupt("return",S(y));case 22:e.next=28;break;case 24:throw e.prev=24,e.t0=e.catch(11),(0,G.A)(e.t0,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});case 28:case"end":return e.stop()}}),e,this,[[11,24]])})));return function(t,n,r){return e.apply(this,arguments)}}(),n._getBackoffSetting=function(e){var t=l.A.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,d=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!=d?d:r}},n._recursivelyRefreshManifest=function(e,t){var n=this,r=t.sendingTime,i=t.parsingTime,a=t.updatingTime,o=l.A.getCurrent(),s=o.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,u=o.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,d=void 0!==i?i+(null!=a?a:0):void 0,f=this._consecutiveUnsafeMode>0?this._consecutiveUnsafeMode<s:void 0!==d&&d>=u,v=void 0===r?0:performance.now()-r,p=Math.max(this._settings.minimumManifestUpdateInterval-v,0),h=new m.Ay;if(h.linkToSignal(this._canceller.signal),this.scheduleManualRefresh=function(t){var i=t.enablePartialRefresh,a=t.delay,o=t.canUseUnsafeMode&&f,s=void 0===r?0:performance.now()-r,u=Math.max(n._settings.minimumManifestUpdateInterval-s,0),l=setTimeout((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:i,unsafeMode:o})}),Math.max((null!=a?a:0)-s,u));h.signal.register((function(){clearTimeout(l)}))},null!==e.expired){var y=setTimeout((function(){var t;null===(t=e.expired)||void 0===t||t.then((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),g.A)}),p);h.signal.register((function(){clearTimeout(y)}))}if(void 0!==e.lifetime&&e.lifetime>=0){var A,_=1e3*e.lifetime-v;void 0===d?A=_:e.lifetime<3&&d>=100?(A=Math.min(Math.max(3e3-v,Math.max(_,0)+d),6*_),c.A.info("MUS: Manifest update rythm is too frequent. Postponing next request.",_,A)):d>=1e3*e.lifetime/10?(A=Math.min(Math.max(_,0)+d,6*_),c.A.info("MUS: Manifest took too long to parse. Postponing next request",A,A)):A=_;var b=setTimeout((function(){h.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),Math.max(A,p));h.signal.register((function(){clearTimeout(b)}))}},n._triggerNextManifestRefresh=function(e,t){var n,r,i=this,a=t.enablePartialRefresh,o=t.unsafeMode,s=e.updateUrl;null!==this._prioritizedContentUrl?(n=!0,r=this._prioritizedContentUrl,this._prioritizedContentUrl=null):r=(n=!a||void 0===s)?e.getUrl():s;var u=e.clockOffset;o?(this._consecutiveUnsafeMode+=1,c.A.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(this._consecutiveUnsafeMode)+" consecutive time.")):this._consecutiveUnsafeMode>0&&(c.A.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(this._consecutiveUnsafeMode)+" consecutive times."),this._consecutiveUnsafeMode=0),this._isRefreshPending||(this._isRefreshPending=!0,this._fetchManifest(r).then((function(t){return t.parse({externalClockOffset:u,previousManifest:e,unsafeMode:o})})).then((function(t){i._isRefreshPending=!1;var r=t.manifest,a=t.sendingTime,o=t.parsingTime,s=performance.now();if(n)e.replace(r);else try{e.update(r)}catch(t){var u=t instanceof Error?t.message:"unknown error";c.A.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully");var d=l.A.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,f=void 0===a?0:performance.now()-a,v=Math.max(i._settings.minimumManifestUpdateInterval-f,0),p=g.A,h=setTimeout((function(){p(),i._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:!1})}),Math.max(d-f,v));return void(p=i._canceller.signal.register((function(){clearTimeout(h)})))}var m=performance.now()-s;i._recursivelyRefreshManifest(e,{sendingTime:a,parsingTime:o,updatingTime:m})})).catch((function(e){i._isRefreshPending=!1,i._onFatalError(e)})))},n._onFatalError=function(e){this._canceller.isUsed()||(this.trigger("error",e),this.dispose())},t}(q.A);var de=le;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){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var ve=function(e){function t(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=ce(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,i.A)(t,e);var n=t.prototype;return n.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},n.downgradeCdn=function(e){var t=this,n=pe(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=l.A.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=pe(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},n._innerGetCdnPreferenceForResource=function(e){var t=this,n=e.reduce((function(e,n){return t._downgradedCdnList.metadata.some((function(e){return e.id===n.id&&e.baseUrl===n.baseUrl}))?e[1].push(n):e[0].push(n),e}),[[],[]]),r=n[0],i=n[1];return r.concat(i)},n._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},t}(q.A);function pe(e,t){return 0===e.length?-1:void 0!==t.id?(0,A.A)(e,(function(e){return e.id===t.id})):(0,A.A)(e,(function(e){return e.baseUrl===t.baseUrl}))}var he=n(7841),me=n(4031),ge=n(8795),ye=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}(),Ae=(0,ge.A)();var _e=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("TP: 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,n,r){var i,a=this;return(0,v.A)(r,(function(o,s){return i={hasEnded:!1,priority:t,trigger:function(){if(!i.hasEnded){var e=function(){u(),a._endTask(i)},t=new m.Ay,u=t.linkToSignal(r);i.interrupter=t,t.signal.register((function(){i.interrupter=null,r.isCancelled()||n.beforeInterrupted()})),a._minPendingPriority=null===a._minPendingPriority?i.priority:Math.min(a._minPendingPriority,i.priority),a._pendingTasks.push(i),i.taskFn(t.signal).then((function(t){n.beforeEnded(),e(),o(t)})).catch((function(n){!r.isCancelled()&&t.isUsed()&&n instanceof m.AL||function(t){e(),s(t)}(n)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i),function(){return a._endTask(i)}}))},t._endTask=function(e){e.hasEnded=!0;var t=be(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=be(e.taskFn,this._pendingTasks);if(n<0)return;this._pendingTasks.splice(n,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.updatePriority=function(e,t){var n=be(e,this._waitingQueue);if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._findAndRunWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=be(e,this._pendingTasks);if(i<0)c.A.warn("TP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority?this._minPendingPriority=t:this._minPendingPriority===o&&(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._findAndRunWaitingQueueTask(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._findAndRunWaitingQueueTask=function(e){return e>=this._waitingQueue.length||e<0?(c.A.warn("TP : Tried to start a non existing task"),!1):(this._waitingQueue.splice(e,1)[0].trigger(),!0)},t._interruptPendingTask=function(e){var t,n=be(e.taskFn,this._pendingTasks);n<0?c.A.warn("TP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(n,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})))),null===(t=e.interrupter)||void 0===t||t.cancel())},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}();function be(e,t){return(0,A.A)(t,(function(t){return t.taskFn===e}))}var Se=function(){function e(e,t,n){var r=new ve(n),i=l.A.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new _e({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,i,a,s=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=l.A.getCurrent(),s=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,u=o.DEFAULT_REQUEST_TIMEOUT,d=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,f=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:s,maxRetryOffline:null!=r?r:d,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?f.LOW_LATENCY:f.REGULAR,requestTimeout:(0,j.A)(a)?u:a}}(e,this._backoffOptions),u=function(e,t,n,i,a){var s={timeout:a.requestTimeout<0?void 0:a.requestTimeout},u=(0,me.A)(["audio","video"],e)?new ye:void 0,l=t.loadSegment,d=t.parseSegment;return function(){var e=(0,r.A)(o().mark((function e(t,r,f){var v,h,g,y,A,_,b,S,E,T,w,k,I,x,R,C,M,P;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P=function(){var e;E||!(0,j.A)(_)&&void 0!==_.size&&void 0!==_.requestDuration&&b.length>0&&b.every((function(e){return e}))&&(E=!0,null===(e=i.onMetrics)||void 0===e||e.call(i,{size:_.size,requestDuration:_.requestDuration,content:t,segmentDuration:S}))},M=function(e){r.onRetry(X(e))},C=function(e,n){b.push(!1);var r=b.length-1;return function(i){var a={data:e,isChunked:n};try{var o=d(a,t,i);return b[r]||(S=void 0!==S&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?S+o.chunkInfos.duration:void 0,b[r]=!0,P()),o}catch(e){throw(0,G.A)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},R=function(e){return l(e,t,s,f,T)},x=function(){var e;void 0===_&&(c.A.debug("SF: Segment request cancelled",y),_=null,null===(e=i.onRequestEnd)||void 0===e||e.call(i,{id:A}))},y=(0,he.M)(t),A=Ae(),b=[],S=0,E=!1,T={onProgress:function(e){var t;void 0===_&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=i.onProgress)||void 0===t||t.call(i,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:A}))},onNewChunk:function(e){r.onChunk(C(e,!0))}},null===(w=void 0!==u?u.get(t):null)){e.next=16;break}return c.A.debug("SF: Found wanted segment in cache",y),r.onChunk(C(w,!1)),e.abrupt("return",Promise.resolve());case 16:return c.A.debug("SF: Beginning request",y),null===(v=i.onRequestBegin)||void 0===v||v.call(i,{requestTimestamp:performance.now(),id:A,content:t}),f.register(x),e.prev=19,e.next=22,ie(t.representation.cdnMetadata,n,R,(0,p.A)({onRetry:M},a),f);case 22:"segment-loaded"===(k=e.sent).resultType?(I=k.resultData.responseData,void 0!==u&&u.add(t,k.resultData.responseData),r.onChunk(C(I,!1))):"segment-created"===k.resultType&&r.onChunk(C(k.resultData,!1)),c.A.debug("SF: Segment request ended with success",y),r.onAllChunksReceived(),"segment-created"!==k.resultType?(_=k.resultData,P()):_=null,f.isCancelled()||null===(h=i.onRequestEnd)||void 0===h||h.call(i,{id:A}),f.deregister(x),e.next=41;break;case 31:if(e.prev=31,e.t0=e.catch(19),f.deregister(x),_=null,!(e.t0 instanceof m.AL)){e.next=38;break}throw c.A.debug("SF: Segment request aborted",y),e.t0;case 38:throw c.A.debug("SF: Segment request failed",y),null===(g=i.onRequestEnd)||void 0===g||g.call(i,{id:A}),X(e.t0);case 41:case"end":return e.stop()}}),e,null,[[19,31]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,s);return n=this._prioritizer,i=u,a=new WeakMap,{createRequest:function(e,t,r,o){var s=function(t){return i(e,r,t)},u=n.create(s,t,r,o);return a.set(u,s),u},updatePriority:function(e,t){var r=a.get(e);void 0!==r?n.updatePriority(r,t):c.A.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Ee=Se,Te=n(418);var we=n(2038),ke=n(7500);function Ie(e){}var xe=function(e){function t(t,n,r){var i;i=e.call(this)||this,c.A.info("AVSB: calling `mediaSource.addSourceBuffer`",n);var a=r.addSourceBuffer(n);i._canceller=new m.Ay,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegmentUniqueId=null,i.codec=n,i._initSegmentsMap=new Map;var o=i._onPendingTaskError.bind(i),s=i._flush.bind(i),u=l.A.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,d=setInterval(s,u);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",s),i._canceller.signal.register((function(){clearInterval(d),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",s)})),i}(0,i.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e,t){Ie(t),this._initSegmentsMap.set(e,t)},n.freeInitSegment=function(e){this._initSegmentsMap.delete(e)},n.pushChunk=function(e,t){return Ie(e.data.chunk),c.A.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,he.M)(e.inventoryInfos)),this._addToQueue({type:ke.B.Push,value:e},t)},n.removeBuffer=function(e,t,n){return c.A.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:ke.B.Remove,value:{start:e,end:t}},n)},n.endOfSegment=function(e,t){return c.A.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,he.M)(e)),this._addToQueue({type:ke.B.EndOfSegment,value:e},t)},n.getBufferedRanges=function(){return this._sourceBuffer.buffered},n.getPendingOperations=function(){var e=function(e){switch(e.type){case ke.B.Push:case ke.B.Remove:case ke.B.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},n.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new m.AL),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new m.AL)}if("open"===this._mediaSource.readyState)try{c.A.debug("AVSB: Calling `abort` on the SourceBuffer"),this._sourceBuffer.abort()}catch(e){c.A.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},n._onPendingTaskError=function(e){if(this._lastInitSegmentUniqueId=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer"),n=this._pendingTask;n.type===ke.B.Push&&0===n.data.length&&null!==n.inventoryData&&this._segmentInventory.insertChunk(n.inventoryData,!1,performance.now()),this._pendingTask=null,n.reject(t)}},n._addToQueue=function(e,t){var n=this;return(0,v.A)(t,(function(t,r){var i=0===n._queue.length&&null===n._pendingTask,a=(0,p.A)({resolve:t,reject:r},e);return n._queue.push(a),i&&n._flush(),function(){var e=n._queue.indexOf(a);e>=0&&n._queue.splice(e,1),a.resolve=g.A,a.reject=g.A}}))},n._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==ke.B.Push||0===e.data.length){switch(e.type){case ke.B.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData,!0,performance.now());break;case ke.B.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case ke.B.Remove:this.synchronizeInventory();break;default:(0,we.A)(e)}var t=e.resolve;return this._pendingTask=null,t(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==ke.B.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,p.A)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegmentUniqueId=null,void n.reject(a)}this._pendingTask=(0,p.A)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case ke.B.EndOfSegment:return c.A.debug("AVSB: Acknowledging complete segment",(0,he.M)(this._pendingTask.value)),void this._flush();case ke.B.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();c.A.debug("AVSB: pushing segment",this.bufferType,(0,he.M)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case ke.B.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;c.A.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,we.A)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},n._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(c.A.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return c.A.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n),a?this.codec=n:c.A.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;c.A.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0])this._sourceBuffer.appendWindowStart>0&&(c.A.debug("AVSB: re-setting `appendWindowStart` to `0`"),this._sourceBuffer.appendWindowStart=0);else if(i[0]!==this._sourceBuffer.appendWindowStart){if(i[0]>=this._sourceBuffer.appendWindowEnd){var s=i[0]+1;c.A.debug("AVSB: pre-updating `appendWindowEnd`",s),this._sourceBuffer.appendWindowEnd=s}c.A.debug("AVSB: setting `appendWindowStart`",i[0]),this._sourceBuffer.appendWindowStart=i[0]}if(void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(c.A.debug("AVSB: re-setting `appendWindowEnd` to `Infinity`"),this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(c.A.debug("AVSB: setting `appendWindowEnd`",i[1]),this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegmentUniqueId&&(a||!this._isLastInitSegment(e.initSegmentUniqueId))){var u=this._initSegmentsMap.get(e.initSegmentUniqueId);if(void 0===u)throw new Error("Invalid initialization segment uniqueId");t.push(u),this._lastInitSegmentUniqueId=e.initSegmentUniqueId}return null!==e.chunk&&t.push(e.chunk),t},n._isLastInitSegment=function(e){return null!==this._lastInitSegmentUniqueId&&this._lastInitSegmentUniqueId===e},t}(ke.K),Re=["audio","video","text","image"];function Ce(e){return"audio"===e||"video"===e}var Me=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Ce(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==Te.A.nativeTextTracksBuffer&&null==Te.A.htmlTextTracksBuffer||e.push("text"),null!=Te.A.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(e){var t=this;return this._areNativeBuffersUsable()?Promise.resolve():(0,v.A)(e,(function(e){var n,r=function(){var e=t._onNativeBufferAddedOrDisabled.indexOf(n);e>=0&&t._onNativeBufferAddedOrDisabled.splice(e,1)};return n=function(){t._areNativeBuffersUsable()&&(r(),e())},t._onNativeBufferAddedOrDisabled.push(n),r}))},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.slice().forEach((function(e){return e()})),(0,f.h)(0===this._onNativeBufferAddedOrDisabled.length))}else c.A.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(Ce(e)){if(null!=i)return i instanceof xe&&i.codec!==t?c.A.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):c.A.info("SB: Reusing native SegmentBuffer with codec",t),i;c.A.info("SB: Adding native SegmentBuffer with codec",t);var a=new xe(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.slice().forEach((function(e){return e()})),(0,f.h)(0===this._onNativeBufferAddedOrDisabled.length),a}if(null!=i)return c.A.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(c.A.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==Te.A.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new Te.A.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==Te.A.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new Te.A.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==Te.A.imageBuffer)throw new Error("Image buffer feature not activated");return c.A.info("SB: Creating a new image SegmentBuffer"),r=new Te.A.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw c.A.error("SB: Unknown buffer type:",e),new d.A("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?(c.A.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):c.A.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Re.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}(),Pe=n(6826),De=n.n(Pe),Ne=n(7296),Oe=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}();function Le(e,t){var n,r=e.segmentBuffer,i=e.playbackObserver,a=e.maxBufferBehind,o=e.maxBufferAhead;function s(){(function(e,t,n,r,i){return Ue.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";c.A.error("Could not run BufferGarbageCollector:",t)}))}i.listen((function(e){var t;n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,s()}),{includeLastObservation:!0,clearSignal:t}),a.onUpdate(s,{clearSignal:t}),o.onUpdate(s,{clearSignal:t}),s()}function Ue(){return(Ue=(0,r.A)(o().mark((function e(t,n,r,i,a){var s,u,l,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(isFinite(r)||isFinite(i)){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:s=[],u=(0,y.OT)(t.getBufferedRanges(),n),l=u.innerRange,d=u.outerRanges,f=function(){if(isFinite(i)){for(var e=0;e<d.length;e++){var t=d[e];n+i<=t.start?s.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&s.push({start:n+i,end:t.end})}null!=l&&n+i<l.end&&s.push({start:n+i,end:l.end})}},function(){if(isFinite(r)){for(var e=0;e<d.length;e++){var t=d[e];n-r>=t.end?s.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&s.push({start:t.start,end:n-r})}null!=l&&n-r>l.start&&s.push({start:l.start,end:n-r})}}(),f(),v=0,p=s;case 9:if(!(v<p.length)){e.next=20;break}if(!((h=p[v]).start<h.end)){e.next=17;break}if(c.A.debug("GC: cleaning range from SegmentBuffer",h.start,h.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(h.start,h.end,a);case 17:v++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Be=function(e){function t(t,n,r,i){var a;return(a=e.call(this)||this)._content=t,a._currentCanceller=null,a._downloadQueue=n,a._initSegmentRequest=null,a._mediaSegmentRequest=null,a._segmentFetcher=r,a._initSegmentInfoRef=new h.A(void 0),a._mediaSegmentAwaitingInitMetadata=null,i||a._initSegmentInfoRef.setValue(null),a}(0,i.A)(t,e);var n=t.prototype;return n.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},n.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},n.start=function(){var e=this;null===this._currentCanceller&&(this._currentCanceller=new m.Ay,this._downloadQueue.onUpdate((function(t){var n=t.segmentQueue;if(!(n.length>0&&n[0].segment.id===e._mediaSegmentAwaitingInitMetadata)){var r=e._mediaSegmentRequest;if(0===n.length){if(null===r)return;return c.A.debug("Stream: no more media segment to request. Cancelling queue.",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()}if(null===r)return c.A.debug("Stream: Media segments now need to be requested. Starting queue.",e._content.adaptation.type,n.length),void e._restartMediaSegmentDownloadingQueue();var i=n[0];return r.segment.id!==i.segment.id?(c.A.debug("Stream: Next media segment changed, cancelling previous",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()):void(r.priority!==i.priority&&(c.A.debug("Stream: Priority of next media segment changed, updating",e._content.adaptation.type,r.priority,i.priority),e._segmentFetcher.updatePriority(r.request,i.priority)))}}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}),this._downloadQueue.onUpdate((function(t){var n,r=e._initSegmentRequest;null===t.initSegment||null===r?(null===(n=t.initSegment)||void 0===n?void 0:n.segment.id)!==(null==r?void 0:r.segment.id)&&(null===t.initSegment&&c.A.debug("Stream: no more init segment to request. Cancelling queue.",e._content.adaptation.type),e._restartInitSegmentDownloadingQueue(t.initSegment)):t.initSegment.priority!==r.priority&&e._segmentFetcher.updatePriority(r.request,t.initSegment.priority)}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}))},n.stop=function(){var e;null===(e=this._currentCanceller)||void 0===e||e.cancel(),this._currentCanceller=null},n._restartMediaSegmentDownloadingQueue=function(){var e=this;null!==this._mediaSegmentRequest&&this._mediaSegmentRequest.canceller.cancel();!function t(n){if(null!==e._currentCanceller&&e._currentCanceller.isUsed())e._mediaSegmentRequest=null;else{if(void 0===n)return e._mediaSegmentRequest=null,void e.trigger("emptyQueue",null);var r=new m.Ay,i=null===e._currentCanceller?g.A:r.linkToSignal(e._currentCanceller.signal),a=n.segment,o=n.priority,s=(0,p.A)({segment:a},e._content),u=!1,l=!1;r.signal.register((function(){e._mediaSegmentRequest=null,u||(e._mediaSegmentAwaitingInitMetadata===a.id&&(e._mediaSegmentAwaitingInitMetadata=null),u=!0,l=!1)}));var d=function(t){(0,f.h)("media"===t.segmentType,"Should have loaded a media segment."),e.trigger("parsedMediaSegment",(0,p.A)({},t,{segment:a}))},v=function(){var n=e._downloadQueue.getValue().segmentQueue;if(0===n.length)return u=!0,void e.trigger("emptyQueue",null);n[0].segment.id===a.id&&n.shift(),u=!0,t(n[0])},h=e._segmentFetcher.createRequest(s,o,{onRetry:function(t){e.trigger("requestRetry",{segment:a,error:t})},beforeInterrupted:function(){c.A.info("Stream: segment request interrupted temporarly.",a.id,a.time)},onChunk:function(t){var n=e._initSegmentInfoRef.getValue();void 0!==n?d(t(null!=n?n:void 0)):(l=!0,e._initSegmentInfoRef.waitUntilDefined((function(e){d(t(null!=e?e:void 0))}),{clearSignal:r.signal}))},onAllChunksReceived:function(){l?(e._mediaSegmentAwaitingInitMetadata=a.id,e._initSegmentInfoRef.waitUntilDefined((function(){e._mediaSegmentAwaitingInitMetadata=null,l=!1,e.trigger("fullyLoadedSegment",a)}),{clearSignal:r.signal})):e.trigger("fullyLoadedSegment",a)},beforeEnded:function(){i(),e._mediaSegmentRequest=null,l?e._initSegmentInfoRef.waitUntilDefined(v,{clearSignal:r.signal}):v()}},r.signal);h.catch((function(t){i(),u||(u=!0,e.stop(),e.trigger("error",t))})),e._mediaSegmentRequest={segment:a,priority:o,request:h,canceller:r}}}(this._downloadQueue.getValue().segmentQueue[0])},n._restartInitSegmentDownloadingQueue=function(e){var t=this;if((null===this._currentCanceller||!this._currentCanceller.isUsed())&&(null!==this._initSegmentRequest&&this._initSegmentRequest.canceller.cancel(),null!==e)){var n=new m.Ay,r=null===this._currentCanceller?g.A:n.linkToSignal(this._currentCanceller.signal),i=e.segment,a=e.priority,o=(0,p.A)({segment:i},this._content),s=!1,u=this._segmentFetcher.createRequest(o,a,{onRetry:function(e){t.trigger("requestRetry",{segment:i,error:e})},beforeInterrupted:function(){c.A.info("Stream: init segment request interrupted temporarly.",i.id)},beforeEnded:function(){r(),t._initSegmentRequest=null,s=!0},onChunk:function(e){var n,r=e(void 0);(0,f.h)("init"===r.segmentType,"Should have loaded an init segment."),t.trigger("parsedInitSegment",(0,p.A)({},r,{segment:i})),"init"===r.segmentType&&t._initSegmentInfoRef.setValue(null!==(n=r.initTimescale)&&void 0!==n?n:null)},onAllChunksReceived:function(){t.trigger("fullyLoadedSegment",i)}},n.signal);u.catch((function(e){r(),s||(s=!0,t.stop(),t.trigger("error",e))})),n.signal.register((function(){t._initSegmentRequest=null,s||(s=!0)})),this._initSegmentRequest={segment:i,priority:a,request:u,canceller:n}}},t}(q.A);function Fe(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 d=i[u];if(void 0!==d.bufferedStart&&d.bufferedStart>t.start&&(null===n||d.infos.segment.end<=n)){var f=d.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,f)?(c.A.debug("RS: current discontinuity encountered",o.type,d.bufferedStart),{start:void 0,end:f}):null}var v=function(e,t,n){if(n<=0)return c.A.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!==v){var p=i[v-1],h=i[v];if(null===n||h.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(p.infos.segment.end,h.infos.segment.time))return null;var m=p.bufferedEnd,g=h.bufferedStart;return c.A.debug("RS: future discontinuity encountered",o.type,m,g),{start:m,end:g}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var y=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!==y){var A=i[y];if(void 0!==A.bufferedEnd&&A.bufferedEnd<a.end)return c.A.debug("RS: discontinuity encountered at the end of the current period",o.type,A.bufferedEnd,a.end),{start:A.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var _=i.length-1;_>=0;_--){var b=i[_];if(void 0===b.bufferedStart)break;if(b.bufferedStart<t.end){if(void 0!==b.bufferedEnd&&b.bufferedEnd<t.end){var S=s.index.checkDiscontinuity(t.end);if(null!==S)return{start:b.bufferedEnd,end:S}}return null}}}return null}function Ve(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,d=n.adaptation,f=n.representation,v=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),h=f.index.getSegments(o.start,o.end-o.start),m=t.filter((function(e){return!Ke(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=l.A.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return!1;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return c.A.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;c.A.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=l.A.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return!1;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return c.A.info("Stream: The end of the wanted segment has been garbage collected",e.end,e.bufferedEnd),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;c.A.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),g=l.A.getCurrent(),y=g.MINIMUM_SEGMENT_SIZE,A=g.MIN_BUFFER_AHEAD,_=!1,b=Math.min(1/60,y),S=!1,E=[],T=h.filter((function(e){var t=(0,p.A)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,he.Q)(t,e)})))return!1;var u=e.duration,l=e.time,h=e.end;if(e.isInit)return!0;if(_)return E.push(e),!1;if(e.complete&&u<y)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;if(a.time-b>l)return!1;if(a.complete){if(a.end+b<h)return!1}else if(Math.abs(l-a.time)>l)return!1;return!Ke(e,t,r,i)})))return!1;for(var g=0;g<m.length;g++){var T=m[g],w=T.infos.period.id===n.period.id;if(1===T.status&&w){var k=T.infos.segment;if(l-k.time>-b)if(k.complete){if(k.end-h>-b)return!1}else if(Math.abs(l-k.time)<b)return!1}}var I=u*n.representation.bitrate;if(v-I<0&&(S=!0,l>o.start+A))return _=!0,E.push(e),!1;var x=a(t);if(x.length>1){var R=x[x.length-1],C=x[x.length-2];if(null===R.buffered&&null===C.buffered)return c.A.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+d.type,f.id,e.time),!1}for(var M=0;M<m.length;M++){var P=m[M];if(P.end+b>l){var D=P.start>l+b||ze(m,M).end<h-b;return D&&(v-=I),D}}return v-=I,!0}));return{segmentsToLoad:T,segmentsOnHold:E,isBufferFull:S}}function ze(e,t){for(var n=t+1,r=l.A.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 Ke(e,t,n,r){var i=l.A.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=l.A.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 We(e,t){for(var n=e-t,r=l.A.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Ge(e,t,n,r,i,a,o){o.synchronizeInventory();var s=e.representation,u=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastAvailablePosition(),l=s.index;i=!(0,j.A)(u)&&Me.isNative(e.adaptation.type)&&t>=u&&l.isInitialized()&&!l.isStillAwaitingFutureSegments()&&function(e,t,n){var r,i=e.getPeriodAfter(t);return t.containsTime(n,i)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t-.1;var d,c=i+n;d=!(!s.index.isInitialized()||s.index.isStillAwaitingFutureSegments()||void 0===o.end)&&(void 0===u?c>=o.end:null===u||c>=u);return{start:Math.max(i,o.start),end:Math.min(c,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:d}}(e,u,i),d=s.index.shouldRefresh(l.start,l.end),c=o.getPendingOperations().filter((function(e){return e.type===ke.B.EndOfSegment})).map((function(e){return e.value})),f=o.getInventory(),v=Ve({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:c,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:We(e.time,u),segment:e}})),y=s.index.isInitialized()&&!s.index.isStillAwaitingFutureSegments()&&l.hasReachedPeriodEnd&&0===g.length&&0===h.length,A=null;return c.length>0&&(A=Math.min.apply(Math,c.map((function(e){return e.segment.time})))),h.length>0&&(A=null!==A?Math.min(A,h[0].time):h[0].time),g.length>0&&(A=null!==A?Math.min(A,g[0].segment.time):g[0].segment.time),{imminentDiscontinuity:Fe(e,l,A,y,f),hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:d}}var He=n(8801);function qe(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){if("string"==typeof e)return je(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(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 je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ye(e,t,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=(0,r.A)(o().mark((function e(t,n,r){var i,a,s,u,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=l.A.getCurrent().BUFFER_GC_GAPS.CALM,a=l.A.getCurrent().BUFFER_GC_GAPS.BEEFY,c.A.warn("Stream: Running garbage collector"),s=n.getBufferedRanges(),0===(u=Xe(t,s,i)).length&&(u=Xe(t,s,a)),c.A.hasLevel("DEBUG")&&c.A.debug("Stream: GC cleaning",u.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),d=qe(u);case 8:if((f=d()).done){e.next=16;break}if(v=f.value,p=v.start,h=v.end,!(p<h)){e.next=14;break}return e.next=14,n.removeBuffer(p,h,r);case 14:e.next=8;break;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(e,t,n){for(var r=(0,y.OT)(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&&(c.A.hasLevel("DEBUG")&&c.A.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),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 $e(e,t,n,r){return Ze.apply(this,arguments)}function Ze(){return(Ze=(0,r.A)(o().mark((function e(t,n,r,i){var a,s,u,l,c,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.pushChunk(r,i);case 3:case 25:e.next=31;break;case 5:if(e.prev=5,e.t0=e.catch(0),!(i.isCancelled()&&e.t0 instanceof m.AL)){e.next=11;break}throw e.t0;case 11:if(e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=14;break}throw s=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new d.A("BUFFER_APPEND_ERROR",s,{adaptation:r.inventoryInfos.adaptation});case 14:return u=t.getReference().getValue(),l=u.position,c=null!==(a=l.pending)&&void 0!==a?a:l.last,e.prev=16,e.next=19,Ye(c,n,i);case 19:return e.next=21,(0,He.A)(200);case 21:if(null===i.cancellationError){e.next=23;break}throw i.cancellationError;case 23:return e.next=25,n.pushChunk(r,i);case 27:throw e.prev=27,e.t1=e.catch(16),f=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new d.A("BUFFER_FULL_ERROR",f,{adaptation:r.inventoryInfos.adaptation});case 31:case"end":return e.stop()}}),e,null,[[0,5],[16,27]])})))).apply(this,arguments)}function Je(){return Je=(0,r.A)(o().mark((function e(t,n){var r,i,a,s,u,l,d,c,f,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.segment,u=t.segmentData,l=t.segmentBuffer,null===n.cancellationError){e.next=3;break}throw n.cancellationError;case 3:return d=i.representation.getMimeTypeString(),c={initSegmentUniqueId:a,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:d},f=(0,p.A)({segment:s,chunkSize:void 0,start:0,end:0},i),e.next=8,$e(r,l,{data:c,inventoryInfos:f},n);case 8:return v=l.getBufferedRanges(),e.abrupt("return",{content:i,segment:s,buffered:v,segmentData:u});case 10:case"end":return e.stop()}}),e)}))),Je.apply(this,arguments)}function et(){return et=(0,r.A)(o().mark((function e(t,n){var r,i,a,s,u,d,c,f,v,h,m,g,y,A,_,b,S,E,T,w,k,I,x;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.parsedSegment,u=t.segment,d=t.segmentBuffer,null!==s.chunkData){e.next=3;break}return e.abrupt("return",null);case 3:if(null===n.cancellationError){e.next=5;break}throw n.cancellationError;case 5:return v=s.chunkData,h=s.chunkInfos,m=s.chunkOffset,g=s.chunkSize,y=s.appendWindow,A=i.representation.getMimeTypeString(),_=l.A.getCurrent(),b=_.APPEND_WINDOW_SECURITIES,S=[void 0!==y[0]?Math.max(0,y[0]-b.START):void 0,void 0!==y[1]?y[1]+b.END:void 0],E={initSegmentUniqueId:a,chunk:v,timestampOffset:m,appendWindow:S,codec:A},T=null!==(c=null==h?void 0:h.time)&&void 0!==c?c:u.time,w=null!==(f=null==h?void 0:h.duration)&&void 0!==f?f:u.duration,k=T+w,void 0!==S[0]&&(T=Math.max(T,S[0])),void 0!==S[1]&&(k=Math.min(k,S[1])),I=(0,p.A)({segment:u,chunkSize:g,start:T,end:k},i),e.next=18,$e(r,d,{data:E,inventoryInfos:I},n);case 18:return x=d.getBufferedRanges(),e.abrupt("return",{content:i,segment:u,buffered:x,segmentData:v});case 20:case"end":return e.stop()}}),e)}))),et.apply(this,arguments)}var tt=function(e,t,n){var r=e.content,i=e.options,a=e.playbackObserver,o=e.segmentBuffer,s=e.segmentFetcher,u=e.terminate,d=r.period,f=r.adaptation,v=r.representation,g=i.bufferGoal,y=i.maxBufferSize,A=i.drmSystemId,_=i.fastSwitchThreshold,b=f.type,S=new m.Ay;S.linkToSignal(n);var E=new m.Ay;E.linkToSignal(S.signal);var T={segment:v.index.getInitSegment(),uniqueId:null,isLoaded:!1};S.signal.register((function(){null!==T.uniqueId&&o.freeInitSegment(T.uniqueId)}));var w=new h.A({initSegment:null,segmentQueue:[]},E.signal),k=null!==T.segment;k||(T.isLoaded=!0);var I=!1;if(void 0!==A){var x=v.getEncryptionData(A);if(x.length>0&&x.every((function(e){return void 0!==e.keyIds}))&&(I=!0,t.encryptionDataEncountered(x.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}var R=new Be(r,w,s,k);return R.addEventListener("error",(function(e){E.signal.isCancelled()||(S.cancel(),t.error(e))})),R.addEventListener("parsedInitSegment",M),R.addEventListener("parsedMediaSegment",M),R.addEventListener("emptyQueue",C),R.addEventListener("requestRetry",(function(e){if(t.warning(e.error),!E.signal.isCancelled()){var n=e.segment,r=v.index;!1===r.isSegmentStillAvailable(n)?C():r.canBeOutOfSyncError(e.error,n)&&t.manifestMightBeOufOfSync()}})),R.addEventListener("fullyLoadedSegment",(function(e){o.endOfSegment((0,p.A)({segment:e},r),S.signal).catch(P)})),R.start(),E.signal.register((function(){R.removeEventListener(),R.stop()})),a.listen(C,{includeLastObservation:!1,clearSignal:E.signal}),r.manifest.addEventListener("manifestUpdate",C,E.signal),g.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),y.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),u.onUpdate(C,{emitCurrentValue:!1,clearSignal:E.signal}),void C();function C(){var e,n;if(!E.isUsed()){var i=a.getReference().getValue(),s=null!==(e=i.position.pending)&&void 0!==e?e:i.position.last,f=Ge(r,s,a,_.getValue(),g.getValue(),y.getValue(),o),p=f.neededSegments,h=null;if(v.index.isInitialized()){if(p.length>0&&!T.isLoaded&&null!==T.segment){var m=p[0].priority;h={segment:T.segment,priority:m}}}else if(null===T.segment)c.A.warn("Stream: Uninitialized index without an initialization segment");else if(T.isLoaded)c.A.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var A=null!==(n=i.position.pending)&&void 0!==n?n:i.position.last;h={segment:T.segment,priority:We(d.start,A)}}var k=u.getValue();if(null===k)w.setValue({initSegment:h,segmentQueue:p});else{if(k.urgent)return c.A.debug("Stream: Urgent switch, terminate now.",b),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),E.cancel(),void t.terminating();var I=p[0],x=R.getRequestedInitSegment(),C=R.getRequestedMediaSegment(),M=null===C||void 0===I||C.id!==I.segment.id?[]:[I],D=null===x?null:h;if(w.setValue({initSegment:D,segmentQueue:M}),0===M.length&&null===D)return c.A.debug("Stream: No request left, terminate",b),w.finish(),E.cancel(),void t.terminating()}if(t.streamStatusUpdate({period:d,position:i.position.last,bufferType:b,imminentDiscontinuity:f.imminentDiscontinuity,isEmptyStream:!1,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}),!E.signal.isCancelled()){var N=l.A.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(f.isBufferFull){var O=Math.max(0,s-N);O>0&&o.removeBuffer(0,O,S.signal).catch(P)}f.shouldRefreshManifest&&t.needsManifestRefresh()}}}function M(e){if(!S.isUsed())if("init"===e.segmentType){if(T.isLoaded=!0,!I){var n=v.getAllEncryptionData();if(n.length>0&&(t.encryptionDataEncountered(n.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}if(null!==e.initializationData){var i=v.uniqueId;T.uniqueId=i,o.declareInitSegment(i,e.initializationData),function(e,t){return Je.apply(this,arguments)}({playbackObserver:a,content:r,initSegmentUniqueId:i,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o},S.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(P)}C()}else{var s=e.inbandEvents,u=e.needsManifestRefresh,l=e.protectionDataUpdate;if(!I&&l){var d=v.getAllEncryptionData();if(d.length>0&&(t.encryptionDataEncountered(d.map((function(e){return(0,p.A)({content:r},e)}))),S.isUsed()))return}if(!0===u&&(t.needsManifestRefresh(),S.isUsed()))return;if(void 0!==s&&s.length>0&&(t.inbandEvent(s),S.isUsed()))return;var c=T.uniqueId;(function(e,t){return et.apply(this,arguments)})({playbackObserver:a,content:r,initSegmentUniqueId:c,parsedSegment:e,segment:e.segment,segmentBuffer:o},S.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(P)}}function P(e){S.isUsed()&&e instanceof m.AL||(S.cancel(),t.error(e))}};var nt=function(e,t,n){var r=e.playbackObserver,i=e.content,a=e.options,o=e.representationEstimator,s=e.segmentBuffer,u=e.segmentFetcherCreator,f=e.wantedBufferAhead,v=e.maxVideoBufferSize,y="direct"===a.manualBitrateSwitchingMode,A=i.manifest,_=i.period,b=i.adaptation,S=new m.Ay;S.linkToSignal(n);var E,T=new Map,w=new h.A(null,S.signal),k=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=new h.A([],a);v(),o.addEventListener("decipherabilityUpdate",v);var l=a.register(p),c=t(e,n,u,r,a),f=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:f};function v(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new d.A("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played",{adaptation:s});return p(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function p(){o.removeEventListener("decipherabilityUpdate",v),void 0!==l&&l()}}(i,o,w,r,(function(e){S.cancel(),t.error(e)}),S.signal),I=k.estimateRef,x=k.abrCallbacks,R=u.createSegmentFetcher(b.type,{onRequestBegin:x.requestBegin,onRequestEnd:x.requestEnd,onProgress:x.requestProgress,onMetrics:x.metrics});function C(e,t,n,i){var o=new m.Ay;o.linkToSignal(S.signal);var u=(0,h.D)(f,(function(t){return M(e,t)}),o.signal),l="video"===b.type?v:new h.A(1/0);c.A.info("Stream: changing representation",b.type,e.id,e.bitrate);var d=(0,p.A)({},i,{error:function(r){var a,o=(0,G.A)(r,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"!==o.code)i.error(r);else{var s=f.getValue(),u=.7*(null!==(a=T.get(e.id))&&void 0!==a?a:1);if(T.set(e.id,u),u<=.05||M(e,s)<=2)return void i.error(o);(0,ee.A)(4e3,S.signal).then((function(){return C(e,t,n,i)})).catch(g.A)}},terminating:function(){o.cancel(),i.terminating()}});tt({playbackObserver:r,content:{representation:e,adaptation:b,period:_,manifest:A},segmentBuffer:s,segmentFetcher:R,terminate:t,options:{bufferGoal:u,maxBufferSize:l,drmSystemId:a.drmSystemId,fastSwitchThreshold:n}},d,S.signal)}function M(e,t){var n=T.get(e.id),r=void 0!==n?n:1;return void 0===n&&T.set(e.id,r),r<1&&t===1/0?3e5*r:t*r}I.onUpdate((function(e){var n=e.bitrate;void 0!==n&&n!==E&&(E=n,c.A.debug("Stream: new "+b.type+" bitrate estimate",n),t.bitrateEstimationChange({type:b.type,bitrate:n}))}),{emitCurrentValue:!0,clearSignal:S.signal}),function e(n){var r=new m.Ay;r.linkToSignal(S.signal);var i=I.getValue(),o=i.representation,s=i.manual;if(null===o)return;if(y&&s&&!n){var u=l.A.getCurrent().DELTA_POSITION_AFTER_RELOAD;return De()((function(){if(!r.isUsed()&&I.getValue().manual){var e=u.bitrateSwitch;return t.waitingMediaSourceReload({bufferType:b.type,period:_,timeOffset:e,stayInPeriod:!0})}}))}var d=new h.A(null,r.signal);I.onUpdate((function(e){if(null!==e.representation&&e.representation.id!==o.id)return e.urgent?(c.A.info("Stream: urgent Representation switch",b.type),d.setValue({urgent:!0})):(c.A.info("Stream: slow Representation switch",b.type),d.setValue({urgent:!1}))}),{clearSignal:r.signal,emitCurrentValue:!0});var f=new h.A(0);a.enableFastSwitching&&I.onUpdate((function(e){f.setValueIfChanged(null==e?void 0:e.knownStableBitrate)}),{clearSignal:r.signal,emitCurrentValue:!0});var v={type:b.type,period:_,representation:o};if(w.setValue(o),S.isUsed())return;if(t.representationChange(v),S.isUsed())return;var p={streamStatusUpdate:t.streamStatusUpdate,encryptionDataEncountered:t.encryptionDataEncountered,manifestMightBeOufOfSync:t.manifestMightBeOufOfSync,needsManifestRefresh:t.needsManifestRefresh,inbandEvent:t.inbandEvent,warning:t.warning,error:function(e){m.Ay.isCancellationError(e)&&S.isUsed()||(S.cancel(),t.error(e))},addedSegment:function(e){x.addedSegment(e),S.isUsed()||t.addedSegment(e)},terminating:function(){if(!r.isUsed())return r.cancel(),e(!1)}};C(o,d,f,p)}(!0)},rt=n(9828);var it=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,S.A)(i,(function(e){return(0,rt.A)(e,"codecs=")})),l=(0,S.A)(s,(function(e){return(0,rt.A)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7),f=d.split(".")[0];f="hev1"===f?"hvc1":f;var v=c.split(".")[0];return f===(v="hev1"===v?"hvc1":v)};function at(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return it(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,y.Nn)(a),s=t.start,u=null==t.end?1/0:t.end,d=(0,y.aW)(o,[{start:s,end:u}]);if(0===d.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 f=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),v=(0,y.bo)(d,f);if(0===v.length)return{type:"continue",value:void 0};var p=r.currentTime,h=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===h)&&(0,y.gV)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return it(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,y.Hh)(f,p))return{type:"needs-reload",value:void 0};var m="audio"===n.type&&"direct"===h,g=[],A=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!==A&&(void 0===A.bufferedEnd||t.start-A.bufferedEnd<1)&&g.push({start:0,end:t.start+1});var _=n.type,b=l.A.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,S=b[_].before;null==S&&(S=0);var E=b[_].after;if(null==E&&(E=0),m||g.push({start:p-S,end:p+E}),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)&&g.push({start:t.end-1,end:Number.MAX_VALUE})}var w=(0,y.bo)(v,g);return 0===w.length?{type:"continue",value:void 0}:m?{type:"flush-buffer",value:w}:{type:"clean-buffer",value:w}}function ot(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){if("string"==typeof e)return st(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}(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 st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return c.A.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new d.A("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played",{adaptation:e})}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}function lt(e,t,n,r,i,a){var o=r.period,s=!1;function u(){var r=e.getReference().getValue(),a=t.getValue(),u=r.position.last;void 0!==o.end&&u+a>=o.end&&(c.A.debug('Stream: full "empty" AdaptationStream',n),s=!0),i.streamStatusUpdate({period:o,bufferType:n,position:u,imminentDiscontinuity:null,isEmptyStream:!0,hasFinishedLoading:s,neededSegments:[]})}t.onUpdate(u,{emitCurrentValue:!1,clearSignal:a}),e.listen(u,{includeLastObservation:!1,clearSignal:a}),u()}var dt=function(e,t,n){var i=e.bufferType,a=e.content,s=e.garbageCollectors,u=e.playbackObserver,d=e.representationEstimator,f=e.segmentFetcherCreator,v=e.segmentBuffersStore,g=e.options,A=e.wantedBufferAhead,_=e.maxVideoBufferSize,b=a.period,S=new h.A(void 0,n);if(t.periodStreamReady({type:i,period:b,adaptationRef:S}),!n.isCancelled()){var E,T=!0;S.onUpdate((function(e){(0,r.A)(o().mark((function r(){var a,d,f,p,h,y,_,S,I,x,R,C,M,P,D,N;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==e){r.next=2;break}return r.abrupt("return");case 2:if((d=new m.Ay).linkToSignal(n),null==E||E.cancel(),E=d,null!==e){r.next=34;break}if(c.A.info("Stream: Set no "+i+" Adaptation. P:",b.start),"initialized"!==(f=v.getStatus(i)).type){r.next=26;break}if(c.A.info("Stream: Clearing previous "+i+" SegmentBuffer"),!Me.isNative(i)){r.next=15;break}return r.abrupt("return",k(0,!0,d.signal));case 15:if(p=null!==(a=b.end)&&void 0!==a?a:1/0,!(b.start>p)){r.next=20;break}c.A.warn("Stream: Can't free buffer: period's start is after its end"),r.next=24;break;case 20:return r.next=22,f.value.removeBuffer(b.start,p,d.signal);case 22:if(!d.isUsed()){r.next=24;break}return r.abrupt("return");case 24:r.next=30;break;case 26:if("uninitialized"!==f.type){r.next=30;break}if(v.disableSegmentBuffer(i),!d.isUsed()){r.next=30;break}return r.abrupt("return");case 30:if(t.adaptationChange({type:i,adaptation:null,period:b}),!d.isUsed()){r.next=33;break}return r.abrupt("return");case 33:return r.abrupt("return",lt(u,A,i,{period:b},t,d.signal));case 34:if(h=l.A.getCurrent(),y=h.DELTA_POSITION_AFTER_RELOAD,_=T?0:"audio"===i?y.trackSwitch.audio:"video"===i?y.trackSwitch.video:y.trackSwitch.other,T=!1,!Me.isNative(i)||"disabled"!==v.getStatus(i).type){r.next=39;break}return r.abrupt("return",k(_,!0,d.signal));case 39:if(c.A.info("Stream: Updating "+i+" adaptation","A: "+e.id,"P: "+b.start),t.adaptationChange({type:i,adaptation:e,period:b}),!d.isUsed()){r.next=43;break}return r.abrupt("return");case 43:if(S=u.getReadyState(),I=ut(v,i,e,g),x={currentTime:u.getCurrentTime(),readyState:S},"needs-reload"!==(R=at(I,b,e,x,g)).type){r.next=49;break}return r.abrupt("return",k(_,!0,d.signal));case 49:return r.next=51,v.waitForUsableBuffers(d.signal);case 51:if(!d.isUsed()){r.next=53;break}return r.abrupt("return");case 53:if("flush-buffer"!==R.type&&"clean-buffer"!==R.type){r.next=67;break}C=ot(R.value);case 55:if((M=C()).done){r.next=63;break}return P=M.value,D=P.start,N=P.end,r.next=59,I.removeBuffer(D,N,d.signal);case 59:if(!d.isUsed()){r.next=61;break}return r.abrupt("return");case 61:r.next=55;break;case 63:if("flush-buffer"!==R.type){r.next=67;break}if(t.needsBufferFlush(),!d.isUsed()){r.next=67;break}return r.abrupt("return");case 67:s.get(I)(d.signal),w(e,I,d.signal);case 69:case"end":return r.stop()}}),r)})))().catch((function(e){e instanceof m.AL||(null==E||E.cancel(),t.error(e))}))}),{clearSignal:n,emitCurrentValue:!0})}function w(e,n,r){var o=a.manifest,s=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=new h.A(i(),n);return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,y.vK)(r,n.position.last);return(0,p.A)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(u,n);nt({content:{manifest:o,period:b,adaptation:e},options:g,playbackObserver:s,representationEstimator:d,segmentBuffer:n,segmentFetcherCreator:f,wantedBufferAhead:A,maxVideoBufferSize:_},Object.assign(Object.assign({},t),{error:function(e){if(!Me.isNative(i)){c.A.error("Stream: "+i+" Stream crashed. Aborting it.",e instanceof Error?e:""),v.disposeSegmentBuffer(i);var n=(0,G.A)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});if(t.warning(n),r.isCancelled())return;return lt(u,A,i,{period:b},t,r)}c.A.error("Stream: "+i+" Stream crashed. Stopping playback.",e instanceof Error?e:""),t.error(e)}}),r)}function k(e,n,r){De()((function(){u.listen((function(){t.waitingMediaSourceReload({bufferType:i,period:b,timeOffset:e,stayInPeriod:n})}),{includeLastObservation:!0,clearSignal:r})}))}};function ct(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n,r=[],i=e.getInventory(),a=function(){var e=i[o];if(t.some((function(t){return e.infos.period.id===t.period.id&&e.infos.adaptation.id===t.adaptation.id&&e.infos.representation.id===t.representation.id}))){var n=e.bufferedStart,a=e.bufferedEnd;if(void 0===n||void 0===a)return c.A.warn("SO: No buffered start or end found from a segment."),{v:[{start:0,end:Number.MAX_VALUE}]};var s=r[r.length-1];void 0!==s&&s.end===n?s.end=a:r.push({start:n,end:a})}},o=0;o<i.length;o++)if(n=a())return n.v;return r}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){if("string"==typeof e)return vt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vt(e,t):void 0}}(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 vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e,t){if(0===t.length)return!1;var n=e.position.last;return e.speed>=0?t[t.length-1].end>=n-5:t[0].start<=n+5}var ht=function(e,t,n,i,a,s,u,f){for(var v,p=e.manifest,g=e.initialPeriod,y=s.maxBufferAhead,A=s.maxBufferBehind,_=s.wantedBufferAhead,b=s.maxVideoBufferSize,S=l.A.getCurrent(),E=S.MINIMUM_MAX_BUFFER_AHEAD,T=S.MAXIMUM_MAX_BUFFER_AHEAD,w=S.MAXIMUM_MAX_BUFFER_BEHIND,k=new Oe((function(e){var n,r,i=e.bufferType,a=null!==(n=w[i])&&void 0!==n?n:1/0,o=null!==(r=T[i])&&void 0!==r?r:1/0;return function(n){Le({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,h.D)(A,(function(e){return Math.min(e,a)}),n),maxBufferAhead:(0,h.D)(y,(function(e){var t,n=Math.max(e,null!==(t=E[i])&&void 0!==t?t:0);return Math.min(n,o)}),n)},n)}})),I=ft(i.getBufferTypes());!(v=I()).done;){x(v.value,g)}function x(e,n){var a=new Ne.A((function(e,t){return e.start-t.start})),s=!1,l=new m.Ay;return l.linkToSignal(f),t.listen((function(t){var n,r,i=t.position,o=null!==(n=i.pending)&&void 0!==n?n:i.last;if(s&&function(e){var t=a.head(),n=a.last();if(null==t||null==n)return!0;return t.start>e||(null==n.end?1/0:n.end)<e}(o)){for(c.A.info("Stream: Destroying all PeriodStreams due to out of bounds situation",e,o),s=!1;a.length()>0;){var d=a.get(a.length()-1);a.removeElement(d),u.periodStreamCleared({type:e,period:d})}l.cancel(),(l=new m.Ay).linkToSignal(f);var h=null!==(r=p.getPeriodForTime(o))&&void 0!==r?r:p.getNextPeriod(o);if(void 0===h)return c.A.warn("Stream: The wanted position is not found in the Manifest."),void(s=!0);v(h)}}),{clearSignal:f,includeLastObservation:!0}),p.addEventListener("decipherabilityUpdate",(function(e){(function(e){return h.apply(this,arguments)})(e).catch((function(e){l.cancel(),u.error(e)}))}),f),v(n);function v(t){var n=Object.assign(Object.assign({},u),{waitingMediaSourceReload:function(e){var t=a.head();void 0===t||t.id!==e.period.id?u.lockedStream({bufferType:e.bufferType,period:e.period}):u.needsMediaSourceReload({timeOffset:e.timeOffset,minimumPosition:e.stayInPeriod?e.period.start:void 0,maximumPosition:e.stayInPeriod?e.period.end:void 0})},periodStreamReady:function(e){s=!0,a.add(e.period),u.periodStreamReady(e)},periodStreamCleared:function(e){a.removeElement(e.period),u.periodStreamCleared(e)},error:function(e){l.cancel(),u.error(e)}});R(e,t,n,l.signal)}function h(){return h=(0,r.A)(o().mark((function n(r){var h,g,y,A,_,b,S,E,T,w,k,I,x;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h=i.getStatus(e),0!==(g=r.filter((function(t){return t.adaptation.type===e}))).length&&"initialized"===h.type&&!g.every((function(e){return!0===e.representation.decipherable}))){n.next=4;break}return n.abrupt("return");case 4:for(y=h.value,A=g.filter((function(e){return void 0===e.representation.decipherable})),_=g.filter((function(e){return!1===e.representation.decipherable})),b=ct(y,_),S=ct(y,A),s=!1,c.A.info("Stream: Destroying all PeriodStreams for decipherability matters",e);a.length()>0;)E=a.get(a.length()-1),a.removeElement(E),u.periodStreamCleared({type:e,period:E});l.cancel(),(l=new m.Ay).linkToSignal(f),T=0,w=[].concat(b,S);case 16:if(!(T<w.length)){n.next=26;break}if(k=w[T],I=k.start,x=k.end,!(I<x)){n.next=23;break}if(!f.isCancelled()){n.next=21;break}return n.abrupt("return");case 21:return n.next=23,y.removeBuffer(I,x,f);case 23:T++,n.next=16;break;case 26:De()((function(){var e;if(!f.isCancelled()){var n=t.getReference().getValue();if(pt(n,b)){if(u.needsDecipherabilityFlush(),f.isCancelled())return}else if(pt(n,S)&&(u.needsBufferFlush(),f.isCancelled()))return;var r=null!==(e=n.position.pending)&&void 0!==e?e:n.position.last,i=p.getPeriodForTime(r);null!=i?v(i):u.error(new d.A("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest."))}}));case 27:case"end":return n.stop()}}),n)}))),h.apply(this,arguments)}}function R(e,r,o,u){c.A.info("Stream: Creating new Stream for",e,r.start);var l=null,d=new m.Ay;d.linkToSignal(u),t.listen((function(t,n){var i,a,s=t.position,u=null!==(i=s.pending)&&void 0!==i?i:s.last;if(void 0!==r.end&&u>=r.end){var l=p.getPeriodAfter(r);if(r.containsTime(u,l))return;c.A.info("Stream: Destroying PeriodStream as the current playhead moved above it",e,r.start,null!==(a=s.pending)&&void 0!==a?a:s.last,r.end),n(),o.periodStreamCleared({type:e,period:r}),d.cancel()}}),{clearSignal:u,includeLastObservation:!0});var f={bufferType:e,content:{manifest:p,period:r},garbageCollectors:k,maxVideoBufferSize:b,segmentFetcherCreator:a,segmentBuffersStore:i,options:s,playbackObserver:t,representationEstimator:n,wantedBufferAhead:_},v=Object.assign(Object.assign({},o),{streamStatusUpdate:function(t){if(t.hasFinishedLoading){var n=p.getPeriodAfter(r);null!==n&&function(t){if(null!==l){if(l.period.id===t.id)return;c.A.warn("Stream: Creating next `PeriodStream` while one was already created.",e,t.id,l.period.id),o.periodStreamCleared({type:e,period:l.period}),l.canceller.cancel()}var n=new m.Ay;n.linkToSignal(u),l={canceller:n,period:t},R(e,t,o,l.canceller.signal)}(n)}else null!==l&&(c.A.info("Stream: Destroying next PeriodStream due to current one being active",e,l.period.start),o.periodStreamCleared({type:e,period:l.period}),l.canceller.cancel(),l=null);o.streamStatusUpdate(t)},error:function(e){null!==l&&(l.canceller.cancel(),l=null),d.cancel(),o.error(e)}});dt(f,v,d.signal)}},mt=ht,gt=n(4640);function yt(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){if("string"==typeof e)return At(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}(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 At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _t=function(e){function t(t,n,r){var i;(i=e.call(this)||this)._canceller=new m.Ay,i._manifest=t,i._activeStreams=new Map,i._allBufferTypes=r,i._lastCurrentPeriodId=null;var a=new bt(t);i._maximumPositionCalculator=a;var o=i._canceller.signal;return n.listen((function(e){var n,r=e.position,o=null!==(n=r.pending)&&void 0!==n?n:r.last;if(o<t.getMinimumSafePosition()){var s=new d.A("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");i.trigger("warning",s)}else if(o>a.getMaximumAvailablePosition()){var u=new d.A("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");i.trigger("warning",u)}}),{includeLastObservation:!0,clearSignal:o}),t.addEventListener("manifestUpdate",(function(){i.trigger("endingPositionChange",i._getManifestEndTime()),o.isCancelled()||i._checkEndOfStream()}),o),i}(0,i.A)(t,e);var n=t.prototype;return n.getCurrentEndingTime=function(){return this._getManifestEndTime()},n.onAdaptationChange=function(e,t,n){if(this._manifest.isLastPeriodKnown){var r=this._manifest.periods[this._manifest.periods.length-1];if(t.id===(null==r?void 0:r.id)&&("audio"===e||"video"===e)){"audio"===e?this._maximumPositionCalculator.updateLastAudioAdaptation(n):this._maximumPositionCalculator.updateLastVideoAdaptation(n);var i=this._maximumPositionCalculator.getEndingPosition(),a=void 0!==i?{isEnd:!0,endingPosition:i}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()};this.trigger("endingPositionChange",a)}}this._canceller.isUsed()||null===n&&this._addActivelyLoadedPeriod(t,e)},n.onRepresentationChange=function(e,t){this._addActivelyLoadedPeriod(t,e)},n.onPeriodCleared=function(e,t){this._removeActivelyLoadedPeriod(t,e)},n.onLastSegmentFinishedLoading=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod||(t.hasFinishedLoadingLastPeriod=!0,this._checkEndOfStream())},n.onLastSegmentLoadingResume=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod&&(t.hasFinishedLoadingLastPeriod=!1,this._checkEndOfStream())},n.dispose=function(){this.removeEventListener(),this._canceller.cancel()},n._addActivelyLoadedPeriod=function(e,t){var n=this._lazilyCreateActiveStreamInfo(t);n.activePeriods.has(e)||(n.activePeriods.add(e),this._checkCurrentPeriod())},n._removeActivelyLoadedPeriod=function(e,t){var n=this._activeStreams.get(t);void 0!==n&&n.activePeriods.has(e)&&(n.activePeriods.removeElement(e),this._checkCurrentPeriod())},n._checkCurrentPeriod=function(){var e=this;if(0!==this._allBufferTypes.length){var t=this._activeStreams.get(this._allBufferTypes[0]);if(void 0!==t)for(var n,r,i=function(){for(var t=r.value,n=!0,i=1;i<e._allBufferTypes.length;i++){var a=e._activeStreams.get(e._allBufferTypes[i]);if(void 0===a)return{v:void 0};if(!a.activePeriods.toArray().some((function(e){return e.id===t.id}))){n=!1;break}}if(n)return e._lastCurrentPeriodId!==t.id&&(e._lastCurrentPeriodId=t.id,e.trigger("periodChange",t)),{v:void 0}},a=yt(t.activePeriods.toArray());!(r=a()).done;)if(n=i())return n.v}},n._getManifestEndTime=function(){var e=this._maximumPositionCalculator.getEndingPosition();return void 0!==e?{isEnd:!0,endingPosition:e}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()}},n._lazilyCreateActiveStreamInfo=function(e){var t=this._activeStreams.get(e);return void 0===t&&(t={activePeriods:new Ne.A((function(e,t){return e.start-t.start})),hasFinishedLoadingLastPeriod:!1},this._activeStreams.set(e,t)),t},n._checkEndOfStream=function(){var e=this;this._manifest.isLastPeriodKnown&&(this._allBufferTypes.every((function(t){var n=e._activeStreams.get(t);return void 0!==n&&n.hasFinishedLoadingLastPeriod}))?this.trigger("endOfStream",null):this.trigger("resumeStream",null))},t}(q.A),bt=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getMaximumAvailablePosition=function(){if(this._manifest.isDynamic)return this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var e=St(this._lastVideoAdaptation);return"number"!=typeof e?this._manifest.getMaximumSafePosition():e}if(null===this._lastVideoAdaptation){var t=St(this._lastAudioAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}var n=St(this._lastAudioAdaptation),r=St(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?this._manifest.getMaximumSafePosition():Math.min(n,r)},t.getEndingPosition=function(){var e,t;if(!this._manifest.isDynamic)return this.getMaximumAvailablePosition();if(void 0!==this._lastVideoAdaptation&&void 0!==this._lastAudioAdaptation){if(null===this._lastAudioAdaptation)return null===this._lastVideoAdaptation?void 0:null!==(e=Et(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=Et(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=Et(this._lastAudioAdaptation),r=Et(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function St(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastAvailablePosition();if(void 0===a)return;null!==a&&(r=(0,j.A)(r)?a:Math.min(r,a))}return r}function Et(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getEnd();if(void 0===a)return;null!==a&&(r=(0,j.A)(r)?a:Math.min(r,a))}return r}var Tt=n(3116),wt=n(9770),kt=n(5121),It=n(2384);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&&(c.A.info("Init: Aborting SourceBuffer before removing"),o.abort()),c.A.info("Init: Removing SourceBuffer from mediaSource"),t.removeSourceBuffer(o)}catch(e){c.A.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&c.A.warn("Init: Not all SourceBuffers could have been removed.")}if(c.A.info("Init: Clearing HTMLMediaElement's src"),(0,Tt.A)(e),null!==n)try{c.A.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){c.A.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function Rt(e,t){return(0,v.A)(t,(function(n){var r=function(e,t){if(null==wt.j)throw new d.A("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,It.A)(e.src)?e.src:null;xt(e,null,n),c.A.info("Init: Creating MediaSource");var r=new wt.j,i=URL.createObjectURL(r);return c.A.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.register((function(){xt(e,r,i)})),r}(e,t);kt.bF(r,(function(){c.A.info("Init: MediaSource opened"),n(r)}),t)}))}function Ct(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){if("string"==typeof e)return Mt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(e,t):void 0}}(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 Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Pt=kt.yS,Dt=kt.bF,Nt=kt.G1;function Ot(e,t){if(c.A.debug("Init: Trying to call endOfStream"),"open"===e.readyState){var n=e.sourceBuffers,r=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(n);if(0===r.length)return c.A.info("Init: Triggering end of stream"),void e.endOfStream();c.A.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var i=new m.Ay;i.linkToSignal(t);for(var a,o=Ct(r);!(a=o()).done;){var s=a.value;Nt(s,(function(){i.cancel(),Ot(e,t)}),i.signal)}Pt(n,(function(){i.cancel(),Ot(e,t)}),i.signal)}else c.A.debug("Init: MediaSource not open, cancel endOfStream")}function Lt(e,t,n){var r;if(!(0,j.A)(n)){var i=e.getMinimumSafePosition(),a=e.getMaximumSafePosition();if(!(0,j.A)(n.position))return c.A.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,a),i);if(!(0,j.A)(n.wallClockTime)){c.A.debug("Init: using startAt.wallClockTime");var o=void 0===e.availabilityStartTime?0:e.availabilityStartTime,s=n.wallClockTime-o;return Math.max(Math.min(s,a),i)}if(!(0,j.A)(n.fromFirstPosition)){c.A.debug("Init: using startAt.fromFirstPosition");var u=n.fromFirstPosition;return u<=0?i:Math.min(a,i+u)}if(!(0,j.A)(n.fromLastPosition)){c.A.debug("Init: using startAt.fromLastPosition");var d=n.fromLastPosition;return d>=0?a:Math.max(i,a+d)}if(!(0,j.A)(n.fromLivePosition)){c.A.debug("Init: using startAt.fromLivePosition");var f=null!==(r=e.getLivePosition())&&void 0!==r?r:a,v=n.fromLivePosition;return v>=0?f:Math.max(i,f+v)}if(!(0,j.A)(n.percentage)){c.A.debug("Init: using startAt.percentage");var p=n.percentage;return p>100?a:p<0?i:i+(a-i)*(+p/100)}}var h=e.getMinimumSafePosition();if(e.isLive){var m,g=e.suggestedPresentationDelay,y=e.clockOffset,A=e.getMaximumSafePosition(),_=l.A.getCurrent().DEFAULT_LIVE_GAP;if(void 0===y)c.A.info("Init: no clock offset found for a live content, starting close to maximum available position"),m=A;else{c.A.info("Init: clock offset found for a live content, checking if we can start close to it");var b=void 0===e.availabilityStartTime?0:e.availabilityStartTime,S=(performance.now()+y)/1e3-b;m=Math.min(A,S)}var E=void 0!==g?g:t?_.LOW_LATENCY:_.DEFAULT;return c.A.debug("Init: "+m+" defined as the live time, applying a live gap of "+E),Math.max(m-E,h)}return c.A.info("Init: starting at the minimum available position:",h),h}var Ut=n(5097),Bt=n(107),Ft=n(6899);var Vt=31536e3,zt=function(){function e(e){this._mediaSource=e,this._currentMediaSourceDurationUpdateCanceller=null}var t=e.prototype;return t.updateDuration=function(e,t){null!==this._currentMediaSourceDurationUpdateCanceller&&this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=new m.Ay;var n=this._mediaSource,r=this._currentMediaSourceDurationUpdateCanceller.signal,i=function(e,t){var n=new h.A("open"===e.readyState,t);return(0,kt.bF)(e,(function(){c.A.debug("Init: Reacting to MediaSource open in duration updater"),n.setValueIfChanged(!0)}),t),(0,kt.Z1)(e,(function(){c.A.debug("Init: Reacting to MediaSource ended in duration updater"),n.setValueIfChanged(!1)}),t),(0,kt.XC)(e,(function(){c.A.debug("Init: Reacting to MediaSource close in duration updater"),n.setValueIfChanged(!1)}),t),n}(n,r),a=new m.Ay;a.linkToSignal(r),i.onUpdate((function(){if(a.cancel(),!i.getValue())return;(a=new m.Ay).linkToSignal(r);var o=function(e,t){if(0===e.length){var n=new h.A(!1);return n.finish(),n}var r=new h.A(!1,t);o();for(var i=function(){var n=e[a];n.addEventListener("updatestart",o),n.addEventListener("update",o),t.register((function(){n.removeEventListener("updatestart",o),n.removeEventListener("update",o)}))},a=0;a<e.length;a++)i();return r;function o(){for(var t=0;t<e.length;t++){if(e[t].updating)return void r.setValueIfChanged(!0)}r.setValueIfChanged(!1)}}(n.sourceBuffers,a.signal),s=new m.Ay;return s.linkToSignal(a.signal),o.onUpdate((function(r){s.cancel(),(s=new m.Ay).linkToSignal(a.signal),r||Wt(n,e,t,s.signal)}),{clearSignal:a.signal,emitCurrentValue:!0})}),{emitCurrentValue:!0,clearSignal:r})},t.stopUpdating=function(){null!==this._currentMediaSourceDurationUpdateCanceller&&(this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=null)},e}();function Kt(e,t,n){var r=t;n||(r=s.A7?1/0:Gt(t));for(var i=0,a=0;a<e.sourceBuffers.length;a++){var o=e.sourceBuffers[a],u=o.buffered.length;u>0&&(i=Math.max(o.buffered.end(u-1)))}if(r===e.duration)return"success";if(i>r){if(i<e.duration)try{c.A.info("Init: Updating duration to what is currently buffered",i),e.duration=i}catch(e){return c.A.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var l=e.duration;try{if(c.A.info("Init: Updating duration",r),e.duration=r,"open"===e.readyState&&!isFinite(r)){var d=Gt(t);c.A.info("Init: calling `mediaSource.setLiveSeekableRange`",d),e.setLiveSeekableRange(0,d)}}catch(e){return c.A.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var f=Math.abs(e.duration-r);return f>=.1?f<Math.abs(e.duration-l)?"partial":"failed":"success"}function Wt(e,t,n,r){if("success"!==Kt(e,t,n))var i=setTimeout((function(){a(),Wt(e,t,n,r)}),2e3),a=r.register((function(){clearTimeout(i)}))}function Gt(e){return Math.max(Math.pow(2,32),e+Vt)}var Ht=n(3137);var qt=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var jt=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(qt(u,{id:a,start:r,end:i}))return void n.push(u)}var l=o.value.element,d={type:o.type,value:Object.assign(Object.assign({},o.value),{element:l})};if(void 0===i){var c={start:r,id:a,data:d,publicEvent:{start:r,data:d}};n.push(c)}else{var f={start:r,end:i,id:a,data:d,publicEvent:{start:r,end:i,data:d}};n.push(f)}}))}return n};function Yt(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){if("string"==typeof e)return Qt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qt(e,t):void 0}}(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 Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Xt=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._manifest=t,i._mediaElement=n,i._playbackObserver=r,i._canceller=null,i._scheduledEventsRef=new h.A([]),i._eventsBeingPlayed=new WeakMap,i}(0,i.A)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(null===this._canceller){this._canceller=new m.Ay;var t=this._canceller.signal,n=this._playbackObserver,r=this._mediaElement,i=!1,a=new m.Ay;a.linkToSignal(t),this._manifest.addEventListener("manifestUpdate",(function(){var t=e._scheduledEventsRef.getValue();e._scheduledEventsRef.setValue(jt(t,e._manifest))}),this._canceller.signal),this._scheduledEventsRef.setValue(jt([],this._manifest)),this._scheduledEventsRef.onUpdate((function(o){if(0!==o.length){if(!i){i=!0;var s=f(),u=function(){var t=f();e._emitStreamEvents(e._scheduledEventsRef.getValue(),s,t,a.signal),s=t},d=l.A.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL,c=setInterval(u,d);n.listen(u,{includeLastObservation:!1,clearSignal:a.signal}),a.signal.register((function(){clearInterval(c)}))}}else i&&(a.cancel(),(a=new m.Ay).linkToSignal(t),i=!1);function f(){var e=n.getReference().getValue().seeking;return{currentTime:r.currentTime,isSeeking:e}}}),{emitCurrentValue:!0,clearSignal:t})}},n.stop=function(){null!==this._canceller&&(this._canceller.cancel(),this._canceller=null)},n._emitStreamEvents=function(e,t,n,r){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],c=d.start,f=$t(d)?d.end:void 0;this._eventsBeingPlayed.has(d)?(c>o||void 0!==f&&o>=f)&&($t(d)&&u.push(d.publicEvent),this._eventsBeingPlayed.delete(d)):c<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:d.publicEvent}),this._eventsBeingPlayed.set(d,!0)):i<c&&o>=(null!=f?f:c)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),$t(d)&&u.push(d.publicEvent)))}if(s.length>0)for(var v,p=Yt(s);!(v=p()).done;){var h=v.value;if("stream-event"===h.type?this.trigger("event",h.value):this.trigger("eventSkip",h.value),r.isCancelled())return}if(u.length>0)for(var m,g=Yt(u);!(m=g()).done;){var y=m.value;if("function"==typeof y.onExit&&y.onExit(),r.isCancelled())return}},t}(q.A);function $t(e){return void 0!==e.end}var Zt=Xt,Jt=n(8345);function en(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){if("string"==typeof e)return tn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tn(e,t):void 0}}(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 tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nn=function(e){function t(t){var n;(n=e.call(this)||this)._settings=t,n._initCanceller=new m.Ay,n._initialManifestProm=null;var r=void 0===t.url?void 0:[t.url];return n._manifestFetcher=new de(r,t.transport,t.manifestRequestSettings),n}(0,i.A)(t,e);var n=t.prototype;return n.prepare=function(){var e=this;null===this._initialManifestProm&&(this._initialManifestProm=(0,v.A)(this._initCanceller.signal,(function(t,n){e._manifestFetcher.addEventListener("warning",(function(t){return e.trigger("warning",t)})),e._manifestFetcher.addEventListener("error",(function(t){e.trigger("error",t),n(t)})),e._manifestFetcher.addEventListener("manifestReady",(function(e){t(e)}))})),this._manifestFetcher.start(),this._initCanceller.signal.register((function(){e._manifestFetcher.dispose()})))},n.start=function(e,t){var n=this;this.prepare(),(0,Jt.A)(e,(function(e){return n._onFatalError(e)}),this._initCanceller.signal);var r=new h.A(null,this._initCanceller.signal);this._initializeMediaSourceAndDecryption(e,r).then((function(i){return n._onInitialMediaSourceReady(e,i.mediaSource,t,i.drmSystemId,r,i.unlinkMediaSource)})).catch((function(e){n._onFatalError(e)}))},n.updateContentUrls=function(e,t){this._manifestFetcher.updateContentUrls(e,t)},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.isUsed()||(this._initCanceller.cancel(),this.trigger("error",e))},n._initializeMediaSourceAndDecryption=function(e,t){var n=this,r=this._initCanceller;return(0,v.A)(r.signal,(function(i){var a=n._settings.keySystems,o=(0,Ft.A)(e,a,t,{onWarning:function(e){return n.trigger("warning",e)},onError:function(e){return n._onFatalError(e)}},r.signal);o.onUpdate((function(t,a){if("uninitialized"!==t.initializationState.type){a();var s=new m.Ay;s.linkToSignal(r.signal),Rt(e,s.signal).then((function(e){var n=o.getValue();if("awaiting-media-link"===n.initializationState.type)n.initializationState.value.isMediaLinked.setValue(!0),o.onUpdate((function(t,n){if("initialized"===t.initializationState.type)return n(),void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})}),{emitCurrentValue:!0,clearSignal:r.signal});else if("initialized"===t.initializationState.type)return void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})})).catch((function(e){s.isUsed()||n._onFatalError(e)}))}}),{emitCurrentValue:!0,clearSignal:r.signal})}))},n._onInitialMediaSourceReady=function(){var e=(0,r.A)(o().mark((function e(t,n,r,i,a,s){var u,l,d,v,h,g,y,A,_,b,S,E,T,w,k,I,x,R,C,M,P,D=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P=function(e,n,i,o){R({mediaElement:t,playbackObserver:r,mediaSource:e,initialTime:n,autoPlay:i,manifest:T,representationEstimator:k,segmentFetcherCreator:x,speed:y,protectionRef:a,bufferOptions:I},(function(e){if(o.cancel(),S.isUsed())return;if(C("reloadingMediaSource",e),S.isUsed())return;var n=new m.Ay;n.linkToSignal(S.signal),Rt(t,n.signal).then((function(t){P(t,e.position,e.autoPlay,n)})).catch((function(e){n.isUsed()||M(e)}))}),o.signal)},u=this._settings,l=u.adaptiveOptions,d=u.autoPlay,v=u.bufferOptions,h=u.lowLatencyMode,g=u.segmentRequestOptions,y=u.speed,A=u.startAt,_=u.textTrackOptions,b=u.transport,S=this._initCanceller,(0,f.h)(null!==this._initialManifestProm),E=this._initialManifestProm,e.prev=5,e.next=8,E;case 8:T=e.sent,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return");case 14:if(T.addEventListener("manifestUpdate",(function(){D.trigger("manifestUpdate",null)}),S.signal),T.addEventListener("decipherabilityUpdate",(function(e){D.trigger("decipherabilityUpdate",e)}),S.signal),c.A.debug("Init: Calculating initial time"),w=Lt(T,h,A),c.A.debug("Init: Initial time calculated:",w),k=K(l),I=(0,p.A)({textTrackOptions:_,drmSystemId:i},v),x=new Ee(b,g,S.signal),this.trigger("manifestReady",T),!S.isUsed()){e.next=25;break}return e.abrupt("return");case 25:R=this._startBufferingOnMediaSource.bind(this),C=this.trigger.bind(this),M=this._onFatalError.bind(this),P(n,w,d,s);case 29:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}(),n._startBufferingOnMediaSource=function(e,t,n){var r,i=this,a=e.autoPlay,o=e.bufferOptions,s=e.initialTime,c=e.manifest,f=e.mediaElement,v=e.mediaSource,p=e.playbackObserver,g=e.protectionRef,y=e.representationEstimator,A=e.segmentFetcherCreator,_=e.speed,b=null!==(r=c.getPeriodForTime(s))&&void 0!==r?r:c.getNextPeriod(s);if(void 0===b){var S=new d.A("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return this._onFatalError(S)}var E=new Me(f,v);n.register((function(){E.disposeAll()}));var T=(0,Bt.A)(f,p,s,a,(function(e){return i.trigger("warning",e)}),!0,n),w=T.autoPlayResult,k=T.initialPlayPerformed,I=T.initialSeekPerformed;if(!n.isCancelled()){k.onUpdate((function(e,t){if(e){t();var r=new Zt(c,f,p);r.addEventListener("event",(function(e){i.trigger("streamEvent",e)}),n),r.addEventListener("eventSkip",(function(e){i.trigger("streamEventSkip",e)}),n),r.start(),n.register((function(){r.stop()}))}}),{clearSignal:n,emitCurrentValue:!0});var x=function(e,t,n){var r=t.autoPlay,i=t.initialPlayPerformed,a=t.initialSeekPerformed,o=t.manifest,s=t.speed,u=t.startTime;return e.deriveReadOnlyObserver((function(e,t){var l=new m.Ay;l.linkToSignal(t),l.linkToSignal(n);var d=new h.A(c(),l.signal);return s.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),e.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),d;function c(){var t,n=e.getValue(),l=s.getValue();if(a.getValue()){if(!o.isDynamic||o.isLastPeriodKnown){var d=o.periods[o.periods.length-1];void 0!==d&&void 0!==d.end&&n.position>d.end&&(t=d.end-1)}}else t=u;return{maximumPosition:o.getMaximumSafePosition(),position:{last:n.position,pending:t},duration:n.duration,paused:{last:n.paused,pending:i.getValue()||!r===n.paused?void 0:!r},readyState:n.readyState,speed:l}}function f(){d.setValue(c())}}))}(p,{autoPlay:a,manifest:c,initialPlayPerformed:k,initialSeekPerformed:I,speed:_,startTime:s},n),R=this._createRebufferingController(p,c,_,n),C=this._createContentTimeBoundariesObserver(c,v,x,E,n);u&&c.addEventListener("decipherabilityUpdate",(function(e){e.some((function(e){return!0!==e.representation.decipherable}))&&P(0,void 0,void 0)}),n),w.then((function(){(0,Ut.A)(p,f,!1,n).onUpdate((function(e,t){e&&(t(),i.trigger("loaded",{segmentBuffersStore:E}))}),{emitCurrentValue:!0,clearSignal:n})})).catch((function(e){n.isCancelled()||i._onFatalError(e)}));var M=this;mt({manifest:c,initialPeriod:b},x,y,E,A,o,{needsBufferFlush:function(){var e=f.currentTime+.001;p.setCurrentTime(e),p.listen((function(t,n){(null!==t.currentRange||t.position>e+.1)&&(n(),p.setCurrentTime(t.position+.001))}),{includeLastObservation:!1,clearSignal:n})},streamStatusUpdate:function(e){var t=e.period,r=e.bufferType,i=e.imminentDiscontinuity,a=e.position;R.updateDiscontinuityInfo({period:t,bufferType:r,discontinuity:i,position:a}),n.isCancelled()||c.isLastPeriodKnown&&e.period.id===c.periods[c.periods.length-1].id&&(e.hasFinishedLoading||e.isEmptyStream?C.onLastSegmentFinishedLoading(e.bufferType):C.onLastSegmentLoadingResume(e.bufferType))},needsManifestRefresh:function(){return M._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!0,canUseUnsafeMode:!0})},manifestMightBeOufOfSync:function(){var e=l.A.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;M._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!1,canUseUnsafeMode:!1,delay:e})},lockedStream:function(e){return R.onLockedStream(e.bufferType,e.period)},adaptationChange:function(e){M.trigger("adaptationChange",e),n.isCancelled()||C.onAdaptationChange(e.type,e.period,e.adaptation)},representationChange:function(e){M.trigger("representationChange",e),n.isCancelled()||C.onRepresentationChange(e.type,e.period)},inbandEvent:function(e){return M.trigger("inbandEvents",e)},warning:function(e){return M.trigger("warning",e)},periodStreamReady:function(e){return M.trigger("periodStreamReady",e)},periodStreamCleared:function(e){C.onPeriodCleared(e.type,e.period),n.isCancelled()||M.trigger("periodStreamCleared",e)},bitrateEstimationChange:function(e){return M.trigger("bitrateEstimationChange",e)},addedSegment:function(e){return M.trigger("addedSegment",e)},needsMediaSourceReload:function(e){P(e.timeOffset,e.minimumPosition,e.maximumPosition)},needsDecipherabilityFlush:function(){var e,n,r,i,a=(0,W.A)(f);if(void 0===(i=null==a?void 0:a[0])||i.indexOf("widevine")<0){var o=x.getReference().getValue(),s=null!==(e=o.position.pending)&&void 0!==e?e:x.getCurrentTime(),u=null!==(n=o.paused.pending)&&void 0!==n?n:x.getIsPaused();t({position:s,autoPlay:!u})}else{var l=x.getReference().getValue(),d=null!==(r=l.position.pending)&&void 0!==r?r:x.getCurrentTime();d+.001<l.duration?p.setCurrentTime(f.currentTime+.001):p.setCurrentTime(d)}},encryptionDataEncountered:function(e){for(var t,r=en(e);!(t=r()).done;){var i=t.value;if(g.setValue(i),n.isCancelled())return}},error:function(e){return M._onFatalError(e)}},n)}function P(e,n,r){var i,a,o=x.getReference().getValue(),s=null!==(i=o.position.pending)&&void 0!==i?i:x.getCurrentTime(),u=null!==(a=o.paused.pending)&&void 0!==a?a:x.getIsPaused(),l=s+e;void 0!==n&&(l=Math.max(n,l)),void 0!==r&&(l=Math.min(r,l)),t({position:l,autoPlay:!u})}},n._createContentTimeBoundariesObserver=function(e,t,n,r,i){var a=this,o=new zt(t);i.register((function(){o.stopUpdating()}));var s=null,u=new _t(e,n,r.getBufferTypes());i.register((function(){u.dispose()})),u.addEventListener("warning",(function(e){return a.trigger("warning",e)})),u.addEventListener("periodChange",(function(e){a.trigger("activePeriodChanged",{period:e})})),u.addEventListener("endingPositionChange",(function(e){return o.updateDuration(e.endingPosition,e.isEnd)})),u.addEventListener("endOfStream",(function(){null===s&&((s=new m.Ay).linkToSignal(i),c.A.debug("Init: end-of-stream order received."),function(e,t){var n=new m.Ay;n.linkToSignal(t),Dt(e,(function(){c.A.debug("Init: MediaSource re-opened while end-of-stream is active"),n.cancel(),(n=new m.Ay).linkToSignal(t),Ot(e,n.signal)}),t),Ot(e,n.signal)}(t,s.signal))})),u.addEventListener("resumeStream",(function(){null!==s&&(c.A.debug("Init: resume-stream order received."),s.cancel(),s=null)}));var l=u.getCurrentEndingTime();return o.updateDuration(l.endingPosition,l.isEnd),u},n._createRebufferingController=function(e,t,n,r){var i=this,a=new Ht.A(e,t,n);return a.addEventListener("stalled",(function(e){return i.trigger("stalled",e)})),a.addEventListener("unstalled",(function(){return i.trigger("unstalled",null)})),a.addEventListener("warning",(function(e){return i.trigger("warning",e)})),r.register((function(){return a.destroy()})),a.start(),a},t}(gt.Y)},4640:function(e,t,n){"use strict";n.d(t,{Y:function(){return i}});var r=n(7387),i=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t}(n(79).A)},5097:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(443);var i=n(2097),a=n(8315),o=n(2507);function s(e,t,n,s){var u=new o.Ay;u.linkToSignal(s);var l=new a.A(!1,u.signal);return e.listen((function(e){if(null===e.rebuffering&&null===e.freezing&&0!==e.readyState){if(!function(e){return!e||!r.dX}(n)){if(isNaN(t.duration))return;if(t.duration>0)return l.setValue(!0),void u.cancel()}var a=r.A7?4:3;return e.readyState>=a&&(null!==e.currentRange||e.ended)&&(!(0,i.A)()||t.duration>0)?(l.setValue(!0),void u.cancel()):void 0}}),{includeLastObservation:!0,clearSignal:u.signal}),l}},107:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(2097),i=n(9770),a=n(443),o=n(7913);var s=n(5575),u=n(9477),l=n(8315);function d(e,t,n,d,c,f,v){var p,h,m=new Promise((function(e,t){p=e,h=t})),g=new l.A(!1,v),y=new l.A(!1,v);e.addEventListener("loadedmetadata",_);var A=v.register((function(t){e.removeEventListener("loadedmetadata",_),h(t)}));return e.readyState>=i.t.HAVE_METADATA&&_(),{autoPlayResult:m,initialPlayPerformed:y,initialSeekPerformed:g};function _(){e.removeEventListener("loadedmetadata",_);var i=!1,l=function(e){u.A.info("Init: Set initial time",e),t.setCurrentTime(e),i=!0,g.setValue(!0),g.finish()},m="function"==typeof n?n():n;if(void 0===m&&f&&e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA?t.listen((function(e,t){if(e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA){var r="function"==typeof n?n():n;void 0===r?(g.setValue(!0),g.finish()):f&&a.dX?setTimeout((function(){l(r)}),0):l(r),t()}})):void 0===m||(a.qe||a.h$)&&0===m?(g.setValue(!0),g.finish()):f&&a.dX?setTimeout((function(){l(m)}),0):l(m),(0,r.A)()&&0===e.duration){var b=new s.A("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");c(b)}if(!v.isCancelled()){var S=i;t.listen((function(t,n){!i||!t.seeking&&"seeking"!==t.event&&"internal-seeking"!==t.event?!S&&!t.seeking&&(o.A&&t.readyState>=3||null===t.rebuffering)&&t.readyState>=1&&(n(),function(){var t,n;if(u.A.info("Init: Can begin to play content"),!d)return e.autoplay&&u.A.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),y.setValue(!0),y.finish(),A(),p({type:"skipped"});if(e.ended)return u.A.warn("Init: autoplay is enabled but the video is ended. Skipping autoplay to prevent video to start again"),y.setValue(!0),y.finish(),A(),p({type:"skipped"});try{n=null!==(t=e.play())&&void 0!==t?t:Promise.resolve()}catch(e){return A(),h(e)}n.then((function(){if(!v.isCancelled())return y.setValue(!0),y.finish(),A(),p({type:"autoplay"})})).catch((function(e){if(A(),!v.isCancelled()){if(e instanceof Error&&"NotAllowedError"===e.name){u.A.warn("Init: Media element can't play. It may be due to browser auto-play policies.");var t=new s.A("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");if(c(t),v.isCancelled())return;return p({type:"autoplay-blocked"})}h(e)}}))}()):S=!1}),{includeLastObservation:!0,clearSignal:v})}}}},6899:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(1956),i=n(418),a=n(9477),o=n(8315),s=n(2507),u=n(2137);function l(e,t,n,l,d){if(0===t.length)return h("No `keySystems` option given.");if(null===i.A.decrypt)return h("EME feature not activated.");var c=new s.Ay;c.linkToSignal(d);var f=new o.A({initializationState:{type:"uninitialized",value:null},drmSystemId:void 0},d),v=i.A.decrypt;if(!v.hasEmeApis())return h("EME API not available on the current page.");a.A.debug("Init: Creating ContentDecryptor");var p=new v(e,t);return p.addEventListener("stateChange",(function(e){if(e===u.R.WaitingForAttachment){var t=new o.A(!1);t.onUpdate((function(t,n){t&&(n(),e===u.R.WaitingForAttachment&&p.attach())}),{clearSignal:c.signal}),f.setValue({initializationState:{type:"awaiting-media-link",value:{isMediaLinked:t}},drmSystemId:p.systemId})}else e===u.R.ReadyForContent&&(f.setValue({initializationState:{type:"initialized",value:null},drmSystemId:p.systemId}),p.removeEventListener("stateChange"))})),p.addEventListener("error",(function(e){c.cancel(),l.onError(e)})),p.addEventListener("warning",(function(e){l.onWarning(e)})),n.onUpdate((function(e){null!==e&&p.onInitializationData(e)}),{clearSignal:c.signal}),c.signal.register((function(){p.dispose()})),f;function h(e){n.onUpdate((function(t,n){if(null!==t){n();var i=new r.A("MEDIA_IS_ENCRYPTED_ERROR",e);l.onError(i)}}),{clearSignal:d});var t=new o.A({initializationState:{type:"initialized",value:null},drmSystemId:void 0});return t.finish(),t}}},3137:function(e,t,n){"use strict";n.d(t,{A:function(){return f}});var r=n(7387),i=n(7913),a=n(5151),o=n(5575),s=n(9477),u=n(79),l=n(3650),d=n(2507),c=1/60,f=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._playbackObserver=t,i._manifest=n,i._speed=r,i._discontinuitiesStore=[],i._isStarted=!1,i._canceller=new d.Ay,i}(0,r.A)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(!this._isStarted){var t;this._isStarted=!0;var n=null,r=new h(this._playbackObserver,this._speed);this._canceller.signal.register((function(){r.dispose()}));var o=null;this._playbackObserver.listen((function(u){var d,f,v=e._discontinuitiesStore,h=u.buffered,m=u.position,g=u.readyState,y=u.rebuffering,A=u.freezing,_=a.A.getCurrent(),b=_.BUFFER_DISCONTINUITY_THRESHOLD,S=_.FORCE_DISCONTINUITY_SEEK_DELAY,E=_.FREEZING_STALLED_DELAY,T=_.UNFREEZING_SEEK_DELAY,w=_.UNFREEZING_DELTA_POSITION;if(!u.seeking&&i.A&&null===n&&null!==t&&u.position<t){s.A.debug("Init: the device appeared to have seeked back by itself.");var k=performance.now();n=k}if(t=u.seeking?Math.max(null!==(d=u.pendingInternalSeek)&&void 0!==d?d:0,u.position):null,null!==A){var I=performance.now();if(I-(null===o?A.timestamp:o.attemptTimestamp)>T&&(s.A.warn("Init: trying to seek to un-freeze player"),e._playbackObserver.setCurrentTime(e._playbackObserver.getCurrentTime()+w),o={attemptTimestamp:I}),I-A.timestamp>E)return null===y||null!==n?r.stopRebuffering():r.startRebuffering(),void e.trigger("stalled","freezing")}else o=null;if(null===y)return r.stopRebuffering(),1===g?(f=u.seeking?null!==u.pendingInternalSeek?"internal-seek":"seeking":"not-ready",void e.trigger("stalled",f)):void e.trigger("unstalled",null);var x="seeking"===y.reason&&null!==u.pendingInternalSeek?"internal-seek":y.reason;if(null!==n){var R=performance.now();if(R-n<S)return r.stopRebuffering(),s.A.debug("Init: letting the device get out of a stall by itself"),void e.trigger("stalled",x);s.A.warn("Init: ignored stall for too long, checking discontinuity",R-n)}if(n=null,r.startRebuffering(),null!==e._manifest){var C=y.position;if(null!=C&&e._speed.getValue()>0){var M=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 u=e[i],l=u.discontinuity,d=u.position,f=l.start,v=l.end;if(n>=(null!=f?f:d)-c)if(null===v){var p=t.getPeriodAfter(a);null!==p?o=p.start+c:s.A.warn("Init: discontinuity at Period's end but no next Period")}else n<v+c&&(o=v+c);void 0!==o&&(s.A.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(v,e._manifest,C);if(null!==M){var P=M+.001;if(!(P<=e._playbackObserver.getCurrentTime()))return s.A.warn("SA: skippable discontinuity found in the stream",m,P),e._playbackObserver.setCurrentTime(P),void e.trigger("warning",p(C,P));s.A.info("Init: position to seek already reached, no seeking",e._playbackObserver.getCurrentTime(),P)}}var D=null!=C?C:m,N=(0,l.Td)(h,D);if(e._speed.getValue()>0&&N<b){var O=D+N+c;if(e._playbackObserver.getCurrentTime()<O)return s.A.warn("Init: discontinuity encountered inferior to the threshold",D,O,b),e._playbackObserver.setCurrentTime(O),void e.trigger("warning",p(D,O))}for(var L=e._manifest.periods.length-2;L>=0;L--){var U=e._manifest.periods[L];if(void 0!==U.end&&U.end<=D){if(e._manifest.periods[L+1].start>D&&e._manifest.periods[L+1].start>e._playbackObserver.getCurrentTime()){var B=e._manifest.periods[L+1];return e._playbackObserver.setCurrentTime(B.start),void e.trigger("warning",p(D,B.start))}break}}e.trigger("stalled",x)}else e.trigger("stalled",x)}),{includeLastObservation:!0,clearSignal:this._canceller.signal})}},n.updateDiscontinuityInfo=function(e){this._isStarted||this.start();var t=this._playbackObserver.getReference().getValue();!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;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return void(v(t)?e[a]=t:e.splice(a,1))}else if(e[a].period.start>r.start)return void(v(t)&&e.splice(a,0,t));v(t)&&e.push(t)}(this._discontinuitiesStore,e,t)},n.onLockedStream=function(e,t){var n;this._isStarted||this.start();var r=this._playbackObserver.getReference().getValue();if(!(!r.rebuffering||r.paused||this._speed.getValue()<=0||"audio"!==e&&"video"!==e)){var i=r.position,a=null!==(n=r.rebuffering.position)&&void 0!==n?n:i,o=t.start;i<o&&Math.abs(a-o)<1&&(s.A.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),this._playbackObserver.setCurrentTime(o+.001))}},n.destroy=function(){this._canceller.cancel()},t}(u.A);function v(e){return null!==e.discontinuity}function p(e,t){return new o.A("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var h=function(){function e(e,t){this._speedUpdateCanceller=new d.Ay,this._isRebuffering=!1,this._playbackObserver=e,this._isDisposed=!1,this._speed=t,this._updateSpeed()}var t=e.prototype;return t.startRebuffering=function(){this._isRebuffering||this._isDisposed||(this._isRebuffering=!0,this._speedUpdateCanceller.cancel(),s.A.info("Init: Pause playback to build buffer"),this._playbackObserver.setPlaybackRate(0))},t.stopRebuffering=function(){this._isRebuffering&&!this._isDisposed&&(this._isRebuffering=!1,this._speedUpdateCanceller=new d.Ay,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){s.A.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},8345:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(5575),i=n(6787);function a(e,t,n){function a(){var n,a,o=e.error;switch((0,i.A)(o)||(n=o.code,a=o.message),n){case 1:return a=null!=a?a:"The fetching of the associated resource was aborted by the user's request.",t(new r.A("MEDIA_ERR_ABORTED",a));case 2:return a=null!=a?a:"A network error occurred which prevented the media from being successfully fetched",t(new r.A("MEDIA_ERR_NETWORK",a));case 3:return a=null!=a?a:"An error occurred while trying to decode the media resource",t(new r.A("MEDIA_ERR_DECODE",a));case 4:return a=null!=a?a:"The media resource has been found to be unsuitable.",t(new r.A("MEDIA_ERR_SRC_NOT_SUPPORTED",a));default:return a=null!=a?a:"The HTMLMediaElement errored due to an unknown reason.",t(new r.A("MEDIA_ERR_UNKNOWN",a))}}n.isCancelled()||(e.addEventListener("error",a),n.register((function(){e.removeEventListener("error",a)})))}},4166:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(9477),a=n(7500),o=n(3481),s=function(e){function t(){var t;return i.A.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new o.A,t}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){i.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){i.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){var t,n;if(i.A.debug("ISB: appending new data."),null===e.data.chunk)return Promise.resolve();var r=e.data,a=r.appendWindow,o=r.chunk,s=o.start,u=o.end,l=o.timescale,d=null!==(t=a[0])&&void 0!==t?t:0,c=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(d,f),h=Math.min(c,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0,performance.now())}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return i.A.info("ISB: ignored image data remove order",e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){i.A.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(a.K)},7938:function(e,t,n){"use strict";n.d(t,{A:function(){return T}});var r=n(7387),i=n(5121),a=n(9477),o=n(8315),s=n(2186).A?void 0:window.ResizeObserver;var u=n(5151),l=n(2507),d=n(7500),c=n(3481),f=n(418);function v(e,t,n){return void 0===n&&(n=.2),Math.abs(e-t)<=Math.min(n,.2)}function p(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function h(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function m(e,t,n){var r=Math.max(e.start,t),i=p(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=h(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var g=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);if(0===n.length&&a.length>0)for(var s=0;s<a.length;s++)(v(e,a[s].start,.001)||v(e,a[s].end,.001))&&n.push(a[s].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=h(a.cues,n),a.start=n;else{var o=m(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=p(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r,i,a,o,s=this._cuesBuffer,u={start:t,end:n,cues:e},l=Math.abs(t-n)/5;function d(e){var t=s[e];void 0===t||v(u.end,t.end,l)?s[e]=u:(t.start>=u.end||(t.cues=h(t.cues,u.end),t.start=u.end),s.splice(e,0,u))}for(var c=0;c<s.length;c++){var f=s[c];if(t<f.end){if(i=f,a=void 0,o=void 0,a=(r=u).end-r.start,o=i.end-i.start,Math.abs(r.start-i.start)/Math.min(a,o,.2)<=.05){if(v(n,f.end,l))return void(s[c]=u);if(n<f.end)return f.cues=h(f.cues,n),f.start=n,void s.splice(c,0,u);do{s.splice(c,1),f=s[c]}while(void 0!==f&&n>f.end);return void d(c)}if(t<f.start){if(n<f.start)return void s.splice(c,0,u);if(v(n,f.start,l))return f.start=n,void s.splice(c,0,u);if(v(n,f.end,l))return void s.splice(c,1,u);if(n<f.end)return f.cues=h(f.cues,n),f.start=n,void s.splice(c,0,u);do{s.splice(c,1),f=s[c]}while(void 0!==f&&n>f.end);return void d(c)}if(v(f.end,n,l))return f.cues=p(f.cues,t),f.end=t,void s.splice(c+1,0,u);if(f.end>n){var g=m(f,t,n),y=g[0],A=g[1];return this._cuesBuffer[c]=y,s.splice(c+1,0,u),void s.splice(c+2,0,A)}f.cues=p(f.cues,t),f.end=t;var _=c+1;for(f=s[_];void 0!==f&&n>f.end;)s.splice(_,1),f=s[_];return void d(_)}}if(s.length){var b=s[s.length-1];v(b.end,t,l)&&(b.end=t)}s.push(u)},e}();function y(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 d=s.getAttribute("data-proportional-height");null===d||isNaN(+d)||(s.style.height=String(+d*i[1])+"px");var c=s.getAttribute("data-proportional-line-height");null===c||isNaN(+c)||(s.style.lineHeight=String(+c*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*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 A=i.g9,_=i.Bi,b=i.ID;function S(e,t){try{e.removeChild(t)}catch(e){a.A.warn("HTSB: Can't remove text track: not in the element.")}}function E(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 T=function(e){function t(t,n){var r;return a.A.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new c.A,r._videoElement=t,r._textTrackElement=n,r._sizeUpdateCanceller=new l.Ay,r._canceller=new l.Ay,r._buffer=new g,r._currentCues=[],r.autoRefreshSubtitles(r._canceller.signal),r}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){a.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){try{this.pushChunkSync(e)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this.removeBufferSync(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.A.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._canceller.cancel()},n.pushChunkSync=function(e){var t,n;a.A.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk;if(null!==s){var u,l,d=s.start,c=s.end,v=s.data,p=s.type,h=s.language,m=null!==(t=o[0])&&void 0!==t?t:0,g=null!==(n=o[1])&&void 0!==n?n:1/0,y=function(e,t,n,r){a.A.debug("HTSB: Finding parser for html text tracks:",e);var i=f.A.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.A.debug("HTSB: Parser found, parsing...");var o=i(t,n,r);return a.A.debug("HTTB: Parsed successfully!",o.length),o}(p,v,i,h);if(0!==m&&g!==1/0){for(var A=0;A<y.length&&y[A].end<=m;)A++;for(y.splice(0,A),A=0;A<y.length&&y[A].start<m;)y[A].start=m,A++;for(A=y.length-1;A>=0&&y[A].start>=g;)A--;for(y.splice(A,y.length),A=y.length-1;A>=0&&y[A].end>g;)y[A].end=g,A--}if(void 0!==d)u=Math.max(m,d);else{if(y.length<=0)return void a.A.warn("HTSB: Current text tracks have no cues nor start time. Aborting");a.A.warn("HTSB: No start time given. Guessing from cues."),u=y[0].start}if(void 0!==c)l=Math.min(g,c);else{if(y.length<=0)return void a.A.warn("HTSB: Current text tracks have no cues nor end time. Aborting");a.A.warn("HTSB: No end time given. Guessing from cues."),l=y[y.length-1].end}l<=u?a.A.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,!0,performance.now()),this._buffer.insert(y,u,l),this._buffered.insert(u,l))}},n.removeBufferSync=function(e,t){a.A.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._sizeUpdateCanceller.cancel(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)S(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._sizeUpdateCanceller.cancel();for(var t=0;t<this._currentCues.length;t++)S(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=E(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var d=this._currentCues.filter((function(e){return null!==e.resolution}));if(d.length>0){this._sizeUpdateCanceller=new l.Ay,this._sizeUpdateCanceller.linkToSignal(this._canceller.signal);var c=u.A.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=new o.A({height:i,width:u},n),d=i,c=u;if(void 0!==s){var f=new s((function(e){if(0!==e.length){var t=e[0].contentRect,n=t.height,r=t.width;n===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}else a.A.error("Compat: Resized but no observed element.")}));f.observe(e),n.register((function(){f.disconnect()}))}else{var v=setInterval((function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;n===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,c,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<d.length;r++){var i=d[r];y(t,n,i.resolution,i.element)}}),{clearSignal:this._sizeUpdateCanceller.signal,emitCurrentValue:!0})}}},n.autoRefreshSubtitles=function(e){var t=this,n=null,r=u.A.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,i=function(){a(),(n=new l.Ay).linkToSignal(e);var i=setInterval((function(){return t.refreshSubtitles()}),r);n.signal.register((function(){clearInterval(i)})),t.refreshSubtitles()};function a(){null!==n&&(n.cancel(),n=null)}b(this._videoElement,(function(){a(),t._disableCurrentCues()}),e),_(this._videoElement,i,e),A(this._videoElement,i,e),i()},n.refreshSubtitles=function(){var e,t=u.A.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL;e=this._videoElement.paused||this._videoElement.playbackRate<=0?this._videoElement.currentTime:Math.max(this._videoElement.currentTime+t/1e3/2,0);var n=this._buffer.get(e);0===n.length?this._disableCurrentCues():this._displayCues(n)},t}(d.K)},8385:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(7387),i=n(443);var a=n(9477);function o(e,t){if(i.gm&&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){a.A.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){a.A.warn("Compat: Could not remove cue from text track.")}}var s=n(7500),u=n(3481),l=n(418);var d=function(e){function t(t,n){var r;a.A.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var o=function(e,t){var n,r,a,o,s="subtitles";if(i.h$){var u=e.textTracks.length;(a=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=a.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=a.SHOWING)&&void 0!==r?r:"showing"}else o=document.createElement("track"),e.appendChild(o),a=o.track,o.kind=s,a.mode=t?"hidden":"showing";return{track:a,trackElement:o}}(t,n),s=o.track,l=o.trackElement;return r.bufferType="text",r._buffered=new u.A,r._videoElement=t,r._track=s,r._trackElement=l,r}(0,r.A)(t,e);var n=t.prototype;return n.declareInitSegment=function(e){a.A.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.A.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},n.pushChunk=function(e){var t,n;if(a.A.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return Promise.resolve();var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk,u=s.start,d=s.end,c=s.data,f=s.type,v=s.language,p=null!==(t=o[0])&&void 0!==t?t:0,h=null!==(n=o[1])&&void 0!==n?n:1/0;try{var m,g,y=function(e,t,n,r){a.A.debug("NTSB: Finding parser for native text tracks:",e);var i=l.A.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.A.debug("NTSB: Parser found, parsing...");var o=i(t,n,r);return a.A.debug("NTSB: Parsed successfully!",o.length),o}(f,c,i,v);if(0!==p&&h!==1/0){for(var A=0;A<y.length&&y[A].endTime<=p;)A++;for(y.splice(0,A),A=0;A<y.length&&y[A].startTime<p;)y[A].startTime=p,A++;for(A=y.length-1;A>=0&&y[A].startTime>=h;)A--;for(y.splice(A,y.length),A=y.length-1;A>=0&&y[A].endTime>h;)y[A].endTime=h,A--}if(void 0!==u)m=Math.max(p,u);else{if(y.length<=0)return a.A.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),Promise.resolve();a.A.warn("NTSB: No start time given. Guessing from cues."),m=y[0].startTime}if(void 0!==d)g=Math.min(h,d);else{if(y.length<=0)return a.A.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),Promise.resolve();a.A.warn("NTSB: No end time given. Guessing from cues."),g=y[y.length-1].endTime}if(g<=m)return a.A.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),Promise.resolve();if(y.length>0){var _=y[0],b=this._track.cues;null!==b&&b.length>0&&_.startTime<b[b.length-1].startTime&&this._removeData(_.startTime,1/0);for(var S=0;S<y.length;S++)this._track.addCue(y[S])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0,performance.now())}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this._removeData(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.A.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){a.A.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){a.A.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 s=r[i],u=s.startTime,l=s.endTime;u>=e&&u<=t&&l<=t&&o(n,s)}this._buffered.remove(e,t)},t}(s.K)},7500:function(e,t,n){"use strict";n.d(t,{K:function(){return y},B:function(){return m}});var r=n(5151),i=n(9477),a=n(7841);function o(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){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.Q)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=o(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 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){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var c=function(){function e(){var e=r.A.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new u(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e,t){var n,a,o,s,u,d,c;void 0===t&&(t=!1);for(var f=this._inventory,v=0,m=f[0],g=r.A.getCurrent().MINIMUM_SEGMENT_SIZE,y=null==m?void 0:m.infos.adaptation.type,A=e.length,_=0;_<A;_++){if(void 0===m)return;var b=e.start(_),S=e.end(_);if(S-b<g)i.A.warn("SI: skipped TimeRange when synchronizing because it was too small",y,b,S);else{for(var E=v;void 0!==m&&(null!==(n=m.bufferedEnd)&&void 0!==n?n:m.end)-b<g;)m=f[++v];var T=null,w=v-E;if(w>0){var k=f[E+w-1];T={end:null!==(a=k.bufferedEnd)&&void 0!==a?a:k.end,precizeEnd:k.precizeEnd},i.A.debug("SI: "+w+" segments GCed.",y);for(var I,x=l(f.splice(E,w));!(I=x()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&2!==R.status&&this._bufferedHistory.addBufferedSegment(R.infos,null)}v=E}if(void 0===m)return;if(S-(null!==(o=m.bufferedStart)&&void 0!==o?o:m.start)>=g){if(p(m,b,T,y),v===f.length-1)return void h(m,S,y);for(var C=null!==(s=(m=f[++v]).bufferedStart)&&void 0!==s?s:m.start,M=null!==(u=m.bufferedEnd)&&void 0!==u?u:m.end,P=_<A-1?e.start(_+1):void 0;void 0!==m&&S-C>=g&&(void 0===P||S-C>=M-P);){var D=f[v-1];void 0===D.bufferedEnd&&(m.precizeStart?D.bufferedEnd=m.start:D.infos.segment.complete?D.bufferedEnd=D.end:D.bufferedEnd=m.start,i.A.debug("SI: calculating buffered end of contiguous segment",y,D.bufferedEnd,D.end)),m.bufferedStart=D.bufferedEnd,void 0!==(m=f[++v])&&(C=null!==(d=m.bufferedStart)&&void 0!==d?d:m.start,M=null!==(c=m.bufferedEnd)&&void 0!==c?c:m.end)}}var N=f[v-1];void 0!==N&&h(N,S,y)}}if(null!=m){i.A.debug("SI: last segments have been GCed",y,v,f.length);for(var O,L=l(f.splice(v,f.length-v));!(O=L()).done;){var U=O.value;void 0===U.bufferedStart&&void 0===U.bufferedEnd&&2!==U.status&&this._bufferedHistory.addBufferedSegment(U.infos,null)}}!t&&void 0!==y&&i.A.hasLevel("DEBUG")&&i.A.debug("SI: current "+y+" 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 d,c=l.infos.period.id,f=l.infos.representation.id,v=n[c],p=void 0;if(void 0===v)p=o(l.infos),n[c]=((d={})[f]=p,d);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}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,t,n){var r=e.period,a=e.adaptation,o=e.representation,s=e.segment,u=e.chunkSize,l=e.start,d=e.end;if(!s.isInit){var c=a.type;if(l>=d)i.A.warn("SI: Invalid chunked inserted: starts before it ends",c,l,d);else{for(var f=this._inventory,v={status:t?0:2,insertionTs:n,chunkSize:u,splitted:!1,start:l,end:d,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:s,period:r,adaptation:a,representation:o}},p=f.length-1;p>=0;p--){var h=f[p];if(h.start<=l){if(h.end<=l){for(i.A.debug("SI: Pushing segment strictly after previous one.",c,l,h.end),this._inventory.splice(p+1,0,v),p+=2;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}if(h.start===l){if(h.end<=d){for(i.A.debug("SI: Segment pushed replace another one",c,l,d,h.end),this._inventory.splice(p,1,v),p+=1;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}return i.A.debug("SI: Segment pushed ends before another with the same start",c,l,d,h.end),f.splice(p,0,v),h.start=v.end,h.bufferedStart=void 0,void(h.precizeStart=h.precizeStart&&v.precizeEnd)}if(h.end<=v.end){for(i.A.debug("SI: Segment pushed updates end of previous one",c,l,d,h.start,h.end),this._inventory.splice(p+1,0,v),h.end=v.start,h.bufferedEnd=void 0,h.precizeEnd=h.precizeEnd&&v.precizeStart,p+=2;p<f.length&&f[p].start<v.end;){if(f[p].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[p].start),f[p].start=v.end,f[p].bufferedStart=void 0,void(f[p].precizeStart=f[p].precizeStart&&v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[p].start,f[p].end),f.splice(p,1)}return}i.A.warn("SI: Segment pushed is contained in a previous one",c,l,d,h.start,h.end);var m={status:h.status,insertionTs:h.insertionTs,chunkSize:h.chunkSize,splitted:!0,start:v.end,end:h.end,precizeStart:h.precizeStart&&h.precizeEnd&&v.precizeEnd,precizeEnd:h.precizeEnd,bufferedStart:void 0,bufferedEnd:h.end,infos:h.infos};return h.end=v.start,h.splitted=!0,h.bufferedEnd=void 0,h.precizeEnd=h.precizeEnd&&v.precizeStart,f.splice(p+1,0,v),void f.splice(p+2,0,m)}}var g=this._inventory[0];if(void 0===g)return i.A.debug("SI: first segment pushed",c,l,d),void this._inventory.push(v);if(!(g.start>=d)){if(g.end<=d){for(i.A.debug("SI: Segment pushed starts before and completely recovers the previous first one",c,l,d,g.start,g.end),this._inventory.splice(0,1,v);f.length>1&&f[1].start<v.end;){if(f[1].end>v.end)return i.A.debug("SI: Segment pushed updates the start of the next one",c,v.end,f[1].start),f[1].start=v.end,f[1].bufferedStart=void 0,void(f[1].precizeStart=v.precizeEnd);i.A.debug("SI: Segment pushed removes the next one",c,l,d,f[1].start,f[1].end),f.splice(1,1)}return}return i.A.debug("SI: Segment pushed start of the next one",c,l,d,g.start,g.end),g.start=d,g.bufferedStart=void 0,g.precizeStart=v.precizeEnd,void this._inventory.splice(0,0,v)}i.A.debug("SI: Segment pushed comes before all previous ones",c,l,d,g.start),this._inventory.splice(0,0,v)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.Q)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.A.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,d=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.Q)(n[o].infos,e);){var c=n[o].chunkSize;void 0!==d&&void 0!==c&&(d+=c),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),0===this._inventory[u].status&&(this._inventory[u].status=1),this._inventory[u].chunkSize=d,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.A.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=l(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?2!==y.status&&this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.A.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}();function f(e){if(void 0===e.bufferedStart||1!==e.status)return!1;var t=e.start,n=e.end-t,i=r.A.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 v(e){if(void 0===e.bufferedEnd||!e.infos.segment.complete||1!==e.status)return!1;var t=e.start,n=e.end,i=n-t,a=r.A.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 p(e,t,n,a){var o=r.A.getCurrent(),s=o.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,u=o.MISSING_DATA_TRIGGER_SYNC_DELAY,l=o.SEGMENT_SYNCHRONIZATION_DELAY;if(void 0!==e.bufferedStart)e.bufferedStart<t&&(i.A.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);else if(e.precizeStart)i.A.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start;else if(null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=s))i.A.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);else if(e.start-t<=s){var d=performance.now();if(e.start-t>=u&&d-e.insertionTs<l)return void i.A.debug("SI: Ignored bufferedStart synchronization",a,t,e.start,d-e.insertionTs);i.A.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)}else if(t<e.start)i.A.debug("SI: range start too far from expected start",a,t,e.start),e.bufferedStart=e.start;else{var c=performance.now();if(e.start-t>=u&&c-e.insertionTs<l)return void i.A.debug("SI: Ignored bufferedStart synchronization",a,t,e.start,c-e.insertionTs);i.A.debug("SI: Segment appears immediately garbage collected at the start",a,t,e.start),e.bufferedStart=t}}function h(e,t,n){var a=r.A.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MISSING_DATA_TRIGGER_SYNC_DELAY,u=a.SEGMENT_SYNCHRONIZATION_DELAY;if(void 0!==e.bufferedEnd)e.bufferedEnd>t&&(i.A.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=o&&v(e)&&(e.precizeEnd=!0,e.end=t);else if(e.precizeEnd)i.A.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end;else if(t-e.end<=o||!e.infos.segment.complete){var l=performance.now();if(t-e.end>=s&&l-e.insertionTs<u)return void i.A.debug("SI: Ignored bufferedEnd synchronization",n,t,e.end,l-e.insertionTs);i.A.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,v(e)&&(e.end=t,e.precizeEnd=!0)}else if(t>e.end)i.A.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end;else{var d=performance.now();if(t-e.end>=s&&d-e.insertionTs<u)return void i.A.debug("SI: Ignored bufferedEnd synchronization",n,t,e.end,d-e.insertionTs);i.A.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t}}var m,g=c,y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(e){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges(),e)},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={}))},3481:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(3650),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.C$)(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.aW)(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}()},7004:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(7387),i=function(e){function t(n,r,i,a){var o;return o=e.call(this,n)||this,Object.setPrototypeOf(o,t.prototype),o.name="CustomLoaderError",o.canRetry=r,o.isOfflineError=i,o.xhr=a,o}return(0,r.A)(t,e),t}((0,n(8593).A)(Error))},1956:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r,i){var s;return s=e.call(this,(0,o.A)("EncryptedMediaError",n,r))||this,Object.setPrototypeOf(s,t.prototype),s.name="EncryptedMediaError",s.type=a.wU.ENCRYPTED_MEDIA_ERROR,s.code=n,s.fatal=!1,"string"==typeof(null==i?void 0:i.keyStatuses)&&(s.keyStatuses=i.keyStatuses),s}return(0,r.A)(t,e),t}((0,i.A)(Error))},5497:function(e,t,n){"use strict";n.d(t,{tG:function(){return a},wU:function(){return r},yl: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"}},2620:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{A:function(){return r}})},874:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(4637),i=n(1858);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.A)(e))return e;var o=e instanceof Error?e.toString():a;return new i.A(n,o)}},4637:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});var r=n(1956),i=n(5497),a=n(5575),o=n(7941),s=n(1858);function u(e){return(e instanceof r.A||e instanceof a.A||e instanceof s.A||e instanceof o.A)&&Object.keys(i.wU).indexOf(e.type)>=0}},5575:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r,i){var s;s=e.call(this,(0,o.A)("MediaError",n,r))||this,Object.setPrototypeOf(s,t.prototype),s.name="MediaError",s.type=a.wU.MEDIA_ERROR,s.code=n,s.fatal=!1;var u=null==i?void 0:i.adaptation;if(void 0!==u)switch(u.type){case"audio":s.trackInfo={type:"audio",track:u.toAudioTrack()};break;case"video":s.trackInfo={type:"video",track:u.toVideoTrack()};break;case"text":s.trackInfo={type:"text",track:u.toTextTrack()}}return s}return(0,r.A)(t,e),t}((0,i.A)(Error))},7941:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r){var i;return i=e.call(this,(0,o.A)("NetworkError",n,r.message))||this,Object.setPrototypeOf(i,t.prototype),i.name="NetworkError",i.type=a.wU.NETWORK_ERROR,i.xhr=void 0===r.xhr?null:r.xhr,i.url=r.url,i.status=r.status,i.errorType=r.type,i.code=n,i.fatal=!1,i}return(0,r.A)(t,e),t.prototype.isHttpError=function(e){return this.errorType===a.yl.ERROR_HTTP_CODE&&this.status===e},t}((0,i.A)(Error))},1858:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(7387),i=n(8593),a=n(5497),o=n(2620),s=function(e){function t(n,r){var i;return i=e.call(this,(0,o.A)("OtherError",n,r))||this,Object.setPrototypeOf(i,t.prototype),i.name="OtherError",i.type=a.wU.OTHER_ERROR,i.code=n,i.fatal=!1,i}return(0,r.A)(t,e),t}((0,i.A)(Error))},3506:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(7387),i=function(e){function t(n,r,i,a){var o,s;switch(i){case"TIMEOUT":s="The request timed out";break;case"ERROR_EVENT":s="An error prevented the request to be performed successfully";break;case"PARSE_ERROR":s="An error happened while formatting the response data";break;case"ERROR_HTTP_CODE":s="An HTTP status code indicating failure was received: "+String(r)}return o=e.call(this,s)||this,Object.setPrototypeOf(o,t.prototype),o.name="RequestError",o.url=n,void 0!==a&&(o.xhr=a),o.status=r,o.type=i,o}return(0,r.A)(t,e),t}((0,n(8593).A)(Error))},8589:function(e,t){"use strict";t.A={dashParsers:{wasm:null,js:null},createDebugElement:null,directfile:null,decrypt:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,mediaSourceInit:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},418:function(e,t,n){"use strict";var r=n(8589);t.A=r.A},9477:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(8060),i=new(function(){function e(){this.error=r.A,this.warn=r.A,this.info=r.A,this.debug=r.A,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.A,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.A,this.info=t>=this._levels.INFO?console.info.bind(console):r.A,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.A},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},4129:function(e,t,n){"use strict";n.d(t,{B:function(){return h},A:function(){return m}});var r=n(9477),i=n(1729),a=n(6787),o=n(8202);var s="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}))},u=n(9770);function l(e){return null!=u.j&&("function"!=typeof u.j.isTypeSupported||u.j.isTypeSupported(e))}var d=n(987);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){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=(0,n(8795).A)(),p=function(){function e(e,t){var n;if(this.id=e.id,this.uniqueId=v(),this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.isSpatialAudio&&(this.isSpatialAudio=e.isSpatialAudio),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.cdnMetadata=e.cdnMetadata,this.index=e.index,"audio"===t.type||"video"===t.type){if(this.isSupported=!1,void 0!==e.supplementalCodecs)l((null!==(n=this.mimeType)&&void 0!==n?n:"")+';codecs="'+e.supplementalCodecs+'"')&&(this.codec=e.supplementalCodecs,this.isSupported=!0);if(!this.isSupported){var i=this.getMimeTypeString(),a=l(i);a||r.A.info("Unsupported Representation",i,this.id,this.bitrate),this.isSupported=a}}else this.isSupported=!0}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,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var i=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var a=this.contentProtections.keyIds;if(void 0===a)this.contentProtections.keyIds=[{keyId:t}];else{for(var o,s=!1,u=c(a);!(o=u()).done;){var l=o.value;(0,d.A)(l.keyId,t)&&(s=!0)}s||(r.A.warn("Manifest: found unanounced key id."),a.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,d.A)(m.data,p[g].data))break;r.A.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),i=!0)}return i}return this.contentProtections.initData.push({type:e,values:n}),!0},t.toAudioRepresentation=function(){return{id:this.id,isSpatialAudio:this.isSpatialAudio,bitrate:this.bitrate,codec:this.codec}},t.toVideoRepresentation=function(){return{id:this.id,bitrate:this.bitrate,frameRate:this.frameRate,width:this.width,height:this.height,codec:this.codec,hdrInfo:this.hdrInfo}},e}(),h=["audio","video","text","image"],m=function(){function e(t,n){void 0===n&&(n={});var i=t.trickModeTracks,s=n,u=s.representationFilter,l=s.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,o.Ay)(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.forcedSubtitles&&(this.isForcedSubtitles=t.forcedSubtitles),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==i&&i.length>0&&(this.trickModeTracks=i.map((function(t){return new e(t)})));for(var d=t.representations,c=[],f=!1,v=0;v<d.length;v++){var h=new p(d[v],{type:this.type});(0,a.A)(u)||u(h,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted})?(c.push(h),!f&&h.isSupported&&(f=!0)):r.A.debug("Filtering Representation due to representationFilter",this.type,"Adaptation: "+this.id,"Representation: "+h.id,"("+h.bitrate+")")}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=f,this.manuallyAdded=!0===l}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 s(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,i.A)(this.representations,(function(t){var n=t.id;return e===n}))},t.toAudioTrack=function(){var e,t,n={language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",audioDescription:!0===this.isAudioDescription,id:this.id,representations:this.representations.map((function(e){return e.toAudioRepresentation()})),label:this.label};return!0===this.isDub&&(n.dub=!0),n},t.toTextTrack=function(){var e,t;return{language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",closedCaption:!0===this.isClosedCaption,id:this.id,label:this.label,forced:this.isForcedSubtitles}},t.toVideoTrack=function(){var e=void 0!==this.trickModeTracks?this.trickModeTracks.map((function(e){var t=e.representations.map((function(e){return e.toVideoRepresentation()})),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,t={id:this.id,representations:this.representations.map((function(e){return e.toVideoRepresentation()})),label:this.label};return!0===this.isSignInterpreted&&(t.signInterpreted=!0),!0===this.isTrickModeTrack&&(t.isTrickModeTrack=!0),void 0!==e&&(t.trickModeTracks=e),t},e}()},8568:function(e,t,n){"use strict";n.d(t,{Ay:function(){return w}});var r,i=n(7387),a=n(5575),o=n(9477),s=n(1729),u=n(79),l=n(8795),d=n(2716),c=n(5950),f=n(4129),v=n(4324),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 f.A(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:r});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.A("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.A("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,v.A)(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.A)(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}))},t.containsTime=function(e,t){return e>=this.start&&(void 0===this.end||e<this.end)||e===this.end&&(null===t||t.start>this.end)},e}(),h=function(){function e(e){this._url=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,url:this._url,time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,privateInfos:{},timescale:1}]},t.getFirstAvailablePosition=function(){},t.getLastAvailablePosition=function(){},t.getEnd=function(){},t.awaitSegmentBetween=function(){return!1},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(){o.A.warn("Tried to replace a static RepresentationIndex")},t._update=function(){o.A.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(3786);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){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t,n){var i={updatedAdaptations:[],removedAdaptations:[],addedAdaptations:[]};e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var a=e.getAdaptations(),s=t.getAdaptations(),u=function(e){var t=a[e],u=(0,m.A)(s,(function(e){return e.id===t.id}));if(-1===u){o.A.warn('Manifest: Adaptation "'+a[e].id+'" not found when merging.');var d=a.splice(e,1)[0];e--,i.removedAdaptations.push(d)}else{var c=s.splice(u,1)[0],f=[],v=[],p=[];i.updatedAdaptations.push({adaptation:t,updatedRepresentations:f,addedRepresentations:v,removedRepresentations:p});for(var h,g=t.representations,y=c.representations.slice(),A=function(e){var t=g[e],i=(0,m.A)(y,(function(e){return e.id===t.id}));if(-1===i){o.A.warn('Manifest: Representation "'+g[e].id+'" not found when merging.');var a=g.splice(e,1)[0];e--,p.push(a)}else{var s=y.splice(i,1)[0];f.push(t),t.cdnMetadata=s.cdnMetadata,n===r.Full?t.index._replace(s.index):t.index._update(s.index)}_=e},_=0;_<g.length;_++)A(_);if(y.length>0)o.A.warn("Manifest: "+y.length+" new Representations found when merging."),(h=t.representations).push.apply(h,y),v.push.apply(v,y)}l=e},l=0;l<a.length;l++)u(l);if(s.length>0){o.A.warn("Manifest: "+s.length+" new Adaptations found when merging.");for(var d,c=g(s);!(d=c()).done;){var f=d.value,v=e.adaptations[f.type];void 0===v?e.adaptations[f.type]=[f]:v.push(f),i.addedAdaptations.push(f)}}return i}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){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(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 b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var S=(0,l.A)(),E=(0,l.A)(),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,d=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=E(),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=d,r.lifetime=t.lifetime,r.clockOffset=t.clockOffset,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.A)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,s.A)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){for(var t=null,n=this.periods.length-1;n>=0;n--){var r=this.periods[n];if(r.containsTime(e,t))return r;t=r}},n.getNextPeriod=function(e){return(0,s.A)(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.A)(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.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=_(e.periods);!(n=i()).done;)for(var a,s=n.value,u=_(s.getAdaptations());!(a=u()).done;)for(var l,d=a.value,c=_(d.representations);!(l=c()).done;){var f=l.value,v=t(f);v!==f.decipherable&&(r.push({manifest:e,period:s,adaptation:d,representation:f}),f.decipherable=v,o.A.debug('Decipherability changed for "'+f.id+'"',"("+f.bitrate+")",String(f.decipherable)))}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,c.A)("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.A)("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.A)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,s.A)(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-"+S(),o="gen-image-rep-"+S(),s=(0,d.Cl)(r),u=r.substring(0,s),l=r.substring(s),c=new f.A({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:l})}]},{isManuallyAdded:!0});if(c.representations.length>0&&!c.isSupported){var v=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:c});t.contentWarnings.push(v)}return c}));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:[],v=(0,d.Cl)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(c.map((function(e){var n="gen-text-ada-"+S(),o="gen-text-rep-"+S(),s=new f.A({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,cdnMetadata:[{baseUrl:p}],id:o,mimeType:r,codecs:i,index:new h({media:m})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.A("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:s});t.contentWarnings.push(u)}return s})))}),[]);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){var n;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,n=function(e,t){for(var n={updatedPeriods:[],addedPeriods:[],removedPeriods:[]},i=0,a=0;a<t.length;a++){for(var s=t[a],u=i,l=e[u];null!=l&&l.id!==s.id;)l=e[++u];if(null!=l){var d,c,f=A(l,s,r.Full);n.updatedPeriods.push({period:l,result:f});var v=t.slice(i,a),p=u-i,h=e.splice.apply(e,[i,p].concat(v));(d=n.removedPeriods).push.apply(d,h),(c=n.addedPeriods).push.apply(c,v),i=a+1}}if(i>e.length)return o.A.error("Manifest: error when updating Periods"),n;if(i<e.length){var m,g=e.splice(i,e.length-i);(m=n.removedPeriods).push.apply(m,g)}var y,_=t.slice(i,t.length);return _.length>0&&(e.push.apply(e,_),(y=n.addedPeriods).push.apply(y,_)),n}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],n=function(e,t){var n,i={updatedPeriods:[],addedPeriods:[],removedPeriods:[]};if(0===e.length)return e.splice.apply(e,[0,0].concat(t)),(n=i.addedPeriods).push.apply(n,t),i;if(0===t.length)return i;var s=e[e.length-1];if(s.start<t[0].start){var u;if(s.end!==t[0].start)throw new a.A("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");return e.push.apply(e,t),(u=i.addedPeriods).push.apply(u,t),i}var l=(0,m.A)(e,(function(e){return e.id===t[0].id}));if(l<0)throw new a.A("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");var d=A(e[l],t[0],r.Partial);i.updatedPeriods.push({period:e[l],result:d});for(var c=l+1,f=1;f<t.length;f++){for(var v=t[f],p=-1,h=c;h<e.length;h++)if(v.id===e[h].id){p=h;break}if(p<0){for(var g,y=-1,_=c;_<e.length;_++)if(v.start<e[_].start){y=_;break}var b=y-c,S=e.splice(c,b,v);i.addedPeriods.push(v),(g=i.removedPeriods).push.apply(g,S)}else{if(p>c){var E;o.A.warn("Manifest: old Periods not found in new when updating, removing");var T=e.splice(c,p-c);(E=i.removedPeriods).push.apply(E,T),p=c}var w=A(e[p],v,r.Full);i.updatedPeriods.push({period:e[p],result:w})}c++}if(c<e.length){var k;o.A.warn("Manifest: Ending Periods not found in new when updating, removing");var I=e.splice(c,e.length-c);(k=i.removedPeriods).push.apply(k,I)}return i}(this.periods,e.periods);for(var i=this.getMinimumSafePosition();this.periods.length>0;){var s=this.periods[0];if(void 0===s.end||s.end>i)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",n)},t}(u.A);var w=T},7841:function(e,t,n){"use strict";n.d(t,{M:function(){return a},Q:function(){return i}});var r=n(6787);function i(e,t){return e.segment.id===t.segment.id&&e.representation.uniqueId===t.representation.uniqueId}function a(e){if((0,r.A)(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)}},3058:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=Math.pow(2,32)-1},8797:function(e,t,n){"use strict";n.d(t,{$H:function(){return v},QL:function(){return f},YH:function(){return c},fP:function(){return p},fZ:function(){return l},fj:function(){return d},o$:function(){return u}});var r=n(9477),i=n(7994),a=n(5553);function o(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){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function d(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.h)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function c(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.mq)(e,r),r+=4,n=(0,a.mq)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.CQ)(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 v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.mq)(e,l),l+=4;var d=(0,a.mq)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.CQ)(e,l),l+=8}if(1970628964===d&&l+16<=s&&(0,a.mq)(e,l)===t&&(0,a.mq)(e,l+4)===n&&(0,a.mq)(e,l+8)===r&&(0,a.mq)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.A.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.mq)(e,n);n+=4;var o=(0,a.mq)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.A.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.CQ)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},2875:function(e,t,n){"use strict";n.d(t,{Y2:function(){return i},hZ:function(){return u},ht:function(){return a},iA:function(){return s},j8:function(){return o}});var r=n(8797);function i(e){var t=(0,r.fZ)(e,1836019558);return null===t?null:(0,r.fZ)(t,1953653094)}function a(e){return(0,r.fj)(e,1836019558).reduce((function(e,t){var n=(0,r.fZ)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.fZ)(e,1835295092)}function s(e){var t=(0,r.fZ)(e,1836019574);if(null===t)return null;var n=(0,r.fZ)(t,1953653099);return null===n?null:(0,r.fZ)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.fZ)(e.subarray(t),1701671783)}},2948:function(e,t,n){"use strict";n.d(t,{A:function(){return s},L:function(){return u}});var r=n(9477);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(4670),o=n(8797);function s(e){var t=0,n=(0,o.fZ)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.QL)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.A.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var d=i(n,s[0],s[2]),c=u(d,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:d}),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.A.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.My)(o)}}}},1134:function(e,t,n){"use strict";n.d(t,{D1:function(){return f},J_:function(){return m},Tr:function(){return c},a5:function(){return y},cS:function(){return p},pk:function(){return g},zS:function(){return h}});var r=n(9477),i=n(5553),a=n(4670),o=n(3058),s=n(8797),u=n(2875);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){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){var n=(0,s.QL)(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,d=(0,i.mq)(e,o);if(o+=4,0===u)l=(0,i.mq)(e,o),o+=4,r+=(0,i.mq)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.CQ)(e,o),o+=8,r+=(0,i.CQ)(e,o)+a,o+=8}var c=[];o+=2;var f=(0,i.UU)(e,o);for(o+=2;--f>=0;){var v=(0,i.mq)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.mq)(e,o);o+=4,o+=4,c.push({time:l,duration:h,timescale:d,range:[r,r+p-1]}),l+=h,r+=p}return c}function f(e){var t=(0,u.Y2)(e);if(null!==t){var n=(0,s.fZ)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.CQ)(n,4):0===r?(0,i.mq)(n,4):void 0}}}function v(e){var t=(0,s.fZ)(e,1952868452);if(null!==t){var n=1,r=(0,i.tb)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.mq)(t,n)}}function p(e){var t=(0,u.ht)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,d=(0,s.fZ)(o,1953658222);if(null===d)return;var c=0,f=d[c];if(c+=1,f>1)return;var p=(0,i.tb)(d,c);c+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,A=(512&p)>0,_=(1024&p)>0,b=(2048&p)>0,S=(0,i.mq)(d,c);c+=4,g&&(c+=4),y&&(c+=4);for(var E=S,T=0;E-- >0;)h?(T+=(0,i.mq)(d,c),c+=4):T+=m,A&&(c+=4),_&&(c+=4),b&&(c+=4);r+=T}return r}}function h(e){var t=(0,u.iA)(e);if(null!==t){var n=(0,s.fZ)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.mq)(n,r+16):0===a?(0,i.mq)(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.mq)(e,0);if(0===n){if(t>o.Z){var r=new Uint8Array(t+8);return r.set((0,i.KS)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.Kk)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.KS)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.Kk)(t),8),e}if(t<=o.Z)return e.set((0,i.KS)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.KS)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.Kk)(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.hZ)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.A.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var d=4,c=(0,a.Yn)(o,d),f=c.end,v=c.string;d=f;var p=(0,a.Yn)(o,d),h=p.end,m=p.string;d=h;var g=(0,i.mq)(o,d);d+=4;var y=(0,i.mq)(o,d);d+=4;var A=(0,i.mq)(o,d);d+=4;var _=(0,i.mq)(o,d);d+=4;var b={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:A,id:_,messageData:o.subarray(d,s)};t.push(b)}}if(0!==t.length)return t}function y(e){var t=(0,s.o$)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.fZ)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.fZ)(n,1701733217)):i=78,null===r)return null;var a=(0,s.o$)(r.subarray(i),[1936289382,1935894633,1952804451]);if(null===a||a.byteLength<24)return null;var o=a.subarray(8,24);return o.every((function(e){return 0===e}))?null:o}},1755:function(e,t,n){"use strict";var r=n(5553),i=n(4670);t.A=function(e){var t=0,n=e.length,a=(0,i.Es)(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 d=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var c=(0,r.eR)(e,t);t+=4;var f=(0,r.eR)(e,t);t+=4;var v=(0,i.Es)(e.subarray(t,t+4));t+=4;var p=(0,r.AT)(e,t);t+=2;var h=(0,r.AT)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===c)throw new Error("bif: no images to parse");for(var A=0,_=null;t<n;){var b=(0,r.eR)(e,t);t+=4;var S=(0,r.eR)(e,t);if(t+=4,null!==_){var E=_.timestamp*f,T=f,w=e.slice(_.offset,S);y.push({index:A,duration:T,ts:E,data:w}),A++}if(4294967295===b)break;_={timestamp:b,offset:S}}return{fileFormat:"BIF",version:d,imageCount:c,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},9044:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(9477),i=n(3877),a=n(1160),o=n(5403),s=n(9955);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,o=t.periodStart,u=t.periodEnd,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-o*f,p=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,s.I1)(e.initialization.media,l,d),h=void 0===e.media?null:(0,s.I1)(e.media,l,d),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:v,initialization:{url:p,range:m},segmentUrlTemplate:h,startNumber:e.startNumber,endNumber:e.endNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._manifestBoundsCalculator=t.manifestBoundsCalculator,this._scaledPeriodStart=(0,i.vb)(o,this._index),this._scaledPeriodEnd=null==u?void 0:(0,i.vb)(u,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,a.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.A)(this._index,e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i._l)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastAvailablePosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.Rb)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i._l)(r,this._index)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},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.isStillAwaitingFutureSegments=function(){return!1},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.A.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1160:function(e,t,n){"use strict";function r(e,t){var n,r=e.initialization,i={};return void 0!==t&&(i.isEMSGWhitelisted=t),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=r?r.range:void 0,indexRange:e.indexRange,url:null!==(n=null==r?void 0:r.url)&&void 0!==n?n:null,complete:!0,privateInfos:i,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{A:function(){return r}})},5403:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(3877),i=n(9955);function a(e,t,n,a,o,s){for(var u,l,d,c=a.getEstimatedMaximumPosition(null!==(u=e.availabilityTimeOffset)&&void 0!==u?u:0),f=Math.min(t+n,null!=c?c:1/0),v=(0,r.vb)(t,e),p=(0,r.vb)(f,e),h=e.timeline,m=e.timescale,g=e.segmentUrlTemplate,y=e.startNumber,A=e.endNumber,_=null!=y?y:1,b=[],S=h.length,E=0;E<S;E++){var T=h[E],w=T.duration,k=T.start,I=T.range,x=void 0;x=void 0===c?o:Math.min(c*m,null!=o?o:1/0);for(var R=(0,r.yi)(T,h[E+1],x),C=!1!==e.availabilityTimeComplete||E!==S-1&&0!==R,M=(l=w,d=void 0,(d=v-k)>0?Math.floor(d/l):0),P=k+M*w;P<p&&M<=R;){var D=_+M;if(void 0!==A&&D>A)break;var N=null===g?null:(0,i.Qy)(P,D)(g),O=P-e.indexTimeOffset,L=w;O<0&&(L=w+O,O=0);var U={id:String(P),time:O/m,end:(O+L)/m,duration:L/m,isInit:!1,range:I,timescale:1,url:N,number:D,timestampOffset:-e.indexTimeOffset/m,complete:C,privateInfos:{isEMSGWhitelisted:s}};b.push(U),P=k+ ++M*w}if(P>=p)return b;if(_+=R+1,void 0!==A&&_>A)return b}return b}},9955:function(e,t,n){"use strict";n.d(t,{I1:function(){return a},Qy:function(){return o}});var r=n(2384);function i(e){return function(t,n,i){var a,o,s,u=(0,r.A)(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 a(e,t,n){return function(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,i(void 0===n?0:n))}(e,t,n)}function o(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 i(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 i(e)(t,n,r)}))}}},95:function(e,t,n){"use strict";n.d(t,{A:function(){return je}});var r=n(2038),i=n(6787),a=n(5151),o=n(9477),s=n(1729),u=n(2716);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.A.warn("DASH Parser: Invalid clock received: ",e)}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(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=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.A.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}}}(e),n=function(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=d(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=d(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.A.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null,this._serverTimestampOffset=e.serverTimestampOffset,this._availabilityStartTime=e.availabilityStartTime}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.getEstimatedMinimumSegmentTime=function(e){var t;if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var n=null!==(t=this.getEstimatedLiveEdge())&&void 0!==t?t:this.getEstimatedMaximumPosition(0);return void 0!==n?n-(this._timeShiftBufferDepth+e):void 0},t.getEstimatedLiveEdge=function(){if(this._isDynamic&&void 0!==this._serverTimestampOffset)return(performance.now()+this._serverTimestampOffset)/1e3-this._availabilityStartTime},t.getEstimatedMaximumPosition=function(e){if(!this._isDynamic)return this._lastPosition;var t=this.getEstimatedLiveEdge();return void 0!==t&&e!==1/0?t+e:void 0!==this._positionTime&&void 0!==this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}();var p=n(3262),h=n(8795),m=n(4324),g=n(4670);var y=n(4129),A=n(3786),_=n(4031),b=n(2384);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){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=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,d=S(y.B);!(u=d()).done;){var c=e[u.value];if(void 0!==c)for(var f,v=S(c);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},w=["subtitle","caption"];function k(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,_.A)(y.B,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.A)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,_.A)(w,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 d=e[l].attributes,c=d.mimeType,f=d.codecs;if(void 0!==c){var v=i(c,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var I=n(8935),x=/[, ]+/g;var R=n(9044),C=n(3877),M=n(1160),P=n(9955),D=function(){function e(e,t){var n,r;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var i=t.periodStart,a=t.periodEnd,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=i,this._periodEnd=a;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,d=null!==(n=e.timescale)&&void 0!==n?n:1,c=l-i*d,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,P.I1)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,P.I1)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:d,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{url:f,range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.A)(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,C.jX)(s,t,a),l=u[0],d=u[1],c=Math.min(i.length-1,Math.floor(d/r)),f=[],v=Math.floor(l/r);v<=c;){var p=i[v].mediaRange,h=i[v].url,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,url:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstAvailablePosition=function(){return this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.canBeOutOfSyncError=function(){return!1},t.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.A.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),N=n(7941),O=n(7994),L=n(5019),U=n(860),B=n(5403);function F(e){return a.A.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e}function V(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.A)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.A.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}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.A.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.A.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.A.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function K(e){for(var t=[],n=0;n<e.length;n++)t.push(z(e[n]));for(var r=[],i=0;i<t.length;i++){var a=V(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function W(e,t){var n,r=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],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-d;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(p+1)}else d+=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;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===r)return o.A.warn('DASH: Cannot perform "based" update. Common segment not found.'),K(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.A.info('DASH: Cannot perform "based" update. New timeline too short'),K(e);var d=t.slice(i);if(s>0){var c=d[0];c.start+=c.duration*s,d[0].repeatCount-=s}if(u>0&&0!==a)return o.A.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),K(e);var f=d[d.length-1],v=z(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.A.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),K(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(z(e[g]));for(var y=0;y<m.length;y++){var A=V(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==A&&h.push(A)}return d.concat(h)}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.availabilityTimeOffset,u=n.manifestBoundsCalculator,l=n.isDynamic,d=n.isLastPeriod,c=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=u,this._isEMSGWhitelisted=h,this._isLastPeriod=d,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=l,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y,A=void 0===(null===(a=t.initialization)||void 0===a?void 0:a.media)?null:(0,P.I1)(t.initialization.media,c,f),_=void 0===t.media?null:(0,P.I1)(t.media,c,f);y=void 0===s&&void 0===o?1/0:null!=s?s:0,this._index={availabilityTimeComplete:null==o||o,availabilityTimeOffset:y,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:A,range:t.initialization.range},segmentUrlTemplate:_,startNumber:t.startNumber,endNumber:t.endNumber,timeline:void 0===t.timeline?null:H(t.timeline,t.startNumber,t.endNumber),timescale:m},this._scaledPeriodStart=(0,C.vb)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,C.vb)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),(0,B.A)(this._index,e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,C._l)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){var e;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null===t)return null;var n=Math.min(t.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,C._l)(n,this._index)},t.getEnd=function(){var e;if(!this._isDynamic||this._isLastPeriod){if(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._index.timeline.length<=0)return null;var t=this._index.timeline[this._index.timeline.length-1],n=Math.min((0,C.Rb)(t,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,C._l)(n,this._index)}},t.awaitSegmentBetween=function(e,t){var n,r;if((0,O.h)(e<=t),!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var i=this._index,a=i.timescale,o=i.timeline,s=F(a),u=(0,C.vb)(t,this._index),l=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==l&&Math.min(l.end,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0)+s>=Math.min(u,null!==(r=this._scaledPeriodEnd)&&void 0!==r?r:1/0))return!1;var d=(0,C.vb)(e,this._index);if(o.length>0&&null!==l&&!l.isLastOfTimeline){var c=o[o.length-1];if(d<(0,C.Rb)(c,null,this._scaledPeriodEnd)+s+s)return!0}return!!this._isLastPeriod&&(void 0===this._scaledPeriodEnd?u+s>this._scaledPeriodStart&&void 0:d-s<this._scaledPeriodEnd&&u+s>this._scaledPeriodStart)},t.isSegmentStillAvailable=function(e){return!!e.isInit||(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),function(e,t,n,r){var i=q(t,n,r);if(null===i)return!1;for(var a=0;a<t.timeline.length;a++){if(i.timelineIdx<a)return!1;var o=t.timeline[a],s=(o.start-t.indexTimeOffset)/t.timescale;if(s>e.time)return!1;if(s===e.time)return void 0===o.range?void 0===e.range:null!=e.range&&o.range[0]===e.range[0]&&o.range[1]===e.range[1];if(o.repeatCount>=0&&void 0!==o.duration){var u=(s-o.start)/o.duration-1;return u%1==0&&u<=i.newRepeatCount}}return!1}(e,this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd))},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,C.ph)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof N.A&&e.isHttpError(404))},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,U.A)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._index.availabilityTimeOffset=e._index.availabilityTimeOffset,this._index.availabilityTimeComplete=e._index.availabilityTimeComplete,this._index.endNumber=e._index.endNumber,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isStillAwaitingFutureSegments=function(){var e;if(!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index.timeline;if(0===t.length){if(void 0!==this._scaledPeriodEnd){var n=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==n&&(0,C.vb)(n,this._index)>this._scaledPeriodEnd)return!1}return this._isLastPeriod}var r=F(this._index.timescale),i=q(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==i&&!i.isLastOfTimeline){var a=Math.min(i.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return!(void 0!==this._scaledPeriodEnd&&a+r>=this._scaledPeriodEnd)}if(!this._isLastPeriod)return!1;if(void 0===this._scaledPeriodEnd)return!0;var o=t[t.length-1];return(0,C.Rb)(o,null,this._scaledPeriodEnd)+r<this._scaledPeriodEnd},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){var e,t;if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var n=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime((null!==(t=null===(e=this._index.timeline[0])||void 0===e?void 0:e.duration)&&void 0!==t?t:0)/this._index.timescale);if(!(0,i.A)(n)){var r=(0,C.vb)(n,this._index),a=(0,L.A)(this._index.timeline,r);void 0!==this._index.startNumber?this._index.startNumber+=a:void 0!==this._index.endNumber&&(this._index.startNumber=a+1)}}},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.A.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.A.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?H(K(e),this._index.startNumber,this._index.endNumber):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,H(W(e,t),this._index.startNumber,this._index.endNumber))},e}();function H(e,t,n){if(void 0===n)return e;for(var r=null!=t?t:1,i=0;i<e.length;i++){var a=e[i];if((r+=a.repeatCount+1)>n){if(r===n+1)return e.slice(0,i+1);var o=e.slice(0,i),s=Object.assign({},a),u=r-a.repeatCount-1;return s.repeatCount=Math.max(0,n-u),o.push(s),o}}return e}function q(e,t,n){if(e.timeline.length<=0)return null;if(e.availabilityTimeOffset===1/0){var r=e.timeline.length-1,i=e.timeline[r];return{isLastOfTimeline:!0,timelineIdx:r,newRepeatCount:i.repeatCount,end:(0,C.Rb)(i,null,n)}}var a=t.getEstimatedMaximumPosition(e.availabilityTimeOffset);if(void 0===a){var o=e.timeline.length-1,s=e.timeline[o];return{isLastOfTimeline:!0,timelineIdx:o,newRepeatCount:s.repeatCount,end:(0,C.Rb)(s,null,n)}}for(var u=e.timeline.length-1;u>=e.timeline.length;u--){var l=e.timeline[u],d=l.start+l.duration;if((0,C._l)(d,e)<=a){var c=(0,C.Rb)(l,e.timeline[u+1],n);if((0,C._l)(c,e)<=a)return{isLastOfTimeline:u===e.timeline.length-1,timelineIdx:u,newRepeatCount:l.repeatCount,end:d};var f=(0,C.vb)(a,e)-l.start,v=Math.floor(f/l.duration);return(0,O.h)(v>=1),{isLastOfTimeline:!1,timelineIdx:u,newRepeatCount:v-1,end:l.start+v*l.duration}}}return null}var j=G,Y=function(){function e(e,t){var n,r,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=i,this._manifestBoundsCalculator=a;var v=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,p=v-u*f;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var h=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,P.I1)(e.initialization.media,l,d),m=void 0===e.media?null:(0,P.I1)(e.media,l,d);this._index={duration:e.duration,timescale:f,indexRange:e.indexRange,indexTimeOffset:p,initialization:null==e.initialization?void 0:{url:h,range:e.initialization.range},url:m,presentationTimeOffset:v,startNumber:e.startNumber,endNumber:e.endNumber},this._isDynamic=o,this._periodStart=u,this._scaledRelativePeriodEnd=void 0===s?void 0:(s-u)*f,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,M.A)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.endNumber,o=n.timescale,s=n.url,u=this._periodStart*o,l=this._scaledRelativePeriodEnd,d=e*o-u,c=(e+t)*o-u,f=this._getFirstSegmentStart(),v=this._getLastSegmentStart();if(null==f||null==v)return[];var p=Math.max(f,d),h=Math.min(v,c);if(h+r<=p)return[];for(var m=[],g=null!=i?i:1,y=Math.floor(p/r),A=y*r;A<=h;A+=r){var _=y+g;if(void 0!==a&&_>a)return m;var b=null!=l&&A+r>l?l-A:r,S=A+u,E=A+this._index.presentationTimeOffset,T=null===s?null:(0,P.Qy)(E,_)(s),w={id:String(_),number:_,time:S/o,end:(S+b)/o,duration:b/o,timescale:1,isInit:!1,scaledDuration:b/o,url:T,timestampOffset:-n.indexTimeOffset/o,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};m.push(w),y++}return m},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e=this._getLastSegmentStart();if((0,i.A)(e))return e;var t=this._estimateRelativeScaledEnd();return Math.min(e+this._index.duration,null!=t?t:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();var e=this._estimateRelativeScaledEnd();if(void 0!==e){var t=this._index.timescale;return(e+this._periodStart*t)/t}},t.awaitSegmentBetween=function(e,t){if((0,O.h)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=F(n),a=this._periodStart*n,o=e*n-a,s=t*n-a,u=this._getLastSegmentStart();if((0,i.A)(u)){var l=this._estimateRelativeScaledEnd();return void 0===l?s+r>=0:s+r>=0&&o<l-r}var d=u+this._index.duration,c=this._estimateRelativeScaledEnd();return void 0===c?s>d-r:s>d-r&&o<c-r},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},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.isStillAwaitingFutureSegments=function(){if(!this._isDynamic)return!1;var e=this._estimateRelativeScaledEnd();if(void 0===e)return!0;var t=this._index.timescale,n=this._getLastSegmentStart();return!!(0,i.A)(n)||n+this._index.duration+F(t)<e},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledRelativePeriodEnd=e._scaledRelativePeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){var e;if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var t=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0!==t&&t<this._periodStart)return null}var n=this._index,r=n.duration,i=n.timescale,a=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime(r/i);if(void 0!==a){var o=a>this._periodStart?(a-this._periodStart)*i:0;return Math.floor(o/r)*r}},t._getLastSegmentStart=function(){var e,t,n=this._index,r=n.duration,i=n.timescale,o=n.endNumber,s=n.startNumber,u=void 0===s?1:s;if(this._isDynamic){var l=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==l&&void 0!==this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<l-this._periodStart*this._index.timescale){var d=Math.ceil(this._scaledRelativePeriodEnd/r);return void 0!==o&&o-u+1<d&&(d=o-u+1),(d-1)*r}var c=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0===c)return;var f=(c-this._periodStart)*i;if(f<0)return null;var v=Math.floor(f/r);return void 0!==o&&o-u+1<v&&(v=o-u+1),v<=0?null:(v-1)*r}var p=null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:0,h=Math.ceil(p/r);void 0!==o&&o-u+1<h&&(h=o-u+1);var m=(h-1)*r,g=a.A.getCurrent().MINIMUM_SEGMENT_SIZE*i;return void 0!==o||p-m>g||h<2?m:(h-2)*r},t._estimateRelativeScaledEnd=function(){var e,t;if(void 0!==this._index.endNumber){var n=this._index.endNumber-(null!==(e=this._index.startNumber)&&void 0!==e?e:1)+1;return Math.max(Math.min(n*this._index.duration,null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:1/0),0)}if(void 0!==this._scaledRelativePeriodEnd)return Math.max(this._scaledRelativePeriodEnd,0)},e}();function Q(e,t){var n;if(0===t.length)return e;var r=t.map((function(e){return{url:e.value}}));if(0===e.length)return r;for(var i=[],a=0;a<e.length;a++)for(var o=e[a],s=0;s<r.length;s++){var l=r[s],d=(0,u.Ay)(o.url,l.url);i.push({url:d,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}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){if("string"==typeof e)return $(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}function Z(e){var t=e.adaptationProfiles,n=e.essentialProperties,r=e.supplementalProperties,i=e.manifestProfiles,a=e.codecs;if(-1!==((null!=t?t:"")+(null!=i?i:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&("hvc1.2.4.L153.B0"===a||"hev1.2.4.L153.B0"===a))return{colorDepth:10,eotf:"pq",colorSpace:"rec2020"};var o=(0,s.A)([].concat(null!=n?n:[],null!=r?r:[]),(function(e){return"urn:mpeg:mpegB:cicp:TransferCharacteristics"===e.schemeIdUri}));if(void 0!==o)switch(o.value){case"15":return;case"16":return{eotf:"pq"};case"18":return{eotf:"hlg"}}return void 0!==a&&/^vp(08|09|10)/.exec(a)?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}}(a):void 0}function J(e,t,n){for(var r,i,a,u,l,d,c=[],f=function(){for(var e=d.value,f=void 0!==e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(void 0!==e.attributes.height?"-"+e.attributes.height:"")+(void 0!==e.attributes.width?"-"+e.attributes.width:"")+(void 0!==e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(void 0!==e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===f}));)f+="-dup";var v,p=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(f))&&void 0!==i?i:null,h=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),m=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete;void 0===e.attributes.availabilityTimeOffset&&void 0===n.availabilityTimeOffset||(v=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+(null!==(l=n.availabilityTimeOffset)&&void 0!==l?l:0));var g,y=function(e,t){var n,r,i,a,o=t.availabilityTimeOffset,s=t.manifestBoundsCalculator,u=t.isDynamic,l=t.end,d=t.start,c=t.receivedTime,f=t.unsafelyBaseOnPreviousRepresentation,v=t.inbandEventStreams,p={availabilityTimeComplete:void 0,availabilityTimeOffset:o,unsafelyBaseOnPreviousRepresentation:f,isEMSGWhitelisted:function(e){return void 0!==v&&v.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:s,isDynamic:u,periodEnd:l,periodStart:d,receivedTime:c,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id};if(void 0!==e.children.segmentBase){var h=e.children.segmentBase;a=new R.A(h,p)}else if(void 0!==e.children.segmentList){var m=e.children.segmentList;a=new D(m,p)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var g=t.parentSegmentTemplates.slice(),y=e.children.segmentTemplate;void 0!==y&&g.push(y);var A=I.A.apply(void 0,[{}].concat(g));void 0===A.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(p.availabilityTimeOffset=(null!==(n=A.availabilityTimeOffset)&&void 0!==n?n:0)+(null!==(r=t.availabilityTimeOffset)&&void 0!==r?r:0)),void 0===A.availabilityTimeComplete&&void 0===t.availabilityTimeComplete||(p.availabilityTimeComplete=null!==(i=A.availabilityTimeComplete)&&void 0!==i?i:t.availabilityTimeComplete),a=j.isTimelineIndexArgument(A)?new j(A,p):new Y(A,p)}else{var _=t.adaptation.children;if(void 0!==_.segmentBase){var b=_.segmentBase;a=new R.A(b,p)}else if(void 0!==_.segmentList){var S=_.segmentList;a=new D(S,p)}else a=new Y({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},p)}return a}(e,(0,I.A)({},n,{availabilityTimeOffset:v,availabilityTimeComplete:m,unsafelyBaseOnPreviousRepresentation:p,adaptation:t,inbandEventStreams:h}));void 0===e.attributes.bitrate?(o.A.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var A,_,S,E=Q(n.baseURLs,e.children.baseURLs),T={bitrate:g,cdnMetadata:0===E.length?[{baseUrl:"",id:void 0}]:E.map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:y,id:f};void 0!==e.children.supplementalProperties&&(0,s.A)(e.children.supplementalProperties,(function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===e.schemeIdUri&&"JOC"===e.value}))&&(T.isSpatialAudio=!0),void 0!==e.attributes.codecs?A=e.attributes.codecs:void 0!==t.attributes.codecs&&(A=t.attributes.codecs),void 0!==A&&(A="mp4a.40.02"===A?"mp4a.40.2":A,T.codecs=A),void 0!==e.attributes.supplementalCodecs?_=e.attributes.supplementalCodecs:void 0!==t.attributes.supplementalCodecs&&(_=t.attributes.supplementalCodecs),void 0!==_&&(T.supplementalCodecs=(S=_,(0,b.A)(S)?S.trim().replace(x,", "):"")),void 0!==e.attributes.frameRate?T.frameRate=e.attributes.frameRate:void 0!==t.attributes.frameRate&&(T.frameRate=t.attributes.frameRate),void 0!==e.attributes.height?T.height=e.attributes.height:void 0!==t.attributes.height&&(T.height=t.attributes.height),void 0!==e.attributes.mimeType?T.mimeType=e.attributes.mimeType:void 0!==t.attributes.mimeType&&(T.mimeType=t.attributes.mimeType),void 0!==e.attributes.width?T.width=e.attributes.width:void 0!==t.attributes.width&&(T.width=t.attributes.width);var w=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&w.push.apply(w,e.children.contentProtections),w.length>0){var k=w.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){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=X(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,d=(0,s.A)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===d)e.initData.push({type:"cenc",values:a});else(l=d.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(k.initData).length>0||void 0!==k.keyIds&&k.keyIds.length>0)&&(T.contentProtections=k)}T.hdrInfo=Z({adaptationProfiles:t.attributes.profiles,supplementalProperties:t.children.supplementalProperties,essentialProperties:t.children.essentialProperties,manifestProfiles:n.manifestProfiles,codecs:A}),c.push(T)},v=X(e);!(d=v()).done;)f();return c}function ee(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){if("string"==typeof e)return te(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(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 te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ne(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 re(e,t){if(void 0!==e&&e.some((function(e){return"urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value})))return!0;if(void 0!==t&&t.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&"caption"===e.value})))return!0;return!1}function ie(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ae(e,t){if((0,b.A)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isForcedSubtitle,i=t.isAudioDescription,a=t.isSignInterpreted,o=t.isTrickModeTrack,s=t.type;return(0,b.A)(e.attributes.language)&&(s+="-"+e.attributes.language),!0===n&&(s+="-cc"),!0===r&&(s+="-cc"),!0===i&&(s+="-ad"),!0===a&&(s+="-si"),o&&(s+="-trickMode"),(0,b.A)(e.attributes.contentType)&&(s+="-"+e.attributes.contentType),(0,b.A)(e.attributes.codecs)&&(s+="-"+e.attributes.codecs),(0,b.A)(e.attributes.mimeType)&&(s+="-"+e.attributes.mimeType),(0,b.A)(e.attributes.frameRate)&&(s+="-"+e.attributes.frameRate),s}function oe(e){if(null!=e.children.supplementalProperties)for(var t,n=ee(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 se(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 ue(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){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}(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 le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var de=(0,h.A)();function ce(e,t){var n,r,a,u,l=[],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 c=t.isDynamic,f=t.manifestBoundsCalculator;c||(0,i.A)(t.duration)||f.setLastPosition(t.duration);for(var v=function(){var v,S=h===e.length-1,E=e[h],w=t.xlinkInfos.get(E),I=Q(t.baseURLs,E.children.baseURLs),x=d[h],R=x.periodStart,C=x.periodDuration,M=x.periodEnd;for((0,i.A)(E.attributes.id)?(o.A.warn("DASH: No usable id found in the Period. Generating one."),v="gen-dash-period-"+de()):v=E.attributes.id;l.some((function(e){return e.id===v}));)v+="-dup";var P=void 0!==w?w.receivedTime:t.receivedTime,D=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(v))&&void 0!==r?r:null,N=E.attributes.availabilityTimeComplete,O=E.attributes.availabilityTimeOffset,L=t.manifestProfiles,U=E.children.segmentTemplate,B={availabilityTimeComplete:N,availabilityTimeOffset:O,baseURLs:I,manifestBoundsCalculator:f,end:M,isDynamic:c,isLastPeriod:S,manifestProfiles:L,receivedTime:P,segmentTemplate:U,start:R,unsafelyBaseOnPreviousPeriod:D},F=function(e,t){for(var n,r,i,a,u,l,d,c={video:[],audio:[],text:[],image:[]},f=[],v={},p=[],h=0;h<e.length;h++){var m=e[h],g=m.children,S=g.essentialProperties,E=g.roles,w=g.label,I=Array.isArray(E)&&E.some((function(e){return"main"===e.value}))&&E.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),x=m.children.representations,R=null!==(n=m.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=void 0;void 0===m.attributes.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(C=(null!==(r=m.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+(null!==(i=t.availabilityTimeOffset)&&void 0!==i?i:0));var M=m.attributes.mimeType,P=m.attributes.codecs,D=k(x,(0,b.A)(M)?M:null,(0,b.A)(P)?P:null,null!=g.roles?g.roles:null);if(void 0!==D){var N=null!==(a=m.attributes.selectionPriority)&&void 0!==a?a:1,O=m.attributes.id,L=oe(m),U=[];void 0!==t.segmentTemplate&&U.push(t.segmentTemplate),void 0!==m.children.segmentTemplate&&U.push(m.children.segmentTemplate);var B={availabilityTimeComplete:R,availabilityTimeOffset:C,baseURLs:Q(t.baseURLs,g.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:U,receivedTime:t.receivedTime,start:t.start,unsafelyBaseOnPreviousAdaptation:null},F=Array.isArray(S)?(0,s.A)(S,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,V=null===(u=null==F?void 0:F.value)||void 0===u?void 0:u.split(" "),z=void 0!==V,K=g.accessibilities,W=void 0;void 0!==E&&E.some((function(e){return"dub"===e.value}))&&(W=!0);var G=void 0;G="text"===D&&re(K,E);var H=void 0;"text"===D&&void 0!==E&&E.some((function(e){return"forced-subtitle"===e.value||"forced_subtitle"===e.value}))&&(H=!0);var q=void 0;"audio"!==D?q=!1:void 0!==K&&(q=K.some(ne));var j=void 0;"video"!==D?j=!1:void 0!==K&&(j=K.some(ie));for(var Y=ae(m,{isAudioDescription:q,isForcedSubtitle:H,isClosedCaption:G,isSignInterpreted:j,isTrickModeTrack:z,type:D});(0,_.A)(p,Y);)Y+="-dup";var X=Y;p.push(Y),B.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation(Y))&&void 0!==d?d:null;var $={id:Y,representations:J(x,m,B),type:D,isTrickModeTrack:z};if(null!=m.attributes.language&&($.language=m.attributes.language),null!=G&&($.closedCaption=G),null!=q&&($.audioDescription=q),!0===W&&($.isDub=!0),void 0!==H&&($.forcedSubtitles=H),!0===j&&($.isSignInterpreted=!0),void 0!==w&&($.label=w),void 0!==V)f.push({adaptation:$,trickModeAttachedAdaptationIds:V});else{for(var Z,te=-1,ue=function(){var e=Z.value,t=v[e];if(void 0!==t&&t.newID!==X&&(0,_.A)(t.adaptationSetSwitchingIDs,O)){te=(0,A.A)(c[D],(function(t){return t[0].id===e}));var n,r=c[D][te];if(void 0!==r&&r[0].audioDescription===$.audioDescription&&r[0].closedCaption===$.closedCaption&&r[0].language===$.language)return o.A.info('DASH Parser: merging "switchable" AdaptationSets',O,e),(n=r[0].representations).push.apply(n,$.representations),r[1]={priority:Math.max(N,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(h,r[1].indexInMpd)},1}},le=ee(L);!(Z=le()).done&&!ue(););te<0&&c[D].push([$,{priority:N,isMainAdaptation:I,indexInMpd:h}])}null!=O&&null==v[O]&&(v[O]={newID:X,adaptationSetSwitchingIDs:L})}}var de=y.B.reduce((function(e,t){var n=c[t];return n.length>0&&(n.sort(se),e[t]=n.map((function(e){return e[0]}))),e}),{});return c.video.sort(se),T(de,f),de}(E.children.adaptations,B),V=(null!==(a=t.xmlNamespaces)&&void 0!==a?a:[]).concat(null!==(u=E.attributes.namespaces)&&void 0!==u?u:[]),z=function(e,t,n){for(var r,i,a,o=[],s=ue(e);!(a=s()).done;)for(var u,l=a.value,d=l.attributes,c=d.schemeIdUri,f=void 0===c?"":c,v=d.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ue(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var A=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,_=void 0===y.duration?void 0:A+y.duration/p,b=void 0;if(y.eventStreamData instanceof Element)b=y.eventStreamData;else{var S=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");S+=">";var E=(0,g.Es)(new Uint8Array(y.eventStreamData));b=(new DOMParser).parseFromString(S+E+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:A,end:_,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:b}}})}}return o}(E.children.eventStreams,R,V),K={id:v,start:R,end:M,duration:C,adaptations:F,streamEvents:z};if(l.unshift(K),!f.lastPositionIsKnown()){var W=function(e){for(var t,n=null,r=!0,a=(0,m.A)(e).filter((function(e){return!(0,i.A)(e)})),o=ue((0,p.A)(a,(function(e){return e})));!(t=o()).done;)for(var s,u=ue(t.value.representations);!(s=u()).done;){var l=s.value.index.getLastAvailablePosition();null!==l&&(r=!1,"number"==typeof l&&(n=(0,i.A)(n)?l:Math.max(n,l)))}if(!(0,i.A)(n))return n;if(r)return null;return}(F);if(c)if("number"==typeof W){var G=performance.now()/1e3;f.setLastPosition(W,G)}else{var H=fe(t,R);if(void 0!==H){var q=H[0],j=H[1];f.setLastPosition(q,j)}}else"number"==typeof W&&f.setLastPosition(W)}},h=e.length-1;h>=0;h--)v();if(t.isDynamic&&!f.lastPositionIsKnown()){var S=fe(t,0);if(void 0!==S){var E=S[0],w=S[1];f.setLastPosition(E,w)}}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.A.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(),0!==t.length);)i=t[t.length-1];t.push(r)}return t}(l)}function fe(e,t){if((0,i.A)(e.clockOffset)){var n=Date.now()/1e3;if(n>=t)return o.A.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[n-e.availabilityStartTime,performance.now()/1e3]}else{var r=e.clockOffset/1e3-e.availabilityStartTime,a=performance.now()/1e3,s=a+r;if(s>=t)return[s,a]}}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){if("string"==typeof e)return pe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,t):void 0}}(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 pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var he=function e(t,n,r,i,d){void 0===d&&(d=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.A)(c.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 A=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!=A&&A.length>0)return{type:"needs-clock",value:{url:A,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.A.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 S=c.periods[b].attributes,E=S.xlinkHref,T=S.xlinkActuate;null!=E&&"onLoad"===T&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,d,c,p,h=e.children,m=e.attributes,g="dynamic"===m.type,y=void 0!==t.url?[{url:t.url.substring(0,(0,u.Cl)(t.url))}]:[],A=Q(y,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,S=m.maxSegmentDuration,E=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,w=t.externalClockOffset,k=new v({availabilityStartTime:_,isDynamic:g,timeShiftBufferDepth:b,serverTimestampOffset:w}),I={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,baseURLs:A,clockOffset:E,duration:m.duration,isDynamic:g,manifestBoundsCalculator:k,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},x=ce(h.periods,I),R=m.duration,C=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(d=0===m.minimumUpdatePeriod?a.A.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var M=f(x),P=M.minimumSafePosition,D=M.maximumSafePosition,N=M.maximumUnsafePosition,O=performance.now();if(g){var L;if(void 0!==D)L=D;else if(void 0===w)o.A.warn("DASH Parser: use system clock to define maximum position"),L=Date.now()/1e3-_;else L=(performance.now()+w)/1e3-_;var U=k.getEstimatedLiveEdge();void 0===U&&(U=void 0!==N?N:L),p={isLinear:!0,maximumSafePosition:L,livePosition:U,time:O},c=P,null!==(C=null!=b?b:null)&&(C+=null!=S?S:0),null!==C&&void 0!==c&&U-c>C&&(C=U-c)}else{c=void 0!==P?P:void 0!==(null===(i=x[0])||void 0===i?void 0:i.start)?x[0].start:0;var B=null!=R?R:1/0;if(void 0!==x[x.length-1]){var F=x[x.length-1],V=null!==(s=F.end)&&void 0!==s?s:void 0!==F.duration?F.start+F.duration:void 0;void 0!==V&&V<B&&(B=V)}void 0!==D&&D<B&&(B=D),p={isLinear:!1,maximumSafePosition:B,livePosition:void 0,time:O}}var z=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=x[x.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration),K={availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:z,periods:x,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:c,timeshiftDepth:C,maximumTimeData:p},lifetime:d,uris:null==t.url?h.locations:[t.url].concat(h.locations)};return{type:"done",value:{parsed:K,warnings:n}}}(t,n,r,d):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=ve(f);!(g=y()).done;){var A=g.value;d.set(A,{receivedTime:p,sendingTime:h,url:m})}(s=c.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,d)}}}};function me(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function ge(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}var ye=n(7387),Ae=n(8593),_e=n(603),be=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Se=/([0-9]+)-([0-9]+)/;function Ee(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new De("`"+t+'` property is not a boolean value but "'+e+'"')]}function Te(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function ke(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ie(e,t){var n=Date.parse(e);return isNaN(n)?[null,new De("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,b.A)(e))return[0,new De("`"+t+"` property is empty")];var n=be.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,b.A)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,b.A)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,b.A)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,b.A)(n[8])?n[8]:"0")*60+60*parseFloat((0,b.A)(n[10])?n[10]:"0")+parseFloat((0,b.A)(n[12])?n[12]:"0"),null]}function Re(e,t){var n=Se.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ce(e,t){try{return[(0,_e.K)(e),null]}catch(n){return[null,new De("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Me(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 Pe(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.A.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var De=function(e){function t(n){var r;return r=e.call(this,n)||this,Object.setPrototypeOf(r,t.prototype),r.name="MPDError",r}return(0,ye.A)(t,e),t}((0,Ae.A)(Error));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=Ce(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.A.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.aT)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Pe(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:Re,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Le(e){for(var t={},n=[],r=Pe(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 d=0;d<e.attributes.length;d++){var c=e.attributes[d];switch(c.name){case"timescale":r(c.value,{asKey:"timescale",parser:Te,dashName:"timescale"});break;case"presentationTimeOffset":r(c.value,{asKey:"presentationTimeOffset",parser:we,dashName:"presentationTimeOffset"});break;case"indexRange":r(c.value,{asKey:"indexRange",parser:Re,dashName:"indexRange"});break;case"indexRangeExact":r(c.value,{asKey:"indexRangeExact",parser:Ee,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(c.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(c.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"duration":r(c.value,{asKey:"duration",parser:Te,dashName:"duration"});break;case"startNumber":r(c.value,{asKey:"startNumber",parser:Te,dashName:"startNumber"});break;case"endNumber":r(c.value,{asKey:"endNumber",parser:Te,dashName:"endNumber"})}}return[t,n]}function Ue(e){for(var t={},n=[],r=Pe(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:Re,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Re,dashName:"mediaRange"})}}return[t,n]}function Be(e){for(var t=Le(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=Ue(s),l=u[0],d=u[1];i.push(l),r=r.concat(d)}}return[(0,I.A)(n,{list:i}),r]}function Fe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ve(e){for(var t,n=Le(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=Fe(o))}for(var s=(0,I.A)({},r,{duration:r.duration,timelineParser:t}),u=Pe(s,i),l=0;l<e.attributes.length;l++){var d=e.attributes[l];switch(d.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:d.value});break;case"index":s.index=d.value;break;case"availabilityTimeOffset":u(d.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(d.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"media":s.media=d.value;break;case"bitstreamSwitching":u(d.value,{asKey:"bitstreamSwitching",parser:Ee,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=me(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(Me(a));break;case"SegmentBase":var l=Le(a),d=l[0],c=l[1];t.segmentBase=d,c.length>0&&(r=r.concat(c));break;case"SegmentList":var f=Be(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ve(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ne(a),A=y[0],_=y[1];_.length>0&&(r=r.concat(_)),void 0!==A&&n.push(A);break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Me(a)]:t.supplementalProperties.push(Me(a))}}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=Pe(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:Te,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Te,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,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:Te,dashName:"qualityRanking"});break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Te,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new De("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=[Me(a)]:t.accessibilities.push(Me(a));break;case"BaseURL":var o=me(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=ge(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Me(a)]:t.essentialProperties.push(Me(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Me(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var d=ze(a),c=d[0],f=d[1];t.representations.push(c),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Me(a)]:t.roles.push(Me(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Me(a)]:t.supplementalProperties.push(Me(a));break;case"SegmentBase":var v=Le(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Be(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var A=Ve(a),_=A[0],b=A[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var S=Ne(a),E=S[0],T=S[1];T.length>0&&(r=r.concat(T)),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=Pe(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:Te,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:Te,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Te,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Te,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Te,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Te,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Te,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:Te,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:ke,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:ke,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Te,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,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:Te,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function We(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Pe(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:Te,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];if("Event"===s.nodeName){var u=Ge(s),l=u[0],d=u[1];t.children.events.push(l),d.length>0&&(n=n.concat(d))}}return[t,n]}function Ge(e){for(var t={eventStreamData:e},n=[],r=Pe(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:Te,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Te,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=me(s),l=u[0],d=u[1];void 0!==l&&n.push(l),i=i.concat(d);break;case"AdaptationSet":var c=Ke(s),f=c[0],v=c[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=We(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ve(s),y=g[0],A=g[1];t=y,A.length>0&&(i=i.concat(A))}}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=Pe(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:xe,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:xe,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,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 qe(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=me(s),l=u[0],d=u[1];void 0!==l&&t.push(l),a=a.concat(d);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var c=He(s),f=c[0],v=c[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Me(s);i.push(p)}}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=Pe(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:Ie,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ie,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ie,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:xe,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:xe,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:xe,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:xe,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:xe,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:xe,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:xe,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.A)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=qe(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 d="<root>"+o.data+"</root>",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var A=t.value.continue(r);return e(A)}}};(0,r.A)(t)}(he(o,t,s))}},5019: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,{A:function(){return r}})},3877:function(e,t,n){"use strict";n.d(t,{Rb:function(){return a},_l:function(){return s},jX:function(){return u},ph:function(){return l},vb:function(){return o},yi:function(){return i}});var r=n(6787);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.A)(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 d=r[u+1];if(void 0===d)return null;var c=d.start;return i>=a(l,d,n)&&i<c?s(c,e):null}},860:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(5575),i=n(9477),a=n(3877);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.Rb)(s,t[0])<o)throw new r.A("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 d=n-u;return e.splice.apply(e,[u,d].concat(t)),!1}if(l<o){var c=e[u];if(c.start+c.duration>o)return i.A.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(c.start+c.duration*(c.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-c.start)/c.duration-1;if(f%1==0&&c.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=c.start,e[u].repeatCount=v,!1}return i.A.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 p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.A.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.A.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.A.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.A.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},9561:function(e,t,n){"use strict";var r=n(2384),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.A=function(e,t,n){var d,c,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.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),A=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.A)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=f.exec(e),c=v.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var _=e.slice(d.index,c.index),b=u.exec(_);if(!Array.isArray(b))throw new Error("parse error (sync time attribute)");var S=+b[1];if(isNaN(S))throw new Error("parse error (sync time attribute NaN)");E(_.split("\n"),S/1e3)}return p;function E(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if("&nbsp;"===d)p[p.length-1].end=n;else{var c=document.createElement("DIV");c.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 v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.A)(A)&&(v.style.cssText=A);for(var h=d.split(a),m=0;m<h.length;m++){0!==m&&v.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))})),v.appendChild(y)}f.appendChild(v),c.appendChild(f),p.push({element:c,start:n+t,end:-1})}}}}}},7275:function(e,t,n){"use strict";var r=n(8068),i=n(2384),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 d(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.A=function(e,t,n){var c,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,A=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=d(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.A)(n)&&void 0===(y=A[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=v.exec(e),f=p.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var _=e.slice(c.index,f.index),b=l.exec(_);if(null===b)throw new Error("parse error (sync time attribute)");var S=+b[1];if(isNaN(S))throw new Error("parse error (sync time attribute NaN)");E(_.split("\n"),S/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.A)(u)&&null!=s){var l=(0,r.A)(o,s,u);null!=l&&t.push(l)}}return t}(h);function E(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&("&nbsp;"===c?h[h.length-1].end=n:h.push({text:(i=c,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},9413:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e,t){for(var n=t+1;(0,r.A)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.A)(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}},1650:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9413),i=n(5842);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.A)(n),s=[],u=0;u<a.length;u++){var l=(0,i.A)(a[u],t);if(null!=l){var d=o(l);null!=d&&s.push(d)}}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 d=e(a);d.style.fontWeight="bold",r.appendChild(d)}else if("I"===a.nodeName){var c=e(a);c.style.fontStyle="italic",r.appendChild(c)}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 v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},5992:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(8068),i=n(9413),a=n(5842);function o(e,t){for(var n,o,s,u,l,d=e.split(/\r\n|\n|\r/),c=(0,i.A)(d),f=[],v=0;v<c.length;v++){var p=(0,a.A)(c[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.A)(o,s,l));null!==h&&f.push(h)}}return f}},5842:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e){var t=e.split(":");if((0,r.A)(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.A)(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.A)(n)||!(0,r.A)(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.A)(n)||!(0,r.A)(a))return null;var l=i(n),d=i(a);return void 0===l||void 0===d?null:{start:l+t,end:d+t,payload:o}}},2632:function(e,t,n){"use strict";n.d(t,{d:function(){return u},i:function(){return s}});var r=n(1729),i=n(4031),a=n(2384),o=n(9828);function s(e,t,n,o){for(var s,u={},l=e.slice(),d=function(){var e=t[c];if(void 0!==e){var s,d;if(e.nodeType===Node.ELEMENT_NODE)for(var f=e,v=0;v<=f.attributes.length-1;v++){var p=f.attributes[v],h=p.name;if("style"===h)s=p.value;else if("region"===h)d=p.value;else{var m=h.substring(4);if((0,i.A)(l,m)&&(u[m]=p.value,l.splice(v,1),0===l.length))return{v:u}}}if((0,a.A)(s)){var g=(0,r.A)(n,(function(e){return e.id===s}));if(void 0!==g)for(var y=0;y<=l.length-1;y++){var A=l[y];if(!(0,a.A)(u[A])&&(0,a.A)(g.style[A])){if(u[A]=g.style[A],l.splice(y,1),0===l.length)return{v:u};y--}}}if((0,a.A)(d)){var _=(0,r.A)(o,(function(e){return e.id===d}));if(void 0!==_)for(var b=0;b<=l.length-1;b++){var S=l[b];if(!(0,a.A)(u[S])&&(0,a.A)(_.style[S])){if(u[S]=_.style[S],l.splice(b,1),0===l.length)return{v:u};b--}}}}},c=0;c<=t.length-1;c++)if(s=d())return s.v;return u}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.A)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},9750:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(2384),i=n(8623);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.Cn.test(e)?function(e,t){var n=i.Cn.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,o+60*a+3600*r}(t,e):i.lP.test(e)?a(i.lP,e):i.uA.test(e)?a(i.uA,e):i.s_.test(e)?function(e,t){var n=i.s_.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Nm.test(e)?function(e,t){var n=i.Nm.exec(t);return Number(n[1])/e.tickRate}(t,e):i.QF.test(e)?a(i.QF,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.A)(n)?o(n,t):null,u=(0,r.A)(i)?o(i,t):null,l=(0,r.A)(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}}},8342:function(e,t,n){"use strict";n.d(t,{A:function(){return T}});var r=n(3487);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(9750);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(2384),d=n(8935),c=n(2632),f=n(4666),v=n(9477),p=n(8623);function h(e,t){var n=t;return(0,l.A)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.UR.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=p.Ce.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=p.PL.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p._Y.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.A)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.A)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.A)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var d=m(o[0]),c=o[1];e.style.textShadow=h(d,c)}else if((0,l.A)(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]),A=o[1];e.style.textShadow=h(y,A)}else if((0,l.A)(r)){var _=o[0];e.style.textShadow=h(r,_)}}}var b=t.textDecoration;if((0,l.A)(b))switch(b){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=b}var S=t.fontFamily;if((0,l.A)(S))switch(S){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=S}var E=t.fontStyle;(0,l.A)(E)&&(e.style.fontStyle=E);var T=t.fontWeight;(0,l.A)(T)&&(e.style.fontWeight=T);var w=t.fontSize;(0,l.A)(w)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.iP.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)?v.A.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 v.A.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,w):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var k=t.direction;(0,l.A)(k)&&(e.style.direction=k);var I=t.unicodeBidi;if((0,l.A)(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.A)(x)&&(e.style.visibility=x),"none"===t.display&&(e.style.display="none");var R=t.wrapOption;e.style.whiteSpace="noWrap"===R?n?"nowrap":"pre":n?"normal":"pre-wrap"}function A(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.A)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.iP.exec(r[0]),a=p.iP.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])):v.A.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])):v.A.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.A)(r);var i=t.overflow;e.style.overflow=(0,l.A)(i)?i:"hidden";var a=t.padding;(0,l.A)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.iP.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])):v.A.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var d=p.iP.exec(n[3]);if(null!==d)if("px"===d[2]||"%"===d[2]||"em"===d[2]){var c=d[1]+d[2];e.style.paddingLeft=c}else"c"===d[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",d[1])):v.A.warn("TTML Parser: unhandled padding unit:",d[2])}}}}}}}}(e,a);var o=t.origin;(0,l.A)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.iP.exec(r[0]),a=p.iP.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])):v.A.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])):v.A.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.A)(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 d=t.opacity;(0,l.A)(d)&&(e.style.opacity=d);var c=t.visibility;(0,l.A)(c)&&(e.style.visibility=c),"none"===t.display&&(e.style.display="none")}function _(e,t){e.style.margin="0px",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1");var n=t.backgroundColor;(0,l.A)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.A)(r)&&function(e,t){var n=t.trim(),r=n.split(" ");if("auto"!==n){var i=p.iP.exec(r[0]);null!==i&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.lineHeight=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",i[1])):v.A.warn("TTML Parser: unhandled lineHeight unit:",i[2]))}}(e,r);var i=t.textAlign;if((0,l.A)(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 b(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," ")}var o=document.createTextNode(i);return r.appendChild(o),r.className="rxp-texttrack-span",y(r,t,n),r}function S(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.Ft)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),A(v,i),null!==t){var p=(0,c.i)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.A)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",_(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,c.i)(["backgroundColor"],a,n,t).backgroundColor;(0,l.A)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=b(p,i,o);u.push(m)}else if((0,f.SV)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.f_)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var A=p.getAttribute("xml:space"),_=(0,l.A)(A)?"default"===A:o,S=(0,d.A)({},i,(0,c.i)(g,[p],n,t));u.push.apply(u,e(p,S,[p].concat(a),_))}}return u}(e,(0,d.A)({},r),[],i)}(e,n,r,i,s),S=0;S<y.length;S++)h.appendChild(y[S]);return v.appendChild(h),v}function E(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 d=n.cellResolution,c=(0,s.A)(t,n);return{start:c.start+u,end:c.end+u,element:S(t,r,i,a,o,{cellResolution:d,shouldTrimWhiteSpace:l})}}var T=function(e,t){for(var n=(0,r.A)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=E(n[s]);null!==l&&o.push(l)}return o}},5084:function(e,t,n){"use strict";n.d(t,{A:function(){return v}});var r=n(3487),i=n(8068),a=n(7402),o=n(2384),s=n(9750),u=n(8623),l=n(4666),d={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.A)(t,f),h=p.start,m=p.end,g=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 d=u.trim();u=d=d.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if((0,l.SV)(s))i+="\n";else if((0,l.f_)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.A)(c)?"default"===c:t)}}return i}return n(e,t)}(t,v),y=(0,i.A)(h+n,m+n,g);return null===y?null:((0,a.A)(y)&&function(e,t){var n=t.extent;if((0,o.A)(n)){var r=u.KP.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.A)(i))u.KP.exec(i);var a=t.align;if((0,o.A)(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 l=d[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.A)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},3487:function(e,t,n){"use strict";n.d(t,{A:function(){return v}});var r=n(1729),i=n(2384),a=n(8935),o=n(9477),s=/(\d+) (\d+)/;var u=n(2632),l=n(3786),d=n(4031);var c=n(4666),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 v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,c.$K)(p),m=(0,c.bL)(p),g=(0,c.Y$)(p),y=(0,c.zn)(p),A=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"),d={columns:32,rows:15};if(null!==l){var c=s.exec(l);if(null===c||c.length<3)o.A.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(c[1],10),v=parseInt(c[2],10);isNaN(f)||isNaN(v)?o.A.warn("TTML Parser: Invalid cellResolution"):d={columns:f,rows:v}}}if((0,i.A)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,A=null!==u?u:"default",_=void 0!==m?m:p*h;if(null!==a){var b=/^(\d+) (\d+)$/g.exec(a);null!==b&&(g=p*(Number(b[1])/Number(b[2])))}return{cellResolution:d,tickRate:_,frameRate:g,subFrameRate:y,spaceStyle:A}}(p),_=[],b=0;b<=m.length-1;b++){var S=m[b];if(S instanceof Element){var E=S.getAttribute("xml:id");if(null!==E){var T=S.getAttribute("style"),w=null===T?[]:T.split(" ");_.push({id:E,style:(0,u.d)(S),extendsStyles:w})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(){var i=r.extendsStyles[u],s=(0,l.A)(e,(function(e){return e.id===i}));if(s<0)o.A.warn("TTML Parser: unknown style inheritance: "+i);else{var c=e[s];(0,d.A)(t,s)?o.A.warn("TTML Parser: infinite style inheritance loop avoided"):n(c,s),r.style=(0,a.A)({},c.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s();r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(_);for(var k=[],I=function(){var e=g[x];if(e instanceof Element){var t=e.getAttribute("xml:id");if(null!==t){var n=(0,u.d)(e),o=e.getAttribute("style");if((0,i.A)(o)){var s=(0,r.A)(_,(function(e){return e.id===o}));void 0!==s&&(n=(0,a.A)({},s.style,n))}k.push({id:t,style:n,extendsStyles:[]})}}},x=0;x<=g.length-1;x++)I();for(var R=(0,u.i)(f,null!==h?[h]:[],_,k),C="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===A.spaceStyle,M=0;M<y.length;M++){var P=y[M];if(P instanceof Element){var D=(0,c.Ft)(P),N=(0,a.A)({},R,(0,u.i)(f,[P].concat(D),_,k)),O=P.getAttribute("xml:space"),L=(0,i.A)(O)?"default"===O:C,U={paragraph:P,timeOffset:t,idStyles:_,regionStyles:k,body:h,paragraphStyle:N,ttParams:A,shouldTrimWhiteSpace:L};null!==U&&n.push(U)}}}return n}},8623:function(e,t,n){"use strict";n.d(t,{Ce:function(){return f},Cn:function(){return r},KP:function(){return l},Nm:function(){return s},PL:function(){return v},QF:function(){return u},UR:function(){return c},_Y:function(){return p},iP:function(){return d},lP:function(){return i},s_:function(){return o},uA: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)%$/,d=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,c=/^#([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])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},4666: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)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function d(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{$K:function(){return a},Ft:function(){return i},SV:function(){return l},Y$:function(){return s},bL:function(){return o},f_:function(){return d},zn:function(){return u}})},7093:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384),i=n(6525);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.GX)(e,a)){var o=(0,i.o4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.A)(e[a]))for(;(0,r.A)(e[a]);)a++;return n}},8977:function(e,t,n){"use strict";n.d(t,{A:function(){return I}});var r=n(7093),i=n(2384),a=n(6525);var o=n(8786),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=function(r){var o=e[r];if(Array.isArray(/::cue {/.exec(o)))for(o=e[++r];(0,i.A)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)n+=o,o=e[++r];else{for(var s=[],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);(0,i.A)(o)&&Array.isArray(u);)s.push(u[1]),o=e[++r],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);for(var l="";(0,i.A)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)l+=o,o=e[++r];s.forEach((function(e){void 0===t[e]?t[e]=l:t[e]+=l}))}a=r},a=1;a<e.length;a++)r(a)})),{classes:t,global:n}}var l=n(4031);function d(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.A)(["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 c=e.nodeName.toLowerCase().split("."),f=[];if(c.forEach((function(e){(0,i.A)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.A)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.A)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=d(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var A=d(e.childNodes[y],t);n.appendChild(A)}}return n}var c=n(4324);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,c.A)(e).length))return"text-align:center";var t=m(e),n=A(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+E(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+S(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"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=w(e.position);if(null!==n)return n;var r=S(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.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={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?S(e.align):v.CENTER]},A=function(e){return{position:_(e.line),offset:b(e.line)}},_=function(e){return w(e)},b=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.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[p.START]},S=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},E=function(e){return T(e,100)},T=function(e,t){var n=w(e);return null!==n?n:t},w=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 k(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 c=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);c.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.A)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),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(d(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(c),c.appendChild(v),{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.yW)(n),d=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.iq)(e,r)){var o=r;for(r++;(0,i.A)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.A)(e[r]))for(;(0,i.A)(e[r]);)r++;return n}(n,l),c=(0,r.A)(n,l),f=u(d),v=0;v<c.length;v++){var p=(0,o.A)(c[v],t);if(null!=p){var h=k(p,f);s.push(h)}}return s}},2537:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(7402),i=n(7093),a=n(8786),o=n(6525),s=n(4031),u=n(2384);function l(e,t){if(!(0,u.A)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.A)(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.A)(["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.A)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.A)(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.A)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.A)(["start","center","end","left"],e.align)&&(t.align=e.align)}var d=n(8068);var c=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,c,f,v=(0,o.yW)(n),p=(0,i.A)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.A)(p[m],t);if(null!=g){var y=(u=void 0,c=void 0,f=void 0,u=(s=g).start,c=s.end,f=s.payload.join("\n"),(0,d.A)(u,c,f));null!=y&&((0,r.A)(y)&&l(g.settings,y),h.push(y))}}return h}},8786:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(2384);function i(e){var t=e.split(":").reverse();if((0,r.A)(t[2])||(0,r.A)(t[1])){var n=(0,r.A)(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}}},6525:function(e,t,n){"use strict";n.d(t,{GX:function(){return o},iq:function(){return a},o4:function(){return s},yW:function(){return i}});var r=n(2384);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.A)(e[n]);)n++;return n}},9502:function(e,t,n){"use strict";n.d(t,{A:function(){return ce}});var r=n(418),i=n(1856),a=n(467),o=n(4756),s=n.n(o),u=n(4389),l=n(2716);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,l.Ay)(e.baseUrl,t.url)}function c(e,t,n,r,i){return f.apply(this,arguments)}function f(){return(f=(0,a.A)(s().mark((function e(t,n,r,i,a){var o,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.segment,l=d(t,o),!o.isInit&&null!==l){e.next=4;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return e.next=6,(0,u.Ay)({url:l,responseType:"arraybuffer",timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i});case 6:return c=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:c});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t){var n,i=t.segment,a=t.period,o=e.data,s=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(s)throw new Error("Image data should not be downloaded in chunks");var u=null!==(n=i.timestampOffset)&&void 0!==n?n:0;return null===o||null===r.A.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}:{segmentType:"media",chunkData:{data:r.A.imageParser(new Uint8Array(o)).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:[a.start,a.end]}}var p=n(5151),h=n(874),m=n(9477),g=n(8568),y=n(8935),A=n(4670);function _(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,d){var c,f=a.responseData,v=o.externalClockOffset,_=null!==(c=a.url)&&void 0!==c?c:o.originalUrl,b=null!=i?i:v,S={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.A.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return m.A.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var T=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,A.eb)(e).buffer;if(e instanceof Document)return(0,A.eb)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);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}(T)?"initialized"===E.wasm.status?(m.A.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(T,S))):(m.A.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(m.A.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(m.A.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(T,S)))}))):(m.A.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,A.Es)(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")}(f);return k(E.js(e,S))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled()?Promise.reject(l.cancellationError):{manifest:new g.Ay(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return d((function(){var t=p.A.getCurrent().DEFAULT_REQUEST_TIMEOUT;return"string"===n.format?(0,u.Ay)({url:e,responseType:"text",timeout:t,cancelSignal:l}):(0,u.Ay)({url:e,responseType:"arraybuffer",timeout:t,cancelSignal:l})})).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,y.A)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,y.A)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,h.A)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,y.A)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var b=n(7004),S=n(3506),E=n(5497),T=n(6787),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,T.A)(k)&&!(0,T.A)(w)}var x=n(5950),R=n(3233);function C(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 M=n(2507),P=n(3598);function D(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new M.Ay,d=l.linkToSignal(i);function c(){l.signal.deregister(u),d()}l.signal.register(u),e(t,n,r,l.signal,Object.assign(Object.assign({},a),{onNewChunk:function(e){try{o(e),a.onNewChunk(e)}catch(e){c(),l.cancel(),u(e)}}})).then((function(e){if(c(),!l.isUsed()){if("segment-loaded"===e.resultType)try{o(e.resultData.responseData)}catch(e){return void u(e)}s(e)}}),(function(e){c(),u(e)}))}));function o(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===C(n.adaptation.type,n.representation)&&(0,P.A)(new Uint8Array(e),n.segment.isInit)}}}var N=n(5553);function O(e,t,n,r,i){if(void 0===t.range)return(0,u.Ay)({url:e,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.Ay)({url:e,headers:{Range:(0,R.A)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var a=(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.Ay)({url:e,headers:{Range:(0,R.A)(t.indexRange)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress});return Promise.all([a,o]).then((function(t){var n=t[0],r=t[1],i=(0,N.xW)(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(1688);function U(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,R.A)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,T.A)(e.headers))if((0,T.A)(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])}}m.A.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,d=performance.now(),c=(0,T.A)(k)?null:new k;function f(){(0,T.A)(c)?m.A.warn("Fetch: AbortController API not available."):c.abort()}void 0!==e.timeout&&(o=window.setTimeout((function(){l=!0,f()}),e.timeout));var v=e.cancelSignal.register((function(e){u=e,f()})),p={method:"GET"};return void 0!==t&&(p.headers=t),p.signal=(0,T.A)(c)?null:c.signal,fetch(e.url,p).then((function(t){if((0,T.A)(o)||clearTimeout(o),t.status>=300)throw m.A.warn("Fetch: Request HTTP Error",t.status,t.url),new S.A(t.url,t.status,E.yl.ERROR_HTTP_CODE);if((0,T.A)(t.body))throw new S.A(t.url,t.status,E.yl.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,T.A)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),u=0;return l();function l(){return c.apply(this,arguments)}function c(){return(c=(0,a.A)(s().mark((function n(){var a,o,c,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,T.A)(a.value)){n.next=11;break}return u+=a.value.byteLength,o=performance.now(),c={url:t.url,currentTime:o,duration:o-d,sendingTime:d,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(c),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-d,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:d,size:u,status:t.status,url:t.url});case 16:return n.abrupt("return",l());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==u)throw u;if(v(),l)throw m.A.warn("Fetch: Request timeouted."),new S.A(e.url,0,E.yl.TIMEOUT);if(t instanceof S.A)throw t;throw m.A.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new S.A(e.url,0,E.yl.ERROR_EVENT)}))}({url:e,headers:u,onData:function(e){var t=new Uint8Array(e.chunk),n=function(e){for(var t=0,n=[],r=null;t<e.length;){r=e.subarray(t,1/0);var i=(0,L.A)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,N.mq)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.A)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,N.mq)(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 0===n.length?[null,r]:[n,r]}(null!==l?(0,N.xW)(l,t):t),a=n[0];l=n[1],null!==a&&(a.forEach((function(e){r.onNewChunk(e)})),i.isCancelled())||(r.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),i.isCancelled())},timeout:n.timeout,cancelSignal:i}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function B(e,t,n,r,i,a){if(t.segment.isInit)return O(e,t.segment,r,a,i);var o=C(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return U(e,t,r,i,a);(0,x.A)("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,u.Ay)({url:e,responseType:"arraybuffer",headers:void 0!==s.range?{Range:(0,R.A)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(2948),V=n(1134),z=408125543,K=357149030,W=2807729,G=17545,H=475249515,q=187,j=179,Y=183,Q=241;function X(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=ee(n,o);if(null==s)return null;var u=s.value,l=o+s.length,d=te(n,l);if(null==d)return null;var c=l+d.length,f=c+d.value;if(u===e)return[c,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return X(e,t.slice(v+1,t.length),n,[c,f])}o=f}return null}function $(e,t){var n=X(W,[z,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/ne(e,n[0],r)}function Z(e,t){var n=X(G,[z,K],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 ee(e,t){var n=J(e,t);if(null==n)return m.A.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.A.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 te(e,t){var n=J(e,t);if(null==n)return m.A.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.A.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 ne(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 re=n(9044);function ie(e,t,n,r){var i=(0,V.D1)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,V.cS)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&m.A.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 ae(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,a=null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),o=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,A.Es)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t);return{inbandEvents:a,needsManifestRefresh:o}}}function oe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a,o=n.period,s=n.adaptation,u=n.representation,l=n.segment,d=n.manifest,c=e.data,f=e.isChunked,v=[o.start,o.end];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:0,protectionDataUpdate:!1,appendWindow:v};var p=c instanceof Uint8Array?c:new Uint8Array(c),h=C(s.type,u),m="mp4"===h||void 0===h,g=!1;if(m){var y,A=(0,F.A)(p);l.isInit&&(y=null!==(i=(0,V.a5)(p))&&void 0!==i?i:void 0),(A.length>0||void 0!==y)&&(g=u._addProtectionData("cenc",y,A))}if(!l.isInit){var _=m?ie(p,f,l,r):null,b=null!==(a=l.timestampOffset)&&void 0!==a?a:0;if(m){var S=(0,V.pk)(p);if(void 0!==S){var E=ae(S.filter((function(e){return void 0!==l.privateInfos&&void 0!==l.privateInfos.isEMSGWhitelisted&&l.privateInfos.isEMSGWhitelisted(e)})),d.publishTime);if(void 0!==E){var w=E.needsManifestRefresh,k=E.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:_,chunkOffset:b,appendWindow:v,inbandEvents:k,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:_,chunkOffset:b,protectionDataUpdate:g,appendWindow:v}}var I=l.indexRange,x=null;if("webm"===h)x=function(e,t){var n=X(z,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=$(e,r);if(null==a)return null;var o=Z(e,r);if(null==o)return null;var s=X(H,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var d=X(q,[],e,[l,s[1]]);if(null==d)break;var c=X(j,[],e,[d[0],d[1]]);if(null==c)return null;var f=ne(e,c[0],c[1]-c[0]),v=X(Q,[Y],e,[d[0],d[1]]);if(null==v)return null;var p=ne(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=d[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(m&&(x=(0,V.Tr)(p,Array.isArray(I)?I[0]:0),!0===t&&null!==x&&x.length>0)){var R=x[x.length-1];Array.isArray(R.range)&&(R.range[1]=1/0)}u.index instanceof re.A&&null!==x&&x.length>0&&u.index.initializeIndex(x);var M=m?(0,V.zS)(p):"webm"===h?$(p,0):void 0,P=(0,T.A)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:P}}}var se=n(2875);function ue(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):m.A.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":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),d=function(e){var t=(0,se.j8)(e);return null===t?"":(0,A.Es)(t)}(t);return{data:d,type:l,language:s.language,start:i,end:a}}function le(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?m.A.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration));var u=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);return{data:t,type:u,language:o.language,start:r,end:i}}function de(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,l=e.data,d=e.isChunked;if(null===l)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var c=C(o.type,s);if("webm"===c)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===c?function(e,t,n,r,i){var a,o=n.period,s=n.representation,u=n.segment,l=u.isInit,d=u.indexRange,c="string"==typeof e?(0,A.eb)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,V.Tr)(c,Array.isArray(d)?d[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,V.zS)(c);return s.index instanceof re.A&&null!==f&&f.length>0&&s.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=ie(c,t,u,r),m=ue(n,c,h,t),g=null!==(a=u.timestampOffset)&&void 0!==a?a:0;return{segmentType:"media",chunkData:m,chunkSize:c.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[o.start,o.end]}}(l,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,A.Es)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:le(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(l,d,n)}}var ce=function(e){var t=(0,i.A)({customManifestLoader:e.manifestLoader},null===r.A.dashParsers.wasm||"initialized"!==r.A.dashParsers.wasm.status&&"initializing"!==r.A.dashParsers.wasm.status?"arraybuffer":"text"),n=_(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:D(r);function r(e,r,i,a,o){var s=d(e,r.segment);if(null==s)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return B(s,r,t,i,o,a);var u={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",timeout:i.timeout,url:s};return new Promise((function(e,l){var d=!1,c=n(u,{reject:function(e){var t,n,r;if(!d&&!a.isCancelled()){d=!0,a.deregister(f);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new b.A(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);l(s)}},resolve:function(t){d||a.isCancelled()||(d=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){d||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){d||a.isCancelled()||(d=!0,a.deregister(f),B(s,r,t,i,o,a).then(e,l))}});function f(e){d||(d=!0,"function"==typeof c&&c(),l(e))}a.register(f)}))}}(e),o=oe(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:D(n);function n(e,n,r,i,a){var o=n.adaptation,s=n.representation,l=n.segment,c=l.range,f=d(e,l);if(null===f)return Promise.resolve({resultType:"segment-created",resultData:null});if(l.isInit)return O(f,l,r,i,a);var v=C(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return U(f,n,r,a,i);(0,x.A)("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 p?(0,u.Ay)({url:f,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,R.A)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.Ay)({url:f,responseType:"text",headers:Array.isArray(c)?{Range:(0,R.A)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:s,parseSegment:de(e)},image:{loadSegment:c,parseSegment:v}}}},5564:function(e,t,n){"use strict";n.d(t,{A:function(){return me}});var r=n(467),i=n(4756),a=n.n(i),o=n(418),s=n(9477),u=n(8568),l=n(2875),d=n(7941),c=n(7994),f=n(5019),v=n(3877),p=n(860);function h(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,v.Rb)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function m(e,t){return e.replace(/\{start time\}/g,String(t))}function g(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function y(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 A=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,v.Rb)(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},url: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,d=this._isAggressiveMode,c=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],A=h.duration,_=h.start,b=y(h,s[p+1]),S=g(_,i,A),E=_+S*A,T=d?0:A;E<a&&S<=b&&(null==v||E+T<=v);){var w=E,k=null!=n?n+S:void 0,I={id:String(E),isInit:!1,time:w/u,end:(w+A)/u,duration:A/u,timescale:1,number:k,url:m(l,w),complete:!0,privateInfos:{smoothMediaSegment:{time:w,duration:A}}};c.push(I),E=_+ ++S*A}if(E>=a)return c;null!=n&&(n+=b+1)}return c},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.getFirstAvailablePosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastAvailablePosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,v.Rb)(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.getEnd=function(){if(!this._isLive)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,c.h)(e<=t),this.isStillAwaitingFutureSegments())return!1;var r=this.getLastAvailablePosition();return!(void 0!==r&&t<r)&&(t>(null!==(n=this.getFirstAvailablePosition())&&void 0!==n?n:0)&&void 0)},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,v.ph)(this._index,e,void 0)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();for(var t=this._index,n=t.timeline,r=t.timescale,i=0;i<n.length;i++){var a=n[i],o=a.start/r;if(o>e.time)return!1;if(o===e.time)return!0;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},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof d.A&&(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,v.Rb)(o,null);if(!((0,v.Rb)(a,null)<=u))for(var l=0;l<t.length;l++){var d=t[l],c=(0,v.Rb)(d,null);if(c===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(c>u){if(d.duration!==o.duration)return;var f=u-d.start;if(0===f)return s.A.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%d.duration!=0)return;var p=f/d.duration-1,h=d.repeatCount-p;if(h<0)return;o.repeatCount+=h;var m=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(m))}}}},t._update=function(e){(0,p.A)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isStillAwaitingFutureSegments=function(){return this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)h(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,f.A)(e.timeline,r)}}},e}(),_=n(4129),b=n(4031),S=n(5553),E=n(2384),T=n(8935),w=n(2716),k=n(4670),I=n(3058),x={};function R(e){if(null!=x[e])return x[e];var t=(0,k.eb)(e);return x[e]=t,t}function C(e,t){var n=t.length+8;return n<=I.Z?(0,S.xW)((0,S.KS)(n),R(e),t):(0,S.xW)((0,S.KS)(1),R(e),(0,S.Kk)(n+8),t)}function M(e,t){return C(e,S.xW.apply(void 0,t))}function P(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,b.A)(t,r)){s.A.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,P(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,b.A)(o,n)){s.A.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,P(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,b.A)(i,n)){s.A.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,P(e),i.push(r)}else i.push(n)}))}))}))}))}var D=n(603);function N(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,S.xW)([8,1,18,16],e)}]}function O(e,t){if(void 0===t&&(t=N),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,D.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,S.AT)(e,8),n=(0,k.Yg)(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,k.KZ)((0,D.K)(i));return(0,k.My)(a).toLowerCase()}(r),a=(0,k.aT)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}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",DFXP:"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"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),d=r("PacketSize"),c=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 s.A.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var p=function(e,t){var n;return 0==(n="AACH"===t?5:(0,E.A)(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!==o?parseInt(o,10):o,codecPrivateData:u,codecs:p,customAttributes:n,mimeType:void 0!==l?B[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};case"video":var h=r("CodecPrivateData"),m=r("FourCC"),g=r("MaxWidth"),y=r("MaxHeight"),A=r("Bitrate"),_=void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10);if(void 0!==m&&void 0===B[m]||void 0===h)return s.A.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var b=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,E.A)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:_,customAttributes:n,mimeType:void 0!==m?B[m]:m,codecPrivateData:h,codecs:b,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var S=r("CodecPrivateData"),T=r("FourCC"),w=r("Bitrate");return{bitrate:void 0===w||isNaN(parseInt(w,10))?0:parseInt(w,10),customAttributes:n,mimeType:void 0!==T?B[T]:T,codecPrivateData:null!=S?S:""};default:return s.A.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.baseUrl,u=t.protections,l=t.timeShiftBufferDepth,d=t.manifestReceivedTime,f=t.isLive,v=r.getAttribute("Timescale"),p=null===v||isNaN(+v)?i:+v,h=r.getAttribute("Type");if(null===h)throw new Error("StreamIndex without type.");(0,b.A)(_.B,h)||s.A.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),w=r.getAttribute("Url"),I=null===w?"":w;var x,R=L(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,m);if(null===i)return e;("video"!==m||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,P=R.cNodes,D={timeline:(x=P,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 d=x[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,E.A)(c)?+c: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:p};(0,c.h)(0!==M.length,"Adaptation should have at least one playable representation.");var N=m+((0,E.A)(y)?"_"+y:""),O=M.map((function(t){var n,r,i,a,s={timeline:D.timeline,timescale:D.timescale,media:(n=I,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,E.A)(t.mimeType)?t.mimeType:U[m],v=t.codecs,p=N+"_"+(null!=m?m+"-":"")+(null!=c?c+"-":"")+(null!=v?v+"-":"")+String(t.bitrate),h=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){h.push({keyId:t,systemId:e.systemId})}))})));var g={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},y=null!=e.aggressiveMode&&e.aggressiveMode,_=new A(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:d,segmentPrivateInfos:g,timeShiftBufferDepth:l}),b=(0,T.A)({},t,{index:_,cdnMetadata:[{baseUrl:o}],mimeType:c,codecs:v,id:p});if(h.length>0||void 0!==a){var w=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,""),i=function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return C("pssh",(0,S.xW)([n,0,0,0],(0,k.aT)(e),(0,S.KS)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(w.length>0){var x=[{type:"cenc",values:w}];b.contentProtections={keyIds:h,initData:x}}else b.contentProtections={keyIds:h,initData:[]}}return b}));if("ADVT"===g)return null;var B={id:N,type:m,representations:O,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(B.closedCaption=!0),B}return function(n,r,a){var s="";if(void 0!==r){var u=(0,w.Cl)(r);s=r.substring(0,u)}var l=n.documentElement;if(null==l||"SmoothStreamingMedia"!==l.nodeName)throw new Error("document root should be SmoothStreamingMedia");var d=l.getAttribute("MajorVersion"),c=l.getAttribute("MinorVersion");if(null===d||null===c||!/^[2]-[0-2]$/.test(d+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,E.A)(p)?isNaN(+p)?1e7:+p:1e7,m=L(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(O(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),g=m.protections,y=m.adaptationNodes,A="boolean"==typeof(f=l.getAttribute("IsLive"))?f:"string"==typeof f&&"TRUE"===f.toUpperCase();if(A){var _=l.getAttribute("DVRWindowLength");null==_||isNaN(+_)||0==+_||(v=+_/h)}var b,S,T,k,I,x,R,C=y.reduce((function(e,t){var n=o({root:t,baseUrl:s,timescale:h,protections:g,isLive:A,timeShiftBufferDepth:v,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,D=void 0!==C.video?C.video[0]:void 0,N=void 0!==C.audio?C.audio[0]:void 0;if(void 0!==D||void 0!==N){var U=[],B=[];if(void 0!==D){var F=D.representations[0];if(void 0!==F){var V=F.index.getFirstAvailablePosition(),z=F.index.getLastAvailablePosition();null!=V&&U.push(V),null!=z&&B.push(z)}}if(void 0!==N){var K=N.representations[0];if(void 0!==K){var W=K.index.getFirstAvailablePosition(),G=K.index.getLastAvailablePosition();null!=W&&U.push(W),null!=G&&B.push(G)}}U.length>0&&(I=Math.max.apply(Math,U)),B.length>0&&(x=Math.min.apply(Math,B),R=Math.max.apply(Math,B))}var H=l.getAttribute("Duration"),q=null!==H&&0!=+H?+H/h:void 0;if(A){b=e.suggestedPresentationDelay,S=t,T=null!=I?I:S;var j=R;void 0===j&&(j=Date.now()/1e3-S);var Y=x;void 0===Y&&(Y=j),k={isLinear:!0,maximumSafePosition:Y,livePosition:j,time:performance.now()},M=null!=v?v:null}else{T=null!=I?I:0,k={isLinear:!1,maximumSafePosition:void 0!==x?x:void 0!==q?T+q:1/0,livePosition:void 0,time:performance.now()}}var Q=A?0:T,X=A?void 0:k.maximumSafePosition,$={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:A,isDynamic:A,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:T,timeshiftDepth:M,maximumTimeData:k},periods:[{adaptations:C,duration:void 0!==X?X-Q:q,end:X,id:"gen-smooth-period-0",start:Q}],suggestedPresentationDelay:b,transportType:"smooth",uris:null==r?[]:[r]};return P($),$}},V=F,z=n(4389),K=n(5950),W=n(3598),G=n(1856),H=n(1134),q=n(8797);function j(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.Y2)(e);null!==c?(u=function(e){var t=(0,q.$H)(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,S.CQ)(t,16*a+5),o=(0,S.CQ)(t,16*a+5+8)):(s=(0,S.mq)(t,8*a+5),o=(0,S.mq)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(c),o=function(e){var t=(0,q.$H)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,S.CQ)(t,12),time:(0,S.CQ)(t,4)}}(c)):s.A.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)d.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:d,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:d,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,H.cS)(e),m=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:d,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var Y=n(443);function Q(e,t){return C("schm",(0,S.xW)(4,(0,k.eb)(e),(0,S.KS)(t)))}function X(e){return C("frma",(0,k.eb)(e))}function $(e){var t=[7,[e.length]];return C("stsd",S.xW.apply(void 0,t.concat(e)))}function Z(e,t,n){return C("tenc",(0,S.xW)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(C("senc",i),function(e){if(0===e.length)return C("saiz",new Uint8Array(0));var t=(0,S.mq)(e,0),n=(0,S.mq)(e,4),r=new Uint8Array(n+9);r.set((0,S.KS)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2&~t?(i=0,a=0):(a=2,s+=6*(i=(0,S.UU)(e,s))+2),r[o]=6*i+8+a,o++;return C("saiz",r)}(i),function(e,t,n,r){return C("saio",(0,S.xW)(4,[0,0,0,1],(0,S.KS)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),M("traf",a)}function ee(e,t){var n=(0,q.QL)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,q.YH)(r,1835427940),a=(0,q.fZ)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,q.QL)(a,1952868452),s=(0,q.QL)(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 d=function(e){return C("tfdt",(0,S.xW)([1,0,0,0],(0,S.Kk)(e)))}(t),c=function(e,t){var n=(1&e[t+3])>0;if(n)return e;var r=new Uint8Array(e.length+4);return r.set(e.subarray(0,t+8),0),r[t+3]=1|r[t+3],r.set([0,0,0,0],t+8),r.set(e.subarray(t+8,e.length),t+12),(0,H.J_)(r)}(l,s[1]-s[0]),f=J(u,d,c,i,(0,q.$H)(a,2721664850,1520127764,2722393154,2086964724)),v=M("moof",[i,f]),p=(0,q.QL)(v,1836019558),h=(0,q.QL)(f,1953653094),m=(0,q.QL)(c,1953658222);if(null===p||null===h||null===m)throw new Error("Smooth: Invalid moof, trun or traf generation");var g=p[1]-p[0]+i.length+(h[1]-h[0])+u.length+d.length+(m[1]-m[0])+8,y=n[2]-n[0],A=v.length-y,_=(0,q.QL)(e,1835295092);if(null===_)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.h$&&(0===A||A<=-8)){var b=_[1];return v.set((0,S.KS)(b),g),e.set(v,n[0]),A<=-8&&e.set(C("free",new Uint8Array(-A-8)),v.length),e}var E=_[1]+A;v.set((0,S.KS)(E),g);var T=new Uint8Array(e.length+A),w=e.subarray(0,n[0]),k=e.subarray(n[2],e.length);return T.set(w,0),T.set(v,w.length),T.set(k,w.length+v.length),T}var te=n(7004),ne=n(3233);function re(e,t,n,r,i,a){var o,s,u,l=M("stbl",[n,C("stts",new Uint8Array(8)),C("stsc",new Uint8Array(8)),C("stsz",new Uint8Array(12)),C("stco",new Uint8Array(8))]),d=function(e){return C("dref",(0,S.xW)(7,[1],e))}(C("url ",new Uint8Array([0,0,0,1]))),c=M("dinf",[d]),f=M("minf",[r,c,l]),v=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 C("hdlr",(0,S.xW)(8,(0,k.eb)(t),12,(0,k.eb)(n),1))}(t),p=function(e){return C("mdhd",(0,S.xW)(12,(0,S.KS)(e),8))}(e),h=M("mdia",[p,v,f]),m=function(e,t,n){return C("tkhd",(0,S.xW)((0,S.KS)(7),8,(0,S.KS)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,S.ww)(e),2,(0,S.ww)(t),2))}(i,a,1),g=M("trak",[m,h]),y=M("mvex",[(o=1,C("trex",(0,S.xW)(4,(0,S.KS)(o),[0,0,0,1],12)))]),A=function(e,t){return C("mvhd",(0,S.xW)(12,(0,S.KS)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,S.ww)(t+1)))}(e,1),_=function(e,t,n){return M("moov",[e,t,n])}(A,y,g),b=(s="isom",u=["isom","iso2","iso6","avc1","dash"],C("ftyp",S.xW.apply(void 0,[(0,k.eb)(s),[0,0,0,1]].concat(u.map(k.eb)))));return(0,S.xW)(b,_)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,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 C("avcC",(0,S.xW)([1,i,a,o,252|r,225],(0,S.ww)(e.length),e,[1],(0,S.ww)(t.length),t))}((0,k.aT)(l),(0,k.aT)(d),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return C("avc1",(0,S.xW)(6,(0,S.ww)(1),16,(0,S.ww)(e),(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),6,[0,1,i.length],(0,k.eb)(i),31-i.length,(0,S.ww)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);c=$([p])}else{var h=M("schi",[Z(1,8,s)]),m=Q("cenc",65536),g=function(e,t,n,r,i,a,o,s){return C("encv",(0,S.xW)(6,(0,S.ww)(1),16,(0,S.ww)(e),(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),6,[0,1,i.length],(0,k.eb)(i),31-i.length,(0,S.ww)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,M("sinf",[X("avc1"),m,h]));c=$([g])}return re(e,"video",c,((f=new Uint8Array(12))[3]=1,C("vmhd",f)),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,d=function(e,t){return C("esds",(0,S.xW)(4,[3,25],(0,S.ww)(e),[0,4,17,64,21],11,[5,2],(0,k.aT)(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,k.My)((0,S.ww)(l))):a),c=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return C("mp4a",(0,S.xW)(6,(0,S.ww)(e),8,(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),(0,S.ww)(i),2,a))}(1,t,n,r,i,d);return $([e])}var a=M("schi",[Z(1,8,o)]),s=Q("cenc",65536),u=M("sinf",[X("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return C("enca",(0,S.xW)(6,(0,S.ww)(e),8,(0,S.ww)(t),(0,S.ww)(n),2,(0,S.ww)(r),(0,S.ww)(i),2,a,o))}(1,t,n,r,i,d,u);return $([l])}();return re(e,"audio",c,C("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,E.A)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ce(e,t){return null===e?null:null===t.url?e.baseUrl:(0,w.Ay)(e.baseUrl,t.url)}function fe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ne.A)(s)}),(0,z.Ay)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,W.A)(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,o){var s=r.segment,u=r.manifest,l=r.period,d=r.adaptation,c=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,v=s.privateInfos.smoothInitSegment,p=v.codecPrivateData,h=v.timescale,m=v.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(d.type){case"video":var y=c.width,A=void 0===y?0:y,_=c.height;f=ie(h,A,void 0===_?0:_,72,72,4,p,g.keyId);break;case"audio":var b=v.channels,S=void 0===b?0:b,E=v.bitsPerSample,T=void 0===E?0:E,w=v.packetSize,k=void 0===w?0:w,I=v.samplingRate;f=oe(h,S,T,k,void 0===I?0:I,p,g.keyId);break;default:0,f=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:f})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:d,manifest:u,period:l,representation:c,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?fe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,d=n(x,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled()){l=!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.",s=new te.A(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);u(s)}},resolve:function(e){if(!l&&!a.isCancelled()){l=!0,a.deregister(c),de(r.representation)&&!0===t||s({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,W.A)(n,r.segment.isInit),s({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){l||a.isCancelled()||(l=!0,a.deregister(c),fe(e,r,o,i,a,t).then(s,u))},progress:function(e){l||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){l||((l=!0)||"function"!=typeof d||d(),u(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.A.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof A&&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.A.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=V(e),n=ve(e),i={customManifestLoader:e.manifestLoader},d={loadSegment:function(e,t,r,i,a){var o=ce(e,t.segment);return n(o,t,r,i,a)},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 d=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var c=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:c,protectionDataUpdate:!1}}var f=void 0!==n?j(d,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 v=f.nextSegments,p=f.chunkInfos,h=ee(d,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},c={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ce(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):de(s)?(0,z.Ay)({url:u,responseType:"arraybuffer",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,W.A)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,z.Ay)({url:u,responseType:"text",timeout:r.timeout,cancelSignal:i,onProgress:a.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,d=t.representation,c=t.segment,f=u.language,v=de(d),p=d.mimeType,h=void 0===p?"":p,m=d.codec,g=void 0===m?"":m,y=e.data,A=e.isChunked;if(c.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var _,b,S,E,T=null;if(v){var w;i=(w="string"==typeof y?(0,k.eb)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var I=void 0!==n?j(w,A,n,c,o.isLive):null;a=null==I?void 0:I.nextSegments,null===(T=null!==(r=null==I?void 0:I.chunkInfos)&&void 0!==r?r:null)?A?s.A.warn("Smooth: Unavailable time data for current text track."):(_=c.time,b=c.end):(_=T.time,b=void 0!==T.duration?T.time+T.duration:c.end);var x=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===x||"stpp.ttml"===x||"stpp.ttml.im1t"===x)E="ttml";else{if("wvtt"!==x)throw new Error("could not find a text-track parser for the type "+h);E="vtt"}var R=(0,l.j8)(w);S=null===R?"":(0,k.Es)(R)}else{var C;if(_=c.time,b=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,C=(0,k.Es)(M)}else C=y;switch(h){case"application/x-sami":case"application/smil":E="sami";break;case"application/ttml+xml":E="ttml";break;case"text/vtt":E="vtt"}if(void 0===E){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);E="srt"}S=C}return null!==T&&Array.isArray(a)&&a.length>0&&he(u,a,c),{segmentType:"media",chunkData:{type:E,data:S,start:_,end:b,language:f},chunkSize:i,chunkInfos:T,chunkOffset:null!=_?_:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;pe.test(e)?((0,K.A)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,z.Ay)({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=Promise.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.A)("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.A)(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,d=t(l,a,o);return{manifest:new u.Ay(d,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:d,video:d,text:c,image:{loadSegment:function(e,t,n,i,o){return(0,r.A)(a().mark((function r(){var s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s=t.segment,u=ce(e,s),!s.isInit&&null!==u){r.next=4;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return r.next=6,(0,z.Ay)({url:u,responseType:"arraybuffer",timeout:n.timeout,onProgress:o.onProgress,cancelSignal:i});case 6:return l=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:l});case 8: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.A.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.A.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]}}}}}},3233: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,{A:function(){return r}})},3598:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(1858),i=n(1688);function a(e,t){if(t){if((0,i.A)(e,1718909296)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.A)(e,1836019574)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.A)(e,1836019558)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.A)(e,1835295092)<0)throw new r.A("INTEGRITY_ERROR","Incomplete `mdat` box")}}},1688:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(5553);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.mq)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.CQ)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.mq)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},1856:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(2038),i=n(4389),a=n(7004);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n,a){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.Ay)({url:t,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:a});case"text":return(0,i.Ay)({url:t,responseType:"text",timeout:n.timeout,cancelSignal:a});case"document":return(0,i.Ay)({url:t,responseType:"document",timeout:n.timeout,cancelSignal:a});default:(0,r.A)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r,i){return new Promise((function(o,s){var u=Date.now()-performance.now(),l=!1,d=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled()){l=!0,i.deregister(c);var o=e,u=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.A(u,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(r=null==o?void 0:o.isOfflineError)&&void 0!==r&&r,null==o?void 0:o.xhr);s(d)}},resolve:function(e){if(!l&&!i.isCancelled()){l=!0,i.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-u:void 0,n=void 0!==e.sendingTime?e.sendingTime-u:void 0;o({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){l||i.isCancelled()||(l=!0,i.deregister(c),t(n,r,i).then(o,s))}},{timeout:r.timeout});function c(e){l||(l=!0,"function"==typeof d&&d(),s(e))}i.register(c)}))}}(n,o)}},987:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;if(e===t)return!0;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{A:function(){return r}})},1729: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,{A:function(){return r}})},3786: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,{A:function(){return r}})},4031: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,{A:function(){return r}})},7994:function(e,t,n){"use strict";n.d(t,{A:function(){return a},h:function(){return i}});var r=n(6787);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.A)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},2038:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(7387),i=function(e){function t(n){var r;return r=e.call(this,n)||this,Object.setPrototypeOf(r,t.prototype),r.name="AssertionError",r}return(0,r.A)(t,e),t}((0,n(8593).A)(Error));function a(e){throw new i("Unreachable path taken")}},603:function(e,t,n){"use strict";n.d(t,{K:function(){return u},i:function(){return s}});var r=n(9477),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.A.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),d=0,c=0;d<u;d+=4,c+=3)a=o(n.charCodeAt(d))<<18|o(n.charCodeAt(d+1))<<12|o(n.charCodeAt(d+2))<<6|o(n.charCodeAt(d+3)),l[c]=a>>16,l[c+1]=a>>8&255,l[c+2]=255&a;return l.subarray(0,l.length-s)}},5553: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 d(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 c(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 v(e){return new Uint8Array([255&e,e>>>8&255])}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}n.d(t,{AT:function(){return c},CQ:function(){return s},KS:function(){return l},Kk:function(){return d},UU:function(){return i},WO:function(){return v},Wz:function(){return p},eR:function(){return f},mq:function(){return o},tb:function(){return a},ww:function(){return u},xW:function(){return r}})},2432:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(4339);function i(e,t){return(0,r.A)(t,(function(t){var n=setTimeout((function(){return t()}),e);return function(){return clearTimeout(n)}}))}},4339:function(e,t,n){"use strict";function r(e,t){var n;return new Promise((function(r,i){if(null!==e.cancellationError)return i(e.cancellationError);var a=!1;function o(e){void 0!==n&&n(),i(e)}n=t((function(t){e.deregister(o),a=!0,r(t)}),(function(t){e.deregister(o),a=!0,i(t)})),a||e.register(o)}))}n.d(t,{A:function(){return r}})},79:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(9477),i=n(6787),a=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,i.A)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,i.A)(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){r.A.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}()},3262: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,{A:function(){return r}})},7021:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=.3;function i(e){return e*((2*Math.random()-1)*r+1)}},8795: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,{A:function(){return r}})},2384:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{A:function(){return r}})},6787:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{A:function(){return r}})},8202:function(e,t,n){"use strict";var r=n(4971);t.Ay=r.Ay},4971:function(e,t,n){"use strict";n.d(t,{Ay:function(){return d},BU:function(){return l},E4:function(){return u}});var r=n(2384),i=n(6787),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.A)(e)||""===e)return"und";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.A)(t)?t:e}function u(e){if(!(0,i.A)(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.A)(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 d=s},8060:function(e,t,n){"use strict";function r(){}n.d(t,{A:function(){return r}})},8935:function(e,t){"use strict";t.A="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}},4324:function(e,t,n){"use strict";t.A="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},3650:function(e,t,n){"use strict";n.d(t,{C$:function(){return y},D3:function(){return m},Hh:function(){return s},Nn:function(){return c},OT:function(){return p},Td:function(){return v},UL:function(){return h},aW:function(){return _},bo:function(){return b},eO:function(){return f},gV:function(){return u},vK:function(){return g}});var r=1/60;function i(e,t){return Math.abs(e-t)<r}function a(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function o(e,t){return e.end<=t.start}function s(e,t){for(var n=0;n<e.length;n++)if(u(e[n],t))return!0;return!1}function u(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function l(e,t){return u(e,t.start)||e.start<t.end&&t.end<e.end||u(t,e.start)}function d(e,t){return i(t.start,e.end)||i(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 f(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 v(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 h(e,t){var n=f(e,t);return null!==n?n.end-n.start:0}function m(e,t){var n=f(e,t);return null!==n?t-n.start:0}function g(e,t){var n=f(e,t);return null!==n?n.end-t:1/0}function y(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var i=e[r],s=l(n,i),u=d(n,i);if(s||u)n=a(n,i),e.splice(r--,1);else if(0===r){if(o(n,e[0]))break}else if(o(e[r-1],n)&&o(n,i))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(d(n,r)){var i=a(n,r);e.splice(--t,2,i)}}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 A(e,t){for(var n=[],r=0;r<t.length;r++)l(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=A(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=A(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,d=0;d<a.length;d++)a[d].start>l&&n.push({start:l,end:a[d].start}),l=a[d].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},8315:function(e,t,n){"use strict";n.d(t,{D:function(){return u}});var r=n(3786),i=n(8060);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){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(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=Array(t);n<t;n++)r[n]=e[n];return r}var s=function(){function e(e,t){var n=this;this._value=e,this._listeners=[],this._isFinished=!1,this._onFinishCbs=[],void 0!==t&&(this._deregisterCancellation=t.register((function(){return n.finish()})))}var t=e.prototype;return t.getValue=function(){return this._value},t.setValue=function(e){if(!this._isFinished&&(this._value=e,0!==this._listeners.length))for(var t,n=a(this._listeners.slice());!(t=n()).done;){var r=t.value;try{r.hasBeenCleared||r.trigger(e,r.complete)}catch(e){}}},t.setValueIfChanged=function(e){e!==this._value&&this.setValue(e)},t.onUpdate=function(e,t){var n=this,r=function e(){if(void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.deregister(e),!i.hasBeenCleared){i.hasBeenCleared=!0;var r=n._listeners.indexOf(i);r>=0&&n._listeners.splice(r,1)}},i={trigger:e,complete:r,hasBeenCleared:!1};this._listeners.push(i),!0===(null==t?void 0:t.emitCurrentValue)&&e(this._value,r),this._isFinished||i.hasBeenCleared?r():void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.register(r)},t.waitUntilDefined=function(e,t){var n=this;this.onUpdate((function(t,r){void 0!==t&&(r(),e(n._value))}),{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:!0})},t._onFinished=function(e,t){var n=this;if(t.isCancelled())return i.A;var a=function(){var e=(0,r.A)(n._onFinishCbs,(function(e){return e.trigger===o}));e>=0&&(n._onFinishCbs[e].hasBeenCleared=!0,n._onFinishCbs.splice(e,1))},o=function(){a(),e()},s=t.register(a);return this._onFinishCbs.push({trigger:o,hasBeenCleared:!1}),s},t.finish=function(){void 0!==this._deregisterCancellation&&this._deregisterCancellation(),this._isFinished=!0;for(var e,t=a(this._listeners.slice());!(e=t()).done;){var n=e.value;try{n.hasBeenCleared||(n.complete(),n.hasBeenCleared=!0)}catch(e){}}if(this._listeners.length=0,this._onFinishCbs.length>0){for(var r,i=a(this._onFinishCbs.slice());!(r=i()).done;){var o=r.value;try{o.hasBeenCleared||(o.trigger(),o.hasBeenCleared=!0)}catch(e){}}this._onFinishCbs.length=0}},e}();function u(e,t,n){var r=new s(t(e.getValue()),n);return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),e._onFinished((function(){r.finish()}),n),r}t.A=s},4389:function(e,t,n){"use strict";n.d(t,{Ay:function(){return o}});var r=n(3506),i=n(2384),a=n(6787);var o=function(e){var t={url:e.url,headers:e.headers,responseType:(0,a.A)(e.responseType)?"json":e.responseType,timeout:e.timeout};return new Promise((function(n,o){var s,u=e.onProgress,l=e.cancelSignal,d=t.url,c=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",d,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){A(),o(new r.A(d,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.A)(c)){var h=c;for(var m in h)h.hasOwnProperty(m)&&p.setRequestHeader(m,h[m])}var g=performance.now(),y=null;function A(){void 0!==s&&clearTimeout(s),null!==y&&y()}void 0!==l&&(y=l.register((function(e){A(),(0,a.A)(p)||4===p.readyState||p.abort(),o(e)})),l.isCancelled())||(p.onerror=function(){A(),o(new r.A(d,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){A(),o(new r.A(d,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:d,duration:t-g,sendingTime:g,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(A(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,l=p.status,c=p.responseType,f=(0,i.A)(p.responseURL)?p.responseURL:d;if(t="json"===c?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,a.A)(t))return void o(new r.A(d,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:c,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.A(d,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},2716:function(e,t,n){"use strict";n.d(t,{Cl:function(){return o}});var r=n(9828),i=/^(?:[a-z]+:)?\/\//i,a=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;function o(e){var t=e.lastIndexOf("/");if(t<0)return e.length;if(i.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e.length}var r=e.indexOf("?");return r>=0&&r<t?o(e.substring(0,r)):t+1}var s=new Map,u=200;function l(e){var t,n,r,i,o;if(s.has(e))return s.get(e);var l,d=e.match(a);return l=null===d?{scheme:"",authority:"",path:"",query:"",fragment:""}:{scheme:null!==(t=d[1])&&void 0!==t?t:"",authority:null!==(n=d[2])&&void 0!==n?n:"",path:null!==(r=d[3])&&void 0!==r?r:"",query:null!==(i=d[4])&&void 0!==i?i:"",fragment:null!==(o=d[5])&&void 0!==o?o:""},s.size>=u&&s.clear(),s.set(e,l),l}function d(e){var t="";return e.scheme&&(t+=e.scheme+":"),e.authority&&(t+="//"+e.authority),t+=e.path,e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function c(e){for(var t=e.split(/(?=\/)/),n=[],r=0;r<t.length;r++){var i=t[r];".."!==i&&"."!==i&&""!==i&&("/.."!==i?"/."!==i?n.push(i):r===t.length-1&&n.push("/"):(n.pop(),r===t.length-1&&n.push("/")))}return n.join("")}t.Ay=function e(){for(var t,n,i,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var u=o.filter((function(e){return""!==e})),f=u.length;if(0===f)return"";if(1===f)return null!==(t=u[0])&&void 0!==t?t:"";var v=function(e,t){var n=l(e),i=l(t);if(i.scheme)return d(i);var a={scheme:n.scheme,authority:n.authority,path:"",query:i.query,fragment:i.fragment};return i.authority?(a.authority=i.authority,a.path=c(i.path),d(a)):(""===i.path?(a.path=n.path,i.query||(a.query=n.query)):(0,r.A)(i.path,"/")?a.path=c(i.path):a.path=c(function(e,t){if(e.authority&&""===e.path)return"/"+t;var n=e.path;return n.substring(0,n.lastIndexOf("/")+1)+t}(n,i.path)),d(a))}(null!==(n=u[0])&&void 0!==n?n:"",null!==(i=u[1])&&void 0!==i?i:""),p=u.slice(2);return e.apply(void 0,[v].concat(p))}},8801:function(e,t,n){"use strict";function r(e){return new Promise((function(t){setTimeout(t,e)}))}n.d(t,{A:function(){return r}})},7296:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(1729),i=n(4031),a=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.toArray=function(){return this._array.slice()},t.findFirst=function(e){return(0,r.A)(this._array,e)},t.has=function(e){return(0,i.A)(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}()},9828: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,{A:function(){return r}})},4670:function(e,t,n){"use strict";n.d(t,{Es:function(){return c},KZ:function(){return p},My:function(){return v},Yg:function(){return u},Yn:function(){return h},aT:function(){return f},eb:function(){return l},kY:function(){return s}});var r=n(9477),i=n(7994),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){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var d=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(d),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var c=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(c),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function d(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function c(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.A.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=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}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+d(l,4):"%"+d(l,2)}}return decodeURIComponent(i)}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 v(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 p(e){(0,i.h)(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],d=new Uint8Array(16);return d[0]=a,d[1]=r,d[2]=n,d[3]=t,d[4]=s,d[5]=o,d[6]=l,d[7]=u,d.set(e.subarray(8,16),8),d}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:c(e.subarray(t,n))}}},2507:function(e,t,n){"use strict";n.d(t,{AK:function(){return l},AL:function(){return d},Ay:function(){return u}});var r=n(7387),i=n(8593),a=n(9477),o=n(7994),s=n(8060),u=function(){function e(){var e,t=(e=s.A,[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)}var t=e.prototype;return t.isUsed=function(){return this._isUsed},t.linkToSignal=function(e){var t=this,n=e.register((function(){t.cancel()}));return this.signal.register(n),n},t.cancel=function(e){if(!this._isUsed){this._isUsed=!0;var t=null!=e?e:new d;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof d},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;)try{var n=t._listeners.pop();null==n||n(e)}catch(e){a.A.error("Error while calling clean up listener",e instanceof Error?e.toString():"Unknown error")}}))}var t=e.prototype;return t.isCancelled=function(){return this._isCancelled},t.register=function(e){var t=this;return this._isCancelled?((0,o.h)(null!==this.cancellationError),e(this.cancellationError),s.A):(this._listeners.push(e),function(){return t.deregister(e)})},t.deregister=function(e){for(var t=this._listeners.length-1;t>=0;t--)this._listeners[t]===e&&this._listeners.splice(t,1)},e}(),d=function(e){function t(){var n;return n=e.call(this,"This task was cancelled.")||this,Object.setPrototypeOf(n,t.prototype),n.name="CancellationError",n}return(0,r.A)(t,e),t}((0,i.A)(Error))},5950:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(4031),i=[];function a(e){(0,r.A)(i,e)||(console.warn(e),i.push(e))}},6826: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}()},4633:function(e,t,n){var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof _?t:_,a=Object.create(i.prototype),o=new D(r||[]);return s(a,"_invoke",{value:R(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=v;var h="suspendedStart",m="suspendedYield",g="executing",y="completed",A={};function _(){}function b(){}function S(){}var E={};f(E,l,(function(){return this}));var T=Object.getPrototypeOf,w=T&&T(T(N([])));w&&w!==a&&o.call(w,l)&&(E=w);var k=S.prototype=_.prototype=Object.create(E);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,a,s,u){var l=p(e[i],e,a);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==r(c)&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(c).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value: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 R(e,n,r){var i=h;return function(a,o){if(i===g)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=C(s,r);if(u){if(u===A)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=g;var l=p(e,n,r);if("normal"===l.type){if(i=r.done?y:m,l.arg===A)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),A;var a=p(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,A;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,A):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function M(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 P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=S,s(k,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:b,configurable:!0}),b.displayName=f(S,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,f(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},I(x.prototype),f(x.prototype,d,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new x(v(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},I(k),f(k,c,"Generator"),f(k,l,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=N,D.prototype={constructor:D,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(P),!e)for(var n in this)"t"===n.charAt(0)&&o.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 r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,A):this.complete(a)},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),A},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),P(n),A}},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;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),A}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:function(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},467: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,{A:function(){return i}})},2212:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function a(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,i(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{A:function(){return o}})},7387:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(3662);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}},3662:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:function(){return r}})},8593:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:function(){return o}});var i=n(3662);function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;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,n)}function n(){return function(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&(0,i.A)(o,n.prototype),o}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.A)(n,e)},o(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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return _e}});var e=n(2212),t=n(7387),i=n(5121);function a(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function o(){if(s()){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 s(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var u=n(443),l=n(9477);function d(){if(!u.gm)return!0;var e=function(){if(!u.gm)return l.A.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 c=n(5151),f=n(874),v=n(5575),p=n(5497),h=n(6787),m=n(8589);var g=n(418),y=n(987),A=n(4031),_=n(7994),b=n(79),S=n(8795),E=n(8935),T=n(3650),w=n(8315),k=n(2507),I=n(5950),x=n(467),R=n(4756),C=n.n(R),M=n(8801),P=n(7365);function D(e){return N.apply(this,arguments)}function N(){return(N=(0,x.A)(C().mark((function e(t){var n,r;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=P.A.getState(t))){e.next=3;break}return e.abrupt("return",void 0);case 3:return l.A.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,P.A.clearState(t),e.next=8,r.closeAllSessions();case 8:return e.abrupt("return",Promise.race([n.emeImplementation.setMediaKeys(t,null).catch((function(e){l.A.error("DRM: Could not reset MediaKeys",e instanceof Error?e:"Unknown Error")})),(0,M.A)(1e3)]));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(5283);function L(e){if(l.A.info("DRM: Clearing-up DRM session."),u.lw)return l.A.info("DRM: disposing current MediaKeys."),D(e);var t=P.A.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(l.A.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(l.A.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var U=n(4971);function B(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){if("string"==typeof e)return F(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}(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 F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V=n(8060),z=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],K=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new k.Ay,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getPlaybackRate=function(){return this._mediaElement.playbackRate},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeeksIncoming.push(e),l.A.info("API: Seeking internally",e),this._mediaElement.currentTime=e},t.setPlaybackRate=function(e){this._mediaElement.playbackRate=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed()||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled()))return V.A;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return H(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=c.A.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r,i=n;"seeking"===i&&t._internalSeeksIncoming.length>0&&(i="internal-seeking",r=t._internalSeeksIncoming.shift());var a=null!=e?e:t._generateInitialObservation(),o=G(t._mediaElement,i,t._withMediaSource),s=null;o.seeking&&("number"==typeof r?s=r:null!==a.pendingInternalSeek&&"seeking"!==n&&(s=a.pendingInternalSeek));var u=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=c.A.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,d=t.bufferGap,f=t.currentRange,v=t.duration,p=t.paused,h=t.readyState,m=t.ended,g=e.rebuffering,y=e.event,A=e.position,_=function(e,t,n,r,i){var a=c.A.getCurrent().REBUFFERING_GAP,o=i?"LOW_LATENCY":"DEFAULT";if(void 0===t)return n&&Math.abs(r-e)<=a[o];return null!==t&&r-t.end<=a[o]}(l,f,m,v,o),b=h>=1&&"loadedmetadata"!==u&&null===g&&!(_||m),S=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)d===1/0?(r=!0,S=l):void 0===d?h<3&&(r=!0,S=void 0):d<=E&&(r=!0,S=l+d);else if(null!==g){var T=W(g,o);!0!==r&&null!==g&&h>1&&(_||m||void 0!==d&&isFinite(d)&&d>T)||void 0===d&&h>=3?i=!0:void 0===d?S=void 0:d===1/0?S=l:d<=T&&(S=l+d)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===y&&l===A||"seeking"===u&&(d===1/0||void 0===d&&h<3))?r=!0:null!==g&&("seeking"!==u&&l!==A||"canplay"===u||void 0===d&&h>=3||void 0!==d&&d<1/0&&(d>W(g,o)||_||m))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==g)return w="seeking"===u||null!==g&&"seeking"===g.reason||t.seeking?"seeking":1===h?"not-ready":"buffering",null!==g&&g.reason===w?{reason:g.reason,timestamp:g.timestamp,position:S}:{reason:w,timestamp:performance.now(),position:S};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),d=function(e,t){var n=c.A.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&&void 0!==t.bufferGap&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(a,o),f=(0,E.A)({},{rebuffering:u,freezing:d,pendingInternalSeek:s},o);return l.A.hasLevel("DEBUG")&&l.A.debug("API: current media element state tick","event",f.event,"position",f.position,"seeking",f.seeking,"internalSeek",f.pendingInternalSeek,"rebuffering",null!==f.rebuffering,"freezing",null!==f.freezing,"ended",f.ended,"paused",f.paused,"playbackRate",f.playbackRate,"readyState",f.readyState),f},s=new w.A(o("init"),this._canceller.signal),u=function(t){var n=o(t);l.A.hasLevel("DEBUG")&&l.A.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 d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i<e.length-1){var c=e.start(i+1),f=" ~"+(c-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<c){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},d=this._lowLatencyMode?i:this._withMediaSource?r:a,f=setInterval(p,d),v=z.map((function(e){function n(){clearInterval(f),f=setInterval(p,d),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(f),v.forEach((function(e){return e()})),s.finish()})),s;function p(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,E.A)(G(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function W(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=c.A.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 G(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,d=e.playbackRate,c=e.readyState,f=e.seeking;return!n&&0===a.length&&c>=3?(r=void 0,i=void 0):i=null!==(r=(0,T.eO)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:d,readyState:c,seeking:f,event:t}}function H(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getPlaybackRate:function(){return e.getPlaybackRate()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled()||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled())||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return H(this,e,n)}}}var q=n(1729),j=n(8202),Y=n(7296);function Q(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,j.Ay)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function X(e){return e.map((function(e){return null===e?e:{normalized:(0,j.Ay)(e.language),forced:e.forced,closedCaption:e.closedCaption}}))}var $=function(){function e(e){this._periods=new Y.A((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=ie(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void l.A.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptationRef:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptationRef: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)):l.A.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else l.A.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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(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.adaptationRef.setValue(null);else if(void 0!==i&&(0,A.A)(r,i))n.adaptationRef.setValue(i);else{var a=J(r,Q(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(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.adaptationRef.setValue(null);else if(void 0!==i&&(0,A.A)(r,i))n.adaptationRef.setValue(i);else{var a=te(r,X(this._preferredTextTracks),this._audioChoiceMemory.get(e));this._textChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.A)(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,A.A)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=re(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptationRef.setValue(null);var o=ae(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptationRef.setValue(o)},t.setAudioTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.audio:null;if((0,h.A)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,q.A)(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.adaptationRef.setValue(i))},t.setTextTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.text:null;if((0,h.A)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,q.A)(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.adaptationRef.setValue(i))},t.setVideoTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.A)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,q.A)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ae(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptationRef.setValue(a)},t.disableTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptationRef.setValue(null))},t.disableVideoTrack=function(e){var t=ie(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.adaptationRef.setValue(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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(n))return null;var r=this._audioChoiceMemory.get(e);return(0,h.A)(r)?null:r.toAudioTrack()},t.getChosenTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))return null;var r=this._textChoiceMemory.get(e);return(0,h.A)(r)?null:r.toTextTrack()},t.getChosenVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.A)(n))return null;var r=this._videoChoiceMemory.get(e);return(0,h.A)(r)?null:r.adaptation.toVideoTrack()},t.getAvailableAudioTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.A)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,h.A)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.A)(e.toAudioTrack(),{active:t})}))},t.getAvailableTextTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.A)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,h.A)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.A)(e.toTextTrack(),{active:t})}))},t.getAvailableVideoTracks=function(e){var t,n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.A)(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=null!==a&&a===e.id,n=e.toVideoTrack(),r=void 0!==n.trickModeTracks?n.trickModeTracks.map((function(e){var t=null!==a&&a===e.id;return(0,E.A)(e,{active:t})})):[],i=(0,E.A)(n,{active:t});return void 0!==r&&(i.trickModeTracks=r),i}))},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=Q(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.A)(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,A.A)(s,u))n(r+1);else{var l=J(s,t);e._audioChoiceMemory.set(a,l),o.adaptationRef.setValue(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=X(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.A)(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,A.A)(s,u))n(r+1);else{var l=te(s,t,e._audioChoiceMemory.get(a));e._textChoiceMemory.set(a,l),o.adaptationRef.setValue(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,h.A)(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,A.A)(s,u.baseAdaptation)){var l=ae(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptationRef.setValue(l),n(0))}var d=re(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptationRef.setValue(null),n(0);var c=ae(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptationRef.setValue(c),n(0)}n(r+1)}}}(0)},e}();function Z(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 J(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=Z(r),a=(0,q.A)(e,i);if(void 0!==a)return a}return e[0]}function ee(e){return function(t){var n;return(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)&&(!0===e.forced?!0===t.isForcedSubtitles:!0!==t.isForcedSubtitles)}}function te(e,t,n){var r;if(0===e.length)return null;for(var i=0;i<t.length;i++){var a=t[i];if(null===a)return null;var o=ee(a),s=(0,q.A)(e,o);if(void 0!==s)return s}var u=e.filter((function(e){return!0===e.isForcedSubtitles}));if(u.length>0){if(null!=n){var l=(0,q.A)(u,(function(e){return e.normalizedLanguage===n.normalizedLanguage}));if(void 0!==l)return l}return null!==(r=(0,q.A)(u,(function(e){return void 0===e.normalizedLanguage})))&&void 0!==r?r:null}return null}function ne(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 re(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=ne(r),a=(0,q.A)(e,i);if(void 0!==a)return a}return e[0]}function ie(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ae(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}function oe(e,t){var n=c.A.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return"ENDED";if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?"ENDED":"seeking"===t?"SEEKING":"BUFFERING"}return e.paused?"PAUSED":"PLAYING"}function se(e){return"LOADING"!==e&&"RELOADING"!==e&&"STOPPED"!==e}function ue(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){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}(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 le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var de=(0,S.A)(),ce=i.Sb,fe=i.o8,ve=i.ng,pe=i.Vb,he=i.rR,me=i.Ah,ge=i.c_,ye=function(n){function r(e){var t,i,a;void 0===e&&(e={}),t=n.call(this)||this;var o=function(e){var t,n,r,i,a,o,s,u,l,d,f,v,p,m,g,y,A=c.A.getCurrent(),_=A.DEFAULT_INITIAL_BITRATES,b=A.DEFAULT_LIMIT_VIDEO_WIDTH,S=A.DEFAULT_MIN_BITRATES,E=A.DEFAULT_MAX_BITRATES,T=A.DEFAULT_MAX_BUFFER_AHEAD,w=A.DEFAULT_MAX_BUFFER_BEHIND,k=A.DEFAULT_MAX_VIDEO_BUFFER_SIZE,x=A.DEFAULT_STOP_AT_END,R=A.DEFAULT_THROTTLE_WHEN_HIDDEN,C=A.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,M=A.DEFAULT_WANTED_BUFFER_AHEAD;if((0,h.A)(e.maxBufferAhead))t=T;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,h.A)(e.maxBufferBehind))n=w;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,h.A)(e.wantedBufferAhead))r=M;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,h.A)(e.maxVideoBufferSize))i=k;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var P=(0,h.A)(e.limitVideoWidth)?b:!!e.limitVideoWidth;if((0,h.A)(e.throttleWhenHidden)?a=R:((0,I.A)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,h.A)(e.throttleVideoBitrateWhenHidden)?C:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,I.A)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,I.A)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,I.A)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,h.A)(e.videoElement))d=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");d=e.videoElement}if((0,h.A)(e.initialVideoBitrate))f=_.video;else if(f=Number(e.initialVideoBitrate),isNaN(f))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,h.A)(e.initialAudioBitrate))v=_.audio;else if(v=Number(e.initialAudioBitrate),isNaN(v))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,h.A)(e.minVideoBitrate))m=S.video;else if(m=Number(e.minVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,h.A)(e.minAudioBitrate))p=S.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,h.A)(e.maxVideoBitrate))y=E.video;else{if(y=Number(e.maxVideoBitrate),isNaN(y))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(m>y)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+y+'", is inferior to the set minVideoBitrate, "'+m+'"')}if((0,h.A)(e.maxAudioBitrate))g=E.audio;else{if(g=Number(e.maxAudioBitrate),isNaN(g))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>g)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+g+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:P,videoElement:d,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:v,initialVideoBitrate:f,minAudioBitrate:p,minVideoBitrate:m,maxAudioBitrate:g,maxVideoBitrate:y,stopAtEnd:(0,h.A)(e.stopAtEnd)?x:!!e.stopAtEnd}}(e),s=o.initialAudioBitrate,u=o.initialVideoBitrate,d=o.limitVideoWidth,f=o.minAudioBitrate,v=o.minVideoBitrate,p=o.maxAudioBitrate,m=o.maxBufferAhead,g=o.maxBufferBehind,y=o.maxVideoBitrate,A=o.preferredAudioTracks,_=o.preferredTextTracks,b=o.preferredVideoTracks,S=o.throttleWhenHidden,E=o.throttleVideoBitrateWhenHidden,T=o.videoElement,x=o.wantedBufferAhead,R=o.maxVideoBufferSize,C=o.stopAtEnd,M=c.A.getCurrent().DEFAULT_UNMUTED_VOLUME;T.preload="auto",t.version="3.33.4",t.log=l.A,t.state="STOPPED",t.videoElement=T,r._priv_registerVideoElement(t.videoElement);var P=new k.Ay;t._destroyCanceller=P,t._priv_pictureInPictureRef=fe(T,P.signal),he(T,(function(){t.trigger("fullscreenChange",t.isFullscreen())}),P.signal);for(var D=[],N=0;N<(null===(i=T.textTracks)||void 0===i?void 0:i.length);N++){var O=null===(a=T.textTracks)||void 0===a?void 0:a[N];(0,h.A)(O)||D.push(O)}var L=function(e){for(var n=e.target,r=[],i=0;i<n.length;i++){var a=n[i];r.push(a)}var o=D;if(D=r,o.length===r.length){for(var s=0;s<o.length;s++)if(o[s]!==r[s])return void t._priv_onNativeTextTracksNext(r)}else t._priv_onNativeTextTracksNext(r)};return(0,h.A)(T.textTracks)||(me(T.textTracks,L,P.signal),ge(T.textTracks,L,P.signal)),t._priv_speed=new w.A(T.playbackRate,t._destroyCanceller.signal),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=new w.A(!1,t._destroyCanceller.signal),t._priv_bufferOptions={wantedBufferAhead:new w.A(x,t._destroyCanceller.signal),maxBufferAhead:new w.A(m,t._destroyCanceller.signal),maxBufferBehind:new w.A(g,t._destroyCanceller.signal),maxVideoBufferSize:new w.A(R,t._destroyCanceller.signal)},t._priv_bitrateInfos={lastBitrates:{audio:s,video:u},minAutoBitrates:{audio:new w.A(f,t._destroyCanceller.signal),video:new w.A(v,t._destroyCanceller.signal)},maxAutoBitrates:{audio:new w.A(p,t._destroyCanceller.signal),video:new w.A(y,t._destroyCanceller.signal)},manualBitrates:{audio:new w.A(-1,t._destroyCanceller.signal),video:new w.A(-1,t._destroyCanceller.signal)}},t._priv_throttleWhenHidden=S,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=M,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=C,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=A,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t._priv_lastAutoPlay=!1,t}(0,t.A)(r,n),r.addFeatures=function(e){!function(e){for(var t=0;t<e.length;t++){var n=e[t];if("function"==typeof n)n(m.A);else{if((0,h.A)(n)||"function"!=typeof n._addFeature)throw new Error("Unrecognized feature");n._addFeature(m.A)}}}(e)},r._priv_registerVideoElement=function(e){if(r._priv_currentlyUsedVideoElements.has(e)){console.warn("The video element is already attached to another RxPlayer instance.\nMake sure to dispose the previous instance with player.dispose() before creating a new player instance attaching that video element.")}r._priv_currentlyUsedVideoElements.add(e)},r._priv_deregisterVideoElement=function(e){r._priv_currentlyUsedVideoElements.has(e)&&r._priv_currentlyUsedVideoElements.delete(e)};var i=r.prototype;return i.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},i.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},i.dispose=function(){this.stop(),null!==this.videoElement&&(r._priv_deregisterVideoElement(this.videoElement),D(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.A.error("API: Could not dispose decryption resources: "+t)}))),this._destroyCanceller.cancel(),this._priv_reloadingMetadata={},this.videoElement=null},i.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,d,f,v,p,m,g,y,_=c.A.getCurrent(),b=_.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,S=_.DEFAULT_AUTO_PLAY,T=_.DEFAULT_CODEC_SWITCHING_BEHAVIOR,w=_.DEFAULT_ENABLE_FAST_SWITCHING,k=_.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,x=_.DEFAULT_SHOW_NATIVE_SUBTITLE,R=_.DEFAULT_TEXT_TRACK_MODE;if((0,h.A)(e))throw new Error("No option set on loadVideo");if((0,h.A)(e.url)){if((0,h.A)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,h.A)(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 f=String(e.url);if((0,h.A)(e.transport))throw new Error("No transport set on loadVideo");v=String(e.transport),(0,h.A)(null===(r=e.transportOptions)||void 0===r?void 0:r.aggressiveMode)||(0,I.A)("`transportOptions.aggressiveMode` is deprecated and won't be present in the next major version. Please open an issue if you still need this.");var C=(0,h.A)(e.autoPlay)?S:!!e.autoPlay;if((0,h.A)(e.keySystems))p=[];else for(var M,P=B(p=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(M=P()).done;){var D=M.value;if("string"!=typeof D.type||"function"!=typeof D.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback");(0,h.A)(D.onKeyStatusesChange)||(0,I.A)("`keySystems[].onKeyStatusesChange` is deprecated and won't be present in the next major version. Please open an issue if you still need this."),(0,h.A)(D.throwOnLicenseExpiration)||(0,I.A)("`keySystems[].throwOnLicenseExpiration` is deprecated and won't be present in the next major version. Please open an issue if you still need this.")}var N=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,O="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},L=null===(i=e.transportOptions)||void 0===i?void 0:i.initialManifest,F=null!==(o=null===(a=e.transportOptions)||void 0===a?void 0:a.minimumManifestUpdateInterval)&&void 0!==o?o:0,V=(0,h.A)(e.audioTrackSwitchingMode)?b:e.audioTrackSwitchingMode;(0,A.A)(["seamless","direct","reload"],V)||(l.A.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+b+" strategy will be used as default"),V=b);var z=(0,h.A)(e.onCodecSwitch)?T:e.onCodecSwitch;(0,A.A)(["continue","reload"],z)||(l.A.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+T+" will be used as default"),z=T);var K=(0,E.A)({},O,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:N});if(delete K.initialManifest,delete K.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,I.A)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var W,G=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],H=B(G);!(W=H()).done;){var q=W.value;if("string"!=typeof q.language||"string"!=typeof q.mimeType||"string"!=typeof q.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}K.supplementaryTextTracks=G}if(void 0!==e.supplementaryImageTracks){(0,I.A)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var j,Y=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],Q=B(Y);!(j=Q()).done;){var X=j.value;if("string"!=typeof X.mimeType||"string"!=typeof X.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}K.supplementaryImageTracks=Y}if((0,h.A)(null===(s=e.transportOptions)||void 0===s?void 0:s.manifestUpdateUrl)||(0,I.A)("`manifestUpdateUrl` API is deprecated, please open an issue if you still rely on this."),(0,h.A)(e.textTrackMode))m=R;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");m=e.textTrackMode}(0,h.A)(e.defaultAudioTrack)||(0,I.A)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var $=(0,U.BU)(e.defaultAudioTrack);(0,h.A)(e.defaultTextTrack)||(0,I.A)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var Z=(0,U.E4)(e.defaultTextTrack),J=!x;(0,h.A)(e.hideNativeSubtitle)||((0,I.A)("The `hideNativeSubtitle` loadVideo option is deprecated"),J=!!e.hideNativeSubtitle);var ee=null!==(u=e.manualBitrateSwitchingMode)&&void 0!==u?u:k,te=(0,h.A)(e.enableFastSwitching)?w:e.enableFastSwitching;if("html"===m){if((0,h.A)(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.");g=e.textTrackElement}else(0,h.A)(e.textTrackElement)||l.A.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,h.A)(e.startAt))if("wallClockTime"in e.startAt&&e.startAt.wallClockTime instanceof Date){var ne=e.startAt.wallClockTime.getTime()/1e3;y=(0,E.A)({},e.startAt,{wallClockTime:ne})}else y=e.startAt;return{autoPlay:C,defaultAudioTrack:$,defaultTextTrack:Z,enableFastSwitching:te,hideNativeSubtitle:J,keySystems:p,initialManifest:L,lowLatencyMode:N,manualBitrateSwitchingMode:ee,audioTrackSwitchingMode:V,minimumManifestUpdateInterval:F,networkConfig:null!==(d=e.networkConfig)&&void 0!==d?d:{},onCodecSwitch:z,startAt:y,textTrackElement:g,textTrackMode:m,transport:v,transportOptions:K,url:f}}(e);l.A.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t),this._priv_lastAutoPlay=t.autoPlay},i.reload=function(e){var t,n,r,i,a,o,s=this._priv_reloadingMetadata,u=s.options,l=s.manifest,d=s.reloadPosition,c=s.reloadInPause;if(void 0===u)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.");if(!Array.isArray(null==e?void 0:e.keySystems)&&void 0!==(null==e?void 0:e.keySystems))throw new Error("API: reload - Invalid 'keySystems' option format.");if(void 0!==(null==e?void 0:e.autoPlay)&&"boolean"!=typeof e.autoPlay)throw new Error("API: reload - Invalid 'autoPlay' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))i={position:e.reloadAt.position};else if(void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.relative)){if(void 0===d)throw new Error("Can't reload to a relative position when previous content was not loaded.");i={position:e.reloadAt.relative+d}}else void 0!==d&&(i={position:d});void 0!==(null==e?void 0:e.autoPlay)?a=e.autoPlay:void 0!==c&&(a=!c),void 0!==(null==e?void 0:e.keySystems)?o=e.keySystems:void 0!==(null===(r=this._priv_reloadingMetadata.options)||void 0===r?void 0:r.keySystems)&&(o=this._priv_reloadingMetadata.options.keySystems);var f=Object.assign(Object.assign({},u),{initialManifest:l});void 0!==i&&(f.startAt=i),void 0!==a&&(f.autoPlay=a),void 0!==o&&(f.keySystems=o),this._priv_initializeContentPlayback(f)},i.createDebugElement=function(e){if(null===g.A.createDebugElement)throw new Error("Feature `DEBUG_ELEMENT` not added to the RxPlayer");var t=new k.Ay;return g.A.createDebugElement(e,this,t.signal),{dispose:function(){t.cancel()}}},i._priv_initializeContentPlayback=function(e){var t=this,n=e.autoPlay,r=e.audioTrackSwitchingMode,i=e.defaultAudioTrack,a=e.defaultTextTrack,o=e.enableFastSwitching,s=e.initialManifest,u=e.keySystems,c=e.lowLatencyMode,v=e.manualBitrateSwitchingMode,p=e.minimumManifestUpdateInterval,m=e.networkConfig,y=e.onCodecSwitch,_=e.startAt,b=e.transport,S=e.transportOptions,T=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var I,x="directfile"===b,R=new k.Ay,C=this.videoElement,M=null;if(x){if(null===g.A.directfile)throw this.stop(),this._priv_currentError=null,new Error("DirectFile feature not activated in your build.");if((0,h.A)(T))throw new Error("No URL for a DirectFile content");if(M=this._priv_initializeMediaElementTrackChoiceManager(i,a,R.signal),R.isUsed())return;I=new g.A.directfile.initDirectFile({autoPlay:n,keySystems:u,speed:this._priv_speed,startAt:_,url:T})}else{var P=g.A.transports[b];if("function"!=typeof P)throw this.stop(),this._priv_currentError=null,new Error('transport "'+b+'" not supported');if(null===g.A.mediaSourceInit)throw new Error("MediaSource streaming not supported");var D=P(S),N=m.offlineRetry,O=m.segmentRetry,L=m.manifestRetry,U=m.manifestRequestTimeout,B=m.segmentRequestTimeout,F={lowLatencyMode:c,maxRetryRegular:L,maxRetryOffline:N,requestTimeout:U,minimumManifestUpdateInterval:p,initialManifest:s},V=d(),z={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(V?z.throttle={video:(0,w.D)(ce(R.signal),(function(e){return e?1/0:0}),R.signal)}:l.A.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(V?z.throttleBitrate={video:(0,w.D)(ve(this._priv_pictureInPictureRef,R.signal),(function(e){return e?1/0:0}),R.signal)}:l.A.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(V?z.limitWidth={video:pe(C,this._priv_pictureInPictureRef,R.signal)}:l.A.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var W={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:c,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:z},G="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},H=(0,E.A)({audioTrackSwitchingMode:r,enableFastSwitching:o,manualBitrateSwitchingMode:v,onCodecSwitch:y},this._priv_bufferOptions),q={lowLatencyMode:c,maxRetryRegular:O,requestTimeout:B,maxRetryOffline:N};I=new g.A.mediaSourceInit({adaptiveOptions:W,autoPlay:n,bufferOptions:H,keySystems:u,lowLatencyMode:c,manifestRequestSettings:F,transport:D,segmentRequestOptions:q,speed:this._priv_speed,startAt:_,textTrackOptions:G,url:T})}var j={contentId:de(),originalUrl:T,currentContentCanceller:R,initializer:I,isDirectFile:x,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:i,initialTextTrack:a,trackChoiceManager:null,mediaElementTrackChoiceManager:M};I.addEventListener("error",(function(e){var n=(0,f.A)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});n.fatal=!0,j.currentContentCanceller.cancel(),t._priv_cleanUpCurrentContentState(),t._priv_currentError=n,l.A.error("API: The player stopped because of an error",e instanceof Error?e:""),t._priv_setPlayerState("STOPPED"),t._priv_currentError===n&&t.trigger("error",n)})),I.addEventListener("warning",(function(e){var n=(0,f.A)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});l.A.warn("API: Sending warning:",n),t.trigger("warning",n)})),I.addEventListener("reloadingMediaSource",(function(e){j.segmentBuffersStore=null,null!==j.trackChoiceManager&&j.trackChoiceManager.resetPeriods(),t._priv_lastAutoPlay=e.autoPlay})),I.addEventListener("inbandEvents",(function(e){return t.trigger("inbandEvents",e)})),I.addEventListener("streamEvent",(function(e){return t.trigger("streamEvent",e)})),I.addEventListener("streamEventSkip",(function(e){return t.trigger("streamEventSkip",e)})),I.addEventListener("decipherabilityUpdate",(function(e){return t.trigger("decipherabilityUpdate",e)})),I.addEventListener("activePeriodChanged",(function(e){return t._priv_onActivePeriodChanged(j,e)})),I.addEventListener("periodStreamReady",(function(e){return t._priv_onPeriodStreamReady(j,e)})),I.addEventListener("periodStreamCleared",(function(e){return t._priv_onPeriodStreamCleared(j,e)})),I.addEventListener("representationChange",(function(e){return t._priv_onRepresentationChange(j,e)})),I.addEventListener("adaptationChange",(function(e){return t._priv_onAdaptationChange(j,e)})),I.addEventListener("bitrateEstimationChange",(function(e){return t._priv_onBitrateEstimationChange(e)})),I.addEventListener("manifestReady",(function(e){return t._priv_onManifestReady(j,e)})),I.addEventListener("loaded",(function(e){j.segmentBuffersStore=e.segmentBuffersStore})),I.addEventListener("addedSegment",(function(e){var n=e.content,r=e.segmentData;if("image"===n.adaptation.type&&!(0,h.A)(r)&&"bif"===r.type){var i=r.data;j.thumbnails=i,t.trigger("imageTrackUpdate",{data:j.thumbnails})}})),I.prepare(),this.stop();var Y=new K(C,{withMediaSource:!x,lowLatencyMode:c});R.signal.register((function(){Y.stop()}));var Q=function(e,t,n,r){var i=new w.A("LOADING",r);e.addEventListener("loaded",(function(){if("LOADING"===i.getValue()){if(i.setValue("LOADED"),!r.isCancelled()){var e=oe(t,null);"PAUSED"!==e&&i.setValue(e)}}else i.setValueIfChanged(oe(t,null))}),r),e.addEventListener("reloadingMediaSource",(function(){se(i.getValue())&&i.setValueIfChanged("RELOADING")}),r);var a=null;return e.addEventListener("stalled",(function(e){e!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,e)),a=e)}),r),e.addEventListener("unstalled",(function(){null!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,null)),a=null)}),r),n.listen((function(e){se(i.getValue())&&(0,A.A)(["seeking","ended","play","pause"],e.event)&&i.setValueIfChanged(oe(t,a))}),{clearSignal:r}),i}(I,C,Y,R.signal);R.signal.register((function(){I.dispose()}));var X=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":t._priv_reloadingMetadata.reloadInPause=!0,t._priv_reloadingMetadata.reloadPosition=Y.getReference().getValue().position;break;default:var n=Y.getReference().getValue();t._priv_reloadingMetadata.reloadInPause=n.paused,t._priv_reloadingMetadata.reloadPosition=n.position}},$=null,Z=function(e){null!==$&&($.cancel(),$=null),Q.onUpdate((function(n,r){var i,a,o,s;se(n)&&(r(),null!==$&&$.cancel(),($=new k.Ay).linkToSignal(R.signal),e!==!C.paused&&(C.paused?t.trigger("pause",null):t.trigger("play",null)),i=C,a=function(){return t.trigger("play",null)},o=function(){return t.trigger("pause",null)},(s=R.signal).isCancelled()||null===i||(i.addEventListener("play",a),i.addEventListener("pause",o),s.register((function(){i.removeEventListener("play",a),i.removeEventListener("pause",o)}))))}),{emitCurrentValue:!1,clearSignal:R.signal})};Z(n),I.addEventListener("reloadingMediaSource",(function(e){Z(e.autoPlay)}));var J=null;Q.onUpdate((function(e){X(e),t._priv_setPlayerState(e),R.isUsed()||(null!==J?se(t.state)||(J.cancel(),J=null):se(t.state)&&((J=new k.Ay).linkToSignal(R.signal),function(e,t,n,r,i){if(!i.isCancelled()&&null!==e){var a=t.getReference().getValue().seeking;a&&(n(),i.isCancelled())||t.listen((function(e){"seeking"===e.event?(a=!0,n()):a&&"seeked"===e.event&&(a=!1,r())}),{includeLastObservation:!0,clearSignal:i})}}(C,Y,(function(){return t.trigger("seeking",null)}),(function(){return t.trigger("seeked",null)}),J.signal)),"ENDED"===t.state&&t._priv_stopAtEnd&&t.stop())}),{emitCurrentValue:!0,clearSignal:R.signal}),Y.listen((function(e){X(t.state),t._priv_triggerPositionUpdate(j,e)}),{clearSignal:R.signal}),this._priv_currentError=null,this._priv_contentInfos=j,R.signal.register((function(){I.removeEventListener()})),this._priv_contentLock.onUpdate((function(e,t){e||(t(),I.start(C,Y))}),{emitCurrentValue:!0,clearSignal:R.signal})},i.getError=function(){return this._priv_currentError},i.getManifest=function(){return(0,I.A)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},i.getCurrentAdaptations=function(){if((0,I.A)("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,h.A)(n[t.id])?null:n[t.id]},i.getCurrentRepresentations=function(){return(0,I.A)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},i.getVideoElement=function(){return this.videoElement},i.getNativeTextTrack=function(){if((0,I.A)("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},i.getPlayerState=function(){return this.state},i.isContentLoaded=function(){return!(0,A.A)(["LOADING","RELOADING","STOPPED"],this.state)},i.isBuffering=function(){return(0,A.A)(["BUFFERING","SEEKING","LOADING","RELOADING"],this.state)},i.isPaused=function(){return!this.videoElement||((0,A.A)(["LOADING","RELOADING"],this.state)?!this._priv_lastAutoPlay:this.videoElement.paused)},i.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},i.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},i.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.originalUrl;return t?r:null!==n?n.getUrl():void 0}},i.updateContentUrls=function(e,t){if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=!0===(null==t?void 0:t.refresh);this._priv_contentInfos.initializer.updateContentUrls(e,n)},i.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},i.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.vK)(e.buffered,e.currentTime)},i.getVideoLoadedTime=function(){if((0,I.A)("`getVideoLoadedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.UL)(e.buffered,e.currentTime)},i.getVideoPlayedTime=function(){if((0,I.A)("`getVideoPlayedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,T.D3)(e.buffered,e.currentTime)},i.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=a(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},i.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},i.getLastStoredContentPosition=function(){return this._priv_reloadingMetadata.reloadPosition},i.getPlaybackRate=function(){return this._priv_speed.getValue()},i.setPlaybackRate=function(e,t){var n;e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var r=null==t?void 0:t.preferTrickModeTracks;if("boolean"==typeof r){this._priv_preferTrickModeTracks=r;var i=null===(n=this._priv_contentInfos)||void 0===n?void 0:n.trackChoiceManager;(0,h.A)(i)||(r&&!i.isTrickModeEnabled()?i.enableVideoTrickModeTracks():!r&&i.isTrickModeEnabled()&&i.disableVideoTrickModeTracks())}},i.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,h.A)(r.video)?[]:r.video.getAvailableBitrates()},i.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,h.A)(r.audio)?[]:r.audio.getAvailableBitrates()},i.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},i.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},i.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.A)(e.video))return e.video.bitrate},i.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.A)(e.audio))return e.audio.bitrate},i.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},i.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},i.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},i.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},i.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,h.A)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new v.A("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},i.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},i.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,o=r.manifest;if(!i&&null===o)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var s=e,u=this.videoElement.currentTime;if((0,h.A)(s.relative))if((0,h.A)(s.position)){if((0,h.A)(s.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==o)n=s.wallClockTime-(null!==(t=o.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var d=a(this.videoElement);void 0!==d&&(n=s.wallClockTime-d)}void 0===n&&(n=s.wallClockTime)}else n=s.position;else n=u+s.relative}if(void 0===n)throw new Error("invalid time given");return l.A.info("API: API Seek to",n),this.videoElement.currentTime=n,n},i.isFullscreen=function(){return(0,I.A)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),s()},i.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,I.A)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!s()){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):o()},i.exitFullscreen=function(){(0,I.A)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),o()},i.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},i.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))},i.isMute=function(){return 0===this.getVolume()},i.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},i.unMute=function(){var e=c.A.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},i.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},i.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},i.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)},i.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)},i.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)},i.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)},i.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},i.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},i.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},i.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},i.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},i.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},i.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},i.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},i.getCurrentKeySystem=function(){if((0,I.A)("`getCurrentKeySystem` is deprecated.Please use the `getKeySystemConfiguration` method instead."),null===this.videoElement)throw new Error("Disposed player");return(0,O.c)(this.videoElement)},i.getKeySystemConfiguration=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=(0,O.A)(this.videoElement);return null===e?null:{keySystem:e[0],configuration:e[1]}},i.getAvailableAudioTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableAudioTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableAudioTracks(n)},i.getAvailableTextTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableTextTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableTextTracks(n)},i.getAvailableVideoTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableVideoTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableVideoTracks(n)},i.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenAudioTrack()}if(null!==r&&null!==t)return r.getChosenAudioTrack(t)}},i.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenTextTrack()}if(null!==r&&null!==t)return r.getChosenTextTrack(t)}},i.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenVideoTrack()}if(null!==r&&null!==t)return r.getChosenVideoTrack(t)}},i.setAudioTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setAudioTrackByID(n,e)}catch(e){throw new Error("player: unknown audio track")}},i.setTextTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setTextTrackByID(n,e)}catch(e){throw new Error("player: unknown text track")}},i.disableTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n)null==i||i.disableTextTrack();else if(null!==r&&null!==t)return r.disableTextTrack(t)}},i.setVideoTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setVideoTrackByID(n,e)}catch(e){throw new Error("player: unknown video track")}},i.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n&&null!==i)return i.disableVideoTrack();if(null!==r&&null!==t)return r.disableVideoTrack(t)}},i.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},i.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},i.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t):null==n||n.trackChoiceManager.setPreferredAudioTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredTextTracks(e,t):null==n||n.trackChoiceManager.setPreferredTextTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.A)(null==n?void 0:n.trackChoiceManager)?(0,h.A)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t):null==n||n.trackChoiceManager.setPreferredVideoTracks(e,t)},i.getImageTrackData=function(){return(0,I.A)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},i.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.getMinimumSafePosition():null},i.getLivePosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?void 0:!0!==(null==n?void 0:n.isLive)?null:n.getLivePosition()},i.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.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},i.__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.synchronizeInventory(!0),t.value.getInventory()):null},i._priv_cleanUpCurrentContentState=function(){var e,t,n=this;l.A.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),null===(t=null===(e=this._priv_contentInfos)||void 0===e?void 0:e.mediaElementTrackChoiceManager)||void 0===t||t.dispose(),this._priv_contentInfos=null,this._priv_contentEventsMemory={};var r=function(){null!==n.videoElement&&(l.A.debug("Unlocking `contentLock`. Next content can begin."),n._priv_contentLock.setValue(!1))};(0,h.A)(this.videoElement)?r():L(this.videoElement).then((function(){l.A.debug("API: DRM session cleaned-up with success!"),r()}),(function(e){l.A.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),r()}))},i._priv_onManifestReady=function(e,t){var n,r=this;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.manifest=t;var i=e.currentContentCanceller.signal;this._priv_reloadingMetadata.manifest=t;var a=e.initialAudioTrack,o=e.initialTextTrack;e.trackChoiceManager=new $({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===a?this._priv_preferredAudioTracks:[a];e.trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===o?this._priv_preferredTextTracks:[o];e.trackChoiceManager.setPreferredTextTracks(u,!0),e.trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),t.addEventListener("manifestUpdate",(function(t){var n,a,o;null!==e.trackChoiceManager&&e.trackChoiceManager.update();var s=null!==(a=null===(n=r._priv_contentInfos)||void 0===n?void 0:n.currentPeriod)&&void 0!==a?a:void 0,u=null===(o=r._priv_contentInfos)||void 0===o?void 0:o.trackChoiceManager;if(void 0!==s&&!(0,h.A)(u))for(var l,d=ue(t.updatedPeriods);!(l=d()).done;){var c=l.value;if(c.period.id===s.id&&(c.result.addedAdaptations.length>0||c.result.removedAdaptations.length>0)){var f=u.getAvailableAudioTracks(s);r._priv_triggerEventIfNotStopped("availableAudioTracksChange",null!=f?f:[],i);var v=u.getAvailableTextTracks(s);r._priv_triggerEventIfNotStopped("availableTextTracksChange",null!=v?v:[],i);var p=u.getAvailableVideoTracks(s);r._priv_triggerEventIfNotStopped("availableVideoTracksChange",null!=p?p:[],i)}return}}),e.currentContentCanceller.signal)}},i._priv_onActivePeriodChanged=function(e,t){var n,r,i,a,o,s,u,l,d=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.currentPeriod=d;var c=e.currentContentCanceller.signal;this._priv_contentEventsMemory.periodChange!==d&&(this._priv_contentEventsMemory.periodChange=d,this._priv_triggerEventIfNotStopped("periodChange",d,c)),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",this.getAvailableAudioTracks(),c),this._priv_triggerEventIfNotStopped("availableTextTracksChange",this.getAvailableTextTracks(),c),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",this.getAvailableVideoTracks(),c);var f=null===(r=this._priv_contentInfos)||void 0===r?void 0:r.trackChoiceManager;if((0,h.A)(f))this._priv_triggerEventIfNotStopped("audioTrackChange",null,c),this._priv_triggerEventIfNotStopped("textTrackChange",null,c),this._priv_triggerEventIfNotStopped("videoTrackChange",null,c);else{var v=f.getChosenAudioTrack(d);this._priv_triggerEventIfNotStopped("audioTrackChange",v,c);var p=f.getChosenTextTrack(d);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);var m=f.getChosenVideoTrack(d);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c)}if(this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates(),c),!e.currentContentCanceller.isUsed()&&(this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates(),c),!e.currentContentCanceller.isUsed())){var g=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.audio)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;if(this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",g,c),!e.currentContentCanceller.isUsed()){var y=null!==(l=null===(u=null===(s=this._priv_getCurrentRepresentations())||void 0===s?void 0:s.video)||void 0===u?void 0:u.bitrate)&&void 0!==l?l:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",y,c)}}}},i._priv_onPeriodStreamReady=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=t.adaptationRef,o=e.trackChoiceManager;switch(r){case"video":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new video period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialVideoTrack(i));break;case"audio":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialAudioTrack(i));break;case"text":(0,h.A)(o)?(l.A.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialTextTrack(i));break;default:var s=i.adaptations[r];!(0,h.A)(s)&&s.length>0?a.setValue(s[0]):a.setValue(null)}}},i._priv_onPeriodStreamCleared=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=e.trackChoiceManager;switch(r){case"audio":case"text":case"video":(0,h.A)(a)||a.removePeriod(r,i)}var o=e.activeAdaptations,s=e.activeRepresentations;if(!(0,h.A)(o)&&!(0,h.A)(o[i.id])){var u=o[i.id];delete u[r],0===Object.keys(u).length&&delete o[i.id]}if(!(0,h.A)(s)&&!(0,h.A)(s[i.id])){var l=s[i.id];delete l[r],0===Object.keys(l).length&&delete s[i.id]}}},i._priv_onAdaptationChange=function(e,t){var n,r=t.type,i=t.adaptation,a=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeAdaptations&&(e.activeAdaptations={});var o,s=e.activeAdaptations,u=e.currentPeriod,l=s[a.id];if((0,h.A)(l))s[a.id]=((o={})[r]=i,o);else l[r]=i;var d=e.trackChoiceManager,c=e.currentContentCanceller.signal;if(null!==d&&null!==u&&!(0,h.A)(a)&&a.id===u.id)switch(r){case"audio":var f=d.getChosenAudioTrack(u);this._priv_triggerEventIfNotStopped("audioTrackChange",f,c);var v=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",v,c);break;case"text":var p=d.getChosenTextTrack(u);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);break;case"video":var m=d.getChosenVideoTrack(u);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c);var g=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",g,c)}}},i._priv_onRepresentationChange=function(e,t){var n,r,i=t.type,a=t.period,o=t.representation;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeRepresentations&&(e.activeRepresentations={});var s,u=e.activeRepresentations,l=e.currentPeriod,d=u[a.id];if((0,h.A)(d))u[a.id]=((s={})[i]=o,s);else d[i]=o;var c=null!==(r=null==o?void 0:o.bitrate)&&void 0!==r?r:-1;if(!(0,h.A)(a)&&null!==l&&l.id===a.id){var f=this._priv_contentInfos.currentContentCanceller.signal;"video"===i?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c,f):"audio"===i&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c,f)}}},i._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})},i._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},i._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,l.A.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},i._priv_triggerPositionUpdate=function(e,t){var n,r;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var i=e.isDirectFile,o=e.manifest;if((i||null!==o)&&!(0,h.A)(t)){var s=null!==o?o.getMaximumSafePosition():void 0,u={position:t.position,duration:t.duration,playbackRate:t.playbackRate,maximumBufferTime:s,bufferGap:void 0!==t.bufferGap&&isFinite(t.bufferGap)?t.bufferGap:0};if(null!==o&&o.isLive&&t.position>0){var l=null!==(r=o.availabilityStartTime)&&void 0!==r?r:0;u.wallClockTime=t.position+l;var d=o.getLivePosition();void 0!==d&&(u.liveGap=d-t.position)}else if(i&&null!==this.videoElement){var c=a(this.videoElement);void 0!==c&&(u.wallClockTime=c+t.position)}this.trigger("positionUpdate",u)}}},i._priv_triggerAvailableBitratesChangeEvent=function(e,t,n){var r=this._priv_contentEventsMemory[e];n.isCancelled()||void 0!==r&&(0,y.A)(t,r)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._priv_triggerCurrentBitrateChangeEvent=function(e,t,n){n.isCancelled()||t===this._priv_contentEventsMemory[e]||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._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,h.A)(n[t.id])?null:n[t.id]},i._priv_triggerEventIfNotStopped=function(e,t,n){n.isCancelled()||this.trigger(e,t)},i._priv_initializeMediaElementTrackChoiceManager=function(e,t,n){var r,i,a,o=this;(0,_.h)(null!==g.A.directfile,"Initializing `MediaElementTrackChoiceManager` without Directfile feature"),(0,_.h)(null!==this.videoElement,"Initializing `MediaElementTrackChoiceManager` on a disposed RxPlayer");var s=new g.A.directfile.mediaElementTrackChoiceManager(this.videoElement),u=void 0===e?this._priv_preferredAudioTracks:[e];s.setPreferredAudioTracks(u,!0);var l=void 0===t?this._priv_preferredTextTracks:[t];return s.setPreferredTextTracks(l,!0),s.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",s.getAvailableAudioTracks(),n),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",s.getAvailableVideoTracks(),n),this._priv_triggerEventIfNotStopped("availableTextTracksChange",s.getAvailableTextTracks(),n),this._priv_triggerEventIfNotStopped("audioTrackChange",null!==(r=s.getChosenAudioTrack())&&void 0!==r?r:null,n),this._priv_triggerEventIfNotStopped("textTrackChange",null!==(i=s.getChosenTextTrack())&&void 0!==i?i:null,n),this._priv_triggerEventIfNotStopped("videoTrackChange",null!==(a=s.getChosenVideoTrack())&&void 0!==a?a:null,n),s.addEventListener("availableVideoTracksChange",(function(e){return o.trigger("availableVideoTracksChange",e)})),s.addEventListener("availableAudioTracksChange",(function(e){return o.trigger("availableAudioTracksChange",e)})),s.addEventListener("availableTextTracksChange",(function(e){return o.trigger("availableTextTracksChange",e)})),s.addEventListener("audioTrackChange",(function(e){return o.trigger("audioTrackChange",e)})),s.addEventListener("videoTrackChange",(function(e){return o.trigger("videoTrackChange",e)})),s.addEventListener("textTrackChange",(function(e){return o.trigger("textTrackChange",e)})),s},(0,e.A)(r,null,[{key:"ErrorTypes",get:function(){return p.wU}},{key:"ErrorCodes",get:function(){return p.tG}},{key:"LogLevel",get:function(){return l.A.getLevel()},set:function(e){l.A.setLevel(e)}}])}(b.A);ye._priv_currentlyUsedVideoElements=new WeakSet,ye.version="3.33.4";var Ae=ye;!function(){m.A.mediaSourceInit=n(1737).A,m.A.decrypt=n(6699).Ay,m.A.imageBuffer=n(4166).A,m.A.imageParser=n(1755).A,m.A.transports.smooth=n(5564).A,m.A.transports.dash=n(9502).A,m.A.dashParsers.js=n(95).A,m.A.nativeTextTracksBuffer=n(8385).A,m.A.nativeTextTracksParsers.vtt=n(2537).A,m.A.nativeTextTracksParsers.ttml=n(5084).A,m.A.nativeTextTracksParsers.sami=n(7275).A,m.A.nativeTextTracksParsers.srt=n(5992).A,m.A.htmlTextTracksBuffer=n(7938).A,m.A.htmlTextTracksParsers.sami=n(9561).A,m.A.htmlTextTracksParsers.ttml=n(8342).A,m.A.htmlTextTracksParsers.srt=n(1650).A,m.A.htmlTextTracksParsers.vtt=n(8977).A;var e=n(5963).A,t=n(3568).A;m.A.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&l.A.setLevel("DEBUG");var _e=Ae}(),r=r.default}()}));