@sapudex/web-components 0.224.0 → 2.0.0

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 (1436) hide show
  1. package/.eslintignore +5 -3
  2. package/.npsrc.json +3 -0
  3. package/config/{dev-server.js → dev-server.mjs} +5 -5
  4. package/config/wdio.conf.cjs +3 -0
  5. package/cypress/fixtures/example.json +5 -0
  6. package/cypress/fixtures/secondary-navigation-items.ts +121 -0
  7. package/cypress/specs/Accordion.cy.tsx +142 -0
  8. package/cypress/specs/AccordionItem.cy.tsx +60 -0
  9. package/cypress/specs/Avatar.cy.tsx +71 -0
  10. package/cypress/specs/AvatarGroup.cy.tsx +47 -0
  11. package/cypress/specs/Badge.cy.tsx +142 -0
  12. package/cypress/specs/ListItem.cy.tsx +162 -0
  13. package/cypress/specs/PhoneNumberField.cy.tsx +193 -0
  14. package/cypress/specs/Review.cy.tsx +49 -0
  15. package/cypress/specs/ReviewItem.cy.tsx +73 -0
  16. package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +367 -0
  17. package/cypress/specs/SecondaryNavigationMobile.cy.tsx +93 -0
  18. package/cypress/specs/SelectBox.cy.tsx +906 -0
  19. package/cypress/specs/Slider.cy.tsx +24 -0
  20. package/cypress/specs/StatusBadge.cy.tsx +28 -0
  21. package/cypress/specs/StatusMessage.cy.tsx +29 -0
  22. package/cypress/specs/Switch.cy.tsx +52 -0
  23. package/cypress/specs/Tag.cy.tsx +122 -0
  24. package/cypress/specs/TagGroup.cy.tsx +99 -0
  25. package/cypress/specs/TextField.cy.tsx +180 -0
  26. package/cypress/specs/Textarea.cy.tsx +205 -0
  27. package/cypress/specs/Toast.cy.tsx +102 -0
  28. package/cypress/specs/Tooltip.cy.tsx +75 -0
  29. package/cypress/specs/TruncatedText.cy.tsx +44 -0
  30. package/cypress/specs/Upload.cy.tsx +93 -0
  31. package/cypress/specs/UploadItem.cy.tsx +93 -0
  32. package/cypress/specs/Wizard.cy.tsx +77 -0
  33. package/cypress/support/commands.ts +77 -0
  34. package/cypress/support/component-index.html +12 -0
  35. package/cypress/support/component.ts +36 -0
  36. package/cypress/tsconfig.json +19 -0
  37. package/cypress.config.ts +13 -0
  38. package/dist/Accordion.d.ts +8 -3
  39. package/dist/Accordion.js +8 -13
  40. package/dist/Accordion.js.map +1 -1
  41. package/dist/AccordionItem.d.ts +7 -7
  42. package/dist/AccordionItem.js +5 -6
  43. package/dist/AccordionItem.js.map +1 -1
  44. package/dist/Assets.js +2 -3
  45. package/dist/Assets.js.map +1 -1
  46. package/dist/AssetsVariables.d.ts +2 -0
  47. package/dist/AssetsVariables.js +51 -0
  48. package/dist/AssetsVariables.js.map +1 -0
  49. package/dist/Avatar.d.ts +15 -13
  50. package/dist/Avatar.js +93 -40
  51. package/dist/Avatar.js.map +1 -1
  52. package/dist/AvatarGroup.js +9 -9
  53. package/dist/AvatarGroup.js.map +1 -1
  54. package/dist/Badge.d.ts +7 -16
  55. package/dist/Badge.js +45 -18
  56. package/dist/Badge.js.map +1 -1
  57. package/dist/Breadcrumbs.d.ts +24 -22
  58. package/dist/Breadcrumbs.js +55 -86
  59. package/dist/Breadcrumbs.js.map +1 -1
  60. package/dist/BreadcrumbsItem.js +2 -2
  61. package/dist/BreadcrumbsItem.js.map +1 -1
  62. package/dist/Button.d.ts +4 -17
  63. package/dist/Button.js +42 -36
  64. package/dist/Button.js.map +1 -1
  65. package/dist/Carousel.d.ts +4 -3
  66. package/dist/Carousel.js +38 -17
  67. package/dist/Carousel.js.map +1 -1
  68. package/dist/Checkbox.d.ts +13 -0
  69. package/dist/Checkbox.js +38 -6
  70. package/dist/Checkbox.js.map +1 -1
  71. package/dist/ControlButton.d.ts +8 -1
  72. package/dist/ControlButton.js +24 -4
  73. package/dist/ControlButton.js.map +1 -1
  74. package/dist/CountrySelector.d.ts +42 -31
  75. package/dist/CountrySelector.js +116 -118
  76. package/dist/CountrySelector.js.map +1 -1
  77. package/dist/DatePicker.d.ts +26 -15
  78. package/dist/DatePicker.js +115 -58
  79. package/dist/DatePicker.js.map +1 -1
  80. package/dist/Divider.js +12 -2
  81. package/dist/Divider.js.map +1 -1
  82. package/dist/Dropdown.d.ts +4 -117
  83. package/dist/Dropdown.js +16 -189
  84. package/dist/Dropdown.js.map +1 -1
  85. package/dist/FilterMenu.d.ts +29 -15
  86. package/dist/FilterMenu.js +99 -53
  87. package/dist/FilterMenu.js.map +1 -1
  88. package/dist/Footer.d.ts +40 -65
  89. package/dist/Footer.js +144 -53
  90. package/dist/Footer.js.map +1 -1
  91. package/dist/HeroBanner.d.ts +4 -4
  92. package/dist/HeroBanner.js +13 -10
  93. package/dist/HeroBanner.js.map +1 -1
  94. package/dist/InputGroup.d.ts +9 -13
  95. package/dist/InputGroup.js +28 -17
  96. package/dist/InputGroup.js.map +1 -1
  97. package/dist/Link.d.ts +4 -20
  98. package/dist/Link.js +12 -28
  99. package/dist/Link.js.map +1 -1
  100. package/dist/List.d.ts +18 -12
  101. package/dist/List.js +53 -32
  102. package/dist/List.js.map +1 -1
  103. package/dist/ListGroupHeader.d.ts +6 -0
  104. package/dist/ListGroupHeader.js +5 -9
  105. package/dist/ListGroupHeader.js.map +1 -1
  106. package/dist/ListGroupHeaderBase.js.map +1 -1
  107. package/dist/ListItem.d.ts +24 -27
  108. package/dist/ListItem.js +59 -75
  109. package/dist/ListItem.js.map +1 -1
  110. package/dist/ListItemBase.d.ts +7 -7
  111. package/dist/ListItemBase.js +43 -11
  112. package/dist/ListItemBase.js.map +1 -1
  113. package/dist/ListSelectAll.d.ts +8 -3
  114. package/dist/ListSelectAll.js +11 -15
  115. package/dist/ListSelectAll.js.map +1 -1
  116. package/dist/MastheadCountrySelector.d.ts +8 -3
  117. package/dist/MastheadCountrySelector.js +7 -29
  118. package/dist/MastheadCountrySelector.js.map +1 -1
  119. package/dist/MastheadItem.d.ts +15 -13
  120. package/dist/MastheadItem.js +54 -19
  121. package/dist/MastheadItem.js.map +1 -1
  122. package/dist/MastheadMenu.d.ts +6 -3
  123. package/dist/MastheadMenu.js +21 -13
  124. package/dist/MastheadMenu.js.map +1 -1
  125. package/dist/MastheadMenuItem.d.ts +6 -5
  126. package/dist/MastheadMenuItem.js +34 -17
  127. package/dist/MastheadMenuItem.js.map +1 -1
  128. package/dist/MastheadMobileMenu.d.ts +17 -13
  129. package/dist/MastheadMobileMenu.js +15 -24
  130. package/dist/MastheadMobileMenu.js.map +1 -1
  131. package/dist/MastheadProfileMenu.d.ts +10 -7
  132. package/dist/MastheadProfileMenu.js +10 -25
  133. package/dist/MastheadProfileMenu.js.map +1 -1
  134. package/dist/MastheadShell.d.ts +25 -10
  135. package/dist/MastheadShell.js +75 -31
  136. package/dist/MastheadShell.js.map +1 -1
  137. package/dist/MediaPlayer.d.ts +21 -3552
  138. package/dist/MediaPlayer.js +103 -43
  139. package/dist/MediaPlayer.js.map +1 -1
  140. package/dist/MediaPlayerVimeo.d.ts +9 -1
  141. package/dist/MediaPlayerVimeo.js +51 -18
  142. package/dist/MediaPlayerVimeo.js.map +1 -1
  143. package/dist/MediaPlayerYoutube.d.ts +14 -3
  144. package/dist/MediaPlayerYoutube.js +45 -19
  145. package/dist/MediaPlayerYoutube.js.map +1 -1
  146. package/dist/MessageStrip.d.ts +6 -12
  147. package/dist/MessageStrip.js +40 -43
  148. package/dist/MessageStrip.js.map +1 -1
  149. package/dist/MessageStripTemplate.d.ts +2 -0
  150. package/dist/MessageStripTemplate.js +34 -0
  151. package/dist/MessageStripTemplate.js.map +1 -0
  152. package/dist/Modal.d.ts +2 -2
  153. package/dist/Modal.js +20 -11
  154. package/dist/Modal.js.map +1 -1
  155. package/dist/Pagination.d.ts +13 -13
  156. package/dist/Pagination.js +57 -37
  157. package/dist/Pagination.js.map +1 -1
  158. package/dist/PasswordField.d.ts +10 -9
  159. package/dist/PasswordField.js +49 -25
  160. package/dist/PasswordField.js.map +1 -1
  161. package/dist/PhoneNumberField.d.ts +18 -24
  162. package/dist/PhoneNumberField.js +126 -75
  163. package/dist/PhoneNumberField.js.map +1 -1
  164. package/dist/ProgressBar.d.ts +11 -0
  165. package/dist/ProgressBar.js +36 -4
  166. package/dist/ProgressBar.js.map +1 -1
  167. package/dist/ProgressBarTemplate.d.ts +2 -0
  168. package/dist/ProgressBarTemplate.js +30 -0
  169. package/dist/ProgressBarTemplate.js.map +1 -0
  170. package/dist/Quote.d.ts +5 -5
  171. package/dist/Quote.js +37 -13
  172. package/dist/Quote.js.map +1 -1
  173. package/dist/RadioButton.d.ts +11 -0
  174. package/dist/RadioButton.js +37 -4
  175. package/dist/RadioButton.js.map +1 -1
  176. package/dist/RangeSlider.js +2 -2
  177. package/dist/RangeSlider.js.map +1 -1
  178. package/dist/RatingBar.d.ts +2 -2
  179. package/dist/RatingBar.js +21 -7
  180. package/dist/RatingBar.js.map +1 -1
  181. package/dist/RatingIndicator.d.ts +7 -3
  182. package/dist/RatingIndicator.js +24 -8
  183. package/dist/RatingIndicator.js.map +1 -1
  184. package/dist/Review.d.ts +3 -4
  185. package/dist/Review.js +21 -9
  186. package/dist/Review.js.map +1 -1
  187. package/dist/ReviewItem.d.ts +3 -4
  188. package/dist/ReviewItem.js +19 -7
  189. package/dist/ReviewItem.js.map +1 -1
  190. package/dist/Search.d.ts +29 -10
  191. package/dist/Search.js +130 -58
  192. package/dist/Search.js.map +1 -1
  193. package/dist/SearchableListBase.d.ts +33 -15
  194. package/dist/SearchableListBase.js +52 -41
  195. package/dist/SearchableListBase.js.map +1 -1
  196. package/dist/SecondaryNavigation.d.ts +17 -12
  197. package/dist/SecondaryNavigation.js +38 -28
  198. package/dist/SecondaryNavigation.js.map +1 -1
  199. package/dist/SecondaryNavigationItem.d.ts +15 -2
  200. package/dist/SecondaryNavigationItem.js +16 -20
  201. package/dist/SecondaryNavigationItem.js.map +1 -1
  202. package/dist/SecondaryNavigationItemBase.d.ts +4 -4
  203. package/dist/SecondaryNavigationItemBase.js +9 -4
  204. package/dist/SecondaryNavigationItemBase.js.map +1 -1
  205. package/dist/SecondaryNavigationSubItem.d.ts +12 -4
  206. package/dist/SecondaryNavigationSubItem.js +24 -17
  207. package/dist/SecondaryNavigationSubItem.js.map +1 -1
  208. package/dist/SegmentedButton.d.ts +2 -15
  209. package/dist/SegmentedButton.js +19 -33
  210. package/dist/SegmentedButton.js.map +1 -1
  211. package/dist/SegmentedButtonItem.d.ts +9 -1
  212. package/dist/SegmentedButtonItem.js +28 -4
  213. package/dist/SegmentedButtonItem.js.map +1 -1
  214. package/dist/SelectBox.d.ts +28 -17
  215. package/dist/SelectBox.js +81 -63
  216. package/dist/SelectBox.js.map +1 -1
  217. package/dist/SideNavigation.js +2 -6
  218. package/dist/SideNavigation.js.map +1 -1
  219. package/dist/SideNavigationGroup.js +2 -2
  220. package/dist/SideNavigationGroup.js.map +1 -1
  221. package/dist/SideNavigationItem.js +6 -2
  222. package/dist/SideNavigationItem.js.map +1 -1
  223. package/dist/SideNavigationMobile.d.ts +9 -14
  224. package/dist/SideNavigationMobile.js +21 -38
  225. package/dist/SideNavigationMobile.js.map +1 -1
  226. package/dist/SideNavigationSubItem.js +2 -2
  227. package/dist/SideNavigationSubItem.js.map +1 -1
  228. package/dist/Slider.js +2 -2
  229. package/dist/Slider.js.map +1 -1
  230. package/dist/StatusBadge.d.ts +6 -5
  231. package/dist/StatusBadge.js +23 -6
  232. package/dist/StatusBadge.js.map +1 -1
  233. package/dist/StatusMessage.d.ts +2 -1
  234. package/dist/StatusMessage.js +21 -4
  235. package/dist/StatusMessage.js.map +1 -1
  236. package/dist/StepInput.d.ts +23 -14
  237. package/dist/StepInput.js +84 -57
  238. package/dist/StepInput.js.map +1 -1
  239. package/dist/StepInputTemplate.d.ts +2 -0
  240. package/dist/StepInputTemplate.js +7 -0
  241. package/dist/StepInputTemplate.js.map +1 -0
  242. package/dist/Switch.d.ts +9 -8
  243. package/dist/Switch.js +44 -19
  244. package/dist/Switch.js.map +1 -1
  245. package/dist/Tab.d.ts +4 -5
  246. package/dist/Tab.js +15 -6
  247. package/dist/Tab.js.map +1 -1
  248. package/dist/TabNavigation.d.ts +14 -7
  249. package/dist/TabNavigation.js +51 -42
  250. package/dist/TabNavigation.js.map +1 -1
  251. package/dist/Table.d.ts +7 -3
  252. package/dist/Table.js +18 -7
  253. package/dist/Table.js.map +1 -1
  254. package/dist/TableCell.d.ts +2 -2
  255. package/dist/TableCell.js +1 -1
  256. package/dist/TableCell.js.map +1 -1
  257. package/dist/TableCellBase.d.ts +1 -2
  258. package/dist/TableCellBase.js +0 -1
  259. package/dist/TableCellBase.js.map +1 -1
  260. package/dist/TableGroupRow.d.ts +1 -0
  261. package/dist/TableGroupRow.js +2 -2
  262. package/dist/TableGroupRow.js.map +1 -1
  263. package/dist/TableHeaderCell.js +16 -2
  264. package/dist/TableHeaderCell.js.map +1 -1
  265. package/dist/TableRowBase.d.ts +1 -1
  266. package/dist/TableRowBase.js +1 -2
  267. package/dist/TableRowBase.js.map +1 -1
  268. package/dist/Tag.d.ts +14 -6
  269. package/dist/Tag.js +59 -27
  270. package/dist/Tag.js.map +1 -1
  271. package/dist/TagGroup.d.ts +18 -8
  272. package/dist/TagGroup.js +33 -22
  273. package/dist/TagGroup.js.map +1 -1
  274. package/dist/TextArea.d.ts +12 -5
  275. package/dist/TextArea.js +86 -24
  276. package/dist/TextArea.js.map +1 -1
  277. package/dist/TextField.d.ts +11 -2
  278. package/dist/TextField.js +88 -24
  279. package/dist/TextField.js.map +1 -1
  280. package/dist/Tile.d.ts +7 -1
  281. package/dist/Tile.js +3 -7
  282. package/dist/Tile.js.map +1 -1
  283. package/dist/Toast.d.ts +5 -3
  284. package/dist/Toast.js +30 -28
  285. package/dist/Toast.js.map +1 -1
  286. package/dist/Tooltip.d.ts +13 -21
  287. package/dist/Tooltip.js +61 -43
  288. package/dist/Tooltip.js.map +1 -1
  289. package/dist/TruncatedText.d.ts +3 -5
  290. package/dist/TruncatedText.js +12 -6
  291. package/dist/TruncatedText.js.map +1 -1
  292. package/dist/Upload.d.ts +21 -6
  293. package/dist/Upload.js +25 -38
  294. package/dist/Upload.js.map +1 -1
  295. package/dist/UploadItem.d.ts +7 -5
  296. package/dist/UploadItem.js +27 -13
  297. package/dist/UploadItem.js.map +1 -1
  298. package/dist/Wizard.d.ts +46 -5
  299. package/dist/Wizard.js +80 -71
  300. package/dist/Wizard.js.map +1 -1
  301. package/dist/WizardStep.js +2 -2
  302. package/dist/WizardStep.js.map +1 -1
  303. package/dist/WizardTab.d.ts +9 -7
  304. package/dist/WizardTab.js +24 -10
  305. package/dist/WizardTab.js.map +1 -1
  306. package/dist/WizardTemplate.d.ts +2 -0
  307. package/dist/WizardTemplate.js +10 -0
  308. package/dist/WizardTemplate.js.map +1 -0
  309. package/dist/assets/InputSuggestions-pMcXiozG.js +2 -0
  310. package/dist/assets/ListItemStandardExpandableTextTemplate-BoB9C9hl.js +3 -0
  311. package/dist/assets/bundle-7XIcgsQH.css +1 -0
  312. package/dist/assets/bundle.esm-4ejJpC9l.js +380 -0
  313. package/dist/assets/messagebundle_en-BYIX4tmE.js +1 -0
  314. package/dist/assets/parameters-bundle.css-BU4Bi-ho.js +2 -0
  315. package/dist/assets/parameters-bundle.css-BZF5sWSb.js +1 -0
  316. package/dist/assets/parameters-bundle.css-Beilb2gS.js +2 -0
  317. package/dist/assets/parameters-bundle.css-BzQMaZUt.js +2 -0
  318. package/dist/assets/parameters-bundle.css-Bzfv_Fox.js +2 -0
  319. package/dist/assets/parameters-bundle.css-CLwmjytB.js +2 -0
  320. package/dist/assets/parameters-bundle.css-CU3plTdF.js +2 -0
  321. package/dist/assets/parameters-bundle.css-CvaMQVtq.js +1 -0
  322. package/dist/assets/parameters-bundle.css-DRX-o-Cb.js +2 -0
  323. package/dist/assets/parameters-bundle.css-DhFMZJhW.js +2 -0
  324. package/dist/assets/video.es-DIP_dh4I.js +219 -0
  325. package/dist/css/themes/AccordionItem.css +1 -1
  326. package/dist/css/themes/Avatar.css +1 -1
  327. package/dist/css/themes/Badge.css +1 -1
  328. package/dist/css/themes/Breadcrumbs.css +1 -1
  329. package/dist/css/themes/BreadcrumbsPopover.css +1 -1
  330. package/dist/css/themes/Button.css +1 -1
  331. package/dist/css/themes/Checkbox.css +1 -1
  332. package/dist/css/themes/ControlButton.css +1 -1
  333. package/dist/css/themes/DatePicker.css +1 -1
  334. package/dist/css/themes/Dropdown.css +1 -1
  335. package/dist/css/themes/Link.css +1 -1
  336. package/dist/css/themes/ListItem.css +1 -1
  337. package/dist/css/themes/MessageStrip.css +1 -1
  338. package/dist/css/themes/Modal.css +1 -1
  339. package/dist/css/themes/Pagination.css +1 -1
  340. package/dist/css/themes/PhoneNumberField.css +1 -1
  341. package/dist/css/themes/ProgressBar.css +1 -1
  342. package/dist/css/themes/RadioButton.css +1 -1
  343. package/dist/css/themes/RatingIndicator.css +1 -1
  344. package/dist/css/themes/Search.css +1 -1
  345. package/dist/css/themes/SegmentedButtonItem.css +1 -1
  346. package/dist/css/themes/SelectBox.css +1 -1
  347. package/dist/css/themes/SideNavigation.css +1 -1
  348. package/dist/css/themes/SideNavigationGroup.css +1 -1
  349. package/dist/css/themes/SideNavigationItem.css +1 -1
  350. package/dist/css/themes/SideNavigationMobileDropdown.css +1 -1
  351. package/dist/css/themes/SideNavigationSubItem.css +1 -1
  352. package/dist/css/themes/Slider.css +1 -1
  353. package/dist/css/themes/TagGroup.css +1 -1
  354. package/dist/css/themes/TextArea.css +1 -1
  355. package/dist/css/themes/Tile.css +1 -1
  356. package/dist/css/themes/Toast.css +1 -1
  357. package/dist/css/themes/Tooltip.css +1 -1
  358. package/dist/css/themes/WizardTab.css +1 -1
  359. package/dist/css/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css +1 -1
  360. package/dist/custom-elements-internal.json +2604 -2803
  361. package/dist/custom-elements.json +1576 -1554
  362. package/dist/features/SearchSuggestionsPopover.d.ts +2 -2
  363. package/dist/features/SearchSuggestionsPopover.js +4 -3
  364. package/dist/features/SearchSuggestionsPopover.js.map +1 -1
  365. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  366. package/dist/generated/assets/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css.json +1 -1
  367. package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
  368. package/dist/generated/assets/themes/sap_glow/parameters-bundle.css.json +1 -1
  369. package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
  370. package/dist/generated/i18n/i18n-defaults.d.ts +1 -1
  371. package/dist/generated/i18n/i18n-defaults.js +2 -2
  372. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  373. package/dist/generated/json-imports/Themes-fetch.js +19 -0
  374. package/dist/generated/json-imports/Themes-fetch.js.map +1 -0
  375. package/dist/generated/json-imports/Themes.js +1 -1
  376. package/dist/generated/json-imports/Themes.js.map +1 -1
  377. package/dist/generated/json-imports/i18n-fetch.js +82 -0
  378. package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
  379. package/dist/generated/json-imports/i18n.js +1 -1
  380. package/dist/generated/json-imports/i18n.js.map +1 -1
  381. package/dist/generated/templates/AccordionItemTemplate.lit.d.ts +2 -3
  382. package/dist/generated/templates/AccordionItemTemplate.lit.js +5 -3
  383. package/dist/generated/templates/AccordionItemTemplate.lit.js.map +1 -1
  384. package/dist/generated/templates/AccordionTemplate.lit.d.ts +2 -3
  385. package/dist/generated/templates/AccordionTemplate.lit.js +3 -1
  386. package/dist/generated/templates/AccordionTemplate.lit.js.map +1 -1
  387. package/dist/generated/templates/AvatarTemplate.lit.d.ts +2 -3
  388. package/dist/generated/templates/AvatarTemplate.lit.js +4 -2
  389. package/dist/generated/templates/AvatarTemplate.lit.js.map +1 -1
  390. package/dist/generated/templates/BadgeTemplate.lit.d.ts +2 -3
  391. package/dist/generated/templates/BadgeTemplate.lit.js +3 -1
  392. package/dist/generated/templates/BadgeTemplate.lit.js.map +1 -1
  393. package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.d.ts +2 -3
  394. package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.js +7 -5
  395. package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.js.map +1 -1
  396. package/dist/generated/templates/BreadcrumbsTemplate.lit.d.ts +2 -3
  397. package/dist/generated/templates/BreadcrumbsTemplate.lit.js +10 -3
  398. package/dist/generated/templates/BreadcrumbsTemplate.lit.js.map +1 -1
  399. package/dist/generated/templates/CarouselTemplate.lit.d.ts +2 -3
  400. package/dist/generated/templates/CarouselTemplate.lit.js +3 -1
  401. package/dist/generated/templates/CarouselTemplate.lit.js.map +1 -1
  402. package/dist/generated/templates/CountrySelectorTemplate.lit.d.ts +2 -3
  403. package/dist/generated/templates/CountrySelectorTemplate.lit.js +4 -2
  404. package/dist/generated/templates/CountrySelectorTemplate.lit.js.map +1 -1
  405. package/dist/generated/templates/DatePickerPopoverTemplate.lit.d.ts +2 -3
  406. package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +7 -3
  407. package/dist/generated/templates/DatePickerPopoverTemplate.lit.js.map +1 -1
  408. package/dist/generated/templates/DatePickerTemplate.lit.d.ts +2 -3
  409. package/dist/generated/templates/DatePickerTemplate.lit.js +8 -3
  410. package/dist/generated/templates/DatePickerTemplate.lit.js.map +1 -1
  411. package/dist/generated/templates/DividerTemplate.lit.d.ts +2 -3
  412. package/dist/generated/templates/DividerTemplate.lit.js +3 -1
  413. package/dist/generated/templates/DividerTemplate.lit.js.map +1 -1
  414. package/dist/generated/templates/FilterMenuTemplate.lit.d.ts +2 -3
  415. package/dist/generated/templates/FilterMenuTemplate.lit.js +4 -2
  416. package/dist/generated/templates/FilterMenuTemplate.lit.js.map +1 -1
  417. package/dist/generated/templates/FooterTemplate.lit.d.ts +2 -3
  418. package/dist/generated/templates/FooterTemplate.lit.js +10 -8
  419. package/dist/generated/templates/FooterTemplate.lit.js.map +1 -1
  420. package/dist/generated/templates/HeroBannerTemplate.lit.d.ts +2 -3
  421. package/dist/generated/templates/HeroBannerTemplate.lit.js +3 -1
  422. package/dist/generated/templates/HeroBannerTemplate.lit.js.map +1 -1
  423. package/dist/generated/templates/InputGroupTemplate.lit.d.ts +2 -3
  424. package/dist/generated/templates/InputGroupTemplate.lit.js +3 -1
  425. package/dist/generated/templates/InputGroupTemplate.lit.js.map +1 -1
  426. package/dist/generated/templates/ListGroupHeaderTemplate.lit.d.ts +2 -3
  427. package/dist/generated/templates/ListGroupHeaderTemplate.lit.js +3 -1
  428. package/dist/generated/templates/ListGroupHeaderTemplate.lit.js.map +1 -1
  429. package/dist/generated/templates/ListItemTemplate.lit.d.ts +2 -3
  430. package/dist/generated/templates/ListItemTemplate.lit.js +19 -21
  431. package/dist/generated/templates/ListItemTemplate.lit.js.map +1 -1
  432. package/dist/generated/templates/ListSelectAllTemplate.lit.d.ts +2 -3
  433. package/dist/generated/templates/ListSelectAllTemplate.lit.js +4 -2
  434. package/dist/generated/templates/ListSelectAllTemplate.lit.js.map +1 -1
  435. package/dist/generated/templates/ListTemplate.lit.d.ts +2 -3
  436. package/dist/generated/templates/ListTemplate.lit.js +3 -1
  437. package/dist/generated/templates/ListTemplate.lit.js.map +1 -1
  438. package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.d.ts +2 -3
  439. package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.js +3 -1
  440. package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.js.map +1 -1
  441. package/dist/generated/templates/MastheadItemTemplate.lit.d.ts +2 -3
  442. package/dist/generated/templates/MastheadItemTemplate.lit.js +11 -9
  443. package/dist/generated/templates/MastheadItemTemplate.lit.js.map +1 -1
  444. package/dist/generated/templates/MastheadMenuItemTemplate.lit.d.ts +2 -3
  445. package/dist/generated/templates/MastheadMenuItemTemplate.lit.js +10 -8
  446. package/dist/generated/templates/MastheadMenuItemTemplate.lit.js.map +1 -1
  447. package/dist/generated/templates/MastheadMenuTemplate.lit.d.ts +2 -3
  448. package/dist/generated/templates/MastheadMenuTemplate.lit.js +3 -1
  449. package/dist/generated/templates/MastheadMenuTemplate.lit.js.map +1 -1
  450. package/dist/generated/templates/MastheadMobileMenuTemplate.lit.d.ts +2 -3
  451. package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js +3 -1
  452. package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js.map +1 -1
  453. package/dist/generated/templates/MastheadProfileMenuTemplate.lit.d.ts +2 -3
  454. package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js +3 -1
  455. package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js.map +1 -1
  456. package/dist/generated/templates/MastheadShellTemplate.lit.d.ts +2 -3
  457. package/dist/generated/templates/MastheadShellTemplate.lit.js +3 -1
  458. package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
  459. package/dist/generated/templates/MediaPlayerTemplate.lit.d.ts +2 -3
  460. package/dist/generated/templates/MediaPlayerTemplate.lit.js +3 -1
  461. package/dist/generated/templates/MediaPlayerTemplate.lit.js.map +1 -1
  462. package/dist/generated/templates/MediaPlayerVimeoTemplate.lit.d.ts +2 -3
  463. package/dist/generated/templates/MediaPlayerVimeoTemplate.lit.js +3 -1
  464. package/dist/generated/templates/MediaPlayerVimeoTemplate.lit.js.map +1 -1
  465. package/dist/generated/templates/MediaPlayerYoutubeTemplate.lit.d.ts +2 -3
  466. package/dist/generated/templates/MediaPlayerYoutubeTemplate.lit.js +3 -1
  467. package/dist/generated/templates/MediaPlayerYoutubeTemplate.lit.js.map +1 -1
  468. package/dist/generated/templates/PaginationTemplate.lit.d.ts +2 -3
  469. package/dist/generated/templates/PaginationTemplate.lit.js +7 -7
  470. package/dist/generated/templates/PaginationTemplate.lit.js.map +1 -1
  471. package/dist/generated/templates/PasswordFieldTemplate.lit.d.ts +2 -3
  472. package/dist/generated/templates/PasswordFieldTemplate.lit.js +4 -2
  473. package/dist/generated/templates/PasswordFieldTemplate.lit.js.map +1 -1
  474. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.d.ts +2 -3
  475. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js +6 -4
  476. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js.map +1 -1
  477. package/dist/generated/templates/QuoteTemplate.lit.d.ts +2 -3
  478. package/dist/generated/templates/QuoteTemplate.lit.js +3 -1
  479. package/dist/generated/templates/QuoteTemplate.lit.js.map +1 -1
  480. package/dist/generated/templates/RatingBarTemplate.lit.d.ts +2 -3
  481. package/dist/generated/templates/RatingBarTemplate.lit.js +3 -1
  482. package/dist/generated/templates/RatingBarTemplate.lit.js.map +1 -1
  483. package/dist/generated/templates/RatingIndicatorTemplate.lit.d.ts +2 -3
  484. package/dist/generated/templates/RatingIndicatorTemplate.lit.js +3 -1
  485. package/dist/generated/templates/RatingIndicatorTemplate.lit.js.map +1 -1
  486. package/dist/generated/templates/ReviewItemTemplate.lit.d.ts +2 -3
  487. package/dist/generated/templates/ReviewItemTemplate.lit.js +3 -1
  488. package/dist/generated/templates/ReviewItemTemplate.lit.js.map +1 -1
  489. package/dist/generated/templates/ReviewTemplate.lit.d.ts +2 -3
  490. package/dist/generated/templates/ReviewTemplate.lit.js +3 -1
  491. package/dist/generated/templates/ReviewTemplate.lit.js.map +1 -1
  492. package/dist/generated/templates/SearchSuggestionsTemplate.lit.d.ts +2 -3
  493. package/dist/generated/templates/SearchSuggestionsTemplate.lit.js +4 -2
  494. package/dist/generated/templates/SearchSuggestionsTemplate.lit.js.map +1 -1
  495. package/dist/generated/templates/SearchTemplate.lit.d.ts +2 -3
  496. package/dist/generated/templates/SearchTemplate.lit.js +19 -7
  497. package/dist/generated/templates/SearchTemplate.lit.js.map +1 -1
  498. package/dist/generated/templates/SearchableListBaseTemplate.lit.d.ts +2 -3
  499. package/dist/generated/templates/SearchableListBaseTemplate.lit.js +5 -3
  500. package/dist/generated/templates/SearchableListBaseTemplate.lit.js.map +1 -1
  501. package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.d.ts +2 -3
  502. package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js +4 -2
  503. package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js.map +1 -1
  504. package/dist/generated/templates/SecondaryNavigationSubItemTemplate.lit.d.ts +2 -3
  505. package/dist/generated/templates/SecondaryNavigationSubItemTemplate.lit.js +5 -3
  506. package/dist/generated/templates/SecondaryNavigationSubItemTemplate.lit.js.map +1 -1
  507. package/dist/generated/templates/SecondaryNavigationTemplate.lit.d.ts +2 -3
  508. package/dist/generated/templates/SecondaryNavigationTemplate.lit.js +7 -5
  509. package/dist/generated/templates/SecondaryNavigationTemplate.lit.js.map +1 -1
  510. package/dist/generated/templates/SelectBoxTemplate.lit.d.ts +2 -3
  511. package/dist/generated/templates/SelectBoxTemplate.lit.js +6 -4
  512. package/dist/generated/templates/SelectBoxTemplate.lit.js.map +1 -1
  513. package/dist/generated/templates/SideNavigationMobileTemplate.lit.d.ts +2 -3
  514. package/dist/generated/templates/SideNavigationMobileTemplate.lit.js +6 -3
  515. package/dist/generated/templates/SideNavigationMobileTemplate.lit.js.map +1 -1
  516. package/dist/generated/templates/StatusBadgeTemplate.lit.d.ts +2 -3
  517. package/dist/generated/templates/StatusBadgeTemplate.lit.js +3 -1
  518. package/dist/generated/templates/StatusBadgeTemplate.lit.js.map +1 -1
  519. package/dist/generated/templates/StatusMessageTemplate.lit.d.ts +2 -3
  520. package/dist/generated/templates/StatusMessageTemplate.lit.js +4 -2
  521. package/dist/generated/templates/StatusMessageTemplate.lit.js.map +1 -1
  522. package/dist/generated/templates/SwitchTemplate.lit.d.ts +2 -3
  523. package/dist/generated/templates/SwitchTemplate.lit.js +8 -6
  524. package/dist/generated/templates/SwitchTemplate.lit.js.map +1 -1
  525. package/dist/generated/templates/TabHeaderTemplate.lit.d.ts +2 -3
  526. package/dist/generated/templates/TabHeaderTemplate.lit.js +5 -3
  527. package/dist/generated/templates/TabHeaderTemplate.lit.js.map +1 -1
  528. package/dist/generated/templates/TabInOverflowTemplate.lit.d.ts +2 -3
  529. package/dist/generated/templates/TabInOverflowTemplate.lit.js +3 -1
  530. package/dist/generated/templates/TabInOverflowTemplate.lit.js.map +1 -1
  531. package/dist/generated/templates/TabNavigationPopoverTemplate.lit.d.ts +2 -3
  532. package/dist/generated/templates/TabNavigationPopoverTemplate.lit.js +4 -2
  533. package/dist/generated/templates/TabNavigationPopoverTemplate.lit.js.map +1 -1
  534. package/dist/generated/templates/TabNavigationTemplate.lit.d.ts +2 -3
  535. package/dist/generated/templates/TabNavigationTemplate.lit.js +8 -5
  536. package/dist/generated/templates/TabNavigationTemplate.lit.js.map +1 -1
  537. package/dist/generated/templates/TabTemplate.lit.d.ts +2 -3
  538. package/dist/generated/templates/TabTemplate.lit.js +3 -1
  539. package/dist/generated/templates/TabTemplate.lit.js.map +1 -1
  540. package/dist/generated/templates/TableCellTemplate.lit.d.ts +2 -3
  541. package/dist/generated/templates/TableCellTemplate.lit.js +3 -1
  542. package/dist/generated/templates/TableCellTemplate.lit.js.map +1 -1
  543. package/dist/generated/templates/TableGroupRowTemplate.lit.d.ts +2 -3
  544. package/dist/generated/templates/TableGroupRowTemplate.lit.js +3 -1
  545. package/dist/generated/templates/TableGroupRowTemplate.lit.js.map +1 -1
  546. package/dist/generated/templates/TableHeaderCellTemplate.lit.d.ts +2 -3
  547. package/dist/generated/templates/TableHeaderCellTemplate.lit.js +3 -1
  548. package/dist/generated/templates/TableHeaderCellTemplate.lit.js.map +1 -1
  549. package/dist/generated/templates/TableHeaderRowTemplate.lit.d.ts +2 -3
  550. package/dist/generated/templates/TableHeaderRowTemplate.lit.js +3 -1
  551. package/dist/generated/templates/TableHeaderRowTemplate.lit.js.map +1 -1
  552. package/dist/generated/templates/TableRowTemplate.lit.d.ts +2 -3
  553. package/dist/generated/templates/TableRowTemplate.lit.js +3 -1
  554. package/dist/generated/templates/TableRowTemplate.lit.js.map +1 -1
  555. package/dist/generated/templates/TableTemplate.lit.d.ts +2 -3
  556. package/dist/generated/templates/TableTemplate.lit.js +3 -1
  557. package/dist/generated/templates/TableTemplate.lit.js.map +1 -1
  558. package/dist/generated/templates/TagGroupTemplate.lit.d.ts +2 -3
  559. package/dist/generated/templates/TagGroupTemplate.lit.js +6 -4
  560. package/dist/generated/templates/TagGroupTemplate.lit.js.map +1 -1
  561. package/dist/generated/templates/TagTemplate.lit.d.ts +2 -3
  562. package/dist/generated/templates/TagTemplate.lit.js +3 -1
  563. package/dist/generated/templates/TagTemplate.lit.js.map +1 -1
  564. package/dist/generated/templates/TextAreaTemplate.lit.d.ts +2 -3
  565. package/dist/generated/templates/TextAreaTemplate.lit.js +5 -3
  566. package/dist/generated/templates/TextAreaTemplate.lit.js.map +1 -1
  567. package/dist/generated/templates/TextFieldTemplate.lit.d.ts +2 -3
  568. package/dist/generated/templates/TextFieldTemplate.lit.js +3 -1
  569. package/dist/generated/templates/TextFieldTemplate.lit.js.map +1 -1
  570. package/dist/generated/templates/TileTemplate.lit.d.ts +2 -3
  571. package/dist/generated/templates/TileTemplate.lit.js +3 -1
  572. package/dist/generated/templates/TileTemplate.lit.js.map +1 -1
  573. package/dist/generated/templates/ToastTemplate.lit.d.ts +2 -3
  574. package/dist/generated/templates/ToastTemplate.lit.js +3 -1
  575. package/dist/generated/templates/ToastTemplate.lit.js.map +1 -1
  576. package/dist/generated/templates/TooltipTemplate.lit.d.ts +2 -3
  577. package/dist/generated/templates/TooltipTemplate.lit.js +4 -2
  578. package/dist/generated/templates/TooltipTemplate.lit.js.map +1 -1
  579. package/dist/generated/templates/TruncatedTextTemplate.lit.d.ts +2 -3
  580. package/dist/generated/templates/TruncatedTextTemplate.lit.js +3 -1
  581. package/dist/generated/templates/TruncatedTextTemplate.lit.js.map +1 -1
  582. package/dist/generated/templates/UploadItemTemplate.lit.d.ts +2 -3
  583. package/dist/generated/templates/UploadItemTemplate.lit.js +3 -1
  584. package/dist/generated/templates/UploadItemTemplate.lit.js.map +1 -1
  585. package/dist/generated/templates/UploadTemplate.lit.d.ts +2 -3
  586. package/dist/generated/templates/UploadTemplate.lit.js +3 -1
  587. package/dist/generated/templates/UploadTemplate.lit.js.map +1 -1
  588. package/dist/generated/themes/Accordion.css.d.ts +2 -3
  589. package/dist/generated/themes/Accordion.css.js +2 -3
  590. package/dist/generated/themes/Accordion.css.js.map +1 -1
  591. package/dist/generated/themes/AccordionItem.css.d.ts +2 -3
  592. package/dist/generated/themes/AccordionItem.css.js +2 -3
  593. package/dist/generated/themes/AccordionItem.css.js.map +1 -1
  594. package/dist/generated/themes/Avatar.css.d.ts +2 -3
  595. package/dist/generated/themes/Avatar.css.js +2 -3
  596. package/dist/generated/themes/Avatar.css.js.map +1 -1
  597. package/dist/generated/themes/Badge.css.d.ts +2 -3
  598. package/dist/generated/themes/Badge.css.js +2 -3
  599. package/dist/generated/themes/Badge.css.js.map +1 -1
  600. package/dist/generated/themes/Breadcrumbs.css.d.ts +2 -3
  601. package/dist/generated/themes/Breadcrumbs.css.js +2 -3
  602. package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
  603. package/dist/generated/themes/BreadcrumbsPopover.css.d.ts +2 -3
  604. package/dist/generated/themes/BreadcrumbsPopover.css.js +2 -3
  605. package/dist/generated/themes/BreadcrumbsPopover.css.js.map +1 -1
  606. package/dist/generated/themes/Button.css.d.ts +2 -3
  607. package/dist/generated/themes/Button.css.js +2 -3
  608. package/dist/generated/themes/Button.css.js.map +1 -1
  609. package/dist/generated/themes/Carousel.css.d.ts +2 -3
  610. package/dist/generated/themes/Carousel.css.js +2 -3
  611. package/dist/generated/themes/Carousel.css.js.map +1 -1
  612. package/dist/generated/themes/Checkbox.css.d.ts +2 -3
  613. package/dist/generated/themes/Checkbox.css.js +2 -3
  614. package/dist/generated/themes/Checkbox.css.js.map +1 -1
  615. package/dist/generated/themes/ControlButton.css.d.ts +2 -3
  616. package/dist/generated/themes/ControlButton.css.js +2 -3
  617. package/dist/generated/themes/ControlButton.css.js.map +1 -1
  618. package/dist/generated/themes/CountrySelector.css.d.ts +2 -3
  619. package/dist/generated/themes/CountrySelector.css.js +2 -3
  620. package/dist/generated/themes/CountrySelector.css.js.map +1 -1
  621. package/dist/generated/themes/DatePicker.css.d.ts +2 -3
  622. package/dist/generated/themes/DatePicker.css.js +2 -3
  623. package/dist/generated/themes/DatePicker.css.js.map +1 -1
  624. package/dist/generated/themes/DatePickerPopover.css.d.ts +2 -3
  625. package/dist/generated/themes/DatePickerPopover.css.js +2 -3
  626. package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
  627. package/dist/generated/themes/Divider.css.d.ts +2 -3
  628. package/dist/generated/themes/Divider.css.js +2 -3
  629. package/dist/generated/themes/Divider.css.js.map +1 -1
  630. package/dist/generated/themes/Dropdown.css.d.ts +2 -3
  631. package/dist/generated/themes/Dropdown.css.js +2 -3
  632. package/dist/generated/themes/Dropdown.css.js.map +1 -1
  633. package/dist/generated/themes/FilterMenu.css.d.ts +2 -3
  634. package/dist/generated/themes/FilterMenu.css.js +2 -3
  635. package/dist/generated/themes/FilterMenu.css.js.map +1 -1
  636. package/dist/generated/themes/Footer.css.d.ts +2 -3
  637. package/dist/generated/themes/Footer.css.js +2 -3
  638. package/dist/generated/themes/Footer.css.js.map +1 -1
  639. package/dist/generated/themes/HeroBanner.css.d.ts +2 -3
  640. package/dist/generated/themes/HeroBanner.css.js +2 -3
  641. package/dist/generated/themes/HeroBanner.css.js.map +1 -1
  642. package/dist/generated/themes/InputGroup.css.d.ts +2 -3
  643. package/dist/generated/themes/InputGroup.css.js +2 -3
  644. package/dist/generated/themes/InputGroup.css.js.map +1 -1
  645. package/dist/generated/themes/Link.css.d.ts +2 -3
  646. package/dist/generated/themes/Link.css.js +2 -3
  647. package/dist/generated/themes/Link.css.js.map +1 -1
  648. package/dist/generated/themes/List.css.d.ts +2 -3
  649. package/dist/generated/themes/List.css.js +2 -3
  650. package/dist/generated/themes/List.css.js.map +1 -1
  651. package/dist/generated/themes/ListGroupHeader.css.d.ts +2 -3
  652. package/dist/generated/themes/ListGroupHeader.css.js +2 -3
  653. package/dist/generated/themes/ListGroupHeader.css.js.map +1 -1
  654. package/dist/generated/themes/ListItem.css.d.ts +2 -3
  655. package/dist/generated/themes/ListItem.css.js +2 -3
  656. package/dist/generated/themes/ListItem.css.js.map +1 -1
  657. package/dist/generated/themes/MastheadCountrySelector.css.d.ts +2 -3
  658. package/dist/generated/themes/MastheadCountrySelector.css.js +2 -3
  659. package/dist/generated/themes/MastheadCountrySelector.css.js.map +1 -1
  660. package/dist/generated/themes/MastheadItem.css.d.ts +2 -3
  661. package/dist/generated/themes/MastheadItem.css.js +2 -3
  662. package/dist/generated/themes/MastheadItem.css.js.map +1 -1
  663. package/dist/generated/themes/MastheadMenu.css.d.ts +2 -3
  664. package/dist/generated/themes/MastheadMenu.css.js +2 -3
  665. package/dist/generated/themes/MastheadMenu.css.js.map +1 -1
  666. package/dist/generated/themes/MastheadMenuItem.css.d.ts +2 -3
  667. package/dist/generated/themes/MastheadMenuItem.css.js +2 -3
  668. package/dist/generated/themes/MastheadMenuItem.css.js.map +1 -1
  669. package/dist/generated/themes/MastheadMobileMenu.css.d.ts +2 -3
  670. package/dist/generated/themes/MastheadMobileMenu.css.js +2 -3
  671. package/dist/generated/themes/MastheadMobileMenu.css.js.map +1 -1
  672. package/dist/generated/themes/MastheadProfileMenu.css.d.ts +2 -3
  673. package/dist/generated/themes/MastheadProfileMenu.css.js +2 -3
  674. package/dist/generated/themes/MastheadProfileMenu.css.js.map +1 -1
  675. package/dist/generated/themes/MastheadShell.css.d.ts +2 -3
  676. package/dist/generated/themes/MastheadShell.css.js +2 -3
  677. package/dist/generated/themes/MastheadShell.css.js.map +1 -1
  678. package/dist/generated/themes/MediaPlayer.css.d.ts +2 -3
  679. package/dist/generated/themes/MediaPlayer.css.js +2 -3
  680. package/dist/generated/themes/MediaPlayer.css.js.map +1 -1
  681. package/dist/generated/themes/MediaPlayerYoutube.css.d.ts +2 -3
  682. package/dist/generated/themes/MediaPlayerYoutube.css.js +2 -3
  683. package/dist/generated/themes/MediaPlayerYoutube.css.js.map +1 -1
  684. package/dist/generated/themes/MessageStrip.css.d.ts +2 -3
  685. package/dist/generated/themes/MessageStrip.css.js +2 -3
  686. package/dist/generated/themes/MessageStrip.css.js.map +1 -1
  687. package/dist/generated/themes/Modal.css.d.ts +2 -3
  688. package/dist/generated/themes/Modal.css.js +2 -3
  689. package/dist/generated/themes/Modal.css.js.map +1 -1
  690. package/dist/generated/themes/Pagination.css.d.ts +2 -3
  691. package/dist/generated/themes/Pagination.css.js +2 -3
  692. package/dist/generated/themes/Pagination.css.js.map +1 -1
  693. package/dist/generated/themes/PhoneNumberField.css.d.ts +2 -3
  694. package/dist/generated/themes/PhoneNumberField.css.js +2 -3
  695. package/dist/generated/themes/PhoneNumberField.css.js.map +1 -1
  696. package/dist/generated/themes/ProgressBar.css.d.ts +2 -3
  697. package/dist/generated/themes/ProgressBar.css.js +2 -3
  698. package/dist/generated/themes/ProgressBar.css.js.map +1 -1
  699. package/dist/generated/themes/Quote.css.d.ts +2 -3
  700. package/dist/generated/themes/Quote.css.js +2 -3
  701. package/dist/generated/themes/Quote.css.js.map +1 -1
  702. package/dist/generated/themes/RadioButton.css.d.ts +2 -3
  703. package/dist/generated/themes/RadioButton.css.js +2 -3
  704. package/dist/generated/themes/RadioButton.css.js.map +1 -1
  705. package/dist/generated/themes/RatingBar.css.d.ts +2 -3
  706. package/dist/generated/themes/RatingBar.css.js +2 -3
  707. package/dist/generated/themes/RatingBar.css.js.map +1 -1
  708. package/dist/generated/themes/RatingIndicator.css.d.ts +2 -3
  709. package/dist/generated/themes/RatingIndicator.css.js +2 -3
  710. package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
  711. package/dist/generated/themes/Review.css.d.ts +2 -3
  712. package/dist/generated/themes/Review.css.js +2 -3
  713. package/dist/generated/themes/Review.css.js.map +1 -1
  714. package/dist/generated/themes/ReviewItem.css.d.ts +2 -3
  715. package/dist/generated/themes/ReviewItem.css.js +2 -3
  716. package/dist/generated/themes/ReviewItem.css.js.map +1 -1
  717. package/dist/generated/themes/Search.css.d.ts +2 -3
  718. package/dist/generated/themes/Search.css.js +2 -3
  719. package/dist/generated/themes/Search.css.js.map +1 -1
  720. package/dist/generated/themes/SearchSuggestions.css.d.ts +2 -3
  721. package/dist/generated/themes/SearchSuggestions.css.js +2 -3
  722. package/dist/generated/themes/SearchSuggestions.css.js.map +1 -1
  723. package/dist/generated/themes/SearchableList.css.d.ts +2 -3
  724. package/dist/generated/themes/SearchableList.css.js +2 -3
  725. package/dist/generated/themes/SearchableList.css.js.map +1 -1
  726. package/dist/generated/themes/SecondaryNavigation.css.d.ts +2 -3
  727. package/dist/generated/themes/SecondaryNavigation.css.js +2 -3
  728. package/dist/generated/themes/SecondaryNavigation.css.js.map +1 -1
  729. package/dist/generated/themes/SecondaryNavigationItem.css.d.ts +2 -3
  730. package/dist/generated/themes/SecondaryNavigationItem.css.js +2 -3
  731. package/dist/generated/themes/SecondaryNavigationItem.css.js.map +1 -1
  732. package/dist/generated/themes/SecondaryNavigationSubItem.css.d.ts +2 -3
  733. package/dist/generated/themes/SecondaryNavigationSubItem.css.js +2 -3
  734. package/dist/generated/themes/SecondaryNavigationSubItem.css.js.map +1 -1
  735. package/dist/generated/themes/SegmentedButton.css.d.ts +2 -3
  736. package/dist/generated/themes/SegmentedButton.css.js +2 -3
  737. package/dist/generated/themes/SegmentedButton.css.js.map +1 -1
  738. package/dist/generated/themes/SegmentedButtonItem.css.d.ts +2 -3
  739. package/dist/generated/themes/SegmentedButtonItem.css.js +2 -3
  740. package/dist/generated/themes/SegmentedButtonItem.css.js.map +1 -1
  741. package/dist/generated/themes/SelectBox.css.d.ts +2 -3
  742. package/dist/generated/themes/SelectBox.css.js +2 -3
  743. package/dist/generated/themes/SelectBox.css.js.map +1 -1
  744. package/dist/generated/themes/SideNavigation.css.d.ts +2 -3
  745. package/dist/generated/themes/SideNavigation.css.js +2 -3
  746. package/dist/generated/themes/SideNavigation.css.js.map +1 -1
  747. package/dist/generated/themes/SideNavigationGroup.css.d.ts +2 -3
  748. package/dist/generated/themes/SideNavigationGroup.css.js +2 -3
  749. package/dist/generated/themes/SideNavigationGroup.css.js.map +1 -1
  750. package/dist/generated/themes/SideNavigationItem.css.d.ts +2 -3
  751. package/dist/generated/themes/SideNavigationItem.css.js +2 -3
  752. package/dist/generated/themes/SideNavigationItem.css.js.map +1 -1
  753. package/dist/generated/themes/SideNavigationMobile.css.d.ts +2 -3
  754. package/dist/generated/themes/SideNavigationMobile.css.js +2 -3
  755. package/dist/generated/themes/SideNavigationMobile.css.js.map +1 -1
  756. package/dist/generated/themes/SideNavigationMobileDropdown.css.d.ts +2 -3
  757. package/dist/generated/themes/SideNavigationMobileDropdown.css.js +2 -3
  758. package/dist/generated/themes/SideNavigationMobileDropdown.css.js.map +1 -1
  759. package/dist/generated/themes/SideNavigationSubItem.css.d.ts +2 -3
  760. package/dist/generated/themes/SideNavigationSubItem.css.js +2 -3
  761. package/dist/generated/themes/SideNavigationSubItem.css.js.map +1 -1
  762. package/dist/generated/themes/Slider.css.d.ts +2 -3
  763. package/dist/generated/themes/Slider.css.js +2 -3
  764. package/dist/generated/themes/Slider.css.js.map +1 -1
  765. package/dist/generated/themes/StatusBadge.css.d.ts +2 -3
  766. package/dist/generated/themes/StatusBadge.css.js +2 -3
  767. package/dist/generated/themes/StatusBadge.css.js.map +1 -1
  768. package/dist/generated/themes/StatusMessage.css.d.ts +2 -3
  769. package/dist/generated/themes/StatusMessage.css.js +2 -3
  770. package/dist/generated/themes/StatusMessage.css.js.map +1 -1
  771. package/dist/generated/themes/StepInput.css.d.ts +2 -3
  772. package/dist/generated/themes/StepInput.css.js +2 -3
  773. package/dist/generated/themes/StepInput.css.js.map +1 -1
  774. package/dist/generated/themes/Switch.css.d.ts +2 -3
  775. package/dist/generated/themes/Switch.css.js +2 -3
  776. package/dist/generated/themes/Switch.css.js.map +1 -1
  777. package/dist/generated/themes/TabInOverflow.css.d.ts +2 -3
  778. package/dist/generated/themes/TabInOverflow.css.js +2 -3
  779. package/dist/generated/themes/TabInOverflow.css.js.map +1 -1
  780. package/dist/generated/themes/TabNavigation.css.d.ts +2 -3
  781. package/dist/generated/themes/TabNavigation.css.js +2 -3
  782. package/dist/generated/themes/TabNavigation.css.js.map +1 -1
  783. package/dist/generated/themes/Table.css.d.ts +2 -3
  784. package/dist/generated/themes/Table.css.js +2 -3
  785. package/dist/generated/themes/Table.css.js.map +1 -1
  786. package/dist/generated/themes/TableCell.css.d.ts +2 -3
  787. package/dist/generated/themes/TableCell.css.js +2 -3
  788. package/dist/generated/themes/TableCell.css.js.map +1 -1
  789. package/dist/generated/themes/TableCellBase.css.d.ts +2 -3
  790. package/dist/generated/themes/TableCellBase.css.js +2 -3
  791. package/dist/generated/themes/TableCellBase.css.js.map +1 -1
  792. package/dist/generated/themes/TableGroupRow.css.d.ts +2 -3
  793. package/dist/generated/themes/TableGroupRow.css.js +2 -3
  794. package/dist/generated/themes/TableGroupRow.css.js.map +1 -1
  795. package/dist/generated/themes/TableHeaderCell.css.d.ts +2 -3
  796. package/dist/generated/themes/TableHeaderCell.css.js +2 -3
  797. package/dist/generated/themes/TableHeaderCell.css.js.map +1 -1
  798. package/dist/generated/themes/TableRowBase.css.d.ts +2 -3
  799. package/dist/generated/themes/TableRowBase.css.js +2 -3
  800. package/dist/generated/themes/TableRowBase.css.js.map +1 -1
  801. package/dist/generated/themes/Tag.css.d.ts +2 -3
  802. package/dist/generated/themes/Tag.css.js +2 -3
  803. package/dist/generated/themes/Tag.css.js.map +1 -1
  804. package/dist/generated/themes/TagGroup.css.d.ts +2 -3
  805. package/dist/generated/themes/TagGroup.css.js +2 -3
  806. package/dist/generated/themes/TagGroup.css.js.map +1 -1
  807. package/dist/generated/themes/TextArea.css.d.ts +2 -3
  808. package/dist/generated/themes/TextArea.css.js +2 -3
  809. package/dist/generated/themes/TextArea.css.js.map +1 -1
  810. package/dist/generated/themes/TextField.css.d.ts +2 -3
  811. package/dist/generated/themes/TextField.css.js +2 -3
  812. package/dist/generated/themes/TextField.css.js.map +1 -1
  813. package/dist/generated/themes/Tile.css.d.ts +2 -3
  814. package/dist/generated/themes/Tile.css.js +2 -3
  815. package/dist/generated/themes/Tile.css.js.map +1 -1
  816. package/dist/generated/themes/Toast.css.d.ts +2 -3
  817. package/dist/generated/themes/Toast.css.js +2 -3
  818. package/dist/generated/themes/Toast.css.js.map +1 -1
  819. package/dist/generated/themes/Tooltip.css.d.ts +2 -3
  820. package/dist/generated/themes/Tooltip.css.js +2 -3
  821. package/dist/generated/themes/Tooltip.css.js.map +1 -1
  822. package/dist/generated/themes/TruncatedText.css.d.ts +2 -3
  823. package/dist/generated/themes/TruncatedText.css.js +2 -3
  824. package/dist/generated/themes/TruncatedText.css.js.map +1 -1
  825. package/dist/generated/themes/Upload.css.d.ts +2 -3
  826. package/dist/generated/themes/Upload.css.js +2 -3
  827. package/dist/generated/themes/Upload.css.js.map +1 -1
  828. package/dist/generated/themes/UploadItem.css.d.ts +2 -3
  829. package/dist/generated/themes/UploadItem.css.js +2 -3
  830. package/dist/generated/themes/UploadItem.css.js.map +1 -1
  831. package/dist/generated/themes/Wizard.css.d.ts +2 -3
  832. package/dist/generated/themes/Wizard.css.js +2 -3
  833. package/dist/generated/themes/Wizard.css.js.map +1 -1
  834. package/dist/generated/themes/WizardTab.css.d.ts +2 -3
  835. package/dist/generated/themes/WizardTab.css.js +2 -3
  836. package/dist/generated/themes/WizardTab.css.js.map +1 -1
  837. package/dist/generated/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css.d.ts +2 -3
  838. package/dist/generated/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css.js +2 -3
  839. package/dist/generated/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css.js.map +1 -1
  840. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +2 -3
  841. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -2
  842. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
  843. package/dist/generated/themes/sap_glow/parameters-bundle.css.d.ts +2 -3
  844. package/dist/generated/themes/sap_glow/parameters-bundle.css.js +1 -2
  845. package/dist/generated/themes/sap_glow/parameters-bundle.css.js.map +1 -1
  846. package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +2 -3
  847. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -2
  848. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
  849. package/dist/mediaPlayerLanguageMapping.d.ts +0 -3382
  850. package/dist/mediaPlayerLanguageMapping.js.map +1 -1
  851. package/dist/{i18n/messagebundle.properties → messagebundle.properties} +1 -1
  852. package/dist/{i18n/messagebundle_en.properties → messagebundle_en.properties} +0 -1
  853. package/dist/types/BadgeDesign.d.ts +17 -8
  854. package/dist/types/BadgeDesign.js +28 -17
  855. package/dist/types/BadgeDesign.js.map +1 -1
  856. package/dist/types/Button.d.ts +28 -0
  857. package/dist/types/Button.js +33 -0
  858. package/dist/types/Button.js.map +1 -0
  859. package/dist/types/Checkbox.d.ts +6 -0
  860. package/dist/types/Checkbox.js +8 -0
  861. package/dist/types/Checkbox.js.map +1 -0
  862. package/dist/types/Dropdown.d.ts +8 -12
  863. package/dist/types/Dropdown.js +8 -14
  864. package/dist/types/Dropdown.js.map +1 -1
  865. package/dist/types/FileUploadState.d.ts +2 -2
  866. package/dist/types/FileUploadState.js +7 -7
  867. package/dist/types/FileUploadState.js.map +1 -1
  868. package/dist/types/IconPlacement.d.ts +2 -2
  869. package/dist/types/IconPlacement.js +6 -6
  870. package/dist/types/IconPlacement.js.map +1 -1
  871. package/dist/types/List.d.ts +4 -4
  872. package/dist/types/List.js +27 -27
  873. package/dist/types/List.js.map +1 -1
  874. package/dist/types/MessageStrip.d.ts +2 -2
  875. package/dist/types/MessageStrip.js +14 -14
  876. package/dist/types/MessageStrip.js.map +1 -1
  877. package/dist/types/ProgressBar.d.ts +8 -0
  878. package/dist/types/ProgressBar.js +10 -0
  879. package/dist/types/ProgressBar.js.map +1 -0
  880. package/dist/types/RadioButton.d.ts +8 -0
  881. package/dist/types/RadioButton.js +10 -0
  882. package/dist/types/RadioButton.js.map +1 -0
  883. package/dist/types/SearchableListBase.d.ts +3 -3
  884. package/dist/types/SearchableListBase.js.map +1 -1
  885. package/dist/types/Table.d.ts +2 -2
  886. package/dist/types/Table.js +9 -9
  887. package/dist/types/Table.js.map +1 -1
  888. package/dist/types/common.d.ts +15 -3
  889. package/dist/types/common.js +35 -15
  890. package/dist/types/common.js.map +1 -1
  891. package/dist/utils/ListWithFirstLetterFocus.js.map +1 -1
  892. package/dist/utils/debounce.d.ts +2 -2
  893. package/dist/utils/debounce.js.map +1 -1
  894. package/dist/utils/listItemLabelStartsWithKeyFocus.d.ts +1 -0
  895. package/dist/utils/listItemLabelStartsWithKeyFocus.js +2 -0
  896. package/dist/utils/listItemLabelStartsWithKeyFocus.js.map +1 -0
  897. package/dist/utils/listItemLabelUtils.js.map +1 -1
  898. package/dist/utils/parseRelativeUnits.js.map +1 -1
  899. package/dist/utils/redirectAttributes.js.map +1 -1
  900. package/dist/utils/retryUntilSuccessful.d.ts +1 -1
  901. package/dist/utils/retryUntilSuccessful.js.map +1 -1
  902. package/dist/vscode.html-custom-data.json +179 -188
  903. package/dist/web-types.json +529 -528
  904. package/{package-scripts.js → package-scripts.cjs} +1 -1
  905. package/package.json +14 -8
  906. package/run-cypress.js +12 -0
  907. package/src/Accordion.ts +15 -19
  908. package/src/AccordionItem.hbs +4 -3
  909. package/src/AccordionItem.ts +10 -10
  910. package/src/Assets.ts +2 -5
  911. package/src/AssetsVariables.ts +52 -0
  912. package/src/Avatar.hbs +1 -1
  913. package/src/Avatar.ts +40 -31
  914. package/src/AvatarGroup.ts +11 -10
  915. package/src/Badge.ts +15 -23
  916. package/src/Breadcrumbs.hbs +9 -5
  917. package/src/Breadcrumbs.ts +65 -103
  918. package/src/BreadcrumbsItem.ts +2 -2
  919. package/src/BreadcrumbsPopover.hbs +6 -8
  920. package/src/Button.ts +31 -42
  921. package/src/Carousel.ts +13 -18
  922. package/src/Checkbox.ts +34 -4
  923. package/src/ControlButton.ts +14 -5
  924. package/src/CountrySelector.hbs +9 -7
  925. package/src/CountrySelector.ts +142 -145
  926. package/src/DatePicker.hbs +12 -11
  927. package/src/DatePicker.ts +93 -79
  928. package/src/DatePickerPopover.hbs +22 -19
  929. package/src/Divider.ts +3 -3
  930. package/src/Dropdown.ts +18 -272
  931. package/src/FilterMenu.hbs +4 -3
  932. package/src/FilterMenu.ts +69 -71
  933. package/src/Footer.hbs +7 -7
  934. package/src/Footer.ts +93 -92
  935. package/src/HeroBanner.ts +7 -10
  936. package/src/InputGroup.ts +15 -21
  937. package/src/Link.ts +16 -46
  938. package/src/List.ts +39 -48
  939. package/src/ListGroupHeader.ts +14 -9
  940. package/src/ListItem.hbs +4 -30
  941. package/src/ListItem.ts +49 -95
  942. package/src/ListItemBase.ts +18 -18
  943. package/src/ListSelectAll.hbs +2 -1
  944. package/src/ListSelectAll.ts +18 -17
  945. package/src/MastheadCountrySelector.ts +15 -32
  946. package/src/MastheadItem.hbs +5 -3
  947. package/src/MastheadItem.ts +31 -39
  948. package/src/MastheadMenu.ts +12 -18
  949. package/src/MastheadMenuItem.hbs +6 -3
  950. package/src/MastheadMenuItem.ts +15 -16
  951. package/src/MastheadMobileMenu.ts +31 -38
  952. package/src/MastheadProfileMenu.ts +18 -32
  953. package/src/MastheadShell.ts +56 -53
  954. package/src/MediaPlayer.ts +67 -59
  955. package/src/MediaPlayerVimeo.ts +29 -23
  956. package/src/MediaPlayerYoutube.ts +33 -23
  957. package/src/MessageStrip.ts +30 -55
  958. package/src/MessageStripTemplate.tsx +74 -0
  959. package/src/Modal.ts +5 -8
  960. package/src/Pagination.hbs +1 -25
  961. package/src/Pagination.ts +33 -41
  962. package/src/PasswordField.hbs +1 -1
  963. package/src/PasswordField.ts +19 -21
  964. package/src/PhoneNumberField.hbs +14 -19
  965. package/src/PhoneNumberField.ts +85 -97
  966. package/src/ProgressBar.ts +34 -2
  967. package/src/ProgressBarTemplate.tsx +59 -0
  968. package/src/Quote.ts +8 -8
  969. package/src/RadioButton.ts +39 -6
  970. package/src/RangeSlider.ts +2 -2
  971. package/src/RatingBar.ts +8 -10
  972. package/src/RatingIndicator.ts +13 -6
  973. package/src/Review.ts +10 -13
  974. package/src/ReviewItem.ts +11 -13
  975. package/src/Search.hbs +14 -9
  976. package/src/Search.ts +101 -87
  977. package/src/SearchSuggestions.hbs +3 -3
  978. package/src/SearchableListBase.hbs +4 -2
  979. package/src/SearchableListBase.ts +69 -55
  980. package/src/SecondaryNavigation.hbs +5 -5
  981. package/src/SecondaryNavigation.ts +32 -42
  982. package/src/SecondaryNavigationItem.hbs +2 -1
  983. package/src/SecondaryNavigationItem.ts +28 -23
  984. package/src/SecondaryNavigationItemBase.ts +7 -7
  985. package/src/SecondaryNavigationSubItem.hbs +4 -2
  986. package/src/SecondaryNavigationSubItem.ts +27 -25
  987. package/src/SegmentedButton.ts +13 -41
  988. package/src/SegmentedButtonItem.ts +23 -5
  989. package/src/SelectBox.hbs +4 -3
  990. package/src/SelectBox.ts +88 -79
  991. package/src/SideNavigation.ts +2 -6
  992. package/src/SideNavigationGroup.ts +2 -2
  993. package/src/SideNavigationItem.ts +8 -2
  994. package/src/SideNavigationMobile.hbs +39 -17
  995. package/src/SideNavigationMobile.ts +26 -43
  996. package/src/SideNavigationSubItem.ts +2 -2
  997. package/src/Slider.ts +2 -2
  998. package/src/StatusBadge.ts +13 -12
  999. package/src/StatusMessage.hbs +1 -1
  1000. package/src/StatusMessage.ts +6 -6
  1001. package/src/StepInput.ts +72 -81
  1002. package/src/StepInputTemplate.tsx +62 -0
  1003. package/src/Switch.hbs +5 -7
  1004. package/src/Switch.ts +21 -25
  1005. package/src/Tab.ts +8 -10
  1006. package/src/TabHeader.hbs +1 -1
  1007. package/src/TabNavigation.hbs +5 -2
  1008. package/src/TabNavigation.ts +62 -61
  1009. package/src/TabNavigationPopover.hbs +5 -7
  1010. package/src/Table.ts +15 -12
  1011. package/src/TableCell.ts +3 -3
  1012. package/src/TableCellBase.ts +1 -2
  1013. package/src/TableGroupRow.ts +2 -2
  1014. package/src/TableHeaderCell.ts +4 -4
  1015. package/src/TableRowBase.ts +2 -3
  1016. package/src/Tag.ts +31 -23
  1017. package/src/TagGroup.hbs +20 -11
  1018. package/src/TagGroup.ts +38 -23
  1019. package/src/TextArea.hbs +7 -7
  1020. package/src/TextArea.ts +34 -34
  1021. package/src/TextField.ts +47 -34
  1022. package/src/Tile.ts +10 -8
  1023. package/src/Toast.ts +19 -25
  1024. package/src/Tooltip.hbs +5 -2
  1025. package/src/Tooltip.ts +29 -45
  1026. package/src/TruncatedText.ts +5 -8
  1027. package/src/Upload.ts +43 -54
  1028. package/src/UploadItem.ts +27 -18
  1029. package/src/Wizard.ts +150 -113
  1030. package/src/WizardStep.ts +2 -2
  1031. package/src/WizardTab.ts +13 -11
  1032. package/src/WizardTemplate.tsx +61 -0
  1033. package/src/features/SearchSuggestionsPopover.ts +6 -4
  1034. package/src/generated/i18n/i18n-defaults.ts +2 -2
  1035. package/src/generated/json-imports/Themes-fetch.ts +21 -0
  1036. package/src/generated/json-imports/Themes.ts +1 -1
  1037. package/src/generated/json-imports/i18n-fetch.ts +85 -0
  1038. package/src/generated/json-imports/i18n.ts +15 -16
  1039. package/src/generated/templates/AccordionItemTemplate.lit.ts +7 -6
  1040. package/src/generated/templates/AccordionTemplate.lit.ts +5 -4
  1041. package/src/generated/templates/AvatarTemplate.lit.ts +6 -5
  1042. package/src/generated/templates/BadgeTemplate.lit.ts +5 -4
  1043. package/src/generated/templates/BreadcrumbsPopoverTemplate.lit.ts +9 -8
  1044. package/src/generated/templates/BreadcrumbsTemplate.lit.ts +12 -6
  1045. package/src/generated/templates/CarouselTemplate.lit.ts +5 -4
  1046. package/src/generated/templates/CountrySelectorTemplate.lit.ts +6 -5
  1047. package/src/generated/templates/DatePickerPopoverTemplate.lit.ts +9 -6
  1048. package/src/generated/templates/DatePickerTemplate.lit.ts +9 -5
  1049. package/src/generated/templates/DividerTemplate.lit.ts +5 -4
  1050. package/src/generated/templates/FilterMenuTemplate.lit.ts +6 -5
  1051. package/src/generated/templates/FooterTemplate.lit.ts +12 -11
  1052. package/src/generated/templates/HeroBannerTemplate.lit.ts +5 -4
  1053. package/src/generated/templates/InputGroupTemplate.lit.ts +5 -4
  1054. package/src/generated/templates/ListGroupHeaderTemplate.lit.ts +5 -4
  1055. package/src/generated/templates/ListItemTemplate.lit.ts +21 -24
  1056. package/src/generated/templates/ListSelectAllTemplate.lit.ts +6 -5
  1057. package/src/generated/templates/ListTemplate.lit.ts +5 -4
  1058. package/src/generated/templates/MastheadCountrySelectorTemplate.lit.ts +5 -4
  1059. package/src/generated/templates/MastheadItemTemplate.lit.ts +13 -12
  1060. package/src/generated/templates/MastheadMenuItemTemplate.lit.ts +12 -11
  1061. package/src/generated/templates/MastheadMenuTemplate.lit.ts +5 -4
  1062. package/src/generated/templates/MastheadMobileMenuTemplate.lit.ts +5 -4
  1063. package/src/generated/templates/MastheadProfileMenuTemplate.lit.ts +5 -4
  1064. package/src/generated/templates/MastheadShellTemplate.lit.ts +5 -4
  1065. package/src/generated/templates/MediaPlayerTemplate.lit.ts +5 -4
  1066. package/src/generated/templates/MediaPlayerVimeoTemplate.lit.ts +5 -4
  1067. package/src/generated/templates/MediaPlayerYoutubeTemplate.lit.ts +5 -4
  1068. package/src/generated/templates/PaginationTemplate.lit.ts +9 -10
  1069. package/src/generated/templates/PasswordFieldTemplate.lit.ts +6 -5
  1070. package/src/generated/templates/PhoneNumberFieldTemplate.lit.ts +8 -7
  1071. package/src/generated/templates/QuoteTemplate.lit.ts +5 -4
  1072. package/src/generated/templates/RatingBarTemplate.lit.ts +5 -4
  1073. package/src/generated/templates/RatingIndicatorTemplate.lit.ts +5 -4
  1074. package/src/generated/templates/ReviewItemTemplate.lit.ts +5 -4
  1075. package/src/generated/templates/ReviewTemplate.lit.ts +5 -4
  1076. package/src/generated/templates/SearchSuggestionsTemplate.lit.ts +6 -5
  1077. package/src/generated/templates/SearchTemplate.lit.ts +20 -9
  1078. package/src/generated/templates/SearchableListBaseTemplate.lit.ts +7 -6
  1079. package/src/generated/templates/SecondaryNavigationItemTemplate.lit.ts +6 -5
  1080. package/src/generated/templates/SecondaryNavigationSubItemTemplate.lit.ts +7 -6
  1081. package/src/generated/templates/SecondaryNavigationTemplate.lit.ts +9 -8
  1082. package/src/generated/templates/SelectBoxTemplate.lit.ts +8 -7
  1083. package/src/generated/templates/SideNavigationMobileTemplate.lit.ts +7 -5
  1084. package/src/generated/templates/StatusBadgeTemplate.lit.ts +5 -4
  1085. package/src/generated/templates/StatusMessageTemplate.lit.ts +6 -5
  1086. package/src/generated/templates/SwitchTemplate.lit.ts +10 -9
  1087. package/src/generated/templates/TabHeaderTemplate.lit.ts +7 -6
  1088. package/src/generated/templates/TabInOverflowTemplate.lit.ts +5 -4
  1089. package/src/generated/templates/TabNavigationPopoverTemplate.lit.ts +6 -5
  1090. package/src/generated/templates/TabNavigationTemplate.lit.ts +10 -8
  1091. package/src/generated/templates/TabTemplate.lit.ts +5 -4
  1092. package/src/generated/templates/TableCellTemplate.lit.ts +5 -4
  1093. package/src/generated/templates/TableGroupRowTemplate.lit.ts +5 -4
  1094. package/src/generated/templates/TableHeaderCellTemplate.lit.ts +5 -4
  1095. package/src/generated/templates/TableHeaderRowTemplate.lit.ts +5 -4
  1096. package/src/generated/templates/TableRowTemplate.lit.ts +5 -4
  1097. package/src/generated/templates/TableTemplate.lit.ts +5 -4
  1098. package/src/generated/templates/TagGroupTemplate.lit.ts +8 -7
  1099. package/src/generated/templates/TagTemplate.lit.ts +5 -4
  1100. package/src/generated/templates/TextAreaTemplate.lit.ts +7 -6
  1101. package/src/generated/templates/TextFieldTemplate.lit.ts +5 -4
  1102. package/src/generated/templates/TileTemplate.lit.ts +5 -4
  1103. package/src/generated/templates/ToastTemplate.lit.ts +5 -4
  1104. package/src/generated/templates/TooltipTemplate.lit.ts +6 -5
  1105. package/src/generated/templates/TruncatedTextTemplate.lit.ts +5 -4
  1106. package/src/generated/templates/UploadItemTemplate.lit.ts +5 -4
  1107. package/src/generated/templates/UploadTemplate.lit.ts +5 -4
  1108. package/src/generated/themes/Accordion.css.ts +2 -6
  1109. package/src/generated/themes/AccordionItem.css.ts +2 -6
  1110. package/src/generated/themes/Avatar.css.ts +2 -6
  1111. package/src/generated/themes/Badge.css.ts +2 -6
  1112. package/src/generated/themes/Breadcrumbs.css.ts +2 -6
  1113. package/src/generated/themes/BreadcrumbsPopover.css.ts +2 -6
  1114. package/src/generated/themes/Button.css.ts +2 -6
  1115. package/src/generated/themes/Carousel.css.ts +2 -6
  1116. package/src/generated/themes/Checkbox.css.ts +2 -6
  1117. package/src/generated/themes/ControlButton.css.ts +2 -6
  1118. package/src/generated/themes/CountrySelector.css.ts +2 -6
  1119. package/src/generated/themes/DatePicker.css.ts +2 -6
  1120. package/src/generated/themes/DatePickerPopover.css.ts +2 -6
  1121. package/src/generated/themes/Divider.css.ts +2 -6
  1122. package/src/generated/themes/Dropdown.css.ts +2 -6
  1123. package/src/generated/themes/FilterMenu.css.ts +2 -6
  1124. package/src/generated/themes/Footer.css.ts +2 -6
  1125. package/src/generated/themes/HeroBanner.css.ts +2 -6
  1126. package/src/generated/themes/InputGroup.css.ts +2 -6
  1127. package/src/generated/themes/Link.css.ts +2 -6
  1128. package/src/generated/themes/List.css.ts +2 -6
  1129. package/src/generated/themes/ListGroupHeader.css.ts +2 -6
  1130. package/src/generated/themes/ListItem.css.ts +2 -6
  1131. package/src/generated/themes/MastheadCountrySelector.css.ts +2 -6
  1132. package/src/generated/themes/MastheadItem.css.ts +2 -6
  1133. package/src/generated/themes/MastheadMenu.css.ts +2 -6
  1134. package/src/generated/themes/MastheadMenuItem.css.ts +2 -6
  1135. package/src/generated/themes/MastheadMobileMenu.css.ts +2 -6
  1136. package/src/generated/themes/MastheadProfileMenu.css.ts +2 -6
  1137. package/src/generated/themes/MastheadShell.css.ts +2 -6
  1138. package/src/generated/themes/MediaPlayer.css.ts +2 -6
  1139. package/src/generated/themes/MediaPlayerYoutube.css.ts +2 -6
  1140. package/src/generated/themes/MessageStrip.css.ts +2 -6
  1141. package/src/generated/themes/Modal.css.ts +2 -6
  1142. package/src/generated/themes/Pagination.css.ts +2 -6
  1143. package/src/generated/themes/PhoneNumberField.css.ts +2 -6
  1144. package/src/generated/themes/ProgressBar.css.ts +2 -6
  1145. package/src/generated/themes/Quote.css.ts +2 -6
  1146. package/src/generated/themes/RadioButton.css.ts +2 -6
  1147. package/src/generated/themes/RatingBar.css.ts +2 -6
  1148. package/src/generated/themes/RatingIndicator.css.ts +2 -6
  1149. package/src/generated/themes/Review.css.ts +2 -6
  1150. package/src/generated/themes/ReviewItem.css.ts +2 -6
  1151. package/src/generated/themes/Search.css.ts +2 -6
  1152. package/src/generated/themes/SearchSuggestions.css.ts +2 -6
  1153. package/src/generated/themes/SearchableList.css.ts +2 -6
  1154. package/src/generated/themes/SecondaryNavigation.css.ts +2 -6
  1155. package/src/generated/themes/SecondaryNavigationItem.css.ts +2 -6
  1156. package/src/generated/themes/SecondaryNavigationSubItem.css.ts +2 -6
  1157. package/src/generated/themes/SegmentedButton.css.ts +2 -6
  1158. package/src/generated/themes/SegmentedButtonItem.css.ts +2 -6
  1159. package/src/generated/themes/SelectBox.css.ts +2 -6
  1160. package/src/generated/themes/SideNavigation.css.ts +2 -6
  1161. package/src/generated/themes/SideNavigationGroup.css.ts +2 -6
  1162. package/src/generated/themes/SideNavigationItem.css.ts +2 -6
  1163. package/src/generated/themes/SideNavigationMobile.css.ts +2 -6
  1164. package/src/generated/themes/SideNavigationMobileDropdown.css.ts +2 -6
  1165. package/src/generated/themes/SideNavigationSubItem.css.ts +2 -6
  1166. package/src/generated/themes/Slider.css.ts +2 -6
  1167. package/src/generated/themes/StatusBadge.css.ts +2 -6
  1168. package/src/generated/themes/StatusMessage.css.ts +2 -6
  1169. package/src/generated/themes/StepInput.css.ts +2 -6
  1170. package/src/generated/themes/Switch.css.ts +2 -6
  1171. package/src/generated/themes/TabInOverflow.css.ts +2 -6
  1172. package/src/generated/themes/TabNavigation.css.ts +2 -6
  1173. package/src/generated/themes/Table.css.ts +2 -6
  1174. package/src/generated/themes/TableCell.css.ts +2 -6
  1175. package/src/generated/themes/TableCellBase.css.ts +2 -6
  1176. package/src/generated/themes/TableGroupRow.css.ts +2 -6
  1177. package/src/generated/themes/TableHeaderCell.css.ts +2 -6
  1178. package/src/generated/themes/TableRowBase.css.ts +2 -6
  1179. package/src/generated/themes/Tag.css.ts +2 -6
  1180. package/src/generated/themes/TagGroup.css.ts +2 -6
  1181. package/src/generated/themes/TextArea.css.ts +2 -6
  1182. package/src/generated/themes/TextField.css.ts +2 -6
  1183. package/src/generated/themes/Tile.css.ts +2 -6
  1184. package/src/generated/themes/Toast.css.ts +2 -6
  1185. package/src/generated/themes/Tooltip.css.ts +2 -6
  1186. package/src/generated/themes/TruncatedText.css.ts +2 -6
  1187. package/src/generated/themes/Upload.css.ts +2 -6
  1188. package/src/generated/themes/UploadItem.css.ts +2 -6
  1189. package/src/generated/themes/Wizard.css.ts +2 -6
  1190. package/src/generated/themes/WizardTab.css.ts +2 -6
  1191. package/src/generated/themes/overrides/@ui5/webcomponents/sap_glow/parameters-bundle.css.ts +2 -6
  1192. package/src/generated/themes/sap_fiori_3/parameters-bundle.css.ts +1 -5
  1193. package/src/generated/themes/sap_glow/parameters-bundle.css.ts +1 -5
  1194. package/src/generated/themes/sap_horizon/parameters-bundle.css.ts +1 -5
  1195. package/src/i18n/messagebundle.properties +1 -1
  1196. package/src/i18n/messagebundle_en.properties +0 -1
  1197. package/src/themes/AccordionItem.css +1 -0
  1198. package/src/themes/Avatar.css +1 -27
  1199. package/src/themes/Badge.css +40 -50
  1200. package/src/themes/Breadcrumbs.css +3 -1
  1201. package/src/themes/BreadcrumbsPopover.css +9 -29
  1202. package/src/themes/Button.css +22 -11
  1203. package/src/themes/Carousel.css +1 -0
  1204. package/src/themes/Checkbox.css +122 -9
  1205. package/src/themes/ControlButton.css +1 -0
  1206. package/src/themes/DatePicker.css +0 -4
  1207. package/src/themes/Dropdown.css +16 -17
  1208. package/src/themes/Link.css +51 -44
  1209. package/src/themes/ListItem.css +0 -23
  1210. package/src/themes/MessageStrip.css +16 -22
  1211. package/src/themes/Modal.css +18 -13
  1212. package/src/themes/Pagination.css +0 -2
  1213. package/src/themes/PhoneNumberField.css +15 -14
  1214. package/src/themes/ProgressBar.css +77 -3
  1215. package/src/themes/RadioButton.css +139 -15
  1216. package/src/themes/RatingIndicator.css +5 -11
  1217. package/src/themes/Search.css +9 -9
  1218. package/src/themes/SegmentedButton.css +1 -1
  1219. package/src/themes/SegmentedButtonItem.css +35 -25
  1220. package/src/themes/SelectBox.css +2 -2
  1221. package/src/themes/SideNavigation.css +2 -2
  1222. package/src/themes/SideNavigationGroup.css +0 -5
  1223. package/src/themes/SideNavigationItem.css +22 -6
  1224. package/src/themes/SideNavigationMobileDropdown.css +1 -1
  1225. package/src/themes/SideNavigationSubItem.css +3 -3
  1226. package/src/themes/Slider.css +86 -22
  1227. package/src/themes/TagGroup.css +4 -0
  1228. package/src/themes/TextArea.css +15 -15
  1229. package/src/themes/Tile.css +7 -0
  1230. package/src/themes/Toast.css +12 -0
  1231. package/src/themes/Tooltip.css +6 -5
  1232. package/src/themes/WizardTab.css +3 -3
  1233. package/src/types/BadgeDesign.ts +21 -8
  1234. package/src/types/Button.ts +31 -0
  1235. package/src/types/Checkbox.ts +7 -0
  1236. package/src/types/Dropdown.ts +12 -13
  1237. package/src/types/FileUploadState.ts +2 -2
  1238. package/src/types/IconPlacement.ts +2 -2
  1239. package/src/types/List.ts +4 -4
  1240. package/src/types/MessageStrip.ts +2 -2
  1241. package/src/types/ProgressBar.ts +9 -0
  1242. package/src/types/RadioButton.ts +9 -0
  1243. package/src/types/SearchableListBase.ts +3 -3
  1244. package/src/types/Table.ts +2 -2
  1245. package/src/types/common.ts +30 -3
  1246. package/src/utils/debounce.ts +1 -1
  1247. package/src/utils/listItemLabelStartsWithKeyFocus.ts +0 -0
  1248. package/src/utils/listItemLabelUtils.ts +1 -1
  1249. package/src/utils/retryUntilSuccessful.ts +1 -1
  1250. package/tsconfig.json +4 -2
  1251. package/config/wdio.conf.js +0 -27
  1252. package/cypress/screenshots/AccordionItem.cy.tsx/AccordionItem -- can be clicked via keyboard using Space (failed).png +0 -0
  1253. package/dist/assets/SAP-icons-95a98080.js +0 -1
  1254. package/dist/assets/SAP-icons-e24df2c3.js +0 -1
  1255. package/dist/assets/bundle-7a4a3e16.css +0 -1
  1256. package/dist/assets/bundle.esm-fe0b0d94.js +0 -330
  1257. package/dist/assets/messagebundle_en-d1666c5e.js +0 -1
  1258. package/dist/assets/parameters-bundle.css-03062520.js +0 -2
  1259. package/dist/assets/parameters-bundle.css-10c626d5.js +0 -1
  1260. package/dist/assets/parameters-bundle.css-165a1208.js +0 -2
  1261. package/dist/assets/parameters-bundle.css-3c706630.js +0 -2
  1262. package/dist/assets/parameters-bundle.css-3ea1926f.js +0 -2
  1263. package/dist/assets/parameters-bundle.css-47cbf095.js +0 -2
  1264. package/dist/assets/parameters-bundle.css-6bd2a8b6.js +0 -1
  1265. package/dist/assets/parameters-bundle.css-6eda420e.js +0 -2
  1266. package/dist/assets/parameters-bundle.css-7f4cec2b.js +0 -2
  1267. package/dist/assets/parameters-bundle.css-9905f744.js +0 -2
  1268. package/dist/assets/parameters-bundle.css-9e6d1c8d.js +0 -2
  1269. package/dist/assets/parameters-bundle.css-b1ba75bd.js +0 -2
  1270. package/dist/assets/parameters-bundle.css-b6cfd976.js +0 -2
  1271. package/dist/assets/parameters-bundle.css-bb08ca85.js +0 -2
  1272. package/dist/assets/parameters-bundle.css-bd30ac58.js +0 -2
  1273. package/dist/assets/parameters-bundle.css-bda386a0.js +0 -2
  1274. package/dist/assets/parameters-bundle.css-d38a0009.js +0 -2
  1275. package/dist/assets/parameters-bundle.css-e591d3a4.js +0 -2
  1276. package/dist/assets/play-a1304ca2.svg +0 -3
  1277. package/dist/assets/video.es-60bfb78c.js +0 -228
  1278. package/dist/generated/json-imports/Themes-static.js +0 -19
  1279. package/dist/generated/json-imports/Themes-static.js.map +0 -1
  1280. package/dist/generated/json-imports/i18n-static.js +0 -111
  1281. package/dist/generated/json-imports/i18n-static.js.map +0 -1
  1282. package/dist/generated/templates/DropdownTemplate.lit.d.ts +0 -4
  1283. package/dist/generated/templates/DropdownTemplate.lit.js +0 -8
  1284. package/dist/generated/templates/DropdownTemplate.lit.js.map +0 -1
  1285. package/dist/generated/templates/LinkTemplate.lit.d.ts +0 -4
  1286. package/dist/generated/templates/LinkTemplate.lit.js +0 -8
  1287. package/dist/generated/templates/LinkTemplate.lit.js.map +0 -1
  1288. package/dist/generated/templates/MessageStripTemplate.lit.d.ts +0 -4
  1289. package/dist/generated/templates/MessageStripTemplate.lit.js +0 -10
  1290. package/dist/generated/templates/MessageStripTemplate.lit.js.map +0 -1
  1291. package/dist/generated/templates/SideNavigationMobileDropdownTemplate.lit.d.ts +0 -4
  1292. package/dist/generated/templates/SideNavigationMobileDropdownTemplate.lit.js +0 -6
  1293. package/dist/generated/templates/SideNavigationMobileDropdownTemplate.lit.js.map +0 -1
  1294. package/dist/generated/templates/StepInputTemplate.lit.d.ts +0 -4
  1295. package/dist/generated/templates/StepInputTemplate.lit.js +0 -6
  1296. package/dist/generated/templates/StepInputTemplate.lit.js.map +0 -1
  1297. package/dist/generated/templates/WizardTemplate.lit.d.ts +0 -4
  1298. package/dist/generated/templates/WizardTemplate.lit.js +0 -7
  1299. package/dist/generated/templates/WizardTemplate.lit.js.map +0 -1
  1300. package/dist/types/ButtonSize.d.ts +0 -6
  1301. package/dist/types/ButtonSize.js +0 -8
  1302. package/dist/types/ButtonSize.js.map +0 -1
  1303. package/src/Dropdown.hbs +0 -39
  1304. package/src/Link.hbs +0 -30
  1305. package/src/MessageStrip.hbs +0 -33
  1306. package/src/SideNavigationMobileDropdown.hbs +0 -17
  1307. package/src/StepInput.hbs +0 -54
  1308. package/src/Wizard.hbs +0 -54
  1309. package/src/generated/json-imports/Themes-static.ts +0 -22
  1310. package/src/generated/json-imports/i18n-static.ts +0 -115
  1311. package/src/generated/templates/DropdownTemplate.lit.ts +0 -13
  1312. package/src/generated/templates/LinkTemplate.lit.ts +0 -13
  1313. package/src/generated/templates/MessageStripTemplate.lit.ts +0 -15
  1314. package/src/generated/templates/SideNavigationMobileDropdownTemplate.lit.ts +0 -11
  1315. package/src/generated/templates/StepInputTemplate.lit.ts +0 -11
  1316. package/src/generated/templates/WizardTemplate.lit.ts +0 -12
  1317. package/src/types/ButtonSize.ts +0 -7
  1318. /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
  1319. /package/dist/assets/{ar-4a3e3814.js → ar-CTZA5thq.js} +0 -0
  1320. /package/dist/assets/{az-1a5c38dc.js → az-v9sl8ib6.js} +0 -0
  1321. /package/dist/assets/{ba-578f2c35.js → ba-DisscYZm.js} +0 -0
  1322. /package/dist/assets/{bg-23e26fa4.js → bg-hMoIXmwx.js} +0 -0
  1323. /package/dist/assets/{bn-ecf46fc9.js → bn-9WIHzDQT.js} +0 -0
  1324. /package/dist/assets/{ca-792d0c23.js → ca-BdAvEnzO.js} +0 -0
  1325. /package/dist/assets/{cs-6fb6c274.js → cs-BTZOJ7RY.js} +0 -0
  1326. /package/dist/assets/{cy-f6e8dafd.js → cy-CkqsAazR.js} +0 -0
  1327. /package/dist/assets/{da-89990885.js → da-CyYzq03-.js} +0 -0
  1328. /package/dist/assets/{de-32104d6f.js → de-Kxrz3LQu.js} +0 -0
  1329. /package/dist/assets/{el-cfd6e74d.js → el-DtD9tvBZ.js} +0 -0
  1330. /package/dist/assets/{en-111ebeca.js → en-BSDBMYja.js} +0 -0
  1331. /package/dist/assets/{en-GB-d734c02c.js → en-GB-eZDJGL6o.js} +0 -0
  1332. /package/dist/assets/{es-611df0dc.js → es-B2uFHLOM.js} +0 -0
  1333. /package/dist/assets/{et-9ece8307.js → et-BZYU6uC4.js} +0 -0
  1334. /package/dist/assets/{eu-49fabb60.js → eu-4kpIM3qq.js} +0 -0
  1335. /package/dist/assets/{fa-b37ac7ef.js → fa-DE6uNAMy.js} +0 -0
  1336. /package/dist/assets/{fi-7ec80e73.js → fi-hYXoEotT.js} +0 -0
  1337. /package/dist/assets/{fr-ee18d408.js → fr-BiXSRyHq.js} +0 -0
  1338. /package/dist/assets/{gd-b81ebaf0.js → gd-BnHQAAnq.js} +0 -0
  1339. /package/dist/assets/{gl-e4ba9f11.js → gl-eZFVp-ap.js} +0 -0
  1340. /package/dist/assets/{he-3161ae46.js → he-BCby_1s8.js} +0 -0
  1341. /package/dist/assets/{hi-90e040fd.js → hi-CTSA-lZK.js} +0 -0
  1342. /package/dist/assets/{hr-578f2c35.js → hr-DisscYZm.js} +0 -0
  1343. /package/dist/assets/{hu-42b8fcee.js → hu-CtXVLPoZ.js} +0 -0
  1344. /package/dist/assets/{it-b051329d.js → it-CNhkO2LS.js} +0 -0
  1345. /package/dist/assets/{ja-8cc903fb.js → ja-DQLMLaVj.js} +0 -0
  1346. /package/dist/assets/{ko-b85d1cca.js → ko-QXeXKT3c.js} +0 -0
  1347. /package/dist/assets/{lv-7a47d532.js → lv-C7KueJFp.js} +0 -0
  1348. /package/dist/assets/{messagebundle_ar-bb470511.js → messagebundle_ar-9zPDAqTU.js} +0 -0
  1349. /package/dist/assets/{messagebundle_bg-a533dfab.js → messagebundle_bg-DWxB0fCn.js} +0 -0
  1350. /package/dist/assets/{messagebundle_cs-c70a7f36.js → messagebundle_cs-C_ZNAcZs.js} +0 -0
  1351. /package/dist/assets/{messagebundle_da-e292cac5.js → messagebundle_da-CRRThnbQ.js} +0 -0
  1352. /package/dist/assets/{messagebundle_de-5c108de6.js → messagebundle_de-CEztl_Bk.js} +0 -0
  1353. /package/dist/assets/{messagebundle_el-44746e0b.js → messagebundle_el-dli9W3Ld.js} +0 -0
  1354. /package/dist/assets/{messagebundle_es-c0c1060f.js → messagebundle_es-BKJxfGUS.js} +0 -0
  1355. /package/dist/assets/{messagebundle_et-a5f15d3b.js → messagebundle_et-CEgPnb-F.js} +0 -0
  1356. /package/dist/assets/{messagebundle_fi-f4b8eb82.js → messagebundle_fi-CB9L6Ted.js} +0 -0
  1357. /package/dist/assets/{messagebundle_fr-af18ac46.js → messagebundle_fr-DV0xFXy7.js} +0 -0
  1358. /package/dist/assets/{messagebundle_hr-d893e46d.js → messagebundle_hr-CxG6YfU9.js} +0 -0
  1359. /package/dist/assets/{messagebundle_hu-230c58c9.js → messagebundle_hu-BD5GvMh2.js} +0 -0
  1360. /package/dist/assets/{messagebundle_it-5bf1436c.js → messagebundle_it-CcnIcv1Q.js} +0 -0
  1361. /package/dist/assets/{messagebundle_iw-dd60afc4.js → messagebundle_iw-njoSdOP-.js} +0 -0
  1362. /package/dist/assets/{messagebundle_ko-c450bda3.js → messagebundle_ko-BsIdyV2m.js} +0 -0
  1363. /package/dist/assets/{messagebundle_lt-87ab0529.js → messagebundle_lt-Cx5dKaVi.js} +0 -0
  1364. /package/dist/assets/{messagebundle_lv-fc413852.js → messagebundle_lv-CjYkt6X6.js} +0 -0
  1365. /package/dist/assets/{messagebundle_nl-34d7e236.js → messagebundle_nl-BxcksDMG.js} +0 -0
  1366. /package/dist/assets/{messagebundle_no-f22648fb.js → messagebundle_no-6rWbHkD4.js} +0 -0
  1367. /package/dist/assets/{messagebundle_pl-10303f09.js → messagebundle_pl-CdoiDA_-.js} +0 -0
  1368. /package/dist/assets/{messagebundle_pt-b7a40c67.js → messagebundle_pt-DtbX15Ym.js} +0 -0
  1369. /package/dist/assets/{messagebundle_ro-94628623.js → messagebundle_ro-C5ojQbzO.js} +0 -0
  1370. /package/dist/assets/{messagebundle_ru-1f6595ba.js → messagebundle_ru-BcLhFIo9.js} +0 -0
  1371. /package/dist/assets/{messagebundle_sk-89eabac1.js → messagebundle_sk-B4D9Y2b-.js} +0 -0
  1372. /package/dist/assets/{messagebundle_sl-d56532f1.js → messagebundle_sl-D43o0FSO.js} +0 -0
  1373. /package/dist/assets/{messagebundle_sr-cf7f3b32.js → messagebundle_sr-Co2xNpod.js} +0 -0
  1374. /package/dist/assets/{messagebundle_sv-3a3b20d3.js → messagebundle_sv-4hT4lgLu.js} +0 -0
  1375. /package/dist/assets/{messagebundle_tr-33b16d09.js → messagebundle_tr-DxFj6Icf.js} +0 -0
  1376. /package/dist/assets/{messagebundle_uk-82e1f2c1.js → messagebundle_uk-Sdu5cmOP.js} +0 -0
  1377. /package/dist/assets/{messagebundle_zh_CN-15ca05aa.js → messagebundle_zh_CN-CuN02AOJ.js} +0 -0
  1378. /package/dist/assets/{messagebundle_zh_TW-ad6445e7.js → messagebundle_zh_TW-CRXaxYip.js} +0 -0
  1379. /package/dist/assets/{mr-9563c6ee.js → mr-Bh6aKPLD.js} +0 -0
  1380. /package/dist/assets/{nb-367efd73.js → nb-2X2Lg6iq.js} +0 -0
  1381. /package/dist/assets/{nl-7501cf03.js → nl-CeYDhQxA.js} +0 -0
  1382. /package/dist/assets/{nn-7a32f39e.js → nn-B0E7C1S9.js} +0 -0
  1383. /package/dist/assets/{np-2442ddf5.js → np-CiDCnKgc.js} +0 -0
  1384. /package/dist/assets/{oc-892205fc.js → oc-BWAm6rBf.js} +0 -0
  1385. /package/dist/assets/{pl-c9e6f97c.js → pl-Cp7zgo_d.js} +0 -0
  1386. /package/dist/assets/{pt-BR-0cdaa4c2.js → pt-BR-Bc7Ikyiv.js} +0 -0
  1387. /package/dist/assets/{pt-PT-3b56b10d.js → pt-PT-BvieYtCa.js} +0 -0
  1388. /package/dist/assets/{ro-27af0bfa.js → ro-C9fEZsPq.js} +0 -0
  1389. /package/dist/assets/{ru-7991b04b.js → ru-CvIUT83o.js} +0 -0
  1390. /package/dist/assets/{sk-c31445bf.js → sk-DmH_P1yQ.js} +0 -0
  1391. /package/dist/assets/{sl-44a6af7b.js → sl-B6qRualr.js} +0 -0
  1392. /package/dist/assets/{sr-ec351a65.js → sr-Czh2gIc8.js} +0 -0
  1393. /package/dist/assets/{sv-1176d505.js → sv-DI2thI3C.js} +0 -0
  1394. /package/dist/assets/{te-78496f2d.js → te-BAfQUXMK.js} +0 -0
  1395. /package/dist/assets/{th-357add84.js → th-DKW3w-LY.js} +0 -0
  1396. /package/dist/assets/{tr-e9ba09b2.js → tr-D2131HpF.js} +0 -0
  1397. /package/dist/assets/{uk-82e5b14a.js → uk-Bg3gZBVy.js} +0 -0
  1398. /package/dist/assets/{vi-8fa3e4db.js → vi-B6k4Eer1.js} +0 -0
  1399. /package/dist/assets/{zh-CN-56d8e9a8.js → zh-CN-B_WgppuI.js} +0 -0
  1400. /package/dist/assets/{zh-Hans-7eba8277.js → zh-Hans-BEUw6d5l.js} +0 -0
  1401. /package/dist/assets/{zh-Hant-c17e8907.js → zh-Hant-BMM21JpX.js} +0 -0
  1402. /package/dist/assets/{zh-TW-52a9fefa.js → zh-TW-vJ8rSmFo.js} +0 -0
  1403. /package/dist/generated/json-imports/{Themes-static.d.ts → Themes-fetch.d.ts} +0 -0
  1404. /package/dist/generated/json-imports/{i18n-static.d.ts → i18n-fetch.d.ts} +0 -0
  1405. /package/dist/{i18n/messagebundle_ar.properties → messagebundle_ar.properties} +0 -0
  1406. /package/dist/{i18n/messagebundle_bg.properties → messagebundle_bg.properties} +0 -0
  1407. /package/dist/{i18n/messagebundle_cs.properties → messagebundle_cs.properties} +0 -0
  1408. /package/dist/{i18n/messagebundle_da.properties → messagebundle_da.properties} +0 -0
  1409. /package/dist/{i18n/messagebundle_de.properties → messagebundle_de.properties} +0 -0
  1410. /package/dist/{i18n/messagebundle_el.properties → messagebundle_el.properties} +0 -0
  1411. /package/dist/{i18n/messagebundle_es.properties → messagebundle_es.properties} +0 -0
  1412. /package/dist/{i18n/messagebundle_et.properties → messagebundle_et.properties} +0 -0
  1413. /package/dist/{i18n/messagebundle_fi.properties → messagebundle_fi.properties} +0 -0
  1414. /package/dist/{i18n/messagebundle_fr.properties → messagebundle_fr.properties} +0 -0
  1415. /package/dist/{i18n/messagebundle_hr.properties → messagebundle_hr.properties} +0 -0
  1416. /package/dist/{i18n/messagebundle_hu.properties → messagebundle_hu.properties} +0 -0
  1417. /package/dist/{i18n/messagebundle_it.properties → messagebundle_it.properties} +0 -0
  1418. /package/dist/{i18n/messagebundle_iw.properties → messagebundle_iw.properties} +0 -0
  1419. /package/dist/{i18n/messagebundle_ko.properties → messagebundle_ko.properties} +0 -0
  1420. /package/dist/{i18n/messagebundle_lt.properties → messagebundle_lt.properties} +0 -0
  1421. /package/dist/{i18n/messagebundle_lv.properties → messagebundle_lv.properties} +0 -0
  1422. /package/dist/{i18n/messagebundle_nl.properties → messagebundle_nl.properties} +0 -0
  1423. /package/dist/{i18n/messagebundle_no.properties → messagebundle_no.properties} +0 -0
  1424. /package/dist/{i18n/messagebundle_pl.properties → messagebundle_pl.properties} +0 -0
  1425. /package/dist/{i18n/messagebundle_pt.properties → messagebundle_pt.properties} +0 -0
  1426. /package/dist/{i18n/messagebundle_pt_BR.properties → messagebundle_pt_BR.properties} +0 -0
  1427. /package/dist/{i18n/messagebundle_ro.properties → messagebundle_ro.properties} +0 -0
  1428. /package/dist/{i18n/messagebundle_ru.properties → messagebundle_ru.properties} +0 -0
  1429. /package/dist/{i18n/messagebundle_sk.properties → messagebundle_sk.properties} +0 -0
  1430. /package/dist/{i18n/messagebundle_sl.properties → messagebundle_sl.properties} +0 -0
  1431. /package/dist/{i18n/messagebundle_sr.properties → messagebundle_sr.properties} +0 -0
  1432. /package/dist/{i18n/messagebundle_sv.properties → messagebundle_sv.properties} +0 -0
  1433. /package/dist/{i18n/messagebundle_tr.properties → messagebundle_tr.properties} +0 -0
  1434. /package/dist/{i18n/messagebundle_uk.properties → messagebundle_uk.properties} +0 -0
  1435. /package/dist/{i18n/messagebundle_zh_CN.properties → messagebundle_zh_CN.properties} +0 -0
  1436. /package/dist/{i18n/messagebundle_zh_TW.properties → messagebundle_zh_TW.properties} +0 -0
@@ -1,228 +0,0 @@
1
- var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Xg(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var qs;typeof window<"u"?qs=window:typeof sn<"u"?qs=sn:typeof self<"u"?qs=self:qs={};var In=qs;const S=os(In),Kg={},Yg=Object.freeze(Object.defineProperty({__proto__:null,default:Kg},Symbol.toStringTag,{value:"Module"})),Qg=Xg(Yg);var bl=typeof sn<"u"?sn:typeof window<"u"?window:{},Jg=Qg,js;typeof document<"u"?js=document:(js=bl["__GLOBAL_DOCUMENT_CACHE@4"],js||(js=bl["__GLOBAL_DOCUMENT_CACHE@4"]=Jg));var Zc=js;const q=os(Zc);var Co={exports:{}},eh={exports:{}};(function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(this,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(eh);var Zg=eh.exports,e0=i0,t0=Object.prototype.toString;function i0(i){if(!i)return!1;var e=t0.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function s0(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=r0(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0;return function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r0(i,e){if(i){if(typeof i=="string")return xl(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xl(i,e)}}function xl(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var n0=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(s,r){this.typeToInterceptorsMap_.has(s)||this.typeToInterceptorsMap_.set(s,new Set);var n=this.typeToInterceptorsMap_.get(s);return n.has(r)?!1:(n.add(r),!0)},e.removeInterceptor=function(s,r){var n=this.typeToInterceptorsMap_.get(s);return n&&n.has(r)?(n.delete(r),!0):!1},e.clearInterceptorsByType=function(s){var r=this.typeToInterceptorsMap_.get(s);return r?(this.typeToInterceptorsMap_.delete(s),this.typeToInterceptorsMap_.set(s,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(s){return this.typeToInterceptorsMap_.get(s)||new Set},e.execute=function(s,r){for(var n=this.getForType(s),a=s0(n),u;!(u=a()).done;){var h=u.value;try{r=h(r)}catch{}}return r},i}(),a0=n0,o0=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(s){this.maxAttempts_=s},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(s){this.delayFactor_=s},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(s){this.fuzzFactor_=s},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(s){this.initialDelay_=s},e.createRetry=function(s){var r=s===void 0?{}:s,n=r.maxAttempts,a=r.delayFactor,u=r.fuzzFactor,h=r.initialDelay;return new u0({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:h||this.initialDelay_})},i}(),u0=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),r=this.getCurrentMaxPossibleDelay();return s+Math.random()*(r-s)},i}(),l0=o0,c0=In,h0=function(e,t){return t===void 0&&(t=!1),function(s,r,n){if(s){e(s);return}if(r.statusCode>=400&&r.statusCode<=599){var a=n;if(t)if(c0.TextDecoder){var u=d0(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(u).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function d0(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var f0=h0,th=In,p0=Zg,m0=e0,ih=a0,g0=l0;be.httpHandler=f0;be.requestInterceptorsStorage=new ih;be.responseInterceptorsStorage=new ih;be.retryManager=new g0;/**
3
- * @license
4
- * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
5
- * Copyright (c) 2014 David Björklund
6
- * Available under the MIT license
7
- * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
8
- */var _0=function(e){var t={};return e&&e.trim().split(`
9
- `).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Co.exports=be;Co.exports.default=be;be.XMLHttpRequest=th.XMLHttpRequest||b0;be.XDomainRequest="withCredentials"in new be.XMLHttpRequest?be.XMLHttpRequest:th.XDomainRequest;y0(["get","put","post","patch","head","delete"],function(i){be[i==="delete"?"del":i]=function(e,t,s){return t=sh(e,t,s),t.method=i.toUpperCase(),Ao(t)}});function y0(i,e){for(var t=0;t<i.length;t++)e(i[t])}function T0(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function sh(i,e,t){var s=i;return m0(e)?(t=e,typeof i=="string"&&(s={uri:i})):s=p0({},e,{uri:i}),s.callback=t,s}function be(i,e,t){return e=sh(i,e,t),Ao(e)}function Ao(i){if(typeof i.callback>"u")throw new Error("callback argument missing");if(i.requestType&&be.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=be.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(N,U,B){s||(s=!0,i.callback(N,U,B))};function n(){f.readyState===4&&!be.responseInterceptorsStorage.getIsEnabled()&&setTimeout(h,0)}function a(){var L=void 0;if(f.response?L=f.response:L=f.responseText||v0(f),D)try{L=JSON.parse(L)}catch{}return L}function u(L){if(clearTimeout(P),clearTimeout(i.retryTimeout),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,!_&&be.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=f,Ao(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&be.responseInterceptorsStorage.getIsEnabled()){var N={headers:k.headers||{},body:k.body,responseUrl:f.responseURL,responseType:f.responseType},U=be.responseInterceptorsStorage.execute(i.requestType,N);k.body=U.body,k.headers=U.headers}return r(L,k)}function h(){if(!_){var L;clearTimeout(P),clearTimeout(i.retryTimeout),i.useXDR&&f.status===void 0?L=200:L=f.status===1223?204:f.status;var N=k,U=null;if(L!==0?(N={body:a(),statusCode:L,method:C,headers:{},url:b,rawRequest:f},f.getAllResponseHeaders&&(N.headers=_0(f.getAllResponseHeaders()))):U=new Error("Internal XMLHttpRequest Error"),i.requestType&&be.responseInterceptorsStorage.getIsEnabled()){var B={headers:N.headers||{},body:N.body,responseUrl:f.responseURL,responseType:f.responseType},$=be.responseInterceptorsStorage.execute(i.requestType,B);N.body=$.body,N.headers=$.headers}return r(U,N,N.body)}}var f=i.xhr||null;f||(i.cors||i.useXDR?f=new be.XDomainRequest:f=new be.XMLHttpRequest);var g,_,b=f.url=i.uri||i.url,C=f.method=i.method||"GET",A=i.body||i.data,y=f.headers=i.headers||{},I=!!i.sync,D=!1,P,k={body:void 0,headers:{},statusCode:0,method:C,url:b,rawRequest:f};if("json"in i&&i.json!==!1&&(D=!0,y.accept||y.Accept||(y.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),A=JSON.stringify(i.json===!0?A:i.json))),f.onreadystatechange=n,f.onload=h,f.onerror=u,f.onprogress=function(){},f.onabort=function(){_=!0,clearTimeout(i.retryTimeout)},f.ontimeout=u,f.open(C,b,!I,i.username,i.password),I||(f.withCredentials=!!i.withCredentials),!I&&i.timeout>0&&(P=setTimeout(function(){if(!_){_=!0,f.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",u(L)}},i.timeout)),f.setRequestHeader)for(g in y)y.hasOwnProperty(g)&&f.setRequestHeader(g,y[g]);else if(i.headers&&!T0(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(f.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(f),f.send(A||null),f}function v0(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function b0(){}var x0=Co.exports;const rh=os(x0);var nh={exports:{}},Sl=Zc,Do=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function et(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}et.prototype=Do(Error.prototype);et.prototype.constructor=et;et.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function wo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Ws(){this.values=Do(null)}Ws.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s<t.length;++s)if(e===t[s]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){return e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function Vs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var u=a[0].trim(),h=a[1].trim();e(u,h)}}}function S0(i,e,t){var s=i;function r(){var u=wo(i);if(u===null)throw new et(et.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),u}function n(u,h){var f=new Ws;Vs(u,function(g,_){switch(g){case"region":for(var b=t.length-1;b>=0;b--)if(t[b].id===_){f.set(g,t[b].region);break}break;case"vertical":f.alt(g,_,["rl","lr"]);break;case"line":var C=_.split(","),A=C[0];f.integer(g,A),f.percent(g,A)&&f.set("snapToLines",!1),f.alt(g,A,["auto"]),C.length===2&&f.alt("lineAlign",C[1],["start","center","end"]);break;case"position":C=_.split(","),f.percent(g,C[0]),C.length===2&&f.alt("positionAlign",C[1],["start","center","end"]);break;case"size":f.percent(g,_);break;case"align":f.alt(g,_,["start","center","end","left","right"]);break}},/:/,/\s/),h.region=f.get("region",null),h.vertical=f.get("vertical","");try{h.line=f.get("line","auto")}catch{}h.lineAlign=f.get("lineAlign","start"),h.snapToLines=f.get("snapToLines",!0),h.size=f.get("size",100);try{h.align=f.get("align","center")}catch{h.align=f.get("align","middle")}try{h.position=f.get("position","auto")}catch{h.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},h.align)}h.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},h.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new et(et.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Da=Sl.createElement&&Sl.createElement("textarea"),E0={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},El={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},C0={v:"title",lang:"lang"},Cl={rt:"ruby"};function ah(i,e){function t(){if(!e)return null;function A(I){return e=e.substr(I.length),I}var y=e.match(/^([^<]*)(<[^>]*>?)?/);return A(y[1]?y[1]:y[2])}function s(A){return Da.innerHTML=A,A=Da.textContent,Da.textContent="",A}function r(A,y){return!Cl[y.localName]||Cl[y.localName]===A.localName}function n(A,y){var I=E0[A];if(!I)return null;var D=i.document.createElement(I),P=C0[A];return P&&y&&(D[P]=y.trim()),D}for(var a=i.document.createElement("div"),u=a,h,f=[];(h=t())!==null;){if(h[0]==="<"){if(h[1]==="/"){f.length&&f[f.length-1]===h.substr(2).replace(">","")&&(f.pop(),u=u.parentNode);continue}var g=wo(h.substr(1,h.length-2)),_;if(g){_=i.document.createProcessingInstruction("timestamp",g),u.appendChild(_);continue}var b=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!b||(_=n(b[1],b[3]),!_)||!r(u,_))continue;if(b[2]){var C=b[2].split(".");C.forEach(function(A){var y=/^bg_/.test(A),I=y?A.slice(3):A;if(El.hasOwnProperty(I)){var D=y?"background-color":"color",P=El[I];_.style[D]=P}}),_.className=C.join(" ")}f.push(b[1]),u.appendChild(_),u=_;continue}u.appendChild(i.document.createTextNode(s(h)))}return a}var Al=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function A0(i){for(var e=0;e<Al.length;e++){var t=Al[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function D0(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(u,h){for(var f=h.childNodes.length-1;f>=0;f--)u.push(h.childNodes[f])}function n(u){if(!u||!u.length)return null;var h=u.pop(),f=h.textContent||h.innerText;if(f){var g=f.match(/^.*(\n|\r)/);return g?(u.length=0,g[0]):f}if(h.tagName==="ruby")return n(u);if(h.childNodes)return r(u,h),n(u)}for(r(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(s=t.charCodeAt(a),A0(s))return"rtl";return"ltr"}function w0(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;r<t.length&&t[r]!==e;r++)t[r].mode==="showing"&&s++;return++s*-1}function kn(){}kn.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};kn.prototype.formatStyle=function(i,e){return i===0?0:i+e};function rn(i,e,t){kn.call(this),this.cue=e,this.cueDiv=ah(i,e.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv),this.div=i.document.createElement("div"),s={direction:D0(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":case"line-left":r=e.position;break;case"center":r=e.position-e.size/2;break;case"end":case"line-right":r=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}rn.prototype=Do(kn.prototype);rn.prototype.constructor=rn;function qe(i){var e,t,s,r;if(i.div){t=i.div.offsetHeight,s=i.div.offsetWidth,r=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||r,this.height=i.height||t,this.bottom=i.bottom||r+(i.height||t),this.width=i.width||s,this.lineHeight=e!==void 0?e:i.lineHeight}qe.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};qe.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};qe.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};qe.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};qe.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};qe.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};qe.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};qe.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function I0(i,e,t,s){function r(I,D){for(var P,k=new qe(I),L=1,N=0;N<D.length;N++){for(;I.overlapsOppositeAxis(t,D[N])||I.within(t)&&I.overlapsAny(s);)I.move(D[N]);if(I.within(t))return I;var U=I.intersectPercentage(t);L>U&&(P=new qe(I),L=U),I=new qe(k)}return P||k}var n=new qe(e),a=e.cue,u=w0(a),h=[];if(a.snapToLines){var f;switch(a.vertical){case"":h=["+y","-y"],f="height";break;case"rl":h=["+x","-x"],f="width";break;case"lr":h=["-x","+x"],f="width";break}var g=n.lineHeight,_=g*Math.round(u),b=t[f]+g,C=h[0];Math.abs(_)>b&&(_=_<0?-1:1,_*=Math.ceil(b/g)*g),u<0&&(_+=a.vertical===""?t.height:t.width,h=h.reverse()),n.move(C,_)}else{var A=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":u-=A/2;break;case"end":u-=A;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(u,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(u,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(u,"%")});break}h=["+y","-x","+x","-y"],n=new qe(e)}var y=r(n,h);e.move(y.toCSSCompatValues(t))}function us(){}us.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};us.convertCueToDOMTree=function(i,e){return!i||!e?null:ah(i,e)};var k0=.05,P0="sans-serif",O0="1.5%";us.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=O0,t.appendChild(s);function r(g){for(var _=0;_<g.length;_++)if(g[_].hasBeenReset||!g[_].displayState)return!0;return!1}if(!r(e)){for(var n=0;n<e.length;n++)s.appendChild(e[n].displayState);return}var a=[],u=qe.getSimpleBoxPosition(s),h=Math.round(u.height*k0*100)/100,f={font:h+"px "+P0};(function(){for(var g,_,b=0;b<e.length;b++)_=e[b],g=new rn(i,_,f),s.appendChild(g.div),I0(i,g,u,a),_.displayState=g.div,a.push(qe.getSimpleBoxPosition(g))})()};us.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};us.Parser.prototype={reportOrThrowError:function(i){if(i instanceof et)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var g=e.buffer,_=0;_<g.length&&g[_]!=="\r"&&g[_]!==`
10
- `;)++_;var b=g.substr(0,_);return g[_]==="\r"&&++_,g[_]===`
11
- `&&++_,e.buffer=g.substr(_),b}function s(g){var _=new Ws;if(Vs(g,function(C,A){switch(C){case"id":_.set(C,A);break;case"width":_.percent(C,A);break;case"lines":_.integer(C,A);break;case"regionanchor":case"viewportanchor":var y=A.split(",");if(y.length!==2)break;var I=new Ws;if(I.percent("x",y[0]),I.percent("y",y[1]),!I.has("x")||!I.has("y"))break;_.set(C+"X",I.get("x")),_.set(C+"Y",I.get("y"));break;case"scroll":_.alt(C,A,["up"]);break}},/=/,/\s/),_.has("id")){var b=new(e.vttjs.VTTRegion||e.window.VTTRegion);b.width=_.get("width",100),b.lines=_.get("lines",3),b.regionAnchorX=_.get("regionanchorX",0),b.regionAnchorY=_.get("regionanchorY",100),b.viewportAnchorX=_.get("viewportanchorX",0),b.viewportAnchorY=_.get("viewportanchorY",100),b.scroll=_.get("scroll",""),e.onregion&&e.onregion(b),e.regionList.push({id:_.get("id"),region:b})}}function r(g){var _=new Ws;Vs(g,function(b,C){switch(b){case"MPEGT":_.integer(b+"S",C);break;case"LOCA":_.set(b+"L",wo(C));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:_.get("MPEGTS"),LOCAL:_.get("LOCAL")})}function n(g){g.match(/X-TIMESTAMP-MAP/)?Vs(g,function(_,b){switch(_){case"X-TIMESTAMP-MAP":r(b);break}},/=/):Vs(g,function(_,b){switch(_){case"Region":s(b);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var u=a.match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new et(et.Errors.BadSignature);e.state="HEADER"}for(var h=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(h?h=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch{e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{S0(a,e.cue,e.regionList)}catch(g){e.reportOrThrowError(g),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(h=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=`
12
- `),e.cue.text+=a.replace(/\u2028/g,`
13
- `).replace(/u2029/g,`
14
- `);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(g){e.reportOrThrowError(g),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=`
15
-
16
- `,i.parse()),i.state==="INITIAL")throw new et(et.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var L0=us,R0="auto",N0={"":1,lr:1,rl:1},M0={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function B0(i){if(typeof i!="string")return!1;var e=N0[i.toLowerCase()];return e?i.toLowerCase():!1}function wa(i){if(typeof i!="string")return!1;var e=M0[i.toLowerCase()];return e?i.toLowerCase():!1}function oh(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,u=t,h=null,f="",g=!0,_="auto",b="start",C="auto",A="auto",y=100,I="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(D){s=""+D}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(D){r=!!D}},startTime:{enumerable:!0,get:function(){return n},set:function(D){if(typeof D!="number")throw new TypeError("Start time must be set to a number.");n=D,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number")throw new TypeError("End time must be set to a number.");a=D,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(D){u=""+D,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(D){h=D,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(D){var P=B0(D);if(P===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=P,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return g},set:function(D){g=!!D,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return _},set:function(D){if(typeof D!="number"&&D!==R0)throw new SyntaxError("Line: an invalid number or illegal string was specified.");_=D,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return b},set:function(D){var P=wa(D);P?(b=P,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return C},set:function(D){if(D<0||D>100)throw new Error("Position must be between 0 and 100.");C=D,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return A},set:function(D){var P=wa(D);P?(A=P,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(D){if(D<0||D>100)throw new Error("Size must be between 0 and 100.");y=D,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return I},set:function(D){var P=wa(D);if(!P)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");I=P,this.hasBeenReset=!0}}}),this.displayState=void 0}oh.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var F0=oh,U0={"":!0,up:!0};function $0(i){if(typeof i!="string")return!1;var e=U0[i.toLowerCase()];return e?i.toLowerCase():!1}function Rs(i){return typeof i=="number"&&i>=0&&i<=100}function q0(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(u){if(!Rs(u))throw new Error("Width must be between 0 and 100.");i=u}},lines:{enumerable:!0,get:function(){return e},set:function(u){if(typeof u!="number")throw new TypeError("Lines must be set to a number.");e=u}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(u){if(!Rs(u))throw new Error("RegionAnchorX must be between 0 and 100.");s=u}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(u){if(!Rs(u))throw new Error("RegionAnchorY must be between 0 and 100.");t=u}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(u){if(!Rs(u))throw new Error("ViewportAnchorY must be between 0 and 100.");n=u}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(u){if(!Rs(u))throw new Error("ViewportAnchorX must be between 0 and 100.");r=u}},scroll:{enumerable:!0,get:function(){return a},set:function(u){var h=$0(u);h===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=h}}})}var j0=q0,Mt=In,xi=nh.exports={WebVTT:L0,VTTCue:F0,VTTRegion:j0};Mt.vttjs=xi;Mt.WebVTT=xi.WebVTT;var V0=xi.VTTCue,H0=xi.VTTRegion,z0=Mt.VTTCue,G0=Mt.VTTRegion;xi.shim=function(){Mt.VTTCue=V0,Mt.VTTRegion=H0};xi.restore=function(){Mt.VTTCue=z0,Mt.VTTRegion=G0};Mt.VTTCue||xi.shim();var W0=nh.exports;const Dl=os(W0);function ke(){return ke=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},ke.apply(this,arguments)}var wl="https://example.com",X0=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=S.location&&S.location.href||"");var s=/^\/\//.test(e),r=!S.location&&!/\/\//i.test(e);e=new S.URL(e,S.location||wl);var n=new URL(t,e);return r?n.href.slice(wl.length):s?n.href.slice(n.protocol.length):n.href},Io=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var u=Array.prototype.slice.call(arguments,1),h=r.length,f=0;f<h;++f)r[f].apply(this,u)},e.dispose=function(){this.listeners={}},e.pipe=function(s){this.on("data",function(r){s.push(r)})},i}();function Fi(){return Fi=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Fi.apply(this,arguments)}var K0=function(e){return S.atob?S.atob(e):Buffer.from(e,"base64").toString("binary")};function Y0(i){for(var e=K0(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class Q0 extends Io{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
17
- `);t>-1;t=this.buffer.indexOf(`
18
- `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const J0=String.fromCharCode(9),Ia=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Z0=function(){const i="[^=]*",e='"[^"]*"|[^,]*',t="(?:"+i+")=(?:"+e+")";return new RegExp("(?:^|,)("+t+")")},Fe=function(i){const e={};if(!i)return e;const t=i.split(Z0());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},Il=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class e_ extends Io{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const u=a(e);return u===e?n:n.concat([u])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){s={type:"tag",tagType:"inf"},t[1]&&(s.duration=parseFloat(t[1])),t[2]&&(s.title=t[2]),this.trigger("data",s);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"targetduration"},t[1]&&(s.duration=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"version"},t[1]&&(s.version=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"media-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){s={type:"tag",tagType:"playlist-type"},t[1]&&(s.playlistType=t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){s=Fi(Ia(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",s);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){s={type:"tag",tagType:"allow-cache"},t[1]&&(s.allowed=!/NO/.test(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(s={type:"tag",tagType:"map"},t[1]){const a=Fe(t[1]);a.URI&&(s.uri=a.URI),a.BYTERANGE&&(s.byterange=Ia(a.BYTERANGE))}this.trigger("data",s);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"stream-inf"},t[1]&&(s.attributes=Fe(t[1]),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=Il(s.attributes.RESOLUTION)),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),s.attributes["PROGRAM-ID"]&&(s.attributes["PROGRAM-ID"]=parseInt(s.attributes["PROGRAM-ID"],10))),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){s={type:"tag",tagType:"media"},t[1]&&(s.attributes=Fe(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){s={type:"tag",tagType:"program-date-time"},t[1]&&(s.dateTimeString=t[1],s.dateTimeObject=new Date(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){s={type:"tag",tagType:"key"},t[1]&&(s.attributes=Fe(t[1]),s.attributes.IV&&(s.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(s.attributes.IV=s.attributes.IV.substring(2)),s.attributes.IV=s.attributes.IV.match(/.{8}/g),s.attributes.IV[0]=parseInt(s.attributes.IV[0],16),s.attributes.IV[1]=parseInt(s.attributes.IV[1],16),s.attributes.IV[2]=parseInt(s.attributes.IV[2],16),s.attributes.IV[3]=parseInt(s.attributes.IV[3],16),s.attributes.IV=new Uint32Array(s.attributes.IV))),this.trigger("data",s);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){s={type:"tag",tagType:"start"},t[1]&&(s.attributes=Fe(t[1]),s.attributes["TIME-OFFSET"]=parseFloat(s.attributes["TIME-OFFSET"]),s.attributes.PRECISE=/YES/.test(s.attributes.PRECISE)),this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out-cont"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-in"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"skip"},s.attributes=Fe(t[1]),s.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(s.attributes["SKIPPED-SEGMENTS"]=parseInt(s.attributes["SKIPPED-SEGMENTS"],10)),s.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(s.attributes["RECENTLY-REMOVED-DATERANGES"]=s.attributes["RECENTLY-REMOVED-DATERANGES"].split(J0)),this.trigger("data",s);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part"},s.attributes=Fe(t[1]),["DURATION"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),s.attributes.hasOwnProperty("BYTERANGE")&&(s.attributes.byterange=Ia(s.attributes.BYTERANGE)),this.trigger("data",s);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"server-control"},s.attributes=Fe(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part-inf"},s.attributes=Fe(t[1]),["PART-TARGET"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"preload-hint"},s.attributes=Fe(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(s.attributes.hasOwnProperty(a)){s.attributes[a]=parseInt(s.attributes[a],10);const u=a==="BYTERANGE-LENGTH"?"length":"offset";s.attributes.byterange=s.attributes.byterange||{},s.attributes.byterange[u]=s.attributes[a],delete s.attributes[a]}}),this.trigger("data",s);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"rendition-report"},s.attributes=Fe(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseInt(s.attributes[a],10))}),this.trigger("data",s);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"daterange"},s.attributes=Fe(t[1]),["ID","CLASS"].forEach(function(u){s.attributes.hasOwnProperty(u)&&(s.attributes[u]=String(s.attributes[u]))}),["START-DATE","END-DATE"].forEach(function(u){s.attributes.hasOwnProperty(u)&&(s.attributes[u]=new Date(s.attributes[u]))}),["DURATION","PLANNED-DURATION"].forEach(function(u){s.attributes.hasOwnProperty(u)&&(s.attributes[u]=parseFloat(s.attributes[u]))}),["END-ON-NEXT"].forEach(function(u){s.attributes.hasOwnProperty(u)&&(s.attributes[u]=/YES/i.test(s.attributes[u]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(u){s.attributes.hasOwnProperty(u)&&(s.attributes[u]=s.attributes[u].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const u in s.attributes){if(!a.test(u))continue;const h=/[0-9A-Fa-f]{6}/g.test(s.attributes[u]),f=/^\d+(\.\d+)?$/.test(s.attributes[u]);s.attributes[u]=h?s.attributes[u].toString(16):f?parseFloat(s.attributes[u]):String(s.attributes[u])}this.trigger("data",s);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){s={type:"tag",tagType:"content-steering"},s.attributes=Fe(t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"i-frame-playlist"},s.attributes=Fe(t[1]),s.attributes.URI&&(s.uri=s.attributes.URI),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=Il(s.attributes.RESOLUTION)),s.attributes["AVERAGE-BANDWIDTH"]&&(s.attributes["AVERAGE-BANDWIDTH"]=parseInt(s.attributes["AVERAGE-BANDWIDTH"],10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),this.trigger("data",s);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){s={type:"tag",tagType:"define"},s.attributes=Fe(t[1]),this.trigger("data",s);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:s,segment:r}){typeof s!="function"&&(s=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const t_=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Gt=function(i){const e={};return Object.keys(i).forEach(function(t){e[t_(t)]=i[t]}),e},ka=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",u=t&&t*3,h=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=u,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[n]<u&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${u})`}),e[n]=u),s&&!e.hasOwnProperty(a)&&(e[a]=s*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),s&&e[a]<h&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${h}).`}),e[a]=h)};class i_ extends Io{constructor(e={}){super(),this.lineStream=new Q0,this.parseStream=new e_,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,s=[];let r={},n,a,u=!1;const h=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},g="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let _=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let b=0,C=0;const A={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof _=="number"&&(r.timeline=_),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(y){let I,D;if(t.manifest.definitions){for(const P in t.manifest.definitions)if(y.uri&&(y.uri=y.uri.replace(`{$${P}}`,t.manifest.definitions[P])),y.attributes)for(const k in y.attributes)typeof y.attributes[k]=="string"&&(y.attributes[k]=y.attributes[k].replace(`{$${P}}`,t.manifest.definitions[P]))}({tag(){({version(){y.version&&(this.manifest.version=y.version)},"allow-cache"(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const P={};"length"in y&&(r.byterange=P,P.length=y.length,"offset"in y||(y.offset=b)),"offset"in y&&(r.byterange=P,P.offset=y.offset),b=P.offset+P.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"})),y.title&&(r.title=y.title),y.duration>0&&(r.duration=y.duration),y.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!y.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(y.attributes.METHOD==="NONE"){a=null;return}if(!y.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes};return}if(y.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI};return}if(y.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(y.attributes.KEYID&&y.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:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:Y0(y.attributes.URI.split(",")[1])};return}y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},typeof y.attributes.IV<"u"&&(a.iv=y.attributes.IV)},"media-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number});return}this.manifest.mediaSequence=y.number},"discontinuity-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number});return}this.manifest.discontinuitySequence=y.number,_=y.number},"playlist-type"(){if(!/VOD|EVENT/.test(y.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist});return}this.manifest.playlistType=y.playlistType},map(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!y.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Fi(r.attributes,y.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const P=this.manifest.mediaGroups[y.attributes.TYPE];P[y.attributes["GROUP-ID"]]=P[y.attributes["GROUP-ID"]]||{},I=P[y.attributes["GROUP-ID"]],D={default:/yes/i.test(y.attributes.DEFAULT)},D.default?D.autoselect=!0:D.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(D.language=y.attributes.LANGUAGE),y.attributes.URI&&(D.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(D.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(D.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(D.forced=/yes/i.test(y.attributes.FORCED)),I[y.attributes.NAME]=D},discontinuity(){_+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),r.dateTimeString=y.dateTimeString,r.dateTimeObject=y.dateTimeObject;const{lastProgramDateTime:P}=this;this.lastProgramDateTime=new Date(y.dateTimeString).getTime(),P===null&&this.manifest.segments.reduceRight((k,L)=>(L.programDateTime=k-L.duration*1e3,L.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(y.duration)||y.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration});return}this.manifest.targetDuration=y.duration,ka.call(this,this.manifest)},start(){if(!y.attributes||isNaN(y.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}},"cue-out"(){r.cueOut=y.data},"cue-out-cont"(){r.cueOutCont=y.data},"cue-in"(){r.cueIn=y.data},skip(){this.manifest.skip=Gt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const P=this.manifest.segments.length,k=Gt(y.attributes);r.parts=r.parts||[],r.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=C),C=k.byterange.offset+k.byterange.length);const L=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${L} for segment #${P}`,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((N,U)=>{N.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${U} lacks required attribute(s): LAST-PART`})})},"server-control"(){const P=this.manifest.serverControl=Gt(y.attributes);P.hasOwnProperty("canBlockReload")||(P.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),P.canSkipDateranges&&!P.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"(){const P=this.manifest.segments.length,k=Gt(y.attributes),L=k.type&&k.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=L?C:0,L&&(C=k.byterange.offset+k.byterange.length)));const N=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${N} for segment #${P}`,y.attributes,["TYPE","URI"]),!!k.type)for(let U=0;U<r.preloadHints.length-1;U++){const B=r.preloadHints[U];B.type&&B.type===k.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${N} for segment #${P} has the same TYPE ${k.type} as preload hint #${U}`})}},"rendition-report"(){const P=Gt(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(P);const k=this.manifest.renditionReports.length-1,L=["LAST-MSN","URI"];u&&L.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${k}`,y.attributes,L)},"part-inf"(){this.manifest.partInf=Gt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ka.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Gt(y.attributes));const P=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${P}`,y.attributes,["ID","START-DATE"]);const k=this.manifest.dateRanges[P];k.endDate&&k.startDate&&new Date(k.endDate)<new Date(k.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),k.duration&&k.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),k.plannedDuration&&k.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const L=!!k.endOnNext;if(L&&!k.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),L&&(k.duration||k.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),k.duration&&k.endDate){const U=k.startDate.getTime()+k.duration*1e3;this.manifest.dateRanges[P].endDate=new Date(U)}if(!A[k.id])A[k.id]=k;else{for(const U in A[k.id])if(k[U]&&JSON.stringify(A[k.id][U])!==JSON.stringify(k[U])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const N=this.manifest.dateRanges.findIndex(U=>U.id===k.id);this.manifest.dateRanges[N]=Fi(this.manifest.dateRanges[N],k),A[k.id]=Fi(A[k.id],k),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=Gt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",y.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const P=(k,L)=>{if(k in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${k}`});return}this.manifest.definitions[k]=L};if("QUERYPARAM"in y.attributes){if("NAME"in y.attributes||"IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const k=this.params.get(y.attributes.QUERYPARAM);if(!k){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${y.attributes.QUERYPARAM}`});return}P(y.attributes.QUERYPARAM,decodeURIComponent(k));return}if("NAME"in y.attributes){if("IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in y.attributes)||typeof y.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${y.attributes.NAME}`});return}P(y.attributes.NAME,y.attributes.VALUE);return}if("IMPORT"in y.attributes){if(!this.mainDefinitions[y.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${y.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}P(y.attributes.IMPORT,this.mainDefinitions[y.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:y.attributes,uri:y.uri,timeline:_}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",y.attributes,["BANDWIDTH","URI"])}}[y.tagType]||h).call(t)},uri(){r.uri=y.uri,s.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=_,n&&(r.map=n),C=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){y.segment?(r.custom=r.custom||{},r.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
19
- `),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 mi={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^/},s_=["video","audio","text"],kl=["Video","Audio","Text"],uh=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},yt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;s_.forEach(function(a){var u=mi[a].exec(r.toLowerCase());if(!(!u||u.length<=1)){n=a;var h=r.substring(0,u[1].length),f=r.replace(h,"");s.push({type:h,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},r_=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return yt(n.playlists[0].attributes.CODECS)}return null},lh=function(e){return e===void 0&&(e=""),mi.audio.test(e.trim().toLowerCase())},n_=function(e){return e===void 0&&(e=""),mi.text.test(e.trim().toLowerCase())},Xi=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return uh(n.trim())}),s="video";t.length===1&&lh(t[0])?s="audio":t.length===1&&n_(t[0])&&(s="application");var r="mp4";return t.every(function(n){return mi.mp4.test(n)})?r="mp4":t.every(function(n){return mi.webm.test(n)})?r="webm":t.every(function(n){return mi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},Xs=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),S.MediaSource&&S.MediaSource.isTypeSupported&&S.MediaSource.isTypeSupported(Xi(e))||t&&S.ManagedMediaSource&&S.ManagedMediaSource.isTypeSupported&&S.ManagedMediaSource.isTypeSupported(Xi(e))||!1},Pa=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;s<kl.length;s++){var r=kl[s];if(mi["muxer"+r].test(t))return!0}return!1})},Pl="mp4a.40.2",a_="avc1.4d400d",o_=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,u_=/^application\/dash\+xml/i,ch=function(e){return o_.test(e)?"hls":u_.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},l_=function(e){return e.toString(2).length},c_=function(e){return Math.ceil(l_(e)/8)},hh=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},h_=function(e){return hh(e)},G=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!h_(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Ie=S.BigInt||Number,Ka=[Ie("0x1"),Ie("0x100"),Ie("0x10000"),Ie("0x1000000"),Ie("0x100000000"),Ie("0x10000000000"),Ie("0x1000000000000"),Ie("0x100000000000000"),Ie("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var d_=function(e,t){var s=t===void 0?{}:t,r=s.signed,n=r===void 0?!1:r,a=s.le,u=a===void 0?!1:a;e=G(e);var h=u?"reduce":"reduceRight",f=e[h]?e[h]:Array.prototype[h],g=f.call(e,function(b,C,A){var y=u?A:Math.abs(A+1-e.length);return b+Ie(C)*Ka[y]},Ie(0));if(n){var _=Ka[e.length]/Ie(2)-Ie(1);g=Ie(g),g>_&&(g-=_,g-=_,g-=Ie(2))}return Number(g)},f_=function(e,t){var s=t===void 0?{}:t,r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ie(e);for(var a=c_(e),u=new Uint8Array(new ArrayBuffer(a)),h=0;h<a;h++){var f=n?h:Math.abs(h+1-u.length);u[f]=Number(e/Ka[h]&Ie(255)),e<0&&(u[f]=Math.abs(~u[f]),u[f]-=h===0?1:2)}return u},dh=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 s=new Uint8Array(e.length),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return s},p_=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];if(t=t.filter(function(u){return u&&(u.byteLength||u.length)&&typeof u!="string"}),t.length<=1)return G(t[0]);var r=t.reduce(function(u,h,f){return u+(h.byteLength||h.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(u){u=G(u),n.set(u,a),a+=u.byteLength}),n},pe=function(e,t,s){var r=s===void 0?{}:s,n=r.offset,a=n===void 0?0:n,u=r.mask,h=u===void 0?[]:u;e=G(e),t=G(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(g,_){var b=h[_]?h[_]&e[a+_]:e[a+_];return g===b})},fh={exports:{}};(function(i,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,u={buildAbsoluteURL:function(h,f,g){if(g=g||{},h=h.trim(),f=f.trim(),!f){if(!g.alwaysNormalize)return h;var _=u.parseURL(h);if(!_)throw new Error("Error trying to parse base URL.");return _.path=u.normalizePath(_.path),u.buildURLFromParts(_)}var b=u.parseURL(f);if(!b)throw new Error("Error trying to parse relative URL.");if(b.scheme)return g.alwaysNormalize?(b.path=u.normalizePath(b.path),u.buildURLFromParts(b)):f;var C=u.parseURL(h);if(!C)throw new Error("Error trying to parse base URL.");if(!C.netLoc&&C.path&&C.path[0]!=="/"){var A=r.exec(C.path);C.netLoc=A[1],C.path=A[2]}C.netLoc&&!C.path&&(C.path="/");var y={scheme:C.scheme,netLoc:b.netLoc,path:null,params:b.params,query:b.query,fragment:b.fragment};if(!b.netLoc&&(y.netLoc=C.netLoc,b.path[0]!=="/"))if(!b.path)y.path=C.path,b.params||(y.params=C.params,b.query||(y.query=C.query));else{var I=C.path,D=I.substring(0,I.lastIndexOf("/")+1)+b.path;y.path=u.normalizePath(D)}return y.path===null&&(y.path=g.alwaysNormalize?u.normalizePath(b.path):b.path),u.buildURLFromParts(y)},parseURL:function(h){var f=s.exec(h);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(h){for(h=h.split("").reverse().join("").replace(n,"");h.length!==(h=h.replace(a,"")).length;);return h.split("").reverse().join("")},buildURLFromParts:function(h){return h.scheme+h.netLoc+h.path+h.params+h.query+h.fragment}};i.exports=u})()})(fh);var m_=fh.exports;const Ol=os(m_);var Ll="http://example.com",ko=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=S.location&&S.location.href||"");var s=typeof S.URL=="function",r=/^\/\//.test(e),n=!S.location&&!/\/\//i.test(e);if(s?e=new S.URL(e,S.location||Ll):/\/\//i.test(e)||(e=Ol.buildAbsoluteURL(S.location&&S.location.href||"",e)),s){var a=new URL(t,e);return n?a.href.slice(Ll.length):r?a.href.slice(a.protocol.length):a.href}return Ol.buildAbsoluteURL(e,t)},g_=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var u=e.mediaGroups[r][n][a];s(u,r,n,a)}})},__=function(e){return S.atob?S.atob(e):Buffer.from(e,"base64").toString("binary")};function y_(i){for(var e=__(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}var ti={},$t={};function T_(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s<i.length;s++)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];if(e.call(void 0,r,s,i))return r}}function Po(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function v_(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var ph=Po({HTML:"text/html",isHTML:function(i){return i===ph.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),mh=Po({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===mh.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});$t.assign=v_;$t.find=T_;$t.freeze=Po;$t.MIME_TYPE=ph;$t.NAMESPACE=mh;var gh=$t,Et=gh.find,er=gh.NAMESPACE;function b_(i){return i!==""}function x_(i){return i?i.split(/[\t\n\f\r ]+/).filter(b_):[]}function S_(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function Rl(i){if(!i)return[];var e=x_(i);return Object.keys(e.reduce(S_,{}))}function E_(i){return function(e){return i&&i.indexOf(e)!==-1}}function ur(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function Ke(i,e){var t=i.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,ur(t,s),i.prototype=t=s}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Ye={},dt=Ye.ELEMENT_NODE=1,Ki=Ye.ATTRIBUTE_NODE=2,nn=Ye.TEXT_NODE=3,_h=Ye.CDATA_SECTION_NODE=4,yh=Ye.ENTITY_REFERENCE_NODE=5,C_=Ye.ENTITY_NODE=6,Th=Ye.PROCESSING_INSTRUCTION_NODE=7,vh=Ye.COMMENT_NODE=8,bh=Ye.DOCUMENT_NODE=9,xh=Ye.DOCUMENT_TYPE_NODE=10,Bt=Ye.DOCUMENT_FRAGMENT_NODE=11,A_=Ye.NOTATION_NODE=12,Ne={},we={};Ne.INDEX_SIZE_ERR=(we[1]="Index size error",1);Ne.DOMSTRING_SIZE_ERR=(we[2]="DOMString size error",2);var ze=Ne.HIERARCHY_REQUEST_ERR=(we[3]="Hierarchy request error",3);Ne.WRONG_DOCUMENT_ERR=(we[4]="Wrong document",4);Ne.INVALID_CHARACTER_ERR=(we[5]="Invalid character",5);Ne.NO_DATA_ALLOWED_ERR=(we[6]="No data allowed",6);Ne.NO_MODIFICATION_ALLOWED_ERR=(we[7]="No modification allowed",7);var Sh=Ne.NOT_FOUND_ERR=(we[8]="Not found",8);Ne.NOT_SUPPORTED_ERR=(we[9]="Not supported",9);var Nl=Ne.INUSE_ATTRIBUTE_ERR=(we[10]="Attribute in use",10);Ne.INVALID_STATE_ERR=(we[11]="Invalid state",11);Ne.SYNTAX_ERR=(we[12]="Syntax error",12);Ne.INVALID_MODIFICATION_ERR=(we[13]="Invalid modification",13);Ne.NAMESPACE_ERR=(we[14]="Invalid namespace",14);Ne.INVALID_ACCESS_ERR=(we[15]="Invalid access",15);function xe(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,we[i]),this.message=we[i],Error.captureStackTrace&&Error.captureStackTrace(this,xe);return t.code=i,e&&(this.message=this.message+": "+e),t}xe.prototype=Error.prototype;ur(Ne,xe);function Rt(){}Rt.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],s=0;s<this.length;s++)Ri(this[s],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function Yi(i,e){this._node=i,this._refresh=e,Oo(this)}function Oo(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(Nh(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var s=t.length;s in i;s++)Object.prototype.hasOwnProperty.call(i,s)&&delete i[s];ur(t,i),i._inc=e}}Yi.prototype.item=function(i){return Oo(this),this[i]||null};Ke(Yi,Rt);function an(){}function Eh(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function Ml(i,e,t,s){if(s?e[Eh(e,s)]=t:e[e.length++]=t,i){t.ownerElement=i;var r=i.ownerDocument;r&&(s&&Dh(r,i,s),D_(r,i,t))}}function Bl(i,e,t){var s=Eh(e,t);if(s>=0){for(var r=e.length-1;s<r;)e[s]=e[++s];if(e.length=r,i){var n=i.ownerDocument;n&&(Dh(n,i,t),t.ownerElement=null)}}else throw new xe(Sh,new Error(i.tagName+"@"+t))}an.prototype={length:0,item:Rt.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new xe(Nl);var t=this.getNamedItem(i.nodeName);return Ml(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new xe(Nl);return t=this.getNamedItemNS(i.namespaceURI,i.localName),Ml(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Bl(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Bl(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var s=this[t];if(s.localName==e&&s.namespaceURI==i)return s}return null}};function Ch(){}Ch.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var s=new lr;if(s.implementation=this,s.childNodes=new Rt,s.doctype=t||null,t&&s.appendChild(t),e){var r=s.createElementNS(i,e);s.appendChild(r)}return s},createDocumentType:function(i,e,t){var s=new Pn;return s.name=i,s.nodeName=i,s.publicId=e||"",s.systemId=t||"",s}};function re(){}re.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(i,e){return on(this,i,e)},replaceChild:function(i,e){on(this,i,e,Ih),e&&this.removeChild(e)},removeChild:function(i){return wh(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return Ya(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==nn&&i.nodeType==nn?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Ki?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Ki?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Ah(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}ur(Ye,re);ur(Ye,re.prototype);function tr(i,e){if(e(i))return!0;if(i=i.firstChild)do if(tr(i,e))return!0;while(i=i.nextSibling)}function lr(){this.ownerDocument=this}function D_(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===er.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Dh(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===er.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Lo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function wh(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Lo(i.ownerDocument,i),e}function w_(i){return i&&(i.nodeType===re.DOCUMENT_NODE||i.nodeType===re.DOCUMENT_FRAGMENT_NODE||i.nodeType===re.ELEMENT_NODE)}function I_(i){return i&&(Ct(i)||Ro(i)||Ft(i)||i.nodeType===re.DOCUMENT_FRAGMENT_NODE||i.nodeType===re.COMMENT_NODE||i.nodeType===re.PROCESSING_INSTRUCTION_NODE)}function Ft(i){return i&&i.nodeType===re.DOCUMENT_TYPE_NODE}function Ct(i){return i&&i.nodeType===re.ELEMENT_NODE}function Ro(i){return i&&i.nodeType===re.TEXT_NODE}function Fl(i,e){var t=i.childNodes||[];if(Et(t,Ct)||Ft(e))return!1;var s=Et(t,Ft);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Ul(i,e){var t=i.childNodes||[];function s(n){return Ct(n)&&n!==e}if(Et(t,s))return!1;var r=Et(t,Ft);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function k_(i,e,t){if(!w_(i))throw new xe(ze,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new xe(Sh,"child not in parent");if(!I_(e)||Ft(e)&&i.nodeType!==re.DOCUMENT_NODE)throw new xe(ze,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function P_(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===re.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||Et(r,Ro))throw new xe(ze,"More than one element or text in fragment");if(n.length===1&&!Fl(i,t))throw new xe(ze,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Fl(i,t))throw new xe(ze,"Only one element can be added and only after doctype");if(Ft(e)){if(Et(s,Ft))throw new xe(ze,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new xe(ze,"Doctype can only be inserted before an element");if(!t&&a)throw new xe(ze,"Doctype can not be appended since element is present")}}function Ih(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===re.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||Et(r,Ro))throw new xe(ze,"More than one element or text in fragment");if(n.length===1&&!Ul(i,t))throw new xe(ze,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Ul(i,t))throw new xe(ze,"Only one element can be added and only after doctype");if(Ft(e)){if(Et(s,function(h){return Ft(h)&&h!==t}))throw new xe(ze,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new xe(ze,"Doctype can only be inserted before an element")}}function on(i,e,t,s){k_(i,e,t),i.nodeType===re.DOCUMENT_NODE&&(s||P_)(i,e,t);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===Bt){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var u=t?t.previousSibling:i.lastChild;n.previousSibling=u,a.nextSibling=t,u?u.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do n.parentNode=i;while(n!==a&&(n=n.nextSibling));return Lo(i.ownerDocument||i,i),e.nodeType==Bt&&(e.firstChild=e.lastChild=null),e}function O_(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,Lo(i.ownerDocument,i,e),e}lr.prototype={nodeName:"#document",nodeType:bh,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==Bt){for(var t=i.firstChild;t;){var s=t.nextSibling;this.insertBefore(t,e),t=s}return i}return on(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===dt&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),wh(this,i)},replaceChild:function(i,e){on(this,i,e,Ih),i.ownerDocument=this,e&&this.removeChild(e),Ct(i)&&(this.documentElement=i)},importNode:function(i,e){return Rh(this,i,e)},getElementById:function(i){var e=null;return tr(this.documentElement,function(t){if(t.nodeType==dt&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=Rl(i);return new Yi(this,function(t){var s=[];return e.length>0&&tr(t.documentElement,function(r){if(r!==t&&r.nodeType===dt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var u=Rl(n);a=e.every(E_(u))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new vi;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Rt;var t=e.attributes=new an;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new On;return i.ownerDocument=this,i.childNodes=new Rt,i},createTextNode:function(i){var e=new No;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Mo;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Bo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Uo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new un;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Fo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new vi,s=e.split(":"),r=t.attributes=new an;return t.childNodes=new Rt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new un,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Ke(lr,re);function vi(){this._nsMap={}}vi.prototype={nodeType:dt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Bt?this.insertBefore(i,null):O_(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Yi(this,function(e){var t=[];return tr(e,function(s){s!==e&&s.nodeType==dt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Yi(this,function(t){var s=[];return tr(t,function(r){r!==t&&r.nodeType===dt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};lr.prototype.getElementsByTagName=vi.prototype.getElementsByTagName;lr.prototype.getElementsByTagNameNS=vi.prototype.getElementsByTagNameNS;Ke(vi,re);function un(){}un.prototype.nodeType=Ki;Ke(un,re);function cr(){}cr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(we[ze])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Ke(cr,re);function No(){}No.prototype={nodeName:"#text",nodeType:nn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Ke(No,cr);function Mo(){}Mo.prototype={nodeName:"#comment",nodeType:vh};Ke(Mo,cr);function Bo(){}Bo.prototype={nodeName:"#cdata-section",nodeType:_h};Ke(Bo,cr);function Pn(){}Pn.prototype.nodeType=xh;Ke(Pn,re);function kh(){}kh.prototype.nodeType=A_;Ke(kh,re);function Ph(){}Ph.prototype.nodeType=C_;Ke(Ph,re);function Fo(){}Fo.prototype.nodeType=yh;Ke(Fo,re);function On(){}On.prototype.nodeName="#document-fragment";On.prototype.nodeType=Bt;Ke(On,re);function Uo(){}Uo.prototype.nodeType=Th;Ke(Uo,re);function Oh(){}Oh.prototype.serializeToString=function(i,e,t){return Lh.call(i,e,t)};re.prototype.toString=Lh;function Lh(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Ri(this,t,i,e,a),t.join("")}function $l(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===er.XML||r===er.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Oa(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Ah),'"')}function Ri(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case dt:var n=i.attributes,a=n.length,D=i.firstChild,u=i.tagName;t=er.isHTML(i.namespaceURI)||t;var h=u;if(!t&&!i.prefix&&i.namespaceURI){for(var f,g=0;g<n.length;g++)if(n.item(g).name==="xmlns"){f=n.item(g).value;break}if(!f)for(var _=r.length-1;_>=0;_--){var b=r[_];if(b.prefix===""&&b.namespace===i.namespaceURI){f=b.namespace;break}}if(f!==i.namespaceURI)for(var _=r.length-1;_>=0;_--){var b=r[_];if(b.namespace===i.namespaceURI){b.prefix&&(h=b.prefix+":"+u);break}}}e.push("<",h);for(var C=0;C<a;C++){var A=n.item(C);A.prefix=="xmlns"?r.push({prefix:A.localName,namespace:A.value}):A.nodeName=="xmlns"&&r.push({prefix:"",namespace:A.value})}for(var C=0;C<a;C++){var A=n.item(C);if($l(A,t,r)){var y=A.prefix||"",I=A.namespaceURI;Oa(e,y?"xmlns:"+y:"xmlns",I),r.push({prefix:y,namespace:I})}Ri(A,e,t,s,r)}if(u===h&&$l(i,t,r)){var y=i.prefix||"",I=i.namespaceURI;Oa(e,y?"xmlns:"+y:"xmlns",I),r.push({prefix:y,namespace:I})}if(D||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),t&&/^script$/i.test(u))for(;D;)D.data?e.push(D.data):Ri(D,e,t,s,r.slice()),D=D.nextSibling;else for(;D;)Ri(D,e,t,s,r.slice()),D=D.nextSibling;e.push("</",h,">")}else e.push("/>");return;case bh:case Bt:for(var D=i.firstChild;D;)Ri(D,e,t,s,r.slice()),D=D.nextSibling;return;case Ki:return Oa(e,i.name,i.value);case nn:return e.push(i.data.replace(/[<&>]/g,Ah));case _h:return e.push("<![CDATA[",i.data,"]]>");case vh:return e.push("<!--",i.data,"-->");case xh:var P=i.publicId,k=i.systemId;if(e.push("<!DOCTYPE ",i.name),P)e.push(" PUBLIC ",P),k&&k!="."&&e.push(" ",k),e.push(">");else if(k&&k!=".")e.push(" SYSTEM ",k,">");else{var L=i.internalSubset;L&&e.push(" [",L,"]"),e.push(">")}return;case Th:return e.push("<?",i.target," ",i.data,"?>");case yh:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Rh(i,e,t){var s;switch(e.nodeType){case dt:s=e.cloneNode(!1),s.ownerDocument=i;case Bt:break;case Ki:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Rh(i,r,t)),r=r.nextSibling;return s}function Ya(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Rt),s.ownerDocument=i,s.nodeType){case dt:var a=e.attributes,u=s.attributes=new an,h=a.length;u._ownerElement=s;for(var f=0;f<h;f++)s.setAttributeNode(Ya(i,a.item(f),!0));break;case Ki:t=!0}if(t)for(var g=e.firstChild;g;)s.appendChild(Ya(i,g,t)),g=g.nextSibling;return s}function Nh(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case dt:case Bt:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Yi.prototype,"length",{get:function(){return Oo(this),this.$$length}}),Object.defineProperty(re.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case dt:case Bt: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}}}),Nh=function(e,t,s){e["$$"+t]=s}}}catch{}ti.DocumentType=Pn;ti.DOMException=xe;ti.DOMImplementation=Ch;ti.Element=vi;ti.Node=re;ti.NodeList=Rt;ti.XMLSerializer=Oh;var Ln={},Mh={};(function(i){var e=$t.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({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:" ",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:`
20
- `,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:" ",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:"‌"}),i.entityMap=i.HTML_ENTITIES})(Mh);var $o={},ir=$t.NAMESPACE,Qa=/[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]/,ql=new RegExp("[\\-\\.0-9"+Qa.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),jl=new RegExp("^"+Qa.source+ql.source+"*(?::"+Qa.source+ql.source+"*)?$"),Ns=0,Wt=1,Di=2,Ms=3,wi=4,Ii=5,Bs=6,Gr=7;function Qi(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Qi)}Qi.prototype=new Error;Qi.prototype.name=Qi.name;function Bh(){}Bh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),Fh(e,e={}),L_(i,e,t,s,this.errorHandler),s.endDocument()}};function L_(i,e,t,s,r){function n(ee){if(ee>65535){ee-=65536;var Te=55296+(ee>>10),It=56320+(ee&1023);return String.fromCharCode(Te,It)}else return String.fromCharCode(ee)}function a(ee){var Te=ee.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+ee),ee)}function u(ee){if(ee>y){var Te=i.substring(y,ee).replace(/&#?\w+;/g,a);b&&h(y),s.characters(Te,0,ee-y),y=ee}}function h(ee,Te){for(;ee>=g&&(Te=_.exec(i));)f=Te.index,g=f+Te[0].length,b.lineNumber++;b.columnNumber=ee-f+1}for(var f=0,g=0,_=/.*(?:\r\n?|\n)|.*$/g,b=s.locator,C=[{currentNSMap:e}],A={},y=0;;){try{var I=i.indexOf("<",y);if(I<0){if(!i.substr(y).match(/^\s*$/)){var D=s.doc,P=D.createTextNode(i.substr(y));D.appendChild(P),s.currentElement=P}return}switch(I>y&&u(I),i.charAt(I+1)){case"/":var J=i.indexOf(">",I+3),k=i.substring(I+2,J).replace(/[ \t\n\r]+$/g,""),L=C.pop();J<0?(k=i.substring(I+2).replace(/[\s<].*/,""),r.error("end tag name: "+k+" is not complete:"+L.tagName),J=I+1+k.length):k.match(/\s</)&&(k=k.replace(/[\s<].*/,""),r.error("end tag name: "+k+" maybe not complete"),J=I+1+k.length);var N=L.localNSMap,U=L.tagName==k,B=U||L.tagName&&L.tagName.toLowerCase()==k.toLowerCase();if(B){if(s.endElement(L.uri,L.localName,k),N)for(var $ in N)Object.prototype.hasOwnProperty.call(N,$)&&s.endPrefixMapping($);U||r.fatalError("end tag name: "+k+" is not match the current start tagName:"+L.tagName)}else C.push(L);J++;break;case"?":b&&h(I),J=F_(i,I,s);break;case"!":b&&h(I),J=B_(i,I,s,r);break;default:b&&h(I);var X=new Uh,ne=C[C.length-1].currentNSMap,J=R_(i,I,X,ne,a,r),oe=X.length;if(!X.closed&&M_(i,J,X.tagName,A)&&(X.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),b&&oe){for(var H=Vl(b,{}),Z=0;Z<oe;Z++){var Me=X[Z];h(Me.offset),Me.locator=Vl(b,{})}s.locator=H,Hl(X,s,ne)&&C.push(X),s.locator=b}else Hl(X,s,ne)&&C.push(X);ir.isHTML(X.uri)&&!X.closed?J=N_(i,J,X.tagName,a,s):J++}}catch(ee){if(ee instanceof Qi)throw ee;r.error("element parse error: "+ee),J=-1}J>y?y=J:u(Math.max(I,y)+1)}}function Vl(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function R_(i,e,t,s,r,n){function a(b,C,A){t.attributeNames.hasOwnProperty(b)&&n.fatalError("Attribute "+b+" redefined"),t.addValue(b,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),A)}for(var u,h,f=++e,g=Ns;;){var _=i.charAt(f);switch(_){case"=":if(g===Wt)u=i.slice(e,f),g=Ms;else if(g===Di)g=Ms;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===Ms||g===Wt)if(g===Wt&&(n.warning('attribute value must after "="'),u=i.slice(e,f)),e=f+1,f=i.indexOf(_,e),f>0)h=i.slice(e,f),a(u,h,e-1),g=Ii;else throw new Error("attribute value no end '"+_+"' match");else if(g==wi)h=i.slice(e,f),a(u,h,e),n.warning('attribute "'+u+'" missed start quot('+_+")!!"),e=f+1,g=Ii;else throw new Error('attribute value must after "="');break;case"/":switch(g){case Ns:t.setTagName(i.slice(e,f));case Ii:case Bs:case Gr:g=Gr,t.closed=!0;case wi:case Wt:break;case Di:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),g==Ns&&t.setTagName(i.slice(e,f)),f;case">":switch(g){case Ns:t.setTagName(i.slice(e,f));case Ii:case Bs:case Gr:break;case wi:case Wt:h=i.slice(e,f),h.slice(-1)==="/"&&(t.closed=!0,h=h.slice(0,-1));case Di:g===Di&&(h=u),g==wi?(n.warning('attribute "'+h+'" missed quot(")!'),a(u,h,e)):((!ir.isHTML(s[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),a(h,h,e));break;case Ms:throw new Error("attribute value missed!!")}return f;case"€":_=" ";default:if(_<=" ")switch(g){case Ns:t.setTagName(i.slice(e,f)),g=Bs;break;case Wt:u=i.slice(e,f),g=Di;break;case wi:var h=i.slice(e,f);n.warning('attribute "'+h+'" missed quot(")!!'),a(u,h,e);case Ii:g=Bs;break}else switch(g){case Di:t.tagName,(!ir.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),a(u,u,e),e=f,g=Wt;break;case Ii:n.warning('attribute space is required"'+u+'"!!');case Bs:g=Wt,e=f;break;case Ms:g=wi,e=f;break;case Gr:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Hl(i,e,t){for(var s=i.tagName,r=null,_=i.length;_--;){var n=i[_],a=n.qName,u=n.value,b=a.indexOf(":");if(b>0)var h=n.prefix=a.slice(0,b),f=a.slice(b+1),g=h==="xmlns"&&f;else f=a,h=null,g=a==="xmlns"&&"";n.localName=f,g!==!1&&(r==null&&(r={},Fh(t,t={})),t[g]=r[g]=u,n.uri=ir.XMLNS,e.startPrefixMapping(g,u))}for(var _=i.length;_--;){n=i[_];var h=n.prefix;h&&(h==="xml"&&(n.uri=ir.XML),h!=="xmlns"&&(n.uri=t[h||""]))}var b=s.indexOf(":");b>0?(h=i.prefix=s.slice(0,b),f=i.localName=s.slice(b+1)):(h=null,f=i.localName=s);var C=i.uri=t[h||""];if(e.startElement(C,f,s,i),i.closed){if(e.endElement(C,f,s),r)for(h in r)Object.prototype.hasOwnProperty.call(r,h)&&e.endPrefixMapping(h)}else return i.currentNSMap=t,i.localNSMap=r,!0}function N_(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function M_(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf("</"+t+">"),r<e&&(r=i.lastIndexOf("</"+t)),s[t]=r),r<e}function Fh(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function B_(i,e,t,s){var r=i.charAt(e+2);switch(r){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=U_(i,e),u=a.length;if(u>1&&/!doctype/i.test(a[0][0])){var h=a[1][0],f=!1,g=!1;u>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],g=u>4&&a[4][0]):/^system$/i.test(a[2][0])&&(g=a[3][0]));var _=a[u-1];return t.startDTD(h,f,g),t.endDTD(),_.index+_[0].length}}return-1}function F_(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function Uh(){this.attributeNames={}}Uh.prototype={setTagName:function(i){if(!jl.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!jl.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function U_(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}$o.XMLReader=Bh;$o.ParseError=Qi;var $_=$t,q_=ti,zl=Mh,$h=$o,j_=q_.DOMImplementation,Gl=$_.NAMESPACE,V_=$h.ParseError,H_=$h.XMLReader;function qh(i){return i.replace(/\r[\n\u0085]/g,`
21
- `).replace(/[\r\u0085\u2028]/g,`
22
- `)}function jh(i){this.options=i||{locator:{}}}jh.prototype.parseFromString=function(i,e){var t=this.options,s=new H_,r=t.domBuilder||new hr,n=t.errorHandler,a=t.locator,u=t.xmlns||{},h=/\/x?html?$/.test(e),f=h?zl.HTML_ENTITIES:zl.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=z_(n,r,a),s.domBuilder=t.domBuilder||r,h&&(u[""]=Gl.HTML),u.xml=u.xml||Gl.XML;var g=t.normalizeLineEndings||qh;return i&&typeof i=="string"?s.parse(g(i),u,f):s.errorHandler.error("invalid doc source"),r.doc};function z_(i,e,t){if(!i){if(e instanceof hr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var u=i[a];!u&&r&&(u=i.length==2?function(h){i(a,h)}:i),s[a]=u&&function(h){u("[xmldom "+a+"] "+h+Ja(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function hr(){this.cdata=!1}function ki(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}hr.prototype={startDocument:function(){this.doc=new j_().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;Wr(this,n),this.currentElement=n,this.locator&&ki(this.locator,n);for(var u=0;u<a;u++){var i=s.getURI(u),h=s.getValue(u),t=s.getQName(u),f=r.createAttributeNS(i,t);this.locator&&ki(s.getLocator(u),f),f.value=f.nodeValue=h,n.setAttributeNode(f)}},endElement:function(i,e,t){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&ki(this.locator,t),Wr(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=Wl.apply(this,arguments),i){if(this.cdata)var s=this.doc.createCDATASection(i);else var s=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(i)&&this.doc.appendChild(s),this.locator&&ki(this.locator,s)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=Wl.apply(this,arguments);var s=this.doc.createComment(i);this.locator&&ki(this.locator,s),Wr(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var s=this.doc.implementation;if(s&&s.createDocumentType){var r=s.createDocumentType(i,e,t);this.locator&&ki(this.locator,r),Wr(this,r),this.doc.doctype=r}},warning:function(i){console.warn("[xmldom warning] "+i,Ja(this.locator))},error:function(i){console.error("[xmldom error] "+i,Ja(this.locator))},fatalError:function(i){throw new V_(i,this.locator)}};function Ja(i){if(i)return`
23
- @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Wl(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){hr.prototype[i]=function(){return null}});function Wr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Ln.__DOMHandler=hr;Ln.normalizeLineEndings=qh;Ln.DOMParser=jh;var G_=Ln.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Xl=i=>!!i&&typeof i=="object",Ae=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):Xl(e[s])&&Xl(t[s])?e[s]=Ae(e[s],t[s]):e[s]=t[s]}),e),{}),Vh=i=>Object.keys(i).map(e=>i[e]),W_=(i,e)=>{const t=[];for(let s=i;s<e;s++)t.push(s);return t},Ji=i=>i.reduce((e,t)=>e.concat(t),[]),Hh=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},X_=(i,e)=>i.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),K_=(i,e)=>Vh(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Zi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const sr=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:ko(i||"",e)};if(t||s){const a=(t||s).split("-");let u=S.BigInt?S.BigInt(a[0]):parseInt(a[0],10),h=S.BigInt?S.BigInt(a[1]):parseInt(a[1],10);u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u)),h<Number.MAX_SAFE_INTEGER&&typeof h=="bigint"&&(h=Number(h));let f;typeof h=="bigint"||typeof u=="bigint"?f=S.BigInt(h)-S.BigInt(u)+S.BigInt(1):f=h-u+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:u}}return r},Y_=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Kl=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),Q_={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=Kl(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:u=0,timeShiftBufferDepth:h=1/0}=i,f=Kl(i.endNumber),g=(e+t)/1e3,_=s+a,C=g+u-_,A=Math.ceil(C*r/n),y=Math.floor((g-_-h)*r/n),I=Math.floor((g-_)*r/n);return{start:Math.max(0,y),end:typeof f=="number"?f:Math.min(A,I)}}},J_=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},qo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:u}=Q_[e](i),h=W_(a,u).map(J_(i));if(e==="static"){const f=h.length-1,g=typeof r=="number"?r:n;h[f].duration=g-t/s*f}return h},zh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:u=0,duration:h}=i;if(!e)throw new Error(Zi.NO_BASE_URL);const f=sr({baseUrl:e,source:t.sourceURL,range:t.range}),g=sr({baseUrl:e,source:e,indexRange:r});if(g.map=f,h){const _=qo(i);_.length&&(g.duration=_[0].duration,g.timeline=_[0].timeline)}else s&&(g.duration=s,g.timeline=n);return g.presentationTime=a||n,g.number=u,[g]},jo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,u=a.offset+a.length,h=e.timescale,f=e.references.filter(I=>I.referenceType!==1),g=[],_=i.endList?"static":"dynamic",b=i.sidx.timeline;let C=b,A=i.mediaSequence||0,y;typeof e.firstOffset=="bigint"?y=S.BigInt(u)+e.firstOffset:y=u+e.firstOffset;for(let I=0;I<f.length;I++){const D=e.references[I],P=D.referencedSize,k=D.subsegmentDuration;let L;typeof y=="bigint"?L=y+S.BigInt(P)-S.BigInt(1):L=y+P-1;const N=`${y}-${L}`,B=zh({baseUrl:t,timescale:h,timeline:n,periodStart:b,presentationTime:C,number:A,duration:k,sourceDuration:r,indexRange:N,type:_})[0];s&&(B.map=s),g.push(B),typeof y=="bigint"?y+=S.BigInt(P):y+=P,C+=k/h,A++}return i.segments=g,i},Z_=["AUDIO","SUBTITLES"],ey=1/60,Gh=i=>K_(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),ty=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Yl=i=>{let e=[];return g_(i,Z_,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},Ql=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},iy=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:h}){return h===s.timeline});const r=ty(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(h){return Math.abs(h.presentationTime-n.presentationTime)<ey});if(a===-1){Ql({playlist:s,mediaSequence:r.mediaSequence+r.segments.length}),s.segments[0].discontinuity=!0,s.discontinuityStarts.unshift(0),(!r.segments.length&&s.timeline>r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),Ql({playlist:s,mediaSequence:r.segments[a].number})})},sy=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(Yl(i)),s=e.playlists.concat(Yl(e));return e.timelineStarts=Gh([i.timelineStarts,e.timelineStarts]),iy({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Rn=i=>i&&i.uri+"-"+Y_(i.byterange),La=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=Vh(s.reduce((n,a)=>{const u=a.attributes.id+(a.attributes.lang||"");return n[u]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[u].segments.push(...a.segments)),a.attributes.contentProtection&&(n[u].attributes.contentProtection=a.attributes.contentProtection)):(n[u]=a,n[u].attributes.timelineStarts=[]),n[u].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=X_(s.segments||[],"discontinuity"),s))},Vo=(i,e)=>{const t=Rn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&jo(i,s,i.sidx.resolvedUri),i},ry=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Vo(i[t],e);return i},ny=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const u={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(u.contentProtection=i.contentProtection),i.serviceLocation&&(u.attributes.serviceLocation=i.serviceLocation),t&&(u.sidx=t),a&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u},ay=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},oy=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const u=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"";let f=a.attributes.label||"main";if(h&&!a.attributes.label){const _=u?` (${u})`:"";f=`${a.attributes.lang}${_}`}n[f]||(n[f]={language:h,autoselect:!0,default:u==="main",playlists:[],uri:""});const g=Vo(ny(a,t),e);return n[f].playlists.push(g),typeof s>"u"&&u==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},uy=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Vo(ay(s),e)),t},{}),ly=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),cy=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},hy=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",dy=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",fy=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",py=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},Jl=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],my=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:u,suggestedPresentationDelay:h,minimumUpdatePeriod:f}=i[0].attributes,g=La(i.filter(hy)).map(cy),_=La(i.filter(dy)),b=La(i.filter(fy)),C=i.map(L=>L.attributes.captionServices).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:ry(g,s)};f>=0&&(A.minimumUpdatePeriod=f*1e3),e&&(A.locations=e),t&&(A.contentSteering=t),u==="dynamic"&&(A.suggestedPresentationDelay=h),n&&n.length>0&&(A.eventStream=n);const y=A.playlists.length===0,I=_.length?oy(_,s,y):null,D=b.length?uy(b,s):null,P=g.concat(Jl(I),Jl(D)),k=P.map(({timelineStarts:L})=>L);return A.timelineStarts=Gh(k),py(P,A.timelineStarts),I&&(A.mediaGroups.AUDIO.audio=I),D&&(A.mediaGroups.SUBTITLES.subs=D),C.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=ly(C)),r?sy({oldManifest:r,newManifest:A}):A},gy=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:u=0,minimumUpdatePeriod:h=0}=i,f=(s+r)/1e3,g=n+u,b=f+h-g;return Math.ceil((b*a-e)/t)},Wh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:u=1,periodStart:h}=i,f=[];let g=-1;for(let _=0;_<e.length;_++){const b=e[_],C=b.d,A=b.r||0,y=b.t||0;g<0&&(g=y),y&&y>g&&(g=y);let I;if(A<0){const k=_+1;k===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?I=gy(i,g,C):I=(n*a-g)/C:I=(e[k].t-g)/C}else I=A+1;const D=u+f.length+I;let P=u+f.length;for(;P<D;)f.push({number:P,duration:C/a,time:g,timeline:h}),g+=C,P++}return f},_y=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,yy=i=>(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},Zl=(i,e)=>i.replace(_y,yy(e)),Ty=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?qo(i):Wh(i,e),vy=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=sr({baseUrl:i.baseUrl,source:Zl(s.sourceURL,t),range:s.range});return Ty(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const u=Zl(i.media||"",t),h=i.timescale||1,f=i.presentationTimeOffset||0,g=i.periodStart+(a.time-f)/h;return{uri:u,timeline:a.timeline,duration:a.duration,resolvedUri:ko(i.baseUrl||"",u),map:r,number:a.number,presentationTime:g}})},by=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=sr({baseUrl:t,source:s.sourceURL,range:s.range}),n=sr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},xy=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Zi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(h=>by(i,h));let a;return t&&(a=qo(i)),e&&(a=Wh(i,e)),a.map((h,f)=>{if(n[f]){const g=n[f],_=i.timescale||1,b=i.presentationTimeOffset||0;return g.timeline=h.timeline,g.duration=h.duration,g.number=h.number,g.presentationTime=r+(h.time-b)/_,g}}).filter(h=>h)},Sy=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=vy,t=Ae(i,e.template)):e.base?(s=zh,t=Ae(i,e.base)):e.list&&(s=xy,t=Ae(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:u=1}=t;t.duration=a/u}else n.length?t.duration=n.reduce((a,u)=>Math.max(a,Math.ceil(u.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},Ey=i=>i.map(Sy),me=(i,e)=>Hh(i.childNodes).filter(({tagName:t})=>t===e),dr=i=>i.textContent.trim(),Cy=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Pi=i=>{const u=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!u)return 0;const[h,f,g,_,b,C]=u.slice(1);return parseFloat(h||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(g||0)*86400+parseFloat(_||0)*3600+parseFloat(b||0)*60+parseFloat(C||0)},Ay=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),ec={mediaPresentationDuration(i){return Pi(i)},availabilityStartTime(i){return Ay(i)/1e3},minimumUpdatePeriod(i){return Pi(i)},suggestedPresentationDelay(i){return Pi(i)},type(i){return i},timeShiftBufferDepth(i){return Pi(i)},start(i){return Pi(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return Cy(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Pi(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Se=i=>i&&i.attributes?Hh(i.attributes).reduce((e,t)=>{const s=ec[t.name]||ec.DEFAULT;return e[t.name]=s(t.value),e},{}):{},Dy={"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"},Nn=(i,e)=>e.length?Ji(i.map(function(t){return e.map(function(s){const r=dr(s),n=ko(t.baseUrl,r),a=Ae(Se(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Ho=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(_=>Ae({tag:"SegmentURL"},Se(_))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],u=t||r||e,h=u&&me(u,"Initialization")[0],f=e&&Se(e);f&&h?f.initialization=h&&Se(h):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const g={template:f,segmentTimeline:a&&me(a,"S").map(_=>Se(_)),list:t&&Ae(Se(t),{segmentUrls:s,initialization:Se(h)}),base:r&&Ae(Se(r),{initialization:Se(h)})};return Object.keys(g).forEach(_=>{g[_]||delete g[_]}),g},wy=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=Nn(e,r),a=Ae(i,Se(s)),u=Ho(s);return n.map(h=>({segmentInfo:Ae(t,u),attributes:Ae(a,h)}))},Iy=i=>i.reduce((e,t)=>{const s=Se(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=Dy[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=dr(n);e[r].pssh=a&&y_(a)}}return e},{}),ky=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[u,h]=a.split(":");u==="lang"?s.language=h:u==="er"?s.easyReader=Number(h):u==="war"?s.aspectRatio=Number(h):u==="3D"&&(s["3D"]=Number(h))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},Py=i=>Ji(me(i.node,"EventStream").map(e=>{const t=Se(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=Se(r),a=n.presentationTime||0,u=t.timescale||1,h=n.duration||0,f=a/u+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+h/u,messageData:dr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),Oy=(i,e,t)=>s=>{const r=Se(s),n=Nn(e,me(s,"BaseURL")),a=me(s,"Role")[0],u={role:Se(a)};let h=Ae(i,r,u);const f=me(s,"Accessibility")[0],g=ky(Se(f));g&&(h=Ae(h,{captionServices:g}));const _=me(s,"Label")[0];if(_&&_.childNodes.length){const I=_.childNodes[0].nodeValue.trim();h=Ae(h,{label:I})}const b=Iy(me(s,"ContentProtection"));Object.keys(b).length&&(h=Ae(h,{contentProtection:b}));const C=Ho(s),A=me(s,"Representation"),y=Ae(t,C);return Ji(A.map(wy(h,n,y)))},Ly=(i,e)=>(t,s)=>{const r=Nn(e,me(t.node,"BaseURL")),n=Ae(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),u=Ho(t.node);return Ji(a.map(Oy(n,r,u)))},Ry=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=Ae({serverURL:dr(i[0])},Se(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Ny=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,My=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(Zi.INVALID_NUMBER_OF_PERIOD);const u=me(i,"Location"),h=Se(i),f=Nn([{baseUrl:t}],me(i,"BaseURL")),g=me(i,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=s,h.clientOffset=r,u.length&&(h.locations=u.map(dr));const _=[];return a.forEach((b,C)=>{const A=Se(b),y=_[C-1];A.start=Ny({attributes:A,priorPeriodAttributes:y?y.attributes:null,mpdType:h.type}),_.push({node:b,attributes:A})}),{locations:h.locations,contentSteeringInfo:Ry(g,n),representationInfo:Ji(_.map(Ly(h,f))),eventStream:Ji(_.map(Py))}},Xh=i=>{if(i==="")throw new Error(Zi.DASH_EMPTY_MANIFEST);const e=new G_;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Zi.DASH_INVALID_XML);return s},By=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=Se(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.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":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Zi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Fy=(i,e={})=>{const t=My(Xh(i),e),s=Ey(t.representationInfo);return my({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Uy=i=>By(Xh(i));var Kh=Math.pow(2,32),$y=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*Kh+e.getUint32(4)},qy={getUint64:$y,MAX_UINT32:Kh},tc=qy.getUint64,jy=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;t.version===0?(t.earliestPresentationTime=e.getUint32(s),t.firstOffset=e.getUint32(s+4),s+=8):(t.earliestPresentationTime=tc(i.subarray(s)),t.firstOffset=tc(i.subarray(s+8)),s+=16),s+=2;var r=e.getUint16(s);for(s+=2;r>0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},Vy=jy;const Hy=os(Vy);var zy=G([73,68,51]),Gy=function(e,t){t===void 0&&(t=0),e=G(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Hs=function i(e,t){return t===void 0&&(t=0),e=G(e),e.length-t<10||!pe(e,zy,{offset:t})?t:(t+=Gy(e,t),i(e,t))},ic=function(e){return typeof e=="string"?dh(e):e},Wy=function(e){return Array.isArray(e)?e.map(function(t){return ic(t)}):[ic(e)]},Xy=function i(e,t,s){s===void 0&&(s=!1),t=Wy(t),e=G(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,u=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(s)break;h=e.length}var f=e.subarray(n+8,h);pe(u,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=h}return r},Xr={EBML:G([26,69,223,163]),DocType:G([66,130]),Segment:G([24,83,128,103]),SegmentInfo:G([21,73,169,102]),Tracks:G([22,84,174,107]),Track:G([174]),TrackNumber:G([215]),DefaultDuration:G([35,227,131]),TrackEntry:G([174]),TrackType:G([131]),FlagDefault:G([136]),CodecID:G([134]),CodecPrivate:G([99,162]),VideoTrack:G([224]),AudioTrack:G([225]),Cluster:G([31,67,182,117]),Timestamp:G([231]),TimestampScale:G([42,215,177]),BlockGroup:G([160]),BlockDuration:G([155]),Block:G([161]),SimpleBlock:G([163])},Za=[128,64,32,16,8,4,2,1],Ky=function(e){for(var t=1,s=0;s<Za.length&&!(e&Za[s]);s++)t++;return t},ln=function(e,t,s,r){s===void 0&&(s=!0),r===void 0&&(r=!1);var n=Ky(e[t]),a=e.subarray(t,t+n);return s&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Za[n-1]),{length:n,value:d_(a,{signed:r}),bytes:a}},sc=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?f_(e):e},Yy=function(e){return Array.isArray(e)?e.map(function(t){return sc(t)}):[sc(e)]},Qy=function i(e,t,s){if(s>=t.length)return t.length;var r=ln(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=ln(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},rc=function i(e,t){t=Yy(t),e=G(e);var s=[];if(!t.length)return s;for(var r=0;r<e.length;){var n=ln(e,r,!1),a=ln(e,r+n.length),u=r+n.length+a.length;a.value===127&&(a.value=Qy(n,e,u),a.value!==e.length&&(a.value-=u));var h=u+a.value>e.length?e.length:u+a.value,f=e.subarray(u,h);pe(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var g=n.length+a.length+f.length;r+=g}return s},Jy=G([0,0,0,1]),Zy=G([0,0,1]),eT=G([0,0,3]),tT=function(e){for(var t=[],s=1;s<e.length-2;)pe(e.subarray(s,s+3),eT)&&(t.push(s+2),s++),s++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(s=0;s<r;a++,s++)a===t[0]&&(a++,t.shift()),n[s]=e[a];return n},Yh=function(e,t,s,r){r===void 0&&(r=1/0),e=G(e),s=[].concat(s);for(var n=0,a,u=0;n<e.length&&(u<r||a);){var h=void 0;if(pe(e.subarray(n),Jy)?h=4:pe(e.subarray(n),Zy)&&(h=3),!h){n++;continue}if(u++,a)return tT(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+h]&31:t==="h265"&&(f=e[n+h]>>1&63),s.indexOf(f)!==-1&&(a=n+h),n+=h+(t==="h264"?1:2)}return e.subarray(0,0)},iT=function(e,t,s){return Yh(e,"h264",t,s)},sT=function(e,t,s){return Yh(e,"h265",t,s)},Ue={webm:G([119,101,98,109]),matroska:G([109,97,116,114,111,115,107,97]),flac:G([102,76,97,67]),ogg:G([79,103,103,83]),ac3:G([11,119]),riff:G([82,73,70,70]),avi:G([65,86,73]),wav:G([87,65,86,69]),"3gp":G([102,116,121,112,51,103]),mp4:G([102,116,121,112]),fmp4:G([115,116,121,112]),mov:G([102,116,121,112,113,116]),moov:G([109,111,111,118]),moof:G([109,111,111,102])},es={aac:function(e){var t=Hs(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Hs(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=rc(e,[Xr.EBML,Xr.DocType])[0];return pe(t,Ue.webm)},mkv:function(e){var t=rc(e,[Xr.EBML,Xr.DocType])[0];return pe(t,Ue.matroska)},mp4:function(e){if(es["3gp"](e)||es.mov(e))return!1;if(pe(e,Ue.mp4,{offset:4})||pe(e,Ue.fmp4,{offset:4})||pe(e,Ue.moof,{offset:4})||pe(e,Ue.moov,{offset:4}))return!0},mov:function(e){return pe(e,Ue.mov,{offset:4})},"3gp":function(e){return pe(e,Ue["3gp"],{offset:4})},ac3:function(e){var t=Hs(e);return pe(e,Ue.ac3,{offset:t})},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=Hs(e);return pe(e,Ue.flac,{offset:t})},ogg:function(e){return pe(e,Ue.ogg)},avi:function(e){return pe(e,Ue.riff)&&pe(e,Ue.avi,{offset:8})},wav:function(e){return pe(e,Ue.riff)&&pe(e,Ue.wav,{offset:8})},h264:function(e){return iT(e,7,3).length},h265:function(e){return sT(e,[32,33],3).length}},eo=Object.keys(es).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);eo.forEach(function(i){var e=es[i];es[i]=function(t){return e(G(t))}});var rT=es,zo=function(e){e=G(e);for(var t=0;t<eo.length;t++){var s=eo[t];if(rT[s](e))return s}return""},nT=function(e){return Xy(e,["moof"]).length>0},Go=9e4,Wo,Xo,Mn,Ko,Qh,Jh,Zh;Wo=function(i){return i*Go};Xo=function(i,e){return i*e};Mn=function(i){return i/Go};Ko=function(i,e){return i/e};Qh=function(i,e){return Wo(Ko(i,e))};Jh=function(i,e){return Xo(Mn(i),e)};Zh=function(i,e,t){return Mn(t?i:i-e)};var fi={ONE_SECOND_IN_TS:Go,secondsToVideoTs:Wo,secondsToAudioTs:Xo,videoTsToSeconds:Mn,audioTsToSeconds:Ko,audioTsToVideoTs:Qh,videoTsToAudioTs:Jh,metadataTsToSeconds:Zh};/**
24
- * @license
25
- * Video.js 8.22.0 <http://videojs.com/>
26
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
27
- * Available under Apache License Version 2.0
28
- * <https://github.com/videojs/video.js/blob/main/LICENSE>
29
- *
30
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
31
- * Available under Apache License Version 2.0
32
- * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
33
- */var to="8.22.0";const Ot={},Zt=function(i,e){return Ot[i]=Ot[i]||[],e&&(Ot[i]=Ot[i].concat(e)),Ot[i]},aT=function(i,e){Zt(i,e)},ed=function(i,e){const t=Zt(i).indexOf(e);return t<=-1?!1:(Ot[i]=Ot[i].slice(),Ot[i].splice(t,1),!0)},oT=function(i,e){Zt(i,[].concat(e).map(t=>{const s=(...r)=>(ed(i,s),t(...r));return s}))},cn={prefixed:!0},Zr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],nc=Zr[0];let zs;for(let i=0;i<Zr.length;i++)if(Zr[i][1]in q){zs=Zr[i];break}if(zs){for(let i=0;i<zs.length;i++)cn[nc[i]]=zs[i];cn.prefixed=zs[0]!==nc[0]}let He=[];const uT=(i,e,t)=>(s,r,n)=>{const a=e.levels[r],u=new RegExp(`^(${a})$`);let h=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(h=`%c${i}`,n.unshift(t)),n.unshift(h+":"),He){He.push([].concat(n));const g=He.length-1e3;He.splice(0,g>0?g:0)}if(!S.console)return;let f=S.console[s];!f&&s==="debug"&&(f=S.console.info||S.console.log),!(!f||!a||!u.test(s))&&f[Array.isArray(n)?"apply":"call"](S.console,n)};function io(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=uT(i,n,t),n.createLogger=(a,u,h)=>{const f=u!==void 0?u:e,g=h!==void 0?h:t,_=`${i} ${f} ${a}`;return io(_,f,g)},n.createNewLogger=(a,u,h)=>io(a,u,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>He?[].concat(He):[],n.history.filter=a=>(He||[]).filter(u=>new RegExp(`.*${a}.*`).test(u[0])),n.history.clear=()=>{He&&(He.length=0)},n.history.disable=()=>{He!==null&&(He.length=0,He=null)},n.history.enable=()=>{He===null&&(He=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const Q=io("VIDEOJS"),td=Q.createLogger,lT=Object.prototype.toString,id=function(i){return At(i)?Object.keys(i):[]};function Ui(i,e){id(i).forEach(t=>e(i[t],t))}function sd(i,e,t=0){return id(i).reduce((s,r)=>e(s,i[r],r),t)}function At(i){return!!i&&typeof i=="object"}function ts(i){return At(i)&&lT.call(i)==="[object Object]"&&i.constructor===Object}function ae(...i){const e={};return i.forEach(t=>{t&&Ui(t,(s,r)=>{if(!ts(s)){e[r]=s;return}ts(e[r])||(e[r]={}),e[r]=ae(e[r],s)})}),e}function rd(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Bn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var cT=Object.freeze({__proto__:null,each:Ui,reduce:sd,isObject:At,isPlain:ts,merge:ae,values:rd,defineLazyProperty:Bn});let Yo=!1,nd=null,pt=!1,ad,od=!1,$i=!1,qi=!1,Dt=!1,Qo=null,Fn=null;const hT=!!(S.cast&&S.cast.framework&&S.cast.framework.CastReceiverContext);let ud=null,hn=!1,Un=!1,dn=!1,$n=!1,fn=!1,pn=!1,mn=!1;const rr=!!(ls()&&("ontouchstart"in S||S.navigator.maxTouchPoints||S.DocumentTouch&&S.document instanceof S.DocumentTouch)),Xt=S.navigator&&S.navigator.userAgentData;Xt&&Xt.platform&&Xt.brands&&(pt=Xt.platform==="Android",$i=!!Xt.brands.find(i=>i.brand==="Microsoft Edge"),qi=!!Xt.brands.find(i=>i.brand==="Chromium"),Dt=!$i&&qi,Qo=Fn=(Xt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Un=Xt.platform==="Windows");if(!qi){const i=S.navigator&&S.navigator.userAgent||"";Yo=/iPod/i.test(i),nd=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),pt=/Android/i.test(i),ad=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),od=/Firefox/i.test(i),$i=/Edg/i.test(i),qi=/Chrome/i.test(i)||/CriOS/i.test(i),Dt=!$i&&qi,Qo=Fn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),ud=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),fn=/Tizen/i.test(i),pn=/Web0S/i.test(i),mn=fn||pn,hn=/Safari/i.test(i)&&!Dt&&!pt&&!$i&&!mn,Un=/Windows/i.test(i),dn=/iPad/i.test(i)||hn&&rr&&!/iPhone/i.test(i),$n=/iPhone/i.test(i)&&!dn}const Oe=$n||dn||Yo,qn=(hn||Oe)&&!Dt;var ld=Object.freeze({__proto__:null,get IS_IPOD(){return Yo},get IOS_VERSION(){return nd},get IS_ANDROID(){return pt},get ANDROID_VERSION(){return ad},get IS_FIREFOX(){return od},get IS_EDGE(){return $i},get IS_CHROMIUM(){return qi},get IS_CHROME(){return Dt},get CHROMIUM_VERSION(){return Qo},get CHROME_VERSION(){return Fn},IS_CHROMECAST_RECEIVER:hT,get IE_VERSION(){return ud},get IS_SAFARI(){return hn},get IS_WINDOWS(){return Un},get IS_IPAD(){return dn},get IS_IPHONE(){return $n},get IS_TIZEN(){return fn},get IS_WEBOS(){return pn},get IS_SMART_TV(){return mn},TOUCH_ENABLED:rr,IS_IOS:Oe,IS_ANY_SAFARI:qn});function ac(i){return typeof i=="string"&&!!i.trim()}function dT(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ls(){return q===S.document}function cs(i){return At(i)&&i.nodeType===1}function cd(){try{return S.parent!==S.self}catch{return!0}}function hd(i){return function(e,t){if(!ac(e))return q[i](null);ac(t)&&(t=q.querySelector(t));const s=cs(t)?t:q;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=q.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ii(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&Jo(r,s),r}function ii(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function so(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function Ks(i,e){return dT(e),i.classList.contains(e)}function gi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function jn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(Q.warn("removeClass was called with an element that doesn't exist"),null)}function dd(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function fd(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Qt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function pd(i,e){return i.getAttribute(e)}function is(i,e,t){i.setAttribute(e,t)}function Vn(i,e){i.removeAttribute(e)}function md(){q.body.focus(),q.onselectstart=function(){return!1}}function gd(){q.onselectstart=function(){return!0}}function ss(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(rs(i,"height"))),t.width||(t.width=parseFloat(rs(i,"width"))),t}}function nr(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==q[cn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Hn(i,e){const t={x:0,y:0};if(Oe){let g=i;for(;g&&g.nodeName.toLowerCase()!=="html";){const _=rs(g,"transform");if(/^matrix/.test(_)){const b=_.slice(7,-1).split(/,\s/).map(Number);t.x+=b[4],t.y+=b[5]}else if(/^matrix3d/.test(_)){const b=_.slice(9,-1).split(/,\s/).map(Number);t.x+=b[12],t.y+=b[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&S.WebKitCSSMatrix){const b=S.getComputedStyle(g.assignedSlot.parentElement).transform,C=new S.WebKitCSSMatrix(b);t.x+=C.m41,t.y+=C.m42}g=g.parentNode||g.host}}const s={},r=nr(e.target),n=nr(i),a=n.width,u=n.height;let h=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,Oe&&(f-=t.x,h-=t.y)),s.y=1-Math.max(0,Math.min(1,h/u)),s.x=Math.max(0,Math.min(1,f/a)),s}function _d(i){return At(i)&&i.nodeType===3}function zn(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function yd(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),cs(e)||_d(e))return e;if(typeof e=="string"&&/\S/.test(e))return q.createTextNode(e)}).filter(e=>e)}function Jo(i,e){return yd(e).forEach(t=>i.appendChild(t)),i}function Td(i,e){return Jo(zn(i),e)}function ar(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const ei=hd("querySelector"),vd=hd("querySelectorAll");function rs(i,e){if(!i||!e)return"";if(typeof S.getComputedStyle=="function"){let t;try{t=S.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function bd(i){[...q.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=q.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=q.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var xd=Object.freeze({__proto__:null,isReal:ls,isEl:cs,isInFrame:cd,createEl:W,textContent:ii,prependTo:so,hasClass:Ks,addClass:gi,removeClass:jn,toggleClass:dd,setAttributes:fd,getAttributes:Qt,getAttribute:pd,setAttribute:is,removeAttribute:Vn,blockTextSelection:md,unblockTextSelection:gd,getBoundingClientRect:ss,findPosition:nr,getPointerPosition:Hn,isTextNode:_d,emptyEl:zn,normalizeContent:yd,appendContent:Jo,insertContent:Td,isSingleLeftClick:ar,$:ei,$$:vd,computedStyle:rs,copyStyleSheetsToWindow:bd});let Sd=!1,ro;const fT=function(){if(ro.options.autoSetup===!1)return;const i=Array.prototype.slice.call(q.getElementsByTagName("video")),e=Array.prototype.slice.call(q.getElementsByTagName("audio")),t=Array.prototype.slice.call(q.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r<n;r++){const a=s[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&ro(a);else{no(1);break}}else Sd||no(1)};function no(i,e){ls()&&(e&&(ro=e),S.setTimeout(fT,i))}function ao(){Sd=!0,S.removeEventListener("load",ao)}ls()&&(q.readyState==="complete"?ao():S.addEventListener("load",ao));const Ed=function(i){const e=q.createElement("style");return e.className=i,e},Cd=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var je=new WeakMap;const pT=3;let mT=pT;function at(){return mT++}function oc(i,e){if(!je.has(i))return;const t=je.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&je.delete(i)}function Zo(i,e,t,s){t.forEach(function(r){i(e,r,s)})}function Gn(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const s=i||S.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in s)r.includes(n)||n==="returnValue"&&s.preventDefault||(i[n]=s[n]);if(i.target||(i.target=i.srcElement||q),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){s.preventDefault&&s.preventDefault(),i.returnValue=!1,s.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),i.cancelBubble=!0,s.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const n=q.documentElement,a=q.body;i.pageX=i.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let Kr;const gT=function(){if(typeof Kr!="boolean"){Kr=!1;try{const i=Object.defineProperty({},"passive",{get(){Kr=!0}});S.addEventListener("test",null,i),S.removeEventListener("test",null,i)}catch{}}return Kr},_T=["touchstart","touchmove"];function tt(i,e,t){if(Array.isArray(e))return Zo(tt,i,e,t);je.has(i)||je.set(i,{});const s=je.get(i);if(s.handlers||(s.handlers={}),s.handlers[e]||(s.handlers[e]=[]),t.guid||(t.guid=at()),s.handlers[e].push(t),s.dispatcher||(s.disabled=!1,s.dispatcher=function(r,n){if(s.disabled)return;r=Gn(r);const a=s.handlers[r.type];if(a){const u=a.slice(0);for(let h=0,f=u.length;h<f&&!r.isImmediatePropagationStopped();h++)try{u[h].call(i,r,n)}catch(g){Q.error(g)}}}),s.handlers[e].length===1)if(i.addEventListener){let r=!1;gT()&&_T.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Le(i,e,t){if(!je.has(i))return;const s=je.get(i);if(!s.handlers)return;if(Array.isArray(e))return Zo(Le,i,e,t);const r=function(a,u){s.handlers[u]=[],oc(a,u)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);oc(i,e)}}function hs(i,e,t){const s=je.has(i)?je.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=Gn(e),s.dispatcher&&s.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)hs.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){je.has(e.target)||je.set(e.target,{});const n=je.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Wn(i,e,t){if(Array.isArray(e))return Zo(Wn,i,e,t);const s=function(){Le(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||at(),tt(i,e,s)}function eu(i,e,t){const s=function(){Le(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||at(),tt(i,e,s)}var yT=Object.freeze({__proto__:null,fixEvent:Gn,on:tt,off:Le,trigger:hs,one:Wn,any:eu});const ot=30,le=function(i,e,t){e.guid||(e.guid=at());const s=e.bind(i);return s.guid=t?t+"_"+e.guid:e.guid,s},wt=function(i,e){let t=S.performance.now();return function(...r){const n=S.performance.now();n-t>=e&&(i(...r),t=n)}},Ad=function(i,e,t,s=S){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const u=this,h=arguments;let f=function(){r=null,f=null,t||i.apply(u,h)};!r&&t&&i.apply(u,h),s.clearTimeout(r),r=s.setTimeout(f,e)};return a.cancel=n,a};var TT=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ot,bind_:le,throttle:wt,debounce:Ad});let Fs;class it{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},tt(this,e,t),this.addEventListener=s}off(e,t){Le(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Wn(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},eu(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Gn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),hs(this,e)}queueTrigger(e){Fs||(Fs=new Map);const t=e.type||e;let s=Fs.get(this);s||(s=new Map,Fs.set(this,s));const r=s.get(t);s.delete(t),S.clearTimeout(r);const n=S.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Fs.delete(this)),this.trigger(e)},0);s.set(t,n)}}it.prototype.allowedEvents_={};it.prototype.addEventListener=it.prototype.on;it.prototype.removeEventListener=it.prototype.off;it.prototype.dispatchEvent=it.prototype.trigger;const Xn=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Nt=i=>i instanceof it||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),vT=(i,e)=>{Nt(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},oo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,gn=(i,e,t)=>{if(!i||!i.nodeName&&!Nt(i))throw new Error(`Invalid target for ${Xn(e)}#${t}; must be a DOM node or evented object.`)},Dd=(i,e,t)=>{if(!oo(i))throw new Error(`Invalid event type for ${Xn(e)}#${t}; must be a non-empty string or array.`)},wd=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Xn(e)}#${t}; must be a function.`)},Ra=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),gn(r,i,t),Dd(n,i,t),wd(a,i,t),a=le(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},ci=(i,e,t,s)=>{gn(i,i,e),i.nodeName?yT[e](i,t,s):i[e](t,s)},bT={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ra(this,i,"on");if(ci(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,ci(this,"on","dispose",n),ci(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ra(this,i,"one");if(e)ci(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ci(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ra(this,i,"any");if(e)ci(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ci(t,"any",s,n)}},off(i,e,t){if(!i||oo(i))Le(this.eventBusEl_,i,e);else{const s=i,r=e;gn(s,this,"off"),Dd(r,this,"off"),wd(t,this,"off"),t=le(this,t),this.off("dispose",t),s.nodeName?(Le(s,r,t),Le(s,"dispose",t)):Nt(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){gn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!oo(t))throw new Error(`Invalid event type for ${Xn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return hs(this.eventBusEl_,i,e)}};function tu(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,bT),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&je.has(s)&&je.delete(s)}),S.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const xT={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ui(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Nt(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function Id(i,e){return Object.assign(i,xT),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Nt(i)&&i.on("statechanged",i.handleStateChanged),i}const Ys=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},ye=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},kd=function(i,e){return ye(i)===ye(e)};var ST=Object.freeze({__proto__:null,toLowerCase:Ys,toTitleCase:ye,titleCaseEquals:kd});class M{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ae({},this.options_),t=this.options_=ae(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${at()}`}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(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(tu(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Id(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(s),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 t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].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_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=ae(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],u=r&&r.split("-")[0],h=n&&n[u];let f=s;return a&&a[e]?f=a[e]:h&&h[e]&&(f=h[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(g,_){const b=t[_-1];let C=b;return typeof b>"u"&&(C=g),C})),f}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((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s<e.length;s++)if(t=t.getChild(e[s]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const s="http://www.w3.org/2000/svg",r=W("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=q.createElementNS(s,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=q.createElementNS(s,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},s=this.children_.length){let r,n;if(typeof e=="string"){n=ye(e);const a=t.componentClass||n;t.name=n;const u=M.getComponent(a);if(!u)throw new Error(`Component ${a} does not exist`);if(typeof u!="function")return null;r=new u(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(s,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&ye(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[Ys(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[s+1]&&(this.children_[s+1].el_?a=this.children_[s+1].el_:cs(this.children_[s+1])&&(a=this.children_[s+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ye(e.name())]=null,this.childNameIndex_[Ys(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const u=a.name;let h=a.opts;if(t[u]!==void 0&&(h=t[u]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const f=this.addChild(u,h);f&&(this[u]=f)};let r;const n=M.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(u){return typeof u=="string"?a===u:a===u.name})})).map(a=>{let u,h;return typeof a=="string"?(u=a,h=e[u]||this.options_[u]||{}):(u=a.name,h=a),{name:u,opts:h}}).filter(a=>{const u=M.getComponent(a.opts.componentClass||ye(a.name));return u&&!n.isTech(u)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ei(e,t||this.contentEl())}$$(e,t){return vd(e,t||this.contentEl())}hasClass(e){return Ks(this.el_,e)}addClass(...e){gi(this.el_,...e)}removeClass(...e){jn(this.el_,...e)}toggleClass(e,t){dd(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 pd(this.el_,e)}setAttribute(e,t){is(this.el_,e,t)}removeAttribute(e){Vn(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,s){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",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+ye(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=rs(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${ye(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={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};return{boundingClientRect:t,center:s}}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;const s=10,r=200;let n;this.on("touchstart",function(u){u.touches.length===1&&(t={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=S.performance.now(),n=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)n=!1;else if(t){const h=u.touches[0].pageX-t.pageX,f=u.touches[0].pageY-t.pageY;Math.sqrt(h*h+f*f)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(u){t=null,n===!0&&S.performance.now()-e<r&&(u.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=le(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const s=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",s),this.on("touchcancel",s)}setTimeout(e,t){var s;return e=le(this,e),this.clearTimersOnDispose_(),s=S.setTimeout(()=>{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),S.clearTimeout(e)),e}setInterval(e,t){e=le(this,e),this.clearTimersOnDispose_();const s=S.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),S.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=le(this,e),t=S.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=le(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),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),S.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((s,r)=>this[t](r))}),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(n){const a=S.getComputedStyle(n,null),u=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||S.getComputedStyle(n).height==="0px"||S.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(q.documentElement.clientWidth||S.innerWidth)||a.y<0||a.y>(q.documentElement.clientHeight||S.innerHeight))return!1;let u=q.elementFromPoint(a.x,a.y);for(;u;){if(u===n)return!0;if(u.parentNode)u=u.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=M.getComponent("Tech"),r=s&&s.isTech(t),n=M===t||M.prototype.isPrototypeOf(t.prototype);if(r||!n){let u;throw r?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=ye(e),M.components_||(M.components_={});const a=M.getComponent("Player");if(e==="Player"&&a&&a.players){const u=a.players,h=Object.keys(u);if(u&&h.length>0){for(let f=0;f<h.length;f++)if(u[h[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return M.components_[e]=t,M.components_[Ys(e)]=t,t}static getComponent(e){if(!(!e||!M.components_))return M.components_[e]}}M.registerComponent("Component",M);function ET(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function uc(i,e,t,s){return ET(i,s,t.length-1),t[s][e]}function Na(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:uc.bind(null,"start",0,i),end:uc.bind(null,"end",1,i)},S.Symbol&&S.Symbol.iterator&&(e[S.Symbol.iterator]=()=>(i||[]).values()),e}function ft(i,e){return Array.isArray(i)?Na(i):i===void 0||e===void 0?Na():Na([[i,e]])}const Pd=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let iu=Pd;function Od(i){iu=i}function Ld(){iu=Pd}function bi(i,e=i){return iu(i,e)}var CT=Object.freeze({__proto__:null,createTimeRanges:ft,createTimeRange:ft,setFormatTime:Od,resetFormatTime:Ld,formatTime:bi});function Rd(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=ft(0,0));for(let n=0;n<i.length;n++)s=i.start(n),r=i.end(n),r>e&&(r=e),t+=r-s;return t/e}function _e(i){if(i instanceof _e)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:At(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=_e.defaultMessages[this.code]||"")}_e.prototype.code=0;_e.prototype.message="";_e.prototype.status=null;_e.prototype.metadata=null;_e.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];_e.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."};_e.MEDIA_ERR_CUSTOM=0;_e.prototype.MEDIA_ERR_CUSTOM=0;_e.MEDIA_ERR_ABORTED=1;_e.prototype.MEDIA_ERR_ABORTED=1;_e.MEDIA_ERR_NETWORK=2;_e.prototype.MEDIA_ERR_NETWORK=2;_e.MEDIA_ERR_DECODE=3;_e.prototype.MEDIA_ERR_DECODE=3;_e.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.MEDIA_ERR_ENCRYPTED=5;_e.prototype.MEDIA_ERR_ENCRYPTED=5;function Qs(i){return i!=null&&typeof i.then=="function"}function vt(i){Qs(i)&&i.then(null,e=>{})}const uo=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},AT=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=uo(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(uo))},DT=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var lc={textTracksToJson:AT,jsonToTextTracks:DT,trackToJson_:uo};const Ma="vjs-modal-dialog";class ds extends M{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Ma}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Ma}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ii(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`${Ma} 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}const 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;const 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"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),Td(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),zn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=q.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=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;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(s===t[n]){r=n;break}q.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_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof S.HTMLAnchorElement||t instanceof S.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof S.HTMLInputElement||t instanceof S.HTMLSelectElement||t instanceof S.HTMLTextAreaElement||t instanceof S.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof S.HTMLIFrameElement||t instanceof S.HTMLObjectElement||t instanceof S.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}ds.prototype.options_={pauseOnOpen:!0,temporary:!0};M.registerComponent("ModalDialog",ds);class ns extends it{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const 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})},Nt(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this[s],t.off&&t.off(),this.tracks_.splice(s,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}ns.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in ns.prototype.allowedEvents_)ns.prototype["on"+i]=null;const Ba=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class wT extends ns{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Ba(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ba(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ba(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 Fa=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class IT extends ns{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Fa(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Fa(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Fa(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 Nd extends ns{addTrack(e){super.addTrack(e),this.queueChange_||(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_))}}class kT{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t<s;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const 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 s=0,r=this.trackElements_.length;s<r;s++)if(e===this.trackElements_[s].track){t=this.trackElements_[s];break}return t}removeTrackElement_(e){for(let t=0,s=this.trackElements_.length;t<s;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 _n{constructor(e){_n.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let s=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(s=t;s<r;s++)n.call(this,s)}getCueById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}const PT={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},OT={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},LT={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},cc={disabled:"disabled",hidden:"hidden",showing:"showing"};class su extends it{constructor(e={}){super();const t={id:e.id||"vjs_track_"+at(),kind:e.kind||"",language:e.language||""};let s=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return s},set(r){r!==s&&(s=r,this.trigger("labelchange"))}})}}const ru=function(i){return new URL(i,q.baseURI)},Md=function(i){return new URL(i,q.baseURI).href},nu=function(i){if(typeof i=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(i);if(t)return t.pop().toLowerCase()}return""},Kn=function(i,e=S.location){return ru(i).origin!==e.origin};var RT=Object.freeze({__proto__:null,parseUrl:ru,getAbsoluteURL:Md,getFileExtension:nu,isCrossOrigin:Kn});const hc=function(i,e){const t=new S.WebVTT.Parser(S,S.vttjs,S.WebVTT.StringDecoder()),s=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){s.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),s.length>0&&(S.console&&S.console.groupCollapsed&&S.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>Q.error(r)),S.console&&S.console.groupEnd&&S.console.groupEnd()),t.flush()},dc=function(i,e){const t={uri:i},s=Kn(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),rh(t,le(this,function(n,a,u){if(n)return Q.error(n,a);e.loaded_=!0,typeof S.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type==="vttjserror"){Q.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return hc(u,e)}):hc(u,e)}))};class fr extends su{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=ae(e,{kind:LT[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=cc[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new _n(this.cues_),a=new _n(this.activeCues_);let u=!1;this.timeupdateHandler=le(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(f){cc[f]&&s!==f&&(s=f,!this.preload_&&s!=="disabled"&&this.cues.length===0&&dc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),g=[];for(let _=0,b=this.cues.length;_<b;_++){const C=this.cues[_];C.startTime<=f&&C.endTime>=f&&g.push(C)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let _=0;_<g.length;_++)this.activeCues_.indexOf(g[_])===-1&&(u=!0);return this.activeCues_=g,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")&&dc(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_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new S.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const s=this.tech_.textTracks();for(let r=0;r<s.length;r++)s[r]!==this&&s[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const s=this.cues_[t];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}fr.prototype.allowedEvents_={cuechange:"cuechange"};class Bd extends su{constructor(e={}){const t=ae(e,{kind:OT[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"enabled",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Fd extends su{constructor(e={}){const t=ae(e,{kind:PT[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"selected",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Ut extends it{constructor(e={}){super();let t;const s=new fr(e);this.kind=s.kind,this.src=s.src,this.srclang=s.language,this.label=s.label,this.default=s.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return s}}}),t=Ut.NONE,s.addEventListener("loadeddata",()=>{t=Ut.LOADED,this.trigger({type:"load",target:this})})}}Ut.prototype.allowedEvents_={load:"load"};Ut.NONE=0;Ut.LOADING=1;Ut.LOADED=2;Ut.ERROR=3;const nt={audio:{ListClass:wT,TrackClass:Bd,capitalName:"Audio"},video:{ListClass:IT,TrackClass:Fd,capitalName:"Video"},text:{ListClass:Nd,TrackClass:fr,capitalName:"Text"}};Object.keys(nt).forEach(function(i){nt[i].getterName=`${i}Tracks`,nt[i].privateName=`${i}Tracks_`});const as={remoteText:{ListClass:Nd,TrackClass:fr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:kT,TrackClass:Ut,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},$e=Object.assign({},nt,as);as.names=Object.keys(as);nt.names=Object.keys(nt);$e.names=[].concat(as.names).concat(nt.names);function NT(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new $e.text.TrackClass(r);return n.addTrack(a),a}class Y extends M{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),$e.names.forEach(s=>{const r=$e[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}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 $e.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(le(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ft(0,0)}bufferedPercent(){return Rd(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(nt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new _e(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?ft(0,0):ft()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){nt.names.forEach(e=>{const t=nt[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!S.WebVTT)if(q.body.contains(this.el())){if(!this.options_["vtt.js"]&&ts(Dl)&&Object.keys(Dl).length>0){this.trigger("vttjsloaded");return}const e=q.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}),S.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=u=>e.addTrack(u.track),r=u=>e.removeTrack(u.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let u=0;u<e.length;u++){const h=e[u];h.removeEventListener("cuechange",n),h.mode==="showing"&&h.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",s),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let u=0;u<e.length;u++)e[u].removeEventListener("cuechange",n)})}addTextTrack(e,t,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return NT(this,e,t,s)}createRemoteTextTrack(e){const t=ae(e,{tech:this});return new as.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const s=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const 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){const t=at();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 Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ye(e),Y.techs_[e]=t,Y.techs_[Ys(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=ye(e),S&&S.videojs&&S.videojs[e])return Q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),S.videojs[e]}}}$e.names.forEach(function(i){const e=$e[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;n<s.length;n++)if(r=s[n].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,s){const r=i.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,s),n)return r[a];return null},i.canPlaySource=function(t,s){const r=i.selectSourceHandler(t,s);return r?r.canHandleSource(t,s):""},["seekable","seeking","duration"].forEach(function(t){const s=this[t];typeof s=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):s.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let s=i.selectSourceHandler(t,this.options_);s||(i.nativeSourceHandler?s=i.nativeSourceHandler:Q.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),s!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=s.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};M.registerComponent("Tech",Y);Y.registerTech("Tech",Y);Y.defaultTechOrder_=[];const _i={},yn={},Tn={};function MT(i,e){_i[i]=_i[i]||[],_i[i].push(e)}function BT(i,e,t){i.setTimeout(()=>hi(e,_i[e.type],t,i),1)}function FT(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function UT(i,e,t){return i.reduceRight(au(t),e[t]())}function $T(i,e,t,s){return e[t](i.reduce(au(t),s))}function fc(i,e,t,s=null){const r="call"+ye(t),n=i.reduce(au(r),s),a=n===Tn,u=a?null:e[t](n);return VT(i,t,u,a),u}const qT={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},jT={setCurrentTime:1,setMuted:1,setVolume:1},pc={play:1,pause:1};function au(i){return(e,t)=>e===Tn?Tn:t[i]?t[i](e):e}function VT(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function HT(i){yn.hasOwnProperty(i.id())&&delete yn[i.id()]}function zT(i,e){const t=yn[i.id()];let s=null;if(t==null)return s=e(i),yn[i.id()]=[[e,s]],s;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(s=a)}return s===null&&(s=e(i),t.push([e,s])),s}function hi(i={},e=[],t,s,r=[],n=!1){const[a,...u]=e;if(typeof a=="string")hi(i,_i[a],t,s,r,n);else if(a){const h=zT(s,a);if(!h.setSource)return r.push(h),hi(i,u,t,s,r,n);h.setSource(Object.assign({},i),function(f,g){if(f)return hi(i,u,t,s,r,n);r.push(h),hi(g,i.type===g.type?u:_i[g.type],t,s,r,n)})}else u.length?hi(i,u,t,s,r,n):n?t(i,r):hi(i,_i["*"],t,s,r,!0)}const GT={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"},vn=function(i=""){const e=nu(i);return GT[e.toLowerCase()]||""},WT=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r<s.length;r++){const n=s[r];if(n.type&&n.src&&n.src===e)return n.type}return vn(e)},Ud=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=Ud(t),Array.isArray(t)?e=e.concat(t):At(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[mc({src:i})]:At(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[mc(i)]:i=[];return i};function mc(i){if(!i.type){const e=vn(i.src);e&&(i.type=e)}return i}var XT=`<svg xmlns="http://www.w3.org/2000/svg">
34
- <defs>
35
- <symbol viewBox="0 0 48 48" id="vjs-icon-play">
36
- <path d="M16 10v28l22-14z"></path>
37
- </symbol>
38
- <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
39
- <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
40
- </symbol>
41
- <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
42
- <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
43
- </symbol>
44
- <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
45
- <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
46
- </symbol>
47
- <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
48
- <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
49
- </symbol>
50
- <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
51
- <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
52
- </symbol>
53
- <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
54
- <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
55
- </symbol>
56
- <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
57
- <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
58
- </symbol>
59
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
60
- <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
61
- </symbol>
62
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
63
- <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
64
- </symbol>
65
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
66
- <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
67
- </symbol>
68
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
69
- <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
70
- </symbol>
71
- <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
72
- <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
73
- </symbol>
74
- <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
75
- <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
76
- </symbol>
77
- <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
78
- <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
79
- </symbol>
80
- <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
81
- <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
82
- </symbol>
83
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
84
- <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
85
- </symbol>
86
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
87
- <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
88
- </symbol>
89
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
90
- <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
91
- </symbol>
92
- <symbol viewBox="0 0 48 48" id="vjs-icon-share">
93
- <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
94
- </symbol>
95
- <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
96
- <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
97
- </symbol>
98
- <symbol viewBox="0 0 48 48" id="vjs-icon-square">
99
- <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
100
- </symbol>
101
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
102
- <circle cx="24" cy="24" r="20"></circle>
103
- </symbol>
104
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
105
- <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
106
- </symbol>
107
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
108
- <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
109
- </symbol>
110
- <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
111
- <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
112
- </symbol>
113
- <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
114
- <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
115
- </symbol>
116
- <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
117
- <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
118
- </symbol>
119
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
120
- <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
121
- </symbol>
122
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
123
- <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
124
- </symbol>
125
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
126
- <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
127
- </symbol>
128
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
129
- <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
130
- </symbol>
131
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
132
- <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
133
- </symbol>
134
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
135
- <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
136
- </symbol>
137
- <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
138
- <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
139
- </symbol>
140
- <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
141
- <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
142
- </symbol>
143
- <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
144
- <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
145
- </symbol>
146
- <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
147
- <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
148
- </symbol>
149
- <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
150
- <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
151
- </symbol>
152
- <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
153
- <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
154
- </symbol>
155
- <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
156
- <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
157
- <path fill="none" d="M-1-3h24v24H-1z"></path>
158
- </symbol>
159
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
160
- <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
161
- </symbol>
162
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
163
- <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
164
- </symbol>
165
- <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
166
- <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
167
- </symbol>
168
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
169
- <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
170
- </symbol>
171
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
172
- <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>
173
- </symbol>
174
- </defs>
175
- </svg>`;const gc=fn?10009:pn?461:8,Oi={codes:{play:415,pause:19,ff:417,rw:412,back:gc},names:{415:"play",19:"pause",417:"ff",412:"rw",[gc]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},_c=5;class KT extends it{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){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Oi.isEventKey(t,"play")||Oi.isEventKey(t,"pause")||Oi.isEventKey(t,"ff")||Oi.isEventKey(t,"rw")){t.preventDefault();const s=Oi.getEventName(t);this.performMediaAction_(s)}else Oi.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()+_c);break;case"rw":this.userSeek_(this.player_.currentTime()-_c);break}}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){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((u,h)=>{t.push({name:()=>"ModalButton"+(h+1),el:()=>u,getPositions:()=>{const f=u.getBoundingClientRect(),g={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},_={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:g,center:_}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>u.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r<s.children.length;r++){const n=s.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const s of this.focusableComponents)if(s.el()===t)return s}}add(e){const 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){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const u=a.getPositions().center,h=this.calculateDistance_(e,u,s);h<r&&(r=h,n=a)}return n}isInDirection_(e,t,s){switch(s){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,s){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(s){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class YT extends M{constructor(e,t,s){const r=ae({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const u=ye(a[n]);let h=Y.getTech(u);if(u||(h=M.getComponent(u)),h&&h.isSupported()){e.loadTech_(u);break}}else e.src(t.playerOptions.sources)}}M.registerComponent("MediaLoader",YT);class Yn extends M{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=s=>this.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("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";const s=this.localize(e);this.controlText_=e,ii(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&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"),typeof this.tabIndex_<"u"&&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)}}M.registerComponent("ClickableComponent",Yn);class lo extends Yn{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")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;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?vt(this.player_.play()):this.player_.pause())}}lo.prototype.crossorigin=lo.prototype.crossOrigin;M.registerComponent("PosterImage",lo);const rt="#222",yc="#ccc",QT={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 Ua(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function _t(i,e,t){try{i.style[e]=t}catch{return}}function Tc(i){return i?`${i}px`:""}class JT extends M{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=S.screen.orientation||S,u=S.screen.orientation?"change":"orientationchange";a.addEventListener(u,n),e.on("dispose",()=>a.removeEventListener(u,n));const h=this.options_.playerOptions.tracks||[];for(let f=0;f<h.length;f++)this.player_.addRemoteTextTrack(h[f],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage;let r,n,a;for(let u=0;u<t.length;u++){const h=t[u];s&&s.enabled&&s.language&&s.language===h.language&&h.kind in e?h.kind===s.kind?a=h:a||(a=h):s&&!s.enabled?(a=null,r=null,n=null):h.default&&(h.kind==="descriptions"&&!r?r=h:h.kind in e&&!n&&(n=h))}a?a.mode="showing":n?n.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 S.WebVTT=="function"&&S.WebVTT.processCues(S,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let u=0;u<e.length;++u){const h=e[u];h.mode==="showing"&&a.push(h)}this.updateForTrack(a);return}let s=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?s=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):s&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s)),!S.CSS.supports("inset","10px")){const a=this.el_,u=a.querySelectorAll(".vjs-text-track-cue"),h=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",_t(a,"position","relative"),_t(a,"height",f-h+"px"),_t(a,"top","unset"),mn?_t(a,"bottom",f+"px"):_t(a,"bottom","0px"),u.length>0&&u.forEach(g=>{if(g.style.inset){const _=g.style.inset.split(" ");_.length===3&&Object.assign(g.style,{top:_[0],right:_[1],bottom:_[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!S.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),_t(this.el_,"insetInline",Tc(n)),_t(this.el_,"insetBlock",Tc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&_t(a.firstChild,"color",Ua(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&_t(a.firstChild,"backgroundColor",Ua(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?_t(a,"backgroundColor",Ua(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${rt}, 2px 2px 4px ${rt}, 2px 2px 5px ${rt}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${rt}, 2px 2px ${rt}, 3px 3px ${rt}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${yc}, 0 1px ${yc}, -1px -1px ${rt}, 0 -1px ${rt}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${rt}, 0 0 4px ${rt}, 0 0 4px ${rt}, 0 0 4px ${rt}`)),t.fontPercent&&t.fontPercent!==1){const u=S.parseFloat(a.style.fontSize);a.style.fontSize=u*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=QT[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof S.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}S.WebVTT.processCues(S,t,this.el_);for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;gi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:s)),r.language&&is(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}M.registerComponent("TextTrackDisplay",JT);class ZT extends M{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),s=W("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(s),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}M.registerComponent("LoadingSpinner",ZT);class Re extends Yn{createEl(e,t={},s={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),s=Object.assign({type:"button"},s);const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const s=this.constructor.name;return Q.warn(`Adding an actionable (user controllable) child to a Button (${s}) is not supported; use a ClickableComponent instead.`),M.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}M.registerComponent("Button",Re);class $d extends Re{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",s=>this.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){vt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Qs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}$d.prototype.controlText_="Play Video";M.registerComponent("BigPlayButton",$d);class ev extends Re{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)}}M.registerComponent("CloseButton",ev);class qd extends Re{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?vt(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",t=>this.handleSeeked(t))}}qd.prototype.controlText_="Play";M.registerComponent("PlayToggle",qd);class fs extends M{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("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=bi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Q.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_=q.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}fs.prototype.labelText_="Time";fs.prototype.controlText_="Time";M.registerComponent("TimeDisplay",fs);class ou extends fs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}ou.prototype.labelText_="Current Time";ou.prototype.controlText_="Current Time";M.registerComponent("CurrentTimeDisplay",ou);class uu extends fs{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}uu.prototype.labelText_="Duration";uu.prototype.controlText_="Duration";M.registerComponent("DurationDisplay",uu);class tv extends M{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}M.registerComponent("TimeDivider",tv);class lu extends fs{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}lu.prototype.labelText_="Remaining Time";lu.prototype.controlText_="Remaining Time";M.registerComponent("RemainingTimeDisplay",lu);class iv extends M{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(q.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()}}M.registerComponent("LiveDisplay",iv);class jd extends Re{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("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()}}jd.prototype.controlText_="Seek to live, currently playing live";M.registerComponent("SeekToLive",jd);function pr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var sv=Object.freeze({__proto__:null,clamp:pr});class cu extends M{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),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;const 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={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Dt&&e.preventDefault(),md(),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){const t=this.bar.el_.ownerDocument;gd(),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;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(pr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Hn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?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()):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")}}M.registerComponent("Slider",cu);const $a=(i,e)=>pr(i/e*100,0,100).toFixed(2)+"%";class rv extends M{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=q.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,u=$a(n,r);this.percent_!==u&&(this.el_.style.width=u,ii(this.percentageEl_,u),this.percent_=u);for(let h=0;h<s.length;h++){const f=s.start(h),g=s.end(h);let _=a[h];_||(_=this.el_.appendChild(W()),a[h]=_),!(_.dataset.start===f&&_.dataset.end===g)&&(_.dataset.start=f,_.dataset.end=g,_.style.left=$a(f,n),_.style.width=$a(g-f,n))}for(let h=a.length;h>s.length;h--)this.el_.removeChild(a[h-1]);a.length=s.length})}}M.registerComponent("LoadProgressBar",rv);class nv extends M{constructor(e,t){super(e,t),this.update=wt(le(this,this.update),ot)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=nr(this.el_),n=ss(this.player_.el()),a=e.width*t;if(!n||!r)return;let u=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,u=a);let f=r.width/2;u<f?f+=f-u:h<f&&(f=h),f<0?f=0:f>r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(s)}write(e){ii(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const u=this.player_.liveTracker.liveWindow(),h=u-t*u;n=(h<1?"":"-")+bi(h,u)}else n=bi(s,a);this.update(e,t,n),r&&r()})}}M.registerComponent("TimeTooltip",nv);class hu extends M{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=wt(le(this,this.update),ot)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}hu.prototype.options_={children:[]};!Oe&&!pt&&hu.prototype.options_.children.push("timeTooltip");M.registerComponent("PlayProgressBar",hu);class Vd extends M{constructor(e,t){super(e,t),this.update=wt(le(this,this.update),ot)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}Vd.prototype.options_={children:["timeTooltip"]};M.registerComponent("MouseTimeDisplay",Vd);class Qn extends cu{constructor(e,t){t=ae(Qn.prototype.options_,t),t.children=[...t.children];const s=e.options_.disableSeekWhileScrubbingOnMobile&&(Oe||pt);(!Oe&&!pt||s)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbingOnMobile_=s,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=le(this,this.update),this.update=wt(this.update_,ot),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 q&&"visibilityState"in q&&this.on(q,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){q.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.updateInterval=this.setInterval(this.update,ot))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(q.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[bi(s,n),bi(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(ss(this.el()),this.getProgress())}),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()}getPercent(){if(this.pendingSeekTime_)return this.pendingSeekTime_/this.player_.duration();const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){ar(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbingOnMobile_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!ar(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),u=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=u&&(s=u),s<=a&&(s=a+.1),s===1/0)return}this.shouldDisableSeekWhileScrubbingOnMobile_?this.pendingSeekTime_=s:this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime_&&(this.userSeek_(this.pendingSeekTime_),this.pendingSeekTime_=null),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?vt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const 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();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}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 q&&"visibilityState"in q&&this.off(q,"visibilitychange",this.toggleVisibility_),super.dispose()}}Qn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};M.registerComponent("SeekBar",Qn);class Hd extends M{constructor(e,t){super(e,t),this.handleMouseMove=wt(le(this,this.handleMouseMove),ot),this.throttledHandleMouseSeek=wt(le(this,this.handleMouseSeek),ot),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=nr(n);let u=Hn(n,e).x;u=pr(u,0,1),r&&r.update(a,u),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const 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())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&vt(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(){const 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){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.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){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Hd.prototype.options_={children:["seekBar"]};M.registerComponent("ProgressControl",Hd);class zd extends Re{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){q.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in S?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 q.exitPictureInPicture=="function"&&super.show()}}zd.prototype.controlText_="Picture-in-Picture";M.registerComponent("PictureInPictureToggle",zd);class Gd extends Re{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),q[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()}}Gd.prototype.controlText_="Fullscreen";M.registerComponent("FullscreenToggle",Gd);const av=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class ov extends M{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}M.registerComponent("VolumeLevel",ov);class uv extends M{constructor(e,t){super(e,t),this.update=wt(le(this,this.update),ot)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=ss(this.el_),a=ss(this.player_.el()),u=e.width*t;if(!a||!n)return;const h=e.left-a.left+u,f=e.width-u+(a.right-e.right);let g=n.width/2;h<g?g+=g-h:f<g&&(g=f),g<0?g=0:g>n.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){ii(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}M.registerComponent("VolumeLevelTooltip",uv);class Wd extends M{constructor(e,t){super(e,t),this.update=wt(le(this,this.update),ot)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Wd.prototype.options_={children:["volumeLevelTooltip"]};M.registerComponent("MouseVolumeLevelDisplay",Wd);class Jn extends cu{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),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){ar(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=ss(s),n=this.vertical();let a=Hn(s,e);a=n?a.y:a.x,a=pr(a,0,1),t.update(r,a,n)}ar(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){const 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_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Jn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Oe&&!pt&&Jn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Jn.prototype.playerEvent="volumechange";M.registerComponent("VolumeBar",Jn);class Xd extends M{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||ts(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),av(this,e),this.throttledHandleMouseMove=wt(le(this,this.handleMouseMove),ot),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),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){const 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){const 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)}}Xd.prototype.options_={children:["volumeBar"]};M.registerComponent("VolumeControl",Xd);const lv=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Kd extends Re{constructor(e,t){super(e,t),lv(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Oe&&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),jn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),gi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Kd.prototype.controlText_="Mute";M.registerComponent("MuteToggle",Kd);class Yd extends M{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||ts(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),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"),tt(q,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Le(q,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Yd.prototype.options_={children:["muteToggle","volumeControl"]};M.registerComponent("VolumePanel",Yd);class Qd extends Re{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(){const 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;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Qd.prototype.controlText_="Skip Forward";M.registerComponent("SkipForward",Qd);class Jd extends Re{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(){const 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){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Jd.prototype.controlText_="Skip Backward";M.registerComponent("SkipBackward",Jd);class Zd extends M{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof M&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof M&&(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){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tt(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||q.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.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){const 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())}}M.registerComponent("Menu",Zd);class du extends M{constructor(e,t={}){super(e,t),this.menuButton_=new Re(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Re.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tt(q,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const 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(){const e=new Zd(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:ye(this.options_.title),tabIndex:-1}),s=new M(this.player_,{el:t});e.addItem(s)}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){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Re.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"),Le(q,"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"),Oe&&cd())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()}}M.registerComponent("MenuButton",du);class fu extends du{constructor(e,t){const s=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!s)return;const r=le(this,this.update);s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),s.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r),s.removeEventListener("labelchange",r)})}}M.registerComponent("TrackButton",fu);class mr extends Yn{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,s){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),s),n=W("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,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))}}M.registerComponent("MenuItem",mr);class gr extends mr{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...u)=>{this.handleTracksChange.apply(this,u)},a=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let u;this.on(["tap","click"],function(){if(typeof S.Event!="object")try{u=new S.Event("change")}catch{}u||(u=q.createEvent("Event"),u.initEvent("change",!0,!0)),r.dispatchEvent(u)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r<s.length;r++){const n=s[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.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()}}M.registerComponent("TextTrackMenuItem",gr);class ef extends gr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(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){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}M.registerComponent("OffTextTrackMenuItem",ef);class ps extends fu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=gr){let s;this.label_&&(s=`${this.label_} off`),e.push(new ef(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const u=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${a.kind}-menu-item`),e.push(u)}}return e}}M.registerComponent("TextTrackButton",ps);class tf extends mr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=s,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}M.registerComponent("ChaptersTrackMenuItem",tf);class pu extends ps{constructor(e,t,s){super(e,t,s),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.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;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(ye(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s<r;s++){const n=t[s],a=new tf(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}pu.prototype.kind_="chapters";pu.prototype.controlText_="Chapters";M.registerComponent("ChaptersButton",pu);class mu extends ps{constructor(e,t,s){super(e,t,s),this.setIcon("audio-description");const r=e.textTracks(),n=le(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let s=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){s=!0;break}}s?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}mu.prototype.kind_="descriptions";mu.prototype.controlText_="Descriptions";M.registerComponent("DescriptionsButton",mu);class gu extends ps{constructor(e,t,s){super(e,t,s),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}gu.prototype.kind_="subtitles";gu.prototype.controlText_="Subtitles";M.registerComponent("SubtitlesButton",gu);class _u extends gr{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()}}M.registerComponent("CaptionSettingsMenuItem",_u);class yu extends ps{constructor(e,t,s){super(e,t,s),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new _u(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}yu.prototype.kind_="captions";yu.prototype.controlText_="Captions";M.registerComponent("CaptionsButton",yu);class sf extends gr{createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}M.registerComponent("SubsCapsMenuItem",sf);class Tu extends ps{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(ye(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 _u(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,sf),e}}Tu.prototype.kinds_=["captions","subtitles"];Tu.prototype.controlText_="Subtitles";M.registerComponent("SubsCapsButton",Tu);class rf extends mr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}M.registerComponent("AudioTrackMenuItem",rf);class nf extends fu{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;const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];e.push(new rf(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}nf.prototype.controlText_="Audio Track";M.registerComponent("AudioTrackButton",nf);class vu extends mr{constructor(e,t){const s=t.rate,r=parseFloat(s,10);t.label=s,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=s,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}vu.prototype.contentElType="button";M.registerComponent("PlaybackRateMenuItem",vu);class af extends du{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("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(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new vu(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const 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")}}af.prototype.controlText_="Playback Rate";M.registerComponent("PlaybackRateMenuButton",af);class of extends M{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}M.registerComponent("Spacer",of);class cv extends of{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}M.registerComponent("CustomControlSpacer",cv);class uf extends M{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}uf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};M.registerComponent("ControlBar",uf);class lf extends ds{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}lf.prototype.options_=Object.assign({},ds.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});M.registerComponent("ErrorDisplay",lf);class cf extends M{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(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${at()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}M.registerComponent("TextTrackSelect",cf);class yi extends M{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],u=a.className,h=a.id.replace("%s",this.options_.id_);let f=null;const g=`vjs_select_${at()}`;if(this.options_.type==="colors"){f=W("span",{className:u});const b=W("label",{id:h,className:"vjs-label",textContent:this.localize(a.label)});b.setAttribute("for",g),f.appendChild(b)}const _=new cf(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(_),this.options_.type==="colors"&&(f.appendChild(_.el()),this.el().appendChild(f))}}createEl(){return W("fieldset",{className:this.options_.className})}}M.registerComponent("TextTrackFieldset",yi);class hf extends M{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new yi(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new yi(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new yi(e,{id_:s,legendId:`captions-window-${s}`,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 W("div",{className:"vjs-track-settings-colors"})}}M.registerComponent("TextTrackSettingsColors",hf);class df extends M{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new yi(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new yi(e,{id_:s,legendId:`captions-edge-style-${s}`,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(n);const a=new yi(e,{id_:s,legendId:`captions-font-family-${s}`,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 W("div",{className:"vjs-track-settings-font"})}}M.registerComponent("TextTrackSettingsFont",df);class ff extends M{constructor(e,t={}){super(e,t);const s=this.localize("restore all settings to the default values"),r=new Re(e,{controlText:s,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new Re(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}M.registerComponent("TrackSettingsControls",ff);const qa="vjs-text-track-settings",vc=["#000","Black"],bc=["#00F","Blue"],xc=["#0FF","Cyan"],Sc=["#0F0","Green"],Ec=["#F0F","Magenta"],Cc=["#F00","Red"],Ac=["#FFF","White"],Dc=["#FF0","Yellow"],ja=["1","Opaque"],Va=["0.5","Semi-Transparent"],wc=["0","Transparent"],Jt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[vc,Ac,Cc,Sc,bc,Dc,Ec,xc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[ja,Va,wc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ac,vc,Cc,Sc,bc,Dc,Ec,xc],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:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[ja,Va],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:[wc,Va,ja],className:"vjs-window-opacity vjs-opacity"}};Jt.windowColor.options=Jt.backgroundColor.options;function pf(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function hv(i,e){const t=i.options[i.options.selectedIndex].value;return pf(t,e)}function dv(i,e,t){if(e){for(let s=0;s<i.options.length;s++)if(pf(i.options[s].value,t)===e){i.selectedIndex=s;break}}}class fv extends ds{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=W("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){const t=new hf(e,{textTrackComponentid:this.id_,selectConfigs:Jt,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const s=new df(e,{textTrackComponentid:this.id_,selectConfigs:Jt,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(s);const r=new ff(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()}),Ui(Jt,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 sd(Jt,(e,t,s)=>{const r=hv(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Ui(Jt,(t,s)=>{dv(this.$(t.selector),e[s],t.parser)})}setDefaults(){Ui(Jt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(S.localStorage.getItem(qa))}catch(t){Q.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?S.localStorage.setItem(qa,JSON.stringify(e)):S.localStorage.removeItem(qa)}catch(t){Q.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}M.registerComponent("TextTrackSettings",fv);class pv extends M{constructor(e,t){let s=t.ResizeObserver||S.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=ae({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||S.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Ad(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Le(this,"resize",n),Le(this,"unload",a),a=null};tt(this.el_.contentWindow,"unload",a),tt(this.el_.contentWindow,"resize",n)},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()}}M.registerComponent("ResizeManager",pv);const mv={trackingThreshold:20,liveTolerance:15};class gv extends M{constructor(e,t){const s=ae(mv,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(S.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>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.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ot),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(){const 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(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const 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(){const 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()}}M.registerComponent("LiveTracker",gv);class _v extends M{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${at()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${at()}`})},W("div",{className:"vjs-title-bar"},{},rd(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],u=s[r];zn(a),n&&ii(a,n),t&&(t.removeAttribute(u),n&&t.setAttribute(u,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}M.registerComponent("TitleBar",_v);const yv={initialDisplay:4e3,position:[],takeFocus:!1};class Tv extends Re{constructor(e,t){t=ae(yv,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("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()}}M.registerComponent("TransientButton",Tv);const co=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&s.indexOf(a)===-1&&s.push(a)}return s.length?(s.length===1&&(r=s[0]),i.triggerSourceset(r),!0):!1},vv=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=q.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=q.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",S.Element.prototype.appendChild.call(this,t),this.innerHTML}}),mf=(i,e)=>{let t={};for(let s=0;s<i.length&&(t=Object.getOwnPropertyDescriptor(i[s],e),!(t&&t.set&&t.get));s++);return t.enumerable=!0,t.configurable=!0,t},bv=i=>mf([i.el(),S.HTMLMediaElement.prototype,S.Element.prototype,vv],"innerHTML"),Ic=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=bv(i),r=n=>(...a)=>{const u=n.apply(e,a);return co(i),u};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",ae(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},xv=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Md(S.Element.prototype.getAttribute.call(this,"src")):""},set(i){return S.Element.prototype.setAttribute.call(this,"src",i),i}}),Sv=i=>mf([i.el(),S.HTMLMediaElement.prototype,xv],"src"),Ev=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=Sv(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",ae(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const u=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),u},e.load=()=>{const n=r.call(e);return co(i)||(i.triggerSourceset(""),Ic(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):co(i)||Ic(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class V extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const u=[];for(;a--;){const h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),!r&&!this.el_.hasAttribute("crossorigin")&&Kn(h.src)&&(r=!0)):u.push(h))}for(let h=0;h<u.length;h++)this.el_.removeChild(u[h])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&Q.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
176
- This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(rr||$n)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),V.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){Ev(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const s=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};s(),e.addEventListener("change",s),this.on("dispose",()=>e.removeEventListener("change",s));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=nt[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:u=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[as.remoteText.getterName]().trigger(h)},addtrack(u){r.addTrack(u.track)},removetrack(u){r.removeTrack(u.track)}},a=function(){const u=[];for(let h=0;h<r.length;h++){let f=!1;for(let g=0;g<s.length;g++)if(s[g]===r[h]){f=!0;break}f||u.push(r[h])}for(;u.length;)r.removeTrack(u.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(u=>{const h=n[u];s.addEventListener(u,h),this.on("dispose",f=>s.removeEventListener(u,h))}),this.on("loadstart",a),this.on("dispose",u=>this.off("loadstart",a))}proxyNativeTracks_(){nt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),V.disposeMediaElement(e),e=s}else{e=q.createElement("video");const s=this.options_.tag&&Qt(this.options_.tag),r=ae({},s);(!rr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,fd(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&is(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s<t.length;s++){const r=t[s],n=this.options_[r];typeof n<"u"&&(n?is(e,r,r):Vn(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let s=!1;const r=function(){s=!0};this.on("loadstart",r);const n=function(){s||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),s||this.trigger("loadstart")});return}const 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(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&qn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Q(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&pt&&Dt&&this.el_.currentTime===0){const 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;const 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(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)vt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}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 Q.error("Invalid source URL."),!1;const s={src:e};t&&(s.type=t);const r=W("source",{},s);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return Q.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const s of t)if(s.src===e)return this.el_.removeChild(s),!0;return Q.warn(`No matching source element found with src: ${e}`),!1}reset(){V.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=q.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){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),S.performance&&(e.creationTime=S.performance.now()),e}}Bn(V,"TEST_VID",function(){if(!ls())return;const i=q.createElement("video"),e=q.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});V.isSupported=function(){try{V.TEST_VID.volume=.5}catch{return!1}return!!(V.TEST_VID&&V.TEST_VID.canPlayType)};V.canPlayType=function(i){return V.TEST_VID.canPlayType(i)};V.canPlaySource=function(i,e){return V.canPlayType(i.type)};V.canControlVolume=function(){try{const i=V.TEST_VID.volume;V.TEST_VID.volume=i/2+.1;const e=i!==V.TEST_VID.volume;return e&&Oe?(S.setTimeout(()=>{V&&V.prototype&&(V.prototype.featuresVolumeControl=i!==V.TEST_VID.volume)}),!1):e}catch{return!1}};V.canMuteVolume=function(){try{const i=V.TEST_VID.muted;return V.TEST_VID.muted=!i,V.TEST_VID.muted?is(V.TEST_VID,"muted","muted"):Vn(V.TEST_VID,"muted","muted"),i!==V.TEST_VID.muted}catch{return!1}};V.canControlPlaybackRate=function(){if(pt&&Dt&&Fn<58)return!1;try{const i=V.TEST_VID.playbackRate;return V.TEST_VID.playbackRate=i/2+.1,i!==V.TEST_VID.playbackRate}catch{return!1}};V.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(q.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(q.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(q.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(q.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};V.supportsNativeTextTracks=function(){return qn||Oe&&Dt};V.supportsNativeVideoTracks=function(){return!!(V.TEST_VID&&V.TEST_VID.videoTracks)};V.supportsNativeAudioTracks=function(){return!!(V.TEST_VID&&V.TEST_VID.audioTracks)};V.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([i,e]){Bn(V.prototype,i,()=>V[e](),!0)});V.prototype.featuresVolumeControl=V.canControlVolume();V.prototype.movingMediaElementInDOM=!Oe;V.prototype.featuresFullscreenResize=!0;V.prototype.featuresProgressEvents=!0;V.prototype.featuresTimeupdateEvents=!0;V.prototype.featuresVideoFrameCallback=!!(V.TEST_VID&&V.TEST_VID.requestVideoFrameCallback);V.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};V.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){V.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){V.prototype["set"+ye(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){V.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){V.prototype["set"+ye(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){V.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(V);V.nativeSourceHandler={};V.nativeSourceHandler.canPlayType=function(i){try{return V.TEST_VID.canPlayType(i)}catch{return""}};V.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return V.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=nu(i.src);return V.nativeSourceHandler.canPlayType(`video/${t}`)}return""};V.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};V.nativeSourceHandler.dispose=function(){};V.registerSourceHandler(V.nativeSourceHandler);Y.registerTech("Html5",V);const gf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ha={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ho=["tiny","xsmall","small","medium","large","xlarge","huge"],en={};ho.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;en[i]=`vjs-layout-${e}`});const Cv={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class de extends M{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${at()}`,t=Object.assign(de.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=td(this.id_),this.fsApi_=cn,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 new 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&&Qt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(u){a[u.toLowerCase()]=t.languages[u]}),this.languages_=a}else this.languages_=de.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(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),tu(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tt(q,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=ae(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const u=new S.DOMParser().parseFromString(XT,"image/svg+xml");if(u.querySelector("parsererror"))Q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=u.documentElement;f.style.display="none",this.el_.appendChild(f),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 KT(this),this.addClass("vjs-spatial-navigation-enabled")),rr&&this.addClass("vjs-touch-enabled"),Oe||this.addClass("vjs-workinghover"),de.players[this.id_]=this;const n=to.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),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"),Le(q,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Le(q,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),de.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_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),HT(this),$e.names.forEach(e=>{const t=$e[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Qt(e);if(r){for(t=this.el_=e,e=this.tag=q.createElement("video");t.children.length;)e.appendChild(t.firstChild);Ks(t,"video-js")||gi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(h=>{try{e[h]=t[h]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Dt&&Un&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(h){r&&h==="class"||t.setAttribute(h,n[h]),r&&e.setAttribute(h,n[h])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>ld[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),S.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ed("vjs-styles-dimensions");const h=ei(".vjs-styles-defaults"),f=ei("head");f.insertBefore(this.styleEl_,h?h.nextSibling:f.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);const u=e.getElementsByTagName("a");for(let h=0;h<u.length;h++){const f=u.item(h);gi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(t,e),so(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Q.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}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){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Q.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Nt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),vT(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 new 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(S.VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(u>=0&&(f.width=u),h>=0&&(f.height=h));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),Cd(this.styleEl_,`
177
- .${r} {
178
- width: ${e}px;
179
- height: ${t}px;
180
- }
181
-
182
- .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
183
- padding-top: ${a*100}%;
184
- }
185
- `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=ye(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,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};$e.names.forEach(h=>{const f=$e[h];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[s]),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);const u=Y.getTech(e);if(!u)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new u(a),this.tech_.ready(le(this,this.handleTechReady_),!0),lc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),gf.forEach(h=>{this.on(this.tech_,h,f=>this[`handleTech${ye(h)}_`](f))}),Object.keys(Ha).forEach(h=>{this.on(this.tech_,h,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ha[h]}_`].bind(this),event:f});return}this[`handleTech${Ha[h]}_`](f)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,f)=>this.handleTechFullscreenChange_(h,f)),this.on(this.tech_,"fullscreenerror",(h,f)=>this.handleTechFullscreenError_(h,f)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&so(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){$e.names.forEach(e=>{const t=$e[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=lc.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&&Q.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
186
- See https://github.com/videojs/video.js/issues/2617 for more info.
187
- `),this.tech_}version(){return{"video.js":to}}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.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Qs(a))return a.catch(u=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Qs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Qs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=WT(this,t)),this.cache_.source=ae({},e,{src:t,type:s});const r=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),u=[];for(let h=0;h<a.length;h++){const f=Qt(a[h]);n.push(f),f.src&&f.src===t&&u.push(f.src)}u.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}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");const 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()?vt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.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()&&!q.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){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=q[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.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_(){const 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 jT)return $T(this.middleware_,this.tech_,e,t);if(e in pc)return fc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw Q(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in qT)return UT(this.middleware_,this.tech_,e);if(e in pc)return fc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Q(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=vt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(qn||Oe);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||ft(0,0)}scrubbing(e){if(typeof e>"u")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;if(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_);return}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?this.cache_.duration:NaN;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=ft(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=ft(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 Rd(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}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);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}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;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",u),t.off("fullscreenchange",a)}function a(){n(),s()}function u(f,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",u);const h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(s,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){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(h,f){r(),s(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const u=e.exitFullscreenHelper_();u&&(u.then(r,r),u.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=q[this.fsApi_.exitFullscreen]();return e&&vt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=q.documentElement.style.overflow,tt(q,"keydown",this.boundFullWindowOnEscKey_),q.documentElement.style.overflow="hidden",gi(q.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,Le(q,"keydown",this.boundFullWindowOnEscKey_),q.documentElement.style.overflow=this.docOrigOverflow,jn(q.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_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&S.documentPictureInPicture){const e=q.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(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),S.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(bd(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",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in q&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(S.documentPictureInPicture&&S.documentPictureInPicture.window)return S.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in q)return q.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=M.getComponent("FullscreenToggle");q[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),M.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),M.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s<r.length;s++){const n=r[s];let a=Y.getTech(n);if(a||(a=M.getComponent(n)),!a){Q.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(u=>[u,Y.getTech(u)]).filter(([u,h])=>h?h.isSupported():(Q.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(u,h,f){let g;return u.some(_=>h.some(b=>{if(g=f(_,b),g)return!0})),g};let r;const n=u=>(h,f)=>u(f,h),a=([u,h],f)=>{if(h.canPlaySource(f,this.options_[u.toLowerCase()]))return{source:f,tech:u}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=Ud(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),BT(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}FT(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?kd(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(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();vt(e.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}),Nt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const 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;return}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=typeof t>"u"?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;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(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){const 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(Zt("beforeerror").forEach(t=>{const s=t(this,e);if(!(At(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new _e(e),this.addClass("vjs-error"),Q.error(`(CODE:${this.error_.code} ${_e.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Zt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=le(this,this.reportUserActivity),n=function(_){(_.screenX!==t||_.screenY!==s)&&(t=_.screenX,s=_.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},u=function(_){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",u),this.on("mouseleave",u);const h=this.getChild("controlBar");h&&!Oe&&!pt&&(h.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const _=this.options_.inactivityTimeout;_<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))};this.setInterval(g,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const 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");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),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){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).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,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(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(),Nt(this)&&this.trigger("languagechange"))}languages(){return ae(de.prototype.options_.languages,this.languages_)}toJSON(){const e=ae(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s<t.length;s++){let r=t[s];r=ae(r),r.player=void 0,e.tracks[s]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const s=new ds(this,t);return this.addChild(s),s.on("dispose",()=>{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;s<ho.length;s++){const r=ho[s],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(en[e]),this.addClass(en[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},Cv,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const 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 en[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const s=this.crossOrigin();this.reset(),this.cache_.media=ae(e);const{artist:r,artwork:n,description:a,poster:u,src:h,textTracks:f,title:g}=this.cache_.media;!n&&u&&(this.cache_.media.artwork=[{src:u,type:vn(u)}]),s&&this.crossOrigin(s),h&&this.src(h),u&&this.poster(u),Array.isArray(f)&&f.forEach(_=>this.addRemoteTextTrack(_,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:vn(r.poster)}]),r}return ae(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Qt(e),r=s["data-setup"];if(Ks(e,"vjs-fill")&&(s.fill=!0),Ks(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){Q.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,u=n.length;a<u;a++){const h=n[a],f=h.nodeName.toLowerCase();f==="source"?t.sources.push(Qt(h)):f==="track"&&t.tracks.push(Qt(h))}}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(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}$e.names.forEach(function(i){const e=$e[i];de.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});de.prototype.crossorigin=de.prototype.crossOrigin;de.players={};const Us=S.navigator;de.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Us&&(Us.languages&&Us.languages[0]||Us.userLanguage||Us.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};gf.forEach(function(i){de.prototype[`handleTech${ye(i)}_`]=function(){return this.trigger(i)}});M.registerComponent("Player",de);const bn="plugin",ji="activePlugins_",Ni={},xn=i=>Ni.hasOwnProperty(i),tn=i=>xn(i)?Ni[i]:void 0,_f=(i,e)=>{i[ji]=i[ji]||{},i[ji][e]=!0},Sn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},Av=function(i,e){const t=function(){Sn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return _f(this,i),Sn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},kc=(i,e)=>(e.prototype.name=i,function(...t){Sn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,Sn(this,s.getEventHash()),s});class Xe{constructor(e){if(this.constructor===Xe)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),tu(this),delete this.trigger,Id(this,this.constructor.defaultState),_f(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 hs(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[ji][e]=!1,this.player=this.state=null,t[e]=kc(e,Ni[e])}static isBasic(e){const t=typeof e=="string"?tn(e):e;return typeof t=="function"&&!Xe.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(xn(e))Q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(de.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Ni[e]=t,e!==bn&&(Xe.isBasic(t)?de.prototype[e]=Av(e,t):de.prototype[e]=kc(e,t)),t}static deregisterPlugin(e){if(e===bn)throw new Error("Cannot de-register base plugin.");xn(e)&&(delete Ni[e],delete de.prototype[e])}static getPlugins(e=Object.keys(Ni)){let t;return e.forEach(s=>{const r=tn(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=tn(e);return t&&t.VERSION||""}}Xe.getPlugin=tn;Xe.BASE_PLUGIN_NAME=bn;Xe.registerPlugin(bn,Xe);de.prototype.usingPlugin=function(i){return!!this[ji]&&this[ji][i]===!0};de.prototype.hasPlugin=function(i){return!!xn(i)};function Dv(i,e){let t=!1;return function(...s){return t||Q.warn(i),t=!0,e.apply(this,s)}}function mt(i,e,t,s){return Dv(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var wv={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 yf=i=>i.indexOf("#")===0?i.slice(1):i;function O(i,e,t){let s=O.getPlayer(i);if(s)return e&&Q.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?ei("#"+yf(i)):i;if(!cs(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof S.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Q.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Zt("beforesetup").forEach(h=>{const f=h(r,ae(e));if(!At(f)||Array.isArray(f)){Q.error("please return an object in beforesetup hooks");return}e=ae(e,f)});const u=M.getComponent("Player");return s=new u(r,e,t),Zt("setup").forEach(h=>h(s)),s}O.hooks_=Ot;O.hooks=Zt;O.hook=aT;O.hookOnce=oT;O.removeHook=ed;if(S.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ls()){let i=ei(".vjs-styles-defaults");if(!i){i=Ed("vjs-styles-defaults");const e=ei("head");e&&e.insertBefore(i,e.firstChild),Cd(i,`
188
- .video-js {
189
- width: 300px;
190
- height: 150px;
191
- }
192
-
193
- .vjs-fluid:not(.vjs-audio-only-mode) {
194
- padding-top: 56.25%
195
- }
196
- `)}}no(1,O);O.VERSION=to;O.options=de.prototype.options_;O.getPlayers=()=>de.players;O.getPlayer=i=>{const e=de.players;let t;if(typeof i=="string"){const s=yf(i),r=e[s];if(r)return r;t=ei("#"+s)}else t=i;if(cs(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};O.getAllPlayers=()=>Object.keys(de.players).map(i=>de.players[i]).filter(Boolean);O.players=de.players;O.getComponent=M.getComponent;O.registerComponent=(i,e)=>(Y.isTech(e)&&Q.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),M.registerComponent.call(M,i,e));O.getTech=Y.getTech;O.registerTech=Y.registerTech;O.use=MT;Object.defineProperty(O,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(O.middleware,"TERMINATOR",{value:Tn,writeable:!1,enumerable:!0});O.browser=ld;O.obj=cT;O.mergeOptions=mt(9,"videojs.mergeOptions","videojs.obj.merge",ae);O.defineLazyProperty=mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Bn);O.bind=mt(9,"videojs.bind","native Function.prototype.bind",le);O.registerPlugin=Xe.registerPlugin;O.deregisterPlugin=Xe.deregisterPlugin;O.plugin=(i,e)=>(Q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Xe.registerPlugin(i,e));O.getPlugins=Xe.getPlugins;O.getPlugin=Xe.getPlugin;O.getPluginVersion=Xe.getPluginVersion;O.addLanguage=function(i,e){return i=(""+i).toLowerCase(),O.options.languages=ae(O.options.languages,{[i]:e}),O.options.languages[i]};O.log=Q;O.createLogger=td;O.time=CT;O.createTimeRange=mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ft);O.createTimeRanges=mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ft);O.formatTime=mt(9,"videojs.formatTime","videojs.time.formatTime",bi);O.setFormatTime=mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",Od);O.resetFormatTime=mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ld);O.parseUrl=mt(9,"videojs.parseUrl","videojs.url.parseUrl",ru);O.isCrossOrigin=mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Kn);O.EventTarget=it;O.any=eu;O.on=tt;O.one=Wn;O.off=Le;O.trigger=hs;O.xhr=rh;O.TextTrack=fr;O.AudioTrack=Bd;O.VideoTrack=Fd;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{O[i]=function(){return Q.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),xd[i].apply(null,arguments)}});O.computedStyle=mt(9,"videojs.computedStyle","videojs.dom.computedStyle",rs);O.dom=xd;O.fn=TT;O.num=sv;O.str=ST;O.url=RT;O.Error=wv;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class Iv{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(s){t.enabled_(s)}}),t}}class En extends O.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;const s=this.levels_.length;return t=new Iv(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this.levels_.splice(s,1)[0],this.selectedIndex_===s?this.selectedIndex_=-1:this.selectedIndex_>s&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;t<s;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}En.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in En.prototype.allowedEvents_)En.prototype["on"+i]=null;var Tf="4.1.0";const kv=function(i,e){const t=i.qualityLevels,s=new En,r=function(){s.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>s,i.qualityLevels.VERSION=Tf,s},vf=function(i){return kv(this,O.obj.merge({},i))};O.registerPlugin("qualityLevels",vf);vf.VERSION=Tf;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const Ge=X0,Cn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,ut=i=>O.log.debug?O.log.debug.bind(O,"VHS:",`${i} >`):function(){};function te(...i){const e=O.obj||O;return(e.merge||e.mergeOptions).apply(e,i)}function De(...i){const e=O.time||O;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function Pv(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
197
- `;for(let t=0;t<i.length;t++){const s=i.start(t),r=i.end(t);e+=`${s} --> ${r}. Duration (${r-s})
198
- `}return e}const bt=1/30,xt=bt*3,bf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s<i.length;s++)e(i.start(s),i.end(s))&&t.push([i.start(s),i.end(s)]);return De(t)},Mi=function(i,e){return bf(i,function(t,s){return t-xt<=e&&s+xt>=e})},Yr=function(i,e){return bf(i,function(t){return t-bt>=e})},Ov=function(i){if(i.length<2)return De();const e=[];for(let t=1;t<i.length;t++){const s=i.end(t-1),r=i.start(t);e.push([s,r])}return De(e)},Lv=function(i,e){let t=null,s=null,r=0;const n=[],a=[];if(!i||!i.length||!e||!e.length)return De();let u=i.length;for(;u--;)n.push({time:i.start(u),type:"start"}),n.push({time:i.end(u),type:"end"});for(u=e.length;u--;)n.push({time:e.start(u),type:"start"}),n.push({time:e.end(u),type:"end"});for(n.sort(function(h,f){return h.time-f.time}),u=0;u<n.length;u++)n[u].type==="start"?(r++,r===2&&(t=n[u].time)):n[u].type==="end"&&(r--,r===1&&(s=n[u].time)),t!==null&&s!==null&&(a.push([t,s]),t=null,s=null);return De(a)},xf=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},Rv=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},pi=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},Nv=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},za=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},bu=function(i,e){let t=0;if(!i||!i.length)return t;for(let s=0;s<i.length;s++){const r=i.start(s),n=i.end(s);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},xu=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},fo=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),Sf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Ef=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Cf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Sf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},Mv=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=xu(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},Bv=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(s=i.segments[r],typeof s.start<"u")return{result:s.start-t,precise:!0};if(t+=xu(i,s),typeof s.end<"u")return{result:s.end-t,precise:!0}}return{result:-1,precise:!1}},Af=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const s=Mv(i,e);if(s.precise)return s.result;const r=Bv(i,e);return r.precise?r.result:s.result+t},Df=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return S.Infinity}return Af(i,e,t)},Js=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n<Math.min(0,s);n++)r+=i;t=0}for(let n=t;n<s;n++)r+=e[n].duration;return r},wf=function(i,e,t,s){if(!i||!i.segments)return null;if(i.endList)return Df(i);if(e===null)return null;e=e||0;let r=Af(i,i.mediaSequence+i.segments.length,e);return t&&(s=typeof s=="number"?s:Cf(null,i),r-=s),Math.max(0,r)},Fv=function(i,e,t){const r=e||0;let n=wf(i,e,!0,t);return n===null?De():(n<r&&(n=r),De(r,n))},Uv=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:s,startTime:r,exactManifestTimings:n}){let a=e-r;const u=fo(i);let h=0;for(let f=0;f<u.length;f++){const g=u[f];if(t===g.segmentIndex&&!(typeof s=="number"&&typeof g.partIndex=="number"&&s!==g.partIndex)){h=f;break}}if(a<0){if(h>0)for(let f=h-1;f>=0;f--){const g=u[f];if(a+=g.duration,n){if(a<0)continue}else if(a+bt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-Js({defaultDuration:i.targetDuration,durationList:u,startIndex:h,endIndex:f})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(h<0){for(let f=h;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};h=0}for(let f=h;f<u.length;f++){const g=u[f];a-=g.duration;const _=g.duration>bt,b=a===0,C=_&&a+bt>=0;if(!((b||C)&&f!==u.length-1)){if(n){if(a>0)continue}else if(a-bt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+Js({defaultDuration:i.targetDuration,durationList:u,startIndex:h,endIndex:f})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},If=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Su=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Zn=function(i){const e=If(i);return!i.disabled&&!e},$v=function(i){return i.disabled},qv=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},kf=function(i,e){return e.attributes&&e.attributes[i]},jv=function(i,e,t,s=0){return kf("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-s*8)/e:NaN},po=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>Zn(s)?(s.attributes.BANDWIDTH||0)<t:!1).length===0},Eu=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Pc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},_r=i=>{if(!i||!i.playlists||!i.playlists.length)return Pc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],s=t.attributes&&t.attributes.CODECS;if(!(s&&s.split(",").every(n=>lh(n))||Pc(i,n=>Eu(t,n))))return!1}return!0};var We={liveEdgeDelay:Cf,duration:Df,seekable:Fv,getMediaInfoForTime:Uv,isEnabled:Zn,isDisabled:$v,isExcluded:If,isIncompatible:Su,playlistEnd:wf,isAes:qv,hasAttribute:kf,estimateSegmentRequestTime:jv,isLowestEnabledRendition:po,isAudioOnly:_r,playlistMatch:Eu,segmentDurationWithParts:xu};const{log:Pf}=O,Vi=(i,e)=>`${i}-${e}`,Of=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,Vv=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new i_;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const u=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){u.hasOwnProperty(f)&&delete u[f]}),u.segments&&u.segments.forEach(function(f){["parts","preloadHints"].forEach(function(g){f.hasOwnProperty(g)&&delete f[g]})})),!u.targetDuration){let f=10;u.segments&&u.segments.length&&(f=u.segments.reduce((g,_)=>Math.max(g,_.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),u.targetDuration=f}const h=Sf(u);if(h.length&&!u.partTargetDuration){const f=h.reduce((g,_)=>Math.max(g,_.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),Pf.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.")),u.partTargetDuration=f}return u},ms=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},Lf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},Hv=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];Lf({playlist:t,id:Vi(e,t.uri)}),t.resolvedUri=Ge(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||Pf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},zv=i=>{ms(i,e=>{e.uri&&(e.resolvedUri=Ge(i.uri,e.uri))})},Gv=(i,e)=>{const t=Vi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:S.location.href,resolvedUri:S.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},Rf=(i,e,t=Of)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const n=`placeholder-uri-${r}`;i.playlists[r].uri=n}const s=_r(i);ms(i,(r,n,a,u)=>{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let h=0;h<i.playlists.length;h++){const f=i.playlists[h];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[ke({},r)]}r.playlists.forEach(function(h,f){const g=t(n,a,u,h),_=Vi(f,g);h.uri?h.resolvedUri=h.resolvedUri||Ge(i.uri,h.uri):(h.uri=f===0?g:_,h.resolvedUri=h.uri),h.id=h.id||_,h.attributes=h.attributes||{},i.playlists[h.id]=h,i.playlists[h.uri]=h})}),Hv(i),zv(i)};class Oc{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,s=t.startDate.getTime();this.trimProcessedDateRanges_(s),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const Nf=22,Ti=({requestType:i,request:e,error:t,parseFailure:s})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},u=r&&!n||s;if(t&&n)a.error=ke({},t),a.errorType=O.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=O.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=O.Error.NetworkRequestTimeout;else if(u){const h=s?O.Error.NetworkBodyParserFailed:O.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},Wv=ut("CodecUtils"),Mf=function(i){const e=i.attributes||{};if(e.CODECS)return yt(e.CODECS)},Bf=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},Xv=(i,e)=>{if(!Bf(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},or=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(uh(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){Wv(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Lc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Zs=function(i,e){const t=e.attributes||{},s=or(Mf(e)||[]);if(Bf(i,e)&&!s.audio&&!Xv(i,e)){const r=or(r_(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},{EventTarget:Kv}=O,Yv=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=Ef(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new S.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},Qv=(i,e)=>{if(!i)return e;const t=te(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s<e.parts.length;s++)i.parts&&i.parts[s]&&(t.parts[s]=te(i.parts[s],e.parts[s]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},Jv=(i,e,t)=>{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let u=0;u<r.length;u++){const h=s[u+t],f=r[u];h?(a=h.map||a,n.push(Qv(h,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},Ff=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=Ge(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Ge(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Ge(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Ge(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))})},Uf=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;s<t.preloadHints.length;s++)if(t.preloadHints[s].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},$f=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,mo=(i,e,t=$f)=>{const s=te(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=Uf(e);const n=te(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=Jv(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{Ff(a,n.resolvedUri)});for(let a=0;a<s.playlists.length;a++)s.playlists[a].id===e.id&&(s.playlists[a]=n);return s.playlists[e.id]=n,s.playlists[e.uri]=n,ms(i,(a,u,h,f)=>{if(a.playlists)for(let g=0;g<a.playlists.length;g++)e.id===a.playlists[g].id&&(a.playlists[g]=n)}),s},go=(i,e)=>{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Rc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:u}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:u})}),{type:e,isLive:t,renditions:s}};class Bi extends Kv{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ut("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Oc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ge(this.main.uri,e.uri);this.llhls&&(t=Yv(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)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,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Ti({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const s=Vv({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!s.playlists||!s.playlists.length||this.excludeAudioOnlyVariants(s.playlists),s}catch(s){this.error=s,this.error.metadata={errorType:O.Error.StreamingHlsPlaylistParserError,error:s}}}excludeAudioOnlyVariants(e){const t=s=>{const r=s.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const u=Mf(s)||[];return!!or(u).video};e.some(t)&&e.forEach(s=>{t(s)||(s.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),Lf({playlist:a,uri:s,id:r});const u=mo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(go(this.media(),!!u)),n.parsedPlaylist=Rc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),S.clearTimeout(this.mediaUpdateTimeout),S.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Oc,this.off()}stopRequest(){if(this.request){const 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 new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(S.clearTimeout(this.finalRenditionTimeout),t){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=S.setTimeout(this.media.bind(this,e,!1),u);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(go(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;const 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"},(u,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Cn(e.resolvedUri,h),u)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=S.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=S.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const 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,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:Ti({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Cn(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Rc(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,Rf(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=Uf(s),s.segments.forEach(r=>{Ff(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||S.location.href;this.main=Gv(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const u=a.resolvedUri,h=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),g=Vi(r,f),_=this.createCloneAttributes_(r,a.attributes),b=this.createClonePlaylist_(a,g,e,_);s.playlists[n]=b,s.playlists[g]=b,s.playlists[f]=b}else s.playlists.splice(n,1);delete s.playlists[h],delete s.playlists[u]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const u in s.mediaGroups[n][a])s.mediaGroups[n][a][u].playlists.forEach((f,g)=>{const _=s.playlists[f.id],b=_.id,C=_.resolvedUri;delete s.playlists[b],delete s.playlists[C]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Vi(e.ID,n),u=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,u);s.playlists[r]=h,s.playlists[a]=h,s.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const u in r.mediaGroups[n][a]){const h=r.mediaGroups[n][a][u];r.mediaGroups[n][t][u]=ke({},h);const f=r.mediaGroups[n][t][u],g=this.createCloneURI_(h.resolvedUri,e);f.resolvedUri=g,f.uri=g,f.playlists=[],h.playlists.forEach((_,b)=>{const C=r.playlists[_.id],A=Of(n,t,u),y=Vi(t,A);if(C&&!r.playlists[y]){const I=this.createClonePlaylist_(C,y,e),D=I.resolvedUri;r.playlists[y]=I,r.playlists[D]=I}f.playlists[b]=this.createClonePlaylist_(_,y,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),te(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const _o=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},Zv=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},e2=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},qf=function(){const i=function e(t,s){t=te({timeout:45e3},t);const r=e.beforeRequest||O.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||O.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||O.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(O.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const u=O.Vhs.xhr.original===!0?O.xhr:O.Vhs.xhr,h=Zv(n,t);n.delete(r);const f=u(h||t,function(_,b){return e2(a,f,_,b),_o(f,_,b,s)}),g=f.abort;return f.abort=function(){return f.aborted=!0,g.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return i.original=!0,i},t2=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},yo=function(i){const e={};return i.byterange&&(e.Range=t2(i.byterange)),e},i2=function(i,e){return i.start(e)+"-"+i.end(e)},s2=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},r2=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},jf=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];hh(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},An=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},Vf=function(i){return i.resolvedUri},Hf=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(s2).join(""),n=e.slice(a*t,a*t+t).map(r2).join(""),s+=r+" "+n+`
199
- `;return s},n2=({bytes:i})=>Hf(i),a2=i=>{let e="",t;for(t=0;t<i.length;t++)e+=i2(i,t)+" ";return e};var o2=Object.freeze({__proto__:null,createTransferableMessage:jf,initSegmentId:An,segmentKeyId:Vf,hexDump:Hf,tagDump:n2,textRanges:a2});const zf=.25,u2=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},l2=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,c2=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(t<new Date(s.dateTimeObject))return null;for(let h=0;h<e.segments.length-1;h++){s=e.segments[h];const f=new Date(e.segments[h+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?l2(r.videoTimingInfo):r.duration+r.duration*zf,u=new Date(n.getTime()+a*1e3);return t>u?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:We.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},h2=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;n<e.segments.length&&(s=e.segments[n],t=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:t+s.duration,!(i<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*zf)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},d2=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},f2=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},p2=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=h2(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=u2(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},Gf=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!f2(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=c2(i,e);if(!u)return a({message:`${i} was not found in the stream`});const h=u.segment,f=d2(h.dateTimeObject,i);if(u.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(u.estimatedStart+f),n.one("seeked",()=>{Gf({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const g=h.start+f,_=()=>a(null,n.currentTime());n.one("seeked",_),r&&n.pause(),s(g)},Ga=(i,e)=>{if(i.readyState===4)return e()},m2=(i,e,t,s)=>{let r=[],n,a=!1;const u=function(_,b,C,A){return b.abort(),a=!0,t(_,b,C,A)},h=function(_,b){if(a)return;if(_)return _.metadata=Ti({requestType:s,request:b,error:_}),u(_,b,"",r);const C=b.responseText.substring(r&&r.byteLength||0,b.responseText.length);if(r=p_(r,dh(C,!0)),n=n||Hs(r),r.length<10||n&&r.length<n+2)return Ga(b,()=>u(_,b,"",r));const A=zo(r);return A==="ts"&&r.length<188?Ga(b,()=>u(_,b,"",r)):!A&&r.length<376?Ga(b,()=>u(_,b,"",r)):u(null,b,A,r)},g=e({uri:i,beforeSend(_){_.overrideMimeType("text/plain; charset=x-user-defined"),_.addEventListener("progress",function({total:b,loaded:C}){return _o(_,null,{statusCode:_.status},h)})}},function(_,b){return _o(g,_,b,h)});return g},{EventTarget:g2}=O,Nc=function(i,e){if(!$f(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const s=i.segments[t],r=e.segments[t];if(s.uri!==r.uri)return!1;if(!s.byterange&&!r.byterange)continue;const n=s.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},_2=(i,e,t,s)=>{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},y2=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=Fy(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return Rf(n,e,_2),n},T2=(i,e)=>{ms(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},v2=(i,e,t)=>{let s=!0,r=te(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const h=Rn(a.sidx);t&&t[h]&&t[h].sidx&&jo(a,t[h].sidx,a.sidx.resolvedUri)}const u=mo(r,a,Nc);u&&(r=u,s=!1)}return ms(e,(n,a,u,h)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,g=mo(r,n.playlists[0],Nc);g&&(r=g,h in r.mediaGroups[a][u]||(r.mediaGroups[a][u][h]=n),r.mediaGroups[a][u][h].playlists[0]=r.playlists[f],s=!1)}}),T2(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},b2=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Mc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Rn(n);if(!e[a])break;const u=e[a].sidxInfo;b2(u,n)&&(t[a]=e[a])}}return t},x2=(i,e)=>{let s=Mc(i.playlists,e);return ms(i,(r,n,a,u)=>{if(r.playlists&&r.playlists.length){const h=r.playlists;s=te(s,Mc(h,e))}}),s};class To extends g2{constructor(e,t,s={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new 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_=ut("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,s){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},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Rn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>s(!1),0);return}const n=Cn(e.sidx.resolvedUri),a=(h,f)=>{if(this.requestErrored_(h,f,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:_}=f;let b;try{b=Hy(G(f.response).subarray(8))}catch(C){C.metadata=Ti({requestType:_,request:f,parseFailure:!0}),this.requestErrored_(C,f,t);return}return g[r]={sidxInfo:e.sidx,sidx:b},jo(e,b,e.sidx.resolvedUri),s(!0)},u="dash-sidx";this.request=m2(n,this.vhs_.xhr,(h,f,g,_)=>{if(h)return a(h,f);if(!g||g!=="mp4"){const A=g||"unknown";return a({status:f.status,message:`Unsupported ${A} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:b,length:C}=e.sidx.byterange;if(_.length>=C+b)return a(h,{response:_.subarray(b,b+C),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:yo({byterange:e.sidx.byterange})},a)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},S.clearTimeout(this.minimumUpdatePeriodTimeout_),S.clearTimeout(this.mediaRequest_),S.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){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,S.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(),S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(S.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const 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"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=Ti({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Cn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=Uy(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:Ge(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=Ti({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=y2({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:O.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=v2(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,u=[];s.playlists.forEach(f=>{u.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const h={duration:n,isLive:!a,renditions:u};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(S.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(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`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=S.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=x2(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=S.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},go(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ce={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 S2=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},Wf=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},E2=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},Xf=function(i){return function(){const e=E2(i),t=Wf(new Worker(e));t.objURL=e;const s=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),s.call(this)},t}},Kf=function(i){return`var browserWorkerPolyFill = ${Wf.toString()};
200
- browserWorkerPolyFill(self);
201
- `+i},Yf=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},C2=Kf(Yf(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(l,c){o[l]||(o[l]=[]),o[l]=o[l].concat(c)},this.off=function(l,c){var d;return o[l]?(d=o[l].indexOf(c),o[l]=o[l].slice(),o[l].splice(d,1),d>-1):!1},this.trigger=function(l){var c,d,p,m;if(c=o[l],!!c)if(arguments.length===2)for(p=c.length,d=0;d<p;++d)c[d].call(this,arguments[1]);else{for(m=[],d=arguments.length,d=1;d<arguments.length;++d)m.push(arguments[d]);for(p=c.length,d=0;d<p;++d)c[d].apply(this,m)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(l){o.push(l)}),this.on("done",function(l){o.flush(l)}),this.on("partialdone",function(l){o.partialFlush(l)}),this.on("endedtimeline",function(l){o.endTimeline(l)}),this.on("reset",function(l){o.reset(l)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,s=Math.pow(2,32),r=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c;return l.getBigUint64?(c=l.getBigUint64(0),c<Number.MAX_SAFE_INTEGER?Number(c):c):l.getUint32(0)*s+l.getUint32(4)},n={getUint64:r,MAX_UINT32:s},a=n.MAX_UINT32,u,h,f,g,_,b,C,A,y,I,D,P,k,L,N,U,B,$,X,ne,J,oe,H,Z,Me,ee,Te,It,si,ri,ni,ai,yr,Du,wu,Iu;(function(){var o;if(H={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(o in H)H.hasOwnProperty(o)&&(H[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);Z=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),ee=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Me=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]),It=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]),si={video:Te,audio:It},ai=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ni=new Uint8Array([0,0,0,0,0,0,0,0]),yr=new Uint8Array([0,0,0,0,0,0,0,0]),Du=yr,wu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Iu=yr,ri=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(o){var l=[],c=0,d,p,m;for(d=1;d<arguments.length;d++)l.push(arguments[d]);for(d=l.length;d--;)c+=l[d].byteLength;for(p=new Uint8Array(c+8),m=new DataView(p.buffer,p.byteOffset,p.byteLength),m.setUint32(0,p.byteLength),p.set(o,4),d=0,c=8;d<l.length;d++)p.set(l[d],c),c+=l[d].byteLength;return p},h=function(){return u(H.dinf,u(H.dref,ai))},f=function(o){return u(H.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,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},g=function(){return u(H.ftyp,Z,Me,Z,ee)},U=function(o){return u(H.hdlr,si[o])},_=function(o){return u(H.mdat,o)},N=function(o){var l=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(l[12]=o.samplerate>>>24&255,l[13]=o.samplerate>>>16&255,l[14]=o.samplerate>>>8&255,l[15]=o.samplerate&255),u(H.mdhd,l)},L=function(o){return u(H.mdia,N(o),U(o.type),C(o))},b=function(o){return u(H.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},C=function(o){return u(H.minf,o.type==="video"?u(H.vmhd,ri):u(H.smhd,ni),h(),$(o))},A=function(o,l){for(var c=[],d=l.length;d--;)c[d]=ne(l[d]);return u.apply(null,[H.moof,b(o)].concat(c))},y=function(o){for(var l=o.length,c=[];l--;)c[l]=P(o[l]);return u.apply(null,[H.moov,D(4294967295)].concat(c).concat(I(o)))},I=function(o){for(var l=o.length,c=[];l--;)c[l]=J(o[l]);return u.apply(null,[H.mvex].concat(c))},D=function(o){var l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&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 u(H.mvhd,l)},B=function(o){var l=o.samples||[],c=new Uint8Array(4+l.length),d,p;for(p=0;p<l.length;p++)d=l[p].flags,c[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return u(H.sdtp,c)},$=function(o){return u(H.stbl,X(o),u(H.stts,Iu),u(H.stsc,Du),u(H.stsz,wu),u(H.stco,yr))},function(){var o,l;X=function(c){return u(H.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),c.type==="video"?o(c):l(c))},o=function(c){var d=c.sps||[],p=c.pps||[],m=[],T=[],v,x;for(v=0;v<d.length;v++)m.push((d[v].byteLength&65280)>>>8),m.push(d[v].byteLength&255),m=m.concat(Array.prototype.slice.call(d[v]));for(v=0;v<p.length;v++)T.push((p[v].byteLength&65280)>>>8),T.push(p[v].byteLength&255),T=T.concat(Array.prototype.slice.call(p[v]));if(x=[H.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,(c.width&65280)>>8,c.width&255,(c.height&65280)>>8,c.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]),u(H.avcC,new Uint8Array([1,c.profileIdc,c.profileCompatibility,c.levelIdc,255].concat([d.length],m,[p.length],T))),u(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],c.sarRatio){var E=c.sarRatio[0],w=c.sarRatio[1];x.push(u(H.pasp,new Uint8Array([(E&4278190080)>>24,(E&16711680)>>16,(E&65280)>>8,E&255,(w&4278190080)>>24,(w&16711680)>>16,(w&65280)>>8,w&255])))}return u.apply(null,x)},l=function(c){return u(H.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(c.channelcount&65280)>>8,c.channelcount&255,(c.samplesize&65280)>>8,c.samplesize&255,0,0,0,0,(c.samplerate&65280)>>8,c.samplerate&255,0,0]),f(c))}}(),k=function(o){var l=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.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,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return u(H.tkhd,l)},ne=function(o){var l,c,d,p,m,T,v;return l=u(H.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),T=Math.floor(o.baseMediaDecodeTime/a),v=Math.floor(o.baseMediaDecodeTime%a),c=u(H.tfdt,new Uint8Array([1,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,T&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255])),m=32+20+8+16+8+8,o.type==="audio"?(d=oe(o,m),u(H.traf,l,c,d)):(p=B(o),d=oe(o,p.length+m),u(H.traf,l,c,d,p))},P=function(o){return o.duration=o.duration||4294967295,u(H.trak,k(o),L(o))},J=function(o){var l=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(l[l.length-1]=0),u(H.trex,l)},function(){var o,l,c;c=function(d,p){var m=0,T=0,v=0,x=0;return d.length&&(d[0].duration!==void 0&&(m=1),d[0].size!==void 0&&(T=2),d[0].flags!==void 0&&(v=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,m|T|v|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},l=function(d,p){var m,T,v,x,E,w;for(x=d.samples||[],p+=8+12+16*x.length,v=c(x,p),T=new Uint8Array(v.length+x.length*16),T.set(v),m=v.length,w=0;w<x.length;w++)E=x[w],T[m++]=(E.duration&4278190080)>>>24,T[m++]=(E.duration&16711680)>>>16,T[m++]=(E.duration&65280)>>>8,T[m++]=E.duration&255,T[m++]=(E.size&4278190080)>>>24,T[m++]=(E.size&16711680)>>>16,T[m++]=(E.size&65280)>>>8,T[m++]=E.size&255,T[m++]=E.flags.isLeading<<2|E.flags.dependsOn,T[m++]=E.flags.isDependedOn<<6|E.flags.hasRedundancy<<4|E.flags.paddingValue<<1|E.flags.isNonSyncSample,T[m++]=E.flags.degradationPriority&61440,T[m++]=E.flags.degradationPriority&15,T[m++]=(E.compositionTimeOffset&4278190080)>>>24,T[m++]=(E.compositionTimeOffset&16711680)>>>16,T[m++]=(E.compositionTimeOffset&65280)>>>8,T[m++]=E.compositionTimeOffset&255;return u(H.trun,T)},o=function(d,p){var m,T,v,x,E,w;for(x=d.samples||[],p+=8+12+8*x.length,v=c(x,p),m=new Uint8Array(v.length+x.length*8),m.set(v),T=v.length,w=0;w<x.length;w++)E=x[w],m[T++]=(E.duration&4278190080)>>>24,m[T++]=(E.duration&16711680)>>>16,m[T++]=(E.duration&65280)>>>8,m[T++]=E.duration&255,m[T++]=(E.size&4278190080)>>>24,m[T++]=(E.size&16711680)>>>16,m[T++]=(E.size&65280)>>>8,m[T++]=E.size&255;return u(H.trun,m)},oe=function(d,p){return d.type==="audio"?o(d,p):l(d,p)}}();var Sp={ftyp:g,mdat:_,moof:A,moov:y,initSegment:function(o){var l=g(),c=y(o),d;return d=new Uint8Array(l.byteLength+c.byteLength),d.set(l),d.set(c,l.byteLength),d}},Ep=function(o){var l,c,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,l=0;l<o.length;l++)c=o[l],c.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=c.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[c],d.byteLength=c.data.byteLength,d.pts=c.pts,d.dts=c.dts):(c.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=c.dts-d.dts,d.byteLength+=c.data.byteLength,d.push(c));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},Cp=function(o){var l,c,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=o[0].pts,d.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,l=0;l<o.length;l++)c=o[l],c.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[c],d.nalCount=c.length,d.byteLength=c.byteLength,d.pts=c.pts,d.dts=c.dts,d.duration=c.duration):(d.duration+=c.duration,d.nalCount+=c.length,d.byteLength+=c.byteLength,d.push(c));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},Ap=function(o){var l;return!o[0][0].keyFrame&&o.length>1&&(l=o.shift(),o.byteLength-=l.byteLength,o.nalCount-=l.nalCount,o[0][0].dts=l.dts,o[0][0].pts=l.pts,o[0][0].duration+=l.duration),o},Dp=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ku=function(o,l){var c=Dp();return c.dataOffset=l,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},wp=function(o,l){var c,d,p,m,T,v=l||0,x=[];for(c=0;c<o.length;c++)for(m=o[c],d=0;d<m.length;d++)T=m[d],p=ku(T,v),v+=p.size,x.push(p);return x},Ip=function(o){var l,c,d,p,m,T,v=0,x=o.byteLength,E=o.nalCount,w=x+4*E,R=new Uint8Array(w),j=new DataView(R.buffer);for(l=0;l<o.length;l++)for(p=o[l],c=0;c<p.length;c++)for(m=p[c],d=0;d<m.length;d++)T=m[d],j.setUint32(v,T.data.byteLength),v+=4,R.set(T.data,v),v+=T.data.byteLength;return R},kp=function(o,l){var c,d=l||0,p=[];return c=ku(o,d),p.push(c),p},Pp=function(o){var l,c,d=0,p=o.byteLength,m=o.length,T=p+4*m,v=new Uint8Array(T),x=new DataView(v.buffer);for(l=0;l<o.length;l++)c=o[l],x.setUint32(d,c.data.byteLength),d+=4,v.set(c.data,d),d+=c.data.byteLength;return v},Op={groupNalsIntoFrames:Ep,groupFramesIntoGops:Cp,extendFirstKeyFrame:Ap,generateSampleTable:wp,concatenateNalData:Ip,generateSampleTableForFrame:kp,concatenateNalDataForFrame:Pp},qt=[33,16,5,32,164,27],ea=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ie=function(o){for(var l=[];o--;)l.push(0);return l},Lp=function(o){return Object.keys(o).reduce(function(l,c){return l[c]=new Uint8Array(o[c].reduce(function(d,p){return d.concat(p)},[])),l},{})},ta,Rp=function(){if(!ta){var o={96e3:[qt,[227,64],ie(154),[56]],88200:[qt,[231],ie(170),[56]],64e3:[qt,[248,192],ie(240),[56]],48e3:[qt,[255,192],ie(268),[55,148,128],ie(54),[112]],44100:[qt,[255,192],ie(268),[55,163,128],ie(84),[112]],32e3:[qt,[255,192],ie(268),[55,234],ie(226),[112]],24e3:[qt,[255,192],ie(268),[55,255,128],ie(268),[111,112],ie(126),[224]],16e3:[qt,[255,192],ie(268),[55,255,128],ie(268),[111,255],ie(269),[223,108],ie(195),[1,192]],12e3:[ea,ie(268),[3,127,248],ie(268),[6,255,240],ie(268),[13,255,224],ie(268),[27,253,128],ie(259),[56]],11025:[ea,ie(268),[3,127,248],ie(268),[6,255,240],ie(268),[13,255,224],ie(268),[27,255,192],ie(268),[55,175,128],ie(108),[112]],8e3:[ea,ie(268),[3,121,16],ie(47),[7]]};ta=Lp(o)}return ta},ia=9e4,sa,ra,Tr,na,Pu,Ou,Lu;sa=function(o){return o*ia},ra=function(o,l){return o*l},Tr=function(o){return o/ia},na=function(o,l){return o/l},Pu=function(o,l){return sa(na(o,l))},Ou=function(o,l){return ra(Tr(o),l)},Lu=function(o,l,c){return Tr(c?o:o-l)};var ce={ONE_SECOND_IN_TS:ia,secondsToVideoTs:sa,secondsToAudioTs:ra,videoTsToSeconds:Tr,audioTsToSeconds:na,audioTsToVideoTs:Pu,videoTsToAudioTs:Ou,metadataTsToSeconds:Lu},Np=Rp,vr=ce,Mp=function(o){var l,c,d=0;for(l=0;l<o.length;l++)c=o[l],d+=c.data.byteLength;return d},Bp=function(o,l,c,d){var p,m=0,T=0,v=0,x=0,E,w,R;if(l.length&&(p=vr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),m=Math.ceil(vr.ONE_SECOND_IN_TS/(o.samplerate/1024)),c&&d&&(T=p-Math.max(c,d),v=Math.floor(T/m),x=v*m),!(v<1||x>vr.ONE_SECOND_IN_TS/2))){for(E=Np()[o.samplerate],E||(E=l[0].data),w=0;w<v;w++)R=l[0],l.splice(0,0,{data:E,dts:R.dts-m,pts:R.pts-m});return o.baseMediaDecodeTime-=Math.floor(vr.videoTsToAudioTs(x,o.samplerate)),x}},Fp=function(o,l,c){return l.minSegmentDts>=c?o:(l.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c?(l.minSegmentDts=Math.min(l.minSegmentDts,d.dts),l.minSegmentPts=l.minSegmentDts,!0):!1}))},Up=function(o){var l,c,d=[];for(l=0;l<o.length;l++)c=o[l],d.push({size:c.data.byteLength,duration:1024});return d},$p=function(o){var l,c,d=0,p=new Uint8Array(Mp(o));for(l=0;l<o.length;l++)c=o[l],p.set(c.data,d),d+=c.data.byteLength;return p},qp={prefixWithSilence:Bp,trimAdtsFramesByEarliestDts:Fp,generateSampleTable:Up,concatenateFrameData:$p},jp=ce.ONE_SECOND_IN_TS,Vp=function(o,l){typeof l.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=l.pts),o.minSegmentPts===void 0?o.minSegmentPts=l.pts:o.minSegmentPts=Math.min(o.minSegmentPts,l.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=l.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,l.pts)),typeof l.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=l.dts),o.minSegmentDts===void 0?o.minSegmentDts=l.dts:o.minSegmentDts=Math.min(o.minSegmentDts,l.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=l.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,l.dts))},Hp=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},zp=function(o,l){var c,d,p=o.minSegmentDts;return l||(p-=o.timelineStartInfo.dts),c=o.timelineStartInfo.baseMediaDecodeTime,c+=p,c=Math.max(0,c),o.type==="audio"&&(d=o.samplerate/jp,c*=d,c=Math.floor(c)),c},Gp={clearDtsInfo:Hp,calculateTrackBaseMediaDecodeTime:zp,collectDtsInfo:Vp},Ru=4,Wp=128,Xp=function(o){for(var l=0,c={payloadType:-1,payloadSize:0},d=0,p=0;l<o.byteLength&&o[l]!==Wp;){for(;o[l]===255;)d+=255,l++;for(d+=o[l++];o[l]===255;)p+=255,l++;if(p+=o[l++],!c.payload&&d===Ru){var m=String.fromCharCode(o[l+3],o[l+4],o[l+5],o[l+6]);if(m==="GA94"){c.payloadType=d,c.payloadSize=p,c.payload=o.subarray(l,l+p);break}else c.payload=void 0}l+=p,d=0,p=0}return c},Kp=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},Yp=function(o,l){var c=[],d,p,m,T;if(!(l[0]&64))return c;for(p=l[0]&31,d=0;d<p;d++)m=d*3,T={type:l[m+2]&3,pts:o},l[m+2]&4&&(T.ccData=l[m+3]<<8|l[m+4],c.push(T));return c},Qp=function(o){for(var l=o.byteLength,c=[],d=1,p,m;d<l-2;)o[d]===0&&o[d+1]===0&&o[d+2]===3?(c.push(d+2),d+=2):d++;if(c.length===0)return o;p=l-c.length,m=new Uint8Array(p);var T=0;for(d=0;d<p;T++,d++)T===c[0]&&(T++,c.shift()),m[d]=o[T];return m},Nu={parseSei:Xp,parseUserData:Kp,parseCaptionPackets:Yp,discardEmulationPreventionBytes:Qp,USER_DATA_REGISTERED_ITU_T_T35:Ru},aa=t,br=Nu,Ve=function(o){o=o||{},Ve.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new fe(0,0),new fe(0,1),new fe(1,0),new fe(1,1)],this.parse708captions_&&(this.cc708Stream_=new ue({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(l){l.on("data",this.trigger.bind(this,"data")),l.on("partialdone",this.trigger.bind(this,"partialdone")),l.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")))};Ve.prototype=new aa,Ve.prototype.push=function(o){var l,c,d;if(o.nalUnitType==="sei_rbsp"&&(l=br.parseSei(o.escapedRBSP),!!l.payload&&l.payloadType===br.USER_DATA_REGISTERED_ITU_T_T35&&(c=br.parseUserData(l),!!c))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=br.parseCaptionPackets(o.pts,c),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Ve.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(l){return o==="flush"?l.flush():l.partialFlush()},this)},Ve.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(l,c){l.presortIndex=c}),this.captionPackets_.sort(function(l,c){return l.pts===c.pts?l.presortIndex-c.presortIndex:l.pts-c.pts}),this.captionPackets_.forEach(function(l){l.type<2?this.dispatchCea608Packet(l):this.dispatchCea708Packet(l)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Ve.prototype.flush=function(){return this.flushStream("flush")},Ve.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ve.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Ve.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},Ve.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Ve.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Ve.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Ve.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Jp={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},Zp=function(o){var l=Jp[o]||o;return o&4096&&o===l?"":String.fromCharCode(l)},xr=function(o){return 32<=o&&o<=127||160<=o&&o<=255},kt=function(o){this.windowNum=o,this.reset()};kt.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},kt.prototype.getText=function(){return this.rows.join(`
202
- `)},kt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},kt.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},kt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},kt.prototype.addText=function(o){this.rows[this.rowIdx]+=o},kt.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var Sr=function(o,l,c){this.serviceNum=o,this.text="",this.currentWindow=new kt(-1),this.windows=[],this.stream=c,typeof l=="string"&&this.createTextDecoder(l)};Sr.prototype.init=function(o,l){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new kt(c),typeof l=="function"&&(this.windows[c].beforeRowOverflow=l)},Sr.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},Sr.prototype.createTextDecoder=function(o){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(o)}catch(l){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+l})}};var ue=function(o){o=o||{},ue.prototype.init.call(this);var l=this,c=o.captionServices||{},d={},p;Object.keys(c).forEach(m=>{p=c[m],/^SERVICE/.test(m)&&(d[m]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(m){m.type===3?(l.new708Packet(),l.add708Bytes(m)):(l.current708Packet===null&&l.new708Packet(),l.add708Bytes(m))}};ue.prototype=new aa,ue.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ue.prototype.add708Bytes=function(o){var l=o.ccData,c=l>>>8,d=l&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},ue.prototype.push708Packet=function(){var o=this.current708Packet,l=o.data,c=null,d=null,p=0,m=l[p++];for(o.seq=m>>6,o.sizeCode=m&63;p<l.length;p++)m=l[p++],c=m>>5,d=m&31,c===7&&d>0&&(m=l[p++],c=m),this.pushServiceBlock(c,p,d),d>0&&(p+=d-1)},ue.prototype.pushServiceBlock=function(o,l,c){var d,p=l,m=this.current708Packet.data,T=this.services[o];for(T||(T=this.initService(o,p));p<l+c&&p<m.length;p++)d=m[p],xr(d)?p=this.handleText(p,T):d===24?p=this.multiByteCharacter(p,T):d===16?p=this.extendedCommands(p,T):128<=d&&d<=135?p=this.setCurrentWindow(p,T):152<=d&&d<=159?p=this.defineWindow(p,T):d===136?p=this.clearWindows(p,T):d===140?p=this.deleteWindows(p,T):d===137?p=this.displayWindows(p,T):d===138?p=this.hideWindows(p,T):d===139?p=this.toggleWindows(p,T):d===151?p=this.setWindowAttributes(p,T):d===144?p=this.setPenAttributes(p,T):d===145?p=this.setPenColor(p,T):d===146?p=this.setPenLocation(p,T):d===143?T=this.reset(p,T):d===8?T.currentWindow.backspace():d===12?T.currentWindow.clearText():d===13?T.currentWindow.pendingNewLine=!0:d===14?T.currentWindow.clearText():d===141&&p++},ue.prototype.extendedCommands=function(o,l){var c=this.current708Packet.data,d=c[++o];return xr(d)&&(o=this.handleText(o,l,{isExtended:!0})),o},ue.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},ue.prototype.initService=function(o,l){var d="SERVICE"+o,c=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new Sr(o,p,c),this.services[o].init(this.getPts(l),function(m){c.flushDisplayed(m,c.services[o])}),this.services[o]},ue.prototype.handleText=function(o,l,c){var d=c&&c.isExtended,p=c&&c.isMultiByte,m=this.current708Packet.data,T=d?4096:0,v=m[o],x=m[o+1],E=l.currentWindow,w,R;function j(F){return F.map(z=>("0"+(z&255).toString(16)).slice(-2)).join("")}if(p?(R=[v,x],o++):R=[v],l.textDecoder_&&!d)w=l.textDecoder_.decode(new Uint8Array(R));else if(p){const F=j(R);w=String.fromCharCode(parseInt(F,16))}else w=Zp(T|v);return E.pendingNewLine&&!E.isEmpty()&&E.newLine(this.getPts(o)),E.pendingNewLine=!1,E.addText(w),o},ue.prototype.multiByteCharacter=function(o,l){var c=this.current708Packet.data,d=c[o+1],p=c[o+2];return xr(d)&&xr(p)&&(o=this.handleText(++o,l,{isMultiByte:!0})),o},ue.prototype.setCurrentWindow=function(o,l){var c=this.current708Packet.data,d=c[o],p=d&7;return l.setCurrentWindow(p),o},ue.prototype.defineWindow=function(o,l){var c=this.current708Packet.data,d=c[o],p=d&7;l.setCurrentWindow(p);var m=l.currentWindow;return d=c[++o],m.visible=(d&32)>>5,m.rowLock=(d&16)>>4,m.columnLock=(d&8)>>3,m.priority=d&7,d=c[++o],m.relativePositioning=(d&128)>>7,m.anchorVertical=d&127,d=c[++o],m.anchorHorizontal=d,d=c[++o],m.anchorPoint=(d&240)>>4,m.rowCount=d&15,d=c[++o],m.columnCount=d&63,d=c[++o],m.windowStyle=(d&56)>>3,m.penStyle=d&7,m.virtualRowCount=m.rowCount+1,o},ue.prototype.setWindowAttributes=function(o,l){var c=this.current708Packet.data,d=c[o],p=l.currentWindow.winAttr;return d=c[++o],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=c[++o],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=c[++o],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=c[++o],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,o},ue.prototype.flushDisplayed=function(o,l){for(var c=[],d=0;d<8;d++)l.windows[d].visible&&!l.windows[d].isEmpty()&&c.push(l.windows[d].getText());l.endPts=o,l.text=c.join(`
203
-
204
- `),this.pushCaption(l),l.startPts=o},ue.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},ue.prototype.displayWindows=function(o,l){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible=1);return o},ue.prototype.hideWindows=function(o,l){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible=0);return o},ue.prototype.toggleWindows=function(o,l){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible^=1);return o},ue.prototype.clearWindows=function(o,l){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&l.windows[m].clearText();return o},ue.prototype.deleteWindows=function(o,l){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&l.windows[m].reset();return o},ue.prototype.setPenAttributes=function(o,l){var c=this.current708Packet.data,d=c[o],p=l.currentWindow.penAttr;return d=c[++o],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=c[++o],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,o},ue.prototype.setPenColor=function(o,l){var c=this.current708Packet.data,d=c[o],p=l.currentWindow.penColor;return d=c[++o],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=c[++o],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=c[++o],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,o},ue.prototype.setPenLocation=function(o,l){var c=this.current708Packet.data,d=c[o],p=l.currentWindow.penLoc;return l.currentWindow.pendingNewLine=!0,d=c[++o],p.row=d&15,d=c[++o],p.column=d&63,o},ue.prototype.reset=function(o,l){var c=this.getPts(o);return this.flushDisplayed(c,l),this.initService(l.serviceNum,o)};var em={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Er=function(o){return o===null?"":(o=em[o]||o,String.fromCharCode(o))},Cr=14,tm=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],oi=function(){for(var o=[],l=Cr+1;l--;)o.push({text:"",indent:0,offset:0});return o},fe=function(o,l){fe.prototype.init.call(this),this.field_=o||0,this.dataChannel_=l||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(c){var d,p,m,T,v;if(d=c.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),m=d>>>8,T=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=oi();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=oi();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=oi()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(m,T))m=(m&3)<<8,v=Er(m|T),this[this.mode_](c.pts,v),this.column_++;else if(this.isExtCharacter(m,T))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),m=(m&3)<<8,v=Er(m|T),this[this.mode_](c.pts,v),this.column_++;else if(this.isMidRowCode(m,T))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,(T&14)===14&&this.addFormatting(c.pts,["i"]),(T&1)===1&&this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(m,T)){const E=T&3;this.nonDisplayed_[this.row_].offset=E,this.column_+=E}else if(this.isPAC(m,T)){var x=tm.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(c.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(c.pts),this.row_=x),T&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),(d&16)===16){const E=(d&14)>>1;this.column_=E*4,this.nonDisplayed_[this.row_].indent+=E}this.isColorPAC(T)&&(T&14)===14&&this.addFormatting(c.pts,["i"])}else this.isNormalChar(m)&&(T===0&&(T=null),v=Er(m),v+=Er(T),this[this.mode_](c.pts,v),this.column_+=v.length)}};fe.prototype=new aa,fe.prototype.flushDisplayed=function(o){const l=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{l(p)}d.text.length&&c.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&l(p)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=oi(),this.nonDisplayed_=oi(),this.lastControlCode_=null,this.column_=0,this.row_=Cr,this.rollUpRows_=2,this.formatting_=[]},fe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},fe.prototype.isSpecialCharacter=function(o,l){return o===this.EXT_&&l>=48&&l<=63},fe.prototype.isExtCharacter=function(o,l){return(o===this.EXT_+1||o===this.EXT_+2)&&l>=32&&l<=63},fe.prototype.isMidRowCode=function(o,l){return o===this.EXT_&&l>=32&&l<=47},fe.prototype.isOffsetControlCode=function(o,l){return o===this.OFFSET_&&l>=33&&l<=35},fe.prototype.isPAC=function(o,l){return o>=this.BASE_&&o<this.BASE_+8&&l>=64&&l<=127},fe.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},fe.prototype.isNormalChar=function(o){return o>=32&&o<=127},fe.prototype.setRollUp=function(o,l){if(this.mode_!=="rollUp"&&(this.row_=Cr,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=oi(),this.displayed_=oi()),l!==void 0&&l!==this.row_)for(var c=0;c<this.rollUpRows_;c++)this.displayed_[l-c]=this.displayed_[this.row_-c],this.displayed_[this.row_-c]={text:"",indent:0,offset:0};l===void 0&&(l=this.row_),this.topRow_=l-this.rollUpRows_+1},fe.prototype.addFormatting=function(o,l){this.formatting_=this.formatting_.concat(l);var c=l.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,c)},fe.prototype.clearFormatting=function(o){if(this.formatting_.length){var l=this.formatting_.reverse().reduce(function(c,d){return c+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,l)}},fe.prototype.popOn=function(o,l){var c=this.nonDisplayed_[this.row_].text;c+=l,this.nonDisplayed_[this.row_].text=c},fe.prototype.rollUp=function(o,l){var c=this.displayed_[this.row_].text;c+=l,this.displayed_[this.row_].text=c},fe.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<Cr+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},fe.prototype.paintOn=function(o,l){var c=this.displayed_[this.row_].text;c+=l,this.displayed_[this.row_].text=c};var Mu={CaptionStream:Ve,Cea608Stream:fe,Cea708Stream:ue},Ar={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},im=t,sm=8589934592,rm=4294967296,Bu="shared",oa=function(o,l){var c=1;for(o>l&&(c=-1);Math.abs(l-o)>rm;)o+=c*sm;return o},ua=function(o){var l,c;ua.prototype.init.call(this),this.type_=o||Bu,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Bu&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=oa(d.dts,c),d.pts=oa(d.pts,c),l=d.dts,this.trigger("data",d))},this.flush=function(){c=l,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,l=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ua.prototype=new im;var Fu={TimestampRolloverStream:ua,handleRollover:oa},nm=(o,l,c)=>{if(!o)return-1;for(var d=c;d<o.length;d++)if(o[d]===l)return d;return-1},am={typedArrayIndexOf:nm},Dr=am.typedArrayIndexOf,wr={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},Uu=function(o,l,c){var d,p="";for(d=l;d<c;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},gs=function(o,l,c){return decodeURIComponent(Uu(o,l,c))},_s=function(o,l,c){return unescape(Uu(o,l,c))},ys=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Ts={APIC:function(o){var l=1,c,d,p="-->";o.data[0]===wr.Utf8&&(c=Dr(o.data,0,l),!(c<0)&&(o.mimeType=_s(o.data,l,c),l=c+1,o.pictureType=o.data[l],l++,d=Dr(o.data,0,l),!(d<0)&&(o.description=gs(o.data,l,d),l=d+1,o.mimeType===p?o.url=_s(o.data,l,o.data.length):o.pictureData=o.data.subarray(l,o.data.length))))},"T*":function(o){o.data[0]===wr.Utf8&&(o.value=gs(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var l;o.data[0]===wr.Utf8&&(l=Dr(o.data,0,1),l!==-1&&(o.description=gs(o.data,1,l),o.value=gs(o.data,l+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=_s(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var l;o.data[0]===wr.Utf8&&(l=Dr(o.data,0,1),l!==-1&&(o.description=gs(o.data,1,l),o.url=_s(o.data,l+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var l;for(l=0;l<o.data.length;l++)if(o.data[l]===0){o.owner=_s(o.data,0,l);break}o.privateData=o.data.subarray(l+1),o.data=o.privateData}},om=function(o){var l,c,d=10,p=0,m=[];if(!(o.length<10||o[0]!=="I".charCodeAt(0)||o[1]!=="D".charCodeAt(0)||o[2]!=="3".charCodeAt(0))){p=ys(o.subarray(6,10)),p+=10;var T=o[5]&64;T&&(d+=4,d+=ys(o.subarray(10,14)),p-=ys(o.subarray(16,20)));do{if(l=ys(o.subarray(d+4,d+8)),l<1)break;c=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var v={id:c,data:o.subarray(d+10,d+l+10)};v.key=v.id,Ts[v.id]?Ts[v.id](v):v.id[0]==="T"?Ts["T*"](v):v.id[0]==="W"&&Ts["W*"](v),m.push(v),d+=10,d+=l}while(d<p);return m}},$u={parseId3Frames:om,parseSyncSafeInteger:ys,frameParsers:Ts},um=t,lm=Ar,jt=$u,Ir;Ir=function(o){var l={descriptor:o&&o.descriptor},c=0,d=[],p=0,m;if(Ir.prototype.init.call(this),this.dispatchType=lm.METADATA_STREAM_TYPE.toString(16),l.descriptor)for(m=0;m<l.descriptor.length;m++)this.dispatchType+=("00"+l.descriptor[m].toString(16)).slice(-2);this.push=function(T){var v,x,E,w,R,j;if(T.type==="timed-metadata"){if(T.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(T.data.length<10||T.data[0]!=="I".charCodeAt(0)||T.data[1]!=="D".charCodeAt(0)||T.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(T),p+=T.data.byteLength,d.length===1&&(c=jt.parseSyncSafeInteger(T.data.subarray(6,10)),c+=10),!(p<c)){for(v={data:new Uint8Array(c),frames:[],pts:d[0].pts,dts:d[0].dts},R=0;R<c;)v.data.set(d[0].data.subarray(0,c-R),R),R+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();x=10,v.data[5]&64&&(x+=4,x+=jt.parseSyncSafeInteger(v.data.subarray(10,14)),c-=jt.parseSyncSafeInteger(v.data.subarray(16,20)));do{if(E=jt.parseSyncSafeInteger(v.data.subarray(x+4,x+8)),E<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(j=String.fromCharCode(v.data[x],v.data[x+1],v.data[x+2],v.data[x+3]),w={id:j,data:v.data.subarray(x+10,x+E+10)},w.key=w.id,jt.frameParsers[w.id]?jt.frameParsers[w.id](w):w.id[0]==="T"?jt.frameParsers["T*"](w):w.id[0]==="W"&&jt.frameParsers["W*"](w),w.owner==="com.apple.streaming.transportStreamTimestamp"){var F=w.data,z=(F[3]&1)<<30|F[4]<<22|F[5]<<14|F[6]<<6|F[7]>>>2;z*=4,z+=F[7]&3,w.timeStamp=z,v.pts===void 0&&v.dts===void 0&&(v.pts=w.timeStamp,v.dts=w.timeStamp),this.trigger("timestamp",w)}v.frames.push(w),x+=10,x+=E}while(x<c);this.trigger("data",v)}}}},Ir.prototype=new um;var cm=Ir,la=t,ca=Mu,lt=Ar,hm=Fu.TimestampRolloverStream,kr,vs,Pr,Si=188,ha=71;kr=function(){var o=new Uint8Array(Si),l=0;kr.prototype.init.call(this),this.push=function(c){var d=0,p=Si,m;for(l?(m=new Uint8Array(c.byteLength+l),m.set(o.subarray(0,l)),m.set(c,l),l=0):m=c;p<m.byteLength;){if(m[d]===ha&&m[p]===ha){this.trigger("data",m.subarray(d,p)),d+=Si,p+=Si;continue}d++,p++}d<m.byteLength&&(o.set(m.subarray(d),0),l=m.byteLength-d)},this.flush=function(){l===Si&&o[0]===ha&&(this.trigger("data",o),l=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){l=0,this.trigger("reset")}},kr.prototype=new la,vs=function(){var o,l,c,d;vs.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,m){var T=0;m.payloadUnitStartIndicator&&(T+=p[T]+1),m.type==="pat"?l(p.subarray(T),m):c(p.subarray(T),m)},l=function(p,m){m.section_number=p[7],m.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],m.pmtPid=d.pmtPid},c=function(p,m){var T,v,x,E;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},T=(p[1]&15)<<8|p[2],v=3+T-4,x=(p[10]&15)<<8|p[11],E=12+x;E<v;){var w=p[E],R=(p[E+1]&31)<<8|p[E+2];w===lt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=R:w===lt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=R:w===lt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][R]=w),E+=((p[E+3]&15)<<8|p[E+4])+5}m.programMapTable=d.programMapTable}},this.push=function(p){var m={},T=4;if(m.payloadUnitStartIndicator=!!(p[1]&64),m.pid=p[1]&31,m.pid<<=8,m.pid|=p[2],(p[3]&48)>>>4>1&&(T+=p[T]+1),m.pid===0)m.type="pat",o(p.subarray(T),m),this.trigger("data",m);else if(m.pid===this.pmtPid)for(m.type="pmt",o(p.subarray(T),m),this.trigger("data",m);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,T,m]):this.processPes_(p,T,m)},this.processPes_=function(p,m,T){T.pid===this.programMapTable.video?T.streamType=lt.H264_STREAM_TYPE:T.pid===this.programMapTable.audio?T.streamType=lt.ADTS_STREAM_TYPE:T.streamType=this.programMapTable["timed-metadata"][T.pid],T.type="pes",T.data=p.subarray(m),this.trigger("data",T)}},vs.prototype=new la,vs.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o=this,l=!1,c={data:[],size:0},d={data:[],size:0},p={data:[],size:0},m,T=function(x,E){var w;const R=x[0]<<16|x[1]<<8|x[2];E.data=new Uint8Array,R===1&&(E.packetLength=6+(x[4]<<8|x[5]),E.dataAlignmentIndicator=(x[6]&4)!==0,w=x[7],w&192&&(E.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,E.pts*=4,E.pts+=(x[13]&6)>>>1,E.dts=E.pts,w&64&&(E.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,E.dts*=4,E.dts+=(x[18]&6)>>>1)),E.data=x.subarray(9+x[8]))},v=function(x,E,w){var R=new Uint8Array(x.size),j={type:E},F=0,z=0,K=!1,Ee;if(!(!x.data.length||x.size<9)){for(j.trackId=x.data[0].pid,F=0;F<x.data.length;F++)Ee=x.data[F],R.set(Ee.data,z),z+=Ee.data.byteLength;T(R,j),K=E==="video"||j.packetLength<=x.size,(w||K)&&(x.size=0,x.data.length=0),K&&o.trigger("data",j)}};Pr.prototype.init.call(this),this.push=function(x){({pat:function(){},pes:function(){var E,w;switch(x.streamType){case lt.H264_STREAM_TYPE:E=c,w="video";break;case lt.ADTS_STREAM_TYPE:E=d,w="audio";break;case lt.METADATA_STREAM_TYPE:E=p,w="timed-metadata";break;default:return}x.payloadUnitStartIndicator&&v(E,w,!0),E.data.push(x),E.size+=x.data.byteLength},pmt:function(){var E={type:"metadata",tracks:[]};m=x.programMapTable,m.video!==null&&E.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&E.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),l=!0,o.trigger("data",E)}})[x.type]()},this.reset=function(){c.size=0,c.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){v(c,"video"),v(d,"audio"),v(p,"timed-metadata")},this.flush=function(){if(!l&&m){var x={type:"metadata",tracks:[]};m.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),o.trigger("data",x)}l=!1,this.flushStreams_(),this.trigger("done")}},Pr.prototype=new la;var qu={PAT_PID:0,MP2T_PACKET_LENGTH:Si,TransportPacketStream:kr,TransportParseStream:vs,ElementaryStream:Pr,TimestampRolloverStream:hm,CaptionStream:ca.CaptionStream,Cea608Stream:ca.Cea608Stream,Cea708Stream:ca.Cea708Stream,MetadataStream:cm};for(var da in lt)lt.hasOwnProperty(da)&&(qu[da]=lt[da]);var dm=qu,fm=t,pm=ce.ONE_SECOND_IN_TS,Or,ju=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Or=function(o){var l,c=0;Or.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts skiping bytes ${d} to ${p} in frame ${c} outside syncword`})},this.push=function(d){var p=0,m,T,v,x,E;if(o||(c=0),d.type==="audio"){l&&l.length?(v=l,l=new Uint8Array(v.byteLength+d.data.byteLength),l.set(v),l.set(d.data,v.byteLength)):l=d.data;for(var w;p+7<l.length;){if(l[p]!==255||(l[p+1]&246)!==240){typeof w!="number"&&(w=p),p++;continue}if(typeof w=="number"&&(this.skipWarn_(w,p),w=null),T=(~l[p+1]&1)*2,m=(l[p+3]&3)<<11|l[p+4]<<3|(l[p+5]&224)>>5,x=((l[p+6]&3)+1)*1024,E=x*pm/ju[(l[p+2]&60)>>>2],l.byteLength-p<m)break;this.trigger("data",{pts:d.pts+c*E,dts:d.dts+c*E,sampleCount:x,audioobjecttype:(l[p+2]>>>6&3)+1,channelcount:(l[p+2]&1)<<2|(l[p+3]&192)>>>6,samplerate:ju[(l[p+2]&60)>>>2],samplingfrequencyindex:(l[p+2]&60)>>>2,samplesize:16,data:l.subarray(p+7+T,p+m)}),c++,p+=m}typeof w=="number"&&(this.skipWarn_(w,p),w=null),l=l.subarray(p)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){l=void 0,this.trigger("reset")},this.endTimeline=function(){l=void 0,this.trigger("endedtimeline")}},Or.prototype=new fm;var mm=Or,Vu;Vu=function(o){var l=o.byteLength,c=0,d=0;this.length=function(){return 8*l},this.bitsAvailable=function(){return 8*l+d},this.loadWord=function(){var p=o.byteLength-l,m=new Uint8Array(4),T=Math.min(4,l);if(T===0)throw new Error("no bytes available");m.set(o.subarray(p,p+T)),c=new DataView(m.buffer).getUint32(0),d=T*8,l-=T},this.skipBits=function(p){var m;d>p?(c<<=p,d-=p):(p-=d,m=Math.floor(p/8),p-=m*8,l-=m,this.loadWord(),c<<=p,d-=p)},this.readBits=function(p){var m=Math.min(d,p),T=c>>>32-m;return d-=m,d>0?c<<=m:l>0&&this.loadWord(),m=p-m,m>0?T<<m|this.readBits(m):T},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if(c&2147483648>>>p)return c<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var gm=Vu,Hu=t,_m=gm,Lr,bs,zu;bs=function(){var o=0,l,c;bs.prototype.init.call(this),this.push=function(d){var p;c?(p=new Uint8Array(c.byteLength+d.data.byteLength),p.set(c),p.set(d.data,c.byteLength),c=p):c=d.data;for(var m=c.byteLength;o<m-3;o++)if(c[o+2]===1){l=o+5;break}for(;l<m;)switch(c[l]){case 0:if(c[l-1]!==0){l+=2;break}else if(c[l-2]!==0){l++;break}o+3!==l-2&&this.trigger("data",c.subarray(o+3,l-2));do l++;while(c[l]!==1&&l<m);o=l-2,l+=3;break;case 1:if(c[l-1]!==0||c[l-2]!==0){l+=3;break}this.trigger("data",c.subarray(o+3,l-2)),o=l-2,l+=3;break;default:l+=3;break}c=c.subarray(o),l-=o,o=0},this.reset=function(){c=null,o=0,this.trigger("reset")},this.flush=function(){c&&c.byteLength>3&&this.trigger("data",c.subarray(o+3)),c=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},bs.prototype=new Hu,zu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o=new bs,l,c,d,p,m,T,v;Lr.prototype.init.call(this),l=this,this.push=function(x){x.type==="video"&&(c=x.trackId,d=x.pts,p=x.dts,o.push(x))},o.on("data",function(x){var E={trackId:c,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(E.nalUnitTypeCode){case 5:E.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:E.nalUnitType="sei_rbsp",E.escapedRBSP=m(x.subarray(1));break;case 7:E.nalUnitType="seq_parameter_set_rbsp",E.escapedRBSP=m(x.subarray(1)),E.config=T(E.escapedRBSP);break;case 8:E.nalUnitType="pic_parameter_set_rbsp";break;case 9:E.nalUnitType="access_unit_delimiter_rbsp";break}l.trigger("data",E)}),o.on("done",function(){l.trigger("done")}),o.on("partialdone",function(){l.trigger("partialdone")}),o.on("reset",function(){l.trigger("reset")}),o.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},v=function(x,E){var w=8,R=8,j,F;for(j=0;j<x;j++)R!==0&&(F=E.readExpGolomb(),R=(w+F+256)%256),w=R===0?w:R},m=function(x){for(var E=x.byteLength,w=[],R=1,j,F;R<E-2;)x[R]===0&&x[R+1]===0&&x[R+2]===3?(w.push(R+2),R+=2):R++;if(w.length===0)return x;j=E-w.length,F=new Uint8Array(j);var z=0;for(R=0;R<j;z++,R++)z===w[0]&&(z++,w.shift()),F[R]=x[z];return F},T=function(x){var E=0,w=0,R=0,j=0,F,z,K,Ee,Qe,zt,Is,ks,Ps,Os,zr,he=[1,1],Ls,ht;if(F=new _m(x),z=F.readUnsignedByte(),Ee=F.readUnsignedByte(),K=F.readUnsignedByte(),F.skipUnsignedExpGolomb(),zu[z]&&(Qe=F.readUnsignedExpGolomb(),Qe===3&&F.skipBits(1),F.skipUnsignedExpGolomb(),F.skipUnsignedExpGolomb(),F.skipBits(1),F.readBoolean()))for(zr=Qe!==3?8:12,ht=0;ht<zr;ht++)F.readBoolean()&&(ht<6?v(16,F):v(64,F));if(F.skipUnsignedExpGolomb(),zt=F.readUnsignedExpGolomb(),zt===0)F.readUnsignedExpGolomb();else if(zt===1)for(F.skipBits(1),F.skipExpGolomb(),F.skipExpGolomb(),Is=F.readUnsignedExpGolomb(),ht=0;ht<Is;ht++)F.skipExpGolomb();if(F.skipUnsignedExpGolomb(),F.skipBits(1),ks=F.readUnsignedExpGolomb(),Ps=F.readUnsignedExpGolomb(),Os=F.readBits(1),Os===0&&F.skipBits(1),F.skipBits(1),F.readBoolean()&&(E=F.readUnsignedExpGolomb(),w=F.readUnsignedExpGolomb(),R=F.readUnsignedExpGolomb(),j=F.readUnsignedExpGolomb()),F.readBoolean()&&F.readBoolean()){switch(Ls=F.readUnsignedByte(),Ls){case 1:he=[1,1];break;case 2:he=[12,11];break;case 3:he=[10,11];break;case 4:he=[16,11];break;case 5:he=[40,33];break;case 6:he=[24,11];break;case 7:he=[20,11];break;case 8:he=[32,11];break;case 9:he=[80,33];break;case 10:he=[18,11];break;case 11:he=[15,11];break;case 12:he=[64,33];break;case 13:he=[160,99];break;case 14:he=[4,3];break;case 15:he=[3,2];break;case 16:he=[2,1];break;case 255:{he=[F.readUnsignedByte()<<8|F.readUnsignedByte(),F.readUnsignedByte()<<8|F.readUnsignedByte()];break}}he&&he[0]/he[1]}return{profileIdc:z,levelIdc:K,profileCompatibility:Ee,width:(ks+1)*16-E*2-w*2,height:(2-Os)*(Ps+1)*16-R*2-j*2,sarRatio:he}}},Lr.prototype=new Hu;var ym={H264Stream:Lr,NalByteStream:bs},Tm=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Gu=function(o,l){var c=o[l+6]<<21|o[l+7]<<14|o[l+8]<<7|o[l+9],d=o[l+5],p=(d&16)>>4;return c=c>=0?c:0,p?c+20:c+10},Wu=function(o,l){return o.length-l<10||o[l]!=="I".charCodeAt(0)||o[l+1]!=="D".charCodeAt(0)||o[l+2]!=="3".charCodeAt(0)?l:(l+=Gu(o,l),Wu(o,l))},vm=function(o){var l=Wu(o,0);return o.length>=l+2&&(o[l]&255)===255&&(o[l+1]&240)===240&&(o[l+1]&22)===16},Xu=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},bm=function(o,l,c){var d,p="";for(d=l;d<c;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},xm=function(o,l,c){return unescape(bm(o,l,c))},Sm=function(o,l){var c=(o[l+5]&224)>>5,d=o[l+4]<<3,p=o[l+3]&6144;return p|d|c},Em=function(o,l){return o[l]==="I".charCodeAt(0)&&o[l+1]==="D".charCodeAt(0)&&o[l+2]==="3".charCodeAt(0)?"timed-metadata":o[l]&!0&&(o[l+1]&240)===240?"audio":null},Cm=function(o){for(var l=0;l+5<o.length;){if(o[l]!==255||(o[l+1]&246)!==240){l++;continue}return Tm[(o[l+2]&60)>>>2]}return null},Am=function(o){var l,c,d,p;l=10,o[5]&64&&(l+=4,l+=Xu(o.subarray(10,14)));do{if(c=Xu(o.subarray(l+4,l+8)),c<1)return null;if(p=String.fromCharCode(o[l],o[l+1],o[l+2],o[l+3]),p==="PRIV"){d=o.subarray(l+10,l+c+10);for(var m=0;m<d.byteLength;m++)if(d[m]===0){var T=xm(d,0,m);if(T==="com.apple.streaming.transportStreamTimestamp"){var v=d.subarray(m+1),x=(v[3]&1)<<30|v[4]<<22|v[5]<<14|v[6]<<6|v[7]>>>2;return x*=4,x+=v[7]&3,x}break}}l+=10,l+=c}while(l<o.byteLength);return null},fa={isLikelyAacData:vm,parseId3TagSize:Gu,parseAdtsSize:Sm,parseType:Em,parseSampleRate:Cm,parseAacTimestamp:Am},Dm=t,Ku=fa,Rr;Rr=function(){var o=new Uint8Array,l=0;Rr.prototype.init.call(this),this.setTimestamp=function(c){l=c},this.push=function(c){var d=0,p=0,m,T,v,x;for(o.length?(x=o.length,o=new Uint8Array(c.byteLength+x),o.set(o.subarray(0,x)),o.set(c,x)):o=c;o.length-p>=3;){if(o[p]==="I".charCodeAt(0)&&o[p+1]==="D".charCodeAt(0)&&o[p+2]==="3".charCodeAt(0)){if(o.length-p<10||(d=Ku.parseId3TagSize(o,p),p+d>o.length))break;T={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",T),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=Ku.parseAdtsSize(o,p),p+d>o.length))break;v={type:"audio",data:o.subarray(p,p+d),pts:l,dts:l},this.trigger("data",v),p+=d;continue}p++}m=o.length-p,m>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},Rr.prototype=new Dm;var wm=Rr,Im=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],km=Im,Pm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Om=Pm,Nr=t,xs=Sp,Ss=Op,Mr=qp,ct=Gp,Pt=dm,Br=ce,Yu=mm,Lm=ym.H264Stream,Rm=wm,Nm=fa.isLikelyAacData,Mm=ce.ONE_SECOND_IN_TS,pa=km,ma=Om,Es,Ei,Fr,ui,Bm=function(o,l){l.stream=o,this.trigger("log",l)},Qu=function(o,l){for(var c=Object.keys(l),d=0;d<c.length;d++){var p=c[d];p==="headOfPipeline"||!l[p].on||l[p].on("log",Bm.bind(o,p))}},Ju=function(o,l){var c;if(o.length!==l.length)return!1;for(c=0;c<o.length;c++)if(o[c]!==l[c])return!1;return!0},ga=function(o,l,c,d,p,m){var T=c-l,v=d-l,x=p-c;return{start:{dts:o,pts:o+T},end:{dts:o+v,pts:o+x},prependedContentDuration:m,baseMediaDecodeTime:o}};Ei=function(o,l){var c=[],d,p=0,m=0,T=1/0;l=l||{},d=l.firstSequenceNumber||0,Ei.prototype.init.call(this),this.push=function(v){ct.collectDtsInfo(o,v),o&&pa.forEach(function(x){o[x]=v[x]}),c.push(v)},this.setEarliestDts=function(v){p=v},this.setVideoBaseMediaDecodeTime=function(v){T=v},this.setAudioAppendStart=function(v){m=v},this.flush=function(){var v,x,E,w,R,j,F;if(c.length===0){this.trigger("done","AudioSegmentStream");return}v=Mr.trimAdtsFramesByEarliestDts(c,o,p),o.baseMediaDecodeTime=ct.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),F=Mr.prefixWithSilence(o,v,m,T),o.samples=Mr.generateSampleTable(v),E=xs.mdat(Mr.concatenateFrameData(v)),c=[],x=xs.moof(d,[o]),w=new Uint8Array(x.byteLength+E.byteLength),d++,w.set(x),w.set(E,x.byteLength),ct.clearDtsInfo(o),R=Math.ceil(Mm*1024/o.samplerate),v.length&&(j=v.length*R,this.trigger("segmentTimingInfo",ga(Br.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),v[0].dts,v[0].pts,v[0].dts+j,v[0].pts+j,F||0)),this.trigger("timingInfo",{start:v[0].pts,end:v[0].pts+j})),this.trigger("data",{track:o,boxes:w}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ct.clearDtsInfo(o),c=[],this.trigger("reset")}},Ei.prototype=new Nr,Es=function(o,l){var c,d=[],p=[],m,T;l=l||{},c=l.firstSequenceNumber||0,Es.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(v){ct.collectDtsInfo(o,v),v.nalUnitType==="seq_parameter_set_rbsp"&&!m&&(m=v.config,o.sps=[v.data],ma.forEach(function(x){o[x]=m[x]},this)),v.nalUnitType==="pic_parameter_set_rbsp"&&!T&&(T=v.data,o.pps=[v.data]),d.push(v)},this.flush=function(){for(var v,x,E,w,R,j,F=0,z,K;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(v=Ss.groupNalsIntoFrames(d),E=Ss.groupFramesIntoGops(v),E[0][0].keyFrame||(x=this.getGopForFusion_(d[0],o),x?(F=x.duration,E.unshift(x),E.byteLength+=x.byteLength,E.nalCount+=x.nalCount,E.pts=x.pts,E.dts=x.dts,E.duration+=x.duration):E=Ss.extendFirstKeyFrame(E)),p.length){var Ee;if(l.alignGopsAtEnd?Ee=this.alignGopsAtEnd_(E):Ee=this.alignGopsAtStart_(E),!Ee){this.gopCache_.unshift({gop:E.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ct.clearDtsInfo(o),E=Ee}ct.collectDtsInfo(o,E),o.samples=Ss.generateSampleTable(E),R=xs.mdat(Ss.concatenateNalData(E)),o.baseMediaDecodeTime=ct.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),this.trigger("processedGopsInfo",E.map(function(Qe){return{pts:Qe.pts,dts:Qe.dts,byteLength:Qe.byteLength}})),z=E[0],K=E[E.length-1],this.trigger("segmentTimingInfo",ga(o.baseMediaDecodeTime,z.dts,z.pts,K.dts+K.duration,K.pts+K.duration,F)),this.trigger("timingInfo",{start:E[0].pts,end:E[E.length-1].pts+E[E.length-1].duration}),this.gopCache_.unshift({gop:E.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),w=xs.moof(c,[o]),j=new Uint8Array(w.byteLength+R.byteLength),c++,j.set(w),j.set(R,w.byteLength),this.trigger("data",{track:o,boxes:j}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){ct.clearDtsInfo(o),m=void 0,T=void 0},this.getGopForFusion_=function(v){var x=45e3,E=1e4,w=1/0,R,j,F,z,K;for(K=0;K<this.gopCache_.length;K++)z=this.gopCache_[K],F=z.gop,!(!(o.pps&&Ju(o.pps[0],z.pps[0]))||!(o.sps&&Ju(o.sps[0],z.sps[0])))&&(F.dts<o.timelineStartInfo.dts||(R=v.dts-F.dts-F.duration,R>=-E&&R<=x&&(!j||w>R)&&(j=z,w=R)));return j?j.gop:null},this.alignGopsAtStart_=function(v){var x,E,w,R,j,F,z,K;for(j=v.byteLength,F=v.nalCount,z=v.duration,x=E=0;x<p.length&&E<v.length&&(w=p[x],R=v[E],w.pts!==R.pts);){if(R.pts>w.pts){x++;continue}E++,j-=R.byteLength,F-=R.nalCount,z-=R.duration}return E===0?v:E===v.length?null:(K=v.slice(E),K.byteLength=j,K.duration=z,K.nalCount=F,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(v){var x,E,w,R,j,F;for(x=p.length-1,E=v.length-1,j=null,F=!1;x>=0&&E>=0;){if(w=p[x],R=v[E],w.pts===R.pts){F=!0;break}if(w.pts>R.pts){x--;continue}x===p.length-1&&(j=E),E--}if(!F&&j===null)return null;var z;if(F?z=E:z=j,z===0)return v;var K=v.slice(z),Ee=K.reduce(function(Qe,zt){return Qe.byteLength+=zt.byteLength,Qe.duration+=zt.duration,Qe.nalCount+=zt.nalCount,Qe},{byteLength:0,duration:0,nalCount:0});return K.byteLength=Ee.byteLength,K.duration=Ee.duration,K.nalCount=Ee.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(v){p=v}},Es.prototype=new Nr,ui=function(o,l){this.numberOfTracks=0,this.metadataStream=l,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ui.prototype.init.call(this),this.push=function(c){if(c.content||c.text)return this.pendingCaptions.push(c);if(c.frames)return this.pendingMetadata.push(c);this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))}},ui.prototype=new Nr,ui.prototype.flush=function(o){var l=0,c={captions:[],captionStreams:{},metadata:[],info:{}},d,p,m,T=0,v;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(T=this.videoTrack.timelineStartInfo.pts,ma.forEach(function(x){c.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(T=this.audioTrack.timelineStartInfo.pts,pa.forEach(function(x){c.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?c.type=this.pendingTracks[0].type:c.type="combined",this.emittedTracks+=this.pendingTracks.length,m=xs.initSegment(this.pendingTracks),c.initSegment=new Uint8Array(m.byteLength),c.initSegment.set(m),c.data=new Uint8Array(this.pendingBytes),v=0;v<this.pendingBoxes.length;v++)c.data.set(this.pendingBoxes[v],l),l+=this.pendingBoxes[v].byteLength;for(v=0;v<this.pendingCaptions.length;v++)d=this.pendingCaptions[v],d.startTime=Br.metadataTsToSeconds(d.startPts,T,this.keepOriginalTimestamps),d.endTime=Br.metadataTsToSeconds(d.endPts,T,this.keepOriginalTimestamps),c.captionStreams[d.stream]=!0,c.captions.push(d);for(v=0;v<this.pendingMetadata.length;v++)p=this.pendingMetadata[v],p.cueTime=Br.metadataTsToSeconds(p.pts,T,this.keepOriginalTimestamps),c.metadata.push(p);for(c.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",c),v=0;v<c.captions.length;v++)d=c.captions[v],this.trigger("caption",d);for(v=0;v<c.metadata.length;v++)p=c.metadata[v],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ui.prototype.setRemux=function(o){this.remuxTracks=o},Fr=function(o){var l=this,c=!0,d,p;Fr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="aac",m.metadataStream=new Pt.MetadataStream,m.aacStream=new Rm,m.audioTimestampRolloverStream=new Pt.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new Pt.TimestampRolloverStream("timed-metadata"),m.adtsStream=new Yu,m.coalesceStream=new ui(o,m.metadataStream),m.headOfPipeline=m.aacStream,m.aacStream.pipe(m.audioTimestampRolloverStream).pipe(m.adtsStream),m.aacStream.pipe(m.timedMetadataTimestampRolloverStream).pipe(m.metadataStream).pipe(m.coalesceStream),m.metadataStream.on("timestamp",function(T){m.aacStream.setTimestamp(T.timeStamp)}),m.aacStream.on("data",function(T){T.type!=="timed-metadata"&&T.type!=="audio"||m.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:l.baseMediaDecodeTime},codec:"adts",type:"audio"},m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Ei(p,o),m.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),Qu(this,m)},this.setupTsPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new Pt.MetadataStream,m.packetStream=new Pt.TransportPacketStream,m.parseStream=new Pt.TransportParseStream,m.elementaryStream=new Pt.ElementaryStream,m.timestampRolloverStream=new Pt.TimestampRolloverStream,m.adtsStream=new Yu,m.h264Stream=new Lm,m.captionStream=new Pt.CaptionStream(o),m.coalesceStream=new ui(o,m.metadataStream),m.headOfPipeline=m.packetStream,m.packetStream.pipe(m.parseStream).pipe(m.elementaryStream).pipe(m.timestampRolloverStream),m.timestampRolloverStream.pipe(m.h264Stream),m.timestampRolloverStream.pipe(m.adtsStream),m.timestampRolloverStream.pipe(m.metadataStream).pipe(m.coalesceStream),m.h264Stream.pipe(m.captionStream).pipe(m.coalesceStream),m.elementaryStream.on("data",function(T){var v;if(T.type==="metadata"){for(v=T.tracks.length;v--;)!d&&T.tracks[v].type==="video"?(d=T.tracks[v],d.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime):!p&&T.tracks[v].type==="audio"&&(p=T.tracks[v],p.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime);d&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new Es(d,o),m.videoSegmentStream.on("log",l.getLogTrigger_("videoSegmentStream")),m.videoSegmentStream.on("timelineStartInfo",function(x){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=x,m.audioSegmentStream.setEarliestDts(x.dts-l.baseMediaDecodeTime))}),m.videoSegmentStream.on("processedGopsInfo",l.trigger.bind(l,"gopInfo")),m.videoSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"videoSegmentTimingInfo")),m.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),m.videoSegmentStream.on("timingInfo",l.trigger.bind(l,"videoTimingInfo")),m.h264Stream.pipe(m.videoSegmentStream).pipe(m.coalesceStream)),p&&!m.audioSegmentStream&&(m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Ei(p,o),m.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),m.audioSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"audioSegmentTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream)),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("id3Frame",function(T){T.dispatchType=m.metadataStream.dispatchType,l.trigger("id3Frame",T)}),m.coalesceStream.on("caption",this.trigger.bind(this,"caption")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),Qu(this,m)},this.setBaseMediaDecodeTime=function(m){var T=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=m),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ct.clearDtsInfo(p),T.audioTimestampRolloverStream&&T.audioTimestampRolloverStream.discontinuity()),d&&(T.videoSegmentStream&&(T.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,ct.clearDtsInfo(d),T.captionStream.reset()),T.timestampRolloverStream&&T.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(m){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(m)},this.setRemux=function(m){var T=this.transmuxPipeline_;o.remux=m,T&&T.coalesceStream&&T.coalesceStream.setRemux(m)},this.alignGopsWith=function(m){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(m)},this.getLogTrigger_=function(m){var T=this;return function(v){v.stream=m,T.trigger("log",v)}},this.push=function(m){if(c){var T=Nm(m);T&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!T&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),c=!1}this.transmuxPipeline_.headOfPipeline.push(m)},this.flush=function(){c=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Fr.prototype=new Nr;var Fm={Transmuxer:Fr,VideoSegmentStream:Es,AudioSegmentStream:Ei,AUDIO_PROPERTIES:pa,VIDEO_PROPERTIES:ma,generateSegmentTimingInfo:ga},Um=function(o){return o>>>0},$m=function(o){return("00"+o.toString(16)).slice(-2)},Ur={toUnsigned:Um,toHexString:$m},qm=function(o){var l="";return l+=String.fromCharCode(o[0]),l+=String.fromCharCode(o[1]),l+=String.fromCharCode(o[2]),l+=String.fromCharCode(o[3]),l},_a=qm,jm=Ur.toUnsigned,Vm=_a,Zu=function(o,l){var c=[],d,p,m,T,v;if(!l.length)return null;for(d=0;d<o.byteLength;)p=jm(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),m=Vm(o.subarray(d+4,d+8)),T=p>1?d+p:o.byteLength,m===l[0]&&(l.length===1?c.push(o.subarray(d+8,T)):(v=Zu(o.subarray(d+8,T),l.slice(1)),v.length&&(c=c.concat(v)))),d=T;return c},$r=Zu,Hm=Ur.toUnsigned,zm=n.getUint64,Gm=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return l.version===1?l.baseMediaDecodeTime=zm(o.subarray(4)):l.baseMediaDecodeTime=Hm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),l},ya=Gm,Wm=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:l.getUint32(4)},d=c.flags[2]&1,p=c.flags[2]&2,m=c.flags[2]&8,T=c.flags[2]&16,v=c.flags[2]&32,x=c.flags[0]&65536,E=c.flags[0]&131072,w;return w=8,d&&(w+=4,c.baseDataOffset=l.getUint32(12),w+=4),p&&(c.sampleDescriptionIndex=l.getUint32(w),w+=4),m&&(c.defaultSampleDuration=l.getUint32(w),w+=4),T&&(c.defaultSampleSize=l.getUint32(w),w+=4),v&&(c.defaultSampleFlags=l.getUint32(w)),x&&(c.durationIsEmpty=!0),!d&&E&&(c.baseDataOffsetIsMoof=!0),c},Ta=Wm,el=n.getUint64,Xm=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),references:[],referenceId:l.getUint32(4),timescale:l.getUint32(8)},d=12;c.version===0?(c.earliestPresentationTime=l.getUint32(d),c.firstOffset=l.getUint32(d+4),d+=8):(c.earliestPresentationTime=el(o.subarray(d)),c.firstOffset=el(o.subarray(d+8)),d+=16),d+=2;var p=l.getUint16(d);for(d+=2;p>0;d+=12,p--)c.references.push({referenceType:(o[d]&128)>>>7,referencedSize:l.getUint32(d)&2147483647,subsegmentDuration:l.getUint32(d+4),startsWithSap:!!(o[d+8]&128),sapType:(o[d+8]&112)>>>4,sapDeltaTime:l.getUint32(d+8)&268435455});return c},Km=Xm,Ym=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},Qm=Ym,tl=Qm,Jm=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},c=new DataView(o.buffer,o.byteOffset,o.byteLength),d=l.flags[2]&1,p=l.flags[2]&4,m=l.flags[1]&1,T=l.flags[1]&2,v=l.flags[1]&4,x=l.flags[1]&8,E=c.getUint32(4),w=8,R;for(d&&(l.dataOffset=c.getInt32(w),w+=4),p&&E&&(R={flags:tl(o.subarray(w,w+4))},w+=4,m&&(R.duration=c.getUint32(w),w+=4),T&&(R.size=c.getUint32(w),w+=4),x&&(l.version===1?R.compositionTimeOffset=c.getInt32(w):R.compositionTimeOffset=c.getUint32(w),w+=4),l.samples.push(R),E--);E--;)R={},m&&(R.duration=c.getUint32(w),w+=4),T&&(R.size=c.getUint32(w),w+=4),v&&(R.flags=tl(o.subarray(w,w+4)),w+=4),x&&(l.version===1?R.compositionTimeOffset=c.getInt32(w):R.compositionTimeOffset=c.getUint32(w),w+=4),l.samples.push(R);return l},il=Jm,Zm=n,sl=Zm.getUint64,Pe,va,st=function(o){return new Date(o*1e3-20828448e5)},Cs=_a,eg=$r,tg=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c=[],d,p;for(d=0;d+4<o.length;d+=p){if(p=l.getUint32(d),d+=4,p<=0){c.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(o[d]&31){case 1:c.push("slice_layer_without_partitioning_rbsp");break;case 5:c.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:c.push("sei_rbsp");break;case 7:c.push("seq_parameter_set_rbsp");break;case 8:c.push("pic_parameter_set_rbsp");break;case 9:c.push("access_unit_delimiter_rbsp");break;default:c.push("UNKNOWN NAL - "+o[d]&31);break}}return c},Vt={avc1:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength);return{dataReferenceIndex:l.getUint16(6),width:l.getUint16(24),height:l.getUint16(26),horizresolution:l.getUint16(28)+l.getUint16(30)/16,vertresolution:l.getUint16(32)+l.getUint16(34)/16,frameCount:l.getUint16(40),depth:l.getUint16(74),config:Pe(o.subarray(78,o.byteLength))}},avcC:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={configurationVersion:o[0],avcProfileIndication:o[1],profileCompatibility:o[2],avcLevelIndication:o[3],lengthSizeMinusOne:o[4]&3,sps:[],pps:[]},d=o[5]&31,p,m,T,v;for(T=6,v=0;v<d;v++)m=l.getUint16(T),T+=2,c.sps.push(new Uint8Array(o.subarray(T,T+m))),T+=m;for(p=o[T],T++,v=0;v<p;v++)m=l.getUint16(T),T+=2,c.pps.push(new Uint8Array(o.subarray(T,T+m))),T+=m;return c},btrt:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength);return{bufferSizeDB:l.getUint32(0),maxBitrate:l.getUint32(4),avgBitrate:l.getUint32(8)}},edts:function(l){return{boxes:Pe(l)}},elst:function(l){var c=new DataView(l.buffer,l.byteOffset,l.byteLength),d={version:c.getUint8(0),flags:new Uint8Array(l.subarray(1,4)),edits:[]},p=c.getUint32(4),m;for(m=8;p;p--)d.version===0?(d.edits.push({segmentDuration:c.getUint32(m),mediaTime:c.getInt32(m+4),mediaRate:c.getUint16(m+8)+c.getUint16(m+10)/(256*256)}),m+=12):(d.edits.push({segmentDuration:sl(l.subarray(m)),mediaTime:sl(l.subarray(m+8)),mediaRate:c.getUint16(m+16)+c.getUint16(m+18)/(256*256)}),m+=20);return d},esds:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),esId:o[6]<<8|o[7],streamPriority:o[8]&31,decoderConfig:{objectProfileIndication:o[11],streamType:o[12]>>>2&63,bufferSize:o[13]<<16|o[14]<<8|o[15],maxBitrate:o[16]<<24|o[17]<<16|o[18]<<8|o[19],avgBitrate:o[20]<<24|o[21]<<16|o[22]<<8|o[23],decoderConfigDescriptor:{tag:o[24],length:o[25],audioObjectType:o[26]>>>3&31,samplingFrequencyIndex:(o[26]&7)<<1|o[27]>>>7&1,channelConfiguration:o[27]>>>3&15}}}},ftyp:function(o){for(var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={majorBrand:Cs(o.subarray(0,4)),minorVersion:l.getUint32(4),compatibleBrands:[]},d=8;d<o.byteLength;)c.compatibleBrands.push(Cs(o.subarray(d,d+4))),d+=4;return c},dinf:function(o){return{boxes:Pe(o)}},dref:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),dataReferences:Pe(o.subarray(8))}},hdlr:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),handlerType:Cs(o.subarray(8,12)),name:""},d=8;for(d=24;d<o.byteLength;d++){if(o[d]===0){d++;break}c.name+=String.fromCharCode(o[d])}return c.name=decodeURIComponent(escape(c.name)),c},mdat:function(o){return{byteLength:o.byteLength,nals:tg(o)}},mdhd:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d,p={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),language:""};return p.version===1?(c+=4,p.creationTime=st(l.getUint32(c)),c+=8,p.modificationTime=st(l.getUint32(c)),c+=4,p.timescale=l.getUint32(c),c+=8,p.duration=l.getUint32(c)):(p.creationTime=st(l.getUint32(c)),c+=4,p.modificationTime=st(l.getUint32(c)),c+=4,p.timescale=l.getUint32(c),c+=4,p.duration=l.getUint32(c)),c+=4,d=l.getUint16(c),p.language+=String.fromCharCode((d>>10)+96),p.language+=String.fromCharCode(((d&992)>>5)+96),p.language+=String.fromCharCode((d&31)+96),p},mdia:function(o){return{boxes:Pe(o)}},mfhd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),sequenceNumber:o[4]<<24|o[5]<<16|o[6]<<8|o[7]}},minf:function(o){return{boxes:Pe(o)}},mp4a:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={dataReferenceIndex:l.getUint16(6),channelcount:l.getUint16(16),samplesize:l.getUint16(18),samplerate:l.getUint16(24)+l.getUint16(26)/65536};return o.byteLength>28&&(c.streamDescriptor=Pe(o.subarray(28))[0]),c},moof:function(o){return{boxes:Pe(o)}},moov:function(o){return{boxes:Pe(o)}},mvex:function(o){return{boxes:Pe(o)}},mvhd:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4))};return d.version===1?(c+=4,d.creationTime=st(l.getUint32(c)),c+=8,d.modificationTime=st(l.getUint32(c)),c+=4,d.timescale=l.getUint32(c),c+=8,d.duration=l.getUint32(c)):(d.creationTime=st(l.getUint32(c)),c+=4,d.modificationTime=st(l.getUint32(c)),c+=4,d.timescale=l.getUint32(c),c+=4,d.duration=l.getUint32(c)),c+=4,d.rate=l.getUint16(c)+l.getUint16(c+2)/16,c+=4,d.volume=l.getUint8(c)+l.getUint8(c+1)/8,c+=2,c+=2,c+=2*4,d.matrix=new Uint32Array(o.subarray(c,c+9*4)),c+=9*4,c+=6*4,d.nextTrackId=l.getUint32(c),d},pdin:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),rate:l.getUint32(4),initialDelay:l.getUint32(8)}},sdtp:function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},c;for(c=4;c<o.byteLength;c++)l.samples.push({dependsOn:(o[c]&48)>>4,isDependedOn:(o[c]&12)>>2,hasRedundancy:o[c]&3});return l},sidx:Km,smhd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),balance:o[4]+o[5]/256}},stbl:function(o){return{boxes:Pe(o)}},ctts:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),compositionOffsets:[]},d=l.getUint32(4),p;for(p=8;d;p+=8,d--)c.compositionOffsets.push({sampleCount:l.getUint32(p),sampleOffset:l[c.version===0?"getUint32":"getInt32"](p+4)});return c},stss:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),syncSamples:[]},d=l.getUint32(4),p;for(p=8;d;p+=4,d--)c.syncSamples.push(l.getUint32(p));return c},stco:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),chunkOffsets:[]},d=l.getUint32(4),p;for(p=8;d;p+=4,d--)c.chunkOffsets.push(l.getUint32(p));return c},stsc:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c=l.getUint32(4),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleToChunks:[]},p;for(p=8;c;p+=12,c--)d.sampleToChunks.push({firstChunk:l.getUint32(p),samplesPerChunk:l.getUint32(p+4),sampleDescriptionIndex:l.getUint32(p+8)});return d},stsd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleDescriptions:Pe(o.subarray(8))}},stsz:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleSize:l.getUint32(4),entries:[]},d;for(d=12;d<o.byteLength;d+=4)c.entries.push(l.getUint32(d));return c},stts:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),timeToSamples:[]},d=l.getUint32(4),p;for(p=8;d;p+=8,d--)c.timeToSamples.push({sampleCount:l.getUint32(p),sampleDelta:l.getUint32(p+4)});return c},styp:function(o){return Vt.ftyp(o)},tfdt:ya,tfhd:Ta,tkhd:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d={version:l.getUint8(0),flags:new Uint8Array(o.subarray(1,4))};return d.version===1?(c+=4,d.creationTime=st(l.getUint32(c)),c+=8,d.modificationTime=st(l.getUint32(c)),c+=4,d.trackId=l.getUint32(c),c+=4,c+=8,d.duration=l.getUint32(c)):(d.creationTime=st(l.getUint32(c)),c+=4,d.modificationTime=st(l.getUint32(c)),c+=4,d.trackId=l.getUint32(c),c+=4,c+=4,d.duration=l.getUint32(c)),c+=4,c+=2*4,d.layer=l.getUint16(c),c+=2,d.alternateGroup=l.getUint16(c),c+=2,d.volume=l.getUint8(c)+l.getUint8(c+1)/8,c+=2,c+=2,d.matrix=new Uint32Array(o.subarray(c,c+9*4)),c+=9*4,d.width=l.getUint16(c)+l.getUint16(c+2)/65536,c+=4,d.height=l.getUint16(c)+l.getUint16(c+2)/65536,d},traf:function(o){return{boxes:Pe(o)}},trak:function(o){return{boxes:Pe(o)}},trex:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:l.getUint32(4),defaultSampleDescriptionIndex:l.getUint32(8),defaultSampleDuration:l.getUint32(12),defaultSampleSize:l.getUint32(16),sampleDependsOn:o[20]&3,sampleIsDependedOn:(o[21]&192)>>6,sampleHasRedundancy:(o[21]&48)>>4,samplePaddingValue:(o[21]&14)>>1,sampleIsDifferenceSample:!!(o[21]&1),sampleDegradationPriority:l.getUint16(22)}},trun:il,"url ":function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4))}},vmhd:function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),graphicsmode:l.getUint16(4),opcolor:new Uint16Array([l.getUint16(6),l.getUint16(8),l.getUint16(10)])}}};Pe=function(o){for(var l=0,c=[],d,p,m,T,v,x=new ArrayBuffer(o.length),E=new Uint8Array(x),w=0;w<o.length;++w)E[w]=o[w];for(d=new DataView(x);l<o.byteLength;)p=d.getUint32(l),m=Cs(o.subarray(l+4,l+8)),T=p>1?l+p:o.byteLength,v=(Vt[m]||function(R){return{data:R}})(o.subarray(l+8,T)),v.size=p,v.type=m,c.push(v),l=T;return c},va=function(o,l){var c;return l=l||0,c=new Array(l*2+1).join(" "),o.map(function(d,p){return c+d.type+`
205
- `+Object.keys(d).filter(function(m){return m!=="type"&&m!=="boxes"}).map(function(m){var T=c+" "+m+": ",v=d[m];if(v instanceof Uint8Array||v instanceof Uint32Array){var x=Array.prototype.slice.call(new Uint8Array(v.buffer,v.byteOffset,v.byteLength)).map(function(E){return" "+("00"+E.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return x?x.length===1?T+"<"+x.join("").slice(1)+">":T+`<
206
- `+x.map(function(E){return c+" "+E}).join(`
207
- `)+`
208
- `+c+" >":T+"<>"}return T+JSON.stringify(v,null,2).split(`
209
- `).map(function(E,w){return w===0?E:c+" "+E}).join(`
210
- `)}).join(`
211
- `)+(d.boxes?`
212
- `+va(d.boxes,l+1):"")}).join(`
213
- `)};var rl={inspect:Pe,textify:va,parseType:Cs,findBox:eg,parseTraf:Vt.traf,parseTfdt:Vt.tfdt,parseHdlr:Vt.hdlr,parseTfhd:Vt.tfhd,parseTrun:Vt.trun,parseSidx:Vt.sidx},ig=function(o){for(var l=0,c=String.fromCharCode(o[l]),d="";c!=="\0";)d+=c,l++,c=String.fromCharCode(o[l]);return d+=c,d},sg={uint8ToCString:ig},qr=sg.uint8ToCString,rg=n.getUint64,ng=function(o){var l=4,c=o[0],d,p,m,T,v,x,E,w;if(c===0){d=qr(o.subarray(l)),l+=d.length,p=qr(o.subarray(l)),l+=p.length;var R=new DataView(o.buffer);m=R.getUint32(l),l+=4,v=R.getUint32(l),l+=4,x=R.getUint32(l),l+=4,E=R.getUint32(l),l+=4}else if(c===1){var R=new DataView(o.buffer);m=R.getUint32(l),l+=4,T=rg(o.subarray(l)),l+=8,x=R.getUint32(l),l+=4,E=R.getUint32(l),l+=4,d=qr(o.subarray(l)),l+=d.length,p=qr(o.subarray(l)),l+=p.length}w=new Uint8Array(o.subarray(l,o.byteLength));var j={scheme_id_uri:d,value:p,timescale:m||1,presentation_time:T,presentation_time_delta:v,event_duration:x,id:E,message_data:w};return og(c,j)?j:void 0},ag=function(o,l,c,d){return o||o===0?o/l:d+c/l},og=function(o,l){var c=l.scheme_id_uri!=="\0",d=o===0&&nl(l.presentation_time_delta)&&c,p=o===1&&nl(l.presentation_time)&&c;return!(o>1)&&d||p},nl=function(o){return o!==void 0||o!==null},ug={parseEmsgBox:ng,scaleTime:ag},As;typeof window<"u"?As=window:typeof i<"u"?As=i:typeof self<"u"?As=self:As={};var al=As,jr=Ur.toUnsigned,Ds=Ur.toHexString,ve=$r,Ci=_a,ba=ug,lg=Ta,cg=il,hg=ya,dg=n.getUint64,ol,ul,ll,cl,hl,xa,dl,Sa=al,fg=$u.parseId3Frames;ol=function(o){var l={},c=ve(o,["moov","trak"]);return c.reduce(function(d,p){var m,T,v,x,E;return m=ve(p,["tkhd"])[0],!m||(T=m[0],v=T===0?12:20,x=jr(m[v]<<24|m[v+1]<<16|m[v+2]<<8|m[v+3]),E=ve(p,["mdia","mdhd"])[0],!E)?null:(T=E[0],v=T===0?12:20,d[x]=jr(E[v]<<24|E[v+1]<<16|E[v+2]<<8|E[v+3]),d)},l)},ul=function(o,l){var c;c=ve(l,["moof","traf"]);var d=c.reduce(function(p,m){var T=ve(m,["tfhd"])[0],v=jr(T[4]<<24|T[5]<<16|T[6]<<8|T[7]),x=o[v]||9e4,E=ve(m,["tfdt"])[0],w=new DataView(E.buffer,E.byteOffset,E.byteLength),R;E[0]===1?R=dg(E.subarray(4,12)):R=w.getUint32(4);let j;return typeof R=="bigint"?j=R/Sa.BigInt(x):typeof R=="number"&&!isNaN(R)&&(j=R/x),j<Number.MAX_SAFE_INTEGER&&(j=Number(j)),j<p&&(p=j),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},ll=function(o,l){var c=ve(l,["moof","traf"]),d=0,p=0,m;if(c&&c.length){var T=ve(c[0],["tfhd"])[0],v=ve(c[0],["trun"])[0],x=ve(c[0],["tfdt"])[0];if(T){var E=lg(T);m=E.trackId}if(x){var w=hg(x);d=w.baseMediaDecodeTime}if(v){var R=cg(v);R.samples&&R.samples.length&&(p=R.samples[0].compositionTimeOffset||0)}}var j=o[m]||9e4;typeof d=="bigint"&&(p=Sa.BigInt(p),j=Sa.BigInt(j));var F=(d+p)/j;return typeof F=="bigint"&&F<Number.MAX_SAFE_INTEGER&&(F=Number(F)),F},cl=function(o){var l=ve(o,["moov","trak"]),c=[];return l.forEach(function(d){var p=ve(d,["mdia","hdlr"]),m=ve(d,["tkhd"]);p.forEach(function(T,v){var x=Ci(T.subarray(8,12)),E=m[v],w,R,j;x==="vide"&&(w=new DataView(E.buffer,E.byteOffset,E.byteLength),R=w.getUint8(0),j=R===0?w.getUint32(12):w.getUint32(20),c.push(j))})}),c},xa=function(o){var l=o[0],c=l===0?12:20;return jr(o[c]<<24|o[c+1]<<16|o[c+2]<<8|o[c+3])},hl=function(o){var l=ve(o,["moov","trak"]),c=[];return l.forEach(function(d){var p={},m=ve(d,["tkhd"])[0],T,v;m&&(T=new DataView(m.buffer,m.byteOffset,m.byteLength),v=T.getUint8(0),p.id=v===0?T.getUint32(12):T.getUint32(20));var x=ve(d,["mdia","hdlr"])[0];if(x){var E=Ci(x.subarray(8,12));E==="vide"?p.type="video":E==="soun"?p.type="audio":p.type=E}var w=ve(d,["mdia","minf","stbl","stsd"])[0];if(w){var R=w.subarray(8);p.codec=Ci(R.subarray(4,8));var j=ve(R,[p.codec])[0],F,z;j&&(/^[asm]vc[1-9]$/i.test(p.codec)?(F=j.subarray(78),z=Ci(F.subarray(4,8)),z==="avcC"&&F.length>11?(p.codec+=".",p.codec+=Ds(F[9]),p.codec+=Ds(F[10]),p.codec+=Ds(F[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(F=j.subarray(28),z=Ci(F.subarray(4,8)),z==="esds"&&F.length>20&&F[19]!==0?(p.codec+="."+Ds(F[19]),p.codec+="."+Ds(F[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=ve(d,["mdia","mdhd"])[0];K&&(p.timescale=xa(K)),c.push(p)}),c},dl=function(o,l=0){var c=ve(o,["emsg"]);return c.map(d=>{var p=ba.parseEmsgBox(new Uint8Array(d)),m=fg(p.message_data);return{cueTime:ba.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,l),duration:ba.scaleTime(p.event_duration,p.timescale),frames:m}})};var ws={findBox:ve,parseType:Ci,timescale:ol,startTime:ul,compositionStartTime:ll,videoTrackIds:cl,tracks:hl,getTimescaleFromMediaHeader:xa,getEmsgID3:dl};const{parseTrun:pg}=rl,{findBox:fl}=ws;var pl=al,mg=function(o){var l=fl(o,["moof","traf"]),c=fl(o,["mdat"]),d=[];return c.forEach(function(p,m){var T=l[m];d.push({mdat:p,traf:T})}),d},gg=function(o,l,c){var d=l,p=c.defaultSampleDuration||0,m=c.defaultSampleSize||0,T=c.trackId,v=[];return o.forEach(function(x){var E=pg(x),w=E.samples;w.forEach(function(R){R.duration===void 0&&(R.duration=p),R.size===void 0&&(R.size=m),R.trackId=T,R.dts=d,R.compositionTimeOffset===void 0&&(R.compositionTimeOffset=0),typeof d=="bigint"?(R.pts=d+pl.BigInt(R.compositionTimeOffset),d+=pl.BigInt(R.duration)):(R.pts=d+R.compositionTimeOffset,d+=R.duration)}),v=v.concat(w)}),v},ml={getMdatTrafPairs:mg,parseSamples:gg},_g=Nu.discardEmulationPreventionBytes,yg=Mu.CaptionStream,Ea=$r,Tg=ya,vg=Ta,{getMdatTrafPairs:bg,parseSamples:xg}=ml,Sg=function(o,l){for(var c=o,d=0;d<l.length;d++){var p=l[d];if(c<p.size)return p;c-=p.size}return null},Eg=function(o,l,c){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},m,T,v,x;for(T=0;T+4<o.length;T+=v)if(v=d.getUint32(T),T+=4,!(v<=0))switch(o[T]&31){case 6:var E=o.subarray(T+1,T+1+v),w=Sg(T,l);if(m={nalUnitType:"sei_rbsp",size:v,data:E,escapedRBSP:_g(E),trackId:c},w)m.pts=w.pts,m.dts=w.dts,x=w;else if(x)m.pts=x.pts,m.dts=x.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+T+" for trackId "+c+". See mux.js#223."});break}p.seiNals.push(m);break}return p},Cg=function(o,l){var c={},d=bg(o);return d.forEach(function(p){var m=p.mdat,T=p.traf,v=Ea(T,["tfhd"]),x=vg(v[0]),E=x.trackId,w=Ea(T,["tfdt"]),R=w.length>0?Tg(w[0]).baseMediaDecodeTime:0,j=Ea(T,["trun"]),F,z;l===E&&j.length>0&&(F=xg(j,R,x),z=Eg(m,F,E),c[E]||(c[E]={seiNals:[],logs:[]}),c[E].seiNals=c[E].seiNals.concat(z.seiNals),c[E].logs=c[E].logs.concat(z.logs))}),c},Ag=function(o,l,c){var d;if(l===null)return null;d=Cg(o,l);var p=d[l]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:c}},Dg=function(){var o=!1,l,c,d,p,m,T;this.isInitialized=function(){return o},this.init=function(v){l=new yg,o=!0,T=v?v.isPartial:!1,l.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,m.captions.push(x),m.captionStreams[x.stream]=!0}),l.on("log",function(x){m.logs.push(x)})},this.isNewInit=function(v,x){return v&&v.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==v[0]||p!==x[d]},this.parse=function(v,x,E){var w;if(this.isInitialized()){if(!x||!E)return null;if(this.isNewInit(x,E))d=x[0],p=E[d];else if(d===null||!p)return c.push(v),null}else return null;for(;c.length>0;){var R=c.shift();this.parse(R,x,E)}return w=Ag(v,d,p),w&&w.logs&&(m.logs=m.logs.concat(w.logs)),w===null||!w.seiNals?m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null:(this.pushNals(w.seiNals),this.flushStream(),m)},this.pushNals=function(v){if(!this.isInitialized()||!v||v.length===0)return null;v.forEach(function(x){l.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;T?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){c=[],d=null,p=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},wg=Dg;const{parseTfdt:Ig}=rl,Ht=$r,{getTimescaleFromMediaHeader:kg}=ws,{parseSamples:Pg,getMdatTrafPairs:Og}=ml;var gl=function(){let o=9e4;this.init=function(l){const c=Ht(l,["moov","trak","mdia","mdhd"])[0];c&&(o=kg(c))},this.parseSegment=function(l){const c=[],d=Og(l);let p=0;return d.forEach(function(m){const T=m.mdat,v=m.traf,x=Ht(v,["tfdt"])[0],E=Ht(v,["tfhd"])[0],w=Ht(v,["trun"]);if(x&&(p=Ig(x).baseMediaDecodeTime),w.length&&E){const R=Pg(w,p,E);let j=0;R.forEach(function(F){const z="utf-8",K=new TextDecoder(z),Ee=T.slice(j,j+F.size);if(Ht(Ee,["vtte"])[0]){j+=F.size;return}Ht(Ee,["vttc"]).forEach(function(Is){const ks=Ht(Is,["payl"])[0],Ps=Ht(Is,["sttg"])[0],Os=F.pts/o,zr=(F.pts+F.duration)/o;let he,Ls;if(ks)try{he=K.decode(ks)}catch(ht){console.error(ht)}if(Ps)try{Ls=K.decode(Ps)}catch(ht){console.error(ht)}F.duration&&he&&c.push({cueText:he,start:Os,end:zr,settings:Ls})}),j+=F.size})}}),c}},Ca=Ar,_l=function(o){var l=o[1]&31;return l<<=8,l|=o[2],l},Vr=function(o){return!!(o[1]&64)},Hr=function(o){var l=0;return(o[3]&48)>>>4>1&&(l+=o[4]+1),l},Lg=function(o,l){var c=_l(o);return c===0?"pat":c===l?"pmt":l?"pes":null},Rg=function(o){var l=Vr(o),c=4+Hr(o);return l&&(c+=o[c]+1),(o[c+10]&31)<<8|o[c+11]},Ng=function(o){var l={},c=Vr(o),d=4+Hr(o);if(c&&(d+=o[d]+1),!!(o[d+5]&1)){var p,m,T;p=(o[d+1]&15)<<8|o[d+2],m=3+p-4,T=(o[d+10]&15)<<8|o[d+11];for(var v=12+T;v<m;){var x=d+v;l[(o[x+1]&31)<<8|o[x+2]]=o[x],v+=((o[x+3]&15)<<8|o[x+4])+5}return l}},Mg=function(o,l){var c=_l(o),d=l[c];switch(d){case Ca.H264_STREAM_TYPE:return"video";case Ca.ADTS_STREAM_TYPE:return"audio";case Ca.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Bg=function(o){var l=Vr(o);if(!l)return null;var c=4+Hr(o);if(c>=o.byteLength)return null;var d=null,p;return p=o[c+7],p&192&&(d={},d.pts=(o[c+9]&14)<<27|(o[c+10]&255)<<20|(o[c+11]&254)<<12|(o[c+12]&255)<<5|(o[c+13]&254)>>>3,d.pts*=4,d.pts+=(o[c+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(o[c+14]&14)<<27|(o[c+15]&255)<<20|(o[c+16]&254)<<12|(o[c+17]&255)<<5|(o[c+18]&254)>>>3,d.dts*=4,d.dts+=(o[c+18]&6)>>>1)),d},Aa=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Fg=function(o){for(var l=4+Hr(o),c=o.subarray(l),d=0,p=0,m=!1,T;p<c.byteLength-3;p++)if(c[p+2]===1){d=p+5;break}for(;d<c.byteLength;)switch(c[d]){case 0:if(c[d-1]!==0){d+=2;break}else if(c[d-2]!==0){d++;break}p+3!==d-2&&(T=Aa(c[p+3]&31),T==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0));do d++;while(c[d]!==1&&d<c.length);p=d-2,d+=3;break;case 1:if(c[d-1]!==0||c[d-2]!==0){d+=3;break}T=Aa(c[p+3]&31),T==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0),p=d-2,d+=3;break;default:d+=3;break}return c=c.subarray(p),d-=p,p=0,c&&c.byteLength>3&&(T=Aa(c[p+3]&31),T==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0)),m},Ug={parseType:Lg,parsePat:Rg,parsePmt:Ng,parsePayloadUnitStartIndicator:Vr,parsePesType:Mg,parsePesTime:Bg,videoPacketContainsKeyFrame:Fg},yl=Ar,Ai=Fu.handleRollover,se={};se.ts=Ug,se.aac=fa;var li=ce.ONE_SECOND_IN_TS,Be=188,gt=71,$g=function(o,l){for(var c=0,d=Be,p,m;d<o.byteLength;){if(o[c]===gt&&o[d]===gt){switch(p=o.subarray(c,d),m=se.ts.parseType(p,l.pid),m){case"pat":l.pid=se.ts.parsePat(p);break;case"pmt":var T=se.ts.parsePmt(p);l.table=l.table||{},Object.keys(T).forEach(function(v){l.table[v]=T[v]});break}c+=Be,d+=Be;continue}c++,d++}},Tl=function(o,l,c){for(var d=0,p=Be,m,T,v,x,E,w=!1;p<=o.byteLength;){if(o[d]===gt&&(o[p]===gt||p===o.byteLength)){switch(m=o.subarray(d,p),T=se.ts.parseType(m,l.pid),T){case"pes":v=se.ts.parsePesType(m,l.table),x=se.ts.parsePayloadUnitStartIndicator(m),v==="audio"&&x&&(E=se.ts.parsePesTime(m),E&&(E.type="audio",c.audio.push(E),w=!0));break}if(w)break;d+=Be,p+=Be;continue}d++,p++}for(p=o.byteLength,d=p-Be,w=!1;d>=0;){if(o[d]===gt&&(o[p]===gt||p===o.byteLength)){switch(m=o.subarray(d,p),T=se.ts.parseType(m,l.pid),T){case"pes":v=se.ts.parsePesType(m,l.table),x=se.ts.parsePayloadUnitStartIndicator(m),v==="audio"&&x&&(E=se.ts.parsePesTime(m),E&&(E.type="audio",c.audio.push(E),w=!0));break}if(w)break;d-=Be,p-=Be;continue}d--,p--}},qg=function(o,l,c){for(var d=0,p=Be,m,T,v,x,E,w,R,j,F=!1,z={data:[],size:0};p<o.byteLength;){if(o[d]===gt&&o[p]===gt){switch(m=o.subarray(d,p),T=se.ts.parseType(m,l.pid),T){case"pes":if(v=se.ts.parsePesType(m,l.table),x=se.ts.parsePayloadUnitStartIndicator(m),v==="video"&&(x&&!F&&(E=se.ts.parsePesTime(m),E&&(E.type="video",c.video.push(E),F=!0)),!c.firstKeyFrame)){if(x&&z.size!==0){for(w=new Uint8Array(z.size),R=0;z.data.length;)j=z.data.shift(),w.set(j,R),R+=j.byteLength;if(se.ts.videoPacketContainsKeyFrame(w)){var K=se.ts.parsePesTime(w);K?(c.firstKeyFrame=K,c.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}z.size=0}z.data.push(m),z.size+=m.byteLength}break}if(F&&c.firstKeyFrame)break;d+=Be,p+=Be;continue}d++,p++}for(p=o.byteLength,d=p-Be,F=!1;d>=0;){if(o[d]===gt&&o[p]===gt){switch(m=o.subarray(d,p),T=se.ts.parseType(m,l.pid),T){case"pes":v=se.ts.parsePesType(m,l.table),x=se.ts.parsePayloadUnitStartIndicator(m),v==="video"&&x&&(E=se.ts.parsePesTime(m),E&&(E.type="video",c.video.push(E),F=!0));break}if(F)break;d-=Be,p-=Be;continue}d--,p--}},jg=function(o,l){if(o.audio&&o.audio.length){var c=l;(typeof c>"u"||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(m){m.dts=Ai(m.dts,c),m.pts=Ai(m.pts,c),m.dtsTime=m.dts/li,m.ptsTime=m.pts/li})}if(o.video&&o.video.length){var d=l;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(m){m.dts=Ai(m.dts,d),m.pts=Ai(m.pts,d),m.dtsTime=m.dts/li,m.ptsTime=m.pts/li}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Ai(p.dts,d),p.pts=Ai(p.pts,d),p.dtsTime=p.dts/li,p.ptsTime=p.pts/li}}},Vg=function(o){for(var l=!1,c=0,d=null,p=null,m=0,T=0,v;o.length-T>=3;){var x=se.aac.parseType(o,T);switch(x){case"timed-metadata":if(o.length-T<10){l=!0;break}if(m=se.aac.parseId3TagSize(o,T),m>o.length){l=!0;break}p===null&&(v=o.subarray(T,T+m),p=se.aac.parseAacTimestamp(v)),T+=m;break;case"audio":if(o.length-T<7){l=!0;break}if(m=se.aac.parseAdtsSize(o,T),m>o.length){l=!0;break}d===null&&(v=o.subarray(T,T+m),d=se.aac.parseSampleRate(v)),c++,T+=m;break;default:T++;break}if(l)return null}if(d===null||p===null)return null;var E=li/d,w={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+c*1024*E,pts:p+c*1024*E}]};return w},Hg=function(o){var l={pid:null,table:null},c={};$g(o,l);for(var d in l.table)if(l.table.hasOwnProperty(d)){var p=l.table[d];switch(p){case yl.H264_STREAM_TYPE:c.video=[],qg(o,l,c),c.video.length===0&&delete c.video;break;case yl.ADTS_STREAM_TYPE:c.audio=[],Tl(o,l,c),c.audio.length===0&&delete c.audio;break}}return c},zg=function(o,l){var c=se.aac.isLikelyAacData(o),d;return c?d=Vg(o):d=Hg(o),!d||!d.audio&&!d.video?null:(jg(d,l),d)},Gg={inspect:zg,parseAudioPes_:Tl};const Wg=function(o,l){l.on("data",function(c){const d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=c.data;c.data=p.buffer,o.postMessage({action:"data",segment:c,byteOffset:p.byteOffset,byteLength:p.byteLength},[c.data])}),l.on("done",function(c){o.postMessage({action:"done"})}),l.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),l.on("videoSegmentTimingInfo",function(c){const d={start:{decode:ce.videoTsToSeconds(c.start.dts),presentation:ce.videoTsToSeconds(c.start.pts)},end:{decode:ce.videoTsToSeconds(c.end.dts),presentation:ce.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ce.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ce.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),l.on("audioSegmentTimingInfo",function(c){const d={start:{decode:ce.videoTsToSeconds(c.start.dts),presentation:ce.videoTsToSeconds(c.start.pts)},end:{decode:ce.videoTsToSeconds(c.end.dts),presentation:ce.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ce.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ce.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),l.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),l.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),l.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),l.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ce.videoTsToSeconds(c.start),end:ce.videoTsToSeconds(c.end)}})}),l.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ce.videoTsToSeconds(c.start),end:ce.videoTsToSeconds(c.end)}})}),l.on("log",function(c){o.postMessage({action:"log",log:c})})};class vl{constructor(l,c){this.options=c||{},this.self=l,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Fm.Transmuxer(this.options),Wg(this.self,this.transmuxer)}pushMp4Captions(l){this.captionParser||(this.captionParser=new wg,this.captionParser.init());const c=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.captionParser.parse(c,l.trackIds,l.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}initMp4WebVttParser(l){this.webVttParser||(this.webVttParser=new gl);const c=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.webVttParser.init(c)}getMp4WebVttText(l){this.webVttParser||(this.webVttParser=new gl);const c=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.webVttParser.parseSegment(c);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:l,data:c}){const d=ws.startTime(l,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:l}){const c=ws.tracks(l);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:l},[l.buffer])}probeEmsgID3({data:l,offset:c}){const d=ws.getEmsgID3(l,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:l},[l.buffer])}probeTs({data:l,baseStartTime:c}){const d=typeof c=="number"&&!isNaN(c)?c*ce.ONE_SECOND_IN_TS:void 0,p=Gg.inspect(l,d);let m=null;p&&(m={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},m.hasVideo&&(m.videoStart=p.video[0].ptsTime),m.hasAudio&&(m.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:m,data:l},[l.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(l){const c=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(l){const c=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ce.secondsToVideoTs(c)))}setAudioAppendStart(l){this.transmuxer.setAudioAppendStart(Math.ceil(ce.secondsToVideoTs(l.appendStart)))}setRemux(l){this.transmuxer.setRemux(l.remux)}flush(l){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(l){this.transmuxer.alignGopsWith(l.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new vl(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new vl(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var A2=Xf(C2);const D2=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:u,videoFrameDtsTime:h,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:u});const g=i.data.segment.boxes||{data:i.data.segment.data},_={type:s,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof h<"u"&&(_.videoFrameDtsTime=h),typeof f<"u"&&(_.videoFramePtsTime=f),t(_)},w2=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},I2=(i,e)=>{e.gopInfo=i.data.gopInfo},Qf=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:u,onAudioTimingInfo:h,onVideoTimingInfo:f,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:_,onId3:b,onCaptions:C,onDone:A,onEndedTimeline:y,onTransmuxerLog:I,isEndOfTimeline:D,segment:P,triggerSegmentEventFn:k}=i,L={buffer:[]};let N=D;const U=$=>{e.currentTransmux===i&&($.data.action==="data"&&D2($,L,a),$.data.action==="trackinfo"&&u($.data.trackInfo),$.data.action==="gopInfo"&&I2($,L),$.data.action==="audioTimingInfo"&&h($.data.audioTimingInfo),$.data.action==="videoTimingInfo"&&f($.data.videoTimingInfo),$.data.action==="videoSegmentTimingInfo"&&g($.data.videoSegmentTimingInfo),$.data.action==="audioSegmentTimingInfo"&&_($.data.audioSegmentTimingInfo),$.data.action==="id3Frame"&&b([$.data.id3Frame],$.data.id3Frame.dispatchType),$.data.action==="caption"&&C($.data.caption),$.data.action==="endedtimeline"&&(N=!1,y()),$.data.action==="log"&&I($.data.log),$.data.type==="transmuxed"&&(N||(e.onmessage=null,w2({transmuxedData:L,callback:A}),Jf(e))))},B=()=>{const $={message:"Received an error message from the transmuxer worker",metadata:{errorType:O.Error.StreamingFailedToTransmuxSegment,segmentInfo:di({segment:P})}};A(null,$)};if(e.onmessage=U,e.onerror=B,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const $=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;k({type:"segmenttransmuxingstart",segment:P}),e.postMessage({action:"push",data:$,byteOffset:X,byteLength:t.byteLength},[$])}D&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Jf=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Qf(i.currentTransmux))},Bc=(i,e)=>{i.postMessage({action:e}),Jf(i)},Zf=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Bc(e,i);return}e.transmuxQueue.push(Bc.bind(null,e,i))},k2=i=>{Zf("reset",i)},P2=i=>{Zf("endTimeline",i)},ep=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Qf(i);return}i.transmuxer.transmuxQueue.push(i)},O2=i=>{const e=new A2;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Wa={reset:k2,endTimeline:P2,transmux:ep,createTransmuxer:O2};const Hi=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=ke({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const u=[a?i.data:i.data.buffer];e.postMessage(r,u)}else e.postMessage(r)},St={FAILURE:2,TIMEOUT:-101,ABORTED:-102},tp="wvtt",vo=i=>{i.forEach(e=>{e.abort()})},L2=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),R2=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Cu=(i,e)=>{const{requestType:t}=e,s=Ti({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:St.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:St.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:St.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:St.FAILURE,xhr:e,metadata:s}:null},Fc=(i,e,t,s)=>(r,n)=>{const a=n.response,u=Cu(r,n);if(u)return t(u,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:St.FAILURE,xhr:n},i);const h=new DataView(a),f=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let _=0;_<e.length;_++)e[_].bytes=f;const g={uri:n.uri};return s({type:"segmentkeyloadcomplete",segment:i,keyInfo:g}),t(null,i)},N2=(i,e)=>{e===tp&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},M2=(i,e,t)=>{e===tp&&Hi({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:s,mp4VttCues:r})=>{i.bytes=s,t(null,i,{mp4VttCues:r})}})},ip=(i,e)=>{const t=zo(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:St.FAILURE,metadata:{mediaType:r}})}Hi({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale),n.type==="text"&&N2(i,n.codec))}),e(null))})},B2=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=Cu(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,ip(i,function(u){if(u)return u.xhr=r,u.status=r.status,e(u,i);e(null,i)})},F2=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=Cu(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const u=t==="arraybuffer"||!n.responseText?n.response:S2(n.responseText.substring(i.lastReachedChar||0));return i.stats=L2(n),i.key?i.encryptedBytes=new Uint8Array(u):i.bytes=new Uint8Array(u),e(null,i)},U2=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})=>{const A=i.map&&i.map.tracks||{},y=!!(A.audio&&A.video);let I=s.bind(null,i,"audio","start");const D=s.bind(null,i,"audio","end");let P=s.bind(null,i,"video","start");const k=s.bind(null,i,"video","end"),L=()=>ep({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:N=>{N.type=N.type==="combined"?"video":N.type,g(i,N)},onTrackInfo:N=>{t&&(y&&(N.isMuxed=!0),t(i,N))},onAudioTimingInfo:N=>{I&&typeof N.start<"u"&&(I(N.start),I=null),D&&typeof N.end<"u"&&D(N.end)},onVideoTimingInfo:N=>{P&&typeof N.start<"u"&&(P(N.start),P=null),k&&typeof N.end<"u"&&k(N.end)},onVideoSegmentTimingInfo:N=>{const U={pts:{start:N.start.presentation,end:N.end.presentation},dts:{start:N.start.decode,end:N.end.decode}};C({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:U}),r(N)},onAudioSegmentTimingInfo:N=>{const U={pts:{start:N.start.pts,end:N.end.pts},dts:{start:N.start.dts,end:N.end.dts}};C({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:U}),n(N)},onId3:(N,U)=>{a(i,N,U)},onCaptions:N=>{u(i,[N])},isEndOfTimeline:h,onEndedTimeline:()=>{f()},onTransmuxerLog:b,onDone:(N,U)=>{_&&(N.type=N.type==="combined"?"video":N.type,C({type:"segmenttransmuxingcomplete",segment:i}),_(U,i,N))},segment:i,triggerSegmentEventFn:C});Hi({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:N=>{i.bytes=e=N.data;const U=N.result;U&&(t(i,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:y}),t=null),L()}})},sp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})=>{let A=new Uint8Array(e);if(nT(A)){i.isFmp4=!0;const{tracks:y}=i.map;if(y.text&&(!y.audio||!y.video)){g(i,{data:A,type:"text"}),M2(i,y.text.codec,_);return}const D={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(D.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(D.videoCodec=y.video.codec),y.video&&y.audio&&(D.isMuxed=!0),t(i,D);const P=(k,L)=>{g(i,{data:A,type:D.hasAudio&&!D.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),k&&k.length&&u(i,k),_(null,i,{})};Hi({action:"probeMp4StartTime",timescales:i.map.timescales,data:A,transmuxer:i.transmuxer,callback:({data:k,startTime:L})=>{e=k.buffer,i.bytes=A=k,D.hasAudio&&!D.isMuxed&&s(i,"audio","start",L),D.hasVideo&&s(i,"video","start",L),Hi({action:"probeEmsgID3",data:A,transmuxer:i.transmuxer,offset:L,callback:({emsgData:N,id3Frames:U})=>{if(e=N.buffer,i.bytes=A=N,!y.video||!N.byteLength||!i.transmuxer){P(void 0,U);return}Hi({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:A,timescales:i.map.timescales,trackIds:[y.video.id],callback:B=>{e=B.data.buffer,i.bytes=A=B.data,B.logs.forEach(function($){b(te($,{stream:"mp4CaptionParser"}))}),P(B.captions,U)}})}})}});return}if(!i.transmuxer){_(null,i,{});return}if(typeof i.container>"u"&&(i.container=zo(A)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),_(null,i,{});return}U2({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})},rp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const u=f=>{if(f.data.source===i){s.removeEventListener("message",u);const g=f.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};s.onerror=()=>{const f="An error occurred in the decryption worker",g=di({segment:r}),_={message:f,metadata:{error:new Error(f),errorType:O.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(_,r)},s.addEventListener("message",u);let h;e.bytes.slice?h=e.bytes.slice():h=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(jf({source:i,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},$2=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})=>{C({type:"segmentdecryptionstart"}),rp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:_},A=>{e.bytes=A,C({type:"segmentdecryptioncomplete",segment:e}),sp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})})},q2=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})=>{let A=0,y=!1;return(I,D)=>{if(!y){if(I)return y=!0,vo(i),_(I,D);if(A+=1,A===i.length){const P=function(){if(D.encryptedBytes)return $2({decryptionWorker:e,segment:D,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C});sp({segment:D,bytes:D.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:b,triggerSegmentEventFn:C})};if(D.endOfAllRequests=Date.now(),D.map&&D.map.encryptedBytes&&!D.map.bytes)return C({type:"segmentdecryptionstart",segment:D}),rp({decryptionWorker:e,id:D.requestId+"-init",encryptedBytes:D.map.encryptedBytes,key:D.map.key,segment:D,doneFn:_},k=>{D.map.bytes=k,C({type:"segmentdecryptioncomplete",segment:D}),ip(D,L=>{if(L)return vo(i),_(L,D);P()})});P()}}}},j2=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},V2=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g})=>_=>{if(!_.target.aborted)return i.stats=te(i.stats,R2(_)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(_,i)},H2=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:C,dataFn:A,doneFn:y,onTransmuxerLog:I,triggerSegmentEventFn:D})=>{const P=[],k=q2({activeXhrs:P,decryptionWorker:t,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:C,dataFn:A,doneFn:y,onTransmuxerLog:I,triggerSegmentEventFn:D});if(s.key&&!s.key.bytes){const $=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&$.push(s.map.key);const X=te(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ne=Fc(s,$,k,D),J={uri:s.key.resolvedUri};D({type:"segmentkeyloadstart",segment:s,keyInfo:J});const oe=i(X,ne);P.push(oe)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const oe=te(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),H=Fc(s,[s.map.key],k,D),Z={uri:s.map.key.resolvedUri};D({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const Me=i(oe,H);P.push(Me)}const X=te(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:yo(s.map),requestType:"segment-media-initialization"}),ne=B2({segment:s,finishProcessingFn:k,triggerSegmentEventFn:D});D({type:"segmentloadstart",segment:s});const J=i(X,ne);P.push(J)}const L=te(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:yo(s),requestType:"segment"}),N=F2({segment:s,finishProcessingFn:k,responseType:L.responseType,triggerSegmentEventFn:D});D({type:"segmentloadstart",segment:s});const U=i(L,N);U.addEventListener("progress",V2({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:C,dataFn:A})),P.push(U);const B={};return P.forEach($=>{$.addEventListener("loadend",j2({loadendState:B,abortFn:r}))}),()=>vo(P)},Qr=ut("PlaylistSelector"),Uc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},zi=function(i,e){if(!i)return"";const t=S.getComputedStyle(i);return t?t[e]:""},Gi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Au=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||S.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||S.Number.MAX_VALUE,t-s},z2=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||S.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||S.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let np=function(i){const{main:e,bandwidth:t,playerWidth:s,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:u}=i;if(!e)return;const h={bandwidth:t,width:s,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;We.isAudioOnly(e)&&(f=u.getAudioTrackPlaylists_(),h.audioOnly=!0);let g=f.map(B=>{let $;const X=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.width,ne=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.height;return $=B.attributes&&B.attributes.BANDWIDTH,$=$||S.Number.MAX_VALUE,{bandwidth:$,width:X,height:ne,playlist:B}});Gi(g,(B,$)=>B.bandwidth-$.bandwidth),g=g.filter(B=>!We.isIncompatible(B.playlist));let _=g.filter(B=>We.isEnabled(B.playlist));_.length||(_=g.filter(B=>!We.isDisabled(B.playlist)));const b=_.filter(B=>B.bandwidth*Ce.BANDWIDTH_VARIANCE<t);let C=b[b.length-1];const A=b.filter(B=>B.bandwidth===C.bandwidth)[0];if(a===!1){const B=A||_[0]||g[0];if(B&&B.playlist){let $="sortedPlaylistReps";return A&&($="bandwidthBestRep"),_[0]&&($="enabledPlaylistReps"),Qr(`choosing ${Uc(B)} using ${$} with options`,h),B.playlist}return Qr("could not choose a playlist with options",h),null}const y=b.filter(B=>B.width&&B.height);Gi(y,(B,$)=>B.width-$.width);const I=y.filter(B=>B.width===s&&B.height===r);C=I[I.length-1];const D=I.filter(B=>B.bandwidth===C.bandwidth)[0];let P,k,L;D||(P=y.filter(B=>n==="cover"?B.width>s&&B.height>r:B.width>s||B.height>r),k=P.filter(B=>B.width===P[0].width&&B.height===P[0].height),C=k[k.length-1],L=k.filter(B=>B.bandwidth===C.bandwidth)[0]);let N;if(u.leastPixelDiffSelector){const B=y.map($=>($.pixelDiff=Math.abs($.width-s)+Math.abs($.height-r),$));Gi(B,($,X)=>$.pixelDiff===X.pixelDiff?X.bandwidth-$.bandwidth:$.pixelDiff-X.pixelDiff),N=B[0]}const U=N||L||D||A||_[0]||g[0];if(U&&U.playlist){let B="sortedPlaylistReps";return N?B="leastPixelDiffRep":L?B="resolutionPlusOneRep":D?B="resolutionBestRep":A?B="bandwidthBestRep":_[0]&&(B="enabledPlaylistReps"),Qr(`choosing ${Uc(U)} using ${B} with options`,h),U.playlist}return Qr("could not choose a playlist with options",h),null};const $c=function(){let i=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),np({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(zi(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(zi(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?zi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},G2=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),np({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(zi(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(zi(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?zi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},W2=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:u,syncController:h}=i,f=e.playlists.filter(A=>!We.isIncompatible(A));let g=f.filter(We.isEnabled);g.length||(g=f.filter(A=>!We.isDisabled(A)));const b=g.filter(We.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{const I=h.getSyncPoint(A,r,u,t)?1:2,P=We.estimateSegmentRequestTime(n,s,A)*I-a;return{playlist:A,rebufferingImpact:P}}),C=b.filter(A=>A.rebufferingImpact<=0);return Gi(C,(A,y)=>Au(y.playlist,A.playlist)),C.length?C[0]:(Gi(b,(A,y)=>A.rebufferingImpact-y.rebufferingImpact),b[0]||null)},X2=function(){const i=this.playlists.main.playlists.filter(We.isEnabled);return Gi(i,(t,s)=>Au(t,s)),i.filter(t=>!!Zs(this.playlists.main,t).video)[0]||null},K2=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function ap(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const Y2=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,u=t,h=!1;const f=n[s];f&&(a=f.label,u=f.language,h=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:h,label:a,language:u},!1).track}}},Q2=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const u=new s(r.startTime+t,r.endTime+t,a.text);u.line=a.line,u.align="left",u.position=a.position,u.positionAlign="line-left",i[n].addCue(u)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},J2=function(i){Object.defineProperties(i.frame,{id:{get(){return O.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return O.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return O.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},Z2=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=S.WebKitDataCue||S.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(g=>{const _=g.cueTime+t;typeof _!="number"||S.isNaN(_)||_<0||!(_<1/0)||!g.frames||!g.frames.length||g.frames.forEach(b=>{const C=new r(_,_,b.value||b.url||b.data||"");C.frame=b,C.value=b,J2(C),n.addCue(C)})}),!n.cues||!n.cues.length))return;const a=n.cues,u=[];for(let g=0;g<a.length;g++)a[g]&&u.push(a[g]);const h=u.reduce((g,_)=>{const b=g[_.startTime]||[];return b.push(_),g[_.startTime]=b,g},{}),f=Object.keys(h).sort((g,_)=>Number(g)-Number(_));f.forEach((g,_)=>{const b=h[g],C=isFinite(s)?s:g,A=Number(f[_+1])||C;b.forEach(y=>{y.endTime=A})})},eb={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},tb=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),ib=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(tb.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:eb[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},qc=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,O.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Gs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},sb=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},rb=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*fi.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>s);r++);return i.slice(r)},nb=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=s);r++);return i.slice(0,r).concat(e)},ab=(i,e,t,s)=>{const r=Math.ceil((e-s)*fi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*fi.ONE_SECOND_IN_TS),a=i.slice();let u=i.length;for(;u--&&!(i[u].pts<=n););if(u===-1)return a;let h=u+1;for(;h--&&!(i[h].pts<=r););return h=Math.max(h,0),a.splice(h,u-h+1),a},ob=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==s[r]||i[n]!==e[n])return!1}return!0},ub=function(i,e,t){e=e||[];const s=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(i===a.timeline&&(s.push(n),r+=a.duration,r>t))return n}return s.length===0?0:s[s.length-1]},$s=1,lb=500,jc=i=>typeof i=="number"&&isFinite(i),Jr=1/60,cb=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,hb=(i,e,t)=>{let s=e-Ce.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Li=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:u=[]},mediaIndex:h,partIndex:f,timeline:g}=i,_=u.length-1;let b="mediaIndex/partIndex increment";i.getMediaInfoForTime?b=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(b="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(b+=` with independent ${i.independent}`);const C=typeof f=="number",A=i.segment.uri?"segment":"pre-segment",y=C?Ef({preloadSegment:s})-1:0;return`${A} [${n+h}/${n+_}]`+(C?` part [${f}/${y}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(C?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${b}] playlist [${a}]`},Vc=i=>`${i}TimingInfo`,db=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i<e?t:s.length?s.end(s.length-1):t,bo=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:s,audioDisabled:r})=>{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},fb=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},pb=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Kt=i=>{const e=i.pendingSegment_;if(!e)return;if(bo({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&fb(i.timelineChangeController_)){if(pb(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},mb=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=S.BigInt(n)-S.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Hc=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+bt:!1,gb=(i,e)=>{if(e!=="hls")return null;const t=mb({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Hc({segmentDuration:t,maxDuration:s*2}),n=Hc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},di=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class xo extends O.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ut(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(ke({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(ke({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Kt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Wa.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,S.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Wa.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return De();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=An(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=Vf(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
214
- currentTime: ${this.currentTime_()}
215
- bufferedEnd: ${za(this.buffered_())}
216
- `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Wa.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=ab(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const u in this.inbandTextTracks_)Gs(e,t,this.inbandTextTracks_[u]);Gs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),lb)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:di({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=za(e)||0,s=bu(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=ub(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const b=a[this.mediaIndex],C=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=b.end?b.end:t,b.parts&&b.parts[C+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=C+1):u.mediaIndex=this.mediaIndex+1}else{let b,C,A;const y=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
217
- For TargetTime: ${y}.
218
- CurrentTime: ${this.currentTime_()}
219
- BufferedEnd: ${t}
220
- Fetch At Buffer: ${this.fetchAtBuffer_}
221
- `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const I=this.getSyncInfoFromMediaSequenceSync_(y);if(!I){const D="No sync info found while using media sequence sync";return this.error({message:D,metadata:{errorType:O.Error.StreamingFailedToSelectNextSegment,error:new Error(D)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${I.start} --> ${I.end})`),b=I.segmentIndex,C=I.partIndex,A=I.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const I=We.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:y,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});b=I.segmentIndex,C=I.partIndex,A=I.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${y}`:`currentTime ${y}`,u.mediaIndex=b,u.startOfSegment=A,u.partIndex=C,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const h=a[u.mediaIndex];let f=h&&typeof u.partIndex=="number"&&h.parts&&h.parts[u.partIndex];if(!h||typeof u.partIndex=="number"&&!f)return null;typeof u.partIndex!="number"&&h.parts&&(u.partIndex=0,f=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!g&&!f.independent)if(u.partIndex===0){const b=a[u.mediaIndex-1],C=b.parts&&b.parts.length&&b.parts[b.parts.length-1];C&&C.independent&&(u.mediaIndex-=1,u.partIndex=b.parts.length-1,u.independent="previous segment")}else h.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const _=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.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){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:u,forceTimestampOffset:h,getMediaInfoForTime:f}=e,g=s.segments[r],_=typeof u=="number"&&g.parts[u],b={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:_?u:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:_&&_.duration||g.duration,segment:g,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},C=typeof h<"u"?h:this.isPendingTimestampOffset_;b.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:C});const A=za(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(b.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(b.gopsToAlignWith=rb(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),b}timestampOffsetForSegment_(e){return db(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=We.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=Rv(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const u=W2({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const f=n-a-u.rebufferingImpact;let g=.5;a<=bt&&(g=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=u.playlist.attributes.BANDWIDTH*Ce.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Li(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:s,hasVideo:r}=t,n={segmentInfo:di({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:s,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},ob(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_():Kt(this))))}handleTimingInfo_(e,t,s,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Vc(t);n[a]=n[a]||{},n[a][s]=r,this.logger_(`timinginfo: ${t} - ${s} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(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}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const u=n[a.stream];u.startTime=Math.min(u.startTime,a.startTime+r),u.endTime=Math.max(u.endTime,a.endTime+r),u.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:u,endTime:h,captions:f}=n[a],g=this.inbandTextTracks_;this.logger_(`adding cues from ${u} -> ${h} for ${a}`),Y2(g,this.vhs_.tech_,a),Gs(u,h,g[a]),Q2({captionArray:f,inbandTextTracks:g,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!bo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!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;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||bo({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_()){Kt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Vc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,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:s,playlist:r}){if(s){const n=An(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+pi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+pi(a).join(", "));const u=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-u<=$s&&g-f<=$s){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${pi(n).join(", ")}, video buffer: ${pi(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:s}));const b=this.currentTime_()-$s;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${b}`),this.remove(0,b,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${$s}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=S.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},$s*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===Nf){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:O.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const u=[r];let h=r.byteLength;s&&(u.unshift(s),h+=s.byteLength),n=K2({bytes:h,segments:u})}const a={segmentInfo:di({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Kt(this),this.loadQueue_.push(()=>{const t=ke({},e,{forceTimestampOffset:!0});ke(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}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}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting
222
- ${ap(e.uri)}
223
- ${Li(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=H2({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:u,level:h,stream:f})=>{this.logger_(`${Li(e)} logged from transmuxer stream ${f} as a ${h}: ${u}`)},triggerSegmentEventFn:({type:u,segment:h,keyInfo:f,trackInfo:g,timingInfo:_})=>{const C={segmentInfo:di({segment:h})};f&&(C.keyInfo=f),g&&(C.trackInfo=g),_&&(C.timingInfo=_),this.trigger({type:u,metadata:C})}})}trimBackBuffer_(e){const t=hb(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.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:n},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===t.timeline&&(u.videoTimingInfo?a.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(a.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),t.key){const h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}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<Jr){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Jr}`);return}const s={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:s}),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,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,s));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===St.ABORTED)return;if(this.pause(),e.code===St.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=nb(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const 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:s,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:u,audioTimingInfo:h}){if(typeof e<"u")return e;if(!a)return h.start;const f=t.segments[s-1];return s===0||!f||typeof f.start>"u"||f.end!==r+n?r:u.start}waitForAppendsToComplete_(e){const 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}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,u=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!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);return}a&&e.waitingOnAppends++,u&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=cb(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:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const h={segmentInfo:di({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:h})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const 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"});const t=gb(e,this.sourceType_);if(t&&(t.severity==="warn"?O.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 ${Li(e)}`);return}this.logger_(`Appended ${Li(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");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Li(e)}`),this.resetEverything();return}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<Jr){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Jr}`);return}const t=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,s=t.start,r=t.end;if(!jc(s)||!jc(r))return;Gs(s,r,this.segmentMetadataTrack_);const n=S.WebKitDataCue||S.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:s,end:r},u=JSON.stringify(a),h=new n(s,r,u);h.value=a,this.segmentMetadataTrack_.addCue(h)}}function Lt(){}const op=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},_b=["video","audio"],So=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},yb=(i,e)=>{for(let t=0;t<e.length;t++){const s=e[t];if(s.type==="mediaSource")return null;if(s.type===i)return t}return null},Wi=(i,e)=>{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Wi("audio",e),Wi("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||So(i,e))){if(s.type!==i){if(t=yb(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Wi(i,e);return}}},up=(i,e)=>{const t=e[`${i}Buffer`],s=op(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Tt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Je={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(Tt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===Nf?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(Tt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];Tt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){O.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){O.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(Tt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){O.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=op(i),r=Xi(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(up(i,e),!!Tt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){O.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Xi(i);if(!Tt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const h={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:h}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(f){h.errorType=O.Error.StreamingCodecsChangeError,h.error=f,f.metadata=h,t.error_=f,t.trigger("error"),O.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},Ze=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Wi(i,e)},zc=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=Pv(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Wi(i,e)};class lp extends O.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Wi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ut("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=zc("video",this),this.onAudioUpdateEnd_=zc("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},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){Ze({type:"mediaSource",sourceUpdater:this,action:Je.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Ze({type:e,sourceUpdater:this,action:Je.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){O.log.error("removeSourceBuffer is not supported!");return}Ze({type:"mediaSource",sourceUpdater:this,action:Je.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!O.browser.IS_FIREFOX&&S.MediaSource&&S.MediaSource.prototype&&typeof S.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return S.SourceBuffer&&S.SourceBuffer.prototype&&typeof S.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){O.log.error("changeType is not supported!");return}Ze({type:e,sourceUpdater:this,action:Je.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Ze({type:r,sourceUpdater:this,action:Je.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return Tt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:De()}videoBuffered(){return Tt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:De()}buffered(){const e=Tt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Tt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Lv(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Lt){Ze({type:"mediaSource",sourceUpdater:this,action:Je.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Lt){typeof e!="string"&&(e=void 0),Ze({type:"mediaSource",sourceUpdater:this,action:Je.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Lt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Ze({type:"audio",sourceUpdater:this,action:Je.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Lt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Ze({type:"video",sourceUpdater:this,action:Je.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(So("audio",this)||So("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ze({type:"audio",sourceUpdater:this,action:Je.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Ze({type:"video",sourceUpdater:this,action:Je.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Ze({type:"audio",sourceUpdater:this,action:Je.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Ze({type:"video",sourceUpdater:this,action:Je.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),_b.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>up(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Gc=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),Tb=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Wc=new Uint8Array(`
224
-
225
- `.split("").map(i=>i.charCodeAt(0)));class vb extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class bb extends xo{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 De();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return De([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=An(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=Wc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Wc,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Gs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}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,s){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===St.TIMEOUT&&this.handleTimeout_(),e.code===St.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=s.mp4VttCues&&s.mp4VttCues.length;n&&(r.mp4VttCues=s.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof S.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(u){this.stopForError({message:u.message,metadata:{errorType:O.Error.StreamingVttParserError,error:u}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new S.VTTCue(u.startTime,u.endTime,u.text):u)}),sb(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const s=e&&e.type==="vtt",r=t&&t.type==="text";s&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(s=>{const r=s.start+t,n=s.end+t,a=new S.VTTCue(r,n,s.cueText);s.settings&&s.settings.split(" ").forEach(u=>{const h=u.split(":"),f=h[0],g=h[1];a[f]=isNaN(g)?g:Number(g)}),e.cues.push(a)})}parseVTTCues_(e){let t,s=!1;if(typeof S.WebVTT!="function")throw new vb;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof S.TextDecoder=="function"?t=new S.TextDecoder("utf8"):(t=S.WebVTT.StringDecoder(),s=!0);const r=new S.WebVTT.Parser(S,S.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{O.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=Gc(a)),r.parse(a)}let n=e.bytes;s&&(n=Gc(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,h=n/fi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const g=f.endTime-f.startTime,_=this.handleRollover_(f.startTime+h,t.time);f.startTime=Math.max(_,0),f.endTime=Math.max(_+g,0)}),!s.syncInfo){const f=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,g-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*fi.ONE_SECOND_IN_TS;const r=t*fi.ONE_SECOND_IN_TS;let n;for(r<s?n=-8589934592:n=8589934592;Math.abs(s-r)>4294967296;)s+=n;return s/fi.ONE_SECOND_IN_TS}}const xb=function(i,e){const t=i.cues;for(let s=0;s<t.length;s++){const r=t[s];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},Sb=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n<i.segments.length;n++){const a=i.segments[n];if(r||(r=xb(e,s+a.duration/2)),r){if("cueIn"in a){r.endTime=s,r.adEndTime=s,s+=a.duration,r=null;continue}if(s<r.endTime){s+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new S.VTTCue(s,s+a.duration,a.cueOut),r.adStartTime=s,r.adEndTime=s+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[u,h]=a.cueOutCont.split("/").map(parseFloat);r=new S.VTTCue(s,s+a.duration,""),r.adStartTime=s-u,r.adEndTime=r.adStartTime+h,e.addCue(r)}s+=a.duration}};class Xc{constructor({start:e,end:t,segmentIndex:s,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=s,this.partIndex_=r,this.appended_=n}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 Eb{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 cp{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){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=`
226
- `,a=s,u=t;this.start_=a,e.forEach((h,f)=>{const g=this.storage_.get(u),_=a,b=_+h.duration,C=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),A=new Xc({start:_,end:b,appended:C,segmentIndex:f});h.syncInfo=A;let y=a;const I=(h.parts||[]).map((D,P)=>{const k=y,L=y+D.duration,N=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[P]&&g.partsSyncInfo[P].isAppended),U=new Xc({start:k,end:L,appended:N,segmentIndex:f,partIndex:P});return y=L,n+=`Media Sequence: ${u}.${P} | Range: ${k} --> ${L} | Appended: ${N}
227
- `,D.syncInfo=U,U});r.set(u,new Eb(A,I)),n+=`${ap(h.resolvedUri)} | Media Sequence: ${u} | Range: ${_} --> ${b} | Appended: ${C}
228
- `,u++,a=b}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,s){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let u=0;u<n;u++){const h=t[u];a-=h.duration}return a}return s}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Kc extends cp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,s){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,s)}}const Cb=86400,Xa=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const u=a.getSyncInfoForTime(r);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const u=fo(e);r=r||0;for(let h=0;h<u.length;h++){const f=e.endList||r===0?h:u.length-(h+1),g=u[f],_=g.segment,b=i.timelineToDatetimeMappings[_.timeline];if(!b||!_.dateTimeObject)continue;let A=_.dateTimeObject.getTime()/1e3+b;if(_.parts&&typeof g.partIndex=="number")for(let I=0;I<g.partIndex;I++)A+=_.parts[I].duration;const y=Math.abs(r-A);if(a!==null&&(y===0||a<y))break;a=y,n={time:A,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return n}},{name:"Segment",run:(i,e,t,s,r)=>{let n=null,a=null;r=r||0;const u=fo(e);for(let h=0;h<u.length;h++){const f=e.endList||r===0?h:u.length-(h+1),g=u[f],_=g.segment,b=g.part&&g.part.start||_&&_.start;if(_.timeline===s&&typeof b<"u"){const C=Math.abs(r-b);if(a!==null&&a<C)break;(!n||a===null||a>=C)&&(a=C,n={time:b,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let u=0;u<e.discontinuityStarts.length;u++){const h=e.discontinuityStarts[u],f=e.discontinuitySequence+u+1,g=i.discontinuities[f];if(g){const _=Math.abs(r-g.time);if(a!==null&&a<_)break;(!n||a===null||a>=_)&&(a=_,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class Ab extends O.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new cp,s=new Kc(t),r=new Kc(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=ut("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Xa.find(({name:h})=>h==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const u of a){const{syncPoint:h,strategy:f}=u,{segmentIndex:g,time:_}=h;if(g<0)continue;const b=e.segments[g],C=_,A=C+b.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${g}. Time: [${C} -> ${A}]}`),r>=C&&r<A)return this.logger_("Found sync point with exact match: ",h),h}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Js({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let u=0;u<Xa.length;u++){const h=Xa[u],f=h.run(this,e,t,s,r,n);f&&(f.strategy=h.name,a.push({strategy:h.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let s=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const u=Math.abs(e[a].syncPoint[t.key]-t.value);u<r&&(r=u,s=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${s.time}, segmentIndex:${s.segmentIndex}`+(typeof s.partIndex=="number"?`,partIndex:${s.partIndex}`:"")+"]"),s}saveExpiredSegmentInfo(e,t){const s=t.mediaSequence-e.mediaSequence;if(s>Cb){O.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){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){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],u,h;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),u=e.startOfSegment,h=t.end+a.mapping;else if(a)u=t.start+a.mapping,h=t.end+a.mapping;else return!1;return n&&(n.start=u,n.end=h),(!r.start||u<r.start)&&(r.start=u),r.end=h,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,u=n-e.mediaIndex,h=Math.abs(u);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>h){let f;u<0?f=s.start-Js({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Js({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class Db extends O.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const wb=Kf(Yf(function(){var i=function(){function y(){this.listeners={}}var I=y.prototype;return I.on=function(P,k){this.listeners[P]||(this.listeners[P]=[]),this.listeners[P].push(k)},I.off=function(P,k){if(!this.listeners[P])return!1;var L=this.listeners[P].indexOf(k);return this.listeners[P]=this.listeners[P].slice(0),this.listeners[P].splice(L,1),L>-1},I.trigger=function(P){var k=this.listeners[P];if(k)if(arguments.length===2)for(var L=k.length,N=0;N<L;++N)k[N].call(this,arguments[1]);else for(var U=Array.prototype.slice.call(arguments,1),B=k.length,$=0;$<B;++$)k[$].apply(this,U)},I.dispose=function(){this.listeners={}},I.pipe=function(P){this.on("data",function(k){P.push(k)})},y}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(y){return y.subarray(0,y.byteLength-y[y.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const y=[[[],[],[],[],[]],[[],[],[],[],[]]],I=y[0],D=y[1],P=I[4],k=D[4];let L,N,U;const B=[],$=[];let X,ne,J,oe,H,Z;for(L=0;L<256;L++)$[(B[L]=L<<1^(L>>7)*283)^L]=L;for(N=U=0;!P[N];N^=X||1,U=$[U]||1)for(oe=U^U<<1^U<<2^U<<3^U<<4,oe=oe>>8^oe&255^99,P[N]=oe,k[oe]=N,J=B[ne=B[X=B[N]]],Z=J*16843009^ne*65537^X*257^N*16843008,H=B[oe]*257^oe*16843008,L=0;L<4;L++)I[L][N]=H=H<<24^H>>>8,D[L][oe]=Z=Z<<24^Z>>>8;for(L=0;L<5;L++)I[L]=I[L].slice(0),D[L]=D[L].slice(0);return y};let s=null;class r{constructor(I){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let D,P,k;const L=this._tables[0][4],N=this._tables[1],U=I.length;let B=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");const $=I.slice(0),X=[];for(this._key=[$,X],D=U;D<4*U+28;D++)k=$[D-1],(D%U===0||U===8&&D%U===4)&&(k=L[k>>>24]<<24^L[k>>16&255]<<16^L[k>>8&255]<<8^L[k&255],D%U===0&&(k=k<<8^k>>>24^B<<24,B=B<<1^(B>>7)*283)),$[D]=$[D-U]^k;for(P=0;D;P++,D--)k=$[P&3?D:D-4],D<=4||P<4?X[P]=k:X[P]=N[0][L[k>>>24]]^N[1][L[k>>16&255]]^N[2][L[k>>8&255]]^N[3][L[k&255]]}decrypt(I,D,P,k,L,N){const U=this._key[1];let B=I^U[0],$=k^U[1],X=P^U[2],ne=D^U[3],J,oe,H;const Z=U.length/4-2;let Me,ee=4;const Te=this._tables[1],It=Te[0],si=Te[1],ri=Te[2],ni=Te[3],ai=Te[4];for(Me=0;Me<Z;Me++)J=It[B>>>24]^si[$>>16&255]^ri[X>>8&255]^ni[ne&255]^U[ee],oe=It[$>>>24]^si[X>>16&255]^ri[ne>>8&255]^ni[B&255]^U[ee+1],H=It[X>>>24]^si[ne>>16&255]^ri[B>>8&255]^ni[$&255]^U[ee+2],ne=It[ne>>>24]^si[B>>16&255]^ri[$>>8&255]^ni[X&255]^U[ee+3],ee+=4,B=J,$=oe,X=H;for(Me=0;Me<4;Me++)L[(3&-Me)+N]=ai[B>>>24]<<24^ai[$>>16&255]<<16^ai[X>>8&255]<<8^ai[ne&255]^U[ee++],J=B,B=$,$=X,X=ne,ne=J}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(I){this.jobs.push(I),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(y){return y<<24|(y&65280)<<8|(y&16711680)>>8|y>>>24},u=function(y,I,D){const P=new Int32Array(y.buffer,y.byteOffset,y.byteLength>>2),k=new r(Array.prototype.slice.call(I)),L=new Uint8Array(y.byteLength),N=new Int32Array(L.buffer);let U,B,$,X,ne,J,oe,H,Z;for(U=D[0],B=D[1],$=D[2],X=D[3],Z=0;Z<P.length;Z+=4)ne=a(P[Z]),J=a(P[Z+1]),oe=a(P[Z+2]),H=a(P[Z+3]),k.decrypt(ne,J,oe,H,N,Z),N[Z]=a(N[Z]^U),N[Z+1]=a(N[Z+1]^B),N[Z+2]=a(N[Z+2]^$),N[Z+3]=a(N[Z+3]^X),U=ne,B=J,$=oe,X=H;return L};class h{constructor(I,D,P,k){const L=h.STEP,N=new Int32Array(I.buffer),U=new Uint8Array(I.byteLength);let B=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(N.subarray(B,B+L),D,P,U)),B=L;B<N.length;B+=L)P=new Uint32Array([a(N[B-4]),a(N[B-3]),a(N[B-2]),a(N[B-1])]),this.asyncStream_.push(this.decryptChunk_(N.subarray(B,B+L),D,P,U));this.asyncStream_.push(function(){k(null,e(U))})}static get STEP(){return 32e3}decryptChunk_(I,D,P,k){return function(){const L=u(I,D,P);k.set(L,I.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof f<"u"?g=f:typeof self<"u"?g=self:g={};var _=g,b=function(I){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(I):I&&I.buffer instanceof ArrayBuffer},C=_.BigInt||Number;C("0x1"),C("0x100"),C("0x10000"),C("0x1000000"),C("0x100000000"),C("0x10000000000"),C("0x1000000000000"),C("0x100000000000000"),C("0x10000000000000000"),function(){var y=new Uint16Array([65484]),I=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);return I[0]===255?"big":I[0]===204?"little":"unknown"}();const A=function(y){const I={};return Object.keys(y).forEach(D=>{const P=y[D];b(P)?I[D]={bytes:P.buffer,byteOffset:P.byteOffset,byteLength:P.byteLength}:I[D]=P}),I};self.onmessage=function(y){const I=y.data,D=new Uint8Array(I.encrypted.bytes,I.encrypted.byteOffset,I.encrypted.byteLength),P=new Uint32Array(I.key.bytes,I.key.byteOffset,I.key.byteLength/4),k=new Uint32Array(I.iv.bytes,I.iv.byteOffset,I.iv.byteLength/4);new h(D,P,k,function(L,N){self.postMessage(A({source:I.source,decrypted:N}),[N.buffer])})}}));var Ib=Xf(wb);const kb=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},hp=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Eo=(i,e)=>{e.activePlaylistLoader=i,i.load()},Pb=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),u=r.activePlaylistLoader,h=r.lastGroup_;if(!(a&&h&&a.id===h.id)&&(r.lastGroup_=a,r.lastTrack_=n,hp(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){u&&s.resetEverything();return}t.resyncLoader(),Eo(a.playlistLoader,r)}},Ob=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},Lb=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),u=n.getActiveGroup(),h=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=u,n.lastTrack_=a,hp(s,n),!!u)){if(u.isMainPlaylist){if(!a||!f||a.id===f.id)return;const g=e.vhs.playlistController_,_=g.selectPlaylist();if(g.media()===_)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),g.fastQualityChange_(_);return}if(i==="AUDIO"){if(!u.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(h===u.playlistLoader){Eo(u.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Eo(u.playlistLoader,n)}},Dn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,u=t.tracks[a];if(r===u){s({error:{message:"Problem encountered loading the default audio track."}});return}O.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in t.tracks)t.tracks[h].enabled=t.tracks[h]===u;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;O.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},Yc={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const u=e.media();n.playlist(u,r),n.track(a.activeTrack()),(!s.paused()||u.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))}},Rb={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:u,tracks:h,logger_:f}},mainPlaylistLoader:g}=e,_=_r(g.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},_&&(a[i].main.default.playlists=g.main.playlists));for(const b in a[i]){u[b]||(u[b]=[]);for(const C in a[i][b]){let A=a[i][b][C],y;if(_?(f(`AUDIO group '${b}' label '${C}' is a main playlist`),A.isMainPlaylist=!0,y=null):s==="vhs-json"&&A.playlists?y=new Bi(A.playlists[0],t,n):A.resolvedUri?y=new Bi(A.resolvedUri,t,n):A.playlists&&s==="dash"?y=new To(A.playlists[0],t,n,g):y=null,A=te({id:C,playlistLoader:y},A),Yc[i](i,A.playlistLoader,e),u[b].push(A),typeof h[C]>"u"){const I=new O.AudioTrack({id:C,kind:kb(A),enabled:!1,language:A.language,default:A.default,label:C});h[C]=I}}}r.on("error",Dn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:u},mediaTypes:{[i]:{groups:h,tracks:f}},mainPlaylistLoader:g}=e;for(const _ in u[i]){h[_]||(h[_]=[]);for(const b in u[i][_]){if(!s.options_.useForcedSubtitles&&u[i][_][b].forced)continue;let C=u[i][_][b],A;if(r==="hls")A=new Bi(C.resolvedUri,s,a);else if(r==="dash"){if(!C.playlists.filter(I=>I.excludeUntil!==1/0).length)return;A=new To(C.playlists[0],s,a,g)}else r==="vhs-json"&&(A=new Bi(C.playlists?C.playlists[0]:C.resolvedUri,s,a));if(C=te({id:b,playlistLoader:A},C),Yc[i](i,C.playlistLoader,e),h[_].push(C),typeof f[b]>"u"){const y=t.addRemoteTextTrack({id:b,kind:"subtitles",default:C.default&&C.autoselect,language:C.language,label:b},!1).track;f[b]=y}}}n.on("error",Dn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const u in s[i][a]){const h=s[i][a][u];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:u,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(f[g.instreamId]&&(g=te(g,f[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(te({id:u},h)),typeof n[u]>"u"){const _=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[u]=_}}}}},dp=(i,e)=>{for(let t=0;t<i.length;t++)if(Eu(e,i[t])||i[t].playlists&&dp(i[t].playlists,e))return!0;return!1},Nb=(i,e)=>t=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const u=Object.keys(r);if(!a)if(i==="AUDIO"&&u.length>1&&_r(e.main))for(let h=0;h<u.length;h++){const f=r[u[h]];if(dp(f,n)){a=f;break}}else r.main?a=r.main:u.length===1&&(a=r[u[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(h=>h.id===t.id)[0]||null},Mb={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},Bb=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},Fb=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{Rb[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=Nb(f,i),e[f].activeTrack=Mb[f](f,i),e[f].onGroupChanged=Pb(f,i),e[f].onGroupChanging=Ob(f,i),e[f].onTrackChanged=Lb(f,i),e[f].getActiveGroup=Bb(f,i)});const u=e.AUDIO.activeGroup();if(u){const f=(u.filter(_=>_.default)[0]||u[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",h),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",h),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},Ub=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Lt,activeTrack:Lt,getActiveGroup:Lt,onGroupChanged:Lt,onTrackChanged:Lt,lastTrack_:null,logger_:ut(`MediaGroups[${e}]`)}}),i};class Qc{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_=Ge(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}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 $b extends O.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Qc,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_=ut("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ge(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const f=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${f} seconds.`),this.startTTLTimeout_(parseInt(f,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let u;try{u=JSON.parse(this.request_.responseText)}catch(f){const g={errorType:O.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(u);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new S.URL(e),s=new S.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(S.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new S.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,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());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=S.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){S.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 Qc}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&&(Ge(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const qb=(i,e)=>{let t=null;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,s)},e)}},jb=10;let Yt;const Vb=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Hb=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},zb=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:u,log:h}){if(!s)return O.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return h(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const g=!!Mi(e,t).length;if(!i.endList)return!g&&typeof i.partTargetDuration=="number"?(h(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(h(`${f} as current playlist is live`),!0);const _=bu(e,t),b=u?Ce.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ce.MAX_BUFFER_LOW_WATER_LINE;if(a<b)return h(`${f} as duration < max low water line (${a} < ${b})`),!0;const C=s.attributes.BANDWIDTH,A=i.attributes.BANDWIDTH;if(C<A&&(!u||_<n)){let y=`${f} as next bandwidth < current bandwidth (${C} < ${A})`;return u&&(y+=` and forwardBuffer < bufferHighWaterLine (${_} < ${n})`),h(y),!0}if((!u||C>A)&&_>=r){let y=`${f} as forwardBuffer >= bufferLowWaterLine (${_} >= ${r})`;return u&&(y+=` and next bandwidth > current bandwidth (${C} > ${A})`),h(y),!0}return h(`not ${f} as no switching criteria met`),!1};class Gb extends O.EventTarget{constructor(e){super(),this.fastQualityChange_=qb(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:u,playlistExclusionDuration:h,enableLowInitialPlaylist:f,sourceType:g,cacheEncryptionKeys:_,bufferBasedABR:b,leastPixelDiffSelector:C,captionServices:A,experimentalUseMMS:y}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:I}=e;(I===null||typeof I>"u")&&(I=1/0),Yt=a,this.bufferBasedABR=!!b,this.leastPixelDiffSelector=!!C,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=u,this.playlistExclusionDuration=h,this.maxPlaylistRetries=I,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:I,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Ub(),y&&S.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new S.ManagedMediaSource,this.usingManagedMediaSource_=!0,O.log("Using ManagedMediaSource")):S.MediaSource&&(this.mediaSource=new S.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_=De(),this.hasPlayed_=!1,this.syncController_=new Ab(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new Ib,this.sourceUpdater_=new lp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Db,this.keyStatusMap_=new Map;const D={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:A,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:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:_,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new To(t,this.vhs_,te(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Bi(t,this.vhs_,te(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new xo(te(D,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new xo(te(D,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new bb(te(D,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((L,N)=>{function U(){r.off("vttjserror",B),L()}function B(){r.off("vttjsloaded",U),N()}r.one("vttjsloaded",U),r.one("vttjserror",B),r.addWebVttScript_()})}),e);const P=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new $b(this.vhs_.xhr,P),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Vb.forEach(L=>{this[L+"_"]=Hb.bind(this,L)}),this.logger_=ut("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;const k=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(k,()=>{const L=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-L,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const u={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(u=>u.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=S.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(S.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const u=s.main||r.length&&s[r[0]];for(const h in u)if(u[h].default){n={label:h};break}}if(!n)return t;const a=[];for(const u in s)if(s[u][n.label]){const h=s[u][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const g=e.playlists[f];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===u&&a.push(g)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;po(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),Fb({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(),t),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 t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;po(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(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(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(ke({},s))})})}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){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const u in s.AUDIO[a])s.AUDIO[a][u].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Yt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[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){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return zb({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,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",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),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",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),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",s=>{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:jb}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!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(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(ke({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(ke({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(ke({},r))})})}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()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}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();const 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(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const s=t.end(0);let r=s;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(s+n,t.start(0)):r=Math.min(s,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const 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){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Yt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=xt;const u=a.end(a.length-1);return u-n<=xt&&r-u<=xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Zn),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return O.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){const A=this.pathwayAttribute_(e),y=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(A),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(A)},y);return}let C=!1;r.forEach(A=>{if(A===e)return;const y=A.excludeUntil;typeof y<"u"&&y!==1/0&&(C=!0,delete A.excludeUntil)}),C&&(O.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+s*1e3,e.excludeUntil=u,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:O.log.warn,g=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const _=h.targetDuration/2*1e3||5*1e3,b=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=_;return this.switchMedia_(h,"exclude",a||b)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const u=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;u&&s.push(u)}),["main","audio","subtitle"].forEach(a=>{const u=this[`${a}SegmentLoader_`];u&&(e===a||e==="all")&&s.push(u)}),s.forEach(a=>t.forEach(u=>{typeof a[u]=="function"&&a[u]()}))}setCurrentTime(e){const t=Mi(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;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Yt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const s=e.media();if(!s)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const u=r.start,h=r.end;if(!isFinite(u)||!isFinite(h))return null;const f=Yt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s),g=Math.max(u,h-f);return De([[u,g]])}const n=this.syncController_.getExpiredTime(s,this.duration());if(n===null)return null;const a=Yt.Playlist.seekable(s,n,Yt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const s=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||s>a?e:De([[Math.max(s,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const 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;const s=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||s&&s.length&&this.seekable_.length&&s.start(0)===this.seekable_.start(0)&&s.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${xf(this.seekable_)}]`);const 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_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let s=Yt.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}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=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.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_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Zs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||a_),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Pl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Pl,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}const a=(f,g)=>f?Xs(g,this.usingManagedMediaSource_):Pa(g),u={};let h;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const g=e[f].isFmp4?"browser":"muxer";u[g]=u[g]||[],u[g].push(r[f]),f==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===f&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${h} does not support codec(s): "${r.audio}"`)}if(Object.keys(u).length){const f=Object.keys(u).reduce((g,_)=>(g&&(g+=", "),g+=`${_} does not support codec(s): "${u[_].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(g=>{const _=(yt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,b=(yt(r[g]||"")[0]||{}).type;_&&b&&_.toLowerCase()!==b.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Zs(this.main,r),a=[];n.audio&&!Pa(n.audio)&&!Xs(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Pa(n.video)&&!Xs(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=or(yt(e)),n=Lc(r),a=r.video&&yt(r.video)[0]||null,u=r.audio&&yt(r.audio)[0]||null;Object.keys(s).forEach(h=>{const f=s[h];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const g=[],_=Zs(this.mainPlaylistLoader_.main,f),b=Lc(_);if(!(!_.audio&&!_.video)){if(b!==n&&g.push(`codec count "${b}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const C=_.video&&yt(_.video)[0]||null,A=_.audio&&yt(_.audio)[0]||null;C&&a&&C.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${C.type}" !== "${a.type}"`),A&&u&&A.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${A.type}" !== "${u.type}"`)}g.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),Sb(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ce.GOAL_BUFFER_LENGTH,s=Ce.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ce.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ce.BUFFER_LOW_WATER_LINE,s=Ce.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ce.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ce.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ce.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){qc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),ib({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();qc(this.inbandTextTracks_,e,this.tech_),Z2({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}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(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(ke({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const u of t.playlists){const h=u.attributes.serviceLocation;if(h&&(a.push(h),!n.has(h)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const u=s[a],h=this.pathwayAttribute_(u),f=h&&e!==h;u.excludeUntil===1/0&&u.lastExcludeReason_==="content-steering"&&!f&&(delete u.excludeUntil,delete u.lastExcludeReason_,n=!0);const _=!u.excludeUntil&&u.excludeUntil!==1/0;!r.has(u.id)&&f&&_&&(r.add(u.id),u.excludeUntil=1/0,u.lastExcludeReason_="content-steering",this.logger_(`excluding ${u.id} for ${u.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const u=this.mediaTypes_[a];if(u.activePlaylistLoader){const h=u.activePlaylistLoader.media_;h&&h.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,u]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(u),this.contentSteeringController_.excludePathway(a));for(const[a,u]of r.entries()){const h=s.get(a);if(!h){t.filter(g=>g.attributes["PATHWAY-ID"]===u["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(u,g)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(h,u)||(this.mainPlaylistLoader_.updateOrDeleteClone(u,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const 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;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",u=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=s.lastExcludeReason_===t&&s.excludeUntil===1/0;u?u&&h&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,O.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:Tb(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 Wb=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Su(r),a=Zn(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const u={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(s?(t(r),i.trigger({type:"renditionenabled",metadata:u})):i.trigger({type:"renditiondisabled",metadata:u})),s};class Xb{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Zs(r.main(),t),this.playlist=t,this.id=s,this.enabled=Wb(e.playlists,t.id,n)}}const Kb=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=_r(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Su(s)).map((s,r)=>new Xb(i,s,s.id)):[]}},Jc=["seeking","seeked","pause","playing","error"];class Yb extends O.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_=ut("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,u=["main","subtitle","audio"],h={};u.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const f=g=>{["main","audio"].forEach(_=>{a[`${_}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Jc,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Jc,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=S.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const 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){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=Nv(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:pi(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;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+xt>=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(De([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const A=t.start(0);n=A+(A===t.end(0)?0:xt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${xf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,u=this.tech_.buffered(),h=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,g=this.media(),_=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-bt)*2,b=[h,f];for(let A=0;A<b.length;A++){if(!b[A])continue;if(bu(b[A],s)<_)return!1}const C=Yr(u,s);return C.length===0?!1:(n=C.start(0)+xt,this.logger_(`Buffered region starts (${C.start(0)}) just beyond seek point (${s}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),s=Mi(t,e);if(s.length&&e+3<=s.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${s.start(0)} -> ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const u=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${u}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(u),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Yr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+xt;const a=!s.endList,u=typeof s.partTargetDuration=="number";return a&&(u||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:s}){if(!e)return;let r;if(e.length&&t.length){const n=Mi(e,s-3),a=Mi(e,s),u=Mi(t,s);u.length&&!a.length&&n.length&&(r={start:n.end(0),end:u.end(0)})}else Yr(e,s).length||(r=this.gapFromVideoUnderflow_(e,s));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${s}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),s=this.tech_.currentTime(),r=Yr(t,s);if(this.resetTimeUpdate_(),r.length===0||s!==e)return;this.logger_("skipTheGap_:","currentTime:",s,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+bt);const n={gapInfo:{from:s,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const s=Ov(e);for(let r=0;r<s.length;r++){const n=s.start(r),a=s.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const Qb={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},fp=function(i,e){let t=0,s=0;const r=te(Qb,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(g){g!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(g),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},u=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){O.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},h=function(){i.off("loadedmetadata",n),i.off("error",u),i.off("dispose",h)},f=function(g){h(),fp(i,g)};i.on("error",u),i.on("dispose",h),i.reloadSourceOnError=f},Jb=function(i){fp(this,i)};var pp="3.17.0",Zb="7.1.0",e1="1.3.1",t1="7.2.0",i1="4.0.2";const ge={PlaylistLoader:Bi,Playlist:We,utils:o2,STANDARD_PLAYLIST_SELECTOR:$c,INITIAL_PLAYLIST_SELECTOR:X2,lastBandwidthSelector:$c,movingAverageBandwidthSelector:G2,comparePlaylistBandwidth:Au,comparePlaylistResolution:z2,xhr:qf()};Object.keys(Ce).forEach(i=>{Object.defineProperty(ge,i,{get(){return O.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ce[i]},set(e){if(O.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){O.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ce[i]=e}})});const mp="videojs-vhs",gp=function(i,e){const t=e.media();let s=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){s=r;break}i.selectedIndex_=s,i.trigger({selectedIndex:s,type:"change"})},s1=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),gp(i,e.playlists)};ge.canPlaySource=function(){return O.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const r1=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=or(yt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Xi(s.video),n=Xi(s.audio),a={};for(const u in i)a[u]={},n&&(a[u].audioContentType=n),r&&(a[u].videoContentType=r),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(a[u].pssh=e.contentProtection[u].pssh),typeof i[u]=="string"&&(a[u].url=i[u]);return te(i,a)},n1=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const u=s.contentProtection[a];return u&&u.pssh&&(n[a]={pssh:u.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),a1=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=n1(r,Object.keys(e)),a=[],u=[];return n.forEach(h=>{u.push(new Promise((f,g)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,g)=>{i.eme.initializeMediaKeys({keySystems:h},_=>{if(_){g(_);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(u)])},o1=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=r1(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(O.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},_p=()=>{if(!S.localStorage)return null;const i=S.localStorage.getItem(mp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},u1=i=>{if(!S.localStorage)return!1;let e=_p();e=e?te(e,i):i;try{S.localStorage.setItem(mp,JSON.stringify(e))}catch{return!1}return e},l1=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,yp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},Tp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},vp=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},bp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!q||!q.createElement)return!1;const i=q.createElement("video");return O.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(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!q||!q.createElement||!O.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(q.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return O.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){yp(ge.xhr,i)};ge.xhr.onResponse=function(i){Tp(ge.xhr,i)};ge.xhr.offRequest=function(i){vp(ge.xhr,i)};ge.xhr.offResponse=function(i){bp(ge.xhr,i)};const c1=O.getComponent("Component");class xp extends c1{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ut("VhsHandler"),t.options_&&t.options_.playerId){const r=O.getPlayer(t.options_.playerId);this.player_=r}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 new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(q,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=q.fullscreenElement||q.webkitFullscreenElement||q.mozFullScreenElement||q.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}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_=te(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=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,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){const s=_p();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ce.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ce.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const 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=l1(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=ch(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new Gb(this.options_);const s=te({liveRangeSafeTimeDelta:xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Yb(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=O.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.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(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=S.navigator.connection||S.navigator.mozConnection||S.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&a){const h=a.downlink*1e3*1e3;h>=u&&n>=u?n=Math.max(n,h):n=h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){O.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:()=>pi(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:()=>pi(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&&u1({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Kb(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_=S.URL.createObjectURL(this.playlistController_.mediaSource),(O.browser.IS_ANY_SAFARI||O.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_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),a1({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(t=>{this.logger_("error while creating EME key session",t),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_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=o1({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=O.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{s1(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{gp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":pp,"mux.js":Zb,"mpd-parser":e1,"m3u8-parser":t1,"aes-decrypter":i1}}version(){return this.constructor.version()}canChangeType(){return lp.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_&&S.URL.revokeObjectURL&&(S.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return p2({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return Gf({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{yp(this.xhr,e)},this.xhr.onResponse=e=>{Tp(this.xhr,e)},this.xhr.offRequest=e=>{vp(this.xhr,e)},this.xhr.offResponse=e=>{bp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(ke({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(ke({},r))})})}}const wn={name:"videojs-http-streaming",VERSION:pp,canHandleSource(i,e={}){const t=te(O.options,e);return!t.vhs.experimentalUseMMS&&!Xs("avc1.4d400d,mp4a.40.2",!1)?!1:wn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=te(O.options,t);return e.vhs=new xp(i,e,s),e.vhs.xhr=qf(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=ch(i);if(!t)return"";const s=wn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(O.browser.IS_ANY_SAFARI||O.browser.IS_IOS),{overrideNative:s=t}=e;return s}},h1=()=>Xs("avc1.4d400d,mp4a.40.2",!0);h1()&&O.getTech("Html5").registerSourceHandler(wn,0);O.VhsHandler=xp;O.VhsSourceHandler=wn;O.Vhs=ge;O.use||O.registerComponent("Vhs",ge);O.options.vhs=O.options.vhs||{};(!O.getPlugin||!O.getPlugin("reloadSourceOnError"))&&O.registerPlugin("reloadSourceOnError",Jb);export{O as default};