@arcgis/core 6.0.0-next.15 → 6.0.0-next.17

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 (439) hide show
  1. package/analysis/LineOfSightAnalysis.d.ts +49 -32
  2. package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
  3. package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
  4. package/analysis/Viewshed.d.ts +23 -3
  5. package/analysis/ViewshedAnalysis.d.ts +33 -13
  6. package/arcade/geometry/operatorsWorkerConnection.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
  10. package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
  11. package/assets/esri/core/workers/chunks/164c8eeefa8232b2b191.js +2 -0
  12. package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
  13. package/assets/esri/core/workers/chunks/1967b9c96045a5802d08.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
  16. package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
  17. package/assets/esri/core/workers/chunks/{261fea092ee7d27608a0.js → 20a2124cbe43e5527c40.js} +1 -1
  18. package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
  19. package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
  20. package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
  21. package/assets/esri/core/workers/chunks/2853606099602f73d379.js +1 -0
  22. package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +2 -0
  23. package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
  24. package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +2 -0
  25. package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 34e0a8a3a2beea50f4f5.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3e30b96a8c75bd5b9ae2.js +1 -0
  29. package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → 42753cf4965a94bc91ca.js} +1 -1
  30. package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
  31. package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
  33. package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
  34. package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
  35. package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{b564ec4e03478f5659db.js → 4c240ca50f70bf30813f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
  38. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
  39. package/assets/esri/core/workers/chunks/{70d3055f15d8b0cf4074.js → 532e9cda8ac3601d8892.js} +1 -1
  40. package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
  41. package/assets/esri/core/workers/chunks/{953ba13299e7aa92c1a0.js → 564565246dae080f5e6c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
  43. package/assets/esri/core/workers/chunks/{2145a512d269d64036b0.js → 58c3ae6030def2ed5f31.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +1 -0
  45. package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +1 -0
  46. package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 5b91e2dffdc84c006539.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
  48. package/assets/esri/core/workers/chunks/603fdbbe9534c614928f.js +1 -0
  49. package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → 60f92eb03c6e17ab4747.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{67ebc5a3d46b254b725c.js → 612345f17f5eeb99ea8f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{1b077c92345ffb5916c2.js → 65c98f3449044fa4fd79.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2bd4ee083ca4ad221f8b.js → 65cb5e39c467a35621ca.js} +1 -1
  53. package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
  54. package/assets/esri/core/workers/chunks/67a35155b8b4d36f171e.js +1 -0
  55. package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
  56. package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{ae31fd416bbb41a81392.js → 6ad309154fe84210d23c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
  59. package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
  60. package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
  61. package/assets/esri/core/workers/chunks/784d6c6949284ed6e10b.js +1 -0
  62. package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{e2190361247f35b02b32.js → 7b5cd150a4d0139850be.js} +1 -1
  65. package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
  66. package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +1 -0
  67. package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js → 844eedda8f749972f707.js} +2 -2
  70. package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
  76. package/assets/esri/core/workers/chunks/9503eedfdda55fc5adab.js +1 -0
  77. package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
  78. package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
  80. package/assets/esri/core/workers/chunks/999c23da883eb11cb29e.js +1 -0
  81. package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +1 -0
  82. package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
  84. package/assets/esri/core/workers/chunks/a35c69a4751d28c39907.js +1 -0
  85. package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{ec8b7476eac4718eb0ac.js → a504a5e06cb89a620799.js} +1 -1
  88. package/assets/esri/core/workers/chunks/a596779eaeec7310671d.js +1 -0
  89. package/assets/esri/core/workers/chunks/{d5d0fe8e198ff5a902ee.js → a5c8f9f5be4ef5063b42.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → ab1660f5f8a5268c2fac.js} +1 -1
  92. package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
  93. package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
  94. package/assets/esri/core/workers/chunks/ae0563d573baf91e01f7.js +1 -0
  95. package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
  96. package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
  97. package/assets/esri/core/workers/chunks/b686cd74975da09b9c91.js +2 -0
  98. package/assets/esri/core/workers/chunks/{aa36c3a9bbaa086e3757.js → b8fd7c3b36981261378b.js} +1 -1
  99. package/assets/esri/core/workers/chunks/bd046399e05e759e0bc2.js +1 -0
  100. package/assets/esri/core/workers/chunks/bd46a04a9ee4ea9e6ef1.js +2 -0
  101. package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
  102. package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +1 -0
  103. package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
  104. package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
  105. package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
  106. package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
  107. package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
  108. package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → dd0310184fe4832755a8.js} +1 -1
  109. package/assets/esri/core/workers/chunks/dfa5f1311806473e473f.js +1 -0
  110. package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
  112. package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
  113. package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
  114. package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
  115. package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
  116. package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
  117. package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
  118. package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
  119. package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
  120. package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{634523cc7757da9020e4.js → fb70ab267a08e24b710f.js} +1 -1
  122. package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +1 -0
  123. package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
  124. package/assets/esri/themes/base/widgets/_Weather.scss +1 -0
  125. package/assets/esri/themes/dark/main.css +1 -1
  126. package/assets/esri/themes/light/main.css +1 -1
  127. package/assets/esri/themes/light/view.css +1 -1
  128. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  129. package/chunks/Envelope.js +1 -1
  130. package/chunks/MultiPathImpl.js +1 -1
  131. package/chunks/OperatorGeodeticArea.js +1 -1
  132. package/chunks/OperatorShapePreservingLength.js +1 -1
  133. package/chunks/OperatorShapePreservingProject.js +1 -1
  134. package/chunks/UnitFactory.js +1 -1
  135. package/chunks/basis_encoder.js +1 -1
  136. package/chunks/basis_transcoder.js +1 -1
  137. package/chunks/index.js +1 -1
  138. package/chunks/lclayout.js +1 -1
  139. package/chunks/lerc-wasm.js +1 -1
  140. package/config.d.ts +2 -0
  141. package/config.js +1 -1
  142. package/core/accessorSupport/DefaultsStore.js +1 -1
  143. package/core/accessorSupport/MultiOriginStore.js +1 -1
  144. package/core/accessorSupport/Store.js +1 -1
  145. package/core/accessorSupport/decorators/reader.js +1 -1
  146. package/core/accessorSupport/decorators/writer.js +1 -1
  147. package/core/sql/WhereGrammar.js +2 -2
  148. package/core/workers/WorkerOwner.js +1 -1
  149. package/core/workers/workerFactory.js +1 -1
  150. package/core/workers/workers.js +2 -2
  151. package/core/workers.d.ts +9 -0
  152. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  153. package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
  154. package/geometry/Mesh.js +1 -1
  155. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  156. package/geometry/operators/gx/operatorOffset.js +1 -1
  157. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  158. package/geometry/operators/support/jsonConverter.js +1 -1
  159. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  160. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  161. package/geometry/support/meshUtils/merge.js +1 -1
  162. package/geometry/support/meshUtils/rotate.js +1 -1
  163. package/geometry/support/polygonExtentClipping.js +1 -1
  164. package/identity/Credential.js +1 -1
  165. package/kernel.js +1 -1
  166. package/layers/AnnotationFeatureLayer.d.ts +2 -2
  167. package/layers/AnnotationFeatureLayer.js +1 -1
  168. package/layers/CatalogLayer.d.ts +2 -2
  169. package/layers/CatalogLayer.js +1 -1
  170. package/layers/DimensionFeatureLayer.d.ts +2 -2
  171. package/layers/DimensionFeatureLayer.js +1 -1
  172. package/layers/ElevationLayer.js +1 -1
  173. package/layers/FeatureLayer.d.ts +4 -4
  174. package/layers/FeatureLayer.js +1 -1
  175. package/layers/GeoJSONLayer.d.ts +1 -1
  176. package/layers/ImageryTileLayer.js +1 -1
  177. package/layers/LineOfSightLayer.d.ts +10 -8
  178. package/layers/SceneLayer.js +1 -1
  179. package/layers/SubtypeGroupLayer.d.ts +2 -2
  180. package/layers/SubtypeGroupLayer.js +1 -1
  181. package/layers/ViewshedLayer.d.ts +1 -1
  182. package/layers/VoxelLayer.js +1 -1
  183. package/layers/WMSLayer.js +1 -1
  184. package/layers/effects/parser.js +3 -3
  185. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  186. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
  187. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  188. package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
  189. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  190. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  191. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  192. package/layers/graphics/data/QueryEngineResult.js +1 -1
  193. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  194. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  195. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  196. package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
  197. package/layers/mixins/ReloadableLayer.js +2 -0
  198. package/layers/raster/datasets/BaseRaster.js +1 -1
  199. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  200. package/layers/raster/datasets/ImageAuxRaster.js +2 -2
  201. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  202. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  203. package/layers/raster/datasets/MRFRaster.js +1 -1
  204. package/layers/raster/datasets/TIFFRaster.js +1 -1
  205. package/layers/raster/datasets/WCSRaster.js +1 -1
  206. package/layers/raster/formats/ElevationCodec.js +2 -0
  207. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  208. package/layers/raster/formats/Lerc.js +1 -1
  209. package/layers/raster/formats/RasterCodec.js +1 -1
  210. package/layers/raster/formats/TiffDecoder.js +1 -1
  211. package/layers/raster/formats/Zlib.js +1 -1
  212. package/layers/raster/functions/stretchUtils.js +1 -1
  213. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  214. package/layers/support/FieldsIndex.js +1 -1
  215. package/layers/support/LercWorker.js +1 -1
  216. package/layers/support/RasterWorker.js +1 -1
  217. package/layers/support/TileInfo.d.ts +1 -1
  218. package/layers/support/TileInfo.js +1 -1
  219. package/layers/support/featureReductionProperties.js +1 -1
  220. package/layers/support/kmlUtils.js +1 -1
  221. package/layers/support/layerOriginUtils.js +1 -1
  222. package/layers/video/VideoController.js +10 -10
  223. package/libs/maquette/projection.js +1 -1
  224. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  225. package/package.json +6 -6
  226. package/popup/FeatureModel.js +1 -1
  227. package/popup/FeaturesModel.js +1 -1
  228. package/portal/Portal.js +1 -1
  229. package/request/process.js +1 -1
  230. package/request/types.d.ts +7 -0
  231. package/rest/knowledgeGraphService.js +1 -1
  232. package/rest/networks/trace.js +1 -1
  233. package/rest/query/executeQuery.js +1 -1
  234. package/smartMapping/raster/renderers/shadedRelief.js +1 -1
  235. package/smartMapping/renderers/univariateColorSize.js +1 -1
  236. package/smartMapping/statistics/support/statsWorker.js +1 -1
  237. package/smartMapping/statistics/support/utils.js +1 -1
  238. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  239. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  240. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  241. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  242. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  243. package/smartMapping/support/adapters/support/utils.js +1 -1
  244. package/smartMapping/support/clusterUtils.js +1 -1
  245. package/statistics/utils.js +1 -1
  246. package/symbols/cim/CIMCursor.js +1 -1
  247. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  248. package/symbols/cim/cimAnalyzer.js +1 -1
  249. package/symbols/support/ElevationInfo.d.ts +4 -3
  250. package/time/TimeExtent.d.ts +1 -1
  251. package/undoredo/support/Services.js +1 -1
  252. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
  253. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  254. package/views/2d/grid/GridView2D.js +1 -1
  255. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  256. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  257. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
  258. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
  259. package/views/2d/viewpointUtils.js +1 -1
  260. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  261. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  262. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  263. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  264. package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
  265. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
  266. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  267. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  268. package/views/3d/analysis/Viewshed/types.d.ts +7 -0
  269. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
  270. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  271. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  272. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  273. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  274. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  275. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  276. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  277. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  278. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  279. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  280. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  281. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  282. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  283. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  284. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  285. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  286. package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
  287. package/views/3d/layers/i3s/I3SNode.js +1 -1
  288. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  289. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  290. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  291. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  292. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  293. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  294. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  295. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  296. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  297. package/views/3d/state/utils/navigationUtils.js +1 -1
  298. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  299. package/views/3d/support/elevationUpdateUtils.js +1 -1
  300. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  301. package/views/3d/support/sphereExtentUtils.js +2 -0
  302. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  303. package/views/3d/terrain/OverlayRenderer.js +1 -1
  304. package/views/3d/terrain/PatchRenderData.js +1 -1
  305. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  306. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  307. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  308. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  309. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  310. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  311. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  312. package/views/SceneView.js +1 -1
  313. package/views/ToolViewManager.js +1 -1
  314. package/views/View.js +1 -1
  315. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  316. package/views/draw/DrawOperation.js +1 -1
  317. package/views/draw/support/InteractiveHandle.js +1 -1
  318. package/views/draw/support/Reshape.js +1 -1
  319. package/views/draw/support/createUtils.js +1 -1
  320. package/views/draw/support/editingSessionUtils.js +1 -1
  321. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  322. package/views/interactive/SegmentLabels.js +1 -1
  323. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  324. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  325. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  326. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  327. package/views/interactive/options/TooltipOptions.d.ts +2 -0
  328. package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
  329. package/views/interactive/sketch/constraintUtils.js +1 -1
  330. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  331. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  332. package/views/interactive/snapping/allLayerSnapping.js +1 -1
  333. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  334. package/views/layers/LayerView.js +1 -1
  335. package/views/layers/LineOfSightLayerView.d.ts +35 -13
  336. package/views/layers/SketchLayerView.d.ts +1 -0
  337. package/views/layers/ViewshedLayerView.d.ts +36 -12
  338. package/views/webgl/Program.js +1 -1
  339. package/views/webgl/Texture.js +1 -1
  340. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -1
  341. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +2 -0
  342. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  343. package/widgets/Directions.js +1 -1
  344. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -1
  345. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  346. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  347. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  348. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  349. package/widgets/Expand/ExpandViewModel.d.ts +2 -0
  350. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  351. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  352. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  353. package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -1
  354. package/widgets/Home/HomeViewModel.d.ts +2 -0
  355. package/widgets/OrientedImageryViewer.js +1 -1
  356. package/widgets/Print.js +1 -1
  357. package/widgets/Sketch/SketchViewModel.js +1 -1
  358. package/widgets/Slice.js +1 -1
  359. package/widgets/Swipe/SwipeViewModel.d.ts +2 -0
  360. package/widgets/Swipe/types.d.ts +9 -2
  361. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +9 -5
  362. package/widgets/TimeSlider/types.d.ts +7 -0
  363. package/widgets/TimeSlider.d.ts +2 -3
  364. package/widgets/TimeSlider.js +1 -1
  365. package/widgets/Track/TrackViewModel.d.ts +4 -0
  366. package/widgets/Track/types.d.ts +1 -0
  367. package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
  368. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  369. package/widgets/support/SelectionList.js +1 -1
  370. package/widgets/support/Selector3D/selectorUtils.js +1 -1
  371. package/widgets/support/componentsUtils.js +1 -1
  372. package/assets/esri/core/workers/chunks/0050916e462e3c9e0627.js +0 -1
  373. package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
  374. package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
  375. package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
  376. package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
  377. package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
  378. package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
  379. package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
  380. package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
  381. package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
  382. package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
  383. package/assets/esri/core/workers/chunks/34cbaf844730ac2d92c2.js +0 -2
  384. package/assets/esri/core/workers/chunks/3c301a689c7853c9fa67.js +0 -2
  385. package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +0 -1
  386. package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
  387. package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
  388. package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
  389. package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
  390. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
  391. package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
  392. package/assets/esri/core/workers/chunks/604f0f4150fb79ee54c8.js +0 -1
  393. package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +0 -1
  394. package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
  395. package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
  396. package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
  397. package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
  398. package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
  399. package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
  400. package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
  401. package/assets/esri/core/workers/chunks/745a153d0cd34faa124e.js +0 -1
  402. package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +0 -1
  403. package/assets/esri/core/workers/chunks/76ab353d80d786777161.js +0 -2
  404. package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
  405. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
  406. package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
  407. package/assets/esri/core/workers/chunks/8483c50ed8f280fd74bb.js +0 -1
  408. package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
  409. package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
  410. package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +0 -1
  411. package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
  412. package/assets/esri/core/workers/chunks/94e427040edb469d58ad.js +0 -1
  413. package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
  414. package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
  415. package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
  416. package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
  417. package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
  418. package/assets/esri/core/workers/chunks/b49df4ebd4be1181b0f9.js +0 -2
  419. package/assets/esri/core/workers/chunks/b557824bc1fa163d72a3.js +0 -2
  420. package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
  421. package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
  422. package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
  423. package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
  424. package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
  425. package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
  426. package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
  427. package/assets/esri/core/workers/chunks/ed8786fed345718ed684.js +0 -1
  428. package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
  429. package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
  430. package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +0 -1
  431. package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
  432. package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
  433. package/layers/mixins/FeatureLayerReload.js +0 -2
  434. /package/assets/esri/core/workers/chunks/{b557824bc1fa163d72a3.js.LICENSE.txt → 164c8eeefa8232b2b191.js.LICENSE.txt} +0 -0
  435. /package/assets/esri/core/workers/chunks/{b49df4ebd4be1181b0f9.js.LICENSE.txt → 2981e904ab62f3ed80d0.js.LICENSE.txt} +0 -0
  436. /package/assets/esri/core/workers/chunks/{34cbaf844730ac2d92c2.js.LICENSE.txt → 32cc59e126df8c96a0cf.js.LICENSE.txt} +0 -0
  437. /package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js.LICENSE.txt → 844eedda8f749972f707.js.LICENSE.txt} +0 -0
  438. /package/assets/esri/core/workers/chunks/{3c301a689c7853c9fa67.js.LICENSE.txt → b686cd74975da09b9c91.js.LICENSE.txt} +0 -0
  439. /package/assets/esri/core/workers/chunks/{76ab353d80d786777161.js.LICENSE.txt → bd46a04a9ee4ea9e6ef1.js.LICENSE.txt} +0 -0
@@ -11,11 +11,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
11
11
  `,e.parse()),e.state===`INITIAL`)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},L=x,L}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;var e=`auto`,t={"":1,lr:1,rl:1},n={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(e){return typeof e==`string`&&t[e.toLowerCase()]?e.toLowerCase():!1}function i(e){return typeof e==`string`&&n[e.toLowerCase()]?e.toLowerCase():!1}function a(t,n,a){this.hasBeenReset=!1;var o=``,s=!1,c=t,l=n,u=a,d=null,f=``,p=!0,m=`auto`,h=`start`,g=`auto`,_=`auto`,v=100,y=`center`;Object.defineProperties(this,{id:{enumerable:!0,get:function(){return o},set:function(e){o=``+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`)throw TypeError(`Start time must be set to a number.`);c=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if(typeof e!=`number`)throw TypeError(`End time must be set to a number.`);l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(e){u=``+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return d},set:function(e){d=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(e){var t=r(e);if(t===!1)throw SyntaxError(`Vertical: an invalid or illegal direction string was specified.`);f=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!=`number`&&t!==e)throw SyntaxError(`Line: an invalid number or illegal string was specified.`);m=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=i(e);t?(h=t,this.hasBeenReset=!0):console.warn(`lineAlign: an invalid or illegal string was specified.`)}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw Error(`Position must be between 0 and 100.`);g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _},set:function(e){var t=i(e);t?(_=t,this.hasBeenReset=!0):console.warn(`positionAlign: an invalid or illegal string was specified.`)}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw Error(`Size must be between 0 and 100.`);v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=i(e);if(!t)throw SyntaxError(`align: an invalid or illegal alignment string was specified.`);y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}return a.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Ye=a,Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;var e={"":!0,up:!0};function t(t){return typeof t==`string`&&e[t.toLowerCase()]?t.toLowerCase():!1}function n(e){return typeof e==`number`&&e>=0&&e<=100}function r(){var e=100,r=3,i=0,a=100,o=0,s=100,c=``;Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!n(t))throw Error(`Width must be between 0 and 100.`);e=t}},lines:{enumerable:!0,get:function(){return r},set:function(e){if(typeof e!=`number`)throw TypeError(`Lines must be set to a number.`);r=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!n(e))throw Error(`RegionAnchorX must be between 0 and 100.`);a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!n(e))throw Error(`RegionAnchorY must be between 0 and 100.`);i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!n(e))throw Error(`ViewportAnchorY must be between 0 and 100.`);s=e}},viewportAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!n(e))throw Error(`ViewportAnchorX must be between 0 and 100.`);o=e}},scroll:{enumerable:!0,get:function(){return c},set:function(e){var n=t(e);n===!1?console.warn(`Scroll: an invalid or illegal string was specified.`):c=n}}})}return Qe=r,Qe}var tt;function nt(){if(tt)return Ke.exports;tt=1;var e=y(),t=Ke.exports={WebVTT:Je(),VTTCue:Ze(),VTTRegion:et()};e.vttjs=t,e.WebVTT=t.WebVTT;var n=t.VTTCue,r=t.VTTRegion,i=e.VTTCue,a=e.VTTRegion;return t.shim=function(){e.VTTCue=n,e.VTTRegion=r},t.restore=function(){e.VTTCue=i,e.VTTRegion=a},e.VTTCue||t.shim(),Ke.exports}var rt=nt();const it=g(rt);function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}var at=`https://example.com`,ot=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||``);var n=/^\/\//.test(e),r=!x.location&&!/\/\//i.test(e);e=new x.URL(e,x.location||at);var i=new URL(t,e);return r?i.href.slice(at.length):n?i.href.slice(i.protocol.length):i.href},st=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)}},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}(),ct=function(e){return x.atob?x.atob(e):Buffer.from(e,`base64`).toString(`binary`)};function lt(e){for(var t=ct(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}class ut extends st{constructor(){super(),this.buffer=``}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
12
12
  `);t>-1;t=this.buffer.indexOf(`
13
13
  `))this.trigger(`data`,this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const dt=function(e){let t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||``),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},ft=function(){return RegExp(`(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))`)},pt=function(e){let t={};if(!e)return t;let n=e.split(ft()),r=n.length,i;for(;r--;)n[r]!==``&&(i=/([^=]*)=(.*)/.exec(n[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^['"](.*)['"]$/g,`$1`),t[i[0]]=i[1]);return t},mt=e=>{let t=e.split(`x`),n={};return t[0]&&(n.width=parseInt(t[0],10)),t[1]&&(n.height=parseInt(t[1],10)),n};class ht extends st{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;e=e.trim(),e.length!==0&&(e[0]===`#`?this.tagMappers.reduce((t,n)=>{let r=n(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(e.indexOf(`#EXT`)!==0)this.trigger(`data`,{type:`comment`,text:e.slice(1)});else if(e=e.replace(`\r`,``),t=/^#EXTM3U/.exec(e),t)this.trigger(`data`,{type:`tag`,tagType:`m3u`});else if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)n={type:`tag`,tagType:`inf`},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),this.trigger(`data`,n);else if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)n={type:`tag`,tagType:`targetduration`},t[1]&&(n.duration=parseInt(t[1],10)),this.trigger(`data`,n);else if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)n={type:`tag`,tagType:`version`},t[1]&&(n.version=parseInt(t[1],10)),this.trigger(`data`,n);else if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)n={type:`tag`,tagType:`media-sequence`},t[1]&&(n.number=parseInt(t[1],10)),this.trigger(`data`,n);else if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)n={type:`tag`,tagType:`discontinuity-sequence`},t[1]&&(n.number=parseInt(t[1],10)),this.trigger(`data`,n);else if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)n={type:`tag`,tagType:`playlist-type`},t[1]&&(n.playlistType=t[1]),this.trigger(`data`,n);else if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)n=R(dt(t[1]),{type:`tag`,tagType:`byterange`}),this.trigger(`data`,n);else if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)n={type:`tag`,tagType:`allow-cache`},t[1]&&(n.allowed=!/NO/.test(t[1])),this.trigger(`data`,n);else if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(n={type:`tag`,tagType:`map`},t[1]){let e=pt(t[1]);e.URI&&(n.uri=e.URI),e.BYTERANGE&&(n.byterange=dt(e.BYTERANGE))}this.trigger(`data`,n)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)n={type:`tag`,tagType:`stream-inf`},t[1]&&(n.attributes=pt(t[1]),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=mt(n.attributes.RESOLUTION)),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes[`FRAME-RATE`]&&(n.attributes[`FRAME-RATE`]=parseFloat(n.attributes[`FRAME-RATE`])),n.attributes[`PROGRAM-ID`]&&(n.attributes[`PROGRAM-ID`]=parseInt(n.attributes[`PROGRAM-ID`],10))),this.trigger(`data`,n);else if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)n={type:`tag`,tagType:`media`},t[1]&&(n.attributes=pt(t[1])),this.trigger(`data`,n);else if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger(`data`,{type:`tag`,tagType:`endlist`});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger(`data`,{type:`tag`,tagType:`discontinuity`});else if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)n={type:`tag`,tagType:`program-date-time`},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),this.trigger(`data`,n);else if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)n={type:`tag`,tagType:`key`},t[1]&&(n.attributes=pt(t[1]),n.attributes.IV&&(n.attributes.IV.substring(0,2).toLowerCase()===`0x`&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),this.trigger(`data`,n);else if(t=/^#EXT-X-START:(.*)$/.exec(e),t)n={type:`tag`,tagType:`start`},t[1]&&(n.attributes=pt(t[1]),n.attributes[`TIME-OFFSET`]=parseFloat(n.attributes[`TIME-OFFSET`]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),this.trigger(`data`,n);else if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)n={type:`tag`,tagType:`cue-out-cont`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);else if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)n={type:`tag`,tagType:`cue-out`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);else if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)n={type:`tag`,tagType:`cue-in`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);else if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`skip`},n.attributes=pt(t[1]),n.attributes.hasOwnProperty(`SKIPPED-SEGMENTS`)&&(n.attributes[`SKIPPED-SEGMENTS`]=parseInt(n.attributes[`SKIPPED-SEGMENTS`],10)),n.attributes.hasOwnProperty(`RECENTLY-REMOVED-DATERANGES`)&&(n.attributes[`RECENTLY-REMOVED-DATERANGES`]=n.attributes[`RECENTLY-REMOVED-DATERANGES`].split(` `)),this.trigger(`data`,n);else if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`part`},n.attributes=pt(t[1]),[`DURATION`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`INDEPENDENT`,`GAP`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))}),n.attributes.hasOwnProperty(`BYTERANGE`)&&(n.attributes.byterange=dt(n.attributes.BYTERANGE)),this.trigger(`data`,n);else if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`server-control`},n.attributes=pt(t[1]),[`CAN-SKIP-UNTIL`,`PART-HOLD-BACK`,`HOLD-BACK`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`CAN-SKIP-DATERANGES`,`CAN-BLOCK-RELOAD`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))}),this.trigger(`data`,n);else if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`part-inf`},n.attributes=pt(t[1]),[`PART-TARGET`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),this.trigger(`data`,n);else if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`preload-hint`},n.attributes=pt(t[1]),[`BYTERANGE-START`,`BYTERANGE-LENGTH`].forEach(function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);let t=e===`BYTERANGE-LENGTH`?`length`:`offset`;n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}}),this.trigger(`data`,n);else if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])n={type:`tag`,tagType:`rendition-report`},n.attributes=pt(t[1]),[`LAST-MSN`,`LAST-PART`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))}),this.trigger(`data`,n);else if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`daterange`},n.attributes=pt(t[1]),[`ID`,`CLASS`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=String(n.attributes[e]))}),[`START-DATE`,`END-DATE`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=new Date(n.attributes[e]))}),[`DURATION`,`PLANNED-DURATION`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`END-ON-NEXT`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/i.test(n.attributes[e]))}),[`SCTE35-CMD`,` SCTE35-OUT`,`SCTE35-IN`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=n.attributes[e].toString(16))});let e=/^X-([A-Z]+-)+[A-Z]+$/;for(let t in n.attributes){if(!e.test(t))continue;let r=/[0-9A-Fa-f]{6}/g.test(n.attributes[t]),i=/^\d+(\.\d+)?$/.test(n.attributes[t]);n.attributes[t]=r?n.attributes[t].toString(16):i?parseFloat(n.attributes[t]):String(n.attributes[t])}this.trigger(`data`,n)}else t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t?this.trigger(`data`,{type:`tag`,tagType:`independent-segments`}):(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t?this.trigger(`data`,{type:`tag`,tagType:`i-frames-only`}):(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t?(n={type:`tag`,tagType:`content-steering`},n.attributes=pt(t[1]),this.trigger(`data`,n)):(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t?(n={type:`tag`,tagType:`i-frame-playlist`},n.attributes=pt(t[1]),n.attributes.URI&&(n.uri=n.attributes.URI),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=mt(n.attributes.RESOLUTION)),n.attributes[`AVERAGE-BANDWIDTH`]&&(n.attributes[`AVERAGE-BANDWIDTH`]=parseInt(n.attributes[`AVERAGE-BANDWIDTH`],10)),n.attributes[`FRAME-RATE`]&&(n.attributes[`FRAME-RATE`]=parseFloat(n.attributes[`FRAME-RATE`])),this.trigger(`data`,n)):(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t?(n={type:`tag`,tagType:`define`},n.attributes=pt(t[1]),this.trigger(`data`,n)):this.trigger(`data`,{type:`tag`,data:e.slice(4)})))))}):this.trigger(`data`,{type:`uri`,uri:e}))}addParser({expression:e,customType:t,dataParser:n,segment:r}){typeof n!=`function`&&(n=e=>e),this.customParsers.push(i=>{if(e.exec(i))return this.trigger(`data`,{type:`custom`,data:n(i),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(n=>e.test(n)?t(n):n)}}const gt=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),_t=function(e){let t={};return Object.keys(e).forEach(function(n){t[gt(n)]=e[n]}),t},vt=function(e){let{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;let i=`#EXT-X-SERVER-CONTROL`,a=`holdBack`,o=`partHoldBack`,s=n&&n*3,c=r&&r*2;n&&!t.hasOwnProperty(a)&&(t[a]=s,this.trigger(`info`,{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${s}).`})),s&&t[a]<s&&(this.trigger(`warn`,{message:`${i} clamping HOLD-BACK (${t[a]}) to targetDuration * 3 (${s})`}),t[a]=s),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger(`info`,{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[o]}).`})),r&&t[o]<c&&(this.trigger(`warn`,{message:`${i} clamping PART-HOLD-BACK (${t[o]}) to partTargetDuration * 2 (${c}).`}),t[o]=c)};class yt extends st{constructor(e={}){super(),this.lineStream=new ut,this.parseStream=new ht,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,`https://a.com`).searchParams,this.lastProgramDateTime=null;let t=this,n=[],r={},i,a,o=!1,s=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0,d=0,f={};this.on(`end`,()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&i&&(r.map=i),!r.key&&a&&(r.key=a),!r.timeline&&typeof l==`number`&&(r.timeline=l),this.manifest.preloadSegment=r)}),this.parseStream.on(`data`,function(e){let p,m;if(t.manifest.definitions){for(let n in t.manifest.definitions)if(e.uri&&=e.uri.replace(`{$${n}}`,t.manifest.definitions[n]),e.attributes)for(let r in e.attributes)typeof e.attributes[r]==`string`&&(e.attributes[r]=e.attributes[r].replace(`{$${n}}`,t.manifest.definitions[n]))}({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,`allowed`in e||(this.trigger(`info`,{message:`defaulting allowCache to YES`}),this.manifest.allowCache=!0)},byterange(){let t={};`length`in e&&(r.byterange=t,t.length=e.length,`offset`in e||(e.offset=u)),`offset`in e&&(r.byterange=t,t.offset=e.offset),u=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){`mediaSequence`in this.manifest||(this.manifest.mediaSequence=0,this.trigger(`info`,{message:`defaulting media sequence to zero`})),`discontinuitySequence`in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger(`info`,{message:`defaulting discontinuity sequence to zero`})),e.title&&(r.title=e.title),e.duration>0&&(r.duration=e.duration),e.duration===0&&(r.duration=.01,this.trigger(`info`,{message:`updating zero segment duration to a small value`})),this.manifest.segments=n},key(){if(!e.attributes)this.trigger(`warn`,{message:`ignoring key declaration without attribute list`});else if(e.attributes.METHOD===`NONE`)a=null;else if(!e.attributes.URI)this.trigger(`warn`,{message:`ignoring key declaration without URI`});else if(e.attributes.KEYFORMAT===`com.apple.streamingkeydelivery`)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.apple.fps.1_0`]={attributes:e.attributes};else if(e.attributes.KEYFORMAT===`com.microsoft.playready`)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.microsoft.playready`]={uri:e.attributes.URI};else if(e.attributes.KEYFORMAT===`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`){if([`SAMPLE-AES`,`SAMPLE-AES-CTR`,`SAMPLE-AES-CENC`].indexOf(e.attributes.METHOD)===-1){this.trigger(`warn`,{message:`invalid key method provided for Widevine`});return}if(e.attributes.METHOD===`SAMPLE-AES-CENC`&&this.trigger(`warn`,{message:`SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead`}),e.attributes.URI.substring(0,23)!==`data:text/plain;base64,`){this.trigger(`warn`,{message:`invalid key URI provided for Widevine`});return}if(!(e.attributes.KEYID&&e.attributes.KEYID.substring(0,2)===`0x`)){this.trigger(`warn`,{message:`invalid key ID provided for Widevine`});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.widevine.alpha`]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:lt(e.attributes.URI.split(`,`)[1])}}else e.attributes.METHOD||this.trigger(`warn`,{message:`defaulting key method to AES-128`}),a={method:e.attributes.METHOD||`AES-128`,uri:e.attributes.URI},e.attributes.IV!==void 0&&(a.iv=e.attributes.IV)},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger(`warn`,{message:`ignoring invalid media sequence: `+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,l=e.number):this.trigger(`warn`,{message:`ignoring invalid discontinuity sequence: `+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger(`warn`,{message:`ignoring unknown playlist type: `+e.playlist})},map(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),a&&(i.key=a)},"stream-inf"(){this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes?(r.attributes||(r.attributes={}),R(r.attributes,e.attributes)):this.trigger(`warn`,{message:`ignoring empty stream-inf attributes`})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,!(e.attributes&&e.attributes.TYPE&&e.attributes[`GROUP-ID`]&&e.attributes.NAME)){this.trigger(`warn`,{message:`ignoring incomplete or missing media group`});return}let t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes[`GROUP-ID`]]=t[e.attributes[`GROUP-ID`]]||{},p=t[e.attributes[`GROUP-ID`]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes[`INSTREAM-ID`]&&(m.instreamId=e.attributes[`INSTREAM-ID`]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=m},discontinuity(){l+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),r.dateTimeString=e.dateTimeString,r.dateTimeObject=e.dateTimeObject;let{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),t===null&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-t.duration*1e3,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger(`warn`,{message:`ignoring invalid target duration: `+e.duration}):(this.manifest.targetDuration=e.duration,vt.call(this,this.manifest))},start(){!e.attributes||isNaN(e.attributes[`TIME-OFFSET`])?this.trigger(`warn`,{message:`ignoring start declaration without appropriate attribute list`}):this.manifest.start={timeOffset:e.attributes[`TIME-OFFSET`],precise:e.attributes.PRECISE}},"cue-out"(){r.cueOut=e.data},"cue-out-cont"(){r.cueOutCont=e.data},"cue-in"(){r.cueIn=e.data},skip(){this.manifest.skip=_t(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-SKIP`,e.attributes,[`SKIPPED-SEGMENTS`])},part(){o=!0;let t=this.manifest.segments.length,n=_t(e.attributes);r.parts=r.parts||[],r.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);let i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${t}`,e.attributes,[`URI`,`DURATION`]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty(`lastPart`)||this.trigger(`warn`,{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){let t=this.manifest.serverControl=_t(e.attributes);t.hasOwnProperty(`canBlockReload`)||(t.canBlockReload=!1,this.trigger(`info`,{message:`#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false`})),vt.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty(`canSkipUntil`)&&this.trigger(`warn`,{message:`#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set`})},"preload-hint"(){let t=this.manifest.segments.length,n=_t(e.attributes),i=n.type&&n.type===`PART`;r.preloadHints=r.preloadHints||[],r.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=i?d:0,i&&(d=n.byterange.offset+n.byterange.length)));let a=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${a} for segment #${t}`,e.attributes,[`TYPE`,`URI`]),n.type)for(let e=0;e<r.preloadHints.length-1;e++){let i=r.preloadHints[e];i.type&&i.type===n.type&&this.trigger(`warn`,{message:`#EXT-X-PRELOAD-HINT #${a} for segment #${t} has the same TYPE ${n.type} as preload hint #${e}`})}},"rendition-report"(){let t=_t(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);let n=this.manifest.renditionReports.length-1,r=[`LAST-MSN`,`URI`];o&&r.push(`LAST-PART`),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${n}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=_t(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-PART-INF`,e.attributes,[`PART-TARGET`]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),vt.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(_t(e.attributes));let t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,[`ID`,`START-DATE`]);let n=this.manifest.dateRanges[t];n.endDate&&n.startDate&&new Date(n.endDate)<new Date(n.startDate)&&this.trigger(`warn`,{message:`EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE`}),n.duration&&n.duration<0&&this.trigger(`warn`,{message:`EXT-X-DATERANGE DURATION must not be negative`}),n.plannedDuration&&n.plannedDuration<0&&this.trigger(`warn`,{message:`EXT-X-DATERANGE PLANNED-DURATION must not be negative`});let r=!!n.endOnNext;if(r&&!n.class&&this.trigger(`warn`,{message:`EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute`}),r&&(n.duration||n.endDate)&&this.trigger(`warn`,{message:`EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes`}),n.duration&&n.endDate){let e=n.startDate.getTime()+n.duration*1e3;this.manifest.dateRanges[t].endDate=new Date(e)}if(!f[n.id])f[n.id]=n;else{for(let e in f[n.id])if(n[e]&&JSON.stringify(f[n.id][e])!==JSON.stringify(n[e])){this.trigger(`warn`,{message:`EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values`});break}let e=this.manifest.dateRanges.findIndex(e=>e.id===n.id);this.manifest.dateRanges[e]=R(this.manifest.dateRanges[e],n),f[n.id]=R(f[n.id],n),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=_t(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-CONTENT-STEERING`,e.attributes,[`SERVER-URI`])},define(){this.manifest.definitions=this.manifest.definitions||{};let t=(e,t)=>{e in this.manifest.definitions?this.trigger(`error`,{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if(`QUERYPARAM`in e.attributes){if(`NAME`in e.attributes||`IMPORT`in e.attributes){this.trigger(`error`,{message:`EXT-X-DEFINE: Invalid attributes`});return}let n=this.params.get(e.attributes.QUERYPARAM);if(!n){this.trigger(`error`,{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`});return}t(e.attributes.QUERYPARAM,decodeURIComponent(n))}else if(`NAME`in e.attributes){if(`IMPORT`in e.attributes){this.trigger(`error`,{message:`EXT-X-DEFINE: Invalid attributes`});return}if(!(`VALUE`in e.attributes)||typeof e.attributes.VALUE!=`string`){this.trigger(`error`,{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`});return}t(e.attributes.NAME,e.attributes.VALUE)}else if(`IMPORT`in e.attributes){if(!this.mainDefinitions[e.attributes.IMPORT]){this.trigger(`error`,{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT])}else this.trigger(`error`,{message:`EXT-X-DEFINE: No attribute`})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:l}),this.warnOnMissingAttributes_(`#EXT-X-I-FRAME-STREAM-INF`,e.attributes,[`BANDWIDTH`,`URI`])}}[e.tagType]||s).call(t)},uri(){r.uri=e.uri,n.push(r),this.manifest.targetDuration&&!(`duration`in r)&&(this.trigger(`warn`,{message:`defaulting segment duration to the target duration`}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=l,i&&(r.map=i),d=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){e.segment?(r.custom=r.custom||{},r.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger(`warn`,{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,n){let r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger(`warn`,{message:`${e} lacks required attribute(s): ${r.join(`, `)}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
14
- `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger(`warn`,{message:`A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag`}),this.lastProgramDateTime=null,this.trigger(`end`)}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var bt={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},xt=[`video`,`audio`,`text`],St=[`Video`,`Audio`,`Text`],Ct=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){var r=(`00`+Number(t).toString(16)).slice(-2),i=(`00`+Number(n).toString(16)).slice(-2);return`avc1.`+r+`00`+i})},wt=function(e){e===void 0&&(e=``);var t=e.split(`,`),n=[];return t.forEach(function(e){e=e.trim();var t;xt.forEach(function(r){var i=bt[r].exec(e.toLowerCase());if(!(!i||i.length<=1)){t=r;var a=e.substring(0,i[1].length),o=e.replace(a,``);n.push({type:a,details:o,mediaType:r})}}),t||n.push({type:e,details:``,mediaType:`unknown`})}),n},Tt=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return wt(i.playlists[0].attributes.CODECS)}return null},Et=function(e){return e===void 0&&(e=``),bt.audio.test(e.trim().toLowerCase())},Dt=function(e){return e===void 0&&(e=``),bt.text.test(e.trim().toLowerCase())},Ot=function(e){if(e&&typeof e==`string`){var t=e.toLowerCase().split(`,`).map(function(e){return Ct(e.trim())}),n=`video`;t.length===1&&Et(t[0])?n=`audio`:t.length===1&&Dt(t[0])&&(n=`application`);var r=`mp4`;return t.every(function(e){return bt.mp4.test(e)})?r=`mp4`:t.every(function(e){return bt.webm.test(e)})?r=`webm`:t.every(function(e){return bt.ogg.test(e)})&&(r=`ogg`),n+`/`+r+`;codecs="`+e+`"`}},kt=function(e,t){return e===void 0&&(e=``),t===void 0&&(t=!1),x.MediaSource&&x.MediaSource.isTypeSupported&&x.MediaSource.isTypeSupported(Ot(e))||t&&x.ManagedMediaSource&&x.ManagedMediaSource.isTypeSupported&&x.ManagedMediaSource.isTypeSupported(Ot(e))||!1},At=function(e){return e===void 0&&(e=``),e.toLowerCase().split(`,`).every(function(e){e=e.trim();for(var t=0;t<St.length;t++)if(bt[`muxer`+St[t]].test(e))return!0;return!1})},jt=`mp4a.40.2`,Mt=`avc1.4d400d`,Nt=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Pt=/^application\/dash\+xml/i,Ft=function(e){return Nt.test(e)?`hls`:Pt.test(e)?`dash`:e===`application/vnd.videojs.vhs+json`?`vhs-json`:null},It=function(e){return e.toString(2).length},Lt=function(e){return Math.ceil(It(e)/8)},Rt=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},zt=function(e){return Rt(e)},z=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!zt(e)&&!(e instanceof ArrayBuffer)&&(e=typeof e!=`number`||typeof e==`number`&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Bt=x.BigInt||Number,Vt=[Bt(`0x1`),Bt(`0x100`),Bt(`0x10000`),Bt(`0x1000000`),Bt(`0x100000000`),Bt(`0x10000000000`),Bt(`0x1000000000000`),Bt(`0x100000000000000`),Bt(`0x10000000000000000`)];(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();var Ht=function(e,t){var n=t===void 0?{}:t,r=n.signed,i=r!==void 0&&r,a=n.le,o=a!==void 0&&a;e=z(e);var s=o?`reduce`:`reduceRight`,c=(e[s]?e[s]:Array.prototype[s]).call(e,function(t,n,r){var i=o?r:Math.abs(r+1-e.length);return t+Bt(n)*Vt[i]},Bt(0));if(i){var l=Vt[e.length]/Bt(2)-Bt(1);c=Bt(c),c>l&&(c-=l,c-=l,c-=Bt(2))}return Number(c)},Ut=function(e,t){var n={}.le,r=n!==void 0&&n;(typeof e!=`bigint`&&typeof e!=`number`||typeof e==`number`&&e!==e)&&(e=0),e=Bt(e);for(var i=Lt(e),a=new Uint8Array(new ArrayBuffer(i)),o=0;o<i;o++){var s=r?o:Math.abs(o+1-a.length);a[s]=Number(e/Vt[o]&Bt(255)),e<0&&(a[s]=Math.abs(~a[s]),a[s]-=o===0?1:2)}return a},Wt=function(e,t){if(typeof e!=`string`&&e&&typeof e.toString==`function`&&(e=e.toString()),typeof e!=`string`)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},Gt=function(){var e=[...arguments];if(e=e.filter(function(e){return e&&(e.byteLength||e.length)&&typeof e!=`string`}),e.length<=1)return z(e[0]);var t=e.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),n=new Uint8Array(t),r=0;return e.forEach(function(e){e=z(e),n.set(e,r),r+=e.byteLength}),n},B=function(e,t,n){var r=n===void 0?{}:n,i=r.offset,a=i===void 0?0:i,o=r.mask,s=o===void 0?[]:o;e=z(e),t=z(t);var c=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&c.call(t,function(t,n){return t===(s[n]?s[n]&e[a+n]:e[a+n])})},Kt=function(e,t,n){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var i in e.mediaGroups[t][r]){var a=e.mediaGroups[t][r][i];n(a,t,r,i)}})},qt={},Jt={},Yt={},Xt;function Zt(){if(Xt)return Yt;Xt=1;function e(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}}function t(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}function n(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var r=t({HTML:`text/html`,isHTML:function(e){return e===r.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),i=t({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===i.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`}),a=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=RegExp(`[\\-\\.0-9`+a.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),s=RegExp(`^`+a.source+o.source+`*(?::`+a.source+o.source+`*)?$`);return Yt.assign=n,Yt.find=e,Yt.freeze=t,Yt.MIME_TYPE=r,Yt.NAMESPACE=i,Yt.nameStartChar=a,Yt.nameChar=o,Yt.tagNamePattern=s,Yt}var Qt;function $t(){if(Qt)return Jt;Qt=1;var e=Zt(),t=e.find,n=e.NAMESPACE,r=e.tagNamePattern;function i(e){return e!==``}function a(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=a(e);return Object.keys(t.reduce(o,{}))}function c(e){return function(t){return e&&e.indexOf(t)!==-1}}function l(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function u(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,l(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,p=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,h=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,_=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,y=d.COMMENT_NODE=8,b=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,S=d.DOCUMENT_FRAGMENT_NODE=11,C=d.NOTATION_NODE=12,w={},T={};w.INDEX_SIZE_ERR=(T[1]=`Index size error`,1),w.DOMSTRING_SIZE_ERR=(T[2]=`DOMString size error`,2);var E=w.HIERARCHY_REQUEST_ERR=(T[3]=`Hierarchy request error`,3);w.WRONG_DOCUMENT_ERR=(T[4]=`Wrong document`,4);var D=w.INVALID_CHARACTER_ERR=(T[5]=`Invalid character`,5);w.NO_DATA_ALLOWED_ERR=(T[6]=`No data allowed`,6),w.NO_MODIFICATION_ALLOWED_ERR=(T[7]=`No modification allowed`,7);var O=w.NOT_FOUND_ERR=(T[8]=`Not found`,8);w.NOT_SUPPORTED_ERR=(T[9]=`Not supported`,9);var ee=w.INUSE_ATTRIBUTE_ERR=(T[10]=`Attribute in use`,10),k=w.INVALID_STATE_ERR=(T[11]=`Invalid state`,11);w.SYNTAX_ERR=(T[12]=`Syntax error`,12),w.INVALID_MODIFICATION_ERR=(T[13]=`Invalid modification`,13),w.NAMESPACE_ERR=(T[14]=`Invalid namespace`,14),w.INVALID_ACCESS_ERR=(T[15]=`Invalid access`,15);function A(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,T[e]),this.message=T[e],Error.captureStackTrace&&Error.captureStackTrace(this,A);return n.code=e,t&&(this.message=this.message+`: `+t),n}A.prototype=Error.prototype,l(w,A);function te(){}te.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,n){for(var r=!!n&&!!n.requireWellFormed,i=[],a=0;a<this.length;a++)Ue(this[a],i,e,t,null,r);return i.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function ne(e,t){this._node=e,this._refresh=t,re(this)}function re(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ke(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];l(n,e),e._inc=t}}ne.prototype.item=function(e){return re(this),this[e]||null},u(ne,te);function ie(){this._nameIndex=Object.create(null)}function j(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function ae(e,t){e._nameIndex[t.nodeName]=t}function oe(e,t){e._nameIndex[t.nodeName]===t&&delete e._nameIndex[t.nodeName]}function se(e,t,n,r){if(r?(t[j(t,r)]=n,oe(t,r)):t[t.length++]=n,ae(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&he(i,e,r),me(i,e,n))}}function ce(e,t,n){var r=j(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,oe(t,n),e){var a=e.ownerDocument;a&&(he(a,e,n),n.ownerElement=null)}}else throw new A(O,Error(e.tagName+`@`+n))}ie.prototype={length:0,item:te.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new A(ee);var n=this._nameIndex[e.nodeName];return se(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new A(ee);return n=this.getNamedItemNS(e.namespaceURI,e.localName),se(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return ce(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return ce(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function le(){}le.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new pe;if(r.implementation=this,r.childNodes=new te,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new Pe;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function M(){}M.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Ee(this,e,t)},replaceChild:function(e,t){Ee(this,e,t,P),t&&this.removeChild(t)},removeChild:function(e){return _e(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Ge(this.ownerDocument||this,this,e)},normalize:function(){fe(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===m&&t.nodeType===m){for(var r=[],i=n;i!==null&&i.nodeType===m;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),ge(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r}t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function ue(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}l(d,M),l(d,M.prototype);function de(e,t){return fe(e,null,{enter:function(e){return!t(e)||fe.STOP}})===fe.STOP}function fe(e,t,n){for(var r=[{node:e,context:t,phase:fe.ENTER}];r.length>0;){var i=r.pop();if(i.phase===fe.ENTER){var a=n.enter(i.node,i.context);if(a===fe.STOP)return fe.STOP;if(r.push({node:i.node,context:a,phase:fe.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:fe.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}fe.STOP=Symbol(`walkDOM.STOP`),fe.ENTER=0,fe.EXIT=1;function pe(){this.ownerDocument=this}function me(e,t,r){e&&e._inc++,r.namespaceURI===n.XMLNS&&(t._nsMap[r.prefix?r.localName:``]=r.value)}function he(e,t,r,i){e&&e._inc++,r.namespaceURI===n.XMLNS&&delete t._nsMap[r.prefix?r.localName:``]}function ge(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function _e(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,ge(e.ownerDocument,e),t}function N(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}function ve(e){return e&&(be(e)||xe(e)||ye(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}function ye(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function be(e){return e&&e.nodeType===M.ELEMENT_NODE}function xe(e){return e&&e.nodeType===M.TEXT_NODE}function Se(e,n){var r=e.childNodes||[];if(t(r,be)||ye(n))return!1;var i=t(r,ye);return!(n&&i&&r.indexOf(i)>r.indexOf(n))}function Ce(e,n){var r=e.childNodes||[];function i(e){return be(e)&&e!==n}if(t(r,i))return!1;var a=t(r,ye);return!(n&&a&&r.indexOf(a)>r.indexOf(n))}function we(e,t,n){if(!N(e))throw new A(E,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new A(O,`child not in parent`);if(!ve(t)||ye(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new A(E,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Te(e,n,r){var i=e.childNodes||[],a=n.childNodes||[];if(n.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||t(a,xe))throw new A(E,`More than one element or text in fragment`);if(o.length===1&&!Se(e,r))throw new A(E,`Element in fragment can not be inserted before doctype`)}if(be(n)&&!Se(e,r))throw new A(E,`Only one element can be added and only after doctype`);if(ye(n)){if(t(i,ye))throw new A(E,`Only one doctype is allowed`);var s=t(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new A(E,`Doctype can only be inserted before an element`);if(!r&&s)throw new A(E,`Doctype can not be appended since element is present`)}}function P(e,n,r){var i=e.childNodes||[],a=n.childNodes||[];if(n.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||t(a,xe))throw new A(E,`More than one element or text in fragment`);if(o.length===1&&!Ce(e,r))throw new A(E,`Element in fragment can not be inserted before doctype`)}if(be(n)&&!Ce(e,r))throw new A(E,`Only one element can be added and only after doctype`);if(ye(n)){function e(e){return ye(e)&&e!==r}if(t(i,e))throw new A(E,`Only one doctype is allowed`);var s=t(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new A(E,`Doctype can only be inserted before an element`)}}function Ee(e,t,n,r){we(e,t,n),e.nodeType===M.DOCUMENT_NODE&&(r||Te)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===S){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e;var c=e.ownerDocument||e;F(a,c)}while(a!==o&&(a=a.nextSibling));return ge(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function F(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===f&&e.attributes)for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);r&&(r.ownerDocument=t)}for(var i=e.firstChild;i;)F(i,t),i=i.nextSibling}}function De(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,ge(e.ownerDocument,e,t),F(t,e.ownerDocument||e),t}pe.prototype={nodeName:`#document`,nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Ee(this,e,t),F(e,this),this.documentElement===null&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),_e(this,e)},replaceChild:function(e,t){Ee(this,e,t,P),F(e,this),t&&this.removeChild(t),be(e)&&(this.documentElement=e)},importNode:function(e,t){return We(this,e,t)},getElementById:function(e){var t=null;return de(this.documentElement,function(n){if(n.nodeType==f&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new ne(this,function(n){var r=[];return t.length>0&&de(n.documentElement,function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var l=s(a);o=t.every(c(l))}o&&r.push(i)}}}),r})},createElement:function(e){var t=new Oe;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new te;var n=t.attributes=new ie;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Re;return e.ownerDocument=this,e.childNodes=new te,e},createTextNode:function(e){var t=new je;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Me;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new A(D,`data contains "]]>"`);var t=new Ne;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ze;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ke;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!r.test(e))throw new A(D,`not a valid xml name "`+e+`"`);var t=new Le;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Oe,r=t.split(`:`),i=n.attributes=new ie;return n.childNodes=new te,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ke,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},u(pe,M);function Oe(){this._nsMap={}}Oe.prototype={nodeType:f,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):De(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ne(this,function(t){var n=[];return de(t,function(r){r!==t&&r.nodeType==f&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new ne(this,function(n){var r=[];return de(n,function(i){i!==n&&i.nodeType===f&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},pe.prototype.getElementsByTagName=Oe.prototype.getElementsByTagName,pe.prototype.getElementsByTagNameNS=Oe.prototype.getElementsByTagNameNS,u(Oe,M);function ke(){}ke.prototype.nodeType=p,u(ke,M);function Ae(){}Ae.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(T[E])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},u(Ae,M);function je(){}je.prototype={nodeName:`#text`,nodeType:m,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},u(je,Ae);function Me(){}Me.prototype={nodeName:`#comment`,nodeType:y},u(Me,Ae);function Ne(){}Ne.prototype={nodeName:`#cdata-section`,nodeType:h},u(Ne,Ae);function Pe(){}Pe.prototype.nodeType=x,u(Pe,M);function Fe(){}Fe.prototype.nodeType=C,u(Fe,M);function Ie(){}Ie.prototype.nodeType=_,u(Ie,M);function Le(){}Le.prototype.nodeType=g,u(Le,M);function Re(){}Re.prototype.nodeName=`#document-fragment`,Re.prototype.nodeType=S,u(Re,M);function ze(){}ze.prototype.nodeType=v,u(ze,M);function Be(){}Be.prototype.serializeToString=function(e,t,n,r){return Ve.call(e,t,n,r)},M.prototype.toString=Ve;function Ve(e,t,n){var r=!!n&&!!n.requireWellFormed,i=[],a=this.nodeType==9&&this.documentElement||this,o=a.prefix,s=a.namespaceURI;if(s&&o==null){var o=a.lookupPrefix(s);if(o==null)var c=[{namespace:s,prefix:null}]}return Ue(this,i,e,t,c,r),i.join(``)}function I(e,t,r){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===n.XML||a===n.XMLNS)return!1;for(var o=r.length;o--;){var s=r[o];if(s.prefix===i)return s.namespace!==a}return!0}function He(e,t,n,i){if(i&&!r.test(t))throw new A(k,`The attribute name "`+t+`" is not a valid XML QName`);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,ue),`"`)}function Ue(e,t,i,a,o,s){o||=[],fe(e,{ns:o,isHTML:i},{enter:function(e,i){var o=i.ns,c=i.isHTML;if(a){if(e=a(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case f:var l=e.attributes,u=l.length,d=e.tagName;c=n.isHTML(e.namespaceURI)||c;var _=d;if(!c&&!e.prefix&&e.namespaceURI){for(var C,w=0;w<l.length;w++)if(l.item(w).name===`xmlns`){C=l.item(w).value;break}if(!C)for(var T=o.length-1;T>=0;T--){var E=o[T];if(E.prefix===``&&E.namespace===e.namespaceURI){C=E.namespace;break}}if(C!==e.namespaceURI)for(var T=o.length-1;T>=0;T--){var E=o[T];if(E.namespace===e.namespaceURI){E.prefix&&(_=E.prefix+`:`+d);break}}}if(s&&!r.test(_))throw new A(k,`The element name "`+_+`" is not a valid XML QName`);t.push(`<`,_);for(var D=o.slice(),O=0;O<u;O++){var ee=l.item(O);ee.prefix==`xmlns`?D.push({prefix:ee.localName,namespace:ee.value}):ee.nodeName==`xmlns`&&D.push({prefix:``,namespace:ee.value})}for(var O=0;O<u;O++){var ee=l.item(O);if(I(ee,c,D)){var te=ee.prefix||``,ne=ee.namespaceURI;He(t,te?`xmlns:`+te:`xmlns`,ne,s),D.push({prefix:te,namespace:ne})}var re=a?a(ee):ee;re&&(typeof re==`string`?t.push(re):He(t,re.name,re.value,s))}if(d===_&&I(e,c,D)){var ie=e.prefix||``,ne=e.namespaceURI;He(t,ie?`xmlns:`+ie:`xmlns`,ne,s),D.push({prefix:ie,namespace:ne})}var j=e.firstChild;if(j||c&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(`>`),c&&/^script$/i.test(d)){for(;j;)j.data?t.push(j.data):Ue(j,t,c,a,D.slice(),s),j=j.nextSibling;return t.push(`</`,d,`>`),null}return{ns:D,isHTML:c,tag:_}}return t.push(`/>`),null;case b:case S:return{ns:o.slice(),isHTML:c,tag:null};case p:return He(t,e.name,e.value,s),null;case m:return t.push(e.data.replace(/[<&>]/g,ue)),null;case h:if(s&&e.data.indexOf(`]]>`)!==-1)throw new A(k,`The CDATASection data contains "]]>"`);return t.push(`<![CDATA[`,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),`]]>`),null;case y:if(s&&e.data.indexOf(`-->`)!==-1)throw new A(k,`The comment node data contains "-->"`);return t.push(`<!--`,e.data,`-->`),null;case x:if(s){if(!r.test(e.name))throw new A(k,`The doctype name "`+e.name+`" is not a valid XML Name`);if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new A(k,`DocumentType publicId is not a valid PubidLiteral`);if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new A(k,`DocumentType systemId is not a valid SystemLiteral`);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new A(k,`DocumentType internalSubset contains "]>"`)}var ae=e.publicId,oe=e.systemId;if(t.push(`<!DOCTYPE `,e.name),ae)t.push(` PUBLIC `,ae),oe&&oe!=`.`&&t.push(` `,oe),t.push(`>`);else if(oe&&oe!=`.`)t.push(` SYSTEM `,oe,`>`);else{var se=e.internalSubset;se&&t.push(` [`,se,`]`),t.push(`>`)}return null;case v:if(s){if(!r.test(e.target)||e.target.indexOf(`:`)!==-1||e.target.toLowerCase()===`xml`)throw new A(k,`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`);if(e.data.indexOf(`?>`)!==-1)throw new A(k,`The ProcessingInstruction data contains "?>"`)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case g:if(s&&!r.test(e.nodeName))throw new A(k,`The entity reference name "`+e.nodeName+`" is not a valid XML Name`);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function We(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===p||n?a:null}}),r}function Ge(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=t[o];typeof s!=`object`&&s!=a[o]&&(a[o]=s)}t.childNodes&&(a.childNodes=new te),a.ownerDocument=e;var c=n;switch(a.nodeType){case f:var l=t.attributes,u=a.attributes=new ie,d=l.length;u._ownerElement=a;for(var m=0;m<d;m++)a.setAttributeNode(Ge(e,l.item(m),!0));break;case p:c=!0}return i===null?r=a:i.appendChild(a),c?a:null}}),r}function Ke(e,t,n){e[t]=n}try{Object.defineProperty&&(Object.defineProperty(ne.prototype,"length",{get:function(){return re(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){if(this.nodeType===f||this.nodeType===S){var e=[];return fe(this,null,{enter:function(t){if(t.nodeType===f||t.nodeType===S)return!0;if(t.nodeType===v||t.nodeType===y)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case f:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Ke=function(e,t,n){e[`$$`+t]=n})}catch{}return Jt.DocumentType=Pe,Jt.DOMException=A,Jt.DOMImplementation=le,Jt.Element=Oe,Jt.Node=M,Jt.NodeList=te,Jt.walkDOM=fe,Jt.XMLSerializer=Be,Jt}var en={},tn={},nn;function rn(){return nn||(nn=1,function(e){var t=Zt().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:`⁡`,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:`⁡`,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:`⁣`,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
15
- `,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:`­`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:`  `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:`​`,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`}),e.entityMap=e.HTML_ENTITIES}(tn)),tn}var an={},on;function sn(){if(on)return an;on=1;var e=Zt().NAMESPACE,t=Zt().tagNamePattern,n=0,r=1,i=2,a=3,o=4,s=5,c=6,l=7;function u(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,u)}u.prototype=Error(),u.prototype.name=u.name;function d(){}d.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),v(t,t={}),f(e,t,n,r,this.errorHandler),r.endDocument()}};function f(n,r,i,a,o){function s(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:t.charAt(0)===`#`?s(parseInt(t.substr(1).replace(`x`,`0x`))):(o.error(`entity not found:`+e),e)}function l(e){if(e>E){var t=n.substring(E,e).replace(/&#?\w+;/g,c);C&&d(E),a.characters(t,0,e-E),E=e}}function d(e,t){for(;e>=v&&(t=S.exec(n));)f=t.index,v=f+t[0].length,C.lineNumber++;C.columnNumber=e-f+1}for(var f=0,v=0,S=/.*(?:\r\n?|\n)|.*$/g,C=a.locator,w=[{currentNSMap:r}],T={},E=0;;){try{var D=n.indexOf(`<`,E);if(D<0){if(!n.substr(E).match(/^\s*$/)){var O=a.doc,ee=O.createTextNode(n.substr(E));O.appendChild(ee),a.currentElement=ee}return}switch(D>E&&l(D),n.charAt(D+1)){case`/`:var k=n.indexOf(`>`,D+3),A=n.substring(D+2,k).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,`$1`),te=w.pop();k<0?(A=n.substring(D+2).replace(/[\s<].*/,``),o.error(`end tag name: `+A+` is not complete:`+te.tagName),k=D+1+A.length):A.match(/\s</)?(A=A.replace(/[\s<].*/,``),o.error(`end tag name: `+A+` maybe not complete`),k=D+1+A.length):/[ \t\n\r]/.test(A)&&t.test(A.split(/[ \t\n\r]/)[0])&&o.error(`end tag name is followed by whitespace and trailing content: "`+A+`"`);var ne=te.localNSMap,re=te.tagName==A;if(re||te.tagName&&te.tagName.toLowerCase()==A.toLowerCase()){if(a.endElement(te.uri,te.localName,A),ne)for(var ie in ne)Object.prototype.hasOwnProperty.call(ne,ie)&&a.endPrefixMapping(ie);re||o.fatalError(`end tag name: `+A+` is not match the current start tagName:`+te.tagName)}else w.push(te);k++;break;case`?`:C&&d(D),k=b(n,D,a);break;case`!`:C&&d(D),k=y(n,D,a,o);break;default:C&&d(D);var j=new x,ae=w[w.length-1].currentNSMap,k=m(n,D,j,ae,c,o),oe=j.length;if(!j.closed&&_(n,k,j.tagName,T)&&(j.closed=!0,i.nbsp||o.warning(`unclosed xml attribute`)),C&&oe){for(var se=p(C,{}),ce=0;ce<oe;ce++){var le=j[ce];d(le.offset),le.locator=p(C,{})}a.locator=se,h(j,a,ae)&&w.push(j),a.locator=C}else h(j,a,ae)&&w.push(j);e.isHTML(j.uri)&&!j.closed?k=g(n,k,j.tagName,c,a):k++}}catch(e){if(e instanceof u)throw e;o.error(`element parse error: `+e),k=-1}k>E?E=k:l(Math.max(D,E)+1)}}function p(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function m(t,u,d,f,p,m){function h(e,t,n){d.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),d.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(/&#?\w+;/g,p),n)}for(var g,_,v=++u,y=n;;){var b=t.charAt(v);if(y===n&&b===`<`)throw Error(`unexpected < in tag name: `+t.slice(u,v));switch(b){case`=`:if(y===r)g=t.slice(u,v),y=a;else if(y===i)y=a;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===a||y===r){if(y===r&&(m.warning(`attribute value must after "="`),g=t.slice(u,v)),u=v+1,v=t.indexOf(b,u),v>0)_=t.slice(u,v),h(g,_,u-1),y=s;else throw Error(`attribute value no end '`+b+`' match`)}else if(y==o)_=t.slice(u,v),h(g,_,u),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),u=v+1,y=s;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case n:d.setTagName(t.slice(u,v));case s:case c:case l:y=l,d.closed=!0;case o:case r:break;case i:d.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==n&&d.setTagName(t.slice(u,v)),v;case`>`:switch(y){case n:d.setTagName(t.slice(u,v));case s:case c:case l:break;case o:case r:_=t.slice(u,v),_.slice(-1)===`/`&&(d.closed=!0,_=_.slice(0,-1));case i:y===i&&(_=g),y==o?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_,u)):((!e.isHTML(f[``])||!_.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,u));break;case a:throw Error(`attribute value missed!!`)}return v;case`€`:b=` `;default:if(b<=` `)switch(y){case n:d.setTagName(t.slice(u,v)),y=c;break;case r:g=t.slice(u,v),y=i;break;case o:var _=t.slice(u,v);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,u);case s:y=c}else switch(y){case i:d.tagName,(!e.isHTML(f[``])||!g.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,u),u=v,y=r;break;case s:m.warning(`attribute space is required"`+g+`"!!`);case c:y=r,u=v;break;case a:y=o,u=v;break;case l:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function h(t,n,r){for(var i=t.tagName,a=null,o=t.length;o--;){var s=t[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},r=Object.create(r)),r[p]=a[p]=l,s.uri=e.XMLNS,n.startPrefixMapping(p,l))}for(var o=t.length;o--;){s=t[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=e.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=t.prefix=i.slice(0,u),f=t.localName=i.slice(u+1)):(d=null,f=t.localName=i);var m=t.uri=r[d||``];if(n.startElement(m,f,i,t),t.closed){if(n.endElement(m,f,i),a)for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&n.endPrefixMapping(d)}else return t.currentNSMap=r,t.localNSMap=a,!0}function g(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function _(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function v(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function y(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=S(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function b(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function x(){this.attributeNames={}}x.prototype={setTagName:function(e){if(!t.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,n,r){if(!t.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:n,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function S(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}return an.XMLReader=d,an.ParseError=u,an}var cn;function ln(){if(cn)return en;cn=1;var e=Zt(),t=$t(),n=rn(),r=sn(),i=t.DOMImplementation,a=e.NAMESPACE,o=r.ParseError,s=r.XMLReader;function c(e){return e.replace(/\r[\n\u0085]/g,`
14
+ `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger(`warn`,{message:`A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag`}),this.lastProgramDateTime=null,this.trigger(`end`)}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var bt={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},xt=[`video`,`audio`,`text`],St=[`Video`,`Audio`,`Text`],Ct=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){var r=(`00`+Number(t).toString(16)).slice(-2),i=(`00`+Number(n).toString(16)).slice(-2);return`avc1.`+r+`00`+i})},wt=function(e){e===void 0&&(e=``);var t=e.split(`,`),n=[];return t.forEach(function(e){e=e.trim();var t;xt.forEach(function(r){var i=bt[r].exec(e.toLowerCase());if(!(!i||i.length<=1)){t=r;var a=e.substring(0,i[1].length),o=e.replace(a,``);n.push({type:a,details:o,mediaType:r})}}),t||n.push({type:e,details:``,mediaType:`unknown`})}),n},Tt=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return wt(i.playlists[0].attributes.CODECS)}return null},Et=function(e){return e===void 0&&(e=``),bt.audio.test(e.trim().toLowerCase())},Dt=function(e){return e===void 0&&(e=``),bt.text.test(e.trim().toLowerCase())},Ot=function(e){if(e&&typeof e==`string`){var t=e.toLowerCase().split(`,`).map(function(e){return Ct(e.trim())}),n=`video`;t.length===1&&Et(t[0])?n=`audio`:t.length===1&&Dt(t[0])&&(n=`application`);var r=`mp4`;return t.every(function(e){return bt.mp4.test(e)})?r=`mp4`:t.every(function(e){return bt.webm.test(e)})?r=`webm`:t.every(function(e){return bt.ogg.test(e)})&&(r=`ogg`),n+`/`+r+`;codecs="`+e+`"`}},kt=function(e,t){return e===void 0&&(e=``),t===void 0&&(t=!1),x.MediaSource&&x.MediaSource.isTypeSupported&&x.MediaSource.isTypeSupported(Ot(e))||t&&x.ManagedMediaSource&&x.ManagedMediaSource.isTypeSupported&&x.ManagedMediaSource.isTypeSupported(Ot(e))||!1},At=function(e){return e===void 0&&(e=``),e.toLowerCase().split(`,`).every(function(e){e=e.trim();for(var t=0;t<St.length;t++)if(bt[`muxer`+St[t]].test(e))return!0;return!1})},jt=`mp4a.40.2`,Mt=`avc1.4d400d`,Nt=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Pt=/^application\/dash\+xml/i,Ft=function(e){return Nt.test(e)?`hls`:Pt.test(e)?`dash`:e===`application/vnd.videojs.vhs+json`?`vhs-json`:null},It=function(e){return e.toString(2).length},Lt=function(e){return Math.ceil(It(e)/8)},Rt=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},zt=function(e){return Rt(e)},z=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||zt(e)||e instanceof ArrayBuffer||(e=typeof e!=`number`||typeof e==`number`&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Bt=x.BigInt||Number,Vt=[Bt(`0x1`),Bt(`0x100`),Bt(`0x10000`),Bt(`0x1000000`),Bt(`0x100000000`),Bt(`0x10000000000`),Bt(`0x1000000000000`),Bt(`0x100000000000000`),Bt(`0x10000000000000000`)];(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();var Ht=function(e,t){var n=t===void 0?{}:t,r=n.signed,i=r!==void 0&&r,a=n.le,o=a!==void 0&&a;e=z(e);var s=o?`reduce`:`reduceRight`,c=(e[s]?e[s]:Array.prototype[s]).call(e,function(t,n,r){var i=o?r:Math.abs(r+1-e.length);return t+Bt(n)*Vt[i]},Bt(0));if(i){var l=Vt[e.length]/Bt(2)-Bt(1);c=Bt(c),c>l&&(c-=l,c-=l,c-=Bt(2))}return Number(c)},Ut=function(e,t){var n={}.le,r=n!==void 0&&n;(typeof e!=`bigint`&&typeof e!=`number`||typeof e==`number`&&e!==e)&&(e=0),e=Bt(e);for(var i=Lt(e),a=new Uint8Array(new ArrayBuffer(i)),o=0;o<i;o++){var s=r?o:Math.abs(o+1-a.length);a[s]=Number(e/Vt[o]&Bt(255)),e<0&&(a[s]=Math.abs(~a[s]),a[s]-=o===0?1:2)}return a},Wt=function(e,t){if(typeof e!=`string`&&e&&typeof e.toString==`function`&&(e=e.toString()),typeof e!=`string`)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},Gt=function(){var e=[...arguments];if(e=e.filter(function(e){return e&&(e.byteLength||e.length)&&typeof e!=`string`}),e.length<=1)return z(e[0]);var t=e.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),n=new Uint8Array(t),r=0;return e.forEach(function(e){e=z(e),n.set(e,r),r+=e.byteLength}),n},B=function(e,t,n){var r=n===void 0?{}:n,i=r.offset,a=i===void 0?0:i,o=r.mask,s=o===void 0?[]:o;e=z(e),t=z(t);var c=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&c.call(t,function(t,n){return t===(s[n]?s[n]&e[a+n]:e[a+n])})},Kt=function(e,t,n){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var i in e.mediaGroups[t][r]){var a=e.mediaGroups[t][r][i];n(a,t,r,i)}})},qt={},Jt={},Yt={},Xt;function Zt(){if(Xt)return Yt;Xt=1;function e(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}}function t(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}function n(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var r=t({HTML:`text/html`,isHTML:function(e){return e===r.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),i=t({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===i.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`}),a=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=RegExp(`[\\-\\.0-9`+a.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),s=RegExp(`^`+a.source+o.source+`*(?::`+a.source+o.source+`*)?$`);return Yt.assign=n,Yt.find=e,Yt.freeze=t,Yt.MIME_TYPE=r,Yt.NAMESPACE=i,Yt.nameStartChar=a,Yt.nameChar=o,Yt.tagNamePattern=s,Yt}var Qt;function $t(){if(Qt)return Jt;Qt=1;var e=Zt(),t=e.find,n=e.NAMESPACE,r=e.tagNamePattern;function i(e){return e!==``}function a(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=a(e);return Object.keys(t.reduce(o,{}))}function c(e){return function(t){return e&&e.indexOf(t)!==-1}}function l(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function u(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,l(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,p=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,h=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,_=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,y=d.COMMENT_NODE=8,b=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,S=d.DOCUMENT_FRAGMENT_NODE=11,C=d.NOTATION_NODE=12,w={},T={};w.INDEX_SIZE_ERR=(T[1]=`Index size error`,1),w.DOMSTRING_SIZE_ERR=(T[2]=`DOMString size error`,2);var E=w.HIERARCHY_REQUEST_ERR=(T[3]=`Hierarchy request error`,3);w.WRONG_DOCUMENT_ERR=(T[4]=`Wrong document`,4);var D=w.INVALID_CHARACTER_ERR=(T[5]=`Invalid character`,5);w.NO_DATA_ALLOWED_ERR=(T[6]=`No data allowed`,6),w.NO_MODIFICATION_ALLOWED_ERR=(T[7]=`No modification allowed`,7);var O=w.NOT_FOUND_ERR=(T[8]=`Not found`,8);w.NOT_SUPPORTED_ERR=(T[9]=`Not supported`,9);var ee=w.INUSE_ATTRIBUTE_ERR=(T[10]=`Attribute in use`,10),k=w.INVALID_STATE_ERR=(T[11]=`Invalid state`,11);w.SYNTAX_ERR=(T[12]=`Syntax error`,12),w.INVALID_MODIFICATION_ERR=(T[13]=`Invalid modification`,13),w.NAMESPACE_ERR=(T[14]=`Invalid namespace`,14),w.INVALID_ACCESS_ERR=(T[15]=`Invalid access`,15);function A(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,T[e]),this.message=T[e],Error.captureStackTrace&&Error.captureStackTrace(this,A);return n.code=e,t&&(this.message=this.message+`: `+t),n}A.prototype=Error.prototype,l(w,A);function te(){}te.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,n){for(var r=!!n&&!!n.requireWellFormed,i=[],a=0;a<this.length;a++)Ue(this[a],i,e,t,null,r);return i.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function ne(e,t){this._node=e,this._refresh=t,re(this)}function re(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ke(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];l(n,e),e._inc=t}}ne.prototype.item=function(e){return re(this),this[e]||null},u(ne,te);function ie(){this._nameIndex=Object.create(null)}function j(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function ae(e,t){e._nameIndex[t.nodeName]=t}function oe(e,t){e._nameIndex[t.nodeName]===t&&delete e._nameIndex[t.nodeName]}function se(e,t,n,r){if(r?(t[j(t,r)]=n,oe(t,r)):t[t.length++]=n,ae(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&he(i,e,r),me(i,e,n))}}function ce(e,t,n){var r=j(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,oe(t,n),e){var a=e.ownerDocument;a&&(he(a,e,n),n.ownerElement=null)}}else throw new A(O,Error(e.tagName+`@`+n))}ie.prototype={length:0,item:te.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new A(ee);var n=this._nameIndex[e.nodeName];return se(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new A(ee);return n=this.getNamedItemNS(e.namespaceURI,e.localName),se(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return ce(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return ce(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function le(){}le.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new pe;if(r.implementation=this,r.childNodes=new te,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new Pe;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function M(){}M.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Ee(this,e,t)},replaceChild:function(e,t){Ee(this,e,t,P),t&&this.removeChild(t)},removeChild:function(e){return _e(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Ge(this.ownerDocument||this,this,e)},normalize:function(){fe(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===m&&t.nodeType===m){for(var r=[],i=n;i!==null&&i.nodeType===m;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),ge(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r}t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function ue(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}l(d,M),l(d,M.prototype);function de(e,t){return fe(e,null,{enter:function(e){return!t(e)||fe.STOP}})===fe.STOP}function fe(e,t,n){for(var r=[{node:e,context:t,phase:fe.ENTER}];r.length>0;){var i=r.pop();if(i.phase===fe.ENTER){var a=n.enter(i.node,i.context);if(a===fe.STOP)return fe.STOP;if(r.push({node:i.node,context:a,phase:fe.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:fe.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}fe.STOP=Symbol(`walkDOM.STOP`),fe.ENTER=0,fe.EXIT=1;function pe(){this.ownerDocument=this}function me(e,t,r){e&&e._inc++,r.namespaceURI===n.XMLNS&&(t._nsMap[r.prefix?r.localName:``]=r.value)}function he(e,t,r,i){e&&e._inc++,r.namespaceURI===n.XMLNS&&delete t._nsMap[r.prefix?r.localName:``]}function ge(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function _e(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,ge(e.ownerDocument,e),t}function N(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}function ve(e){return e&&(be(e)||xe(e)||ye(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}function ye(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function be(e){return e&&e.nodeType===M.ELEMENT_NODE}function xe(e){return e&&e.nodeType===M.TEXT_NODE}function Se(e,n){var r=e.childNodes||[];if(t(r,be)||ye(n))return!1;var i=t(r,ye);return!(n&&i&&r.indexOf(i)>r.indexOf(n))}function Ce(e,n){var r=e.childNodes||[];function i(e){return be(e)&&e!==n}if(t(r,i))return!1;var a=t(r,ye);return!(n&&a&&r.indexOf(a)>r.indexOf(n))}function we(e,t,n){if(!N(e))throw new A(E,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new A(O,`child not in parent`);if(!ve(t)||ye(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new A(E,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Te(e,n,r){var i=e.childNodes||[],a=n.childNodes||[];if(n.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||t(a,xe))throw new A(E,`More than one element or text in fragment`);if(o.length===1&&!Se(e,r))throw new A(E,`Element in fragment can not be inserted before doctype`)}if(be(n)&&!Se(e,r))throw new A(E,`Only one element can be added and only after doctype`);if(ye(n)){if(t(i,ye))throw new A(E,`Only one doctype is allowed`);var s=t(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new A(E,`Doctype can only be inserted before an element`);if(!r&&s)throw new A(E,`Doctype can not be appended since element is present`)}}function P(e,n,r){var i=e.childNodes||[],a=n.childNodes||[];if(n.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||t(a,xe))throw new A(E,`More than one element or text in fragment`);if(o.length===1&&!Ce(e,r))throw new A(E,`Element in fragment can not be inserted before doctype`)}if(be(n)&&!Ce(e,r))throw new A(E,`Only one element can be added and only after doctype`);if(ye(n)){function e(e){return ye(e)&&e!==r}if(t(i,e))throw new A(E,`Only one doctype is allowed`);var s=t(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new A(E,`Doctype can only be inserted before an element`)}}function Ee(e,t,n,r){we(e,t,n),e.nodeType===M.DOCUMENT_NODE&&(r||Te)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===S){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e;var c=e.ownerDocument||e;F(a,c)}while(a!==o&&(a=a.nextSibling));return ge(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function F(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===f&&e.attributes)for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);r&&(r.ownerDocument=t)}for(var i=e.firstChild;i;)F(i,t),i=i.nextSibling}}function De(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,ge(e.ownerDocument,e,t),F(t,e.ownerDocument||e),t}pe.prototype={nodeName:`#document`,nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Ee(this,e,t),F(e,this),this.documentElement===null&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),_e(this,e)},replaceChild:function(e,t){Ee(this,e,t,P),F(e,this),t&&this.removeChild(t),be(e)&&(this.documentElement=e)},importNode:function(e,t){return We(this,e,t)},getElementById:function(e){var t=null;return de(this.documentElement,function(n){if(n.nodeType==f&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new ne(this,function(n){var r=[];return t.length>0&&de(n.documentElement,function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var l=s(a);o=t.every(c(l))}o&&r.push(i)}}}),r})},createElement:function(e){var t=new Oe;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new te;var n=t.attributes=new ie;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Re;return e.ownerDocument=this,e.childNodes=new te,e},createTextNode:function(e){var t=new je;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Me;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new A(D,`data contains "]]>"`);var t=new Ne;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ze;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ke;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!r.test(e))throw new A(D,`not a valid xml name "`+e+`"`);var t=new Le;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Oe,r=t.split(`:`),i=n.attributes=new ie;return n.childNodes=new te,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ke,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},u(pe,M);function Oe(){this._nsMap={}}Oe.prototype={nodeType:f,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):De(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ne(this,function(t){var n=[];return de(t,function(r){r!==t&&r.nodeType==f&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new ne(this,function(n){var r=[];return de(n,function(i){i===n||i.nodeType!==f||e!==`*`&&i.namespaceURI!==e||t!==`*`&&i.localName!=t||r.push(i)}),r})}},pe.prototype.getElementsByTagName=Oe.prototype.getElementsByTagName,pe.prototype.getElementsByTagNameNS=Oe.prototype.getElementsByTagNameNS,u(Oe,M);function ke(){}ke.prototype.nodeType=p,u(ke,M);function Ae(){}Ae.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(T[E])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},u(Ae,M);function je(){}je.prototype={nodeName:`#text`,nodeType:m,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},u(je,Ae);function Me(){}Me.prototype={nodeName:`#comment`,nodeType:y},u(Me,Ae);function Ne(){}Ne.prototype={nodeName:`#cdata-section`,nodeType:h},u(Ne,Ae);function Pe(){}Pe.prototype.nodeType=x,u(Pe,M);function Fe(){}Fe.prototype.nodeType=C,u(Fe,M);function Ie(){}Ie.prototype.nodeType=_,u(Ie,M);function Le(){}Le.prototype.nodeType=g,u(Le,M);function Re(){}Re.prototype.nodeName=`#document-fragment`,Re.prototype.nodeType=S,u(Re,M);function ze(){}ze.prototype.nodeType=v,u(ze,M);function Be(){}Be.prototype.serializeToString=function(e,t,n,r){return Ve.call(e,t,n,r)},M.prototype.toString=Ve;function Ve(e,t,n){var r=!!n&&!!n.requireWellFormed,i=[],a=this.nodeType==9&&this.documentElement||this,o=a.prefix,s=a.namespaceURI;if(s&&o==null){var o=a.lookupPrefix(s);if(o==null)var c=[{namespace:s,prefix:null}]}return Ue(this,i,e,t,c,r),i.join(``)}function I(e,t,r){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===n.XML||a===n.XMLNS)return!1;for(var o=r.length;o--;){var s=r[o];if(s.prefix===i)return s.namespace!==a}return!0}function He(e,t,n,i){if(i&&!r.test(t))throw new A(k,`The attribute name "`+t+`" is not a valid XML QName`);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,ue),`"`)}function Ue(e,t,i,a,o,s){o||=[],fe(e,{ns:o,isHTML:i},{enter:function(e,i){var o=i.ns,c=i.isHTML;if(a){if(e=a(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case f:var l=e.attributes,u=l.length,d=e.tagName;c=n.isHTML(e.namespaceURI)||c;var _=d;if(!c&&!e.prefix&&e.namespaceURI){for(var C,w=0;w<l.length;w++)if(l.item(w).name===`xmlns`){C=l.item(w).value;break}if(!C)for(var T=o.length-1;T>=0;T--){var E=o[T];if(E.prefix===``&&E.namespace===e.namespaceURI){C=E.namespace;break}}if(C!==e.namespaceURI)for(var T=o.length-1;T>=0;T--){var E=o[T];if(E.namespace===e.namespaceURI){E.prefix&&(_=E.prefix+`:`+d);break}}}if(s&&!r.test(_))throw new A(k,`The element name "`+_+`" is not a valid XML QName`);t.push(`<`,_);for(var D=o.slice(),O=0;O<u;O++){var ee=l.item(O);ee.prefix==`xmlns`?D.push({prefix:ee.localName,namespace:ee.value}):ee.nodeName==`xmlns`&&D.push({prefix:``,namespace:ee.value})}for(var O=0;O<u;O++){var ee=l.item(O);if(I(ee,c,D)){var te=ee.prefix||``,ne=ee.namespaceURI;He(t,te?`xmlns:`+te:`xmlns`,ne,s),D.push({prefix:te,namespace:ne})}var re=a?a(ee):ee;re&&(typeof re==`string`?t.push(re):He(t,re.name,re.value,s))}if(d===_&&I(e,c,D)){var ie=e.prefix||``,ne=e.namespaceURI;He(t,ie?`xmlns:`+ie:`xmlns`,ne,s),D.push({prefix:ie,namespace:ne})}var j=e.firstChild;if(j||c&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(`>`),c&&/^script$/i.test(d)){for(;j;)j.data?t.push(j.data):Ue(j,t,c,a,D.slice(),s),j=j.nextSibling;return t.push(`</`,d,`>`),null}return{ns:D,isHTML:c,tag:_}}return t.push(`/>`),null;case b:case S:return{ns:o.slice(),isHTML:c,tag:null};case p:return He(t,e.name,e.value,s),null;case m:return t.push(e.data.replace(/[<&>]/g,ue)),null;case h:if(s&&e.data.indexOf(`]]>`)!==-1)throw new A(k,`The CDATASection data contains "]]>"`);return t.push(`<![CDATA[`,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),`]]>`),null;case y:if(s&&e.data.indexOf(`-->`)!==-1)throw new A(k,`The comment node data contains "-->"`);return t.push(`<!--`,e.data,`-->`),null;case x:if(s){if(!r.test(e.name))throw new A(k,`The doctype name "`+e.name+`" is not a valid XML Name`);if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new A(k,`DocumentType publicId is not a valid PubidLiteral`);if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new A(k,`DocumentType systemId is not a valid SystemLiteral`);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new A(k,`DocumentType internalSubset contains "]>"`)}var ae=e.publicId,oe=e.systemId;if(t.push(`<!DOCTYPE `,e.name),ae)t.push(` PUBLIC `,ae),oe&&oe!=`.`&&t.push(` `,oe),t.push(`>`);else if(oe&&oe!=`.`)t.push(` SYSTEM `,oe,`>`);else{var se=e.internalSubset;se&&t.push(` [`,se,`]`),t.push(`>`)}return null;case v:if(s){if(!r.test(e.target)||e.target.indexOf(`:`)!==-1||e.target.toLowerCase()===`xml`)throw new A(k,`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`);if(e.data.indexOf(`?>`)!==-1)throw new A(k,`The ProcessingInstruction data contains "?>"`)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case g:if(s&&!r.test(e.nodeName))throw new A(k,`The entity reference name "`+e.nodeName+`" is not a valid XML Name`);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function We(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===p||n?a:null}}),r}function Ge(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=t[o];typeof s!=`object`&&s!=a[o]&&(a[o]=s)}t.childNodes&&(a.childNodes=new te),a.ownerDocument=e;var c=n;switch(a.nodeType){case f:var l=t.attributes,u=a.attributes=new ie,d=l.length;u._ownerElement=a;for(var m=0;m<d;m++)a.setAttributeNode(Ge(e,l.item(m),!0));break;case p:c=!0}return i===null?r=a:i.appendChild(a),c?a:null}}),r}function Ke(e,t,n){e[t]=n}try{Object.defineProperty&&(Object.defineProperty(ne.prototype,"length",{get:function(){return re(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){if(this.nodeType===f||this.nodeType===S){var e=[];return fe(this,null,{enter:function(t){if(t.nodeType===f||t.nodeType===S)return!0;if(t.nodeType===v||t.nodeType===y)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case f:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Ke=function(e,t,n){e[`$$`+t]=n})}catch{}return Jt.DocumentType=Pe,Jt.DOMException=A,Jt.DOMImplementation=le,Jt.Element=Oe,Jt.Node=M,Jt.NodeList=te,Jt.walkDOM=fe,Jt.XMLSerializer=Be,Jt}var en={},tn={},nn;function rn(){return nn||(nn=1,function(e){var t=Zt().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:`⁡`,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:`⁡`,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:`⁣`,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
15
+ `,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:`­`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:`  `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:`​`,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`}),e.entityMap=e.HTML_ENTITIES}(tn)),tn}var an={},on;function sn(){if(on)return an;on=1;var e=Zt().NAMESPACE,t=Zt().tagNamePattern,n=0,r=1,i=2,a=3,o=4,s=5,c=6,l=7;function u(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,u)}u.prototype=Error(),u.prototype.name=u.name;function d(){}d.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),v(t,t={}),f(e,t,n,r,this.errorHandler),r.endDocument()}};function f(n,r,i,a,o){function s(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:t.charAt(0)===`#`?s(parseInt(t.substr(1).replace(`x`,`0x`))):(o.error(`entity not found:`+e),e)}function l(e){if(e>E){var t=n.substring(E,e).replace(/&#?\w+;/g,c);C&&d(E),a.characters(t,0,e-E),E=e}}function d(e,t){for(;e>=v&&(t=S.exec(n));)f=t.index,v=f+t[0].length,C.lineNumber++;C.columnNumber=e-f+1}for(var f=0,v=0,S=/.*(?:\r\n?|\n)|.*$/g,C=a.locator,w=[{currentNSMap:r}],T={},E=0;;){try{var D=n.indexOf(`<`,E);if(D<0){if(!n.substr(E).match(/^\s*$/)){var O=a.doc,ee=O.createTextNode(n.substr(E));O.appendChild(ee),a.currentElement=ee}return}switch(D>E&&l(D),n.charAt(D+1)){case`/`:var k=n.indexOf(`>`,D+3),A=n.substring(D+2,k).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,`$1`),te=w.pop();k<0?(A=n.substring(D+2).replace(/[\s<].*/,``),o.error(`end tag name: `+A+` is not complete:`+te.tagName),k=D+1+A.length):A.match(/\s</)?(A=A.replace(/[\s<].*/,``),o.error(`end tag name: `+A+` maybe not complete`),k=D+1+A.length):/[ \t\n\r]/.test(A)&&t.test(A.split(/[ \t\n\r]/)[0])&&o.error(`end tag name is followed by whitespace and trailing content: "`+A+`"`);var ne=te.localNSMap,re=te.tagName==A;if(re||te.tagName&&te.tagName.toLowerCase()==A.toLowerCase()){if(a.endElement(te.uri,te.localName,A),ne)for(var ie in ne)Object.prototype.hasOwnProperty.call(ne,ie)&&a.endPrefixMapping(ie);re||o.fatalError(`end tag name: `+A+` is not match the current start tagName:`+te.tagName)}else w.push(te);k++;break;case`?`:C&&d(D),k=b(n,D,a);break;case`!`:C&&d(D),k=y(n,D,a,o);break;default:C&&d(D);var j=new x,ae=w[w.length-1].currentNSMap,k=m(n,D,j,ae,c,o),oe=j.length;if(!j.closed&&_(n,k,j.tagName,T)&&(j.closed=!0,i.nbsp||o.warning(`unclosed xml attribute`)),C&&oe){for(var se=p(C,{}),ce=0;ce<oe;ce++){var le=j[ce];d(le.offset),le.locator=p(C,{})}a.locator=se,h(j,a,ae)&&w.push(j),a.locator=C}else h(j,a,ae)&&w.push(j);e.isHTML(j.uri)&&!j.closed?k=g(n,k,j.tagName,c,a):k++}}catch(e){if(e instanceof u)throw e;o.error(`element parse error: `+e),k=-1}k>E?E=k:l(Math.max(D,E)+1)}}function p(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function m(t,u,d,f,p,m){function h(e,t,n){d.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),d.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(/&#?\w+;/g,p),n)}for(var g,_,v=++u,y=n;;){var b=t.charAt(v);if(y===n&&b===`<`)throw Error(`unexpected < in tag name: `+t.slice(u,v));switch(b){case`=`:if(y===r)g=t.slice(u,v),y=a;else if(y===i)y=a;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===a||y===r){if(y===r&&(m.warning(`attribute value must after "="`),g=t.slice(u,v)),u=v+1,v=t.indexOf(b,u),v>0)_=t.slice(u,v),h(g,_,u-1),y=s;else throw Error(`attribute value no end '`+b+`' match`)}else if(y==o)_=t.slice(u,v),h(g,_,u),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),u=v+1,y=s;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case n:d.setTagName(t.slice(u,v));case s:case c:case l:y=l,d.closed=!0;case o:case r:break;case i:d.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==n&&d.setTagName(t.slice(u,v)),v;case`>`:switch(y){case n:d.setTagName(t.slice(u,v));case s:case c:case l:break;case o:case r:_=t.slice(u,v),_.slice(-1)===`/`&&(d.closed=!0,_=_.slice(0,-1));case i:y===i&&(_=g),y==o?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_,u)):(e.isHTML(f[``])&&_.match(/^(?:disabled|checked|selected)$/i)||m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,u));break;case a:throw Error(`attribute value missed!!`)}return v;case`€`:b=` `;default:if(b<=` `)switch(y){case n:d.setTagName(t.slice(u,v)),y=c;break;case r:g=t.slice(u,v),y=i;break;case o:var _=t.slice(u,v);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,u);case s:y=c}else switch(y){case i:d.tagName,e.isHTML(f[``])&&g.match(/^(?:disabled|checked|selected)$/i)||m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,u),u=v,y=r;break;case s:m.warning(`attribute space is required"`+g+`"!!`);case c:y=r,u=v;break;case a:y=o,u=v;break;case l:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function h(t,n,r){for(var i=t.tagName,a=null,o=t.length;o--;){var s=t[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},r=Object.create(r)),r[p]=a[p]=l,s.uri=e.XMLNS,n.startPrefixMapping(p,l))}for(var o=t.length;o--;){s=t[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=e.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=t.prefix=i.slice(0,u),f=t.localName=i.slice(u+1)):(d=null,f=t.localName=i);var m=t.uri=r[d||``];if(n.startElement(m,f,i,t),t.closed){if(n.endElement(m,f,i),a)for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&n.endPrefixMapping(d)}else return t.currentNSMap=r,t.localNSMap=a,!0}function g(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function _(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function v(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function y(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=S(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function b(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function x(){this.attributeNames={}}x.prototype={setTagName:function(e){if(!t.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,n,r){if(!t.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:n,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function S(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}return an.XMLReader=d,an.ParseError=u,an}var cn;function ln(){if(cn)return en;cn=1;var e=Zt(),t=$t(),n=rn(),r=sn(),i=t.DOMImplementation,a=e.NAMESPACE,o=r.ParseError,s=r.XMLReader;function c(e){return e.replace(/\r[\n\u0085]/g,`
16
16
  `).replace(/[\r\u0085\u2028]/g,`
17
17
  `)}function l(e){this.options=e||{locator:{}}}l.prototype.parseFromString=function(e,t){var r=this.options,i=new s,o=r.domBuilder||new d,l=r.errorHandler,f=r.locator,p=r.xmlns||{},m=/\/x?html?$/.test(t),h=m?n.HTML_ENTITIES:n.XML_ENTITIES;f&&o.setDocumentLocator(f),i.errorHandler=u(l,o,f),i.domBuilder=r.domBuilder||o,m&&(p[``]=a.HTML),p.xml=p.xml||a.XML;var g=r.normalizeLineEndings||c;return e&&typeof e==`string`?i.parse(g(e),p,h):i.errorHandler.error(`invalid doc source`),o.doc};function u(e,t,n){if(!e){if(t instanceof d)return t;e=t}var r={},i=e instanceof Function;n||={};function a(t){var a=e[t];!a&&i&&(a=e.length==2?function(n){e(t,n)}:e),r[t]=a&&function(e){a(`[xmldom `+t+`] `+e+p(n))}||function(){}}return a(`warning`),a(`error`),a(`fatalError`),r}function d(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}d.prototype={startDocument:function(){this.doc=new i().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;h(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&f(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,n),h(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=m.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&f(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&f(this.locator,r),h(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&f(this.locator,i),h(this,i),this.doc.doctype=i}},warning:function(e){console.warn(`[xmldom warning] `+e,p(this.locator))},error:function(e){console.error(`[xmldom error] `+e,p(this.locator))},fatalError:function(e){throw new o(e,this.locator)}};function p(e){if(e)return`
18
- @`+(e.systemId||``)+`#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function m(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){d.prototype[e]=function(){return null}});function h(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}return en.__DOMHandler=d,en.normalizeLineEndings=c,en.DOMParser=l,en}var un;function dn(){if(un)return qt;un=1;var e=$t();return qt.DOMImplementation=e.DOMImplementation,qt.XMLSerializer=e.XMLSerializer,qt.DOMParser=ln().DOMParser,qt}var fn=dn();const pn=e=>!!e&&typeof e==`object`,mn=(...e)=>e.reduce((e,t)=>(typeof t==`object`&&Object.keys(t).forEach(n=>{e[n]=Array.isArray(e[n])&&Array.isArray(t[n])?e[n].concat(t[n]):pn(e[n])&&pn(t[n])?mn(e[n],t[n]):t[n]}),e),{}),hn=e=>Object.keys(e).map(t=>e[t]),gn=(e,t)=>{let n=[];for(let r=e;r<t;r++)n.push(r);return n},_n=e=>e.reduce((e,t)=>e.concat(t),[]),vn=e=>{if(!e.length)return[];let t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},yn=(e,t)=>e.reduce((e,n,r)=>(n[t]&&e.push(r),e),[]),bn=(e,t)=>hn(e.reduce((e,n)=>(n.forEach(n=>{e[t(n)]=n}),e),{}));var xn={INVALID_NUMBER_OF_PERIOD:`INVALID_NUMBER_OF_PERIOD`,DASH_EMPTY_MANIFEST:`DASH_EMPTY_MANIFEST`,DASH_INVALID_XML:`DASH_INVALID_XML`,NO_BASE_URL:`NO_BASE_URL`,SEGMENT_TIME_UNSPECIFIED:`SEGMENT_TIME_UNSPECIFIED`,UNSUPPORTED_UTC_TIMING_SCHEME:`UNSUPPORTED_UTC_TIMING_SCHEME`};const Sn=({baseUrl:e=``,source:t=``,range:n=``,indexRange:r=``})=>{let i={uri:t,resolvedUri:ot(e||``,t)};if(n||r){let e=(n||r).split(`-`),t=x.BigInt?x.BigInt(e[0]):parseInt(e[0],10),a=x.BigInt?x.BigInt(e[1]):parseInt(e[1],10);t<2**53-1&&typeof t==`bigint`&&(t=Number(t)),a<2**53-1&&typeof a==`bigint`&&(a=Number(a));let o;o=typeof a==`bigint`||typeof t==`bigint`?x.BigInt(a)-x.BigInt(t)+x.BigInt(1):a-t+1,typeof o==`bigint`&&o<2**53-1&&(o=Number(o)),i.byterange={length:o,offset:t}}return i},Cn=e=>{let t;return t=typeof e.offset==`bigint`||typeof e.length==`bigint`?x.BigInt(e.offset)+x.BigInt(e.length)-x.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`},wn=e=>(e&&typeof e!=`number`&&(e=parseInt(e,10)),isNaN(e)?null:e),Tn={static(e){let{duration:t,timescale:n=1,sourceDuration:r,periodDuration:i}=e,a=wn(e.endNumber),o=t/n;return typeof a==`number`?{start:0,end:a}:typeof i==`number`?{start:0,end:i/o}:{start:0,end:r/o}},dynamic(e){let{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:i=1,duration:a,periodStart:o=0,minimumUpdatePeriod:s=0,timeShiftBufferDepth:c=1/0}=e,l=wn(e.endNumber),u=(t+n)/1e3,d=r+o,f=u+s-d,p=Math.ceil(f*i/a),m=Math.floor((u-d-c)*i/a),h=Math.floor((u-d)*i/a);return{start:Math.max(0,m),end:typeof l==`number`?l:Math.min(p,h)}}},En=e=>t=>{let{duration:n,timescale:r=1,periodStart:i,startNumber:a=1}=e;return{number:a+t,duration:n/r,timeline:i,time:t*n}},Dn=e=>{let{type:t,duration:n,timescale:r=1,periodDuration:i,sourceDuration:a}=e,{start:o,end:s}=Tn[t](e),c=gn(o,s).map(En(e));if(t===`static`){let e=c.length-1,t=typeof i==`number`?i:a;c[e].duration=t-n/r*e}return c},On=e=>{let{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:i=``,periodStart:a,presentationTime:o,number:s=0,duration:c}=e;if(!t)throw Error(xn.NO_BASE_URL);let l=Sn({baseUrl:t,source:n.sourceURL,range:n.range}),u=Sn({baseUrl:t,source:t,indexRange:i});if(u.map=l,c){let t=Dn(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else r&&(u.duration=r,u.timeline=a);return u.presentationTime=o||a,u.number=s,[u]},kn=(e,t,n)=>{let r=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,s=o.offset+o.length,c=t.timescale,l=t.references.filter(e=>e.referenceType!==1),u=[],d=e.endList?`static`:`dynamic`,f=e.sidx.timeline,p=f,m=e.mediaSequence||0,h;h=typeof t.firstOffset==`bigint`?x.BigInt(s)+t.firstOffset:s+t.firstOffset;for(let e=0;e<l.length;e++){let o=t.references[e],s=o.referencedSize,l=o.subsegmentDuration,g;g=typeof h==`bigint`?h+x.BigInt(s)-x.BigInt(1):h+s-1;let _=`${h}-${g}`,v=On({baseUrl:n,timescale:c,timeline:a,periodStart:f,presentationTime:p,number:m,duration:l,sourceDuration:i,indexRange:_,type:d})[0];r&&(v.map=r),u.push(v),h+=typeof h==`bigint`?x.BigInt(s):s,p+=l/c,m++}return e.segments=u,e},An=[`AUDIO`,`SUBTITLES`],jn=e=>bn(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Mn=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null},Nn=e=>{let t=[];return Kt(e,An,(e,n,r,i)=>{t=t.concat(e.playlists||[])}),t},Pn=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,n)=>{t.number=e.mediaSequence+n})},Fn=({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach(t=>{t.discontinuitySequence=n.findIndex(function({timeline:e}){return e===t.timeline});let r=Mn(e,t.attributes.NAME);if(!r||t.sidx)return;let i=t.segments[0],a=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666});a===-1?(Pn({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--):(r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),Pn({playlist:t,mediaSequence:r.segments[a].number}))})},In=({oldManifest:e,newManifest:t})=>{let n=e.playlists.concat(Nn(e)),r=t.playlists.concat(Nn(t));return t.timelineStarts=jn([e.timelineStarts,t.timelineStarts]),Fn({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t},Ln=e=>e&&e.uri+`-`+Cn(e.byterange),Rn=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),n=[];return Object.values(t).forEach(e=>{let t=hn(e.reduce((e,t)=>{let n=t.attributes.id+(t.attributes.lang||``);return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));n=n.concat(t)}),n.map(e=>(e.discontinuityStarts=yn(e.segments||[],`discontinuity`),e))},zn=(e,t)=>{let n=Ln(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&kn(e,r,e.sidx.resolvedUri),e},Bn=(e,t={})=>{if(!Object.keys(t).length)return e;for(let n in e)e[n]=zn(e[n],t);return e},Vn=({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:a},o)=>{let s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuitySequence:i,discontinuityStarts:a,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),n&&(s.sidx=n),o&&(s.attributes.AUDIO=`audio`,s.attributes.SUBTITLES=`subs`),s},Hn=({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:i})=>{t===void 0&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||``,duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let a={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(a.CODECS=e.codecs);let o={attributes:a,uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:n,segments:t};return e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),o},Un=(e,t={},n=!1)=>{let r,i=e.reduce((e,i)=>{let a=i.attributes.role&&i.attributes.role.value||``,o=i.attributes.lang||``,s=i.attributes.label||`main`;if(o&&!i.attributes.label){let e=a?` (${a})`:``;s=`${i.attributes.lang}${e}`}e[s]||(e[s]={language:o,autoselect:!0,default:a===`main`,playlists:[],uri:``});let c=zn(Vn(i,n),t);return e[s].playlists.push(c),r===void 0&&a===`main`&&(r=i,r.default=!0),e},{});if(!r){let e=Object.keys(i)[0];i[e].default=!0}return i},Wn=(e,t={})=>e.reduce((e,n)=>{let r=n.attributes.label||n.attributes.lang||`text`,i=n.attributes.lang||`und`;return e[r]||(e[r]={language:i,default:!1,autoselect:!1,playlists:[],uri:``}),e[r].playlists.push(zn(Hn(n),t)),e},{}),Gn=e=>e.reduce((e,t)=>(t&&t.forEach(t=>{let{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty(`aspectRatio`)&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty(`easyReader`)&&(e[r].easyReader=t.easyReader),t.hasOwnProperty(`3D`)&&(e[r][`3D`]=t[`3D`])}),e),{}),Kn=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{let i={attributes:{NAME:e.id,AUDIO:`audio`,SUBTITLES:`subs`,RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(i.attributes[`FRAME-RATE`]=e.frameRate),e.qualityRanking!==void 0&&(i.attributes.SCORE=1/(e.qualityRanking+1)),e.contentProtection&&(i.contentProtection=e.contentProtection),e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),n&&(i.sidx=n),i},qn=({attributes:e})=>e.mimeType===`video/mp4`||e.mimeType===`video/webm`||e.contentType===`video`,Jn=({attributes:e})=>e.mimeType===`audio/mp4`||e.mimeType===`audio/webm`||e.contentType===`audio`,Yn=({attributes:e})=>e.mimeType===`text/vtt`||e.contentType===`text`,Xn=(e,t)=>{e.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})})},Zn=e=>e?Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(r.playlists)},[]):[],Qn=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:i,eventStream:a})=>{if(!e.length)return{};let{sourceDuration:o,type:s,suggestedPresentationDelay:c,minimumUpdatePeriod:l}=e[0].attributes,u=Rn(e.filter(qn)).map(Kn),d=Rn(e.filter(Jn)),f=Rn(e.filter(Yn)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:``,duration:o,playlists:Bn(u,r)};l>=0&&(m.minimumUpdatePeriod=l*1e3),t&&(m.locations=t),n&&(m.contentSteering=n),s===`dynamic`&&(m.suggestedPresentationDelay=c),a&&a.length>0&&(m.eventStream=a);let h=m.playlists.length===0,g=d.length?Un(d,r,h):null,_=f.length?Wn(f,r):null,v=u.concat(Zn(g),Zn(_)),y=v.map(({timelineStarts:e})=>e);return m.timelineStarts=jn(y),Xn(v,m.timelineStarts),g&&(m.mediaGroups.AUDIO.audio=g),_&&(m.mediaGroups.SUBTITLES.subs=_),p.length&&(m.mediaGroups[`CLOSED-CAPTIONS`].cc=Gn(p)),i?In({oldManifest:i,newManifest:m}):m},$n=(e,t,n)=>{let{NOW:r,clientOffset:i,availabilityStartTime:a,timescale:o=1,periodStart:s=0,minimumUpdatePeriod:c=0}=e,l=(r+i)/1e3,u=a+s,d=l+c-u;return Math.ceil((d*o-t)/n)},er=(e,t)=>{let{type:n,minimumUpdatePeriod:r=0,media:i=``,sourceDuration:a,timescale:o=1,startNumber:s=1,periodStart:c}=e,l=[],u=-1;for(let d=0;d<t.length;d++){let f=t[d],p=f.d,m=f.r||0,h=f.t||0;u<0&&(u=h),h&&h>u&&(u=h);let g;if(m<0){let s=d+1;g=s===t.length?n===`dynamic`&&r>0&&i.indexOf(`$Number$`)>0?$n(e,u,p):(a*o-u)/p:(t[s].t-u)/p}else g=m+1;let _=s+l.length+g,v=s+l.length;for(;v<_;)l.push({number:v,duration:p/o,time:u,timeline:c}),u+=p,v++}return l},tr=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,nr=e=>(t,n,r,i)=>{if(t===`$$`)return`$`;if(e[n]===void 0)return t;let a=``+e[n];return n===`RepresentationID`||(i=r?parseInt(i,10):1,a.length>=i)?a:`${Array(i-a.length+1).join(`0`)}${a}`},rr=(e,t)=>e.replace(tr,nr(t)),ir=(e,t)=>!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?Dn(e):er(e,t),ar=(e,t)=>{let n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:``,range:``}}=e,i=Sn({baseUrl:e.baseUrl,source:rr(r.sourceURL,n),range:r.range});return ir(e,t).map(t=>{n.Number=t.number,n.Time=t.time;let r=rr(e.media||``,n),a=e.timescale||1,o=e.presentationTimeOffset||0,s=e.periodStart+(t.time-o)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:ot(e.baseUrl||``,r),map:i,number:t.number,presentationTime:s}})},or=(e,t)=>{let{baseUrl:n,initialization:r={}}=e,i=Sn({baseUrl:n,source:r.sourceURL,range:r.range}),a=Sn({baseUrl:n,source:t.media,range:t.mediaRange});return a.map=i,a},sr=(e,t)=>{let{duration:n,segmentUrls:r=[],periodStart:i}=e;if(!n&&!t||n&&t)throw Error(xn.SEGMENT_TIME_UNSPECIFIED);let a=r.map(t=>or(e,t)),o;return n&&(o=Dn(e)),t&&(o=er(e,t)),o.map((t,n)=>{if(a[n]){let r=a[n],o=e.timescale||1,s=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=i+(t.time-s)/o,r}}).filter(e=>e)},cr=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=ar,n=mn(e,t.template)):t.base?(r=On,n=mn(e,t.base)):t.list&&(r=sr,n=mn(e,t.list));let i={attributes:e};if(!r)return i;let a=r(n,t.segmentTimeline);if(n.duration){let{duration:e,timescale:t=1}=n;n.duration=e/t}else a.length?n.duration=a.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):n.duration=0;return i.attributes=n,i.segments=a,t.base&&n.indexRange&&(i.sidx=a[0],i.segments=[]),i},lr=e=>e.map(cr),V=(e,t)=>vn(e.childNodes).filter(({tagName:e})=>e===t),ur=e=>e.textContent.trim(),dr=e=>parseFloat(e.split(`/`).reduce((e,t)=>e/t)),fr=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[n,r,i,a,o,s]=t.slice(1);return parseFloat(n||0)*31536e3+parseFloat(r||0)*2592e3+parseFloat(i||0)*86400+parseFloat(a||0)*3600+parseFloat(o||0)*60+parseFloat(s||0)},pr=e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+=`Z`),Date.parse(e)),mr={mediaPresentationDuration(e){return fr(e)},availabilityStartTime(e){return pr(e)/1e3},minimumUpdatePeriod(e){return fr(e)},suggestedPresentationDelay(e){return fr(e)},type(e){return e},timeShiftBufferDepth(e){return fr(e)},start(e){return fr(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return dr(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){let t=parseInt(e,10);return isNaN(t)?fr(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},qualityRanking(e){return parseInt(e,10)},qualityranking(e){return parseInt(e,10)},DEFAULT(e){return e}},hr={qualityranking:`qualityRanking`},gr=e=>e&&e.attributes?vn(e.attributes).reduce((e,t)=>{let n=mr[t.name]||mr.DEFAULT,r=hr[t.name]||t.name;return e[r]=n(t.value),e},{}):{},_r={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":`org.w3.clearkey`,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":`com.widevine.alpha`,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":`com.microsoft.playready`,"urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":`com.adobe.primetime`,"urn:mpeg:dash:mp4protection:2011":`mp4protection`},vr=(e,t)=>t.length?_n(e.map(function(e){return t.map(function(t){let n=ur(t),r=ot(e.baseUrl,n),i=mn(gr(t),{baseUrl:r});return r!==n&&!i.serviceLocation&&e.serviceLocation&&(i.serviceLocation=e.serviceLocation),i})})):e,yr=e=>{let t=V(e,`SegmentTemplate`)[0],n=V(e,`SegmentList`)[0],r=n&&V(n,`SegmentURL`).map(e=>mn({tag:`SegmentURL`},gr(e))),i=V(e,`SegmentBase`)[0],a=n||t,o=a&&V(a,`SegmentTimeline`)[0],s=n||i||t,c=s&&V(s,`Initialization`)[0],l=t&&gr(t);l&&c?l.initialization=c&&gr(c):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});let u={template:l,segmentTimeline:o&&V(o,`S`).map(e=>gr(e)),list:n&&mn(gr(n),{segmentUrls:r,initialization:gr(c)}),base:i&&mn(gr(i),{initialization:gr(c)})};return Object.keys(u).forEach(e=>{u[e]||delete u[e]}),u},br=(e,t,n)=>r=>{let i=V(r,`BaseURL`),a=vr(t,i),o=mn(e,gr(r)),s=yr(r);return a.map(e=>({segmentInfo:mn(n,s),attributes:mn(o,e)}))},xr=e=>e.reduce((e,t)=>{let n=gr(t);n.schemeIdUri&&=n.schemeIdUri.toLowerCase();let r=_r[n.schemeIdUri];if(r){e[r]={attributes:n};let i=V(t,`cenc:pssh`)[0];if(i){let t=ur(i);e[r].pssh=t&&lt(t)}}return e},{}),Sr=e=>{if(e.schemeIdUri===`urn:scte:dash:cc:cea-608:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split(`=`):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}});if(e.schemeIdUri===`urn:scte:dash:cc:cea-708:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[n,r=``]=e.split(`=`);t.channel=n,t.language=e,r.split(`,`).forEach(e=>{let[n,r]=e.split(`:`);n===`lang`?t.language=r:n===`er`?t.easyReader=Number(r):n===`war`?t.aspectRatio=Number(r):n===`3D`&&(t[`3D`]=Number(r))})}else t.language=e;return t.channel&&=`SERVICE`+t.channel,t})},Cr=e=>_n(V(e.node,`EventStream`).map(t=>{let n=gr(t),r=n.schemeIdUri;return V(t,`Event`).map(t=>{let i=gr(t),a=i.presentationTime||0,o=n.timescale||1,s=i.duration||0,c=a/o+e.attributes.start;return{schemeIdUri:r,value:n.value,id:i.id,start:c,end:c+s/o,messageData:ur(t)||i.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})})),wr=(e,t,n)=>r=>{let i=gr(r),a=vr(t,V(r,`BaseURL`)),o=V(r,`Role`)[0],s={role:gr(o)},c=mn(e,i,s),l=V(r,`Accessibility`)[0],u=Sr(gr(l));u&&(c=mn(c,{captionServices:u}));let d=V(r,`Label`)[0];if(d&&d.childNodes.length){let e=d.childNodes[0].nodeValue.trim();c=mn(c,{label:e})}let f=xr(V(r,`ContentProtection`));Object.keys(f).length&&(c=mn(c,{contentProtection:f}));let p=yr(r),m=V(r,`Representation`),h=mn(n,p);return _n(m.map(br(c,a,h)))},Tr=(e,t)=>(n,r)=>{let i=vr(t,V(n.node,`BaseURL`)),a=mn(e,{periodStart:n.attributes.start});typeof n.attributes.duration==`number`&&(a.periodDuration=n.attributes.duration);let o=V(n.node,`AdaptationSet`),s=yr(n.node);return _n(o.map(wr(a,i,s)))},Er=(e,t)=>{if(e.length>1&&t({type:`warn`,message:`The MPD manifest should contain no more than one ContentSteering tag`}),!e.length)return null;let n=mn({serverURL:ur(e[0])},gr(e[0]));return n.queryBeforeStart=n.queryBeforeStart===`true`,n},Dr=({attributes:e,priorPeriodAttributes:t,mpdType:n})=>typeof e.start==`number`?e.start:t&&typeof t.start==`number`&&typeof t.duration==`number`?t.start+t.duration:!t&&n===`static`?0:null,Or=(e,t={})=>{let{manifestUri:n=``,NOW:r=Date.now(),clientOffset:i=0,eventHandler:a=function(){}}=t,o=V(e,`Period`);if(!o.length)throw Error(xn.INVALID_NUMBER_OF_PERIOD);let s=V(e,`Location`),c=gr(e),l=vr([{baseUrl:n}],V(e,`BaseURL`)),u=V(e,`ContentSteering`);c.type=c.type||`static`,c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=r,c.clientOffset=i,s.length&&(c.locations=s.map(ur));let d=[];return o.forEach((e,t)=>{let n=gr(e),r=d[t-1];n.start=Dr({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:c.type}),d.push({node:e,attributes:n})}),{locations:c.locations,contentSteeringInfo:Er(u,a),representationInfo:_n(d.map(Tr(c,l))),eventStream:_n(d.map(Cr))}},kr=e=>{if(e===``)throw Error(xn.DASH_EMPTY_MANIFEST);let t=new fn.DOMParser,n,r;try{n=t.parseFromString(e,`application/xml`),r=n&&n.documentElement.tagName===`MPD`?n.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName(`parsererror`).length>0)throw Error(xn.DASH_INVALID_XML);return r},Ar=e=>{let t=V(e,`UTCTiming`)[0];if(!t)return null;let n=gr(t);switch(n.schemeIdUri){case`urn:mpeg:dash:utc:http-head:2014`:case`urn:mpeg:dash:utc:http-head:2012`:n.method=`HEAD`;break;case`urn:mpeg:dash:utc:http-xsdate:2014`:case`urn:mpeg:dash:utc:http-iso:2014`:case`urn:mpeg:dash:utc:http-xsdate:2012`:case`urn:mpeg:dash:utc:http-iso:2012`:n.method=`GET`;break;case`urn:mpeg:dash:utc:direct:2014`:case`urn:mpeg:dash:utc:direct:2012`:n.method=`DIRECT`,n.value=Date.parse(n.value);break;default:throw Error(xn.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},jr=(e,t={})=>{let n=Or(kr(e),t),r=lr(n.representationInfo);return Qn({dashPlaylists:r,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})},Mr=e=>Ar(kr(e));var Nr,Pr;function Fr(){if(Pr)return Nr;Pr=1;var e=2**32;return Nr={getUint64:function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return n.getBigUint64?(r=n.getBigUint64(0),r<2**53-1?Number(r):r):n.getUint32(0)*e+n.getUint32(4)},MAX_UINT32:e},Nr}var Ir,Lr;function Rr(){if(Lr)return Ir;Lr=1;var e=Fr().getUint64;return Ir=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8)},i=12;r.version===0?(r.earliestPresentationTime=n.getUint32(i),r.firstOffset=n.getUint32(i+4),i+=8):(r.earliestPresentationTime=e(t.subarray(i)),r.firstOffset=e(t.subarray(i+8)),i+=16),i+=2;var a=n.getUint16(i);for(i+=2;a>0;i+=12,a--)r.references.push({referenceType:(t[i]&128)>>>7,referencedSize:n.getUint32(i)&2147483647,subsegmentDuration:n.getUint32(i+4),startsWithSap:!!(t[i+8]&128),sapType:(t[i+8]&112)>>>4,sapDeltaTime:n.getUint32(i+8)&268435455});return r},Ir}var zr=Rr();const Br=g(zr);var H=z([73,68,51]),Vr=function(e,t){t===void 0&&(t=0),e=z(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(n&16)>>4?r+20:r+10},Hr=function e(t,n){return n===void 0&&(n=0),t=z(t),t.length-n<10||!B(t,H,{offset:n})?n:(n+=Vr(t,n),e(t,n))},Ur=function(e){return typeof e==`string`?Wt(e):e},Wr=function(e){return Array.isArray(e)?e.map(function(e){return Ur(e)}):[Ur(e)]},Gr=function e(t,n,r){r===void 0&&(r=!1),n=Wr(n),t=z(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,s=t.subarray(a+4,a+8);if(o===0)break;var c=a+o;if(c>t.length){if(r)break;c=t.length}var l=t.subarray(a+8,c);B(s,n[0])&&(n.length===1?i.push(l):i.push.apply(i,e(l,n.slice(1),r))),a=c}return i},Kr={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},qr=[128,64,32,16,8,4,2,1],Jr=function(e){for(var t=1,n=0;n<qr.length&&!(e&qr[n]);n++)t++;return t},Yr=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!1);var i=Jr(e[t]),a=e.subarray(t,t+i);return n&&(a=Array.prototype.slice.call(e,t,t+i),a[0]^=qr[i-1]),{length:i,value:Ht(a,{signed:r}),bytes:a}},Xr=function e(t){return typeof t==`string`?t.match(/.{1,2}/g).map(function(t){return e(t)}):typeof t==`number`?Ut(t):t},Zr=function(e){return Array.isArray(e)?e.map(function(e){return Xr(e)}):[Xr(e)]},Qr=function e(t,n,r){if(r>=n.length)return n.length;var i=Yr(n,r,!1);if(B(t.bytes,i.bytes))return r;var a=Yr(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},$r=function e(t,n){n=Zr(n),t=z(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=Yr(t,i,!1),o=Yr(t,i+a.length),s=i+a.length+o.length;o.value===127&&(o.value=Qr(a,t,s),o.value!==t.length&&(o.value-=s));var c=s+o.value>t.length?t.length:s+o.value,l=t.subarray(s,c);B(n[0],a.bytes)&&(n.length===1?r.push(l):r=r.concat(e(l,n.slice(1))));var u=a.length+o.length+l.length;i+=u}return r},ei=z([0,0,0,1]),ti=z([0,0,1]),ni=z([0,0,3]),ri=function(e){for(var t=[],n=1;n<e.length-2;)B(e.subarray(n,n+3),ni)&&(t.push(n+2),n++),n++;if(t.length===0)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},ii=function(e,t,n,r){e=z(e),n=[].concat(n);for(var i=0,a,o=0;i<e.length&&(o<r||a);){var s=void 0;if(B(e.subarray(i),ei)?s=4:B(e.subarray(i),ti)&&(s=3),!s)i++;else{if(o++,a)return ri(e.subarray(a,i));var c=void 0;t===`h264`?c=e[i+s]&31:t===`h265`&&(c=e[i+s]>>1&63),n.indexOf(c)!==-1&&(a=i+s),i+=s+(t===`h264`?1:2)}}return e.subarray(0,0)},ai=function(e,t,n){return ii(e,`h264`,t,n)},oi=function(e,t,n){return ii(e,`h265`,t,n)},si={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102]),vtt:z([87,69,66,86,84,84])},ci={aac:function(e){return B(e,[255,16],{offset:Hr(e),mask:[255,22]})},mp3:function(e){return B(e,[255,2],{offset:Hr(e),mask:[255,6]})},webm:function(e){var t=$r(e,[Kr.EBML,Kr.DocType])[0];return B(t,si.webm)},mkv:function(e){var t=$r(e,[Kr.EBML,Kr.DocType])[0];return B(t,si.matroska)},mp4:function(e){if(ci[`3gp`](e)||ci.mov(e))return!1;if(B(e,si.mp4,{offset:4})||B(e,si.fmp4,{offset:4})||B(e,si.moof,{offset:4})||B(e,si.moov,{offset:4}))return!0},mov:function(e){return B(e,si.mov,{offset:4})},"3gp":function(e){return B(e,si[`3gp`],{offset:4})},ac3:function(e){var t=Hr(e);return B(e,si.ac3,{offset:t})},vtt:function(e){return B(e,si.vtt)},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Hr(e);return B(e,si.flac,{offset:t})},ogg:function(e){return B(e,si.ogg)},avi:function(e){return B(e,si.riff)&&B(e,si.avi,{offset:8})},wav:function(e){return B(e,si.riff)&&B(e,si.wav,{offset:8})},h264:function(e){return ai(e,7,3).length},h265:function(e){return oi(e,[32,33],3).length}},li=Object.keys(ci).filter(function(e){return e!==`ts`&&e!==`h264`&&e!==`h265`}).concat([`ts`,`h264`,`h265`]);li.forEach(function(e){var t=ci[e];ci[e]=function(e){return t(z(e))}});var ui=ci,di=function(e){e=z(e);for(var t=0;t<li.length;t++){var n=li[t];if(ui[n](e))return n}return``},fi=function(e){return Gr(e,[`moof`]).length>0},pi,mi;function hi(){if(mi)return pi;mi=1;var e=9e4,t=function(t){return t*e},n=function(e,t){return e*t},r=function(t){return t/e},i=function(e,t){return e/t};return pi={ONE_SECOND_IN_TS:e,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:function(e,n){return t(i(e,n))},videoTsToAudioTs:function(e,t){return n(r(e),t)},metadataTsToSeconds:function(e,t,n){return r(n?e:e-t)}},pi}var gi=hi(),_i=`8.24.1`;const vi={},yi=function(e,t){return vi[e]=vi[e]||[],t&&(vi[e]=vi[e].concat(t)),vi[e]},bi=function(e,t){yi(e,t)},xi=function(e,t){let n=yi(e).indexOf(t);return n<=-1?!1:(vi[e]=vi[e].slice(),vi[e].splice(n,1),!0)},Si=function(e,t){yi(e,[].concat(t).map(t=>{let n=(...r)=>(xi(e,n),t(...r));return n}))},Ci={prefixed:!0},wi=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`,`fullscreen`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`,`-webkit-full-screen`]],Ti=wi[0];let Ei;for(let e=0;e<wi.length;e++)if(wi[e][1]in F){Ei=wi[e];break}if(Ei){for(let e=0;e<Ei.length;e++)Ci[Ti[e]]=Ei[e];Ci.prefixed=Ei[0]!==Ti[0]}let Di=[];const Oi=(e,t,n)=>(r,i,a)=>{let o=t.levels[i],s=RegExp(`^(${o})$`),c=e;if(r!==`log`&&a.unshift(r.toUpperCase()+`:`),n&&(c=`%c${e}`,a.unshift(n)),a.unshift(c+`:`),Di){Di.push([].concat(a));let e=Di.length-1e3;Di.splice(0,e>0?e:0)}if(!x.console)return;let l=x.console[r];!l&&r===`debug`&&(l=x.console.info||x.console.log),l&&o&&s.test(r)&&l[Array.isArray(a)?`apply`:`call`](x.console,a)};function ki(e,t=`:`,n=``){let r=`info`,i;function a(...e){i(`log`,r,e)}return i=Oi(e,a,n),a.createLogger=(r,i,a)=>{let o=i===void 0?t:i,s=a===void 0?n:a;return ki(`${e} ${o} ${r}`,o,s)},a.createNewLogger=(e,t,n)=>ki(e,t,n),a.levels={all:`debug|log|warn|error`,off:``,debug:`debug|log|warn|error`,info:`log|warn|error`,warn:`warn|error`,error:`error`,DEFAULT:r},a.level=e=>{if(typeof e==`string`){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);r=e}return r},a.history=()=>Di?[].concat(Di):[],a.history.filter=e=>(Di||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{Di&&(Di.length=0)},a.history.disable=()=>{Di!==null&&(Di.length=0,Di=null)},a.history.enable=()=>{Di===null&&(Di=[])},a.error=(...e)=>i(`error`,r,e),a.warn=(...e)=>i(`warn`,r,e),a.debug=(...e)=>i(`debug`,r,e),a}const U=ki(`VIDEOJS`),Ai=U.createLogger,ji=Object.prototype.toString,Mi=function(e){return Fi(e)?Object.keys(e):[]};function Ni(e,t){Mi(e).forEach(n=>t(e[n],n))}function Pi(e,t,n=0){return Mi(e).reduce((n,r)=>t(n,e[r],r),n)}function Fi(e){return!!e&&typeof e==`object`}function Ii(e){return Fi(e)&&ji.call(e)===`[object Object]`&&e.constructor===Object}function W(...e){let t={};return e.forEach(e=>{e&&Ni(e,(e,n)=>{Ii(e)?(Ii(t[n])||(t[n]={}),t[n]=W(t[n],e)):t[n]=e})}),t}function Li(e={}){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];t.push(r)}return t}function Ri(e,t,n,r=!0){let i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){let e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)}var zi=Object.freeze({__proto__:null,each:Ni,reduce:Pi,isObject:Fi,isPlain:Ii,merge:W,values:Li,defineLazyProperty:Ri});let Bi=!1,Vi=null,Hi=!1,Ui,Wi=!1,Gi=!1,Ki=!1,qi=!1,Ji=null,Yi=null;const Xi=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let Zi=null,Qi=!1,$i=!1,ea=!1,ta=!1,na=!1,ra=!1,ia=!1;const aa=!!(fa()&&(`ontouchstart`in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),oa=x.navigator&&x.navigator.userAgentData;if(oa&&oa.platform&&oa.brands&&(Hi=oa.platform===`Android`,Gi=!!oa.brands.find(e=>e.brand===`Microsoft Edge`),Ki=!!oa.brands.find(e=>e.brand===`Chromium`),qi=!Gi&&Ki,Ji=Yi=(oa.brands.find(e=>e.brand===`Chromium`)||{}).version||null,$i=oa.platform===`Windows`),!Ki){let e=x.navigator&&x.navigator.userAgent||``;Bi=/iPod/i.test(e),Vi=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Hi=/Android/i.test(e),Ui=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+`.`+t[2]):n||null}(),Wi=/Firefox/i.test(e),Gi=/Edg/i.test(e),Ki=/Chrome/i.test(e)||/CriOS/i.test(e),qi=!Gi&&Ki,Ji=Yi=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Zi=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),na=/Tizen/i.test(e),ra=/Web0S/i.test(e),ia=na||ra,Qi=/Safari/i.test(e)&&!qi&&!Hi&&!Gi&&!ia,$i=/Windows/i.test(e),ea=/iPad/i.test(e)||Qi&&aa&&!/iPhone/i.test(e),ta=/iPhone/i.test(e)&&!ea}const sa=ta||ea||Bi,ca=(Qi||sa)&&!qi;var la=Object.freeze({__proto__:null,get IS_IPOD(){return Bi},get IOS_VERSION(){return Vi},get IS_ANDROID(){return Hi},get ANDROID_VERSION(){return Ui},get IS_FIREFOX(){return Wi},get IS_EDGE(){return Gi},get IS_CHROMIUM(){return Ki},get IS_CHROME(){return qi},get CHROMIUM_VERSION(){return Ji},get CHROME_VERSION(){return Yi},IS_CHROMECAST_RECEIVER:Xi,get IE_VERSION(){return Zi},get IS_SAFARI(){return Qi},get IS_WINDOWS(){return $i},get IS_IPAD(){return ea},get IS_IPHONE(){return ta},get IS_TIZEN(){return na},get IS_WEBOS(){return ra},get IS_SMART_TV(){return ia},TOUCH_ENABLED:aa,IS_IOS:sa,IS_ANY_SAFARI:ca});function ua(e){return typeof e==`string`&&!!e.trim()}function da(e){if(e.indexOf(` `)>=0)throw Error(`class has illegal whitespace characters`)}function fa(){return F===x.document}function pa(e){return Fi(e)&&e.nodeType===1}function ma(){try{return x.parent!==x.self}catch{return!0}}function ha(e){return function(t,n){if(!ua(t))return F[e](null);ua(n)&&(n=F.querySelector(n));let r=pa(n)?n:F;return r[e]&&r[e](t)}}function G(e=`div`,t={},n={},r){let i=F.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let n=t[e];e===`textContent`?ga(i,n):(i[e]!==n||e===`tabIndex`)&&(i[e]=n)}),Object.getOwnPropertyNames(n).forEach(function(e){i.setAttribute(e,n[e])}),r&&Fa(i,r),i}function ga(e,t){return e.textContent===void 0?e.innerText=t:e.textContent=t,e}function _a(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function va(e,t){return da(t),e.classList.contains(t)}function ya(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function ba(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(U.warn(`removeClass was called with an element that doesn't exist`),null)}function xa(e,t,n){return typeof n==`function`&&(n=n(e,t)),typeof n!=`boolean`&&(n=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,n)),e}function Sa(e,t){Object.getOwnPropertyNames(t).forEach(function(n){let r=t[n];r==null||r===!1?e.removeAttribute(n):e.setAttribute(n,r===!0?``:r)})}function Ca(e){let t={},n=[`autoplay`,`controls`,`playsinline`,`loop`,`muted`,`default`,`defaultMuted`];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let i=r[e].name,a=r[e].value;n.includes(i)&&(a=a!==null),t[i]=a}}return t}function wa(e,t){return e.getAttribute(t)}function Ta(e,t,n){e.setAttribute(t,n)}function Ea(e,t){e.removeAttribute(t)}function Da(){F.body.focus(),F.onselectstart=function(){return!1}}function Oa(){F.onselectstart=function(){return!0}}function ka(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),n={};return[`bottom`,`height`,`left`,`right`,`top`,`width`].forEach(e=>{t[e]!==void 0&&(n[e]=t[e])}),n.height||=parseFloat(Ba(e,`height`)),n.width||=parseFloat(Ba(e,`width`)),n}}function Aa(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,n=e.offsetHeight,r=0,i=0;for(;e.offsetParent&&e!==F[Ci.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function ja(e,t){let n={x:0,y:0};if(sa){let t=e;for(;t&&t.nodeName.toLowerCase()!==`html`;){let e=Ba(t,`transform`);if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&x.WebKitCSSMatrix){let e=x.getComputedStyle(t.assignedSlot.parentElement).transform,r=new x.WebKitCSSMatrix(e);n.x+=r.m41,n.y+=r.m42}t=t.parentNode||t.host}}let r={},i=Aa(t.target),a=Aa(e),o=a.width,s=a.height,c=t.offsetY-(a.top-i.top),l=t.offsetX-(a.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-a.left,c=t.changedTouches[0].pageY+a.top,sa&&(l-=n.x,c-=n.y)),r.y=1-Math.max(0,Math.min(1,c/s)),r.x=Math.max(0,Math.min(1,l/o)),r}function Ma(e){return Fi(e)&&e.nodeType===3}function Na(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Pa(e){return typeof e==`function`&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==`function`&&(e=e()),pa(e)||Ma(e))return e;if(typeof e==`string`&&/\S/.test(e))return F.createTextNode(e)}).filter(e=>e)}function Fa(e,t){return Pa(t).forEach(t=>e.appendChild(t)),e}function Ia(e,t){return Fa(Na(e),t)}function La(e){return e.button===void 0&&e.buttons===void 0||e.button===0&&e.buttons===void 0||e.type===`mouseup`&&e.button===0&&e.buttons===0||e.type===`mousedown`&&e.button===0&&e.buttons===0||e.button===0&&e.buttons===1}const Ra=ha(`querySelector`),za=ha(`querySelectorAll`);function Ba(e,t){if(!e||!t)return``;if(typeof x.getComputedStyle==`function`){let n;try{n=x.getComputedStyle(e)}catch{return``}return n?n.getPropertyValue(t)||n[t]:``}return``}function Va(e){[...F.styleSheets].forEach(t=>{try{let n=[...t.cssRules].map(e=>e.cssText).join(``),r=F.createElement(`style`);r.textContent=n,e.document.head.appendChild(r)}catch{let n=F.createElement(`link`);n.rel=`stylesheet`,n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}})}var Ha=Object.freeze({__proto__:null,isReal:fa,isEl:pa,isInFrame:ma,createEl:G,textContent:ga,prependTo:_a,hasClass:va,addClass:ya,removeClass:ba,toggleClass:xa,setAttributes:Sa,getAttributes:Ca,getAttribute:wa,setAttribute:Ta,removeAttribute:Ea,blockTextSelection:Da,unblockTextSelection:Oa,getBoundingClientRect:ka,findPosition:Aa,getPointerPosition:ja,isTextNode:Ma,emptyEl:Na,normalizeContent:Pa,appendContent:Fa,insertContent:Ia,isSingleLeftClick:La,$:Ra,$$:za,computedStyle:Ba,copyStyleSheetsToWindow:Va});let Ua=!1,Wa;const Ga=function(){if(Wa.options.autoSetup===!1)return;let e=Array.prototype.slice.call(F.getElementsByTagName(`video`)),t=Array.prototype.slice.call(F.getElementsByTagName(`audio`)),n=Array.prototype.slice.call(F.getElementsByTagName(`video-js`)),r=e.concat(t,n);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){let t=r[e];if(t&&t.getAttribute)t.player===void 0&&t.getAttribute(`data-setup`)!==null&&Wa(t);else{Ka(1);break}}else Ua||Ka(1)};function Ka(e,t){fa()&&(t&&(Wa=t),x.setTimeout(Ga,e))}function qa(){Ua=!0,x.removeEventListener(`load`,qa)}fa()&&(F.readyState===`complete`?qa():x.addEventListener(`load`,qa));const Ja=function(e){let t=F.createElement(`style`);return t.className=e,t},Ya=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Xa=new WeakMap;let Za=3;function Qa(){return Za++}function $a(e,t){if(!Xa.has(e))return;let n=Xa.get(e);n.handlers[t].length===0&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent(`on`+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),Object.getOwnPropertyNames(n).length===0&&Xa.delete(e)}function eo(e,t,n,r){n.forEach(function(n){e(t,n,r)})}function to(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||x.event;e={};let i=[`layerX`,`layerY`,`keyLocation`,`path`,`webkitMovementX`,`webkitMovementY`,`mozPressure`,`mozInputSource`];for(let t in r)i.includes(t)||t===`returnValue`&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||F),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,e.clientX!==null&&e.clientX!==void 0){let t=F.documentElement,n=F.body;e.pageX=e.clientX+(t&&t.scrollLeft||n&&n.scrollLeft||0)-(t&&t.clientLeft||n&&n.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||n&&n.scrollTop||0)-(t&&t.clientTop||n&&n.clientTop||0)}e.which=e.charCode||e.keyCode,e.button!==null&&e.button!==void 0&&(e.button=e.button&1?0:e.button&4?1:e.button&2?2:0)}return e.fixed_=!0,e}let no;const ro=function(){if(typeof no!=`boolean`){no=!1;try{let e=Object.defineProperty({},"passive",{get(){no=!0}});x.addEventListener(`test`,null,e),x.removeEventListener(`test`,null,e)}catch{}}return no},io=[`touchstart`,`touchmove`];function ao(e,t,n){if(Array.isArray(t))return eo(ao,e,t,n);Xa.has(e)||Xa.set(e,{});let r=Xa.get(e);if(r.handlers||={},r.handlers[t]||(r.handlers[t]=[]),n.guid||=Qa(),r.handlers[t].push(n),r.dispatcher||=(r.disabled=!1,function(t,n){if(r.disabled)return;t=to(t);let i=r.handlers[t.type];if(i){let r=i.slice(0);for(let i=0,a=r.length;i<a&&!t.isImmediatePropagationStopped();i++)try{r[i].call(e,t,n)}catch(e){U.error(e)}}}),r.handlers[t].length===1){if(e.addEventListener){let n=!1;ro()&&io.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent(`on`+t,r.dispatcher)}}function oo(e,t,n){if(!Xa.has(e))return;let r=Xa.get(e);if(!r.handlers)return;if(Array.isArray(t))return eo(oo,e,t,n);let i=function(e,t){r.handlers[t]=[],$a(e,t)};if(t===void 0){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}let a=r.handlers[t];if(a){if(!n)i(e,t);else{if(n.guid)for(let e=0;e<a.length;e++)a[e].guid===n.guid&&a.splice(e--,1);$a(e,t)}}}function so(e,t,n){let r=Xa.has(e)?Xa.get(e):{},i=e.parentNode||e.ownerDocument;if(typeof t==`string`?t={type:t,target:e}:t.target||(t.target=e),t=to(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&t.bubbles===!0)so.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Xa.has(t.target)||Xa.set(t.target,{});let e=Xa.get(t.target);t.target[t.type]&&(e.disabled=!0,typeof t.target[t.type]==`function`&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function co(e,t,n){if(Array.isArray(t))return eo(co,e,t,n);let r=function(){oo(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Qa(),ao(e,t,r)}function lo(e,t,n){let r=function(){oo(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Qa(),ao(e,t,r)}var uo=Object.freeze({__proto__:null,fixEvent:to,on:ao,off:oo,trigger:so,one:co,any:lo});const K=function(e,t,n){t.guid||=Qa();let r=t.bind(e);return r.guid=n?n+`_`+t.guid:t.guid,r},fo=function(e,t){let n=x.performance.now();return function(...r){let i=x.performance.now();i-n>=t&&(e(...r),n=i)}},po=function(e,t,n,r=x){let i,a=()=>{r.clearTimeout(i),i=null},o=function(){let a=this,o=arguments,s=function(){i=null,s=null,n||e.apply(a,o)};!i&&n&&e.apply(a,o),r.clearTimeout(i),i=r.setTimeout(s,t)};return o.cancel=a,o};var mo=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:K,throttle:fo,debounce:po});let ho;class go{on(e,t){let n=this.addEventListener;this.addEventListener=()=>{},ao(this,e,t),this.addEventListener=n}off(e,t){oo(this,e,t)}one(e,t){let n=this.addEventListener;this.addEventListener=()=>{},co(this,e,t),this.addEventListener=n}any(e,t){let n=this.addEventListener;this.addEventListener=()=>{},lo(this,e,t),this.addEventListener=n}trigger(e){let t=e.type||e;typeof e==`string`&&(e={type:t}),e=to(e),this.allowedEvents_[t]&&this[`on`+t]&&this[`on`+t](e),so(this,e)}queueTrigger(e){ho||=new Map;let t=e.type||e,n=ho.get(this);n||(n=new Map,ho.set(this,n));let r=n.get(t);n.delete(t),x.clearTimeout(r);let i=x.setTimeout(()=>{n.delete(t),n.size===0&&(n=null,ho.delete(this)),this.trigger(e)},0);n.set(t,i)}}go.prototype.allowedEvents_={},go.prototype.addEventListener=go.prototype.on,go.prototype.removeEventListener=go.prototype.off,go.prototype.dispatchEvent=go.prototype.trigger;const _o=e=>typeof e.name==`function`?e.name():typeof e.name==`string`?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,vo=e=>e instanceof go||!!e.eventBusEl_&&[`on`,`one`,`off`,`trigger`].every(t=>typeof e[t]==`function`),yo=(e,t)=>{vo(e)?t():(e.eventedCallbacks||=[],e.eventedCallbacks.push(t))},bo=e=>typeof e==`string`&&/\S/.test(e)||Array.isArray(e)&&!!e.length,xo=(e,t,n)=>{if(!e||!e.nodeName&&!vo(e))throw Error(`Invalid target for ${_o(t)}#${n}; must be a DOM node or evented object.`)},So=(e,t,n)=>{if(!bo(e))throw Error(`Invalid event type for ${_o(t)}#${n}; must be a non-empty string or array.`)},Co=(e,t,n)=>{if(typeof e!=`function`)throw Error(`Invalid listener for ${_o(t)}#${n}; must be a function.`)},wo=(e,t,n)=>{let r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,i,a,o;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[a,o]=t):(i=t[0],a=t[1],o=t[2]),xo(i,e,n),So(a,e,n),Co(o,e,n),o=K(e,o),{isTargetingSelf:r,target:i,type:a,listener:o}},To=(e,t,n,r)=>{xo(e,e,t),e.nodeName?uo[t](e,n,r):e[t](n,r)},Eo={on(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`on`);if(To(n,`on`,r,i),!t){let e=()=>this.off(n,r,i);e.guid=i.guid;let t=()=>this.off(`dispose`,e);t.guid=i.guid,To(this,`on`,`dispose`,e),To(n,`on`,`dispose`,t)}},one(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`one`);if(t)To(n,`one`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,To(n,`one`,r,e)}},any(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`any`);if(t)To(n,`any`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,To(n,`any`,r,e)}},off(e,t,n){if(!e||bo(e))oo(this.eventBusEl_,e,t);else{let r=e,i=t;xo(r,this,`off`),So(i,this,`off`),Co(n,this,`off`),n=K(this,n),this.off(`dispose`,n),r.nodeName?(oo(r,i,n),oo(r,`dispose`,n)):vo(r)&&(r.off(i,n),r.off(`dispose`,n))}},trigger(e,t){xo(this.eventBusEl_,this,`trigger`);let n=e&&typeof e!=`string`?e.type:e;if(!bo(n))throw Error(`Invalid event type for ${_o(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return so(this.eventBusEl_,e,t)}};function Do(e,t={}){let{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=G(`span`,{className:`vjs-event-bus`});return Object.assign(e,Eo),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on(`dispose`,()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&Xa.has(e)&&Xa.delete(e)}),x.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const Oo={state:{},setState(e){typeof e==`function`&&(e=e());let t;return Ni(e,(e,n)=>{this.state[n]!==e&&(t||={},t[n]={from:this.state[n],to:e}),this.state[n]=e}),t&&vo(this)&&this.trigger({changes:t,type:`statechanged`}),t}};function ko(e,t){return Object.assign(e,Oo),e.state=Object.assign({},e.state,t),typeof e.handleStateChanged==`function`&&vo(e)&&e.on(`statechanged`,e.handleStateChanged),e}const Ao=function(e){return typeof e==`string`?e.replace(/./,e=>e.toLowerCase()):e},jo=function(e){return typeof e==`string`?e.replace(/./,e=>e.toUpperCase()):e},Mo=function(e,t){return jo(e)===jo(t)};var No=Object.freeze({__proto__:null,toLowerCase:Ao,toTitleCase:jo,titleCaseEquals:Mo});class q{constructor(e,t,n){if(this.player_=!e&&this.play?e=this:e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=W({},this.options_),t=this.options_=W(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||`no_player`;this.id_=`${t}_component_${Qa()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(` `).forEach(e=>this.addClass(e)),[`on`,`off`,`one`,`any`,`trigger`].forEach(e=>{this[e]=void 0}),t.evented!==!1&&(Do(this,{eventBusKey:this.el_?`el_`:null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,`languagechange`,this.handleLanguagechange)),ko(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(n),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:`dispose`,bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&=(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=W(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,n){return G(e,t,n)}localize(e,t,n=e){let r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],o=r&&r.split(`-`)[0],s=i&&i[o],c=n;return a&&a[e]?c=a[e]:s&&s[e]&&(c=s[e]),t&&(c=c.replace(/\{(\d+)\}/g,function(e,n){let r=t[n-1],i=r;return r===void 0&&(i=e),i})),c}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let n=`http://www.w3.org/2000/svg`,r=G(`span`,{className:`vjs-icon-placeholder vjs-svg-icon`},{"aria-hidden":`true`}),i=F.createElementNS(n,`svg`);i.setAttributeNS(null,`viewBox`,`0 0 512 512`);let a=F.createElementNS(n,`use`);return i.appendChild(a),a.setAttributeNS(null,`href`,`#vjs-icon-${e}`),r.appendChild(i),this.iconIsSet_?t.replaceChild(r,t.querySelector(`.vjs-icon-placeholder`)):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,i;if(typeof e==`string`){i=jo(e);let n=t.componentClass||i;t.name=i;let a=q.getComponent(n);if(!a)throw Error(`Component ${n} does not exist`);if(typeof a!=`function`)return null;r=new a(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,typeof r.id==`function`&&(this.childIndex_[r.id()]=r),i||=r.name&&jo(r.name()),i&&(this.childNameIndex_[i]=r,this.childNameIndex_[Ao(i)]=r),typeof r.el==`function`&&r.el()){let e=null;this.children_[n+1]&&(this.children_[n+1].el_?e=this.children_[n+1].el_:pa(this.children_[n+1])&&(e=this.children_[n+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if(typeof e==`string`&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[jo(e.name())]=null,this.childNameIndex_[Ao(e.name())]=null;let n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t=this.options_,n=e=>{let n=e.name,r=e.opts;if(t[n]!==void 0&&(r=t[n]),r===!1)return;r===!0&&(r={}),r.playerOptions=this.options_.playerOptions;let i=this.addChild(n,r);i&&(this[n]=i)},r,i=q.getComponent(`Tech`);r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(e){return!r.some(function(t){return typeof t==`string`?e===t:e===t.name})})).map(t=>{let n,r;return typeof t==`string`?(n=t,r=e[n]||this.options_[n]||{}):(n=t.name,r=t),{name:n,opts:r}}).filter(e=>{let t=q.getComponent(e.opts.componentClass||jo(e.name));return t&&!i.isTech(t)}).forEach(n)}}buildCSSClass(){return``}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger(`ready`)},1)}$(e,t){return Ra(e,t||this.contentEl())}$$(e,t){return za(e,t||this.contentEl())}hasClass(e){return va(this.el_,e)}addClass(...e){ya(this.el_,...e)}removeClass(...e){ba(this.el_,...e)}toggleClass(e,t){xa(this.el_,e,t)}show(){this.removeClass(`vjs-hidden`)}hide(){this.addClass(`vjs-hidden`)}lockShowing(){this.addClass(`vjs-lock-showing`)}unlockShowing(){this.removeClass(`vjs-lock-showing`)}getAttribute(e){return wa(this.el_,e)}setAttribute(e,t){Ta(this.el_,e,t)}removeAttribute(e){Ea(this.el_,e)}width(e,t){return this.dimension(`width`,e,t)}height(e,t){return this.dimension(`height`,e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(t!==void 0){(t===null||t!==t)&&(t=0),(``+t).indexOf(`%`)!==-1||(``+t).indexOf(`px`)!==-1?this.el_.style[e]=t:t===`auto`?this.el_.style[e]=``:this.el_.style[e]=t+`px`,n||this.trigger(`componentresize`);return}if(!this.el_)return 0;let r=this.el_.style[e],i=r.indexOf(`px`);return parseInt(i===-1?this.el_[`offset`+jo(e)]:r.slice(0,i),10)}currentDimension(e){let t=0;if(e!==`width`&&e!==`height`)throw Error(`currentDimension only accepts width or height value`);if(t=Ba(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){let n=`offset${jo(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension(`width`),height:this.currentDimension(`height`)}}currentWidth(){return this.currentDimension(`width`)}currentHeight(){return this.currentDimension(`height`)}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!==`Tab`&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null,n;this.on(`touchstart`,function(r){r.touches.length===1&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on(`touchmove`,function(e){if(e.touches.length>1)n=!1;else if(t){let r=e.touches[0].pageX-t.pageX,i=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+i*i)>10&&(n=!1)}});let r=function(){n=!1};this.on(`touchleave`,r),this.on(`touchcancel`,r),this.on(`touchend`,function(r){t=null,n===!0&&x.performance.now()-e<200&&(r.preventDefault(),this.trigger(`tap`))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let e=K(this.player(),this.player().reportUserActivity),t;this.on(`touchstart`,function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});let n=function(n){e(),this.clearInterval(t)};this.on(`touchmove`,e),this.on(`touchend`,n),this.on(`touchcancel`,n)}setTimeout(e,t){var n;return e=K(this,e),this.clearTimersOnDispose_(),n=x.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=K(this,e),this.clearTimersOnDispose_();let n=x.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=K(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=K(this,t);let n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one(`dispose`,()=>{[[`namedRafs_`,`cancelNamedAnimationFrame`],[`rafIds_`,`cancelAnimationFrame`],[`setTimeoutIds_`,`clearTimeout`],[`setIntervalIds_`,`clearInterval`]].forEach(([e,t])=>{this[e].forEach((e,n)=>this[t](n))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){let t=x.getComputedStyle(e,null),n=t.getPropertyValue(`visibility`);return t.getPropertyValue(`display`)!==`none`&&![`hidden`,`collapse`].includes(n)}function n(e){return!(!t(e.parentElement)||!t(e)||e.style.opacity===`0`||x.getComputedStyle(e).height===`0px`||x.getComputedStyle(e).width===`0px`)}function r(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(F.documentElement.clientWidth||x.innerWidth)||t.y<0||t.y>(F.documentElement.clientHeight||x.innerHeight))return!1;let n=F.elementFromPoint(t.x,t.y);for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else return!1}}return e||=this.el(),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!=`string`||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let n=q.getComponent(`Tech`),r=n&&n.isTech(t),i=q===t||q.prototype.isPrototypeOf(t.prototype);if(r||!i){let t;throw t=r?`techs must be registered using Tech.registerTech()`:`must be a Component subclass`,Error(`Illegal component, "${e}"; ${t}.`)}e=jo(e),q.components_||={};let a=q.getComponent(`Player`);if(e===`Player`&&a&&a.players){let e=a.players,t=Object.keys(e);if(e&&t.length>0){for(let n=0;n<t.length;n++)if(e[t[n]]!==null)throw Error(`Can not register Player component after player has been created.`)}}return q.components_[e]=t,q.components_[Ao(e)]=t,t}static getComponent(e){if(e&&q.components_)return q.components_[e]}}q.registerComponent(`Component`,q);function Po(e,t,n){if(typeof t!=`number`||t<0||t>n)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}function Fo(e,t,n,r){return Po(e,r,n.length-1),n[r][t]}function Io(e){let t;return t=e===void 0||e.length===0?{length:0,start(){throw Error(`This TimeRanges object is empty`)},end(){throw Error(`This TimeRanges object is empty`)}}:{length:e.length,start:Fo.bind(null,`start`,0,e),end:Fo.bind(null,`end`,1,e)},x.Symbol&&x.Symbol.iterator&&(t[x.Symbol.iterator]=()=>(e||[]).values()),t}function Lo(e,t){return Array.isArray(e)?Io(e):e===void 0||t===void 0?Io():Io([[e,t]])}const Ro=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n=`-`),i=i>0||o>0?i+`:`:``,r=((i||a>=10)&&r<10?`0`+r:r)+`:`,n=n<10?`0`+n:n,i+r+n};let zo=Ro;function Bo(e){zo=e}function Vo(){zo=Ro}function Ho(e,t=e){return zo(e,t)}var Uo=Object.freeze({__proto__:null,createTimeRanges:Lo,createTimeRange:Lo,setFormatTime:Bo,resetFormatTime:Vo,formatTime:Ho});function Wo(e,t){let n=0,r,i;if(!t)return 0;(!e||!e.length)&&(e=Lo(0,0));for(let a=0;a<e.length;a++)r=e.start(a),i=e.end(a),i>t&&(i=t),n+=i-r;return n/t}function Go(e){if(e instanceof Go)return e;typeof e==`number`?this.code=e:typeof e==`string`?this.message=e:Fi(e)&&(typeof e.code==`number`&&(this.code=e.code),Object.assign(this,e)),this.message||=Go.defaultMessages[this.code]||``}Go.prototype.code=0,Go.prototype.message=``,Go.prototype.status=null,Go.prototype.metadata=null,Go.errorTypes=[`MEDIA_ERR_CUSTOM`,`MEDIA_ERR_ABORTED`,`MEDIA_ERR_NETWORK`,`MEDIA_ERR_DECODE`,`MEDIA_ERR_SRC_NOT_SUPPORTED`,`MEDIA_ERR_ENCRYPTED`],Go.defaultMessages={1:`You aborted the media playback`,2:`A network error caused the media download to fail part-way.`,3:`The media playback was aborted due to a corruption problem or because the media used features your browser did not support.`,4:`The media could not be loaded, either because the server or network failed or because the format is not supported.`,5:`The media is encrypted and we do not have the keys to decrypt it.`},Go.MEDIA_ERR_CUSTOM=0,Go.prototype.MEDIA_ERR_CUSTOM=0,Go.MEDIA_ERR_ABORTED=1,Go.prototype.MEDIA_ERR_ABORTED=1,Go.MEDIA_ERR_NETWORK=2,Go.prototype.MEDIA_ERR_NETWORK=2,Go.MEDIA_ERR_DECODE=3,Go.prototype.MEDIA_ERR_DECODE=3,Go.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Go.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Go.MEDIA_ERR_ENCRYPTED=5,Go.prototype.MEDIA_ERR_ENCRYPTED=5;function Ko(e){return e!=null&&typeof e.then==`function`}function qo(e){Ko(e)&&e.then(null,e=>{})}const Jo=function(e){return[`kind`,`label`,`language`,`id`,`inBandMetadataTrackDispatchType`,`mode`,`src`].reduce((t,n,r)=>(e[n]&&(t[n]=e[n]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var Yo={textTracksToJson:function(e){let t=e.$$(`track`),n=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=Jo(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return n.indexOf(e)===-1}).map(Jo))},jsonToTextTracks:function(e,t){return e.forEach(function(e){let n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>n.addCue(e))}),t.textTracks()},trackToJson:Jo};const Xo=`vjs-modal-dialog`;class Zo extends q{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=G(`div`,{className:`${Xo}-content`},{role:`document`}),this.descEl_=G(`p`,{className:`${Xo}-description vjs-control-text`,id:this.el().getAttribute(`aria-describedby`)}),ga(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl(`div`,{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":`true`,"aria-label":this.label(),role:`dialog`,"aria-live":`polite`})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Xo} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||`Modal Window`)}description(){let e=this.options_.description||this.localize(`This is a modal window.`);return this.closeable()&&(e+=` `+this.localize(`This modal can be closed by pressing the Escape key or activating the close button.`)),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}let e=this.player();this.trigger(`beforemodalopen`),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on(`keydown`,this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute(`aria-hidden`,`false`),this.trigger(`modalopen`),this.hasBeenOpened_=!0}opened(e){return typeof e==`boolean`&&this[e?`open`:`close`](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger(`beforemodalclose`),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off(`keydown`,this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute(`aria-hidden`,`true`),this.trigger({type:`modalclose`,bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e==`boolean`){let t=this.closeable_=!!e,n=this.getChild(`closeButton`);if(t&&!n){let e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild(`closeButton`,{controlText:`Close Modal Dialog`}),this.contentEl_=e,this.on(n,`close`,this.close_)}!t&&n&&(this.off(n,`close`,this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger(`beforemodalfill`),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),Ia(t,e),this.trigger(`modalfill`),r?n.insertBefore(t,r):n.appendChild(t);let i=this.getChild(`closeButton`);i&&n.appendChild(i.el_),this.trigger(`aftermodalfill`)}empty(){this.trigger(`beforemodalempty`),Na(this.contentEl()),this.trigger(`modalempty`)}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){let e=F.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&=(this.previouslyActiveEl_.focus(),null)}handleKeyDown(e){if(this.trigger({type:`modalKeydown`,originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key===`Escape`&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!==`Tab`)return;let t=this.focusableEls_(),n=this.el_.querySelector(`:focus`),r;for(let e=0;e<t.length;e++)if(n===t[e]){r=e;break}F.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll(`*`);return Array.prototype.filter.call(e,e=>(e instanceof x.HTMLAnchorElement||e instanceof x.HTMLAreaElement)&&e.hasAttribute(`href`)||(e instanceof x.HTMLInputElement||e instanceof x.HTMLSelectElement||e instanceof x.HTMLTextAreaElement||e instanceof x.HTMLButtonElement)&&!e.hasAttribute(`disabled`)||e instanceof x.HTMLIFrameElement||e instanceof x.HTMLObjectElement||e instanceof x.HTMLEmbedElement||e.hasAttribute(`tabindex`)&&e.getAttribute(`tabindex`)!==-1||e.hasAttribute(`contenteditable`))}}Zo.prototype.options_={pauseOnOpen:!0,temporary:!0},q.registerComponent(`ModalDialog`,Zo);class Qo extends go{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){let t=this.tracks_.length;``+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:`addtrack`,target:this})),e.labelchange_=()=>{this.trigger({track:e,type:`labelchange`,target:this})},vo(e)&&e.addEventListener(`labelchange`,e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:`removetrack`,target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}}Qo.prototype.allowedEvents_={change:`change`,addtrack:`addtrack`,removetrack:`removetrack`,labelchange:`labelchange`};for(let e in Qo.prototype.allowedEvents_)Qo.prototype[`on`+e]=null;const $o=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)};class es extends Qo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){$o(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&$o(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,$o(this,e),this.changing_=!1,this.trigger(`change`))},e.addEventListener(`enabledchange`,e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener(`enabledchange`,e.enabledChange_),e.enabledChange_=null)}}const ts=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)};class ns extends Qo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){ts(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&ts(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,ts(this,e),this.changing_=!1,this.trigger(`change`))},e.addEventListener(`selectedchange`,e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener(`selectedchange`,e.selectedChange_),e.selectedChange_=null)}}class rs extends Qo{addTrack(e){super.addTrack(e),this.queueChange_||=()=>this.queueTrigger(`change`),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger(`selectedlanguagechange`)),e.addEventListener(`modechange`,this.queueChange_),[`metadata`,`chapters`].indexOf(e.kind)===-1&&e.addEventListener(`modechange`,this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener(`modechange`,this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener(`modechange`,this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class is{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;``+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off==`function`&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off==`function`&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class as{constructor(e){as.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;let i=function(e){``+e in this||Object.defineProperty(this,``+e,{get(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}}const os={alternative:`alternative`,captions:`captions`,main:`main`,sign:`sign`,subtitles:`subtitles`,commentary:`commentary`},ss={alternative:`alternative`,descriptions:`descriptions`,main:`main`,"main-desc":`main-desc`,translation:`translation`,commentary:`commentary`},cs={subtitles:`subtitles`,captions:`captions`,descriptions:`descriptions`,chapters:`chapters`,metadata:`metadata`},ls={disabled:`disabled`,hidden:`hidden`,showing:`showing`};class us extends go{constructor(e={}){super();let t={id:e.id||`vjs_track_`+Qa(),kind:e.kind||``,language:e.language||``},n=e.label||``;for(let e in t)Object.defineProperty(this,e,{get(){return t[e]},set(){}});Object.defineProperty(this,"label",{get(){return n},set(e){e!==n&&(n=e,this.trigger(`labelchange`))}})}}const ds=function(e){return new URL(e,F.baseURI)},fs=function(e){return new URL(e,F.baseURI).href},ps=function(e){if(typeof e==`string`){let t=e.split(`?`)[0].replace(/\/+$/,``).match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():``}return``},ms=function(e,t=x.location){return ds(e).origin!==t.origin};var hs=Object.freeze({__proto__:null,parseUrl:ds,getAbsoluteURL:fs,getFileExtension:ps,isCrossOrigin:ms});const gs=function(e,t){let n=new x.WebVTT.Parser(x,x.vttjs,x.WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:`loadeddata`,target:t})},n.parse(e),r.length>0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>U.error(e)),x.console&&x.console.groupEnd&&x.console.groupEnd()),n.flush()},_s=function(e,t){let n={uri:e},r=ms(e);r&&(n.cors=r);let i=t.tech_.crossOrigin()===`use-credentials`;i&&(n.withCredentials=i),Ge(n,K(this,function(e,n,r){if(e)return U.error(e,n);t.loaded_=!0,typeof x.WebVTT==`function`?gs(r,t):t.tech_&&t.tech_.any([`vttjsloaded`,`vttjserror`],e=>{if(e.type===`vttjserror`)U.error(`vttjs failed to load, stopping trying to process ${t.src}`);else return gs(r,t)})}))};class vs extends us{constructor(e={}){if(!e.tech)throw Error(`A tech was not provided.`);let t=W(e,{kind:cs[e.kind]||`subtitles`,language:e.language||e.srclang||``}),n=ls[t.mode]||`disabled`,r=t.default;(t.kind===`metadata`||t.kind===`chapters`)&&(n=`hidden`),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;let i=new as(this.cues_),a=new as(this.activeCues_),o=!1;this.timeupdateHandler=K(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,o&&=(this.trigger(`cuechange`),!1)),e.type!==`timeupdate`&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),this.tech_.one(`dispose`,()=>{this.stopTracking()}),n!==`disabled`&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(e){ls[e]&&n!==e&&(n=e,!this.preload_&&n!==`disabled`&&this.cues.length===0&&_s(this.src,this),this.stopTracking(),n!==`disabled`&&this.startTracking(),this.trigger(`modechange`))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;let e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){let r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(let e=0;e<t.length;e++)this.activeCues_.indexOf(t[e])===-1&&(o=!0);return this.activeCues_=t,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!==`subtitles`&&t.kind!==`captions`)&&_s(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on(`timeupdate`,this.timeupdateHandler)}stopTracking(){this.rvf_&&=(this.tech_.cancelVideoFrameCallback(this.rvf_),void 0),this.tech_.off(`timeupdate`,this.timeupdateHandler)}addCue(e){let t=e;if(!(`getCueAsHTML`in t)){t=new x.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(let n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}let n=this.tech_.textTracks();for(let e=0;e<n.length;e++)n[e]!==this&&n[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Yo.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}vs.prototype.allowedEvents_={cuechange:`cuechange`};class ys extends us{constructor(e={}){let t=W(e,{kind:ss[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,"enabled",{get(){return n},set(e){typeof e==`boolean`&&e!==n&&(n=e,this.trigger(`enabledchange`))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class bs extends us{constructor(e={}){let t=W(e,{kind:os[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,"selected",{get(){return n},set(e){typeof e==`boolean`&&e!==n&&(n=e,this.trigger(`selectedchange`))}}),t.selected&&(this.selected=t.selected)}}class xs extends go{constructor(e={}){super();let t,n=new vs(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return n}}}),t=xs.NONE,n.addEventListener(`loadeddata`,()=>{t=xs.LOADED,this.trigger({type:`load`,target:this})})}}xs.prototype.allowedEvents_={load:`load`},xs.NONE=0,xs.LOADING=1,xs.LOADED=2,xs.ERROR=3;const Ss={audio:{ListClass:es,TrackClass:ys,capitalName:`Audio`},video:{ListClass:ns,TrackClass:bs,capitalName:`Video`},text:{ListClass:rs,TrackClass:vs,capitalName:`Text`}};Object.keys(Ss).forEach(function(e){Ss[e].getterName=`${e}Tracks`,Ss[e].privateName=`${e}Tracks_`});const Cs={remoteText:{ListClass:rs,TrackClass:vs,capitalName:`RemoteText`,getterName:`remoteTextTracks`,privateName:`remoteTextTracks_`},remoteTextEl:{ListClass:is,TrackClass:xs,capitalName:`RemoteTextTrackEls`,getterName:`remoteTextTrackEls`,privateName:`remoteTextTrackEls_`}},ws=Object.assign({},Ss,Cs);Cs.names=Object.keys(Cs),Ss.names=Object.keys(Ss),ws.names=[].concat(Cs.names,Ss.names);function Ts(e,t,n,r,i={}){let a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;let o=new ws.text.TrackClass(i);return a.addTrack(o),o}class J extends q{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on(`playing`,function(){this.hasStarted_=!0}),this.on(`loadstart`,function(){this.hasStarted_=!1}),ws.names.forEach(t=>{let n=ws[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),[`Text`,`Audio`,`Video`].forEach(t=>{e[`native${t}Tracks`]===!1&&(this[`featuresNative${t}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ws.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||`Unknown Tech`)}triggerSourceset(e){this.isReady_||this.one(`ready`,()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:`sourceset`})}manualProgressOn(){this.on(`durationchange`,this.onDurationChange_),this.manualProgress=!0,this.one(`ready`,this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off(`durationchange`,this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(K(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger(`progress`),this.bufferedPercent_=e,e===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Lo(0,0)}bufferedPercent(){return Wo(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on(`play`,this.trackCurrentTime_),this.on(`pause`,this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off(`play`,this.trackCurrentTime_),this.off(`pause`,this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Ss.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(e=>{let t=this[`${e}Tracks`]()||[],n=t.length;for(;n--;){let r=t[n];e===`text`&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Go(e),this.trigger(`error`)),this.error_}played(){return this.hasStarted_?Lo(0,0):Lo()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}initTrackListeners(){Ss.names.forEach(e=>{let t=Ss[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener(`removetrack`,n),r.addEventListener(`addtrack`,n),this.on(`dispose`,()=>{r.removeEventListener(`removetrack`,n),r.removeEventListener(`addtrack`,n)})})}addWebVttScript_(){if(!x.WebVTT){if(F.body.contains(this.el())){if(!this.options_[`vtt.js`]&&Ii(it)&&Object.keys(it).length>0){this.trigger(`vttjsloaded`);return}let e=F.createElement(`script`);e.src=this.options_[`vtt.js`]||`https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js`,e.onload=()=>{this.trigger(`vttjsloaded`)},e.onerror=()=>{this.trigger(`vttjserror`)},this.on(`dispose`,()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on(`addtrack`,n),t.on(`removetrack`,r),this.addWebVttScript_();let i=()=>this.trigger(`texttrackchange`),a=()=>{i();for(let t=0;t<e.length;t++){let n=e[t];n.removeEventListener(`cuechange`,i),n.mode===`showing`&&n.addEventListener(`cuechange`,i)}};a(),e.addEventListener(`change`,a),e.addEventListener(`addtrack`,a),e.addEventListener(`removetrack`,a),this.on(`dispose`,function(){t.off(`addtrack`,n),t.off(`removetrack`,r),e.removeEventListener(`change`,a),e.removeEventListener(`addtrack`,a),e.removeEventListener(`removetrack`,a);for(let t=0;t<e.length;t++)e[t].removeEventListener(`cuechange`,i)})}addTextTrack(e,t,n){if(!e)throw Error(`TextTrack kind is required but was not provided`);return Ts(this,e,t,n)}createRemoteTextTrack(e){let t=W(e,{tech:this});return new Cs.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let n=this.createRemoteTextTrack(e);return typeof t!=`boolean`&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=Qa();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one(`playing`,()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return``}static canPlayType(e){return``}static canPlaySource(e,t){return J.canPlayType(e.type)}static isTech(e){return e.prototype instanceof J||e instanceof J||e===J}static registerTech(e,t){if(J.techs_||={},!J.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!J.canPlayType)throw Error(`Techs must have a static canPlayType method on them`);if(!J.canPlaySource)throw Error(`Techs must have a static canPlaySource method on them`);return e=jo(e),J.techs_[e]=t,J.techs_[Ao(e)]=t,e!==`Tech`&&J.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(J.techs_&&J.techs_[e])return J.techs_[e];if(e=jo(e),x&&x.videojs&&x.videojs[e])return U.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}ws.names.forEach(function(e){let t=ws[e];J.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),J.prototype.featuresVolumeControl=!0,J.prototype.featuresMuteControl=!0,J.prototype.featuresFullscreenResize=!1,J.prototype.featuresPlaybackRate=!1,J.prototype.featuresProgressEvents=!1,J.prototype.featuresSourceset=!1,J.prototype.featuresTimeupdateEvents=!1,J.prototype.featuresNativeTextTracks=!1,J.prototype.featuresVideoFrameCallback=!1,J.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||=e.sourceHandlers=[],n===void 0&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){let n=e.sourceHandlers||[],r;for(let e=0;e<n.length;e++)if(r=n[e].canPlayType(t),r)return r;return``},e.selectSourceHandler=function(t,n){let r=e.sourceHandlers||[],i;for(let e=0;e<r.length;e++)if(i=r[e].canHandleSource(t,n),i)return r[e];return null},e.canPlaySource=function(t,n){let r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):``},[`seekable`,`seeking`,`duration`].forEach(function(e){let t=this[e];typeof t==`function`&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:U.error(`No source handler found for the current source.`)),this.disposeSourceHandler(),this.off(`dispose`,this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one(`dispose`,this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&=(this.clearTracks([`audio`,`video`]),null),this.cleanupAutoTextTracks(),this.sourceHandler_&&=(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),null)}},q.registerComponent(`Tech`,J),J.registerTech(`Tech`,J),J.defaultTechOrder_=[];const Es={},Ds={},Os={};function ks(e,t){Es[e]=Es[e]||[],Es[e].push(t)}function As(e,t,n){e.setTimeout(()=>Hs(t,Es[t.type],n,e),1)}function js(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function Ms(e,t,n){return e.reduceRight(Rs(n),t[n]())}function Ns(e,t,n,r){return t[n](e.reduce(Rs(n),r))}function Ps(e,t,n,r=null){let i=`call`+jo(n),a=e.reduce(Rs(i),r),o=a===Os,s=o?null:t[n](a);return zs(e,n,s,o),s}const Fs={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Is={setCurrentTime:1,setMuted:1,setVolume:1},Ls={play:1,pause:1};function Rs(e){return(t,n)=>t===Os?Os:n[e]?n[e](t):t}function zs(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i];a[t]&&a[t](r,n)}}function Bs(e){Ds.hasOwnProperty(e.id())&&delete Ds[e.id()]}function Vs(e,t){let n=Ds[e.id()],r=null;if(n==null)return r=t(e),Ds[e.id()]=[[t,r]],r;for(let e=0;e<n.length;e++){let[i,a]=n[e];i===t&&(r=a)}return r===null&&(r=t(e),n.push([t,r])),r}function Hs(e={},t=[],n,r,i=[],a=!1){let[o,...s]=t;if(typeof o==`string`)Hs(e,Es[o],n,r,i,a);else if(o){let t=Vs(r,o);if(!t.setSource)return i.push(t),Hs(e,s,n,r,i,a);t.setSource(Object.assign({},e),function(o,c){if(o)return Hs(e,s,n,r,i,a);i.push(t),Hs(c,e.type===c.type?s:Es[c.type],n,r,i,a)})}else s.length?Hs(e,s,n,r,i,a):a?n(e,i):Hs(e,Es[`*`],n,r,i,!0)}const Us={opus:`video/ogg`,ogv:`video/ogg`,mp4:`video/mp4`,mov:`video/mp4`,m4v:`video/mp4`,mkv:`video/x-matroska`,m4a:`audio/mp4`,mp3:`audio/mpeg`,aac:`audio/aac`,caf:`audio/x-caf`,flac:`audio/flac`,oga:`audio/ogg`,wav:`audio/wav`,m3u8:`application/x-mpegURL`,mpd:`application/dash+xml`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,png:`image/png`,svg:`image/svg+xml`,webp:`image/webp`},Ws=function(e=``){let t=ps(e);return Us[t.toLowerCase()]||``},Gs=(e,t)=>{if(!t)return``;if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let n=e.cache_.sources.filter(e=>e.src===t);if(n.length)return n[0].type;let r=e.$$(`source`);for(let e=0;e<r.length;e++){let n=r[e];if(n.type&&n.src&&n.src===t)return n.type}return Ws(t)},Ks=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=Ks(e),Array.isArray(e)?t=t.concat(e):Fi(e)&&t.push(e)}),e=t}else e=typeof e==`string`&&e.trim()?[qs({src:e})]:Fi(e)&&typeof e.src==`string`&&e.src&&e.src.trim()?[qs(e)]:[];return e};function qs(e){if(!e.type){let t=Ws(e.src);t&&(e.type=t)}return e}var Js=`<svg xmlns="http://www.w3.org/2000/svg">
18
+ @`+(e.systemId||``)+`#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function m(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){d.prototype[e]=function(){return null}});function h(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}return en.__DOMHandler=d,en.normalizeLineEndings=c,en.DOMParser=l,en}var un;function dn(){if(un)return qt;un=1;var e=$t();return qt.DOMImplementation=e.DOMImplementation,qt.XMLSerializer=e.XMLSerializer,qt.DOMParser=ln().DOMParser,qt}var fn=dn();const pn=e=>!!e&&typeof e==`object`,mn=(...e)=>e.reduce((e,t)=>(typeof t==`object`&&Object.keys(t).forEach(n=>{e[n]=Array.isArray(e[n])&&Array.isArray(t[n])?e[n].concat(t[n]):pn(e[n])&&pn(t[n])?mn(e[n],t[n]):t[n]}),e),{}),hn=e=>Object.keys(e).map(t=>e[t]),gn=(e,t)=>{let n=[];for(let r=e;r<t;r++)n.push(r);return n},_n=e=>e.reduce((e,t)=>e.concat(t),[]),vn=e=>{if(!e.length)return[];let t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},yn=(e,t)=>e.reduce((e,n,r)=>(n[t]&&e.push(r),e),[]),bn=(e,t)=>hn(e.reduce((e,n)=>(n.forEach(n=>{e[t(n)]=n}),e),{}));var xn={INVALID_NUMBER_OF_PERIOD:`INVALID_NUMBER_OF_PERIOD`,DASH_EMPTY_MANIFEST:`DASH_EMPTY_MANIFEST`,DASH_INVALID_XML:`DASH_INVALID_XML`,NO_BASE_URL:`NO_BASE_URL`,SEGMENT_TIME_UNSPECIFIED:`SEGMENT_TIME_UNSPECIFIED`,UNSUPPORTED_UTC_TIMING_SCHEME:`UNSUPPORTED_UTC_TIMING_SCHEME`};const Sn=({baseUrl:e=``,source:t=``,range:n=``,indexRange:r=``})=>{let i={uri:t,resolvedUri:ot(e||``,t)};if(n||r){let e=(n||r).split(`-`),t=x.BigInt?x.BigInt(e[0]):parseInt(e[0],10),a=x.BigInt?x.BigInt(e[1]):parseInt(e[1],10);t<2**53-1&&typeof t==`bigint`&&(t=Number(t)),a<2**53-1&&typeof a==`bigint`&&(a=Number(a));let o;o=typeof a==`bigint`||typeof t==`bigint`?x.BigInt(a)-x.BigInt(t)+x.BigInt(1):a-t+1,typeof o==`bigint`&&o<2**53-1&&(o=Number(o)),i.byterange={length:o,offset:t}}return i},Cn=e=>{let t;return t=typeof e.offset==`bigint`||typeof e.length==`bigint`?x.BigInt(e.offset)+x.BigInt(e.length)-x.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`},wn=e=>(e&&typeof e!=`number`&&(e=parseInt(e,10)),isNaN(e)?null:e),Tn={static(e){let{duration:t,timescale:n=1,sourceDuration:r,periodDuration:i}=e,a=wn(e.endNumber),o=t/n;return typeof a==`number`?{start:0,end:a}:typeof i==`number`?{start:0,end:i/o}:{start:0,end:r/o}},dynamic(e){let{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:i=1,duration:a,periodStart:o=0,minimumUpdatePeriod:s=0,timeShiftBufferDepth:c=1/0}=e,l=wn(e.endNumber),u=(t+n)/1e3,d=r+o,f=u+s-d,p=Math.ceil(f*i/a),m=Math.floor((u-d-c)*i/a),h=Math.floor((u-d)*i/a);return{start:Math.max(0,m),end:typeof l==`number`?l:Math.min(p,h)}}},En=e=>t=>{let{duration:n,timescale:r=1,periodStart:i,startNumber:a=1}=e;return{number:a+t,duration:n/r,timeline:i,time:t*n}},Dn=e=>{let{type:t,duration:n,timescale:r=1,periodDuration:i,sourceDuration:a}=e,{start:o,end:s}=Tn[t](e),c=gn(o,s).map(En(e));if(t===`static`){let e=c.length-1,t=typeof i==`number`?i:a;c[e].duration=t-n/r*e}return c},On=e=>{let{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:i=``,periodStart:a,presentationTime:o,number:s=0,duration:c}=e;if(!t)throw Error(xn.NO_BASE_URL);let l=Sn({baseUrl:t,source:n.sourceURL,range:n.range}),u=Sn({baseUrl:t,source:t,indexRange:i});if(u.map=l,c){let t=Dn(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else r&&(u.duration=r,u.timeline=a);return u.presentationTime=o||a,u.number=s,[u]},kn=(e,t,n)=>{let r=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,s=o.offset+o.length,c=t.timescale,l=t.references.filter(e=>e.referenceType!==1),u=[],d=e.endList?`static`:`dynamic`,f=e.sidx.timeline,p=f,m=e.mediaSequence||0,h;h=typeof t.firstOffset==`bigint`?x.BigInt(s)+t.firstOffset:s+t.firstOffset;for(let e=0;e<l.length;e++){let o=t.references[e],s=o.referencedSize,l=o.subsegmentDuration,g;g=typeof h==`bigint`?h+x.BigInt(s)-x.BigInt(1):h+s-1;let _=`${h}-${g}`,v=On({baseUrl:n,timescale:c,timeline:a,periodStart:f,presentationTime:p,number:m,duration:l,sourceDuration:i,indexRange:_,type:d})[0];r&&(v.map=r),u.push(v),h+=typeof h==`bigint`?x.BigInt(s):s,p+=l/c,m++}return e.segments=u,e},An=[`AUDIO`,`SUBTITLES`],jn=e=>bn(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Mn=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null},Nn=e=>{let t=[];return Kt(e,An,(e,n,r,i)=>{t=t.concat(e.playlists||[])}),t},Pn=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,n)=>{t.number=e.mediaSequence+n})},Fn=({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach(t=>{t.discontinuitySequence=n.findIndex(function({timeline:e}){return e===t.timeline});let r=Mn(e,t.attributes.NAME);if(!r||t.sidx)return;let i=t.segments[0],a=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666});a===-1?(Pn({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--):(r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),Pn({playlist:t,mediaSequence:r.segments[a].number}))})},In=({oldManifest:e,newManifest:t})=>{let n=e.playlists.concat(Nn(e)),r=t.playlists.concat(Nn(t));return t.timelineStarts=jn([e.timelineStarts,t.timelineStarts]),Fn({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t},Ln=e=>e&&e.uri+`-`+Cn(e.byterange),Rn=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),n=[];return Object.values(t).forEach(e=>{let t=hn(e.reduce((e,t)=>{let n=t.attributes.id+(t.attributes.lang||``);return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));n=n.concat(t)}),n.map(e=>(e.discontinuityStarts=yn(e.segments||[],`discontinuity`),e))},zn=(e,t)=>{let n=Ln(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&kn(e,r,e.sidx.resolvedUri),e},Bn=(e,t={})=>{if(!Object.keys(t).length)return e;for(let n in e)e[n]=zn(e[n],t);return e},Vn=({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:a},o)=>{let s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuitySequence:i,discontinuityStarts:a,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),n&&(s.sidx=n),o&&(s.attributes.AUDIO=`audio`,s.attributes.SUBTITLES=`subs`),s},Hn=({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:i})=>{t===void 0&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||``,duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let a={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(a.CODECS=e.codecs);let o={attributes:a,uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:n,segments:t};return e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),o},Un=(e,t={},n=!1)=>{let r,i=e.reduce((e,i)=>{let a=i.attributes.role&&i.attributes.role.value||``,o=i.attributes.lang||``,s=i.attributes.label||`main`;if(o&&!i.attributes.label){let e=a?` (${a})`:``;s=`${i.attributes.lang}${e}`}e[s]||(e[s]={language:o,autoselect:!0,default:a===`main`,playlists:[],uri:``});let c=zn(Vn(i,n),t);return e[s].playlists.push(c),r===void 0&&a===`main`&&(r=i,r.default=!0),e},{});if(!r){let e=Object.keys(i)[0];i[e].default=!0}return i},Wn=(e,t={})=>e.reduce((e,n)=>{let r=n.attributes.label||n.attributes.lang||`text`,i=n.attributes.lang||`und`;return e[r]||(e[r]={language:i,default:!1,autoselect:!1,playlists:[],uri:``}),e[r].playlists.push(zn(Hn(n),t)),e},{}),Gn=e=>e.reduce((e,t)=>(t&&t.forEach(t=>{let{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty(`aspectRatio`)&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty(`easyReader`)&&(e[r].easyReader=t.easyReader),t.hasOwnProperty(`3D`)&&(e[r][`3D`]=t[`3D`])}),e),{}),Kn=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{let i={attributes:{NAME:e.id,AUDIO:`audio`,SUBTITLES:`subs`,RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(i.attributes[`FRAME-RATE`]=e.frameRate),e.qualityRanking!==void 0&&(i.attributes.SCORE=1/(e.qualityRanking+1)),e.contentProtection&&(i.contentProtection=e.contentProtection),e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),n&&(i.sidx=n),i},qn=({attributes:e})=>e.mimeType===`video/mp4`||e.mimeType===`video/webm`||e.contentType===`video`,Jn=({attributes:e})=>e.mimeType===`audio/mp4`||e.mimeType===`audio/webm`||e.contentType===`audio`,Yn=({attributes:e})=>e.mimeType===`text/vtt`||e.contentType===`text`,Xn=(e,t)=>{e.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})})},Zn=e=>e?Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(r.playlists)},[]):[],Qn=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:i,eventStream:a})=>{if(!e.length)return{};let{sourceDuration:o,type:s,suggestedPresentationDelay:c,minimumUpdatePeriod:l}=e[0].attributes,u=Rn(e.filter(qn)).map(Kn),d=Rn(e.filter(Jn)),f=Rn(e.filter(Yn)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:``,duration:o,playlists:Bn(u,r)};l>=0&&(m.minimumUpdatePeriod=l*1e3),t&&(m.locations=t),n&&(m.contentSteering=n),s===`dynamic`&&(m.suggestedPresentationDelay=c),a&&a.length>0&&(m.eventStream=a);let h=m.playlists.length===0,g=d.length?Un(d,r,h):null,_=f.length?Wn(f,r):null,v=u.concat(Zn(g),Zn(_)),y=v.map(({timelineStarts:e})=>e);return m.timelineStarts=jn(y),Xn(v,m.timelineStarts),g&&(m.mediaGroups.AUDIO.audio=g),_&&(m.mediaGroups.SUBTITLES.subs=_),p.length&&(m.mediaGroups[`CLOSED-CAPTIONS`].cc=Gn(p)),i?In({oldManifest:i,newManifest:m}):m},$n=(e,t,n)=>{let{NOW:r,clientOffset:i,availabilityStartTime:a,timescale:o=1,periodStart:s=0,minimumUpdatePeriod:c=0}=e,l=(r+i)/1e3,u=a+s,d=l+c-u;return Math.ceil((d*o-t)/n)},er=(e,t)=>{let{type:n,minimumUpdatePeriod:r=0,media:i=``,sourceDuration:a,timescale:o=1,startNumber:s=1,periodStart:c}=e,l=[],u=-1;for(let d=0;d<t.length;d++){let f=t[d],p=f.d,m=f.r||0,h=f.t||0;u<0&&(u=h),h&&h>u&&(u=h);let g;if(m<0){let s=d+1;g=s===t.length?n===`dynamic`&&r>0&&i.indexOf(`$Number$`)>0?$n(e,u,p):(a*o-u)/p:(t[s].t-u)/p}else g=m+1;let _=s+l.length+g,v=s+l.length;for(;v<_;)l.push({number:v,duration:p/o,time:u,timeline:c}),u+=p,v++}return l},tr=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,nr=e=>(t,n,r,i)=>{if(t===`$$`)return`$`;if(e[n]===void 0)return t;let a=``+e[n];return n===`RepresentationID`||(i=r?parseInt(i,10):1,a.length>=i)?a:`${Array(i-a.length+1).join(`0`)}${a}`},rr=(e,t)=>e.replace(tr,nr(t)),ir=(e,t)=>!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?Dn(e):er(e,t),ar=(e,t)=>{let n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:``,range:``}}=e,i=Sn({baseUrl:e.baseUrl,source:rr(r.sourceURL,n),range:r.range});return ir(e,t).map(t=>{n.Number=t.number,n.Time=t.time;let r=rr(e.media||``,n),a=e.timescale||1,o=e.presentationTimeOffset||0,s=e.periodStart+(t.time-o)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:ot(e.baseUrl||``,r),map:i,number:t.number,presentationTime:s}})},or=(e,t)=>{let{baseUrl:n,initialization:r={}}=e,i=Sn({baseUrl:n,source:r.sourceURL,range:r.range}),a=Sn({baseUrl:n,source:t.media,range:t.mediaRange});return a.map=i,a},sr=(e,t)=>{let{duration:n,segmentUrls:r=[],periodStart:i}=e;if(!n&&!t||n&&t)throw Error(xn.SEGMENT_TIME_UNSPECIFIED);let a=r.map(t=>or(e,t)),o;return n&&(o=Dn(e)),t&&(o=er(e,t)),o.map((t,n)=>{if(a[n]){let r=a[n],o=e.timescale||1,s=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=i+(t.time-s)/o,r}}).filter(e=>e)},cr=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=ar,n=mn(e,t.template)):t.base?(r=On,n=mn(e,t.base)):t.list&&(r=sr,n=mn(e,t.list));let i={attributes:e};if(!r)return i;let a=r(n,t.segmentTimeline);if(n.duration){let{duration:e,timescale:t=1}=n;n.duration=e/t}else a.length?n.duration=a.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):n.duration=0;return i.attributes=n,i.segments=a,t.base&&n.indexRange&&(i.sidx=a[0],i.segments=[]),i},lr=e=>e.map(cr),V=(e,t)=>vn(e.childNodes).filter(({tagName:e})=>e===t),ur=e=>e.textContent.trim(),dr=e=>parseFloat(e.split(`/`).reduce((e,t)=>e/t)),fr=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[n,r,i,a,o,s]=t.slice(1);return parseFloat(n||0)*31536e3+parseFloat(r||0)*2592e3+parseFloat(i||0)*86400+parseFloat(a||0)*3600+parseFloat(o||0)*60+parseFloat(s||0)},pr=e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+=`Z`),Date.parse(e)),mr={mediaPresentationDuration(e){return fr(e)},availabilityStartTime(e){return pr(e)/1e3},minimumUpdatePeriod(e){return fr(e)},suggestedPresentationDelay(e){return fr(e)},type(e){return e},timeShiftBufferDepth(e){return fr(e)},start(e){return fr(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return dr(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){let t=parseInt(e,10);return isNaN(t)?fr(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},qualityRanking(e){return parseInt(e,10)},qualityranking(e){return parseInt(e,10)},DEFAULT(e){return e}},hr={qualityranking:`qualityRanking`},gr=e=>e&&e.attributes?vn(e.attributes).reduce((e,t)=>{let n=mr[t.name]||mr.DEFAULT,r=hr[t.name]||t.name;return e[r]=n(t.value),e},{}):{},_r={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":`org.w3.clearkey`,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":`com.widevine.alpha`,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":`com.microsoft.playready`,"urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":`com.adobe.primetime`,"urn:mpeg:dash:mp4protection:2011":`mp4protection`},vr=(e,t)=>t.length?_n(e.map(function(e){return t.map(function(t){let n=ur(t),r=ot(e.baseUrl,n),i=mn(gr(t),{baseUrl:r});return r!==n&&!i.serviceLocation&&e.serviceLocation&&(i.serviceLocation=e.serviceLocation),i})})):e,yr=e=>{let t=V(e,`SegmentTemplate`)[0],n=V(e,`SegmentList`)[0],r=n&&V(n,`SegmentURL`).map(e=>mn({tag:`SegmentURL`},gr(e))),i=V(e,`SegmentBase`)[0],a=n||t,o=a&&V(a,`SegmentTimeline`)[0],s=n||i||t,c=s&&V(s,`Initialization`)[0],l=t&&gr(t);l&&c?l.initialization=c&&gr(c):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});let u={template:l,segmentTimeline:o&&V(o,`S`).map(e=>gr(e)),list:n&&mn(gr(n),{segmentUrls:r,initialization:gr(c)}),base:i&&mn(gr(i),{initialization:gr(c)})};return Object.keys(u).forEach(e=>{u[e]||delete u[e]}),u},br=(e,t,n)=>r=>{let i=V(r,`BaseURL`),a=vr(t,i),o=mn(e,gr(r)),s=yr(r);return a.map(e=>({segmentInfo:mn(n,s),attributes:mn(o,e)}))},xr=e=>e.reduce((e,t)=>{let n=gr(t);n.schemeIdUri&&=n.schemeIdUri.toLowerCase();let r=_r[n.schemeIdUri];if(r){e[r]={attributes:n};let i=V(t,`cenc:pssh`)[0];if(i){let t=ur(i);e[r].pssh=t&&lt(t)}}return e},{}),Sr=e=>{if(e.schemeIdUri===`urn:scte:dash:cc:cea-608:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split(`=`):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}});if(e.schemeIdUri===`urn:scte:dash:cc:cea-708:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[n,r=``]=e.split(`=`);t.channel=n,t.language=e,r.split(`,`).forEach(e=>{let[n,r]=e.split(`:`);n===`lang`?t.language=r:n===`er`?t.easyReader=Number(r):n===`war`?t.aspectRatio=Number(r):n===`3D`&&(t[`3D`]=Number(r))})}else t.language=e;return t.channel&&=`SERVICE`+t.channel,t})},Cr=e=>_n(V(e.node,`EventStream`).map(t=>{let n=gr(t),r=n.schemeIdUri;return V(t,`Event`).map(t=>{let i=gr(t),a=i.presentationTime||0,o=n.timescale||1,s=i.duration||0,c=a/o+e.attributes.start;return{schemeIdUri:r,value:n.value,id:i.id,start:c,end:c+s/o,messageData:ur(t)||i.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})})),wr=(e,t,n)=>r=>{let i=gr(r),a=vr(t,V(r,`BaseURL`)),o=V(r,`Role`)[0],s={role:gr(o)},c=mn(e,i,s),l=V(r,`Accessibility`)[0],u=Sr(gr(l));u&&(c=mn(c,{captionServices:u}));let d=V(r,`Label`)[0];if(d&&d.childNodes.length){let e=d.childNodes[0].nodeValue.trim();c=mn(c,{label:e})}let f=xr(V(r,`ContentProtection`));Object.keys(f).length&&(c=mn(c,{contentProtection:f}));let p=yr(r),m=V(r,`Representation`),h=mn(n,p);return _n(m.map(br(c,a,h)))},Tr=(e,t)=>(n,r)=>{let i=vr(t,V(n.node,`BaseURL`)),a=mn(e,{periodStart:n.attributes.start});typeof n.attributes.duration==`number`&&(a.periodDuration=n.attributes.duration);let o=V(n.node,`AdaptationSet`),s=yr(n.node);return _n(o.map(wr(a,i,s)))},Er=(e,t)=>{if(e.length>1&&t({type:`warn`,message:`The MPD manifest should contain no more than one ContentSteering tag`}),!e.length)return null;let n=mn({serverURL:ur(e[0])},gr(e[0]));return n.queryBeforeStart=n.queryBeforeStart===`true`,n},Dr=({attributes:e,priorPeriodAttributes:t,mpdType:n})=>typeof e.start==`number`?e.start:t&&typeof t.start==`number`&&typeof t.duration==`number`?t.start+t.duration:!t&&n===`static`?0:null,Or=(e,t={})=>{let{manifestUri:n=``,NOW:r=Date.now(),clientOffset:i=0,eventHandler:a=function(){}}=t,o=V(e,`Period`);if(!o.length)throw Error(xn.INVALID_NUMBER_OF_PERIOD);let s=V(e,`Location`),c=gr(e),l=vr([{baseUrl:n}],V(e,`BaseURL`)),u=V(e,`ContentSteering`);c.type=c.type||`static`,c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=r,c.clientOffset=i,s.length&&(c.locations=s.map(ur));let d=[];return o.forEach((e,t)=>{let n=gr(e),r=d[t-1];n.start=Dr({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:c.type}),d.push({node:e,attributes:n})}),{locations:c.locations,contentSteeringInfo:Er(u,a),representationInfo:_n(d.map(Tr(c,l))),eventStream:_n(d.map(Cr))}},kr=e=>{if(e===``)throw Error(xn.DASH_EMPTY_MANIFEST);let t=new fn.DOMParser,n,r;try{n=t.parseFromString(e,`application/xml`),r=n&&n.documentElement.tagName===`MPD`?n.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName(`parsererror`).length>0)throw Error(xn.DASH_INVALID_XML);return r},Ar=e=>{let t=V(e,`UTCTiming`)[0];if(!t)return null;let n=gr(t);switch(n.schemeIdUri){case`urn:mpeg:dash:utc:http-head:2014`:case`urn:mpeg:dash:utc:http-head:2012`:n.method=`HEAD`;break;case`urn:mpeg:dash:utc:http-xsdate:2014`:case`urn:mpeg:dash:utc:http-iso:2014`:case`urn:mpeg:dash:utc:http-xsdate:2012`:case`urn:mpeg:dash:utc:http-iso:2012`:n.method=`GET`;break;case`urn:mpeg:dash:utc:direct:2014`:case`urn:mpeg:dash:utc:direct:2012`:n.method=`DIRECT`,n.value=Date.parse(n.value);break;default:throw Error(xn.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},jr=(e,t={})=>{let n=Or(kr(e),t),r=lr(n.representationInfo);return Qn({dashPlaylists:r,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})},Mr=e=>Ar(kr(e));var Nr,Pr;function Fr(){if(Pr)return Nr;Pr=1;var e=2**32;return Nr={getUint64:function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return n.getBigUint64?(r=n.getBigUint64(0),r<2**53-1?Number(r):r):n.getUint32(0)*e+n.getUint32(4)},MAX_UINT32:e},Nr}var Ir,Lr;function Rr(){if(Lr)return Ir;Lr=1;var e=Fr().getUint64;return Ir=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8)},i=12;r.version===0?(r.earliestPresentationTime=n.getUint32(i),r.firstOffset=n.getUint32(i+4),i+=8):(r.earliestPresentationTime=e(t.subarray(i)),r.firstOffset=e(t.subarray(i+8)),i+=16),i+=2;var a=n.getUint16(i);for(i+=2;a>0;i+=12,a--)r.references.push({referenceType:(t[i]&128)>>>7,referencedSize:n.getUint32(i)&2147483647,subsegmentDuration:n.getUint32(i+4),startsWithSap:!!(t[i+8]&128),sapType:(t[i+8]&112)>>>4,sapDeltaTime:n.getUint32(i+8)&268435455});return r},Ir}var zr=Rr();const Br=g(zr);var H=z([73,68,51]),Vr=function(e,t){t===void 0&&(t=0),e=z(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(n&16)>>4?r+20:r+10},Hr=function e(t,n){return n===void 0&&(n=0),t=z(t),t.length-n<10||!B(t,H,{offset:n})?n:(n+=Vr(t,n),e(t,n))},Ur=function(e){return typeof e==`string`?Wt(e):e},Wr=function(e){return Array.isArray(e)?e.map(function(e){return Ur(e)}):[Ur(e)]},Gr=function e(t,n,r){r===void 0&&(r=!1),n=Wr(n),t=z(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,s=t.subarray(a+4,a+8);if(o===0)break;var c=a+o;if(c>t.length){if(r)break;c=t.length}var l=t.subarray(a+8,c);B(s,n[0])&&(n.length===1?i.push(l):i.push.apply(i,e(l,n.slice(1),r))),a=c}return i},Kr={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},qr=[128,64,32,16,8,4,2,1],Jr=function(e){for(var t=1,n=0;n<qr.length&&!(e&qr[n]);n++)t++;return t},Yr=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!1);var i=Jr(e[t]),a=e.subarray(t,t+i);return n&&(a=Array.prototype.slice.call(e,t,t+i),a[0]^=qr[i-1]),{length:i,value:Ht(a,{signed:r}),bytes:a}},Xr=function e(t){return typeof t==`string`?t.match(/.{1,2}/g).map(function(t){return e(t)}):typeof t==`number`?Ut(t):t},Zr=function(e){return Array.isArray(e)?e.map(function(e){return Xr(e)}):[Xr(e)]},Qr=function e(t,n,r){if(r>=n.length)return n.length;var i=Yr(n,r,!1);if(B(t.bytes,i.bytes))return r;var a=Yr(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},$r=function e(t,n){n=Zr(n),t=z(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=Yr(t,i,!1),o=Yr(t,i+a.length),s=i+a.length+o.length;o.value===127&&(o.value=Qr(a,t,s),o.value!==t.length&&(o.value-=s));var c=s+o.value>t.length?t.length:s+o.value,l=t.subarray(s,c);B(n[0],a.bytes)&&(n.length===1?r.push(l):r=r.concat(e(l,n.slice(1))));var u=a.length+o.length+l.length;i+=u}return r},ei=z([0,0,0,1]),ti=z([0,0,1]),ni=z([0,0,3]),ri=function(e){for(var t=[],n=1;n<e.length-2;)B(e.subarray(n,n+3),ni)&&(t.push(n+2),n++),n++;if(t.length===0)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},ii=function(e,t,n,r){e=z(e),n=[].concat(n);for(var i=0,a,o=0;i<e.length&&(o<r||a);){var s=void 0;if(B(e.subarray(i),ei)?s=4:B(e.subarray(i),ti)&&(s=3),!s)i++;else{if(o++,a)return ri(e.subarray(a,i));var c=void 0;t===`h264`?c=e[i+s]&31:t===`h265`&&(c=e[i+s]>>1&63),n.indexOf(c)!==-1&&(a=i+s),i+=s+(t===`h264`?1:2)}}return e.subarray(0,0)},ai=function(e,t,n){return ii(e,`h264`,t,n)},oi=function(e,t,n){return ii(e,`h265`,t,n)},si={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102]),vtt:z([87,69,66,86,84,84])},ci={aac:function(e){return B(e,[255,16],{offset:Hr(e),mask:[255,22]})},mp3:function(e){return B(e,[255,2],{offset:Hr(e),mask:[255,6]})},webm:function(e){var t=$r(e,[Kr.EBML,Kr.DocType])[0];return B(t,si.webm)},mkv:function(e){var t=$r(e,[Kr.EBML,Kr.DocType])[0];return B(t,si.matroska)},mp4:function(e){if(ci[`3gp`](e)||ci.mov(e))return!1;if(B(e,si.mp4,{offset:4})||B(e,si.fmp4,{offset:4})||B(e,si.moof,{offset:4})||B(e,si.moov,{offset:4}))return!0},mov:function(e){return B(e,si.mov,{offset:4})},"3gp":function(e){return B(e,si[`3gp`],{offset:4})},ac3:function(e){var t=Hr(e);return B(e,si.ac3,{offset:t})},vtt:function(e){return B(e,si.vtt)},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Hr(e);return B(e,si.flac,{offset:t})},ogg:function(e){return B(e,si.ogg)},avi:function(e){return B(e,si.riff)&&B(e,si.avi,{offset:8})},wav:function(e){return B(e,si.riff)&&B(e,si.wav,{offset:8})},h264:function(e){return ai(e,7,3).length},h265:function(e){return oi(e,[32,33],3).length}},li=Object.keys(ci).filter(function(e){return e!==`ts`&&e!==`h264`&&e!==`h265`}).concat([`ts`,`h264`,`h265`]);li.forEach(function(e){var t=ci[e];ci[e]=function(e){return t(z(e))}});var ui=ci,di=function(e){e=z(e);for(var t=0;t<li.length;t++){var n=li[t];if(ui[n](e))return n}return``},fi=function(e){return Gr(e,[`moof`]).length>0},pi,mi;function hi(){if(mi)return pi;mi=1;var e=9e4,t=function(t){return t*e},n=function(e,t){return e*t},r=function(t){return t/e},i=function(e,t){return e/t};return pi={ONE_SECOND_IN_TS:e,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:function(e,n){return t(i(e,n))},videoTsToAudioTs:function(e,t){return n(r(e),t)},metadataTsToSeconds:function(e,t,n){return r(n?e:e-t)}},pi}var gi=hi(),_i=`8.24.1`;const vi={},yi=function(e,t){return vi[e]=vi[e]||[],t&&(vi[e]=vi[e].concat(t)),vi[e]},bi=function(e,t){yi(e,t)},xi=function(e,t){let n=yi(e).indexOf(t);return n<=-1?!1:(vi[e]=vi[e].slice(),vi[e].splice(n,1),!0)},Si=function(e,t){yi(e,[].concat(t).map(t=>{let n=(...r)=>(xi(e,n),t(...r));return n}))},Ci={prefixed:!0},wi=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`,`fullscreen`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`,`-webkit-full-screen`]],Ti=wi[0];let Ei;for(let e=0;e<wi.length;e++)if(wi[e][1]in F){Ei=wi[e];break}if(Ei){for(let e=0;e<Ei.length;e++)Ci[Ti[e]]=Ei[e];Ci.prefixed=Ei[0]!==Ti[0]}let Di=[];const Oi=(e,t,n)=>(r,i,a)=>{let o=t.levels[i],s=RegExp(`^(${o})$`),c=e;if(r!==`log`&&a.unshift(r.toUpperCase()+`:`),n&&(c=`%c${e}`,a.unshift(n)),a.unshift(c+`:`),Di){Di.push([].concat(a));let e=Di.length-1e3;Di.splice(0,e>0?e:0)}if(!x.console)return;let l=x.console[r];!l&&r===`debug`&&(l=x.console.info||x.console.log),l&&o&&s.test(r)&&l[Array.isArray(a)?`apply`:`call`](x.console,a)};function ki(e,t=`:`,n=``){let r=`info`,i;function a(...e){i(`log`,r,e)}return i=Oi(e,a,n),a.createLogger=(r,i,a)=>{let o=i===void 0?t:i,s=a===void 0?n:a;return ki(`${e} ${o} ${r}`,o,s)},a.createNewLogger=(e,t,n)=>ki(e,t,n),a.levels={all:`debug|log|warn|error`,off:``,debug:`debug|log|warn|error`,info:`log|warn|error`,warn:`warn|error`,error:`error`,DEFAULT:r},a.level=e=>{if(typeof e==`string`){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);r=e}return r},a.history=()=>Di?[].concat(Di):[],a.history.filter=e=>(Di||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{Di&&(Di.length=0)},a.history.disable=()=>{Di!==null&&(Di.length=0,Di=null)},a.history.enable=()=>{Di===null&&(Di=[])},a.error=(...e)=>i(`error`,r,e),a.warn=(...e)=>i(`warn`,r,e),a.debug=(...e)=>i(`debug`,r,e),a}const U=ki(`VIDEOJS`),Ai=U.createLogger,ji=Object.prototype.toString,Mi=function(e){return Fi(e)?Object.keys(e):[]};function Ni(e,t){Mi(e).forEach(n=>t(e[n],n))}function Pi(e,t,n=0){return Mi(e).reduce((n,r)=>t(n,e[r],r),n)}function Fi(e){return!!e&&typeof e==`object`}function Ii(e){return Fi(e)&&ji.call(e)===`[object Object]`&&e.constructor===Object}function W(...e){let t={};return e.forEach(e=>{e&&Ni(e,(e,n)=>{Ii(e)?(Ii(t[n])||(t[n]={}),t[n]=W(t[n],e)):t[n]=e})}),t}function Li(e={}){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];t.push(r)}return t}function Ri(e,t,n,r=!0){let i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){let e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)}var zi=Object.freeze({__proto__:null,each:Ni,reduce:Pi,isObject:Fi,isPlain:Ii,merge:W,values:Li,defineLazyProperty:Ri});let Bi=!1,Vi=null,Hi=!1,Ui,Wi=!1,Gi=!1,Ki=!1,qi=!1,Ji=null,Yi=null;const Xi=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let Zi=null,Qi=!1,$i=!1,ea=!1,ta=!1,na=!1,ra=!1,ia=!1;const aa=!!(fa()&&(`ontouchstart`in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),oa=x.navigator&&x.navigator.userAgentData;if(oa&&oa.platform&&oa.brands&&(Hi=oa.platform===`Android`,Gi=!!oa.brands.find(e=>e.brand===`Microsoft Edge`),Ki=!!oa.brands.find(e=>e.brand===`Chromium`),qi=!Gi&&Ki,Ji=Yi=(oa.brands.find(e=>e.brand===`Chromium`)||{}).version||null,$i=oa.platform===`Windows`),!Ki){let e=x.navigator&&x.navigator.userAgent||``;Bi=/iPod/i.test(e),Vi=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Hi=/Android/i.test(e),Ui=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+`.`+t[2]):n||null}(),Wi=/Firefox/i.test(e),Gi=/Edg/i.test(e),Ki=/Chrome/i.test(e)||/CriOS/i.test(e),qi=!Gi&&Ki,Ji=Yi=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Zi=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),na=/Tizen/i.test(e),ra=/Web0S/i.test(e),ia=na||ra,Qi=/Safari/i.test(e)&&!qi&&!Hi&&!Gi&&!ia,$i=/Windows/i.test(e),ea=/iPad/i.test(e)||Qi&&aa&&!/iPhone/i.test(e),ta=/iPhone/i.test(e)&&!ea}const sa=ta||ea||Bi,ca=(Qi||sa)&&!qi;var la=Object.freeze({__proto__:null,get IS_IPOD(){return Bi},get IOS_VERSION(){return Vi},get IS_ANDROID(){return Hi},get ANDROID_VERSION(){return Ui},get IS_FIREFOX(){return Wi},get IS_EDGE(){return Gi},get IS_CHROMIUM(){return Ki},get IS_CHROME(){return qi},get CHROMIUM_VERSION(){return Ji},get CHROME_VERSION(){return Yi},IS_CHROMECAST_RECEIVER:Xi,get IE_VERSION(){return Zi},get IS_SAFARI(){return Qi},get IS_WINDOWS(){return $i},get IS_IPAD(){return ea},get IS_IPHONE(){return ta},get IS_TIZEN(){return na},get IS_WEBOS(){return ra},get IS_SMART_TV(){return ia},TOUCH_ENABLED:aa,IS_IOS:sa,IS_ANY_SAFARI:ca});function ua(e){return typeof e==`string`&&!!e.trim()}function da(e){if(e.indexOf(` `)>=0)throw Error(`class has illegal whitespace characters`)}function fa(){return F===x.document}function pa(e){return Fi(e)&&e.nodeType===1}function ma(){try{return x.parent!==x.self}catch{return!0}}function ha(e){return function(t,n){if(!ua(t))return F[e](null);ua(n)&&(n=F.querySelector(n));let r=pa(n)?n:F;return r[e]&&r[e](t)}}function G(e=`div`,t={},n={},r){let i=F.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let n=t[e];e===`textContent`?ga(i,n):(i[e]!==n||e===`tabIndex`)&&(i[e]=n)}),Object.getOwnPropertyNames(n).forEach(function(e){i.setAttribute(e,n[e])}),r&&Fa(i,r),i}function ga(e,t){return e.textContent===void 0?e.innerText=t:e.textContent=t,e}function _a(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function va(e,t){return da(t),e.classList.contains(t)}function ya(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function ba(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(U.warn(`removeClass was called with an element that doesn't exist`),null)}function xa(e,t,n){return typeof n==`function`&&(n=n(e,t)),typeof n!=`boolean`&&(n=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,n)),e}function Sa(e,t){Object.getOwnPropertyNames(t).forEach(function(n){let r=t[n];r==null||r===!1?e.removeAttribute(n):e.setAttribute(n,r===!0?``:r)})}function Ca(e){let t={},n=[`autoplay`,`controls`,`playsinline`,`loop`,`muted`,`default`,`defaultMuted`];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let i=r[e].name,a=r[e].value;n.includes(i)&&(a=a!==null),t[i]=a}}return t}function wa(e,t){return e.getAttribute(t)}function Ta(e,t,n){e.setAttribute(t,n)}function Ea(e,t){e.removeAttribute(t)}function Da(){F.body.focus(),F.onselectstart=function(){return!1}}function Oa(){F.onselectstart=function(){return!0}}function ka(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),n={};return[`bottom`,`height`,`left`,`right`,`top`,`width`].forEach(e=>{t[e]!==void 0&&(n[e]=t[e])}),n.height||=parseFloat(Ba(e,`height`)),n.width||=parseFloat(Ba(e,`width`)),n}}function Aa(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,n=e.offsetHeight,r=0,i=0;for(;e.offsetParent&&e!==F[Ci.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function ja(e,t){let n={x:0,y:0};if(sa){let t=e;for(;t&&t.nodeName.toLowerCase()!==`html`;){let e=Ba(t,`transform`);if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&x.WebKitCSSMatrix){let e=x.getComputedStyle(t.assignedSlot.parentElement).transform,r=new x.WebKitCSSMatrix(e);n.x+=r.m41,n.y+=r.m42}t=t.parentNode||t.host}}let r={},i=Aa(t.target),a=Aa(e),o=a.width,s=a.height,c=t.offsetY-(a.top-i.top),l=t.offsetX-(a.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-a.left,c=t.changedTouches[0].pageY+a.top,sa&&(l-=n.x,c-=n.y)),r.y=1-Math.max(0,Math.min(1,c/s)),r.x=Math.max(0,Math.min(1,l/o)),r}function Ma(e){return Fi(e)&&e.nodeType===3}function Na(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Pa(e){return typeof e==`function`&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==`function`&&(e=e()),pa(e)||Ma(e))return e;if(typeof e==`string`&&/\S/.test(e))return F.createTextNode(e)}).filter(e=>e)}function Fa(e,t){return Pa(t).forEach(t=>e.appendChild(t)),e}function Ia(e,t){return Fa(Na(e),t)}function La(e){return e.button===void 0&&e.buttons===void 0||e.button===0&&e.buttons===void 0||e.type===`mouseup`&&e.button===0&&e.buttons===0||e.type===`mousedown`&&e.button===0&&e.buttons===0||e.button===0&&e.buttons===1}const Ra=ha(`querySelector`),za=ha(`querySelectorAll`);function Ba(e,t){if(!e||!t)return``;if(typeof x.getComputedStyle==`function`){let n;try{n=x.getComputedStyle(e)}catch{return``}return n?n.getPropertyValue(t)||n[t]:``}return``}function Va(e){[...F.styleSheets].forEach(t=>{try{let n=[...t.cssRules].map(e=>e.cssText).join(``),r=F.createElement(`style`);r.textContent=n,e.document.head.appendChild(r)}catch{let n=F.createElement(`link`);n.rel=`stylesheet`,n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}})}var Ha=Object.freeze({__proto__:null,isReal:fa,isEl:pa,isInFrame:ma,createEl:G,textContent:ga,prependTo:_a,hasClass:va,addClass:ya,removeClass:ba,toggleClass:xa,setAttributes:Sa,getAttributes:Ca,getAttribute:wa,setAttribute:Ta,removeAttribute:Ea,blockTextSelection:Da,unblockTextSelection:Oa,getBoundingClientRect:ka,findPosition:Aa,getPointerPosition:ja,isTextNode:Ma,emptyEl:Na,normalizeContent:Pa,appendContent:Fa,insertContent:Ia,isSingleLeftClick:La,$:Ra,$$:za,computedStyle:Ba,copyStyleSheetsToWindow:Va});let Ua=!1,Wa;const Ga=function(){if(Wa.options.autoSetup===!1)return;let e=Array.prototype.slice.call(F.getElementsByTagName(`video`)),t=Array.prototype.slice.call(F.getElementsByTagName(`audio`)),n=Array.prototype.slice.call(F.getElementsByTagName(`video-js`)),r=e.concat(t,n);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){let t=r[e];if(t&&t.getAttribute)t.player===void 0&&t.getAttribute(`data-setup`)!==null&&Wa(t);else{Ka(1);break}}else Ua||Ka(1)};function Ka(e,t){fa()&&(t&&(Wa=t),x.setTimeout(Ga,e))}function qa(){Ua=!0,x.removeEventListener(`load`,qa)}fa()&&(F.readyState===`complete`?qa():x.addEventListener(`load`,qa));const Ja=function(e){let t=F.createElement(`style`);return t.className=e,t},Ya=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Xa=new WeakMap;let Za=3;function Qa(){return Za++}function $a(e,t){if(!Xa.has(e))return;let n=Xa.get(e);n.handlers[t].length===0&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent(`on`+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),Object.getOwnPropertyNames(n).length===0&&Xa.delete(e)}function eo(e,t,n,r){n.forEach(function(n){e(t,n,r)})}function to(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||x.event;e={};let i=[`layerX`,`layerY`,`keyLocation`,`path`,`webkitMovementX`,`webkitMovementY`,`mozPressure`,`mozInputSource`];for(let t in r)i.includes(t)||t===`returnValue`&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||F),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,e.clientX!==null&&e.clientX!==void 0){let t=F.documentElement,n=F.body;e.pageX=e.clientX+(t&&t.scrollLeft||n&&n.scrollLeft||0)-(t&&t.clientLeft||n&&n.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||n&&n.scrollTop||0)-(t&&t.clientTop||n&&n.clientTop||0)}e.which=e.charCode||e.keyCode,e.button!==null&&e.button!==void 0&&(e.button=e.button&1?0:e.button&4?1:e.button&2?2:0)}return e.fixed_=!0,e}let no;const ro=function(){if(typeof no!=`boolean`){no=!1;try{let e=Object.defineProperty({},"passive",{get(){no=!0}});x.addEventListener(`test`,null,e),x.removeEventListener(`test`,null,e)}catch{}}return no},io=[`touchstart`,`touchmove`];function ao(e,t,n){if(Array.isArray(t))return eo(ao,e,t,n);Xa.has(e)||Xa.set(e,{});let r=Xa.get(e);if(r.handlers||={},r.handlers[t]||(r.handlers[t]=[]),n.guid||=Qa(),r.handlers[t].push(n),r.dispatcher||=(r.disabled=!1,function(t,n){if(r.disabled)return;t=to(t);let i=r.handlers[t.type];if(i){let r=i.slice(0);for(let i=0,a=r.length;i<a&&!t.isImmediatePropagationStopped();i++)try{r[i].call(e,t,n)}catch(e){U.error(e)}}}),r.handlers[t].length===1){if(e.addEventListener){let n=!1;ro()&&io.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent(`on`+t,r.dispatcher)}}function oo(e,t,n){if(!Xa.has(e))return;let r=Xa.get(e);if(!r.handlers)return;if(Array.isArray(t))return eo(oo,e,t,n);let i=function(e,t){r.handlers[t]=[],$a(e,t)};if(t===void 0){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}let a=r.handlers[t];if(a){if(!n)i(e,t);else{if(n.guid)for(let e=0;e<a.length;e++)a[e].guid===n.guid&&a.splice(e--,1);$a(e,t)}}}function so(e,t,n){let r=Xa.has(e)?Xa.get(e):{},i=e.parentNode||e.ownerDocument;if(typeof t==`string`?t={type:t,target:e}:t.target||(t.target=e),t=to(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&t.bubbles===!0)so.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Xa.has(t.target)||Xa.set(t.target,{});let e=Xa.get(t.target);t.target[t.type]&&(e.disabled=!0,typeof t.target[t.type]==`function`&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function co(e,t,n){if(Array.isArray(t))return eo(co,e,t,n);let r=function(){oo(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Qa(),ao(e,t,r)}function lo(e,t,n){let r=function(){oo(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Qa(),ao(e,t,r)}var uo=Object.freeze({__proto__:null,fixEvent:to,on:ao,off:oo,trigger:so,one:co,any:lo});const K=function(e,t,n){t.guid||=Qa();let r=t.bind(e);return r.guid=n?n+`_`+t.guid:t.guid,r},fo=function(e,t){let n=x.performance.now();return function(...r){let i=x.performance.now();i-n>=t&&(e(...r),n=i)}},po=function(e,t,n,r=x){let i,a=()=>{r.clearTimeout(i),i=null},o=function(){let a=this,o=arguments,s=function(){i=null,s=null,n||e.apply(a,o)};!i&&n&&e.apply(a,o),r.clearTimeout(i),i=r.setTimeout(s,t)};return o.cancel=a,o};var mo=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:K,throttle:fo,debounce:po});let ho;class go{on(e,t){let n=this.addEventListener;this.addEventListener=()=>{},ao(this,e,t),this.addEventListener=n}off(e,t){oo(this,e,t)}one(e,t){let n=this.addEventListener;this.addEventListener=()=>{},co(this,e,t),this.addEventListener=n}any(e,t){let n=this.addEventListener;this.addEventListener=()=>{},lo(this,e,t),this.addEventListener=n}trigger(e){let t=e.type||e;typeof e==`string`&&(e={type:t}),e=to(e),this.allowedEvents_[t]&&this[`on`+t]&&this[`on`+t](e),so(this,e)}queueTrigger(e){ho||=new Map;let t=e.type||e,n=ho.get(this);n||(n=new Map,ho.set(this,n));let r=n.get(t);n.delete(t),x.clearTimeout(r);let i=x.setTimeout(()=>{n.delete(t),n.size===0&&(n=null,ho.delete(this)),this.trigger(e)},0);n.set(t,i)}}go.prototype.allowedEvents_={},go.prototype.addEventListener=go.prototype.on,go.prototype.removeEventListener=go.prototype.off,go.prototype.dispatchEvent=go.prototype.trigger;const _o=e=>typeof e.name==`function`?e.name():typeof e.name==`string`?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,vo=e=>e instanceof go||!!e.eventBusEl_&&[`on`,`one`,`off`,`trigger`].every(t=>typeof e[t]==`function`),yo=(e,t)=>{vo(e)?t():(e.eventedCallbacks||=[],e.eventedCallbacks.push(t))},bo=e=>typeof e==`string`&&/\S/.test(e)||Array.isArray(e)&&!!e.length,xo=(e,t,n)=>{if(!e||!e.nodeName&&!vo(e))throw Error(`Invalid target for ${_o(t)}#${n}; must be a DOM node or evented object.`)},So=(e,t,n)=>{if(!bo(e))throw Error(`Invalid event type for ${_o(t)}#${n}; must be a non-empty string or array.`)},Co=(e,t,n)=>{if(typeof e!=`function`)throw Error(`Invalid listener for ${_o(t)}#${n}; must be a function.`)},wo=(e,t,n)=>{let r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,i,a,o;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[a,o]=t):(i=t[0],a=t[1],o=t[2]),xo(i,e,n),So(a,e,n),Co(o,e,n),o=K(e,o),{isTargetingSelf:r,target:i,type:a,listener:o}},To=(e,t,n,r)=>{xo(e,e,t),e.nodeName?uo[t](e,n,r):e[t](n,r)},Eo={on(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`on`);if(To(n,`on`,r,i),!t){let e=()=>this.off(n,r,i);e.guid=i.guid;let t=()=>this.off(`dispose`,e);t.guid=i.guid,To(this,`on`,`dispose`,e),To(n,`on`,`dispose`,t)}},one(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`one`);if(t)To(n,`one`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,To(n,`one`,r,e)}},any(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=wo(this,e,`any`);if(t)To(n,`any`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,To(n,`any`,r,e)}},off(e,t,n){if(!e||bo(e))oo(this.eventBusEl_,e,t);else{let r=e,i=t;xo(r,this,`off`),So(i,this,`off`),Co(n,this,`off`),n=K(this,n),this.off(`dispose`,n),r.nodeName?(oo(r,i,n),oo(r,`dispose`,n)):vo(r)&&(r.off(i,n),r.off(`dispose`,n))}},trigger(e,t){xo(this.eventBusEl_,this,`trigger`);let n=e&&typeof e!=`string`?e.type:e;if(!bo(n))throw Error(`Invalid event type for ${_o(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return so(this.eventBusEl_,e,t)}};function Do(e,t={}){let{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=G(`span`,{className:`vjs-event-bus`});return Object.assign(e,Eo),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on(`dispose`,()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&Xa.has(e)&&Xa.delete(e)}),x.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const Oo={state:{},setState(e){typeof e==`function`&&(e=e());let t;return Ni(e,(e,n)=>{this.state[n]!==e&&(t||={},t[n]={from:this.state[n],to:e}),this.state[n]=e}),t&&vo(this)&&this.trigger({changes:t,type:`statechanged`}),t}};function ko(e,t){return Object.assign(e,Oo),e.state=Object.assign({},e.state,t),typeof e.handleStateChanged==`function`&&vo(e)&&e.on(`statechanged`,e.handleStateChanged),e}const Ao=function(e){return typeof e==`string`?e.replace(/./,e=>e.toLowerCase()):e},jo=function(e){return typeof e==`string`?e.replace(/./,e=>e.toUpperCase()):e},Mo=function(e,t){return jo(e)===jo(t)};var No=Object.freeze({__proto__:null,toLowerCase:Ao,toTitleCase:jo,titleCaseEquals:Mo});class q{constructor(e,t,n){if(this.player_=!e&&this.play?e=this:e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=W({},this.options_),t=this.options_=W(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||`no_player`;this.id_=`${t}_component_${Qa()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(` `).forEach(e=>this.addClass(e)),[`on`,`off`,`one`,`any`,`trigger`].forEach(e=>{this[e]=void 0}),t.evented!==!1&&(Do(this,{eventBusKey:this.el_?`el_`:null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,`languagechange`,this.handleLanguagechange)),ko(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(n),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:`dispose`,bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&=(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=W(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,n){return G(e,t,n)}localize(e,t,n=e){let r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],o=r&&r.split(`-`)[0],s=i&&i[o],c=n;return a&&a[e]?c=a[e]:s&&s[e]&&(c=s[e]),t&&(c=c.replace(/\{(\d+)\}/g,function(e,n){let r=t[n-1],i=r;return r===void 0&&(i=e),i})),c}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let n=`http://www.w3.org/2000/svg`,r=G(`span`,{className:`vjs-icon-placeholder vjs-svg-icon`},{"aria-hidden":`true`}),i=F.createElementNS(n,`svg`);i.setAttributeNS(null,`viewBox`,`0 0 512 512`);let a=F.createElementNS(n,`use`);return i.appendChild(a),a.setAttributeNS(null,`href`,`#vjs-icon-${e}`),r.appendChild(i),this.iconIsSet_?t.replaceChild(r,t.querySelector(`.vjs-icon-placeholder`)):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,i;if(typeof e==`string`){i=jo(e);let n=t.componentClass||i;t.name=i;let a=q.getComponent(n);if(!a)throw Error(`Component ${n} does not exist`);if(typeof a!=`function`)return null;r=new a(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,typeof r.id==`function`&&(this.childIndex_[r.id()]=r),i||=r.name&&jo(r.name()),i&&(this.childNameIndex_[i]=r,this.childNameIndex_[Ao(i)]=r),typeof r.el==`function`&&r.el()){let e=null;this.children_[n+1]&&(this.children_[n+1].el_?e=this.children_[n+1].el_:pa(this.children_[n+1])&&(e=this.children_[n+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if(typeof e==`string`&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[jo(e.name())]=null,this.childNameIndex_[Ao(e.name())]=null;let n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t=this.options_,n=e=>{let n=e.name,r=e.opts;if(t[n]!==void 0&&(r=t[n]),r===!1)return;r===!0&&(r={}),r.playerOptions=this.options_.playerOptions;let i=this.addChild(n,r);i&&(this[n]=i)},r,i=q.getComponent(`Tech`);r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(e){return!r.some(function(t){return typeof t==`string`?e===t:e===t.name})})).map(t=>{let n,r;return typeof t==`string`?(n=t,r=e[n]||this.options_[n]||{}):(n=t.name,r=t),{name:n,opts:r}}).filter(e=>{let t=q.getComponent(e.opts.componentClass||jo(e.name));return t&&!i.isTech(t)}).forEach(n)}}buildCSSClass(){return``}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger(`ready`)},1)}$(e,t){return Ra(e,t||this.contentEl())}$$(e,t){return za(e,t||this.contentEl())}hasClass(e){return va(this.el_,e)}addClass(...e){ya(this.el_,...e)}removeClass(...e){ba(this.el_,...e)}toggleClass(e,t){xa(this.el_,e,t)}show(){this.removeClass(`vjs-hidden`)}hide(){this.addClass(`vjs-hidden`)}lockShowing(){this.addClass(`vjs-lock-showing`)}unlockShowing(){this.removeClass(`vjs-lock-showing`)}getAttribute(e){return wa(this.el_,e)}setAttribute(e,t){Ta(this.el_,e,t)}removeAttribute(e){Ea(this.el_,e)}width(e,t){return this.dimension(`width`,e,t)}height(e,t){return this.dimension(`height`,e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(t!==void 0){(t===null||t!==t)&&(t=0),(``+t).indexOf(`%`)!==-1||(``+t).indexOf(`px`)!==-1?this.el_.style[e]=t:t===`auto`?this.el_.style[e]=``:this.el_.style[e]=t+`px`,n||this.trigger(`componentresize`);return}if(!this.el_)return 0;let r=this.el_.style[e],i=r.indexOf(`px`);return parseInt(i===-1?this.el_[`offset`+jo(e)]:r.slice(0,i),10)}currentDimension(e){let t=0;if(e!==`width`&&e!==`height`)throw Error(`currentDimension only accepts width or height value`);if(t=Ba(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){let n=`offset${jo(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension(`width`),height:this.currentDimension(`height`)}}currentWidth(){return this.currentDimension(`width`)}currentHeight(){return this.currentDimension(`height`)}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!==`Tab`&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null,n;this.on(`touchstart`,function(r){r.touches.length===1&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on(`touchmove`,function(e){if(e.touches.length>1)n=!1;else if(t){let r=e.touches[0].pageX-t.pageX,i=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+i*i)>10&&(n=!1)}});let r=function(){n=!1};this.on(`touchleave`,r),this.on(`touchcancel`,r),this.on(`touchend`,function(r){t=null,n===!0&&x.performance.now()-e<200&&(r.preventDefault(),this.trigger(`tap`))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let e=K(this.player(),this.player().reportUserActivity),t;this.on(`touchstart`,function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});let n=function(n){e(),this.clearInterval(t)};this.on(`touchmove`,e),this.on(`touchend`,n),this.on(`touchcancel`,n)}setTimeout(e,t){var n;return e=K(this,e),this.clearTimersOnDispose_(),n=x.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=K(this,e),this.clearTimersOnDispose_();let n=x.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=K(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=K(this,t);let n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one(`dispose`,()=>{[[`namedRafs_`,`cancelNamedAnimationFrame`],[`rafIds_`,`cancelAnimationFrame`],[`setTimeoutIds_`,`clearTimeout`],[`setIntervalIds_`,`clearInterval`]].forEach(([e,t])=>{this[e].forEach((e,n)=>this[t](n))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){let t=x.getComputedStyle(e,null),n=t.getPropertyValue(`visibility`);return t.getPropertyValue(`display`)!==`none`&&![`hidden`,`collapse`].includes(n)}function n(e){return!(!t(e.parentElement)||!t(e)||e.style.opacity===`0`||x.getComputedStyle(e).height===`0px`||x.getComputedStyle(e).width===`0px`)}function r(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(F.documentElement.clientWidth||x.innerWidth)||t.y<0||t.y>(F.documentElement.clientHeight||x.innerHeight))return!1;let n=F.elementFromPoint(t.x,t.y);for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else return!1}}return e||=this.el(),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!=`string`||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let n=q.getComponent(`Tech`),r=n&&n.isTech(t),i=q===t||q.prototype.isPrototypeOf(t.prototype);if(r||!i){let t;throw t=r?`techs must be registered using Tech.registerTech()`:`must be a Component subclass`,Error(`Illegal component, "${e}"; ${t}.`)}e=jo(e),q.components_||={};let a=q.getComponent(`Player`);if(e===`Player`&&a&&a.players){let e=a.players,t=Object.keys(e);if(e&&t.length>0){for(let n=0;n<t.length;n++)if(e[t[n]]!==null)throw Error(`Can not register Player component after player has been created.`)}}return q.components_[e]=t,q.components_[Ao(e)]=t,t}static getComponent(e){if(e&&q.components_)return q.components_[e]}}q.registerComponent(`Component`,q);function Po(e,t,n){if(typeof t!=`number`||t<0||t>n)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}function Fo(e,t,n,r){return Po(e,r,n.length-1),n[r][t]}function Io(e){let t;return t=e===void 0||e.length===0?{length:0,start(){throw Error(`This TimeRanges object is empty`)},end(){throw Error(`This TimeRanges object is empty`)}}:{length:e.length,start:Fo.bind(null,`start`,0,e),end:Fo.bind(null,`end`,1,e)},x.Symbol&&x.Symbol.iterator&&(t[x.Symbol.iterator]=()=>(e||[]).values()),t}function Lo(e,t){return Array.isArray(e)?Io(e):e===void 0||t===void 0?Io():Io([[e,t]])}const Ro=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n=`-`),i=i>0||o>0?i+`:`:``,r=((i||a>=10)&&r<10?`0`+r:r)+`:`,n=n<10?`0`+n:n,i+r+n};let zo=Ro;function Bo(e){zo=e}function Vo(){zo=Ro}function Ho(e,t=e){return zo(e,t)}var Uo=Object.freeze({__proto__:null,createTimeRanges:Lo,createTimeRange:Lo,setFormatTime:Bo,resetFormatTime:Vo,formatTime:Ho});function Wo(e,t){let n=0,r,i;if(!t)return 0;e&&e.length||(e=Lo(0,0));for(let a=0;a<e.length;a++)r=e.start(a),i=e.end(a),i>t&&(i=t),n+=i-r;return n/t}function Go(e){if(e instanceof Go)return e;typeof e==`number`?this.code=e:typeof e==`string`?this.message=e:Fi(e)&&(typeof e.code==`number`&&(this.code=e.code),Object.assign(this,e)),this.message||=Go.defaultMessages[this.code]||``}Go.prototype.code=0,Go.prototype.message=``,Go.prototype.status=null,Go.prototype.metadata=null,Go.errorTypes=[`MEDIA_ERR_CUSTOM`,`MEDIA_ERR_ABORTED`,`MEDIA_ERR_NETWORK`,`MEDIA_ERR_DECODE`,`MEDIA_ERR_SRC_NOT_SUPPORTED`,`MEDIA_ERR_ENCRYPTED`],Go.defaultMessages={1:`You aborted the media playback`,2:`A network error caused the media download to fail part-way.`,3:`The media playback was aborted due to a corruption problem or because the media used features your browser did not support.`,4:`The media could not be loaded, either because the server or network failed or because the format is not supported.`,5:`The media is encrypted and we do not have the keys to decrypt it.`},Go.MEDIA_ERR_CUSTOM=0,Go.prototype.MEDIA_ERR_CUSTOM=0,Go.MEDIA_ERR_ABORTED=1,Go.prototype.MEDIA_ERR_ABORTED=1,Go.MEDIA_ERR_NETWORK=2,Go.prototype.MEDIA_ERR_NETWORK=2,Go.MEDIA_ERR_DECODE=3,Go.prototype.MEDIA_ERR_DECODE=3,Go.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Go.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Go.MEDIA_ERR_ENCRYPTED=5,Go.prototype.MEDIA_ERR_ENCRYPTED=5;function Ko(e){return e!=null&&typeof e.then==`function`}function qo(e){Ko(e)&&e.then(null,e=>{})}const Jo=function(e){return[`kind`,`label`,`language`,`id`,`inBandMetadataTrackDispatchType`,`mode`,`src`].reduce((t,n,r)=>(e[n]&&(t[n]=e[n]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var Yo={textTracksToJson:function(e){let t=e.$$(`track`),n=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=Jo(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return n.indexOf(e)===-1}).map(Jo))},jsonToTextTracks:function(e,t){return e.forEach(function(e){let n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>n.addCue(e))}),t.textTracks()},trackToJson:Jo};const Xo=`vjs-modal-dialog`;class Zo extends q{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=G(`div`,{className:`${Xo}-content`},{role:`document`}),this.descEl_=G(`p`,{className:`${Xo}-description vjs-control-text`,id:this.el().getAttribute(`aria-describedby`)}),ga(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl(`div`,{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":`true`,"aria-label":this.label(),role:`dialog`,"aria-live":`polite`})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Xo} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||`Modal Window`)}description(){let e=this.options_.description||this.localize(`This is a modal window.`);return this.closeable()&&(e+=` `+this.localize(`This modal can be closed by pressing the Escape key or activating the close button.`)),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}let e=this.player();this.trigger(`beforemodalopen`),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on(`keydown`,this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute(`aria-hidden`,`false`),this.trigger(`modalopen`),this.hasBeenOpened_=!0}opened(e){return typeof e==`boolean`&&this[e?`open`:`close`](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger(`beforemodalclose`),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off(`keydown`,this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute(`aria-hidden`,`true`),this.trigger({type:`modalclose`,bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e==`boolean`){let t=this.closeable_=!!e,n=this.getChild(`closeButton`);if(t&&!n){let e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild(`closeButton`,{controlText:`Close Modal Dialog`}),this.contentEl_=e,this.on(n,`close`,this.close_)}!t&&n&&(this.off(n,`close`,this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger(`beforemodalfill`),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),Ia(t,e),this.trigger(`modalfill`),r?n.insertBefore(t,r):n.appendChild(t);let i=this.getChild(`closeButton`);i&&n.appendChild(i.el_),this.trigger(`aftermodalfill`)}empty(){this.trigger(`beforemodalempty`),Na(this.contentEl()),this.trigger(`modalempty`)}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){let e=F.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&=(this.previouslyActiveEl_.focus(),null)}handleKeyDown(e){if(this.trigger({type:`modalKeydown`,originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key===`Escape`&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!==`Tab`)return;let t=this.focusableEls_(),n=this.el_.querySelector(`:focus`),r;for(let e=0;e<t.length;e++)if(n===t[e]){r=e;break}F.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll(`*`);return Array.prototype.filter.call(e,e=>(e instanceof x.HTMLAnchorElement||e instanceof x.HTMLAreaElement)&&e.hasAttribute(`href`)||(e instanceof x.HTMLInputElement||e instanceof x.HTMLSelectElement||e instanceof x.HTMLTextAreaElement||e instanceof x.HTMLButtonElement)&&!e.hasAttribute(`disabled`)||e instanceof x.HTMLIFrameElement||e instanceof x.HTMLObjectElement||e instanceof x.HTMLEmbedElement||e.hasAttribute(`tabindex`)&&e.getAttribute(`tabindex`)!==-1||e.hasAttribute(`contenteditable`))}}Zo.prototype.options_={pauseOnOpen:!0,temporary:!0},q.registerComponent(`ModalDialog`,Zo);class Qo extends go{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){let t=this.tracks_.length;``+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:`addtrack`,target:this})),e.labelchange_=()=>{this.trigger({track:e,type:`labelchange`,target:this})},vo(e)&&e.addEventListener(`labelchange`,e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:`removetrack`,target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}}Qo.prototype.allowedEvents_={change:`change`,addtrack:`addtrack`,removetrack:`removetrack`,labelchange:`labelchange`};for(let e in Qo.prototype.allowedEvents_)Qo.prototype[`on`+e]=null;const $o=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)};class es extends Qo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){$o(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&$o(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,$o(this,e),this.changing_=!1,this.trigger(`change`))},e.addEventListener(`enabledchange`,e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener(`enabledchange`,e.enabledChange_),e.enabledChange_=null)}}const ts=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)};class ns extends Qo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){ts(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&ts(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,ts(this,e),this.changing_=!1,this.trigger(`change`))},e.addEventListener(`selectedchange`,e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener(`selectedchange`,e.selectedChange_),e.selectedChange_=null)}}class rs extends Qo{addTrack(e){super.addTrack(e),this.queueChange_||=()=>this.queueTrigger(`change`),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger(`selectedlanguagechange`)),e.addEventListener(`modechange`,this.queueChange_),[`metadata`,`chapters`].indexOf(e.kind)===-1&&e.addEventListener(`modechange`,this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener(`modechange`,this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener(`modechange`,this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class is{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;``+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off==`function`&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off==`function`&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class as{constructor(e){as.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;let i=function(e){``+e in this||Object.defineProperty(this,``+e,{get(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}}const os={alternative:`alternative`,captions:`captions`,main:`main`,sign:`sign`,subtitles:`subtitles`,commentary:`commentary`},ss={alternative:`alternative`,descriptions:`descriptions`,main:`main`,"main-desc":`main-desc`,translation:`translation`,commentary:`commentary`},cs={subtitles:`subtitles`,captions:`captions`,descriptions:`descriptions`,chapters:`chapters`,metadata:`metadata`},ls={disabled:`disabled`,hidden:`hidden`,showing:`showing`};class us extends go{constructor(e={}){super();let t={id:e.id||`vjs_track_`+Qa(),kind:e.kind||``,language:e.language||``},n=e.label||``;for(let e in t)Object.defineProperty(this,e,{get(){return t[e]},set(){}});Object.defineProperty(this,"label",{get(){return n},set(e){e!==n&&(n=e,this.trigger(`labelchange`))}})}}const ds=function(e){return new URL(e,F.baseURI)},fs=function(e){return new URL(e,F.baseURI).href},ps=function(e){if(typeof e==`string`){let t=e.split(`?`)[0].replace(/\/+$/,``).match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():``}return``},ms=function(e,t=x.location){return ds(e).origin!==t.origin};var hs=Object.freeze({__proto__:null,parseUrl:ds,getAbsoluteURL:fs,getFileExtension:ps,isCrossOrigin:ms});const gs=function(e,t){let n=new x.WebVTT.Parser(x,x.vttjs,x.WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:`loadeddata`,target:t})},n.parse(e),r.length>0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>U.error(e)),x.console&&x.console.groupEnd&&x.console.groupEnd()),n.flush()},_s=function(e,t){let n={uri:e},r=ms(e);r&&(n.cors=r);let i=t.tech_.crossOrigin()===`use-credentials`;i&&(n.withCredentials=i),Ge(n,K(this,function(e,n,r){if(e)return U.error(e,n);t.loaded_=!0,typeof x.WebVTT==`function`?gs(r,t):t.tech_&&t.tech_.any([`vttjsloaded`,`vttjserror`],e=>{if(e.type===`vttjserror`)U.error(`vttjs failed to load, stopping trying to process ${t.src}`);else return gs(r,t)})}))};class vs extends us{constructor(e={}){if(!e.tech)throw Error(`A tech was not provided.`);let t=W(e,{kind:cs[e.kind]||`subtitles`,language:e.language||e.srclang||``}),n=ls[t.mode]||`disabled`,r=t.default;(t.kind===`metadata`||t.kind===`chapters`)&&(n=`hidden`),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;let i=new as(this.cues_),a=new as(this.activeCues_),o=!1;this.timeupdateHandler=K(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,o&&=(this.trigger(`cuechange`),!1)),e.type!==`timeupdate`&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),this.tech_.one(`dispose`,()=>{this.stopTracking()}),n!==`disabled`&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(e){ls[e]&&n!==e&&(n=e,!this.preload_&&n!==`disabled`&&this.cues.length===0&&_s(this.src,this),this.stopTracking(),n!==`disabled`&&this.startTracking(),this.trigger(`modechange`))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;let e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){let r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(let e=0;e<t.length;e++)this.activeCues_.indexOf(t[e])===-1&&(o=!0);return this.activeCues_=t,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!==`subtitles`&&t.kind!==`captions`)&&_s(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on(`timeupdate`,this.timeupdateHandler)}stopTracking(){this.rvf_&&=(this.tech_.cancelVideoFrameCallback(this.rvf_),void 0),this.tech_.off(`timeupdate`,this.timeupdateHandler)}addCue(e){let t=e;if(!(`getCueAsHTML`in t)){t=new x.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(let n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}let n=this.tech_.textTracks();for(let e=0;e<n.length;e++)n[e]!==this&&n[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Yo.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}vs.prototype.allowedEvents_={cuechange:`cuechange`};class ys extends us{constructor(e={}){let t=W(e,{kind:ss[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,"enabled",{get(){return n},set(e){typeof e==`boolean`&&e!==n&&(n=e,this.trigger(`enabledchange`))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class bs extends us{constructor(e={}){let t=W(e,{kind:os[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,"selected",{get(){return n},set(e){typeof e==`boolean`&&e!==n&&(n=e,this.trigger(`selectedchange`))}}),t.selected&&(this.selected=t.selected)}}class xs extends go{constructor(e={}){super();let t,n=new vs(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return n}}}),t=xs.NONE,n.addEventListener(`loadeddata`,()=>{t=xs.LOADED,this.trigger({type:`load`,target:this})})}}xs.prototype.allowedEvents_={load:`load`},xs.NONE=0,xs.LOADING=1,xs.LOADED=2,xs.ERROR=3;const Ss={audio:{ListClass:es,TrackClass:ys,capitalName:`Audio`},video:{ListClass:ns,TrackClass:bs,capitalName:`Video`},text:{ListClass:rs,TrackClass:vs,capitalName:`Text`}};Object.keys(Ss).forEach(function(e){Ss[e].getterName=`${e}Tracks`,Ss[e].privateName=`${e}Tracks_`});const Cs={remoteText:{ListClass:rs,TrackClass:vs,capitalName:`RemoteText`,getterName:`remoteTextTracks`,privateName:`remoteTextTracks_`},remoteTextEl:{ListClass:is,TrackClass:xs,capitalName:`RemoteTextTrackEls`,getterName:`remoteTextTrackEls`,privateName:`remoteTextTrackEls_`}},ws=Object.assign({},Ss,Cs);Cs.names=Object.keys(Cs),Ss.names=Object.keys(Ss),ws.names=[].concat(Cs.names,Ss.names);function Ts(e,t,n,r,i={}){let a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;let o=new ws.text.TrackClass(i);return a.addTrack(o),o}class J extends q{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on(`playing`,function(){this.hasStarted_=!0}),this.on(`loadstart`,function(){this.hasStarted_=!1}),ws.names.forEach(t=>{let n=ws[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),[`Text`,`Audio`,`Video`].forEach(t=>{e[`native${t}Tracks`]===!1&&(this[`featuresNative${t}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ws.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||`Unknown Tech`)}triggerSourceset(e){this.isReady_||this.one(`ready`,()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:`sourceset`})}manualProgressOn(){this.on(`durationchange`,this.onDurationChange_),this.manualProgress=!0,this.one(`ready`,this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off(`durationchange`,this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(K(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger(`progress`),this.bufferedPercent_=e,e===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Lo(0,0)}bufferedPercent(){return Wo(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on(`play`,this.trackCurrentTime_),this.on(`pause`,this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off(`play`,this.trackCurrentTime_),this.off(`pause`,this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Ss.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(e=>{let t=this[`${e}Tracks`]()||[],n=t.length;for(;n--;){let r=t[n];e===`text`&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Go(e),this.trigger(`error`)),this.error_}played(){return this.hasStarted_?Lo(0,0):Lo()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}initTrackListeners(){Ss.names.forEach(e=>{let t=Ss[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener(`removetrack`,n),r.addEventListener(`addtrack`,n),this.on(`dispose`,()=>{r.removeEventListener(`removetrack`,n),r.removeEventListener(`addtrack`,n)})})}addWebVttScript_(){if(!x.WebVTT){if(F.body.contains(this.el())){if(!this.options_[`vtt.js`]&&Ii(it)&&Object.keys(it).length>0){this.trigger(`vttjsloaded`);return}let e=F.createElement(`script`);e.src=this.options_[`vtt.js`]||`https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js`,e.onload=()=>{this.trigger(`vttjsloaded`)},e.onerror=()=>{this.trigger(`vttjserror`)},this.on(`dispose`,()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on(`addtrack`,n),t.on(`removetrack`,r),this.addWebVttScript_();let i=()=>this.trigger(`texttrackchange`),a=()=>{i();for(let t=0;t<e.length;t++){let n=e[t];n.removeEventListener(`cuechange`,i),n.mode===`showing`&&n.addEventListener(`cuechange`,i)}};a(),e.addEventListener(`change`,a),e.addEventListener(`addtrack`,a),e.addEventListener(`removetrack`,a),this.on(`dispose`,function(){t.off(`addtrack`,n),t.off(`removetrack`,r),e.removeEventListener(`change`,a),e.removeEventListener(`addtrack`,a),e.removeEventListener(`removetrack`,a);for(let t=0;t<e.length;t++)e[t].removeEventListener(`cuechange`,i)})}addTextTrack(e,t,n){if(!e)throw Error(`TextTrack kind is required but was not provided`);return Ts(this,e,t,n)}createRemoteTextTrack(e){let t=W(e,{tech:this});return new Cs.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let n=this.createRemoteTextTrack(e);return typeof t!=`boolean`&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=Qa();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one(`playing`,()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return``}static canPlayType(e){return``}static canPlaySource(e,t){return J.canPlayType(e.type)}static isTech(e){return e.prototype instanceof J||e instanceof J||e===J}static registerTech(e,t){if(J.techs_||={},!J.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!J.canPlayType)throw Error(`Techs must have a static canPlayType method on them`);if(!J.canPlaySource)throw Error(`Techs must have a static canPlaySource method on them`);return e=jo(e),J.techs_[e]=t,J.techs_[Ao(e)]=t,e!==`Tech`&&J.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(J.techs_&&J.techs_[e])return J.techs_[e];if(e=jo(e),x&&x.videojs&&x.videojs[e])return U.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}ws.names.forEach(function(e){let t=ws[e];J.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),J.prototype.featuresVolumeControl=!0,J.prototype.featuresMuteControl=!0,J.prototype.featuresFullscreenResize=!1,J.prototype.featuresPlaybackRate=!1,J.prototype.featuresProgressEvents=!1,J.prototype.featuresSourceset=!1,J.prototype.featuresTimeupdateEvents=!1,J.prototype.featuresNativeTextTracks=!1,J.prototype.featuresVideoFrameCallback=!1,J.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||=e.sourceHandlers=[],n===void 0&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){let n=e.sourceHandlers||[],r;for(let e=0;e<n.length;e++)if(r=n[e].canPlayType(t),r)return r;return``},e.selectSourceHandler=function(t,n){let r=e.sourceHandlers||[],i;for(let e=0;e<r.length;e++)if(i=r[e].canHandleSource(t,n),i)return r[e];return null},e.canPlaySource=function(t,n){let r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):``},[`seekable`,`seeking`,`duration`].forEach(function(e){let t=this[e];typeof t==`function`&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:U.error(`No source handler found for the current source.`)),this.disposeSourceHandler(),this.off(`dispose`,this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one(`dispose`,this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&=(this.clearTracks([`audio`,`video`]),null),this.cleanupAutoTextTracks(),this.sourceHandler_&&=(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),null)}},q.registerComponent(`Tech`,J),J.registerTech(`Tech`,J),J.defaultTechOrder_=[];const Es={},Ds={},Os={};function ks(e,t){Es[e]=Es[e]||[],Es[e].push(t)}function As(e,t,n){e.setTimeout(()=>Hs(t,Es[t.type],n,e),1)}function js(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function Ms(e,t,n){return e.reduceRight(Rs(n),t[n]())}function Ns(e,t,n,r){return t[n](e.reduce(Rs(n),r))}function Ps(e,t,n,r=null){let i=`call`+jo(n),a=e.reduce(Rs(i),r),o=a===Os,s=o?null:t[n](a);return zs(e,n,s,o),s}const Fs={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Is={setCurrentTime:1,setMuted:1,setVolume:1},Ls={play:1,pause:1};function Rs(e){return(t,n)=>t===Os?Os:n[e]?n[e](t):t}function zs(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i];a[t]&&a[t](r,n)}}function Bs(e){Ds.hasOwnProperty(e.id())&&delete Ds[e.id()]}function Vs(e,t){let n=Ds[e.id()],r=null;if(n==null)return r=t(e),Ds[e.id()]=[[t,r]],r;for(let e=0;e<n.length;e++){let[i,a]=n[e];i===t&&(r=a)}return r===null&&(r=t(e),n.push([t,r])),r}function Hs(e={},t=[],n,r,i=[],a=!1){let[o,...s]=t;if(typeof o==`string`)Hs(e,Es[o],n,r,i,a);else if(o){let t=Vs(r,o);if(!t.setSource)return i.push(t),Hs(e,s,n,r,i,a);t.setSource(Object.assign({},e),function(o,c){if(o)return Hs(e,s,n,r,i,a);i.push(t),Hs(c,e.type===c.type?s:Es[c.type],n,r,i,a)})}else s.length?Hs(e,s,n,r,i,a):a?n(e,i):Hs(e,Es[`*`],n,r,i,!0)}const Us={opus:`video/ogg`,ogv:`video/ogg`,mp4:`video/mp4`,mov:`video/mp4`,m4v:`video/mp4`,mkv:`video/x-matroska`,m4a:`audio/mp4`,mp3:`audio/mpeg`,aac:`audio/aac`,caf:`audio/x-caf`,flac:`audio/flac`,oga:`audio/ogg`,wav:`audio/wav`,m3u8:`application/x-mpegURL`,mpd:`application/dash+xml`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,png:`image/png`,svg:`image/svg+xml`,webp:`image/webp`},Ws=function(e=``){let t=ps(e);return Us[t.toLowerCase()]||``},Gs=(e,t)=>{if(!t)return``;if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let n=e.cache_.sources.filter(e=>e.src===t);if(n.length)return n[0].type;let r=e.$$(`source`);for(let e=0;e<r.length;e++){let n=r[e];if(n.type&&n.src&&n.src===t)return n.type}return Ws(t)},Ks=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=Ks(e),Array.isArray(e)?t=t.concat(e):Fi(e)&&t.push(e)}),e=t}else e=typeof e==`string`&&e.trim()?[qs({src:e})]:Fi(e)&&typeof e.src==`string`&&e.src&&e.src.trim()?[qs(e)]:[];return e};function qs(e){if(!e.type){let t=Ws(e.src);t&&(e.type=t)}return e}var Js=`<svg xmlns="http://www.w3.org/2000/svg">
19
19
  <defs>
20
20
  <symbol viewBox="0 0 48 48" id="vjs-icon-play">
21
21
  <path d="M16 10v28l22-14z"></path>
@@ -157,8 +157,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
157
157
  <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
158
158
  </symbol>
159
159
  </defs>
160
- </svg>`;const Ys=na?10009:ra?461:8,Xs={codes:{play:415,pause:19,ff:417,rw:412,back:Ys},names:{415:`play`,19:`pause`,417:`ff`,412:`rw`,[Ys]:`back`},isEventKey(e,t){return t=t.toLowerCase(),!!(this.names[e.keyCode]&&this.names[e.keyCode]===t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}};class Zs extends go{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on(`keydown`,this.onKeyDown_),this.player_.on(`modalKeydown`,this.onKeyDown_),this.player_.on(`loadedmetadata`,()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on(`modalclose`,()=>{this.refocusComponent()}),this.player_.on(`focusin`,this.handlePlayerFocus_.bind(this)),this.player_.on(`focusout`,this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on(`aftermodalfill`,()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off(`keydown`,this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){let t=e.originalEvent?e.originalEvent:e;if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(Xs.isEventKey(t,`play`)||Xs.isEventKey(t,`pause`)||Xs.isEventKey(t,`ff`)||Xs.isEventKey(t,`rw`)){t.preventDefault();let e=Xs.getEventName(t);this.performMediaAction_(e)}else Xs.isEventKey(t,`Back`)&&e.target&&typeof e.target.closeable==`function`&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case`play`:this.player_.paused()&&this.player_.play();break;case`pause`:this.player_.paused()||this.player_.pause();break;case`ff`:this.userSeek_(this.player_.currentTime()+5);break;case`rw`:this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){let t=e.relatedTarget,n=null,r=this.getCurrentComponent(e.target);t&&(n=!!t.closest(`.video-js`),t.classList.contains(`vjs-text-track-settings`)&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!t)&&(r&&r.name()===`CloseButton`?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function n(e){for(let r of e)r.hasOwnProperty(`el_`)&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty(`children_`)&&r.children_.length>0&&n(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty(`el_`)){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())){t.push(e);return}e.hasOwnProperty(`children_`)&&e.children_.length>0?n(e.children_):e.hasOwnProperty(`items`)&&e.items.length>0?n(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if(e.name_===`ErrorDisplay`&&e.opened_){let n=e.el_.querySelector(`.vjs-errors-ok-button-container`);n&&n.querySelectorAll(`button`).forEach((e,n)=>{t.push({name:()=>`ModalButton`+(n+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let e=0;e<n.children.length;e++){let r=n.children[e],i=t(r);if(i)return i}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let e of this.focusableComponents)if(e.el()===t)return e}}add(e){let t=[...this.focusableComponents];e.hasOwnProperty(`el_`)&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let n=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(n.boundingClientRect,r.getPositions().boundingClientRect,e)),i=this.findBestCandidate_(n.center,r,e);i?this.focus(i):this.trigger({type:`endOfFocusableComponents`,direction:e,focusedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,i=null;for(let a of t){let t=a.getPositions().center,o=this.calculateDistance_(e,t,n);o<r&&(r=o,i=a)}return i}isInDirection_(e,t,n){switch(n){case`right`:return t.left>=e.right;case`left`:return t.right<=e.left;case`down`:return t.top>=e.bottom;case`up`:return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e==`object`&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,n){let r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),a;switch(n){case`right`:case`left`:a=r+i*100;break;case`up`:a=i*2+r*.5;break;case`down`:a=i*5+r;break;default:a=r+i}return a}searchForTrackSelect_(){let e=this;for(let t of e.updateFocusableComponents())if(t.constructor.name===`TextTrackSelect`){e.focus(t);break}}}class Qs extends q{constructor(e,t,n){let r=W({createEl:!1},t);if(super(e,r,n),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,r=t.playerOptions.techOrder;n<r.length;n++){let t=jo(r[n]),i=J.getTech(t);if(t||(i=q.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}else e.src(t.playerOptions.sources)}}q.registerComponent(`MediaLoader`,Qs);class $s extends q{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e=`div`,t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e===`button`&&U.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:`button`},n),this.tabIndex_=t.tabIndex;let r=G(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=G(`span`,{className:`vjs-control-text`},{"aria-live":`polite`}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||`Need Text`;let n=this.localize(e);this.controlText_=e,ga(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute(`title`,n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass(`vjs-disabled`),this.el_.setAttribute(`aria-disabled`,`false`),this.tabIndex_!==void 0&&this.el_.setAttribute(`tabIndex`,this.tabIndex_),this.on([`tap`,`click`],this.handleClick_),this.on(`keydown`,this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass(`vjs-disabled`),this.el_.setAttribute(`aria-disabled`,`true`),this.tabIndex_!==void 0&&this.el_.removeAttribute(`tabIndex`),this.off(`mouseover`,this.handleMouseOver_),this.off(`mouseout`,this.handleMouseOut_),this.off([`tap`,`click`],this.handleClick_),this.off(`keydown`,this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===` `||e.key===`Enter`?(e.preventDefault(),e.stopPropagation(),this.trigger(`click`)):super.handleKeyDown(e)}}q.registerComponent(`ClickableComponent`,$s);class ec extends $s{constructor(e,t){super(e,t);let{mainContent:n}=t&&t.playerOptions||{};this.isMainContent=n,this.update(),this.update_=e=>this.update(e),e.on(`posterchange`,this.update_)}dispose(){this.player().off(`posterchange`,this.update_),super.dispose()}createEl(){return G(`div`,{className:`vjs-poster`})}crossOrigin(e){if(e===void 0)return this.$(`img`)?this.$(`img`).crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e!==null&&e!==`anonymous`&&e!==`use-credentials`?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):this.$(`img`)&&(this.$(`img`).crossOrigin=e)}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$(`img`)||this.el_.appendChild(G(`picture`,{className:`vjs-poster`,tabIndex:-1},{},G(`img`,{loading:this.isMainContent?`eager`:`lazy`,fetchPriority:this.isMainContent?`high`:`auto`,crossOrigin:this.crossOrigin()},{alt:``}))),this.$(`img`).src=e):this.el_.textContent=``}handleClick(e){if(!this.player_.controls())return;let t=this.player_.getChild(`controlBar`),n=t&&t.getChild(`playToggle`);Gi?(n||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?qo(this.player_.play()):this.player_.pause()}}ec.prototype.crossorigin=ec.prototype.crossOrigin,q.registerComponent(`PosterImage`,ec);const tc=`#222`,nc=`#ccc`,rc={monospace:`monospace`,sansSerif:`sans-serif`,serif:`serif`,monospaceSansSerif:`"Andale Mono", "Lucida Console", monospace`,monospaceSerif:`"Courier New", monospace`,proportionalSansSerif:`sans-serif`,proportionalSerif:`serif`,casual:`"Comic Sans MS", Impact, fantasy`,script:`"Monotype Corsiva", cursive`,smallcaps:`"Andale Mono", "Lucida Console", monospace, sans-serif`};function ic(e,t){let n;if(e.length===4)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(e.length===7)n=e.slice(1);else throw Error(`Invalid color code provided, `+e+`; must be formatted as e.g. #f0e or #f604e2.`);return`rgba(`+parseInt(n.slice(0,2),16)+`,`+parseInt(n.slice(2,4),16)+`,`+parseInt(n.slice(4,6),16)+`,`+t+`)`}function ac(e,t,n){try{e.style[t]=n}catch{return}}function oc(e){return e?`${e}px`:``}class sc extends q{constructor(e,t,n){super(e,t,n);let r=e=>this.updateDisplay(e),i=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on(`loadstart`,e=>this.toggleDisplay(e)),e.on(`useractive`,r),e.on(`userinactive`,r),e.on(`texttrackchange`,r),e.on(`loadedmetadata`,e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(K(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on(`fullscreenchange`,i),e.on(`playerresize`,i);let t=x.screen.orientation||x,n=x.screen.orientation?`change`:`orientationchange`;t.addEventListener(n,i),e.on(`dispose`,()=>t.removeEventListener(n,i));let r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()}))}preselectTrack(){let e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,r,i,a;for(let o=0;o<t.length;o++){let s=t[o];n&&n.enabled&&n.language&&n.language===s.language&&s.kind in e?s.kind===n.kind?a=s:a||=s:n&&!n.enabled?(a=null,r=null,i=null):s.default&&(s.kind===`descriptions`&&!r?r=s:s.kind in e&&!i&&(i=s))}a?a.mode=`showing`:i?i.mode=`showing`:r&&(r.mode=`showing`)}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl(`div`,{className:`vjs-text-track-display`},{translate:`yes`,"aria-live":`off`,"aria-atomic":`true`})}clearDisplay(){typeof x.WebVTT==`function`&&x.WebVTT.processCues(x,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let n=0;n<e.length;++n){let r=e[n];r.mode===`showing`&&t.push(r)}this.updateForTrack(t);return}let n=null,r=null,i=e.length;for(;i--;){let t=e[i];t.mode===`showing`&&(t.kind===`descriptions`?n=t:r=t)}if(r?(this.getAttribute(`aria-live`)!==`off`&&this.setAttribute(`aria-live`,`off`),this.updateForTrack(r)):n&&(this.getAttribute(`aria-live`)!==`assertive`&&this.setAttribute(`aria-live`,`assertive`),this.updateForTrack(n)),!(x.CSS!==void 0&&x.CSS.supports(`inset`,`10px`))){let e=this.el_,t=e.querySelectorAll(`.vjs-text-track-cue`),n=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style=``,ac(e,`position`,`relative`),ac(e,`height`,r-n+`px`),ac(e,`top`,`unset`),ia?ac(e,`bottom`,r+`px`):ac(e,`bottom`,`0px`),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(` `);t.length===3&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:`unset`})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(x.CSS!==void 0&&x.CSS.supports(`inset-inline: 10px`)))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),i=0,a=0;Math.abs(n-r)>.1&&(n>r?i=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ac(this.el_,`insetInline`,oc(i)),ac(this.el_,`insetBlock`,oc(a))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;for(;r--;){let e=n[r];if(!e)continue;let i=e.displayState;if(t.color&&(i.firstChild.style.color=t.color),t.textOpacity&&ac(i.firstChild,`color`,ic(t.color||`#fff`,t.textOpacity)),t.backgroundColor&&(i.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ac(i.firstChild,`backgroundColor`,ic(t.backgroundColor||`#000`,t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ac(i,`backgroundColor`,ic(t.windowColor,t.windowOpacity)):i.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle===`dropshadow`?i.firstChild.style.textShadow=`2px 2px 3px ${tc}, 2px 2px 4px ${tc}, 2px 2px 5px ${tc}`:t.edgeStyle===`raised`?i.firstChild.style.textShadow=`1px 1px ${tc}, 2px 2px ${tc}, 3px 3px ${tc}`:t.edgeStyle===`depressed`?i.firstChild.style.textShadow=`1px 1px ${nc}, 0 1px ${nc}, -1px -1px ${tc}, 0 -1px ${tc}`:t.edgeStyle===`uniform`&&(i.firstChild.style.textShadow=`0 0 4px ${tc}, 0 0 4px ${tc}, 0 0 4px ${tc}, 0 0 4px ${tc}`)),t.fontPercent&&t.fontPercent!==1){let e=x.parseFloat(i.style.fontSize);i.style.fontSize=e*t.fontPercent+`px`,i.style.height=`auto`,i.style.top=`auto`}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily===`small-caps`?i.firstChild.style.fontVariant=`small-caps`:i.firstChild.style.fontFamily=rc[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!=`function`||e.every(e=>!e.activeCues))return;let t=[];for(let n=0;n<e.length;++n){let r=e[n];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}x.WebVTT.processCues(x,t,this.el_);for(let t=0;t<e.length;++t){let n=e[t];for(let e=0;e<n.activeCues.length;++e){let r=n.activeCues[e].displayState;ya(r,`vjs-text-track-cue`,`vjs-text-track-cue-`+(n.language?n.language:t)),n.language&&Ta(r,`lang`,n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}q.registerComponent(`TextTrackDisplay`,sc);class cc extends q{createEl(){let e=this.player_.isAudio(),t=this.localize(e?`Audio Player`:`Video Player`),n=G(`span`,{className:`vjs-control-text`,textContent:this.localize(`{1} is loading.`,[t])}),r=super.createEl(`div`,{className:`vjs-loading-spinner`,dir:`ltr`});return r.appendChild(n),r}handleLanguagechange(){this.$(`.vjs-control-text`).textContent=this.localize(`{1} is loading.`,[this.player_.isAudio()?`Audio Player`:`Video Player`])}}q.registerComponent(`LoadingSpinner`,cc);class lc extends $s{createEl(e,t={},n={}){e=`button`,t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:`button`},n);let r=G(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){let n=this.constructor.name;return U.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),q.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute(`disabled`)}disable(){super.disable(),this.el_.setAttribute(`disabled`,`disabled`)}handleKeyDown(e){e.key===` `||e.key===`Enter`?e.stopPropagation():super.handleKeyDown(e)}}q.registerComponent(`Button`,lc);class uc extends lc{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon(`play`),this.on(`mousedown`,e=>this.handleMouseDown(e))}buildCSSClass(){return`vjs-big-play-button`}handleClick(e){let t=this.player_.play(),n=this.player_.getChild(`controlBar`),r=n&&n.getChild(`playToggle`);if(e.type===`tap`||this.mouseused_&&`clientX`in e&&`clientY`in e){qo(t),Gi?(r||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus();return}if(!r){this.player_.tech(!0).focus();return}let i=()=>r.focus();Ko(t)?t.then(i,()=>{}):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}uc.prototype.controlText_=`Play Video`,q.registerComponent(`BigPlayButton`,uc);class dc extends lc{constructor(e,t){super(e,t),this.setIcon(`cancel`),this.controlText(t&&t.controlText||this.localize(`Close`))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:`close`,bubbles:!1})}handleKeyDown(e){e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this.trigger(`click`)):super.handleKeyDown(e)}}q.registerComponent(`CloseButton`,dc);class fc extends lc{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon(`play`),this.on(e,`play`,e=>this.handlePlay(e)),this.on(e,`pause`,e=>this.handlePause(e)),t.replay&&this.on(e,`ended`,e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?qo(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass(`vjs-ended`),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass(`vjs-ended`,`vjs-paused`),this.addClass(`vjs-playing`),this.setIcon(`pause`),this.controlText(`Pause`)}handlePause(e){this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.setIcon(`play`),this.controlText(`Play`)}handleEnded(e){this.removeClass(`vjs-playing`),this.addClass(`vjs-ended`),this.setIcon(`replay`),this.controlText(`Replay`),this.one(this.player_,`seeked`,e=>this.handleSeeked(e))}}fc.prototype.controlText_=`Play`,q.registerComponent(`PlayToggle`,fc);class pc extends q{constructor(e,t){super(e,t),this.on(e,[`timeupdate`,`ended`,`seeking`],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl(`div`,{className:`${e} vjs-time-control vjs-control`}),n=G(`span`,{className:`vjs-control-text`,textContent:`${this.localize(this.labelText_)}\u00a0`},{role:`presentation`});return t.appendChild(n),this.contentEl_=G(`span`,{className:`${e}-display`},{role:`presentation`}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!==`seeking`)&&this.updateContent(e)}updateTextNode_(e=0){e=Ho(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame(`TimeDisplay#updateTextNode_`,()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,U.warn(`TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.`)),this.textNode_=F.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}pc.prototype.labelText_=`Time`,pc.prototype.controlText_=`Time`,q.registerComponent(`TimeDisplay`,pc);class mc extends pc{buildCSSClass(){return`vjs-current-time`}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime==`function`&&e.target.pendingSeekTime()!==null?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}mc.prototype.labelText_=`Current Time`,mc.prototype.controlText_=`Current Time`,q.registerComponent(`CurrentTimeDisplay`,mc);class hc extends pc{constructor(e,t){super(e,t);let n=e=>this.updateContent(e);this.on(e,`durationchange`,n),this.on(e,`loadstart`,n),this.on(e,`loadedmetadata`,n)}buildCSSClass(){return`vjs-duration`}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}hc.prototype.labelText_=`Duration`,hc.prototype.controlText_=`Duration`,q.registerComponent(`DurationDisplay`,hc);class gc extends q{createEl(){let e=super.createEl(`div`,{className:`vjs-time-control vjs-time-divider`},{"aria-hidden":!0}),t=super.createEl(`div`),n=super.createEl(`span`,{textContent:`/`});return t.appendChild(n),e.appendChild(t),e}}q.registerComponent(`TimeDivider`,gc);class _c extends pc{constructor(e,t){super(e,t),this.on(e,`durationchange`,e=>this.updateContent(e))}buildCSSClass(){return`vjs-remaining-time`}createEl(){let e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(G(`span`,{},{"aria-hidden":!0},`-`),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!=`number`)return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}_c.prototype.labelText_=`Remaining Time`,_c.prototype.controlText_=`Remaining Time`,q.registerComponent(`RemainingTimeDisplay`,_c);class vc extends q{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),`durationchange`,e=>this.updateShowing(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-live-control vjs-control`});return this.contentEl_=G(`div`,{className:`vjs-live-display`},{"aria-live":`off`}),this.contentEl_.appendChild(G(`span`,{className:`vjs-control-text`,textContent:`${this.localize(`Stream Type`)}\u00a0`})),this.contentEl_.appendChild(F.createTextNode(this.localize(`LIVE`))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}q.registerComponent(`LiveDisplay`,vc);class yc extends lc{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,`liveedgechange`,this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl(`button`,{className:`vjs-seek-to-live-control vjs-control`});return this.setIcon(`circle`,e),this.textEl_=G(`span`,{className:`vjs-seek-to-live-text`,textContent:this.localize(`LIVE`)},{"aria-hidden":`true`}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute(`aria-disabled`,!0),this.addClass(`vjs-at-live-edge`),this.controlText(`Seek to live, currently playing live`)):(this.setAttribute(`aria-disabled`,!1),this.removeClass(`vjs-at-live-edge`),this.controlText(`Seek to live, currently behind live`))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,`liveedgechange`,this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}yc.prototype.controlText_=`Seek to live, currently playing live`,q.registerComponent(`SeekToLive`,yc);function bc(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}var xc=Object.freeze({__proto__:null,clamp:bc});class Sc extends q{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on(`mousedown`,this.handleMouseDown_),this.on(`touchstart`,this.handleMouseDown_),this.on(`keydown`,this.handleKeyDown_),this.on(`click`,this.handleClick_),this.on(this.player_,`controlsvisible`,this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass(`disabled`),this.setAttribute(`tabindex`,0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off(`mousedown`,this.handleMouseDown_),this.off(`touchstart`,this.handleMouseDown_),this.off(`keydown`,this.handleKeyDown_),this.off(`click`,this.handleClick_),this.off(this.player_,`controlsvisible`,this.update_),this.off(e,`mousemove`,this.handleMouseMove_),this.off(e,`mouseup`,this.handleMouseUp_),this.off(e,`touchmove`,this.handleMouseMove_),this.off(e,`touchend`,this.handleMouseUp_),this.removeAttribute(`tabindex`),this.addClass(`disabled`),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className+=` vjs-slider`,t=Object.assign({tabIndex:0},t),n=Object.assign({role:`slider`,"aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;e.type===`mousedown`&&e.preventDefault(),e.type===`touchstart`&&!qi&&e.preventDefault(),Da(),this.addClass(`vjs-sliding`),this.trigger(`slideractive`),this.on(t,`mousemove`,this.handleMouseMove_),this.on(t,`mouseup`,this.handleMouseUp_),this.on(t,`touchmove`,this.handleMouseMove_),this.on(t,`touchend`,this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;Oa(),this.removeClass(`vjs-sliding`),this.trigger(`sliderinactive`),this.off(t,`mousemove`,this.handleMouseMove_),this.off(t,`mouseup`,this.handleMouseUp_),this.off(t,`touchmove`,this.handleMouseMove_),this.off(t,`touchend`,this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame(`Slider#update`,()=>{let t=this.vertical()?`height`:`width`;this.bar.el().style[t]=(e*100).toFixed(2)+`%`})),e}getProgress(){return Number(bc(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=ja(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?r&&e.key===`ArrowLeft`||!r&&e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key===`ArrowRight`||!r&&e.key===`ArrowUp`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key===`ArrowUp`||e.key===`ArrowRight`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass(`vjs-slider-vertical`):this.addClass(`vjs-slider-horizontal`)}}q.registerComponent(`Slider`,Sc);const Cc=(e,t)=>bc(e/t*100,0,100).toFixed(2)+`%`;class wc extends q{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,`progress`,e=>this.update(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-load-progress`}),t=G(`span`,{className:`vjs-control-text`}),n=G(`span`,{textContent:this.localize(`Loaded`)}),r=F.createTextNode(`: `);return this.percentageEl_=G(`span`,{className:`vjs-control-text-loaded-percentage`,textContent:`0%`}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame(`LoadProgressBar#update`,()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,a=Cc(r,n);this.percent_!==a&&(this.el_.style.width=a,ga(this.percentageEl_,a),this.percent_=a);for(let e=0;e<t.length;e++){let n=t.start(e),a=t.end(e),o=i[e];o||(o=this.el_.appendChild(G()),i[e]=o),(o.dataset.start!==n||o.dataset.end!==a)&&(o.dataset.start=n,o.dataset.end=a,o.style.left=Cc(n,r),o.style.width=Cc(a-n,r))}for(let e=i.length;e>t.length;e--)this.el_.removeChild(i[e-1]);i.length=t.length})}}q.registerComponent(`LoadProgressBar`,wc);class Tc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-time-tooltip`},{"aria-hidden":`true`})}update(e,t,n){let r=Aa(this.el_),i=ka(this.player_.el()),a=e.width*t;if(!i||!r)return;let o=e.left-i.left+a,s=e.width-a+(i.right-e.right);s||(s=e.width-a,o=a);let c=r.width/2;o<c?c+=c-o:s<c&&(c=s),c<0?c=0:c>r.width&&(c=r.width),c=Math.round(c),this.el_.style.right=`-${c}px`,this.write(n)}write(e){ga(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame(`TimeTooltip#updateTime`,()=>{let i,a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?``:`-`)+Ho(n,e)}else i=Ho(n,a);this.update(e,t,i),r&&r()})}}q.registerComponent(`TimeTooltip`,Tc);class Ec extends q{constructor(e,t){super(e,t),this.setIcon(`circle`),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-play-progress vjs-slider-bar`},{"aria-hidden":`true`})}update(e,t,n){let r=this.getChild(`timeTooltip`);if(!r)return;let i=n&&n.target&&typeof n.target.pendingSeekTime==`function`?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,i)}}Ec.prototype.options_={children:[]},!sa&&!Hi&&Ec.prototype.options_.children.push(`timeTooltip`),q.registerComponent(`PlayProgressBar`,Ec);class Dc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t){let n=t*this.player_.duration();this.getChild(`timeTooltip`).updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}}Dc.prototype.options_={children:[`timeTooltip`]},q.registerComponent(`MouseTimeDisplay`,Dc);class Oc extends Sc{constructor(e,t){t=W(Oc.prototype.options_,t),t.children=[...t.children];let n=e.options_.disableSeekWhileScrubbingOnMobile&&(sa||Hi)||e.options_.disableSeekWhileScrubbingOnSTV;(!sa&&!Hi||n)&&t.children.splice(1,0,`mouseTimeDisplay`),super(e,t),this.shouldDisableSeekWhileScrubbing_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=K(this,this.update),this.update=fo(this.update_,30),this.on(this.player_,[`durationchange`,`timeupdate`],this.update),this.on(this.player_,[`ended`],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,`liveedgechange`,this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,[`playing`],this.enableIntervalHandler_),this.on(this.player_,[`ended`,`pause`,`waiting`],this.disableIntervalHandler_),`hidden`in F&&`visibilityState`in F&&this.on(F,`visibilitychange`,this.toggleVisibility_)}toggleVisibility_(e){F.visibilityState===`hidden`?(this.cancelNamedAnimationFrame(`SeekBar#update`),this.cancelNamedAnimationFrame(`Slider#update`),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||=this.setInterval(this.update,30)}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!==`ended`||(this.updateInterval&&=(this.clearInterval(this.updateInterval),null))}createEl(){return super.createEl(`div`,{className:`vjs-progress-holder`},{"aria-label":this.localize(`Progress Bar`)})}update(e){if(F.visibilityState===`hidden`)return;let t=super.update();return this.requestNamedAnimationFrame(`SeekBar#update`,()=>{let n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker,i=this.player_.duration();r&&r.isLive()&&(i=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute(`aria-valuenow`,(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==n||this.duration_!==i)&&(this.el_.setAttribute(`aria-valuetext`,this.localize(`progress bar timing: currentTime={1} duration={2}`,[Ho(n,i),Ho(i,i)],`{1} of {2}`)),this.currentTime_=n,this.duration_=i),this.bar&&this.bar.update(ka(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0){if(e!==null){let t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null}return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();let e=this.getCurrentTime_(),t,n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){La(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!La(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n,r=this.calculateDistance(e),i=this.player_.liveTracker;if(!i||!i.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);else{if(r>=.99){i.seekToLiveEdge();return}let e=i.seekableStart(),t=i.liveCurrentTime();if(n=e+r*i.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild(`mouseTimeDisplay`);e&&e.show()}disable(){super.disable();let e=this.getChild(`mouseTimeDisplay`);e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0}),this.videoWasPlaying?qo(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=this.pendingSeekTime()===null?this.player_.currentTime():this.pendingSeekTime();this.pendingSeekTime(t+e),this.player_.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(e.key===` `||e.key===`Enter`)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key===`Home`)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key===`End`)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let n=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key===`PageDown`?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key===`PageUp`?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,[`durationchange`,`timeupdate`],this.update),this.off(this.player_,[`ended`],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,`liveedgechange`,this.update),this.off(this.player_,[`playing`],this.enableIntervalHandler_),this.off(this.player_,[`ended`,`pause`,`waiting`],this.disableIntervalHandler_),`hidden`in F&&`visibilityState`in F&&this.off(F,`visibilitychange`,this.toggleVisibility_),super.dispose()}}Oc.prototype.options_={children:[`loadProgressBar`,`playProgressBar`],barName:`playProgressBar`,stepSeconds:5,pageMultiplier:12},q.registerComponent(`SeekBar`,Oc);class kc extends q{constructor(e,t){super(e,t),this.handleMouseMove=fo(K(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=fo(K(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl(`div`,{className:`vjs-progress-control vjs-control`})}handleMouseMove(e){let t=this.getChild(`seekBar`);if(!t)return;let n=t.getChild(`playProgressBar`),r=t.getChild(`mouseTimeDisplay`);if(!n&&!r)return;let i=t.el(),a=Aa(i),o=ja(i,e).x;o=bc(o,0,1),r&&r.update(a,o),n&&n.update(a,t.getProgress())}handleMouseSeek(e){let t=this.getChild(`seekBar`);t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off([`mousedown`,`touchstart`],this.handleMouseDownHandler_),this.off(this.el_,[`mousemove`,`touchmove`],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass(`disabled`),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild(`seekBar`);this.player_.scrubbing(!1),e.videoWasPlaying&&qo(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on([`mousedown`,`touchstart`],this.handleMouseDownHandler_),this.on(this.el_,[`mousemove`,`touchmove`],this.handleMouseMove),this.removeClass(`disabled`),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,`mousemove`,this.throttledHandleMouseSeek),this.off(e,`touchmove`,this.throttledHandleMouseSeek),this.off(e,`mouseup`,this.handleMouseUpHandler_),this.off(e,`touchend`,this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,n=this.getChild(`seekBar`);n&&n.handleMouseDown(e),this.on(t,`mousemove`,this.throttledHandleMouseSeek),this.on(t,`touchmove`,this.throttledHandleMouseSeek),this.on(t,`mouseup`,this.handleMouseUpHandler_),this.on(t,`touchend`,this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild(`seekBar`);t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}kc.prototype.options_={children:[`seekBar`]},q.registerComponent(`ProgressControl`,kc);class Ac extends lc{constructor(e,t){super(e,t),this.setIcon(`picture-in-picture-enter`),this.on(e,[`enterpictureinpicture`,`leavepictureinpicture`],e=>this.handlePictureInPictureChange(e)),this.on(e,[`disablepictureinpicturechanged`,`loadedmetadata`],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,[`loadedmetadata`,`audioonlymodechange`,`audiopostermodechange`],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)===`audio`||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){F.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&`documentPictureInPicture`in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon(`picture-in-picture-exit`),this.controlText(`Exit Picture-in-Picture`)):(this.setIcon(`picture-in-picture-enter`),this.controlText(`Picture-in-Picture`)),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof F.exitPictureInPicture==`function`&&super.show()}}Ac.prototype.controlText_=`Picture-in-Picture`,q.registerComponent(`PictureInPictureToggle`,Ac);class jc extends lc{constructor(e,t){super(e,t),this.setIcon(`fullscreen-enter`),this.on(e,`fullscreenchange`,e=>this.handleFullscreenChange(e)),F[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText(`Exit Fullscreen`),this.setIcon(`fullscreen-exit`)):(this.controlText(`Fullscreen`),this.setIcon(`fullscreen-enter`))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}jc.prototype.controlText_=`Fullscreen`,q.registerComponent(`FullscreenToggle`,jc);const Mc=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresVolumeControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})};class Nc extends q{createEl(){let e=super.createEl(`div`,{className:`vjs-volume-level`});return this.setIcon(`circle`,e),e.appendChild(super.createEl(`span`,{className:`vjs-control-text`})),e}}q.registerComponent(`VolumeLevel`,Nc);class Pc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-volume-tooltip`},{"aria-hidden":`true`})}update(e,t,n,r){if(!n){let n=ka(this.el_),r=ka(this.player_.el()),i=e.width*t;if(!r||!n)return;let a=e.left-r.left+i,o=e.width-i+(r.right-e.right),s=n.width/2;a<s?s+=s-a:o<s&&(s=o),s<0?s=0:s>n.width&&(s=n.width),this.el_.style.right=`-${s}px`}this.write(`${r}%`)}write(e){ga(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame(`VolumeLevelTooltip#updateVolume`,()=>{this.update(e,t,n,r.toFixed(0)),i&&i()})}}q.registerComponent(`VolumeLevelTooltip`,Pc);class Fc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t,n){let r=100*t;this.getChild(`volumeLevelTooltip`).updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Fc.prototype.options_={children:[`volumeLevelTooltip`]},q.registerComponent(`MouseVolumeLevelDisplay`,Fc);class Ic extends Sc{constructor(e,t){super(e,t),this.on(`slideractive`,e=>this.updateLastVolume_(e)),this.on(e,`volumechange`,e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl(`div`,{className:`vjs-volume-bar vjs-slider-bar`},{"aria-label":this.localize(`Volume Level`),"aria-live":`polite`})}handleMouseDown(e){La(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild(`mouseVolumeLevelDisplay`);if(t){let n=this.el(),r=ka(n),i=this.vertical(),a=ja(n,e);a=i?a.y:a.x,a=bc(a,0,1),t.update(r,a,i)}La(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute(`aria-valuenow`,t),this.el_.setAttribute(`aria-valuetext`,t+`%`)}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){let e=this.player_.volume();this.one(`sliderinactive`,()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Ic.prototype.options_={children:[`volumeLevel`],barName:`volumeLevel`},!sa&&!Hi&&Ic.prototype.options_.children.splice(0,0,`mouseVolumeLevelDisplay`),Ic.prototype.playerEvent=`volumechange`,q.registerComponent(`VolumeBar`,Ic);class Lc extends q{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||Ii(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Mc(this,e),this.throttledHandleMouseMove=fo(K(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on(`mousedown`,e=>this.handleMouseDown(e)),this.on(`touchstart`,e=>this.handleMouseDown(e)),this.on(`mousemove`,e=>this.handleMouseMove(e)),this.on(this.volumeBar,[`focus`,`slideractive`],()=>{this.volumeBar.addClass(`vjs-slider-active`),this.addClass(`vjs-slider-active`),this.trigger(`slideractive`)}),this.on(this.volumeBar,[`blur`,`sliderinactive`],()=>{this.volumeBar.removeClass(`vjs-slider-active`),this.removeClass(`vjs-slider-active`),this.trigger(`sliderinactive`)})}createEl(){let e=`vjs-volume-horizontal`;return this.options_.vertical&&(e=`vjs-volume-vertical`),super.createEl(`div`,{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,`mousemove`,this.throttledHandleMouseMove),this.on(t,`touchmove`,this.throttledHandleMouseMove),this.on(t,`mouseup`,this.handleMouseUpHandler_),this.on(t,`touchend`,this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,`mousemove`,this.throttledHandleMouseMove),this.off(t,`touchmove`,this.throttledHandleMouseMove),this.off(t,`mouseup`,this.handleMouseUpHandler_),this.off(t,`touchend`,this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Lc.prototype.options_={children:[`volumeBar`]},q.registerComponent(`VolumeControl`,Lc);const Rc=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresMuteControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})};class zc extends lc{constructor(e,t){super(e,t),Rc(this,e),this.on(e,[`loadstart`,`volumechange`],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),n=this.player_.lastVolume_();if(t===0){let e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon(`volume-high`),sa&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon(`volume-mute`),t=0):e<.33?(this.setIcon(`volume-low`),t=1):e<.67&&(this.setIcon(`volume-medium`),t=2),ba(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?` `:``}vjs-vol-${t}`,``)),ya(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||this.player_.volume()===0?`Unmute`:`Mute`;this.controlText()!==e&&this.controlText(e)}}zc.prototype.controlText_=`Mute`,q.registerComponent(`MuteToggle`,zc);class Bc extends q{constructor(e,t={}){t.inline=t.inline===void 0||t.inline,(t.volumeControl===void 0||Ii(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,[`loadstart`],e=>this.volumePanelState_(e)),this.on(this.muteToggle,`keyup`,e=>this.handleKeyPress(e)),this.on(this.volumeControl,`keyup`,e=>this.handleVolumeControlKeyUp(e)),this.on(`keydown`,e=>this.handleKeyPress(e)),this.on(`mouseover`,e=>this.handleMouseOver(e)),this.on(`mouseout`,e=>this.handleMouseOut(e)),this.on(this.volumeControl,[`slideractive`],this.sliderActive_),this.on(this.volumeControl,[`sliderinactive`],this.sliderInactive_)}sliderActive_(){this.addClass(`vjs-slider-active`)}sliderInactive_(){this.removeClass(`vjs-slider-active`)}volumePanelState_(){this.volumeControl.hasClass(`vjs-hidden`)&&this.muteToggle.hasClass(`vjs-hidden`)&&this.addClass(`vjs-hidden`),this.volumeControl.hasClass(`vjs-hidden`)&&!this.muteToggle.hasClass(`vjs-hidden`)&&this.addClass(`vjs-mute-toggle-only`)}createEl(){let e=`vjs-volume-panel-horizontal`;return this.options_.inline||(e=`vjs-volume-panel-vertical`),super.createEl(`div`,{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key===`Escape`&&this.muteToggle.focus()}handleMouseOver(e){this.addClass(`vjs-hover`),ao(F,`keyup`,this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass(`vjs-hover`),oo(F,`keyup`,this.handleKeyPressHandler_)}handleKeyPress(e){e.key===`Escape`&&this.handleMouseOut()}}Bc.prototype.options_={children:[`muteToggle`,`volumeControl`]},q.registerComponent(`VolumePanel`,Bc);class Vc extends lc{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize(`Skip forward {1} seconds`,[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration(),i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip forward {1} seconds`,[this.skipTime]))}}Vc.prototype.controlText_=`Skip Forward`,q.registerComponent(`SkipForward`,Vc);class Hc extends lc{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize(`Skip backward {1} seconds`,[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart(),i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip backward {1} seconds`,[this.skipTime]))}}Hc.prototype.controlText_=`Skip Backward`,q.registerComponent(`SkipBackward`,Hc);class Uc extends q{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on(`keydown`,e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof q&&(this.on(e,`blur`,this.boundHandleBlur_),this.on(e,[`tap`,`click`],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof q&&(this.off(e,`blur`,this.boundHandleBlur_),this.off(e,[`tap`,`click`],this.boundHandleTapClick_))}removeChild(e){typeof e==`string`&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||`ul`;this.contentEl_=G(e,{className:`vjs-menu-content`}),this.contentEl_.setAttribute(`role`,`menu`);let t=super.createEl(`div`,{append:this.contentEl_,className:`vjs-menu`});return t.appendChild(this.contentEl_),ao(t,`click`,function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||F.activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let n=t.filter(t=>t.el()===e.target)[0];if(!n)return;n.name()!==`CaptionSettingsMenuItem`&&this.menuButton_.focus()}}handleKeyDown(e){e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key===`ArrowRight`||e.key===`ArrowUp`)&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){let t=this.children().slice();t.length&&t[0].hasClass(`vjs-menu-title`)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}q.registerComponent(`Menu`,Uc);class Wc extends q{constructor(e,t={}){super(e,t),this.menuButton_=new lc(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute(`aria-haspopup`,`true`);let n=lc.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+` `+n,this.menuButton_.removeClass(`vjs-control`),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,`tap`,r),this.on(this.menuButton_,`click`,r),this.on(this.menuButton_,`keydown`,e=>this.handleKeyDown(e)),this.on(this.menuButton_,`mouseenter`,()=>{this.addClass(`vjs-hover`),this.menu.show(),ao(F,`keyup`,this.handleMenuKeyUp_)}),this.on(`mouseleave`,e=>this.handleMouseLeave(e)),this.on(`keydown`,e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute(`aria-expanded`,`false`),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute(`role`)):(this.show(),this.menu.contentEl_.setAttribute(`role`,`menu`))}createMenu(){let e=new Uc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=G(`li`,{className:`vjs-menu-title`,textContent:jo(this.options_.title),tabIndex:-1}),n=new q(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl(`div`,{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e=`vjs-menu-button`;this.options_.inline===!0?e+=`-inline`:e+=`-popup`;let t=lc.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e=`vjs-menu-button`;return this.options_.inline===!0?e+=`-inline`:e+=`-popup`,`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass(`vjs-hover`),oo(F,`keyup`,this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key===`Escape`||e.key===`Tab`?(this.buttonPressed_&&this.unpressButton(),!e.key===`Tab`&&(e.preventDefault(),this.menuButton_.focus())):(e.key===`Up`||e.key===`Down`&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key===`Escape`||e.key===`Tab`)&&this.removeClass(`vjs-hover`)}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key===`Escape`||e.key===`Tab`)&&(this.buttonPressed_&&this.unpressButton(),!e.key===`Tab`&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute(`aria-expanded`,`true`),sa&&ma())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute(`aria-expanded`,`false`))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass(`vjs-disabled`),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass(`vjs-disabled`),this.menuButton_.enable()}}q.registerComponent(`MenuButton`,Wc);class Gc extends Wc{constructor(e,t){let n=t.tracks;super(e,t),this.items.length<=1&&this.hide(),n&&(this.updateHandler_=K(this,this.update),this.cleanupHandler_=K(this,this.cleanupTrackListeners_),n.addEventListener(`removetrack`,this.updateHandler_),n.addEventListener(`addtrack`,this.updateHandler_),n.addEventListener(`labelchange`,this.updateHandler_),this.player_.on(`ready`,this.updateHandler_),this.player_.on(`dispose`,this.cleanupHandler_))}cleanupTrackListeners_(){if(!this.updateHandler_)return;let e=this.options_.tracks;e&&(e.removeEventListener(`removetrack`,this.updateHandler_),e.removeEventListener(`addtrack`,this.updateHandler_),e.removeEventListener(`labelchange`,this.updateHandler_)),this.player_&&(this.player_.off(`ready`,this.updateHandler_),this.player_.off(`dispose`,this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}dispose(){this.cleanupTrackListeners_(),super.dispose()}}q.registerComponent(`TrackButton`,Gc);class Kc extends $s{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute(`role`,`menuitemcheckbox`):this.el_.setAttribute(`role`,`menuitemradio`):this.el_.setAttribute(`role`,`menuitem`)}createEl(e,t,n){this.nonIconControl=!0;let r=super.createEl(`li`,Object.assign({className:`vjs-menu-item`,tabIndex:-1},t),n),i=G(`span`,{className:`vjs-menu-item-text`,textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(i):r.replaceChild(i,r.querySelector(`.vjs-icon-placeholder`)),r}handleKeyDown(e){[`Tab`,`Escape`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`ArrowDown`].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass(`vjs-selected`),this.el_.setAttribute(`aria-checked`,`true`),this.controlText(`, selected`),this.isSelected_=!0):(this.removeClass(`vjs-selected`),this.el_.setAttribute(`aria-checked`,`false`),this.controlText(``),this.isSelected_=!1))}}q.registerComponent(`MenuItem`,Kc);class qc extends Kc{constructor(e,t){let n=t.track,r=e.textTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.mode===`showing`,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let i=(...e)=>{this.handleTracksChange.apply(this,e)},a=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on([`loadstart`,`texttrackchange`],i),r.addEventListener(`change`,i),r.addEventListener(`selectedlanguagechange`,a),this.on(`dispose`,function(){e.off([`loadstart`,`texttrackchange`],i),r.removeEventListener(`change`,i),r.removeEventListener(`selectedlanguagechange`,a)}),r.onchange===void 0){let e;this.on([`tap`,`click`],function(){if(typeof x.Event!=`object`)try{e=new x.Event(`change`)}catch{}e||(e=F.createEvent(`Event`),e.initEvent(`change`,!0,!0)),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let e=0;e<n.length;e++){let r=n[e];this.kinds.indexOf(r.kind)!==-1&&(r===t?r.mode!==`showing`&&(r.mode=`showing`):r.mode!==`disabled`&&(r.mode=`disabled`))}}handleTracksChange(e){let t=this.track.mode===`showing`;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode===`showing`){let e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}q.registerComponent(`TextTrackMenuItem`,qc);class Jc extends qc{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:`disabled`},t.kinds||=[t.kind],t.label?t.track.label=t.label:t.track.label=t.kinds.join(` and `)+` off`,t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if([`captions`,`descriptions`,`subtitles`].indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(`.vjs-menu-item-text`).textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}q.registerComponent(`OffTextTrackMenuItem`,Jc);class Yc extends Gc{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=qc){let n;this.label_&&(n=`${this.label_} off`),e.push(new Jc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){let i=r[n];if(this.kinds_.indexOf(i.kind)>-1){let n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}}q.registerComponent(`TextTrackButton`,Yc);class Xc extends Kc{constructor(e,t){let n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}q.registerComponent(`ChaptersTrackMenuItem`,Xc);class Zc extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`chapters`),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!==`chapters`)return;let t=this.findChaptersTrack();t===this.track_?(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update():(this.setTrack(t),super.update())}setTrack(e){if(this.track_!==e){if(this.updateHandler_||=this.update.bind(this),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener(`load`,this.updateHandler_),this.track_.removeEventListener(`cuechange`,this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode=`hidden`;let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener(`load`,this.updateHandler_),this.track_.addEventListener(`cuechange`,this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(jo(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){let r=t[n],i=new Xc(this.player_,{track:this.track_,cue:r});e.push(i)}return e}}Zc.prototype.kind_=`chapters`,Zc.prototype.controlText_=`Chapters`,q.registerComponent(`ChaptersButton`,Zc);class Qc extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`audio-description`);let r=e.textTracks(),i=K(this,this.handleTracksChange);r.addEventListener(`change`,i),this.on(`dispose`,function(){r.removeEventListener(`change`,i)})}handleTracksChange(e){let t=this.player().textTracks(),n=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&r.mode===`showing`){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Qc.prototype.kind_=`descriptions`,Qc.prototype.controlText_=`Descriptions`,q.registerComponent(`DescriptionsButton`,Qc);class $c extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`subtitles`)}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}$c.prototype.kind_=`subtitles`,$c.prototype.controlText_=`Subtitles`,q.registerComponent(`SubtitlesButton`,$c);class el extends qc{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+` settings`,selectable:!1,default:!1,mode:`disabled`},t.selectable=!1,t.name=`CaptionSettingsMenuItem`,super(e,t),this.addClass(`vjs-texttrack-settings`),this.controlText(`, opens `+t.kind+` settings dialog`)}handleClick(e){this.player().getChild(`textTrackSettings`).open()}handleLanguagechange(){this.$(`.vjs-menu-item-text`).textContent=this.player_.localize(this.options_.kind+` settings`),super.handleLanguagechange()}}q.registerComponent(`CaptionSettingsMenuItem`,el);class tl extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`captions`)}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild(`textTrackSettings`)&&(e.push(new el(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}tl.prototype.kind_=`captions`,tl.prototype.controlText_=`Captions`,q.registerComponent(`CaptionsButton`,tl);class nl extends qc{createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return this.options_.track.kind===`captions`&&(this.player_.options_.experimentalSvgIcons?this.setIcon(`captions`,r):i.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(G(`span`,{className:`vjs-control-text`,textContent:` ${this.localize(`Captions`)}`}))),r}}q.registerComponent(`SubsCapsMenuItem`,nl);class rl extends Yc{constructor(e,t={}){super(e,t),this.label_=`subtitles`,this.setIcon(`subtitles`),[`en`,`en-us`,`en-ca`,`fr-ca`].indexOf(this.player_.language_)>-1&&(this.label_=`captions`,this.setIcon(`captions`)),this.menuButton_.controlText(jo(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild(`textTrackSettings`)&&(e.push(new el(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,nl),e}}rl.prototype.kinds_=[`captions`,`subtitles`],rl.prototype.controlText_=`Subtitles`,q.registerComponent(`SubsCapsButton`,rl);class il extends Kc{constructor(e,t){let n=t.track,r=e.audioTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);let i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener(`change`,i),this.on(`dispose`,()=>{r.removeEventListener(`change`,i)})}createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return[`main-desc`,`descriptions`,`description`].indexOf(this.options_.track.kind)>=0&&(i.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(G(`span`,{className:`vjs-control-text`,textContent:` `+this.localize(`Descriptions`)}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let n=e[t];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}q.registerComponent(`AudioTrackMenuItem`,il);class al extends Gc{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon(`audio`)}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;let t=this.player_.audioTracks();for(let n=0;n<t.length;n++){let r=t[n];e.push(new il(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}al.prototype.controlText_=`Audio Track`,q.registerComponent(`AudioTrackButton`,al);class ol extends Kc{constructor(e,t){let n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,`ratechange`,e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ol.prototype.contentElType=`button`,q.registerComponent(`PlaybackRateMenuItem`,ol);class sl extends Wc{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute(`aria-describedby`,this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,`loadstart`,e=>this.updateVisibility(e)),this.on(e,`ratechange`,e=>this.updateLabel(e)),this.on(e,`playbackrateschange`,e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_=`vjs-playback-rate-value-label-`+this.id_,this.labelEl_=G(`div`,{className:`vjs-playback-rate-value`,id:this.labelElId_,textContent:`1x`}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new ol(this.player(),{rate:e[n]+`x`}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass(`vjs-hidden`):this.addClass(`vjs-hidden`)}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+`x`)}}sl.prototype.controlText_=`Playback Rate`,q.registerComponent(`PlaybackRateMenuButton`,sl);class cl extends q{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e=`div`,t={},n={}){return t.className||=this.buildCSSClass(),super.createEl(e,t,n)}}q.registerComponent(`Spacer`,cl);class ll extends cl{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl(`div`,{className:this.buildCSSClass(),textContent:`\xA0`})}}q.registerComponent(`CustomControlSpacer`,ll);class ul extends q{createEl(){return super.createEl(`div`,{className:`vjs-control-bar`,dir:`ltr`})}}ul.prototype.options_={children:[`playToggle`,`skipBackward`,`skipForward`,`volumePanel`,`currentTimeDisplay`,`timeDivider`,`durationDisplay`,`progressControl`,`liveDisplay`,`seekToLive`,`remainingTimeDisplay`,`customControlSpacer`,`playbackRateMenuButton`,`chaptersButton`,`descriptionsButton`,`subsCapsButton`,`audioTrackButton`,`pictureInPictureToggle`,`fullscreenToggle`]},q.registerComponent(`ControlBar`,ul);class dl extends Zo{constructor(e,t){super(e,t),this.on(e,`error`,e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):``}}dl.prototype.options_=Object.assign({},Zo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),q.registerComponent(`ErrorDisplay`,dl);class fl extends q{constructor(e,t={}){super(e,t),this.el_.setAttribute(`aria-labelledby`,this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(` `).trim(),G(`select`,{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Qa()}`)+`-`+e[1].replace(/\W+/g,``),n=G(`option`,{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return n.setAttribute(`aria-labelledby`,`${this.selectLabelledbyIds} ${t}`),n}))}}q.registerComponent(`TextTrackSelect`,fl);class pl extends q{constructor(e,t={}){super(e,t);let n=G(`legend`,{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);let r=this.options_.selects;for(let t of r){let n=this.options_.selectConfigs[t],r=n.className,i=n.id.replace(`%s`,this.options_.id_),a=null,o=`vjs_select_${Qa()}`;if(this.options_.type===`colors`){a=G(`span`,{className:r});let e=G(`label`,{id:i,className:`vjs-label`,textContent:this.localize(n.label)});e.setAttribute(`for`,o),a.appendChild(e)}let s=new fl(e,{SelectOptions:n.options,legendId:this.options_.legendId,id:o,labelId:i});this.addChild(s),this.options_.type===`colors`&&(a.appendChild(s.el()),this.el().appendChild(a))}}createEl(){return G(`fieldset`,{className:this.options_.className})}}q.registerComponent(`TextTrackFieldset`,pl);class ml extends q{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new pl(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize(`Text`),className:`vjs-fg vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(r);let i=new pl(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize(`Text Background`),className:`vjs-bg vjs-track-setting`,selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(i);let a=new pl(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize(`Caption Area Background`),className:`vjs-window vjs-track-setting`,selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(a)}createEl(){return G(`div`,{className:`vjs-track-settings-colors`})}}q.registerComponent(`TextTrackSettingsColors`,ml);class hl extends q{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new pl(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:`Font Size`,className:`vjs-font-percent vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(r);let i=new pl(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize(`Text Edge Style`),className:`vjs-edge-style vjs-track-setting`,selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(i);let a=new pl(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize(`Font Family`),className:`vjs-font-family vjs-track-setting`,selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(a)}createEl(){return G(`div`,{className:`vjs-track-settings-font`})}}q.registerComponent(`TextTrackSettingsFont`,hl);class gl extends q{constructor(e,t={}){super(e,t);let n=new lc(e,{controlText:this.localize(`restore all settings to the default values`),className:`vjs-default-button`});n.el().classList.remove(`vjs-control`,`vjs-button`),n.el().textContent=this.localize(`Reset`),this.addChild(n);let r=this.localize(`Done`),i=new lc(e,{controlText:r,className:`vjs-done-button`});i.el().classList.remove(`vjs-control`,`vjs-button`),i.el().textContent=r,this.addChild(i)}createEl(){return G(`div`,{className:`vjs-track-settings-controls`})}}q.registerComponent(`TrackSettingsControls`,gl);const _l=`vjs-text-track-settings`,vl=[`#000`,`Black`],yl=[`#00F`,`Blue`],bl=[`#0FF`,`Cyan`],xl=[`#0F0`,`Green`],Sl=[`#F0F`,`Magenta`],Cl=[`#F00`,`Red`],wl=[`#FFF`,`White`],Tl=[`#FF0`,`Yellow`],El=[`1`,`Opaque`],Dl=[`0.5`,`Semi-Transparent`],Ol=[`0`,`Transparent`],kl={backgroundColor:{selector:`.vjs-bg-color > select`,id:`captions-background-color-%s`,label:`Color`,options:[vl,wl,Cl,xl,yl,Tl,Sl,bl],className:`vjs-bg-color`},backgroundOpacity:{selector:`.vjs-bg-opacity > select`,id:`captions-background-opacity-%s`,label:`Opacity`,options:[El,Dl,Ol],className:`vjs-bg-opacity vjs-opacity`},color:{selector:`.vjs-text-color > select`,id:`captions-foreground-color-%s`,label:`Color`,options:[wl,vl,Cl,xl,yl,Tl,Sl,bl],className:`vjs-text-color`},edgeStyle:{selector:`.vjs-edge-style > select`,id:``,label:`Text Edge Style`,options:[[`none`,`None`],[`raised`,`Raised`],[`depressed`,`Depressed`],[`uniform`,`Uniform`],[`dropshadow`,`Drop shadow`]]},fontFamily:{selector:`.vjs-font-family > select`,id:``,label:`Font Family`,options:[[`proportionalSansSerif`,`Proportional Sans-Serif`],[`monospaceSansSerif`,`Monospace Sans-Serif`],[`proportionalSerif`,`Proportional Serif`],[`monospaceSerif`,`Monospace Serif`],[`casual`,`Casual`],[`script`,`Script`],[`small-caps`,`Small Caps`]]},fontPercent:{selector:`.vjs-font-percent > select`,id:``,label:`Font Size`,options:[[`0.50`,`50%`],[`0.75`,`75%`],[`1.00`,`100%`],[`1.25`,`125%`],[`1.50`,`150%`],[`1.75`,`175%`],[`2.00`,`200%`],[`3.00`,`300%`],[`4.00`,`400%`]],default:2,parser:e=>e===`1.00`?null:Number(e)},textOpacity:{selector:`.vjs-text-opacity > select`,id:`captions-foreground-opacity-%s`,label:`Opacity`,options:[El,Dl],className:`vjs-text-opacity vjs-opacity`},windowColor:{selector:`.vjs-window-color > select`,id:`captions-window-color-%s`,label:`Color`,className:`vjs-window-color`},windowOpacity:{selector:`.vjs-window-opacity > select`,id:`captions-window-opacity-%s`,label:`Opacity`,options:[Ol,Dl,El],className:`vjs-window-opacity vjs-opacity`}};kl.windowColor.options=kl.backgroundColor.options;function Al(e,t){if(t&&(e=t(e)),e&&e!==`none`)return e}function jl(e,t){let n=e.options[e.options.selectedIndex].value;return Al(n,t)}function Ml(e,t,n){if(t){for(let r=0;r<e.options.length;r++)if(Al(e.options[r].value,n)===t){e.selectedIndex=r;break}}}class Nl extends Zo{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=G(`p`,{className:`vjs-control-text`,textContent:this.localize(`End of dialog window.`)}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new ml(e,{textTrackComponentid:this.id_,selectConfigs:kl,fieldSets:[[`color`,`textOpacity`],[`backgroundColor`,`backgroundOpacity`],[`windowColor`,`windowOpacity`]]});this.addChild(t);let n=new hl(e,{textTrackComponentid:this.id_,selectConfigs:kl,fieldSets:[[`fontPercent`],[`edgeStyle`],[`fontFamily`]]});this.addChild(n);let r=new gl(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(`.vjs-done-button`),[`click`,`tap`],()=>{this.saveSettings(),this.close()}),this.on(this.$(`.vjs-default-button`),[`click`,`tap`],()=>{this.setDefaults(),this.updateDisplay()}),Ni(kl,e=>{this.on(this.$(e.selector),`change`,this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize(`Caption Settings Dialog`)}description(){return this.localize(`Beginning of dialog window. Escape will cancel and close the window.`)}buildCSSClass(){return super.buildCSSClass()+` vjs-text-track-settings`}getValues(){return Pi(kl,(e,t,n)=>{let r=jl(this.$(t.selector),t.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){Ni(kl,(t,n)=>{Ml(this.$(t.selector),e[n],t.parser)})}setDefaults(){Ni(kl,e=>{let t=e.hasOwnProperty(`default`)?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem(_l))}catch(e){U.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem(_l,JSON.stringify(e)):x.localStorage.removeItem(_l)}catch(e){U.warn(e)}}updateDisplay(){let e=this.player_.getChild(`textTrackDisplay`);e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}q.registerComponent(`TextTrackSettings`,Nl);class Pl extends q{constructor(e,t){let n=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(n=!1);let r=W({createEl:!n,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=po(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){oo(this,`resize`,e),oo(this,`unload`,t),t=null};ao(this.el_.contentWindow,`unload`,t),ao(this.el_.contentWindow,`resize`,e)},this.one(`load`,this.loadListener_))}createEl(){return super.createEl(`iframe`,{className:`vjs-resize-manager`,tabIndex:-1,title:this.localize(`No content`)},{"aria-hidden":`true`})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger(`playerresize`)}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off(`load`,this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}q.registerComponent(`ResizeManager`,Pl);const Fl={trackingThreshold:20,liveTolerance:15};class Il extends q{constructor(e,t){let n=W(Fl,t,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,`durationchange`,e=>this.handleDurationchange(e)),this.on(this.player_,`canplay`,()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(x.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;let r=this.liveCurrentTime(),i=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-i)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger(`liveedgechange`))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass(`vjs-liveui`),this.startTracking()):(this.player_.removeClass(`vjs-liveui`),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||=this.player_.hasStarted(),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,[`play`,`pause`],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,`seeked`,this.handleSeeked_):(this.one(this.player_,`play`,this.handlePlay_),this.one(this.player_,`timeupdate`,this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,`seeked`,this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,`timeupdate`,this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,[`play`,`pause`],this.trackLiveHandler_),this.off(this.player_,`seeked`,this.handleSeeked_),this.off(this.player_,`play`,this.handlePlay_),this.off(this.player_,`timeupdate`,this.handleFirstTimeupdate_),this.off(this.player_,`timeupdate`,this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger(`liveedgechange`))}seekableEnd(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==`number`}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}q.registerComponent(`LiveTracker`,Il);class Ll extends q{constructor(e,t){super(e,t),this.on(`statechanged`,e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:G(`div`,{className:`vjs-title-bar-title`,id:`vjs-title-bar-title-${Qa()}`}),description:G(`div`,{className:`vjs-title-bar-description`,id:`vjs-title-bar-description-${Qa()}`})},G(`div`,{className:`vjs-title-bar`},{},Li(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,n={title:`aria-labelledby`,description:`aria-describedby`};[`title`,`description`].forEach(e=>{let r=this.state[e],i=this.els[e],a=n[e];Na(i),r&&ga(i,r),t&&(t.removeAttribute(a),r&&t.setAttribute(a,i.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute(`aria-labelledby`),t.removeAttribute(`aria-describedby`)),super.dispose(),this.els=null}}q.registerComponent(`TitleBar`,Ll);const Rl={initialDisplay:4e3,position:[],takeFocus:!1};class zl extends lc{constructor(e,t){t=W(Rl,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,[`useractive`,`userinactive`],e=>{this.removeClass(`force-display`)})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(` `)}`}createEl(){let e=G(`button`,{},{type:`button`,class:this.buildCSSClass()},G(`span`));return this.controlTextEl_=e.querySelector(`span`),e}show(){super.show(),this.addClass(`force-display`),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass(`force-display`)},this.options_.initialDisplay)}hide(){this.removeClass(`force-display`),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}q.registerComponent(`TransientButton`,zl);const Bl=e=>{let t=e.el();if(t.hasAttribute(`src`))return e.triggerSourceset(t.src),!0;let n=e.$$(`source`),r=[],i=``;if(!n.length)return!1;for(let e=0;e<n.length;e++){let t=n[e].src;t&&r.indexOf(t)===-1&&r.push(t)}return r.length?(r.length===1&&(i=r[0]),e.triggerSourceset(i),!0):!1},Vl=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){let t=F.createElement(this.nodeName.toLowerCase());t.innerHTML=e;let n=F.createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText=``,x.Element.prototype.appendChild.call(this,n),this.innerHTML}}),Hl=(e,t)=>{let n={};for(let r=0;r<e.length&&(n=Object.getOwnPropertyDescriptor(e[r],t),!(n&&n.set&&n.get));r++);return n.enumerable=!0,n.configurable=!0,n},Ul=e=>Hl([e.el(),x.HTMLMediaElement.prototype,x.Element.prototype,Vl],`innerHTML`),Wl=function(e){let t=e.el();if(t.resetSourceWatch_)return;let n={},r=Ul(e),i=n=>(...r)=>{let i=n.apply(t,r);return Bl(e),i};[`append`,`appendChild`,`insertAdjacentHTML`].forEach(e=>{t[e]&&(n[e]=t[e],t[e]=i(n[e]))}),Object.defineProperty(t,"innerHTML",W(r,{set:i(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach(e=>{t[e]=n[e]}),Object.defineProperty(t,"innerHTML",r)},e.one(`sourceset`,t.resetSourceWatch_)},Gl=Object.defineProperty({},"src",{get(){return this.hasAttribute(`src`)?fs(x.Element.prototype.getAttribute.call(this,`src`)):``},set(e){return x.Element.prototype.setAttribute.call(this,`src`,e),e}}),Kl=e=>Hl([e.el(),x.HTMLMediaElement.prototype,Gl],`src`),ql=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let n=Kl(e),r=t.setAttribute,i=t.load;Object.defineProperty(t,"src",W(n,{set:r=>{let i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{let a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=()=>{let n=i.call(t);return Bl(e)||(e.triggerSourceset(``),Wl(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Bl(e)||Wl(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=i,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}};class Y extends J{constructor(e,t){super(e,t);let n=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName===`VIDEO`,n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,n=[];for(;t--;){let i=e[t];i.nodeName.toLowerCase()===`track`&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),!r&&!this.el_.hasAttribute(`crossorigin`)&&ms(i.src)&&(r=!0)):n.push(i))}for(let e=0;e<n.length;e++)this.el_.removeChild(n[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&U.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
161
- This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(aa||ta)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Y.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){ql(this)}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,n=()=>{t=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===`metadata`&&t.push({track:r,storedMode:r.mode})}};n(),e.addEventListener(`change`,n),this.on(`dispose`,()=>e.removeEventListener(`change`,n));let r=()=>{for(let e=0;e<t.length;e++){let n=t[e];n.track.mode===`disabled`&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}e.removeEventListener(`change`,r)};this.on(`webkitbeginfullscreen`,()=>{e.removeEventListener(`change`,n),e.removeEventListener(`change`,r),e.addEventListener(`change`,r)}),this.on(`webkitendfullscreen`,()=>{e.removeEventListener(`change`,n),e.addEventListener(`change`,n),e.removeEventListener(`change`,r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_(`Audio`,e)}overrideNativeVideoTracks(e){this.overrideNative_(`Video`,e)}proxyNativeTracksForType_(e){let t=Ss[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;let i={change:t=>{let n={type:`change`,target:r,currentTarget:r,srcElement:r};r.trigger(n),e===`text`&&this[Cs.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},a=function(){let e=[];for(let t=0;t<r.length;t++){let i=!1;for(let e=0;e<n.length;e++)if(n[e]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+`Listeners_`]=i,Object.keys(i).forEach(e=>{let t=i[e];n.addEventListener(e,t),this.on(`dispose`,r=>n.removeEventListener(e,t))}),this.on(`loadstart`,a),this.on(`dispose`,e=>this.off(`loadstart`,a))}proxyNativeTracks_(){Ss.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Y.disposeMediaElement(e),e=t}else{e=F.createElement(`video`);let t=W({},this.options_.tag&&Ca(this.options_.tag));(!aa||this.options_.nativeControlsForTouch!==!0)&&delete t.controls,Sa(e,Object.assign(t,{id:this.options_.techId,class:`vjs-tech`}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&Ta(e,`preload`,this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=[`loop`,`muted`,`playsinline`,`autoplay`];for(let n=0;n<t.length;n++){let r=t[n],i=this.options_[r];i!==void 0&&(i?Ta(e,r,r):Ea(e,r),e[r]=i)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let e=!1,t=function(){e=!0};this.on(`loadstart`,t);let n=function(){e||this.trigger(`loadstart`)};this.on(`loadedmetadata`,n),this.ready(function(){this.off(`loadstart`,t),this.off(`loadedmetadata`,n),e||this.trigger(`loadstart`)});return}let t=[`loadstart`];t.push(`loadedmetadata`),e.readyState>=2&&t.push(`loadeddata`),e.readyState>=3&&t.push(`canplay`),e.readyState>=4&&t.push(`canplaythrough`),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&ca?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){U(e,`Video is not ready. (Video.js)`)}}duration(){if(this.el_.duration===1/0&&Hi&&qi&&this.el_.currentTime===0){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger(`durationchange`),this.off(`timeupdate`,e))};return this.on(`timeupdate`,e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!(`webkitDisplayingFullscreen`in this.el_))return;let e=function(){this.trigger(`fullscreenchange`,{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){`webkitPresentationMode`in this.el_&&this.el_.webkitPresentationMode!==`picture-in-picture`&&(this.one(`webkitendfullscreen`,e),this.trigger(`fullscreenchange`,{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on(`webkitbeginfullscreen`,t),this.on(`dispose`,()=>{this.off(`webkitbeginfullscreen`,t),this.off(`webkitendfullscreen`,e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==`function`}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)qo(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger(`fullscreenerror`,Error(`The video is not fullscreen`))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return U.error(`Invalid source URL.`),!1;let n={src:e};t&&(n.type=t);let r=G(`source`,{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return U.error(`Source URL is required to remove the source element.`),!1;let t=this.el_.querySelectorAll(`source`);for(let n of t)if(n.src===e)return this.el_.removeChild(n),!0;return U.warn(`No matching source element found with src: ${e}`),!1}reset(){Y.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=F.createElement(`track`);return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$(`track`),n=t.length;for(;n--;)(e===t[n]||e===t[n].track)&&this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==`function`)return this.el().getVideoPlaybackQuality();let e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}Ri(Y,`TEST_VID`,function(){if(!fa())return;let e=F.createElement(`video`),t=F.createElement(`track`);return t.kind=`captions`,t.srclang=`en`,t.label=`English`,e.appendChild(t),e}),Y.isSupported=function(){try{Y.TEST_VID.volume=.5}catch{return!1}return!!(Y.TEST_VID&&Y.TEST_VID.canPlayType)},Y.canPlayType=function(e){return Y.TEST_VID.canPlayType(e)},Y.canPlaySource=function(e,t){return Y.canPlayType(e.type)},Y.canControlVolume=function(){try{let e=Y.TEST_VID.volume;Y.TEST_VID.volume=e/2+.1;let t=e!==Y.TEST_VID.volume;return t&&sa?(x.setTimeout(()=>{Y&&Y.prototype&&(Y.prototype.featuresVolumeControl=e!==Y.TEST_VID.volume)}),!1):t}catch{return!1}},Y.canMuteVolume=function(){try{let e=Y.TEST_VID.muted;return Y.TEST_VID.muted=!e,Y.TEST_VID.muted?Ta(Y.TEST_VID,`muted`,`muted`):Ea(Y.TEST_VID,`muted`,`muted`),e!==Y.TEST_VID.muted}catch{return!1}},Y.canControlPlaybackRate=function(){if(Hi&&qi&&Yi<58)return!1;try{let e=Y.TEST_VID.playbackRate;return Y.TEST_VID.playbackRate=e/2+.1,e!==Y.TEST_VID.playbackRate}catch{return!1}},Y.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(F.createElement(`video`),"src",{get:e,set:e}),Object.defineProperty(F.createElement(`audio`),"src",{get:e,set:e}),Object.defineProperty(F.createElement(`video`),"innerHTML",{get:e,set:e}),Object.defineProperty(F.createElement(`audio`),"innerHTML",{get:e,set:e})}catch{return!1}return!0},Y.supportsNativeTextTracks=function(){return ca||sa&&qi},Y.supportsNativeVideoTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.videoTracks)},Y.supportsNativeAudioTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.audioTracks)},Y.Events=[`loadstart`,`suspend`,`abort`,`error`,`emptied`,`stalled`,`loadedmetadata`,`loadeddata`,`canplay`,`canplaythrough`,`playing`,`waiting`,`seeking`,`seeked`,`ended`,`durationchange`,`timeupdate`,`progress`,`play`,`pause`,`ratechange`,`resize`,`volumechange`],[[`featuresMuteControl`,`canMuteVolume`],[`featuresPlaybackRate`,`canControlPlaybackRate`],[`featuresSourceset`,`canOverrideAttributes`],[`featuresNativeTextTracks`,`supportsNativeTextTracks`],[`featuresNativeVideoTracks`,`supportsNativeVideoTracks`],[`featuresNativeAudioTracks`,`supportsNativeAudioTracks`]].forEach(function([e,t]){Ri(Y.prototype,e,()=>Y[t](),!0)}),Y.prototype.featuresVolumeControl=Y.canControlVolume(),Y.prototype.movingMediaElementInDOM=!sa,Y.prototype.featuresFullscreenResize=!0,Y.prototype.featuresProgressEvents=!0,Y.prototype.featuresTimeupdateEvents=!0,Y.prototype.featuresVideoFrameCallback=!!(Y.TEST_VID&&Y.TEST_VID.requestVideoFrameCallback),Y.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()}},Y.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll(`source`),n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()},[`muted`,`defaultMuted`,`autoplay`,`controls`,`loop`,`playsinline`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),[`muted`,`defaultMuted`,`autoplay`,`loop`,`playsinline`].forEach(function(e){Y.prototype[`set`+jo(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),[`paused`,`currentTime`,`buffered`,`volume`,`poster`,`preload`,`error`,`seeking`,`seekable`,`ended`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`played`,`networkState`,`readyState`,`videoWidth`,`videoHeight`,`crossOrigin`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]}}),[`volume`,`src`,`poster`,`preload`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`crossOrigin`].forEach(function(e){Y.prototype[`set`+jo(e)]=function(t){this.el_[e]=t}}),[`pause`,`load`,`play`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]()}}),J.withSourceHandlers(Y),Y.nativeSourceHandler={},Y.nativeSourceHandler.canPlayType=function(e){try{return Y.TEST_VID.canPlayType(e)}catch{return``}},Y.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Y.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=ps(e.src);return Y.nativeSourceHandler.canPlayType(`video/${t}`)}return``},Y.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Y.nativeSourceHandler.dispose=function(){},Y.registerSourceHandler(Y.nativeSourceHandler),J.registerTech(`Html5`,Y);const Jl=[`progress`,`abort`,`suspend`,`emptied`,`stalled`,`loadedmetadata`,`loadeddata`,`timeupdate`,`resize`,`volumechange`,`texttrackchange`],Yl={canplay:`CanPlay`,canplaythrough:`CanPlayThrough`,playing:`Playing`,seeked:`Seeked`},Xl=[`tiny`,`xsmall`,`small`,`medium`,`large`,`xlarge`,`huge`],Zl={};Xl.forEach(e=>{let t=e.charAt(0)===`x`?`x-${e.substring(1)}`:e;Zl[e]=`vjs-layout-${t}`});const Ql={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class X extends q{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${Qa()}`,t=Object.assign(X.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let n=e.closest(`[lang]`);n&&(t.language=n.getAttribute(`lang`))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=Ai(this.id_),this.fsApi_=Ci,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error(`No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?`);if(this.tag=e,this.tagAttributes=e&&Ca(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(n){e[n.toLowerCase()]=t.languages[n]}),this.languages_=e}else this.languages_=X.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||``,this.controls_=!!t.controls,e.controls=!1,e.removeAttribute(`controls`),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute(`autoplay`)?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if(typeof this[e]!=`function`)throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Do(this,{eventBusKey:`el_`}),this.fsApi_.requestFullscreen&&(ao(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on([`playerreset`,`resize`],this.boundUpdateStyleEl_);let r=W(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=new x.DOMParser().parseFromString(Js,`image/svg+xml`);if(e.querySelector(`parsererror`))U.warn(`Failed to load SVG Icons. Falling back to Font Icons.`),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display=`none`,this.el_.appendChild(t),this.addClass(`vjs-svg-icons-enabled`)}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()===`audio`),this.controls()?this.addClass(`vjs-controls-enabled`):this.addClass(`vjs-controls-disabled`),this.el_.setAttribute(`role`,`region`),this.isAudio()?this.el_.setAttribute(`aria-label`,this.localize(`Audio Player`)):this.el_.setAttribute(`aria-label`,this.localize(`Video Player`)),this.isAudio()&&this.addClass(`vjs-audio`),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Zs(this),this.addClass(`vjs-spatial-navigation-enabled`)),aa&&this.addClass(`vjs-touch-enabled`),sa||this.addClass(`vjs-workinghover`),X.players[this.id_]=this;let i=_i.split(`.`)[0];this.addClass(`vjs-v${i}`),this.userActive(!0),this.reportUserActivity(),this.one(`play`,e=>this.listenForUserActivity_(e)),this.on(`keydown`,e=>this.handleKeyDown(e)),this.on(`languagechange`,e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on(`ready`,()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger(`dispose`),this.off(`dispose`),oo(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),oo(F,`keydown`,this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),X.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=``),this.playerElIngest_&&=null,this.tag&&=null,Bs(this),ws.names.forEach(e=>{let t=ws[e],n=this[t.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute(`data-vjs-player`),r=this.tag.tagName.toLowerCase()===`video-js`;n?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl(`div`));let i=Ca(e);if(r){for(t=this.el_=e,e=this.tag=F.createElement(`video`);t.children.length;)e.appendChild(t.firstChild);va(t,`video-js`)||ya(t,`video-js`),t.appendChild(e),n=this.playerElIngest_=t,Object.keys(t).forEach(n=>{try{e[n]=t[n]}catch{}})}e.setAttribute(`tabindex`,`-1`),i.tabindex=`-1`,qi&&$i&&(e.setAttribute(`role`,`application`),i.role=`application`),e.removeAttribute(`width`),e.removeAttribute(`height`),`width`in i&&delete i.width,`height`in i&&delete i.height,Object.getOwnPropertyNames(i).forEach(function(n){r&&n===`class`||t.setAttribute(n,i[n]),r&&e.setAttribute(n,i[n])}),e.playerId=e.id,e.id+=`_html5_api`,e.className=`vjs-tech`,e.player=t.player=this,this.addClass(`vjs-paused`);let a=[`IS_SMART_TV`,`IS_TIZEN`,`IS_WEBOS`,`IS_ANDROID`,`IS_IPAD`,`IS_IPHONE`,`IS_CHROMECAST_RECEIVER`].filter(e=>la[e]).map(e=>`vjs-device-`+e.substring(3).toLowerCase().replace(/\_/g,`-`));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ja(`vjs-styles-dimensions`);let e=Ra(`.vjs-styles-defaults`),t=Ra(`head`);t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let o=e.getElementsByTagName(`a`);for(let e=0;e<o.length;e++){let t=o.item(e);ya(t,`vjs-hidden`),t.setAttribute(`hidden`,`hidden`)}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(t,e),_a(e,t),this.children_.unshift(e),this.el_.setAttribute(`lang`,this.language_),this.el_.setAttribute(`translate`,`no`),this.el_=t,t}crossOrigin(e){if(e===void 0)return this.techGet_(`crossOrigin`);e!==null&&e!==`anonymous`&&e!==`use-credentials`?U.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):(this.techCall_(`setCrossOrigin`,e),this.posterImage&&this.posterImage.crossOrigin(e))}width(e){return this.dimension(`width`,e)}height(e){return this.dimension(`height`,e)}dimension(e,t){let n=e+`_`;if(t===void 0)return this[n]||0;if(t===``||t===`auto`){this[n]=void 0,this.updateStyleEl_();return}let r=parseFloat(t);isNaN(r)?U.error(`Improper value "${t}" supplied for for ${e}`):(this[n]=r,this.updateStyleEl_())}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,vo(this)&&this.off([`playerreset`,`resize`],this.boundUpdateStyleEl_),e?(this.addClass(`vjs-fluid`),this.fill(!1),yo(this,()=>{this.on([`playerreset`,`resize`],this.boundUpdateStyleEl_)})):this.removeClass(`vjs-fluid`),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass(`vjs-fill`),this.fluid(!1)):this.removeClass(`vjs-fill`)}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error(`Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.`);this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){let e=typeof this.width_==`number`?this.width_:this.options_.width,t=typeof this.height_==`number`?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();n&&(e>=0&&(n.width=e),t>=0&&(n.height=t));return}let e,t,n,r;n=this.aspectRatio_!==void 0&&this.aspectRatio_!==`auto`?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+`:`+this.videoHeight():`16:9`;let i=n.split(`:`),a=i[1]/i[0];e=this.width_===void 0?this.height_===void 0?this.videoWidth()||300:this.height_/a:this.width_,t=this.height_===void 0?e*a:this.height_,r=/^[^a-zA-Z]/.test(this.id())?`dimensions-`+this.id():this.id()+`-dimensions`,this.addClass(r),Ya(this.styleEl_,`
160
+ </svg>`;const Ys=na?10009:ra?461:8,Xs={codes:{play:415,pause:19,ff:417,rw:412,back:Ys},names:{415:`play`,19:`pause`,417:`ff`,412:`rw`,[Ys]:`back`},isEventKey(e,t){return t=t.toLowerCase(),!!(this.names[e.keyCode]&&this.names[e.keyCode]===t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}};class Zs extends go{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on(`keydown`,this.onKeyDown_),this.player_.on(`modalKeydown`,this.onKeyDown_),this.player_.on(`loadedmetadata`,()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on(`modalclose`,()=>{this.refocusComponent()}),this.player_.on(`focusin`,this.handlePlayerFocus_.bind(this)),this.player_.on(`focusout`,this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on(`aftermodalfill`,()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off(`keydown`,this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){let t=e.originalEvent?e.originalEvent:e;if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(Xs.isEventKey(t,`play`)||Xs.isEventKey(t,`pause`)||Xs.isEventKey(t,`ff`)||Xs.isEventKey(t,`rw`)){t.preventDefault();let e=Xs.getEventName(t);this.performMediaAction_(e)}else Xs.isEventKey(t,`Back`)&&e.target&&typeof e.target.closeable==`function`&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case`play`:this.player_.paused()&&this.player_.play();break;case`pause`:this.player_.paused()||this.player_.pause();break;case`ff`:this.userSeek_(this.player_.currentTime()+5);break;case`rw`:this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){let t=e.relatedTarget,n=null,r=this.getCurrentComponent(e.target);t&&(n=!!t.closest(`.video-js`),t.classList.contains(`vjs-text-track-settings`)&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||n)&&t||(r&&r.name()===`CloseButton`?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function n(e){for(let r of e)r.hasOwnProperty(`el_`)&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty(`children_`)&&r.children_.length>0&&n(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty(`el_`)){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())){t.push(e);return}e.hasOwnProperty(`children_`)&&e.children_.length>0?n(e.children_):e.hasOwnProperty(`items`)&&e.items.length>0?n(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if(e.name_===`ErrorDisplay`&&e.opened_){let n=e.el_.querySelector(`.vjs-errors-ok-button-container`);n&&n.querySelectorAll(`button`).forEach((e,n)=>{t.push({name:()=>`ModalButton`+(n+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let e=0;e<n.children.length;e++){let r=n.children[e],i=t(r);if(i)return i}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let e of this.focusableComponents)if(e.el()===t)return e}}add(e){let t=[...this.focusableComponents];e.hasOwnProperty(`el_`)&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:`focusableComponentsChanged`,focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let n=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(n.boundingClientRect,r.getPositions().boundingClientRect,e)),i=this.findBestCandidate_(n.center,r,e);i?this.focus(i):this.trigger({type:`endOfFocusableComponents`,direction:e,focusedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,i=null;for(let a of t){let t=a.getPositions().center,o=this.calculateDistance_(e,t,n);o<r&&(r=o,i=a)}return i}isInDirection_(e,t,n){switch(n){case`right`:return t.left>=e.right;case`left`:return t.right<=e.left;case`down`:return t.top>=e.bottom;case`up`:return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e==`object`&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,n){let r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),a;switch(n){case`right`:case`left`:a=r+i*100;break;case`up`:a=i*2+r*.5;break;case`down`:a=i*5+r;break;default:a=r+i}return a}searchForTrackSelect_(){let e=this;for(let t of e.updateFocusableComponents())if(t.constructor.name===`TextTrackSelect`){e.focus(t);break}}}class Qs extends q{constructor(e,t,n){let r=W({createEl:!1},t);if(super(e,r,n),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,r=t.playerOptions.techOrder;n<r.length;n++){let t=jo(r[n]),i=J.getTech(t);if(t||(i=q.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}else e.src(t.playerOptions.sources)}}q.registerComponent(`MediaLoader`,Qs);class $s extends q{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e=`div`,t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e===`button`&&U.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:`button`},n),this.tabIndex_=t.tabIndex;let r=G(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=G(`span`,{className:`vjs-control-text`},{"aria-live":`polite`}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||`Need Text`;let n=this.localize(e);this.controlText_=e,ga(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute(`title`,n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass(`vjs-disabled`),this.el_.setAttribute(`aria-disabled`,`false`),this.tabIndex_!==void 0&&this.el_.setAttribute(`tabIndex`,this.tabIndex_),this.on([`tap`,`click`],this.handleClick_),this.on(`keydown`,this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass(`vjs-disabled`),this.el_.setAttribute(`aria-disabled`,`true`),this.tabIndex_!==void 0&&this.el_.removeAttribute(`tabIndex`),this.off(`mouseover`,this.handleMouseOver_),this.off(`mouseout`,this.handleMouseOut_),this.off([`tap`,`click`],this.handleClick_),this.off(`keydown`,this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===` `||e.key===`Enter`?(e.preventDefault(),e.stopPropagation(),this.trigger(`click`)):super.handleKeyDown(e)}}q.registerComponent(`ClickableComponent`,$s);class ec extends $s{constructor(e,t){super(e,t);let{mainContent:n}=t&&t.playerOptions||{};this.isMainContent=n,this.update(),this.update_=e=>this.update(e),e.on(`posterchange`,this.update_)}dispose(){this.player().off(`posterchange`,this.update_),super.dispose()}createEl(){return G(`div`,{className:`vjs-poster`})}crossOrigin(e){if(e===void 0)return this.$(`img`)?this.$(`img`).crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e!==null&&e!==`anonymous`&&e!==`use-credentials`?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):this.$(`img`)&&(this.$(`img`).crossOrigin=e)}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$(`img`)||this.el_.appendChild(G(`picture`,{className:`vjs-poster`,tabIndex:-1},{},G(`img`,{loading:this.isMainContent?`eager`:`lazy`,fetchPriority:this.isMainContent?`high`:`auto`,crossOrigin:this.crossOrigin()},{alt:``}))),this.$(`img`).src=e):this.el_.textContent=``}handleClick(e){if(!this.player_.controls())return;let t=this.player_.getChild(`controlBar`),n=t&&t.getChild(`playToggle`);Gi?(n||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?qo(this.player_.play()):this.player_.pause()}}ec.prototype.crossorigin=ec.prototype.crossOrigin,q.registerComponent(`PosterImage`,ec);const tc=`#222`,nc=`#ccc`,rc={monospace:`monospace`,sansSerif:`sans-serif`,serif:`serif`,monospaceSansSerif:`"Andale Mono", "Lucida Console", monospace`,monospaceSerif:`"Courier New", monospace`,proportionalSansSerif:`sans-serif`,proportionalSerif:`serif`,casual:`"Comic Sans MS", Impact, fantasy`,script:`"Monotype Corsiva", cursive`,smallcaps:`"Andale Mono", "Lucida Console", monospace, sans-serif`};function ic(e,t){let n;if(e.length===4)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(e.length===7)n=e.slice(1);else throw Error(`Invalid color code provided, `+e+`; must be formatted as e.g. #f0e or #f604e2.`);return`rgba(`+parseInt(n.slice(0,2),16)+`,`+parseInt(n.slice(2,4),16)+`,`+parseInt(n.slice(4,6),16)+`,`+t+`)`}function ac(e,t,n){try{e.style[t]=n}catch{return}}function oc(e){return e?`${e}px`:``}class sc extends q{constructor(e,t,n){super(e,t,n);let r=e=>this.updateDisplay(e),i=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on(`loadstart`,e=>this.toggleDisplay(e)),e.on(`useractive`,r),e.on(`userinactive`,r),e.on(`texttrackchange`,r),e.on(`loadedmetadata`,e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(K(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on(`fullscreenchange`,i),e.on(`playerresize`,i);let t=x.screen.orientation||x,n=x.screen.orientation?`change`:`orientationchange`;t.addEventListener(n,i),e.on(`dispose`,()=>t.removeEventListener(n,i));let r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()}))}preselectTrack(){let e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,r,i,a;for(let o=0;o<t.length;o++){let s=t[o];n&&n.enabled&&n.language&&n.language===s.language&&s.kind in e?s.kind===n.kind?a=s:a||=s:n&&!n.enabled?(a=null,r=null,i=null):s.default&&(s.kind===`descriptions`&&!r?r=s:s.kind in e&&!i&&(i=s))}a?a.mode=`showing`:i?i.mode=`showing`:r&&(r.mode=`showing`)}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl(`div`,{className:`vjs-text-track-display`},{translate:`yes`,"aria-live":`off`,"aria-atomic":`true`})}clearDisplay(){typeof x.WebVTT==`function`&&x.WebVTT.processCues(x,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let n=0;n<e.length;++n){let r=e[n];r.mode===`showing`&&t.push(r)}this.updateForTrack(t);return}let n=null,r=null,i=e.length;for(;i--;){let t=e[i];t.mode===`showing`&&(t.kind===`descriptions`?n=t:r=t)}if(r?(this.getAttribute(`aria-live`)!==`off`&&this.setAttribute(`aria-live`,`off`),this.updateForTrack(r)):n&&(this.getAttribute(`aria-live`)!==`assertive`&&this.setAttribute(`aria-live`,`assertive`),this.updateForTrack(n)),!(x.CSS!==void 0&&x.CSS.supports(`inset`,`10px`))){let e=this.el_,t=e.querySelectorAll(`.vjs-text-track-cue`),n=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style=``,ac(e,`position`,`relative`),ac(e,`height`,r-n+`px`),ac(e,`top`,`unset`),ia?ac(e,`bottom`,r+`px`):ac(e,`bottom`,`0px`),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(` `);t.length===3&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:`unset`})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(x.CSS!==void 0&&x.CSS.supports(`inset-inline: 10px`)))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),i=0,a=0;Math.abs(n-r)>.1&&(n>r?i=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ac(this.el_,`insetInline`,oc(i)),ac(this.el_,`insetBlock`,oc(a))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;for(;r--;){let e=n[r];if(!e)continue;let i=e.displayState;if(t.color&&(i.firstChild.style.color=t.color),t.textOpacity&&ac(i.firstChild,`color`,ic(t.color||`#fff`,t.textOpacity)),t.backgroundColor&&(i.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ac(i.firstChild,`backgroundColor`,ic(t.backgroundColor||`#000`,t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ac(i,`backgroundColor`,ic(t.windowColor,t.windowOpacity)):i.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle===`dropshadow`?i.firstChild.style.textShadow=`2px 2px 3px ${tc}, 2px 2px 4px ${tc}, 2px 2px 5px ${tc}`:t.edgeStyle===`raised`?i.firstChild.style.textShadow=`1px 1px ${tc}, 2px 2px ${tc}, 3px 3px ${tc}`:t.edgeStyle===`depressed`?i.firstChild.style.textShadow=`1px 1px ${nc}, 0 1px ${nc}, -1px -1px ${tc}, 0 -1px ${tc}`:t.edgeStyle===`uniform`&&(i.firstChild.style.textShadow=`0 0 4px ${tc}, 0 0 4px ${tc}, 0 0 4px ${tc}, 0 0 4px ${tc}`)),t.fontPercent&&t.fontPercent!==1){let e=x.parseFloat(i.style.fontSize);i.style.fontSize=e*t.fontPercent+`px`,i.style.height=`auto`,i.style.top=`auto`}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily===`small-caps`?i.firstChild.style.fontVariant=`small-caps`:i.firstChild.style.fontFamily=rc[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!=`function`||e.every(e=>!e.activeCues))return;let t=[];for(let n=0;n<e.length;++n){let r=e[n];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}x.WebVTT.processCues(x,t,this.el_);for(let t=0;t<e.length;++t){let n=e[t];for(let e=0;e<n.activeCues.length;++e){let r=n.activeCues[e].displayState;ya(r,`vjs-text-track-cue`,`vjs-text-track-cue-`+(n.language?n.language:t)),n.language&&Ta(r,`lang`,n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}q.registerComponent(`TextTrackDisplay`,sc);class cc extends q{createEl(){let e=this.player_.isAudio(),t=this.localize(e?`Audio Player`:`Video Player`),n=G(`span`,{className:`vjs-control-text`,textContent:this.localize(`{1} is loading.`,[t])}),r=super.createEl(`div`,{className:`vjs-loading-spinner`,dir:`ltr`});return r.appendChild(n),r}handleLanguagechange(){this.$(`.vjs-control-text`).textContent=this.localize(`{1} is loading.`,[this.player_.isAudio()?`Audio Player`:`Video Player`])}}q.registerComponent(`LoadingSpinner`,cc);class lc extends $s{createEl(e,t={},n={}){e=`button`,t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:`button`},n);let r=G(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){let n=this.constructor.name;return U.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),q.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute(`disabled`)}disable(){super.disable(),this.el_.setAttribute(`disabled`,`disabled`)}handleKeyDown(e){e.key===` `||e.key===`Enter`?e.stopPropagation():super.handleKeyDown(e)}}q.registerComponent(`Button`,lc);class uc extends lc{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon(`play`),this.on(`mousedown`,e=>this.handleMouseDown(e))}buildCSSClass(){return`vjs-big-play-button`}handleClick(e){let t=this.player_.play(),n=this.player_.getChild(`controlBar`),r=n&&n.getChild(`playToggle`);if(e.type===`tap`||this.mouseused_&&`clientX`in e&&`clientY`in e){qo(t),Gi?(r||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus();return}if(!r){this.player_.tech(!0).focus();return}let i=()=>r.focus();Ko(t)?t.then(i,()=>{}):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}uc.prototype.controlText_=`Play Video`,q.registerComponent(`BigPlayButton`,uc);class dc extends lc{constructor(e,t){super(e,t),this.setIcon(`cancel`),this.controlText(t&&t.controlText||this.localize(`Close`))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:`close`,bubbles:!1})}handleKeyDown(e){e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this.trigger(`click`)):super.handleKeyDown(e)}}q.registerComponent(`CloseButton`,dc);class fc extends lc{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon(`play`),this.on(e,`play`,e=>this.handlePlay(e)),this.on(e,`pause`,e=>this.handlePause(e)),t.replay&&this.on(e,`ended`,e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?qo(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass(`vjs-ended`),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass(`vjs-ended`,`vjs-paused`),this.addClass(`vjs-playing`),this.setIcon(`pause`),this.controlText(`Pause`)}handlePause(e){this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.setIcon(`play`),this.controlText(`Play`)}handleEnded(e){this.removeClass(`vjs-playing`),this.addClass(`vjs-ended`),this.setIcon(`replay`),this.controlText(`Replay`),this.one(this.player_,`seeked`,e=>this.handleSeeked(e))}}fc.prototype.controlText_=`Play`,q.registerComponent(`PlayToggle`,fc);class pc extends q{constructor(e,t){super(e,t),this.on(e,[`timeupdate`,`ended`,`seeking`],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl(`div`,{className:`${e} vjs-time-control vjs-control`}),n=G(`span`,{className:`vjs-control-text`,textContent:`${this.localize(this.labelText_)}\u00a0`},{role:`presentation`});return t.appendChild(n),this.contentEl_=G(`span`,{className:`${e}-display`},{role:`presentation`}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!==`seeking`)&&this.updateContent(e)}updateTextNode_(e=0){e=Ho(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame(`TimeDisplay#updateTextNode_`,()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,U.warn(`TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.`)),this.textNode_=F.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}pc.prototype.labelText_=`Time`,pc.prototype.controlText_=`Time`,q.registerComponent(`TimeDisplay`,pc);class mc extends pc{buildCSSClass(){return`vjs-current-time`}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime==`function`&&e.target.pendingSeekTime()!==null?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}mc.prototype.labelText_=`Current Time`,mc.prototype.controlText_=`Current Time`,q.registerComponent(`CurrentTimeDisplay`,mc);class hc extends pc{constructor(e,t){super(e,t);let n=e=>this.updateContent(e);this.on(e,`durationchange`,n),this.on(e,`loadstart`,n),this.on(e,`loadedmetadata`,n)}buildCSSClass(){return`vjs-duration`}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}hc.prototype.labelText_=`Duration`,hc.prototype.controlText_=`Duration`,q.registerComponent(`DurationDisplay`,hc);class gc extends q{createEl(){let e=super.createEl(`div`,{className:`vjs-time-control vjs-time-divider`},{"aria-hidden":!0}),t=super.createEl(`div`),n=super.createEl(`span`,{textContent:`/`});return t.appendChild(n),e.appendChild(t),e}}q.registerComponent(`TimeDivider`,gc);class _c extends pc{constructor(e,t){super(e,t),this.on(e,`durationchange`,e=>this.updateContent(e))}buildCSSClass(){return`vjs-remaining-time`}createEl(){let e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(G(`span`,{},{"aria-hidden":!0},`-`),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!=`number`)return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}_c.prototype.labelText_=`Remaining Time`,_c.prototype.controlText_=`Remaining Time`,q.registerComponent(`RemainingTimeDisplay`,_c);class vc extends q{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),`durationchange`,e=>this.updateShowing(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-live-control vjs-control`});return this.contentEl_=G(`div`,{className:`vjs-live-display`},{"aria-live":`off`}),this.contentEl_.appendChild(G(`span`,{className:`vjs-control-text`,textContent:`${this.localize(`Stream Type`)}\u00a0`})),this.contentEl_.appendChild(F.createTextNode(this.localize(`LIVE`))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}q.registerComponent(`LiveDisplay`,vc);class yc extends lc{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,`liveedgechange`,this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl(`button`,{className:`vjs-seek-to-live-control vjs-control`});return this.setIcon(`circle`,e),this.textEl_=G(`span`,{className:`vjs-seek-to-live-text`,textContent:this.localize(`LIVE`)},{"aria-hidden":`true`}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute(`aria-disabled`,!0),this.addClass(`vjs-at-live-edge`),this.controlText(`Seek to live, currently playing live`)):(this.setAttribute(`aria-disabled`,!1),this.removeClass(`vjs-at-live-edge`),this.controlText(`Seek to live, currently behind live`))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,`liveedgechange`,this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}yc.prototype.controlText_=`Seek to live, currently playing live`,q.registerComponent(`SeekToLive`,yc);function bc(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}var xc=Object.freeze({__proto__:null,clamp:bc});class Sc extends q{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on(`mousedown`,this.handleMouseDown_),this.on(`touchstart`,this.handleMouseDown_),this.on(`keydown`,this.handleKeyDown_),this.on(`click`,this.handleClick_),this.on(this.player_,`controlsvisible`,this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass(`disabled`),this.setAttribute(`tabindex`,0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off(`mousedown`,this.handleMouseDown_),this.off(`touchstart`,this.handleMouseDown_),this.off(`keydown`,this.handleKeyDown_),this.off(`click`,this.handleClick_),this.off(this.player_,`controlsvisible`,this.update_),this.off(e,`mousemove`,this.handleMouseMove_),this.off(e,`mouseup`,this.handleMouseUp_),this.off(e,`touchmove`,this.handleMouseMove_),this.off(e,`touchend`,this.handleMouseUp_),this.removeAttribute(`tabindex`),this.addClass(`disabled`),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className+=` vjs-slider`,t=Object.assign({tabIndex:0},t),n=Object.assign({role:`slider`,"aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;e.type===`mousedown`&&e.preventDefault(),e.type===`touchstart`&&!qi&&e.preventDefault(),Da(),this.addClass(`vjs-sliding`),this.trigger(`slideractive`),this.on(t,`mousemove`,this.handleMouseMove_),this.on(t,`mouseup`,this.handleMouseUp_),this.on(t,`touchmove`,this.handleMouseMove_),this.on(t,`touchend`,this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;Oa(),this.removeClass(`vjs-sliding`),this.trigger(`sliderinactive`),this.off(t,`mousemove`,this.handleMouseMove_),this.off(t,`mouseup`,this.handleMouseUp_),this.off(t,`touchmove`,this.handleMouseMove_),this.off(t,`touchend`,this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame(`Slider#update`,()=>{let t=this.vertical()?`height`:`width`;this.bar.el().style[t]=(e*100).toFixed(2)+`%`})),e}getProgress(){return Number(bc(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=ja(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?r&&e.key===`ArrowLeft`||!r&&e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key===`ArrowRight`||!r&&e.key===`ArrowUp`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key===`ArrowUp`||e.key===`ArrowRight`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass(`vjs-slider-vertical`):this.addClass(`vjs-slider-horizontal`)}}q.registerComponent(`Slider`,Sc);const Cc=(e,t)=>bc(e/t*100,0,100).toFixed(2)+`%`;class wc extends q{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,`progress`,e=>this.update(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-load-progress`}),t=G(`span`,{className:`vjs-control-text`}),n=G(`span`,{textContent:this.localize(`Loaded`)}),r=F.createTextNode(`: `);return this.percentageEl_=G(`span`,{className:`vjs-control-text-loaded-percentage`,textContent:`0%`}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame(`LoadProgressBar#update`,()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,a=Cc(r,n);this.percent_!==a&&(this.el_.style.width=a,ga(this.percentageEl_,a),this.percent_=a);for(let e=0;e<t.length;e++){let n=t.start(e),a=t.end(e),o=i[e];o||(o=this.el_.appendChild(G()),i[e]=o),(o.dataset.start!==n||o.dataset.end!==a)&&(o.dataset.start=n,o.dataset.end=a,o.style.left=Cc(n,r),o.style.width=Cc(a-n,r))}for(let e=i.length;e>t.length;e--)this.el_.removeChild(i[e-1]);i.length=t.length})}}q.registerComponent(`LoadProgressBar`,wc);class Tc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-time-tooltip`},{"aria-hidden":`true`})}update(e,t,n){let r=Aa(this.el_),i=ka(this.player_.el()),a=e.width*t;if(!i||!r)return;let o=e.left-i.left+a,s=e.width-a+(i.right-e.right);s||(s=e.width-a,o=a);let c=r.width/2;o<c?c+=c-o:s<c&&(c=s),c<0?c=0:c>r.width&&(c=r.width),c=Math.round(c),this.el_.style.right=`-${c}px`,this.write(n)}write(e){ga(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame(`TimeTooltip#updateTime`,()=>{let i,a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?``:`-`)+Ho(n,e)}else i=Ho(n,a);this.update(e,t,i),r&&r()})}}q.registerComponent(`TimeTooltip`,Tc);class Ec extends q{constructor(e,t){super(e,t),this.setIcon(`circle`),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-play-progress vjs-slider-bar`},{"aria-hidden":`true`})}update(e,t,n){let r=this.getChild(`timeTooltip`);if(!r)return;let i=n&&n.target&&typeof n.target.pendingSeekTime==`function`?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,i)}}Ec.prototype.options_={children:[]},!sa&&!Hi&&Ec.prototype.options_.children.push(`timeTooltip`),q.registerComponent(`PlayProgressBar`,Ec);class Dc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t){let n=t*this.player_.duration();this.getChild(`timeTooltip`).updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}}Dc.prototype.options_={children:[`timeTooltip`]},q.registerComponent(`MouseTimeDisplay`,Dc);class Oc extends Sc{constructor(e,t){t=W(Oc.prototype.options_,t),t.children=[...t.children];let n=e.options_.disableSeekWhileScrubbingOnMobile&&(sa||Hi)||e.options_.disableSeekWhileScrubbingOnSTV;(!sa&&!Hi||n)&&t.children.splice(1,0,`mouseTimeDisplay`),super(e,t),this.shouldDisableSeekWhileScrubbing_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=K(this,this.update),this.update=fo(this.update_,30),this.on(this.player_,[`durationchange`,`timeupdate`],this.update),this.on(this.player_,[`ended`],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,`liveedgechange`,this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,[`playing`],this.enableIntervalHandler_),this.on(this.player_,[`ended`,`pause`,`waiting`],this.disableIntervalHandler_),`hidden`in F&&`visibilityState`in F&&this.on(F,`visibilitychange`,this.toggleVisibility_)}toggleVisibility_(e){F.visibilityState===`hidden`?(this.cancelNamedAnimationFrame(`SeekBar#update`),this.cancelNamedAnimationFrame(`Slider#update`),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||=this.setInterval(this.update,30)}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!==`ended`||(this.updateInterval&&=(this.clearInterval(this.updateInterval),null))}createEl(){return super.createEl(`div`,{className:`vjs-progress-holder`},{"aria-label":this.localize(`Progress Bar`)})}update(e){if(F.visibilityState===`hidden`)return;let t=super.update();return this.requestNamedAnimationFrame(`SeekBar#update`,()=>{let n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker,i=this.player_.duration();r&&r.isLive()&&(i=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute(`aria-valuenow`,(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==n||this.duration_!==i)&&(this.el_.setAttribute(`aria-valuetext`,this.localize(`progress bar timing: currentTime={1} duration={2}`,[Ho(n,i),Ho(i,i)],`{1} of {2}`)),this.currentTime_=n,this.duration_=i),this.bar&&this.bar.update(ka(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0){if(e!==null){let t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null}return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();let e=this.getCurrentTime_(),t,n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){La(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!La(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n,r=this.calculateDistance(e),i=this.player_.liveTracker;if(!i||!i.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);else{if(r>=.99){i.seekToLiveEdge();return}let e=i.seekableStart(),t=i.liveCurrentTime();if(n=e+r*i.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild(`mouseTimeDisplay`);e&&e.show()}disable(){super.disable();let e=this.getChild(`mouseTimeDisplay`);e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0}),this.videoWasPlaying?qo(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=this.pendingSeekTime()===null?this.player_.currentTime():this.pendingSeekTime();this.pendingSeekTime(t+e),this.player_.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(e.key===` `||e.key===`Enter`)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key===`Home`)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key===`End`)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let n=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key===`PageDown`?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key===`PageUp`?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,[`durationchange`,`timeupdate`],this.update),this.off(this.player_,[`ended`],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,`liveedgechange`,this.update),this.off(this.player_,[`playing`],this.enableIntervalHandler_),this.off(this.player_,[`ended`,`pause`,`waiting`],this.disableIntervalHandler_),`hidden`in F&&`visibilityState`in F&&this.off(F,`visibilitychange`,this.toggleVisibility_),super.dispose()}}Oc.prototype.options_={children:[`loadProgressBar`,`playProgressBar`],barName:`playProgressBar`,stepSeconds:5,pageMultiplier:12},q.registerComponent(`SeekBar`,Oc);class kc extends q{constructor(e,t){super(e,t),this.handleMouseMove=fo(K(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=fo(K(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl(`div`,{className:`vjs-progress-control vjs-control`})}handleMouseMove(e){let t=this.getChild(`seekBar`);if(!t)return;let n=t.getChild(`playProgressBar`),r=t.getChild(`mouseTimeDisplay`);if(!n&&!r)return;let i=t.el(),a=Aa(i),o=ja(i,e).x;o=bc(o,0,1),r&&r.update(a,o),n&&n.update(a,t.getProgress())}handleMouseSeek(e){let t=this.getChild(`seekBar`);t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off([`mousedown`,`touchstart`],this.handleMouseDownHandler_),this.off(this.el_,[`mousemove`,`touchmove`],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass(`disabled`),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild(`seekBar`);this.player_.scrubbing(!1),e.videoWasPlaying&&qo(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on([`mousedown`,`touchstart`],this.handleMouseDownHandler_),this.on(this.el_,[`mousemove`,`touchmove`],this.handleMouseMove),this.removeClass(`disabled`),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,`mousemove`,this.throttledHandleMouseSeek),this.off(e,`touchmove`,this.throttledHandleMouseSeek),this.off(e,`mouseup`,this.handleMouseUpHandler_),this.off(e,`touchend`,this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,n=this.getChild(`seekBar`);n&&n.handleMouseDown(e),this.on(t,`mousemove`,this.throttledHandleMouseSeek),this.on(t,`touchmove`,this.throttledHandleMouseSeek),this.on(t,`mouseup`,this.handleMouseUpHandler_),this.on(t,`touchend`,this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild(`seekBar`);t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}kc.prototype.options_={children:[`seekBar`]},q.registerComponent(`ProgressControl`,kc);class Ac extends lc{constructor(e,t){super(e,t),this.setIcon(`picture-in-picture-enter`),this.on(e,[`enterpictureinpicture`,`leavepictureinpicture`],e=>this.handlePictureInPictureChange(e)),this.on(e,[`disablepictureinpicturechanged`,`loadedmetadata`],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,[`loadedmetadata`,`audioonlymodechange`,`audiopostermodechange`],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)===`audio`||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){F.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&`documentPictureInPicture`in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon(`picture-in-picture-exit`),this.controlText(`Exit Picture-in-Picture`)):(this.setIcon(`picture-in-picture-enter`),this.controlText(`Picture-in-Picture`)),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof F.exitPictureInPicture==`function`&&super.show()}}Ac.prototype.controlText_=`Picture-in-Picture`,q.registerComponent(`PictureInPictureToggle`,Ac);class jc extends lc{constructor(e,t){super(e,t),this.setIcon(`fullscreen-enter`),this.on(e,`fullscreenchange`,e=>this.handleFullscreenChange(e)),F[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText(`Exit Fullscreen`),this.setIcon(`fullscreen-exit`)):(this.controlText(`Fullscreen`),this.setIcon(`fullscreen-enter`))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}jc.prototype.controlText_=`Fullscreen`,q.registerComponent(`FullscreenToggle`,jc);const Mc=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresVolumeControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})};class Nc extends q{createEl(){let e=super.createEl(`div`,{className:`vjs-volume-level`});return this.setIcon(`circle`,e),e.appendChild(super.createEl(`span`,{className:`vjs-control-text`})),e}}q.registerComponent(`VolumeLevel`,Nc);class Pc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-volume-tooltip`},{"aria-hidden":`true`})}update(e,t,n,r){if(!n){let n=ka(this.el_),r=ka(this.player_.el()),i=e.width*t;if(!r||!n)return;let a=e.left-r.left+i,o=e.width-i+(r.right-e.right),s=n.width/2;a<s?s+=s-a:o<s&&(s=o),s<0?s=0:s>n.width&&(s=n.width),this.el_.style.right=`-${s}px`}this.write(`${r}%`)}write(e){ga(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame(`VolumeLevelTooltip#updateVolume`,()=>{this.update(e,t,n,r.toFixed(0)),i&&i()})}}q.registerComponent(`VolumeLevelTooltip`,Pc);class Fc extends q{constructor(e,t){super(e,t),this.update=fo(K(this,this.update),30)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t,n){let r=100*t;this.getChild(`volumeLevelTooltip`).updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Fc.prototype.options_={children:[`volumeLevelTooltip`]},q.registerComponent(`MouseVolumeLevelDisplay`,Fc);class Ic extends Sc{constructor(e,t){super(e,t),this.on(`slideractive`,e=>this.updateLastVolume_(e)),this.on(e,`volumechange`,e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl(`div`,{className:`vjs-volume-bar vjs-slider-bar`},{"aria-label":this.localize(`Volume Level`),"aria-live":`polite`})}handleMouseDown(e){La(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild(`mouseVolumeLevelDisplay`);if(t){let n=this.el(),r=ka(n),i=this.vertical(),a=ja(n,e);a=i?a.y:a.x,a=bc(a,0,1),t.update(r,a,i)}La(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute(`aria-valuenow`,t),this.el_.setAttribute(`aria-valuetext`,t+`%`)}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){let e=this.player_.volume();this.one(`sliderinactive`,()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Ic.prototype.options_={children:[`volumeLevel`],barName:`volumeLevel`},!sa&&!Hi&&Ic.prototype.options_.children.splice(0,0,`mouseVolumeLevelDisplay`),Ic.prototype.playerEvent=`volumechange`,q.registerComponent(`VolumeBar`,Ic);class Lc extends q{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||Ii(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Mc(this,e),this.throttledHandleMouseMove=fo(K(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on(`mousedown`,e=>this.handleMouseDown(e)),this.on(`touchstart`,e=>this.handleMouseDown(e)),this.on(`mousemove`,e=>this.handleMouseMove(e)),this.on(this.volumeBar,[`focus`,`slideractive`],()=>{this.volumeBar.addClass(`vjs-slider-active`),this.addClass(`vjs-slider-active`),this.trigger(`slideractive`)}),this.on(this.volumeBar,[`blur`,`sliderinactive`],()=>{this.volumeBar.removeClass(`vjs-slider-active`),this.removeClass(`vjs-slider-active`),this.trigger(`sliderinactive`)})}createEl(){let e=`vjs-volume-horizontal`;return this.options_.vertical&&(e=`vjs-volume-vertical`),super.createEl(`div`,{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,`mousemove`,this.throttledHandleMouseMove),this.on(t,`touchmove`,this.throttledHandleMouseMove),this.on(t,`mouseup`,this.handleMouseUpHandler_),this.on(t,`touchend`,this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,`mousemove`,this.throttledHandleMouseMove),this.off(t,`touchmove`,this.throttledHandleMouseMove),this.off(t,`mouseup`,this.handleMouseUpHandler_),this.off(t,`touchend`,this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Lc.prototype.options_={children:[`volumeBar`]},q.registerComponent(`VolumeControl`,Lc);const Rc=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresMuteControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})};class zc extends lc{constructor(e,t){super(e,t),Rc(this,e),this.on(e,[`loadstart`,`volumechange`],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),n=this.player_.lastVolume_();if(t===0){let e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon(`volume-high`),sa&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon(`volume-mute`),t=0):e<.33?(this.setIcon(`volume-low`),t=1):e<.67&&(this.setIcon(`volume-medium`),t=2),ba(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?` `:``}vjs-vol-${t}`,``)),ya(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||this.player_.volume()===0?`Unmute`:`Mute`;this.controlText()!==e&&this.controlText(e)}}zc.prototype.controlText_=`Mute`,q.registerComponent(`MuteToggle`,zc);class Bc extends q{constructor(e,t={}){t.inline=t.inline===void 0||t.inline,(t.volumeControl===void 0||Ii(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,[`loadstart`],e=>this.volumePanelState_(e)),this.on(this.muteToggle,`keyup`,e=>this.handleKeyPress(e)),this.on(this.volumeControl,`keyup`,e=>this.handleVolumeControlKeyUp(e)),this.on(`keydown`,e=>this.handleKeyPress(e)),this.on(`mouseover`,e=>this.handleMouseOver(e)),this.on(`mouseout`,e=>this.handleMouseOut(e)),this.on(this.volumeControl,[`slideractive`],this.sliderActive_),this.on(this.volumeControl,[`sliderinactive`],this.sliderInactive_)}sliderActive_(){this.addClass(`vjs-slider-active`)}sliderInactive_(){this.removeClass(`vjs-slider-active`)}volumePanelState_(){this.volumeControl.hasClass(`vjs-hidden`)&&this.muteToggle.hasClass(`vjs-hidden`)&&this.addClass(`vjs-hidden`),this.volumeControl.hasClass(`vjs-hidden`)&&!this.muteToggle.hasClass(`vjs-hidden`)&&this.addClass(`vjs-mute-toggle-only`)}createEl(){let e=`vjs-volume-panel-horizontal`;return this.options_.inline||(e=`vjs-volume-panel-vertical`),super.createEl(`div`,{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key===`Escape`&&this.muteToggle.focus()}handleMouseOver(e){this.addClass(`vjs-hover`),ao(F,`keyup`,this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass(`vjs-hover`),oo(F,`keyup`,this.handleKeyPressHandler_)}handleKeyPress(e){e.key===`Escape`&&this.handleMouseOut()}}Bc.prototype.options_={children:[`muteToggle`,`volumeControl`]},q.registerComponent(`VolumePanel`,Bc);class Vc extends lc{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize(`Skip forward {1} seconds`,[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration(),i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip forward {1} seconds`,[this.skipTime]))}}Vc.prototype.controlText_=`Skip Forward`,q.registerComponent(`SkipForward`,Vc);class Hc extends lc{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize(`Skip backward {1} seconds`,[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart(),i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip backward {1} seconds`,[this.skipTime]))}}Hc.prototype.controlText_=`Skip Backward`,q.registerComponent(`SkipBackward`,Hc);class Uc extends q{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on(`keydown`,e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof q&&(this.on(e,`blur`,this.boundHandleBlur_),this.on(e,[`tap`,`click`],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof q&&(this.off(e,`blur`,this.boundHandleBlur_),this.off(e,[`tap`,`click`],this.boundHandleTapClick_))}removeChild(e){typeof e==`string`&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||`ul`;this.contentEl_=G(e,{className:`vjs-menu-content`}),this.contentEl_.setAttribute(`role`,`menu`);let t=super.createEl(`div`,{append:this.contentEl_,className:`vjs-menu`});return t.appendChild(this.contentEl_),ao(t,`click`,function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||F.activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let n=t.filter(t=>t.el()===e.target)[0];if(!n)return;n.name()!==`CaptionSettingsMenuItem`&&this.menuButton_.focus()}}handleKeyDown(e){e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key===`ArrowRight`||e.key===`ArrowUp`)&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){let t=this.children().slice();t.length&&t[0].hasClass(`vjs-menu-title`)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}q.registerComponent(`Menu`,Uc);class Wc extends q{constructor(e,t={}){super(e,t),this.menuButton_=new lc(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute(`aria-haspopup`,`true`);let n=lc.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+` `+n,this.menuButton_.removeClass(`vjs-control`),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,`tap`,r),this.on(this.menuButton_,`click`,r),this.on(this.menuButton_,`keydown`,e=>this.handleKeyDown(e)),this.on(this.menuButton_,`mouseenter`,()=>{this.addClass(`vjs-hover`),this.menu.show(),ao(F,`keyup`,this.handleMenuKeyUp_)}),this.on(`mouseleave`,e=>this.handleMouseLeave(e)),this.on(`keydown`,e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute(`aria-expanded`,`false`),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute(`role`)):(this.show(),this.menu.contentEl_.setAttribute(`role`,`menu`))}createMenu(){let e=new Uc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=G(`li`,{className:`vjs-menu-title`,textContent:jo(this.options_.title),tabIndex:-1}),n=new q(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl(`div`,{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e=`vjs-menu-button`;this.options_.inline===!0?e+=`-inline`:e+=`-popup`;let t=lc.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e=`vjs-menu-button`;return this.options_.inline===!0?e+=`-inline`:e+=`-popup`,`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass(`vjs-hover`),oo(F,`keyup`,this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key===`Escape`||e.key===`Tab`?(this.buttonPressed_&&this.unpressButton(),!e.key===`Tab`&&(e.preventDefault(),this.menuButton_.focus())):e.key!==`Up`&&(e.key!==`Down`||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){(e.key===`Escape`||e.key===`Tab`)&&this.removeClass(`vjs-hover`)}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key===`Escape`||e.key===`Tab`)&&(this.buttonPressed_&&this.unpressButton(),!e.key===`Tab`&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute(`aria-expanded`,`true`),sa&&ma())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute(`aria-expanded`,`false`))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass(`vjs-disabled`),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass(`vjs-disabled`),this.menuButton_.enable()}}q.registerComponent(`MenuButton`,Wc);class Gc extends Wc{constructor(e,t){let n=t.tracks;super(e,t),this.items.length<=1&&this.hide(),n&&(this.updateHandler_=K(this,this.update),this.cleanupHandler_=K(this,this.cleanupTrackListeners_),n.addEventListener(`removetrack`,this.updateHandler_),n.addEventListener(`addtrack`,this.updateHandler_),n.addEventListener(`labelchange`,this.updateHandler_),this.player_.on(`ready`,this.updateHandler_),this.player_.on(`dispose`,this.cleanupHandler_))}cleanupTrackListeners_(){if(!this.updateHandler_)return;let e=this.options_.tracks;e&&(e.removeEventListener(`removetrack`,this.updateHandler_),e.removeEventListener(`addtrack`,this.updateHandler_),e.removeEventListener(`labelchange`,this.updateHandler_)),this.player_&&(this.player_.off(`ready`,this.updateHandler_),this.player_.off(`dispose`,this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}dispose(){this.cleanupTrackListeners_(),super.dispose()}}q.registerComponent(`TrackButton`,Gc);class Kc extends $s{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute(`role`,`menuitemcheckbox`):this.el_.setAttribute(`role`,`menuitemradio`):this.el_.setAttribute(`role`,`menuitem`)}createEl(e,t,n){this.nonIconControl=!0;let r=super.createEl(`li`,Object.assign({className:`vjs-menu-item`,tabIndex:-1},t),n),i=G(`span`,{className:`vjs-menu-item-text`,textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(i):r.replaceChild(i,r.querySelector(`.vjs-icon-placeholder`)),r}handleKeyDown(e){[`Tab`,`Escape`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`ArrowDown`].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass(`vjs-selected`),this.el_.setAttribute(`aria-checked`,`true`),this.controlText(`, selected`),this.isSelected_=!0):(this.removeClass(`vjs-selected`),this.el_.setAttribute(`aria-checked`,`false`),this.controlText(``),this.isSelected_=!1))}}q.registerComponent(`MenuItem`,Kc);class qc extends Kc{constructor(e,t){let n=t.track,r=e.textTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.mode===`showing`,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let i=(...e)=>{this.handleTracksChange.apply(this,e)},a=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on([`loadstart`,`texttrackchange`],i),r.addEventListener(`change`,i),r.addEventListener(`selectedlanguagechange`,a),this.on(`dispose`,function(){e.off([`loadstart`,`texttrackchange`],i),r.removeEventListener(`change`,i),r.removeEventListener(`selectedlanguagechange`,a)}),r.onchange===void 0){let e;this.on([`tap`,`click`],function(){if(typeof x.Event!=`object`)try{e=new x.Event(`change`)}catch{}e||(e=F.createEvent(`Event`),e.initEvent(`change`,!0,!0)),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let e=0;e<n.length;e++){let r=n[e];this.kinds.indexOf(r.kind)!==-1&&(r===t?r.mode!==`showing`&&(r.mode=`showing`):r.mode!==`disabled`&&(r.mode=`disabled`))}}handleTracksChange(e){let t=this.track.mode===`showing`;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode===`showing`){let e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}q.registerComponent(`TextTrackMenuItem`,qc);class Jc extends qc{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:`disabled`},t.kinds||=[t.kind],t.label?t.track.label=t.label:t.track.label=t.kinds.join(` and `)+` off`,t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if([`captions`,`descriptions`,`subtitles`].indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(`.vjs-menu-item-text`).textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}q.registerComponent(`OffTextTrackMenuItem`,Jc);class Yc extends Gc{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=qc){let n;this.label_&&(n=`${this.label_} off`),e.push(new Jc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){let i=r[n];if(this.kinds_.indexOf(i.kind)>-1){let n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}}q.registerComponent(`TextTrackButton`,Yc);class Xc extends Kc{constructor(e,t){let n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}q.registerComponent(`ChaptersTrackMenuItem`,Xc);class Zc extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`chapters`),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!==`chapters`)return;let t=this.findChaptersTrack();t===this.track_?(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update():(this.setTrack(t),super.update())}setTrack(e){if(this.track_!==e){if(this.updateHandler_||=this.update.bind(this),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener(`load`,this.updateHandler_),this.track_.removeEventListener(`cuechange`,this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode=`hidden`;let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener(`load`,this.updateHandler_),this.track_.addEventListener(`cuechange`,this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(jo(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){let r=t[n],i=new Xc(this.player_,{track:this.track_,cue:r});e.push(i)}return e}}Zc.prototype.kind_=`chapters`,Zc.prototype.controlText_=`Chapters`,q.registerComponent(`ChaptersButton`,Zc);class Qc extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`audio-description`);let r=e.textTracks(),i=K(this,this.handleTracksChange);r.addEventListener(`change`,i),this.on(`dispose`,function(){r.removeEventListener(`change`,i)})}handleTracksChange(e){let t=this.player().textTracks(),n=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&r.mode===`showing`){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Qc.prototype.kind_=`descriptions`,Qc.prototype.controlText_=`Descriptions`,q.registerComponent(`DescriptionsButton`,Qc);class $c extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`subtitles`)}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}$c.prototype.kind_=`subtitles`,$c.prototype.controlText_=`Subtitles`,q.registerComponent(`SubtitlesButton`,$c);class el extends qc{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+` settings`,selectable:!1,default:!1,mode:`disabled`},t.selectable=!1,t.name=`CaptionSettingsMenuItem`,super(e,t),this.addClass(`vjs-texttrack-settings`),this.controlText(`, opens `+t.kind+` settings dialog`)}handleClick(e){this.player().getChild(`textTrackSettings`).open()}handleLanguagechange(){this.$(`.vjs-menu-item-text`).textContent=this.player_.localize(this.options_.kind+` settings`),super.handleLanguagechange()}}q.registerComponent(`CaptionSettingsMenuItem`,el);class tl extends Yc{constructor(e,t,n){super(e,t,n),this.setIcon(`captions`)}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild(`textTrackSettings`)&&(e.push(new el(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}tl.prototype.kind_=`captions`,tl.prototype.controlText_=`Captions`,q.registerComponent(`CaptionsButton`,tl);class nl extends qc{createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return this.options_.track.kind===`captions`&&(this.player_.options_.experimentalSvgIcons?this.setIcon(`captions`,r):i.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(G(`span`,{className:`vjs-control-text`,textContent:` ${this.localize(`Captions`)}`}))),r}}q.registerComponent(`SubsCapsMenuItem`,nl);class rl extends Yc{constructor(e,t={}){super(e,t),this.label_=`subtitles`,this.setIcon(`subtitles`),[`en`,`en-us`,`en-ca`,`fr-ca`].indexOf(this.player_.language_)>-1&&(this.label_=`captions`,this.setIcon(`captions`)),this.menuButton_.controlText(jo(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild(`textTrackSettings`)&&(e.push(new el(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,nl),e}}rl.prototype.kinds_=[`captions`,`subtitles`],rl.prototype.controlText_=`Subtitles`,q.registerComponent(`SubsCapsButton`,rl);class il extends Kc{constructor(e,t){let n=t.track,r=e.audioTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);let i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener(`change`,i),this.on(`dispose`,()=>{r.removeEventListener(`change`,i)})}createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return[`main-desc`,`descriptions`,`description`].indexOf(this.options_.track.kind)>=0&&(i.appendChild(G(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(G(`span`,{className:`vjs-control-text`,textContent:` `+this.localize(`Descriptions`)}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let n=e[t];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}q.registerComponent(`AudioTrackMenuItem`,il);class al extends Gc{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon(`audio`)}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;let t=this.player_.audioTracks();for(let n=0;n<t.length;n++){let r=t[n];e.push(new il(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}al.prototype.controlText_=`Audio Track`,q.registerComponent(`AudioTrackButton`,al);class ol extends Kc{constructor(e,t){let n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,`ratechange`,e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ol.prototype.contentElType=`button`,q.registerComponent(`PlaybackRateMenuItem`,ol);class sl extends Wc{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute(`aria-describedby`,this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,`loadstart`,e=>this.updateVisibility(e)),this.on(e,`ratechange`,e=>this.updateLabel(e)),this.on(e,`playbackrateschange`,e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_=`vjs-playback-rate-value-label-`+this.id_,this.labelEl_=G(`div`,{className:`vjs-playback-rate-value`,id:this.labelElId_,textContent:`1x`}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new ol(this.player(),{rate:e[n]+`x`}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass(`vjs-hidden`):this.addClass(`vjs-hidden`)}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+`x`)}}sl.prototype.controlText_=`Playback Rate`,q.registerComponent(`PlaybackRateMenuButton`,sl);class cl extends q{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e=`div`,t={},n={}){return t.className||=this.buildCSSClass(),super.createEl(e,t,n)}}q.registerComponent(`Spacer`,cl);class ll extends cl{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl(`div`,{className:this.buildCSSClass(),textContent:`\xA0`})}}q.registerComponent(`CustomControlSpacer`,ll);class ul extends q{createEl(){return super.createEl(`div`,{className:`vjs-control-bar`,dir:`ltr`})}}ul.prototype.options_={children:[`playToggle`,`skipBackward`,`skipForward`,`volumePanel`,`currentTimeDisplay`,`timeDivider`,`durationDisplay`,`progressControl`,`liveDisplay`,`seekToLive`,`remainingTimeDisplay`,`customControlSpacer`,`playbackRateMenuButton`,`chaptersButton`,`descriptionsButton`,`subsCapsButton`,`audioTrackButton`,`pictureInPictureToggle`,`fullscreenToggle`]},q.registerComponent(`ControlBar`,ul);class dl extends Zo{constructor(e,t){super(e,t),this.on(e,`error`,e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):``}}dl.prototype.options_=Object.assign({},Zo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),q.registerComponent(`ErrorDisplay`,dl);class fl extends q{constructor(e,t={}){super(e,t),this.el_.setAttribute(`aria-labelledby`,this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(` `).trim(),G(`select`,{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Qa()}`)+`-`+e[1].replace(/\W+/g,``),n=G(`option`,{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return n.setAttribute(`aria-labelledby`,`${this.selectLabelledbyIds} ${t}`),n}))}}q.registerComponent(`TextTrackSelect`,fl);class pl extends q{constructor(e,t={}){super(e,t);let n=G(`legend`,{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);let r=this.options_.selects;for(let t of r){let n=this.options_.selectConfigs[t],r=n.className,i=n.id.replace(`%s`,this.options_.id_),a=null,o=`vjs_select_${Qa()}`;if(this.options_.type===`colors`){a=G(`span`,{className:r});let e=G(`label`,{id:i,className:`vjs-label`,textContent:this.localize(n.label)});e.setAttribute(`for`,o),a.appendChild(e)}let s=new fl(e,{SelectOptions:n.options,legendId:this.options_.legendId,id:o,labelId:i});this.addChild(s),this.options_.type===`colors`&&(a.appendChild(s.el()),this.el().appendChild(a))}}createEl(){return G(`fieldset`,{className:this.options_.className})}}q.registerComponent(`TextTrackFieldset`,pl);class ml extends q{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new pl(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize(`Text`),className:`vjs-fg vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(r);let i=new pl(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize(`Text Background`),className:`vjs-bg vjs-track-setting`,selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(i);let a=new pl(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize(`Caption Area Background`),className:`vjs-window vjs-track-setting`,selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(a)}createEl(){return G(`div`,{className:`vjs-track-settings-colors`})}}q.registerComponent(`TextTrackSettingsColors`,ml);class hl extends q{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new pl(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:`Font Size`,className:`vjs-font-percent vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(r);let i=new pl(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize(`Text Edge Style`),className:`vjs-edge-style vjs-track-setting`,selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(i);let a=new pl(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize(`Font Family`),className:`vjs-font-family vjs-track-setting`,selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(a)}createEl(){return G(`div`,{className:`vjs-track-settings-font`})}}q.registerComponent(`TextTrackSettingsFont`,hl);class gl extends q{constructor(e,t={}){super(e,t);let n=new lc(e,{controlText:this.localize(`restore all settings to the default values`),className:`vjs-default-button`});n.el().classList.remove(`vjs-control`,`vjs-button`),n.el().textContent=this.localize(`Reset`),this.addChild(n);let r=this.localize(`Done`),i=new lc(e,{controlText:r,className:`vjs-done-button`});i.el().classList.remove(`vjs-control`,`vjs-button`),i.el().textContent=r,this.addChild(i)}createEl(){return G(`div`,{className:`vjs-track-settings-controls`})}}q.registerComponent(`TrackSettingsControls`,gl);const _l=`vjs-text-track-settings`,vl=[`#000`,`Black`],yl=[`#00F`,`Blue`],bl=[`#0FF`,`Cyan`],xl=[`#0F0`,`Green`],Sl=[`#F0F`,`Magenta`],Cl=[`#F00`,`Red`],wl=[`#FFF`,`White`],Tl=[`#FF0`,`Yellow`],El=[`1`,`Opaque`],Dl=[`0.5`,`Semi-Transparent`],Ol=[`0`,`Transparent`],kl={backgroundColor:{selector:`.vjs-bg-color > select`,id:`captions-background-color-%s`,label:`Color`,options:[vl,wl,Cl,xl,yl,Tl,Sl,bl],className:`vjs-bg-color`},backgroundOpacity:{selector:`.vjs-bg-opacity > select`,id:`captions-background-opacity-%s`,label:`Opacity`,options:[El,Dl,Ol],className:`vjs-bg-opacity vjs-opacity`},color:{selector:`.vjs-text-color > select`,id:`captions-foreground-color-%s`,label:`Color`,options:[wl,vl,Cl,xl,yl,Tl,Sl,bl],className:`vjs-text-color`},edgeStyle:{selector:`.vjs-edge-style > select`,id:``,label:`Text Edge Style`,options:[[`none`,`None`],[`raised`,`Raised`],[`depressed`,`Depressed`],[`uniform`,`Uniform`],[`dropshadow`,`Drop shadow`]]},fontFamily:{selector:`.vjs-font-family > select`,id:``,label:`Font Family`,options:[[`proportionalSansSerif`,`Proportional Sans-Serif`],[`monospaceSansSerif`,`Monospace Sans-Serif`],[`proportionalSerif`,`Proportional Serif`],[`monospaceSerif`,`Monospace Serif`],[`casual`,`Casual`],[`script`,`Script`],[`small-caps`,`Small Caps`]]},fontPercent:{selector:`.vjs-font-percent > select`,id:``,label:`Font Size`,options:[[`0.50`,`50%`],[`0.75`,`75%`],[`1.00`,`100%`],[`1.25`,`125%`],[`1.50`,`150%`],[`1.75`,`175%`],[`2.00`,`200%`],[`3.00`,`300%`],[`4.00`,`400%`]],default:2,parser:e=>e===`1.00`?null:Number(e)},textOpacity:{selector:`.vjs-text-opacity > select`,id:`captions-foreground-opacity-%s`,label:`Opacity`,options:[El,Dl],className:`vjs-text-opacity vjs-opacity`},windowColor:{selector:`.vjs-window-color > select`,id:`captions-window-color-%s`,label:`Color`,className:`vjs-window-color`},windowOpacity:{selector:`.vjs-window-opacity > select`,id:`captions-window-opacity-%s`,label:`Opacity`,options:[Ol,Dl,El],className:`vjs-window-opacity vjs-opacity`}};kl.windowColor.options=kl.backgroundColor.options;function Al(e,t){if(t&&(e=t(e)),e&&e!==`none`)return e}function jl(e,t){let n=e.options[e.options.selectedIndex].value;return Al(n,t)}function Ml(e,t,n){if(t){for(let r=0;r<e.options.length;r++)if(Al(e.options[r].value,n)===t){e.selectedIndex=r;break}}}class Nl extends Zo{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=G(`p`,{className:`vjs-control-text`,textContent:this.localize(`End of dialog window.`)}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new ml(e,{textTrackComponentid:this.id_,selectConfigs:kl,fieldSets:[[`color`,`textOpacity`],[`backgroundColor`,`backgroundOpacity`],[`windowColor`,`windowOpacity`]]});this.addChild(t);let n=new hl(e,{textTrackComponentid:this.id_,selectConfigs:kl,fieldSets:[[`fontPercent`],[`edgeStyle`],[`fontFamily`]]});this.addChild(n);let r=new gl(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(`.vjs-done-button`),[`click`,`tap`],()=>{this.saveSettings(),this.close()}),this.on(this.$(`.vjs-default-button`),[`click`,`tap`],()=>{this.setDefaults(),this.updateDisplay()}),Ni(kl,e=>{this.on(this.$(e.selector),`change`,this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize(`Caption Settings Dialog`)}description(){return this.localize(`Beginning of dialog window. Escape will cancel and close the window.`)}buildCSSClass(){return super.buildCSSClass()+` vjs-text-track-settings`}getValues(){return Pi(kl,(e,t,n)=>{let r=jl(this.$(t.selector),t.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){Ni(kl,(t,n)=>{Ml(this.$(t.selector),e[n],t.parser)})}setDefaults(){Ni(kl,e=>{let t=e.hasOwnProperty(`default`)?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem(_l))}catch(e){U.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem(_l,JSON.stringify(e)):x.localStorage.removeItem(_l)}catch(e){U.warn(e)}}updateDisplay(){let e=this.player_.getChild(`textTrackDisplay`);e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}q.registerComponent(`TextTrackSettings`,Nl);class Pl extends q{constructor(e,t){let n=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(n=!1);let r=W({createEl:!n,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=po(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){oo(this,`resize`,e),oo(this,`unload`,t),t=null};ao(this.el_.contentWindow,`unload`,t),ao(this.el_.contentWindow,`resize`,e)},this.one(`load`,this.loadListener_))}createEl(){return super.createEl(`iframe`,{className:`vjs-resize-manager`,tabIndex:-1,title:this.localize(`No content`)},{"aria-hidden":`true`})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger(`playerresize`)}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off(`load`,this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}q.registerComponent(`ResizeManager`,Pl);const Fl={trackingThreshold:20,liveTolerance:15};class Il extends q{constructor(e,t){let n=W(Fl,t,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,`durationchange`,e=>this.handleDurationchange(e)),this.on(this.player_,`canplay`,()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(x.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;let r=this.liveCurrentTime(),i=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-i)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger(`liveedgechange`))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass(`vjs-liveui`),this.startTracking()):(this.player_.removeClass(`vjs-liveui`),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||=this.player_.hasStarted(),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,[`play`,`pause`],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,`seeked`,this.handleSeeked_):(this.one(this.player_,`play`,this.handlePlay_),this.one(this.player_,`timeupdate`,this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,`seeked`,this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,`timeupdate`,this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,[`play`,`pause`],this.trackLiveHandler_),this.off(this.player_,`seeked`,this.handleSeeked_),this.off(this.player_,`play`,this.handlePlay_),this.off(this.player_,`timeupdate`,this.handleFirstTimeupdate_),this.off(this.player_,`timeupdate`,this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger(`liveedgechange`))}seekableEnd(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==`number`}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}q.registerComponent(`LiveTracker`,Il);class Ll extends q{constructor(e,t){super(e,t),this.on(`statechanged`,e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:G(`div`,{className:`vjs-title-bar-title`,id:`vjs-title-bar-title-${Qa()}`}),description:G(`div`,{className:`vjs-title-bar-description`,id:`vjs-title-bar-description-${Qa()}`})},G(`div`,{className:`vjs-title-bar`},{},Li(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,n={title:`aria-labelledby`,description:`aria-describedby`};[`title`,`description`].forEach(e=>{let r=this.state[e],i=this.els[e],a=n[e];Na(i),r&&ga(i,r),t&&(t.removeAttribute(a),r&&t.setAttribute(a,i.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute(`aria-labelledby`),t.removeAttribute(`aria-describedby`)),super.dispose(),this.els=null}}q.registerComponent(`TitleBar`,Ll);const Rl={initialDisplay:4e3,position:[],takeFocus:!1};class zl extends lc{constructor(e,t){t=W(Rl,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,[`useractive`,`userinactive`],e=>{this.removeClass(`force-display`)})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(` `)}`}createEl(){let e=G(`button`,{},{type:`button`,class:this.buildCSSClass()},G(`span`));return this.controlTextEl_=e.querySelector(`span`),e}show(){super.show(),this.addClass(`force-display`),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass(`force-display`)},this.options_.initialDisplay)}hide(){this.removeClass(`force-display`),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}q.registerComponent(`TransientButton`,zl);const Bl=e=>{let t=e.el();if(t.hasAttribute(`src`))return e.triggerSourceset(t.src),!0;let n=e.$$(`source`),r=[],i=``;if(!n.length)return!1;for(let e=0;e<n.length;e++){let t=n[e].src;t&&r.indexOf(t)===-1&&r.push(t)}return r.length?(r.length===1&&(i=r[0]),e.triggerSourceset(i),!0):!1},Vl=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){let t=F.createElement(this.nodeName.toLowerCase());t.innerHTML=e;let n=F.createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText=``,x.Element.prototype.appendChild.call(this,n),this.innerHTML}}),Hl=(e,t)=>{let n={};for(let r=0;r<e.length&&(n=Object.getOwnPropertyDescriptor(e[r],t),!(n&&n.set&&n.get));r++);return n.enumerable=!0,n.configurable=!0,n},Ul=e=>Hl([e.el(),x.HTMLMediaElement.prototype,x.Element.prototype,Vl],`innerHTML`),Wl=function(e){let t=e.el();if(t.resetSourceWatch_)return;let n={},r=Ul(e),i=n=>(...r)=>{let i=n.apply(t,r);return Bl(e),i};[`append`,`appendChild`,`insertAdjacentHTML`].forEach(e=>{t[e]&&(n[e]=t[e],t[e]=i(n[e]))}),Object.defineProperty(t,"innerHTML",W(r,{set:i(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach(e=>{t[e]=n[e]}),Object.defineProperty(t,"innerHTML",r)},e.one(`sourceset`,t.resetSourceWatch_)},Gl=Object.defineProperty({},"src",{get(){return this.hasAttribute(`src`)?fs(x.Element.prototype.getAttribute.call(this,`src`)):``},set(e){return x.Element.prototype.setAttribute.call(this,`src`,e),e}}),Kl=e=>Hl([e.el(),x.HTMLMediaElement.prototype,Gl],`src`),ql=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let n=Kl(e),r=t.setAttribute,i=t.load;Object.defineProperty(t,"src",W(n,{set:r=>{let i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{let a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=()=>{let n=i.call(t);return Bl(e)||(e.triggerSourceset(``),Wl(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Bl(e)||Wl(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=i,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}};class Y extends J{constructor(e,t){super(e,t);let n=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName===`VIDEO`,n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,n=[];for(;t--;){let i=e[t];i.nodeName.toLowerCase()===`track`&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),!r&&!this.el_.hasAttribute(`crossorigin`)&&ms(i.src)&&(r=!0)):n.push(i))}for(let e=0;e<n.length;e++)this.el_.removeChild(n[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&U.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
161
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(aa||ta)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Y.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){ql(this)}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,n=()=>{t=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===`metadata`&&t.push({track:r,storedMode:r.mode})}};n(),e.addEventListener(`change`,n),this.on(`dispose`,()=>e.removeEventListener(`change`,n));let r=()=>{for(let e=0;e<t.length;e++){let n=t[e];n.track.mode===`disabled`&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}e.removeEventListener(`change`,r)};this.on(`webkitbeginfullscreen`,()=>{e.removeEventListener(`change`,n),e.removeEventListener(`change`,r),e.addEventListener(`change`,r)}),this.on(`webkitendfullscreen`,()=>{e.removeEventListener(`change`,n),e.addEventListener(`change`,n),e.removeEventListener(`change`,r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_(`Audio`,e)}overrideNativeVideoTracks(e){this.overrideNative_(`Video`,e)}proxyNativeTracksForType_(e){let t=Ss[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;let i={change:t=>{let n={type:`change`,target:r,currentTarget:r,srcElement:r};r.trigger(n),e===`text`&&this[Cs.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},a=function(){let e=[];for(let t=0;t<r.length;t++){let i=!1;for(let e=0;e<n.length;e++)if(n[e]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+`Listeners_`]=i,Object.keys(i).forEach(e=>{let t=i[e];n.addEventListener(e,t),this.on(`dispose`,r=>n.removeEventListener(e,t))}),this.on(`loadstart`,a),this.on(`dispose`,e=>this.off(`loadstart`,a))}proxyNativeTracks_(){Ss.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Y.disposeMediaElement(e),e=t}else{e=F.createElement(`video`);let t=W({},this.options_.tag&&Ca(this.options_.tag));aa&&this.options_.nativeControlsForTouch===!0||delete t.controls,Sa(e,Object.assign(t,{id:this.options_.techId,class:`vjs-tech`}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&Ta(e,`preload`,this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=[`loop`,`muted`,`playsinline`,`autoplay`];for(let n=0;n<t.length;n++){let r=t[n],i=this.options_[r];i!==void 0&&(i?Ta(e,r,r):Ea(e,r),e[r]=i)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let e=!1,t=function(){e=!0};this.on(`loadstart`,t);let n=function(){e||this.trigger(`loadstart`)};this.on(`loadedmetadata`,n),this.ready(function(){this.off(`loadstart`,t),this.off(`loadedmetadata`,n),e||this.trigger(`loadstart`)});return}let t=[`loadstart`];t.push(`loadedmetadata`),e.readyState>=2&&t.push(`loadeddata`),e.readyState>=3&&t.push(`canplay`),e.readyState>=4&&t.push(`canplaythrough`),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&ca?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){U(e,`Video is not ready. (Video.js)`)}}duration(){if(this.el_.duration===1/0&&Hi&&qi&&this.el_.currentTime===0){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger(`durationchange`),this.off(`timeupdate`,e))};return this.on(`timeupdate`,e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!(`webkitDisplayingFullscreen`in this.el_))return;let e=function(){this.trigger(`fullscreenchange`,{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){`webkitPresentationMode`in this.el_&&this.el_.webkitPresentationMode!==`picture-in-picture`&&(this.one(`webkitendfullscreen`,e),this.trigger(`fullscreenchange`,{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on(`webkitbeginfullscreen`,t),this.on(`dispose`,()=>{this.off(`webkitbeginfullscreen`,t),this.off(`webkitendfullscreen`,e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==`function`}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)qo(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger(`fullscreenerror`,Error(`The video is not fullscreen`))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return U.error(`Invalid source URL.`),!1;let n={src:e};t&&(n.type=t);let r=G(`source`,{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return U.error(`Source URL is required to remove the source element.`),!1;let t=this.el_.querySelectorAll(`source`);for(let n of t)if(n.src===e)return this.el_.removeChild(n),!0;return U.warn(`No matching source element found with src: ${e}`),!1}reset(){Y.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=F.createElement(`track`);return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$(`track`),n=t.length;for(;n--;)(e===t[n]||e===t[n].track)&&this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==`function`)return this.el().getVideoPlaybackQuality();let e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}Ri(Y,`TEST_VID`,function(){if(!fa())return;let e=F.createElement(`video`),t=F.createElement(`track`);return t.kind=`captions`,t.srclang=`en`,t.label=`English`,e.appendChild(t),e}),Y.isSupported=function(){try{Y.TEST_VID.volume=.5}catch{return!1}return!!(Y.TEST_VID&&Y.TEST_VID.canPlayType)},Y.canPlayType=function(e){return Y.TEST_VID.canPlayType(e)},Y.canPlaySource=function(e,t){return Y.canPlayType(e.type)},Y.canControlVolume=function(){try{let e=Y.TEST_VID.volume;Y.TEST_VID.volume=e/2+.1;let t=e!==Y.TEST_VID.volume;return t&&sa?(x.setTimeout(()=>{Y&&Y.prototype&&(Y.prototype.featuresVolumeControl=e!==Y.TEST_VID.volume)}),!1):t}catch{return!1}},Y.canMuteVolume=function(){try{let e=Y.TEST_VID.muted;return Y.TEST_VID.muted=!e,Y.TEST_VID.muted?Ta(Y.TEST_VID,`muted`,`muted`):Ea(Y.TEST_VID,`muted`,`muted`),e!==Y.TEST_VID.muted}catch{return!1}},Y.canControlPlaybackRate=function(){if(Hi&&qi&&Yi<58)return!1;try{let e=Y.TEST_VID.playbackRate;return Y.TEST_VID.playbackRate=e/2+.1,e!==Y.TEST_VID.playbackRate}catch{return!1}},Y.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(F.createElement(`video`),"src",{get:e,set:e}),Object.defineProperty(F.createElement(`audio`),"src",{get:e,set:e}),Object.defineProperty(F.createElement(`video`),"innerHTML",{get:e,set:e}),Object.defineProperty(F.createElement(`audio`),"innerHTML",{get:e,set:e})}catch{return!1}return!0},Y.supportsNativeTextTracks=function(){return ca||sa&&qi},Y.supportsNativeVideoTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.videoTracks)},Y.supportsNativeAudioTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.audioTracks)},Y.Events=[`loadstart`,`suspend`,`abort`,`error`,`emptied`,`stalled`,`loadedmetadata`,`loadeddata`,`canplay`,`canplaythrough`,`playing`,`waiting`,`seeking`,`seeked`,`ended`,`durationchange`,`timeupdate`,`progress`,`play`,`pause`,`ratechange`,`resize`,`volumechange`],[[`featuresMuteControl`,`canMuteVolume`],[`featuresPlaybackRate`,`canControlPlaybackRate`],[`featuresSourceset`,`canOverrideAttributes`],[`featuresNativeTextTracks`,`supportsNativeTextTracks`],[`featuresNativeVideoTracks`,`supportsNativeVideoTracks`],[`featuresNativeAudioTracks`,`supportsNativeAudioTracks`]].forEach(function([e,t]){Ri(Y.prototype,e,()=>Y[t](),!0)}),Y.prototype.featuresVolumeControl=Y.canControlVolume(),Y.prototype.movingMediaElementInDOM=!sa,Y.prototype.featuresFullscreenResize=!0,Y.prototype.featuresProgressEvents=!0,Y.prototype.featuresTimeupdateEvents=!0,Y.prototype.featuresVideoFrameCallback=!!(Y.TEST_VID&&Y.TEST_VID.requestVideoFrameCallback),Y.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()}},Y.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll(`source`),n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()},[`muted`,`defaultMuted`,`autoplay`,`controls`,`loop`,`playsinline`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),[`muted`,`defaultMuted`,`autoplay`,`loop`,`playsinline`].forEach(function(e){Y.prototype[`set`+jo(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),[`paused`,`currentTime`,`buffered`,`volume`,`poster`,`preload`,`error`,`seeking`,`seekable`,`ended`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`played`,`networkState`,`readyState`,`videoWidth`,`videoHeight`,`crossOrigin`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]}}),[`volume`,`src`,`poster`,`preload`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`crossOrigin`].forEach(function(e){Y.prototype[`set`+jo(e)]=function(t){this.el_[e]=t}}),[`pause`,`load`,`play`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]()}}),J.withSourceHandlers(Y),Y.nativeSourceHandler={},Y.nativeSourceHandler.canPlayType=function(e){try{return Y.TEST_VID.canPlayType(e)}catch{return``}},Y.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Y.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=ps(e.src);return Y.nativeSourceHandler.canPlayType(`video/${t}`)}return``},Y.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Y.nativeSourceHandler.dispose=function(){},Y.registerSourceHandler(Y.nativeSourceHandler),J.registerTech(`Html5`,Y);const Jl=[`progress`,`abort`,`suspend`,`emptied`,`stalled`,`loadedmetadata`,`loadeddata`,`timeupdate`,`resize`,`volumechange`,`texttrackchange`],Yl={canplay:`CanPlay`,canplaythrough:`CanPlayThrough`,playing:`Playing`,seeked:`Seeked`},Xl=[`tiny`,`xsmall`,`small`,`medium`,`large`,`xlarge`,`huge`],Zl={};Xl.forEach(e=>{let t=e.charAt(0)===`x`?`x-${e.substring(1)}`:e;Zl[e]=`vjs-layout-${t}`});const Ql={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class X extends q{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${Qa()}`,t=Object.assign(X.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let n=e.closest(`[lang]`);n&&(t.language=n.getAttribute(`lang`))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=Ai(this.id_),this.fsApi_=Ci,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error(`No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?`);if(this.tag=e,this.tagAttributes=e&&Ca(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(n){e[n.toLowerCase()]=t.languages[n]}),this.languages_=e}else this.languages_=X.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||``,this.controls_=!!t.controls,e.controls=!1,e.removeAttribute(`controls`),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute(`autoplay`)?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if(typeof this[e]!=`function`)throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Do(this,{eventBusKey:`el_`}),this.fsApi_.requestFullscreen&&(ao(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on([`playerreset`,`resize`],this.boundUpdateStyleEl_);let r=W(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=new x.DOMParser().parseFromString(Js,`image/svg+xml`);if(e.querySelector(`parsererror`))U.warn(`Failed to load SVG Icons. Falling back to Font Icons.`),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display=`none`,this.el_.appendChild(t),this.addClass(`vjs-svg-icons-enabled`)}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()===`audio`),this.controls()?this.addClass(`vjs-controls-enabled`):this.addClass(`vjs-controls-disabled`),this.el_.setAttribute(`role`,`region`),this.isAudio()?this.el_.setAttribute(`aria-label`,this.localize(`Audio Player`)):this.el_.setAttribute(`aria-label`,this.localize(`Video Player`)),this.isAudio()&&this.addClass(`vjs-audio`),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Zs(this),this.addClass(`vjs-spatial-navigation-enabled`)),aa&&this.addClass(`vjs-touch-enabled`),sa||this.addClass(`vjs-workinghover`),X.players[this.id_]=this;let i=_i.split(`.`)[0];this.addClass(`vjs-v${i}`),this.userActive(!0),this.reportUserActivity(),this.one(`play`,e=>this.listenForUserActivity_(e)),this.on(`keydown`,e=>this.handleKeyDown(e)),this.on(`languagechange`,e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on(`ready`,()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger(`dispose`),this.off(`dispose`),oo(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),oo(F,`keydown`,this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),X.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=``),this.playerElIngest_&&=null,this.tag&&=null,Bs(this),ws.names.forEach(e=>{let t=ws[e],n=this[t.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute(`data-vjs-player`),r=this.tag.tagName.toLowerCase()===`video-js`;n?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl(`div`));let i=Ca(e);if(r){for(t=this.el_=e,e=this.tag=F.createElement(`video`);t.children.length;)e.appendChild(t.firstChild);va(t,`video-js`)||ya(t,`video-js`),t.appendChild(e),n=this.playerElIngest_=t,Object.keys(t).forEach(n=>{try{e[n]=t[n]}catch{}})}e.setAttribute(`tabindex`,`-1`),i.tabindex=`-1`,qi&&$i&&(e.setAttribute(`role`,`application`),i.role=`application`),e.removeAttribute(`width`),e.removeAttribute(`height`),`width`in i&&delete i.width,`height`in i&&delete i.height,Object.getOwnPropertyNames(i).forEach(function(n){r&&n===`class`||t.setAttribute(n,i[n]),r&&e.setAttribute(n,i[n])}),e.playerId=e.id,e.id+=`_html5_api`,e.className=`vjs-tech`,e.player=t.player=this,this.addClass(`vjs-paused`);let a=[`IS_SMART_TV`,`IS_TIZEN`,`IS_WEBOS`,`IS_ANDROID`,`IS_IPAD`,`IS_IPHONE`,`IS_CHROMECAST_RECEIVER`].filter(e=>la[e]).map(e=>`vjs-device-`+e.substring(3).toLowerCase().replace(/\_/g,`-`));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ja(`vjs-styles-dimensions`);let e=Ra(`.vjs-styles-defaults`),t=Ra(`head`);t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let o=e.getElementsByTagName(`a`);for(let e=0;e<o.length;e++){let t=o.item(e);ya(t,`vjs-hidden`),t.setAttribute(`hidden`,`hidden`)}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(t,e),_a(e,t),this.children_.unshift(e),this.el_.setAttribute(`lang`,this.language_),this.el_.setAttribute(`translate`,`no`),this.el_=t,t}crossOrigin(e){if(e===void 0)return this.techGet_(`crossOrigin`);e!==null&&e!==`anonymous`&&e!==`use-credentials`?U.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):(this.techCall_(`setCrossOrigin`,e),this.posterImage&&this.posterImage.crossOrigin(e))}width(e){return this.dimension(`width`,e)}height(e){return this.dimension(`height`,e)}dimension(e,t){let n=e+`_`;if(t===void 0)return this[n]||0;if(t===``||t===`auto`){this[n]=void 0,this.updateStyleEl_();return}let r=parseFloat(t);isNaN(r)?U.error(`Improper value "${t}" supplied for for ${e}`):(this[n]=r,this.updateStyleEl_())}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,vo(this)&&this.off([`playerreset`,`resize`],this.boundUpdateStyleEl_),e?(this.addClass(`vjs-fluid`),this.fill(!1),yo(this,()=>{this.on([`playerreset`,`resize`],this.boundUpdateStyleEl_)})):this.removeClass(`vjs-fluid`),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass(`vjs-fill`),this.fluid(!1)):this.removeClass(`vjs-fill`)}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error(`Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.`);this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){let e=typeof this.width_==`number`?this.width_:this.options_.width,t=typeof this.height_==`number`?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();n&&(e>=0&&(n.width=e),t>=0&&(n.height=t));return}let e,t,n,r;n=this.aspectRatio_!==void 0&&this.aspectRatio_!==`auto`?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+`:`+this.videoHeight():`16:9`;let i=n.split(`:`),a=i[1]/i[0];e=this.width_===void 0?this.height_===void 0?this.videoWidth()||300:this.height_/a:this.width_,t=this.height_===void 0?e*a:this.height_,r=/^[^a-zA-Z]/.test(this.id())?`dimensions-`+this.id():this.id()+`-dimensions`,this.addClass(r),Ya(this.styleEl_,`
162
162
  .${r} {
163
163
  width: ${e}px;
164
164
  height: ${t}px;
@@ -167,9 +167,9 @@ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNati
167
167
  .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
168
168
  padding-top: ${a*100}%;
169
169
  }
170
- `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let n=jo(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!==`Html5`&&this.tag&&(J.getTech(`Html5`).disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();(typeof this.autoplay()==`string`||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(i=!1);let a={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_[`vtt.js`],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ws.names.forEach(e=>{let t=ws[e];a[t.getterName]=this[t.privateName]}),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);let o=J.getTech(e);if(!o)throw Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(K(this,this.handleTechReady_),!0),Yo.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Jl.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${jo(e)}_`](t))}),Object.keys(Yl).forEach(e=>{this.on(this.tech_,e,t=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Yl[e]}_`].bind(this),event:t}):this[`handleTech${Yl[e]}_`](t)})}),this.on(this.tech_,`loadstart`,e=>this.handleTechLoadStart_(e)),this.on(this.tech_,`sourceset`,e=>this.handleTechSourceset_(e)),this.on(this.tech_,`waiting`,e=>this.handleTechWaiting_(e)),this.on(this.tech_,`ended`,e=>this.handleTechEnded_(e)),this.on(this.tech_,`seeking`,e=>this.handleTechSeeking_(e)),this.on(this.tech_,`play`,e=>this.handleTechPlay_(e)),this.on(this.tech_,`pause`,e=>this.handleTechPause_(e)),this.on(this.tech_,`durationchange`,e=>this.handleTechDurationChange_(e)),this.on(this.tech_,`fullscreenchange`,(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,`fullscreenerror`,(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,`enterpictureinpicture`,e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,`leavepictureinpicture`,e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,`error`,e=>this.handleTechError_(e)),this.on(this.tech_,`posterchange`,e=>this.handleTechPosterChange_(e)),this.on(this.tech_,`textdata`,e=>this.handleTechTextData_(e)),this.on(this.tech_,`ratechange`,e=>this.handleTechRateChange_(e)),this.on(this.tech_,`loadedmetadata`,this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_(`controls`)),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!==`Html5`||!this.tag)&&_a(this.tech_.el(),this.el()),this.tag&&=(this.tag.player=null,null)}unloadTech_(){ws.names.forEach(e=>{let t=ws[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Yo.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_=``,this.trigger(`posterchange`)),this.isPosterFromTech_=!1}tech(e){return e===void 0&&U.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
170
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let n=jo(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!==`Html5`&&this.tag&&(J.getTech(`Html5`).disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();(typeof this.autoplay()==`string`||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(i=!1);let a={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_[`vtt.js`],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ws.names.forEach(e=>{let t=ws[e];a[t.getterName]=this[t.privateName]}),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);let o=J.getTech(e);if(!o)throw Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(K(this,this.handleTechReady_),!0),Yo.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Jl.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${jo(e)}_`](t))}),Object.keys(Yl).forEach(e=>{this.on(this.tech_,e,t=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Yl[e]}_`].bind(this),event:t}):this[`handleTech${Yl[e]}_`](t)})}),this.on(this.tech_,`loadstart`,e=>this.handleTechLoadStart_(e)),this.on(this.tech_,`sourceset`,e=>this.handleTechSourceset_(e)),this.on(this.tech_,`waiting`,e=>this.handleTechWaiting_(e)),this.on(this.tech_,`ended`,e=>this.handleTechEnded_(e)),this.on(this.tech_,`seeking`,e=>this.handleTechSeeking_(e)),this.on(this.tech_,`play`,e=>this.handleTechPlay_(e)),this.on(this.tech_,`pause`,e=>this.handleTechPause_(e)),this.on(this.tech_,`durationchange`,e=>this.handleTechDurationChange_(e)),this.on(this.tech_,`fullscreenchange`,(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,`fullscreenerror`,(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,`enterpictureinpicture`,e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,`leavepictureinpicture`,e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,`error`,e=>this.handleTechError_(e)),this.on(this.tech_,`posterchange`,e=>this.handleTechPosterChange_(e)),this.on(this.tech_,`textdata`,e=>this.handleTechTextData_(e)),this.on(this.tech_,`ratechange`,e=>this.handleTechRateChange_(e)),this.on(this.tech_,`loadedmetadata`,this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_(`controls`)),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||n===`Html5`&&this.tag||_a(this.tech_.el(),this.el()),this.tag&&=(this.tag.player=null,null)}unloadTech_(){ws.names.forEach(e=>{let t=ws[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Yo.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_=``,this.trigger(`posterchange`)),this.isPosterFromTech_=!1}tech(e){return e===void 0&&U.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
171
171
  See https://github.com/videojs/video.js/issues/2617 for more info.
172
- `),this.tech_}version(){return{"video.js":_i}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,`click`,this.boundHandleTechClick_),this.on(this.tech_,`dblclick`,this.boundHandleTechDoubleClick_),this.on(this.tech_,`touchstart`,this.boundHandleTechTouchStart_),this.on(this.tech_,`touchmove`,this.boundHandleTechTouchMove_),this.on(this.tech_,`touchend`,this.boundHandleTechTouchEnd_),this.on(this.tech_,`tap`,this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,`tap`,this.boundHandleTechTap_),this.off(this.tech_,`touchstart`,this.boundHandleTechTouchStart_),this.off(this.tech_,`touchmove`,this.boundHandleTechTouchMove_),this.off(this.tech_,`touchend`,this.boundHandleTechTouchEnd_),this.off(this.tech_,`click`,this.boundHandleTechClick_),this.off(this.tech_,`dblclick`,this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_(`setVolume`,this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass(`vjs-ended`,`vjs-seeking`),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger(`loadstart`),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?`play`:this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=`string`)return;let t=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let n=this.play();if(Ko(n))return n.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||``}`)})},n;if(e===`any`&&!this.muted()?(n=this.play(),Ko(n)&&(n=n.catch(t))):n=e===`muted`&&!this.muted()?t():this.play(),Ko(n))return n.then(()=>{this.trigger({type:`autoplay-success`,autoplay:e})}).catch(()=>{this.trigger({type:`autoplay-failure`,autoplay:e})})}updateSourceCaches_(e=``){let t=e,n=``;typeof t!=`string`&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=Gs(this,t)),this.cache_.source=W({},e,{src:t,type:n});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),i=[],a=this.$$(`source`),o=[];for(let e=0;e<a.length;e++){let n=Ca(a[e]);i.push(n),n.src&&n.src===t&&o.push(n.src)}o.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any([`sourceset`,`loadstart`],e=>{if(e.type===`sourceset`)return;let t=this.techGet_(`currentSrc`);this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:`sourceset`})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass(`vjs-has-started`):this.removeClass(`vjs-has-started`))}handleTechPlay_(){this.removeClass(`vjs-ended`,`vjs-paused`),this.addClass(`vjs-playing`),this.hasStarted(!0),this.trigger(`play`)}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger(`ratechange`)}handleTechWaiting_(){this.addClass(`vjs-waiting`),this.trigger(`waiting`);let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass(`vjs-waiting`),this.off(`timeupdate`,t))};this.on(`timeupdate`,t)}handleTechCanPlay_(){this.removeClass(`vjs-waiting`),this.trigger(`canplay`)}handleTechCanPlayThrough_(){this.removeClass(`vjs-waiting`),this.trigger(`canplaythrough`)}handleTechPlaying_(){this.removeClass(`vjs-waiting`),this.trigger(`playing`)}handleTechSeeking_(){this.addClass(`vjs-seeking`),this.trigger(`seeking`)}handleTechSeeked_(){this.removeClass(`vjs-seeking`,`vjs-ended`),this.trigger(`seeked`)}handleTechPause_(){this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.trigger(`pause`)}handleTechEnded_(){this.addClass(`vjs-ended`),this.removeClass(`vjs-waiting`),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger(`ended`)}handleTechDurationChange_(){this.duration(this.techGet_(`duration`))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click==`function`?this.options_.userActions.click.call(this,e):this.paused()?qo(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(`.vjs-control-bar, .vjs-modal-dialog`),t=>t.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick==`function`?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!F.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass(`vjs-fullscreen`):this.removeClass(`vjs-fullscreen`)}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let n=this.el(),r=F[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(`:`+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass(`vjs-ios-native-fs`),this.tech_.one(`webkitendfullscreen`,()=>{this.removeClass(`vjs-ios-native-fs`)})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger(`fullscreenerror`,t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass(`vjs-picture-in-picture`):this.removeClass(`vjs-picture-in-picture`)}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger(`textdata`,e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:``,source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Is)return Ns(this.middleware_,this.tech_,e,t);if(e in Ls)return Ps(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw U(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Fs)return Ms(this.middleware_,this.tech_,e);if(e in Ls)return Ps(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(U(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name===`TypeError`?(U(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(U(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=qo){this.playCallbacks_.push(e);let t=!(this.changingSrc_||!this.src()&&!this.currentSrc()),n=!!(ca||sa);if(this.waitToPlay_&&=(this.off([`ready`,`loadstart`],this.waitToPlay_),null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one([`ready`,`loadstart`],this.waitToPlay_),!t&&n&&this.load();return}let r=this.techGet_(`play`);n&&this.hasClass(`vjs-ended`)&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_(`pause`)}paused(){return this.techGet_(`paused`)!==!1}played(){return this.techGet_(`played`)||Lo(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_(`setScrubbing`,this.scrubbing_),e?this.addClass(`vjs-scrubbing`):this.removeClass(`vjs-scrubbing`)}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_(`currentTime`)||0,this.cache_.currentTime;e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_?(this.cache_.initTime=e,this.off(`canplay`,this.boundApplyInitTime_),this.one(`canplay`,this.boundApplyInitTime_)):(this.techCall_(`setCurrentTime`,e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration===void 0?NaN:this.cache_.duration;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass(`vjs-live`):this.removeClass(`vjs-live`),isNaN(e)||this.trigger(`durationchange`))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_(`buffered`);return(!e||!e.length)&&(e=Lo(0,0)),e}seekable(){let e=this.techGet_(`seekable`);return(!e||!e.length)&&(e=Lo(0,0)),e}seeking(){return this.techGet_(`seeking`)}ended(){return this.techGet_(`ended`)}networkState(){return this.techGet_(`networkState`)}readyState(){return this.techGet_(`readyState`)}bufferedPercent(){return Wo(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;if(e!==void 0)t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_(`setVolume`,t),t>0&&this.lastVolume_(t);else return t=parseFloat(this.techGet_(`volume`)),isNaN(t)?1:t}muted(e){if(e!==void 0)this.techCall_(`setMuted`,e);else return this.techGet_(`muted`)||!1}defaultMuted(e){return e!==void 0&&this.techCall_(`setDefaultMuted`,e),this.techGet_(`defaultMuted`)||!1}lastVolume_(e){if(e!==void 0&&e!==0)this.cache_.lastVolume=e;else return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_(`supportsFullScreen`)||!1}isFullscreen(e){if(e!==void 0){let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger(`fullscreenchange`),this.toggleFullscreenClass_()}else return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((n,r)=>{function i(){t.off(`fullscreenerror`,o),t.off(`fullscreenchange`,a)}function a(){i(),n()}function o(e,t){i(),r(t)}t.one(`fullscreenchange`,a),t.one(`fullscreenerror`,o);let s=t.requestFullscreenHelper_(e);s&&(s.then(i,i),s.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_(`enterFullScreen`):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,n)=>{function r(){e.off(`fullscreenerror`,a),e.off(`fullscreenchange`,i)}function i(){r(),t()}function a(e,t){r(),n(t)}e.one(`fullscreenchange`,i),e.one(`fullscreenerror`,a);let o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=F[this.fsApi_.exitFullscreen]();return e&&qo(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_(`exitFullScreen`):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=F.documentElement.style.overflow,ao(F,`keydown`,this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=`hidden`,ya(F.body,`vjs-full-window`),this.trigger(`enterFullWindow`)}fullWindowOnEscKey(e){e.key===`Escape`&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,oo(F,`keydown`,this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=this.docOrigOverflow,ba(F.body,`vjs-full-window`),this.trigger(`exitFullWindow`)}disablePictureInPicture(e){if(e===void 0)return this.techGet_(`disablePictureInPicture`);this.techCall_(`setDisablePictureInPicture`,e),this.options_.disablePictureInPicture=e,this.trigger(`disablepictureinpicturechanged`)}isInPictureInPicture(e){if(e!==void 0)this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();else return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){let e=F.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add(`vjs-pip-container`),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(G(`p`,{className:`vjs-pip-text`},{},this.localize(`Playing in picture-in-picture`))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Va(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add(`vjs-pip-window`),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:`enterpictureinpicture`,pipWindow:t}),t.addEventListener(`pagehide`,t=>{let n=t.target.querySelector(`.video-js`);e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger(`leavepictureinpicture`)}),t))}return`pictureInPictureEnabled`in F&&this.disablePictureInPicture()===!1?this.techGet_(`requestPictureInPicture`):Promise.reject(`No PiP mode is available`)}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if(`pictureInPictureEnabled`in F)return F.exitPictureInPicture()}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&!(e=>{let t=e.tagName.toLowerCase();return e.isContentEditable?!0:t===`input`?[`button`,`checkbox`,`hidden`,`radio`,`reset`,`submit`].indexOf(e.type)===-1:[`textarea`].indexOf(t)!==-1})(this.el_.ownerDocument.activeElement)&&(typeof t.hotkeys==`function`?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){let{fullscreenKey:t=t=>e.key.toLowerCase()===`f`,muteKey:n=t=>e.key.toLowerCase()===`m`,playPauseKey:r=t=>e.key.toLowerCase()===`k`||e.key.toLowerCase()===` `}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=q.getComponent(`FullscreenToggle`);F[this.fsApi_.fullscreenEnabled]!==!1&&t.prototype.handleClick.call(this,e)}else n.call(this,e)?(e.preventDefault(),e.stopPropagation(),q.getComponent(`MuteToggle`).prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),q.getComponent(`PlayToggle`).prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){let i=r[n],a=J.getTech(i);if(a||=q.getComponent(i),!a)U.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`);else if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return``}selectSource(e){let t=this.options_.techOrder.map(e=>[e,J.getTech(e)]).filter(([e,t])=>t?t.isSupported():(U.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(e,t,n){let r;return e.some(e=>t.some(t=>{if(r=n(e,t),r)return!0})),r},r,i=e=>(t,n)=>e(n,t),a=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};return r=this.options_.sourceOrder?n(e,t,i(a)):n(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||``;this.resetRetryOnError_&&this.resetRetryOnError_();let n=Ks(e);if(!n.length)this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);else if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),As(this,n[0],(e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady()}else js(r,this.tech_)}),n.length>1){let e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off(`error`,e)};this.one(`error`,e),this.one(`playing`,t),this.resetRetryOnError_=()=>{this.off(`error`,e),this.off(`playing`,t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return t?Mo(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty(`setSource`)?this.techCall_(`setSource`,e):this.techCall_(`src`,e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_(`load`)}reset(){this.paused()?this.doReset_():qo(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks(`text`),this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.resetCache_(),this.poster(``),this.loadTech_(this.options_.techOrder[0],null),this.techCall_(`reset`),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),vo(this)&&this.trigger(`playerreset`)}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger(`volumechange`)}currentSources(){let e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||``}currentType(){return this.currentSource()&&this.currentSource().type||``}preload(e){if(e!==void 0)this.techCall_(`setPreload`,e),this.options_.preload=e;else return this.techGet_(`preload`)}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e==`string`&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e==`string`?e:`play`),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_(`setAutoplay`,t)}playsinline(e){return e!==void 0&&(this.techCall_(`setPlaysinline`,e),this.options_.playsinline=e),this.techGet_(`playsinline`)}loop(e){if(e!==void 0)this.techCall_(`setLoop`,e),this.options_.loop=e;else return this.techGet_(`loop`)}poster(e){if(e===void 0)return this.poster_;e||=``,e!==this.poster_&&(this.poster_=e,this.techCall_(`setPoster`,e),this.isPosterFromTech_=!1,this.trigger(`posterchange`))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||``;e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger(`posterchange`))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_(`setControls`,e),this.controls_?(this.removeClass(`vjs-controls-disabled`),this.addClass(`vjs-controls-enabled`),this.trigger(`controlsenabled`),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass(`vjs-controls-enabled`),this.addClass(`vjs-controls-disabled`),this.trigger(`controlsdisabled`),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass(`vjs-using-native-controls`),this.trigger(`usingnativecontrols`)):(this.removeClass(`vjs-using-native-controls`),this.trigger(`usingcustomcontrols`)))}error(e){if(e===void 0)return this.error_||null;if(yi(`beforeerror`).forEach(t=>{let n=t(this,e);Fi(n)&&!Array.isArray(n)||typeof n==`string`||typeof n==`number`||n===null?e=n:this.log.error(`please return a value that MediaError expects in beforeerror hooks`)}),this.options_.suppressNotSupportedError&&e&&e.code===4){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any([`click`,`touchstart`],t),this.one(`loadstart`,function(){this.off([`click`,`touchstart`],t)})}else e===null?(this.error_=null,this.removeClass(`vjs-error`),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new Go(e),this.addClass(`vjs-error`),U.error(`(CODE:${this.error_.code} ${Go.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger(`error`),yi(`error`).forEach(e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;e=!!e,e!==this.userActive_&&(this.userActive_=e,this.userActive_?(this.userActivity_=!0,this.removeClass(`vjs-user-inactive`),this.addClass(`vjs-user-active`),this.trigger(`useractive`)):(this.tech_&&this.tech_.one(`mousemove`,function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass(`vjs-user-active`),this.addClass(`vjs-user-inactive`),this.trigger(`userinactive`)))}listenForUserActivity_(){let e,t,n,r=K(this,this.reportUserActivity),i=function(e){(e.screenX!==t||e.screenY!==n)&&(t=e.screenX,n=e.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(t){r(),this.clearInterval(e)};this.on(`mousedown`,a),this.on(`mousemove`,i),this.on(`mouseup`,o),this.on(`mouseleave`,o);let s=this.getChild(`controlBar`);s&&!sa&&!Hi&&(s.on(`mouseenter`,function(e){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on(`mouseleave`,function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on(`keydown`,r),this.on(`keyup`,r);let c;this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(c);let e=this.options_.inactivityTimeout;e<=0||(c=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(e!==void 0)this.techCall_(`setPlaybackRate`,e);else return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_(`playbackRate`):1}defaultPlaybackRate(e){return e===void 0?this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_(`defaultPlaybackRate`):1:this.techCall_(`setDefaultPlaybackRate`,e)}isAudio(e){if(e!==void 0)this.isAudio_=!!e;else return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let e=this.getChild(`ControlBar`);e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass(`vjs-audio-only-mode`);let e=this.children(),t=this.getChild(`ControlBar`),n=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass(`vjs-hidden`)&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on(`playerresize`,this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger(`audioonlymodechange`)}disableAudioOnlyUI_(){this.removeClass(`vjs-audio-only-mode`),this.off(`playerresize`,this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger(`audioonlymodechange`)}audioOnlyMode(e){if(typeof e!=`boolean`||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass(`vjs-audio-poster-mode`),this.trigger(`audiopostermodechange`)}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass(`vjs-audio-poster-mode`),this.trigger(`audiopostermodechange`)}audioPosterMode(e){return typeof e!=`boolean`||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||=e,this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_(`getVideoPlaybackQuality`)}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),vo(this)&&this.trigger(`languagechange`))}languages(){return W(X.prototype.options_.languages,this.languages_)}toJSON(){let e=W(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=W(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){t||={},t.content=e||``;let n=new Zo(this,t);return this.addChild(n),n.on(`dispose`,()=>{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<Xl.length;n++){let r=Xl[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Zl[e]),this.addClass(Zl[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_=``,e&&this.removeClass(e)}breakpoints(e){return e===void 0||(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},Ql,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(e===void 0)return this.responsive_;e=!!e;let t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on(`playerresize`,this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off(`playerresize`,this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Zl[this.breakpoint_]||``}loadMedia(e,t){if(!e||typeof e!=`object`)return;let n=this.crossOrigin();this.reset(),this.cache_.media=W(e);let{artist:r,artwork:i,description:a,poster:o,src:s,textTracks:c,title:l}=this.cache_.media;!i&&o&&(this.cache_.media.artwork=[{src:o,type:Ws(o)}]),n&&this.crossOrigin(n),s&&this.src(s),o&&this.poster(o),Array.isArray(c)&&c.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:l,description:a||r||``}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Ws(t.poster)}]),t}return W(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},n=Ca(e),r=n[`data-setup`];if(va(e,`vjs-fill`)&&(n.fill=!0),va(e,`vjs-fluid`)&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||`{}`))}catch(e){U.error(`data-setup`,e)}if(Object.assign(t,n),e.hasChildNodes()){let n=e.childNodes;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.nodeName.toLowerCase();i===`source`?t.sources.push(Ca(r)):i===`track`&&t.tracks.push(Ca(r))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger(`debugon`),this.previousLogLevel_=this.log.level,this.log.level(`debug`),this.debugEnabled_=!0):(this.trigger(`debugoff`),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>typeof e==`number`)&&(this.cache_.playbackRates=e,this.trigger(`playbackrateschange`))}}X.prototype.videoTracks=()=>{},X.prototype.audioTracks=()=>{},X.prototype.textTracks=()=>{},X.prototype.remoteTextTracks=()=>{},X.prototype.remoteTextTrackEls=()=>{},ws.names.forEach(function(e){let t=ws[e];X.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),X.prototype.crossorigin=X.prototype.crossOrigin,X.players={};const $l=x.navigator;X.prototype.options_={techOrder:J.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:[`mediaLoader`,`posterImage`,`titleBar`,`textTrackDisplay`,`loadingSpinner`,`bigPlayButton`,`liveTracker`,`controlBar`,`errorDisplay`,`textTrackSettings`,`resizeManager`],language:$l&&($l.languages&&$l.languages[0]||$l.userLanguage||$l.language)||`en`,languages:{},notSupportedMessage:`No compatible source was found for this media.`,normalizeAutoplay:!1,fullscreen:{options:{navigationUI:`hide`}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Jl.forEach(function(e){X.prototype[`handleTech${jo(e)}_`]=function(){return this.trigger(e)}}),q.registerComponent(`Player`,X);const eu=`plugin`,tu=`activePlugins_`,nu={},ru=e=>nu.hasOwnProperty(e),iu=e=>ru(e)?nu[e]:void 0,au=(e,t)=>{e[tu]=e[tu]||{},e[tu][t]=!0},ou=(e,t,n)=>{let r=(n?`before`:``)+`pluginsetup`;e.trigger(r,t),e.trigger(r+`:`+t.name,t)},su=function(e,t){let n=function(){ou(this,{name:e,plugin:t,instance:null},!0);let n=t.apply(this,arguments);return au(this,e),ou(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},cu=(e,t)=>(t.prototype.name=e,function(...n){ou(this,{name:e,plugin:t,instance:null},!0);let r=new t(this,...n);return this[e]=()=>r,ou(this,r.getEventHash()),r});class lu{constructor(e){if(this.constructor===lu)throw Error(`Plugin must be sub-classed; not directly instantiated.`);this.player=e,this.log||=this.player.log.createLogger(this.name),Do(this),delete this.trigger,ko(this,this.constructor.defaultState),au(e,this.name),this.dispose=this.dispose.bind(this),e.on(`dispose`,this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return so(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger(`dispose`),this.off(),t.off(`dispose`,this.dispose),t[tu][e]=!1,this.player=this.state=null,t[e]=cu(e,nu[e])}static isBasic(e){let t=typeof e==`string`?iu(e):e;return typeof t==`function`&&!lu.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!=`string`)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(ru(e))U.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(X.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!=`function`)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return nu[e]=t,e!==eu&&(lu.isBasic(t)?X.prototype[e]=su(e,t):X.prototype[e]=cu(e,t)),t}static deregisterPlugin(e){if(e===eu)throw Error(`Cannot de-register base plugin.`);ru(e)&&(delete nu[e],delete X.prototype[e])}static getPlugins(e=Object.keys(nu)){let t;return e.forEach(e=>{let n=iu(e);n&&(t||={},t[e]=n)}),t}static getPluginVersion(e){let t=iu(e);return t&&t.VERSION||``}}lu.getPlugin=iu,lu.BASE_PLUGIN_NAME=eu,lu.registerPlugin(eu,lu),X.prototype.usingPlugin=function(e){return!!this[tu]&&this[tu][e]===!0},X.prototype.hasPlugin=function(e){return!!ru(e)};function uu(e,t){let n=!1;return function(...r){return n||U.warn(e),n=!0,t.apply(this,r)}}function du(e,t,n,r){return uu(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}var fu={NetworkBadStatus:`networkbadstatus`,NetworkRequestFailed:`networkrequestfailed`,NetworkRequestAborted:`networkrequestaborted`,NetworkRequestTimeout:`networkrequesttimeout`,NetworkBodyParserFailed:`networkbodyparserfailed`,StreamingHlsPlaylistParserError:`streaminghlsplaylistparsererror`,StreamingDashManifestParserError:`streamingdashmanifestparsererror`,StreamingContentSteeringParserError:`streamingcontentsteeringparsererror`,StreamingVttParserError:`streamingvttparsererror`,StreamingFailedToSelectNextSegment:`streamingfailedtoselectnextsegment`,StreamingFailedToDecryptSegment:`streamingfailedtodecryptsegment`,StreamingFailedToTransmuxSegment:`streamingfailedtotransmuxsegment`,StreamingFailedToAppendSegment:`streamingfailedtoappendsegment`,StreamingCodecsChangeError:`streamingcodecschangeerror`};const pu=e=>e.indexOf(`#`)===0?e.slice(1):e;function Z(e,t,n){let r=Z.getPlayer(e);if(r)return t&&U.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;let i=typeof e==`string`?Ra(`#`+pu(e)):e;if(!pa(i))throw TypeError(`The element or ID supplied is not valid. (videojs)`);let a=`getRootNode`in i&&i.getRootNode()instanceof x.ShadowRoot?i.getRootNode():i.ownerDocument.body;return(!i.ownerDocument.defaultView||!a.contains(i))&&U.warn(`The element supplied is not included in the DOM`),t||={},t.restoreEl===!0&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute(`data-vjs-player`)?i.parentNode:i).cloneNode(!0)),yi(`beforesetup`).forEach(e=>{let n=e(i,W(t));!Fi(n)||Array.isArray(n)?U.error(`please return an object in beforesetup hooks`):t=W(t,n)}),r=new(q.getComponent(`Player`))(i,t,n),yi(`setup`).forEach(e=>e(r)),r}if(Z.hooks_=vi,Z.hooks=yi,Z.hook=bi,Z.hookOnce=Si,Z.removeHook=xi,x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&fa()){let e=Ra(`.vjs-styles-defaults`);if(!e){e=Ja(`vjs-styles-defaults`);let t=Ra(`head`);t&&t.insertBefore(e,t.firstChild),Ya(e,`
172
+ `),this.tech_}version(){return{"video.js":_i}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,`click`,this.boundHandleTechClick_),this.on(this.tech_,`dblclick`,this.boundHandleTechDoubleClick_),this.on(this.tech_,`touchstart`,this.boundHandleTechTouchStart_),this.on(this.tech_,`touchmove`,this.boundHandleTechTouchMove_),this.on(this.tech_,`touchend`,this.boundHandleTechTouchEnd_),this.on(this.tech_,`tap`,this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,`tap`,this.boundHandleTechTap_),this.off(this.tech_,`touchstart`,this.boundHandleTechTouchStart_),this.off(this.tech_,`touchmove`,this.boundHandleTechTouchMove_),this.off(this.tech_,`touchend`,this.boundHandleTechTouchEnd_),this.off(this.tech_,`click`,this.boundHandleTechClick_),this.off(this.tech_,`dblclick`,this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_(`setVolume`,this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass(`vjs-ended`,`vjs-seeking`),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger(`loadstart`),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?`play`:this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=`string`)return;let t=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let n=this.play();if(Ko(n))return n.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||``}`)})},n;if(e===`any`&&!this.muted()?(n=this.play(),Ko(n)&&(n=n.catch(t))):n=e===`muted`&&!this.muted()?t():this.play(),Ko(n))return n.then(()=>{this.trigger({type:`autoplay-success`,autoplay:e})}).catch(()=>{this.trigger({type:`autoplay-failure`,autoplay:e})})}updateSourceCaches_(e=``){let t=e,n=``;typeof t!=`string`&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=Gs(this,t)),this.cache_.source=W({},e,{src:t,type:n});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),i=[],a=this.$$(`source`),o=[];for(let e=0;e<a.length;e++){let n=Ca(a[e]);i.push(n),n.src&&n.src===t&&o.push(n.src)}o.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any([`sourceset`,`loadstart`],e=>{if(e.type===`sourceset`)return;let t=this.techGet_(`currentSrc`);this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:`sourceset`})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass(`vjs-has-started`):this.removeClass(`vjs-has-started`))}handleTechPlay_(){this.removeClass(`vjs-ended`,`vjs-paused`),this.addClass(`vjs-playing`),this.hasStarted(!0),this.trigger(`play`)}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger(`ratechange`)}handleTechWaiting_(){this.addClass(`vjs-waiting`),this.trigger(`waiting`);let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass(`vjs-waiting`),this.off(`timeupdate`,t))};this.on(`timeupdate`,t)}handleTechCanPlay_(){this.removeClass(`vjs-waiting`),this.trigger(`canplay`)}handleTechCanPlayThrough_(){this.removeClass(`vjs-waiting`),this.trigger(`canplaythrough`)}handleTechPlaying_(){this.removeClass(`vjs-waiting`),this.trigger(`playing`)}handleTechSeeking_(){this.addClass(`vjs-seeking`),this.trigger(`seeking`)}handleTechSeeked_(){this.removeClass(`vjs-seeking`,`vjs-ended`),this.trigger(`seeked`)}handleTechPause_(){this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.trigger(`pause`)}handleTechEnded_(){this.addClass(`vjs-ended`),this.removeClass(`vjs-waiting`),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger(`ended`)}handleTechDurationChange_(){this.duration(this.techGet_(`duration`))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click==`function`?this.options_.userActions.click.call(this,e):this.paused()?qo(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(`.vjs-control-bar, .vjs-modal-dialog`),t=>t.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick==`function`?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!F.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass(`vjs-fullscreen`):this.removeClass(`vjs-fullscreen`)}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let n=this.el(),r=F[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(`:`+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass(`vjs-ios-native-fs`),this.tech_.one(`webkitendfullscreen`,()=>{this.removeClass(`vjs-ios-native-fs`)})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger(`fullscreenerror`,t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass(`vjs-picture-in-picture`):this.removeClass(`vjs-picture-in-picture`)}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger(`textdata`,e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:``,source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Is)return Ns(this.middleware_,this.tech_,e,t);if(e in Ls)return Ps(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw U(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Fs)return Ms(this.middleware_,this.tech_,e);if(e in Ls)return Ps(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(U(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name===`TypeError`?(U(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(U(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=qo){this.playCallbacks_.push(e);let t=!(this.changingSrc_||!this.src()&&!this.currentSrc()),n=!!(ca||sa);if(this.waitToPlay_&&=(this.off([`ready`,`loadstart`],this.waitToPlay_),null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one([`ready`,`loadstart`],this.waitToPlay_),!t&&n&&this.load();return}let r=this.techGet_(`play`);n&&this.hasClass(`vjs-ended`)&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_(`pause`)}paused(){return this.techGet_(`paused`)!==!1}played(){return this.techGet_(`played`)||Lo(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_(`setScrubbing`,this.scrubbing_),e?this.addClass(`vjs-scrubbing`):this.removeClass(`vjs-scrubbing`)}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_(`currentTime`)||0,this.cache_.currentTime;e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_?(this.cache_.initTime=e,this.off(`canplay`,this.boundApplyInitTime_),this.one(`canplay`,this.boundApplyInitTime_)):(this.techCall_(`setCurrentTime`,e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration===void 0?NaN:this.cache_.duration;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass(`vjs-live`):this.removeClass(`vjs-live`),isNaN(e)||this.trigger(`durationchange`))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_(`buffered`);return e&&e.length||(e=Lo(0,0)),e}seekable(){let e=this.techGet_(`seekable`);return e&&e.length||(e=Lo(0,0)),e}seeking(){return this.techGet_(`seeking`)}ended(){return this.techGet_(`ended`)}networkState(){return this.techGet_(`networkState`)}readyState(){return this.techGet_(`readyState`)}bufferedPercent(){return Wo(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;if(e!==void 0)t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_(`setVolume`,t),t>0&&this.lastVolume_(t);else return t=parseFloat(this.techGet_(`volume`)),isNaN(t)?1:t}muted(e){if(e!==void 0)this.techCall_(`setMuted`,e);else return this.techGet_(`muted`)||!1}defaultMuted(e){return e!==void 0&&this.techCall_(`setDefaultMuted`,e),this.techGet_(`defaultMuted`)||!1}lastVolume_(e){if(e!==void 0&&e!==0)this.cache_.lastVolume=e;else return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_(`supportsFullScreen`)||!1}isFullscreen(e){if(e!==void 0){let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger(`fullscreenchange`),this.toggleFullscreenClass_()}else return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((n,r)=>{function i(){t.off(`fullscreenerror`,o),t.off(`fullscreenchange`,a)}function a(){i(),n()}function o(e,t){i(),r(t)}t.one(`fullscreenchange`,a),t.one(`fullscreenerror`,o);let s=t.requestFullscreenHelper_(e);s&&(s.then(i,i),s.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_(`enterFullScreen`):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,n)=>{function r(){e.off(`fullscreenerror`,a),e.off(`fullscreenchange`,i)}function i(){r(),t()}function a(e,t){r(),n(t)}e.one(`fullscreenchange`,i),e.one(`fullscreenerror`,a);let o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=F[this.fsApi_.exitFullscreen]();return e&&qo(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_(`exitFullScreen`):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=F.documentElement.style.overflow,ao(F,`keydown`,this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=`hidden`,ya(F.body,`vjs-full-window`),this.trigger(`enterFullWindow`)}fullWindowOnEscKey(e){e.key===`Escape`&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,oo(F,`keydown`,this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=this.docOrigOverflow,ba(F.body,`vjs-full-window`),this.trigger(`exitFullWindow`)}disablePictureInPicture(e){if(e===void 0)return this.techGet_(`disablePictureInPicture`);this.techCall_(`setDisablePictureInPicture`,e),this.options_.disablePictureInPicture=e,this.trigger(`disablepictureinpicturechanged`)}isInPictureInPicture(e){if(e!==void 0)this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();else return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){let e=F.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add(`vjs-pip-container`),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(G(`p`,{className:`vjs-pip-text`},{},this.localize(`Playing in picture-in-picture`))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Va(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add(`vjs-pip-window`),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:`enterpictureinpicture`,pipWindow:t}),t.addEventListener(`pagehide`,t=>{let n=t.target.querySelector(`.video-js`);e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger(`leavepictureinpicture`)}),t))}return`pictureInPictureEnabled`in F&&this.disablePictureInPicture()===!1?this.techGet_(`requestPictureInPicture`):Promise.reject(`No PiP mode is available`)}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if(`pictureInPictureEnabled`in F)return F.exitPictureInPicture()}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&!(e=>{let t=e.tagName.toLowerCase();return e.isContentEditable?!0:t===`input`?[`button`,`checkbox`,`hidden`,`radio`,`reset`,`submit`].indexOf(e.type)===-1:[`textarea`].indexOf(t)!==-1})(this.el_.ownerDocument.activeElement)&&(typeof t.hotkeys==`function`?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){let{fullscreenKey:t=t=>e.key.toLowerCase()===`f`,muteKey:n=t=>e.key.toLowerCase()===`m`,playPauseKey:r=t=>e.key.toLowerCase()===`k`||e.key.toLowerCase()===` `}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=q.getComponent(`FullscreenToggle`);F[this.fsApi_.fullscreenEnabled]!==!1&&t.prototype.handleClick.call(this,e)}else n.call(this,e)?(e.preventDefault(),e.stopPropagation(),q.getComponent(`MuteToggle`).prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),q.getComponent(`PlayToggle`).prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){let i=r[n],a=J.getTech(i);if(a||=q.getComponent(i),!a)U.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`);else if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return``}selectSource(e){let t=this.options_.techOrder.map(e=>[e,J.getTech(e)]).filter(([e,t])=>t?t.isSupported():(U.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(e,t,n){let r;return e.some(e=>t.some(t=>{if(r=n(e,t),r)return!0})),r},r,i=e=>(t,n)=>e(n,t),a=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};return r=this.options_.sourceOrder?n(e,t,i(a)):n(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||``;this.resetRetryOnError_&&this.resetRetryOnError_();let n=Ks(e);if(!n.length)this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);else if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),As(this,n[0],(e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady()}else js(r,this.tech_)}),n.length>1){let e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off(`error`,e)};this.one(`error`,e),this.one(`playing`,t),this.resetRetryOnError_=()=>{this.off(`error`,e),this.off(`playing`,t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return t?Mo(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty(`setSource`)?this.techCall_(`setSource`,e):this.techCall_(`src`,e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_(`load`)}reset(){this.paused()?this.doReset_():qo(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks(`text`),this.removeClass(`vjs-playing`),this.addClass(`vjs-paused`),this.resetCache_(),this.poster(``),this.loadTech_(this.options_.techOrder[0],null),this.techCall_(`reset`),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),vo(this)&&this.trigger(`playerreset`)}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger(`volumechange`)}currentSources(){let e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||``}currentType(){return this.currentSource()&&this.currentSource().type||``}preload(e){if(e!==void 0)this.techCall_(`setPreload`,e),this.options_.preload=e;else return this.techGet_(`preload`)}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e==`string`&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e==`string`?e:`play`),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_(`setAutoplay`,t)}playsinline(e){return e!==void 0&&(this.techCall_(`setPlaysinline`,e),this.options_.playsinline=e),this.techGet_(`playsinline`)}loop(e){if(e!==void 0)this.techCall_(`setLoop`,e),this.options_.loop=e;else return this.techGet_(`loop`)}poster(e){if(e===void 0)return this.poster_;e||=``,e!==this.poster_&&(this.poster_=e,this.techCall_(`setPoster`,e),this.isPosterFromTech_=!1,this.trigger(`posterchange`))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||``;e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger(`posterchange`))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_(`setControls`,e),this.controls_?(this.removeClass(`vjs-controls-disabled`),this.addClass(`vjs-controls-enabled`),this.trigger(`controlsenabled`),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass(`vjs-controls-enabled`),this.addClass(`vjs-controls-disabled`),this.trigger(`controlsdisabled`),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass(`vjs-using-native-controls`),this.trigger(`usingnativecontrols`)):(this.removeClass(`vjs-using-native-controls`),this.trigger(`usingcustomcontrols`)))}error(e){if(e===void 0)return this.error_||null;if(yi(`beforeerror`).forEach(t=>{let n=t(this,e);Fi(n)&&!Array.isArray(n)||typeof n==`string`||typeof n==`number`||n===null?e=n:this.log.error(`please return a value that MediaError expects in beforeerror hooks`)}),this.options_.suppressNotSupportedError&&e&&e.code===4){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any([`click`,`touchstart`],t),this.one(`loadstart`,function(){this.off([`click`,`touchstart`],t)})}else e===null?(this.error_=null,this.removeClass(`vjs-error`),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new Go(e),this.addClass(`vjs-error`),U.error(`(CODE:${this.error_.code} ${Go.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger(`error`),yi(`error`).forEach(e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;e=!!e,e!==this.userActive_&&(this.userActive_=e,this.userActive_?(this.userActivity_=!0,this.removeClass(`vjs-user-inactive`),this.addClass(`vjs-user-active`),this.trigger(`useractive`)):(this.tech_&&this.tech_.one(`mousemove`,function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass(`vjs-user-active`),this.addClass(`vjs-user-inactive`),this.trigger(`userinactive`)))}listenForUserActivity_(){let e,t,n,r=K(this,this.reportUserActivity),i=function(e){(e.screenX!==t||e.screenY!==n)&&(t=e.screenX,n=e.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(t){r(),this.clearInterval(e)};this.on(`mousedown`,a),this.on(`mousemove`,i),this.on(`mouseup`,o),this.on(`mouseleave`,o);let s=this.getChild(`controlBar`);s&&!sa&&!Hi&&(s.on(`mouseenter`,function(e){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on(`mouseleave`,function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on(`keydown`,r),this.on(`keyup`,r);let c;this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(c);let e=this.options_.inactivityTimeout;e<=0||(c=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(e!==void 0)this.techCall_(`setPlaybackRate`,e);else return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_(`playbackRate`):1}defaultPlaybackRate(e){return e===void 0?this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_(`defaultPlaybackRate`):1:this.techCall_(`setDefaultPlaybackRate`,e)}isAudio(e){if(e!==void 0)this.isAudio_=!!e;else return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let e=this.getChild(`ControlBar`);e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass(`vjs-audio-only-mode`);let e=this.children(),t=this.getChild(`ControlBar`),n=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass(`vjs-hidden`)&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on(`playerresize`,this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger(`audioonlymodechange`)}disableAudioOnlyUI_(){this.removeClass(`vjs-audio-only-mode`),this.off(`playerresize`,this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger(`audioonlymodechange`)}audioOnlyMode(e){if(typeof e!=`boolean`||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass(`vjs-audio-poster-mode`),this.trigger(`audiopostermodechange`)}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass(`vjs-audio-poster-mode`),this.trigger(`audiopostermodechange`)}audioPosterMode(e){return typeof e!=`boolean`||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||=e,this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_(`getVideoPlaybackQuality`)}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),vo(this)&&this.trigger(`languagechange`))}languages(){return W(X.prototype.options_.languages,this.languages_)}toJSON(){let e=W(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=W(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){t||={},t.content=e||``;let n=new Zo(this,t);return this.addChild(n),n.on(`dispose`,()=>{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<Xl.length;n++){let r=Xl[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Zl[e]),this.addClass(Zl[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_=``,e&&this.removeClass(e)}breakpoints(e){return e===void 0||(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},Ql,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(e===void 0)return this.responsive_;e=!!e;let t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on(`playerresize`,this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off(`playerresize`,this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Zl[this.breakpoint_]||``}loadMedia(e,t){if(!e||typeof e!=`object`)return;let n=this.crossOrigin();this.reset(),this.cache_.media=W(e);let{artist:r,artwork:i,description:a,poster:o,src:s,textTracks:c,title:l}=this.cache_.media;!i&&o&&(this.cache_.media.artwork=[{src:o,type:Ws(o)}]),n&&this.crossOrigin(n),s&&this.src(s),o&&this.poster(o),Array.isArray(c)&&c.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:l,description:a||r||``}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Ws(t.poster)}]),t}return W(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},n=Ca(e),r=n[`data-setup`];if(va(e,`vjs-fill`)&&(n.fill=!0),va(e,`vjs-fluid`)&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||`{}`))}catch(e){U.error(`data-setup`,e)}if(Object.assign(t,n),e.hasChildNodes()){let n=e.childNodes;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.nodeName.toLowerCase();i===`source`?t.sources.push(Ca(r)):i===`track`&&t.tracks.push(Ca(r))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger(`debugon`),this.previousLogLevel_=this.log.level,this.log.level(`debug`),this.debugEnabled_=!0):(this.trigger(`debugoff`),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>typeof e==`number`)&&(this.cache_.playbackRates=e,this.trigger(`playbackrateschange`))}}X.prototype.videoTracks=()=>{},X.prototype.audioTracks=()=>{},X.prototype.textTracks=()=>{},X.prototype.remoteTextTracks=()=>{},X.prototype.remoteTextTrackEls=()=>{},ws.names.forEach(function(e){let t=ws[e];X.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),X.prototype.crossorigin=X.prototype.crossOrigin,X.players={};const $l=x.navigator;X.prototype.options_={techOrder:J.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:[`mediaLoader`,`posterImage`,`titleBar`,`textTrackDisplay`,`loadingSpinner`,`bigPlayButton`,`liveTracker`,`controlBar`,`errorDisplay`,`textTrackSettings`,`resizeManager`],language:$l&&($l.languages&&$l.languages[0]||$l.userLanguage||$l.language)||`en`,languages:{},notSupportedMessage:`No compatible source was found for this media.`,normalizeAutoplay:!1,fullscreen:{options:{navigationUI:`hide`}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Jl.forEach(function(e){X.prototype[`handleTech${jo(e)}_`]=function(){return this.trigger(e)}}),q.registerComponent(`Player`,X);const eu=`plugin`,tu=`activePlugins_`,nu={},ru=e=>nu.hasOwnProperty(e),iu=e=>ru(e)?nu[e]:void 0,au=(e,t)=>{e[tu]=e[tu]||{},e[tu][t]=!0},ou=(e,t,n)=>{let r=(n?`before`:``)+`pluginsetup`;e.trigger(r,t),e.trigger(r+`:`+t.name,t)},su=function(e,t){let n=function(){ou(this,{name:e,plugin:t,instance:null},!0);let n=t.apply(this,arguments);return au(this,e),ou(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},cu=(e,t)=>(t.prototype.name=e,function(...n){ou(this,{name:e,plugin:t,instance:null},!0);let r=new t(this,...n);return this[e]=()=>r,ou(this,r.getEventHash()),r});class lu{constructor(e){if(this.constructor===lu)throw Error(`Plugin must be sub-classed; not directly instantiated.`);this.player=e,this.log||=this.player.log.createLogger(this.name),Do(this),delete this.trigger,ko(this,this.constructor.defaultState),au(e,this.name),this.dispose=this.dispose.bind(this),e.on(`dispose`,this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return so(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger(`dispose`),this.off(),t.off(`dispose`,this.dispose),t[tu][e]=!1,this.player=this.state=null,t[e]=cu(e,nu[e])}static isBasic(e){let t=typeof e==`string`?iu(e):e;return typeof t==`function`&&!lu.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!=`string`)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(ru(e))U.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(X.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!=`function`)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return nu[e]=t,e!==eu&&(lu.isBasic(t)?X.prototype[e]=su(e,t):X.prototype[e]=cu(e,t)),t}static deregisterPlugin(e){if(e===eu)throw Error(`Cannot de-register base plugin.`);ru(e)&&(delete nu[e],delete X.prototype[e])}static getPlugins(e=Object.keys(nu)){let t;return e.forEach(e=>{let n=iu(e);n&&(t||={},t[e]=n)}),t}static getPluginVersion(e){let t=iu(e);return t&&t.VERSION||``}}lu.getPlugin=iu,lu.BASE_PLUGIN_NAME=eu,lu.registerPlugin(eu,lu),X.prototype.usingPlugin=function(e){return!!this[tu]&&this[tu][e]===!0},X.prototype.hasPlugin=function(e){return!!ru(e)};function uu(e,t){let n=!1;return function(...r){return n||U.warn(e),n=!0,t.apply(this,r)}}function du(e,t,n,r){return uu(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}var fu={NetworkBadStatus:`networkbadstatus`,NetworkRequestFailed:`networkrequestfailed`,NetworkRequestAborted:`networkrequestaborted`,NetworkRequestTimeout:`networkrequesttimeout`,NetworkBodyParserFailed:`networkbodyparserfailed`,StreamingHlsPlaylistParserError:`streaminghlsplaylistparsererror`,StreamingDashManifestParserError:`streamingdashmanifestparsererror`,StreamingContentSteeringParserError:`streamingcontentsteeringparsererror`,StreamingVttParserError:`streamingvttparsererror`,StreamingFailedToSelectNextSegment:`streamingfailedtoselectnextsegment`,StreamingFailedToDecryptSegment:`streamingfailedtodecryptsegment`,StreamingFailedToTransmuxSegment:`streamingfailedtotransmuxsegment`,StreamingFailedToAppendSegment:`streamingfailedtoappendsegment`,StreamingCodecsChangeError:`streamingcodecschangeerror`};const pu=e=>e.indexOf(`#`)===0?e.slice(1):e;function Z(e,t,n){let r=Z.getPlayer(e);if(r)return t&&U.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;let i=typeof e==`string`?Ra(`#`+pu(e)):e;if(!pa(i))throw TypeError(`The element or ID supplied is not valid. (videojs)`);let a=`getRootNode`in i&&i.getRootNode()instanceof x.ShadowRoot?i.getRootNode():i.ownerDocument.body;return i.ownerDocument.defaultView&&a.contains(i)||U.warn(`The element supplied is not included in the DOM`),t||={},t.restoreEl===!0&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute(`data-vjs-player`)?i.parentNode:i).cloneNode(!0)),yi(`beforesetup`).forEach(e=>{let n=e(i,W(t));!Fi(n)||Array.isArray(n)?U.error(`please return an object in beforesetup hooks`):t=W(t,n)}),r=new(q.getComponent(`Player`))(i,t,n),yi(`setup`).forEach(e=>e(r)),r}if(Z.hooks_=vi,Z.hooks=yi,Z.hook=bi,Z.hookOnce=Si,Z.removeHook=xi,x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&fa()){let e=Ra(`.vjs-styles-defaults`);if(!e){e=Ja(`vjs-styles-defaults`);let t=Ra(`head`);t&&t.insertBefore(e,t.firstChild),Ya(e,`
173
173
  .video-js {
174
174
  width: 300px;
175
175
  height: 150px;
@@ -180,7 +180,7 @@ See https://github.com/videojs/video.js/issues/2617 for more info.
180
180
  }
181
181
  `)}}Ka(1,Z),Z.VERSION=_i,Z.options=X.prototype.options_,Z.getPlayers=()=>X.players,Z.getPlayer=e=>{let t=X.players,n;if(typeof e==`string`){let r=pu(e),i=t[r];if(i)return i;n=Ra(`#`+r)}else n=e;if(pa(n)){let{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},Z.getAllPlayers=()=>Object.keys(X.players).map(e=>X.players[e]).filter(Boolean),Z.players=X.players,Z.getComponent=q.getComponent,Z.registerComponent=(e,t)=>(J.isTech(t)&&U.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),q.registerComponent.call(q,e,t)),Z.getTech=J.getTech,Z.registerTech=J.registerTech,Z.use=ks,Object.defineProperty(Z,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Z.middleware,"TERMINATOR",{value:Os,writeable:!1,enumerable:!0}),Z.browser=la,Z.obj=zi,Z.mergeOptions=du(9,`videojs.mergeOptions`,`videojs.obj.merge`,W),Z.defineLazyProperty=du(9,`videojs.defineLazyProperty`,`videojs.obj.defineLazyProperty`,Ri),Z.bind=du(9,`videojs.bind`,`native Function.prototype.bind`,K),Z.registerPlugin=lu.registerPlugin,Z.deregisterPlugin=lu.deregisterPlugin,Z.plugin=(e,t)=>(U.warn(`videojs.plugin() is deprecated; use videojs.registerPlugin() instead`),lu.registerPlugin(e,t)),Z.getPlugins=lu.getPlugins,Z.getPlugin=lu.getPlugin,Z.getPluginVersion=lu.getPluginVersion,Z.addLanguage=function(e,t){return e=(``+e).toLowerCase(),Z.options.languages=W(Z.options.languages,{[e]:t}),Z.options.languages[e]},Z.log=U,Z.createLogger=Ai,Z.time=Uo,Z.createTimeRange=du(9,`videojs.createTimeRange`,`videojs.time.createTimeRanges`,Lo),Z.createTimeRanges=du(9,`videojs.createTimeRanges`,`videojs.time.createTimeRanges`,Lo),Z.formatTime=du(9,`videojs.formatTime`,`videojs.time.formatTime`,Ho),Z.setFormatTime=du(9,`videojs.setFormatTime`,`videojs.time.setFormatTime`,Bo),Z.resetFormatTime=du(9,`videojs.resetFormatTime`,`videojs.time.resetFormatTime`,Vo),Z.parseUrl=du(9,`videojs.parseUrl`,`videojs.url.parseUrl`,ds),Z.isCrossOrigin=du(9,`videojs.isCrossOrigin`,`videojs.url.isCrossOrigin`,ms),Z.EventTarget=go,Z.any=lo,Z.on=ao,Z.one=co,Z.off=oo,Z.trigger=so,Z.xhr=Ge,Z.TrackList=Qo,Z.TextTrack=vs,Z.TextTrackList=rs,Z.AudioTrack=ys,Z.AudioTrackList=es,Z.VideoTrack=bs,Z.VideoTrackList=ns,[`isEl`,`isTextNode`,`createEl`,`hasClass`,`addClass`,`removeClass`,`toggleClass`,`setAttributes`,`getAttributes`,`emptyEl`,`appendContent`,`insertContent`].forEach(e=>{Z[e]=function(){return U.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Ha[e].apply(null,arguments)}}),Z.computedStyle=du(9,`videojs.computedStyle`,`videojs.dom.computedStyle`,Ba),Z.dom=Ha,Z.fn=mo,Z.num=xc,Z.str=No,Z.url=hs,Z.Error=fu;class mu{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(e){t.enabled_(e)}}),t}}class hu extends Z.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let n=this.levels_.length;return t=new mu(e),``+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:`addqualitylevel`}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:`removequalitylevel`}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){let n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}hu.prototype.allowedEvents_={change:`change`,addqualitylevel:`addqualitylevel`,removequalitylevel:`removequalitylevel`};for(let e in hu.prototype.allowedEvents_)hu.prototype[`on`+e]=null;var gu=`4.1.0`;const _u=function(e,t){let n=e.qualityLevels,r=new hu,i=function(){r.dispose(),e.qualityLevels=n,e.off(`dispose`,i)};return e.on(`dispose`,i),e.qualityLevels=()=>r,e.qualityLevels.VERSION=gu,r},vu=function(e){return _u(this,Z.obj.merge({},e))};Z.registerPlugin(`qualityLevels`,vu),vu.VERSION=gu;const yu=ot,bu=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,xu=e=>Z.log.debug?Z.log.debug.bind(Z,`VHS:`,`${e} >`):function(){};function Q(...e){let t=Z.obj||Z;return(t.merge||t.mergeOptions).apply(t,e)}function Su(...e){let t=Z.time||Z;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}function Cu(e){if(e.length===0)return`Buffered Ranges are empty`;let t=`Buffered Ranges:
182
182
  `;for(let n=0;n<e.length;n++){let r=e.start(n),i=e.end(n);t+=`${r} --> ${i}. Duration (${i-r})\n`}return t}const wu=1/30,Tu=wu*3,Eu=function(e,t){let n=[],r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return Su(n)},Du=function(e,t){return Eu(e,function(e,n){return e-Tu<=t&&n+Tu>=t})},Ou=function(e,t){return Eu(e,function(e){return e-wu>=t})},ku=function(e){if(e.length<2)return Su();let t=[];for(let n=1;n<e.length;n++){let r=e.end(n-1),i=e.start(n);t.push([r,i])}return Su(t)},Au=function(e,t){let n=null,r=null,i=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return Su();let s=e.length;for(;s--;)a.push({time:e.start(s),type:`start`}),a.push({time:e.end(s),type:`end`});for(s=t.length;s--;)a.push({time:t.start(s),type:`start`}),a.push({time:t.end(s),type:`end`});for(a.sort(function(e,t){return e.time-t.time}),s=0;s<a.length;s++)a[s].type===`start`?(i++,i===2&&(n=a[s].time)):a[s].type===`end`&&(i--,i===1&&(r=a[s].time)),n!==null&&r!==null&&(o.push([n,r]),n=null,r=null);return Su(o)},ju=e=>{let t=[];if(!e||!e.length)return``;for(let n=0;n<e.length;n++)t.push(e.start(n)+` => `+e.end(n));return t.join(`, `)},Mu=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n},Nu=e=>{let t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},Pu=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1},Fu=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Iu=function(e,t){let n=0;if(!e||!e.length)return n;for(let r=0;r<e.length;r++){let i=e.start(r),a=e.end(r);t>a||(n+=t>i&&t<=a?a-t:a-i)}return n},Lu=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){t.type===`PART`&&(n+=e.partTargetDuration)}),n},Ru=e=>(e.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),zu=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Bu=({preloadSegment:e})=>{if(!e)return;let{parts:t,preloadHints:n}=e,r=(n||[]).reduce((e,t)=>e+ +(t.type===`PART`),0);return r+=t&&t.length?t.length:0,r},Vu=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let n=zu(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},Hu=function(e,t){let n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(i.start!==void 0)return{result:i.start,precise:!0};if(i.end!==void 0)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=e.segments[r],i.end!==void 0)return{result:n+i.end,precise:!0};if(n+=Lu(e,i),i.start!==void 0)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}},Uu=function(e,t){let n=0,r,i=t-e.mediaSequence;for(;i<e.segments.length;i++){if(r=e.segments[i],r.start!==void 0)return{result:r.start-n,precise:!0};if(n+=Lu(e,r),r.end!==void 0)return{result:r.end-n,precise:!0}}return{result:-1,precise:!1}},Wu=function(e,t,n){if(t===void 0&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;let r=Hu(e,t);if(r.precise)return r.result;let i=Uu(e,t);return i.precise?i.result:r.result+n},Gu=function(e,t,n){if(!e)return 0;if(typeof n!=`number`&&(n=0),t===void 0){if(e.totalDuration)return e.totalDuration;if(!e.endList)return x.Infinity}return Wu(e,t,n)},Ku=function({defaultDuration:e,durationList:t,startIndex:n,endIndex:r}){let i=0;if(n>r&&([n,r]=[r,n]),n<0){for(let t=n;t<Math.min(0,r);t++)i+=e;n=0}for(let e=n;e<r;e++)i+=t[e].duration;return i},qu=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return Gu(e);if(t===null)return null;t||=0;let i=Wu(e,e.mediaSequence+e.segments.length,t);return n&&(r=typeof r==`number`?r:Vu(null,e),i-=r),Math.max(0,i)},Ju=function(e,t,n){let r=t||0,i=qu(e,t,!0,n);return i===null?Su():(i<r&&(i=r),Su(r,i))},Yu=function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:i,exactManifestTimings:a}){let o=t-i,s=Ru(e),c=0;for(let e=0;e<s.length;e++){let t=s[e];if(n===t.segmentIndex&&(typeof r!=`number`||typeof t.partIndex!=`number`||r===t.partIndex)){c=e;break}}if(o<0){if(c>0)for(let t=c-1;t>=0;t--){let n=s[t];if(o+=n.duration,a){if(o<0)continue}else if(o+wu<=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i-Ku({defaultDuration:e.targetDuration,durationList:s,startIndex:c,endIndex:t})}}return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t}}if(c<0){for(let n=c;n<0;n++)if(o-=e.targetDuration,o<0)return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t};c=0}for(let t=c;t<s.length;t++){let n=s[t];o-=n.duration;let r=n.duration>wu,l=o===0,u=r&&o+wu>=0;if(!l&&!u||t===s.length-1){if(a){if(o>0)continue}else if(o-wu>=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i+Ku({defaultDuration:e.targetDuration,durationList:s,startIndex:c,endIndex:t})}}}return{segmentIndex:s[s.length-1].segmentIndex,partIndex:s[s.length-1].partIndex,startTime:t}},Xu=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Zu=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Qu=function(e){let t=Xu(e);return!e.disabled&&!t},$u=function(e){return e.disabled},ed=function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},td=function(e,t){return t.attributes&&t.attributes[e]},nd=function(e,t,n,r=0){return td(`BANDWIDTH`,n)?(e*n.attributes.BANDWIDTH-r*8)/t:NaN},rd=(e,t)=>{if(e.playlists.length===1)return!0;let n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>Qu(e)?(e.attributes.BANDWIDTH||0)<n:!1).length===0},id=(e,t)=>!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri),ad=function(e,t){let n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(let e in n){for(let i in n[e])if(r=t(n[e][i]),r)break;if(r)break}return!!r},od=e=>{if(!e||!e.playlists||!e.playlists.length)return ad(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;if(!(r&&r.split(`,`).every(e=>Et(e))||ad(e,e=>id(n,e))))return!1}return!0};var sd={liveEdgeDelay:Vu,duration:Gu,seekable:Ju,getMediaInfoForTime:Yu,isEnabled:Qu,isDisabled:$u,isExcluded:Xu,isIncompatible:Zu,playlistEnd:qu,isAes:ed,hasAttribute:td,estimateSegmentRequestTime:nd,isLowestEnabledRendition:rd,isAudioOnly:od,playlistMatch:id,segmentDurationWithParts:Lu};const{log:cd}=Z,ld=(e,t)=>`${e}-${t}`,ud=(e,t,n)=>`placeholder-uri-${e}-${t}-${n}`,dd=({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:i=[],llhls:a})=>{let o=new yt;e&&o.on(`warn`,e),t&&o.on(`info`,t),r.forEach(e=>o.addParser(e)),i.forEach(e=>o.addTagMapper(e)),o.push(n),o.end();let s=o.manifest;if(a||([`preloadSegment`,`skip`,`serverControl`,`renditionReports`,`partInf`,`partTargetDuration`].forEach(function(e){s.hasOwnProperty(e)&&delete s[e]}),s.segments&&s.segments.forEach(function(e){[`parts`,`preloadHints`].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!s.targetDuration){let t=10;s.segments&&s.segments.length&&(t=s.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),s.targetDuration=t}let c=zu(s);if(c.length&&!s.partTargetDuration){let t=c.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),cd.error(`LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.`)),s.partTargetDuration=t}return s},fd=(e,t)=>{e.mediaGroups&&[`AUDIO`,`SUBTITLES`].forEach(n=>{if(e.mediaGroups[n])for(let r in e.mediaGroups[n])for(let i in e.mediaGroups[n][r]){let a=e.mediaGroups[n][r][i];t(a,n,r,i)}})},pd=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},md=e=>{let t=e.playlists.length;for(;t--;){let n=e.playlists[t];pd({playlist:n,id:ld(t,n.uri)}),n.resolvedUri=yu(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||cd.warn(`Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.`)}},hd=e=>{fd(e,t=>{t.uri&&(t.resolvedUri=yu(e.uri,t.uri))})},gd=(e,t)=>{let n=ld(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:x.location.href,resolvedUri:x.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r},_d=(e,t,n=ud)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){let n=`placeholder-uri-${t}`;e.playlists[t].uri=n}let r=od(e);fd(e,(t,i,a,o)=>{if(!t.playlists||!t.playlists.length){if(r&&i===`AUDIO`&&!t.uri)for(let t=0;t<e.playlists.length;t++){let n=e.playlists[t];if(n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===a)return}t.playlists=[R({},t)]}t.playlists.forEach(function(t,r){let s=n(i,a,o,t),c=ld(r,s);t.uri?t.resolvedUri=t.resolvedUri||yu(e.uri,t.uri):(t.uri=r===0?s:c,t.resolvedUri=t.uri),t.id=t.id||c,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),md(e),hd(e)};class vd{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;let[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;let[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];let e={},t=[];this.pendingDateRanges_.forEach((n,r)=>{this.processedDateRanges_.has(r)||(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),n.class&&(e[n.class]?n.classListIndex=e[n.class].push(n)-1:(e[n.class]=[n],n.classListIndex=0)))});for(let n of t){let t=e[n.class]||[];n.endTime=n.endDate?n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&t[n.classListIndex+1]?t[n.classListIndex+1].startTime:n.duration?n.startTime+n.duration:n.plannedDuration?n.startTime+n.plannedDuration:n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,n)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(n)})}}const yd=({requestType:e,request:t,error:n,parseFailure:r})=>{let i=t.status<200||t.status>299,a=t.status>=400&&t.status<=499,o={uri:t.uri,requestType:e},s=i&&!a||r;return n&&a?(o.error=R({},n),o.errorType=Z.Error.NetworkRequestFailed):t.aborted?o.errorType=Z.Error.NetworkRequestAborted:t.timedout?o.errorType=Z.Error.NetworkRequestTimeout:s&&(o.errorType=r?Z.Error.NetworkBodyParserFailed:Z.Error.NetworkBadStatus,o.status=t.status,o.headers=t.headers),o},bd=xu(`CodecUtils`),xd=function(e){let t=e.attributes||{};if(t.CODECS)return wt(t.CODECS)},Sd=(e,t)=>{let n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},Cd=(e,t)=>{if(!Sd(e,t))return!0;let n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(let e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1},wd=function(e){let t={};return e.forEach(({mediaType:e,type:n,details:r})=>{t[e]=t[e]||[],t[e].push(Ct(`${n}${r}`))}),Object.keys(t).forEach(function(e){t[e].length>1?(bd(`multiple ${e} codecs found as attributes: ${t[e].join(`, `)}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null):t[e]=t[e][0]}),t},Td=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Ed=function(e,t){let n=t.attributes||{},r=wd(xd(t)||[]);if(Sd(e,t)&&!r.audio&&!Cd(e,t)){let t=wd(Tt(e,n.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},{EventTarget:Dd}=Z,Od=(e,t)=>{if(t.endList||!t.serverControl)return e;let n={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,r=t.mediaSequence+t.segments.length;if(e){let i=e.parts||[],a=Bu(t)-1;a>-1&&a!==i.length-1&&(n._HLS_part=a),(a>-1||i.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?`v2`:`YES`),Object.keys(n).length){let t=new x.URL(e);[`_HLS_skip`,`_HLS_msn`,`_HLS_part`].forEach(function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])}),e=t.toString()}return e},kd=(e,t)=>{if(!e)return t;let n=Q(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=Q(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Ad=(e,t,n)=>{let r=e.slice(),i=t.slice();n||=0;let a=[],o;for(let e=0;e<i.length;e++){let t=r[e+n],s=i[e];t?(o=t.map||o,a.push(kd(t,s))):(o&&!s.map&&(s.map=o),a.push(s))}return a},jd=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=yu(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=yu(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=yu(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=yu(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||=yu(t,e.uri)}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||=yu(t,e.uri)})},Md=function(e){let t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(let e=0;e<n.preloadHints.length;e++)if(n.preloadHints[e].type===`MAP`)return t}n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Nd=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,Pd=(e,t,n=Nd)=>{let r=Q(e,{}),i=r.playlists[t.id];if(!i||n(i,t))return null;t.segments=Md(t);let a=Q(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}a.segments=Ad(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach(e=>{jd(e,a.resolvedUri)});for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,fd(e,(e,n,r,i)=>{if(e.playlists)for(let n=0;n<e.playlists.length;n++)t.id===e.playlists[n].id&&(e.playlists[n]=a)}),r},Fd=(e,t)=>{let n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},Id=(e,t,n)=>{if(!e)return;let r=[];return e.forEach(e=>{if(!e.attributes)return;let{BANDWIDTH:t,RESOLUTION:n,CODECS:i}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:n,codecs:i})}),{type:t,isLive:n,renditions:r}};class Ld extends Dd{constructor(e,t,n={}){if(super(),!e)throw Error(`A non-empty playlist URL or object is required`);this.logger_=xu(`PlaylistLoader`);let{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;let i=t.options_;this.customTagParsers=i&&i.customTagParsers||[],this.customTagMappers=i&&i.customTagMappers||[],this.llhls=i&&i.llhls,this.dateRangesStorage_=new vd,this.state=`HAVE_NOTHING`,this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on(`mediaupdatetimeout`,this.handleMediaupdatetimeout_),this.on(`loadedplaylist`,this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!==`HAVE_METADATA`)return;let e=this.media(),t=yu(this.main.uri,e.uri);this.llhls&&(t=Od(t,e)),this.state=`HAVE_CURRENT_METADATA`,this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:`hls-playlist`},(e,t)=>{if(this.request){if(e)return this.playlistRequestError(this.request,this.media(),`HAVE_METADATA`);this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,n){let{uri:r,id:i}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[i],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:yd({requestType:e.requestType,request:e,error:e.error})},this.trigger(`error`)}parseManifest_({url:e,manifestString:t}){try{let n=dd({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!n.playlists||!n.playlists.length||this.excludeAudioOnlyVariants(n.playlists),n}catch(e){this.error=e,this.error.metadata={errorType:Z.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){let t=e=>{let{width:t,height:n}=(e.attributes||{}).RESOLUTION||{};if(t&&n)return!0;let r=xd(e)||[];return!!wd(r).video};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state=`HAVE_METADATA`;let i={playlistInfo:{type:`media`,uri:n}};this.trigger({type:`playlistparsestart`,metadata:i});let a=t||this.parseManifest_({url:n,manifestString:e});a.lastRequest=Date.now(),pd({playlist:a,uri:n,id:r});let o=Pd(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger(`playlistunchanged`),this.updateMediaUpdateTimeout_(Fd(this.media(),!!o)),i.parsedPlaylist=Id(this.main.playlists,i.playlistInfo.type,!this.media_.endList),this.trigger({type:`playlistparsecomplete`,metadata:i}),this.trigger(`loadedplaylist`)}dispose(){this.trigger(`dispose`),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),x.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new vd,this.off()}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state===`HAVE_NOTHING`)throw Error(`Cannot switch media playlist from `+this.state);if(typeof e==`string`){if(!this.main.playlists[e])throw Error(`Unknown playlist URI: `+e);e=this.main.playlists[e]}if(x.clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=x.setTimeout(this.media.bind(this,e,!1),t);return}let n=this.state,r=!this.media_||e.id!==this.media_.id,i=this.main.playlists[e.id];if(i&&i.endList||e.endList&&e.segments.length){this.request&&=(this.request.onreadystatechange=null,this.request.abort(),null),this.state=`HAVE_METADATA`,this.media_=e,r&&(this.trigger(`mediachanging`),n===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`));return}if(this.updateMediaUpdateTimeout_(Fd(e,!0)),!r)return;if(this.state=`SWITCHING_MEDIA`,this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger(`mediachanging`),this.pendingMedia_=e;let a={playlistInfo:{type:`media`,uri:e.uri}};this.trigger({type:`playlistrequeststart`,metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:`hls-playlist`},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=bu(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.trigger({type:`playlistrequestcomplete`,metadata:a}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),n===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`)}})}pause(){this.mediaUpdateTimeout&&=(x.clearTimeout(this.mediaUpdateTimeout),null),this.stopRequest(),this.state===`HAVE_NOTHING`&&(this.started=!1),this.state===`SWITCHING_MEDIA`?this.state=this.media_?`HAVE_METADATA`:`HAVE_MAIN_MANIFEST`:this.state===`HAVE_CURRENT_METADATA`&&(this.state=`HAVE_METADATA`)}load(e){this.mediaUpdateTimeout&&=(x.clearTimeout(this.mediaUpdateTimeout),null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)}else this.started?t&&!t.endList?this.trigger(`mediaupdatetimeout`):this.trigger(`loadedplaylist`):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&=(x.clearTimeout(this.mediaUpdateTimeout),null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger(`mediaupdatetimeout`),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src==`object`){this.src.uri||(this.src.uri=x.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}let e={playlistInfo:{type:`multivariant`,uri:this.src}};this.trigger({type:`playlistrequeststart`,metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:`hls-playlist`},(t,n)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:yd({requestType:n.requestType,request:n,error:t})},this.state===`HAVE_NOTHING`&&(this.started=!1),this.trigger(`error`);this.trigger({type:`playlistrequestcomplete`,metadata:e}),this.src=bu(this.src,n),this.trigger({type:`playlistparsestart`,metadata:e});let r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=Id(r.playlists,e.playlistInfo.type,!1),this.trigger({type:`playlistparsecomplete`,metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src==`string`?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state=`HAVE_MAIN_MANIFEST`,e.playlists){this.main=e,_d(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=Md(e),e.segments.forEach(t=>{jd(t,e.resolvedUri)})}),this.trigger(`loadedplaylist`),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||x.location.href;this.main=gd(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger(`loadedmetadata`)}updateOrDeleteClone(e,t){let n=this.main,r=e.ID,i=n.playlists.length;for(;i--;){let a=n.playlists[i];if(a.attributes[`PATHWAY-ID`]===r){let o=a.resolvedUri,s=a.id;if(t){let t=this.createCloneURI_(a.resolvedUri,e),o=ld(r,t),s=this.createCloneAttributes_(r,a.attributes),c=this.createClonePlaylist_(a,o,e,s);n.playlists[i]=c,n.playlists[o]=c,n.playlists[t]=c}else n.playlists.splice(i,1);delete n.playlists[s],delete n.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let n=this.main,r=e.ID;[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(e=>{if(n.mediaGroups[e]&&n.mediaGroups[e][r]){for(let t in n.mediaGroups[e])if(t===r){for(let r in n.mediaGroups[e][t])n.mediaGroups[e][t][r].playlists.forEach((e,t)=>{let r=n.playlists[e.id],i=r.id,a=r.resolvedUri;delete n.playlists[i],delete n.playlists[a]});delete n.mediaGroups[e][t]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let n=this.main,r=n.playlists.length,i=this.createCloneURI_(t.resolvedUri,e),a=ld(e.ID,i),o=this.createCloneAttributes_(e.ID,t.attributes),s=this.createClonePlaylist_(t,a,e,o);n.playlists[r]=s,n.playlists[a]=s,n.playlists[i]=s,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,n=e[`BASE-ID`],r=this.main;[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(i=>{if(r.mediaGroups[i]&&!r.mediaGroups[i][t])for(let a in r.mediaGroups[i]){if(a===n)r.mediaGroups[i][t]={};else continue;for(let n in r.mediaGroups[i][a]){let o=r.mediaGroups[i][a][n];r.mediaGroups[i][t][n]=R({},o);let s=r.mediaGroups[i][t][n],c=this.createCloneURI_(o.resolvedUri,e);s.resolvedUri=c,s.uri=c,s.playlists=[],o.playlists.forEach((a,o)=>{let c=r.playlists[a.id],l=ud(i,t,n),u=ld(t,l);if(c&&!r.playlists[u]){let t=this.createClonePlaylist_(c,u,e),n=t.resolvedUri;r.playlists[u]=t,r.playlists[n]=t}s.playlists[o]=this.createClonePlaylist_(a,u,e)})}}})}createClonePlaylist_(e,t,n,r){let i=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:i,uri:i,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Q(e,a)}createCloneURI_(e,t){let n=new URL(e);n.hostname=t[`URI-REPLACEMENT`].HOST;let r=t[`URI-REPLACEMENT`].PARAMS;for(let e of Object.keys(r))n.searchParams.set(e,r[e]);return n.href}createCloneAttributes_(e,t){let n={"PATHWAY-ID":e};return[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(r=>{t[r]&&(n[r]=e)}),n}getKeyIdSet(e){let t=new Set;if(!e||!e.contentProtection)return t;for(let n in e.contentProtection)if(e.contentProtection[n]&&e.contentProtection[n].attributes&&e.contentProtection[n].attributes.keyId){let r=e.contentProtection[n].attributes.keyId;t.add(r.toLowerCase())}return t}}const Rd=function(e,t,n,r){let i=e.responseType===`arraybuffer`?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)),n.headers&&(e.responseHeaders=n.headers),t&&t.code===`ETIMEDOUT`&&(e.timedout=!0),!t&&!e.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(t=Error(`XHR Failed with a response of: `+(e&&(i||e.responseText)))),r(t,e)},zd=(e,t)=>{if(!e||!e.size)return;let n=t;return e.forEach(e=>{n=e(n)}),n},Bd=(e,t,n,r)=>{e&&e.size&&e.forEach(e=>{e(t,n,r)})},Vd=function(){let e=function e(t,n){t=Q({timeout:45e3},t);let r=e.beforeRequest||Z.Vhs.xhr.beforeRequest,i=e._requestCallbackSet||Z.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||Z.Vhs.xhr._responseCallbackSet;r&&typeof r==`function`&&(Z.log.warn(`beforeRequest is deprecated, use onRequest instead.`),i.add(r));let o=Z.Vhs.xhr.original===!0?Z.xhr:Z.Vhs.xhr,s=zd(i,t);i.delete(r);let c=o(s||t,function(e,t){return Bd(a,c,e,t),Rd(c,e,t,n)}),l=c.abort;return c.abort=function(){return c.aborted=!0,l.apply(c,arguments)},c.uri=t.uri,c.requestType=t.requestType,c.requestTime=Date.now(),c};return e.original=!0,e},Hd=function(e){let t,n=e.offset;return t=typeof e.offset==`bigint`||typeof e.length==`bigint`?x.BigInt(e.offset)+x.BigInt(e.length)-x.BigInt(1):e.offset+e.length-1,`bytes=`+n+`-`+t},Ud=function(e){let t={};return e.byterange&&(t.Range=Hd(e.byterange)),t},Wd=function(e,t){return e.start(t)+`-`+e.end(t)},Gd=function(e,t){let n=e.toString(16);return`00`.substring(0,2-n.length)+n+(t%2?` `:``)},Kd=function(e){return e>=32&&e<126?String.fromCharCode(e):`.`},qd=function(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];Rt(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t},Jd=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(`,`)},Yd=function(e){return e.resolvedUri},Xd=e=>{let t=Array.prototype.slice.call(e),n=``,r,i;for(let e=0;e<t.length/16;e++)r=t.slice(e*16,e*16+16).map(Gd).join(``),i=t.slice(e*16,e*16+16).map(Kd).join(``),n+=r+` `+i+`
183
- `;return n};var Zd=Object.freeze({__proto__:null,createTransferableMessage:qd,initSegmentId:Jd,segmentKeyId:Yd,hexDump:Xd,tagDump:({bytes:e})=>Xd(e),textRanges:e=>{let t=``,n=0;for(;n<e.length;n++)t+=Wd(e,n)+` `;return t}});const Qd=.25,$d=(e,t)=>{if(!t.dateTimeObject)return null;let n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+r*1e3)},ef=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,tf=(e,t)=>{let n;try{n=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1;e++){r=t.segments[e];let i=new Date(t.segments[e+1].dateTimeObject);if(n<i)break}let i=t.segments[t.segments.length-1],a=i.dateTimeObject,o=i.videoTimingInfo?ef(i.videoTimingInfo):i.duration+i.duration*Qd,s=new Date(a.getTime()+o*1e3);return n>s?null:(n>new Date(a)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:sd.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?`accurate`:`estimate`})},nf=(e,t)=>{if(!t||!t.segments||t.segments.length===0)return null;let n=0,r;for(let i=0;i<t.segments.length&&(r=t.segments[i],n=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration,!(e<=n));i++);let i=t.segments[t.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+i.duration*Qd)return null;r=i}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?`accurate`:`estimate`}},rf=(e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch{}let i=n.getTime();return(r.getTime()-i)/1e3},af=e=>{if(!e.segments||e.segments.length===0)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0},of=({playlist:e,time:t=void 0,callback:n})=>{if(!n)throw Error(`getProgramTime: callback must be provided`);if(!e||t===void 0)return n({message:`getProgramTime: playlist and time must be provided`});let r=nf(t,e);if(!r)return n({message:`valid programTime was not found`});if(r.type===`estimate`)return n({message:`Accurate programTime could not be determined. Please seek to e.seekTime and try again`,seekTime:r.estimatedStart});let i={mediaSeconds:t},a=$d(t,r.segment);return a&&(i.programDateTime=a.toISOString()),n(null,i)},sf=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:a,callback:o})=>{if(!o)throw Error(`seekToProgramTime: callback must be provided`);if(e===void 0||!t||!r)return o({message:`seekToProgramTime: programTime, seekTo and playlist must be provided`});if(!t.endList&&!a.hasStarted_)return o({message:`player must be playing a live stream to start buffering`});if(!af(t))return o({message:`programDateTime tags must be provided in the manifest `+t.resolvedUri});let s=tf(e,t);if(!s)return o({message:`${e} was not found in the stream`});let c=s.segment,l=rf(c.dateTimeObject,e);if(s.type===`estimate`){if(n===0)return o({message:`${e} is not buffered yet. Try again`});r(s.estimatedStart+l),a.one(`seeked`,()=>{sf({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:a,callback:o})});return}let u=c.start+l;a.one(`seeked`,()=>o(null,a.currentTime())),i&&a.pause(),r(u)},cf=(e,t)=>{if(e.readyState===4)return t()},lf=(e,t,n,r)=>{let i=[],a,o=!1,s=function(e,t,r,i){return t.abort(),o=!0,n(e,t,r,i)},c=function(e,t){if(o)return;if(e)return e.metadata=yd({requestType:r,request:t,error:e}),s(e,t,``,i);let n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=Gt(i,Wt(n,!0)),a||=Hr(i),i.length<10||a&&i.length<a+2)return cf(t,()=>s(e,t,``,i));let c=di(i);return c===`ts`&&i.length<188||!c&&i.length<376?cf(t,()=>s(e,t,``,i)):s(null,t,c,i)},l=t({uri:e,beforeSend(e){e.overrideMimeType(`text/plain; charset=x-user-defined`),e.addEventListener(`progress`,function({total:t,loaded:n}){return Rd(e,null,{statusCode:e.status},c)})}},function(e,t){return Rd(l,e,t,c)});return l},{EventTarget:uf}=Z,df=function(e,t){if(!Nd(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n<e.segments.length;n++){let r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;let a=r.byterange,o=i.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}return!0},ff=(e,t,n,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`,pf=({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{let a=jr(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return _d(a,t,ff),a},mf=(e,t)=>{fd(e,(n,r,i,a)=>{(!t.mediaGroups[r][i]||!(a in t.mediaGroups[r][i]))&&delete e.mediaGroups[r][i][a]})},hf=(e,t,n)=>{let r=!0,i=Q(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let a=t.playlists[e];if(a.sidx){let e=Ln(a.sidx);n&&n[e]&&n[e].sidx&&kn(a,n[e].sidx,a.sidx.resolvedUri)}let o=Pd(i,a,df);o&&(i=o,r=!1)}return fd(t,(e,t,n,a)=>{if(e.playlists&&e.playlists.length){let o=e.playlists[0].id,s=Pd(i,e.playlists[0],df);s&&(i=s,a in i.mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[o],r=!1)}}),mf(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i},gf=(e,t)=>(!e.map&&!t.map||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,_f=(e,t)=>{let n={};for(let r in e){let i=e[r].sidx;if(i){let e=Ln(i);if(!t[e])break;let r=t[e].sidxInfo;gf(r,i)&&(n[e]=t[e])}}return n},vf=(e,t)=>{let n=_f(e.playlists,t);return fd(e,(e,r,i,a)=>{if(e.playlists&&e.playlists.length){let r=e.playlists;n=Q(n,_f(r,t))}}),n};class yf extends uf{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw Error(`A non-empty playlist URL or object is required`);this.on(`minimumUpdatePeriod`,()=>{this.refreshXml_()}),this.on(`mediaupdatetimeout`,()=>{this.refreshMedia_(this.media().id)}),this.state=`HAVE_NOTHING`,this.loadedPlaylists_={},this.logger_=xu(`DashPlaylistLoader`),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e==`object`&&!(e instanceof Error)?e:{status:t.status,message:`DASH request error at URL: `+t.uri,response:t.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger(`error`),!0}addSidxSegments_(e,t,n){let r=e.sidx&&Ln(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){x.clearTimeout(this.mediaRequest_),this.mediaRequest_=x.setTimeout(()=>n(!1),0);return}let i=bu(e.sidx.resolvedUri),a=(i,a)=>{if(this.requestErrored_(i,a,t))return;let o=this.mainPlaylistLoader_.sidxMapping_,{requestType:s}=a,c;try{c=Br(z(a.response).subarray(8))}catch(e){e.metadata=yd({requestType:s,request:a,parseFailure:!0}),this.requestErrored_(e,a,t);return}return o[r]={sidxInfo:e.sidx,sidx:c},kn(e,c,e.sidx.resolvedUri),n(!0)};this.request=lf(i,this.vhs_.xhr,(t,n,r,o)=>{if(t)return a(t,n);if(!r||r!==`mp4`){let t=r||`unknown`;return a({status:n.status,message:`Unsupported ${t} container type for sidx segment at URL: ${i}`,response:``,playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n)}let{offset:s,length:c}=e.sidx.byterange;if(o.length>=c+s)return a(t,{response:o.subarray(s,s+c),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:i,responseType:`arraybuffer`,requestType:`dash-sidx`,headers:Ud({byterange:e.sidx.byterange})},a)},`dash-sidx`)}dispose(){this.isPaused_=!0,this.trigger(`dispose`),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off(`loadedmetadata`,this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state===`HAVE_NOTHING`)throw Error(`Cannot switch media playlist from `+this.state);let t=this.state;if(typeof e==`string`){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error(`Unknown playlist URI: `+e);e=this.mainPlaylistLoader_.main.playlists[e]}let n=!this.media_||e.id!==this.media_.id;n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList?(this.state=`HAVE_METADATA`,this.media_=e,n&&(this.trigger(`mediachanging`),this.trigger(`mediachange`))):n&&(this.media_&&this.trigger(`mediachanging`),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state=`HAVE_METADATA`,this.loadedPlaylists_[t.id]=t,x.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`)}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off(`loadedmetadata`,this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state===`HAVE_NOTHING`&&(this.started=!1)}load(e){this.isPaused_=!1,x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger(`minimumUpdatePeriod`),this.updateMinimumUpdatePeriodTimeout_()),this.trigger(`mediaupdatetimeout`)):this.trigger(`loadedplaylist`):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])}):(x.clearTimeout(this.mediaRequest_),this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0))}requestMain_(e){let t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:`manifestrequeststart`,metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:`dash-manifest`},(n,r)=>{if(n){let{requestType:e}=r;n.metadata=yd({requestType:e,request:r,error:n})}if(this.requestErrored_(n,r)){this.state===`HAVE_NOTHING`&&(this.started=!1);return}this.trigger({type:`manifestrequestcomplete`,metadata:t});let i=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,this.mainLoaded_=r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):Date.now(),this.mainPlaylistLoader_.srcUrl=bu(this.mainPlaylistLoader_.srcUrl,r),i)this.handleMain_(),this.syncClientServerClock_(()=>e(r,i));else return e(r,i)})}syncClientServerClock_(e){let t=Mr(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method===`DIRECT`)return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:yu(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:`dash-clock-sync`},(n,r)=>{if(!this.request)return;if(n){let{requestType:t}=r;return this.error.metadata=yd({requestType:t,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let i;i=t.method===`HEAD`?!r.responseHeaders||!r.responseHeaders.date?this.mainLoaded_:Date.parse(r.responseHeaders.date):Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()})}haveMain_(){this.state=`HAVE_MAIN_MANIFEST`,this.isMain_?this.trigger(`loadedplaylist`):this.media_||this.media(this.childPlaylist_)}handleMain_(){x.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:`manifestparsestart`,metadata:t});let n;try{n=pf({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Z.Error.StreamingDashManifestParserError,error:e},this.trigger(`error`)}e&&(n=hf(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){let{duration:e,endList:r}=n,i=[];n.playlists.forEach(e=>{i.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),t.parsedManifest={duration:e,isLive:!r,renditions:i},this.trigger({type:`manifestparsecomplete`,metadata:t})}return!!n}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&=(e.off(`loadedmetadata`,e.createMupOnMedia_),null),e.minimumUpdatePeriodTimeout_&&=(x.clearTimeout(e.minimumUpdatePeriodTimeout_),null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one(`loadedmetadata`,e.createMupOnMedia_))),typeof t!=`number`||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger(`minimumUpdatePeriod`),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&=this.mainPlaylistLoader_.main.playlists[this.media_.id],this.mainPlaylistLoader_.sidxMapping_=vf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error(`refreshMedia_ must take a media id`);this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger(`playlistunchanged`),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger(`mediaupdatetimeout`),e()},Fd(this.media(),!!n)))};e()}this.trigger(`loadedplaylist`)}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack(`EventStream`,e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let n in e.contentProtection){let r=e.contentProtection[n].attributes[`cenc:default_KID`];r&&t.add(r.replace(/-/g,``).toLowerCase())}return t}}}var bf={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const xf=e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer},Sf=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Cf=function(e){try{return URL.createObjectURL(new Blob([e],{type:`application/javascript`}))}catch{let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},wf=function(e){return function(){let t=Cf(e),n=Sf(new Worker(t));n.objURL=t;let r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},Tf=function(e){return`var browserWorkerPolyFill = ${Sf.toString()};\nbrowserWorkerPolyFill(self);
183
+ `;return n};var Zd=Object.freeze({__proto__:null,createTransferableMessage:qd,initSegmentId:Jd,segmentKeyId:Yd,hexDump:Xd,tagDump:({bytes:e})=>Xd(e),textRanges:e=>{let t=``,n=0;for(;n<e.length;n++)t+=Wd(e,n)+` `;return t}});const Qd=.25,$d=(e,t)=>{if(!t.dateTimeObject)return null;let n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+r*1e3)},ef=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,tf=(e,t)=>{let n;try{n=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1;e++){r=t.segments[e];let i=new Date(t.segments[e+1].dateTimeObject);if(n<i)break}let i=t.segments[t.segments.length-1],a=i.dateTimeObject,o=i.videoTimingInfo?ef(i.videoTimingInfo):i.duration+i.duration*Qd,s=new Date(a.getTime()+o*1e3);return n>s?null:(n>new Date(a)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:sd.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?`accurate`:`estimate`})},nf=(e,t)=>{if(!t||!t.segments||t.segments.length===0)return null;let n=0,r;for(let i=0;i<t.segments.length&&(r=t.segments[i],n=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration,!(e<=n));i++);let i=t.segments[t.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+i.duration*Qd)return null;r=i}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?`accurate`:`estimate`}},rf=(e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch{}let i=n.getTime();return(r.getTime()-i)/1e3},af=e=>{if(!e.segments||e.segments.length===0)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0},of=({playlist:e,time:t=void 0,callback:n})=>{if(!n)throw Error(`getProgramTime: callback must be provided`);if(!e||t===void 0)return n({message:`getProgramTime: playlist and time must be provided`});let r=nf(t,e);if(!r)return n({message:`valid programTime was not found`});if(r.type===`estimate`)return n({message:`Accurate programTime could not be determined. Please seek to e.seekTime and try again`,seekTime:r.estimatedStart});let i={mediaSeconds:t},a=$d(t,r.segment);return a&&(i.programDateTime=a.toISOString()),n(null,i)},sf=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:a,callback:o})=>{if(!o)throw Error(`seekToProgramTime: callback must be provided`);if(e===void 0||!t||!r)return o({message:`seekToProgramTime: programTime, seekTo and playlist must be provided`});if(!t.endList&&!a.hasStarted_)return o({message:`player must be playing a live stream to start buffering`});if(!af(t))return o({message:`programDateTime tags must be provided in the manifest `+t.resolvedUri});let s=tf(e,t);if(!s)return o({message:`${e} was not found in the stream`});let c=s.segment,l=rf(c.dateTimeObject,e);if(s.type===`estimate`){if(n===0)return o({message:`${e} is not buffered yet. Try again`});r(s.estimatedStart+l),a.one(`seeked`,()=>{sf({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:a,callback:o})});return}let u=c.start+l;a.one(`seeked`,()=>o(null,a.currentTime())),i&&a.pause(),r(u)},cf=(e,t)=>{if(e.readyState===4)return t()},lf=(e,t,n,r)=>{let i=[],a,o=!1,s=function(e,t,r,i){return t.abort(),o=!0,n(e,t,r,i)},c=function(e,t){if(o)return;if(e)return e.metadata=yd({requestType:r,request:t,error:e}),s(e,t,``,i);let n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=Gt(i,Wt(n,!0)),a||=Hr(i),i.length<10||a&&i.length<a+2)return cf(t,()=>s(e,t,``,i));let c=di(i);return c===`ts`&&i.length<188||!c&&i.length<376?cf(t,()=>s(e,t,``,i)):s(null,t,c,i)},l=t({uri:e,beforeSend(e){e.overrideMimeType(`text/plain; charset=x-user-defined`),e.addEventListener(`progress`,function({total:t,loaded:n}){return Rd(e,null,{statusCode:e.status},c)})}},function(e,t){return Rd(l,e,t,c)});return l},{EventTarget:uf}=Z,df=function(e,t){if(!Nd(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n<e.segments.length;n++){let r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;let a=r.byterange,o=i.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}return!0},ff=(e,t,n,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`,pf=({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{let a=jr(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return _d(a,t,ff),a},mf=(e,t)=>{fd(e,(n,r,i,a)=>{t.mediaGroups[r][i]&&a in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][a]})},hf=(e,t,n)=>{let r=!0,i=Q(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let a=t.playlists[e];if(a.sidx){let e=Ln(a.sidx);n&&n[e]&&n[e].sidx&&kn(a,n[e].sidx,a.sidx.resolvedUri)}let o=Pd(i,a,df);o&&(i=o,r=!1)}return fd(t,(e,t,n,a)=>{if(e.playlists&&e.playlists.length){let o=e.playlists[0].id,s=Pd(i,e.playlists[0],df);s&&(i=s,a in i.mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[o],r=!1)}}),mf(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i},gf=(e,t)=>(!e.map&&!t.map||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,_f=(e,t)=>{let n={};for(let r in e){let i=e[r].sidx;if(i){let e=Ln(i);if(!t[e])break;let r=t[e].sidxInfo;gf(r,i)&&(n[e]=t[e])}}return n},vf=(e,t)=>{let n=_f(e.playlists,t);return fd(e,(e,r,i,a)=>{if(e.playlists&&e.playlists.length){let r=e.playlists;n=Q(n,_f(r,t))}}),n};class yf extends uf{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw Error(`A non-empty playlist URL or object is required`);this.on(`minimumUpdatePeriod`,()=>{this.refreshXml_()}),this.on(`mediaupdatetimeout`,()=>{this.refreshMedia_(this.media().id)}),this.state=`HAVE_NOTHING`,this.loadedPlaylists_={},this.logger_=xu(`DashPlaylistLoader`),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e==`object`&&!(e instanceof Error)?e:{status:t.status,message:`DASH request error at URL: `+t.uri,response:t.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger(`error`),!0}addSidxSegments_(e,t,n){let r=e.sidx&&Ln(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){x.clearTimeout(this.mediaRequest_),this.mediaRequest_=x.setTimeout(()=>n(!1),0);return}let i=bu(e.sidx.resolvedUri),a=(i,a)=>{if(this.requestErrored_(i,a,t))return;let o=this.mainPlaylistLoader_.sidxMapping_,{requestType:s}=a,c;try{c=Br(z(a.response).subarray(8))}catch(e){e.metadata=yd({requestType:s,request:a,parseFailure:!0}),this.requestErrored_(e,a,t);return}return o[r]={sidxInfo:e.sidx,sidx:c},kn(e,c,e.sidx.resolvedUri),n(!0)};this.request=lf(i,this.vhs_.xhr,(t,n,r,o)=>{if(t)return a(t,n);if(!r||r!==`mp4`){let t=r||`unknown`;return a({status:n.status,message:`Unsupported ${t} container type for sidx segment at URL: ${i}`,response:``,playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n)}let{offset:s,length:c}=e.sidx.byterange;if(o.length>=c+s)return a(t,{response:o.subarray(s,s+c),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:i,responseType:`arraybuffer`,requestType:`dash-sidx`,headers:Ud({byterange:e.sidx.byterange})},a)},`dash-sidx`)}dispose(){this.isPaused_=!0,this.trigger(`dispose`),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off(`loadedmetadata`,this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state===`HAVE_NOTHING`)throw Error(`Cannot switch media playlist from `+this.state);let t=this.state;if(typeof e==`string`){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error(`Unknown playlist URI: `+e);e=this.mainPlaylistLoader_.main.playlists[e]}let n=!this.media_||e.id!==this.media_.id;n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList?(this.state=`HAVE_METADATA`,this.media_=e,n&&(this.trigger(`mediachanging`),this.trigger(`mediachange`))):n&&(this.media_&&this.trigger(`mediachanging`),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state=`HAVE_METADATA`,this.loadedPlaylists_[t.id]=t,x.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`)}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off(`loadedmetadata`,this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state===`HAVE_NOTHING`&&(this.started=!1)}load(e){this.isPaused_=!1,x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger(`minimumUpdatePeriod`),this.updateMinimumUpdatePeriodTimeout_()),this.trigger(`mediaupdatetimeout`)):this.trigger(`loadedplaylist`):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])}):(x.clearTimeout(this.mediaRequest_),this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0))}requestMain_(e){let t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:`manifestrequeststart`,metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:`dash-manifest`},(n,r)=>{if(n){let{requestType:e}=r;n.metadata=yd({requestType:e,request:r,error:n})}if(this.requestErrored_(n,r)){this.state===`HAVE_NOTHING`&&(this.started=!1);return}this.trigger({type:`manifestrequestcomplete`,metadata:t});let i=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,this.mainLoaded_=r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):Date.now(),this.mainPlaylistLoader_.srcUrl=bu(this.mainPlaylistLoader_.srcUrl,r),i)this.handleMain_(),this.syncClientServerClock_(()=>e(r,i));else return e(r,i)})}syncClientServerClock_(e){let t=Mr(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method===`DIRECT`)return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:yu(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:`dash-clock-sync`},(n,r)=>{if(!this.request)return;if(n){let{requestType:t}=r;return this.error.metadata=yd({requestType:t,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let i;i=t.method===`HEAD`?!r.responseHeaders||!r.responseHeaders.date?this.mainLoaded_:Date.parse(r.responseHeaders.date):Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()})}haveMain_(){this.state=`HAVE_MAIN_MANIFEST`,this.isMain_?this.trigger(`loadedplaylist`):this.media_||this.media(this.childPlaylist_)}handleMain_(){x.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:`manifestparsestart`,metadata:t});let n;try{n=pf({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Z.Error.StreamingDashManifestParserError,error:e},this.trigger(`error`)}e&&(n=hf(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){let{duration:e,endList:r}=n,i=[];n.playlists.forEach(e=>{i.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),t.parsedManifest={duration:e,isLive:!r,renditions:i},this.trigger({type:`manifestparsecomplete`,metadata:t})}return!!n}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&=(e.off(`loadedmetadata`,e.createMupOnMedia_),null),e.minimumUpdatePeriodTimeout_&&=(x.clearTimeout(e.minimumUpdatePeriodTimeout_),null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one(`loadedmetadata`,e.createMupOnMedia_))),typeof t!=`number`||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger(`minimumUpdatePeriod`),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&=this.mainPlaylistLoader_.main.playlists[this.media_.id],this.mainPlaylistLoader_.sidxMapping_=vf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error(`refreshMedia_ must take a media id`);this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger(`playlistunchanged`),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger(`mediaupdatetimeout`),e()},Fd(this.media(),!!n)))};e()}this.trigger(`loadedplaylist`)}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack(`EventStream`,e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let n in e.contentProtection){let r=e.contentProtection[n].attributes[`cenc:default_KID`];r&&t.add(r.replace(/-/g,``).toLowerCase())}return t}}}var bf={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const xf=e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer},Sf=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Cf=function(e){try{return URL.createObjectURL(new Blob([e],{type:`application/javascript`}))}catch{let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},wf=function(e){return function(){let t=Cf(e),n=Sf(new Worker(t));n.objURL=t;let r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},Tf=function(e){return`var browserWorkerPolyFill = ${Sf.toString()};\nbrowserWorkerPolyFill(self);
184
184
  `+e},Ef=function(e){return e.toString().replace(/^function.+?{/,``).slice(0,-1)};var Df=wf(Tf(Ef(function(){var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return e[t]?(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1):!1},this.trigger=function(t){var n=e[t],r,i,a;if(n){if(arguments.length===2)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on(`data`,function(t){e.push(t)}),this.on(`done`,function(t){e.flush(t)}),this.on(`partialdone`,function(t){e.partialFlush(t)}),this.on(`endedtimeline`,function(t){e.endTimeline(t)}),this.on(`reset`,function(t){e.reset(t)}),e},t.prototype.push=function(e){this.trigger(`data`,e)},t.prototype.flush=function(e){this.trigger(`done`,e)},t.prototype.partialFlush=function(e){this.trigger(`partialdone`,e)},t.prototype.endTimeline=function(e){this.trigger(`endedtimeline`,e)},t.prototype.reset=function(e){this.trigger(`reset`,e)};var n=t,r=2**32,i={getUint64:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n;return t.getBigUint64?(n=t.getBigUint64(0),n<2**53-1?Number(n):n):t.getUint32(0)*r+t.getUint32(4)},MAX_UINT32:r},a=i.MAX_UINT32,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,ee,k,A,te,ne,re,ie,j,ae,oe,se,ce,le;(function(){var e;if(O={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array<`u`){for(e in O)O.hasOwnProperty(e)&&(O[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);ee=new Uint8Array([105,115,111,109]),A=new Uint8Array([97,118,99,49]),k=new Uint8Array([0,0,0,1]),te=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ne=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),re={video:te,audio:ne},ae=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),j=new Uint8Array([0,0,0,0,0,0,0,0]),oe=new Uint8Array([0,0,0,0,0,0,0,0]),se=oe,ce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),le=oe,ie=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(e){for(var t=[],n=0,r=1,i,a;r<arguments.length;r++)t.push(arguments[r]);for(r=t.length;r--;)n+=t[r].byteLength;for(i=new Uint8Array(n+8),a=new DataView(i.buffer,i.byteOffset,i.byteLength),a.setUint32(0,i.byteLength),i.set(e,4),r=0,n=8;r<t.length;r++)i.set(t[r],n),n+=t[r].byteLength;return i},s=function(){return o(O.dinf,o(O.dref,ae))},c=function(e){return o(O.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},l=function(){return o(O.ftyp,ee,k,ee,A)},x=function(e){return o(O.hdlr,re[e])},u=function(e){return o(O.mdat,e)},b=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=e.samplerate&255),o(O.mdhd,t)},y=function(e){return o(O.mdia,b(e),x(e.type),f(e))},d=function(e){return o(O.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))},f=function(e){return o(O.minf,e.type===`video`?o(O.vmhd,ie):o(O.smhd,j),s(),C(e))},p=function(e,t){for(var n=[],r=t.length;r--;)n[r]=T(t[r]);return o.apply(null,[O.moof,d(e)].concat(n))},m=function(e){for(var t=e.length,n=[];t--;)n[t]=_(e[t]);return o.apply(null,[O.moov,g(4294967295)].concat(n,h(e)))},h=function(e){for(var t=e.length,n=[];t--;)n[t]=E(e[t]);return o.apply(null,[O.mvex].concat(n))},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(O.mvhd,t)},S=function(e){for(var t=e.samples||[],n=new Uint8Array(4+t.length),r,i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return o(O.sdtp,n)},C=function(e){return o(O.stbl,w(e),o(O.stts,le),o(O.stsc,se),o(O.stsz,ce),o(O.stco,oe))},(function(){var e,t;w=function(n){return o(O.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),n.type===`video`?e(n):t(n))},e=function(e){for(var t=e.sps||[],n=e.pps||[],r=[],i=[],a=0,s;a<t.length;a++)r.push((t[a].byteLength&65280)>>>8),r.push(t[a].byteLength&255),r=r.concat(Array.prototype.slice.call(t[a]));for(a=0;a<n.length;a++)i.push((n[a].byteLength&65280)>>>8),i.push(n[a].byteLength&255),i=i.concat(Array.prototype.slice.call(n[a]));if(s=[O.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(O.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255,t.length].concat(r,[n.length],i))),o(O.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var c=e.sarRatio[0],l=e.sarRatio[1];s.push(o(O.pasp,new Uint8Array([(c&4278190080)>>24,(c&16711680)>>16,(c&65280)>>8,c&255,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255])))}return o.apply(null,s)},t=function(e){return o(O.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),c(e))}})(),v=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return o(O.tkhd,t)},T=function(e){var t=o(O.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n,r,i,s,c=Math.floor(e.baseMediaDecodeTime/a),l=Math.floor(e.baseMediaDecodeTime%a);return n=o(O.tfdt,new Uint8Array([1,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255])),s=92,e.type===`audio`?(r=D(e,s),o(O.traf,t,n,r)):(i=S(e),r=D(e,i.length+s),o(O.traf,t,n,r,i))},_=function(e){return e.duration=e.duration||4294967295,o(O.trak,v(e),y(e))},E=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.type!==`video`&&(t[t.length-1]=0),o(O.trex,t)},(function(){var e,t,n=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(e[0].duration!==void 0&&(n=1),e[0].size!==void 0&&(r=2),e[0].flags!==void 0&&(i=4),e[0].compositionTimeOffset!==void 0&&(a=8)),[0,0,n|r|i|a,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};t=function(e,t){var r,i,a,s=e.samples||[],c,l;for(t+=20+16*s.length,a=n(s,t),i=new Uint8Array(a.length+s.length*16),i.set(a),r=a.length,l=0;l<s.length;l++)c=s[l],i[r++]=(c.duration&4278190080)>>>24,i[r++]=(c.duration&16711680)>>>16,i[r++]=(c.duration&65280)>>>8,i[r++]=c.duration&255,i[r++]=(c.size&4278190080)>>>24,i[r++]=(c.size&16711680)>>>16,i[r++]=(c.size&65280)>>>8,i[r++]=c.size&255,i[r++]=c.flags.isLeading<<2|c.flags.dependsOn,i[r++]=c.flags.isDependedOn<<6|c.flags.hasRedundancy<<4|c.flags.paddingValue<<1|c.flags.isNonSyncSample,i[r++]=c.flags.degradationPriority&61440,i[r++]=c.flags.degradationPriority&15,i[r++]=(c.compositionTimeOffset&4278190080)>>>24,i[r++]=(c.compositionTimeOffset&16711680)>>>16,i[r++]=(c.compositionTimeOffset&65280)>>>8,i[r++]=c.compositionTimeOffset&255;return o(O.trun,i)},e=function(e,t){var r,i,a,s=e.samples||[],c,l;for(t+=20+8*s.length,a=n(s,t),r=new Uint8Array(a.length+s.length*8),r.set(a),i=a.length,l=0;l<s.length;l++)c=s[l],r[i++]=(c.duration&4278190080)>>>24,r[i++]=(c.duration&16711680)>>>16,r[i++]=(c.duration&65280)>>>8,r[i++]=c.duration&255,r[i++]=(c.size&4278190080)>>>24,r[i++]=(c.size&16711680)>>>16,r[i++]=(c.size&65280)>>>8,r[i++]=c.size&255;return o(O.trun,r)},D=function(n,r){return n.type===`audio`?e(n,r):t(n,r)}})();var M={ftyp:l,mdat:u,moof:p,moov:m,initSegment:function(e){var t=l(),n=m(e),r=new Uint8Array(t.byteLength+n.byteLength);return r.set(t),r.set(n,t.byteLength),r}},ue=function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)n=e[t],n.nalUnitType===`access_unit_delimiter_rbsp`?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),r=[n],r.byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):(n.nalUnitType===`slice_layer_without_partitioning_rbsp_idr`&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i},de=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)n=e[t],n.keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),r=[n],r.nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},fe=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},pe=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},me=function(e,t){var n=pe();return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},he={groupNalsIntoFrames:ue,groupFramesIntoGops:de,extendFirstKeyFrame:fe,generateSampleTable:function(e,t){var n,r,i,a,o,s=t||0,c=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)o=a[r],i=me(o,s),s+=i.size,c.push(i);return c},concatenateNalData:function(e){var t,n,r,i,a,o,s=0,c=e.byteLength+4*e.nalCount,l=new Uint8Array(c),u=new DataView(l.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)o=a[r],u.setUint32(s,o.data.byteLength),s+=4,l.set(o.data,s),s+=o.data.byteLength;return l},generateSampleTableForFrame:function(e,t){var n,r=t||0,i=[];return n=me(e,r),i.push(n),i},concatenateNalDataForFrame:function(e){var t,n,r=0,i=e.byteLength+4*e.length,a=new Uint8Array(i),o=new DataView(a.buffer);for(t=0;t<e.length;t++)n=e[t],o.setUint32(r,n.data.byteLength),r+=4,a.set(n.data,r),r+=n.data.byteLength;return a}},ge=[33,16,5,32,164,27],_e=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],N=function(e){for(var t=[];e--;)t.push(0);return t},ve=function(e){return Object.keys(e).reduce(function(t,n){return t[n]=new Uint8Array(e[n].reduce(function(e,t){return e.concat(t)},[])),t},{})},ye,be=function(){return ye||=ve({96e3:[ge,[227,64],N(154),[56]],88200:[ge,[231],N(170),[56]],64e3:[ge,[248,192],N(240),[56]],48e3:[ge,[255,192],N(268),[55,148,128],N(54),[112]],44100:[ge,[255,192],N(268),[55,163,128],N(84),[112]],32e3:[ge,[255,192],N(268),[55,234],N(226),[112]],24e3:[ge,[255,192],N(268),[55,255,128],N(268),[111,112],N(126),[224]],16e3:[ge,[255,192],N(268),[55,255,128],N(268),[111,255],N(269),[223,108],N(195),[1,192]],12e3:[_e,N(268),[3,127,248],N(268),[6,255,240],N(268),[13,255,224],N(268),[27,253,128],N(259),[56]],11025:[_e,N(268),[3,127,248],N(268),[6,255,240],N(268),[13,255,224],N(268),[27,255,192],N(268),[55,175,128],N(108),[112]],8e3:[_e,N(268),[3,121,16],N(47),[7]]}),ye},xe=9e4,Se=function(e){return e*xe},Ce=function(e,t){return e*t},we=function(e){return e/xe},Te=function(e,t){return e/t},P={ONE_SECOND_IN_TS:xe,secondsToVideoTs:Se,secondsToAudioTs:Ce,videoTsToSeconds:we,audioTsToSeconds:Te,audioTsToVideoTs:function(e,t){return Se(Te(e,t))},videoTsToAudioTs:function(e,t){return Ce(we(e),t)},metadataTsToSeconds:function(e,t,n){return we(n?e:e-t)}},Ee=be,F=P,De=function(e){var t,n,r=0;for(t=0;t<e.length;t++)n=e[t],r+=n.data.byteLength;return r},Oe={prefixWithSilence:function(e,t,n,r){var i,a=0,o=0,s=0,c=0,l,u,d;if(t.length&&(i=F.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(F.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&r&&(o=i-Math.max(n,r),s=Math.floor(o/a),c=s*a),!(s<1||c>F.ONE_SECOND_IN_TS/2))){for(l=Ee()[e.samplerate],l||=t[0].data,u=0;u<s;u++)d=t[0],t.splice(0,0,{data:l,dts:d.dts-a,pts:d.pts-a});return e.baseMediaDecodeTime-=Math.floor(F.videoTsToAudioTs(c,e.samplerate)),c}},trimAdtsFramesByEarliestDts:function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},concatenateFrameData:function(e){var t,n,r=0,i=new Uint8Array(De(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}},ke=P.ONE_SECOND_IN_TS,Ae={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var n,r,i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=i,n=Math.max(0,n),e.type===`audio`&&(r=e.samplerate/ke,n*=r,n=Math.floor(n)),n},collectDtsInfo:function(e,t){typeof t.pts==`number`&&(e.timelineStartInfo.pts===void 0&&(e.timelineStartInfo.pts=t.pts),e.minSegmentPts=e.minSegmentPts===void 0?t.pts:Math.min(e.minSegmentPts,t.pts),e.maxSegmentPts=e.maxSegmentPts===void 0?t.pts:Math.max(e.maxSegmentPts,t.pts)),typeof t.dts==`number`&&(e.timelineStartInfo.dts===void 0&&(e.timelineStartInfo.dts=t.dts),e.minSegmentDts=e.minSegmentDts===void 0?t.dts:Math.min(e.minSegmentDts,t.dts),e.maxSegmentDts=e.maxSegmentDts===void 0?t.dts:Math.max(e.maxSegmentDts,t.dts))}},je=4,Me=128,Ne={parseSei:function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&e[t]!==Me;){for(;e[t]===255;)r+=255,t++;for(r+=e[t++];e[t]===255;)i+=255,t++;if(i+=e[t++],!n.payload&&r===je){if(String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])===`GA94`){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}n.payload=void 0}t+=i,r=0,i=0}return n},parseUserData:function(e){return e.payload[0]!==181||(e.payload[1]<<8|e.payload[2])!=49||String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])!==`GA94`||e.payload[7]!==3?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var n=[],r,i,a,o;if(!(t[0]&64))return n;for(i=t[0]&31,r=0;r<i;r++)a=r*3,o={type:t[a+2]&3,pts:e},t[a+2]&4&&(o.ccData=t[a+3]<<8|t[a+4],n.push(o));return n},discardEmulationPreventionBytes:function(e){for(var t=e.byteLength,n=[],r=1,i,a;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;i=t-n.length,a=new Uint8Array(i);var o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=e[o];return a},USER_DATA_REGISTERED_ITU_T_T35:je},Pe=n,Fe=Ne,Ie=function(e){e||={},Ie.prototype.init.call(this),this.parse708captions_=typeof e.parse708captions!=`boolean`||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new L(0,0),new L(0,1),new L(1,0),new L(1,1)],this.parse708captions_&&(this.cc708Stream_=new I({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on(`data`,this.trigger.bind(this,`data`)),e.on(`partialdone`,this.trigger.bind(this,`partialdone`)),e.on(`done`,this.trigger.bind(this,`done`))},this),this.parse708captions_&&(this.cc708Stream_.on(`data`,this.trigger.bind(this,`data`)),this.cc708Stream_.on(`partialdone`,this.trigger.bind(this,`partialdone`)),this.cc708Stream_.on(`done`,this.trigger.bind(this,`done`)))};Ie.prototype=new Pe,Ie.prototype.push=function(e){var t,n,r;e.nalUnitType===`sei_rbsp`&&(t=Fe.parseSei(e.escapedRBSP),t.payload&&t.payloadType===Fe.USER_DATA_REGISTERED_ITU_T_T35&&(n=Fe.parseUserData(t),n&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(r=Fe.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts))))},Ie.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return e===`flush`?t.flush():t.partialFlush()},this)},Ie.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},Ie.prototype.flush=function(){return this.flushStream(`flush`)},Ie.prototype.partialFlush=function(){return this.flushStream(`partialFlush`)},Ie.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},Ie.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),this.activeCea608Channel_[e.type]!==null&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Ie.prototype.setsChannel1Active=function(e){return(e.ccData&30720)==4096},Ie.prototype.setsChannel2Active=function(e){return(e.ccData&30720)==6144},Ie.prototype.setsTextOrXDSActive=function(e){return(e.ccData&28928)==256||(e.ccData&30974)==4138||(e.ccData&30974)==6186},Ie.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Le={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Re=function(e){var t=Le[e]||e;return e&4096&&e===t?``:String.fromCharCode(t)},ze=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Be=function(e){this.windowNum=e,this.reset()};Be.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Be.prototype.getText=function(){return this.rows.join(`
185
185
  `)},Be.prototype.clearText=function(){this.rows=[``],this.rowIdx=0},Be.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==`function`&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(``),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Be.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===``},Be.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Be.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Ve=function(e,t,n){this.serviceNum=e,this.text=``,this.currentWindow=new Be(-1),this.windows=[],this.stream=n,typeof t==`string`&&this.createTextDecoder(t)};Ve.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Be(n),typeof t==`function`&&(this.windows[n].beforeRowOverflow=t)},Ve.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Ve.prototype.createTextDecoder=function(e){if(typeof TextDecoder>`u`)this.stream.trigger(`log`,{level:`warn`,message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger(`log`,{level:`warn`,message:`TextDecoder could not be created with `+e+` encoding. `+t})}};var I=function(e){e||={},I.prototype.init.call(this);var t=this,n=e.captionServices||{},r={},i;Object.keys(n).forEach(e=>{i=n[e],/^SERVICE/.test(e)&&(r[e]=i.encoding)}),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){e.type===3?(t.new708Packet(),t.add708Bytes(e)):(t.current708Packet===null&&t.new708Packet(),t.add708Bytes(e))}};I.prototype=new Pe,I.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},I.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=t&255;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},I.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=a&63;i<t.length;i++)a=t[i++],n=a>>5,r=a&31,n===7&&r>0&&(a=t[i++],n=a),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},I.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,o=this.services[e];for(o||=this.initService(e,i);i<t+n&&i<a.length;i++)r=a[i],ze(r)?i=this.handleText(i,o):r===24?i=this.multiByteCharacter(i,o):r===16?i=this.extendedCommands(i,o):128<=r&&r<=135?i=this.setCurrentWindow(i,o):152<=r&&r<=159?i=this.defineWindow(i,o):r===136?i=this.clearWindows(i,o):r===140?i=this.deleteWindows(i,o):r===137?i=this.displayWindows(i,o):r===138?i=this.hideWindows(i,o):r===139?i=this.toggleWindows(i,o):r===151?i=this.setWindowAttributes(i,o):r===144?i=this.setPenAttributes(i,o):r===145?i=this.setPenColor(i,o):r===146?i=this.setPenLocation(i,o):r===143?o=this.reset(i,o):r===8?o.currentWindow.backspace():r===12?o.currentWindow.clearText():r===13?o.currentWindow.pendingNewLine=!0:r===14?o.currentWindow.clearText():r===141&&i++},I.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return ze(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},I.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},I.prototype.initService=function(e,t){var n=`SERVICE`+e,r=this,n,i;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Ve(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},I.prototype.handleText=function(e,t,n){var r=n&&n.isExtended,i=n&&n.isMultiByte,a=this.current708Packet.data,o=r?4096:0,s=a[e],c=a[e+1],l=t.currentWindow,u,d;function f(e){return e.map(e=>(`0`+(e&255).toString(16)).slice(-2)).join(``)}if(i?(d=[s,c],e++):d=[s],t.textDecoder_&&!r)u=t.textDecoder_.decode(new Uint8Array(d));else if(i){let e=f(d);u=String.fromCharCode(parseInt(e,16))}else u=Re(o|s);return l.pendingNewLine&&!l.isEmpty()&&l.newLine(this.getPts(e)),l.pendingNewLine=!1,l.addText(u),e},I.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return ze(r)&&ze(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},I.prototype.setCurrentWindow=function(e,t){var n=this.current708Packet.data[e]&7;return t.setCurrentWindow(n),e},I.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=r&7;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(r&32)>>5,a.rowLock=(r&16)>>4,a.columnLock=(r&8)>>3,a.priority=r&7,r=n[++e],a.relativePositioning=(r&128)>>7,a.anchorVertical=r&127,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(r&240)>>4,a.rowCount=r&15,r=n[++e],a.columnCount=r&63,r=n[++e],a.windowStyle=(r&56)>>3,a.penStyle=r&7,a.virtualRowCount=a.rowCount+1,e},I.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(r&192)>>6,i.fillRed=(r&48)>>4,i.fillGreen=(r&12)>>2,i.fillBlue=r&3,r=n[++e],i.borderType=(r&192)>>6,i.borderRed=(r&48)>>4,i.borderGreen=(r&12)>>2,i.borderBlue=r&3,r=n[++e],i.borderType+=(r&128)>>5,i.wordWrap=(r&64)>>6,i.printDirection=(r&48)>>4,i.scrollDirection=(r&12)>>2,i.justify=r&3,r=n[++e],i.effectSpeed=(r&240)>>4,i.effectDirection=(r&12)>>2,i.displayEffect=r&3,e},I.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join(`
186
186
 
@@ -192,9 +192,9 @@ For TargetTime: ${i}.
192
192
  CurrentTime: ${this.currentTime_()}
193
193
  BufferedEnd: ${t}
194
194
  Fetch At Buffer: ${this.fetchAtBuffer_}
195
- `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(i);if(!t){let e=`No sync info found while using media sequence sync`;return this.error({message:e,metadata:{errorType:Z.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_(`chooseNextRequest_ - no sync info found using media sequence sync`),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --> ${t.end})`),e=t.segmentIndex,n=t.partIndex,r=t.start}else{this.logger_(`chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.`);let t=sd.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:i,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,n=t.partIndex,r=t.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${i}`:`currentTime ${i}`,o.mediaIndex=e,o.startOfSegment=r,o.partIndex=n,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}let s=a[o.mediaIndex],c=s&&typeof o.partIndex==`number`&&s.parts&&s.parts[o.partIndex];if(!s||typeof o.partIndex==`number`&&!c)return null;typeof o.partIndex!=`number`&&s.parts&&(o.partIndex=0,c=s.parts[0]);let l=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&c&&!l&&!c.independent){if(o.partIndex===0){let e=a[o.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(--o.mediaIndex,o.partIndex=e.parts.length-1,o.independent=`previous segment`)}else s.parts[o.partIndex-1].independent&&(--o.partIndex,o.independent=`previous part`)}let u=this.mediaSource_&&this.mediaSource_.readyState===`ended`;return o.mediaIndex>=a.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_(`choose next request. Force timestamp offset after loader resync`)),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;let r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_(`getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!`),r):null}generateSegmentInfo_(e){let{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:a,partIndex:o,forceTimestampOffset:s,getMediaInfoForTime:c}=e,l=n.segments[r],u=typeof o==`number`&&l.parts[o],d={requestId:`segment-loader-`+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:u?o:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},f=s===void 0?this.isPendingTimestampOffset_:s;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});let p=Fu(this.sourceUpdater_.audioBuffered());return typeof p==`number`&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=kp(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return Bp(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=sd.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=Mu(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=a)return;let o=hp({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;let s=i-a-o.rebufferingImpact,c=.5;a<=wu&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||s<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*bf.BANDWIDTH_VARIANCE+1,this.trigger(`earlyabort`))}handleAbort_(e){this.logger_(`Aborting ${Rp(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger(`progress`)}handleTrackInfo_(e,t){let{hasAudio:n,hasVideo:r}=t,i={segmentInfo:Jp({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:`segmenttransmuxingtrackinfoavailable`,metadata:i}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t||={},Mp(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_(`trackinfo update`,t),this.trigger(`trackinfo`)),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wp(this))))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let i=this.pendingSegment_,a=zp(t);i[a]=i[a]||{},i[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wp(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_(`SegmentLoader received no captions from a caption event`);return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}let n=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:i,captions:a}=r[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),yp(o,this.vhs_.tech_,e),Dp(t,i,o[e]),bp({captionArray:a,inbandTextTracks:o,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:`clearParsedMp4Captions`})}handleId3_(e,t,n){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(n,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!==`audio`)return!0;let e=this.pendingSegment_;return e?!this.getCurrentMediaInfo_()||!Vp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Vp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Wp(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!==`closed`){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger(`fmp4`),n.timingInfo.start=n[zp(t.type)].start;else{let e=this.getCurrentMediaInfo_(),t=this.loaderType_===`main`&&e&&e.hasVideo,r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_===`main`});let e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex){this.logger_(`sync segment was incorrect, not appending`);return}this.logger_(`sync segment was correct, appending`)}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_===`main`&&typeof e.timestampOffset==`number`&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){let e=Jd(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){let i=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();i.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: `+Nu(i).join(`, `)),a.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: `+Nu(a).join(`, `));let o=i.length?i.start(0):0,s=i.length?i.end(i.length-1):0,c=a.length?a.start(0):0,l=a.length?a.end(a.length-1):0;if(s-o<=1&&l-c<=1){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Nu(i).join(`, `)}, video buffer: ${Nu(a).join(`, `)}, `),this.error({message:`Quota exceeded error with append of a single segment of content`,excludeUntil:1/0}),this.trigger(`error`);return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));let u=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in 1s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, re-processing call queue`),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(r.code===22?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}):(this.logger_(`Received non QUOTA_EXCEEDED_ERR on append`,r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Z.Error.StreamingFailedToAppendSegment}}),this.trigger(`appenderror`)))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){let e=[r],t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=_p({bytes:t,segments:e})}let a={segmentInfo:Jp({type:this.loaderType_,segment:e})};this.trigger({type:`segmentappendstart`,metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){let{type:n,data:r}=t;if(!r||!r.byteLength||n===`audio`&&this.audioDisabled_)return;let i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}loadSegment_(e){this.state=`WAITING`,this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset==`number`&&this.transmuxer_&&this.transmuxer_.postMessage({action:`clearAllMp4Captions`}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):(Wp(this),this.loadQueue_.push(()=>{let t=R({},e,{forceTimestampOffset:!0});R(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:`reset`}),this.transmuxer_.postMessage({action:`setTimestampOffset`,timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,i=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&i;this.logger_(`Requesting
195
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(i);if(!t){let e=`No sync info found while using media sequence sync`;return this.error({message:e,metadata:{errorType:Z.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_(`chooseNextRequest_ - no sync info found using media sequence sync`),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --> ${t.end})`),e=t.segmentIndex,n=t.partIndex,r=t.start}else{this.logger_(`chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.`);let t=sd.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:i,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,n=t.partIndex,r=t.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${i}`:`currentTime ${i}`,o.mediaIndex=e,o.startOfSegment=r,o.partIndex=n,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}let s=a[o.mediaIndex],c=s&&typeof o.partIndex==`number`&&s.parts&&s.parts[o.partIndex];if(!s||typeof o.partIndex==`number`&&!c)return null;typeof o.partIndex!=`number`&&s.parts&&(o.partIndex=0,c=s.parts[0]);let l=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&c&&!l&&!c.independent){if(o.partIndex===0){let e=a[o.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(--o.mediaIndex,o.partIndex=e.parts.length-1,o.independent=`previous segment`)}else s.parts[o.partIndex-1].independent&&(--o.partIndex,o.independent=`previous part`)}let u=this.mediaSource_&&this.mediaSource_.readyState===`ended`;return o.mediaIndex>=a.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_(`choose next request. Force timestamp offset after loader resync`)),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;let r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_(`getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!`),r):null}generateSegmentInfo_(e){let{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:a,partIndex:o,forceTimestampOffset:s,getMediaInfoForTime:c}=e,l=n.segments[r],u=typeof o==`number`&&l.parts[o],d={requestId:`segment-loader-`+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:u?o:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},f=s===void 0?this.isPendingTimestampOffset_:s;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});let p=Fu(this.sourceUpdater_.audioBuffered());return typeof p==`number`&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=kp(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return Bp(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=sd.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=Mu(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=a)return;let o=hp({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;let s=i-a-o.rebufferingImpact,c=.5;a<=wu&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||s<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*bf.BANDWIDTH_VARIANCE+1,this.trigger(`earlyabort`))}handleAbort_(e){this.logger_(`Aborting ${Rp(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger(`progress`)}handleTrackInfo_(e,t){let{hasAudio:n,hasVideo:r}=t,i={segmentInfo:Jp({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:`segmenttransmuxingtrackinfoavailable`,metadata:i}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t||={},Mp(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_(`trackinfo update`,t),this.trigger(`trackinfo`)),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wp(this)))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let i=this.pendingSegment_,a=zp(t);i[a]=i[a]||{},i[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wp(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_(`SegmentLoader received no captions from a caption event`);return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}let n=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:i,captions:a}=r[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),yp(o,this.vhs_.tech_,e),Dp(t,i,o[e]),bp({captionArray:a,inbandTextTracks:o,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:`clearParsedMp4Captions`})}handleId3_(e,t,n){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(n,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!==`audio`)return!0;let e=this.pendingSegment_;return e?!this.getCurrentMediaInfo_()||!Vp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Vp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Wp(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!==`closed`){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger(`fmp4`),n.timingInfo.start=n[zp(t.type)].start;else{let e=this.getCurrentMediaInfo_(),t=this.loaderType_===`main`&&e&&e.hasVideo,r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_===`main`});let e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex){this.logger_(`sync segment was incorrect, not appending`);return}this.logger_(`sync segment was correct, appending`)}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_===`main`&&typeof e.timestampOffset==`number`&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){let e=Jd(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){let i=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();i.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: `+Nu(i).join(`, `)),a.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: `+Nu(a).join(`, `));let o=i.length?i.start(0):0,s=i.length?i.end(i.length-1):0,c=a.length?a.start(0):0,l=a.length?a.end(a.length-1):0;if(s-o<=1&&l-c<=1){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Nu(i).join(`, `)}, video buffer: ${Nu(a).join(`, `)}, `),this.error({message:`Quota exceeded error with append of a single segment of content`,excludeUntil:1/0}),this.trigger(`error`);return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));let u=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in 1s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, re-processing call queue`),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(r.code===22?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}):(this.logger_(`Received non QUOTA_EXCEEDED_ERR on append`,r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Z.Error.StreamingFailedToAppendSegment}}),this.trigger(`appenderror`)))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){let e=[r],t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=_p({bytes:t,segments:e})}let a={segmentInfo:Jp({type:this.loaderType_,segment:e})};this.trigger({type:`segmentappendstart`,metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){let{type:n,data:r}=t;if(!r||!r.byteLength||n===`audio`&&this.audioDisabled_)return;let i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}loadSegment_(e){this.state=`WAITING`,this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset==`number`&&this.transmuxer_&&this.transmuxer_.postMessage({action:`clearAllMp4Captions`}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):(Wp(this),this.loadQueue_.push(()=>{let t=R({},e,{forceTimestampOffset:!0});R(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:`reset`}),this.transmuxer_.postMessage({action:`setTimestampOffset`,timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,i=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&i;this.logger_(`Requesting
196
196
  ${vp(e.uri)}
197
197
  ${Rp(e)}`),t.map&&!t.map.bytes&&(this.logger_(`going to request init segment.`),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=ap({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,`video`,e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,`audio`,e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_(`received endedtimeline callback`)},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:n,stream:r})=>{this.logger_(`${Rp(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:n,trackInfo:r,timingInfo:i})=>{let a={segmentInfo:Jp({segment:t})};n&&(a.keyInfo=n),r&&(a.trackInfo=r),i&&(a.timingInfo=i),this.trigger({type:e,metadata:a})}})}trimBackBuffer_(e){let t=Lp(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){let t=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,i=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:i},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){let n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=n}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Fp){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Fp}`);return}let n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:`bandwidthupdated`,metadata:n}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger(`bandwidthupdate`),this.trigger(`timeout`)}segmentRequestFinished_(e,t,n){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state=`READY`,e.code===Bf.ABORTED)return;if(this.pause(),e.code===Bf.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger(`error`);return}let r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=Ap(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state=`APPENDING`,this.trigger(`appending`),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){let t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start==`number`&&typeof e.end==`number`?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_===`main`&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:i,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:s}){if(e!==void 0)return e;if(!a)return s.start;let c=t.segments[n-1];return n===0||!c||c.start===void 0||c.end!==r+i?r:o.start}waitForAppendsToComplete_(e){let t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:`No starting media returned, likely due to an unsupported media format.`,playlistExclusionDuration:1/0}),this.trigger(`error`);return}let{hasAudio:n,hasVideo:r,isMuxed:i}=t,a=this.loaderType_===`main`&&r,o=!this.audioDisabled_&&n&&!i;e.waitingOnAppends=0,e.hasAppendedData_?(a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))):(!e.timingInfo&&typeof e.timestampOffset==`number`&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){let t=Ip(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger(`error`),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!=`number`||e.changedTimestampOffset||this.loaderType_!==`main`)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger(`timestampoffset`)}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart==`number`?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart==`number`?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),n=this.loaderType_===`main`&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end=typeof n.end==`number`?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let e={segmentInfo:Jp({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:`appendsdone`,metadata:e})}if(!this.pendingSegment_){this.state=`READY`,this.paused()||this.monitorBuffer_();return}let e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_===`main`});let t=qp(e,this.sourceType_);if(t&&(t.severity===`warn`?Z.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state=`READY`,e.isSyncRequest&&(this.trigger(`syncinfoupdate`),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Rp(e)}`);return}this.logger_(`Appended ${Rp(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_===`main`&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:`audio`,from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger(`syncinfoupdate`);let n=e.segment,r=e.part,i=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;i||a?(this.logger_(`bad ${i?`segment`:`part`} ${Rp(e)}`),this.resetEverything()):(this.mediaIndex!==null&&this.trigger(`bandwidthupdate`),this.trigger(`progress`),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger(`appended`),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_())}recordThroughput_(e){if(e.duration<Fp){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Fp}`);return}let t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,n=t.start,r=t.end;if(!Pp(n)||!Pp(r))return;Dp(n,r,this.segmentMetadataTrack_);let i=x.WebKitDataCue||x.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=new i(n,r,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}}function Xp(){}const Zp=function(e){return typeof e==`string`?e.replace(/./,e=>e.toUpperCase()):e},Qp=[`video`,`audio`],$p=(e,t)=>{let n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},em=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.type===`mediaSource`)return null;if(r.type===e)return n}return null},tm=(e,t)=>{if(t.queue.length===0)return;let n=0,r=t.queue[n];if(r.type===`mediaSource`)!t.updating()&&t.mediaSource.readyState!==`closed`&&(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),tm(`audio`,t),tm(`video`,t));else if(e!==`mediaSource`&&t.ready()&&t.mediaSource.readyState!==`closed`&&!$p(e,t)){if(r.type!==e){if(n=em(e,t.queue),n===null)return;r=t.queue[n]}t.queue.splice(n,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn&&(t.queuePending[e]=null,tm(e,t))}},nm=(e,t)=>{let n=t[`${e}Buffer`],r=Zp(e);n&&(n.removeEventListener(`updateend`,t[`on${r}UpdateEnd_`]),n.removeEventListener(`error`,t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},rm=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1,im={appendBuffer:(e,t,n)=>(r,i)=>{let a=i[`${r}Buffer`];if(rm(i.mediaSource,a)){i.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{a.appendBuffer(e)}catch(e){i.logger_(`Error with code ${e.code} `+(e.code===22?`(QUOTA_EXCEEDED_ERR) `:``)+`when appending segment ${t.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,n(e)}}},remove:(e,t)=>(n,r)=>{let i=r[`${n}Buffer`];if(rm(r.mediaSource,i)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{i.remove(e,t)}catch{r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},timestampOffset:e=>(t,n)=>{let r=n[`${t}Buffer`];rm(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},callback:e=>(t,n)=>{e()},endOfStream:e=>t=>{if(t.mediaSource.readyState===`open`){t.logger_(`Calling mediaSource endOfStream(${e||``})`);try{t.mediaSource.endOfStream(e)}catch(e){Z.log.warn(`Failed to call media source endOfStream`,e)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){Z.log.warn(`Failed to set media source duration`,e)}},abort:()=>(e,t)=>{if(t.mediaSource.readyState!==`open`)return;let n=t[`${e}Buffer`];if(rm(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(t){Z.log.warn(`Failed to abort on ${e}Buffer`,t)}}},addSourceBuffer:(e,t)=>n=>{let r=Zp(e),i=Ot(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);let a=n.mediaSource.addSourceBuffer(i);a.addEventListener(`updateend`,n[`on${r}UpdateEnd_`]),a.addEventListener(`error`,n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=a},removeSourceBuffer:e=>t=>{let n=t[`${e}Buffer`];if(nm(e,t),rm(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(t){Z.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},changeType:e=>(t,n)=>{let r=n[`${t}Buffer`],i=Ot(e);if(!rm(n.mediaSource,r))return;let a=e.substring(0,e.indexOf(`.`)),o=n.codecs[t];if(o.substring(0,o.indexOf(`.`))===a)return;let s={codecsChangeInfo:{from:o,to:e}};n.trigger({type:`codecschange`,metadata:s}),n.logger_(`changing ${t}Buffer codec from ${o} to ${e}`);try{r.changeType(i),n.codecs[t]=e}catch(e){s.errorType=Z.Error.StreamingCodecsChangeError,s.error=e,e.metadata=s,n.error_=e,n.trigger(`error`),Z.log.warn(`Failed to changeType on ${t}Buffer`,e)}}},am=({type:e,sourceUpdater:t,action:n,doneFn:r,name:i})=>{t.queue.push({type:e,action:n,doneFn:r,name:i}),tm(e,t)},om=(e,t)=>n=>{let r=Cu(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){let n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}tm(e,t)};class sm extends Z.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>tm(`mediaSource`,this),this.mediaSource.addEventListener(`sourceopen`,this.sourceopenListener_),this.logger_=xu(`SourceUpdater`),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=om(`video`,this),this.onAudioUpdateEnd_=om(`audio`,this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger(`createdsourcebuffers`),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger(`ready`))}addSourceBuffer(e,t){am({type:`mediaSource`,sourceUpdater:this,action:im.addSourceBuffer(e,t),name:`addSourceBuffer`})}abort(e){am({type:e,sourceUpdater:this,action:im.abort(),name:`abort`})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?am({type:`mediaSource`,sourceUpdater:this,action:im.removeSourceBuffer(e),name:`removeSourceBuffer`}):Z.log.error(`removeSourceBuffer is not supported!`)}canRemoveSourceBuffer(){return!Z.browser.IS_FIREFOX&&x.MediaSource&&x.MediaSource.prototype&&typeof x.MediaSource.prototype.removeSourceBuffer==`function`}static canChangeType(){return x.SourceBuffer&&x.SourceBuffer.prototype&&typeof x.SourceBuffer.prototype.changeType==`function`}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?am({type:e,sourceUpdater:this,action:im.changeType(t),name:`changeType`}):Z.log.error(`changeType is not supported!`)}addOrChangeSourceBuffers(e){if(!e||typeof e!=`object`||Object.keys(e).length===0)throw Error(`Cannot addOrChangeSourceBuffers to undefined codecs`);Object.keys(e).forEach(t=>{let n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){let{segmentInfo:n,type:r,bytes:i}=e;if(this.processedAppend_=!0,r===`audio`&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${i.length} until video append`);return}let a=t;if(am({type:r,sourceUpdater:this,action:im.appendBuffer(i,n||{mediaIndex:-1},a),doneFn:t,name:`appendBuffer`}),r===`video`){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return rm(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Su()}videoBuffered(){return rm(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Su()}buffered(){let e=rm(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=rm(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Au(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Xp){am({type:`mediaSource`,sourceUpdater:this,action:im.duration(e),name:`duration`,doneFn:t})}endOfStream(e=null,t=Xp){typeof e!=`string`&&(e=void 0),am({type:`mediaSource`,sourceUpdater:this,action:im.endOfStream(e),name:`endOfStream`,doneFn:t})}removeAudio(e,t,n=Xp){!this.audioBuffered().length||this.audioBuffered().end(0)===0?n():am({type:`audio`,sourceUpdater:this,action:im.remove(e,t),doneFn:n,name:`remove`})}removeVideo(e,t,n=Xp){!this.videoBuffered().length||this.videoBuffered().end(0)===0?n():am({type:`video`,sourceUpdater:this,action:im.remove(e,t),doneFn:n,name:`remove`})}updating(){return!!($p(`audio`,this)||$p(`video`,this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(am({type:`audio`,sourceUpdater:this,action:im.timestampOffset(e),name:`timestampOffset`}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(am({type:`video`,sourceUpdater:this,action:im.timestampOffset(e),name:`timestampOffset`}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&am({type:`audio`,sourceUpdater:this,action:im.callback(e),name:`callback`})}videoQueueCallback(e){this.videoBuffer&&am({type:`video`,sourceUpdater:this,action:im.callback(e),name:`callback`})}dispose(){this.trigger(`dispose`),Qp.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>nm(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener(`sourceopen`,this.sourceopenListener_),this.off()}}const cm=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),lm=e=>{let t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``)},um=new Uint8Array(`
198
198
 
199
199
  `.split(``).map(e=>e.charCodeAt(0)));class dm extends Error{constructor(){super(`Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.`)}}class fm extends Yp{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Su();let e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return Su([[t,n]])}initSegmentForMap(e,t=!1){if(!e)return null;let n=Jd(e),r=this.initSegments_[n];if(t&&!r&&e.bytes){let t=um.byteLength+e.bytes.byteLength,i=new Uint8Array(t);i.set(e.bytes),i.set(um,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state=`READY`,this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0||(this.subtitlesTrack_=e,this.state===`INIT`&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){Dp(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();e&&(this.syncController_.timestampOffsetForTimeline(e.timeline)===null?(this.syncController_.one(`timestampoffset`,()=>{this.state=`READY`,this.paused()||this.monitorBuffer_()}),this.state=`WAITING_ON_TIMELINE`):this.loadSegment_(e))}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state=`READY`,this.pause(),this.trigger(`error`)}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_){this.state=`READY`;return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state=`READY`,this.mediaRequestsAborted+=1;return}if(e){e.code===Bf.TIMEOUT&&this.handleTimeout_(),e.code===Bf.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let r=this.pendingSegment_,i=n.mp4VttCues&&n.mp4VttCues.length;i&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state=`APPENDING`,this.trigger(`appending`);let a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof x.WebVTT!=`function`&&typeof this.loadVttJs==`function`)this.state=`WAITING_ON_VTTJS`,this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:`Error loading vtt.js`}));else{a.requested=!0;try{this.parseVTTCues_(r)}catch(e){this.stopForError({message:e.message,metadata:{errorType:Z.Error.StreamingVttParserError,error:e}});return}i||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.timingInfo=r.cues.length?{start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:{start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest?(this.trigger(`syncinfoupdate`),this.pendingSegment_=null,this.state=`READY`):(r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new x.VTTCue(e.startTime,e.endTime,e.text):e)}),Op(this.subtitlesTrack_),this.handleAppendsDone_())}}handleData_(e,t){let n=e&&e.type===`vtt`,r=t&&t.type===`text`;n&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{let r=n.start+t,i=n.end+t,a=new x.VTTCue(r,i,n.cueText);n.settings&&n.settings.split(` `).forEach(e=>{let t=e.split(`:`),n=t[0],r=t[1];a[n]=isNaN(r)?r:Number(r)}),e.cues.push(a)})}parseVTTCues_(e){let t,n=!1;if(typeof x.WebVTT!=`function`)throw new dm;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof x.TextDecoder==`function`?t=new x.TextDecoder(`utf8`):(t=x.WebVTT.StringDecoder(),n=!0);let r=new x.WebVTT.Parser(x,x.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{Z.log.warn(`Error encountered when parsing cues: `+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=cm(t)),r.parse(t)}let i=e.bytes;n&&(i=cm(i)),r.parse(i),r.flush()}updateTimeMapping_(e,t,n){let r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}let{MPEGTS:i,LOCAL:a}=e.timestampmap,o=i/gi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(e=>{let n=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+o,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+n,0)}),!n.syncInfo){let t=e.cues[0].startTime,i=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,i-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let n=e*gi.ONE_SECOND_IN_TS,r=t*gi.ONE_SECOND_IN_TS,i;for(i=r<n?-8589934592:8589934592;Math.abs(n-r)>4294967296;)n+=i;return n/gi.ONE_SECOND_IN_TS}}const pm=function(e,t){let n=e.cues;for(let e=0;e<n.length;e++){let r=n[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},mm=function(e,t,n=0){if(!e.segments)return;let r=n,i;for(let n=0;n<e.segments.length;n++){let a=e.segments[n];if(i||=pm(t,r+a.duration/2),i){if(`cueIn`in a){i.endTime=r,i.adEndTime=r,r+=a.duration,i=null;continue}if(r<i.endTime){r+=a.duration;continue}i.endTime+=a.duration}else if(`cueOut`in a&&(i=new x.VTTCue(r,r+a.duration,a.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(a.cueOut),t.addCue(i)),`cueOutCont`in a){let[e,n]=a.cueOutCont.split(`/`).map(parseFloat);i=new x.VTTCue(r,r+a.duration,``),i.adStartTime=r-e,i.adEndTime=i.adStartTime+n,t.addCue(i)}r+=a.duration}};class hm{constructor({start:e,end:t,segmentIndex:n,partIndex:r=null,appended:i=!1}){this.start_=e,this.end_=t,this.segmentIndex_=n,this.partIndex_=r,this.appended_=i}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class gm{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class _m{constructor(){this.storage_=new Map,this.diagnostics_=``,this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){let{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:n}of this.storage_.values())if(n.length){for(let t of n)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,n){let r=new Map,i=`
200
- `,a=n,o=t;this.start_=a,e.forEach((e,t)=>{let n=this.storage_.get(o),s=a,c=s+e.duration,l=!!(n&&n.segmentSyncInfo&&n.segmentSyncInfo.isAppended),u=new hm({start:s,end:c,appended:l,segmentIndex:t});e.syncInfo=u;let d=a,f=(e.parts||[]).map((e,r)=>{let a=d,s=d+e.duration,c=!!(n&&n.partsSyncInfo&&n.partsSyncInfo[r]&&n.partsSyncInfo[r].isAppended),l=new hm({start:a,end:s,appended:c,segmentIndex:t,partIndex:r});return d=s,i+=`Media Sequence: ${o}.${r} | Range: ${a} --> ${s} | Appended: ${c}\n`,e.syncInfo=l,l});r.set(o,new gm(u,f)),i+=`${vp(e.resolvedUri)} | Media Sequence: ${o} | Range: ${s} --> ${c} | Appended: ${l}\n`,o++,a=c}),this.end_=a,this.storage_=r,this.diagnostics_=i}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let n=r-e,i=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<n;e++){let n=t[e];i-=n.duration}return i}return n}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class vm extends _m{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}}const ym=[{name:`VOD`,run:(e,t,n,r,i)=>n===1/0?null:{time:0,segmentIndex:0,partIndex:null}},{name:`MediaSequence`,run:(e,t,n,r,i,a)=>{let o=e.getMediaSequenceSync(a);if(!o||!o.isReliable)return null;let s=o.getSyncInfoForTime(i);return s?{time:s.start,partIndex:s.partIndex,segmentIndex:s.segmentIndex}:null}},{name:`ProgramDateTime`,run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let a=null,o=null,s=Ru(t);i||=0;for(let n=0;n<s.length;n++){let r=s[t.endList||i===0?n:s.length-(n+1)],c=r.segment,l=e.timelineToDatetimeMappings[c.timeline];if(!l||!c.dateTimeObject)continue;let u=c.dateTimeObject.getTime()/1e3+l;if(c.parts&&typeof r.partIndex==`number`)for(let e=0;e<r.partIndex;e++)u+=c.parts[e].duration;let d=Math.abs(i-u);if(o!==null&&(d===0||o<d))break;o=d,a={time:u,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return a}},{name:`Segment`,run:(e,t,n,r,i)=>{let a=null,o=null;i||=0;let s=Ru(t);for(let e=0;e<s.length;e++){let n=s[t.endList||i===0?e:s.length-(e+1)],c=n.segment,l=n.part&&n.part.start||c&&c.start;if(c.timeline===r&&l!==void 0){let e=Math.abs(i-l);if(o!==null&&o<e)break;(!a||o===null||o>=e)&&(o=e,a={time:l,segmentIndex:n.segmentIndex,partIndex:n.partIndex})}}return a}},{name:`Discontinuity`,run:(e,t,n,r,i)=>{let a=null;if(i||=0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r<t.discontinuityStarts.length;r++){let o=t.discontinuityStarts[r],s=t.discontinuitySequence+r+1,c=e.discontinuities[s];if(c){let e=Math.abs(i-c.time);if(n!==null&&n<e)break;(!a||n===null||n>=e)&&(n=e,a={time:c.time,segmentIndex:o,partIndex:null})}}}return a}},{name:`Playlist`,run:(e,t,n,r,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class bm extends Z.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new _m,n=new vm(t),r=new vm(t);this.mediaSequenceStorage_={main:t,audio:n,vtt:r},this.logger_=xu(`SyncController`)}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,i){if(t!==1/0)return ym.find(({name:e})=>e===`VOD`).run(this,e,t);let a=this.runStrategies_(e,t,n,r,i);if(!a.length)return null;for(let t of a){let{syncPoint:n,strategy:i}=t,{segmentIndex:a,time:o}=n;if(a<0)continue;let s=e.segments[a],c=o,l=c+s.duration;if(this.logger_(`Strategy: ${i}. Current time: ${r}. selected segment: ${a}. Time: [${c} -> ${l}]}`),r>=c&&r<l)return this.logger_(`Found sync point with exact match: `,n),n}return this.selectSyncPoint_(a,{key:`time`,value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;let r=this.selectSyncPoint_(n,{key:`segmentIndex`,value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ku({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,i){let a=[];for(let o=0;o<ym.length;o++){let s=ym[o],c=s.run(this,e,t,n,r,i);c&&(c.strategy=s.name,a.push({strategy:s.name,syncPoint:c}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy;for(let a=1;a<e.length;a++){let o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${i}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+(typeof n.partIndex==`number`?`,partIndex:${n.partIndex}`:``)+`]`),n}saveExpiredSegmentInfo(e,t){let n=t.mediaSequence-e.mediaSequence;if(n>86400)Z.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let r=n-1;r>=0;r--){let n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger(`syncinfoupdate`);break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));let i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-(i.getTime()/1e3))}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){let r=e.segment,i=e.part,a=this.timelines[e.timeline],o,s;if(typeof e.timestampOffset==`number`)a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=a,this.trigger(`timestampoffset`),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,s=t.end+a.mapping;else if(a)o=t.start+a.mapping,s=t.end+a.mapping;else return!1;return i&&(i.start=o,i.end=s),(!r.start||o<r.start)&&(r.start=o),r.end=s,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=i-e.mediaIndex,s=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>s){let r;r=o<0?n.start-Ku({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+Ku({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:r,accuracy:s}}}}dispose(){this.trigger(`dispose`),this.off()}}class xm extends Z.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger(`pendingtimelinechange`)}pendingTimelineChange({type:e,from:t,to:n}){return typeof t==`number`&&typeof n==`number`&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger(`pendingtimelinechange`)),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if(typeof t==`number`&&typeof n==`number`){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];let r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:`timelinechange`,metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger(`dispose`),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var Sm=wf(Tf(Ef(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)}},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}();function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}let n=function(){let e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4],a,o,s,c=[],l=[],u,d,f,p,m,h;for(a=0;a<256;a++)l[(c[a]=a<<1^(a>>7)*283)^a]=a;for(o=s=0;!r[o];o^=u||1,s=l[s]||1)for(p=s^s<<1^s<<2^s<<3^s<<4,p=p>>8^p&255^99,r[o]=p,i[p]=o,f=c[d=c[u=c[o]]],h=f*16843009^d*65537^u*257^o*16843008,m=c[p]*257^p*16843008,a=0;a<4;a++)t[a][o]=m=m<<24^m>>>8,n[a][p]=h=h<<24^h>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e},r=null;class i{constructor(e){r||=n(),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let t,i,a,o=this._tables[0][4],s=this._tables[1],c=e.length,l=1;if(c!==4&&c!==6&&c!==8)throw Error(`Invalid aes key size`);let u=e.slice(0),d=[];for(this._key=[u,d],t=c;t<4*c+28;t++)a=u[t-1],(t%c===0||c===8&&t%c===4)&&(a=o[a>>>24]<<24^o[a>>16&255]<<16^o[a>>8&255]<<8^o[a&255],t%c===0&&(a=a<<8^a>>>24^l<<24,l=l<<1^(l>>7)*283)),u[t]=u[t-c]^a;for(i=0;t;i++,t--)a=u[i&3?t:t-4],t<=4||i<4?d[i]=a:d[i]=s[0][o[a>>>24]]^s[1][o[a>>16&255]]^s[2][o[a>>8&255]]^s[3][o[a&255]]}decrypt(e,t,n,r,i,a){let o=this._key[1],s=e^o[0],c=r^o[1],l=n^o[2],u=t^o[3],d,f,p,m=o.length/4-2,h,g=4,_=this._tables[1],v=_[0],y=_[1],b=_[2],x=_[3],S=_[4];for(h=0;h<m;h++)d=v[s>>>24]^y[c>>16&255]^b[l>>8&255]^x[u&255]^o[g],f=v[c>>>24]^y[l>>16&255]^b[u>>8&255]^x[s&255]^o[g+1],p=v[l>>>24]^y[u>>16&255]^b[s>>8&255]^x[c&255]^o[g+2],u=v[u>>>24]^y[s>>16&255]^b[c>>8&255]^x[l&255]^o[g+3],g+=4,s=d,c=f,l=p;for(h=0;h<4;h++)i[(3&-h)+a]=S[s>>>24]<<24^S[c>>16&255]<<16^S[l>>8&255]<<8^S[u&255]^o[g++],d=s,s=c,c=l,l=u,u=d}}class a extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null}push(e){this.jobs.push(e),this.timeout_||=setTimeout(this.processJob_.bind(this),this.delay)}}let o=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24},s=function(e,t,n){let r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),c=new Int32Array(s.buffer),l,u,d,f,p,m,h,g,_;for(l=n[0],u=n[1],d=n[2],f=n[3],_=0;_<r.length;_+=4)p=o(r[_]),m=o(r[_+1]),h=o(r[_+2]),g=o(r[_+3]),a.decrypt(p,m,h,g,c,_),c[_]=o(c[_]^l),c[_+1]=o(c[_+1]^u),c[_+2]=o(c[_+2]^d),c[_+3]=o(c[_+3]^f),l=p,u=m,d=h,f=g;return s};class c{constructor(e,n,r,i){let s=c.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength),d=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u)),d=s;d<l.length;d+=s)r=new Uint32Array([o(l[d-4]),o(l[d-3]),o(l[d-2]),o(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u));this.asyncStream_.push(function(){i(null,t(u))})}static get STEP(){return 32e3}decryptChunk_(e,t,n,r){return function(){let i=s(e,t,n);r.set(i,e.byteOffset)}}}var l=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},u=typeof window<`u`?window:l===void 0?typeof self<`u`?self:{}:l,d=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=u.BigInt||Number;f(`0x1`),f(`0x100`),f(`0x10000`),f(`0x1000000`),f(`0x100000000`),f(`0x10000000000`),f(`0x1000000000000`),f(`0x100000000000000`),f(`0x10000000000000000`),(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();let p=function(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];d(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t};self.onmessage=function(e){let t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new c(n,r,i,function(e,n){self.postMessage(p({source:t.source,decrypted:n}),[n.buffer])})}})));const Cm=e=>{let t=e.default?`main`:`alternative`;return e.characteristics&&e.characteristics.indexOf(`public.accessibility.describes-video`)>=0&&(t=`main-desc`),t},wm=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Tm=(e,t)=>{t.activePlaylistLoader=e,e.load()},Em=(e,t)=>()=>{let{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,a=i.activeTrack(),o=i.getActiveGroup(),s=i.activePlaylistLoader,c=i.lastGroup_;o&&c&&o.id===c.id||(i.lastGroup_=o,i.lastTrack_=a,wm(n,i),o&&!o.isMainPlaylist&&(o.playlistLoader?(n.resyncLoader(),Tm(o.playlistLoader,i)):s&&r.resetEverything()))},Dm=(e,t)=>()=>{let{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()},Om=(e,t)=>()=>{let{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:a}}=t,o=a.activeTrack(),s=a.getActiveGroup(),c=a.activePlaylistLoader,l=a.lastTrack_;if(!(l&&o&&l.id===o.id)&&(a.lastGroup_=s,a.lastTrack_=o,wm(r,a),s)){if(s.isMainPlaylist){if(!o||!l||o.id===l.id)return;let e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;a.logger_(`track change. Switching main audio from ${l.id} to ${o.id}`),n.pause(),i.resetEverything(),e.fastQualityChange_(r)}else{if(e===`AUDIO`){if(!s.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}c===s.playlistLoader||(r.track&&r.track(o),r.resetEverything()),Tm(s.playlistLoader,a)}}},km={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:n},excludePlaylist:r}=t,i=n.activeTrack(),a=n.activeGroup(),o=(a.filter(e=>e.default)[0]||a[0]).id,s=n.tracks[o];if(i===s)r({error:{message:`Problem encountered loading the default audio track.`}});else{Z.log.warn(`Problem encountered loading the alternate audio track.Switching back to default.`);for(let e in n.tracks)n.tracks[e].enabled=n.tracks[e]===s;n.onTrackChanged()}},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:n}}=t;Z.log.warn(`Problem encountered loading the subtitle track.Disabling subtitle track.`);let r=n.activeTrack();r&&(r.mode=`disabled`),n.onTrackChanged()}},Am={AUDIO:(e,t,n)=>{if(!t)return;let{tech:r,requestOptions:i,segmentLoaders:{[e]:a}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,km[e](e,n))},SUBTITLES:(e,t,n)=>{let{tech:r,requestOptions:i,segmentLoaders:{[e]:a},mediaTypes:{[e]:o}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),a.track(o.activeTrack()),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,km[e](e,n))}},jm={AUDIO:(e,t)=>{let{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:s,tracks:c,logger_:l}},mainPlaylistLoader:u}=t,d=od(u.main);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},d&&(o[e].main.default.playlists=u.main.playlists));for(let i in o[e]){s[i]||(s[i]=[]);for(let f in o[e][i]){let p=o[e][i][f],m;d?(l(`AUDIO group '${i}' label '${f}' is a main playlist`),p.isMainPlaylist=!0,m=null):m=r===`vhs-json`&&p.playlists?new Ld(p.playlists[0],n,a):p.resolvedUri?new Ld(p.resolvedUri,n,a):p.playlists&&r===`dash`?new yf(p.playlists[0],n,a,u):null,p=Q({id:f,playlistLoader:m},p),Am[e](e,p.playlistLoader,t),s[i].push(p),c[f]===void 0&&(c[f]=new Z.AudioTrack({id:f,kind:Cm(p),enabled:!1,language:p.language,default:p.default,label:f}))}}i.on(`error`,km[e](e,t))},SUBTITLES:(e,t)=>{let{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:s},mediaTypes:{[e]:{groups:c,tracks:l}},mainPlaylistLoader:u}=t;for(let a in s[e]){c[a]||(c[a]=[]);for(let d in s[e][a]){if(!r.options_.useForcedSubtitles&&s[e][a][d].forced)continue;let f=s[e][a][d],p;if(i===`hls`)p=new Ld(f.resolvedUri,r,o);else if(i===`dash`){if(!f.playlists.filter(e=>e.excludeUntil!==1/0).length)return;p=new yf(f.playlists[0],r,o,u)}else i===`vhs-json`&&(p=new Ld(f.playlists?f.playlists[0]:f.resolvedUri,r,o));f=Q({id:d,playlistLoader:p},f),Am[e](e,f.playlistLoader,t),c[a].push(f),l[d]===void 0&&(l[d]=n.addRemoteTextTrack({id:d,kind:`subtitles`,default:f.default&&f.autoselect,language:f.language,label:d},!1).track)}}a.on(`error`,km[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:a}}}=t;for(let t in r[e]){i[t]||(i[t]=[]);for(let o in r[e][t]){let s=r[e][t][o];if(!/^(?:CC|SERVICE)/.test(s.instreamId))continue;let c=n.options_.vhs&&n.options_.vhs.captionServices||{},l={label:o,language:s.language,instreamId:s.instreamId,default:s.default&&s.autoselect};c[l.instreamId]&&(l=Q(l,c[l.instreamId])),l.default===void 0&&delete l.default,i[t].push(Q({id:o},s)),a[o]===void 0&&(a[o]=n.addRemoteTextTrack({id:l.instreamId,kind:`captions`,default:l.default,language:l.language,label:l.label},!1).track)}}}},Mm=(e,t)=>{for(let n=0;n<e.length;n++)if(id(t,e[n])||e[n].playlists&&Mm(e[n].playlists,t))return!0;return!1},Nm=(e,t)=>n=>{let{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,a=r.media();if(!a)return null;let o=null;a.attributes[e]&&(o=i[a.attributes[e]]);let s=Object.keys(i);if(!o){if(e===`AUDIO`&&s.length>1&&od(t.main))for(let e=0;e<s.length;e++){let t=i[s[e]];if(Mm(t,a)){o=t;break}}else i.main?o=i.main:s.length===1&&(o=i[s[0]])}return n===void 0?o:n===null||!o?null:o.filter(e=>e.id===n.id)[0]||null},Pm={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].mode===`showing`||n[e].mode===`hidden`)return n[e];return null}},Fm=(e,{mediaTypes:t})=>()=>{let n=t[e].activeTrack();return n?t[e].activeGroup(n):null},Im=e=>{[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{jm[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:a,main:o}}=e;[`AUDIO`,`SUBTITLES`].forEach(n=>{t[n].activeGroup=Nm(n,e),t[n].activeTrack=Pm[n](n,e),t[n].onGroupChanged=Em(n,e),t[n].onGroupChanging=Dm(n,e),t[n].onTrackChanged=Om(n,e),t[n].getActiveGroup=Fm(n,e)});let s=t.AUDIO.activeGroup();if(s){let e=(s.filter(e=>e.default)[0]||s[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),a.setAudio(!0)):o.setAudio(!0)}n.on(`mediachange`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanged())}),n.on(`mediachanging`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanging())});let c=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:`usage`,name:`vhs-audio-change`})};r.audioTracks().addEventListener(`change`,c),r.remoteTextTracks().addEventListener(`change`,t.SUBTITLES.onTrackChanged),i.on(`dispose`,()=>{r.audioTracks().removeEventListener(`change`,c),r.remoteTextTracks().removeEventListener(`change`,t.SUBTITLES.onTrackChanged)}),r.clearTracks(`audio`);for(let e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])},Lm=()=>{let e={};return[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Xp,activeTrack:Xp,getActiveGroup:Xp,onGroupChanged:Xp,onTrackChanged:Xp,lastTrack_:null,logger_:xu(`MediaGroups[${t}]`)}}),e};class Rm{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=yu(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class zm extends Z.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Rm,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=xu(`Content Steering`),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?`HLS`:`DASH`;let n=t.serverUri||t.serverURL;n?n.startsWith(`data:`)?this.decodeDataUriManifest_(n.substring(n.indexOf(`,`)+1)):(this.steeringManifest.reloadUri=yu(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger(`content-steering`)):(this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger(`error`))}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let n=e?t:this.getRequestURI(t);if(!n){this.logger_(`No valid content steering manifest URIs. Stopping content steering.`),this.trigger(`error`),this.dispose();return}let r={contentSteeringInfo:{uri:n}};this.trigger({type:`contentsteeringloadstart`,metadata:r}),this.request_=this.xhr_({uri:n,requestType:`content-steering-manifest`},(e,t)=>{if(e){if(t.status===410){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(t.status===429){let n=t.responseHeaders[`retry-after`];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),this.startTTLTimeout_(parseInt(n,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}this.trigger({type:`contentsteeringloadcomplete`,metadata:r});let i;try{i=JSON.parse(this.request_.responseText)}catch(e){let t={errorType:Z.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:`error`,metadata:t})}this.assignSteeringProperties_(i);let a={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:`contentsteeringparsed`,metadata:a}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new x.URL(e),n=new x.URL(this.proxyServerUrl_);return n.searchParams.set(`url`,encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){let t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new x.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,n)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger(`error`);return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e[`RELOAD-URI`],this.steeringManifest.priority=e[`PATHWAY-PRIORITY`]||e[`SERVICE-LOCATION-PRIORITY`],this.steeringManifest.pathwayClones=e[`PATHWAY-CLONES`],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_(`There are no available pathways for content steering. Ending content steering.`),this.trigger(`error`),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger(`content-steering`))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let n=this.setProxyServerUrl_(e);if(!t(n))return n}let n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){let t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off(`content-steering`),this.off(`error`),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Rm}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(yu(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Bm=(e,t)=>{let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(null,r)},t)}};let Vm;const Hm=[`mediaRequests`,`mediaRequestsAborted`,`mediaRequestsTimedout`,`mediaRequestsErrored`,`mediaTransferDuration`,`mediaBytesTransferred`,`mediaAppends`],Um=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Wm=function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:o,bufferBasedABR:s,log:c}){if(!r)return Z.log.warn(`We received no playlist to switch to. Please check your stream.`),!1;let l=`allowing switch ${e&&e.id||`null`} -> ${r.id}`;if(!e)return c(`${l} as current playlist is not set`),!0;if(r.id===e.id)return!1;let u=!!Du(t,n).length;if(!e.endList)return!u&&typeof e.partTargetDuration==`number`?(c(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${l} as current playlist is live`),!0);let d=Iu(t,n),f=s?bf.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:bf.MAX_BUFFER_LOW_WATER_LINE;if(o<f)return c(`${l} as duration < max low water line (${o} < ${f})`),!0;let p=r.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!s||d<a)){let e=`${l} as next bandwidth < current bandwidth (${p} < ${m})`;return s&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${a})`),c(e),!0}if((!s||p>m)&&d>=i){let e=`${l} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return s&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),c(e),!0}return c(`not ${l} as no switching criteria met`),!1};class Gm extends Z.EventTarget{constructor(e){super(),this.fastQualityChange_=Bm(this.fastQualityChange_.bind(this),100);let{src:t,withCredentials:n,tech:r,bandwidth:i,externVhs:a,useCueTags:o,playlistExclusionDuration:s,enableLowInitialPlaylist:c,sourceType:l,cacheEncryptionKeys:u,bufferBasedABR:d,leastPixelDiffSelector:f,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw Error(`A non-empty playlist URL or JSON manifest string is required`);let{maxPlaylistRetries:h}=e;h??=1/0,Vm=a,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!f,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=l,this.useCueTags_=o,this.playlistExclusionDuration=s,this.maxPlaylistRetries=h,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack(`metadata`,`ad-cues`),this.cueTagsTrack_.inBandMetadataTrackDispatchType=``),this.requestOptions_={withCredentials:n,maxPlaylistRetries:h,timeout:null},this.on(`error`,this.pauseLoading),this.mediaTypes_=Lm(),m&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,this.usingManagedMediaSource_=!0,Z.log(`Using ManagedMediaSource`)):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener(`durationchange`,this.handleDurationChange_),this.mediaSource.addEventListener(`sourceopen`,this.handleSourceOpen_),this.mediaSource.addEventListener(`sourceended`,this.handleSourceEnded_),this.mediaSource.addEventListener(`startstreaming`,this.load),this.mediaSource.addEventListener(`endstreaming`,this.pause),this.seekable_=Su(),this.hasPlayed_=!1,this.syncController_=new bm(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:`metadata`,label:`segment-metadata`},!1).track,this.segmentMetadataTrack_.mode=`hidden`,this.decrypter_=new Sm,this.sourceUpdater_=new sm(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new xm,this.keyStatusMap_=new Map;let g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:i,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_===`dash`?new yf(t,this.vhs_,Q(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ld(t,this.vhs_,Q(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Yp(Q(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:`main`}),e),this.audioSegmentLoader_=new Yp(Q(g,{loaderType:`audio`}),e),this.subtitleSegmentLoader_=new fm(Q(g,{loaderType:`vtt`,featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function n(){r.off(`vttjserror`,i),e()}function i(){r.off(`vttjsloaded`,n),t()}r.one(`vttjsloaded`,n),r.one(`vttjserror`,i),r.addWebVttScript_()})}),e);let _=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new zm(this.vhs_.xhr,_),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one(`loadedplaylist`,()=>this.startABRTimer_()),this.tech_.on(`pause`,()=>this.stopABRTimer_()),this.tech_.on(`play`,()=>this.startABRTimer_())),Hm.forEach(e=>{this[e+`_`]=Um.bind(this,e)}),this.logger_=xu(`pc`),this.triggeredFmp4Usage=!1,this.tech_.preload()===`none`?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one(`play`,this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let v=this.tech_.preload()===`none`?`play`:`loadstart`;this.tech_.one(v,()=>{let e=Date.now();this.tech_.one(`loadeddata`,()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e=`abr`){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){let r=this.media(),i=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(i&&i!==a){this.logger_(`switch media ${i} -> ${a} from ${t}`);let n={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:`renditionselected`,metadata:n}),this.tech_.trigger({type:`usage`,name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(e=>{let t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){let t=(n.length?n[0].playlists:n.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;let n=e.mediaGroups.AUDIO,r=Object.keys(n),i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{let e=n.main||r.length&&n[r[0]];for(let t in e)if(e[t].default){i={label:t};break}}if(!i)return t;let a=[];for(let t in n)if(n[t][i.label]){let r=n[t][i.label];if(r.playlists&&r.playlists.length)a.push.apply(a,r.playlists);else if(r.uri)a.push(r);else if(e.playlists.length)for(let n=0;n<e.playlists.length;n++){let r=e.playlists[n];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&a.push(r)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on(`loadedmetadata`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;rd(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!==`none`&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Im({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger(`selectedinitialmedia`):this.mediaTypes_.AUDIO.activePlaylistLoader.one(`loadedmetadata`,()=>{this.trigger(`selectedinitialmedia`)})}),this.mainPlaylistLoader_.on(`loadedplaylist`,()=>{this.loadOnPlay_&&this.tech_.off(`play`,this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||=this.selectPlaylist(),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,`initial`),!(this.sourceType_===`vhs-json`&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on(`error`,()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on(`mediachanging`,()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on(`mediachange`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;rd(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_===`dash`&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:`mediachange`,bubbles:!0})}),this.mainPlaylistLoader_.on(`playlistunchanged`,()=>{let e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!==`playlist-unchanged`&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:`Playlist no longer updating.`,reason:`playlist-unchanged`}}),this.tech_.trigger(`playliststuck`))}),this.mainPlaylistLoader_.on(`renditiondisabled`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-rendition-disabled`})}),this.mainPlaylistLoader_.on(`renditionenabled`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-rendition-enabled`})}),[`manifestrequeststart`,`manifestrequestcomplete`,`manifestparsestart`,`manifestparsecomplete`,`playlistrequeststart`,`playlistrequestcomplete`,`playlistparsestart`,`playlistparsecomplete`,`renditiondisabled`,`renditionenabled`].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(R({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(let e in n.AUDIO)for(let t in n.AUDIO[e])n.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:`usage`,name:`vhs-demuxed`}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:`usage`,name:`vhs-webvtt`}),Vm.Playlist.isAes(t)&&this.tech_.trigger({type:`usage`,name:`vhs-aes`}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:`usage`,name:`vhs-alternate-audio`}),this.useCueTags_&&this.tech_.trigger({type:`usage`,name:`vhs-playlist-cue-tags`})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine(),a=this.tech_.buffered();return Wm({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on(`bandwidthupdate`,()=>{this.checkABR_(`bandwidthupdate`),this.tech_.trigger(`bandwidthupdate`)}),this.mainSegmentLoader_.on(`timeout`,()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on(`progress`,()=>{this.trigger(`progress`)}),this.mainSegmentLoader_.on(`error`,()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on(`appenderror`,()=>{this.error=this.mainSegmentLoader_.error_,this.trigger(`error`)}),this.mainSegmentLoader_.on(`syncinfoupdate`,()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on(`timestampoffset`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-timestamp-offset`})}),this.audioSegmentLoader_.on(`syncinfoupdate`,()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on(`appenderror`,()=>{this.error=this.audioSegmentLoader_.error_,this.trigger(`error`)}),this.mainSegmentLoader_.on(`ended`,()=>{this.logger_(`main segment loader ended`),this.onEndOfStream()}),this.timelineChangeController_.on(`audioTimelineBehind`,()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on(`fixBadTimelineChange`,()=>{this.logger_(`Fix bad timeline change. Restarting al segment loaders...`),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on(`earlyabort`,e=>{this.bufferBasedABR||(this.delegateLoaders_(`all`,[`abort`]),this.excludePlaylist({error:{message:`Aborted early because there isn't enough bandwidth to complete the request without rebuffering.`},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on(`trackinfo`,e),this.audioSegmentLoader_.on(`trackinfo`,e),this.mainSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!0)}),this.audioSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!0)}),this.audioSegmentLoader_.on(`ended`,()=>{this.logger_(`audioSegmentLoader ended`),this.onEndOfStream()}),[`segmentselected`,`segmentloadstart`,`segmentloaded`,`segmentkeyloadstart`,`segmentkeyloadcomplete`,`segmentdecryptionstart`,`segmentdecryptioncomplete`,`segmenttransmuxingstart`,`segmenttransmuxingcomplete`,`segmenttransmuxingtrackinfoavailable`,`segmenttransmuxingtiminginfoavailable`,`segmentappendstart`,`appendsdone`,`bandwidthupdated`,`timelinechange`,`codecschange`].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_(`skipping fastQualityChange because new media is same as old`):(this.switchMedia_(e,`fast-quality`),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let n=t.end(0),r=n;if(e.start){let i=e.start.timeOffset;if(i<0){let a=this.mainPlaylistLoader_.main,o=n+Vm.Playlist.liveEdgeDelay(a,e);r=Math.max(Math.min(o+i,n),t.start(0))}else r=Math.min(n,i)}this.trigger(`firstplay`),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();e!==void 0&&typeof e.then==`function`&&e.then(null,e=>{})}this.trigger(`sourceopen`)}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger(`durationchange`)}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e&&=this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;let n=Vm.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Tu;let a=i.end(i.length-1);return a-r<=Tu&&n-a<=Tu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e||=this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState===`open`?this.sourceUpdater_.endOfStream(`network`):this.trigger(`error`);return}e.playlistErrors_++;let r=this.mainPlaylistLoader_.main.playlists,i=r.filter(Qu),a=i.length===1&&i[0]===e;if(r.length===1&&n!==1/0)return Z.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger(`retryplaylist`),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){let t=this.pathwayAttribute_(e),n=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},n);return}let t=!1;r.forEach(n=>{if(n===e)return;let r=n.excludeUntil;r!==void 0&&r!==1/0&&(t=!0,delete n.excludeUntil)}),t&&(Z.log.warn(`Removing other playlists from the exclusion list because the last rendition is about to be excluded.`),this.tech_.trigger(`retryplaylist`))}let o;o=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+n*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger(`excludeplaylist`),this.tech_.trigger({type:`usage`,name:`vhs-rendition-excluded`});let s=this.selectPlaylist();if(!s){this.error=`Playback cannot continue. No available working or supported playlists.`,this.trigger(`error`);return}let c=t.internal?this.logger_:Z.log.warn,l=t.message?` `+t.message:``;c(`${t.internal?`Internal problem`:`Problem`} encountered with playlist ${e.id}.${l} Switching to playlist ${s.id}.`),s.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_(`audio`,[`abort`,`pause`]),s.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_(`subtitle`,[`abort`,`pause`]),this.delegateLoaders_(`main`,[`abort`,`pause`]);let u=s.targetDuration/2*1e3||5e3,d=typeof s.lastRequest==`number`&&Date.now()-s.lastRequest<=u;return this.switchMedia_(s,`exclude`,a||d)}pauseLoading(){this.delegateLoaders_(`all`,[`abort`,`pause`]),this.stopABRTimer_()}delegateLoaders_(e,t){let n=[],r=e===`all`;(r||e===`main`)&&n.push(this.mainPlaylistLoader_);let i=[];(r||e===`audio`)&&i.push(`AUDIO`),(r||e===`subtitle`)&&(i.push(`CLOSED-CAPTIONS`),i.push(`SUBTITLES`)),i.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),[`main`,`audio`,`subtitle`].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||e===`all`)&&n.push(r)}),n.forEach(e=>t.forEach(t=>{typeof e[t]==`function`&&e[t]()}))}setCurrentTime(e){let t=Du(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Vm.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let n=e.media();if(!n)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let i=Vm.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n);return Su([[e,Math.max(e,t-i)]])}let i=this.syncController_.getExpiredTime(n,this.duration());if(i===null)return null;let a=Vm.Playlist.seekable(n,i,Vm.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;let n=e.start(0),r=e.end(0),i=t.start(0),a=t.end(0);return i>r||n>a?e:Su([[Math.max(n,i),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let e=this.getSeekableRange_(this.mainPlaylistLoader_,`main`);if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,`audio`),!t))return;let n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${ju(this.seekable_)}]`);let r={seekableRanges:this.seekable_};this.trigger({type:`seekablerangeschanged`,metadata:r}),this.tech_.trigger(`seekablechanged`)}updateDuration(e){if(this.updateDuration_&&=(this.mediaSource.removeEventListener(`sourceopen`,this.updateDuration_),null),this.mediaSource.readyState!==`open`){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener(`sourceopen`,this.updateDuration_);return}if(e){let e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1));return}let t=this.tech_.buffered(),n=Vm.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger(`dispose`),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off(`play`,this.loadOnPlay_),[`AUDIO`,`SUBTITLES`].forEach(e=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener(`sourceopen`,this.updateDuration_),this.mediaSource.removeEventListener(`durationchange`,this.handleDurationChange_),this.mediaSource.removeEventListener(`sourceopen`,this.handleSourceOpen_),this.mediaSource.removeEventListener(`sourceended`,this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;let n=Ed(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||Mt),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||jt}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||jt,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:`Could not determine codecs for playlist.`},playlistExclusionDuration:1/0});return}let a=(e,t)=>e?kt(t,this.usingManagedMediaSource_):At(t),o={},s;if([`video`,`audio`].forEach(function(t){if(r.hasOwnProperty(t)&&!a(e[t].isFmp4,r[t])){let n=e[t].isFmp4?`browser`:`muxer`;o[n]=o[n]||[],o[n].push(r[t]),t===`audio`&&(s=n)}}),i&&s&&t.attributes.AUDIO){let e=t.attributes.AUDIO;this.main().playlists.forEach(n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){let e=Object.keys(o).reduce((e,t)=>(e&&(e+=`, `),e+=`${t} does not support codec(s): "${o[t].join(`,`)}"`,e),``)+`.`;this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}else{if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if([`video`,`audio`].forEach(t=>{let n=(wt(this.sourceUpdater_.codecs[t]||``)[0]||{}).type,i=(wt(r[t]||``)[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(`, `)}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!==`open`||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(`,`);this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{let r=e[n];if(t.indexOf(r.id)!==-1)return;t.push(r.id);let i=Ed(this.main,r),a=[];i.audio&&!At(i.audio)&&!kt(i.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${i.audio}`),i.video&&!At(i.video)&&!kt(i.video,this.usingManagedMediaSource_)&&a.push(`video codec ${i.video}`),i.text&&i.text===`stpp.ttml.im1t`&&a.push(`text codec ${i.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(`, `)}`))})}excludeIncompatibleVariants_(e){let t=[],n=this.main().playlists,r=wd(wt(e)),i=Td(r),a=r.video&&wt(r.video)[0]||null,o=r.audio&&wt(r.audio)[0]||null;Object.keys(n).forEach(e=>{let r=n[e];if(t.indexOf(r.id)!==-1||r.excludeUntil===1/0)return;t.push(r.id);let s=[],c=Ed(this.mainPlaylistLoader_.main,r),l=Td(c);if(c.audio||c.video){if(l!==i&&s.push(`codec count "${l}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){let e=c.video&&wt(c.video)[0]||null,t=c.audio&&wt(c.audio)[0]||null;e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&s.push(`video codec "${e.type}" !== "${a.type}"`),t&&o&&t.type.toLowerCase()!==o.type.toLowerCase()&&s.push(`audio codec "${t.type}" !== "${o.type}"`)}s.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${s.join(` && `)}`))}})}updateAdCues_(e){let t=0,n=this.seekable();n.length&&(t=n.start(0)),mm(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=bf.GOAL_BUFFER_LENGTH,n=bf.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,bf.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=bf.BUFFER_LOW_WATER_LINE,n=bf.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,bf.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,bf.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return bf.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Ep(this.inbandTextTracks_,`com.apple.streaming`,this.tech_),Tp({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ep(this.inbandTextTracks_,e,this.tech_),Sp({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes[`PATHWAY-ID`]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one(`canplay`,()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on(`content-steering`,this.excludeThenChangePathway_.bind(this)),[`contentsteeringloadstart`,`contentsteeringloadcomplete`,`contentsteeringparsed`].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(R({},e))})}),this.sourceType_===`dash`&&this.mainPlaylistLoader_.on(`loadedplaylist`,()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),n=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(n.push(e),!t.has(e)))return!0}return!(n.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,n=new Set,r=!1;Object.keys(t).forEach(i=>{let a=t[i],o=this.pathwayAttribute_(a),s=o&&e!==o;a.excludeUntil===1/0&&a.lastExcludeReason_===`content-steering`&&!s&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);let c=!a.excludeUntil&&a.excludeUntil!==1/0;!n.has(a.id)&&s&&c&&(n.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_=`content-steering`,this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_===`DASH`&&Object.keys(this.mediaTypes_).forEach(t=>{let n=this.mediaTypes_[t];if(n.activePlaylistLoader){let t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(let[e,r]of t.entries())n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,i]of n.entries()){let n=t.get(r);n?this.equalPathwayClones_(n,i)||(this.mainPlaylistLoader_.updateOrDeleteClone(i,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(e=>e.attributes[`PATHWAY-ID`]===i[`BASE-ID`]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(i,e)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e[`BASE-ID`]!==t[`BASE-ID`]||e.ID!==t.ID||e[`URI-REPLACEMENT`].HOST!==t[`URI-REPLACEMENT`].HOST)return!1;let n=e[`URI-REPLACEMENT`].PARAMS,r=t[`URI-REPLACEMENT`].PARAMS;for(let e in n)if(n[e]!==r[e])return!1;for(let e in r)if(n[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_===`DASH`&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,`content-steering`)}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t=`non-usable`;this.mainPlaylistLoader_.main.playlists.forEach(n=>{let r=this.mainPlaylistLoader_.getKeyIdSet(n);r&&r.size&&r.forEach(r=>{let i=`usable`,a=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===i,o=n.lastExcludeReason_===t&&n.excludeUntil===1/0;a?a&&o&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${i}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${i}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,Z.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let n=(typeof e==`string`?e:lm(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off(`loadedplaylist`,this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on(`loadedplaylist`,this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const Km=(e,t,n)=>r=>{let i=e.main.playlists[t],a=Zu(i),o=Qu(i);if(r===void 0)return o;r?delete i.disabled:i.disabled=!0;let s={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:`fast-quality`};return r!==o&&!a&&(r?(n(i),e.trigger({type:`renditionenabled`,metadata:s})):e.trigger({type:`renditiondisabled`,metadata:s})),r};class qm{constructor(e,t,n){let{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes[`FRAME-RATE`]}this.codecs=Ed(r.main(),t),this.playlist=t,this.id=n,this.enabled=Km(e.playlists,t.id,i)}}const Jm=function(e){e.representations=()=>{let t=e.playlistController_.main(),n=od(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(e=>!Zu(e)).map((t,n)=>new qm(e,t,t.id)):[]}},Ym=[`seeking`,`seeked`,`pause`,`playing`,`error`];class Xm extends Z.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=xu(`PlaybackWatcher`),this.logger_(`initialize`);let t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),i=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=[`main`,`subtitle`,`audio`],s={};o.forEach(e=>{s[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].on(`playlistupdate`,s[e].reset),this.tech_.on([`seeked`,`seeking`],s[e].reset)});let c=e=>{[`main`,`audio`].forEach(t=>{a[`${t}SegmentLoader_`][e](`appended`,this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c(`off`))},this.clearSeekingAppendCheck_=()=>c(`off`),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c(`on`)},this.tech_.on(`seeked`,this.clearSeekingAppendCheck_),this.tech_.on(`seeking`,this.watchForBadSeeking_),this.tech_.on(`waiting`,r),this.tech_.on(Ym,i),this.tech_.on(`canplay`,n),this.tech_.one(`play`,t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_(`dispose`),this.tech_.off(`waiting`,r),this.tech_.off(Ym,i),this.tech_.off(`canplay`,n),this.tech_.off(`play`,t),this.tech_.off(`seeking`,this.watchForBadSeeking_),this.tech_.off(`seeked`,this.clearSeekingAppendCheck_),o.forEach(e=>{a[`${e}SegmentLoader_`].off(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].off(`playlistupdate`,s[e].reset),this.tech_.off([`seeked`,`seeking`],s[e].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=Pu(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,i){let n={bufferedRanges:r};t.trigger({type:`bufferedrangeschanged`,metadata:n}),this.resetSegmentDownloads_(e)}else this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Nu(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:`usage`,name:`vhs-${e}-download-exclusion`}),e!==`subtitle`&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Tu>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Su([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:`playedrangeschanged`,metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let e=this.seekable(),t=this.tech_.currentTime(),n=this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow),r;if(n&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){let t=e.start(0);r=t+(t===e.end(0)?0:Tu)}if(r!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${ju(e)}. Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0;let i=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=i.audioBuffer?i.audioBuffered():null,s=i.videoBuffer?i.videoBuffered():null,c=this.media(),l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-wu)*2,u=[o,s];for(let e=0;e<u.length;e++)if(u[e]&&Iu(u[e],t)<l)return!1;let d=Ou(a,t);return d.length!==0&&(r=d.start(0)+Tu,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${t}). Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Du(t,e);n.length&&e+3<=n.end(0)&&(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:`usage`,name:`vhs-unknown-waiting`}))}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:`usage`,name:`vhs-live-resync`}),!0}let n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:`usage`,name:`vhs-video-underflow`}),!0;let i=Ou(r,t);return i.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+Tu,a=!n.endList,o=typeof n.partTargetDuration==`number`;return a&&(o||r)&&(i=e.end(e.length-1)+n.targetDuration*3),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){let i=Du(e,n-3),a=Du(e,n),o=Du(t,n);o.length&&!a.length&&i.length&&(r={start:i.end(0),end:o.end(0)})}else Ou(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0):!1}skipTheGap_(e){let t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Ou(t,n);if(this.resetTimeUpdate_(),r.length===0||n!==e)return;this.logger_(`skipTheGap_:`,`currentTime:`,n,`scheduled currentTime:`,e,`nextRange start:`,r.start(0)),this.tech_.setCurrentTime(r.start(0)+wu);let i={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:`gapjumped`,metadata:i}),this.tech_.trigger({type:`usage`,name:`vhs-gap-skip`})}gapFromVideoUnderflow_(e,t){let n=ku(e);for(let e=0;e<n.length;e++){let r=n.start(e),i=n.end(e);if(t-r<4&&t-r>2)return{start:r,end:i}}return null}}const Zm={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Qm=function(e,t){let n=0,r=0,i=Q(Zm,t);e.ready(()=>{e.trigger({type:`usage`,name:`vhs-error-reload-initialized`})});let a=function(){r&&e.currentTime(r)},o=function(t){t!=null&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one(`loadedmetadata`,a),e.src(t),e.trigger({type:`usage`,name:`vhs-error-reload`}),e.play())},s=function(){if(Date.now()-n<i.errorInterval*1e3)e.trigger({type:`usage`,name:`vhs-error-reload-canceled`});else if(!i.getSource||typeof i.getSource!=`function`)Z.log.error(`ERROR: reloadSourceOnError - The option getSource must be a function!`);else return n=Date.now(),i.getSource.call(e,o)},c=function(){e.off(`loadedmetadata`,a),e.off(`error`,s),e.off(`dispose`,c)};e.on(`error`,s),e.on(`dispose`,c),e.reloadSourceOnError=function(t){c(),Qm(e,t)}},$m=function(e){Qm(this,e)};var eh=`3.17.5`,th=`7.1.0`,nh=`1.4.0`,rh=`7.2.0`,ih=`4.0.2`;const ah={PlaylistLoader:Ld,Playlist:sd,utils:Zd,STANDARD_PLAYLIST_SELECTOR:pp,INITIAL_PLAYLIST_SELECTOR:gp,lastBandwidthSelector:pp,movingAverageBandwidthSelector:mp,comparePlaylistBandwidth:up,comparePlaylistResolution:dp,xhr:Vd()};Object.keys(bf).forEach(e=>{Object.defineProperty(ah,e,{get(){return Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),bf[e]},set(t){Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),typeof t!=`number`||t<0?Z.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):bf[e]=t}})});const oh=`videojs-vhs`,sh=function(e,t){let n=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===n.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:`change`})},ch=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),sh(e,t.playlists)};ah.canPlaySource=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)};const lh=(e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=wd(wt(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);let i=Ot(r.video),a=Ot(r.audio),o={};for(let n in e)o[n]={},a&&(o[n].audioContentType=a),i&&(o[n].videoContentType=i),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(o[n].pssh=t.contentProtection[n].pssh),typeof e[n]==`string`&&(o[n].url=e[n]);return Q(e,o)},uh=(e,t)=>e.reduce((e,n)=>{if(!n.contentProtection)return e;let r=t.reduce((e,t)=>{let r=n.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]),dh=({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();let i=n?r.concat([n]):r,a=uh(i,Object.keys(t)),o=[],s=[];return a.forEach(t=>{s.push(new Promise((t,n)=>{e.tech_.one(`keysessioncreated`,t)})),o.push(new Promise((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):n()})}))}),Promise.race([Promise.all(o),Promise.race(s)])},fh=({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{let i=lh(t,n,r);return i?(e.currentSource().keySystems=i,i&&!e.eme?(Z.log.warn(`DRM encrypted source cannot be decrypted without a DRM plugin`),!1):!0):!1},ph=()=>{if(!x.localStorage)return null;let e=x.localStorage.getItem(oh);if(!e)return null;try{return JSON.parse(e)}catch{return null}},mh=e=>{if(!x.localStorage)return!1;let t=ph();t=t?Q(t,e):e;try{x.localStorage.setItem(oh,JSON.stringify(t))}catch{return!1}return t},hh=e=>e.toLowerCase().indexOf(`data:application/vnd.videojs.vhs+json,`)===0?JSON.parse(e.substring(e.indexOf(`,`)+1)):e,gh=(e,t)=>{e._requestCallbackSet||=new Set,e._requestCallbackSet.add(t)},_h=(e,t)=>{e._responseCallbackSet||=new Set,e._responseCallbackSet.add(t)},vh=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},yh=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};ah.supportsNativeHls=function(){if(!F||!F.createElement)return!1;let e=F.createElement(`video`);return Z.getTech(`Html5`).isSupported()?[`application/vnd.apple.mpegurl`,`audio/mpegurl`,`audio/x-mpegurl`,`application/x-mpegurl`,`video/x-mpegurl`,`video/mpegurl`,`application/mpegurl`].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))}):!1}(),ah.supportsNativeDash=function(){return!F||!F.createElement||!Z.getTech(`Html5`).isSupported()?!1:/maybe|probably/i.test(F.createElement(`video`).canPlayType(`application/dash+xml`))}(),ah.supportsTypeNatively=e=>e===`hls`?ah.supportsNativeHls:e===`dash`&&ah.supportsNativeDash,ah.isSupported=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)},ah.xhr.onRequest=function(e){gh(ah.xhr,e)},ah.xhr.onResponse=function(e){_h(ah.xhr,e)},ah.xhr.offRequest=function(e){vh(ah.xhr,e)},ah.xhr.offResponse=function(e){yh(ah.xhr,e)};const bh=Z.getComponent(`Component`);class xh extends bh{constructor(e,t,n){if(super(t,n.vhs),typeof n.initialBandwidth==`number`&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=xu(`VhsHandler`),t.options_&&t.options_.playerId){let e=Z.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error(`Overriding native VHS requires emulated tracks. See https://git.io/vMpjB`);this.on(F,[`fullscreenchange`,`webkitfullscreenchange`,`mozfullscreenchange`,`MSFullscreenChange`],e=>{let t=F.fullscreenElement||F.webkitFullscreenElement||F.mozFullScreenElement||F.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,`seeking`,function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,`error`,function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,`play`,this.play)}setOptions_(e={}){if(this.options_=Q(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage===void 0?this.options_.useBandwidthFromLocalStorage||!1:this.source_.useBandwidthFromLocalStorage,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi===void 0||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!=`number`&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!=`number`&&this.options_.useBandwidthFromLocalStorage){let e=ph();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:`usage`,name:`vhs-bandwidth-from-local-storage`})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:`usage`,name:`vhs-throughput-from-local-storage`}))}typeof this.options_.bandwidth!=`number`&&(this.options_.bandwidth=bf.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===bf.INITIAL_BANDWIDTH,[`withCredentials`,`useDevicePixelRatio`,`usePlayerObjectFit`,`customPixelRatio`,`limitRenditionByPlayerDimensions`,`bandwidth`,`customTagParsers`,`customTagMappers`,`cacheEncryptionKeys`,`playlistSelector`,`initialPlaylistSelector`,`bufferBasedABR`,`liveRangeSafeTimeDelta`,`llhls`,`useForcedSubtitles`,`useNetworkInformationApi`,`useDtsForTimestampOffset`,`exactManifestTimings`,`leastPixelDiffSelector`].forEach(e=>{this.source_[e]!==void 0&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let t=this.options_.customPixelRatio;typeof t==`number`&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=hh(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ah,this.options_.sourceType=Ft(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Gm(this.options_);let n=Q({liveRangeSafeTimeDelta:Tu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Xm(n),this.attachStreamingEventListeners_(),this.playlistController_.on(`error`,()=>{let e=Z.players[this.tech_.options_.playerId],t=this.playlistController_.error;typeof t==`object`&&!t.code?t.code=3:typeof t==`string`&&(t={message:t,code:3}),e.error(t)});let r=this.options_.bufferBasedABR?ah.movingAverageBandwidthSelector(.55):ah.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ah.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){let r=t.downlink*1e3*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let e=1/(this.bandwidth||1),t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){Z.log.error(`The "systemBandwidth" property is read-only`)}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Nu(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Nu(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one(`canplay`,this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on(`bandwidthupdate`,()=>{this.options_.useBandwidthFromLocalStorage&&mh({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on(`selectedinitialmedia`,()=>{Jm(this)}),this.playlistController_.sourceUpdater_.on(`createdsourcebuffers`,()=>{this.setupEme_()}),this.on(this.playlistController_,`progress`,function(){this.tech_.trigger(`progress`)}),this.on(this.playlistController_,`firstplay`,function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),(Z.browser.IS_ANY_SAFARI||Z.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType===`hls`&&typeof this.tech_.addSourceElement==`function`?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_(`waiting for EME key session creation`),dh({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_(`created EME key session`),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_(`error while creating EME key session`,e),this.player_.error({message:`Failed to initialize media keys for EME`,code:3})})}handleWaitingForKey_(){this.logger_(`waitingforkey fired, attempting to create any new key sessions`),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=fh({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on(`keystatuschange`,e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on(`waitingforkey`,this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){let e=Z.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on(`selectedinitialmedia`,()=>{ch(this.qualityLevels_,this)}),this.playlists.on(`mediachange`,()=>{sh(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":eh,"mux.js":th,"mpd-parser":nh,"m3u8-parser":rh,"aes-decrypter":ih}}version(){return this.constructor.version()}canChangeType(){return sm.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off(`waitingforkey`,this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return of({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return sf({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{gh(this.xhr,e)},this.xhr.onResponse=e=>{_h(this.xhr,e)},this.xhr.offRequest=e=>{vh(this.xhr,e)},this.xhr.offResponse=e=>{yh(this.xhr,e)},this.player_.trigger(`xhr-hooks-ready`)}attachStreamingEventListeners_(){[`seekablerangeschanged`,`bufferedrangeschanged`,`contentsteeringloadstart`,`contentsteeringloadcomplete`,`contentsteeringparsed`].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(R({},e))})}),[`gapjumped`,`playedrangeschanged`].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(R({},e))})})}}const Sh={name:`videojs-http-streaming`,VERSION:eh,canHandleSource(e,t={}){let n=Q(Z.options,t);return!n.vhs.experimentalUseMMS&&!kt(`avc1.4d400d,mp4a.40.2`,!1)?!1:Sh.canPlayType(e.type,n)},handleSource(e,t,n={}){let r=Q(Z.options,n);return t.vhs=new xh(e,t,r),t.vhs.xhr=Vd(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let n=Ft(e);if(!n)return``;let r=Sh.getOverrideNative(t);return!ah.supportsTypeNatively(n)||r?`maybe`:``},getOverrideNative(e={}){let{vhs:t={}}=e,n=!(Z.browser.IS_ANY_SAFARI||Z.browser.IS_IOS),{overrideNative:r=n}=t;return r}};kt(`avc1.4d400d,mp4a.40.2`,!0)&&Z.getTech(`Html5`).registerSourceHandler(Sh,0),Z.VhsHandler=xh,Z.VhsSourceHandler=Sh,Z.Vhs=ah,Z.use||Z.registerComponent(`Vhs`,ah),Z.options.vhs=Z.options.vhs||{},(!Z.getPlugin||!Z.getPlugin(`reloadSourceOnError`))&&Z.registerPlugin(`reloadSourceOnError`,$m);let $=class extends t{constructor(){super(...arguments),this._controllerConfigs={autoplay:!1,autoSetup:!1,controls:!1,defaultVolume:.3,disablePictureInPicture:!0,enableDocumentPictureInPicture:!1,enableSmoothSeeking:!0,html5:{nativeAudioTracks:!1,nativeVideoTracks:!1,vhs:{llhls:!0,overrideNative:!0}},inactivityTimeout:0,liveTracker:{liveTolerance:10,trackingThreshold:15},loop:!1,muted:!1,nativeControlsForTouch:!1,normalizeAutoplay:!0,preload:`auto`},this._prevPlayingState=!1,this._retryCount=0,this._qualityLevels=[],this.autoplay=!1,this.currentMetadata=null,this.element=null,this.isLive=!1,this.mimeType=null,this.sensorModel=null,this.started=!1,this.state=`not-ready`,this.waitingTimestamp=null,this._initController=async()=>{if(!this._controller&&this.playerUrl)try{let e={...this._controllerConfigs};this.element=document.createElement(`video`),Z.log.level(`off`),this._controller=Z(this.element,e),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.qualityLevels().on(`addqualitylevel`,e=>this._handleQualityLevel(e)),this._controller.ready(this._handleReady),this._controller.one(`play`,this._handleFirstPlay),this._controller.on(`canplay`,this._handleCanPlay),this._controller.on(`durationchange`,this._handleDurationChange),this._controller.on(`ended`,this._handleEnded),this._controller.on(`error`,this._handleError),this._controller.on(`loadeddata`,this._handleDataLoaded),this._controller.on(`loadedmetadata`,this._handleLoadedMetadata),this._controller.on(`loadstart`,this._handleLoadStart),this._controller.on(`play`,this._handlePlay),this._controller.on(`playing`,this._handlePlaying),this._controller.on(`stalled`,this._handleStalled),this._controller.on(`timeupdate`,this._handleTimeUpdate),this._controller.on(`waiting`,this._handleWaiting),this._controller.on(`xhr-hooks-ready`,this._handleXHRhooksReady),this._controller?.liveTracker.on(`seekableendchange`,()=>this.notifyChange(`livestreamStatus`)),this._controller?.liveTracker.on(`liveedgechange`,()=>this.notifyChange(`livestreamStatus`))}catch{r.getLogger(this).error(`Unable to initialize the player.`),this._controller&&this._controller.dispose()}},this._handleQualityLevel=e=>{if(!e?.qualityLevel)return;let t=e.qualityLevel;this._qualityLevels.push(t),t?.enabled&&(this._set(`videoWidth`,t?.width??0),this._set(`videoHeight`,t?.height??0))},this._handleReady=()=>{this.state=`ready`},this._handleFirstPlay=()=>{this._set(`started`,!0)},this._handleCanPlay=async()=>{if(this._prevPlayingState=this.state===`playing`,this.state=`can-play`,this.autoplay&&!this.started)try{this.muted=!0,await this.play()}catch{r.getLogger(this).info(`Unable to auto start playback. Blocked by the browser.`)}},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;let e=this.subtitleTrack?.activeCues,t=f(e);if(!t?.length)return;let n=new Map;for(let e of t)Array.isArray(e.value)?e.tagId===90064?n.set(e.tagId,e):e.value.forEach(e=>{n.set(e.tagId,e)}):n.set(e.tagId,e);n.set(p.EsriVideoWidth,{name:`Video Width`,tagId:p.EsriVideoWidth,value:this._controller?.videoWidth()}),n.set(p.EsriVideoHeight,{name:`Video Height`,tagId:p.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(n)},this._handleDataLoaded=()=>{this._set(`videoWidth`,this._controller?.videoWidth()),this._set(`videoHeight`,this._controller?.videoHeight())},this._handleDurationChange=()=>{this._controller?.duration()!==0&&(this.notifyChange(`duration`),this.isLive=this._controller?.duration()===1/0||!1,this._setLivestreamStatus(),this.started&&this._controller?.duration()===this._controller?.currentTime()&&this._controller?.trigger(`ended`))},this._handleEnded=()=>{this._controller?.ended()&&this.notifyChange(`ended`)},this._handleError=()=>{let e=this._controller?.error()??null;if(typeof e?.code==`number`&&e?.code<3&&this._retryCount===0)this._retryCount++,setTimeout(()=>{this._controller?.src({type:this.mimeType,src:this.playerUrl}),this._controller?.load()},2e3);else{let t=new n(`Media Error`,e?.message??``);r.getLogger(this).error(t),this.reset()}},this._handleLoadStart=()=>{this.state=`can-play`},this._handleLoadedMetadata=()=>{this.state=`can-play`,this.notifyChange(`buffered`),this.notifyChange(`subtitleTrack`)},this._handlePlay=()=>{this.notifyChange(`ended`)},this._handlePlaying=()=>{this.state=`playing`,this._retryCount=0,this.notifyChange(`ended`)},this._handleStalled=()=>{r.getLogger(this).warn(`Playback is stalled and awaiting data`)},this._handleTimeUpdate=()=>{this._setLivestreamStatus(),this.notifyChange(`currentTime`),this.notifyChange(`buffered`),this.notifyChange(`bufferedPercent`),this._set(`videoWidth`,this._controller?.videoWidth()),this._set(`videoHeight`,this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime(),this.state=`waiting`},this._handleXHRhooksReady=()=>{this._controller?.tech(!0)?.vhs.xhr.onRequest(e=>(e.xhr=new c,e))},this._updateSensorModel=()=>{this.currentMetadata?.size&&(this.sensorModel?this.sensorModel.updateSensorModel(this.currentMetadata):this.sensorModel=new d({videoMetadata:this.currentMetadata}))},this._setLivestreamStatus=()=>{if(!this.isLive){this.livestreamStatus=null;return}this._controller?.liveTracker.isTracking()||this._controller?.liveTracker.startTracking();let e={atLiveEdge:this._controller?.liveTracker.atLiveEdge()??null,behindLiveEdge:this._controller?.liveTracker.behindLiveEdge()??null,liveCurrentTime:this._controller?.liveTracker?.liveCurrentTime()??null,liveWindow:this._controller?.liveTracker?.liveWindow()??null,pastSeekEnd:this._controller?.liveTracker?.pastSeekEnd()??null,seekableEnd:this._controller?.liveTracker?.seekableEnd()??null,seekableStart:this._controller?.liveTracker?.seekableStart()??null};this.livestreamStatus={...e},this.notifyChange(`livestreamStatus`),this._controller?.liveTracker.handlePlay(),this._controller?.liveTracker.handleFirstTimeupdate()}}initialize(){this.addHandles([a(()=>this.playerUrl,e=>{e&&this._initController().then(()=>{this.mimeType=m(e),this._controller?.src({src:this.playerUrl,type:this.mimeType})})},o),a(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode=`showing`)},o),a(()=>this.isLive,async e=>{e&&(this._controller?.liveTracker.startTracking(),this.autoplay&&(this.muted=!0,await this.play()))}),a(()=>this.currentMetadata,()=>this._updateSensorModel())]),this.addHandles(s(()=>this.subtitleTrack,`cuechange`,this._handleCueChange),o)}destroy(){this.removeAllHandles(),this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get crossOrigin(){return this._controller?.crossOrigin()??this._get(`crossOrigin`)}set crossOrigin(e){this._controller?.crossOrigin(e),this._set(`crossOrigin`,e)}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get(`ended`)??!0}set ended(e){this._controller?.trigger(`ended`),this._set(`ended`,e)}get loop(){return this._controller?.loop()??this._get(`loop`)??!1}set loop(e){this._controller?.loop(e),this._set(`loop`,e)}get muted(){return this._controller?.muted()??this._get(`muted`)??!1}set muted(e){this._controller?.muted(e),this._set(`muted`,e)}get playerUrl(){return this._controller?.src()||``}set playerUrl(e){this._set(`playerUrl`,e)}get playing(){return this.ended?!1:this.state===`can-play`?this._prevPlayingState:this.state===`playing`}get playsInline(){return this._controller?.playsinline()??this._get(`playsInline`)??!1}set playsInline(e){this._controller?.playsinline(e),this._set(`playsInline`,e)}get rate(){return this._controller?.playbackRate()??this._get(`rate`)??1}set rate(e){this._controller?.playbackRate(e),this._set(`rate`,e)}get startMode(){return this._controller?.preload()??this._get(`startMode`)??`auto`}set startMode(e){this._controller?.preload(e),this._set(`startMode`,e)}get subtitleTrack(){let e=this._controller?.textTracks();return e?.length?Array.from(e).find(e=>e.kind===`subtitles`):null}get volume(){return this._controller?.volume()??0}set volume(e){let t=i(e,0,1);isNaN(t)||this._controller?.volume(t)}get waiting(){return this.waitingTimestamp?!1:this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1)}pause(){this._controller?.pause(),this.state=`paused`}async play(){try{!this.started&&this.isLive&&this._controller?.muted(!0),await this._controller?.play(),this.state=`playing`}catch{}}reset(){this._controller&&(this._prevPlayingState=!1,this._retryCount=0,this._set(`started`,!1),this.setCurrentTime(0),this.notifyChange(`buffered`),this.notifyChange(`currentTime`),this.notifyChange(`duration`),this.notifyChange(`waiting`),this._controller?.trigger(`can-play`),this.autoplay||this._controller?.pause())}seekToLiveEdge(){this.isLive?this.state===`playing`&&this._controller?.liveTracker.isTracking()&&this._controller?.liveTracker.seekToLiveEdge():r.getLogger(this).info(`seekToLiveEdge method is only available for livestream playback.`)}setCurrentTime(e){let t=i(e,0,this.duration);this._controller?.currentTime(t),this.notifyChange(`currentTime`)}};e([l()],$.prototype,`autoplay`,void 0),e([l()],$.prototype,`buffered`,null),e([l()],$.prototype,`bufferedPercent`,null),e([l()],$.prototype,`crossOrigin`,null),e([l({readOnly:!0})],$.prototype,`currentTime`,null),e([l()],$.prototype,`currentMetadata`,void 0),e([l({readOnly:!0})],$.prototype,`duration`,null),e([l()],$.prototype,`element`,void 0),e([l({readOnly:!0})],$.prototype,`ended`,null),e([l()],$.prototype,`isLive`,void 0),e([l()],$.prototype,`livestreamStatus`,void 0),e([l()],$.prototype,`loop`,null),e([l()],$.prototype,`mimeType`,void 0),e([l()],$.prototype,`muted`,null),e([l()],$.prototype,`playerUrl`,null),e([l({readOnly:!0})],$.prototype,`playing`,null),e([l()],$.prototype,`playsInline`,null),e([l()],$.prototype,`rate`,null),e([l()],$.prototype,`sensorModel`,void 0),e([l({readOnly:!0})],$.prototype,`started`,void 0),e([l()],$.prototype,`startMode`,null),e([l()],$.prototype,`state`,void 0),e([l()],$.prototype,`subtitleTrack`,null),e([l({readOnly:!0})],$.prototype,`videoHeight`,void 0),e([l({readOnly:!0})],$.prototype,`videoWidth`,void 0),e([l()],$.prototype,`volume`,null),e([l({readOnly:!0})],$.prototype,`waiting`,null),e([l()],$.prototype,`waitingTimestamp`,void 0),$=e([u(`esri.layers.video.VideoController`)],$);export{$ as default};
200
+ `,a=n,o=t;this.start_=a,e.forEach((e,t)=>{let n=this.storage_.get(o),s=a,c=s+e.duration,l=!!(n&&n.segmentSyncInfo&&n.segmentSyncInfo.isAppended),u=new hm({start:s,end:c,appended:l,segmentIndex:t});e.syncInfo=u;let d=a,f=(e.parts||[]).map((e,r)=>{let a=d,s=d+e.duration,c=!!(n&&n.partsSyncInfo&&n.partsSyncInfo[r]&&n.partsSyncInfo[r].isAppended),l=new hm({start:a,end:s,appended:c,segmentIndex:t,partIndex:r});return d=s,i+=`Media Sequence: ${o}.${r} | Range: ${a} --> ${s} | Appended: ${c}\n`,e.syncInfo=l,l});r.set(o,new gm(u,f)),i+=`${vp(e.resolvedUri)} | Media Sequence: ${o} | Range: ${s} --> ${c} | Appended: ${l}\n`,o++,a=c}),this.end_=a,this.storage_=r,this.diagnostics_=i}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let n=r-e,i=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<n;e++){let n=t[e];i-=n.duration}return i}return n}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class vm extends _m{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}}const ym=[{name:`VOD`,run:(e,t,n,r,i)=>n===1/0?null:{time:0,segmentIndex:0,partIndex:null}},{name:`MediaSequence`,run:(e,t,n,r,i,a)=>{let o=e.getMediaSequenceSync(a);if(!o||!o.isReliable)return null;let s=o.getSyncInfoForTime(i);return s?{time:s.start,partIndex:s.partIndex,segmentIndex:s.segmentIndex}:null}},{name:`ProgramDateTime`,run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let a=null,o=null,s=Ru(t);i||=0;for(let n=0;n<s.length;n++){let r=s[t.endList||i===0?n:s.length-(n+1)],c=r.segment,l=e.timelineToDatetimeMappings[c.timeline];if(!l||!c.dateTimeObject)continue;let u=c.dateTimeObject.getTime()/1e3+l;if(c.parts&&typeof r.partIndex==`number`)for(let e=0;e<r.partIndex;e++)u+=c.parts[e].duration;let d=Math.abs(i-u);if(o!==null&&(d===0||o<d))break;o=d,a={time:u,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return a}},{name:`Segment`,run:(e,t,n,r,i)=>{let a=null,o=null;i||=0;let s=Ru(t);for(let e=0;e<s.length;e++){let n=s[t.endList||i===0?e:s.length-(e+1)],c=n.segment,l=n.part&&n.part.start||c&&c.start;if(c.timeline===r&&l!==void 0){let e=Math.abs(i-l);if(o!==null&&o<e)break;(!a||o===null||o>=e)&&(o=e,a={time:l,segmentIndex:n.segmentIndex,partIndex:n.partIndex})}}return a}},{name:`Discontinuity`,run:(e,t,n,r,i)=>{let a=null;if(i||=0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r<t.discontinuityStarts.length;r++){let o=t.discontinuityStarts[r],s=t.discontinuitySequence+r+1,c=e.discontinuities[s];if(c){let e=Math.abs(i-c.time);if(n!==null&&n<e)break;(!a||n===null||n>=e)&&(n=e,a={time:c.time,segmentIndex:o,partIndex:null})}}}return a}},{name:`Playlist`,run:(e,t,n,r,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class bm extends Z.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new _m,n=new vm(t),r=new vm(t);this.mediaSequenceStorage_={main:t,audio:n,vtt:r},this.logger_=xu(`SyncController`)}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,i){if(t!==1/0)return ym.find(({name:e})=>e===`VOD`).run(this,e,t);let a=this.runStrategies_(e,t,n,r,i);if(!a.length)return null;for(let t of a){let{syncPoint:n,strategy:i}=t,{segmentIndex:a,time:o}=n;if(a<0)continue;let s=e.segments[a],c=o,l=c+s.duration;if(this.logger_(`Strategy: ${i}. Current time: ${r}. selected segment: ${a}. Time: [${c} -> ${l}]}`),r>=c&&r<l)return this.logger_(`Found sync point with exact match: `,n),n}return this.selectSyncPoint_(a,{key:`time`,value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;let r=this.selectSyncPoint_(n,{key:`segmentIndex`,value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ku({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,i){let a=[];for(let o=0;o<ym.length;o++){let s=ym[o],c=s.run(this,e,t,n,r,i);c&&(c.strategy=s.name,a.push({strategy:s.name,syncPoint:c}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy;for(let a=1;a<e.length;a++){let o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${i}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+(typeof n.partIndex==`number`?`,partIndex:${n.partIndex}`:``)+`]`),n}saveExpiredSegmentInfo(e,t){let n=t.mediaSequence-e.mediaSequence;if(n>86400)Z.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let r=n-1;r>=0;r--){let n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger(`syncinfoupdate`);break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));let i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-(i.getTime()/1e3))}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){let r=e.segment,i=e.part,a=this.timelines[e.timeline],o,s;if(typeof e.timestampOffset==`number`)a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=a,this.trigger(`timestampoffset`),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,s=t.end+a.mapping;else if(a)o=t.start+a.mapping,s=t.end+a.mapping;else return!1;return i&&(i.start=o,i.end=s),(!r.start||o<r.start)&&(r.start=o),r.end=s,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=i-e.mediaIndex,s=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>s){let r;r=o<0?n.start-Ku({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+Ku({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:r,accuracy:s}}}}dispose(){this.trigger(`dispose`),this.off()}}class xm extends Z.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger(`pendingtimelinechange`)}pendingTimelineChange({type:e,from:t,to:n}){return typeof t==`number`&&typeof n==`number`&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger(`pendingtimelinechange`)),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if(typeof t==`number`&&typeof n==`number`){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];let r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:`timelinechange`,metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger(`dispose`),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var Sm=wf(Tf(Ef(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)}},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}();function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}let n=function(){let e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4],a,o,s,c=[],l=[],u,d,f,p,m,h;for(a=0;a<256;a++)l[(c[a]=a<<1^(a>>7)*283)^a]=a;for(o=s=0;!r[o];o^=u||1,s=l[s]||1)for(p=s^s<<1^s<<2^s<<3^s<<4,p=p>>8^p&255^99,r[o]=p,i[p]=o,f=c[d=c[u=c[o]]],h=f*16843009^d*65537^u*257^o*16843008,m=c[p]*257^p*16843008,a=0;a<4;a++)t[a][o]=m=m<<24^m>>>8,n[a][p]=h=h<<24^h>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e},r=null;class i{constructor(e){r||=n(),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let t,i,a,o=this._tables[0][4],s=this._tables[1],c=e.length,l=1;if(c!==4&&c!==6&&c!==8)throw Error(`Invalid aes key size`);let u=e.slice(0),d=[];for(this._key=[u,d],t=c;t<4*c+28;t++)a=u[t-1],(t%c===0||c===8&&t%c===4)&&(a=o[a>>>24]<<24^o[a>>16&255]<<16^o[a>>8&255]<<8^o[a&255],t%c===0&&(a=a<<8^a>>>24^l<<24,l=l<<1^(l>>7)*283)),u[t]=u[t-c]^a;for(i=0;t;i++,t--)a=u[i&3?t:t-4],t<=4||i<4?d[i]=a:d[i]=s[0][o[a>>>24]]^s[1][o[a>>16&255]]^s[2][o[a>>8&255]]^s[3][o[a&255]]}decrypt(e,t,n,r,i,a){let o=this._key[1],s=e^o[0],c=r^o[1],l=n^o[2],u=t^o[3],d,f,p,m=o.length/4-2,h,g=4,_=this._tables[1],v=_[0],y=_[1],b=_[2],x=_[3],S=_[4];for(h=0;h<m;h++)d=v[s>>>24]^y[c>>16&255]^b[l>>8&255]^x[u&255]^o[g],f=v[c>>>24]^y[l>>16&255]^b[u>>8&255]^x[s&255]^o[g+1],p=v[l>>>24]^y[u>>16&255]^b[s>>8&255]^x[c&255]^o[g+2],u=v[u>>>24]^y[s>>16&255]^b[c>>8&255]^x[l&255]^o[g+3],g+=4,s=d,c=f,l=p;for(h=0;h<4;h++)i[(3&-h)+a]=S[s>>>24]<<24^S[c>>16&255]<<16^S[l>>8&255]<<8^S[u&255]^o[g++],d=s,s=c,c=l,l=u,u=d}}class a extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null}push(e){this.jobs.push(e),this.timeout_||=setTimeout(this.processJob_.bind(this),this.delay)}}let o=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24},s=function(e,t,n){let r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),c=new Int32Array(s.buffer),l,u,d,f,p,m,h,g,_;for(l=n[0],u=n[1],d=n[2],f=n[3],_=0;_<r.length;_+=4)p=o(r[_]),m=o(r[_+1]),h=o(r[_+2]),g=o(r[_+3]),a.decrypt(p,m,h,g,c,_),c[_]=o(c[_]^l),c[_+1]=o(c[_+1]^u),c[_+2]=o(c[_+2]^d),c[_+3]=o(c[_+3]^f),l=p,u=m,d=h,f=g;return s};class c{constructor(e,n,r,i){let s=c.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength),d=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u)),d=s;d<l.length;d+=s)r=new Uint32Array([o(l[d-4]),o(l[d-3]),o(l[d-2]),o(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u));this.asyncStream_.push(function(){i(null,t(u))})}static get STEP(){return 32e3}decryptChunk_(e,t,n,r){return function(){let i=s(e,t,n);r.set(i,e.byteOffset)}}}var l=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},u=typeof window<`u`?window:l===void 0?typeof self<`u`?self:{}:l,d=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=u.BigInt||Number;f(`0x1`),f(`0x100`),f(`0x10000`),f(`0x1000000`),f(`0x100000000`),f(`0x10000000000`),f(`0x1000000000000`),f(`0x100000000000000`),f(`0x10000000000000000`),(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();let p=function(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];d(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t};self.onmessage=function(e){let t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new c(n,r,i,function(e,n){self.postMessage(p({source:t.source,decrypted:n}),[n.buffer])})}})));const Cm=e=>{let t=e.default?`main`:`alternative`;return e.characteristics&&e.characteristics.indexOf(`public.accessibility.describes-video`)>=0&&(t=`main-desc`),t},wm=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Tm=(e,t)=>{t.activePlaylistLoader=e,e.load()},Em=(e,t)=>()=>{let{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,a=i.activeTrack(),o=i.getActiveGroup(),s=i.activePlaylistLoader,c=i.lastGroup_;o&&c&&o.id===c.id||(i.lastGroup_=o,i.lastTrack_=a,wm(n,i),o&&!o.isMainPlaylist&&(o.playlistLoader?(n.resyncLoader(),Tm(o.playlistLoader,i)):s&&r.resetEverything()))},Dm=(e,t)=>()=>{let{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()},Om=(e,t)=>()=>{let{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:a}}=t,o=a.activeTrack(),s=a.getActiveGroup(),c=a.activePlaylistLoader,l=a.lastTrack_;if(!(l&&o&&l.id===o.id)&&(a.lastGroup_=s,a.lastTrack_=o,wm(r,a),s)){if(s.isMainPlaylist){if(!o||!l||o.id===l.id)return;let e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;a.logger_(`track change. Switching main audio from ${l.id} to ${o.id}`),n.pause(),i.resetEverything(),e.fastQualityChange_(r)}else{if(e===`AUDIO`){if(!s.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}c===s.playlistLoader||(r.track&&r.track(o),r.resetEverything()),Tm(s.playlistLoader,a)}}},km={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:n},excludePlaylist:r}=t,i=n.activeTrack(),a=n.activeGroup(),o=(a.filter(e=>e.default)[0]||a[0]).id,s=n.tracks[o];if(i===s)r({error:{message:`Problem encountered loading the default audio track.`}});else{Z.log.warn(`Problem encountered loading the alternate audio track.Switching back to default.`);for(let e in n.tracks)n.tracks[e].enabled=n.tracks[e]===s;n.onTrackChanged()}},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:n}}=t;Z.log.warn(`Problem encountered loading the subtitle track.Disabling subtitle track.`);let r=n.activeTrack();r&&(r.mode=`disabled`),n.onTrackChanged()}},Am={AUDIO:(e,t,n)=>{if(!t)return;let{tech:r,requestOptions:i,segmentLoaders:{[e]:a}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,km[e](e,n))},SUBTITLES:(e,t,n)=>{let{tech:r,requestOptions:i,segmentLoaders:{[e]:a},mediaTypes:{[e]:o}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),a.track(o.activeTrack()),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,km[e](e,n))}},jm={AUDIO:(e,t)=>{let{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:s,tracks:c,logger_:l}},mainPlaylistLoader:u}=t,d=od(u.main);o[e]&&Object.keys(o[e]).length!==0||(o[e]={main:{default:{default:!0}}},d&&(o[e].main.default.playlists=u.main.playlists));for(let i in o[e]){s[i]||(s[i]=[]);for(let f in o[e][i]){let p=o[e][i][f],m;d?(l(`AUDIO group '${i}' label '${f}' is a main playlist`),p.isMainPlaylist=!0,m=null):m=r===`vhs-json`&&p.playlists?new Ld(p.playlists[0],n,a):p.resolvedUri?new Ld(p.resolvedUri,n,a):p.playlists&&r===`dash`?new yf(p.playlists[0],n,a,u):null,p=Q({id:f,playlistLoader:m},p),Am[e](e,p.playlistLoader,t),s[i].push(p),c[f]===void 0&&(c[f]=new Z.AudioTrack({id:f,kind:Cm(p),enabled:!1,language:p.language,default:p.default,label:f}))}}i.on(`error`,km[e](e,t))},SUBTITLES:(e,t)=>{let{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:s},mediaTypes:{[e]:{groups:c,tracks:l}},mainPlaylistLoader:u}=t;for(let a in s[e]){c[a]||(c[a]=[]);for(let d in s[e][a]){if(!r.options_.useForcedSubtitles&&s[e][a][d].forced)continue;let f=s[e][a][d],p;if(i===`hls`)p=new Ld(f.resolvedUri,r,o);else if(i===`dash`){if(!f.playlists.filter(e=>e.excludeUntil!==1/0).length)return;p=new yf(f.playlists[0],r,o,u)}else i===`vhs-json`&&(p=new Ld(f.playlists?f.playlists[0]:f.resolvedUri,r,o));f=Q({id:d,playlistLoader:p},f),Am[e](e,f.playlistLoader,t),c[a].push(f),l[d]===void 0&&(l[d]=n.addRemoteTextTrack({id:d,kind:`subtitles`,default:f.default&&f.autoselect,language:f.language,label:d},!1).track)}}a.on(`error`,km[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:a}}}=t;for(let t in r[e]){i[t]||(i[t]=[]);for(let o in r[e][t]){let s=r[e][t][o];if(!/^(?:CC|SERVICE)/.test(s.instreamId))continue;let c=n.options_.vhs&&n.options_.vhs.captionServices||{},l={label:o,language:s.language,instreamId:s.instreamId,default:s.default&&s.autoselect};c[l.instreamId]&&(l=Q(l,c[l.instreamId])),l.default===void 0&&delete l.default,i[t].push(Q({id:o},s)),a[o]===void 0&&(a[o]=n.addRemoteTextTrack({id:l.instreamId,kind:`captions`,default:l.default,language:l.language,label:l.label},!1).track)}}}},Mm=(e,t)=>{for(let n=0;n<e.length;n++)if(id(t,e[n])||e[n].playlists&&Mm(e[n].playlists,t))return!0;return!1},Nm=(e,t)=>n=>{let{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,a=r.media();if(!a)return null;let o=null;a.attributes[e]&&(o=i[a.attributes[e]]);let s=Object.keys(i);if(!o){if(e===`AUDIO`&&s.length>1&&od(t.main))for(let e=0;e<s.length;e++){let t=i[s[e]];if(Mm(t,a)){o=t;break}}else i.main?o=i.main:s.length===1&&(o=i[s[0]])}return n===void 0?o:n===null||!o?null:o.filter(e=>e.id===n.id)[0]||null},Pm={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].mode===`showing`||n[e].mode===`hidden`)return n[e];return null}},Fm=(e,{mediaTypes:t})=>()=>{let n=t[e].activeTrack();return n?t[e].activeGroup(n):null},Im=e=>{[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{jm[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:a,main:o}}=e;[`AUDIO`,`SUBTITLES`].forEach(n=>{t[n].activeGroup=Nm(n,e),t[n].activeTrack=Pm[n](n,e),t[n].onGroupChanged=Em(n,e),t[n].onGroupChanging=Dm(n,e),t[n].onTrackChanged=Om(n,e),t[n].getActiveGroup=Fm(n,e)});let s=t.AUDIO.activeGroup();if(s){let e=(s.filter(e=>e.default)[0]||s[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),a.setAudio(!0)):o.setAudio(!0)}n.on(`mediachange`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanged())}),n.on(`mediachanging`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanging())});let c=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:`usage`,name:`vhs-audio-change`})};r.audioTracks().addEventListener(`change`,c),r.remoteTextTracks().addEventListener(`change`,t.SUBTITLES.onTrackChanged),i.on(`dispose`,()=>{r.audioTracks().removeEventListener(`change`,c),r.remoteTextTracks().removeEventListener(`change`,t.SUBTITLES.onTrackChanged)}),r.clearTracks(`audio`);for(let e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])},Lm=()=>{let e={};return[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Xp,activeTrack:Xp,getActiveGroup:Xp,onGroupChanged:Xp,onTrackChanged:Xp,lastTrack_:null,logger_:xu(`MediaGroups[${t}]`)}}),e};class Rm{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=yu(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class zm extends Z.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Rm,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=xu(`Content Steering`),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?`HLS`:`DASH`;let n=t.serverUri||t.serverURL;n?n.startsWith(`data:`)?this.decodeDataUriManifest_(n.substring(n.indexOf(`,`)+1)):(this.steeringManifest.reloadUri=yu(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger(`content-steering`)):(this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger(`error`))}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let n=e?t:this.getRequestURI(t);if(!n){this.logger_(`No valid content steering manifest URIs. Stopping content steering.`),this.trigger(`error`),this.dispose();return}let r={contentSteeringInfo:{uri:n}};this.trigger({type:`contentsteeringloadstart`,metadata:r}),this.request_=this.xhr_({uri:n,requestType:`content-steering-manifest`},(e,t)=>{if(e){if(t.status===410){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(t.status===429){let n=t.responseHeaders[`retry-after`];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),this.startTTLTimeout_(parseInt(n,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}this.trigger({type:`contentsteeringloadcomplete`,metadata:r});let i;try{i=JSON.parse(this.request_.responseText)}catch(e){let t={errorType:Z.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:`error`,metadata:t})}this.assignSteeringProperties_(i);let a={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:`contentsteeringparsed`,metadata:a}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new x.URL(e),n=new x.URL(this.proxyServerUrl_);return n.searchParams.set(`url`,encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){let t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new x.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,n)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger(`error`);return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e[`RELOAD-URI`],this.steeringManifest.priority=e[`PATHWAY-PRIORITY`]||e[`SERVICE-LOCATION-PRIORITY`],this.steeringManifest.pathwayClones=e[`PATHWAY-CLONES`],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_(`There are no available pathways for content steering. Ending content steering.`),this.trigger(`error`),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger(`content-steering`))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let n=this.setProxyServerUrl_(e);if(!t(n))return n}let n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){let t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off(`content-steering`),this.off(`error`),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Rm}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(yu(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Bm=(e,t)=>{let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(null,r)},t)}};let Vm;const Hm=[`mediaRequests`,`mediaRequestsAborted`,`mediaRequestsTimedout`,`mediaRequestsErrored`,`mediaTransferDuration`,`mediaBytesTransferred`,`mediaAppends`],Um=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Wm=function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:o,bufferBasedABR:s,log:c}){if(!r)return Z.log.warn(`We received no playlist to switch to. Please check your stream.`),!1;let l=`allowing switch ${e&&e.id||`null`} -> ${r.id}`;if(!e)return c(`${l} as current playlist is not set`),!0;if(r.id===e.id)return!1;let u=!!Du(t,n).length;if(!e.endList)return!u&&typeof e.partTargetDuration==`number`?(c(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${l} as current playlist is live`),!0);let d=Iu(t,n),f=s?bf.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:bf.MAX_BUFFER_LOW_WATER_LINE;if(o<f)return c(`${l} as duration < max low water line (${o} < ${f})`),!0;let p=r.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!s||d<a)){let e=`${l} as next bandwidth < current bandwidth (${p} < ${m})`;return s&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${a})`),c(e),!0}if((!s||p>m)&&d>=i){let e=`${l} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return s&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),c(e),!0}return c(`not ${l} as no switching criteria met`),!1};class Gm extends Z.EventTarget{constructor(e){super(),this.fastQualityChange_=Bm(this.fastQualityChange_.bind(this),100);let{src:t,withCredentials:n,tech:r,bandwidth:i,externVhs:a,useCueTags:o,playlistExclusionDuration:s,enableLowInitialPlaylist:c,sourceType:l,cacheEncryptionKeys:u,bufferBasedABR:d,leastPixelDiffSelector:f,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw Error(`A non-empty playlist URL or JSON manifest string is required`);let{maxPlaylistRetries:h}=e;h??=1/0,Vm=a,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!f,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=l,this.useCueTags_=o,this.playlistExclusionDuration=s,this.maxPlaylistRetries=h,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack(`metadata`,`ad-cues`),this.cueTagsTrack_.inBandMetadataTrackDispatchType=``),this.requestOptions_={withCredentials:n,maxPlaylistRetries:h,timeout:null},this.on(`error`,this.pauseLoading),this.mediaTypes_=Lm(),m&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,this.usingManagedMediaSource_=!0,Z.log(`Using ManagedMediaSource`)):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener(`durationchange`,this.handleDurationChange_),this.mediaSource.addEventListener(`sourceopen`,this.handleSourceOpen_),this.mediaSource.addEventListener(`sourceended`,this.handleSourceEnded_),this.mediaSource.addEventListener(`startstreaming`,this.load),this.mediaSource.addEventListener(`endstreaming`,this.pause),this.seekable_=Su(),this.hasPlayed_=!1,this.syncController_=new bm(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:`metadata`,label:`segment-metadata`},!1).track,this.segmentMetadataTrack_.mode=`hidden`,this.decrypter_=new Sm,this.sourceUpdater_=new sm(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new xm,this.keyStatusMap_=new Map;let g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:i,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_===`dash`?new yf(t,this.vhs_,Q(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ld(t,this.vhs_,Q(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Yp(Q(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:`main`}),e),this.audioSegmentLoader_=new Yp(Q(g,{loaderType:`audio`}),e),this.subtitleSegmentLoader_=new fm(Q(g,{loaderType:`vtt`,featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function n(){r.off(`vttjserror`,i),e()}function i(){r.off(`vttjsloaded`,n),t()}r.one(`vttjsloaded`,n),r.one(`vttjserror`,i),r.addWebVttScript_()})}),e);let _=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new zm(this.vhs_.xhr,_),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one(`loadedplaylist`,()=>this.startABRTimer_()),this.tech_.on(`pause`,()=>this.stopABRTimer_()),this.tech_.on(`play`,()=>this.startABRTimer_())),Hm.forEach(e=>{this[e+`_`]=Um.bind(this,e)}),this.logger_=xu(`pc`),this.triggeredFmp4Usage=!1,this.tech_.preload()===`none`?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one(`play`,this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let v=this.tech_.preload()===`none`?`play`:`loadstart`;this.tech_.one(v,()=>{let e=Date.now();this.tech_.one(`loadeddata`,()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e=`abr`){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){let r=this.media(),i=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(i&&i!==a){this.logger_(`switch media ${i} -> ${a} from ${t}`);let n={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:`renditionselected`,metadata:n}),this.tech_.trigger({type:`usage`,name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(e=>{let t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){let t=(n.length?n[0].playlists:n.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;let n=e.mediaGroups.AUDIO,r=Object.keys(n),i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{let e=n.main||r.length&&n[r[0]];for(let t in e)if(e[t].default){i={label:t};break}}if(!i)return t;let a=[];for(let t in n)if(n[t][i.label]){let r=n[t][i.label];if(r.playlists&&r.playlists.length)a.push.apply(a,r.playlists);else if(r.uri)a.push(r);else if(e.playlists.length)for(let n=0;n<e.playlists.length;n++){let r=e.playlists[n];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&a.push(r)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on(`loadedmetadata`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;rd(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!==`none`&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Im({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger(`selectedinitialmedia`):this.mediaTypes_.AUDIO.activePlaylistLoader.one(`loadedmetadata`,()=>{this.trigger(`selectedinitialmedia`)})}),this.mainPlaylistLoader_.on(`loadedplaylist`,()=>{this.loadOnPlay_&&this.tech_.off(`play`,this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||=this.selectPlaylist(),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,`initial`),!(this.sourceType_===`vhs-json`&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on(`error`,()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on(`mediachanging`,()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on(`mediachange`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;rd(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_===`dash`&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:`mediachange`,bubbles:!0})}),this.mainPlaylistLoader_.on(`playlistunchanged`,()=>{let e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!==`playlist-unchanged`&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:`Playlist no longer updating.`,reason:`playlist-unchanged`}}),this.tech_.trigger(`playliststuck`))}),this.mainPlaylistLoader_.on(`renditiondisabled`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-rendition-disabled`})}),this.mainPlaylistLoader_.on(`renditionenabled`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-rendition-enabled`})}),[`manifestrequeststart`,`manifestrequestcomplete`,`manifestparsestart`,`manifestparsecomplete`,`playlistrequeststart`,`playlistrequestcomplete`,`playlistparsestart`,`playlistparsecomplete`,`renditiondisabled`,`renditionenabled`].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(R({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(let e in n.AUDIO)for(let t in n.AUDIO[e])n.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:`usage`,name:`vhs-demuxed`}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:`usage`,name:`vhs-webvtt`}),Vm.Playlist.isAes(t)&&this.tech_.trigger({type:`usage`,name:`vhs-aes`}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:`usage`,name:`vhs-alternate-audio`}),this.useCueTags_&&this.tech_.trigger({type:`usage`,name:`vhs-playlist-cue-tags`})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine(),a=this.tech_.buffered();return Wm({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on(`bandwidthupdate`,()=>{this.checkABR_(`bandwidthupdate`),this.tech_.trigger(`bandwidthupdate`)}),this.mainSegmentLoader_.on(`timeout`,()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on(`progress`,()=>{this.trigger(`progress`)}),this.mainSegmentLoader_.on(`error`,()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on(`appenderror`,()=>{this.error=this.mainSegmentLoader_.error_,this.trigger(`error`)}),this.mainSegmentLoader_.on(`syncinfoupdate`,()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on(`timestampoffset`,()=>{this.tech_.trigger({type:`usage`,name:`vhs-timestamp-offset`})}),this.audioSegmentLoader_.on(`syncinfoupdate`,()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on(`appenderror`,()=>{this.error=this.audioSegmentLoader_.error_,this.trigger(`error`)}),this.mainSegmentLoader_.on(`ended`,()=>{this.logger_(`main segment loader ended`),this.onEndOfStream()}),this.timelineChangeController_.on(`audioTimelineBehind`,()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on(`fixBadTimelineChange`,()=>{this.logger_(`Fix bad timeline change. Restarting al segment loaders...`),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on(`earlyabort`,e=>{this.bufferBasedABR||(this.delegateLoaders_(`all`,[`abort`]),this.excludePlaylist({error:{message:`Aborted early because there isn't enough bandwidth to complete the request without rebuffering.`},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on(`trackinfo`,e),this.audioSegmentLoader_.on(`trackinfo`,e),this.mainSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!0)}),this.audioSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!0)}),this.audioSegmentLoader_.on(`ended`,()=>{this.logger_(`audioSegmentLoader ended`),this.onEndOfStream()}),[`segmentselected`,`segmentloadstart`,`segmentloaded`,`segmentkeyloadstart`,`segmentkeyloadcomplete`,`segmentdecryptionstart`,`segmentdecryptioncomplete`,`segmenttransmuxingstart`,`segmenttransmuxingcomplete`,`segmenttransmuxingtrackinfoavailable`,`segmenttransmuxingtiminginfoavailable`,`segmentappendstart`,`appendsdone`,`bandwidthupdated`,`timelinechange`,`codecschange`].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(R({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_(`skipping fastQualityChange because new media is same as old`):(this.switchMedia_(e,`fast-quality`),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let n=t.end(0),r=n;if(e.start){let i=e.start.timeOffset;if(i<0){let a=this.mainPlaylistLoader_.main,o=n+Vm.Playlist.liveEdgeDelay(a,e);r=Math.max(Math.min(o+i,n),t.start(0))}else r=Math.min(n,i)}this.trigger(`firstplay`),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();e!==void 0&&typeof e.then==`function`&&e.then(null,e=>{})}this.trigger(`sourceopen`)}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger(`durationchange`)}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e&&=this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;let n=Vm.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Tu;let a=i.end(i.length-1);return a-r<=Tu&&n-a<=Tu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e||=this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState===`open`?this.sourceUpdater_.endOfStream(`network`):this.trigger(`error`);return}e.playlistErrors_++;let r=this.mainPlaylistLoader_.main.playlists,i=r.filter(Qu),a=i.length===1&&i[0]===e;if(r.length===1&&n!==1/0)return Z.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger(`retryplaylist`),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){let t=this.pathwayAttribute_(e),n=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},n);return}let t=!1;r.forEach(n=>{if(n===e)return;let r=n.excludeUntil;r!==void 0&&r!==1/0&&(t=!0,delete n.excludeUntil)}),t&&(Z.log.warn(`Removing other playlists from the exclusion list because the last rendition is about to be excluded.`),this.tech_.trigger(`retryplaylist`))}let o;o=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+n*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger(`excludeplaylist`),this.tech_.trigger({type:`usage`,name:`vhs-rendition-excluded`});let s=this.selectPlaylist();if(!s){this.error=`Playback cannot continue. No available working or supported playlists.`,this.trigger(`error`);return}let c=t.internal?this.logger_:Z.log.warn,l=t.message?` `+t.message:``;c(`${t.internal?`Internal problem`:`Problem`} encountered with playlist ${e.id}.${l} Switching to playlist ${s.id}.`),s.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_(`audio`,[`abort`,`pause`]),s.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_(`subtitle`,[`abort`,`pause`]),this.delegateLoaders_(`main`,[`abort`,`pause`]);let u=s.targetDuration/2*1e3||5e3,d=typeof s.lastRequest==`number`&&Date.now()-s.lastRequest<=u;return this.switchMedia_(s,`exclude`,a||d)}pauseLoading(){this.delegateLoaders_(`all`,[`abort`,`pause`]),this.stopABRTimer_()}delegateLoaders_(e,t){let n=[],r=e===`all`;(r||e===`main`)&&n.push(this.mainPlaylistLoader_);let i=[];(r||e===`audio`)&&i.push(`AUDIO`),(r||e===`subtitle`)&&(i.push(`CLOSED-CAPTIONS`),i.push(`SUBTITLES`)),i.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),[`main`,`audio`,`subtitle`].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||e===`all`)&&n.push(r)}),n.forEach(e=>t.forEach(t=>{typeof e[t]==`function`&&e[t]()}))}setCurrentTime(e){let t=Du(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Vm.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let n=e.media();if(!n)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let i=Vm.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n);return Su([[e,Math.max(e,t-i)]])}let i=this.syncController_.getExpiredTime(n,this.duration());if(i===null)return null;let a=Vm.Playlist.seekable(n,i,Vm.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;let n=e.start(0),r=e.end(0),i=t.start(0),a=t.end(0);return i>r||n>a?e:Su([[Math.max(n,i),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let e=this.getSeekableRange_(this.mainPlaylistLoader_,`main`);if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,`audio`),!t))return;let n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${ju(this.seekable_)}]`);let r={seekableRanges:this.seekable_};this.trigger({type:`seekablerangeschanged`,metadata:r}),this.tech_.trigger(`seekablechanged`)}updateDuration(e){if(this.updateDuration_&&=(this.mediaSource.removeEventListener(`sourceopen`,this.updateDuration_),null),this.mediaSource.readyState!==`open`){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener(`sourceopen`,this.updateDuration_);return}if(e){let e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1));return}let t=this.tech_.buffered(),n=Vm.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger(`dispose`),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off(`play`,this.loadOnPlay_),[`AUDIO`,`SUBTITLES`].forEach(e=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener(`sourceopen`,this.updateDuration_),this.mediaSource.removeEventListener(`durationchange`,this.handleDurationChange_),this.mediaSource.removeEventListener(`sourceopen`,this.handleSourceOpen_),this.mediaSource.removeEventListener(`sourceended`,this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;let n=Ed(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||Mt),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||jt}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||jt,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:`Could not determine codecs for playlist.`},playlistExclusionDuration:1/0});return}let a=(e,t)=>e?kt(t,this.usingManagedMediaSource_):At(t),o={},s;if([`video`,`audio`].forEach(function(t){if(r.hasOwnProperty(t)&&!a(e[t].isFmp4,r[t])){let n=e[t].isFmp4?`browser`:`muxer`;o[n]=o[n]||[],o[n].push(r[t]),t===`audio`&&(s=n)}}),i&&s&&t.attributes.AUDIO){let e=t.attributes.AUDIO;this.main().playlists.forEach(n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){let e=Object.keys(o).reduce((e,t)=>(e&&(e+=`, `),e+=`${t} does not support codec(s): "${o[t].join(`,`)}"`,e),``)+`.`;this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}else{if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if([`video`,`audio`].forEach(t=>{let n=(wt(this.sourceUpdater_.codecs[t]||``)[0]||{}).type,i=(wt(r[t]||``)[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(`, `)}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!==`open`||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(`,`);this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{let r=e[n];if(t.indexOf(r.id)!==-1)return;t.push(r.id);let i=Ed(this.main,r),a=[];i.audio&&!At(i.audio)&&!kt(i.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${i.audio}`),i.video&&!At(i.video)&&!kt(i.video,this.usingManagedMediaSource_)&&a.push(`video codec ${i.video}`),i.text&&i.text===`stpp.ttml.im1t`&&a.push(`text codec ${i.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(`, `)}`))})}excludeIncompatibleVariants_(e){let t=[],n=this.main().playlists,r=wd(wt(e)),i=Td(r),a=r.video&&wt(r.video)[0]||null,o=r.audio&&wt(r.audio)[0]||null;Object.keys(n).forEach(e=>{let r=n[e];if(t.indexOf(r.id)!==-1||r.excludeUntil===1/0)return;t.push(r.id);let s=[],c=Ed(this.mainPlaylistLoader_.main,r),l=Td(c);if(c.audio||c.video){if(l!==i&&s.push(`codec count "${l}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){let e=c.video&&wt(c.video)[0]||null,t=c.audio&&wt(c.audio)[0]||null;e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&s.push(`video codec "${e.type}" !== "${a.type}"`),t&&o&&t.type.toLowerCase()!==o.type.toLowerCase()&&s.push(`audio codec "${t.type}" !== "${o.type}"`)}s.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${s.join(` && `)}`))}})}updateAdCues_(e){let t=0,n=this.seekable();n.length&&(t=n.start(0)),mm(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=bf.GOAL_BUFFER_LENGTH,n=bf.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,bf.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=bf.BUFFER_LOW_WATER_LINE,n=bf.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,bf.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,bf.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return bf.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Ep(this.inbandTextTracks_,`com.apple.streaming`,this.tech_),Tp({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ep(this.inbandTextTracks_,e,this.tech_),Sp({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes[`PATHWAY-ID`]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one(`canplay`,()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on(`content-steering`,this.excludeThenChangePathway_.bind(this)),[`contentsteeringloadstart`,`contentsteeringloadcomplete`,`contentsteeringparsed`].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(R({},e))})}),this.sourceType_===`dash`&&this.mainPlaylistLoader_.on(`loadedplaylist`,()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),n=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(n.push(e),!t.has(e)))return!0}return!(n.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,n=new Set,r=!1;Object.keys(t).forEach(i=>{let a=t[i],o=this.pathwayAttribute_(a),s=o&&e!==o;a.excludeUntil===1/0&&a.lastExcludeReason_===`content-steering`&&!s&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);let c=!a.excludeUntil&&a.excludeUntil!==1/0;!n.has(a.id)&&s&&c&&(n.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_=`content-steering`,this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_===`DASH`&&Object.keys(this.mediaTypes_).forEach(t=>{let n=this.mediaTypes_[t];if(n.activePlaylistLoader){let t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(let[e,r]of t.entries())n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,i]of n.entries()){let n=t.get(r);n?this.equalPathwayClones_(n,i)||(this.mainPlaylistLoader_.updateOrDeleteClone(i,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(e=>e.attributes[`PATHWAY-ID`]===i[`BASE-ID`]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(i,e)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e[`BASE-ID`]!==t[`BASE-ID`]||e.ID!==t.ID||e[`URI-REPLACEMENT`].HOST!==t[`URI-REPLACEMENT`].HOST)return!1;let n=e[`URI-REPLACEMENT`].PARAMS,r=t[`URI-REPLACEMENT`].PARAMS;for(let e in n)if(n[e]!==r[e])return!1;for(let e in r)if(n[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_===`DASH`&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,`content-steering`)}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t=`non-usable`;this.mainPlaylistLoader_.main.playlists.forEach(n=>{let r=this.mainPlaylistLoader_.getKeyIdSet(n);r&&r.size&&r.forEach(r=>{let i=`usable`,a=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===i,o=n.lastExcludeReason_===t&&n.excludeUntil===1/0;a?a&&o&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${i}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${i}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,Z.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let n=(typeof e==`string`?e:lm(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off(`loadedplaylist`,this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on(`loadedplaylist`,this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const Km=(e,t,n)=>r=>{let i=e.main.playlists[t],a=Zu(i),o=Qu(i);if(r===void 0)return o;r?delete i.disabled:i.disabled=!0;let s={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:`fast-quality`};return r!==o&&!a&&(r?(n(i),e.trigger({type:`renditionenabled`,metadata:s})):e.trigger({type:`renditiondisabled`,metadata:s})),r};class qm{constructor(e,t,n){let{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes[`FRAME-RATE`]}this.codecs=Ed(r.main(),t),this.playlist=t,this.id=n,this.enabled=Km(e.playlists,t.id,i)}}const Jm=function(e){e.representations=()=>{let t=e.playlistController_.main(),n=od(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(e=>!Zu(e)).map((t,n)=>new qm(e,t,t.id)):[]}},Ym=[`seeking`,`seeked`,`pause`,`playing`,`error`];class Xm extends Z.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=xu(`PlaybackWatcher`),this.logger_(`initialize`);let t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),i=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=[`main`,`subtitle`,`audio`],s={};o.forEach(e=>{s[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].on(`playlistupdate`,s[e].reset),this.tech_.on([`seeked`,`seeking`],s[e].reset)});let c=e=>{[`main`,`audio`].forEach(t=>{a[`${t}SegmentLoader_`][e](`appended`,this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c(`off`))},this.clearSeekingAppendCheck_=()=>c(`off`),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c(`on`)},this.tech_.on(`seeked`,this.clearSeekingAppendCheck_),this.tech_.on(`seeking`,this.watchForBadSeeking_),this.tech_.on(`waiting`,r),this.tech_.on(Ym,i),this.tech_.on(`canplay`,n),this.tech_.one(`play`,t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_(`dispose`),this.tech_.off(`waiting`,r),this.tech_.off(Ym,i),this.tech_.off(`canplay`,n),this.tech_.off(`play`,t),this.tech_.off(`seeking`,this.watchForBadSeeking_),this.tech_.off(`seeked`,this.clearSeekingAppendCheck_),o.forEach(e=>{a[`${e}SegmentLoader_`].off(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].off(`playlistupdate`,s[e].reset),this.tech_.off([`seeked`,`seeking`],s[e].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=Pu(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,i){let n={bufferedRanges:r};t.trigger({type:`bufferedrangeschanged`,metadata:n}),this.resetSegmentDownloads_(e)}else this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Nu(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:`usage`,name:`vhs-${e}-download-exclusion`}),e!==`subtitle`&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Tu>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Su([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:`playedrangeschanged`,metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let e=this.seekable(),t=this.tech_.currentTime(),n=this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow),r;if(n&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){let t=e.start(0);r=t+(t===e.end(0)?0:Tu)}if(r!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${ju(e)}. Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0;let i=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=i.audioBuffer?i.audioBuffered():null,s=i.videoBuffer?i.videoBuffered():null,c=this.media(),l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-wu)*2,u=[o,s];for(let e=0;e<u.length;e++)if(u[e]&&Iu(u[e],t)<l)return!1;let d=Ou(a,t);return d.length!==0&&(r=d.start(0)+Tu,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${t}). Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Du(t,e);n.length&&e+3<=n.end(0)&&(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:`usage`,name:`vhs-unknown-waiting`}))}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:`usage`,name:`vhs-live-resync`}),!0}let n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:`usage`,name:`vhs-video-underflow`}),!0;let i=Ou(r,t);return i.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+Tu,a=!n.endList,o=typeof n.partTargetDuration==`number`;return a&&(o||r)&&(i=e.end(e.length-1)+n.targetDuration*3),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){let i=Du(e,n-3),a=Du(e,n),o=Du(t,n);o.length&&!a.length&&i.length&&(r={start:i.end(0),end:o.end(0)})}else Ou(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0):!1}skipTheGap_(e){let t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Ou(t,n);if(this.resetTimeUpdate_(),r.length===0||n!==e)return;this.logger_(`skipTheGap_:`,`currentTime:`,n,`scheduled currentTime:`,e,`nextRange start:`,r.start(0)),this.tech_.setCurrentTime(r.start(0)+wu);let i={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:`gapjumped`,metadata:i}),this.tech_.trigger({type:`usage`,name:`vhs-gap-skip`})}gapFromVideoUnderflow_(e,t){let n=ku(e);for(let e=0;e<n.length;e++){let r=n.start(e),i=n.end(e);if(t-r<4&&t-r>2)return{start:r,end:i}}return null}}const Zm={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Qm=function(e,t){let n=0,r=0,i=Q(Zm,t);e.ready(()=>{e.trigger({type:`usage`,name:`vhs-error-reload-initialized`})});let a=function(){r&&e.currentTime(r)},o=function(t){t!=null&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one(`loadedmetadata`,a),e.src(t),e.trigger({type:`usage`,name:`vhs-error-reload`}),e.play())},s=function(){if(Date.now()-n<i.errorInterval*1e3)e.trigger({type:`usage`,name:`vhs-error-reload-canceled`});else if(!i.getSource||typeof i.getSource!=`function`)Z.log.error(`ERROR: reloadSourceOnError - The option getSource must be a function!`);else return n=Date.now(),i.getSource.call(e,o)},c=function(){e.off(`loadedmetadata`,a),e.off(`error`,s),e.off(`dispose`,c)};e.on(`error`,s),e.on(`dispose`,c),e.reloadSourceOnError=function(t){c(),Qm(e,t)}},$m=function(e){Qm(this,e)};var eh=`3.17.5`,th=`7.1.0`,nh=`1.4.0`,rh=`7.2.0`,ih=`4.0.2`;const ah={PlaylistLoader:Ld,Playlist:sd,utils:Zd,STANDARD_PLAYLIST_SELECTOR:pp,INITIAL_PLAYLIST_SELECTOR:gp,lastBandwidthSelector:pp,movingAverageBandwidthSelector:mp,comparePlaylistBandwidth:up,comparePlaylistResolution:dp,xhr:Vd()};Object.keys(bf).forEach(e=>{Object.defineProperty(ah,e,{get(){return Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),bf[e]},set(t){Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),typeof t!=`number`||t<0?Z.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):bf[e]=t}})});const oh=`videojs-vhs`,sh=function(e,t){let n=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===n.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:`change`})},ch=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),sh(e,t.playlists)};ah.canPlaySource=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)};const lh=(e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=wd(wt(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);let i=Ot(r.video),a=Ot(r.audio),o={};for(let n in e)o[n]={},a&&(o[n].audioContentType=a),i&&(o[n].videoContentType=i),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(o[n].pssh=t.contentProtection[n].pssh),typeof e[n]==`string`&&(o[n].url=e[n]);return Q(e,o)},uh=(e,t)=>e.reduce((e,n)=>{if(!n.contentProtection)return e;let r=t.reduce((e,t)=>{let r=n.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]),dh=({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();let i=n?r.concat([n]):r,a=uh(i,Object.keys(t)),o=[],s=[];return a.forEach(t=>{s.push(new Promise((t,n)=>{e.tech_.one(`keysessioncreated`,t)})),o.push(new Promise((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):n()})}))}),Promise.race([Promise.all(o),Promise.race(s)])},fh=({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{let i=lh(t,n,r);return i?(e.currentSource().keySystems=i,i&&!e.eme?(Z.log.warn(`DRM encrypted source cannot be decrypted without a DRM plugin`),!1):!0):!1},ph=()=>{if(!x.localStorage)return null;let e=x.localStorage.getItem(oh);if(!e)return null;try{return JSON.parse(e)}catch{return null}},mh=e=>{if(!x.localStorage)return!1;let t=ph();t=t?Q(t,e):e;try{x.localStorage.setItem(oh,JSON.stringify(t))}catch{return!1}return t},hh=e=>e.toLowerCase().indexOf(`data:application/vnd.videojs.vhs+json,`)===0?JSON.parse(e.substring(e.indexOf(`,`)+1)):e,gh=(e,t)=>{e._requestCallbackSet||=new Set,e._requestCallbackSet.add(t)},_h=(e,t)=>{e._responseCallbackSet||=new Set,e._responseCallbackSet.add(t)},vh=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},yh=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};ah.supportsNativeHls=function(){if(!F||!F.createElement)return!1;let e=F.createElement(`video`);return Z.getTech(`Html5`).isSupported()?[`application/vnd.apple.mpegurl`,`audio/mpegurl`,`audio/x-mpegurl`,`application/x-mpegurl`,`video/x-mpegurl`,`video/mpegurl`,`application/mpegurl`].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))}):!1}(),ah.supportsNativeDash=function(){return!F||!F.createElement||!Z.getTech(`Html5`).isSupported()?!1:/maybe|probably/i.test(F.createElement(`video`).canPlayType(`application/dash+xml`))}(),ah.supportsTypeNatively=e=>e===`hls`?ah.supportsNativeHls:e===`dash`&&ah.supportsNativeDash,ah.isSupported=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)},ah.xhr.onRequest=function(e){gh(ah.xhr,e)},ah.xhr.onResponse=function(e){_h(ah.xhr,e)},ah.xhr.offRequest=function(e){vh(ah.xhr,e)},ah.xhr.offResponse=function(e){yh(ah.xhr,e)};const bh=Z.getComponent(`Component`);class xh extends bh{constructor(e,t,n){if(super(t,n.vhs),typeof n.initialBandwidth==`number`&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=xu(`VhsHandler`),t.options_&&t.options_.playerId){let e=Z.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error(`Overriding native VHS requires emulated tracks. See https://git.io/vMpjB`);this.on(F,[`fullscreenchange`,`webkitfullscreenchange`,`mozfullscreenchange`,`MSFullscreenChange`],e=>{let t=F.fullscreenElement||F.webkitFullscreenElement||F.mozFullScreenElement||F.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,`seeking`,function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,`error`,function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,`play`,this.play)}setOptions_(e={}){if(this.options_=Q(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage===void 0?this.options_.useBandwidthFromLocalStorage||!1:this.source_.useBandwidthFromLocalStorage,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi===void 0||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!=`number`&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!=`number`&&this.options_.useBandwidthFromLocalStorage){let e=ph();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:`usage`,name:`vhs-bandwidth-from-local-storage`})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:`usage`,name:`vhs-throughput-from-local-storage`}))}typeof this.options_.bandwidth!=`number`&&(this.options_.bandwidth=bf.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===bf.INITIAL_BANDWIDTH,[`withCredentials`,`useDevicePixelRatio`,`usePlayerObjectFit`,`customPixelRatio`,`limitRenditionByPlayerDimensions`,`bandwidth`,`customTagParsers`,`customTagMappers`,`cacheEncryptionKeys`,`playlistSelector`,`initialPlaylistSelector`,`bufferBasedABR`,`liveRangeSafeTimeDelta`,`llhls`,`useForcedSubtitles`,`useNetworkInformationApi`,`useDtsForTimestampOffset`,`exactManifestTimings`,`leastPixelDiffSelector`].forEach(e=>{this.source_[e]!==void 0&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let t=this.options_.customPixelRatio;typeof t==`number`&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=hh(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ah,this.options_.sourceType=Ft(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Gm(this.options_);let n=Q({liveRangeSafeTimeDelta:Tu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Xm(n),this.attachStreamingEventListeners_(),this.playlistController_.on(`error`,()=>{let e=Z.players[this.tech_.options_.playerId],t=this.playlistController_.error;typeof t==`object`&&!t.code?t.code=3:typeof t==`string`&&(t={message:t,code:3}),e.error(t)});let r=this.options_.bufferBasedABR?ah.movingAverageBandwidthSelector(.55):ah.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ah.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){let r=t.downlink*1e3*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let e=1/(this.bandwidth||1),t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){Z.log.error(`The "systemBandwidth" property is read-only`)}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Nu(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Nu(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one(`canplay`,this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on(`bandwidthupdate`,()=>{this.options_.useBandwidthFromLocalStorage&&mh({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on(`selectedinitialmedia`,()=>{Jm(this)}),this.playlistController_.sourceUpdater_.on(`createdsourcebuffers`,()=>{this.setupEme_()}),this.on(this.playlistController_,`progress`,function(){this.tech_.trigger(`progress`)}),this.on(this.playlistController_,`firstplay`,function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),(Z.browser.IS_ANY_SAFARI||Z.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType===`hls`&&typeof this.tech_.addSourceElement==`function`?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_(`waiting for EME key session creation`),dh({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_(`created EME key session`),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_(`error while creating EME key session`,e),this.player_.error({message:`Failed to initialize media keys for EME`,code:3})})}handleWaitingForKey_(){this.logger_(`waitingforkey fired, attempting to create any new key sessions`),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=fh({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on(`keystatuschange`,e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on(`waitingforkey`,this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){let e=Z.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on(`selectedinitialmedia`,()=>{ch(this.qualityLevels_,this)}),this.playlists.on(`mediachange`,()=>{sh(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":eh,"mux.js":th,"mpd-parser":nh,"m3u8-parser":rh,"aes-decrypter":ih}}version(){return this.constructor.version()}canChangeType(){return sm.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off(`waitingforkey`,this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return of({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return sf({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{gh(this.xhr,e)},this.xhr.onResponse=e=>{_h(this.xhr,e)},this.xhr.offRequest=e=>{vh(this.xhr,e)},this.xhr.offResponse=e=>{yh(this.xhr,e)},this.player_.trigger(`xhr-hooks-ready`)}attachStreamingEventListeners_(){[`seekablerangeschanged`,`bufferedrangeschanged`,`contentsteeringloadstart`,`contentsteeringloadcomplete`,`contentsteeringparsed`].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(R({},e))})}),[`gapjumped`,`playedrangeschanged`].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(R({},e))})})}}const Sh={name:`videojs-http-streaming`,VERSION:eh,canHandleSource(e,t={}){let n=Q(Z.options,t);return!n.vhs.experimentalUseMMS&&!kt(`avc1.4d400d,mp4a.40.2`,!1)?!1:Sh.canPlayType(e.type,n)},handleSource(e,t,n={}){let r=Q(Z.options,n);return t.vhs=new xh(e,t,r),t.vhs.xhr=Vd(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let n=Ft(e);if(!n)return``;let r=Sh.getOverrideNative(t);return!ah.supportsTypeNatively(n)||r?`maybe`:``},getOverrideNative(e={}){let{vhs:t={}}=e,n=!(Z.browser.IS_ANY_SAFARI||Z.browser.IS_IOS),{overrideNative:r=n}=t;return r}};kt(`avc1.4d400d,mp4a.40.2`,!0)&&Z.getTech(`Html5`).registerSourceHandler(Sh,0),Z.VhsHandler=xh,Z.VhsSourceHandler=Sh,Z.Vhs=ah,Z.use||Z.registerComponent(`Vhs`,ah),Z.options.vhs=Z.options.vhs||{},Z.getPlugin&&Z.getPlugin(`reloadSourceOnError`)||Z.registerPlugin(`reloadSourceOnError`,$m);let $=class extends t{constructor(){super(...arguments),this._controllerConfigs={autoplay:!1,autoSetup:!1,controls:!1,defaultVolume:.3,disablePictureInPicture:!0,enableDocumentPictureInPicture:!1,enableSmoothSeeking:!0,html5:{nativeAudioTracks:!1,nativeVideoTracks:!1,vhs:{llhls:!0,overrideNative:!0}},inactivityTimeout:0,liveTracker:{liveTolerance:10,trackingThreshold:15},loop:!1,muted:!1,nativeControlsForTouch:!1,normalizeAutoplay:!0,preload:`auto`},this._prevPlayingState=!1,this._retryCount=0,this._qualityLevels=[],this.autoplay=!1,this.currentMetadata=null,this.element=null,this.isLive=!1,this.mimeType=null,this.sensorModel=null,this.started=!1,this.state=`not-ready`,this.waitingTimestamp=null,this._initController=async()=>{if(!this._controller&&this.playerUrl)try{let e={...this._controllerConfigs};this.element=document.createElement(`video`),Z.log.level(`off`),this._controller=Z(this.element,e),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.qualityLevels().on(`addqualitylevel`,e=>this._handleQualityLevel(e)),this._controller.ready(this._handleReady),this._controller.one(`play`,this._handleFirstPlay),this._controller.on(`canplay`,this._handleCanPlay),this._controller.on(`durationchange`,this._handleDurationChange),this._controller.on(`ended`,this._handleEnded),this._controller.on(`error`,this._handleError),this._controller.on(`loadeddata`,this._handleDataLoaded),this._controller.on(`loadedmetadata`,this._handleLoadedMetadata),this._controller.on(`loadstart`,this._handleLoadStart),this._controller.on(`play`,this._handlePlay),this._controller.on(`playing`,this._handlePlaying),this._controller.on(`stalled`,this._handleStalled),this._controller.on(`timeupdate`,this._handleTimeUpdate),this._controller.on(`waiting`,this._handleWaiting),this._controller.on(`xhr-hooks-ready`,this._handleXHRhooksReady),this._controller?.liveTracker.on(`seekableendchange`,()=>this.notifyChange(`livestreamStatus`)),this._controller?.liveTracker.on(`liveedgechange`,()=>this.notifyChange(`livestreamStatus`))}catch{r.getLogger(this).error(`Unable to initialize the player.`),this._controller&&this._controller.dispose()}},this._handleQualityLevel=e=>{if(!e?.qualityLevel)return;let t=e.qualityLevel;this._qualityLevels.push(t),t?.enabled&&(this._set(`videoWidth`,t?.width??0),this._set(`videoHeight`,t?.height??0))},this._handleReady=()=>{this.state=`ready`},this._handleFirstPlay=()=>{this._set(`started`,!0)},this._handleCanPlay=async()=>{if(this._prevPlayingState=this.state===`playing`,this.state=`can-play`,this.autoplay&&!this.started)try{this.muted=!0,await this.play()}catch{r.getLogger(this).info(`Unable to auto start playback. Blocked by the browser.`)}},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;let e=this.subtitleTrack?.activeCues,t=f(e);if(!t?.length)return;let n=new Map;for(let e of t)Array.isArray(e.value)?e.tagId===90064?n.set(e.tagId,e):e.value.forEach(e=>{n.set(e.tagId,e)}):n.set(e.tagId,e);n.set(p.EsriVideoWidth,{name:`Video Width`,tagId:p.EsriVideoWidth,value:this._controller?.videoWidth()}),n.set(p.EsriVideoHeight,{name:`Video Height`,tagId:p.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(n)},this._handleDataLoaded=()=>{this._set(`videoWidth`,this._controller?.videoWidth()),this._set(`videoHeight`,this._controller?.videoHeight())},this._handleDurationChange=()=>{this._controller?.duration()!==0&&(this.notifyChange(`duration`),this.isLive=this._controller?.duration()===1/0||!1,this._setLivestreamStatus(),this.started&&this._controller?.duration()===this._controller?.currentTime()&&this._controller?.trigger(`ended`))},this._handleEnded=()=>{this._controller?.ended()&&this.notifyChange(`ended`)},this._handleError=()=>{let e=this._controller?.error()??null;if(typeof e?.code==`number`&&e?.code<3&&this._retryCount===0)this._retryCount++,setTimeout(()=>{this._controller?.src({type:this.mimeType,src:this.playerUrl}),this._controller?.load()},2e3);else{let t=new n(`Media Error`,e?.message??``);r.getLogger(this).error(t),this.reset()}},this._handleLoadStart=()=>{this.state=`can-play`},this._handleLoadedMetadata=()=>{this.state=`can-play`,this.notifyChange(`buffered`),this.notifyChange(`subtitleTrack`)},this._handlePlay=()=>{this.notifyChange(`ended`)},this._handlePlaying=()=>{this.state=`playing`,this._retryCount=0,this.notifyChange(`ended`)},this._handleStalled=()=>{r.getLogger(this).warn(`Playback is stalled and awaiting data`)},this._handleTimeUpdate=()=>{this._setLivestreamStatus(),this.notifyChange(`currentTime`),this.notifyChange(`buffered`),this.notifyChange(`bufferedPercent`),this._set(`videoWidth`,this._controller?.videoWidth()),this._set(`videoHeight`,this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime(),this.state=`waiting`},this._handleXHRhooksReady=()=>{this._controller?.tech(!0)?.vhs.xhr.onRequest(e=>(e.xhr=new c,e))},this._updateSensorModel=()=>{this.currentMetadata?.size&&(this.sensorModel?this.sensorModel.updateSensorModel(this.currentMetadata):this.sensorModel=new d({videoMetadata:this.currentMetadata}))},this._setLivestreamStatus=()=>{if(!this.isLive){this.livestreamStatus=null;return}this._controller?.liveTracker.isTracking()||this._controller?.liveTracker.startTracking();let e={atLiveEdge:this._controller?.liveTracker.atLiveEdge()??null,behindLiveEdge:this._controller?.liveTracker.behindLiveEdge()??null,liveCurrentTime:this._controller?.liveTracker?.liveCurrentTime()??null,liveWindow:this._controller?.liveTracker?.liveWindow()??null,pastSeekEnd:this._controller?.liveTracker?.pastSeekEnd()??null,seekableEnd:this._controller?.liveTracker?.seekableEnd()??null,seekableStart:this._controller?.liveTracker?.seekableStart()??null};this.livestreamStatus={...e},this.notifyChange(`livestreamStatus`),this._controller?.liveTracker.handlePlay(),this._controller?.liveTracker.handleFirstTimeupdate()}}initialize(){this.addHandles([a(()=>this.playerUrl,e=>{e&&this._initController().then(()=>{this.mimeType=m(e),this._controller?.src({src:this.playerUrl,type:this.mimeType})})},o),a(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode=`showing`)},o),a(()=>this.isLive,async e=>{e&&(this._controller?.liveTracker.startTracking(),this.autoplay&&(this.muted=!0,await this.play()))}),a(()=>this.currentMetadata,()=>this._updateSensorModel())]),this.addHandles(s(()=>this.subtitleTrack,`cuechange`,this._handleCueChange),o)}destroy(){this.removeAllHandles(),this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get crossOrigin(){return this._controller?.crossOrigin()??this._get(`crossOrigin`)}set crossOrigin(e){this._controller?.crossOrigin(e),this._set(`crossOrigin`,e)}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get(`ended`)??!0}set ended(e){this._controller?.trigger(`ended`),this._set(`ended`,e)}get loop(){return this._controller?.loop()??this._get(`loop`)??!1}set loop(e){this._controller?.loop(e),this._set(`loop`,e)}get muted(){return this._controller?.muted()??this._get(`muted`)??!1}set muted(e){this._controller?.muted(e),this._set(`muted`,e)}get playerUrl(){return this._controller?.src()||``}set playerUrl(e){this._set(`playerUrl`,e)}get playing(){return this.ended?!1:this.state===`can-play`?this._prevPlayingState:this.state===`playing`}get playsInline(){return this._controller?.playsinline()??this._get(`playsInline`)??!1}set playsInline(e){this._controller?.playsinline(e),this._set(`playsInline`,e)}get rate(){return this._controller?.playbackRate()??this._get(`rate`)??1}set rate(e){this._controller?.playbackRate(e),this._set(`rate`,e)}get startMode(){return this._controller?.preload()??this._get(`startMode`)??`auto`}set startMode(e){this._controller?.preload(e),this._set(`startMode`,e)}get subtitleTrack(){let e=this._controller?.textTracks();return e?.length?Array.from(e).find(e=>e.kind===`subtitles`):null}get volume(){return this._controller?.volume()??0}set volume(e){let t=i(e,0,1);isNaN(t)||this._controller?.volume(t)}get waiting(){return this.waitingTimestamp?!1:this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1)}pause(){this._controller?.pause(),this.state=`paused`}async play(){try{!this.started&&this.isLive&&this._controller?.muted(!0),await this._controller?.play(),this.state=`playing`}catch{}}reset(){this._controller&&(this._prevPlayingState=!1,this._retryCount=0,this._set(`started`,!1),this.setCurrentTime(0),this.notifyChange(`buffered`),this.notifyChange(`currentTime`),this.notifyChange(`duration`),this.notifyChange(`waiting`),this._controller?.trigger(`can-play`),this.autoplay||this._controller?.pause())}seekToLiveEdge(){this.isLive?this.state===`playing`&&this._controller?.liveTracker.isTracking()&&this._controller?.liveTracker.seekToLiveEdge():r.getLogger(this).info(`seekToLiveEdge method is only available for livestream playback.`)}setCurrentTime(e){let t=i(e,0,this.duration);this._controller?.currentTime(t),this.notifyChange(`currentTime`)}};e([l()],$.prototype,`autoplay`,void 0),e([l()],$.prototype,`buffered`,null),e([l()],$.prototype,`bufferedPercent`,null),e([l()],$.prototype,`crossOrigin`,null),e([l({readOnly:!0})],$.prototype,`currentTime`,null),e([l()],$.prototype,`currentMetadata`,void 0),e([l({readOnly:!0})],$.prototype,`duration`,null),e([l()],$.prototype,`element`,void 0),e([l({readOnly:!0})],$.prototype,`ended`,null),e([l()],$.prototype,`isLive`,void 0),e([l()],$.prototype,`livestreamStatus`,void 0),e([l()],$.prototype,`loop`,null),e([l()],$.prototype,`mimeType`,void 0),e([l()],$.prototype,`muted`,null),e([l()],$.prototype,`playerUrl`,null),e([l({readOnly:!0})],$.prototype,`playing`,null),e([l()],$.prototype,`playsInline`,null),e([l()],$.prototype,`rate`,null),e([l()],$.prototype,`sensorModel`,void 0),e([l({readOnly:!0})],$.prototype,`started`,void 0),e([l()],$.prototype,`startMode`,null),e([l()],$.prototype,`state`,void 0),e([l()],$.prototype,`subtitleTrack`,null),e([l({readOnly:!0})],$.prototype,`videoHeight`,void 0),e([l({readOnly:!0})],$.prototype,`videoWidth`,void 0),e([l()],$.prototype,`volume`,null),e([l({readOnly:!0})],$.prototype,`waiting`,null),e([l()],$.prototype,`waitingTimestamp`,void 0),$=e([u(`esri.layers.video.VideoController`)],$);export{$ as default};