@clickview/reports 0.69.0-rc.0 → 0.69.1-dev.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.
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/bundles.json +2 -3
- package/dist/css/1VpVng8x.chunk.css +1 -0
- package/dist/css/BBwBgFf_.chunk.css +1 -0
- package/dist/css/BDijM1kt.chunk.css +1 -0
- package/dist/css/BMPwvOki.chunk.css +1 -0
- package/dist/css/BNt45Kgy.chunk.css +1 -0
- package/dist/css/BSGhUWzl.chunk.css +1 -0
- package/dist/css/BZ3_uhDP.chunk.css +1 -0
- package/dist/css/BaadNO4A.chunk.css +1 -0
- package/dist/css/BdUNjJqp.chunk.css +1 -0
- package/dist/css/BdeI0FAV.chunk.css +1 -0
- package/dist/css/BxcMGr8Y.chunk.css +1 -0
- package/dist/css/ByuL_xKJ.chunk.css +1 -0
- package/dist/css/C-A0Pj_7.chunk.css +1 -0
- package/dist/css/C4jMfPWU.chunk.css +1 -0
- package/dist/css/C7XoyEPr.chunk.css +1 -0
- package/dist/css/C8sxda3R.chunk.css +1 -0
- package/dist/css/CD1qrI1T.chunk.css +1 -0
- package/dist/css/CFO--d_R.chunk.css +1 -0
- package/dist/css/CX9nw8t8.chunk.css +1 -0
- package/dist/css/C_qGRdC2.chunk.css +1 -0
- package/dist/css/CdC6ugQR.chunk.css +1 -0
- package/dist/css/ClRRGXPb.chunk.css +1 -0
- package/dist/css/Cr1bwtZG.chunk.css +1 -0
- package/dist/css/DBlPz5Fw.chunk.css +1 -0
- package/dist/css/DDnpOnVB.chunk.css +1 -0
- package/dist/css/DFZQCLLg.chunk.css +1 -0
- package/dist/css/DJwAbl6l.chunk.css +1 -0
- package/dist/css/DWjg_0sz.chunk.css +1 -0
- package/dist/css/DYV9jjVn.chunk.css +1 -0
- package/dist/css/Dgeh4AqU.chunk.css +9 -0
- package/dist/css/DlOtoSz0.chunk.css +1 -0
- package/dist/css/DlxOgKUu.chunk.css +1 -0
- package/dist/css/DwgaDUzz.chunk.css +1 -0
- package/dist/css/FPQ_LmXH.chunk.css +1 -0
- package/dist/css/H09rC9gw.chunk.css +1 -0
- package/dist/css/LAFr2dPT.chunk.css +1 -0
- package/dist/css/Pg1TlYG6.chunk.css +1 -0
- package/dist/css/PsQn3-kb.chunk.css +1 -0
- package/dist/css/alkEuPrr.chunk.css +1 -0
- package/dist/css/k4DgCj_g.chunk.css +1 -0
- package/dist/en.json +1 -0
- package/dist/scripts/-b_h0A4y.chunk.js +2 -0
- package/dist/scripts/-b_h0A4y.chunk.js.map +1 -0
- package/dist/scripts/0UfVJrf5.chunk.js +2 -0
- package/dist/scripts/0UfVJrf5.chunk.js.map +1 -0
- package/dist/scripts/2cd-ulth.chunk.js +2 -0
- package/dist/scripts/2cd-ulth.chunk.js.map +1 -0
- package/dist/scripts/5O9SdVRZ.chunk.js +2 -0
- package/dist/scripts/5O9SdVRZ.chunk.js.map +1 -0
- package/dist/scripts/72EXv822.chunk.js +2 -0
- package/dist/scripts/72EXv822.chunk.js.map +1 -0
- package/dist/scripts/8CNwntVY.chunk.js +2 -0
- package/dist/scripts/8CNwntVY.chunk.js.map +1 -0
- package/dist/scripts/9pagDMWN.chunk.js +2 -0
- package/dist/scripts/9pagDMWN.chunk.js.map +1 -0
- package/dist/scripts/AKgZQGT0.chunk.js +2 -0
- package/dist/scripts/AKgZQGT0.chunk.js.map +1 -0
- package/dist/scripts/ASoPpgM4.chunk.js +2 -0
- package/dist/scripts/ASoPpgM4.chunk.js.map +1 -0
- package/dist/scripts/B0ZIDriY.chunk.js +6 -0
- package/dist/scripts/B0ZIDriY.chunk.js.map +1 -0
- package/dist/scripts/B3PA8QNB.chunk.js +2 -0
- package/dist/scripts/B3PA8QNB.chunk.js.map +1 -0
- package/dist/scripts/B6QS1MPy.chunk.js +4 -0
- package/dist/scripts/B6QS1MPy.chunk.js.map +1 -0
- package/dist/scripts/B9I2jvNY.chunk.js +2 -0
- package/dist/scripts/B9I2jvNY.chunk.js.map +1 -0
- package/dist/scripts/B9IzwFHp.chunk.js +2 -0
- package/dist/scripts/B9IzwFHp.chunk.js.map +1 -0
- package/dist/scripts/BBGDjrt-.chunk.js +2 -0
- package/dist/scripts/BBGDjrt-.chunk.js.map +1 -0
- package/dist/scripts/BHZ8VWq7.chunk.js +2 -0
- package/dist/scripts/BHZ8VWq7.chunk.js.map +1 -0
- package/dist/scripts/BIIsc-MA.chunk.js +2 -0
- package/dist/scripts/BIIsc-MA.chunk.js.map +1 -0
- package/dist/scripts/BLEXuU9u.chunk.js +2 -0
- package/dist/scripts/BLEXuU9u.chunk.js.map +1 -0
- package/dist/scripts/BLIHpHXi.chunk.js +2 -0
- package/dist/scripts/BLIHpHXi.chunk.js.map +1 -0
- package/dist/scripts/BLSeaGtL.chunk.js +2 -0
- package/dist/scripts/BLSeaGtL.chunk.js.map +1 -0
- package/dist/scripts/BLuY6AYO.chunk.js +2 -0
- package/dist/scripts/BLuY6AYO.chunk.js.map +1 -0
- package/dist/scripts/BSe8MmUc.chunk.js +2 -0
- package/dist/scripts/BSe8MmUc.chunk.js.map +1 -0
- package/dist/scripts/BZf-mjTJ.chunk.js +380 -0
- package/dist/scripts/BZf-mjTJ.chunk.js.map +1 -0
- package/dist/scripts/BbvzsNLZ.chunk.js +2 -0
- package/dist/scripts/BbvzsNLZ.chunk.js.map +1 -0
- package/dist/scripts/BdX0pSRt.chunk.js +2 -0
- package/dist/scripts/BdX0pSRt.chunk.js.map +1 -0
- package/dist/scripts/Bgidb-to.chunk.js +2 -0
- package/dist/scripts/Bgidb-to.chunk.js.map +1 -0
- package/dist/scripts/BhPjzT2a.chunk.js +2 -0
- package/dist/scripts/BhPjzT2a.chunk.js.map +1 -0
- package/dist/scripts/BihcsiRl.chunk.js +2 -0
- package/dist/scripts/BihcsiRl.chunk.js.map +1 -0
- package/dist/scripts/BlUKEHqx.chunk.js +2 -0
- package/dist/scripts/BlUKEHqx.chunk.js.map +1 -0
- package/dist/scripts/BpWIcknK.chunk.js +2 -0
- package/dist/scripts/BpWIcknK.chunk.js.map +1 -0
- package/dist/scripts/BqY3bZyH.chunk.js +2 -0
- package/dist/scripts/BqY3bZyH.chunk.js.map +1 -0
- package/dist/scripts/BrXmRwXi.chunk.js +2 -0
- package/dist/scripts/BrXmRwXi.chunk.js.map +1 -0
- package/dist/scripts/BsOLqypJ.chunk.js +2 -0
- package/dist/scripts/BsOLqypJ.chunk.js.map +1 -0
- package/dist/scripts/BvArNs1K.chunk.js +2 -0
- package/dist/scripts/BvArNs1K.chunk.js.map +1 -0
- package/dist/scripts/BxBPX67V.chunk.js +2 -0
- package/dist/scripts/BxBPX67V.chunk.js.map +1 -0
- package/dist/scripts/C0Ak1kpS.chunk.js +3 -0
- package/dist/scripts/C0Ak1kpS.chunk.js.map +1 -0
- package/dist/scripts/C0GFlX65.chunk.js +2 -0
- package/dist/scripts/C0GFlX65.chunk.js.map +1 -0
- package/dist/scripts/C0nQ0Xnx.chunk.js +6 -0
- package/dist/scripts/C0nQ0Xnx.chunk.js.map +1 -0
- package/dist/scripts/C6UUJ8P5.chunk.js +2 -0
- package/dist/scripts/C6UUJ8P5.chunk.js.map +1 -0
- package/dist/scripts/C8oA7_zY.chunk.js +2 -0
- package/dist/scripts/C8oA7_zY.chunk.js.map +1 -0
- package/dist/scripts/CEy1YX0b.chunk.js +2 -0
- package/dist/scripts/CEy1YX0b.chunk.js.map +1 -0
- package/dist/scripts/CNfESBlK.chunk.js +2 -0
- package/dist/scripts/CNfESBlK.chunk.js.map +1 -0
- package/dist/scripts/CNgTzzan.chunk.js +42 -0
- package/dist/scripts/CNgTzzan.chunk.js.map +1 -0
- package/dist/scripts/CP2i5uhZ.chunk.js +2 -0
- package/dist/scripts/CP2i5uhZ.chunk.js.map +1 -0
- package/dist/scripts/CSmXZuTZ.chunk.js +2 -0
- package/dist/scripts/CSmXZuTZ.chunk.js.map +1 -0
- package/dist/scripts/CTMVj7AR.chunk.js +2 -0
- package/dist/scripts/CTMVj7AR.chunk.js.map +1 -0
- package/dist/scripts/CW7x8M-z.chunk.js +2 -0
- package/dist/scripts/CW7x8M-z.chunk.js.map +1 -0
- package/dist/scripts/CWEUVMEm.chunk.js +2 -0
- package/dist/scripts/CWEUVMEm.chunk.js.map +1 -0
- package/dist/scripts/CWViZWyh.chunk.js +34 -0
- package/dist/scripts/CWViZWyh.chunk.js.map +1 -0
- package/dist/scripts/CX5q-0jT.chunk.js +2 -0
- package/dist/scripts/CX5q-0jT.chunk.js.map +1 -0
- package/dist/scripts/CbBaa9Aj.chunk.js +2 -0
- package/dist/scripts/CbBaa9Aj.chunk.js.map +1 -0
- package/dist/scripts/Ce_zROQ3.chunk.js +2 -0
- package/dist/scripts/Ce_zROQ3.chunk.js.map +1 -0
- package/dist/scripts/CfTCpF5i.chunk.js +4 -0
- package/dist/scripts/CfTCpF5i.chunk.js.map +1 -0
- package/dist/scripts/Cl1c9Acb.chunk.js +2 -0
- package/dist/scripts/Cl1c9Acb.chunk.js.map +1 -0
- package/dist/scripts/Cmu1J2M7.chunk.js +262 -0
- package/dist/scripts/Cmu1J2M7.chunk.js.map +1 -0
- package/dist/scripts/Cn0ghy_D.chunk.js +2 -0
- package/dist/scripts/Cn0ghy_D.chunk.js.map +1 -0
- package/dist/scripts/Cs1UnwSi.chunk.js +2 -0
- package/dist/scripts/Cs1UnwSi.chunk.js.map +1 -0
- package/dist/scripts/CsP3Lruv.chunk.js +3 -0
- package/dist/scripts/CsP3Lruv.chunk.js.map +1 -0
- package/dist/scripts/CsROrwVV.chunk.js +2 -0
- package/dist/scripts/CsROrwVV.chunk.js.map +1 -0
- package/dist/scripts/Ctu1A4hw.chunk.js +2 -0
- package/dist/scripts/Ctu1A4hw.chunk.js.map +1 -0
- package/dist/scripts/D1UdZdfs.chunk.js +2 -0
- package/dist/scripts/D1UdZdfs.chunk.js.map +1 -0
- package/dist/scripts/D2pFW6EB.chunk.js +2 -0
- package/dist/scripts/D2pFW6EB.chunk.js.map +1 -0
- package/dist/scripts/D9oCeDYw.chunk.js +10 -0
- package/dist/scripts/D9oCeDYw.chunk.js.map +1 -0
- package/dist/scripts/DAajosqn.chunk.js +2 -0
- package/dist/scripts/DAajosqn.chunk.js.map +1 -0
- package/dist/scripts/DDGxV4ns.chunk.js +2 -0
- package/dist/scripts/DDGxV4ns.chunk.js.map +1 -0
- package/dist/scripts/DFlfmBPU.chunk.js +2 -0
- package/dist/scripts/DFlfmBPU.chunk.js.map +1 -0
- package/dist/scripts/DHZefNDC.chunk.js +2 -0
- package/dist/scripts/DHZefNDC.chunk.js.map +1 -0
- package/dist/scripts/DJzpw8qX.chunk.js +2 -0
- package/dist/scripts/DJzpw8qX.chunk.js.map +1 -0
- package/dist/scripts/DKEdZyAE.chunk.js +2 -0
- package/dist/scripts/DKEdZyAE.chunk.js.map +1 -0
- package/dist/scripts/DKu8iTnz.chunk.js +2 -0
- package/dist/scripts/DKu8iTnz.chunk.js.map +1 -0
- package/dist/scripts/DMd0fZar.chunk.js +2 -0
- package/dist/scripts/DMd0fZar.chunk.js.map +1 -0
- package/dist/scripts/DNDksLLJ.chunk.js +2 -0
- package/dist/scripts/DNDksLLJ.chunk.js.map +1 -0
- package/dist/scripts/DNP9cLqQ.chunk.js +2 -0
- package/dist/scripts/DNP9cLqQ.chunk.js.map +1 -0
- package/dist/scripts/DO-V6YKu.chunk.js +2 -0
- package/dist/scripts/DO-V6YKu.chunk.js.map +1 -0
- package/dist/scripts/DQA8MZy3.chunk.js +2 -0
- package/dist/scripts/DQA8MZy3.chunk.js.map +1 -0
- package/dist/scripts/DT1lPNaD.chunk.js +2 -0
- package/dist/scripts/DT1lPNaD.chunk.js.map +1 -0
- package/dist/scripts/DTL-Rceb.chunk.js +2 -0
- package/dist/scripts/DTL-Rceb.chunk.js.map +1 -0
- package/dist/scripts/DTotSVIi.chunk.js +2 -0
- package/dist/scripts/DTotSVIi.chunk.js.map +1 -0
- package/dist/scripts/DWkaXclo.chunk.js +10 -0
- package/dist/scripts/DWkaXclo.chunk.js.map +1 -0
- package/dist/scripts/DXFcNENa.chunk.js +2 -0
- package/dist/scripts/DXFcNENa.chunk.js.map +1 -0
- package/dist/scripts/Ddy6mQmA.chunk.js +2 -0
- package/dist/scripts/Ddy6mQmA.chunk.js.map +1 -0
- package/dist/scripts/DlxDC-9E.chunk.js +2 -0
- package/dist/scripts/DlxDC-9E.chunk.js.map +1 -0
- package/dist/scripts/Dn5-Zvws.chunk.js +2 -0
- package/dist/scripts/Dn5-Zvws.chunk.js.map +1 -0
- package/dist/scripts/DnhffgUu.chunk.js +2 -0
- package/dist/scripts/DnhffgUu.chunk.js.map +1 -0
- package/dist/scripts/Dv9OgzKw.chunk.js +2 -0
- package/dist/scripts/Dv9OgzKw.chunk.js.map +1 -0
- package/dist/scripts/DvV9e2O3.chunk.js +3 -0
- package/dist/scripts/DvV9e2O3.chunk.js.map +1 -0
- package/dist/scripts/Dvf_hOR3.chunk.js +2 -0
- package/dist/scripts/Dvf_hOR3.chunk.js.map +1 -0
- package/dist/scripts/DxOc33K6.chunk.js +3 -0
- package/dist/scripts/DxOc33K6.chunk.js.map +1 -0
- package/dist/scripts/DxbQzyJg.chunk.js +2 -0
- package/dist/scripts/DxbQzyJg.chunk.js.map +1 -0
- package/dist/scripts/DyaAoFDP.chunk.js +2 -0
- package/dist/scripts/DyaAoFDP.chunk.js.map +1 -0
- package/dist/scripts/EBNeK_uD.chunk.js +2 -0
- package/dist/scripts/EBNeK_uD.chunk.js.map +1 -0
- package/dist/scripts/HBvGjr-A.chunk.js +2 -0
- package/dist/scripts/HBvGjr-A.chunk.js.map +1 -0
- package/dist/scripts/IC6KSiqE.chunk.js +2 -0
- package/dist/scripts/IC6KSiqE.chunk.js.map +1 -0
- package/dist/scripts/LT6WE6TB.chunk.js +2 -0
- package/dist/scripts/LT6WE6TB.chunk.js.map +1 -0
- package/dist/scripts/P0RdEZGz.chunk.js +2 -0
- package/dist/scripts/P0RdEZGz.chunk.js.map +1 -0
- package/dist/scripts/P3PkkK_o.chunk.js +2 -0
- package/dist/scripts/P3PkkK_o.chunk.js.map +1 -0
- package/dist/scripts/SA1hxE7y.chunk.js +15 -0
- package/dist/scripts/SA1hxE7y.chunk.js.map +1 -0
- package/dist/scripts/YHL8PX91.chunk.js +2 -0
- package/dist/scripts/YHL8PX91.chunk.js.map +1 -0
- package/dist/scripts/app-5iiM5qQY.js +224 -0
- package/dist/scripts/app-5iiM5qQY.js.map +1 -0
- package/dist/scripts/fORcC1yd.chunk.js +2 -0
- package/dist/scripts/fORcC1yd.chunk.js.map +1 -0
- package/dist/scripts/hU1zzvt8.chunk.js +2 -0
- package/dist/scripts/hU1zzvt8.chunk.js.map +1 -0
- package/dist/scripts/kFXLewpU.chunk.js +2 -0
- package/dist/scripts/kFXLewpU.chunk.js.map +1 -0
- package/dist/scripts/k_p1R4KR.chunk.js +2 -0
- package/dist/scripts/k_p1R4KR.chunk.js.map +1 -0
- package/dist/scripts/mqFCEyYv.chunk.js +2 -0
- package/dist/scripts/mqFCEyYv.chunk.js.map +1 -0
- package/dist/scripts/qwzILhQ0.chunk.js +8 -0
- package/dist/scripts/qwzILhQ0.chunk.js.map +1 -0
- package/dist/scripts/sFV5nxD4.chunk.js +2 -0
- package/dist/scripts/sFV5nxD4.chunk.js.map +1 -0
- package/dist/scripts/uBcZoYae.chunk.js +2 -0
- package/dist/scripts/uBcZoYae.chunk.js.map +1 -0
- package/dist/scripts/yaRKidLW.chunk.js +2 -0
- package/dist/scripts/yaRKidLW.chunk.js.map +1 -0
- package/dist/scripts/ysP6mL-L.chunk.js +2 -0
- package/dist/scripts/ysP6mL-L.chunk.js.map +1 -0
- package/package.json +5 -3
- package/typings/utils/imports.d.ts +1 -1
- package/vite.config.ts +6 -0
- package/dist/css/1103-reports-d3d5cc00db.chunk.css +0 -31
- package/dist/css/1456-reports-4a5871a275.chunk.css +0 -9
- package/dist/css/1648-reports-012456ba48.chunk.css +0 -2
- package/dist/css/209-reports-cdae99d0ee.chunk.css +0 -11
- package/dist/css/2150-reports-84ec0e9770.chunk.css +0 -4
- package/dist/css/2217-reports-74dec0a3fe.chunk.css +0 -32
- package/dist/css/2997-reports-e08318f14b.chunk.css +0 -9
- package/dist/css/4582-reports-d3d5cc00db.chunk.css +0 -31
- package/dist/css/5304-reports-22c2d8d635.chunk.css +0 -9
- package/dist/css/6007-reports-5ba77c55a3.chunk.css +0 -8
- package/dist/css/6031-reports-d558076846.chunk.css +0 -6
- package/dist/css/6356-reports-8c5b220bf6.chunk.css +0 -1
- package/dist/css/6546-reports-f190450b10.chunk.css +0 -60
- package/dist/css/6811-reports-baf2e97e71.chunk.css +0 -35
- package/dist/css/7723-reports-8c6d3c414b.chunk.css +0 -4
- package/dist/css/7747-reports-2d9e191b5a.chunk.css +0 -12
- package/dist/css/8087-reports-cfe23ba648.chunk.css +0 -10
- package/dist/css/8294-reports-c797263ac2.chunk.css +0 -1
- package/dist/css/8418-reports-0ada3f3ce2.chunk.css +0 -29
- package/dist/css/8450-reports-06493dfde5.chunk.css +0 -9
- package/dist/css/8622-reports-9e8970cc7f.chunk.css +0 -8
- package/dist/css/8839-reports-8e46644943.chunk.css +0 -1
- package/dist/css/8989-reports-92b4f1dde8.chunk.css +0 -8
- package/dist/css/9059-reports-a2ac630ebc.chunk.css +0 -35
- package/dist/css/9285-reports-5b9af8380f.chunk.css +0 -13
- package/dist/css/9661-reports-7435e94a85.chunk.css +0 -4
- package/dist/css/9822-reports-a1db1900c7.chunk.css +0 -8
- package/dist/css/9949-reports-f22fa2b407.chunk.css +0 -15
- package/dist/css/reports-app-b4c4ec5632.css +0 -32
- package/dist/languages/en.json +0 -1
- package/dist/scripts/1103-d77d388f5b-reports.chunk.js +0 -1
- package/dist/scripts/1177-7cf7817e74-reports.chunk.js +0 -1
- package/dist/scripts/1456-019d93e620-reports.chunk.js +0 -1
- package/dist/scripts/1648-e892604f5a-reports.chunk.js +0 -1
- package/dist/scripts/1934-ca8497c768-reports.chunk.js +0 -2
- package/dist/scripts/1934-ca8497c768-reports.chunk.js.LICENSE.txt +0 -9
- package/dist/scripts/2087-e0ef668e1f-reports.chunk.js +0 -1
- package/dist/scripts/209-d769572af9-reports.chunk.js +0 -1
- package/dist/scripts/2150-2cbadacf12-reports.chunk.js +0 -1
- package/dist/scripts/2217-eb2f8619c9-reports.chunk.js +0 -1
- package/dist/scripts/2476-a700f69dc4-reports.chunk.js +0 -1
- package/dist/scripts/2539-04dfb4f4f1-reports.chunk.js +0 -1
- package/dist/scripts/2997-62d81c3442-reports.chunk.js +0 -1
- package/dist/scripts/312-8b006e92ff-reports.chunk.js +0 -1
- package/dist/scripts/4234-e3c04f41eb-reports.chunk.js +0 -1
- package/dist/scripts/4372-26474a3318-reports.chunk.js +0 -1
- package/dist/scripts/438-b444dfb8c6-reports.chunk.js +0 -1
- package/dist/scripts/4582-230f130f41-reports.chunk.js +0 -1
- package/dist/scripts/4752-db4247883d-reports.chunk.js +0 -2
- package/dist/scripts/4752-db4247883d-reports.chunk.js.LICENSE.txt +0 -118
- package/dist/scripts/4979-7e14b09f33-reports.chunk.js +0 -1
- package/dist/scripts/5051-72c53737e2-reports.chunk.js +0 -1
- package/dist/scripts/5091-ddd6f61b55-reports.chunk.js +0 -1
- package/dist/scripts/5173-cce3b37672-reports.chunk.js +0 -1
- package/dist/scripts/5177-a7372e7b8d-reports.chunk.js +0 -1
- package/dist/scripts/5304-d5674b32b4-reports.chunk.js +0 -1
- package/dist/scripts/5802-2125536755-reports.chunk.js +0 -1
- package/dist/scripts/6007-346d08e3ae-reports.chunk.js +0 -1
- package/dist/scripts/6031-b1c60cc409-reports.chunk.js +0 -1
- package/dist/scripts/6081-2bbda6cac3-reports.chunk.js +0 -1
- package/dist/scripts/6180-bdb237ffbe-reports.chunk.js +0 -2
- package/dist/scripts/6180-bdb237ffbe-reports.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/6198-189ddde870-reports.chunk.js +0 -1
- package/dist/scripts/6356-a1b313c73e-reports.chunk.js +0 -1
- package/dist/scripts/645-e72b3d845e-reports.chunk.js +0 -1
- package/dist/scripts/6545-f07bcd318a-reports.chunk.js +0 -1
- package/dist/scripts/6546-72384574e1-reports.chunk.js +0 -2
- package/dist/scripts/6546-72384574e1-reports.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/6811-add7c7c1a2-reports.chunk.js +0 -1
- package/dist/scripts/7238-de5ef0ebfb-reports.chunk.js +0 -1
- package/dist/scripts/7562-748e60c3fc-reports.chunk.js +0 -1
- package/dist/scripts/7709-82750ee317-reports.chunk.js +0 -1
- package/dist/scripts/7723-1799f5aa26-reports.chunk.js +0 -1
- package/dist/scripts/7747-a4fcf6b02f-reports.chunk.js +0 -2
- package/dist/scripts/7747-a4fcf6b02f-reports.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/7925-c6c532c9c4-reports.chunk.js +0 -1
- package/dist/scripts/8087-1d9e9701e5-reports.chunk.js +0 -1
- package/dist/scripts/8393-686a7866e1-reports.chunk.js +0 -1
- package/dist/scripts/8418-9f96caf039-reports.chunk.js +0 -1
- package/dist/scripts/8450-f2d5d99614-reports.chunk.js +0 -1
- package/dist/scripts/8591-4811082ab0-reports.chunk.js +0 -1
- package/dist/scripts/8622-ca384ec4b0-reports.chunk.js +0 -1
- package/dist/scripts/8839-711793a97f-reports.chunk.js +0 -1
- package/dist/scripts/8989-ca5cab7f45-reports.chunk.js +0 -1
- package/dist/scripts/9059-b2dcf3cdb2-reports.chunk.js +0 -1
- package/dist/scripts/9162-7ffc692736-reports.chunk.js +0 -1
- package/dist/scripts/9285-ecddd01efb-reports.chunk.js +0 -1
- package/dist/scripts/9590-41bb23ae71-reports.chunk.js +0 -1
- package/dist/scripts/9647-f0c111d3f0-reports.chunk.js +0 -1
- package/dist/scripts/9661-2dee4c3417-reports.chunk.js +0 -1
- package/dist/scripts/9822-379ea90dd3-reports.chunk.js +0 -1
- package/dist/scripts/9895-3b3feb12b9-reports.chunk.js +0 -1
- package/dist/scripts/9949-6b1d1f4d32-reports.chunk.js +0 -1
- package/dist/scripts/bundle-17c29f9bf9.min.js +0 -2
- package/dist/scripts/bundle-17c29f9bf9.min.js.LICENSE.txt +0 -108
- package/dist/scripts/polyfills-3db3f009d4.min.js +0 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import{cc as hm,aD as Ln,j as we,T as Jg,p as Ht,aT as Zg,aU as ev,L as Ks,aw as KC,cd as XC,ce as jt,x as YC,bF as $d,_ as Xo,a0 as er,av as Gr,cf as tv,cg as QC,ch as iv,ci as JC,at as Wr,cj as Be,ck as rt,cl as ol,au as Ju,cm as rv,cn as ZC,co as eE,cp as tE,az as iE,r as dh,cq as rE,v as nE,a5 as J0,a2 as Qc,h as Ho,a3 as sE,Z as Ea,cr as aE,F as oE,Y as lE,aX as uE,aa as Z0,cs as kc,s as nv,ak as Os,D as Ac,a7 as eT,ct as cE,S as hE,bx as dE,I as fE,cu as pE,cv as mE}from"./app-5iiM5qQY.js";import{T as gE}from"./qwzILhQ0.chunk.js";import{a as np}from"./CsP3Lruv.chunk.js";import{P as vE,a as yE}from"./P3PkkK_o.chunk.js";import{r as tT}from"./CW7x8M-z.chunk.js";import{c as dm,i as _E,t as sv,d as av,m as TE}from"./hU1zzvt8.chunk.js";import"./Cl1c9Acb.chunk.js";import{C as bE}from"./B9IzwFHp.chunk.js";import{C as SE}from"./CsROrwVV.chunk.js";import{u as iT}from"./CbBaa9Aj.chunk.js";import{D as CE}from"./Cs1UnwSi.chunk.js";import{u as EE}from"./BLuY6AYO.chunk.js";import{b as fm}from"./DvV9e2O3.chunk.js";import{I as wE,b as kE}from"./CNgTzzan.chunk.js";function AE(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&hm(s,e)}function sp(s){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sp(s)}function rT(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rT=function(){return!!s})()}var Jc={exports:{}};/**
|
|
2
|
+
* chroma.js - JavaScript library for color conversions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2011-2019, Gregor Aisch
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
11
|
+
* list of conditions and the following disclaimer.
|
|
12
|
+
*
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* 3. The name Gregor Aisch may not be used to endorse or promote products
|
|
18
|
+
* derived from this software without specific prior written permission.
|
|
19
|
+
*
|
|
20
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
* DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
24
|
+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
25
|
+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
27
|
+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
28
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
29
|
+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
*
|
|
31
|
+
* -------------------------------------------------------
|
|
32
|
+
*
|
|
33
|
+
* chroma.js includes colors from colorbrewer2.org, which are released under
|
|
34
|
+
* the following license:
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
|
|
37
|
+
* and The Pennsylvania State University.
|
|
38
|
+
*
|
|
39
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
40
|
+
* you may not use this file except in compliance with the License.
|
|
41
|
+
* You may obtain a copy of the License at
|
|
42
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
43
|
+
*
|
|
44
|
+
* Unless required by applicable law or agreed to in writing,
|
|
45
|
+
* software distributed under the License is distributed on an
|
|
46
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
47
|
+
* either express or implied. See the License for the specific
|
|
48
|
+
* language governing permissions and limitations under the License.
|
|
49
|
+
*
|
|
50
|
+
* ------------------------------------------------------
|
|
51
|
+
*
|
|
52
|
+
* Named colors are taken from X11 Color Names.
|
|
53
|
+
* http://www.w3.org/TR/css3-color/#svg-color
|
|
54
|
+
*
|
|
55
|
+
* @preserve
|
|
56
|
+
*/var xE=Jc.exports,ov;function NE(){return ov||(ov=1,(function(s,e){(function(t,r){s.exports=r()})(xE,(function(){for(var t=function(w,I,U){return I===void 0&&(I=0),U===void 0&&(U=1),w<I?I:w>U?U:w},r=function(w){w._clipped=!1,w._unclipped=w.slice(0);for(var I=0;I<=3;I++)I<3?((w[I]<0||w[I]>255)&&(w._clipped=!0),w[I]=t(w[I],0,255)):I===3&&(w[I]=t(w[I],0,1));return w},i={},n=0,a=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n<a.length;n+=1){var o=a[n];i["[object "+o+"]"]=o.toLowerCase()}var l=function(w){return i[Object.prototype.toString.call(w)]||"object"},u=function(w,I){return I===void 0&&(I=null),w.length>=3?Array.prototype.slice.call(w):l(w[0])=="object"&&I?I.split("").filter(function(U){return w[0][U]!==void 0}).map(function(U){return w[0][U]}):w[0]},c=function(w){if(w.length<2)return null;var I=w.length-1;return l(w[I])=="string"?w[I].toLowerCase():null},d=Math.PI,f={clip_rgb:r,limit:t,type:l,unpack:u,last:c,TWOPI:d*2,PITHIRD:d/3,DEG2RAD:d/180,RAD2DEG:180/d},g={format:{},autodetect:[]},E=f.last,S=f.clip_rgb,k=f.type,F=function(){for(var I=[],U=arguments.length;U--;)I[U]=arguments[U];var J=this;if(k(I[0])==="object"&&I[0].constructor&&I[0].constructor===this.constructor)return I[0];var ue=E(I),oe=!1;if(!ue){oe=!0,g.sorted||(g.autodetect=g.autodetect.sort(function(Le,Pe){return Pe.p-Le.p}),g.sorted=!0);for(var ae=0,fe=g.autodetect;ae<fe.length;ae+=1){var pe=fe[ae];if(ue=pe.test.apply(pe,I),ue)break}}if(g.format[ue]){var Ne=g.format[ue].apply(null,oe?I:I.slice(0,-1));J._rgb=S(Ne)}else throw new Error("unknown format: "+I);J._rgb.length===3&&J._rgb.push(1)};F.prototype.toString=function(){return k(this.hex)=="function"?this.hex():"["+this._rgb.join(",")+"]"};var L=F,W=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(W.Color,[null].concat(w)))};W.Color=L,W.version="2.1.2";var H=W,$=f.unpack,G=Math.max,K=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=$(w,"rgb"),J=U[0],ue=U[1],oe=U[2];J=J/255,ue=ue/255,oe=oe/255;var ae=1-G(J,G(ue,oe)),fe=ae<1?1/(1-ae):0,pe=(1-J-ae)*fe,Ne=(1-ue-ae)*fe,Le=(1-oe-ae)*fe;return[pe,Ne,Le,ae]},Y=K,P=f.unpack,O=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=P(w,"cmyk");var U=w[0],J=w[1],ue=w[2],oe=w[3],ae=w.length>4?w[4]:1;return oe===1?[0,0,0,ae]:[U>=1?0:255*(1-U)*(1-oe),J>=1?0:255*(1-J)*(1-oe),ue>=1?0:255*(1-ue)*(1-oe),ae]},ne=O,te=f.unpack,re=f.type;L.prototype.cmyk=function(){return Y(this._rgb)},H.cmyk=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["cmyk"])))},g.format.cmyk=ne,g.autodetect.push({p:2,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=te(w,"cmyk"),re(w)==="array"&&w.length===4)return"cmyk"}});var me=f.unpack,Se=f.last,Ae=function(w){return Math.round(w*100)/100},ve=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=me(w,"hsla"),J=Se(w)||"lsa";return U[0]=Ae(U[0]||0),U[1]=Ae(U[1]*100)+"%",U[2]=Ae(U[2]*100)+"%",J==="hsla"||U.length>3&&U[3]<1?(U[3]=U.length>3?U[3]:1,J="hsla"):U.length=3,J+"("+U.join(",")+")"},Te=ve,ye=f.unpack,_e=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=ye(w,"rgba");var U=w[0],J=w[1],ue=w[2];U/=255,J/=255,ue/=255;var oe=Math.min(U,J,ue),ae=Math.max(U,J,ue),fe=(ae+oe)/2,pe,Ne;return ae===oe?(pe=0,Ne=Number.NaN):pe=fe<.5?(ae-oe)/(ae+oe):(ae-oe)/(2-ae-oe),U==ae?Ne=(J-ue)/(ae-oe):J==ae?Ne=2+(ue-U)/(ae-oe):ue==ae&&(Ne=4+(U-J)/(ae-oe)),Ne*=60,Ne<0&&(Ne+=360),w.length>3&&w[3]!==void 0?[Ne,pe,fe,w[3]]:[Ne,pe,fe]},xe=_e,qe=f.unpack,We=f.last,Ke=Math.round,ze=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=qe(w,"rgba"),J=We(w)||"rgb";return J.substr(0,3)=="hsl"?Te(xe(U),J):(U[0]=Ke(U[0]),U[1]=Ke(U[1]),U[2]=Ke(U[2]),(J==="rgba"||U.length>3&&U[3]<1)&&(U[3]=U.length>3?U[3]:1,J="rgba"),J+"("+U.slice(0,J==="rgb"?3:4).join(",")+")")},xt=ze,Qt=f.unpack,wt=Math.round,Jt=function(){for(var w,I=[],U=arguments.length;U--;)I[U]=arguments[U];I=Qt(I,"hsl");var J=I[0],ue=I[1],oe=I[2],ae,fe,pe;if(ue===0)ae=fe=pe=oe*255;else{var Ne=[0,0,0],Le=[0,0,0],Pe=oe<.5?oe*(1+ue):oe+ue-oe*ue,He=2*oe-Pe,je=J/360;Ne[0]=je+1/3,Ne[1]=je,Ne[2]=je-1/3;for(var tt=0;tt<3;tt++)Ne[tt]<0&&(Ne[tt]+=1),Ne[tt]>1&&(Ne[tt]-=1),6*Ne[tt]<1?Le[tt]=He+(Pe-He)*6*Ne[tt]:2*Ne[tt]<1?Le[tt]=Pe:3*Ne[tt]<2?Le[tt]=He+(Pe-He)*(2/3-Ne[tt])*6:Le[tt]=He;w=[wt(Le[0]*255),wt(Le[1]*255),wt(Le[2]*255)],ae=w[0],fe=w[1],pe=w[2]}return I.length>3?[ae,fe,pe,I[3]]:[ae,fe,pe,1]},Ii=Jt,oi=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,yi=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,Pr=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,li=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Lr=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Ut=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Pi=Math.round,_i=function(w){w=w.toLowerCase().trim();var I;if(g.format.named)try{return g.format.named(w)}catch{}if(I=w.match(oi)){for(var U=I.slice(1,4),J=0;J<3;J++)U[J]=+U[J];return U[3]=1,U}if(I=w.match(yi)){for(var ue=I.slice(1,5),oe=0;oe<4;oe++)ue[oe]=+ue[oe];return ue}if(I=w.match(Pr)){for(var ae=I.slice(1,4),fe=0;fe<3;fe++)ae[fe]=Pi(ae[fe]*2.55);return ae[3]=1,ae}if(I=w.match(li)){for(var pe=I.slice(1,5),Ne=0;Ne<3;Ne++)pe[Ne]=Pi(pe[Ne]*2.55);return pe[3]=+pe[3],pe}if(I=w.match(Lr)){var Le=I.slice(1,4);Le[1]*=.01,Le[2]*=.01;var Pe=Ii(Le);return Pe[3]=1,Pe}if(I=w.match(Ut)){var He=I.slice(1,4);He[1]*=.01,He[2]*=.01;var je=Ii(He);return je[3]=+I[4],je}};_i.test=function(w){return oi.test(w)||yi.test(w)||Pr.test(w)||li.test(w)||Lr.test(w)||Ut.test(w)};var nt=_i,lt=f.type;L.prototype.css=function(w){return xt(this._rgb,w)},H.css=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["css"])))},g.format.css=nt,g.autodetect.push({p:5,test:function(w){for(var I=[],U=arguments.length-1;U-- >0;)I[U]=arguments[U+1];if(!I.length&<(w)==="string"&&nt.test(w))return"css"}});var kt=f.unpack;g.format.gl=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=kt(w,"rgba");return U[0]*=255,U[1]*=255,U[2]*=255,U},H.gl=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["gl"])))},L.prototype.gl=function(){var w=this._rgb;return[w[0]/255,w[1]/255,w[2]/255,w[3]]};var Ft=f.unpack,Tr=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Ft(w,"rgb"),J=U[0],ue=U[1],oe=U[2],ae=Math.min(J,ue,oe),fe=Math.max(J,ue,oe),pe=fe-ae,Ne=pe*100/255,Le=ae/(255-pe)*100,Pe;return pe===0?Pe=Number.NaN:(J===fe&&(Pe=(ue-oe)/pe),ue===fe&&(Pe=2+(oe-J)/pe),oe===fe&&(Pe=4+(J-ue)/pe),Pe*=60,Pe<0&&(Pe+=360)),[Pe,Ne,Le]},nr=Tr,Or=f.unpack,br=Math.floor,Sr=function(){for(var w,I,U,J,ue,oe,ae=[],fe=arguments.length;fe--;)ae[fe]=arguments[fe];ae=Or(ae,"hcg");var pe=ae[0],Ne=ae[1],Le=ae[2],Pe,He,je;Le=Le*255;var tt=Ne*255;if(Ne===0)Pe=He=je=Le;else{pe===360&&(pe=0),pe>360&&(pe-=360),pe<0&&(pe+=360),pe/=60;var gt=br(pe),ot=pe-gt,bt=Le*(1-Ne),Rt=bt+tt*(1-ot),Kt=bt+tt*ot,Ai=bt+tt;switch(gt){case 0:w=[Ai,Kt,bt],Pe=w[0],He=w[1],je=w[2];break;case 1:I=[Rt,Ai,bt],Pe=I[0],He=I[1],je=I[2];break;case 2:U=[bt,Ai,Kt],Pe=U[0],He=U[1],je=U[2];break;case 3:J=[bt,Rt,Ai],Pe=J[0],He=J[1],je=J[2];break;case 4:ue=[Kt,bt,Ai],Pe=ue[0],He=ue[1],je=ue[2];break;case 5:oe=[Ai,bt,Rt],Pe=oe[0],He=oe[1],je=oe[2];break}}return[Pe,He,je,ae.length>3?ae[3]:1]},Mr=Sr,Rn=f.unpack,Bn=f.type;L.prototype.hcg=function(){return nr(this._rgb)},H.hcg=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hcg"])))},g.format.hcg=Mr,g.autodetect.push({p:1,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=Rn(w,"hcg"),Bn(w)==="array"&&w.length===3)return"hcg"}});var dt=f.unpack,_t=f.last,Jr=Math.round,mn=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=dt(w,"rgba"),J=U[0],ue=U[1],oe=U[2],ae=U[3],fe=_t(w)||"auto";ae===void 0&&(ae=1),fe==="auto"&&(fe=ae<1?"rgba":"rgb"),J=Jr(J),ue=Jr(ue),oe=Jr(oe);var pe=J<<16|ue<<8|oe,Ne="000000"+pe.toString(16);Ne=Ne.substr(Ne.length-6);var Le="0"+Jr(ae*255).toString(16);switch(Le=Le.substr(Le.length-2),fe.toLowerCase()){case"rgba":return"#"+Ne+Le;case"argb":return"#"+Le+Ne;default:return"#"+Ne}},Ts=mn,Js=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Zr=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,en=function(w){if(w.match(Js)){(w.length===4||w.length===7)&&(w=w.substr(1)),w.length===3&&(w=w.split(""),w=w[0]+w[0]+w[1]+w[1]+w[2]+w[2]);var I=parseInt(w,16),U=I>>16,J=I>>8&255,ue=I&255;return[U,J,ue,1]}if(w.match(Zr)){(w.length===5||w.length===9)&&(w=w.substr(1)),w.length===4&&(w=w.split(""),w=w[0]+w[0]+w[1]+w[1]+w[2]+w[2]+w[3]+w[3]);var oe=parseInt(w,16),ae=oe>>24&255,fe=oe>>16&255,pe=oe>>8&255,Ne=Math.round((oe&255)/255*100)/100;return[ae,fe,pe,Ne]}throw new Error("unknown hex color: "+w)},bs=en,Ss=f.type;L.prototype.hex=function(w){return Ts(this._rgb,w)},H.hex=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hex"])))},g.format.hex=bs,g.autodetect.push({p:4,test:function(w){for(var I=[],U=arguments.length-1;U-- >0;)I[U]=arguments[U+1];if(!I.length&&Ss(w)==="string"&&[3,4,5,6,7,8,9].indexOf(w.length)>=0)return"hex"}});var Zs=f.unpack,R=f.TWOPI,j=Math.min,ie=Math.sqrt,ge=Math.acos,Me=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Zs(w,"rgb"),J=U[0],ue=U[1],oe=U[2];J/=255,ue/=255,oe/=255;var ae,fe=j(J,ue,oe),pe=(J+ue+oe)/3,Ne=pe>0?1-fe/pe:0;return Ne===0?ae=NaN:(ae=(J-ue+(J-oe))/2,ae/=ie((J-ue)*(J-ue)+(J-oe)*(ue-oe)),ae=ge(ae),oe>ue&&(ae=R-ae),ae/=R),[ae*360,Ne,pe]},Xe=Me,At=f.unpack,Wt=f.limit,Tt=f.TWOPI,Yi=f.PITHIRD,mi=Math.cos,Li=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=At(w,"hsi");var U=w[0],J=w[1],ue=w[2],oe,ae,fe;return isNaN(U)&&(U=0),isNaN(J)&&(J=0),U>360&&(U-=360),U<0&&(U+=360),U/=360,U<1/3?(fe=(1-J)/3,oe=(1+J*mi(Tt*U)/mi(Yi-Tt*U))/3,ae=1-(fe+oe)):U<2/3?(U-=1/3,oe=(1-J)/3,ae=(1+J*mi(Tt*U)/mi(Yi-Tt*U))/3,fe=1-(oe+ae)):(U-=2/3,ae=(1-J)/3,fe=(1+J*mi(Tt*U)/mi(Yi-Tt*U))/3,oe=1-(ae+fe)),oe=Wt(ue*oe*3),ae=Wt(ue*ae*3),fe=Wt(ue*fe*3),[oe*255,ae*255,fe*255,w.length>3?w[3]:1]},ii=Li,Lt=f.unpack,ut=f.type;L.prototype.hsi=function(){return Xe(this._rgb)},H.hsi=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hsi"])))},g.format.hsi=ii,g.autodetect.push({p:2,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=Lt(w,"hsi"),ut(w)==="array"&&w.length===3)return"hsi"}});var Rr=f.unpack,qi=f.type;L.prototype.hsl=function(){return xe(this._rgb)},H.hsl=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hsl"])))},g.format.hsl=Ii,g.autodetect.push({p:2,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=Rr(w,"hsl"),qi(w)==="array"&&w.length===3)return"hsl"}});var Ct=f.unpack,gn=Math.min,at=Math.max,Nt=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=Ct(w,"rgb");var U=w[0],J=w[1],ue=w[2],oe=gn(U,J,ue),ae=at(U,J,ue),fe=ae-oe,pe,Ne,Le;return Le=ae/255,ae===0?(pe=Number.NaN,Ne=0):(Ne=fe/ae,U===ae&&(pe=(J-ue)/fe),J===ae&&(pe=2+(ue-U)/fe),ue===ae&&(pe=4+(U-J)/fe),pe*=60,pe<0&&(pe+=360)),[pe,Ne,Le]},vn=Nt,ri=f.unpack,zl=Math.floor,yn=function(){for(var w,I,U,J,ue,oe,ae=[],fe=arguments.length;fe--;)ae[fe]=arguments[fe];ae=ri(ae,"hsv");var pe=ae[0],Ne=ae[1],Le=ae[2],Pe,He,je;if(Le*=255,Ne===0)Pe=He=je=Le;else{pe===360&&(pe=0),pe>360&&(pe-=360),pe<0&&(pe+=360),pe/=60;var tt=zl(pe),gt=pe-tt,ot=Le*(1-Ne),bt=Le*(1-Ne*gt),Rt=Le*(1-Ne*(1-gt));switch(tt){case 0:w=[Le,Rt,ot],Pe=w[0],He=w[1],je=w[2];break;case 1:I=[bt,Le,ot],Pe=I[0],He=I[1],je=I[2];break;case 2:U=[ot,Le,Rt],Pe=U[0],He=U[1],je=U[2];break;case 3:J=[ot,bt,Le],Pe=J[0],He=J[1],je=J[2];break;case 4:ue=[Rt,ot,Le],Pe=ue[0],He=ue[1],je=ue[2];break;case 5:oe=[Le,ot,bt],Pe=oe[0],He=oe[1],je=oe[2];break}}return[Pe,He,je,ae.length>3?ae[3]:1]},Ot=yn,ea=f.unpack,Cs=f.type;L.prototype.hsv=function(){return vn(this._rgb)},H.hsv=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hsv"])))},g.format.hsv=Ot,g.autodetect.push({p:2,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=ea(w,"hsv"),Cs(w)==="array"&&w.length===3)return"hsv"}});var wi={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ho=f.unpack,Es=Math.pow,fo=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=ho(w,"rgb"),J=U[0],ue=U[1],oe=U[2],ae=ws(J,ue,oe),fe=ae[0],pe=ae[1],Ne=ae[2],Le=116*pe-16;return[Le<0?0:Le,500*(fe-pe),200*(pe-Ne)]},tn=function(w){return(w/=255)<=.04045?w/12.92:Es((w+.055)/1.055,2.4)},Un=function(w){return w>wi.t3?Es(w,1/3):w/wi.t2+wi.t0},ws=function(w,I,U){w=tn(w),I=tn(I),U=tn(U);var J=Un((.4124564*w+.3575761*I+.1804375*U)/wi.Xn),ue=Un((.2126729*w+.7151522*I+.072175*U)/wi.Yn),oe=Un((.0193339*w+.119192*I+.9503041*U)/wi.Zn);return[J,ue,oe]},po=fo,Wl=f.unpack,_n=Math.pow,rn=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=Wl(w,"lab");var U=w[0],J=w[1],ue=w[2],oe,ae,fe,pe,Ne,Le;return ae=(U+16)/116,oe=isNaN(J)?ae:ae+J/500,fe=isNaN(ue)?ae:ae-ue/200,ae=wi.Yn*Qi(ae),oe=wi.Xn*Qi(oe),fe=wi.Zn*Qi(fe),pe=Tn(3.2404542*oe-1.5371385*ae-.4985314*fe),Ne=Tn(-.969266*oe+1.8760108*ae+.041556*fe),Le=Tn(.0556434*oe-.2040259*ae+1.0572252*fe),[pe,Ne,Le,w.length>3?w[3]:1]},Tn=function(w){return 255*(w<=.00304?12.92*w:1.055*_n(w,1/2.4)-.055)},Qi=function(w){return w>wi.t1?w*w*w:wi.t2*(w-wi.t0)},nn=rn,Fn=f.unpack,bn=f.type;L.prototype.lab=function(){return po(this._rgb)},H.lab=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["lab"])))},g.format.lab=nn,g.autodetect.push({p:2,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=Fn(w,"lab"),bn(w)==="array"&&w.length===3)return"lab"}});var Br=f.unpack,mo=f.RAD2DEG,ta=Math.sqrt,go=Math.atan2,Ur=Math.round,ks=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Br(w,"lab"),J=U[0],ue=U[1],oe=U[2],ae=ta(ue*ue+oe*oe),fe=(go(oe,ue)*mo+360)%360;return Ur(ae*1e4)===0&&(fe=Number.NaN),[J,ae,fe]},Gl=ks,$n=f.unpack,jn=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=$n(w,"rgb"),J=U[0],ue=U[1],oe=U[2],ae=po(J,ue,oe),fe=ae[0],pe=ae[1],Ne=ae[2];return Gl(fe,pe,Ne)},zi=jn,Kl=f.unpack,ia=f.DEG2RAD,Hn=Math.sin,ra=Math.cos,Vn=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Kl(w,"lch"),J=U[0],ue=U[1],oe=U[2];return isNaN(oe)&&(oe=0),oe=oe*ia,[J,ra(oe)*ue,Hn(oe)*ue]},na=Vn,vo=f.unpack,Ia=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];w=vo(w,"lch");var U=w[0],J=w[1],ue=w[2],oe=na(U,J,ue),ae=oe[0],fe=oe[1],pe=oe[2],Ne=nn(ae,fe,pe),Le=Ne[0],Pe=Ne[1],He=Ne[2];return[Le,Pe,He,w.length>3?w[3]:1]},yo=Ia,Xl=f.unpack,Yl=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Xl(w,"hcl").reverse();return yo.apply(void 0,U)},sa=Yl,As=f.unpack,aa=f.type;L.prototype.lch=function(){return zi(this._rgb)},L.prototype.hcl=function(){return zi(this._rgb).reverse()},H.lch=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["lch"])))},H.hcl=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["hcl"])))},g.format.lch=yo,g.format.hcl=sa,["lch","hcl"].forEach(function(w){return g.autodetect.push({p:2,test:function(){for(var I=[],U=arguments.length;U--;)I[U]=arguments[U];if(I=As(I,w),aa(I)==="array"&&I.length===3)return w}})});var _o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},qn=_o,Pa=f.type;L.prototype.name=function(){for(var w=Ts(this._rgb,"rgb"),I=0,U=Object.keys(qn);I<U.length;I+=1){var J=U[I];if(qn[J]===w)return J.toLowerCase()}return w},g.format.named=function(w){if(w=w.toLowerCase(),qn[w])return bs(qn[w]);throw new Error("unknown color name: "+w)},g.autodetect.push({p:5,test:function(w){for(var I=[],U=arguments.length-1;U-- >0;)I[U]=arguments[U+1];if(!I.length&&Pa(w)==="string"&&qn[w.toLowerCase()])return"named"}});var Ql=f.unpack,xs=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Ql(w,"rgb"),J=U[0],ue=U[1],oe=U[2];return(J<<16)+(ue<<8)+oe},oa=xs,To=f.type,Jl=function(w){if(To(w)=="number"&&w>=0&&w<=16777215){var I=w>>16,U=w>>8&255,J=w&255;return[I,U,J,1]}throw new Error("unknown num color: "+w)},la=Jl,zn=f.type;L.prototype.num=function(){return oa(this._rgb)},H.num=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["num"])))},g.format.num=la,g.autodetect.push({p:5,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w.length===1&&zn(w[0])==="number"&&w[0]>=0&&w[0]<=16777215)return"num"}});var Wn=f.unpack,sn=f.type,La=Math.round;L.prototype.rgb=function(w){return w===void 0&&(w=!0),w===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(La)},L.prototype.rgba=function(w){return w===void 0&&(w=!0),this._rgb.slice(0,4).map(function(I,U){return U<3?w===!1?I:La(I):I})},H.rgb=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["rgb"])))},g.format.rgb=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];var U=Wn(w,"rgba");return U[3]===void 0&&(U[3]=1),U},g.autodetect.push({p:3,test:function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];if(w=Wn(w,"rgba"),sn(w)==="array"&&(w.length===3||w.length===4&&sn(w[3])=="number"&&w[3]>=0&&w[3]<=1))return"rgb"}});var Ns=Math.log,bo=function(w){var I=w/100,U,J,ue;return I<66?(U=255,J=-155.25485562709179-.44596950469579133*(J=I-2)+104.49216199393888*Ns(J),ue=I<20?0:-254.76935184120902+.8274096064007395*(ue=I-10)+115.67994401066147*Ns(ue)):(U=351.97690566805693+.114206453784165*(U=I-55)-40.25366309332127*Ns(U),J=325.4494125711974+.07943456536662342*(J=I-50)-28.0852963507957*Ns(J),ue=255),[U,J,ue,1]},Oa=bo,Zl=f.unpack,eu=Math.round,tu=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];for(var U=Zl(w,"rgb"),J=U[0],ue=U[2],oe=1e3,ae=4e4,fe=.4,pe;ae-oe>fe;){pe=(ae+oe)*.5;var Ne=Oa(pe);Ne[2]/Ne[0]>=ue/J?ae=pe:oe=pe}return eu(pe)},Gn=tu;L.prototype.temp=L.prototype.kelvin=L.prototype.temperature=function(){return Gn(this._rgb)},H.temp=H.kelvin=H.temperature=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];return new(Function.prototype.bind.apply(L,[null].concat(w,["temp"])))},g.format.temp=g.format.kelvin=g.format.temperature=Oa;var iu=f.type;L.prototype.alpha=function(w,I){return I===void 0&&(I=!1),w!==void 0&&iu(w)==="number"?I?(this._rgb[3]=w,this):new L([this._rgb[0],this._rgb[1],this._rgb[2],w],"rgb"):this._rgb[3]},L.prototype.clipped=function(){return this._rgb._clipped||!1},L.prototype.darken=function(w){w===void 0&&(w=1);var I=this,U=I.lab();return U[0]-=wi.Kn*w,new L(U,"lab").alpha(I.alpha(),!0)},L.prototype.brighten=function(w){return w===void 0&&(w=1),this.darken(-w)},L.prototype.darker=L.prototype.darken,L.prototype.brighter=L.prototype.brighten,L.prototype.get=function(w){var I=w.split("."),U=I[0],J=I[1],ue=this[U]();if(J){var oe=U.indexOf(J);if(oe>-1)return ue[oe];throw new Error("unknown channel "+J+" in mode "+U)}else return ue};var an=f.type,ua=Math.pow,ru=1e-7,Mt=20;L.prototype.luminance=function(w){if(w!==void 0&&an(w)==="number"){if(w===0)return new L([0,0,0,this._rgb[3]],"rgb");if(w===1)return new L([255,255,255,this._rgb[3]],"rgb");var I=this.luminance(),U="rgb",J=Mt,ue=function(ae,fe){var pe=ae.interpolate(fe,.5,U),Ne=pe.luminance();return Math.abs(w-Ne)<ru||!J--?pe:Ne>w?ue(ae,pe):ue(pe,fe)},oe=(I>w?ue(new L([0,0,0]),this):ue(this,new L([255,255,255]))).rgb();return new L(oe.concat([this._rgb[3]]))}return nu.apply(void 0,this._rgb.slice(0,3))};var nu=function(w,I,U){return w=Ma(w),I=Ma(I),U=Ma(U),.2126*w+.7152*I+.0722*U},Ma=function(w){return w/=255,w<=.03928?w/12.92:ua((w+.055)/1.055,2.4)},Oi={},Kn=f.type,Xn=function(w,I,U){U===void 0&&(U=.5);for(var J=[],ue=arguments.length-3;ue-- >0;)J[ue]=arguments[ue+3];var oe=J[0]||"lrgb";if(!Oi[oe]&&!J.length&&(oe=Object.keys(Oi)[0]),!Oi[oe])throw new Error("interpolation mode "+oe+" is not defined");return Kn(w)!=="object"&&(w=new L(w)),Kn(I)!=="object"&&(I=new L(I)),Oi[oe](w,I,U).alpha(w.alpha()+U*(I.alpha()-w.alpha()))};L.prototype.mix=L.prototype.interpolate=function(w,I){I===void 0&&(I=.5);for(var U=[],J=arguments.length-2;J-- >0;)U[J]=arguments[J+2];return Xn.apply(void 0,[this,w,I].concat(U))},L.prototype.premultiply=function(w){w===void 0&&(w=!1);var I=this._rgb,U=I[3];return w?(this._rgb=[I[0]*U,I[1]*U,I[2]*U,U],this):new L([I[0]*U,I[1]*U,I[2]*U,U],"rgb")},L.prototype.saturate=function(w){w===void 0&&(w=1);var I=this,U=I.lch();return U[1]+=wi.Kn*w,U[1]<0&&(U[1]=0),new L(U,"lch").alpha(I.alpha(),!0)},L.prototype.desaturate=function(w){return w===void 0&&(w=1),this.saturate(-w)};var Sn=f.type;L.prototype.set=function(w,I,U){U===void 0&&(U=!1);var J=w.split("."),ue=J[0],oe=J[1],ae=this[ue]();if(oe){var fe=ue.indexOf(oe);if(fe>-1){if(Sn(I)=="string")switch(I.charAt(0)){case"+":ae[fe]+=+I;break;case"-":ae[fe]+=+I;break;case"*":ae[fe]*=+I.substr(1);break;case"/":ae[fe]/=+I.substr(1);break;default:ae[fe]=+I}else if(Sn(I)==="number")ae[fe]=I;else throw new Error("unsupported value for Color.set");var pe=new L(ae,ue);return U?(this._rgb=pe._rgb,this):pe}throw new Error("unknown channel "+oe+" in mode "+ue)}else return ae};var ca=function(w,I,U){var J=w._rgb,ue=I._rgb;return new L(J[0]+U*(ue[0]-J[0]),J[1]+U*(ue[1]-J[1]),J[2]+U*(ue[2]-J[2]),"rgb")};Oi.rgb=ca;var Mi=Math.sqrt,Ri=Math.pow,Ds=function(w,I,U){var J=w._rgb,ue=J[0],oe=J[1],ae=J[2],fe=I._rgb,pe=fe[0],Ne=fe[1],Le=fe[2];return new L(Mi(Ri(ue,2)*(1-U)+Ri(pe,2)*U),Mi(Ri(oe,2)*(1-U)+Ri(Ne,2)*U),Mi(Ri(ae,2)*(1-U)+Ri(Le,2)*U),"rgb")};Oi.lrgb=Ds;var Ra=function(w,I,U){var J=w.lab(),ue=I.lab();return new L(J[0]+U*(ue[0]-J[0]),J[1]+U*(ue[1]-J[1]),J[2]+U*(ue[2]-J[2]),"lab")};Oi.lab=Ra;var Fr=function(w,I,U,J){var ue,oe,ae,fe;J==="hsl"?(ae=w.hsl(),fe=I.hsl()):J==="hsv"?(ae=w.hsv(),fe=I.hsv()):J==="hcg"?(ae=w.hcg(),fe=I.hcg()):J==="hsi"?(ae=w.hsi(),fe=I.hsi()):(J==="lch"||J==="hcl")&&(J="hcl",ae=w.hcl(),fe=I.hcl());var pe,Ne,Le,Pe,He,je;J.substr(0,1)==="h"&&(ue=ae,pe=ue[0],Le=ue[1],He=ue[2],oe=fe,Ne=oe[0],Pe=oe[1],je=oe[2]);var tt,gt,ot,bt;return!isNaN(pe)&&!isNaN(Ne)?(Ne>pe&&Ne-pe>180?bt=Ne-(pe+360):Ne<pe&&pe-Ne>180?bt=Ne+360-pe:bt=Ne-pe,gt=pe+U*bt):isNaN(pe)?isNaN(Ne)?gt=Number.NaN:(gt=Ne,(He==1||He==0)&&J!="hsv"&&(tt=Pe)):(gt=pe,(je==1||je==0)&&J!="hsv"&&(tt=Le)),tt===void 0&&(tt=Le+U*(Pe-Le)),ot=He+U*(je-He),new L([gt,tt,ot],J)},Yn=function(w,I,U){return Fr(w,I,U,"lch")};Oi.lch=Yn,Oi.hcl=Yn;var su=function(w,I,U){var J=w.num(),ue=I.num();return new L(J+U*(ue-J),"num")};Oi.num=su;var au=function(w,I,U){return Fr(w,I,U,"hcg")};Oi.hcg=au;var So=function(w,I,U){return Fr(w,I,U,"hsi")};Oi.hsi=So;var Co=function(w,I,U){return Fr(w,I,U,"hsl")};Oi.hsl=Co;var ha=function(w,I,U){return Fr(w,I,U,"hsv")};Oi.hsv=ha;var Is=f.clip_rgb,Qn=Math.pow,$r=Math.sqrt,Ba=Math.PI,Jn=Math.cos,Cn=Math.sin,Eo=Math.atan2,wo=function(w,I,U){I===void 0&&(I="lrgb"),U===void 0&&(U=null);var J=w.length;U||(U=Array.from(new Array(J)).map(function(){return 1}));var ue=J/U.reduce(function(gt,ot){return gt+ot});if(U.forEach(function(gt,ot){U[ot]*=ue}),w=w.map(function(gt){return new L(gt)}),I==="lrgb")return ko(w,U);for(var oe=w.shift(),ae=oe.get(I),fe=[],pe=0,Ne=0,Le=0;Le<ae.length;Le++)if(ae[Le]=(ae[Le]||0)*U[0],fe.push(isNaN(ae[Le])?0:U[0]),I.charAt(Le)==="h"&&!isNaN(ae[Le])){var Pe=ae[Le]/180*Ba;pe+=Jn(Pe)*U[0],Ne+=Cn(Pe)*U[0]}var He=oe.alpha()*U[0];w.forEach(function(gt,ot){var bt=gt.get(I);He+=gt.alpha()*U[ot+1];for(var Rt=0;Rt<ae.length;Rt++)if(!isNaN(bt[Rt]))if(fe[Rt]+=U[ot+1],I.charAt(Rt)==="h"){var Kt=bt[Rt]/180*Ba;pe+=Jn(Kt)*U[ot+1],Ne+=Cn(Kt)*U[ot+1]}else ae[Rt]+=bt[Rt]*U[ot+1]});for(var je=0;je<ae.length;je++)if(I.charAt(je)==="h"){for(var tt=Eo(Ne/fe[je],pe/fe[je])/Ba*180;tt<0;)tt+=360;for(;tt>=360;)tt-=360;ae[je]=tt}else ae[je]=ae[je]/fe[je];return He/=J,new L(ae,I).alpha(He>.99999?1:He,!0)},ko=function(w,I){for(var U=w.length,J=[0,0,0,0],ue=0;ue<w.length;ue++){var oe=w[ue],ae=I[ue]/U,fe=oe._rgb;J[0]+=Qn(fe[0],2)*ae,J[1]+=Qn(fe[1],2)*ae,J[2]+=Qn(fe[2],2)*ae,J[3]+=fe[3]*ae}return J[0]=$r(J[0]),J[1]=$r(J[1]),J[2]=$r(J[2]),J[3]>.9999999&&(J[3]=1),new L(Is(J))},En=f.type,Ps=Math.pow,Ls=function(w){var I="rgb",U=H("#ccc"),J=0,ue=[0,1],oe=[],ae=[0,0],fe=!1,pe=[],Ne=!1,Le=0,Pe=1,He=!1,je={},tt=!0,gt=1,ot=function(Oe){if(Oe=Oe||["#fff","#000"],Oe&&En(Oe)==="string"&&H.brewer&&H.brewer[Oe.toLowerCase()]&&(Oe=H.brewer[Oe.toLowerCase()]),En(Oe)==="array"){Oe.length===1&&(Oe=[Oe[0],Oe[0]]),Oe=Oe.slice(0);for(var Ze=0;Ze<Oe.length;Ze++)Oe[Ze]=H(Oe[Ze]);oe.length=0;for(var ft=0;ft<Oe.length;ft++)oe.push(ft/(Oe.length-1))}return or(),pe=Oe},bt=function(Oe){if(fe!=null){for(var Ze=fe.length-1,ft=0;ft<Ze&&Oe>=fe[ft];)ft++;return ft-1}return 0},Rt=function(Oe){return Oe},Kt=function(Oe){return Oe},Ai=function(Oe,Ze){var ft,ct;if(Ze==null&&(Ze=!1),isNaN(Oe)||Oe===null)return U;if(Ze)ct=Oe;else if(fe&&fe.length>2){var xi=bt(Oe);ct=xi/(fe.length-2)}else Pe!==Le?ct=(Oe-Le)/(Pe-Le):ct=1;ct=Kt(ct),Ze||(ct=Rt(ct)),gt!==1&&(ct=Ps(ct,gt)),ct=ae[0]+ct*(1-ae[0]-ae[1]),ct=Math.min(1,Math.max(0,ct));var $t=Math.floor(ct*1e4);if(tt&&je[$t])ft=je[$t];else{if(En(pe)==="array")for(var Dt=0;Dt<oe.length;Dt++){var It=oe[Dt];if(ct<=It){ft=pe[Dt];break}if(ct>=It&&Dt===oe.length-1){ft=pe[Dt];break}if(ct>It&&ct<oe[Dt+1]){ct=(ct-It)/(oe[Dt+1]-It),ft=H.interpolate(pe[Dt],pe[Dt+1],ct,I);break}}else En(pe)==="function"&&(ft=pe(ct));tt&&(je[$t]=ft)}return ft},or=function(){return je={}};ot(w);var vt=function(Oe){var Ze=H(Ai(Oe));return Ne&&Ze[Ne]?Ze[Ne]():Ze};return vt.classes=function(Oe){if(Oe!=null){if(En(Oe)==="array")fe=Oe,ue=[Oe[0],Oe[Oe.length-1]];else{var Ze=H.analyze(ue);Oe===0?fe=[Ze.min,Ze.max]:fe=H.limits(Ze,"e",Oe)}return vt}return fe},vt.domain=function(Oe){if(!arguments.length)return ue;Le=Oe[0],Pe=Oe[Oe.length-1],oe=[];var Ze=pe.length;if(Oe.length===Ze&&Le!==Pe)for(var ft=0,ct=Array.from(Oe);ft<ct.length;ft+=1){var xi=ct[ft];oe.push((xi-Le)/(Pe-Le))}else{for(var $t=0;$t<Ze;$t++)oe.push($t/(Ze-1));if(Oe.length>2){var Dt=Oe.map(function(hi,Bt){return Bt/(Oe.length-1)}),It=Oe.map(function(hi){return(hi-Le)/(Pe-Le)});It.every(function(hi,Bt){return Dt[Bt]===hi})||(Kt=function(hi){if(hi<=0||hi>=1)return hi;for(var Bt=0;hi>=It[Bt+1];)Bt++;var es=(hi-It[Bt])/(It[Bt+1]-It[Bt]),ts=Dt[Bt]+es*(Dt[Bt+1]-Dt[Bt]);return ts})}}return ue=[Le,Pe],vt},vt.mode=function(Oe){return arguments.length?(I=Oe,or(),vt):I},vt.range=function(Oe,Ze){return ot(Oe),vt},vt.out=function(Oe){return Ne=Oe,vt},vt.spread=function(Oe){return arguments.length?(J=Oe,vt):J},vt.correctLightness=function(Oe){return Oe==null&&(Oe=!0),He=Oe,or(),He?Rt=function(Ze){for(var ft=Ai(0,!0).lab()[0],ct=Ai(1,!0).lab()[0],xi=ft>ct,$t=Ai(Ze,!0).lab()[0],Dt=ft+(ct-ft)*Ze,It=$t-Dt,hi=0,Bt=1,es=20;Math.abs(It)>.01&&es-- >0;)(function(){return xi&&(It*=-1),It<0?(hi=Ze,Ze+=(Bt-Ze)*.5):(Bt=Ze,Ze+=(hi-Ze)*.5),$t=Ai(Ze,!0).lab()[0],It=$t-Dt})();return Ze}:Rt=function(Ze){return Ze},vt},vt.padding=function(Oe){return Oe!=null?(En(Oe)==="number"&&(Oe=[Oe,Oe]),ae=Oe,vt):ae},vt.colors=function(Oe,Ze){arguments.length<2&&(Ze="hex");var ft=[];if(arguments.length===0)ft=pe.slice(0);else if(Oe===1)ft=[vt(.5)];else if(Oe>1){var ct=ue[0],xi=ue[1]-ct;ft=da(0,Oe).map(function(Bt){return vt(ct+Bt/(Oe-1)*xi)})}else{w=[];var $t=[];if(fe&&fe.length>2)for(var Dt=1,It=fe.length,hi=1<=It;hi?Dt<It:Dt>It;hi?Dt++:Dt--)$t.push((fe[Dt-1]+fe[Dt])*.5);else $t=ue;ft=$t.map(function(Bt){return vt(Bt)})}return H[Ze]&&(ft=ft.map(function(Bt){return Bt[Ze]()})),ft},vt.cache=function(Oe){return Oe!=null?(tt=Oe,vt):tt},vt.gamma=function(Oe){return Oe!=null?(gt=Oe,vt):gt},vt.nodata=function(Oe){return Oe!=null?(U=H(Oe),vt):U},vt};function da(w,I,U){for(var J=[],ue=w<I,oe=I,ae=w;ue?ae<oe:ae>oe;ue?ae++:ae--)J.push(ae);return J}var fa=function(w){var I,U,J,ue,oe,ae,fe;if(w=w.map(function(Pe){return new L(Pe)}),w.length===2)I=w.map(function(Pe){return Pe.lab()}),oe=I[0],ae=I[1],ue=function(Pe){var He=[0,1,2].map(function(je){return oe[je]+Pe*(ae[je]-oe[je])});return new L(He,"lab")};else if(w.length===3)U=w.map(function(Pe){return Pe.lab()}),oe=U[0],ae=U[1],fe=U[2],ue=function(Pe){var He=[0,1,2].map(function(je){return(1-Pe)*(1-Pe)*oe[je]+2*(1-Pe)*Pe*ae[je]+Pe*Pe*fe[je]});return new L(He,"lab")};else if(w.length===4){var pe;J=w.map(function(Pe){return Pe.lab()}),oe=J[0],ae=J[1],fe=J[2],pe=J[3],ue=function(Pe){var He=[0,1,2].map(function(je){return(1-Pe)*(1-Pe)*(1-Pe)*oe[je]+3*(1-Pe)*(1-Pe)*Pe*ae[je]+3*(1-Pe)*Pe*Pe*fe[je]+Pe*Pe*Pe*pe[je]});return new L(He,"lab")}}else if(w.length===5){var Ne=fa(w.slice(0,3)),Le=fa(w.slice(2,5));ue=function(Pe){return Pe<.5?Ne(Pe*2):Le((Pe-.5)*2)}}return ue},Ao=function(w){var I=fa(w);return I.scale=function(){return Ls(I)},I},ki=function(w,I,U){if(!ki[U])throw new Error("unknown blend mode "+U);return ki[U](w,I)},Wi=function(w){return function(I,U){var J=H(U).rgb(),ue=H(I).rgb();return H.rgb(w(J,ue))}},on=function(w){return function(I,U){var J=[];return J[0]=w(I[0],U[0]),J[1]=w(I[1],U[1]),J[2]=w(I[2],U[2]),J}},ou=function(w){return w},lu=function(w,I){return w*I/255},Ua=function(w,I){return w>I?I:w},uu=function(w,I){return w>I?w:I},pa=function(w,I){return 255*(1-(1-w/255)*(1-I/255))},cu=function(w,I){return I<128?2*w*I/255:255*(1-2*(1-w/255)*(1-I/255))},hu=function(w,I){return 255*(1-(1-I/255)/(w/255))},wn=function(w,I){return w===255?255:(w=255*(I/255)/(1-w/255),w>255?255:w)};ki.normal=Wi(on(ou)),ki.multiply=Wi(on(lu)),ki.screen=Wi(on(pa)),ki.overlay=Wi(on(cu)),ki.darken=Wi(on(Ua)),ki.lighten=Wi(on(uu)),ki.dodge=Wi(on(wn)),ki.burn=Wi(on(hu));for(var Et=ki,Cr=f.type,Ti=f.clip_rgb,sr=f.TWOPI,du=Math.pow,xo=Math.sin,ma=Math.cos,fu=function(w,I,U,J,ue){w===void 0&&(w=300),I===void 0&&(I=-1.5),U===void 0&&(U=1),J===void 0&&(J=1),ue===void 0&&(ue=[0,1]);var oe=0,ae;Cr(ue)==="array"?ae=ue[1]-ue[0]:(ae=0,ue=[ue,ue]);var fe=function(pe){var Ne=sr*((w+120)/360+I*pe),Le=du(ue[0]+ae*pe,J),Pe=oe!==0?U[0]+pe*oe:U,He=Pe*Le*(1-Le)/2,je=ma(Ne),tt=xo(Ne),gt=Le+He*(-.14861*je+1.78277*tt),ot=Le+He*(-.29227*je-.90649*tt),bt=Le+He*(1.97294*je);return H(Ti([gt*255,ot*255,bt*255,1]))};return fe.start=function(pe){return pe==null?w:(w=pe,fe)},fe.rotations=function(pe){return pe==null?I:(I=pe,fe)},fe.gamma=function(pe){return pe==null?J:(J=pe,fe)},fe.hue=function(pe){return pe==null?U:(U=pe,Cr(U)==="array"?(oe=U[1]-U[0],oe===0&&(U=U[1])):oe=0,fe)},fe.lightness=function(pe){return pe==null?ue:(Cr(pe)==="array"?(ue=pe,ae=pe[1]-pe[0]):(ue=[pe,pe],ae=0),fe)},fe.scale=function(){return H.scale(fe)},fe.hue(U),fe},pu="0123456789abcdef",mu=Math.floor,gu=Math.random,No=function(){for(var w="#",I=0;I<6;I++)w+=pu.charAt(mu(gu()*16));return new L(w,"hex")},Do=Math.log,Zn=Math.pow,M=Math.floor,p=Math.abs,T=function(w,I){I===void 0&&(I=null);var U={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return l(w)==="object"&&(w=Object.values(w)),w.forEach(function(J){I&&l(J)==="object"&&(J=J[I]),J!=null&&!isNaN(J)&&(U.values.push(J),U.sum+=J,J<U.min&&(U.min=J),J>U.max&&(U.max=J),U.count+=1)}),U.domain=[U.min,U.max],U.limits=function(J,ue){return v(U,J,ue)},U},v=function(w,I,U){I===void 0&&(I="equal"),U===void 0&&(U=7),l(w)=="array"&&(w=T(w));var J=w.min,ue=w.max,oe=w.values.sort(function(wr,yu){return wr-yu});if(U===1)return[J,ue];var ae=[];if(I.substr(0,1)==="c"&&(ae.push(J),ae.push(ue)),I.substr(0,1)==="e"){ae.push(J);for(var fe=1;fe<U;fe++)ae.push(J+fe/U*(ue-J));ae.push(ue)}else if(I.substr(0,1)==="l"){if(J<=0)throw new Error("Logarithmic scales are only possible for values > 0");var pe=Math.LOG10E*Do(J),Ne=Math.LOG10E*Do(ue);ae.push(J);for(var Le=1;Le<U;Le++)ae.push(Zn(10,pe+Le/U*(Ne-pe)));ae.push(ue)}else if(I.substr(0,1)==="q"){ae.push(J);for(var Pe=1;Pe<U;Pe++){var He=(oe.length-1)*Pe/U,je=M(He);if(je===He)ae.push(oe[je]);else{var tt=He-je;ae.push(oe[je]*(1-tt)+oe[je+1]*tt)}}ae.push(ue)}else if(I.substr(0,1)==="k"){var gt,ot=oe.length,bt=new Array(ot),Rt=new Array(U),Kt=!0,Ai=0,or=null;or=[],or.push(J);for(var vt=1;vt<U;vt++)or.push(J+vt/U*(ue-J));for(or.push(ue);Kt;){for(var Oe=0;Oe<U;Oe++)Rt[Oe]=0;for(var Ze=0;Ze<ot;Ze++)for(var ft=oe[Ze],ct=Number.MAX_VALUE,xi=void 0,$t=0;$t<U;$t++){var Dt=p(or[$t]-ft);Dt<ct&&(ct=Dt,xi=$t),Rt[xi]++,bt[Ze]=xi}for(var It=new Array(U),hi=0;hi<U;hi++)It[hi]=null;for(var Bt=0;Bt<ot;Bt++)gt=bt[Bt],It[gt]===null?It[gt]=oe[Bt]:It[gt]+=oe[Bt];for(var es=0;es<U;es++)It[es]*=1/Rt[es];Kt=!1;for(var ts=0;ts<U;ts++)if(It[ts]!==or[ts]){Kt=!0;break}or=It,Ai++,Ai>200&&(Kt=!1)}for(var $a={},vu=0;vu<U;vu++)$a[vu]=[];for(var ja=0;ja<ot;ja++)gt=bt[ja],$a[gt].push(oe[ja]);for(var Er=[],yt=0;yt<U;yt++)Er.push($a[yt][0]),Er.push($a[yt][$a[yt].length-1]);Er=Er.sort(function(wr,yu){return wr-yu}),ae.push(Er[0]);for(var kn=1;kn<Er.length;kn+=2){var Ni=Er[kn];!isNaN(Ni)&&ae.indexOf(Ni)===-1&&ae.push(Ni)}}return ae},b={analyze:T,limits:v},A=function(w,I){w=new L(w),I=new L(I);var U=w.luminance(),J=I.luminance();return U>J?(U+.05)/(J+.05):(J+.05)/(U+.05)},D=Math.sqrt,V=Math.atan2,X=Math.abs,se=Math.cos,ee=Math.PI,le=function(w,I,U,J){U===void 0&&(U=1),J===void 0&&(J=1),w=new L(w),I=new L(I);for(var ue=Array.from(w.lab()),oe=ue[0],ae=ue[1],fe=ue[2],pe=Array.from(I.lab()),Ne=pe[0],Le=pe[1],Pe=pe[2],He=D(ae*ae+fe*fe),je=D(Le*Le+Pe*Pe),tt=oe<16?.511:.040975*oe/(1+.01765*oe),gt=.0638*He/(1+.0131*He)+.638,ot=He<1e-6?0:V(fe,ae)*180/ee;ot<0;)ot+=360;for(;ot>=360;)ot-=360;var bt=ot>=164&&ot<=345?.56+X(.2*se(ee*(ot+168)/180)):.36+X(.4*se(ee*(ot+35)/180)),Rt=He*He*He*He,Kt=D(Rt/(Rt+1900)),Ai=gt*(Kt*bt+1-Kt),or=oe-Ne,vt=He-je,Oe=ae-Le,Ze=fe-Pe,ft=Oe*Oe+Ze*Ze-vt*vt,ct=or/(U*tt),xi=vt/(J*gt),$t=Ai;return D(ct*ct+xi*xi+ft/($t*$t))},Ce=function(w,I,U){U===void 0&&(U="lab"),w=new L(w),I=new L(I);var J=w.get(U),ue=I.get(U),oe=0;for(var ae in J){var fe=(J[ae]||0)-(ue[ae]||0);oe+=fe*fe}return Math.sqrt(oe)},Re=function(){for(var w=[],I=arguments.length;I--;)w[I]=arguments[I];try{return new(Function.prototype.bind.apply(L,[null].concat(w))),!0}catch{return!1}},Fe={cool:function(){return Ls([H.hsl(180,1,.9),H.hsl(250,.7,.4)])},hot:function(){return Ls(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Ie={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Ye=0,Gt=Object.keys(Ie);Ye<Gt.length;Ye+=1){var bi=Gt[Ye];Ie[bi.toLowerCase()]=Ie[bi]}var ar=Ie;H.average=wo,H.bezier=Ao,H.blend=Et,H.cubehelix=fu,H.mix=H.interpolate=Xn,H.random=No,H.scale=Ls,H.analyze=b.analyze,H.contrast=A,H.deltaE=le,H.distance=Ce,H.limits=b.limits,H.valid=Re,H.scales=Fe,H.colors=qn,H.brewer=ar;var Fa=H;return Fa}))})(Jc)),Jc.exports}var DE=NE();const IE=Ln(DE);function nT(s){const e=s.videoDuration||0;return new Array(Math.ceil(e)).fill(null).map((t,r)=>(s==null?void 0:s.heatMap[r])||0)}const PE="_heatMap_o1f0x_1",LE="_legend_o1f0x_2",sT={heatMap:PE,legend:LE},lv="shared.engagementHeatMap",OE="#f1f1f1",ME="#daf07d",RE="#08bd1a",BE=IE.scale([ME,RE]),jd=[0,.01,.25,.5,.75,1];function aT(s,e){return s?BE(s/e).hex():OE}function UE(s,e){const t=[];for(let r=0;r<s.length;r++){const i=r>0&&s[r-1],n=s[r],a=r<s.length-1&&s[r+1];n===i&&n===a||t.push(`${aT(n,e)} ${100/s.length*r}%`)}return`linear-gradient(to right, ${t.join(",")})`}function oT(){const s=Math.max(...jd),e=100/jd.length;return we.jsxs("div",{className:"d-flex justify-content-between w-100",children:[we.jsx(Jg,{namespace:lv,phrase:"less"}),we.jsx("div",{className:`d-flex mx-1 flex-grow-1 ${sT.legend}`,children:jd.map((t,r)=>we.jsx("div",{style:{width:`${e}%`,backgroundColor:aT(t,s)}},r))}),we.jsx(Jg,{namespace:lv,phrase:"more"})]})}function pm(s){const e=nT(s.engagement),t=s.max??Math.max(...e);return we.jsx("div",{className:`border rounded ${sT.heatMap} ${s.className??""}`,style:{background:UE(e,t)}})}const FE="_heatMap_1rrhv_1",$E="_avatarContainer_1rrhv_4",Hd={heatMap:FE,avatarContainer:$E},jE="shared.engagementTable",HE=Ks.encloseNamespace(jE),VE={heatMap:[],engagementRate:0,viewCount:0};function Wa(s){return we.jsx("div",{className:`${s.className??""}`,children:s.children})}function Io(s){return we.jsx(Wa,{className:`d-inline-block ${s.column.isSorted?"fw-bold":""}`,children:HE(s.phraseKey)})}function qE(s){let e=0;return s.forEach(t=>{const r=Math.max(...t.heatMap);r>e&&(e=r)}),e}function Ha(s,e){const r=np(s,e).split(" ").filter(i=>!!i);return{name:r[0],surname:r.slice(1).join(" ")}}function zE(s){return Ht.useMemo(()=>{const e=qE(s.engagement);return[...s.showSeparateNameColumns?[{id:"firstName",Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"firstName"}),accessor:"user",width:63,sortType:(r,i)=>{const{name:n}=Ha(r.values.firstName,s.anonymiseUsers),{name:a}=Ha(i.values.firstName,s.anonymiseUsers);return n>a?1:-1},Cell:({value:r})=>{var a;const{name:i,surname:n}=Ha(r,s.anonymiseUsers);return we.jsxs(Wa,{className:"d-flex align-items-center h-100",children:[we.jsx("span",{className:Hd.avatarContainer,children:we.jsx(Zg,{imageCdnUrl:s.imageCdnUrl,initials:ev.getInitials(i,n),imageUrl:!s.anonymiseUsers&&((a=r==null?void 0:r.avatar)==null?void 0:a.url),showAnonymousUser:!s.anonymiseUsers&&(!r||!!r.sessionId||!!r.deleted)})}),we.jsx("span",{className:"ms-2 clamp-1",children:i})]})}},{id:"surname",Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"surname"}),accessor:"user",width:68,sortType:(r,i)=>{const{surname:n}=Ha(r.values.surname,s.anonymiseUsers),{surname:a}=Ha(i.values.surname,s.anonymiseUsers);return n>a?1:-1},Cell:({value:r})=>{const{surname:i}=Ha(r,s.anonymiseUsers);return we.jsx(Wa,{className:"d-flex align-items-center h-100",children:we.jsx("span",{className:"clamp-1",children:i||""})})}}]:[{id:"name",Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"name"}),accessor:"user",width:22,sortType:(r,i)=>{const n=np(r.values.user,s.anonymiseUsers),a=np(i.values.user,s.anonymiseUsers);return n>a?1:-1},Cell:({value:r})=>{var a;const{name:i,surname:n}=Ha(r,s.anonymiseUsers);return we.jsxs(Wa,{className:"d-flex align-items-center h-100",children:[we.jsx("span",{className:Hd.avatarContainer,children:we.jsx(Zg,{imageCdnUrl:s.imageCdnUrl,initials:ev.getInitials(i,n),imageUrl:!s.anonymiseUsers&&((a=r==null?void 0:r.avatar)==null?void 0:a.url),showAnonymousUser:!s.anonymiseUsers&&(!r||!!r.sessionId||!!r.deleted)})}),we.jsxs("span",{className:"ms-2 clamp-1",children:[i," ",n]})]})}}],{Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"views"}),accessor:"viewCount",width:s.showSeparateNameColumns?47:15,sortType:"basic",sortDescFirst:!0,Cell:({value:r})=>we.jsx(Wa,{className:"d-flex align-items-center h-100",children:we.jsx("div",{children:r})})},{Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"engagement"}),accessor:"engagementRate",width:s.showSeparateNameColumns?79:20,sortDescFirst:!0,Cell:({value:r})=>we.jsx(Wa,{className:"w-33",children:we.jsx(vE,{percentage:r,layout:yE.LabelBefore})})},{Header:({column:r})=>we.jsx(Io,{column:r,phraseKey:"heatMap"}),accessor:"heatMap",width:s.showSeparateNameColumns?230:48,disableSortBy:!0,Cell:({row:{original:r}})=>we.jsx(Wa,{className:"d-flex align-items-center h-100",children:we.jsx(pm,{engagement:r,max:e,className:`${Hd.heatMap} flex-grow-1`})})}]},[s.anonymiseUsers,s.showSeparateNameColumns])}function WE(s,e,t){return Ht.useMemo(()=>{const r=[],i=new Set;if(s==null||s.forEach(n=>{const a=e==null?void 0:e.find(o=>o.id&&o.id===n.userId?(i.add(o.id),!0):!!(o.sessionId&&o.sessionId===n.sessionId));r.push({...n,user:a})}),t!=null&&t.length){const n=t.filter(a=>!i.has(a.id)).map(a=>({...VE,user:a}));r.push(...n)}return r},[s==null?void 0:s.length,e==null?void 0:e.length,t==null?void 0:t.length])}const Vd={table:"bg-white rounded px-0",header:"border-bottom",headerCell:"m-3",cell:"mx-3 my-2"};function N9(s){const e=zE({engagement:s.engagement,imageCdnUrl:s.imageCdnUrl,anonymiseUsers:s.anonymiseUsers,showSeparateNameColumns:s.showSeparateNameColumns}),t=WE(s.engagement,s.users,s.classroomStudents);return t.length?we.jsx(gE,{columns:e,data:t,theme:{...Vd,table:s.border?`${Vd.table} border`:Vd.table},enableSort:s.enableSort}):we.jsx(we.Fragment,{})}var GE=(s=>(s.Share="share",s.MasterObject="masterobject",s))(GE||{});const D9={createViewKey(s,e,t,r,i){const n={mediaId:s.toString(),mediaIdType:e};return t&&(n.shareContextId=t),{url:"/api/player/create-view-key",key:`view:key:${s}:${e}`,type:KC.POST,data:n,cacheDuration:28800,success:r,error:i}}},KE="_playerContainer_1sqm3_1",XE="_playerPlaceholder_1sqm3_8",YE="_heatMap_1sqm3_12",QE="_heatMapTimepointIndicator_1sqm3_15",JE="_heatMapTimepointIndicatorVisible_1sqm3_24",Us={playerContainer:KE,playerPlaceholder:XE,heatMap:YE,heatMapTimepointIndicator:QE,heatMapTimepointIndicatorVisible:JE},ZE="shared.videoEngagementOverlay",ew=Ks.encloseNamespace(ZE);function I9(s){return we.jsxs("div",{className:`bg-white rounded p-2 ${Us.partialLoadingContainer}`,children:[s.hasHeading&&we.jsx("div",{className:"partial-loading-background w-25 mb-3",children:" "}),we.jsx("div",{className:"ratio ratio-16x9 partial-loading-background mb-2"}),we.jsxs("div",{className:"d-flex flex-column justify-content-end",children:[we.jsx("div",{className:Us.heatMapContainer,children:we.jsx("div",{className:"position-relative",children:we.jsx(pm,{engagement:{heatMap:[],videoDuration:0},className:Us.heatMap})})}),we.jsxs("div",{className:"d-flex justify-content-between mt-2",children:[we.jsx("strong",{children:!s.hasHeading&&ew("engagement")}),we.jsx("div",{className:"w-33",children:we.jsx(oT,{})})]})]})]})}var qd,uv;function Al(){if(uv)return qd;uv=1;var s;return typeof window<"u"?s=window:typeof globalThis<"u"?s=globalThis:typeof self<"u"?s=self:s={},qd=s,qd}var tw=Al();const N=Ln(tw),iw={},rw=Object.freeze(Object.defineProperty({__proto__:null,default:iw},Symbol.toStringTag,{value:"Module"})),nw=XC(rw);var zd,cv;function lT(){if(cv)return zd;cv=1;var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},e=nw,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),zd=t,zd}var sw=lT();const de=Ln(sw);var xc={exports:{}},Wd,hv;function uT(){if(hv)return Wd;hv=1,Wd=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var r=s.call(t);return r==="[object Function]"||typeof t=="function"&&r!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return Wd}var Gd,dv;function aw(){if(dv)return Gd;dv=1;function s(i,n){var a=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(a)return(a=a.call(i)).next.bind(a);if(Array.isArray(i)||(a=e(i))||n){a&&(i=a);var o=0;return function(){return o>=i.length?{done:!0}:{done:!1,value:i[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
57
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,n){if(i){if(typeof i=="string")return t(i,n);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(i);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(i,n)}}function t(i,n){(n==null||n>i.length)&&(n=i.length);for(var a=0,o=new Array(n);a<n;a++)o[a]=i[a];return o}var r=(function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=i.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(o,l){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(l)?!1:(u.add(l),!0)},n.removeInterceptor=function(o,l){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(l)?(u.delete(l),!0):!1},n.clearInterceptorsByType=function(o){var l=this.typeToInterceptorsMap_.get(o);return l?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},n.execute=function(o,l){for(var u=this.getForType(o),c=s(u),d;!(d=c()).done;){var f=d.value;try{l=f(l)}catch{}}return l},i})();return Gd=r,Gd}var Kd,fv;function ow(){if(fv)return Kd;fv=1;var s=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var r=t.prototype;return r.getIsEnabled=function(){return this.enabled_},r.enable=function(){this.enabled_=!0},r.disable=function(){this.enabled_=!1},r.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},r.getMaxAttempts=function(){return this.maxAttempts_},r.setMaxAttempts=function(n){this.maxAttempts_=n},r.getDelayFactor=function(){return this.delayFactor_},r.setDelayFactor=function(n){this.delayFactor_=n},r.getFuzzFactor=function(){return this.fuzzFactor_},r.setFuzzFactor=function(n){this.fuzzFactor_=n},r.getInitialDelay=function(){return this.initialDelay_},r.setInitialDelay=function(n){this.initialDelay_=n},r.createRetry=function(n){var a=n===void 0?{}:n,o=a.maxAttempts,l=a.delayFactor,u=a.fuzzFactor,c=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},t})(),e=(function(){function t(i){this.maxAttempts_=i.maxAttempts,this.delayFactor_=i.delayFactor,this.fuzzFactor_=i.fuzzFactor,this.currentDelay_=i.initialDelay,this.currentAttempt_=1}var r=t.prototype;return r.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},r.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},r.getCurrentDelay=function(){return this.currentDelay_},r.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},r.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},r.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t})();return Kd=s,Kd}var Xd,pv;function lw(){if(pv)return Xd;pv=1;var s=Al(),e=function(i,n){return n===void 0&&(n=!1),function(a,o,l){if(a){i(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function t(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(i,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():i},"utf-8")}return Xd=e,Xd}var mv;function uw(){if(mv)return xc.exports;mv=1;var s=Al(),e=tT(),t=uT(),r=aw(),i=ow();u.httpHandler=lw(),u.requestInterceptorsStorage=new r,u.responseInterceptorsStorage=new r,u.retryManager=new i;/**
|
|
58
|
+
* @license
|
|
59
|
+
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
60
|
+
* Copyright (c) 2014 David Björklund
|
|
61
|
+
* Available under the MIT license
|
|
62
|
+
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
|
63
|
+
*/var n=function(E){var S={};return E&&E.trim().split(`
|
|
64
|
+
`).forEach(function(k){var F=k.indexOf(":"),L=k.slice(0,F).trim().toLowerCase(),W=k.slice(F+1).trim();typeof S[L]>"u"?S[L]=W:Array.isArray(S[L])?S[L].push(W):S[L]=[S[L],W]}),S};xc.exports=u,xc.exports.default=u,u.XMLHttpRequest=s.XMLHttpRequest||f,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(g){u[g==="delete"?"del":g]=function(E,S,k){return S=l(E,S,k),S.method=g.toUpperCase(),c(S)}});function a(g,E){for(var S=0;S<g.length;S++)E(g[S])}function o(g){for(var E in g)if(g.hasOwnProperty(E))return!1;return!0}function l(g,E,S){var k=g;return t(E)?(S=E,typeof g=="string"&&(k={uri:g})):k=e({},E,{uri:g}),k.callback=S,k}function u(g,E,S){return E=l(g,E,S),c(E)}function c(g){if(typeof g.callback>"u")throw new Error("callback argument missing");if(g.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var E={uri:g.uri||g.url,headers:g.headers||{},body:g.body,metadata:g.metadata||{},retry:g.retry,timeout:g.timeout},S=u.requestInterceptorsStorage.execute(g.requestType,E);g.uri=S.uri,g.headers=S.headers,g.body=S.body,g.metadata=S.metadata,g.retry=S.retry,g.timeout=S.timeout}var k=!1,F=function(Te,ye,_e){k||(k=!0,g.callback(Te,ye,_e))};function L(){G.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout($,0)}function W(){var ve=void 0;if(G.response?ve=G.response:ve=G.responseText||d(G),me)try{ve=JSON.parse(ve)}catch{}return ve}function H(ve){if(clearTimeout(Se),clearTimeout(g.retryTimeout),ve instanceof Error||(ve=new Error(""+(ve||"Unknown XMLHttpRequest Error"))),ve.statusCode=0,!Y&&u.retryManager.getIsEnabled()&&g.retry&&g.retry.shouldRetry()){g.retryTimeout=setTimeout(function(){g.retry.moveToNextAttempt(),g.xhr=G,c(g)},g.retry.getCurrentFuzzedDelay());return}if(g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var Te={headers:Ae.headers||{},body:Ae.body,responseUrl:G.responseURL,responseType:G.responseType},ye=u.responseInterceptorsStorage.execute(g.requestType,Te);Ae.body=ye.body,Ae.headers=ye.headers}return F(ve,Ae)}function $(){if(!Y){var ve;clearTimeout(Se),clearTimeout(g.retryTimeout),g.useXDR&&G.status===void 0?ve=200:ve=G.status===1223?204:G.status;var Te=Ae,ye=null;if(ve!==0?(Te={body:W(),statusCode:ve,method:O,headers:{},url:P,rawRequest:G},G.getAllResponseHeaders&&(Te.headers=n(G.getAllResponseHeaders()))):ye=new Error("Internal XMLHttpRequest Error"),g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var _e={headers:Te.headers||{},body:Te.body,responseUrl:G.responseURL,responseType:G.responseType},xe=u.responseInterceptorsStorage.execute(g.requestType,_e);Te.body=xe.body,Te.headers=xe.headers}return F(ye,Te,Te.body)}}var G=g.xhr||null;G||(g.cors||g.useXDR?G=new u.XDomainRequest:G=new u.XMLHttpRequest);var K,Y,P=G.url=g.uri||g.url,O=G.method=g.method||"GET",ne=g.body||g.data,te=G.headers=g.headers||{},re=!!g.sync,me=!1,Se,Ae={body:void 0,headers:{},statusCode:0,method:O,url:P,rawRequest:G};if("json"in g&&g.json!==!1&&(me=!0,te.accept||te.Accept||(te.Accept="application/json"),O!=="GET"&&O!=="HEAD"&&(te["content-type"]||te["Content-Type"]||(te["Content-Type"]="application/json"),ne=JSON.stringify(g.json===!0?ne:g.json))),G.onreadystatechange=L,G.onload=$,G.onerror=H,G.onprogress=function(){},G.onabort=function(){Y=!0,clearTimeout(g.retryTimeout)},G.ontimeout=H,G.open(O,P,!re,g.username,g.password),re||(G.withCredentials=!!g.withCredentials),!re&&g.timeout>0&&(Se=setTimeout(function(){if(!Y){Y=!0,G.abort("timeout");var ve=new Error("XMLHttpRequest timeout");ve.code="ETIMEDOUT",H(ve)}},g.timeout)),G.setRequestHeader)for(K in te)te.hasOwnProperty(K)&&G.setRequestHeader(K,te[K]);else if(g.headers&&!o(g.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in g&&(G.responseType=g.responseType),"beforeSend"in g&&typeof g.beforeSend=="function"&&g.beforeSend(G),G.send(ne||null),G}function d(g){try{if(g.responseType==="document")return g.responseXML;var E=g.responseXML&&g.responseXML.documentElement.nodeName==="parsererror";if(g.responseType===""&&!E)return g.responseXML}catch{}return null}function f(){}return xc.exports}var cw=uw();const cT=Ln(cw);var Yd={exports:{}},Qd,gv;function hw(){if(gv)return Qd;gv=1;var s=lT(),e=Object.create||(function(){function P(){}return function(O){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return P.prototype=O,new P}})();function t(P,O){this.name="ParsingError",this.code=P.code,this.message=O||P.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function r(P){function O(te,re,me,Se){return(te|0)*3600+(re|0)*60+(me|0)+(Se|0)/1e3}var ne=P.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return ne?ne[3]?O(ne[1],ne[2],ne[3].replace(":",""),ne[4]):ne[1]>59?O(ne[1],ne[2],0,ne[4]):O(0,ne[1],ne[2],ne[4]):null}function i(){this.values=e(null)}i.prototype={set:function(P,O){!this.get(P)&&O!==""&&(this.values[P]=O)},get:function(P,O,ne){return ne?this.has(P)?this.values[P]:O[ne]:this.has(P)?this.values[P]:O},has:function(P){return P in this.values},alt:function(P,O,ne){for(var te=0;te<ne.length;++te)if(O===ne[te]){this.set(P,O);break}},integer:function(P,O){/^-?\d+$/.test(O)&&this.set(P,parseInt(O,10))},percent:function(P,O){return O.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(O=parseFloat(O),O>=0&&O<=100)?(this.set(P,O),!0):!1}};function n(P,O,ne,te){var re=te?P.split(te):[P];for(var me in re)if(typeof re[me]=="string"){var Se=re[me].split(ne);if(Se.length===2){var Ae=Se[0].trim(),ve=Se[1].trim();O(Ae,ve)}}}function a(P,O,ne){var te=P;function re(){var Ae=r(P);if(Ae===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+te);return P=P.replace(/^[^\sa-zA-Z-]+/,""),Ae}function me(Ae,ve){var Te=new i;n(Ae,function(ye,_e){switch(ye){case"region":for(var xe=ne.length-1;xe>=0;xe--)if(ne[xe].id===_e){Te.set(ye,ne[xe].region);break}break;case"vertical":Te.alt(ye,_e,["rl","lr"]);break;case"line":var qe=_e.split(","),We=qe[0];Te.integer(ye,We),Te.percent(ye,We)&&Te.set("snapToLines",!1),Te.alt(ye,We,["auto"]),qe.length===2&&Te.alt("lineAlign",qe[1],["start","center","end"]);break;case"position":qe=_e.split(","),Te.percent(ye,qe[0]),qe.length===2&&Te.alt("positionAlign",qe[1],["start","center","end"]);break;case"size":Te.percent(ye,_e);break;case"align":Te.alt(ye,_e,["start","center","end","left","right"]);break}},/:/,/\s/),ve.region=Te.get("region",null),ve.vertical=Te.get("vertical","");try{ve.line=Te.get("line","auto")}catch{}ve.lineAlign=Te.get("lineAlign","start"),ve.snapToLines=Te.get("snapToLines",!0),ve.size=Te.get("size",100);try{ve.align=Te.get("align","center")}catch{ve.align=Te.get("align","middle")}try{ve.position=Te.get("position","auto")}catch{ve.position=Te.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},ve.align)}ve.positionAlign=Te.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},ve.align)}function Se(){P=P.replace(/^\s+/,"")}if(Se(),O.startTime=re(),Se(),P.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+te);P=P.substr(3),Se(),O.endTime=re(),Se(),me(P,O)}var o=s.createElement&&s.createElement("textarea"),l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={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)"},c={v:"title",lang:"lang"},d={rt:"ruby"};function f(P,O){function ne(){if(!O)return null;function We(ze){return O=O.substr(ze.length),ze}var Ke=O.match(/^([^<]*)(<[^>]*>?)?/);return We(Ke[1]?Ke[1]:Ke[2])}function te(We){return o.innerHTML=We,We=o.textContent,o.textContent="",We}function re(We,Ke){return!d[Ke.localName]||d[Ke.localName]===We.localName}function me(We,Ke){var ze=l[We];if(!ze)return null;var xt=P.document.createElement(ze),Qt=c[We];return Qt&&Ke&&(xt[Qt]=Ke.trim()),xt}for(var Se=P.document.createElement("div"),Ae=Se,ve,Te=[];(ve=ne())!==null;){if(ve[0]==="<"){if(ve[1]==="/"){Te.length&&Te[Te.length-1]===ve.substr(2).replace(">","")&&(Te.pop(),Ae=Ae.parentNode);continue}var ye=r(ve.substr(1,ve.length-2)),_e;if(ye){_e=P.document.createProcessingInstruction("timestamp",ye),Ae.appendChild(_e);continue}var xe=ve.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!xe||(_e=me(xe[1],xe[3]),!_e)||!re(Ae,_e))continue;if(xe[2]){var qe=xe[2].split(".");qe.forEach(function(We){var Ke=/^bg_/.test(We),ze=Ke?We.slice(3):We;if(u.hasOwnProperty(ze)){var xt=Ke?"background-color":"color",Qt=u[ze];_e.style[xt]=Qt}}),_e.className=qe.join(" ")}Te.push(xe[1]),Ae.appendChild(_e),Ae=_e;continue}Ae.appendChild(P.document.createTextNode(te(ve)))}return Se}var g=[[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 E(P){for(var O=0;O<g.length;O++){var ne=g[O];if(P>=ne[0]&&P<=ne[1])return!0}return!1}function S(P){var O=[],ne="",te;if(!P||!P.childNodes)return"ltr";function re(Ae,ve){for(var Te=ve.childNodes.length-1;Te>=0;Te--)Ae.push(ve.childNodes[Te])}function me(Ae){if(!Ae||!Ae.length)return null;var ve=Ae.pop(),Te=ve.textContent||ve.innerText;if(Te){var ye=Te.match(/^.*(\n|\r)/);return ye?(Ae.length=0,ye[0]):Te}if(ve.tagName==="ruby")return me(Ae);if(ve.childNodes)return re(Ae,ve),me(Ae)}for(re(O,P);ne=me(O);)for(var Se=0;Se<ne.length;Se++)if(te=ne.charCodeAt(Se),E(te))return"rtl";return"ltr"}function k(P){if(typeof P.line=="number"&&(P.snapToLines||P.line>=0&&P.line<=100))return P.line;if(!P.track||!P.track.textTrackList||!P.track.textTrackList.mediaElement)return-1;for(var O=P.track,ne=O.textTrackList,te=0,re=0;re<ne.length&&ne[re]!==O;re++)ne[re].mode==="showing"&&te++;return++te*-1}function F(){}F.prototype.applyStyles=function(P,O){O=O||this.div;for(var ne in P)P.hasOwnProperty(ne)&&(O.style[ne]=P[ne])},F.prototype.formatStyle=function(P,O){return P===0?0:P+O};function L(P,O,ne){F.call(this),this.cue=O,this.cueDiv=f(P,O.text);var te={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:O.vertical===""?"horizontal-tb":O.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(te,this.cueDiv),this.div=P.document.createElement("div"),te={direction:S(this.cueDiv),writingMode:O.vertical===""?"horizontal-tb":O.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:O.align==="middle"?"center":O.align,font:ne.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(te),this.div.appendChild(this.cueDiv);var re=0;switch(O.positionAlign){case"start":case"line-left":re=O.position;break;case"center":re=O.position-O.size/2;break;case"end":case"line-right":re=O.position-O.size;break}O.vertical===""?this.applyStyles({left:this.formatStyle(re,"%"),width:this.formatStyle(O.size,"%")}):this.applyStyles({top:this.formatStyle(re,"%"),height:this.formatStyle(O.size,"%")}),this.move=function(me){this.applyStyles({top:this.formatStyle(me.top,"px"),bottom:this.formatStyle(me.bottom,"px"),left:this.formatStyle(me.left,"px"),right:this.formatStyle(me.right,"px"),height:this.formatStyle(me.height,"px"),width:this.formatStyle(me.width,"px")})}}L.prototype=e(F.prototype),L.prototype.constructor=L;function W(P){var O,ne,te,re;if(P.div){ne=P.div.offsetHeight,te=P.div.offsetWidth,re=P.div.offsetTop;var me=(me=P.div.childNodes)&&(me=me[0])&&me.getClientRects&&me.getClientRects();P=P.div.getBoundingClientRect(),O=me?Math.max(me[0]&&me[0].height||0,P.height/me.length):0}this.left=P.left,this.right=P.right,this.top=P.top||re,this.height=P.height||ne,this.bottom=P.bottom||re+(P.height||ne),this.width=P.width||te,this.lineHeight=O!==void 0?O:P.lineHeight}W.prototype.move=function(P,O){switch(O=O!==void 0?O:this.lineHeight,P){case"+x":this.left+=O,this.right+=O;break;case"-x":this.left-=O,this.right-=O;break;case"+y":this.top+=O,this.bottom+=O;break;case"-y":this.top-=O,this.bottom-=O;break}},W.prototype.overlaps=function(P){return this.left<P.right&&this.right>P.left&&this.top<P.bottom&&this.bottom>P.top},W.prototype.overlapsAny=function(P){for(var O=0;O<P.length;O++)if(this.overlaps(P[O]))return!0;return!1},W.prototype.within=function(P){return this.top>=P.top&&this.bottom<=P.bottom&&this.left>=P.left&&this.right<=P.right},W.prototype.overlapsOppositeAxis=function(P,O){switch(O){case"+x":return this.left<P.left;case"-x":return this.right>P.right;case"+y":return this.top<P.top;case"-y":return this.bottom>P.bottom}},W.prototype.intersectPercentage=function(P){var O=Math.max(0,Math.min(this.right,P.right)-Math.max(this.left,P.left)),ne=Math.max(0,Math.min(this.bottom,P.bottom)-Math.max(this.top,P.top)),te=O*ne;return te/(this.height*this.width)},W.prototype.toCSSCompatValues=function(P){return{top:this.top-P.top,bottom:P.bottom-this.bottom,left:this.left-P.left,right:P.right-this.right,height:this.height,width:this.width}},W.getSimpleBoxPosition=function(P){var O=P.div?P.div.offsetHeight:P.tagName?P.offsetHeight:0,ne=P.div?P.div.offsetWidth:P.tagName?P.offsetWidth:0,te=P.div?P.div.offsetTop:P.tagName?P.offsetTop:0;P=P.div?P.div.getBoundingClientRect():P.tagName?P.getBoundingClientRect():P;var re={left:P.left,right:P.right,top:P.top||te,height:P.height||O,bottom:P.bottom||te+(P.height||O),width:P.width||ne};return re};function H(P,O,ne,te){function re(ze,xt){for(var Qt,wt=new W(ze),Jt=1,Ii=0;Ii<xt.length;Ii++){for(;ze.overlapsOppositeAxis(ne,xt[Ii])||ze.within(ne)&&ze.overlapsAny(te);)ze.move(xt[Ii]);if(ze.within(ne))return ze;var oi=ze.intersectPercentage(ne);Jt>oi&&(Qt=new W(ze),Jt=oi),ze=new W(wt)}return Qt||wt}var me=new W(O),Se=O.cue,Ae=k(Se),ve=[];if(Se.snapToLines){var Te;switch(Se.vertical){case"":ve=["+y","-y"],Te="height";break;case"rl":ve=["+x","-x"],Te="width";break;case"lr":ve=["-x","+x"],Te="width";break}var ye=me.lineHeight,_e=ye*Math.round(Ae),xe=ne[Te]+ye,qe=ve[0];Math.abs(_e)>xe&&(_e=_e<0?-1:1,_e*=Math.ceil(xe/ye)*ye),Ae<0&&(_e+=Se.vertical===""?ne.height:ne.width,ve=ve.reverse()),me.move(qe,_e)}else{var We=me.lineHeight/ne.height*100;switch(Se.lineAlign){case"center":Ae-=We/2;break;case"end":Ae-=We;break}switch(Se.vertical){case"":O.applyStyles({top:O.formatStyle(Ae,"%")});break;case"rl":O.applyStyles({left:O.formatStyle(Ae,"%")});break;case"lr":O.applyStyles({right:O.formatStyle(Ae,"%")});break}ve=["+y","-x","+x","-y"],me=new W(O)}var Ke=re(me,ve);O.move(Ke.toCSSCompatValues(ne))}function $(){}$.StringDecoder=function(){return{decode:function(P){if(!P)return"";if(typeof P!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(P))}}},$.convertCueToDOMTree=function(P,O){return!P||!O?null:f(P,O)};var G=.05,K="sans-serif",Y="1.5%";return $.processCues=function(P,O,ne){if(!P||!O||!ne)return null;for(;ne.firstChild;)ne.removeChild(ne.firstChild);var te=P.document.createElement("div");te.style.position="absolute",te.style.left="0",te.style.right="0",te.style.top="0",te.style.bottom="0",te.style.margin=Y,ne.appendChild(te);function re(ye){for(var _e=0;_e<ye.length;_e++)if(ye[_e].hasBeenReset||!ye[_e].displayState)return!0;return!1}if(!re(O)){for(var me=0;me<O.length;me++)te.appendChild(O[me].displayState);return}var Se=[],Ae=W.getSimpleBoxPosition(te),ve=Math.round(Ae.height*G*100)/100,Te={font:ve+"px "+K};(function(){for(var ye,_e,xe=0;xe<O.length;xe++)_e=O[xe],ye=new L(P,_e,Te),te.appendChild(ye.div),H(P,ye,Ae,Se),_e.displayState=ye.div,Se.push(W.getSimpleBoxPosition(ye))})()},$.Parser=function(P,O,ne){ne||(ne=O,O={}),O||(O={}),this.window=P,this.vttjs=O,this.state="INITIAL",this.buffer="",this.decoder=ne||new TextDecoder("utf8"),this.regionList=[]},$.Parser.prototype={reportOrThrowError:function(P){if(P instanceof t)this.onparsingerror&&this.onparsingerror(P);else throw P},parse:function(P){var O=this;P&&(O.buffer+=O.decoder.decode(P,{stream:!0}));function ne(){for(var ye=O.buffer,_e=0;_e<ye.length&&ye[_e]!=="\r"&&ye[_e]!==`
|
|
65
|
+
`;)++_e;var xe=ye.substr(0,_e);return ye[_e]==="\r"&&++_e,ye[_e]===`
|
|
66
|
+
`&&++_e,O.buffer=ye.substr(_e),xe}function te(ye){var _e=new i;if(n(ye,function(qe,We){switch(qe){case"id":_e.set(qe,We);break;case"width":_e.percent(qe,We);break;case"lines":_e.integer(qe,We);break;case"regionanchor":case"viewportanchor":var Ke=We.split(",");if(Ke.length!==2)break;var ze=new i;if(ze.percent("x",Ke[0]),ze.percent("y",Ke[1]),!ze.has("x")||!ze.has("y"))break;_e.set(qe+"X",ze.get("x")),_e.set(qe+"Y",ze.get("y"));break;case"scroll":_e.alt(qe,We,["up"]);break}},/=/,/\s/),_e.has("id")){var xe=new(O.vttjs.VTTRegion||O.window.VTTRegion);xe.width=_e.get("width",100),xe.lines=_e.get("lines",3),xe.regionAnchorX=_e.get("regionanchorX",0),xe.regionAnchorY=_e.get("regionanchorY",100),xe.viewportAnchorX=_e.get("viewportanchorX",0),xe.viewportAnchorY=_e.get("viewportanchorY",100),xe.scroll=_e.get("scroll",""),O.onregion&&O.onregion(xe),O.regionList.push({id:_e.get("id"),region:xe})}}function re(ye){var _e=new i;n(ye,function(xe,qe){switch(xe){case"MPEGT":_e.integer(xe+"S",qe);break;case"LOCA":_e.set(xe+"L",r(qe));break}},/[^\d]:/,/,/),O.ontimestampmap&&O.ontimestampmap({MPEGTS:_e.get("MPEGTS"),LOCAL:_e.get("LOCAL")})}function me(ye){ye.match(/X-TIMESTAMP-MAP/)?n(ye,function(_e,xe){switch(_e){case"X-TIMESTAMP-MAP":re(xe);break}},/=/):n(ye,function(_e,xe){switch(_e){case"Region":te(xe);break}},/:/)}try{var Se;if(O.state==="INITIAL"){if(!/\r\n|\n/.test(O.buffer))return this;Se=ne();var Ae=Se.match(/^WEBVTT([ \t].*)?$/);if(!Ae||!Ae[0])throw new t(t.Errors.BadSignature);O.state="HEADER"}for(var ve=!1;O.buffer;){if(!/\r\n|\n/.test(O.buffer))return this;switch(ve?ve=!1:Se=ne(),O.state){case"HEADER":/:/.test(Se)?me(Se):Se||(O.state="ID");continue;case"NOTE":Se||(O.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(Se)){O.state="NOTE";break}if(!Se)continue;O.cue=new(O.vttjs.VTTCue||O.window.VTTCue)(0,0,"");try{O.cue.align="center"}catch{O.cue.align="middle"}if(O.state="CUE",Se.indexOf("-->")===-1){O.cue.id=Se;continue}case"CUE":try{a(Se,O.cue,O.regionList)}catch(ye){O.reportOrThrowError(ye),O.cue=null,O.state="BADCUE";continue}O.state="CUETEXT";continue;case"CUETEXT":var Te=Se.indexOf("-->")!==-1;if(!Se||Te&&(ve=!0)){O.oncue&&O.oncue(O.cue),O.cue=null,O.state="ID";continue}O.cue.text&&(O.cue.text+=`
|
|
67
|
+
`),O.cue.text+=Se.replace(/\u2028/g,`
|
|
68
|
+
`).replace(/u2029/g,`
|
|
69
|
+
`);continue;case"BADCUE":Se||(O.state="ID");continue}}}catch(ye){O.reportOrThrowError(ye),O.state==="CUETEXT"&&O.cue&&O.oncue&&O.oncue(O.cue),O.cue=null,O.state=O.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var P=this;try{if(P.buffer+=P.decoder.decode(),(P.cue||P.state==="HEADER")&&(P.buffer+=`
|
|
70
|
+
|
|
71
|
+
`,P.parse()),P.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(O){P.reportOrThrowError(O)}return P.onflush&&P.onflush(),this}},Qd=$,Qd}var Jd,vv;function dw(){if(vv)return Jd;vv=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function i(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function n(a,o,l){this.hasBeenReset=!1;var u="",c=!1,d=a,f=o,g=l,E=null,S="",k=!0,F="auto",L="start",W="auto",H="auto",$=100,G="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(K){u=""+K}},pauseOnExit:{enumerable:!0,get:function(){return c},set:function(K){c=!!K}},startTime:{enumerable:!0,get:function(){return d},set:function(K){if(typeof K!="number")throw new TypeError("Start time must be set to a number.");d=K,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return f},set:function(K){if(typeof K!="number")throw new TypeError("End time must be set to a number.");f=K,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return g},set:function(K){g=""+K,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return E},set:function(K){E=K,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return S},set:function(K){var Y=r(K);if(Y===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");S=Y,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return k},set:function(K){k=!!K,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return F},set:function(K){if(typeof K!="number"&&K!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");F=K,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return L},set:function(K){var Y=i(K);Y?(L=Y,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return W},set:function(K){if(K<0||K>100)throw new Error("Position must be between 0 and 100.");W=K,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return H},set:function(K){var Y=i(K);Y?(H=Y,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return $},set:function(K){if(K<0||K>100)throw new Error("Size must be between 0 and 100.");$=K,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return G},set:function(K){var Y=i(K);if(!Y)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");G=Y,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Jd=n,Jd}var Zd,yv;function fw(){if(yv)return Zd;yv=1;var s={"":!0,up:!0};function e(i){if(typeof i!="string")return!1;var n=s[i.toLowerCase()];return n?i.toLowerCase():!1}function t(i){return typeof i=="number"&&i>=0&&i<=100}function r(){var i=100,n=3,a=0,o=100,l=0,u=100,c="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(d){if(!t(d))throw new Error("Width must be between 0 and 100.");i=d}},lines:{enumerable:!0,get:function(){return n},set:function(d){if(typeof d!="number")throw new TypeError("Lines must be set to a number.");n=d}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(d){if(!t(d))throw new Error("RegionAnchorX must be between 0 and 100.");o=d}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(d){if(!t(d))throw new Error("RegionAnchorY must be between 0 and 100.");a=d}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(d){if(!t(d))throw new Error("ViewportAnchorY must be between 0 and 100.");u=d}},viewportAnchorX:{enumerable:!0,get:function(){return l},set:function(d){if(!t(d))throw new Error("ViewportAnchorX must be between 0 and 100.");l=d}},scroll:{enumerable:!0,get:function(){return c},set:function(d){var f=e(d);f===!1?console.warn("Scroll: an invalid or illegal string was specified."):c=f}}})}return Zd=r,Zd}var _v;function pw(){if(_v)return Yd.exports;_v=1;var s=Al(),e=Yd.exports={WebVTT:hw(),VTTCue:dw(),VTTRegion:fw()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,r=e.VTTRegion,i=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=r},e.restore=function(){s.VTTCue=i,s.VTTRegion=n},s.VTTCue||e.shim(),Yd.exports}var mw=pw();const ll=Ln(mw);var Tv="https://example.com",sd=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=N.location&&N.location.href||"");var r=/^\/\//.test(e),i=!N.location&&!/\/\//i.test(e);e=new N.URL(e,N.location||Tv);var n=new URL(t,e);return i?n.href.slice(Tv.length):r?n.href.slice(n.protocol.length):n.href},mm=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(r,i){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(i)},e.off=function(r,i){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(i);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var i=this.listeners[r];if(i)if(arguments.length===2)for(var n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=i.length,u=0;u<l;++u)i[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(i){r.push(i)})},s})(),gw=function(e){return N.atob?N.atob(e):Buffer.from(e,"base64").toString("binary")};function hT(s){for(var e=gw(s),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */let vw=class extends mm{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
|
|
72
|
+
`);t>-1;t=this.buffer.indexOf(`
|
|
73
|
+
`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}};const yw=" ",ef=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},_w=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},lr=function(s){const e={};if(!s)return e;const t=s.split(_w());let r=t.length,i;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},bv=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};let Tw=class extends mm{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,r;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 o=a(e);return o===e?n:n.concat([o])},[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){r={type:"tag",tagType:"inf"},t[1]&&(r.duration=parseFloat(t[1])),t[2]&&(r.title=t[2]),this.trigger("data",r);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"targetduration"},t[1]&&(r.duration=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"version"},t[1]&&(r.version=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"media-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){r={type:"tag",tagType:"playlist-type"},t[1]&&(r.playlistType=t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){r=jt(ef(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",r);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){r={type:"tag",tagType:"allow-cache"},t[1]&&(r.allowed=!/NO/.test(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(r={type:"tag",tagType:"map"},t[1]){const a=lr(t[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=ef(a.BYTERANGE))}this.trigger("data",r);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"stream-inf"},t[1]&&(r.attributes=lr(t[1]),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=bv(r.attributes.RESOLUTION)),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){r={type:"tag",tagType:"media"},t[1]&&(r.attributes=lr(t[1])),this.trigger("data",r);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){r={type:"tag",tagType:"program-date-time"},t[1]&&(r.dateTimeString=t[1],r.dateTimeObject=new Date(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){r={type:"tag",tagType:"key"},t[1]&&(r.attributes=lr(t[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),this.trigger("data",r);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){r={type:"tag",tagType:"start"},t[1]&&(r.attributes=lr(t[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out-cont"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-in"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"skip"},r.attributes=lr(t[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(yw)),this.trigger("data",r);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part"},r.attributes=lr(t[1]),["DURATION"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=ef(r.attributes.BYTERANGE)),this.trigger("data",r);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"server-control"},r.attributes=lr(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part-inf"},r.attributes=lr(t[1]),["PART-TARGET"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"preload-hint"},r.attributes=lr(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(r.attributes.hasOwnProperty(a)){r.attributes[a]=parseInt(r.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[o]=r.attributes[a],delete r.attributes[a]}}),this.trigger("data",r);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"rendition-report"},r.attributes=lr(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseInt(r.attributes[a],10))}),this.trigger("data",r);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"daterange"},r.attributes=lr(t[1]),["ID","CLASS"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=String(r.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=new Date(r.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=parseFloat(r.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=/YES/i.test(r.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=r.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in r.attributes){if(!a.test(o))continue;const l=/[0-9A-Fa-f]{6}/g.test(r.attributes[o]),u=/^\d+(\.\d+)?$/.test(r.attributes[o]);r.attributes[o]=l?r.attributes[o].toString(16):u?parseFloat(r.attributes[o]):String(r.attributes[o])}this.trigger("data",r);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){r={type:"tag",tagType:"content-steering"},r.attributes=lr(t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"i-frame-playlist"},r.attributes=lr(t[1]),r.attributes.URI&&(r.uri=r.attributes.URI),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=bv(r.attributes.RESOLUTION)),r.attributes["AVERAGE-BANDWIDTH"]&&(r.attributes["AVERAGE-BANDWIDTH"]=parseInt(r.attributes["AVERAGE-BANDWIDTH"],10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),this.trigger("data",r);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){r={type:"tag",tagType:"define"},r.attributes=lr(t[1]),this.trigger("data",r);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:r,segment:i}){typeof r!="function"&&(r=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:r(n),customType:t,segment:i}),!0})}addTagMapper({expression:e,map:t}){const r=i=>e.test(i)?t(i):i;this.tagMappers.push(r)}};const bw=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),va=function(s){const e={};return Object.keys(s).forEach(function(t){e[bw(t)]=s[t]}),e},tf=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:r}=s;if(!e)return;const i="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=r&&r*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${i} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),r&&!e.hasOwnProperty(a)&&(e[a]=r*3,this.trigger("info",{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),r&&e[a]<l&&(this.trigger("warn",{message:`${i} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${l}).`}),e[a]=l)};let Sw=class extends mm{constructor(e={}){super(),this.lineStream=new vw,this.parseStream=new Tw,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,r=[];let i={},n,a,o=!1;const l=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let d=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let f=0,g=0;const E={};this.on("end",()=>{i.uri||!i.parts&&!i.preloadHints||(!i.map&&n&&(i.map=n),!i.key&&a&&(i.key=a),!i.timeline&&typeof d=="number"&&(i.timeline=d),this.manifest.preloadSegment=i)}),this.parseStream.on("data",function(S){let k,F;if(t.manifest.definitions){for(const L in t.manifest.definitions)if(S.uri&&(S.uri=S.uri.replace(`{$${L}}`,t.manifest.definitions[L])),S.attributes)for(const W in S.attributes)typeof S.attributes[W]=="string"&&(S.attributes[W]=S.attributes[W].replace(`{$${L}}`,t.manifest.definitions[L]))}({tag(){({version(){S.version&&(this.manifest.version=S.version)},"allow-cache"(){this.manifest.allowCache=S.allowed,"allowed"in S||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const L={};"length"in S&&(i.byterange=L,L.length=S.length,"offset"in S||(S.offset=f)),"offset"in S&&(i.byterange=L,L.offset=S.offset),f=L.offset+L.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"})),S.title&&(i.title=S.title),S.duration>0&&(i.duration=S.duration),S.duration===0&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key(){if(!S.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(S.attributes.METHOD==="NONE"){a=null;return}if(!S.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(S.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes};return}if(S.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:S.attributes.URI};return}if(S.attributes.KEYFORMAT===c){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(S.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(S.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),S.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(S.attributes.KEYID&&S.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:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:hT(S.attributes.URI.split(",")[1])};return}S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},typeof S.attributes.IV<"u"&&(a.iv=S.attributes.IV)},"media-sequence"(){if(!isFinite(S.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number});return}this.manifest.mediaSequence=S.number},"discontinuity-sequence"(){if(!isFinite(S.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number});return}this.manifest.discontinuitySequence=S.number,d=S.number},"playlist-type"(){if(!/VOD|EVENT/.test(S.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist});return}this.manifest.playlistType=S.playlistType},map(){n={},S.uri&&(n.uri=S.uri),S.byterange&&(n.byterange=S.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!S.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}i.attributes||(i.attributes={}),jt(i.attributes,S.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const L=this.manifest.mediaGroups[S.attributes.TYPE];L[S.attributes["GROUP-ID"]]=L[S.attributes["GROUP-ID"]]||{},k=L[S.attributes["GROUP-ID"]],F={default:/yes/i.test(S.attributes.DEFAULT)},F.default?F.autoselect=!0:F.autoselect=/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(F.language=S.attributes.LANGUAGE),S.attributes.URI&&(F.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(F.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(F.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(F.forced=/yes/i.test(S.attributes.FORCED)),k[S.attributes.NAME]=F},discontinuity(){d+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),i.dateTimeString=S.dateTimeString,i.dateTimeObject=S.dateTimeObject;const{lastProgramDateTime:L}=this;this.lastProgramDateTime=new Date(S.dateTimeString).getTime(),L===null&&this.manifest.segments.reduceRight((W,H)=>(H.programDateTime=W-H.duration*1e3,H.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(S.duration)||S.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration});return}this.manifest.targetDuration=S.duration,tf.call(this,this.manifest)},start(){if(!S.attributes||isNaN(S.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}},"cue-out"(){i.cueOut=S.data},"cue-out-cont"(){i.cueOutCont=S.data},"cue-in"(){i.cueIn=S.data},skip(){this.manifest.skip=va(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const L=this.manifest.segments.length,W=va(S.attributes);i.parts=i.parts||[],i.parts.push(W),W.byterange&&(W.byterange.hasOwnProperty("offset")||(W.byterange.offset=g),g=W.byterange.offset+W.byterange.length);const H=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${H} for segment #${L}`,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(($,G)=>{$.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${G} lacks required attribute(s): LAST-PART`})})},"server-control"(){const L=this.manifest.serverControl=va(S.attributes);L.hasOwnProperty("canBlockReload")||(L.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),tf.call(this,this.manifest),L.canSkipDateranges&&!L.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 L=this.manifest.segments.length,W=va(S.attributes),H=W.type&&W.type==="PART";i.preloadHints=i.preloadHints||[],i.preloadHints.push(W),W.byterange&&(W.byterange.hasOwnProperty("offset")||(W.byterange.offset=H?g:0,H&&(g=W.byterange.offset+W.byterange.length)));const $=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${$} for segment #${L}`,S.attributes,["TYPE","URI"]),!!W.type)for(let G=0;G<i.preloadHints.length-1;G++){const K=i.preloadHints[G];K.type&&K.type===W.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${$} for segment #${L} has the same TYPE ${W.type} as preload hint #${G}`})}},"rendition-report"(){const L=va(S.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(L);const W=this.manifest.renditionReports.length-1,H=["LAST-MSN","URI"];o&&H.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${W}`,S.attributes,H)},"part-inf"(){this.manifest.partInf=va(S.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",S.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),tf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(va(S.attributes));const L=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${L}`,S.attributes,["ID","START-DATE"]);const W=this.manifest.dateRanges[L];W.endDate&&W.startDate&&new Date(W.endDate)<new Date(W.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),W.duration&&W.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),W.plannedDuration&&W.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const H=!!W.endOnNext;if(H&&!W.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),H&&(W.duration||W.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),W.duration&&W.endDate){const G=W.startDate.getTime()+W.duration*1e3;this.manifest.dateRanges[L].endDate=new Date(G)}if(!E[W.id])E[W.id]=W;else{for(const G in E[W.id])if(W[G]&&JSON.stringify(E[W.id][G])!==JSON.stringify(W[G])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const $=this.manifest.dateRanges.findIndex(G=>G.id===W.id);this.manifest.dateRanges[$]=jt(this.manifest.dateRanges[$],W),E[W.id]=jt(E[W.id],W),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=va(S.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",S.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const L=(W,H)=>{if(W in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${W}`});return}this.manifest.definitions[W]=H};if("QUERYPARAM"in S.attributes){if("NAME"in S.attributes||"IMPORT"in S.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const W=this.params.get(S.attributes.QUERYPARAM);if(!W){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${S.attributes.QUERYPARAM}`});return}L(S.attributes.QUERYPARAM,decodeURIComponent(W));return}if("NAME"in S.attributes){if("IMPORT"in S.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in S.attributes)||typeof S.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${S.attributes.NAME}`});return}L(S.attributes.NAME,S.attributes.VALUE);return}if("IMPORT"in S.attributes){if(!this.mainDefinitions[S.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${S.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}L(S.attributes.IMPORT,this.mainDefinitions[S.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:S.attributes,uri:S.uri,timeline:d}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",S.attributes,["BANDWIDTH","URI"])}}[S.tagType]||l).call(t)},uri(){i.uri=S.uri,r.push(i),this.manifest.targetDuration&&!("duration"in i)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),a&&(i.key=a),i.timeline=d,n&&(i.map=n),g=0,this.lastProgramDateTime!==null&&(i.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=i.duration*1e3),i={}},comment(){},custom(){S.segment?(i.custom=i.custom||{},i.custom[S.customType]=S.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[S.customType]=S.data)}})[S.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,r){const i=[];r.forEach(function(n){t.hasOwnProperty(n)||i.push(n)}),i.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${i.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
|
|
74
|
+
`),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 eo={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^/},Cw=["video","audio","text"],Sv=["Video","Audio","Text"],dT=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,i){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})},rs=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(i){i=i.trim();var n;Cw.forEach(function(a){var o=eo[a].exec(i.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=i.substring(0,o[1].length),u=i.replace(l,"");r.push({type:l,details:u,mediaType:a})}}),n||r.push({type:i,details:"",mediaType:"unknown"})}),r},Ew=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var i in r){var n=r[i];if(n.default&&n.playlists)return rs(n.playlists[0].attributes.CODECS)}return null},fT=function(e){return e===void 0&&(e=""),eo.audio.test(e.trim().toLowerCase())},ww=function(e){return e===void 0&&(e=""),eo.text.test(e.trim().toLowerCase())},ul=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return dT(n.trim())}),r="video";t.length===1&&fT(t[0])?r="audio":t.length===1&&ww(t[0])&&(r="application");var i="mp4";return t.every(function(n){return eo.mp4.test(n)})?i="mp4":t.every(function(n){return eo.webm.test(n)})?i="webm":t.every(function(n){return eo.ogg.test(n)})&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},Hu=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),N.MediaSource&&N.MediaSource.isTypeSupported&&N.MediaSource.isTypeSupported(ul(e))||t&&N.ManagedMediaSource&&N.ManagedMediaSource.isTypeSupported&&N.ManagedMediaSource.isTypeSupported(ul(e))||!1},rf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<Sv.length;r++){var i=Sv[r];if(eo["muxer"+i].test(t))return!0}return!1})},Cv="mp4a.40.2",kw="avc1.4d400d",Aw=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,xw=/^application\/dash\+xml/i,pT=function(e){return Aw.test(e)?"hls":xw.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Nw=function(e){return e.toString(2).length},Dw=function(e){return Math.ceil(Nw(e)/8)},mT=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Iw=function(e){return mT(e)},Qe=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Iw(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))},Gi=N.BigInt||Number,ap=[Gi("0x1"),Gi("0x100"),Gi("0x10000"),Gi("0x1000000"),Gi("0x100000000"),Gi("0x10000000000"),Gi("0x1000000000000"),Gi("0x100000000000000"),Gi("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var Pw=function(e,t){var r=t===void 0?{}:t,i=r.signed,n=i===void 0?!1:i,a=r.le,o=a===void 0?!1:a;e=Qe(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,E){var S=o?E:Math.abs(E+1-e.length);return f+Gi(g)*ap[S]},Gi(0));if(n){var d=ap[e.length]/Gi(2)-Gi(1);c=Gi(c),c>d&&(c-=d,c-=d,c-=Gi(2))}return Number(c)},Lw=function(e,t){var r={},i=r.le,n=i===void 0?!1:i;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Gi(e);for(var a=Dw(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/ap[l]&Gi(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},gT=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 r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r},Ow=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return Qe(t[0]);var i=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(i),a=0;return t.forEach(function(o){o=Qe(o),n.set(o,a),a+=o.byteLength}),n},ni=function(e,t,r){var i=r===void 0?{}:r,n=i.offset,a=n===void 0?0:n,o=i.mask,l=o===void 0?[]:o;e=Qe(e),t=Qe(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,d){var f=l[d]?l[d]&e[a+d]:e[a+d];return c===f})},Mw=function(e,t,r){t.forEach(function(i){for(var n in e.mediaGroups[i])for(var a in e.mediaGroups[i][n]){var o=e.mediaGroups[i][n][a];r(o,i,n,a)}})},Eu={},Ms={},Va={},Ev;function ad(){if(Ev)return Va;Ev=1;function s(n,a,o){if(o===void 0&&(o=Array.prototype),n&&typeof o.find=="function")return o.find.call(n,a);for(var l=0;l<n.length;l++)if(Object.prototype.hasOwnProperty.call(n,l)){var u=n[l];if(a.call(void 0,u,l,n))return u}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o]);return n}var r=e({HTML:"text/html",isHTML:function(n){return n===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Va.assign=t,Va.find=s,Va.freeze=e,Va.MIME_TYPE=r,Va.NAMESPACE=i,Va}var wv;function vT(){if(wv)return Ms;wv=1;var s=ad(),e=s.find,t=s.NAMESPACE;function r(R){return R!==""}function i(R){return R?R.split(/[\t\n\f\r ]+/).filter(r):[]}function n(R,j){return R.hasOwnProperty(j)||(R[j]=!0),R}function a(R){if(!R)return[];var j=i(R);return Object.keys(j.reduce(n,{}))}function o(R){return function(j){return R&&R.indexOf(j)!==-1}}function l(R,j){for(var ie in R)Object.prototype.hasOwnProperty.call(R,ie)&&(j[ie]=R[ie])}function u(R,j){var ie=R.prototype;if(!(ie instanceof j)){let ge=function(){};ge.prototype=j.prototype,ge=new ge,l(ie,ge),R.prototype=ie=ge}ie.constructor!=R&&(typeof R!="function"&&console.error("unknown Class:"+R),ie.constructor=R)}var c={},d=c.ELEMENT_NODE=1,f=c.ATTRIBUTE_NODE=2,g=c.TEXT_NODE=3,E=c.CDATA_SECTION_NODE=4,S=c.ENTITY_REFERENCE_NODE=5,k=c.ENTITY_NODE=6,F=c.PROCESSING_INSTRUCTION_NODE=7,L=c.COMMENT_NODE=8,W=c.DOCUMENT_NODE=9,H=c.DOCUMENT_TYPE_NODE=10,$=c.DOCUMENT_FRAGMENT_NODE=11,G=c.NOTATION_NODE=12,K={},Y={};K.INDEX_SIZE_ERR=(Y[1]="Index size error",1),K.DOMSTRING_SIZE_ERR=(Y[2]="DOMString size error",2);var P=K.HIERARCHY_REQUEST_ERR=(Y[3]="Hierarchy request error",3);K.WRONG_DOCUMENT_ERR=(Y[4]="Wrong document",4),K.INVALID_CHARACTER_ERR=(Y[5]="Invalid character",5),K.NO_DATA_ALLOWED_ERR=(Y[6]="No data allowed",6),K.NO_MODIFICATION_ALLOWED_ERR=(Y[7]="No modification allowed",7);var O=K.NOT_FOUND_ERR=(Y[8]="Not found",8);K.NOT_SUPPORTED_ERR=(Y[9]="Not supported",9);var ne=K.INUSE_ATTRIBUTE_ERR=(Y[10]="Attribute in use",10);K.INVALID_STATE_ERR=(Y[11]="Invalid state",11),K.SYNTAX_ERR=(Y[12]="Syntax error",12),K.INVALID_MODIFICATION_ERR=(Y[13]="Invalid modification",13),K.NAMESPACE_ERR=(Y[14]="Invalid namespace",14),K.INVALID_ACCESS_ERR=(Y[15]="Invalid access",15);function te(R,j){if(j instanceof Error)var ie=j;else ie=this,Error.call(this,Y[R]),this.message=Y[R],Error.captureStackTrace&&Error.captureStackTrace(this,te);return ie.code=R,j&&(this.message=this.message+": "+j),ie}te.prototype=Error.prototype,l(K,te);function re(){}re.prototype={length:0,item:function(R){return R>=0&&R<this.length?this[R]:null},toString:function(R,j){for(var ie=[],ge=0;ge<this.length;ge++)en(this[ge],ie,R,j);return ie.join("")},filter:function(R){return Array.prototype.filter.call(this,R)},indexOf:function(R){return Array.prototype.indexOf.call(this,R)}};function me(R,j){this._node=R,this._refresh=j,Se(this)}function Se(R){var j=R._node._inc||R._node.ownerDocument._inc;if(R._inc!==j){var ie=R._refresh(R._node);if(Zs(R,"length",ie.length),!R.$$length||ie.length<R.$$length)for(var ge=ie.length;ge in R;ge++)Object.prototype.hasOwnProperty.call(R,ge)&&delete R[ge];l(ie,R),R._inc=j}}me.prototype.item=function(R){return Se(this),this[R]||null},u(me,re);function Ae(){}function ve(R,j){for(var ie=R.length;ie--;)if(R[ie]===j)return ie}function Te(R,j,ie,ge){if(ge?j[ve(j,ge)]=ie:j[j.length++]=ie,R){ie.ownerElement=R;var Me=R.ownerDocument;Me&&(ge&&xt(Me,R,ge),ze(Me,R,ie))}}function ye(R,j,ie){var ge=ve(j,ie);if(ge>=0){for(var Me=j.length-1;ge<Me;)j[ge]=j[++ge];if(j.length=Me,R){var Xe=R.ownerDocument;Xe&&(xt(Xe,R,ie),ie.ownerElement=null)}}else throw new te(O,new Error(R.tagName+"@"+ie))}Ae.prototype={length:0,item:re.prototype.item,getNamedItem:function(R){for(var j=this.length;j--;){var ie=this[j];if(ie.nodeName==R)return ie}},setNamedItem:function(R){var j=R.ownerElement;if(j&&j!=this._ownerElement)throw new te(ne);var ie=this.getNamedItem(R.nodeName);return Te(this._ownerElement,this,R,ie),ie},setNamedItemNS:function(R){var j=R.ownerElement,ie;if(j&&j!=this._ownerElement)throw new te(ne);return ie=this.getNamedItemNS(R.namespaceURI,R.localName),Te(this._ownerElement,this,R,ie),ie},removeNamedItem:function(R){var j=this.getNamedItem(R);return ye(this._ownerElement,this,j),j},removeNamedItemNS:function(R,j){var ie=this.getNamedItemNS(R,j);return ye(this._ownerElement,this,ie),ie},getNamedItemNS:function(R,j){for(var ie=this.length;ie--;){var ge=this[ie];if(ge.localName==j&&ge.namespaceURI==R)return ge}return null}};function _e(){}_e.prototype={hasFeature:function(R,j){return!0},createDocument:function(R,j,ie){var ge=new Ke;if(ge.implementation=this,ge.childNodes=new re,ge.doctype=ie||null,ie&&ge.appendChild(ie),j){var Me=ge.createElementNS(R,j);ge.appendChild(Me)}return ge},createDocumentType:function(R,j,ie){var ge=new Mr;return ge.name=R,ge.nodeName=R,ge.publicId=j||"",ge.systemId=ie||"",ge}};function xe(){}xe.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(R,j){return nt(this,R,j)},replaceChild:function(R,j){nt(this,R,j,_i),j&&this.removeChild(j)},removeChild:function(R){return wt(this,R)},appendChild:function(R){return this.insertBefore(R,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(R){return Ss(this.ownerDocument||this,this,R)},normalize:function(){for(var R=this.firstChild;R;){var j=R.nextSibling;j&&j.nodeType==g&&R.nodeType==g?(this.removeChild(j),R.appendData(j.data)):(R.normalize(),R=j)}},isSupported:function(R,j){return this.ownerDocument.implementation.hasFeature(R,j)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(R){for(var j=this;j;){var ie=j._nsMap;if(ie){for(var ge in ie)if(Object.prototype.hasOwnProperty.call(ie,ge)&&ie[ge]===R)return ge}j=j.nodeType==f?j.ownerDocument:j.parentNode}return null},lookupNamespaceURI:function(R){for(var j=this;j;){var ie=j._nsMap;if(ie&&Object.prototype.hasOwnProperty.call(ie,R))return ie[R];j=j.nodeType==f?j.ownerDocument:j.parentNode}return null},isDefaultNamespace:function(R){var j=this.lookupPrefix(R);return j==null}};function qe(R){return R=="<"&&"<"||R==">"&&">"||R=="&"&&"&"||R=='"'&&"""||"&#"+R.charCodeAt()+";"}l(c,xe),l(c,xe.prototype);function We(R,j){if(j(R))return!0;if(R=R.firstChild)do if(We(R,j))return!0;while(R=R.nextSibling)}function Ke(){this.ownerDocument=this}function ze(R,j,ie){R&&R._inc++;var ge=ie.namespaceURI;ge===t.XMLNS&&(j._nsMap[ie.prefix?ie.localName:""]=ie.value)}function xt(R,j,ie,ge){R&&R._inc++;var Me=ie.namespaceURI;Me===t.XMLNS&&delete j._nsMap[ie.prefix?ie.localName:""]}function Qt(R,j,ie){if(R&&R._inc){R._inc++;var ge=j.childNodes;if(ie)ge[ge.length++]=ie;else{for(var Me=j.firstChild,Xe=0;Me;)ge[Xe++]=Me,Me=Me.nextSibling;ge.length=Xe,delete ge[ge.length]}}}function wt(R,j){var ie=j.previousSibling,ge=j.nextSibling;return ie?ie.nextSibling=ge:R.firstChild=ge,ge?ge.previousSibling=ie:R.lastChild=ie,j.parentNode=null,j.previousSibling=null,j.nextSibling=null,Qt(R.ownerDocument,R),j}function Jt(R){return R&&(R.nodeType===xe.DOCUMENT_NODE||R.nodeType===xe.DOCUMENT_FRAGMENT_NODE||R.nodeType===xe.ELEMENT_NODE)}function Ii(R){return R&&(yi(R)||Pr(R)||oi(R)||R.nodeType===xe.DOCUMENT_FRAGMENT_NODE||R.nodeType===xe.COMMENT_NODE||R.nodeType===xe.PROCESSING_INSTRUCTION_NODE)}function oi(R){return R&&R.nodeType===xe.DOCUMENT_TYPE_NODE}function yi(R){return R&&R.nodeType===xe.ELEMENT_NODE}function Pr(R){return R&&R.nodeType===xe.TEXT_NODE}function li(R,j){var ie=R.childNodes||[];if(e(ie,yi)||oi(j))return!1;var ge=e(ie,oi);return!(j&&ge&&ie.indexOf(ge)>ie.indexOf(j))}function Lr(R,j){var ie=R.childNodes||[];function ge(Xe){return yi(Xe)&&Xe!==j}if(e(ie,ge))return!1;var Me=e(ie,oi);return!(j&&Me&&ie.indexOf(Me)>ie.indexOf(j))}function Ut(R,j,ie){if(!Jt(R))throw new te(P,"Unexpected parent node type "+R.nodeType);if(ie&&ie.parentNode!==R)throw new te(O,"child not in parent");if(!Ii(j)||oi(j)&&R.nodeType!==xe.DOCUMENT_NODE)throw new te(P,"Unexpected node type "+j.nodeType+" for parent node type "+R.nodeType)}function Pi(R,j,ie){var ge=R.childNodes||[],Me=j.childNodes||[];if(j.nodeType===xe.DOCUMENT_FRAGMENT_NODE){var Xe=Me.filter(yi);if(Xe.length>1||e(Me,Pr))throw new te(P,"More than one element or text in fragment");if(Xe.length===1&&!li(R,ie))throw new te(P,"Element in fragment can not be inserted before doctype")}if(yi(j)&&!li(R,ie))throw new te(P,"Only one element can be added and only after doctype");if(oi(j)){if(e(ge,oi))throw new te(P,"Only one doctype is allowed");var At=e(ge,yi);if(ie&&ge.indexOf(At)<ge.indexOf(ie))throw new te(P,"Doctype can only be inserted before an element");if(!ie&&At)throw new te(P,"Doctype can not be appended since element is present")}}function _i(R,j,ie){var ge=R.childNodes||[],Me=j.childNodes||[];if(j.nodeType===xe.DOCUMENT_FRAGMENT_NODE){var Xe=Me.filter(yi);if(Xe.length>1||e(Me,Pr))throw new te(P,"More than one element or text in fragment");if(Xe.length===1&&!Lr(R,ie))throw new te(P,"Element in fragment can not be inserted before doctype")}if(yi(j)&&!Lr(R,ie))throw new te(P,"Only one element can be added and only after doctype");if(oi(j)){if(e(ge,function(Tt){return oi(Tt)&&Tt!==ie}))throw new te(P,"Only one doctype is allowed");var At=e(ge,yi);if(ie&&ge.indexOf(At)<ge.indexOf(ie))throw new te(P,"Doctype can only be inserted before an element")}}function nt(R,j,ie,ge){Ut(R,j,ie),R.nodeType===xe.DOCUMENT_NODE&&(ge||Pi)(R,j,ie);var Me=j.parentNode;if(Me&&Me.removeChild(j),j.nodeType===$){var Xe=j.firstChild;if(Xe==null)return j;var At=j.lastChild}else Xe=At=j;var Wt=ie?ie.previousSibling:R.lastChild;Xe.previousSibling=Wt,At.nextSibling=ie,Wt?Wt.nextSibling=Xe:R.firstChild=Xe,ie==null?R.lastChild=At:ie.previousSibling=At;do{Xe.parentNode=R;var Tt=R.ownerDocument||R;lt(Xe,Tt)}while(Xe!==At&&(Xe=Xe.nextSibling));return Qt(R.ownerDocument||R,R),j.nodeType==$&&(j.firstChild=j.lastChild=null),j}function lt(R,j){if(R.ownerDocument!==j){if(R.ownerDocument=j,R.nodeType===d&&R.attributes)for(var ie=0;ie<R.attributes.length;ie++){var ge=R.attributes.item(ie);ge&&(ge.ownerDocument=j)}for(var Me=R.firstChild;Me;)lt(Me,j),Me=Me.nextSibling}}function kt(R,j){j.parentNode&&j.parentNode.removeChild(j),j.parentNode=R,j.previousSibling=R.lastChild,j.nextSibling=null,j.previousSibling?j.previousSibling.nextSibling=j:R.firstChild=j,R.lastChild=j,Qt(R.ownerDocument,R,j);var ie=R.ownerDocument||R;return lt(j,ie),j}Ke.prototype={nodeName:"#document",nodeType:W,doctype:null,documentElement:null,_inc:1,insertBefore:function(R,j){if(R.nodeType==$){for(var ie=R.firstChild;ie;){var ge=ie.nextSibling;this.insertBefore(ie,j),ie=ge}return R}return nt(this,R,j),lt(R,this),this.documentElement===null&&R.nodeType===d&&(this.documentElement=R),R},removeChild:function(R){return this.documentElement==R&&(this.documentElement=null),wt(this,R)},replaceChild:function(R,j){nt(this,R,j,_i),lt(R,this),j&&this.removeChild(j),yi(R)&&(this.documentElement=R)},importNode:function(R,j){return bs(this,R,j)},getElementById:function(R){var j=null;return We(this.documentElement,function(ie){if(ie.nodeType==d&&ie.getAttribute("id")==R)return j=ie,!0}),j},getElementsByClassName:function(R){var j=a(R);return new me(this,function(ie){var ge=[];return j.length>0&&We(ie.documentElement,function(Me){if(Me!==ie&&Me.nodeType===d){var Xe=Me.getAttribute("class");if(Xe){var At=R===Xe;if(!At){var Wt=a(Xe);At=j.every(o(Wt))}At&&ge.push(Me)}}}),ge})},createElement:function(R){var j=new Ft;j.ownerDocument=this,j.nodeName=R,j.tagName=R,j.localName=R,j.childNodes=new re;var ie=j.attributes=new Ae;return ie._ownerElement=j,j},createDocumentFragment:function(){var R=new _t;return R.ownerDocument=this,R.childNodes=new re,R},createTextNode:function(R){var j=new Or;return j.ownerDocument=this,j.appendData(R),j},createComment:function(R){var j=new br;return j.ownerDocument=this,j.appendData(R),j},createCDATASection:function(R){var j=new Sr;return j.ownerDocument=this,j.appendData(R),j},createProcessingInstruction:function(R,j){var ie=new Jr;return ie.ownerDocument=this,ie.tagName=ie.nodeName=ie.target=R,ie.nodeValue=ie.data=j,ie},createAttribute:function(R){var j=new Tr;return j.ownerDocument=this,j.name=R,j.nodeName=R,j.localName=R,j.specified=!0,j},createEntityReference:function(R){var j=new dt;return j.ownerDocument=this,j.nodeName=R,j},createElementNS:function(R,j){var ie=new Ft,ge=j.split(":"),Me=ie.attributes=new Ae;return ie.childNodes=new re,ie.ownerDocument=this,ie.nodeName=j,ie.tagName=j,ie.namespaceURI=R,ge.length==2?(ie.prefix=ge[0],ie.localName=ge[1]):ie.localName=j,Me._ownerElement=ie,ie},createAttributeNS:function(R,j){var ie=new Tr,ge=j.split(":");return ie.ownerDocument=this,ie.nodeName=j,ie.name=j,ie.namespaceURI=R,ie.specified=!0,ge.length==2?(ie.prefix=ge[0],ie.localName=ge[1]):ie.localName=j,ie}},u(Ke,xe);function Ft(){this._nsMap={}}Ft.prototype={nodeType:d,hasAttribute:function(R){return this.getAttributeNode(R)!=null},getAttribute:function(R){var j=this.getAttributeNode(R);return j&&j.value||""},getAttributeNode:function(R){return this.attributes.getNamedItem(R)},setAttribute:function(R,j){var ie=this.ownerDocument.createAttribute(R);ie.value=ie.nodeValue=""+j,this.setAttributeNode(ie)},removeAttribute:function(R){var j=this.getAttributeNode(R);j&&this.removeAttributeNode(j)},appendChild:function(R){return R.nodeType===$?this.insertBefore(R,null):kt(this,R)},setAttributeNode:function(R){return this.attributes.setNamedItem(R)},setAttributeNodeNS:function(R){return this.attributes.setNamedItemNS(R)},removeAttributeNode:function(R){return this.attributes.removeNamedItem(R.nodeName)},removeAttributeNS:function(R,j){var ie=this.getAttributeNodeNS(R,j);ie&&this.removeAttributeNode(ie)},hasAttributeNS:function(R,j){return this.getAttributeNodeNS(R,j)!=null},getAttributeNS:function(R,j){var ie=this.getAttributeNodeNS(R,j);return ie&&ie.value||""},setAttributeNS:function(R,j,ie){var ge=this.ownerDocument.createAttributeNS(R,j);ge.value=ge.nodeValue=""+ie,this.setAttributeNode(ge)},getAttributeNodeNS:function(R,j){return this.attributes.getNamedItemNS(R,j)},getElementsByTagName:function(R){return new me(this,function(j){var ie=[];return We(j,function(ge){ge!==j&&ge.nodeType==d&&(R==="*"||ge.tagName==R)&&ie.push(ge)}),ie})},getElementsByTagNameNS:function(R,j){return new me(this,function(ie){var ge=[];return We(ie,function(Me){Me!==ie&&Me.nodeType===d&&(R==="*"||Me.namespaceURI===R)&&(j==="*"||Me.localName==j)&&ge.push(Me)}),ge})}},Ke.prototype.getElementsByTagName=Ft.prototype.getElementsByTagName,Ke.prototype.getElementsByTagNameNS=Ft.prototype.getElementsByTagNameNS,u(Ft,xe);function Tr(){}Tr.prototype.nodeType=f,u(Tr,xe);function nr(){}nr.prototype={data:"",substringData:function(R,j){return this.data.substring(R,R+j)},appendData:function(R){R=this.data+R,this.nodeValue=this.data=R,this.length=R.length},insertData:function(R,j){this.replaceData(R,0,j)},appendChild:function(R){throw new Error(Y[P])},deleteData:function(R,j){this.replaceData(R,j,"")},replaceData:function(R,j,ie){var ge=this.data.substring(0,R),Me=this.data.substring(R+j);ie=ge+ie+Me,this.nodeValue=this.data=ie,this.length=ie.length}},u(nr,xe);function Or(){}Or.prototype={nodeName:"#text",nodeType:g,splitText:function(R){var j=this.data,ie=j.substring(R);j=j.substring(0,R),this.data=this.nodeValue=j,this.length=j.length;var ge=this.ownerDocument.createTextNode(ie);return this.parentNode&&this.parentNode.insertBefore(ge,this.nextSibling),ge}},u(Or,nr);function br(){}br.prototype={nodeName:"#comment",nodeType:L},u(br,nr);function Sr(){}Sr.prototype={nodeName:"#cdata-section",nodeType:E},u(Sr,nr);function Mr(){}Mr.prototype.nodeType=H,u(Mr,xe);function Rn(){}Rn.prototype.nodeType=G,u(Rn,xe);function Bn(){}Bn.prototype.nodeType=k,u(Bn,xe);function dt(){}dt.prototype.nodeType=S,u(dt,xe);function _t(){}_t.prototype.nodeName="#document-fragment",_t.prototype.nodeType=$,u(_t,xe);function Jr(){}Jr.prototype.nodeType=F,u(Jr,xe);function mn(){}mn.prototype.serializeToString=function(R,j,ie){return Ts.call(R,j,ie)},xe.prototype.toString=Ts;function Ts(R,j){var ie=[],ge=this.nodeType==9&&this.documentElement||this,Me=ge.prefix,Xe=ge.namespaceURI;if(Xe&&Me==null){var Me=ge.lookupPrefix(Xe);if(Me==null)var At=[{namespace:Xe,prefix:null}]}return en(this,ie,R,j,At),ie.join("")}function Js(R,j,ie){var ge=R.prefix||"",Me=R.namespaceURI;if(!Me||ge==="xml"&&Me===t.XML||Me===t.XMLNS)return!1;for(var Xe=ie.length;Xe--;){var At=ie[Xe];if(At.prefix===ge)return At.namespace!==Me}return!0}function Zr(R,j,ie){R.push(" ",j,'="',ie.replace(/[<>&"\t\n\r]/g,qe),'"')}function en(R,j,ie,ge,Me){if(Me||(Me=[]),ge)if(R=ge(R),R){if(typeof R=="string"){j.push(R);return}}else return;switch(R.nodeType){case d:var Xe=R.attributes,At=Xe.length,Ct=R.firstChild,Wt=R.tagName;ie=t.isHTML(R.namespaceURI)||ie;var Tt=Wt;if(!ie&&!R.prefix&&R.namespaceURI){for(var Yi,mi=0;mi<Xe.length;mi++)if(Xe.item(mi).name==="xmlns"){Yi=Xe.item(mi).value;break}if(!Yi)for(var Li=Me.length-1;Li>=0;Li--){var ii=Me[Li];if(ii.prefix===""&&ii.namespace===R.namespaceURI){Yi=ii.namespace;break}}if(Yi!==R.namespaceURI)for(var Li=Me.length-1;Li>=0;Li--){var ii=Me[Li];if(ii.namespace===R.namespaceURI){ii.prefix&&(Tt=ii.prefix+":"+Wt);break}}}j.push("<",Tt);for(var Lt=0;Lt<At;Lt++){var ut=Xe.item(Lt);ut.prefix=="xmlns"?Me.push({prefix:ut.localName,namespace:ut.value}):ut.nodeName=="xmlns"&&Me.push({prefix:"",namespace:ut.value})}for(var Lt=0;Lt<At;Lt++){var ut=Xe.item(Lt);if(Js(ut,ie,Me)){var Rr=ut.prefix||"",qi=ut.namespaceURI;Zr(j,Rr?"xmlns:"+Rr:"xmlns",qi),Me.push({prefix:Rr,namespace:qi})}en(ut,j,ie,ge,Me)}if(Wt===Tt&&Js(R,ie,Me)){var Rr=R.prefix||"",qi=R.namespaceURI;Zr(j,Rr?"xmlns:"+Rr:"xmlns",qi),Me.push({prefix:Rr,namespace:qi})}if(Ct||ie&&!/^(?:meta|link|img|br|hr|input)$/i.test(Wt)){if(j.push(">"),ie&&/^script$/i.test(Wt))for(;Ct;)Ct.data?j.push(Ct.data):en(Ct,j,ie,ge,Me.slice()),Ct=Ct.nextSibling;else for(;Ct;)en(Ct,j,ie,ge,Me.slice()),Ct=Ct.nextSibling;j.push("</",Tt,">")}else j.push("/>");return;case W:case $:for(var Ct=R.firstChild;Ct;)en(Ct,j,ie,ge,Me.slice()),Ct=Ct.nextSibling;return;case f:return Zr(j,R.name,R.value);case g:return j.push(R.data.replace(/[<&>]/g,qe));case E:return j.push("<![CDATA[",R.data,"]]>");case L:return j.push("<!--",R.data,"-->");case H:var gn=R.publicId,at=R.systemId;if(j.push("<!DOCTYPE ",R.name),gn)j.push(" PUBLIC ",gn),at&&at!="."&&j.push(" ",at),j.push(">");else if(at&&at!=".")j.push(" SYSTEM ",at,">");else{var Nt=R.internalSubset;Nt&&j.push(" [",Nt,"]"),j.push(">")}return;case F:return j.push("<?",R.target," ",R.data,"?>");case S:return j.push("&",R.nodeName,";");default:j.push("??",R.nodeName)}}function bs(R,j,ie){var ge;switch(j.nodeType){case d:ge=j.cloneNode(!1),ge.ownerDocument=R;case $:break;case f:ie=!0;break}if(ge||(ge=j.cloneNode(!1)),ge.ownerDocument=R,ge.parentNode=null,ie)for(var Me=j.firstChild;Me;)ge.appendChild(bs(R,Me,ie)),Me=Me.nextSibling;return ge}function Ss(R,j,ie){var ge=new j.constructor;for(var Me in j)if(Object.prototype.hasOwnProperty.call(j,Me)){var Xe=j[Me];typeof Xe!="object"&&Xe!=ge[Me]&&(ge[Me]=Xe)}switch(j.childNodes&&(ge.childNodes=new re),ge.ownerDocument=R,ge.nodeType){case d:var At=j.attributes,Wt=ge.attributes=new Ae,Tt=At.length;Wt._ownerElement=ge;for(var Yi=0;Yi<Tt;Yi++)ge.setAttributeNode(Ss(R,At.item(Yi),!0));break;case f:ie=!0}if(ie)for(var mi=j.firstChild;mi;)ge.appendChild(Ss(R,mi,ie)),mi=mi.nextSibling;return ge}function Zs(R,j,ie){R[j]=ie}try{if(Object.defineProperty){let R=function(j){switch(j.nodeType){case d:case $:var ie=[];for(j=j.firstChild;j;)j.nodeType!==7&&j.nodeType!==8&&ie.push(R(j)),j=j.nextSibling;return ie.join("");default:return j.nodeValue}};Object.defineProperty(me.prototype,"length",{get:function(){return Se(this),this.$$length}}),Object.defineProperty(xe.prototype,"textContent",{get:function(){return R(this)},set:function(j){switch(this.nodeType){case d:case $:for(;this.firstChild;)this.removeChild(this.firstChild);(j||String(j))&&this.appendChild(this.ownerDocument.createTextNode(j));break;default:this.data=j,this.value=j,this.nodeValue=j}}}),Zs=function(j,ie,ge){j["$$"+ie]=ge}}}catch{}return Ms.DocumentType=Mr,Ms.DOMException=te,Ms.DOMImplementation=_e,Ms.Element=Ft,Ms.Node=xe,Ms.NodeList=re,Ms.XMLSerializer=mn,Ms}var wu={},nf={},kv;function Rw(){return kv||(kv=1,(function(s){var e=ad().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.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:`
|
|
75
|
+
`,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:""}),s.entityMap=s.HTML_ENTITIES})(nf)),nf}var Nc={},Av;function Bw(){if(Av)return Nc;Av=1;var s=ad().NAMESPACE,e=/[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]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),i=0,n=1,a=2,o=3,l=4,u=5,c=6,d=7;function f(P,O){this.message=P,this.locator=O,Error.captureStackTrace&&Error.captureStackTrace(this,f)}f.prototype=new Error,f.prototype.name=f.name;function g(){}g.prototype={parse:function(P,O,ne){var te=this.domBuilder;te.startDocument(),H(O,O={}),E(P,O,ne,te,this.errorHandler),te.endDocument()}};function E(P,O,ne,te,re){function me(kt){if(kt>65535){kt-=65536;var Ft=55296+(kt>>10),Tr=56320+(kt&1023);return String.fromCharCode(Ft,Tr)}else return String.fromCharCode(kt)}function Se(kt){var Ft=kt.slice(1,-1);return Object.hasOwnProperty.call(ne,Ft)?ne[Ft]:Ft.charAt(0)==="#"?me(parseInt(Ft.substr(1).replace("x","0x"))):(re.error("entity not found:"+kt),kt)}function Ae(kt){if(kt>Ke){var Ft=P.substring(Ke,kt).replace(/&#?\w+;/g,Se);xe&&ve(Ke),te.characters(Ft,0,kt-Ke),Ke=kt}}function ve(kt,Ft){for(;kt>=ye&&(Ft=_e.exec(P));)Te=Ft.index,ye=Te+Ft[0].length,xe.lineNumber++;xe.columnNumber=kt-Te+1}for(var Te=0,ye=0,_e=/.*(?:\r\n?|\n)|.*$/g,xe=te.locator,qe=[{currentNSMap:O}],We={},Ke=0;;){try{var ze=P.indexOf("<",Ke);if(ze<0){if(!P.substr(Ke).match(/^\s*$/)){var xt=te.doc,Qt=xt.createTextNode(P.substr(Ke));xt.appendChild(Qt),te.currentElement=Qt}return}switch(ze>Ke&&Ae(ze),P.charAt(ze+1)){case"/":var Ut=P.indexOf(">",ze+3),wt=P.substring(ze+2,Ut).replace(/[ \t\n\r]+$/g,""),Jt=qe.pop();Ut<0?(wt=P.substring(ze+2).replace(/[\s<].*/,""),re.error("end tag name: "+wt+" is not complete:"+Jt.tagName),Ut=ze+1+wt.length):wt.match(/\s</)&&(wt=wt.replace(/[\s<].*/,""),re.error("end tag name: "+wt+" maybe not complete"),Ut=ze+1+wt.length);var Ii=Jt.localNSMap,oi=Jt.tagName==wt,yi=oi||Jt.tagName&&Jt.tagName.toLowerCase()==wt.toLowerCase();if(yi){if(te.endElement(Jt.uri,Jt.localName,wt),Ii)for(var Pr in Ii)Object.prototype.hasOwnProperty.call(Ii,Pr)&&te.endPrefixMapping(Pr);oi||re.fatalError("end tag name: "+wt+" is not match the current start tagName:"+Jt.tagName)}else qe.push(Jt);Ut++;break;case"?":xe&&ve(ze),Ut=G(P,ze,te);break;case"!":xe&&ve(ze),Ut=$(P,ze,te,re);break;default:xe&&ve(ze);var li=new K,Lr=qe[qe.length-1].currentNSMap,Ut=k(P,ze,li,Lr,Se,re),Pi=li.length;if(!li.closed&&W(P,Ut,li.tagName,We)&&(li.closed=!0,ne.nbsp||re.warning("unclosed xml attribute")),xe&&Pi){for(var _i=S(xe,{}),nt=0;nt<Pi;nt++){var lt=li[nt];ve(lt.offset),lt.locator=S(xe,{})}te.locator=_i,F(li,te,Lr)&&qe.push(li),te.locator=xe}else F(li,te,Lr)&&qe.push(li);s.isHTML(li.uri)&&!li.closed?Ut=L(P,Ut,li.tagName,Se,te):Ut++}}catch(kt){if(kt instanceof f)throw kt;re.error("element parse error: "+kt),Ut=-1}Ut>Ke?Ke=Ut:Ae(Math.max(ze,Ke)+1)}}function S(P,O){return O.lineNumber=P.lineNumber,O.columnNumber=P.columnNumber,O}function k(P,O,ne,te,re,me){function Se(xe,qe,We){ne.attributeNames.hasOwnProperty(xe)&&me.fatalError("Attribute "+xe+" redefined"),ne.addValue(xe,qe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,re),We)}for(var Ae,ve,Te=++O,ye=i;;){var _e=P.charAt(Te);switch(_e){case"=":if(ye===n)Ae=P.slice(O,Te),ye=o;else if(ye===a)ye=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ye===o||ye===n)if(ye===n&&(me.warning('attribute value must after "="'),Ae=P.slice(O,Te)),O=Te+1,Te=P.indexOf(_e,O),Te>0)ve=P.slice(O,Te),Se(Ae,ve,O-1),ye=u;else throw new Error("attribute value no end '"+_e+"' match");else if(ye==l)ve=P.slice(O,Te),Se(Ae,ve,O),me.warning('attribute "'+Ae+'" missed start quot('+_e+")!!"),O=Te+1,ye=u;else throw new Error('attribute value must after "="');break;case"/":switch(ye){case i:ne.setTagName(P.slice(O,Te));case u:case c:case d:ye=d,ne.closed=!0;case l:case n:break;case a:ne.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return me.error("unexpected end of input"),ye==i&&ne.setTagName(P.slice(O,Te)),Te;case">":switch(ye){case i:ne.setTagName(P.slice(O,Te));case u:case c:case d:break;case l:case n:ve=P.slice(O,Te),ve.slice(-1)==="/"&&(ne.closed=!0,ve=ve.slice(0,-1));case a:ye===a&&(ve=Ae),ye==l?(me.warning('attribute "'+ve+'" missed quot(")!'),Se(Ae,ve,O)):((!s.isHTML(te[""])||!ve.match(/^(?:disabled|checked|selected)$/i))&&me.warning('attribute "'+ve+'" missed value!! "'+ve+'" instead!!'),Se(ve,ve,O));break;case o:throw new Error("attribute value missed!!")}return Te;case"":_e=" ";default:if(_e<=" ")switch(ye){case i:ne.setTagName(P.slice(O,Te)),ye=c;break;case n:Ae=P.slice(O,Te),ye=a;break;case l:var ve=P.slice(O,Te);me.warning('attribute "'+ve+'" missed quot(")!!'),Se(Ae,ve,O);case u:ye=c;break}else switch(ye){case a:ne.tagName,(!s.isHTML(te[""])||!Ae.match(/^(?:disabled|checked|selected)$/i))&&me.warning('attribute "'+Ae+'" missed value!! "'+Ae+'" instead2!!'),Se(Ae,Ae,O),O=Te,ye=n;break;case u:me.warning('attribute space is required"'+Ae+'"!!');case c:ye=n,O=Te;break;case o:ye=l,O=Te;break;case d:throw new Error("elements closed character '/' and '>' must be connected to")}}Te++}}function F(P,O,ne){for(var te=P.tagName,re=null,_e=P.length;_e--;){var me=P[_e],Se=me.qName,Ae=me.value,xe=Se.indexOf(":");if(xe>0)var ve=me.prefix=Se.slice(0,xe),Te=Se.slice(xe+1),ye=ve==="xmlns"&&Te;else Te=Se,ve=null,ye=Se==="xmlns"&&"";me.localName=Te,ye!==!1&&(re==null&&(re={},H(ne,ne={})),ne[ye]=re[ye]=Ae,me.uri=s.XMLNS,O.startPrefixMapping(ye,Ae))}for(var _e=P.length;_e--;){me=P[_e];var ve=me.prefix;ve&&(ve==="xml"&&(me.uri=s.XML),ve!=="xmlns"&&(me.uri=ne[ve||""]))}var xe=te.indexOf(":");xe>0?(ve=P.prefix=te.slice(0,xe),Te=P.localName=te.slice(xe+1)):(ve=null,Te=P.localName=te);var qe=P.uri=ne[ve||""];if(O.startElement(qe,Te,te,P),P.closed){if(O.endElement(qe,Te,te),re)for(ve in re)Object.prototype.hasOwnProperty.call(re,ve)&&O.endPrefixMapping(ve)}else return P.currentNSMap=ne,P.localNSMap=re,!0}function L(P,O,ne,te,re){if(/^(?:script|textarea)$/i.test(ne)){var me=P.indexOf("</"+ne+">",O),Se=P.substring(O+1,me);if(/[&<]/.test(Se))return/^script$/i.test(ne)?(re.characters(Se,0,Se.length),me):(Se=Se.replace(/&#?\w+;/g,te),re.characters(Se,0,Se.length),me)}return O+1}function W(P,O,ne,te){var re=te[ne];return re==null&&(re=P.lastIndexOf("</"+ne+">"),re<O&&(re=P.lastIndexOf("</"+ne)),te[ne]=re),re<O}function H(P,O){for(var ne in P)Object.prototype.hasOwnProperty.call(P,ne)&&(O[ne]=P[ne])}function $(P,O,ne,te){var re=P.charAt(O+2);switch(re){case"-":if(P.charAt(O+3)==="-"){var me=P.indexOf("-->",O+4);return me>O?(ne.comment(P,O+4,me-O-4),me+3):(te.error("Unclosed comment"),-1)}else return-1;default:if(P.substr(O+3,6)=="CDATA["){var me=P.indexOf("]]>",O+9);return ne.startCDATA(),ne.characters(P,O+9,me-O-9),ne.endCDATA(),me+3}var Se=Y(P,O),Ae=Se.length;if(Ae>1&&/!doctype/i.test(Se[0][0])){var ve=Se[1][0],Te=!1,ye=!1;Ae>3&&(/^public$/i.test(Se[2][0])?(Te=Se[3][0],ye=Ae>4&&Se[4][0]):/^system$/i.test(Se[2][0])&&(ye=Se[3][0]));var _e=Se[Ae-1];return ne.startDTD(ve,Te,ye),ne.endDTD(),_e.index+_e[0].length}}return-1}function G(P,O,ne){var te=P.indexOf("?>",O);if(te){var re=P.substring(O,te).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return re?(re[0].length,ne.processingInstruction(re[1],re[2]),te+2):-1}return-1}function K(){this.attributeNames={}}K.prototype={setTagName:function(P){if(!r.test(P))throw new Error("invalid tagName:"+P);this.tagName=P},addValue:function(P,O,ne){if(!r.test(P))throw new Error("invalid attribute:"+P);this.attributeNames[P]=this.length,this[this.length++]={qName:P,value:O,offset:ne}},length:0,getLocalName:function(P){return this[P].localName},getLocator:function(P){return this[P].locator},getQName:function(P){return this[P].qName},getURI:function(P){return this[P].uri},getValue:function(P){return this[P].value}};function Y(P,O){var ne,te=[],re=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(re.lastIndex=O,re.exec(P);ne=re.exec(P);)if(te.push(ne),ne[1])return te}return Nc.XMLReader=g,Nc.ParseError=f,Nc}var xv;function Uw(){if(xv)return wu;xv=1;var s=ad(),e=vT(),t=Rw(),r=Bw(),i=e.DOMImplementation,n=s.NAMESPACE,a=r.ParseError,o=r.XMLReader;function l(k){return k.replace(/\r[\n\u0085]/g,`
|
|
76
|
+
`).replace(/[\r\u0085\u2028]/g,`
|
|
77
|
+
`)}function u(k){this.options=k||{locator:{}}}u.prototype.parseFromString=function(k,F){var L=this.options,W=new o,H=L.domBuilder||new d,$=L.errorHandler,G=L.locator,K=L.xmlns||{},Y=/\/x?html?$/.test(F),P=Y?t.HTML_ENTITIES:t.XML_ENTITIES;G&&H.setDocumentLocator(G),W.errorHandler=c($,H,G),W.domBuilder=L.domBuilder||H,Y&&(K[""]=n.HTML),K.xml=K.xml||n.XML;var O=L.normalizeLineEndings||l;return k&&typeof k=="string"?W.parse(O(k),K,P):W.errorHandler.error("invalid doc source"),H.doc};function c(k,F,L){if(!k){if(F instanceof d)return F;k=F}var W={},H=k instanceof Function;L=L||{};function $(G){var K=k[G];!K&&H&&(K=k.length==2?function(Y){k(G,Y)}:k),W[G]=K&&function(Y){K("[xmldom "+G+"] "+Y+g(L))}||function(){}}return $("warning"),$("error"),$("fatalError"),W}function d(){this.cdata=!1}function f(k,F){F.lineNumber=k.lineNumber,F.columnNumber=k.columnNumber}d.prototype={startDocument:function(){this.doc=new i().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(k,F,L,W){var H=this.doc,$=H.createElementNS(k,L||F),G=W.length;S(this,$),this.currentElement=$,this.locator&&f(this.locator,$);for(var K=0;K<G;K++){var k=W.getURI(K),Y=W.getValue(K),L=W.getQName(K),P=H.createAttributeNS(k,L);this.locator&&f(W.getLocator(K),P),P.value=P.nodeValue=Y,$.setAttributeNode(P)}},endElement:function(k,F,L){var W=this.currentElement;W.tagName,this.currentElement=W.parentNode},startPrefixMapping:function(k,F){},endPrefixMapping:function(k){},processingInstruction:function(k,F){var L=this.doc.createProcessingInstruction(k,F);this.locator&&f(this.locator,L),S(this,L)},ignorableWhitespace:function(k,F,L){},characters:function(k,F,L){if(k=E.apply(this,arguments),k){if(this.cdata)var W=this.doc.createCDATASection(k);else var W=this.doc.createTextNode(k);this.currentElement?this.currentElement.appendChild(W):/^\s*$/.test(k)&&this.doc.appendChild(W),this.locator&&f(this.locator,W)}},skippedEntity:function(k){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(k){(this.locator=k)&&(k.lineNumber=0)},comment:function(k,F,L){k=E.apply(this,arguments);var W=this.doc.createComment(k);this.locator&&f(this.locator,W),S(this,W)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(k,F,L){var W=this.doc.implementation;if(W&&W.createDocumentType){var H=W.createDocumentType(k,F,L);this.locator&&f(this.locator,H),S(this,H),this.doc.doctype=H}},warning:function(k){console.warn("[xmldom warning] "+k,g(this.locator))},error:function(k){console.error("[xmldom error] "+k,g(this.locator))},fatalError:function(k){throw new a(k,this.locator)}};function g(k){if(k)return`
|
|
78
|
+
@`+(k.systemId||"")+"#[line:"+k.lineNumber+",col:"+k.columnNumber+"]"}function E(k,F,L){return typeof k=="string"?k.substr(F,L):k.length>=F+L||F?new java.lang.String(k,F,L)+"":k}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(k){d.prototype[k]=function(){return null}});function S(k,F){k.currentElement?k.currentElement.appendChild(F):k.doc.appendChild(F)}return wu.__DOMHandler=d,wu.normalizeLineEndings=l,wu.DOMParser=u,wu}var Nv;function Fw(){if(Nv)return Eu;Nv=1;var s=vT();return Eu.DOMImplementation=s.DOMImplementation,Eu.XMLSerializer=s.XMLSerializer,Eu.DOMParser=Uw().DOMParser,Eu}var yT=Fw();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Dv=s=>!!s&&typeof s=="object",$i=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(r=>{Array.isArray(e[r])&&Array.isArray(t[r])?e[r]=e[r].concat(t[r]):Dv(e[r])&&Dv(t[r])?e[r]=$i(e[r],t[r]):e[r]=t[r]}),e),{}),_T=s=>Object.keys(s).map(e=>s[e]),$w=(s,e)=>{const t=[];for(let r=s;r<e;r++)t.push(r);return t},cl=s=>s.reduce((e,t)=>e.concat(t),[]),TT=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},jw=(s,e)=>s.reduce((t,r,i)=>(r[e]&&t.push(i),t),[]),Hw=(s,e)=>_T(s.reduce((t,r)=>(r.forEach(i=>{t[e(i)]=i}),t),{}));var hl={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Zu=({baseUrl:s="",source:e="",range:t="",indexRange:r=""})=>{const i={uri:e,resolvedUri:sd(s||"",e)};if(t||r){const a=(t||r).split("-");let o=N.BigInt?N.BigInt(a[0]):parseInt(a[0],10),l=N.BigInt?N.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l));let u;typeof l=="bigint"||typeof o=="bigint"?u=N.BigInt(l)-N.BigInt(o)+N.BigInt(1):u=l-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),i.byterange={length:u,offset:o}}return i},Vw=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=N.BigInt(s.offset)+N.BigInt(s.length)-N.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},Iv=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),qw={static(s){const{duration:e,timescale:t=1,sourceDuration:r,periodDuration:i}=s,n=Iv(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof i=="number"?{start:0,end:i/a}:{start:0,end:r/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:r,timescale:i=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=s,u=Iv(s.endNumber),c=(e+t)/1e3,d=r+a,g=c+o-d,E=Math.ceil(g*i/n),S=Math.floor((c-d-l)*i/n),k=Math.floor((c-d)*i/n);return{start:Math.max(0,S),end:typeof u=="number"?u:Math.min(E,k)}}},zw=s=>e=>{const{duration:t,timescale:r=1,periodStart:i,startNumber:n=1}=s;return{number:n+e,duration:t/r,timeline:i,time:e*t}},gm=s=>{const{type:e,duration:t,timescale:r=1,periodDuration:i,sourceDuration:n}=s,{start:a,end:o}=qw[e](s),l=$w(a,o).map(zw(s));if(e==="static"){const u=l.length-1,c=typeof i=="number"?i:n;l[u].duration=c-t/r*u}return l},bT=s=>{const{baseUrl:e,initialization:t={},sourceDuration:r,indexRange:i="",periodStart:n,presentationTime:a,number:o=0,duration:l}=s;if(!e)throw new Error(hl.NO_BASE_URL);const u=Zu({baseUrl:e,source:t.sourceURL,range:t.range}),c=Zu({baseUrl:e,source:e,indexRange:i});if(c.map=u,l){const d=gm(s);d.length&&(c.duration=d[0].duration,c.timeline=d[0].timeline)}else r&&(c.duration=r,c.timeline=n);return c.presentationTime=a||n,c.number=o,[c]},vm=(s,e,t)=>{const r=s.sidx.map?s.sidx.map:null,i=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,o=a.offset+a.length,l=e.timescale,u=e.references.filter(k=>k.referenceType!==1),c=[],d=s.endList?"static":"dynamic",f=s.sidx.timeline;let g=f,E=s.mediaSequence||0,S;typeof e.firstOffset=="bigint"?S=N.BigInt(o)+e.firstOffset:S=o+e.firstOffset;for(let k=0;k<u.length;k++){const F=e.references[k],L=F.referencedSize,W=F.subsegmentDuration;let H;typeof S=="bigint"?H=S+N.BigInt(L)-N.BigInt(1):H=S+L-1;const $=`${S}-${H}`,K=bT({baseUrl:t,timescale:l,timeline:n,periodStart:f,presentationTime:g,number:E,duration:W,sourceDuration:i,indexRange:$,type:d})[0];r&&(K.map=r),c.push(K),typeof S=="bigint"?S+=N.BigInt(L):S+=L,g+=W/l,E++}return s.segments=c,s},Ww=["AUDIO","SUBTITLES"],Gw=1/60,ST=s=>Hw(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Kw=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},Pv=s=>{let e=[];return Mw(s,Ww,(t,r,i,n)=>{e=e.concat(t.playlists||[])}),e},Lv=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,r)=>{t.number=s.mediaSequence+r})},Xw=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(r=>{r.discontinuitySequence=t.findIndex(function({timeline:l}){return l===r.timeline});const i=Kw(s,r.attributes.NAME);if(!i||r.sidx)return;const n=r.segments[0],a=i.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)<Gw});if(a===-1){Lv({playlist:r,mediaSequence:i.mediaSequence+i.segments.length}),r.segments[0].discontinuity=!0,r.discontinuityStarts.unshift(0),(!i.segments.length&&r.timeline>i.timeline||i.segments.length&&r.timeline>i.segments[i.segments.length-1].timeline)&&r.discontinuitySequence--;return}i.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),Lv({playlist:r,mediaSequence:i.segments[a].number})})},Yw=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Pv(s)),r=e.playlists.concat(Pv(e));return e.timelineStarts=ST([s.timelineStarts,e.timelineStarts]),Xw({oldPlaylists:t,newPlaylists:r,timelineStarts:e.timelineStarts}),e},od=s=>s&&s.uri+"-"+Vw(s.byterange),sf=s=>{const e=s.reduce(function(r,i){return r[i.attributes.baseUrl]||(r[i.attributes.baseUrl]=[]),r[i.attributes.baseUrl].push(i),r},{});let t=[];return Object.values(e).forEach(r=>{const i=_T(r.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(i)}),t.map(r=>(r.discontinuityStarts=jw(r.segments||[],"discontinuity"),r))},ym=(s,e)=>{const t=od(s.sidx),r=t&&e[t]&&e[t].sidx;return r&&vm(s,r,s.sidx.resolvedUri),s},Qw=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=ym(s[t],e);return s},Jw=({attributes:s,segments:e,sidx:t,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:n},a)=>{const o={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:i,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:r,segments:e};return s.contentProtection&&(o.contentProtection=s.contentProtection),s.serviceLocation&&(o.attributes.serviceLocation=s.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},Zw=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:r,discontinuitySequence:i})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},ek=(s,e={},t=!1)=>{let r;const i=s.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let u=a.attributes.label||"main";if(l&&!a.attributes.label){const d=o?` (${o})`:"";u=`${a.attributes.lang}${d}`}n[u]||(n[u]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const c=ym(Jw(a,t),e);return n[u].playlists.push(c),typeof r>"u"&&o==="main"&&(r=a,r.default=!0),n},{});if(!r){const n=Object.keys(i)[0];i[n].default=!0}return i},tk=(s,e={})=>s.reduce((t,r)=>{const i=r.attributes.label||r.attributes.lang||"text",n=r.attributes.lang||"und";return t[i]||(t[i]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[i].playlists.push(ym(Zw(r),e)),t},{}),ik=s=>s.reduce((e,t)=>(t&&t.forEach(r=>{const{channel:i,language:n}=r;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},r.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(e[n].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(e[n]["3D"]=r["3D"])}),e),{}),rk=({attributes:s,segments:e,sidx:t,discontinuityStarts:r})=>{const i={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:r,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(i.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(i.contentProtection=s.contentProtection),s.serviceLocation&&(i.attributes.serviceLocation=s.serviceLocation),t&&(i.sidx=t),i},nk=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",sk=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",ak=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",ok=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:r}){return r===t.timeline}),t.segments&&t.segments.forEach((r,i)=>{r.number=i})})},Ov=s=>s?Object.keys(s).reduce((e,t)=>{const r=s[t];return e.concat(r.playlists)},[]):[],lk=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:r={},previousManifest:i,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=s[0].attributes,c=sf(s.filter(nk)).map(rk),d=sf(s.filter(sk)),f=sf(s.filter(ak)),g=s.map(H=>H.attributes.captionServices).filter(Boolean),E={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Qw(c,r)};u>=0&&(E.minimumUpdatePeriod=u*1e3),e&&(E.locations=e),t&&(E.contentSteering=t),o==="dynamic"&&(E.suggestedPresentationDelay=l),n&&n.length>0&&(E.eventStream=n);const S=E.playlists.length===0,k=d.length?ek(d,r,S):null,F=f.length?tk(f,r):null,L=c.concat(Ov(k),Ov(F)),W=L.map(({timelineStarts:H})=>H);return E.timelineStarts=ST(W),ok(L,E.timelineStarts),k&&(E.mediaGroups.AUDIO.audio=k),F&&(E.mediaGroups.SUBTITLES.subs=F),g.length&&(E.mediaGroups["CLOSED-CAPTIONS"].cc=ik(g)),i?Yw({oldManifest:i,newManifest:E}):E},uk=(s,e,t)=>{const{NOW:r,clientOffset:i,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=s,u=(r+i)/1e3,c=n+o,f=u+l-c;return Math.ceil((f*a-e)/t)},CT=(s,e)=>{const{type:t,minimumUpdatePeriod:r=0,media:i="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=s,u=[];let c=-1;for(let d=0;d<e.length;d++){const f=e[d],g=f.d,E=f.r||0,S=f.t||0;c<0&&(c=S),S&&S>c&&(c=S);let k;if(E<0){const W=d+1;W===e.length?t==="dynamic"&&r>0&&i.indexOf("$Number$")>0?k=uk(s,c,g):k=(n*a-c)/g:k=(e[W].t-c)/g}else k=E+1;const F=o+u.length+k;let L=o+u.length;for(;L<F;)u.push({number:L,duration:g/a,time:c,timeline:l}),c+=g,L++}return u},ck=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,hk=s=>(e,t,r,i)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(r?i=parseInt(i,10):i=1,n.length>=i)?n:`${new Array(i-n.length+1).join("0")}${n}`},Mv=(s,e)=>s.replace(ck,hk(e)),dk=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?gm(s):CT(s,e),fk=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=s,i=Zu({baseUrl:s.baseUrl,source:Mv(r.sourceURL,t),range:r.range});return dk(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=Mv(s.media||"",t),l=s.timescale||1,u=s.presentationTimeOffset||0,c=s.periodStart+(a.time-u)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:sd(s.baseUrl||"",o),map:i,number:a.number,presentationTime:c}})},pk=(s,e)=>{const{baseUrl:t,initialization:r={}}=s,i=Zu({baseUrl:t,source:r.sourceURL,range:r.range}),n=Zu({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=i,n},mk=(s,e)=>{const{duration:t,segmentUrls:r=[],periodStart:i}=s;if(!t&&!e||t&&e)throw new Error(hl.SEGMENT_TIME_UNSPECIFIED);const n=r.map(l=>pk(s,l));let a;return t&&(a=gm(s)),e&&(a=CT(s,e)),a.map((l,u)=>{if(n[u]){const c=n[u],d=s.timescale||1,f=s.presentationTimeOffset||0;return c.timeline=l.timeline,c.duration=l.duration,c.number=l.number,c.presentationTime=i+(l.time-f)/d,c}}).filter(l=>l)},gk=({attributes:s,segmentInfo:e})=>{let t,r;e.template?(r=fk,t=$i(s,e.template)):e.base?(r=bT,t=$i(s,e.base)):e.list&&(r=mk,t=$i(s,e.list));const i={attributes:s};if(!r)return i;const n=r(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return i.attributes=t,i.segments=n,e.base&&t.indexRange&&(i.sidx=n[0],i.segments=[]),i},vk=s=>s.map(gk),ai=(s,e)=>TT(s.childNodes).filter(({tagName:t})=>t===e),hc=s=>s.textContent.trim(),yk=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Po=s=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!o)return 0;const[l,u,c,d,f,g]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(c||0)*86400+parseFloat(d||0)*3600+parseFloat(f||0)*60+parseFloat(g||0)},_k=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),Rv={mediaPresentationDuration(s){return Po(s)},availabilityStartTime(s){return _k(s)/1e3},minimumUpdatePeriod(s){return Po(s)},suggestedPresentationDelay(s){return Po(s)},type(s){return s},timeShiftBufferDepth(s){return Po(s)},start(s){return Po(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return yk(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?Po(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},Ci=s=>s&&s.attributes?TT(s.attributes).reduce((e,t)=>{const r=Rv[t.name]||Rv.DEFAULT;return e[t.name]=r(t.value),e},{}):{},Tk={"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"},ld=(s,e)=>e.length?cl(s.map(function(t){return e.map(function(r){const i=hc(r),n=sd(t.baseUrl,i),a=$i(Ci(r),{baseUrl:n});return n!==i&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,_m=s=>{const e=ai(s,"SegmentTemplate")[0],t=ai(s,"SegmentList")[0],r=t&&ai(t,"SegmentURL").map(d=>$i({tag:"SegmentURL"},Ci(d))),i=ai(s,"SegmentBase")[0],n=t||e,a=n&&ai(n,"SegmentTimeline")[0],o=t||i||e,l=o&&ai(o,"Initialization")[0],u=e&&Ci(e);u&&l?u.initialization=l&&Ci(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&ai(a,"S").map(d=>Ci(d)),list:t&&$i(Ci(t),{segmentUrls:r,initialization:Ci(l)}),base:i&&$i(Ci(i),{initialization:Ci(l)})};return Object.keys(c).forEach(d=>{c[d]||delete c[d]}),c},bk=(s,e,t)=>r=>{const i=ai(r,"BaseURL"),n=ld(e,i),a=$i(s,Ci(r)),o=_m(r);return n.map(l=>({segmentInfo:$i(t,o),attributes:$i(a,l)}))},Sk=s=>s.reduce((e,t)=>{const r=Ci(t);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());const i=Tk[r.schemeIdUri];if(i){e[i]={attributes:r};const n=ai(t,"cenc:pssh")[0];if(n){const a=hc(n);e[i].pssh=a&&hT(a)}}return e},{}),Ck=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let r,i;return i=t,/^CC\d=/.test(t)?[r,i]=t.split("="):/^CC\d$/.test(t)&&(r=t),{channel:r,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[i,n=""]=t.split("=");r.channel=i,r.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?r.language=l:o==="er"?r.easyReader=Number(l):o==="war"?r.aspectRatio=Number(l):o==="3D"&&(r["3D"]=Number(l))})}else r.language=t;return r.channel&&(r.channel="SERVICE"+r.channel),r})},Ek=s=>cl(ai(s.node,"EventStream").map(e=>{const t=Ci(e),r=t.schemeIdUri;return ai(e,"Event").map(i=>{const n=Ci(i),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,u=a/o+s.attributes.start;return{schemeIdUri:r,value:t.value,id:n.id,start:u,end:u+l/o,messageData:hc(i)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),wk=(s,e,t)=>r=>{const i=Ci(r),n=ld(e,ai(r,"BaseURL")),a=ai(r,"Role")[0],o={role:Ci(a)};let l=$i(s,i,o);const u=ai(r,"Accessibility")[0],c=Ck(Ci(u));c&&(l=$i(l,{captionServices:c}));const d=ai(r,"Label")[0];if(d&&d.childNodes.length){const k=d.childNodes[0].nodeValue.trim();l=$i(l,{label:k})}const f=Sk(ai(r,"ContentProtection"));Object.keys(f).length&&(l=$i(l,{contentProtection:f}));const g=_m(r),E=ai(r,"Representation"),S=$i(t,g);return cl(E.map(bk(l,n,S)))},kk=(s,e)=>(t,r)=>{const i=ld(e,ai(t.node,"BaseURL")),n=$i(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=ai(t.node,"AdaptationSet"),o=_m(t.node);return cl(a.map(wk(n,i,o)))},Ak=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=$i({serverURL:hc(s[0])},Ci(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},xk=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,Nk=(s,e={})=>{const{manifestUri:t="",NOW:r=Date.now(),clientOffset:i=0,eventHandler:n=function(){}}=e,a=ai(s,"Period");if(!a.length)throw new Error(hl.INVALID_NUMBER_OF_PERIOD);const o=ai(s,"Location"),l=Ci(s),u=ld([{baseUrl:t}],ai(s,"BaseURL")),c=ai(s,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=i,o.length&&(l.locations=o.map(hc));const d=[];return a.forEach((f,g)=>{const E=Ci(f),S=d[g-1];E.start=xk({attributes:E,priorPeriodAttributes:S?S.attributes:null,mpdType:l.type}),d.push({node:f,attributes:E})}),{locations:l.locations,contentSteeringInfo:Ak(c,n),representationInfo:cl(d.map(kk(l,u))),eventStream:cl(d.map(Ek))}},ET=s=>{if(s==="")throw new Error(hl.DASH_EMPTY_MANIFEST);const e=new yT.DOMParser;let t,r;try{t=e.parseFromString(s,"application/xml"),r=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(hl.DASH_INVALID_XML);return r},Dk=s=>{const e=ai(s,"UTCTiming")[0];if(!e)return null;const t=Ci(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(hl.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Ik=(s,e={})=>{const t=Nk(ET(s),e),r=vk(t.representationInfo);return lk({dashPlaylists:r,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Pk=s=>Dk(ET(s));var af,Bv;function Lk(){if(Bv)return af;Bv=1;var s=Math.pow(2,32),e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i;return r.getBigUint64?(i=r.getBigUint64(0),i<Number.MAX_SAFE_INTEGER?Number(i):i):r.getUint32(0)*s+r.getUint32(4)};return af={getUint64:e,MAX_UINT32:s},af}var of,Uv;function Ok(){if(Uv)return of;Uv=1;var s=Lk().getUint64,e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},n=12;i.version===0?(i.earliestPresentationTime=r.getUint32(n),i.firstOffset=r.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(t.subarray(n)),i.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=r.getUint16(n);for(n+=2;a>0;n+=12,a--)i.references.push({referenceType:(t[n]&128)>>>7,referencedSize:r.getUint32(n)&2147483647,subsegmentDuration:r.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:r.getUint32(n+8)&268435455});return i};return of=e,of}var Mk=Ok();const Rk=Ln(Mk);var Bk=Qe([73,68,51]),Uk=function(e,t){t===void 0&&(t=0),e=Qe(e);var r=e[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?i+20:i+10},Ru=function s(e,t){return t===void 0&&(t=0),e=Qe(e),e.length-t<10||!ni(e,Bk,{offset:t})?t:(t+=Uk(e,t),s(e,t))},Fv=function(e){return typeof e=="string"?gT(e):e},Fk=function(e){return Array.isArray(e)?e.map(function(t){return Fv(t)}):[Fv(e)]},$k=function s(e,t,r){r===void 0&&(r=!1),t=Fk(t),e=Qe(e);var i=[];if(!t.length)return i;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(r)break;l=e.length}var u=e.subarray(n+8,l);ni(o,t[0])&&(t.length===1?i.push(u):i.push.apply(i,s(u,t.slice(1),r))),n=l}return i},Dc={EBML:Qe([26,69,223,163]),DocType:Qe([66,130]),Segment:Qe([24,83,128,103]),SegmentInfo:Qe([21,73,169,102]),Tracks:Qe([22,84,174,107]),Track:Qe([174]),TrackNumber:Qe([215]),DefaultDuration:Qe([35,227,131]),TrackEntry:Qe([174]),TrackType:Qe([131]),FlagDefault:Qe([136]),CodecID:Qe([134]),CodecPrivate:Qe([99,162]),VideoTrack:Qe([224]),AudioTrack:Qe([225]),Cluster:Qe([31,67,182,117]),Timestamp:Qe([231]),TimestampScale:Qe([42,215,177]),BlockGroup:Qe([160]),BlockDuration:Qe([155]),Block:Qe([161]),SimpleBlock:Qe([163])},op=[128,64,32,16,8,4,2,1],jk=function(e){for(var t=1,r=0;r<op.length&&!(e&op[r]);r++)t++;return t},fh=function(e,t,r,i){r===void 0&&(r=!0),i===void 0&&(i=!1);var n=jk(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=op[n-1]),{length:n,value:Pw(a,{signed:i}),bytes:a}},$v=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?Lw(e):e},Hk=function(e){return Array.isArray(e)?e.map(function(t){return $v(t)}):[$v(e)]},Vk=function s(e,t,r){if(r>=t.length)return t.length;var i=fh(t,r,!1);if(ni(e.bytes,i.bytes))return r;var n=fh(t,r+i.length);return s(e,t,r+n.length+n.value+i.length)},jv=function s(e,t){t=Hk(t),e=Qe(e);var r=[];if(!t.length)return r;for(var i=0;i<e.length;){var n=fh(e,i,!1),a=fh(e,i+n.length),o=i+n.length+a.length;a.value===127&&(a.value=Vk(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);ni(t[0],n.bytes)&&(t.length===1?r.push(u):r=r.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;i+=c}return r},qk=Qe([0,0,0,1]),zk=Qe([0,0,1]),Wk=Qe([0,0,3]),Gk=function(e){for(var t=[],r=1;r<e.length-2;)ni(e.subarray(r,r+3),Wk)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var i=e.length-t.length,n=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},wT=function(e,t,r,i){e=Qe(e),r=[].concat(r);for(var n=0,a,o=0;n<e.length&&(o<i||a);){var l=void 0;if(ni(e.subarray(n),qk)?l=4:ni(e.subarray(n),zk)&&(l=3),!l){n++;continue}if(o++,a)return Gk(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),r.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},Kk=function(e,t,r){return wT(e,"h264",t,r)},Xk=function(e,t,r){return wT(e,"h265",t,r)},ur={webm:Qe([119,101,98,109]),matroska:Qe([109,97,116,114,111,115,107,97]),flac:Qe([102,76,97,67]),ogg:Qe([79,103,103,83]),ac3:Qe([11,119]),riff:Qe([82,73,70,70]),avi:Qe([65,86,73]),wav:Qe([87,65,86,69]),"3gp":Qe([102,116,121,112,51,103]),mp4:Qe([102,116,121,112]),fmp4:Qe([115,116,121,112]),mov:Qe([102,116,121,112,113,116]),moov:Qe([109,111,111,118]),moof:Qe([109,111,111,102])},dl={aac:function(e){var t=Ru(e);return ni(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ru(e);return ni(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=jv(e,[Dc.EBML,Dc.DocType])[0];return ni(t,ur.webm)},mkv:function(e){var t=jv(e,[Dc.EBML,Dc.DocType])[0];return ni(t,ur.matroska)},mp4:function(e){if(dl["3gp"](e)||dl.mov(e))return!1;if(ni(e,ur.mp4,{offset:4})||ni(e,ur.fmp4,{offset:4})||ni(e,ur.moof,{offset:4})||ni(e,ur.moov,{offset:4}))return!0},mov:function(e){return ni(e,ur.mov,{offset:4})},"3gp":function(e){return ni(e,ur["3gp"],{offset:4})},ac3:function(e){var t=Ru(e);return ni(e,ur.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=Ru(e);return ni(e,ur.flac,{offset:t})},ogg:function(e){return ni(e,ur.ogg)},avi:function(e){return ni(e,ur.riff)&&ni(e,ur.avi,{offset:8})},wav:function(e){return ni(e,ur.riff)&&ni(e,ur.wav,{offset:8})},h264:function(e){return Kk(e,7,3).length},h265:function(e){return Xk(e,[32,33],3).length}},lp=Object.keys(dl).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);lp.forEach(function(s){var e=dl[s];dl[s]=function(t){return e(Qe(t))}});var Yk=dl,Tm=function(e){e=Qe(e);for(var t=0;t<lp.length;t++){var r=lp[t];if(Yk[r](e))return r}return""},Qk=function(e){return $k(e,["moof"]).length>0},lf,Hv;function Jk(){if(Hv)return lf;Hv=1;var s=9e4,e,t,r,i,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},r=function(l){return l/s},i=function(l,u){return l/u},n=function(l,u){return e(i(l,u))},a=function(l,u){return t(r(l),u)},o=function(l,u,c){return r(c?l:l-u)},lf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},lf}var Qa=Jk();/**
|
|
79
|
+
* @license
|
|
80
|
+
* Video.js 8.20.0 <http://videojs.com/>
|
|
81
|
+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
82
|
+
* Available under Apache License Version 2.0
|
|
83
|
+
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
84
|
+
*
|
|
85
|
+
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
86
|
+
* Available under Apache License Version 2.0
|
|
87
|
+
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
88
|
+
*/var up="8.20.0";const Fs={},wa=function(s,e){return Fs[s]=Fs[s]||[],e&&(Fs[s]=Fs[s].concat(e)),Fs[s]},Zk=function(s,e){wa(s,e)},kT=function(s,e){const t=wa(s).indexOf(e);return t<=-1?!1:(Fs[s]=Fs[s].slice(),Fs[s].splice(t,1),!0)},eA=function(s,e){wa(s,[].concat(e).map(t=>{const r=(...i)=>(kT(s,r),t(...i));return r}))},ph={prefixed:!0},Zc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Vv=Zc[0];let Bu;for(let s=0;s<Zc.length;s++)if(Zc[s][1]in de){Bu=Zc[s];break}if(Bu){for(let s=0;s<Bu.length;s++)ph[Vv[s]]=Bu[s];ph.prefixed=Bu[0]!==Vv[0]}let Ar=[];const tA=(s,e,t)=>(r,i,n)=>{const a=e.levels[i],o=new RegExp(`^(${a})$`);let l=s;if(r!=="log"&&n.unshift(r.toUpperCase()+":"),t&&(l=`%c${s}`,n.unshift(t)),n.unshift(l+":"),Ar){Ar.push([].concat(n));const c=Ar.length-1e3;Ar.splice(0,c>0?c:0)}if(!N.console)return;let u=N.console[r];!u&&r==="debug"&&(u=N.console.info||N.console.log),!(!u||!a||!o.test(r))&&u[Array.isArray(n)?"apply":"call"](N.console,n)};function cp(s,e=":",t=""){let r="info",i;function n(...a){i("log",r,a)}return i=tA(s,n,t),n.createLogger=(a,o,l)=>{const u=o!==void 0?o:e,c=l!==void 0?l:t,d=`${s} ${u} ${a}`;return cp(d,u,c)},n.createNewLogger=(a,o,l)=>cp(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>Ar?[].concat(Ar):[],n.history.filter=a=>(Ar||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ar&&(Ar.length=0)},n.history.disable=()=>{Ar!==null&&(Ar.length=0,Ar=null)},n.history.enable=()=>{Ar===null&&(Ar=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const mt=cp("VIDEOJS"),AT=mt.createLogger,iA=Object.prototype.toString,xT=function(s){return ps(s)?Object.keys(s):[]};function Yo(s,e){xT(s).forEach(t=>e(s[t],t))}function NT(s,e,t=0){return xT(s).reduce((r,i)=>e(r,s[i],i),t)}function ps(s){return!!s&&typeof s=="object"}function fl(s){return ps(s)&&iA.call(s)==="[object Object]"&&s.constructor===Object}function Vt(...s){const e={};return s.forEach(t=>{t&&Yo(t,(r,i)=>{if(!fl(r)){e[i]=r;return}fl(e[i])||(e[i]={}),e[i]=Vt(e[i],r)})}),e}function DT(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const r=s[t];e.push(r)}return e}function ud(s,e,t,r=!0){const i=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return i(a),a}};return r&&(n.set=i),Object.defineProperty(s,e,n)}var rA=Object.freeze({__proto__:null,each:Yo,reduce:NT,isObject:ps,isPlain:fl,merge:Vt,values:DT,defineLazyProperty:ud});let bm=!1,IT=null,ms=!1,PT,LT=!1,Qo=!1,Jo=!1,gs=!1,Sm=null,cd=null;const nA=!!(N.cast&&N.cast.framework&&N.cast.framework.CastReceiverContext);let OT=null,mh=!1,hd=!1,gh=!1,dd=!1,vh=!1,yh=!1,_h=!1;const ec=!!(xl()&&("ontouchstart"in N||N.navigator.maxTouchPoints||N.DocumentTouch&&N.document instanceof N.DocumentTouch)),ya=N.navigator&&N.navigator.userAgentData;ya&&ya.platform&&ya.brands&&(ms=ya.platform==="Android",Qo=!!ya.brands.find(s=>s.brand==="Microsoft Edge"),Jo=!!ya.brands.find(s=>s.brand==="Chromium"),gs=!Qo&&Jo,Sm=cd=(ya.brands.find(s=>s.brand==="Chromium")||{}).version||null,hd=ya.platform==="Windows");if(!Jo){const s=N.navigator&&N.navigator.userAgent||"";bm=/iPod/i.test(s),IT=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),ms=/Android/i.test(s),PT=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return t&&r?parseFloat(e[1]+"."+e[2]):t||null})(),LT=/Firefox/i.test(s),Qo=/Edg/i.test(s),Jo=/Chrome/i.test(s)||/CriOS/i.test(s),gs=!Qo&&Jo,Sm=cd=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),OT=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),vh=/Tizen/i.test(s),yh=/Web0S/i.test(s),_h=vh||yh,mh=/Safari/i.test(s)&&!gs&&!ms&&!Qo&&!_h,hd=/Windows/i.test(s),gh=/iPad/i.test(s)||mh&&ec&&!/iPhone/i.test(s),dd=/iPhone/i.test(s)&&!gh}const vr=dd||gh||bm,fd=(mh||vr)&&!gs;var MT=Object.freeze({__proto__:null,get IS_IPOD(){return bm},get IOS_VERSION(){return IT},get IS_ANDROID(){return ms},get ANDROID_VERSION(){return PT},get IS_FIREFOX(){return LT},get IS_EDGE(){return Qo},get IS_CHROMIUM(){return Jo},get IS_CHROME(){return gs},get CHROMIUM_VERSION(){return Sm},get CHROME_VERSION(){return cd},IS_CHROMECAST_RECEIVER:nA,get IE_VERSION(){return OT},get IS_SAFARI(){return mh},get IS_WINDOWS(){return hd},get IS_IPAD(){return gh},get IS_IPHONE(){return dd},get IS_TIZEN(){return vh},get IS_WEBOS(){return yh},get IS_SMART_TV(){return _h},TOUCH_ENABLED:ec,IS_IOS:vr,IS_ANY_SAFARI:fd});function qv(s){return typeof s=="string"&&!!s.trim()}function sA(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function xl(){return de===N.document}function Nl(s){return ps(s)&&s.nodeType===1}function RT(){try{return N.parent!==N.self}catch{return!0}}function BT(s){return function(e,t){if(!qv(e))return de[s](null);qv(t)&&(t=de.querySelector(t));const r=Nl(t)?t:de;return r[s]&&r[s](e)}}function it(s="div",e={},t={},r){const i=de.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Da(i,a):(i[n]!==a||n==="tabIndex")&&(i[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){i.setAttribute(n,t[n])}),r&&Cm(i,r),i}function Da(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function hp(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Vu(s,e){return sA(e),s.classList.contains(e)}function to(s,...e){return s.classList.add(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),s}function pd(s,...e){return s?(s.classList.remove(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),s):(mt.warn("removeClass was called with an element that doesn't exist"),null)}function UT(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(r=>s.classList.toggle(r,t)),s}function FT(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const r=e[t];r===null||typeof r>"u"||r===!1?s.removeAttribute(t):s.setAttribute(t,r===!0?"":r)})}function Sa(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const r=s.attributes;for(let i=r.length-1;i>=0;i--){const n=r[i].name;let a=r[i].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function $T(s,e){return s.getAttribute(e)}function pl(s,e,t){s.setAttribute(e,t)}function md(s,e){s.removeAttribute(e)}function jT(){de.body.focus(),de.onselectstart=function(){return!1}}function HT(){de.onselectstart=function(){return!0}}function ml(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(gl(s,"height"))),t.width||(t.width=parseFloat(gl(s,"width"))),t}}function tc(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let r=0,i=0;for(;s.offsetParent&&s!==de[ph.fullscreenElement];)r+=s.offsetLeft,i+=s.offsetTop,s=s.offsetParent;return{left:r,top:i,width:e,height:t}}function gd(s,e){const t={x:0,y:0};if(vr){let c=s;for(;c&&c.nodeName.toLowerCase()!=="html";){const d=gl(c,"transform");if(/^matrix/.test(d)){const f=d.slice(7,-1).split(/,\s/).map(Number);t.x+=f[4],t.y+=f[5]}else if(/^matrix3d/.test(d)){const f=d.slice(9,-1).split(/,\s/).map(Number);t.x+=f[12],t.y+=f[13]}if(c.assignedSlot&&c.assignedSlot.parentElement&&N.WebKitCSSMatrix){const f=N.getComputedStyle(c.assignedSlot.parentElement).transform,g=new N.WebKitCSSMatrix(f);t.x+=g.m41,t.y+=g.m42}c=c.parentNode||c.host}}const r={},i=tc(e.target),n=tc(s),a=n.width,o=n.height;let l=e.offsetY-(n.top-i.top),u=e.offsetX-(n.left-i.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,vr&&(u-=t.x,l-=t.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,u/a)),r}function VT(s){return ps(s)&&s.nodeType===3}function vd(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function qT(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Nl(e)||VT(e))return e;if(typeof e=="string"&&/\S/.test(e))return de.createTextNode(e)}).filter(e=>e)}function Cm(s,e){return qT(e).forEach(t=>s.appendChild(t)),s}function zT(s,e){return Cm(vd(s),e)}function ic(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const ka=BT("querySelector"),WT=BT("querySelectorAll");function gl(s,e){if(!s||!e)return"";if(typeof N.getComputedStyle=="function"){let t;try{t=N.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function GT(s){[...de.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(i=>i.cssText).join(""),r=de.createElement("style");r.textContent=t,s.document.head.appendChild(r)}catch{const r=de.createElement("link");r.rel="stylesheet",r.type=e.type,r.media=e.media.mediaText,r.href=e.href,s.document.head.appendChild(r)}})}var KT=Object.freeze({__proto__:null,isReal:xl,isEl:Nl,isInFrame:RT,createEl:it,textContent:Da,prependTo:hp,hasClass:Vu,addClass:to,removeClass:pd,toggleClass:UT,setAttributes:FT,getAttributes:Sa,getAttribute:$T,setAttribute:pl,removeAttribute:md,blockTextSelection:jT,unblockTextSelection:HT,getBoundingClientRect:ml,findPosition:tc,getPointerPosition:gd,isTextNode:VT,emptyEl:vd,normalizeContent:qT,appendContent:Cm,insertContent:zT,isSingleLeftClick:ic,$:ka,$$:WT,computedStyle:gl,copyStyleSheetsToWindow:GT});let XT=!1,dp;const aA=function(){if(dp.options.autoSetup===!1)return;const s=Array.prototype.slice.call(de.getElementsByTagName("video")),e=Array.prototype.slice.call(de.getElementsByTagName("audio")),t=Array.prototype.slice.call(de.getElementsByTagName("video-js")),r=s.concat(e,t);if(r&&r.length>0)for(let i=0,n=r.length;i<n;i++){const a=r[i];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&dp(a);else{fp(1);break}}else XT||fp(1)};function fp(s,e){xl()&&(e&&(dp=e),N.setTimeout(aA,s))}function pp(){XT=!0,N.removeEventListener("load",pp)}xl()&&(de.readyState==="complete"?pp():N.addEventListener("load",pp));const YT=function(s){const e=de.createElement("style");return e.className=s,e},QT=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var fr=new WeakMap;const oA=3;let lA=oA;function dn(){return lA++}function zv(s,e){if(!fr.has(s))return;const t=fr.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.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&&fr.delete(s)}function Em(s,e,t,r){t.forEach(function(i){s(e,i,r)})}function yd(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const r=s||N.event;s={};const i=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in r)i.includes(n)||n==="returnValue"&&r.preventDefault||(s[n]=r[n]);if(s.target||(s.target=s.srcElement||de),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){r.preventDefault&&r.preventDefault(),s.returnValue=!1,r.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),s.cancelBubble=!0,r.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=de.documentElement,a=de.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let Ic;const uA=function(){if(typeof Ic!="boolean"){Ic=!1;try{const s=Object.defineProperty({},"passive",{get(){Ic=!0}});N.addEventListener("test",null,s),N.removeEventListener("test",null,s)}catch{}}return Ic},cA=["touchstart","touchmove"];function Kr(s,e,t){if(Array.isArray(e))return Em(Kr,s,e,t);fr.has(s)||fr.set(s,{});const r=fr.get(s);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=dn()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(i,n){if(r.disabled)return;i=yd(i);const a=r.handlers[i.type];if(a){const o=a.slice(0);for(let l=0,u=o.length;l<u&&!i.isImmediatePropagationStopped();l++)try{o[l].call(s,i,n)}catch(c){mt.error(c)}}}),r.handlers[e].length===1)if(s.addEventListener){let i=!1;uA()&&cA.indexOf(e)>-1&&(i={passive:!0}),s.addEventListener(e,r.dispatcher,i)}else s.attachEvent&&s.attachEvent("on"+e,r.dispatcher)}function tr(s,e,t){if(!fr.has(s))return;const r=fr.get(s);if(!r.handlers)return;if(Array.isArray(e))return Em(tr,s,e,t);const i=function(a,o){r.handlers[o]=[],zv(a,o)};if(e===void 0){for(const a in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},a)&&i(s,a);return}const n=r.handlers[e];if(n){if(!t){i(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);zv(s,e)}}function Dl(s,e,t){const r=fr.has(s)?fr.get(s):{},i=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=yd(e),r.dispatcher&&r.dispatcher.call(s,e,t),i&&!e.isPropagationStopped()&&e.bubbles===!0)Dl.call(null,i,e,t);else if(!i&&!e.defaultPrevented&&e.target&&e.target[e.type]){fr.has(e.target)||fr.set(e.target,{});const n=fr.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 _d(s,e,t){if(Array.isArray(e))return Em(_d,s,e,t);const r=function(){tr(s,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||dn(),Kr(s,e,r)}function wm(s,e,t){const r=function(){tr(s,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||dn(),Kr(s,e,r)}var hA=Object.freeze({__proto__:null,fixEvent:yd,on:Kr,off:tr,trigger:Dl,one:_d,any:wm});const fn=30,Yt=function(s,e,t){e.guid||(e.guid=dn());const r=e.bind(s);return r.guid=t?t+"_"+e.guid:e.guid,r},vs=function(s,e){let t=N.performance.now();return function(...i){const n=N.performance.now();n-t>=e&&(s(...i),t=n)}},JT=function(s,e,t,r=N){let i;const n=()=>{r.clearTimeout(i),i=null},a=function(){const o=this,l=arguments;let u=function(){i=null,u=null,t||s.apply(o,l)};!i&&t&&s.apply(o,l),r.clearTimeout(i),i=r.setTimeout(u,e)};return a.cancel=n,a};var dA=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:fn,bind_:Yt,throttle:vs,debounce:JT});let ku,Xr=class{on(e,t){const r=this.addEventListener;this.addEventListener=()=>{},Kr(this,e,t),this.addEventListener=r}off(e,t){tr(this,e,t)}one(e,t){const r=this.addEventListener;this.addEventListener=()=>{},_d(this,e,t),this.addEventListener=r}any(e,t){const r=this.addEventListener;this.addEventListener=()=>{},wm(this,e,t),this.addEventListener=r}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=yd(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Dl(this,e)}queueTrigger(e){ku||(ku=new Map);const t=e.type||e;let r=ku.get(this);r||(r=new Map,ku.set(this,r));const i=r.get(t);r.delete(t),N.clearTimeout(i);const n=N.setTimeout(()=>{r.delete(t),r.size===0&&(r=null,ku.delete(this)),this.trigger(e)},0);r.set(t,n)}};Xr.prototype.allowedEvents_={};Xr.prototype.addEventListener=Xr.prototype.on;Xr.prototype.removeEventListener=Xr.prototype.off;Xr.prototype.dispatchEvent=Xr.prototype.trigger;const Td=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,Vs=s=>s instanceof Xr||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),fA=(s,e)=>{Vs(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},mp=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,Th=(s,e,t)=>{if(!s||!s.nodeName&&!Vs(s))throw new Error(`Invalid target for ${Td(e)}#${t}; must be a DOM node or evented object.`)},ZT=(s,e,t)=>{if(!mp(s))throw new Error(`Invalid event type for ${Td(e)}#${t}; must be a non-empty string or array.`)},eb=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Td(e)}#${t}; must be a function.`)},uf=(s,e,t)=>{const r=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let i,n,a;return r?(i=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(i=e[0],n=e[1],a=e[2]),Th(i,s,t),ZT(n,s,t),eb(a,s,t),a=Yt(s,a),{isTargetingSelf:r,target:i,type:n,listener:a}},qa=(s,e,t,r)=>{Th(s,s,e),s.nodeName?hA[e](s,t,r):s[e](t,r)},pA={on(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=uf(this,s,"on");if(qa(t,"on",r,i),!e){const n=()=>this.off(t,r,i);n.guid=i.guid;const a=()=>this.off("dispose",n);a.guid=i.guid,qa(this,"on","dispose",n),qa(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=uf(this,s,"one");if(e)qa(t,"one",r,i);else{const n=(...a)=>{this.off(t,r,n),i.apply(null,a)};n.guid=i.guid,qa(t,"one",r,n)}},any(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=uf(this,s,"any");if(e)qa(t,"any",r,i);else{const n=(...a)=>{this.off(t,r,n),i.apply(null,a)};n.guid=i.guid,qa(t,"any",r,n)}},off(s,e,t){if(!s||mp(s))tr(this.eventBusEl_,s,e);else{const r=s,i=e;Th(r,this,"off"),ZT(i,this,"off"),eb(t,this,"off"),t=Yt(this,t),this.off("dispose",t),r.nodeName?(tr(r,i,t),tr(r,"dispose",t)):Vs(r)&&(r.off(i,t),r.off("dispose",t))}},trigger(s,e){Th(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!mp(t))throw new Error(`Invalid event type for ${Td(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Dl(this.eventBusEl_,s,e)}};function km(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=it("span",{className:"vjs-event-bus"});return Object.assign(s,pA),s.eventedCallbacks&&s.eventedCallbacks.forEach(r=>{r()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(r){r&&fr.has(r)&&fr.delete(r)}),N.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const mA={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Yo(s,(t,r)=>{this.state[r]!==t&&(e=e||{},e[r]={from:this.state[r],to:t}),this.state[r]=t}),e&&Vs(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function tb(s,e){return Object.assign(s,mA),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&Vs(s)&&s.on("statechanged",s.handleStateChanged),s}const qu=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},pi=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},ib=function(s,e){return pi(s)===pi(e)};var gA=Object.freeze({__proto__:null,toLowerCase:qu,toTitleCase:pi,titleCaseEquals:ib});let ke=class kr{constructor(e,t,r){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Vt({},this.options_),t=this.options_=Vt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const i=e&&e.id&&e.id()||"no_player";this.id_=`${i}_component_${dn()}`}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(i=>this.addClass(i)),["on","off","one","any","trigger"].forEach(i=>{this[i]=void 0}),t.evented!==!1&&(km(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),tb(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(r),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_=Vt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,r){return it(e,t,r)}localize(e,t,r=e){const i=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[i],o=i&&i.split("-")[0],l=n&&n[o];let u=r;return a&&a[e]?u=a[e]:l&&l[e]&&(u=l[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(c,d){const f=t[d-1];let g=f;return typeof f>"u"&&(g=c),g})),u}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((r,i)=>r.concat(i),[]);let t=this;for(let r=0;r<e.length;r++)if(t=t.getChild(e[r]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const r="http://www.w3.org/2000/svg",i=it("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=de.createElementNS(r,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=de.createElementNS(r,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),i.appendChild(n),this.iconIsSet_?t.replaceChild(i,t.querySelector(".vjs-icon-placeholder")):t.appendChild(i),this.iconIsSet_=!0,i}addChild(e,t={},r=this.children_.length){let i,n;if(typeof e=="string"){n=pi(e);const a=t.componentClass||n;t.name=n;const o=kr.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;i=new o(this.player_||this,t)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,typeof i.id=="function"&&(this.childIndex_[i.id()]=i),n=n||i.name&&pi(i.name()),n&&(this.childNameIndex_[n]=i,this.childNameIndex_[qu(n)]=i),typeof i.el=="function"&&i.el()){let a=null;this.children_[r+1]&&(this.children_[r+1].el_?a=this.children_[r+1].el_:Nl(this.children_[r+1])&&(a=this.children_[r+1])),this.contentEl().insertBefore(i.el(),a)}return i}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[pi(e.name())]=null,this.childNameIndex_[qu(e.name())]=null;const r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,r=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const u=this.addChild(o,l);u&&(this[o]=u)};let i;const n=kr.getComponent("Tech");Array.isArray(e)?i=e:i=Object.keys(e),i.concat(Object.keys(this.options_).filter(function(a){return!i.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=kr.getComponent(a.opts.componentClass||pi(a.name));return o&&!n.isTech(o)}).forEach(r)}}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 ka(e,t||this.contentEl())}$$(e,t){return WT(e,t||this.contentEl())}hasClass(e){return Vu(this.el_,e)}addClass(...e){to(this.el_,...e)}removeClass(...e){pd(this.el_,...e)}toggleClass(e,t){UT(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 $T(this.el_,e)}setAttribute(e,t){pl(this.el_,e,t)}removeAttribute(e){md(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,r){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",r||this.trigger("componentresize");return}if(!this.el_)return 0;const i=this.el_.style[e],n=i.indexOf("px");return parseInt(n!==-1?i.slice(0,n):this.el_["offset"+pi(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=gl(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const r=`offset${pi(e)}`;t=this.el_[r]}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},r={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:r}}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 r=10,i=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=N.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+u*u)>r&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&N.performance.now()-e<i&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Yt(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const r=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",r),this.on("touchcancel",r)}setTimeout(e,t){var r;return e=Yt(this,e),this.clearTimersOnDispose_(),r=N.setTimeout(()=>{this.setTimeoutIds_.has(r)&&this.setTimeoutIds_.delete(r),e()},t),this.setTimeoutIds_.add(r),r}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),N.clearTimeout(e)),e}setInterval(e,t){e=Yt(this,e),this.clearTimersOnDispose_();const r=N.setInterval(e,t);return this.setIntervalIds_.add(r),r}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),N.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Yt(this,e),t=N.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=Yt(this,t);const r=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,r),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),N.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((r,i)=>this[t](i))}),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=N.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function r(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||N.getComputedStyle(n).height==="0px"||N.getComputedStyle(n).width==="0px")}function i(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>(de.documentElement.clientWidth||N.innerWidth)||a.y<0||a.y>(de.documentElement.clientHeight||N.innerHeight))return!1;let o=de.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(i(e)&&r(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 r=kr.getComponent("Tech"),i=r&&r.isTech(t),n=kr===t||kr.prototype.isPrototypeOf(t.prototype);if(i||!n){let o;throw i?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=pi(e),kr.components_||(kr.components_={});const a=kr.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(u=>o[u]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return kr.components_[e]=t,kr.components_[qu(e)]=t,t}static getComponent(e){if(!(!e||!kr.components_))return kr.components_[e]}};ke.registerComponent("Component",ke);function vA(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Wv(s,e,t,r){return vA(s,r,t.length-1),t[r][e]}function cf(s){let e;return s===void 0||s.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:s.length,start:Wv.bind(null,"start",0,s),end:Wv.bind(null,"end",1,s)},N.Symbol&&N.Symbol.iterator&&(e[N.Symbol.iterator]=()=>(s||[]).values()),e}function Dn(s,e){return Array.isArray(s)?cf(s):s===void 0||e===void 0?cf():cf([[s,e]])}const rb=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),r=Math.floor(s/60%60),i=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(i=r=t="-"),i=i>0||a>0?i+":":"",r=((i||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,i+r+t};let Am=rb;function nb(s){Am=s}function sb(){Am=rb}function uo(s,e=s){return Am(s,e)}var yA=Object.freeze({__proto__:null,createTimeRanges:Dn,createTimeRange:Dn,setFormatTime:nb,resetFormatTime:sb,formatTime:uo});function ab(s,e){let t=0,r,i;if(!e)return 0;(!s||!s.length)&&(s=Dn(0,0));for(let n=0;n<s.length;n++)r=s.start(n),i=s.end(n),i>e&&(i=e),t+=i-r;return t/e}function ci(s){if(s instanceof ci)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:ps(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=ci.defaultMessages[this.code]||"")}ci.prototype.code=0;ci.prototype.message="";ci.prototype.status=null;ci.prototype.metadata=null;ci.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ci.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."};ci.MEDIA_ERR_CUSTOM=0;ci.prototype.MEDIA_ERR_CUSTOM=0;ci.MEDIA_ERR_ABORTED=1;ci.prototype.MEDIA_ERR_ABORTED=1;ci.MEDIA_ERR_NETWORK=2;ci.prototype.MEDIA_ERR_NETWORK=2;ci.MEDIA_ERR_DECODE=3;ci.prototype.MEDIA_ERR_DECODE=3;ci.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ci.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ci.MEDIA_ERR_ENCRYPTED=5;ci.prototype.MEDIA_ERR_ENCRYPTED=5;function zu(s){return s!=null&&typeof s.then=="function"}function os(s){zu(s)&&s.then(null,e=>{})}const gp=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,r,i)=>(s[r]&&(t[r]=s[r]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},_A=function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const n=gp(i.track);return i.src&&(n.src=i.src),n}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(gp))},TA=function(s,e){return s.forEach(function(t){const r=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(i=>r.addCue(i))}),e.textTracks()};var Gv={textTracksToJson:_A,jsonToTextTracks:TA,trackToJson_:gp};const hf="vjs-modal-dialog";let Il=class extends ke{constructor(e,t){super(e,t),this.handleKeyDown_=r=>this.handleKeyDown(r),this.close_=r=>this.close(r),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=it("div",{className:`${hf}-content`},{role:"document"}),this.descEl_=it("p",{className:`${hf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Da(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`${hf} 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 r=this.getChild("closeButton");if(t&&!r){const i=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(r,"close",this.close_)}!t&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),r=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(t),this.empty(),zT(t,e),this.trigger("modalfill"),i?r.insertBefore(t,i):r.appendChild(t);const n=this.getChild("closeButton");n&&r.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),vd(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=de.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_(),r=this.el_.querySelector(":focus");let i;for(let n=0;n<t.length;n++)if(r===t[n]){i=n;break}de.activeElement===this.el_&&(i=0),e.shiftKey&&i===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&i===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof N.HTMLAnchorElement||t instanceof N.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof N.HTMLInputElement||t instanceof N.HTMLSelectElement||t instanceof N.HTMLTextAreaElement||t instanceof N.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof N.HTMLIFrameElement||t instanceof N.HTMLObjectElement||t instanceof N.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};Il.prototype.options_={pauseOnOpen:!0,temporary:!0};ke.registerComponent("ModalDialog",Il);let vl=class extends Xr{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})},Vs(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let r=0,i=this.length;r<i;r++)if(this[r]===e){t=this[r],t.off&&t.off(),this.tracks_.splice(r,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let r=0,i=this.length;r<i;r++){const n=this[r];if(n.id===e){t=n;break}}return t}};vl.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in vl.prototype.allowedEvents_)vl.prototype["on"+s]=null;const df=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};let bA=class extends vl{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){df(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&df(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,df(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 ff=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};let SA=class extends vl{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){ff(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&&ff(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,ff(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)}},ob=class extends vl{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_))}},CA=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,r=e.length;t<r;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 r=0,i=this.trackElements_.length;r<i;r++)if(e===this.trackElements_[r].track){t=this.trackElements_[r];break}return t}removeTrackElement_(e){for(let t=0,r=this.trackElements_.length;t<r;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}}},Kv=class lb{constructor(e){lb.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let r=0;const i=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<i)for(r=t;r<i;r++)n.call(this,r)}getCueById(e){let t=null;for(let r=0,i=this.length;r<i;r++){const n=this[r];if(n.id===e){t=n;break}}return t}};const EA={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},wA={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},kA={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Xv={disabled:"disabled",hidden:"hidden",showing:"showing"};let xm=class extends Xr{constructor(e={}){super();const t={id:e.id||"vjs_track_"+dn(),kind:e.kind||"",language:e.language||""};let r=e.label||"";for(const i in t)Object.defineProperty(this,i,{get(){return t[i]},set(){}});Object.defineProperty(this,"label",{get(){return r},set(i){i!==r&&(r=i,this.trigger("labelchange"))}})}};const Nm=function(s){return new URL(s,de.baseURI)},ub=function(s){return new URL(s,de.baseURI).href},Dm=function(s){if(typeof s=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(t)return t.pop().toLowerCase()}return""},bd=function(s,e=N.location){return Nm(s).origin!==e.origin};var AA=Object.freeze({__proto__:null,parseUrl:Nm,getAbsoluteURL:ub,getFileExtension:Dm,isCrossOrigin:bd});const Yv=function(s,e){const t=new N.WebVTT.Parser(N,N.vttjs,N.WebVTT.StringDecoder()),r=[];t.oncue=function(i){e.addCue(i)},t.onparsingerror=function(i){r.push(i)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),r.length>0&&(N.console&&N.console.groupCollapsed&&N.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),r.forEach(i=>mt.error(i)),N.console&&N.console.groupEnd&&N.console.groupEnd()),t.flush()},Qv=function(s,e){const t={uri:s},r=bd(s);r&&(t.cors=r);const i=e.tech_.crossOrigin()==="use-credentials";i&&(t.withCredentials=i),cT(t,Yt(this,function(n,a,o){if(n)return mt.error(n,a);e.loaded_=!0,typeof N.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){mt.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Yv(o,e)}):Yv(o,e)}))};let dc=class extends xm{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Vt(e,{kind:kA[e.kind]||"subtitles",language:e.language||e.srclang||""});let r=Xv[t.mode]||"disabled";const i=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(r="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new Kv(this.cues_),a=new Kv(this.activeCues_);let o=!1;this.timeupdateHandler=Yt(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),r!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return i},set(){}},mode:{get(){return r},set(u){Xv[u]&&r!==u&&(r=u,!this.preload_&&r!=="disabled"&&this.cues.length===0&&Qv(this.src,this),this.stopTracking(),r!=="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 u=this.tech_.currentTime(),c=[];for(let d=0,f=this.cues.length;d<f;d++){const g=this.cues[d];g.startTime<=u&&g.endTime>=u&&c.push(g)}if(o=!1,c.length!==this.activeCues_.length)o=!0;else for(let d=0;d<c.length;d++)this.activeCues_.indexOf(c[d])===-1&&(o=!0);return this.activeCues_=c,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")&&Qv(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 N.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const r=this.tech_.textTracks();for(let i=0;i<r.length;i++)r[i]!==this&&r[i].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const r=this.cues_[t];if(r===e||r.originalCue_&&r.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};dc.prototype.allowedEvents_={cuechange:"cuechange"};let cb=class extends xm{constructor(e={}){const t=Vt(e,{kind:wA[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"enabled",{get(){return r},set(i){typeof i!="boolean"||i===r||(r=i,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},hb=class extends xm{constructor(e={}){const t=Vt(e,{kind:EA[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"selected",{get(){return r},set(i){typeof i!="boolean"||i===r||(r=i,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}},Pl=class vp extends Xr{constructor(e={}){super();let t;const r=new dc(e);this.kind=r.kind,this.src=r.src,this.srclang=r.language,this.label=r.label,this.default=r.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return r}}}),t=vp.NONE,r.addEventListener("loadeddata",()=>{t=vp.LOADED,this.trigger({type:"load",target:this})})}};Pl.prototype.allowedEvents_={load:"load"};Pl.NONE=0;Pl.LOADING=1;Pl.LOADED=2;Pl.ERROR=3;const cn={audio:{ListClass:bA,TrackClass:cb,capitalName:"Audio"},video:{ListClass:SA,TrackClass:hb,capitalName:"Video"},text:{ListClass:ob,TrackClass:dc,capitalName:"Text"}};Object.keys(cn).forEach(function(s){cn[s].getterName=`${s}Tracks`,cn[s].privateName=`${s}Tracks_`});const yl={remoteText:{ListClass:ob,TrackClass:dc,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:CA,TrackClass:Pl,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},hr=Object.assign({},cn,yl);yl.names=Object.keys(yl);cn.names=Object.keys(cn);hr.names=[].concat(yl.names).concat(cn.names);function xA(s,e,t,r,i={}){const n=s.textTracks();i.kind=e,t&&(i.label=t),r&&(i.language=r),i.tech=s;const a=new hr.text.TrackClass(i);return n.addTrack(a),a}let qt=class Ji extends ke{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=r=>this.onDurationChange(r),this.trackProgress_=r=>this.trackProgress(r),this.trackCurrentTime_=r=>this.trackCurrentTime(r),this.stopTrackingCurrentTime_=r=>this.stopTrackingCurrentTime(r),this.disposeSourceHandler_=r=>this.disposeSourceHandler(r),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),hr.names.forEach(r=>{const i=hr[r];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(r=>{e[`native${r}Tracks`]===!1&&(this[`featuresNative${r}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 hr.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(Yt(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 Dn(0,0)}bufferedPercent(){return ab(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(cn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const r=this[`${t}Tracks`]()||[];let i=r.length;for(;i--;){const n=r[i];t==="text"&&this.removeRemoteTextTrack(n),r.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const r=e[t];this.removeRemoteTextTrack(r)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ci(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Dn(0,0):Dn()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){cn.names.forEach(e=>{const t=cn[e],r=()=>{this.trigger(`${e}trackchange`)},i=this[t.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),this.on("dispose",()=>{i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)})})}addWebVttScript_(){if(!N.WebVTT)if(de.body.contains(this.el())){if(!this.options_["vtt.js"]&&fl(ll)&&Object.keys(ll).length>0){this.trigger("vttjsloaded");return}const e=de.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}),N.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),r=o=>e.addTrack(o.track),i=o=>e.removeTrack(o.track);t.on("addtrack",r),t.on("removetrack",i),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const l=e[o];l.removeEventListener("cuechange",n),l.mode==="showing"&&l.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",r),t.off("removetrack",i),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,r){if(!e)throw new Error("TextTrack kind is required but was not provided");return xA(this,e,t,r)}createRemoteTextTrack(e){const t=Vt(e,{tech:this});return new yl.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const r=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(r.track)),r}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=dn();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 Ji.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Ji||e instanceof Ji||e===Ji}static registerTech(e,t){if(Ji.techs_||(Ji.techs_={}),!Ji.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Ji.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Ji.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=pi(e),Ji.techs_[e]=t,Ji.techs_[qu(e)]=t,e!=="Tech"&&Ji.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Ji.techs_&&Ji.techs_[e])return Ji.techs_[e];if(e=pi(e),N&&N.videojs&&N.videojs[e])return mt.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),N.videojs[e]}}};hr.names.forEach(function(s){const e=hr[s];qt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});qt.prototype.featuresVolumeControl=!0;qt.prototype.featuresMuteControl=!0;qt.prototype.featuresFullscreenResize=!1;qt.prototype.featuresPlaybackRate=!1;qt.prototype.featuresProgressEvents=!1;qt.prototype.featuresSourceset=!1;qt.prototype.featuresTimeupdateEvents=!1;qt.prototype.featuresNativeTextTracks=!1;qt.prototype.featuresVideoFrameCallback=!1;qt.withSourceHandlers=function(s){s.registerSourceHandler=function(t,r){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),r===void 0&&(r=i.length),i.splice(r,0,t)},s.canPlayType=function(t){const r=s.sourceHandlers||[];let i;for(let n=0;n<r.length;n++)if(i=r[n].canPlayType(t),i)return i;return""},s.selectSourceHandler=function(t,r){const i=s.sourceHandlers||[];let n;for(let a=0;a<i.length;a++)if(n=i[a].canHandleSource(t,r),n)return i[a];return null},s.canPlaySource=function(t,r){const i=s.selectSourceHandler(t,r);return i?i.canHandleSource(t,r):""},["seekable","seeking","duration"].forEach(function(t){const r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let r=s.selectSourceHandler(t,this.options_);r||(s.nativeSourceHandler?r=s.nativeSourceHandler:mt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.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)}};ke.registerComponent("Tech",qt);qt.registerTech("Tech",qt);qt.defaultTechOrder_=[];const io={},bh={},Sh={};function NA(s,e){io[s]=io[s]||[],io[s].push(e)}function DA(s,e,t){s.setTimeout(()=>Ga(e,io[e.type],t,s),1)}function IA(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function PA(s,e,t){return s.reduceRight(Im(t),e[t]())}function LA(s,e,t,r){return e[t](s.reduce(Im(t),r))}function Jv(s,e,t,r=null){const i="call"+pi(t),n=s.reduce(Im(i),r),a=n===Sh,o=a?null:e[t](n);return RA(s,t,o,a),o}const OA={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},MA={setCurrentTime:1,setMuted:1,setVolume:1},Zv={play:1,pause:1};function Im(s){return(e,t)=>e===Sh?Sh:t[s]?t[s](e):e}function RA(s,e,t,r){for(let i=s.length-1;i>=0;i--){const n=s[i];n[e]&&n[e](r,t)}}function BA(s){bh.hasOwnProperty(s.id())&&delete bh[s.id()]}function UA(s,e){const t=bh[s.id()];let r=null;if(t==null)return r=e(s),bh[s.id()]=[[e,r]],r;for(let i=0;i<t.length;i++){const[n,a]=t[i];n===e&&(r=a)}return r===null&&(r=e(s),t.push([e,r])),r}function Ga(s={},e=[],t,r,i=[],n=!1){const[a,...o]=e;if(typeof a=="string")Ga(s,io[a],t,r,i,n);else if(a){const l=UA(r,a);if(!l.setSource)return i.push(l),Ga(s,o,t,r,i,n);l.setSource(Object.assign({},s),function(u,c){if(u)return Ga(s,o,t,r,i,n);i.push(l),Ga(c,s.type===c.type?o:io[c.type],t,r,i,n)})}else o.length?Ga(s,o,t,r,i,n):n?t(s,i):Ga(s,io["*"],t,r,i,!0)}const FA={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"},Ch=function(s=""){const e=Dm(s);return FA[e.toLowerCase()]||""},$A=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(i=>i.src===e);if(t.length)return t[0].type;const r=s.$$("source");for(let i=0;i<r.length;i++){const n=r[i];if(n.type&&n.src&&n.src===e)return n.type}return Ch(e)},db=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=db(t),Array.isArray(t)?e=e.concat(t):ps(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[ey({src:s})]:ps(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[ey(s)]:s=[];return s};function ey(s){if(!s.type){const e=Ch(s.src);e&&(s.type=e)}return s}var jA=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
89
|
+
<defs>
|
|
90
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-play">
|
|
91
|
+
<path d="M16 10v28l22-14z"></path>
|
|
92
|
+
</symbol>
|
|
93
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-pause">
|
|
94
|
+
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
|
|
95
|
+
</symbol>
|
|
96
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-audio">
|
|
97
|
+
<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>
|
|
98
|
+
</symbol>
|
|
99
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-captions">
|
|
100
|
+
<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>
|
|
101
|
+
</symbol>
|
|
102
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
|
|
103
|
+
<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>
|
|
104
|
+
</symbol>
|
|
105
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
|
|
106
|
+
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
|
|
107
|
+
</symbol>
|
|
108
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
|
|
109
|
+
<path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
|
|
110
|
+
</symbol>
|
|
111
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
|
|
112
|
+
<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>
|
|
113
|
+
</symbol>
|
|
114
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
|
|
115
|
+
<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>
|
|
116
|
+
</symbol>
|
|
117
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
|
|
118
|
+
<path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
|
|
119
|
+
</symbol>
|
|
120
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
|
|
121
|
+
<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>
|
|
122
|
+
</symbol>
|
|
123
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
|
|
124
|
+
<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>
|
|
125
|
+
</symbol>
|
|
126
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
|
|
127
|
+
<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>
|
|
128
|
+
</symbol>
|
|
129
|
+
<symbol viewBox="0 0 24 24" id="vjs-icon-hd">
|
|
130
|
+
<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>
|
|
131
|
+
</symbol>
|
|
132
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
|
|
133
|
+
<path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
|
|
134
|
+
</symbol>
|
|
135
|
+
<symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
|
|
136
|
+
<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>
|
|
137
|
+
</symbol>
|
|
138
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
|
|
139
|
+
<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>
|
|
140
|
+
</symbol>
|
|
141
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
|
|
142
|
+
<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>
|
|
143
|
+
</symbol>
|
|
144
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
|
|
145
|
+
<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>
|
|
146
|
+
</symbol>
|
|
147
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-share">
|
|
148
|
+
<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>
|
|
149
|
+
</symbol>
|
|
150
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cog">
|
|
151
|
+
<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>
|
|
152
|
+
</symbol>
|
|
153
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-square">
|
|
154
|
+
<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>
|
|
155
|
+
</symbol>
|
|
156
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle">
|
|
157
|
+
<circle cx="24" cy="24" r="20"></circle>
|
|
158
|
+
</symbol>
|
|
159
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
|
|
160
|
+
<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>
|
|
161
|
+
</symbol>
|
|
162
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
|
|
163
|
+
<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>
|
|
164
|
+
</symbol>
|
|
165
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
|
|
166
|
+
<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>
|
|
167
|
+
</symbol>
|
|
168
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-replay">
|
|
169
|
+
<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>
|
|
170
|
+
</symbol>
|
|
171
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
|
|
172
|
+
<path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
|
|
173
|
+
</symbol>
|
|
174
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
|
|
175
|
+
<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>
|
|
176
|
+
</symbol>
|
|
177
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
|
|
178
|
+
<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>
|
|
179
|
+
</symbol>
|
|
180
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
|
|
181
|
+
<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>
|
|
182
|
+
</symbol>
|
|
183
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
|
|
184
|
+
<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>
|
|
185
|
+
</symbol>
|
|
186
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
|
|
187
|
+
<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>
|
|
188
|
+
</symbol>
|
|
189
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
|
|
190
|
+
<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>
|
|
191
|
+
</symbol>
|
|
192
|
+
<symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
|
|
193
|
+
<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>
|
|
194
|
+
</symbol>
|
|
195
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
|
|
196
|
+
<path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
|
|
197
|
+
</symbol>
|
|
198
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
|
|
199
|
+
<path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
|
|
200
|
+
</symbol>
|
|
201
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
|
|
202
|
+
<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>
|
|
203
|
+
</symbol>
|
|
204
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cast">
|
|
205
|
+
<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>
|
|
206
|
+
</symbol>
|
|
207
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
|
|
208
|
+
<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>
|
|
209
|
+
</symbol>
|
|
210
|
+
<symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
|
|
211
|
+
<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>
|
|
212
|
+
<path fill="none" d="M-1-3h24v24H-1z"></path>
|
|
213
|
+
</symbol>
|
|
214
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
|
|
215
|
+
<path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
|
|
216
|
+
</symbol>
|
|
217
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
|
|
218
|
+
<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>
|
|
219
|
+
</symbol>
|
|
220
|
+
<symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
|
|
221
|
+
<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"/>
|
|
222
|
+
</symbol>
|
|
223
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
|
|
224
|
+
<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>
|
|
225
|
+
</symbol>
|
|
226
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
|
|
227
|
+
<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>
|
|
228
|
+
</symbol>
|
|
229
|
+
</defs>
|
|
230
|
+
</svg>`;const ty=vh?10009:yh?461:8,Lo={codes:{play:415,pause:19,ff:417,rw:412,back:ty},names:{415:"play",19:"pause",417:"ff",412:"rw",[ty]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},iy=5;class HA extends Xr{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 r=t.key.substring(5).toLowerCase();this.move(r)}else if(Lo.isEventKey(t,"play")||Lo.isEventKey(t,"pause")||Lo.isEventKey(t,"ff")||Lo.isEventKey(t,"rw")){t.preventDefault();const r=Lo.getEventName(t);this.performMediaAction_(r)}else Lo.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()+iy);break;case"rw":this.userSeek_(this.player_.currentTime()-iy);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 r=null;const i=this.getCurrentComponent(e.target);t&&(r=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!r||!t)&&(i&&i.name()==="CloseButton"?this.refocusComponent():(this.pause(),i&&i.el()&&(this.lastFocusedComponent_=i)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function r(i){for(const n of i)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&r(n.children_)}return e.children_.forEach(i=>{if(i.hasOwnProperty("el_"))if(i.getIsFocusable&&i.getIsAvailableToBeFocused&&i.getIsFocusable()&&i.getIsAvailableToBeFocused(i.el())){t.push(i);return}else i.hasOwnProperty("children_")&&i.children_.length>0?r(i.children_):i.hasOwnProperty("items")&&i.items.length>0?r(i.items):this.findSuitableDOMChild(i)&&t.push(i);if(i.name_==="ErrorDisplay"&&i.opened_){const n=i.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),c={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},d={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:c,center:d}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(r){if(e.getIsFocusable(r)&&e.getIsAvailableToBeFocused(r))return r;for(let i=0;i<r.children.length;i++){const n=r.children[i],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 r of this.focusableComponents)if(r.el()===t)return r}}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 r=t.getPositions(),i=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(r.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(r.center,i,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,r){let i=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,r);l<i&&(i=l,n=a)}return n}isInDirection_(e,t,r){switch(r){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,r){const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(r){case"right":case"left":a=i+n*100;break;case"up":a=n*2+i*.5;break;case"down":a=n*5+i;break;default:a=i+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}let VA=class extends ke{constructor(e,t,r){const i=Vt({createEl:!1},t);if(super(e,i,r),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=pi(a[n]);let l=qt.getTech(o);if(o||(l=ke.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}};ke.registerComponent("MediaLoader",VA);let Sd=class extends ke{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=r=>this.handleMouseOver(r),this.handleMouseOut_=r=>this.handleMouseOut(r),this.handleClick_=r=>this.handleClick(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.emitTapEvents(),this.enable()}createEl(e="div",t={},r={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&mt.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),r=Object.assign({role:"button"},r),this.tabIndex_=t.tabIndex;const i=it(e,t,r);return this.player_.options_.experimentalSvgIcons||i.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=it("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 r=this.localize(e);this.controlText_=e,Da(this.controlTextEl_,r),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",r)}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)}};ke.registerComponent("ClickableComponent",Sd);let yp=class extends Sd{constructor(e,t){super(e,t),this.update(),this.update_=r=>this.update(r),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return it("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(it("picture",{className:"vjs-poster",tabIndex:-1},{},it("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()?os(this.player_.play()):this.player_.pause())}};yp.prototype.crossorigin=yp.prototype.crossOrigin;ke.registerComponent("PosterImage",yp);const ln="#222",ry="#ccc",qA={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 pf(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; 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 is(s,e,t){try{s.style[e]=t}catch{return}}function ny(s){return s?`${s}px`:""}let zA=class extends ke{constructor(e,t,r){super(e,t,r);const i=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",i),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Yt(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=N.screen.orientation||N,o=N.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),r=this.player_.cache_.selectedLanguage;let i,n,a;for(let o=0;o<t.length;o++){const l=t[o];r&&r.enabled&&r.language&&r.language===l.language&&l.kind in e?l.kind===r.kind?a=l:a||(a=l):r&&!r.enabled?(a=null,i=null,n=null):l.default&&(l.kind==="descriptions"&&!i?i=l:l.kind in e&&!n&&(n=l))}a?a.mode="showing":n?n.mode="showing":i&&(i.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 N.WebVTT=="function"&&N.WebVTT.processCues(N,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const l=e[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}let r=null,i=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?r=a:i=a)}if(i?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):r&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(r)),!N.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),l=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",is(a,"position","relative"),is(a,"height",u-l+"px"),is(a,"top","unset"),_h?is(a,"bottom",u+"px"):is(a,"bottom","0px"),o.length>0&&o.forEach(c=>{if(c.style.inset){const d=c.style.inset.split(" ");d.length===3&&Object.assign(c.style,{top:d[0],right:d[1],bottom:d[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!N.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),r=e/t,i=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(r-i)>.1&&(r>i?n=Math.round((e-t*i)/2):a=Math.round((t-e/i)/2)),is(this.el_,"insetInline",ny(n)),is(this.el_,"insetBlock",ny(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),r=e.activeCues;let i=r.length;for(;i--;){const n=r[i];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&is(a.firstChild,"color",pf(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&is(a.firstChild,"backgroundColor",pf(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?is(a,"backgroundColor",pf(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${ln}, 2px 2px 4px ${ln}, 2px 2px 5px ${ln}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${ln}, 2px 2px ${ln}, 3px 3px ${ln}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${ry}, 0 1px ${ry}, -1px -1px ${ln}, 0 -1px ${ln}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${ln}, 0 0 4px ${ln}, 0 0 4px ${ln}, 0 0 4px ${ln}`)),t.fontPercent&&t.fontPercent!==1){const o=N.parseFloat(a.style.fontSize);a.style.fontSize=o*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=qA[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof N.WebVTT!="function"||e.every(r=>!r.activeCues))return;const t=[];for(let r=0;r<e.length;++r){const i=e[r];for(let n=0;n<i.activeCues.length;++n)t.push(i.activeCues[n])}N.WebVTT.processCues(N,t,this.el_);for(let r=0;r<e.length;++r){const i=e[r];for(let n=0;n<i.activeCues.length;++n){const a=i.activeCues[n].displayState;to(a,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:r)),i.language&&pl(a,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}};ke.registerComponent("TextTrackDisplay",zA);let WA=class extends ke{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),r=it("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),i=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}};ke.registerComponent("LoadingSpinner",WA);let ir=class extends Sd{createEl(e,t={},r={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),r=Object.assign({type:"button"},r);const i=it(e,t,r);return this.player_.options_.experimentalSvgIcons||i.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}addChild(e,t={}){const r=this.constructor.name;return mt.warn(`Adding an actionable (user controllable) child to a Button (${r}) is not supported; use a ClickableComponent instead.`),ke.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)}};ke.registerComponent("Button",ir);let fb=class extends ir{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",r=>this.handleMouseDown(r))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){os(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const r=this.player_.getChild("controlBar"),i=r&&r.getChild("playToggle");if(!i){this.player_.tech(!0).focus();return}const n=()=>i.focus();zu(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};fb.prototype.controlText_="Play Video";ke.registerComponent("BigPlayButton",fb);let GA=class extends ir{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)}};ke.registerComponent("CloseButton",GA);let pb=class extends ir{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",r=>this.handlePlay(r)),this.on(e,"pause",r=>this.handlePause(r)),t.replay&&this.on(e,"ended",r=>this.handleEnded(r))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?os(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))}};pb.prototype.controlText_="Play";ke.registerComponent("PlayToggle",pb);let Ll=class extends ke{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],r=>this.update(r)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),r=it("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(r),this.contentEl_=it("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=uo(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,mt.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_=de.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};Ll.prototype.labelText_="Time";Ll.prototype.controlText_="Time";ke.registerComponent("TimeDisplay",Ll);let Pm=class extends Ll{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)}};Pm.prototype.labelText_="Current Time";Pm.prototype.controlText_="Current Time";ke.registerComponent("CurrentTimeDisplay",Pm);let Lm=class extends Ll{constructor(e,t){super(e,t);const r=i=>this.updateContent(i);this.on(e,"durationchange",r),this.on(e,"loadstart",r),this.on(e,"loadedmetadata",r)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}};Lm.prototype.labelText_="Duration";Lm.prototype.controlText_="Duration";ke.registerComponent("DurationDisplay",Lm);let KA=class extends ke{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),r=super.createEl("span",{textContent:"/"});return t.appendChild(r),e.appendChild(t),e}};ke.registerComponent("TimeDivider",KA);let Om=class extends Ll{constructor(e,t){super(e,t),this.on(e,"durationchange",r=>this.updateContent(r))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(it("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)}};Om.prototype.labelText_="Remaining Time";Om.prototype.controlText_="Remaining Time";ke.registerComponent("RemainingTimeDisplay",Om);let XA=class extends ke{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",r=>this.updateShowing(r))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=it("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(it("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(de.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()}};ke.registerComponent("LiveDisplay",XA);let mb=class extends ir{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=r=>this.updateLiveEdgeStatus(r),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_=it("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()}};mb.prototype.controlText_="Seek to live, currently playing live";ke.registerComponent("SeekToLive",mb);function fc(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var YA=Object.freeze({__proto__:null,clamp:fc});let Mm=class extends ke{constructor(e,t){super(e,t),this.handleMouseDown_=r=>this.handleMouseDown(r),this.handleMouseUp_=r=>this.handleMouseUp(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.handleClick_=r=>this.handleClick(r),this.handleMouseMove_=r=>this.handleMouseMove(r),this.update_=r=>this.update(r),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={},r={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),r=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},r),super.createEl(e,t,r)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!gs&&e.preventDefault(),jT(),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;HT(),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(fc(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=gd(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,r=t&&t.enabled,i=t&&t.horizontalSeek;r?i&&e.key==="ArrowLeft"||!i&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):i&&e.key==="ArrowRight"||!i&&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")}};ke.registerComponent("Slider",Mm);const mf=(s,e)=>fc(s/e*100,0,100).toFixed(2)+"%";let QA=class extends ke{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",r=>this.update(r))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=it("span",{className:"vjs-control-text"}),r=it("span",{textContent:this.localize("Loaded")}),i=de.createTextNode(": ");return this.percentageEl_=it("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(r),t.appendChild(i),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,r=this.player_.buffered(),i=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=mf(n,i);this.percent_!==o&&(this.el_.style.width=o,Da(this.percentageEl_,o),this.percent_=o);for(let l=0;l<r.length;l++){const u=r.start(l),c=r.end(l);let d=a[l];d||(d=this.el_.appendChild(it()),a[l]=d),!(d.dataset.start===u&&d.dataset.end===c)&&(d.dataset.start=u,d.dataset.end=c,d.style.left=mf(u,n),d.style.width=mf(c-u,n))}for(let l=a.length;l>r.length;l--)this.el_.removeChild(a[l-1]);a.length=r.length})}};ke.registerComponent("LoadProgressBar",QA);let JA=class extends ke{constructor(e,t){super(e,t),this.update=vs(Yt(this,this.update),fn)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,r){const i=tc(this.el_),n=ml(this.player_.el()),a=e.width*t;if(!n||!i)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let u=i.width/2;o<u?u+=u-o:l<u&&(u=l),u<0?u=0:u>i.width&&(u=i.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(r)}write(e){Da(this.el_,e)}updateTime(e,t,r,i){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+uo(l,o)}else n=uo(r,a);this.update(e,t,n),i&&i()})}};ke.registerComponent("TimeTooltip",JA);let Rm=class extends ke{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=vs(Yt(this,this.update),fn)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const r=this.getChild("timeTooltip");if(!r)return;const i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,i)}};Rm.prototype.options_={children:[]};!vr&&!ms&&Rm.prototype.options_.children.push("timeTooltip");ke.registerComponent("PlayProgressBar",Rm);let gb=class extends ke{constructor(e,t){super(e,t),this.update=vs(Yt(this,this.update),fn)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,()=>{this.el_.style.left=`${e.width*t}px`})}};gb.prototype.options_={children:["timeTooltip"]};ke.registerComponent("MouseTimeDisplay",gb);const Pc=5,sy=12;let Bm=class extends Mm{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Yt(this,this.update),this.update=vs(this.update_,fn),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 de&&"visibilityState"in de&&this.on(de,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){de.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,fn))}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(de.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const r=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==r||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[uo(r,n),uo(n,n)],"{1} of {2}")),this.currentTime_=r,this.duration_=n),this.bar&&this.bar.update(ml(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(){const e=this.getCurrentTime_();let t;const r=this.player_.liveTracker;return r&&r.isLive()?(t=(e-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){ic(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!ic(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let r;const i=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())r=i*this.player_.duration(),r===this.player_.duration()&&(r=r-.1);else{if(i>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(r=a+i*n.liveWindow(),r>=o&&(r=o),r<=a&&(r=a+.1),r===1/0)return}this.userSeek_(r),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.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?os(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Pc)}stepBack(){this.userSeek_(this.player_.currentTime()-Pc)}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 r=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Pc*sy)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Pc*sy)):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 de&&"visibilityState"in de&&this.off(de,"visibilitychange",this.toggleVisibility_),super.dispose()}};Bm.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!vr&&!ms&&Bm.prototype.options_.children.splice(1,0,"mouseTimeDisplay");ke.registerComponent("SeekBar",Bm);let vb=class extends ke{constructor(e,t){super(e,t),this.handleMouseMove=vs(Yt(this,this.handleMouseMove),fn),this.throttledHandleMouseSeek=vs(Yt(this,this.handleMouseSeek),fn),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.handleMouseDownHandler_=r=>this.handleMouseDown(r),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const r=t.getChild("playProgressBar"),i=t.getChild("mouseTimeDisplay");if(!r&&!i)return;const n=t.el(),a=tc(n);let o=gd(n,e).x;o=fc(o,0,1),i&&i.update(a,o),r&&r.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",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&os(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",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,r=this.getChild("seekBar");r&&r.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()}};vb.prototype.options_={children:["seekBar"]};ke.registerComponent("ProgressControl",vb);let yb=class extends ir{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],r=>this.handlePictureInPictureChange(r)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],r=>this.handlePictureInPictureEnabledChange(r)),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(){de.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in N?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 de.exitPictureInPicture=="function"&&super.show()}};yb.prototype.controlText_="Picture-in-Picture";ke.registerComponent("PictureInPictureToggle",yb);let _b=class extends ir{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",r=>this.handleFullscreenChange(r)),de[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()}};_b.prototype.controlText_="Fullscreen";ke.registerComponent("FullscreenToggle",_b);const ZA=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let ex=class extends ke{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}};ke.registerComponent("VolumeLevel",ex);let tx=class extends ke{constructor(e,t){super(e,t),this.update=vs(Yt(this,this.update),fn)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,r,i){if(!r){const n=ml(this.el_),a=ml(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,u=e.width-o+(a.right-e.right);let c=n.width/2;l<c?c+=c-l:u<c&&(c=u),c<0?c=0:c>n.width&&(c=n.width),this.el_.style.right=`-${c}px`}this.write(`${i}%`)}write(e){Da(this.el_,e)}updateVolume(e,t,r,i,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,r,i.toFixed(0)),n&&n()})}};ke.registerComponent("VolumeLevelTooltip",tx);let Tb=class extends ke{constructor(e,t){super(e,t),this.update=vs(Yt(this,this.update),fn)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,r){const i=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,r,i,()=>{r?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};Tb.prototype.options_={children:["volumeLevelTooltip"]};ke.registerComponent("MouseVolumeLevelDisplay",Tb);let Cd=class extends Mm{constructor(e,t){super(e,t),this.on("slideractive",r=>this.updateLastVolume_(r)),this.on(e,"volumechange",r=>this.updateARIAAttributes(r)),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){ic(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const r=this.el(),i=ml(r),n=this.vertical();let a=gd(r,e);a=n?a.y:a.x,a=fc(a,0,1),t.update(i,a,n)}ic(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)})}};Cd.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!vr&&!ms&&Cd.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Cd.prototype.playerEvent="volumechange";ke.registerComponent("VolumeBar",Cd);let bb=class extends ke{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||fl(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),ZA(this,e),this.throttledHandleMouseMove=vs(Yt(this,this.handleMouseMove),fn),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.on("mousedown",r=>this.handleMouseDown(r)),this.on("touchstart",r=>this.handleMouseDown(r)),this.on("mousemove",r=>this.handleMouseMove(r)),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)}};bb.prototype.options_={children:["volumeBar"]};ke.registerComponent("VolumeControl",bb);const ix=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let Sb=class extends ir{constructor(e,t){super(e,t),ix(this,e),this.on(e,["loadstart","volumechange"],r=>this.update(r))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),r=this.player_.lastVolume_();if(t===0){const i=r<.1?.1:r;this.player_.volume(i),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"),vr&&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),pd(this.el_,[0,1,2,3].reduce((r,i)=>r+`${i?" ":""}vjs-vol-${i}`,"")),to(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};Sb.prototype.controlText_="Mute";ke.registerComponent("MuteToggle",Sb);let Cb=class extends ke{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||fl(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=r=>this.handleKeyPress(r),this.on(e,["loadstart"],r=>this.volumePanelState_(r)),this.on(this.muteToggle,"keyup",r=>this.handleKeyPress(r)),this.on(this.volumeControl,"keyup",r=>this.handleVolumeControlKeyUp(r)),this.on("keydown",r=>this.handleKeyPress(r)),this.on("mouseover",r=>this.handleMouseOver(r)),this.on("mouseout",r=>this.handleMouseOut(r)),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"),Kr(de,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),tr(de,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};Cb.prototype.options_={children:["muteToggle","volumeControl"]};ke.registerComponent("VolumePanel",Cb);class Eb extends ir{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(),r=this.player_.liveTracker,i=r&&r.isLive()?r.seekableEnd():this.player_.duration();let n;t+this.skipTime<=i?n=t+this.skipTime:n=i,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Eb.prototype.controlText_="Skip Forward";ke.registerComponent("SkipForward",Eb);class wb extends ir{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(),r=this.player_.liveTracker,i=r&&r.isLive()&&r.seekableStart();let n;i&&t-this.skipTime<=i?n=i:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}wb.prototype.controlText_="Skip Backward";ke.registerComponent("SkipBackward",wb);let kb=class extends ke{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",r=>this.handleKeyDown(r)),this.boundHandleBlur_=r=>this.handleBlur(r),this.boundHandleTapClick_=r=>this.handleTapClick(r)}addEventListenerForItem(e){e instanceof ke&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof ke&&(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_=it(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_),Kr(t,"click",function(r){r.preventDefault(),r.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||de.activeElement;if(!this.children().some(r=>r.el()===t)){const r=this.menuButton_;r&&r.buttonPressed_&&t!==r.el().firstChild&&r.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const r=t.filter(i=>i.el()===e.target)[0];if(!r)return;r.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())}};ke.registerComponent("Menu",kb);let Um=class extends ke{constructor(e,t={}){super(e,t),this.menuButton_=new ir(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const r=ir.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+r,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const i=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",i),this.on(this.menuButton_,"click",i),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Kr(de,"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 kb(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=it("li",{className:"vjs-menu-title",textContent:pi(this.options_.title),tabIndex:-1}),r=new ke(this.player_,{el:t});e.addItem(r)}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=ir.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"),tr(de,"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"),vr&&RT())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()}};ke.registerComponent("MenuButton",Um);let Fm=class extends Um{constructor(e,t){const r=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!r)return;const i=Yt(this,this.update);r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),r.addEventListener("labelchange",i),this.player_.on("ready",i),this.player_.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i),r.removeEventListener("labelchange",i)})}};ke.registerComponent("TrackButton",Fm);let pc=class extends Sd{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,r){this.nonIconControl=!0;const i=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),r),n=it("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?i.appendChild(n):i.replaceChild(n,i.querySelector(".vjs-icon-placeholder")),i}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))}};ke.registerComponent("MenuItem",pc);let mc=class extends pc{constructor(e,t){const r=t.track,i=e.textTracks();t.label=r.label||r.language||"Unknown",t.selected=r.mode==="showing",super(e,t),this.track=r,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),i.addEventListener("change",n),i.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),i.removeEventListener("change",n),i.removeEventListener("selectedlanguagechange",a)}),i.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof N.Event!="object")try{o=new N.Event("change")}catch{}o||(o=de.createEvent("Event"),o.initEvent("change",!0,!0)),i.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,r=this.player_.textTracks();if(super.handleClick(e),!!r)for(let i=0;i<r.length;i++){const n=r[i];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()}};ke.registerComponent("TextTrackMenuItem",mc);let Ab=class extends mc{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 r=!0;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r!==this.isSelected_&&this.selected(r)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let r=!0;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};ke.registerComponent("OffTextTrackMenuItem",Ab);let Ol=class extends Fm{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=mc){let r;this.label_&&(r=`${this.label_} off`),e.push(new Ab(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;const i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<i.length;n++){const a=i[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}};ke.registerComponent("TextTrackButton",Ol);let xb=class extends pc{constructor(e,t){const r=t.track,i=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=i.text,t.selected=i.startTime<=n&&n<i.endTime,super(e,t),this.track=r,this.cue=i}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};ke.registerComponent("ChaptersTrackMenuItem",xb);let $m=class extends Ol{constructor(e,t,r){super(e,t,r),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(i=>{i.selected(this.track_.activeCues[0]===i.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 r=e[t];if(r.kind===this.kind_)return r}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(pi(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 r=0,i=t.length;r<i;r++){const n=t[r],a=new xb(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};$m.prototype.kind_="chapters";$m.prototype.controlText_="Chapters";ke.registerComponent("ChaptersButton",$m);let jm=class extends Ol{constructor(e,t,r){super(e,t,r),this.setIcon("audio-description");const i=e.textTracks(),n=Yt(this,this.handleTracksChange);i.addEventListener("change",n),this.on("dispose",function(){i.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let r=!1;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(a.kind!==this.kind_&&a.mode==="showing"){r=!0;break}}r?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};jm.prototype.kind_="descriptions";jm.prototype.controlText_="Descriptions";ke.registerComponent("DescriptionsButton",jm);let Hm=class extends Ol{constructor(e,t,r){super(e,t,r),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};Hm.prototype.kind_="subtitles";Hm.prototype.controlText_="Subtitles";ke.registerComponent("SubtitlesButton",Hm);let Vm=class extends mc{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()}};ke.registerComponent("CaptionSettingsMenuItem",Vm);let qm=class extends Ol{constructor(e,t,r){super(e,t,r),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 Vm(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};qm.prototype.kind_="captions";qm.prototype.controlText_="Captions";ke.registerComponent("CaptionsButton",qm);let Nb=class extends mc{createEl(e,t,r){const i=super.createEl(e,t,r),n=i.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",i):n.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(it("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),i}};ke.registerComponent("SubsCapsMenuItem",Nb);let zm=class extends Ol{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(pi(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 Vm(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Nb),e}};zm.prototype.kinds_=["captions","subtitles"];zm.prototype.controlText_="Subtitles";ke.registerComponent("SubsCapsButton",zm);let Db=class extends pc{constructor(e,t){const r=t.track,i=e.audioTracks();t.label=r.label||r.language||"Unknown",t.selected=r.enabled,super(e,t),this.track=r,this.addClass(`vjs-${r.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};i.addEventListener("change",n),this.on("dispose",()=>{i.removeEventListener("change",n)})}createEl(e,t,r){const i=super.createEl(e,t,r),n=i.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(it("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),i}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let r=0;r<t.length;r++){const i=t[r];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};ke.registerComponent("AudioTrackMenuItem",Db);let Ib=class extends Fm{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 r=0;r<t.length;r++){const i=t[r];e.push(new Db(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e}};Ib.prototype.controlText_="Audio Track";ke.registerComponent("AudioTrackButton",Ib);let Wm=class extends pc{constructor(e,t){const r=t.rate,i=parseFloat(r,10);t.label=r,t.selected=i===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=r,this.rate=i,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)}};Wm.prototype.contentElType="button";ke.registerComponent("PlaybackRateMenuItem",Wm);let Pb=class extends Um{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",r=>this.updateVisibility(r)),this.on(e,"ratechange",r=>this.updateLabel(r)),this.on(e,"playbackrateschange",r=>this.handlePlaybackRateschange(r))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=it("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 r=e.length-1;r>=0;r--)t.push(new Wm(this.player(),{rate:e[r]+"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")}};Pb.prototype.controlText_="Playback Rate";ke.registerComponent("PlaybackRateMenuButton",Pb);let Lb=class extends ke{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},r={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,r)}};ke.registerComponent("Spacer",Lb);let rx=class extends Lb{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}};ke.registerComponent("CustomControlSpacer",rx);let Ob=class extends ke{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};Ob.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};ke.registerComponent("ControlBar",Ob);let Mb=class extends Il{constructor(e,t){super(e,t),this.on(e,"error",r=>{this.open(r)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}};Mb.prototype.options_=Object.assign({},Il.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});ke.registerComponent("ErrorDisplay",Mb);class Rb extends ke{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(),it("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const r=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${dn()}`)+"-"+t[1].replace(/\W+/g,""),i=it("option",{id:r,value:this.localize(t[0]),textContent:this.localize(t[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${r}`),i}))}}ke.registerComponent("TextTrackSelect",Rb);class ro extends ke{constructor(e,t={}){super(e,t);const r=it("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(r);const i=this.options_.selects;for(const n of i){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let u=null;const c=`vjs_select_${dn()}`;if(this.options_.type==="colors"){u=it("span",{className:o});const f=it("label",{id:l,className:"vjs-label",textContent:this.localize(a.label)});f.setAttribute("for",c),u.appendChild(f)}const d=new Rb(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:c,labelId:l});this.addChild(d),this.options_.type==="colors"&&(u.appendChild(d.el()),this.el().appendChild(u))}}createEl(){return it("fieldset",{className:this.options_.className})}}ke.registerComponent("TextTrackFieldset",ro);class Bb extends ke{constructor(e,t={}){super(e,t);const r=this.options_.textTrackComponentid,i=new ro(e,{id_:r,legendId:`captions-text-legend-${r}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(i);const n=new ro(e,{id_:r,legendId:`captions-background-${r}`,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 ro(e,{id_:r,legendId:`captions-window-${r}`,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 it("div",{className:"vjs-track-settings-colors"})}}ke.registerComponent("TextTrackSettingsColors",Bb);class Ub extends ke{constructor(e,t={}){super(e,t);const r=this.options_.textTrackComponentid,i=new ro(e,{id_:r,legendId:`captions-font-size-${r}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(i);const n=new ro(e,{id_:r,legendId:`captions-edge-style-${r}`,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 ro(e,{id_:r,legendId:`captions-font-family-${r}`,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 it("div",{className:"vjs-track-settings-font"})}}ke.registerComponent("TextTrackSettingsFont",Ub);class Fb extends ke{constructor(e,t={}){super(e,t);const r=this.localize("restore all settings to the default values"),i=new ir(e,{controlText:r,className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const n=new ir(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return it("div",{className:"vjs-track-settings-controls"})}}ke.registerComponent("TrackSettingsControls",Fb);const gf="vjs-text-track-settings",ay=["#000","Black"],oy=["#00F","Blue"],ly=["#0FF","Cyan"],uy=["#0F0","Green"],cy=["#F0F","Magenta"],hy=["#F00","Red"],dy=["#FFF","White"],fy=["#FF0","Yellow"],vf=["1","Opaque"],yf=["0.5","Semi-Transparent"],py=["0","Transparent"],Ca={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ay,dy,hy,uy,oy,fy,cy,ly],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[vf,yf,py],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[dy,ay,hy,uy,oy,fy,cy,ly],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:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[vf,yf],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:[py,yf,vf],className:"vjs-window-opacity vjs-opacity"}};Ca.windowColor.options=Ca.backgroundColor.options;function $b(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function nx(s,e){const t=s.options[s.options.selectedIndex].value;return $b(t,e)}function sx(s,e,t){if(e){for(let r=0;r<s.options.length;r++)if($b(s.options[r].value,t)===e){s.selectedIndex=r;break}}}let ax=class extends Il{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=it("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 Bb(e,{textTrackComponentid:this.id_,selectConfigs:Ca,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const r=new Ub(e,{textTrackComponentid:this.id_,selectConfigs:Ca,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(r);const i=new Fb(e);this.addChild(i)}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()}),Yo(Ca,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 NT(Ca,(e,t,r)=>{const i=nx(this.$(t.selector),t.parser);return i!==void 0&&(e[r]=i),e},{})}setValues(e){Yo(Ca,(t,r)=>{sx(this.$(t.selector),e[r],t.parser)})}setDefaults(){Yo(Ca,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(N.localStorage.getItem(gf))}catch(t){mt.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?N.localStorage.setItem(gf,JSON.stringify(e)):N.localStorage.removeItem(gf)}catch(t){mt.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};ke.registerComponent("TextTrackSettings",ax);let ox=class extends ke{constructor(e,t){let r=t.ResizeObserver||N.ResizeObserver;t.ResizeObserver===null&&(r=!1);const i=Vt({createEl:!r,reportTouchActivity:!1},t);super(e,i),this.ResizeObserver=t.ResizeObserver||N.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=JT(()=>{this.resizeHandler()},100,!1,this),r?(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(){tr(this,"resize",n),tr(this,"unload",a),a=null};Kr(this.el_.contentWindow,"unload",a),Kr(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()}};ke.registerComponent("ResizeManager",ox);const lx={trackingThreshold:20,liveTolerance:15};let ux=class extends ke{constructor(e,t){const r=Vt(lx,t,{createEl:!1});super(e,r),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(N.performance.now().toFixed(4)),r=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+r;const i=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||i===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_,fn),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 r=e?e.length:0;for(;r--;)t.push(e.end(r));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let r=e?e.length:0;for(;r--;)t.push(e.start(r));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()}};ke.registerComponent("LiveTracker",ux);class cx extends ke{constructor(e,t){super(e,t),this.on("statechanged",r=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:it("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${dn()}`}),description:it("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${dn()}`})},it("div",{className:"vjs-title-bar"},{},DT(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(i=>{const n=this.state[i],a=this.els[i],o=r[i];vd(a),n&&Da(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,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}}ke.registerComponent("TitleBar",cx);const hx={initialDisplay:4e3,position:[],takeFocus:!1};class dx extends ir{constructor(e,t){t=Vt(hx,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],r=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=it("button",{},{type:"button",class:this.buildCSSClass()},it("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()}}ke.registerComponent("TransientButton",dx);const _p=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),r=[];let i="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&r.indexOf(a)===-1&&r.push(a)}return r.length?(r.length===1&&(i=r[0]),s.triggerSourceset(i),!0):!1},fx=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=de.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=de.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",N.Element.prototype.appendChild.call(this,t),this.innerHTML}}),jb=(s,e)=>{let t={};for(let r=0;r<s.length&&(t=Object.getOwnPropertyDescriptor(s[r],e),!(t&&t.set&&t.get));r++);return t.enumerable=!0,t.configurable=!0,t},px=s=>jb([s.el(),N.HTMLMediaElement.prototype,N.Element.prototype,fx],"innerHTML"),my=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},r=px(s),i=n=>(...a)=>{const o=n.apply(e,a);return _p(s),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=i(t[n]))}),Object.defineProperty(e,"innerHTML",Vt(r,{set:i(r.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",r)},s.one("sourceset",e.resetSourceWatch_)},mx=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?ub(N.Element.prototype.getAttribute.call(this,"src")):""},set(s){return N.Element.prototype.setAttribute.call(this,"src",s),s}}),gx=s=>jb([s.el(),N.HTMLMediaElement.prototype,mx],"src"),vx=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=gx(s),r=e.setAttribute,i=e.load;Object.defineProperty(e,"src",Vt(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=r.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),o},e.load=()=>{const n=i.call(e);return _p(s)||(s.triggerSourceset(""),my(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):_p(s)||my(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=i,e.setAttribute=r,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};let Ve=class eh extends qt{constructor(e,t){super(e,t);const r=e.source;let i=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",r&&(this.el_.currentSrc!==r.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(r):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!i&&!this.el_.hasAttribute("crossorigin")&&bd(l.src)&&(i=!0)):o.push(l))}for(let l=0;l<o.length;l++)this.el_.removeChild(o[l])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&i&&mt.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
231
|
+
This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(ec||dd)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),eh.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){vx(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const r=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};r(),e.addEventListener("change",r),this.on("dispose",()=>e.removeEventListener("change",r));const i=()=>{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",i)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",r),e.removeEventListener("change",i),e.addEventListener("change",i)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",r),e.addEventListener("change",r),e.removeEventListener("change",i)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const r=e.toLowerCase();this[`${r}TracksListeners_`]&&Object.keys(this[`${r}TracksListeners_`]).forEach(i=>{this.el()[`${r}Tracks`].removeEventListener(i,this[`${r}TracksListeners_`][i])}),this[`featuresNative${e}Tracks`]=!t,this[`${r}TracksListeners_`]=null,this.proxyNativeTracksForType_(r)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=cn[e],r=this.el()[t.getterName],i=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!r||!r.addEventListener)return;const n={change:o=>{const l={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(l),e==="text"&&this[yl.remoteText.getterName]().trigger(l)},addtrack(o){i.addTrack(o.track)},removetrack(o){i.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l<i.length;l++){let u=!1;for(let c=0;c<r.length;c++)if(r[c]===i[l]){u=!0;break}u||o.push(i[l])}for(;o.length;)i.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const l=n[o];r.addEventListener(o,l),this.on("dispose",u=>r.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){cn.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),eh.disposeMediaElement(e),e=r}else{e=de.createElement("video");const r=this.options_.tag&&Sa(this.options_.tag),i=Vt({},r);(!ec||this.options_.nativeControlsForTouch!==!0)&&delete i.controls,FT(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&pl(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let r=0;r<t.length;r++){const i=t[r],n=this.options_[i];typeof n<"u"&&(n?pl(e,i,i):md(e,i),e[i]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let r=!1;const i=function(){r=!0};this.on("loadstart",i);const n=function(){r||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),r||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(r){this.trigger(r)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&fd?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){mt(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ms&&gs&&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)os(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 mt.error("Invalid source URL."),!1;const r={src:e};t&&(r.type=t);const i=it("source",{},r);return this.el_.appendChild(i),!0}removeSourceElement(e){if(!e)return mt.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const r of t)if(r.src===e)return this.el_.removeChild(r),!0;return mt.warn(`No matching source element found with src: ${e}`),!1}reset(){eh.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,r):super.addTextTrack(e,t,r)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=de.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 r=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(r),r}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let r=t.length;for(;r--;)(e===t[r]||e===t[r].track)&&this.el().removeChild(t[r])}}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),N.performance&&(e.creationTime=N.performance.now()),e}};ud(Ve,"TEST_VID",function(){if(!xl())return;const s=de.createElement("video"),e=de.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});Ve.isSupported=function(){try{Ve.TEST_VID.volume=.5}catch{return!1}return!!(Ve.TEST_VID&&Ve.TEST_VID.canPlayType)};Ve.canPlayType=function(s){return Ve.TEST_VID.canPlayType(s)};Ve.canPlaySource=function(s,e){return Ve.canPlayType(s.type)};Ve.canControlVolume=function(){try{const s=Ve.TEST_VID.volume;Ve.TEST_VID.volume=s/2+.1;const e=s!==Ve.TEST_VID.volume;return e&&vr?(N.setTimeout(()=>{Ve&&Ve.prototype&&(Ve.prototype.featuresVolumeControl=s!==Ve.TEST_VID.volume)}),!1):e}catch{return!1}};Ve.canMuteVolume=function(){try{const s=Ve.TEST_VID.muted;return Ve.TEST_VID.muted=!s,Ve.TEST_VID.muted?pl(Ve.TEST_VID,"muted","muted"):md(Ve.TEST_VID,"muted","muted"),s!==Ve.TEST_VID.muted}catch{return!1}};Ve.canControlPlaybackRate=function(){if(ms&&gs&&cd<58)return!1;try{const s=Ve.TEST_VID.playbackRate;return Ve.TEST_VID.playbackRate=s/2+.1,s!==Ve.TEST_VID.playbackRate}catch{return!1}};Ve.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(de.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(de.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(de.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(de.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Ve.supportsNativeTextTracks=function(){return fd||vr&&gs};Ve.supportsNativeVideoTracks=function(){return!!(Ve.TEST_VID&&Ve.TEST_VID.videoTracks)};Ve.supportsNativeAudioTracks=function(){return!!(Ve.TEST_VID&&Ve.TEST_VID.audioTracks)};Ve.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([s,e]){ud(Ve.prototype,s,()=>Ve[e](),!0)});Ve.prototype.featuresVolumeControl=Ve.canControlVolume();Ve.prototype.movingMediaElementInDOM=!vr;Ve.prototype.featuresFullscreenResize=!0;Ve.prototype.featuresProgressEvents=!0;Ve.prototype.featuresTimeupdateEvents=!0;Ve.prototype.featuresVideoFrameCallback=!!(Ve.TEST_VID&&Ve.TEST_VID.requestVideoFrameCallback);Ve.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};Ve.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Ve.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ve.prototype["set"+pi(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Ve.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ve.prototype["set"+pi(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ve.prototype[s]=function(){return this.el_[s]()}});qt.withSourceHandlers(Ve);Ve.nativeSourceHandler={};Ve.nativeSourceHandler.canPlayType=function(s){try{return Ve.TEST_VID.canPlayType(s)}catch{return""}};Ve.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ve.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Dm(s.src);return Ve.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Ve.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ve.nativeSourceHandler.dispose=function(){};Ve.registerSourceHandler(Ve.nativeSourceHandler);qt.registerTech("Html5",Ve);const Hb=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],_f={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Tp=["tiny","xsmall","small","medium","large","xlarge","huge"],th={};Tp.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;th[s]=`vjs-layout-${e}`});const yx={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Di=class $o extends ke{constructor(e,t,r){if(e.id=e.id||t.id||`vjs_video_${dn()}`,t=Object.assign($o.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,r),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=AT(this.id_),this.fsApi_=ph,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&&Sa(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=$o.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(),km(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Kr(de,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const i=Vt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=i,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new N.DOMParser().parseFromString(jA,"image/svg+xml");if(o.querySelector("parsererror"))mt.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),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 HA(this),this.addClass("vjs-spatial-navigation-enabled")),ec&&this.addClass("vjs-touch-enabled"),vr||this.addClass("vjs-workinghover"),$o.players[this.id_]=this;const n=up.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"),tr(de,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),tr(de,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),$o.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),BA(this),hr.names.forEach(e=>{const t=hr[e],r=this[t.getterName]();r&&r.off&&r.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,r=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const i=this.tag.tagName.toLowerCase()==="video-js";r?t=this.el_=e.parentNode:i||(t=this.el_=super.createEl("div"));const n=Sa(e);if(i){for(t=this.el_=e,e=this.tag=de.createElement("video");t.children.length;)e.appendChild(t.firstChild);Vu(t,"video-js")||to(t,"video-js"),t.appendChild(e),r=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",gs&&hd&&(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(l){i&&l==="class"||t.setAttribute(l,n[l]),i&&e.setAttribute(l,n[l])}),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(l=>MT[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),N.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=YT("vjs-styles-dimensions");const l=ka(".vjs-styles-defaults"),u=ka("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.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 o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){const u=o.item(l);to(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!r&&e.parentNode.insertBefore(t,e),hp(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"){mt.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 r=e+"_";if(t===void 0)return this[r]||0;if(t===""||t==="auto"){this[r]=void 0,this.updateStyleEl_();return}const i=parseFloat(t);if(isNaN(i)){mt.error(`Improper value "${t}" supplied for for ${e}`);return}this[r]=i,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Vs(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),fA(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(N.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l));return}let e,t,r,i;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?r=this.aspectRatio_:this.videoWidth()>0?r=this.videoWidth()+":"+this.videoHeight():r="16:9";const n=r.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())?i="dimensions-"+this.id():i=this.id()+"-dimensions",this.addClass(i),QT(this.styleEl_,`
|
|
232
|
+
.${i} {
|
|
233
|
+
width: ${e}px;
|
|
234
|
+
height: ${t}px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.${i}.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
238
|
+
padding-top: ${a*100}%;
|
|
239
|
+
}
|
|
240
|
+
`)}loadTech_(e,t){this.tech_&&this.unloadTech_();const r=pi(e),i=e.charAt(0).toLowerCase()+e.slice(1);r!=="Html5"&&this.tag&&(qt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,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()}_${i}_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};hr.names.forEach(l=>{const u=hr[l];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[i]),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 o=qt.getTech(e);if(!o)throw new Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(Yt(this,this.handleTechReady_),!0),Gv.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Hb.forEach(l=>{this.on(this.tech_,l,u=>this[`handleTech${pi(l)}_`](u))}),Object.keys(_f).forEach(l=>{this.on(this.tech_,l,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${_f[l]}_`].bind(this),event:u});return}this[`handleTech${_f[l]}_`](u)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,u)=>this.handleTechFullscreenChange_(l,u)),this.on(this.tech_,"fullscreenerror",(l,u)=>this.handleTechFullscreenError_(l,u)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(r!=="Html5"||!this.tag)&&hp(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){hr.names.forEach(e=>{const t=hr[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Gv.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&&mt.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
241
|
+
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
242
|
+
`),this.tech_}version(){return{"video.js":up}}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 i=this.muted();this.muted(!0);const n=()=>{this.muted(i)};this.playTerminatedQueue_.push(n);const a=this.play();if(zu(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let r;if(e==="any"&&!this.muted()?(r=this.play(),zu(r)&&(r=r.catch(t))):e==="muted"&&!this.muted()?r=t():r=this.play(),!!zu(r))return r.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,r="";typeof t!="string"&&(t=e.src,r=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!r&&(r=$A(this,t)),this.cache_.source=Vt({},e,{src:t,type:r});const i=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;l<a.length;l++){const u=Sa(a[l]);n.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const r=this.currentSource().src,i=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==r)&&(t=()=>{}),t(i),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()?os(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),r=>r.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()&&!de.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 r=this.el();let i=de[this.fsApi_.fullscreenElement]===r;!i&&r.matches&&(i=r.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(i)}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 MA)return LA(this.middleware_,this.tech_,e,t);if(e in Zv)return Jv(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(r){throw mt(r),r}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in OA)return PA(this.middleware_,this.tech_,e);if(e in Zv)return Jv(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(mt(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(mt(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(mt(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=os){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),r=!!(fd||vr);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&&r&&this.load();return}const i=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),i===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)}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(r){r(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Dn(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=Dn(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Dn(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 ab(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let r=e.end(e.length-1);return r>t&&(r=t),r}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((r,i)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),r()}function o(u,c){n(),i(c)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(r,i))})}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 r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),r}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,r)=>{function i(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){i(),t()}function a(l,u){i(),r(u)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(i,i),o.then(t,r))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=de[this.fsApi_.exitFullscreen]();return e&&os(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=de.documentElement.style.overflow,Kr(de,"keydown",this.boundFullWindowOnEscKey_),de.documentElement.style.overflow="hidden",to(de.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,tr(de,"keydown",this.boundFullWindowOnEscKey_),de.documentElement.style.overflow=this.docOrigOverflow,pd(de.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&&N.documentPictureInPicture){const e=de.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(it("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),N.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(GT(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",r=>{const i=r.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in de&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(N.documentPictureInPicture&&N.documentPictureInPicture.window)return N.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in de)return de.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const n=i.tagName.toLowerCase();if(i.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(i.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:r=a=>e.key.toLowerCase()==="f",muteKey:i=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();const a=ke.getComponent("FullscreenToggle");de[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),ke.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),ke.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let r=0,i=this.options_.techOrder;r<i.length;r++){const n=i[r];let a=qt.getTech(n);if(a||(a=ke.getComponent(n)),!a){mt.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(o=>[o,qt.getTech(o)]).filter(([o,l])=>l?l.isSupported():(mt.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(o,l,u){let c;return o.some(d=>l.some(f=>{if(c=u(d,f),c)return!0})),c};let i;const n=o=>(l,u)=>o(u,l),a=([o,l],u)=>{if(l.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?i=r(e,t,n(a)):i=r(t,e,a),i||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const r=db(e);if(!r.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),DA(this,r[0],(i,n)=>{if(this.middleware_=n,t||(this.cache_.sources=r),this.updateSourceCaches_(i),this.src_(i)){if(r.length>1)return this.handleSrc_(r.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}IA(n,this.tech_)}),r.length>1){const i=()=>{this.error(null),this.handleSrc_(r.slice(1),!0)},n=()=>{this.off("error",i)};this.one("error",i),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",i),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?ib(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();os(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}),Vs(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:r,remainingTimeDisplay:i}=this.controlBar||{},{seekBar:n}=r||{};e&&e.updateContent(),t&&t.updateContent(),i&&i.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(wa("beforeerror").forEach(t=>{const r=t(this,e);if(!(ps(r)&&!Array.isArray(r)||typeof r=="string"||typeof r=="number"||r===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=r}),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 ci(e),this.addClass("vjs-error"),mt.error(`(CODE:${this.error_.code} ${ci.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),wa("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,r;const i=Yt(this,this.reportUserActivity),n=function(d){(d.screenX!==t||d.screenY!==r)&&(t=d.screenX,r=d.screenY,i())},a=function(){i(),this.clearInterval(e),e=this.setInterval(i,250)},o=function(d){i(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!vr&&!ms&&(l.on("mouseenter",function(d){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(d){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",i),this.on("keyup",i);let u;const c=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const d=this.options_.inactivityTimeout;d<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},d))};this.setInterval(c,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"),r=t&&t.currentHeight();e.forEach(i=>{i!==t&&i.el_&&!i.hasClass("vjs-hidden")&&(i.hide(),this.audioOnlyCache_.hiddenChildren.push(i))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=r,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(r),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,r){if(this.tech_)return this.tech_.addTextTrack(e,t,r)}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(),Vs(this)&&this.trigger("languagechange"))}languages(){return Vt($o.prototype.options_.languages,this.languages_)}toJSON(){const e=Vt(this.options_),t=e.tracks;e.tracks=[];for(let r=0;r<t.length;r++){let i=t[r];i=Vt(i),i.player=void 0,e.tracks[r]=i}return e}createModal(e,t){t=t||{},t.content=e||"";const r=new Il(this,t);return this.addChild(r),r.on("dispose",()=>{this.removeChild(r)}),r.open(),r}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let r=0;r<Tp.length;r++){const i=Tp[r],n=this.breakpoints_[i];if(t<=n){if(e===i)return;e&&this.removeClass(th[e]),this.addClass(th[i]),this.breakpoint_=i;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({},yx,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 th[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const r=this.crossOrigin();this.reset(),this.cache_.media=Vt(e);const{artist:i,artwork:n,description:a,poster:o,src:l,textTracks:u,title:c}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:Ch(o)}]),r&&this.crossOrigin(r),l&&this.src(l),o&&this.poster(o),Array.isArray(u)&&u.forEach(d=>this.addRemoteTextTrack(d,!1)),this.titleBar&&this.titleBar.update({title:c,description:a||i||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),r=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),i={src:t,textTracks:r};return e&&(i.poster=e,i.artwork=[{src:i.poster,type:Ch(i.poster)}]),i}return Vt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},r=Sa(e),i=r["data-setup"];if(Vu(e,"vjs-fill")&&(r.fill=!0),Vu(e,"vjs-fluid")&&(r.fluid=!0),i!==null)try{Object.assign(r,JSON.parse(i||"{}"))}catch(n){mt.error("data-setup",n)}if(Object.assign(t,r),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const l=n[a],u=l.nodeName.toLowerCase();u==="source"?t.sources.push(Sa(l)):u==="track"&&t.tracks.push(Sa(l))}}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"))}};hr.names.forEach(function(s){const e=hr[s];Di.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Di.prototype.crossorigin=Di.prototype.crossOrigin;Di.players={};const Au=N.navigator;Di.prototype.options_={techOrder:qt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Au&&(Au.languages&&Au.languages[0]||Au.userLanguage||Au.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};Hb.forEach(function(s){Di.prototype[`handleTech${pi(s)}_`]=function(){return this.trigger(s)}});ke.registerComponent("Player",Di);const Eh="plugin",Zo="activePlugins_",Vo={},wh=s=>Vo.hasOwnProperty(s),ih=s=>wh(s)?Vo[s]:void 0,Vb=(s,e)=>{s[Zo]=s[Zo]||{},s[Zo][e]=!0},kh=(s,e,t)=>{const r=(t?"before":"")+"pluginsetup";s.trigger(r,e),s.trigger(r+":"+e.name,e)},_x=function(s,e){const t=function(){kh(this,{name:s,plugin:e,instance:null},!0);const r=e.apply(this,arguments);return Vb(this,s),kh(this,{name:s,plugin:e,instance:r}),r};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},gy=(s,e)=>(e.prototype.name=s,function(...t){kh(this,{name:s,plugin:e,instance:null},!0);const r=new e(this,...t);return this[s]=()=>r,kh(this,r.getEventHash()),r});let ys=class rh{constructor(e){if(this.constructor===rh)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),km(this),delete this.trigger,tb(this,this.constructor.defaultState),Vb(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 Dl(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[Zo][e]=!1,this.player=this.state=null,t[e]=gy(e,Vo[e])}static isBasic(e){const t=typeof e=="string"?ih(e):e;return typeof t=="function"&&!rh.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(wh(e))mt.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Di.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 Vo[e]=t,e!==Eh&&(rh.isBasic(t)?Di.prototype[e]=_x(e,t):Di.prototype[e]=gy(e,t)),t}static deregisterPlugin(e){if(e===Eh)throw new Error("Cannot de-register base plugin.");wh(e)&&(delete Vo[e],delete Di.prototype[e])}static getPlugins(e=Object.keys(Vo)){let t;return e.forEach(r=>{const i=ih(r);i&&(t=t||{},t[r]=i)}),t}static getPluginVersion(e){const t=ih(e);return t&&t.VERSION||""}};ys.getPlugin=ih;ys.BASE_PLUGIN_NAME=Eh;ys.registerPlugin(Eh,ys);Di.prototype.usingPlugin=function(s){return!!this[Zo]&&this[Zo][s]===!0};Di.prototype.hasPlugin=function(s){return!!wh(s)};function Tx(s,e){let t=!1;return function(...r){return t||mt.warn(s),t=!0,e.apply(this,r)}}function On(s,e,t,r){return Tx(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,r)}var bx={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 qb=s=>s.indexOf("#")===0?s.slice(1):s;function B(s,e,t){let r=B.getPlayer(s);if(r)return e&&mt.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&r.ready(t),r;const i=typeof s=="string"?ka("#"+qb(s)):s;if(!Nl(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in i?i.getRootNode()instanceof N.ShadowRoot:!1)?i.getRootNode():i.ownerDocument.body;(!i.ownerDocument.defaultView||!a.contains(i))&&mt.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),wa("beforesetup").forEach(l=>{const u=l(i,Vt(e));if(!ps(u)||Array.isArray(u)){mt.error("please return an object in beforesetup hooks");return}e=Vt(e,u)});const o=ke.getComponent("Player");return r=new o(i,e,t),wa("setup").forEach(l=>l(r)),r}B.hooks_=Fs;B.hooks=wa;B.hook=Zk;B.hookOnce=eA;B.removeHook=kT;if(N.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&xl()){let s=ka(".vjs-styles-defaults");if(!s){s=YT("vjs-styles-defaults");const e=ka("head");e&&e.insertBefore(s,e.firstChild),QT(s,`
|
|
243
|
+
.video-js {
|
|
244
|
+
width: 300px;
|
|
245
|
+
height: 150px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
249
|
+
padding-top: 56.25%
|
|
250
|
+
}
|
|
251
|
+
`)}}fp(1,B);B.VERSION=up;B.options=Di.prototype.options_;B.getPlayers=()=>Di.players;B.getPlayer=s=>{const e=Di.players;let t;if(typeof s=="string"){const r=qb(s),i=e[r];if(i)return i;t=ka("#"+r)}else t=s;if(Nl(t)){const{player:r,playerId:i}=t;if(r||e[i])return r||e[i]}};B.getAllPlayers=()=>Object.keys(Di.players).map(s=>Di.players[s]).filter(Boolean);B.players=Di.players;B.getComponent=ke.getComponent;B.registerComponent=(s,e)=>(qt.isTech(e)&&mt.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),ke.registerComponent.call(ke,s,e));B.getTech=qt.getTech;B.registerTech=qt.registerTech;B.use=NA;Object.defineProperty(B,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(B.middleware,"TERMINATOR",{value:Sh,writeable:!1,enumerable:!0});B.browser=MT;B.obj=rA;B.mergeOptions=On(9,"videojs.mergeOptions","videojs.obj.merge",Vt);B.defineLazyProperty=On(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ud);B.bind=On(9,"videojs.bind","native Function.prototype.bind",Yt);B.registerPlugin=ys.registerPlugin;B.deregisterPlugin=ys.deregisterPlugin;B.plugin=(s,e)=>(mt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ys.registerPlugin(s,e));B.getPlugins=ys.getPlugins;B.getPlugin=ys.getPlugin;B.getPluginVersion=ys.getPluginVersion;B.addLanguage=function(s,e){return s=(""+s).toLowerCase(),B.options.languages=Vt(B.options.languages,{[s]:e}),B.options.languages[s]};B.log=mt;B.createLogger=AT;B.time=yA;B.createTimeRange=On(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Dn);B.createTimeRanges=On(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Dn);B.formatTime=On(9,"videojs.formatTime","videojs.time.formatTime",uo);B.setFormatTime=On(9,"videojs.setFormatTime","videojs.time.setFormatTime",nb);B.resetFormatTime=On(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",sb);B.parseUrl=On(9,"videojs.parseUrl","videojs.url.parseUrl",Nm);B.isCrossOrigin=On(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",bd);B.EventTarget=Xr;B.any=wm;B.on=Kr;B.one=_d;B.off=tr;B.trigger=Dl;B.xhr=cT;B.TextTrack=dc;B.AudioTrack=cb;B.VideoTrack=hb;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{B[s]=function(){return mt.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),KT[s].apply(null,arguments)}});B.computedStyle=On(9,"videojs.computedStyle","videojs.dom.computedStyle",gl);B.dom=KT;B.fn=dA;B.num=YA;B.str=gA;B.url=AA;B.Error=bx;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */let Sx=class{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(r){t.enabled_(r)}}),t}},Ah=class extends B.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 r=this.levels_.length;return t=new Sx(e),""+r in this||Object.defineProperty(this,r,{get(){return this.levels_[r]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let r=0,i=this.length;r<i;r++)if(this[r]===e){t=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,r=this.length;t<r;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};Ah.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in Ah.prototype.allowedEvents_)Ah.prototype["on"+s]=null;var zb="4.1.0";const Cx=function(s,e){const t=s.qualityLevels,r=new Ah,i=function(){r.dispose(),s.qualityLevels=t,s.off("dispose",i)};return s.on("dispose",i),s.qualityLevels=()=>r,s.qualityLevels.VERSION=zb,r},Wb=function(s){return Cx(this,B.obj.merge({},s))};B.registerPlugin("qualityLevels",Wb);Wb.VERSION=zb;/*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */const Nr=sd,xh=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,pn=s=>B.log.debug?B.log.debug.bind(B,"VHS:",`${s} >`):function(){};function Pt(...s){const e=B.obj||B;return(e.merge||e.mergeOptions).apply(e,s)}function ji(...s){const e=B.time||B;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function Ex(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
|
|
252
|
+
`;for(let t=0;t<s.length;t++){const r=s.start(t),i=s.end(t);e+=`${r} --> ${i}. Duration (${i-r})
|
|
253
|
+
`}return e}const ls=1/30,us=ls*3,Gb=function(s,e){const t=[];let r;if(s&&s.length)for(r=0;r<s.length;r++)e(s.start(r),s.end(r))&&t.push([s.start(r),s.end(r)]);return ji(t)},qo=function(s,e){return Gb(s,function(t,r){return t-us<=e&&r+us>=e})},Lc=function(s,e){return Gb(s,function(t){return t-ls>=e})},wx=function(s){if(s.length<2)return ji();const e=[];for(let t=1;t<s.length;t++){const r=s.end(t-1),i=s.start(t);e.push([r,i])}return ji(e)},kx=function(s,e){let t=null,r=null,i=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return ji();let o=s.length;for(;o--;)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(l,u){return l.time-u.time}),o=0;o<n.length;o++)n[o].type==="start"?(i++,i===2&&(t=n[o].time)):n[o].type==="end"&&(i--,i===1&&(r=n[o].time)),t!==null&&r!==null&&(a.push([t,r]),t=null,r=null);return ji(a)},Kb=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},Ax=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Ja=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},xx=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},Tf=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},Gm=function(s,e){let t=0;if(!s||!s.length)return t;for(let r=0;r<s.length;r++){const i=s.start(r),n=s.end(r);if(!(e>n)){if(e>i&&e<=n){t+=n-e;continue}t+=n-i}}return t},Km=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(r){t+=r.duration}),(e.preloadHints||[]).forEach(function(r){r.type==="PART"&&(t+=s.partTargetDuration)}),t},bp=s=>(s.segments||[]).reduce((e,t,r)=>(t.parts?t.parts.forEach(function(i,n){e.push({duration:i.duration,segmentIndex:r,partIndex:n,part:i,segment:t})}):e.push({duration:t.duration,segmentIndex:r,partIndex:null,segment:t,part:null}),e),[]),Xb=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},Yb=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let r=(t||[]).reduce((i,n)=>i+(n.type==="PART"?1:0),0);return r+=e&&e.length?e.length:0,r},Qb=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=Xb(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},Nx=function(s,e){let t=0,r=e-s.mediaSequence,i=s.segments[r];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=s.segments[r],typeof i.end<"u")return{result:t+i.end,precise:!0};if(t+=Km(s,i),typeof i.start<"u")return{result:t+i.start,precise:!0}}return{result:t,precise:!1}},Dx=function(s,e){let t=0,r,i=e-s.mediaSequence;for(;i<s.segments.length;i++){if(r=s.segments[i],typeof r.start<"u")return{result:r.start-t,precise:!0};if(t+=Km(s,r),typeof r.end<"u")return{result:r.end-t,precise:!0}}return{result:-1,precise:!1}},Jb=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const r=Nx(s,e);if(r.precise)return r.result;const i=Dx(s,e);return i.precise?i.result:r.result+t},Zb=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return N.Infinity}return Jb(s,e,t)},Wu=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:r}){let i=0;if(t>r&&([t,r]=[r,t]),t<0){for(let n=t;n<Math.min(0,r);n++)i+=s;t=0}for(let n=t;n<r;n++)i+=e[n].duration;return i},e1=function(s,e,t,r){if(!s||!s.segments)return null;if(s.endList)return Zb(s);if(e===null)return null;e=e||0;let i=Jb(s,s.mediaSequence+s.segments.length,e);return t&&(r=typeof r=="number"?r:Qb(null,s),i-=r),Math.max(0,i)},Ix=function(s,e,t){const i=e||0;let n=e1(s,e,!0,t);return n===null?ji():(n<i&&(n=i),ji(i,n))},Px=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:r,startTime:i,exactManifestTimings:n}){let a=e-i;const o=bp(s);let l=0;for(let u=0;u<o.length;u++){const c=o[u];if(t===c.segmentIndex&&!(typeof r=="number"&&typeof c.partIndex=="number"&&r!==c.partIndex)){l=u;break}}if(a<0){if(l>0)for(let u=l-1;u>=0;u--){const c=o[u];if(a+=c.duration,n){if(a<0)continue}else if(a+ls<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:i-Wu({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let u=l;u<0;u++)if(a-=s.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let u=l;u<o.length;u++){const c=o[u];a-=c.duration;const d=c.duration>ls,f=a===0,g=d&&a+ls>=0;if(!((f||g)&&u!==o.length-1)){if(n){if(a>0)continue}else if(a-ls>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:i+Wu({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},t1=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},Xm=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Ed=function(s){const e=t1(s);return!s.disabled&&!e},Lx=function(s){return s.disabled},Ox=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},i1=function(s,e){return e.attributes&&e.attributes[s]},Mx=function(s,e,t,r=0){return i1("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-r*8)/e:NaN},Sp=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(r=>Ed(r)?(r.attributes.BANDWIDTH||0)<t:!1).length===0},Ym=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),vy=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let r=!1;for(const i in t){for(const n in t[i])if(r=e(t[i][n]),r)break;if(r)break}return!!r},gc=s=>{if(!s||!s.playlists||!s.playlists.length)return vy(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],r=t.attributes&&t.attributes.CODECS;if(!(r&&r.split(",").every(n=>fT(n))||vy(s,n=>Ym(t,n))))return!1}return!0};var Dr={liveEdgeDelay:Qb,duration:Zb,seekable:Ix,getMediaInfoForTime:Px,isEnabled:Ed,isDisabled:Lx,isExcluded:t1,isIncompatible:Xm,playlistEnd:e1,isAes:Ox,hasAttribute:i1,estimateSegmentRequestTime:Mx,isLowestEnabledRendition:Sp,isAudioOnly:gc,playlistMatch:Ym,segmentDurationWithParts:Km};const{log:r1}=B,el=(s,e)=>`${s}-${e}`,n1=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,Rx=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:r=[],customTagMappers:i=[],llhls:n})=>{const a=new Sw;s&&a.on("warn",s),e&&a.on("info",e),r.forEach(u=>a.addParser(u)),i.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(c){u.hasOwnProperty(c)&&delete u[c]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((c,d)=>Math.max(c,d.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const l=Xb(o);if(l.length&&!o.partTargetDuration){const u=l.reduce((c,d)=>Math.max(c,d.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${u}`}),r1.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.")),o.partTargetDuration=u}return o},Ml=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const r in s.mediaGroups[t])for(const i in s.mediaGroups[t][r]){const n=s.mediaGroups[t][r][i];e(n,t,r,i)}})},s1=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},Bx=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];s1({playlist:t,id:el(e,t.uri)}),t.resolvedUri=Nr(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||r1.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Ux=s=>{Ml(s,e=>{e.uri&&(e.resolvedUri=Nr(s.uri,e.uri))})},Fx=(s,e)=>{const t=el(0,e),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:N.location.href,resolvedUri:N.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return r.playlists[t]=r.playlists[0],r.playlists[e]=r.playlists[0],r},a1=(s,e,t=n1)=>{s.uri=e;for(let i=0;i<s.playlists.length;i++)if(!s.playlists[i].uri){const n=`placeholder-uri-${i}`;s.playlists[i].uri=n}const r=gc(s);Ml(s,(i,n,a,o)=>{if(!i.playlists||!i.playlists.length){if(r&&n==="AUDIO"&&!i.uri)for(let l=0;l<s.playlists.length;l++){const u=s.playlists[l];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}i.playlists=[jt({},i)]}i.playlists.forEach(function(l,u){const c=t(n,a,o,l),d=el(u,c);l.uri?l.resolvedUri=l.resolvedUri||Nr(s.uri,l.uri):(l.uri=u===0?c:d,l.resolvedUri=l.uri),l.id=l.id||d,l.attributes=l.attributes||{},s.playlists[l.id]=l,s.playlists[l.uri]=l})}),Bx(s),Ux(s)};class yy{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,r=t.startDate.getTime();this.trimProcessedDateRanges_(r),this.pendingDateRanges_=e.reduce((i,n)=>(i.set(n.id,n),i),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((r,i)=>{if(!this.processedDateRanges_.has(i)&&(r.startTime=r.startDate.getTime()/1e3-this.offset_,r.processDateRange=()=>this.processDateRange(r),t.push(r),!!r.class))if(e[r.class]){const n=e[r.class].push(r);r.classListIndex=n-1}else e[r.class]=[r],r.classListIndex=0});for(const r of t){const i=e[r.class]||[];r.endDate?r.endTime=r.endDate.getTime()/1e3-this.offset_:r.endOnNext&&i[r.classListIndex+1]?r.endTime=i[r.classListIndex+1].startTime:r.duration?r.endTime=r.startTime+r.duration:r.plannedDuration?r.endTime=r.startTime+r.plannedDuration:r.endTime=r.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((r,i)=>{r.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const o1=22,no=({requestType:s,request:e,error:t,parseFailure:r})=>{const i=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},o=i&&!n||r;if(t&&n)a.error=jt({},t),a.errorType=B.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=B.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=B.Error.NetworkRequestTimeout;else if(o){const l=r?B.Error.NetworkBodyParserFailed:B.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:$x}=B,jx=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:r}=e;let i=e.mediaSequence+e.segments.length;if(r){const n=r.parts||[],a=Yb(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&i--}t._HLS_msn=i}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const r=new N.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(i){t.hasOwnProperty(i)&&r.searchParams.set(i,t[i])}),s=r.toString()}return s},Hx=(s,e)=>{if(!s)return e;const t=Pt(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let r=0;r<e.parts.length;r++)s.parts&&s.parts[r]&&(t.parts[r]=Pt(s.parts[r],e.parts[r]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},Vx=(s,e,t)=>{const r=s.slice(),i=e.slice();t=t||0;const n=[];let a;for(let o=0;o<i.length;o++){const l=r[o+t],u=i[o];l?(a=l.map||a,n.push(Hx(l,u))):(a&&!u.map&&(u.map=a),n.push(u))}return n},l1=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=Nr(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=Nr(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=Nr(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=Nr(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Nr(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Nr(e,t.uri))})},u1=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let r=0;r<t.preloadHints.length;r++)if(t.preloadHints[r].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},c1=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Cp=(s,e,t=c1)=>{const r=Pt(s,{}),i=r.playlists[e.id];if(!i||t(i,e))return null;e.segments=u1(e);const n=Pt(i,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,i.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=Vx(i.segments,e.segments,e.mediaSequence-i.mediaSequence)}n.segments.forEach(a=>{l1(a,n.resolvedUri)});for(let a=0;a<r.playlists.length;a++)r.playlists[a].id===e.id&&(r.playlists[a]=n);return r.playlists[e.id]=n,r.playlists[e.uri]=n,Ml(s,(a,o,l,u)=>{if(a.playlists)for(let c=0;c<a.playlists.length;c++)e.id===a.playlists[c].id&&(a.playlists[c]=n)}),r},Ep=(s,e)=>{const t=s.segments||[],r=t[t.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],n=i&&i.duration||r&&r.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},_y=(s,e,t)=>{if(!s)return;const r=[];return s.forEach(i=>{if(!i.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=i.attributes;r.push({id:i.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:r}};let zo=class extends $x{constructor(e,t,r={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=pn("PlaylistLoader");const{withCredentials:i=!1}=r;this.src=e,this.vhs_=t,this.withCredentials=i,this.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new yy,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=Nr(this.main.uri,e.uri);this.llhls&&(t=jx(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(r,i)=>{if(this.request){if(r)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,r){const{uri:i,id:n}=t;this.request=null,r&&(this.state=r),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${i}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:no({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return Rx({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})}catch(r){this.error=r,this.error.metadata={errorType:B.Error.StreamingHlsPlaylistParserError,error:r}}}haveMetadata({playlistString:e,playlistObject:t,url:r,id:i}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:r}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:r,manifestString:e});a.lastRequest=Date.now(),s1({playlist:a,uri:r,id:i});const o=Cp(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[i]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ep(this.media(),!!o)),n.parsedPlaylist=_y(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),N.clearTimeout(this.mediaUpdateTimeout),N.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new yy,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(N.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=N.setTimeout(this.media.bind(this,e,!1),o);return}const r=this.state,i=!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,i&&(this.trigger("mediachanging"),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Ep(e,!0)),!i)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"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=xh(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,r);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(N.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&&(N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const r=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=N.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},r);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=N.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=N.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,r)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:r.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:r.responseText,code:2,metadata:no({requestType:r.requestType,request:r,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=xh(this.src,r),this.trigger({type:"playlistparsestart",metadata:e});const i=this.parseManifest_({manifestString:r.responseText,url:this.src});e.parsedPlaylist=_y(i.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,a1(this.main,this.srcUri()),e.playlists.forEach(r=>{r.segments=u1(r),r.segments.forEach(i=>{l1(i,r.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||N.location.href;this.main=Fx(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const r=this.main,i=e.ID;let n=r.playlists.length;for(;n--;){const a=r.playlists[n];if(a.attributes["PATHWAY-ID"]===i){const o=a.resolvedUri,l=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),c=el(i,u),d=this.createCloneAttributes_(i,a.attributes),f=this.createClonePlaylist_(a,c,e,d);r.playlists[n]=f,r.playlists[c]=f,r.playlists[u]=f}else r.playlists.splice(n,1);delete r.playlists[l],delete r.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const r=this.main,i=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||!r.mediaGroups[n][i])){for(const a in r.mediaGroups[n])if(a===i){for(const o in r.mediaGroups[n][a])r.mediaGroups[n][a][o].playlists.forEach((u,c)=>{const d=r.playlists[u.id],f=d.id,g=d.resolvedUri;delete r.playlists[f],delete r.playlists[g]});delete r.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const r=this.main,i=r.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=el(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);r.playlists[i]=l,r.playlists[a]=l,r.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,r=e["BASE-ID"],i=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||i.mediaGroups[n][t]))for(const a in i.mediaGroups[n]){if(a===r)i.mediaGroups[n][t]={};else continue;for(const o in i.mediaGroups[n][a]){const l=i.mediaGroups[n][a][o];i.mediaGroups[n][t][o]=jt({},l);const u=i.mediaGroups[n][t][o],c=this.createCloneURI_(l.resolvedUri,e);u.resolvedUri=c,u.uri=c,u.playlists=[],l.playlists.forEach((d,f)=>{const g=i.playlists[d.id],E=n1(n,t,o),S=el(t,E);if(g&&!i.playlists[S]){const k=this.createClonePlaylist_(g,S,e),F=k.resolvedUri;i.playlists[S]=k,i.playlists[F]=k}u.playlists[f]=this.createClonePlaylist_(d,S,e)})}}})}createClonePlaylist_(e,t,r,i){const n=this.createCloneURI_(e.resolvedUri,r),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),i&&(a.attributes=i),Pt(e,a)}createCloneURI_(e,t){const r=new URL(e);r.hostname=t["URI-REPLACEMENT"].HOST;const i=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(i))r.searchParams.set(n,i[n]);return r.href}createCloneAttributes_(e,t){const r={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(i=>{t[i]&&(r[i]=e)}),r}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const r in e.contentProtection){const i=e.contentProtection[r].attributes.keyId;i&&t.add(i.toLowerCase())}return t}}};const wp=function(s,e,t,r){const i=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&i&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=i.byteLength||i.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(i||s.responseText)))),r(e,s)},qx=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(r=>{t=r(t)}),t},zx=(s,e,t,r)=>{!s||!s.size||s.forEach(i=>{i(e,t,r)})},h1=function(){const s=function e(t,r){t=Pt({timeout:45e3},t);const i=e.beforeRequest||B.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||B.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||B.Vhs.xhr._responseCallbackSet;i&&typeof i=="function"&&(B.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(i));const o=B.Vhs.xhr.original===!0?B.xhr:B.Vhs.xhr,l=qx(n,t);n.delete(i);const u=o(l||t,function(d,f){return zx(a,u,d,f),wp(u,d,f,r)}),c=u.abort;return u.abort=function(){return u.aborted=!0,c.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return s.original=!0,s},Wx=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=N.BigInt(s.offset)+N.BigInt(s.length)-N.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},kp=function(s){const e={};return s.byterange&&(e.Range=Wx(s.byterange)),e},Gx=function(s,e){return s.start(e)+"-"+s.end(e)},Kx=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Xx=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},d1=function(s){const e={};return Object.keys(s).forEach(t=>{const r=s[t];mT(r)?e[t]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:e[t]=r}),e},Nh=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},f1=function(s){return s.resolvedUri},p1=s=>{const e=Array.prototype.slice.call(s),t=16;let r="",i,n;for(let a=0;a<e.length/t;a++)i=e.slice(a*t,a*t+t).map(Kx).join(""),n=e.slice(a*t,a*t+t).map(Xx).join(""),r+=i+" "+n+`
|
|
254
|
+
`;return r},Yx=({bytes:s})=>p1(s),Qx=s=>{let e="",t;for(t=0;t<s.length;t++)e+=Gx(s,t)+" ";return e};var Jx=Object.freeze({__proto__:null,createTransferableMessage:d1,initSegmentId:Nh,segmentKeyId:f1,hexDump:p1,tagDump:Yx,textRanges:Qx});const m1=.25,Zx=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-i;return new Date(e.dateTimeObject.getTime()+n*1e3)},eN=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,tN=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(t<new Date(r.dateTimeObject))return null;for(let l=0;l<e.segments.length-1;l++){r=e.segments[l];const u=new Date(e.segments[l+1].dateTimeObject);if(t<u)break}const i=e.segments[e.segments.length-1],n=i.dateTimeObject,a=i.videoTimingInfo?eN(i.videoTimingInfo):i.duration+i.duration*m1,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Dr.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},iN=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,r;for(let n=0;n<e.segments.length&&(r=e.segments[n],t=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:t+r.duration,!(s<=t));n++);const i=e.segments[e.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+i.duration*m1)return null;r=i}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:t-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},rN=(s,e)=>{let t,r;try{t=new Date(s),r=new Date(e)}catch{}const i=t.getTime();return(r.getTime()-i)/1e3},nN=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},sN=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const r=iN(e,s);if(!r)return t({message:"valid programTime was not found"});if(r.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const i={mediaSeconds:e},n=Zx(e,r.segment);return n&&(i.programDateTime=n.toISOString()),t(null,i)},g1=({programTime:s,playlist:e,retryCount:t=2,seekTo:r,pauseAfterSeek:i=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!r)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(!nN(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=tN(s,e);if(!o)return a({message:`${s} was not found in the stream`});const l=o.segment,u=rN(l.dateTimeObject,s);if(o.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});r(o.estimatedStart+u),n.one("seeked",()=>{g1({programTime:s,playlist:e,retryCount:t-1,seekTo:r,pauseAfterSeek:i,tech:n,callback:a})});return}const c=l.start+u,d=()=>a(null,n.currentTime());n.one("seeked",d),i&&n.pause(),r(c)},bf=(s,e)=>{if(s.readyState===4)return e()},aN=(s,e,t,r)=>{let i=[],n,a=!1;const o=function(d,f,g,E){return f.abort(),a=!0,t(d,f,g,E)},l=function(d,f){if(a)return;if(d)return d.metadata=no({requestType:r,request:f,error:d}),o(d,f,"",i);const g=f.responseText.substring(i&&i.byteLength||0,f.responseText.length);if(i=Ow(i,gT(g,!0)),n=n||Ru(i),i.length<10||n&&i.length<n+2)return bf(f,()=>o(d,f,"",i));const E=Tm(i);return E==="ts"&&i.length<188?bf(f,()=>o(d,f,"",i)):!E&&i.length<376?bf(f,()=>o(d,f,"",i)):o(null,f,E,i)},c=e({uri:s,beforeSend(d){d.overrideMimeType("text/plain; charset=x-user-defined"),d.addEventListener("progress",function({total:f,loaded:g}){return wp(d,null,{statusCode:d.status},l)})}},function(d,f){return wp(c,d,f,l)});return c},{EventTarget:oN}=B,Ty=function(s,e){if(!c1(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const r=s.segments[t],i=e.segments[t];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;const n=r.byterange,a=i.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},lN=(s,e,t,r)=>{const i=r.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${i}`},uN=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:r,previousManifest:i})=>{const n=Ik(s,{manifestUri:e,clientOffset:t,sidxMapping:r,previousManifest:i});return a1(n,e,lN),n},cN=(s,e)=>{Ml(s,(t,r,i,n)=>{(!e.mediaGroups[r][i]||!(n in e.mediaGroups[r][i]))&&delete s.mediaGroups[r][i][n]})},hN=(s,e,t)=>{let r=!0,i=Pt(s,{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 l=od(a.sidx);t&&t[l]&&t[l].sidx&&vm(a,t[l].sidx,a.sidx.resolvedUri)}const o=Cp(i,a,Ty);o&&(i=o,r=!1)}return Ml(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const u=n.playlists[0].id,c=Cp(i,n.playlists[0],Ty);c&&(i=c,l in i.mediaGroups[a][o]||(i.mediaGroups[a][o][l]=n),i.mediaGroups[a][o][l].playlists[0]=i.playlists[u],r=!1)}}),cN(i,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(r=!1),r?null:i},dN=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,by=(s,e)=>{const t={};for(const r in s){const n=s[r].sidx;if(n){const a=od(n);if(!e[a])break;const o=e[a].sidxInfo;dN(o,n)&&(t[a]=e[a])}}return t},fN=(s,e)=>{let r=by(s.playlists,e);return Ml(s,(i,n,a,o)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;r=Pt(r,by(l,e))}}),r};let Ap=class extends oN{constructor(e,t,r={},i){super(),this.mainPlaylistLoader_=i||this,i||(this.isMain_=!0);const{withCredentials:n=!1}=r;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=r.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_=pn("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,r){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},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,t,r){const i=e.sidx&&od(e.sidx);if(!e.sidx||!i||this.mainPlaylistLoader_.sidxMapping_[i]){this.mediaRequest_=N.setTimeout(()=>r(!1),0);return}const n=xh(e.sidx.resolvedUri),a=(l,u)=>{if(this.requestErrored_(l,u,t))return;const c=this.mainPlaylistLoader_.sidxMapping_,{requestType:d}=u;let f;try{f=Rk(Qe(u.response).subarray(8))}catch(g){g.metadata=no({requestType:d,request:u,parseFailure:!0}),this.requestErrored_(g,u,t);return}return c[i]={sidxInfo:e.sidx,sidx:f},vm(e,f,e.sidx.resolvedUri),r(!0)},o="dash-sidx";this.request=aN(n,this.vhs_.xhr,(l,u,c,d)=>{if(l)return a(l,u);if(!c||c!=="mp4"){const E=c||"unknown";return a({status:u.status,message:`Unsupported ${E} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:f,length:g}=e.sidx.byterange;if(d.length>=g+f)return a(l,{response:d.subarray(f,f+g),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:kp({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},N.clearTimeout(this.minimumUpdatePeriodTimeout_),N.clearTimeout(this.mediaRequest_),N.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 r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(N.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const r=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=N.setTimeout(()=>this.load(),r);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_){this.mediaRequest_=N.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"},(r,i)=>{if(r){const{requestType:a}=i;r.metadata=no({requestType:a,request:i,error:r})}if(this.requestErrored_(r,i)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=i.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=xh(this.mainPlaylistLoader_.srcUrl,i),n){this.handleMain_(),this.syncClientServerClock_(()=>e(i,n));return}return e(i,n)})}syncClientServerClock_(e){const t=Pk(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:Nr(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(r,i)=>{if(!this.request)return;if(r){const{requestType:a}=i;return this.error.metadata=no({requestType:a,request:i,error:r}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!i.responseHeaders||!i.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(i.responseHeaders.date):n=Date.parse(i.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_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let r;try{r=uN({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:B.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(r=hN(e,r,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=r||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(r),r){const{duration:n,endList:a}=r,o=[];r.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!r}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(N.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_=N.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_=fN(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{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,r=!this.media_||this.media_!==t[e];if(r?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const i=()=>{this.media().endList||(this.mediaUpdateTimeout=N.setTimeout(()=>{this.trigger("mediaupdatetimeout"),i()},Ep(this.media(),!!r)))};i()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const r in e.contentProtection){const i=e.contentProtection[r].attributes["cenc:default_KID"];i&&t.add(i.replace(/-/g,"").toLowerCase())}return t}}};var Ui={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 pN=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},v1=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},mN=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},y1=function(s){return function(){const e=mN(s),t=v1(new Worker(e));t.objURL=e;const r=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),r.call(this)},t}},_1=function(s){return`var browserWorkerPolyFill = ${v1.toString()};
|
|
255
|
+
browserWorkerPolyFill(self);
|
|
256
|
+
`+s},T1=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},gN=_1(T1(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=function(){this.init=function(){var h={};this.on=function(m,_){h[m]||(h[m]=[]),h[m]=h[m].concat(_)},this.off=function(m,_){var y;return h[m]?(y=h[m].indexOf(_),h[m]=h[m].slice(),h[m].splice(y,1),y>-1):!1},this.trigger=function(m){var _,y,C,x;if(_=h[m],!!_)if(arguments.length===2)for(C=_.length,y=0;y<C;++y)_[y].call(this,arguments[1]);else{for(x=[],y=arguments.length,y=1;y<arguments.length;++y)x.push(arguments[y]);for(C=_.length,y=0;y<C;++y)_[y].apply(this,x)}},this.dispose=function(){h={}}}};e.prototype.pipe=function(h){return this.on("data",function(m){h.push(m)}),this.on("done",function(m){h.flush(m)}),this.on("partialdone",function(m){h.partialFlush(m)}),this.on("endedtimeline",function(m){h.endTimeline(m)}),this.on("reset",function(m){h.reset(m)}),h},e.prototype.push=function(h){this.trigger("data",h)},e.prototype.flush=function(h){this.trigger("done",h)},e.prototype.partialFlush=function(h){this.trigger("partialdone",h)},e.prototype.endTimeline=function(h){this.trigger("endedtimeline",h)},e.prototype.reset=function(h){this.trigger("reset",h)};var t=e,r=Math.pow(2,32),i=function(h){var m=new DataView(h.buffer,h.byteOffset,h.byteLength),_;return m.getBigUint64?(_=m.getBigUint64(0),_<Number.MAX_SAFE_INTEGER?Number(_):_):m.getUint32(0)*r+m.getUint32(4)},n={getUint64:i,MAX_UINT32:r},a=n.MAX_UINT32,o,l,u,c,d,f,g,E,S,k,F,L,W,H,$,G,K,Y,P,O,ne,te,re,me,Se,Ae,ve,Te,ye,_e,xe,qe,We,Ke,ze,xt;(function(){var h;if(re={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(h in re)re.hasOwnProperty(h)&&(re[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);me=new Uint8Array([105,115,111,109]),Ae=new Uint8Array([97,118,99,49]),Se=new Uint8Array([0,0,0,1]),ve=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]),Te=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]),ye={video:ve,audio:Te},qe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),xe=new Uint8Array([0,0,0,0,0,0,0,0]),We=new Uint8Array([0,0,0,0,0,0,0,0]),Ke=We,ze=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),xt=We,_e=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(h){var m=[],_=0,y,C,x;for(y=1;y<arguments.length;y++)m.push(arguments[y]);for(y=m.length;y--;)_+=m[y].byteLength;for(C=new Uint8Array(_+8),x=new DataView(C.buffer,C.byteOffset,C.byteLength),x.setUint32(0,C.byteLength),C.set(h,4),y=0,_=8;y<m.length;y++)C.set(m[y],_),_+=m[y].byteLength;return C},l=function(){return o(re.dinf,o(re.dref,qe))},u=function(h){return o(re.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,h.audioobjecttype<<3|h.samplingfrequencyindex>>>1,h.samplingfrequencyindex<<7|h.channelcount<<3,6,1,2]))},c=function(){return o(re.ftyp,me,Se,me,Ae)},G=function(h){return o(re.hdlr,ye[h])},d=function(h){return o(re.mdat,h)},$=function(h){var m=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,h.duration>>>24&255,h.duration>>>16&255,h.duration>>>8&255,h.duration&255,85,196,0,0]);return h.samplerate&&(m[12]=h.samplerate>>>24&255,m[13]=h.samplerate>>>16&255,m[14]=h.samplerate>>>8&255,m[15]=h.samplerate&255),o(re.mdhd,m)},H=function(h){return o(re.mdia,$(h),G(h.type),g(h))},f=function(h){return o(re.mfhd,new Uint8Array([0,0,0,0,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255]))},g=function(h){return o(re.minf,h.type==="video"?o(re.vmhd,_e):o(re.smhd,xe),l(),Y(h))},E=function(h,m){for(var _=[],y=m.length;y--;)_[y]=O(m[y]);return o.apply(null,[re.moof,f(h)].concat(_))},S=function(h){for(var m=h.length,_=[];m--;)_[m]=L(h[m]);return o.apply(null,[re.moov,F(4294967295)].concat(_).concat(k(h)))},k=function(h){for(var m=h.length,_=[];m--;)_[m]=ne(h[m]);return o.apply(null,[re.mvex].concat(_))},F=function(h){var m=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(re.mvhd,m)},K=function(h){var m=h.samples||[],_=new Uint8Array(4+m.length),y,C;for(C=0;C<m.length;C++)y=m[C].flags,_[C+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return o(re.sdtp,_)},Y=function(h){return o(re.stbl,P(h),o(re.stts,xt),o(re.stsc,Ke),o(re.stsz,ze),o(re.stco,We))},(function(){var h,m;P=function(_){return o(re.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),_.type==="video"?h(_):m(_))},h=function(_){var y=_.sps||[],C=_.pps||[],x=[],q=[],z,Q;for(z=0;z<y.length;z++)x.push((y[z].byteLength&65280)>>>8),x.push(y[z].byteLength&255),x=x.concat(Array.prototype.slice.call(y[z]));for(z=0;z<C.length;z++)q.push((C[z].byteLength&65280)>>>8),q.push(C[z].byteLength&255),q=q.concat(Array.prototype.slice.call(C[z]));if(Q=[re.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,(_.width&65280)>>8,_.width&255,(_.height&65280)>>8,_.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(re.avcC,new Uint8Array([1,_.profileIdc,_.profileCompatibility,_.levelIdc,255].concat([y.length],x,[C.length],q))),o(re.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],_.sarRatio){var Z=_.sarRatio[0],he=_.sarRatio[1];Q.push(o(re.pasp,new Uint8Array([(Z&4278190080)>>24,(Z&16711680)>>16,(Z&65280)>>8,Z&255,(he&4278190080)>>24,(he&16711680)>>16,(he&65280)>>8,he&255])))}return o.apply(null,Q)},m=function(_){return o(re.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(_.channelcount&65280)>>8,_.channelcount&255,(_.samplesize&65280)>>8,_.samplesize&255,0,0,0,0,(_.samplerate&65280)>>8,_.samplerate&255,0,0]),u(_))}})(),W=function(h){var m=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,0,(h.duration&4278190080)>>24,(h.duration&16711680)>>16,(h.duration&65280)>>8,h.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,(h.width&65280)>>8,h.width&255,0,0,(h.height&65280)>>8,h.height&255,0,0]);return o(re.tkhd,m)},O=function(h){var m,_,y,C,x,q,z;return m=o(re.tfhd,new Uint8Array([0,0,0,58,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),q=Math.floor(h.baseMediaDecodeTime/a),z=Math.floor(h.baseMediaDecodeTime%a),_=o(re.tfdt,new Uint8Array([1,0,0,0,q>>>24&255,q>>>16&255,q>>>8&255,q&255,z>>>24&255,z>>>16&255,z>>>8&255,z&255])),x=92,h.type==="audio"?(y=te(h,x),o(re.traf,m,_,y)):(C=K(h),y=te(h,C.length+x),o(re.traf,m,_,y,C))},L=function(h){return h.duration=h.duration||4294967295,o(re.trak,W(h),H(h))},ne=function(h){var m=new Uint8Array([0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return h.type!=="video"&&(m[m.length-1]=0),o(re.trex,m)},(function(){var h,m,_;_=function(y,C){var x=0,q=0,z=0,Q=0;return y.length&&(y[0].duration!==void 0&&(x=1),y[0].size!==void 0&&(q=2),y[0].flags!==void 0&&(z=4),y[0].compositionTimeOffset!==void 0&&(Q=8)),[0,0,x|q|z|Q,1,(y.length&4278190080)>>>24,(y.length&16711680)>>>16,(y.length&65280)>>>8,y.length&255,(C&4278190080)>>>24,(C&16711680)>>>16,(C&65280)>>>8,C&255]},m=function(y,C){var x,q,z,Q,Z,he;for(Q=y.samples||[],C+=20+16*Q.length,z=_(Q,C),q=new Uint8Array(z.length+Q.length*16),q.set(z),x=z.length,he=0;he<Q.length;he++)Z=Q[he],q[x++]=(Z.duration&4278190080)>>>24,q[x++]=(Z.duration&16711680)>>>16,q[x++]=(Z.duration&65280)>>>8,q[x++]=Z.duration&255,q[x++]=(Z.size&4278190080)>>>24,q[x++]=(Z.size&16711680)>>>16,q[x++]=(Z.size&65280)>>>8,q[x++]=Z.size&255,q[x++]=Z.flags.isLeading<<2|Z.flags.dependsOn,q[x++]=Z.flags.isDependedOn<<6|Z.flags.hasRedundancy<<4|Z.flags.paddingValue<<1|Z.flags.isNonSyncSample,q[x++]=Z.flags.degradationPriority&61440,q[x++]=Z.flags.degradationPriority&15,q[x++]=(Z.compositionTimeOffset&4278190080)>>>24,q[x++]=(Z.compositionTimeOffset&16711680)>>>16,q[x++]=(Z.compositionTimeOffset&65280)>>>8,q[x++]=Z.compositionTimeOffset&255;return o(re.trun,q)},h=function(y,C){var x,q,z,Q,Z,he;for(Q=y.samples||[],C+=20+8*Q.length,z=_(Q,C),x=new Uint8Array(z.length+Q.length*8),x.set(z),q=z.length,he=0;he<Q.length;he++)Z=Q[he],x[q++]=(Z.duration&4278190080)>>>24,x[q++]=(Z.duration&16711680)>>>16,x[q++]=(Z.duration&65280)>>>8,x[q++]=Z.duration&255,x[q++]=(Z.size&4278190080)>>>24,x[q++]=(Z.size&16711680)>>>16,x[q++]=(Z.size&65280)>>>8,x[q++]=Z.size&255;return o(re.trun,x)},te=function(y,C){return y.type==="audio"?h(y,C):m(y,C)}})();var Qt={ftyp:c,mdat:d,moof:E,moov:S,initSegment:function(h){var m=c(),_=S(h),y;return y=new Uint8Array(m.byteLength+_.byteLength),y.set(m),y.set(_,m.byteLength),y}},wt=function(h){var m,_,y=[],C=[];for(C.byteLength=0,C.nalCount=0,C.duration=0,y.byteLength=0,m=0;m<h.length;m++)_=h[m],_.nalUnitType==="access_unit_delimiter_rbsp"?(y.length&&(y.duration=_.dts-y.dts,C.byteLength+=y.byteLength,C.nalCount+=y.length,C.duration+=y.duration,C.push(y)),y=[_],y.byteLength=_.data.byteLength,y.pts=_.pts,y.dts=_.dts):(_.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(y.keyFrame=!0),y.duration=_.dts-y.dts,y.byteLength+=_.data.byteLength,y.push(_));return C.length&&(!y.duration||y.duration<=0)&&(y.duration=C[C.length-1].duration),C.byteLength+=y.byteLength,C.nalCount+=y.length,C.duration+=y.duration,C.push(y),C},Jt=function(h){var m,_,y=[],C=[];for(y.byteLength=0,y.nalCount=0,y.duration=0,y.pts=h[0].pts,y.dts=h[0].dts,C.byteLength=0,C.nalCount=0,C.duration=0,C.pts=h[0].pts,C.dts=h[0].dts,m=0;m<h.length;m++)_=h[m],_.keyFrame?(y.length&&(C.push(y),C.byteLength+=y.byteLength,C.nalCount+=y.nalCount,C.duration+=y.duration),y=[_],y.nalCount=_.length,y.byteLength=_.byteLength,y.pts=_.pts,y.dts=_.dts,y.duration=_.duration):(y.duration+=_.duration,y.nalCount+=_.length,y.byteLength+=_.byteLength,y.push(_));return C.length&&y.duration<=0&&(y.duration=C[C.length-1].duration),C.byteLength+=y.byteLength,C.nalCount+=y.nalCount,C.duration+=y.duration,C.push(y),C},Ii=function(h){var m;return!h[0][0].keyFrame&&h.length>1&&(m=h.shift(),h.byteLength-=m.byteLength,h.nalCount-=m.nalCount,h[0][0].dts=m.dts,h[0][0].pts=m.pts,h[0][0].duration+=m.duration),h},oi=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},yi=function(h,m){var _=oi();return _.dataOffset=m,_.compositionTimeOffset=h.pts-h.dts,_.duration=h.duration,_.size=4*h.length,_.size+=h.byteLength,h.keyFrame&&(_.flags.dependsOn=2,_.flags.isNonSyncSample=0),_},Pr=function(h,m){var _,y,C,x,q,z=m||0,Q=[];for(_=0;_<h.length;_++)for(x=h[_],y=0;y<x.length;y++)q=x[y],C=yi(q,z),z+=C.size,Q.push(C);return Q},li=function(h){var m,_,y,C,x,q,z=0,Q=h.byteLength,Z=h.nalCount,he=Q+4*Z,be=new Uint8Array(he),Ue=new DataView(be.buffer);for(m=0;m<h.length;m++)for(C=h[m],_=0;_<C.length;_++)for(x=C[_],y=0;y<x.length;y++)q=x[y],Ue.setUint32(z,q.data.byteLength),z+=4,be.set(q.data,z),z+=q.data.byteLength;return be},Lr=function(h,m){var _,y=m||0,C=[];return _=yi(h,y),C.push(_),C},Ut=function(h){var m,_,y=0,C=h.byteLength,x=h.length,q=C+4*x,z=new Uint8Array(q),Q=new DataView(z.buffer);for(m=0;m<h.length;m++)_=h[m],Q.setUint32(y,_.data.byteLength),y+=4,z.set(_.data,y),y+=_.data.byteLength;return z},Pi={groupNalsIntoFrames:wt,groupFramesIntoGops:Jt,extendFirstKeyFrame:Ii,generateSampleTable:Pr,concatenateNalData:li,generateSampleTableForFrame:Lr,concatenateNalDataForFrame:Ut},_i=[33,16,5,32,164,27],nt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],lt=function(h){for(var m=[];h--;)m.push(0);return m},kt=function(h){return Object.keys(h).reduce(function(m,_){return m[_]=new Uint8Array(h[_].reduce(function(y,C){return y.concat(C)},[])),m},{})},Ft,Tr=function(){if(!Ft){var h={96e3:[_i,[227,64],lt(154),[56]],88200:[_i,[231],lt(170),[56]],64e3:[_i,[248,192],lt(240),[56]],48e3:[_i,[255,192],lt(268),[55,148,128],lt(54),[112]],44100:[_i,[255,192],lt(268),[55,163,128],lt(84),[112]],32e3:[_i,[255,192],lt(268),[55,234],lt(226),[112]],24e3:[_i,[255,192],lt(268),[55,255,128],lt(268),[111,112],lt(126),[224]],16e3:[_i,[255,192],lt(268),[55,255,128],lt(268),[111,255],lt(269),[223,108],lt(195),[1,192]],12e3:[nt,lt(268),[3,127,248],lt(268),[6,255,240],lt(268),[13,255,224],lt(268),[27,253,128],lt(259),[56]],11025:[nt,lt(268),[3,127,248],lt(268),[6,255,240],lt(268),[13,255,224],lt(268),[27,255,192],lt(268),[55,175,128],lt(108),[112]],8e3:[nt,lt(268),[3,121,16],lt(47),[7]]};Ft=kt(h)}return Ft},nr=9e4,Or,br,Sr,Mr,Rn,Bn,dt;Or=function(h){return h*nr},br=function(h,m){return h*m},Sr=function(h){return h/nr},Mr=function(h,m){return h/m},Rn=function(h,m){return Or(Mr(h,m))},Bn=function(h,m){return br(Sr(h),m)},dt=function(h,m,_){return Sr(_?h:h-m)};var _t={ONE_SECOND_IN_TS:nr,secondsToVideoTs:Or,secondsToAudioTs:br,videoTsToSeconds:Sr,audioTsToSeconds:Mr,audioTsToVideoTs:Rn,videoTsToAudioTs:Bn,metadataTsToSeconds:dt},Jr=Tr,mn=_t,Ts=function(h){var m,_,y=0;for(m=0;m<h.length;m++)_=h[m],y+=_.data.byteLength;return y},Js=function(h,m,_,y){var C,x=0,q=0,z=0,Q=0,Z,he,be;if(m.length&&(C=mn.audioTsToVideoTs(h.baseMediaDecodeTime,h.samplerate),x=Math.ceil(mn.ONE_SECOND_IN_TS/(h.samplerate/1024)),_&&y&&(q=C-Math.max(_,y),z=Math.floor(q/x),Q=z*x),!(z<1||Q>mn.ONE_SECOND_IN_TS/2))){for(Z=Jr()[h.samplerate],Z||(Z=m[0].data),he=0;he<z;he++)be=m[0],m.splice(0,0,{data:Z,dts:be.dts-x,pts:be.pts-x});return h.baseMediaDecodeTime-=Math.floor(mn.videoTsToAudioTs(Q,h.samplerate)),Q}},Zr=function(h,m,_){return m.minSegmentDts>=_?h:(m.minSegmentDts=1/0,h.filter(function(y){return y.dts>=_?(m.minSegmentDts=Math.min(m.minSegmentDts,y.dts),m.minSegmentPts=m.minSegmentDts,!0):!1}))},en=function(h){var m,_,y=[];for(m=0;m<h.length;m++)_=h[m],y.push({size:_.data.byteLength,duration:1024});return y},bs=function(h){var m,_,y=0,C=new Uint8Array(Ts(h));for(m=0;m<h.length;m++)_=h[m],C.set(_.data,y),y+=_.data.byteLength;return C},Ss={prefixWithSilence:Js,trimAdtsFramesByEarliestDts:Zr,generateSampleTable:en,concatenateFrameData:bs},Zs=_t.ONE_SECOND_IN_TS,R=function(h,m){typeof m.pts=="number"&&(h.timelineStartInfo.pts===void 0&&(h.timelineStartInfo.pts=m.pts),h.minSegmentPts===void 0?h.minSegmentPts=m.pts:h.minSegmentPts=Math.min(h.minSegmentPts,m.pts),h.maxSegmentPts===void 0?h.maxSegmentPts=m.pts:h.maxSegmentPts=Math.max(h.maxSegmentPts,m.pts)),typeof m.dts=="number"&&(h.timelineStartInfo.dts===void 0&&(h.timelineStartInfo.dts=m.dts),h.minSegmentDts===void 0?h.minSegmentDts=m.dts:h.minSegmentDts=Math.min(h.minSegmentDts,m.dts),h.maxSegmentDts===void 0?h.maxSegmentDts=m.dts:h.maxSegmentDts=Math.max(h.maxSegmentDts,m.dts))},j=function(h){delete h.minSegmentDts,delete h.maxSegmentDts,delete h.minSegmentPts,delete h.maxSegmentPts},ie=function(h,m){var _,y,C=h.minSegmentDts;return m||(C-=h.timelineStartInfo.dts),_=h.timelineStartInfo.baseMediaDecodeTime,_+=C,_=Math.max(0,_),h.type==="audio"&&(y=h.samplerate/Zs,_*=y,_=Math.floor(_)),_},ge={clearDtsInfo:j,calculateTrackBaseMediaDecodeTime:ie,collectDtsInfo:R},Me=4,Xe=128,At=function(h){for(var m=0,_={payloadType:-1,payloadSize:0},y=0,C=0;m<h.byteLength&&h[m]!==Xe;){for(;h[m]===255;)y+=255,m++;for(y+=h[m++];h[m]===255;)C+=255,m++;if(C+=h[m++],!_.payload&&y===Me){var x=String.fromCharCode(h[m+3],h[m+4],h[m+5],h[m+6]);if(x==="GA94"){_.payloadType=y,_.payloadSize=C,_.payload=h.subarray(m,m+C);break}else _.payload=void 0}m+=C,y=0,C=0}return _},Wt=function(h){return h.payload[0]!==181||(h.payload[1]<<8|h.payload[2])!==49||String.fromCharCode(h.payload[3],h.payload[4],h.payload[5],h.payload[6])!=="GA94"||h.payload[7]!==3?null:h.payload.subarray(8,h.payload.length-1)},Tt=function(h,m){var _=[],y,C,x,q;if(!(m[0]&64))return _;for(C=m[0]&31,y=0;y<C;y++)x=y*3,q={type:m[x+2]&3,pts:h},m[x+2]&4&&(q.ccData=m[x+3]<<8|m[x+4],_.push(q));return _},Yi=function(h){for(var m=h.byteLength,_=[],y=1,C,x;y<m-2;)h[y]===0&&h[y+1]===0&&h[y+2]===3?(_.push(y+2),y+=2):y++;if(_.length===0)return h;C=m-_.length,x=new Uint8Array(C);var q=0;for(y=0;y<C;q++,y++)q===_[0]&&(q++,_.shift()),x[y]=h[q];return x},mi={parseSei:At,parseUserData:Wt,parseCaptionPackets:Tt,discardEmulationPreventionBytes:Yi,USER_DATA_REGISTERED_ITU_T_T35:Me},Li=t,ii=mi,Lt=function(h){h=h||{},Lt.prototype.init.call(this),this.parse708captions_=typeof h.parse708captions=="boolean"?h.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Ot(0,0),new Ot(0,1),new Ot(1,0),new Ot(1,1)],this.parse708captions_&&(this.cc708Stream_=new at({captionServices:h.captionServices})),this.reset(),this.ccStreams_.forEach(function(m){m.on("data",this.trigger.bind(this,"data")),m.on("partialdone",this.trigger.bind(this,"partialdone")),m.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")))};Lt.prototype=new Li,Lt.prototype.push=function(h){var m,_,y;if(h.nalUnitType==="sei_rbsp"&&(m=ii.parseSei(h.escapedRBSP),!!m.payload&&m.payloadType===ii.USER_DATA_REGISTERED_ITU_T_T35&&(_=ii.parseUserData(m),!!_))){if(h.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(h.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}y=ii.parseCaptionPackets(h.pts,_),this.captionPackets_=this.captionPackets_.concat(y),this.latestDts_!==h.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=h.dts}},Lt.prototype.flushCCStreams=function(h){this.ccStreams_.forEach(function(m){return h==="flush"?m.flush():m.partialFlush()},this)},Lt.prototype.flushStream=function(h){if(!this.captionPackets_.length){this.flushCCStreams(h);return}this.captionPackets_.forEach(function(m,_){m.presortIndex=_}),this.captionPackets_.sort(function(m,_){return m.pts===_.pts?m.presortIndex-_.presortIndex:m.pts-_.pts}),this.captionPackets_.forEach(function(m){m.type<2?this.dispatchCea608Packet(m):this.dispatchCea708Packet(m)},this),this.captionPackets_.length=0,this.flushCCStreams(h)},Lt.prototype.flush=function(){return this.flushStream("flush")},Lt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Lt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(h){h.reset()})},Lt.prototype.dispatchCea608Packet=function(h){this.setsTextOrXDSActive(h)?this.activeCea608Channel_[h.type]=null:this.setsChannel1Active(h)?this.activeCea608Channel_[h.type]=0:this.setsChannel2Active(h)&&(this.activeCea608Channel_[h.type]=1),this.activeCea608Channel_[h.type]!==null&&this.ccStreams_[(h.type<<1)+this.activeCea608Channel_[h.type]].push(h)},Lt.prototype.setsChannel1Active=function(h){return(h.ccData&30720)===4096},Lt.prototype.setsChannel2Active=function(h){return(h.ccData&30720)===6144},Lt.prototype.setsTextOrXDSActive=function(h){return(h.ccData&28928)===256||(h.ccData&30974)===4138||(h.ccData&30974)===6186},Lt.prototype.dispatchCea708Packet=function(h){this.parse708captions_&&this.cc708Stream_.push(h)};var ut={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},Rr=function(h){var m=ut[h]||h;return h&4096&&h===m?"":String.fromCharCode(m)},qi=function(h){return 32<=h&&h<=127||160<=h&&h<=255},Ct=function(h){this.windowNum=h,this.reset()};Ct.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},Ct.prototype.getText=function(){return this.rows.join(`
|
|
257
|
+
`)},Ct.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ct.prototype.newLine=function(h){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(h),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ct.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ct.prototype.addText=function(h){this.rows[this.rowIdx]+=h},Ct.prototype.backspace=function(){if(!this.isEmpty()){var h=this.rows[this.rowIdx];this.rows[this.rowIdx]=h.substr(0,h.length-1)}};var gn=function(h,m,_){this.serviceNum=h,this.text="",this.currentWindow=new Ct(-1),this.windows=[],this.stream=_,typeof m=="string"&&this.createTextDecoder(m)};gn.prototype.init=function(h,m){this.startPts=h;for(var _=0;_<8;_++)this.windows[_]=new Ct(_),typeof m=="function"&&(this.windows[_].beforeRowOverflow=m)},gn.prototype.setCurrentWindow=function(h){this.currentWindow=this.windows[h]},gn.prototype.createTextDecoder=function(h){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(h)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+h+" encoding. "+m})}};var at=function(h){h=h||{},at.prototype.init.call(this);var m=this,_=h.captionServices||{},y={},C;Object.keys(_).forEach(x=>{C=_[x],/^SERVICE/.test(x)&&(y[x]=C.encoding)}),this.serviceEncodings=y,this.current708Packet=null,this.services={},this.push=function(x){x.type===3?(m.new708Packet(),m.add708Bytes(x)):(m.current708Packet===null&&m.new708Packet(),m.add708Bytes(x))}};at.prototype=new Li,at.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},at.prototype.add708Bytes=function(h){var m=h.ccData,_=m>>>8,y=m&255;this.current708Packet.ptsVals.push(h.pts),this.current708Packet.data.push(_),this.current708Packet.data.push(y)},at.prototype.push708Packet=function(){var h=this.current708Packet,m=h.data,_=null,y=null,C=0,x=m[C++];for(h.seq=x>>6,h.sizeCode=x&63;C<m.length;C++)x=m[C++],_=x>>5,y=x&31,_===7&&y>0&&(x=m[C++],_=x),this.pushServiceBlock(_,C,y),y>0&&(C+=y-1)},at.prototype.pushServiceBlock=function(h,m,_){var y,C=m,x=this.current708Packet.data,q=this.services[h];for(q||(q=this.initService(h,C));C<m+_&&C<x.length;C++)y=x[C],qi(y)?C=this.handleText(C,q):y===24?C=this.multiByteCharacter(C,q):y===16?C=this.extendedCommands(C,q):128<=y&&y<=135?C=this.setCurrentWindow(C,q):152<=y&&y<=159?C=this.defineWindow(C,q):y===136?C=this.clearWindows(C,q):y===140?C=this.deleteWindows(C,q):y===137?C=this.displayWindows(C,q):y===138?C=this.hideWindows(C,q):y===139?C=this.toggleWindows(C,q):y===151?C=this.setWindowAttributes(C,q):y===144?C=this.setPenAttributes(C,q):y===145?C=this.setPenColor(C,q):y===146?C=this.setPenLocation(C,q):y===143?q=this.reset(C,q):y===8?q.currentWindow.backspace():y===12?q.currentWindow.clearText():y===13?q.currentWindow.pendingNewLine=!0:y===14?q.currentWindow.clearText():y===141&&C++},at.prototype.extendedCommands=function(h,m){var _=this.current708Packet.data,y=_[++h];return qi(y)&&(h=this.handleText(h,m,{isExtended:!0})),h},at.prototype.getPts=function(h){return this.current708Packet.ptsVals[Math.floor(h/2)]},at.prototype.initService=function(h,m){var y="SERVICE"+h,_=this,y,C;return y in this.serviceEncodings&&(C=this.serviceEncodings[y]),this.services[h]=new gn(h,C,_),this.services[h].init(this.getPts(m),function(x){_.flushDisplayed(x,_.services[h])}),this.services[h]},at.prototype.handleText=function(h,m,_){var y=_&&_.isExtended,C=_&&_.isMultiByte,x=this.current708Packet.data,q=y?4096:0,z=x[h],Q=x[h+1],Z=m.currentWindow,he,be;function Ue(Ee){return Ee.map(Ge=>("0"+(Ge&255).toString(16)).slice(-2)).join("")}if(C?(be=[z,Q],h++):be=[z],m.textDecoder_&&!y)he=m.textDecoder_.decode(new Uint8Array(be));else if(C){const Ee=Ue(be);he=String.fromCharCode(parseInt(Ee,16))}else he=Rr(q|z);return Z.pendingNewLine&&!Z.isEmpty()&&Z.newLine(this.getPts(h)),Z.pendingNewLine=!1,Z.addText(he),h},at.prototype.multiByteCharacter=function(h,m){var _=this.current708Packet.data,y=_[h+1],C=_[h+2];return qi(y)&&qi(C)&&(h=this.handleText(++h,m,{isMultiByte:!0})),h},at.prototype.setCurrentWindow=function(h,m){var _=this.current708Packet.data,y=_[h],C=y&7;return m.setCurrentWindow(C),h},at.prototype.defineWindow=function(h,m){var _=this.current708Packet.data,y=_[h],C=y&7;m.setCurrentWindow(C);var x=m.currentWindow;return y=_[++h],x.visible=(y&32)>>5,x.rowLock=(y&16)>>4,x.columnLock=(y&8)>>3,x.priority=y&7,y=_[++h],x.relativePositioning=(y&128)>>7,x.anchorVertical=y&127,y=_[++h],x.anchorHorizontal=y,y=_[++h],x.anchorPoint=(y&240)>>4,x.rowCount=y&15,y=_[++h],x.columnCount=y&63,y=_[++h],x.windowStyle=(y&56)>>3,x.penStyle=y&7,x.virtualRowCount=x.rowCount+1,h},at.prototype.setWindowAttributes=function(h,m){var _=this.current708Packet.data,y=_[h],C=m.currentWindow.winAttr;return y=_[++h],C.fillOpacity=(y&192)>>6,C.fillRed=(y&48)>>4,C.fillGreen=(y&12)>>2,C.fillBlue=y&3,y=_[++h],C.borderType=(y&192)>>6,C.borderRed=(y&48)>>4,C.borderGreen=(y&12)>>2,C.borderBlue=y&3,y=_[++h],C.borderType+=(y&128)>>5,C.wordWrap=(y&64)>>6,C.printDirection=(y&48)>>4,C.scrollDirection=(y&12)>>2,C.justify=y&3,y=_[++h],C.effectSpeed=(y&240)>>4,C.effectDirection=(y&12)>>2,C.displayEffect=y&3,h},at.prototype.flushDisplayed=function(h,m){for(var _=[],y=0;y<8;y++)m.windows[y].visible&&!m.windows[y].isEmpty()&&_.push(m.windows[y].getText());m.endPts=h,m.text=_.join(`
|
|
258
|
+
|
|
259
|
+
`),this.pushCaption(m),m.startPts=h},at.prototype.pushCaption=function(h){h.text!==""&&(this.trigger("data",{startPts:h.startPts,endPts:h.endPts,text:h.text,stream:"cc708_"+h.serviceNum}),h.text="",h.startPts=h.endPts)},at.prototype.displayWindows=function(h,m){var _=this.current708Packet.data,y=_[++h],C=this.getPts(h);this.flushDisplayed(C,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=1);return h},at.prototype.hideWindows=function(h,m){var _=this.current708Packet.data,y=_[++h],C=this.getPts(h);this.flushDisplayed(C,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=0);return h},at.prototype.toggleWindows=function(h,m){var _=this.current708Packet.data,y=_[++h],C=this.getPts(h);this.flushDisplayed(C,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible^=1);return h},at.prototype.clearWindows=function(h,m){var _=this.current708Packet.data,y=_[++h],C=this.getPts(h);this.flushDisplayed(C,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].clearText();return h},at.prototype.deleteWindows=function(h,m){var _=this.current708Packet.data,y=_[++h],C=this.getPts(h);this.flushDisplayed(C,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].reset();return h},at.prototype.setPenAttributes=function(h,m){var _=this.current708Packet.data,y=_[h],C=m.currentWindow.penAttr;return y=_[++h],C.textTag=(y&240)>>4,C.offset=(y&12)>>2,C.penSize=y&3,y=_[++h],C.italics=(y&128)>>7,C.underline=(y&64)>>6,C.edgeType=(y&56)>>3,C.fontStyle=y&7,h},at.prototype.setPenColor=function(h,m){var _=this.current708Packet.data,y=_[h],C=m.currentWindow.penColor;return y=_[++h],C.fgOpacity=(y&192)>>6,C.fgRed=(y&48)>>4,C.fgGreen=(y&12)>>2,C.fgBlue=y&3,y=_[++h],C.bgOpacity=(y&192)>>6,C.bgRed=(y&48)>>4,C.bgGreen=(y&12)>>2,C.bgBlue=y&3,y=_[++h],C.edgeRed=(y&48)>>4,C.edgeGreen=(y&12)>>2,C.edgeBlue=y&3,h},at.prototype.setPenLocation=function(h,m){var _=this.current708Packet.data,y=_[h],C=m.currentWindow.penLoc;return m.currentWindow.pendingNewLine=!0,y=_[++h],C.row=y&15,y=_[++h],C.column=y&63,h},at.prototype.reset=function(h,m){var _=this.getPts(h);return this.flushDisplayed(_,m),this.initService(m.serviceNum,h)};var Nt={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},vn=function(h){return h===null?"":(h=Nt[h]||h,String.fromCharCode(h))},ri=14,zl=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],yn=function(){for(var h=[],m=ri+1;m--;)h.push({text:"",indent:0,offset:0});return h},Ot=function(h,m){Ot.prototype.init.call(this),this.field_=h||0,this.dataChannel_=m||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(_){var y,C,x,q,z;if(y=_.ccData&32639,y===this.lastControlCode_){this.lastControlCode_=null;return}if((y&61440)===4096?this.lastControlCode_=y:y!==this.PADDING_&&(this.lastControlCode_=null),x=y>>>8,q=y&255,y!==this.PADDING_)if(y===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(y===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(_.pts),this.flushDisplayed(_.pts),C=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=C,this.startPts_=_.pts;else if(y===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(_.pts);else if(y===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(_.pts);else if(y===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(_.pts);else if(y===this.CARRIAGE_RETURN_)this.clearFormatting(_.pts),this.flushDisplayed(_.pts),this.shiftRowsUp_(),this.startPts_=_.pts;else if(y===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(y===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(_.pts),this.displayed_=yn();else if(y===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=yn();else if(y===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(_.pts),this.displayed_=yn()),this.mode_="paintOn",this.startPts_=_.pts;else if(this.isSpecialCharacter(x,q))x=(x&3)<<8,z=vn(x|q),this[this.mode_](_.pts,z),this.column_++;else if(this.isExtCharacter(x,q))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),x=(x&3)<<8,z=vn(x|q),this[this.mode_](_.pts,z),this.column_++;else if(this.isMidRowCode(x,q))this.clearFormatting(_.pts),this[this.mode_](_.pts," "),this.column_++,(q&14)===14&&this.addFormatting(_.pts,["i"]),(q&1)===1&&this.addFormatting(_.pts,["u"]);else if(this.isOffsetControlCode(x,q)){const Z=q&3;this.nonDisplayed_[this.row_].offset=Z,this.column_+=Z}else if(this.isPAC(x,q)){var Q=zl.indexOf(y&7968);if(this.mode_==="rollUp"&&(Q-this.rollUpRows_+1<0&&(Q=this.rollUpRows_-1),this.setRollUp(_.pts,Q)),Q!==this.row_&&Q>=0&&Q<=14&&(this.clearFormatting(_.pts),this.row_=Q),q&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(_.pts,["u"]),(y&16)===16){const Z=(y&14)>>1;this.column_=Z*4,this.nonDisplayed_[this.row_].indent+=Z}this.isColorPAC(q)&&(q&14)===14&&this.addFormatting(_.pts,["i"])}else this.isNormalChar(x)&&(q===0&&(q=null),z=vn(x),z+=vn(q),this[this.mode_](_.pts,z),this.column_+=z.length)}};Ot.prototype=new Li,Ot.prototype.flushDisplayed=function(h){const m=y=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+y+"."})},_=[];this.displayed_.forEach((y,C)=>{if(y&&y.text&&y.text.length){try{y.text=y.text.trim()}catch{m(C)}y.text.length&&_.push({text:y.text,line:C+1,position:10+Math.min(70,y.indent*10)+y.offset*2.5})}else y==null&&m(C)}),_.length&&this.trigger("data",{startPts:this.startPts_,endPts:h,content:_,stream:this.name_})},Ot.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=yn(),this.nonDisplayed_=yn(),this.lastControlCode_=null,this.column_=0,this.row_=ri,this.rollUpRows_=2,this.formatting_=[]},Ot.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},Ot.prototype.isSpecialCharacter=function(h,m){return h===this.EXT_&&m>=48&&m<=63},Ot.prototype.isExtCharacter=function(h,m){return(h===this.EXT_+1||h===this.EXT_+2)&&m>=32&&m<=63},Ot.prototype.isMidRowCode=function(h,m){return h===this.EXT_&&m>=32&&m<=47},Ot.prototype.isOffsetControlCode=function(h,m){return h===this.OFFSET_&&m>=33&&m<=35},Ot.prototype.isPAC=function(h,m){return h>=this.BASE_&&h<this.BASE_+8&&m>=64&&m<=127},Ot.prototype.isColorPAC=function(h){return h>=64&&h<=79||h>=96&&h<=127},Ot.prototype.isNormalChar=function(h){return h>=32&&h<=127},Ot.prototype.setRollUp=function(h,m){if(this.mode_!=="rollUp"&&(this.row_=ri,this.mode_="rollUp",this.flushDisplayed(h),this.nonDisplayed_=yn(),this.displayed_=yn()),m!==void 0&&m!==this.row_)for(var _=0;_<this.rollUpRows_;_++)this.displayed_[m-_]=this.displayed_[this.row_-_],this.displayed_[this.row_-_]={text:"",indent:0,offset:0};m===void 0&&(m=this.row_),this.topRow_=m-this.rollUpRows_+1},Ot.prototype.addFormatting=function(h,m){this.formatting_=this.formatting_.concat(m);var _=m.reduce(function(y,C){return y+"<"+C+">"},"");this[this.mode_](h,_)},Ot.prototype.clearFormatting=function(h){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(_,y){return _+"</"+y+">"},"");this.formatting_=[],this[this.mode_](h,m)}},Ot.prototype.popOn=function(h,m){var _=this.nonDisplayed_[this.row_].text;_+=m,this.nonDisplayed_[this.row_].text=_},Ot.prototype.rollUp=function(h,m){var _=this.displayed_[this.row_].text;_+=m,this.displayed_[this.row_].text=_},Ot.prototype.shiftRowsUp_=function(){var h;for(h=0;h<this.topRow_;h++)this.displayed_[h]={text:"",indent:0,offset:0};for(h=this.row_+1;h<ri+1;h++)this.displayed_[h]={text:"",indent:0,offset:0};for(h=this.topRow_;h<this.row_;h++)this.displayed_[h]=this.displayed_[h+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ot.prototype.paintOn=function(h,m){var _=this.displayed_[this.row_].text;_+=m,this.displayed_[this.row_].text=_};var ea={CaptionStream:Lt,Cea608Stream:Ot,Cea708Stream:at},Cs={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},wi=t,ho=8589934592,Es=4294967296,fo="shared",tn=function(h,m){var _=1;for(h>m&&(_=-1);Math.abs(m-h)>Es;)h+=_*ho;return h},Un=function(h){var m,_;Un.prototype.init.call(this),this.type_=h||fo,this.push=function(y){if(y.type==="metadata"){this.trigger("data",y);return}this.type_!==fo&&y.type!==this.type_||(_===void 0&&(_=y.dts),y.dts=tn(y.dts,_),y.pts=tn(y.pts,_),m=y.dts,this.trigger("data",y))},this.flush=function(){_=m,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){_=void 0,m=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Un.prototype=new wi;var ws={TimestampRolloverStream:Un,handleRollover:tn},po=(h,m,_)=>{if(!h)return-1;for(var y=_;y<h.length;y++)if(h[y]===m)return y;return-1},Wl={typedArrayIndexOf:po},_n=Wl.typedArrayIndexOf,rn={Utf8:3},Tn=function(h,m,_){var y,C="";for(y=m;y<_;y++)C+="%"+("00"+h[y].toString(16)).slice(-2);return C},Qi=function(h,m,_){return decodeURIComponent(Tn(h,m,_))},nn=function(h,m,_){return unescape(Tn(h,m,_))},Fn=function(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]},bn={APIC:function(h){var m=1,_,y,C="-->";h.data[0]===rn.Utf8&&(_=_n(h.data,0,m),!(_<0)&&(h.mimeType=nn(h.data,m,_),m=_+1,h.pictureType=h.data[m],m++,y=_n(h.data,0,m),!(y<0)&&(h.description=Qi(h.data,m,y),m=y+1,h.mimeType===C?h.url=nn(h.data,m,h.data.length):h.pictureData=h.data.subarray(m,h.data.length))))},"T*":function(h){h.data[0]===rn.Utf8&&(h.value=Qi(h.data,1,h.data.length).replace(/\0*$/,""),h.values=h.value.split("\0"))},TXXX:function(h){var m;h.data[0]===rn.Utf8&&(m=_n(h.data,0,1),m!==-1&&(h.description=Qi(h.data,1,m),h.value=Qi(h.data,m+1,h.data.length).replace(/\0*$/,""),h.data=h.value))},"W*":function(h){h.url=nn(h.data,0,h.data.length).replace(/\0.*$/,"")},WXXX:function(h){var m;h.data[0]===rn.Utf8&&(m=_n(h.data,0,1),m!==-1&&(h.description=Qi(h.data,1,m),h.url=nn(h.data,m+1,h.data.length).replace(/\0.*$/,"")))},PRIV:function(h){var m;for(m=0;m<h.data.length;m++)if(h.data[m]===0){h.owner=nn(h.data,0,m);break}h.privateData=h.data.subarray(m+1),h.data=h.privateData}},Br=function(h){var m,_,y=10,C=0,x=[];if(!(h.length<10||h[0]!==73||h[1]!==68||h[2]!==51)){C=Fn(h.subarray(6,10)),C+=10;var q=h[5]&64;q&&(y+=4,y+=Fn(h.subarray(10,14)),C-=Fn(h.subarray(16,20)));do{if(m=Fn(h.subarray(y+4,y+8)),m<1)break;_=String.fromCharCode(h[y],h[y+1],h[y+2],h[y+3]);var z={id:_,data:h.subarray(y+10,y+m+10)};z.key=z.id,bn[z.id]?bn[z.id](z):z.id[0]==="T"?bn["T*"](z):z.id[0]==="W"&&bn["W*"](z),x.push(z),y+=10,y+=m}while(y<C);return x}},mo={parseId3Frames:Br,parseSyncSafeInteger:Fn,frameParsers:bn},ta=t,go=Cs,Ur=mo,ks;ks=function(h){var m={descriptor:h&&h.descriptor},_=0,y=[],C=0,x;if(ks.prototype.init.call(this),this.dispatchType=go.METADATA_STREAM_TYPE.toString(16),m.descriptor)for(x=0;x<m.descriptor.length;x++)this.dispatchType+=("00"+m.descriptor[x].toString(16)).slice(-2);this.push=function(q){var z,Q,Z,he,be,Ue;if(q.type==="timed-metadata"){if(q.dataAlignmentIndicator&&(C=0,y.length=0),y.length===0&&(q.data.length<10||q.data[0]!==73||q.data[1]!==68||q.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(y.push(q),C+=q.data.byteLength,y.length===1&&(_=Ur.parseSyncSafeInteger(q.data.subarray(6,10)),_+=10),!(C<_)){for(z={data:new Uint8Array(_),frames:[],pts:y[0].pts,dts:y[0].dts},be=0;be<_;)z.data.set(y[0].data.subarray(0,_-be),be),be+=y[0].data.byteLength,C-=y[0].data.byteLength,y.shift();Q=10,z.data[5]&64&&(Q+=4,Q+=Ur.parseSyncSafeInteger(z.data.subarray(10,14)),_-=Ur.parseSyncSafeInteger(z.data.subarray(16,20)));do{if(Z=Ur.parseSyncSafeInteger(z.data.subarray(Q+4,Q+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ue=String.fromCharCode(z.data[Q],z.data[Q+1],z.data[Q+2],z.data[Q+3]),he={id:Ue,data:z.data.subarray(Q+10,Q+Z+10)},he.key=he.id,Ur.frameParsers[he.id]?Ur.frameParsers[he.id](he):he.id[0]==="T"?Ur.frameParsers["T*"](he):he.id[0]==="W"&&Ur.frameParsers["W*"](he),he.owner==="com.apple.streaming.transportStreamTimestamp"){var Ee=he.data,Ge=(Ee[3]&1)<<30|Ee[4]<<22|Ee[5]<<14|Ee[6]<<6|Ee[7]>>>2;Ge*=4,Ge+=Ee[7]&3,he.timeStamp=Ge,z.pts===void 0&&z.dts===void 0&&(z.pts=he.timeStamp,z.dts=he.timeStamp),this.trigger("timestamp",he)}z.frames.push(he),Q+=10,Q+=Z}while(Q<_);this.trigger("data",z)}}}},ks.prototype=new ta;var Gl=ks,$n=t,jn=ea,zi=Cs,Kl=ws.TimestampRolloverStream,ia,Hn,ra,Vn=188,na=71;ia=function(){var h=new Uint8Array(Vn),m=0;ia.prototype.init.call(this),this.push=function(_){var y=0,C=Vn,x;for(m?(x=new Uint8Array(_.byteLength+m),x.set(h.subarray(0,m)),x.set(_,m),m=0):x=_;C<x.byteLength;){if(x[y]===na&&x[C]===na){this.trigger("data",x.subarray(y,C)),y+=Vn,C+=Vn;continue}y++,C++}y<x.byteLength&&(h.set(x.subarray(y),0),m=x.byteLength-y)},this.flush=function(){m===Vn&&h[0]===na&&(this.trigger("data",h),m=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){m=0,this.trigger("reset")}},ia.prototype=new $n,Hn=function(){var h,m,_,y;Hn.prototype.init.call(this),y=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,h=function(C,x){var q=0;x.payloadUnitStartIndicator&&(q+=C[q]+1),x.type==="pat"?m(C.subarray(q),x):_(C.subarray(q),x)},m=function(C,x){x.section_number=C[7],x.last_section_number=C[8],y.pmtPid=(C[10]&31)<<8|C[11],x.pmtPid=y.pmtPid},_=function(C,x){var q,z,Q,Z;if(C[5]&1){for(y.programMapTable={video:null,audio:null,"timed-metadata":{}},q=(C[1]&15)<<8|C[2],z=3+q-4,Q=(C[10]&15)<<8|C[11],Z=12+Q;Z<z;){var he=C[Z],be=(C[Z+1]&31)<<8|C[Z+2];he===zi.H264_STREAM_TYPE&&y.programMapTable.video===null?y.programMapTable.video=be:he===zi.ADTS_STREAM_TYPE&&y.programMapTable.audio===null?y.programMapTable.audio=be:he===zi.METADATA_STREAM_TYPE&&(y.programMapTable["timed-metadata"][be]=he),Z+=((C[Z+3]&15)<<8|C[Z+4])+5}x.programMapTable=y.programMapTable}},this.push=function(C){var x={},q=4;if(x.payloadUnitStartIndicator=!!(C[1]&64),x.pid=C[1]&31,x.pid<<=8,x.pid|=C[2],(C[3]&48)>>>4>1&&(q+=C[q]+1),x.pid===0)x.type="pat",h(C.subarray(q),x),this.trigger("data",x);else if(x.pid===this.pmtPid)for(x.type="pmt",h(C.subarray(q),x),this.trigger("data",x);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([C,q,x]):this.processPes_(C,q,x)},this.processPes_=function(C,x,q){q.pid===this.programMapTable.video?q.streamType=zi.H264_STREAM_TYPE:q.pid===this.programMapTable.audio?q.streamType=zi.ADTS_STREAM_TYPE:q.streamType=this.programMapTable["timed-metadata"][q.pid],q.type="pes",q.data=C.subarray(x),this.trigger("data",q)}},Hn.prototype=new $n,Hn.STREAM_TYPES={h264:27,adts:15},ra=function(){var h=this,m=!1,_={data:[],size:0},y={data:[],size:0},C={data:[],size:0},x,q=function(Q,Z){var he;const be=Q[0]<<16|Q[1]<<8|Q[2];Z.data=new Uint8Array,be===1&&(Z.packetLength=6+(Q[4]<<8|Q[5]),Z.dataAlignmentIndicator=(Q[6]&4)!==0,he=Q[7],he&192&&(Z.pts=(Q[9]&14)<<27|(Q[10]&255)<<20|(Q[11]&254)<<12|(Q[12]&255)<<5|(Q[13]&254)>>>3,Z.pts*=4,Z.pts+=(Q[13]&6)>>>1,Z.dts=Z.pts,he&64&&(Z.dts=(Q[14]&14)<<27|(Q[15]&255)<<20|(Q[16]&254)<<12|(Q[17]&255)<<5|(Q[18]&254)>>>3,Z.dts*=4,Z.dts+=(Q[18]&6)>>>1)),Z.data=Q.subarray(9+Q[8]))},z=function(Q,Z,he){var be=new Uint8Array(Q.size),Ue={type:Z},Ee=0,Ge=0,ht=!1,Bi;if(!(!Q.data.length||Q.size<9)){for(Ue.trackId=Q.data[0].pid,Ee=0;Ee<Q.data.length;Ee++)Bi=Q.data[Ee],be.set(Bi.data,Ge),Ge+=Bi.data.byteLength;q(be,Ue),ht=Z==="video"||Ue.packetLength<=Q.size,(he||ht)&&(Q.size=0,Q.data.length=0),ht&&h.trigger("data",Ue)}};ra.prototype.init.call(this),this.push=function(Q){({pat:function(){},pes:function(){var Z,he;switch(Q.streamType){case zi.H264_STREAM_TYPE:Z=_,he="video";break;case zi.ADTS_STREAM_TYPE:Z=y,he="audio";break;case zi.METADATA_STREAM_TYPE:Z=C,he="timed-metadata";break;default:return}Q.payloadUnitStartIndicator&&z(Z,he,!0),Z.data.push(Q),Z.size+=Q.data.byteLength},pmt:function(){var Z={type:"metadata",tracks:[]};x=Q.programMapTable,x.video!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+x.video,codec:"avc",type:"video"}),x.audio!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+x.audio,codec:"adts",type:"audio"}),m=!0,h.trigger("data",Z)}})[Q.type]()},this.reset=function(){_.size=0,_.data.length=0,y.size=0,y.data.length=0,this.trigger("reset")},this.flushStreams_=function(){z(_,"video"),z(y,"audio"),z(C,"timed-metadata")},this.flush=function(){if(!m&&x){var Q={type:"metadata",tracks:[]};x.video!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+x.video,codec:"avc",type:"video"}),x.audio!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+x.audio,codec:"adts",type:"audio"}),h.trigger("data",Q)}m=!1,this.flushStreams_(),this.trigger("done")}},ra.prototype=new $n;var vo={PAT_PID:0,MP2T_PACKET_LENGTH:Vn,TransportPacketStream:ia,TransportParseStream:Hn,ElementaryStream:ra,TimestampRolloverStream:Kl,CaptionStream:jn.CaptionStream,Cea608Stream:jn.Cea608Stream,Cea708Stream:jn.Cea708Stream,MetadataStream:Gl};for(var Ia in zi)zi.hasOwnProperty(Ia)&&(vo[Ia]=zi[Ia]);var yo=vo,Xl=t,Yl=_t.ONE_SECOND_IN_TS,sa,As=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];sa=function(h){var m,_=0;sa.prototype.init.call(this),this.skipWarn_=function(y,C){this.trigger("log",{level:"warn",message:`adts skiping bytes ${y} to ${C} in frame ${_} outside syncword`})},this.push=function(y){var C=0,x,q,z,Q,Z;if(h||(_=0),y.type==="audio"){m&&m.length?(z=m,m=new Uint8Array(z.byteLength+y.data.byteLength),m.set(z),m.set(y.data,z.byteLength)):m=y.data;for(var he;C+7<m.length;){if(m[C]!==255||(m[C+1]&246)!==240){typeof he!="number"&&(he=C),C++;continue}if(typeof he=="number"&&(this.skipWarn_(he,C),he=null),q=(~m[C+1]&1)*2,x=(m[C+3]&3)<<11|m[C+4]<<3|(m[C+5]&224)>>5,Q=((m[C+6]&3)+1)*1024,Z=Q*Yl/As[(m[C+2]&60)>>>2],m.byteLength-C<x)break;this.trigger("data",{pts:y.pts+_*Z,dts:y.dts+_*Z,sampleCount:Q,audioobjecttype:(m[C+2]>>>6&3)+1,channelcount:(m[C+2]&1)<<2|(m[C+3]&192)>>>6,samplerate:As[(m[C+2]&60)>>>2],samplingfrequencyindex:(m[C+2]&60)>>>2,samplesize:16,data:m.subarray(C+7+q,C+x)}),_++,C+=x}typeof he=="number"&&(this.skipWarn_(he,C),he=null),m=m.subarray(C)}},this.flush=function(){_=0,this.trigger("done")},this.reset=function(){m=void 0,this.trigger("reset")},this.endTimeline=function(){m=void 0,this.trigger("endedtimeline")}},sa.prototype=new Xl;var aa=sa,_o;_o=function(h){var m=h.byteLength,_=0,y=0;this.length=function(){return 8*m},this.bitsAvailable=function(){return 8*m+y},this.loadWord=function(){var C=h.byteLength-m,x=new Uint8Array(4),q=Math.min(4,m);if(q===0)throw new Error("no bytes available");x.set(h.subarray(C,C+q)),_=new DataView(x.buffer).getUint32(0),y=q*8,m-=q},this.skipBits=function(C){var x;y>C?(_<<=C,y-=C):(C-=y,x=Math.floor(C/8),C-=x*8,m-=x,this.loadWord(),_<<=C,y-=C)},this.readBits=function(C){var x=Math.min(y,C),q=_>>>32-x;return y-=x,y>0?_<<=x:m>0&&this.loadWord(),x=C-x,x>0?q<<x|this.readBits(x):q},this.skipLeadingZeros=function(){var C;for(C=0;C<y;++C)if((_&2147483648>>>C)!==0)return _<<=C,y-=C,C;return this.loadWord(),C+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var C=this.skipLeadingZeros();return this.readBits(C+1)-1},this.readExpGolomb=function(){var C=this.readUnsignedExpGolomb();return 1&C?1+C>>>1:-1*(C>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var qn=_o,Pa=t,Ql=qn,xs,oa,To;oa=function(){var h=0,m,_;oa.prototype.init.call(this),this.push=function(y){var C;_?(C=new Uint8Array(_.byteLength+y.data.byteLength),C.set(_),C.set(y.data,_.byteLength),_=C):_=y.data;for(var x=_.byteLength;h<x-3;h++)if(_[h+2]===1){m=h+5;break}for(;m<x;)switch(_[m]){case 0:if(_[m-1]!==0){m+=2;break}else if(_[m-2]!==0){m++;break}h+3!==m-2&&this.trigger("data",_.subarray(h+3,m-2));do m++;while(_[m]!==1&&m<x);h=m-2,m+=3;break;case 1:if(_[m-1]!==0||_[m-2]!==0){m+=3;break}this.trigger("data",_.subarray(h+3,m-2)),h=m-2,m+=3;break;default:m+=3;break}_=_.subarray(h),m-=h,h=0},this.reset=function(){_=null,h=0,this.trigger("reset")},this.flush=function(){_&&_.byteLength>3&&this.trigger("data",_.subarray(h+3)),_=null,h=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},oa.prototype=new Pa,To={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},xs=function(){var h=new oa,m,_,y,C,x,q,z;xs.prototype.init.call(this),m=this,this.push=function(Q){Q.type==="video"&&(_=Q.trackId,y=Q.pts,C=Q.dts,h.push(Q))},h.on("data",function(Q){var Z={trackId:_,pts:y,dts:C,data:Q,nalUnitTypeCode:Q[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=x(Q.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=x(Q.subarray(1)),Z.config=q(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}m.trigger("data",Z)}),h.on("done",function(){m.trigger("done")}),h.on("partialdone",function(){m.trigger("partialdone")}),h.on("reset",function(){m.trigger("reset")}),h.on("endedtimeline",function(){m.trigger("endedtimeline")}),this.flush=function(){h.flush()},this.partialFlush=function(){h.partialFlush()},this.reset=function(){h.reset()},this.endTimeline=function(){h.endTimeline()},z=function(Q,Z){var he=8,be=8,Ue,Ee;for(Ue=0;Ue<Q;Ue++)be!==0&&(Ee=Z.readExpGolomb(),be=(he+Ee+256)%256),he=be===0?he:be},x=function(Q){for(var Z=Q.byteLength,he=[],be=1,Ue,Ee;be<Z-2;)Q[be]===0&&Q[be+1]===0&&Q[be+2]===3?(he.push(be+2),be+=2):be++;if(he.length===0)return Q;Ue=Z-he.length,Ee=new Uint8Array(Ue);var Ge=0;for(be=0;be<Ue;Ge++,be++)Ge===he[0]&&(Ge++,he.shift()),Ee[be]=Q[Ge];return Ee},q=function(Q){var Z=0,he=0,be=0,Ue=0,Ee,Ge,ht,Bi,jr,ga,_u,Tu,bu,Su,wc,Zt=[1,1],Cu,An;if(Ee=new Ql(Q),Ge=Ee.readUnsignedByte(),Bi=Ee.readUnsignedByte(),ht=Ee.readUnsignedByte(),Ee.skipUnsignedExpGolomb(),To[Ge]&&(jr=Ee.readUnsignedExpGolomb(),jr===3&&Ee.skipBits(1),Ee.skipUnsignedExpGolomb(),Ee.skipUnsignedExpGolomb(),Ee.skipBits(1),Ee.readBoolean()))for(wc=jr!==3?8:12,An=0;An<wc;An++)Ee.readBoolean()&&(An<6?z(16,Ee):z(64,Ee));if(Ee.skipUnsignedExpGolomb(),ga=Ee.readUnsignedExpGolomb(),ga===0)Ee.readUnsignedExpGolomb();else if(ga===1)for(Ee.skipBits(1),Ee.skipExpGolomb(),Ee.skipExpGolomb(),_u=Ee.readUnsignedExpGolomb(),An=0;An<_u;An++)Ee.skipExpGolomb();if(Ee.skipUnsignedExpGolomb(),Ee.skipBits(1),Tu=Ee.readUnsignedExpGolomb(),bu=Ee.readUnsignedExpGolomb(),Su=Ee.readBits(1),Su===0&&Ee.skipBits(1),Ee.skipBits(1),Ee.readBoolean()&&(Z=Ee.readUnsignedExpGolomb(),he=Ee.readUnsignedExpGolomb(),be=Ee.readUnsignedExpGolomb(),Ue=Ee.readUnsignedExpGolomb()),Ee.readBoolean()&&Ee.readBoolean()){switch(Cu=Ee.readUnsignedByte(),Cu){case 1:Zt=[1,1];break;case 2:Zt=[12,11];break;case 3:Zt=[10,11];break;case 4:Zt=[16,11];break;case 5:Zt=[40,33];break;case 6:Zt=[24,11];break;case 7:Zt=[20,11];break;case 8:Zt=[32,11];break;case 9:Zt=[80,33];break;case 10:Zt=[18,11];break;case 11:Zt=[15,11];break;case 12:Zt=[64,33];break;case 13:Zt=[160,99];break;case 14:Zt=[4,3];break;case 15:Zt=[3,2];break;case 16:Zt=[2,1];break;case 255:{Zt=[Ee.readUnsignedByte()<<8|Ee.readUnsignedByte(),Ee.readUnsignedByte()<<8|Ee.readUnsignedByte()];break}}Zt&&Zt[0]/Zt[1]}return{profileIdc:Ge,levelIdc:ht,profileCompatibility:Bi,width:(Tu+1)*16-Z*2-he*2,height:(2-Su)*(bu+1)*16-be*2-Ue*2,sarRatio:Zt}}},xs.prototype=new Pa;var Jl={H264Stream:xs},la=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],zn=function(h,m){var _=h[m+6]<<21|h[m+7]<<14|h[m+8]<<7|h[m+9],y=h[m+5],C=(y&16)>>4;return _=_>=0?_:0,C?_+20:_+10},Wn=function(h,m){return h.length-m<10||h[m]!==73||h[m+1]!==68||h[m+2]!==51?m:(m+=zn(h,m),Wn(h,m))},sn=function(h){var m=Wn(h,0);return h.length>=m+2&&(h[m]&255)===255&&(h[m+1]&240)===240&&(h[m+1]&22)===16},La=function(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]},Ns=function(h,m,_){var y,C="";for(y=m;y<_;y++)C+="%"+("00"+h[y].toString(16)).slice(-2);return C},bo=function(h,m,_){return unescape(Ns(h,m,_))},Oa=function(h,m){var _=(h[m+5]&224)>>5,y=h[m+4]<<3,C=h[m+3]&6144;return C|y|_},Zl=function(h,m){return h[m]===73&&h[m+1]===68&&h[m+2]===51?"timed-metadata":h[m]&!0&&(h[m+1]&240)===240?"audio":null},eu=function(h){for(var m=0;m+5<h.length;){if(h[m]!==255||(h[m+1]&246)!==240){m++;continue}return la[(h[m+2]&60)>>>2]}return null},tu=function(h){var m,_,y,C;m=10,h[5]&64&&(m+=4,m+=La(h.subarray(10,14)));do{if(_=La(h.subarray(m+4,m+8)),_<1)return null;if(C=String.fromCharCode(h[m],h[m+1],h[m+2],h[m+3]),C==="PRIV"){y=h.subarray(m+10,m+_+10);for(var x=0;x<y.byteLength;x++)if(y[x]===0){var q=bo(y,0,x);if(q==="com.apple.streaming.transportStreamTimestamp"){var z=y.subarray(x+1),Q=(z[3]&1)<<30|z[4]<<22|z[5]<<14|z[6]<<6|z[7]>>>2;return Q*=4,Q+=z[7]&3,Q}break}}m+=10,m+=_}while(m<h.byteLength);return null},Gn={isLikelyAacData:sn,parseId3TagSize:zn,parseAdtsSize:Oa,parseType:Zl,parseSampleRate:eu,parseAacTimestamp:tu},iu=t,an=Gn,ua;ua=function(){var h=new Uint8Array,m=0;ua.prototype.init.call(this),this.setTimestamp=function(_){m=_},this.push=function(_){var y=0,C=0,x,q,z,Q;for(h.length?(Q=h.length,h=new Uint8Array(_.byteLength+Q),h.set(h.subarray(0,Q)),h.set(_,Q)):h=_;h.length-C>=3;){if(h[C]===73&&h[C+1]===68&&h[C+2]===51){if(h.length-C<10||(y=an.parseId3TagSize(h,C),C+y>h.length))break;q={type:"timed-metadata",data:h.subarray(C,C+y)},this.trigger("data",q),C+=y;continue}else if((h[C]&255)===255&&(h[C+1]&240)===240){if(h.length-C<7||(y=an.parseAdtsSize(h,C),C+y>h.length))break;z={type:"audio",data:h.subarray(C,C+y),pts:m,dts:m},this.trigger("data",z),C+=y;continue}C++}x=h.length-C,x>0?h=h.subarray(C):h=new Uint8Array},this.reset=function(){h=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){h=new Uint8Array,this.trigger("endedtimeline")}},ua.prototype=new iu;var ru=ua,Mt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],nu=Mt,Ma=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Oi=Ma,Kn=t,Xn=Qt,Sn=Pi,ca=Ss,Mi=ge,Ri=yo,Ds=_t,Ra=aa,Fr=Jl.H264Stream,Yn=ru,su=Gn.isLikelyAacData,au=_t.ONE_SECOND_IN_TS,So=nu,Co=Oi,ha,Is,Qn,$r,Ba=function(h,m){m.stream=h,this.trigger("log",m)},Jn=function(h,m){for(var _=Object.keys(m),y=0;y<_.length;y++){var C=_[y];C==="headOfPipeline"||!m[C].on||m[C].on("log",Ba.bind(h,C))}},Cn=function(h,m){var _;if(h.length!==m.length)return!1;for(_=0;_<h.length;_++)if(h[_]!==m[_])return!1;return!0},Eo=function(h,m,_,y,C,x){var q=_-m,z=y-m,Q=C-_;return{start:{dts:h,pts:h+q},end:{dts:h+z,pts:h+Q},prependedContentDuration:x,baseMediaDecodeTime:h}};Is=function(h,m){var _=[],y,C=0,x=0,q=1/0;m=m||{},y=m.firstSequenceNumber||0,Is.prototype.init.call(this),this.push=function(z){Mi.collectDtsInfo(h,z),h&&So.forEach(function(Q){h[Q]=z[Q]}),_.push(z)},this.setEarliestDts=function(z){C=z},this.setVideoBaseMediaDecodeTime=function(z){q=z},this.setAudioAppendStart=function(z){x=z},this.flush=function(){var z,Q,Z,he,be,Ue,Ee;if(_.length===0){this.trigger("done","AudioSegmentStream");return}z=ca.trimAdtsFramesByEarliestDts(_,h,C),h.baseMediaDecodeTime=Mi.calculateTrackBaseMediaDecodeTime(h,m.keepOriginalTimestamps),Ee=ca.prefixWithSilence(h,z,x,q),h.samples=ca.generateSampleTable(z),Z=Xn.mdat(ca.concatenateFrameData(z)),_=[],Q=Xn.moof(y,[h]),he=new Uint8Array(Q.byteLength+Z.byteLength),y++,he.set(Q),he.set(Z,Q.byteLength),Mi.clearDtsInfo(h),be=Math.ceil(au*1024/h.samplerate),z.length&&(Ue=z.length*be,this.trigger("segmentTimingInfo",Eo(Ds.audioTsToVideoTs(h.baseMediaDecodeTime,h.samplerate),z[0].dts,z[0].pts,z[0].dts+Ue,z[0].pts+Ue,Ee||0)),this.trigger("timingInfo",{start:z[0].pts,end:z[0].pts+Ue})),this.trigger("data",{track:h,boxes:he}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Mi.clearDtsInfo(h),_=[],this.trigger("reset")}},Is.prototype=new Kn,ha=function(h,m){var _,y=[],C=[],x,q;m=m||{},_=m.firstSequenceNumber||0,ha.prototype.init.call(this),delete h.minPTS,this.gopCache_=[],this.push=function(z){Mi.collectDtsInfo(h,z),z.nalUnitType==="seq_parameter_set_rbsp"&&!x&&(x=z.config,h.sps=[z.data],Co.forEach(function(Q){h[Q]=x[Q]},this)),z.nalUnitType==="pic_parameter_set_rbsp"&&!q&&(q=z.data,h.pps=[z.data]),y.push(z)},this.flush=function(){for(var z,Q,Z,he,be,Ue,Ee=0,Ge,ht;y.length&&y[0].nalUnitType!=="access_unit_delimiter_rbsp";)y.shift();if(y.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(z=Sn.groupNalsIntoFrames(y),Z=Sn.groupFramesIntoGops(z),Z[0][0].keyFrame||(Q=this.getGopForFusion_(y[0],h),Q?(Ee=Q.duration,Z.unshift(Q),Z.byteLength+=Q.byteLength,Z.nalCount+=Q.nalCount,Z.pts=Q.pts,Z.dts=Q.dts,Z.duration+=Q.duration):Z=Sn.extendFirstKeyFrame(Z)),C.length){var Bi;if(m.alignGopsAtEnd?Bi=this.alignGopsAtEnd_(Z):Bi=this.alignGopsAtStart_(Z),!Bi){this.gopCache_.unshift({gop:Z.pop(),pps:h.pps,sps:h.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),y=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Mi.clearDtsInfo(h),Z=Bi}Mi.collectDtsInfo(h,Z),h.samples=Sn.generateSampleTable(Z),be=Xn.mdat(Sn.concatenateNalData(Z)),h.baseMediaDecodeTime=Mi.calculateTrackBaseMediaDecodeTime(h,m.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(jr){return{pts:jr.pts,dts:jr.dts,byteLength:jr.byteLength}})),Ge=Z[0],ht=Z[Z.length-1],this.trigger("segmentTimingInfo",Eo(h.baseMediaDecodeTime,Ge.dts,Ge.pts,ht.dts+ht.duration,ht.pts+ht.duration,Ee)),this.trigger("timingInfo",{start:Z[0].pts,end:Z[Z.length-1].pts+Z[Z.length-1].duration}),this.gopCache_.unshift({gop:Z.pop(),pps:h.pps,sps:h.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),y=[],this.trigger("baseMediaDecodeTime",h.baseMediaDecodeTime),this.trigger("timelineStartInfo",h.timelineStartInfo),he=Xn.moof(_,[h]),Ue=new Uint8Array(he.byteLength+be.byteLength),_++,Ue.set(he),Ue.set(be,he.byteLength),this.trigger("data",{track:h,boxes:Ue}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),y=[],this.gopCache_.length=0,C.length=0,this.trigger("reset")},this.resetStream_=function(){Mi.clearDtsInfo(h),x=void 0,q=void 0},this.getGopForFusion_=function(z){var Q=45e3,Z=1/0,he,be,Ue,Ee,Ge;for(Ge=0;Ge<this.gopCache_.length;Ge++)Ee=this.gopCache_[Ge],Ue=Ee.gop,!(!(h.pps&&Cn(h.pps[0],Ee.pps[0]))||!(h.sps&&Cn(h.sps[0],Ee.sps[0])))&&(Ue.dts<h.timelineStartInfo.dts||(he=z.dts-Ue.dts-Ue.duration,he>=-1e4&&he<=Q&&(!be||Z>he)&&(be=Ee,Z=he)));return be?be.gop:null},this.alignGopsAtStart_=function(z){var Q,Z,he,be,Ue,Ee,Ge,ht;for(Ue=z.byteLength,Ee=z.nalCount,Ge=z.duration,Q=Z=0;Q<C.length&&Z<z.length&&(he=C[Q],be=z[Z],he.pts!==be.pts);){if(be.pts>he.pts){Q++;continue}Z++,Ue-=be.byteLength,Ee-=be.nalCount,Ge-=be.duration}return Z===0?z:Z===z.length?null:(ht=z.slice(Z),ht.byteLength=Ue,ht.duration=Ge,ht.nalCount=Ee,ht.pts=ht[0].pts,ht.dts=ht[0].dts,ht)},this.alignGopsAtEnd_=function(z){var Q,Z,he,be,Ue,Ee;for(Q=C.length-1,Z=z.length-1,Ue=null,Ee=!1;Q>=0&&Z>=0;){if(he=C[Q],be=z[Z],he.pts===be.pts){Ee=!0;break}if(he.pts>be.pts){Q--;continue}Q===C.length-1&&(Ue=Z),Z--}if(!Ee&&Ue===null)return null;var Ge;if(Ee?Ge=Z:Ge=Ue,Ge===0)return z;var ht=z.slice(Ge),Bi=ht.reduce(function(jr,ga){return jr.byteLength+=ga.byteLength,jr.duration+=ga.duration,jr.nalCount+=ga.nalCount,jr},{byteLength:0,duration:0,nalCount:0});return ht.byteLength=Bi.byteLength,ht.duration=Bi.duration,ht.nalCount=Bi.nalCount,ht.pts=ht[0].pts,ht.dts=ht[0].dts,ht},this.alignGopsWith=function(z){C=z}},ha.prototype=new Kn,$r=function(h,m){this.numberOfTracks=0,this.metadataStream=m,h=h||{},typeof h.remux<"u"?this.remuxTracks=!!h.remux:this.remuxTracks=!0,typeof h.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=h.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,$r.prototype.init.call(this),this.push=function(_){if(_.content||_.text)return this.pendingCaptions.push(_);if(_.frames)return this.pendingMetadata.push(_);this.pendingTracks.push(_.track),this.pendingBytes+=_.boxes.byteLength,_.track.type==="video"&&(this.videoTrack=_.track,this.pendingBoxes.push(_.boxes)),_.track.type==="audio"&&(this.audioTrack=_.track,this.pendingBoxes.unshift(_.boxes))}},$r.prototype=new Kn,$r.prototype.flush=function(h){var m=0,_={captions:[],captionStreams:{},metadata:[],info:{}},y,C,x,q=0,z;if(this.pendingTracks.length<this.numberOfTracks){if(h!=="VideoSegmentStream"&&h!=="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?(q=this.videoTrack.timelineStartInfo.pts,Co.forEach(function(Q){_.info[Q]=this.videoTrack[Q]},this)):this.audioTrack&&(q=this.audioTrack.timelineStartInfo.pts,So.forEach(function(Q){_.info[Q]=this.audioTrack[Q]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?_.type=this.pendingTracks[0].type:_.type="combined",this.emittedTracks+=this.pendingTracks.length,x=Xn.initSegment(this.pendingTracks),_.initSegment=new Uint8Array(x.byteLength),_.initSegment.set(x),_.data=new Uint8Array(this.pendingBytes),z=0;z<this.pendingBoxes.length;z++)_.data.set(this.pendingBoxes[z],m),m+=this.pendingBoxes[z].byteLength;for(z=0;z<this.pendingCaptions.length;z++)y=this.pendingCaptions[z],y.startTime=Ds.metadataTsToSeconds(y.startPts,q,this.keepOriginalTimestamps),y.endTime=Ds.metadataTsToSeconds(y.endPts,q,this.keepOriginalTimestamps),_.captionStreams[y.stream]=!0,_.captions.push(y);for(z=0;z<this.pendingMetadata.length;z++)C=this.pendingMetadata[z],C.cueTime=Ds.metadataTsToSeconds(C.pts,q,this.keepOriginalTimestamps),_.metadata.push(C);for(_.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",_),z=0;z<_.captions.length;z++)y=_.captions[z],this.trigger("caption",y);for(z=0;z<_.metadata.length;z++)C=_.metadata[z],this.trigger("id3Frame",C)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},$r.prototype.setRemux=function(h){this.remuxTracks=h},Qn=function(h){var m=this,_=!0,y,C;Qn.prototype.init.call(this),h=h||{},this.baseMediaDecodeTime=h.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var x={};this.transmuxPipeline_=x,x.type="aac",x.metadataStream=new Ri.MetadataStream,x.aacStream=new Yn,x.audioTimestampRolloverStream=new Ri.TimestampRolloverStream("audio"),x.timedMetadataTimestampRolloverStream=new Ri.TimestampRolloverStream("timed-metadata"),x.adtsStream=new Ra,x.coalesceStream=new $r(h,x.metadataStream),x.headOfPipeline=x.aacStream,x.aacStream.pipe(x.audioTimestampRolloverStream).pipe(x.adtsStream),x.aacStream.pipe(x.timedMetadataTimestampRolloverStream).pipe(x.metadataStream).pipe(x.coalesceStream),x.metadataStream.on("timestamp",function(q){x.aacStream.setTimestamp(q.timeStamp)}),x.aacStream.on("data",function(q){q.type!=="timed-metadata"&&q.type!=="audio"||x.audioSegmentStream||(C=C||{timelineStartInfo:{baseMediaDecodeTime:m.baseMediaDecodeTime},codec:"adts",type:"audio"},x.coalesceStream.numberOfTracks++,x.audioSegmentStream=new Is(C,h),x.audioSegmentStream.on("log",m.getLogTrigger_("audioSegmentStream")),x.audioSegmentStream.on("timingInfo",m.trigger.bind(m,"audioTimingInfo")),x.adtsStream.pipe(x.audioSegmentStream).pipe(x.coalesceStream),m.trigger("trackinfo",{hasAudio:!!C,hasVideo:!!y}))}),x.coalesceStream.on("data",this.trigger.bind(this,"data")),x.coalesceStream.on("done",this.trigger.bind(this,"done")),Jn(this,x)},this.setupTsPipeline=function(){var x={};this.transmuxPipeline_=x,x.type="ts",x.metadataStream=new Ri.MetadataStream,x.packetStream=new Ri.TransportPacketStream,x.parseStream=new Ri.TransportParseStream,x.elementaryStream=new Ri.ElementaryStream,x.timestampRolloverStream=new Ri.TimestampRolloverStream,x.adtsStream=new Ra,x.h264Stream=new Fr,x.captionStream=new Ri.CaptionStream(h),x.coalesceStream=new $r(h,x.metadataStream),x.headOfPipeline=x.packetStream,x.packetStream.pipe(x.parseStream).pipe(x.elementaryStream).pipe(x.timestampRolloverStream),x.timestampRolloverStream.pipe(x.h264Stream),x.timestampRolloverStream.pipe(x.adtsStream),x.timestampRolloverStream.pipe(x.metadataStream).pipe(x.coalesceStream),x.h264Stream.pipe(x.captionStream).pipe(x.coalesceStream),x.elementaryStream.on("data",function(q){var z;if(q.type==="metadata"){for(z=q.tracks.length;z--;)!y&&q.tracks[z].type==="video"?(y=q.tracks[z],y.timelineStartInfo.baseMediaDecodeTime=m.baseMediaDecodeTime):!C&&q.tracks[z].type==="audio"&&(C=q.tracks[z],C.timelineStartInfo.baseMediaDecodeTime=m.baseMediaDecodeTime);y&&!x.videoSegmentStream&&(x.coalesceStream.numberOfTracks++,x.videoSegmentStream=new ha(y,h),x.videoSegmentStream.on("log",m.getLogTrigger_("videoSegmentStream")),x.videoSegmentStream.on("timelineStartInfo",function(Q){C&&!h.keepOriginalTimestamps&&(C.timelineStartInfo=Q,x.audioSegmentStream.setEarliestDts(Q.dts-m.baseMediaDecodeTime))}),x.videoSegmentStream.on("processedGopsInfo",m.trigger.bind(m,"gopInfo")),x.videoSegmentStream.on("segmentTimingInfo",m.trigger.bind(m,"videoSegmentTimingInfo")),x.videoSegmentStream.on("baseMediaDecodeTime",function(Q){C&&x.audioSegmentStream.setVideoBaseMediaDecodeTime(Q)}),x.videoSegmentStream.on("timingInfo",m.trigger.bind(m,"videoTimingInfo")),x.h264Stream.pipe(x.videoSegmentStream).pipe(x.coalesceStream)),C&&!x.audioSegmentStream&&(x.coalesceStream.numberOfTracks++,x.audioSegmentStream=new Is(C,h),x.audioSegmentStream.on("log",m.getLogTrigger_("audioSegmentStream")),x.audioSegmentStream.on("timingInfo",m.trigger.bind(m,"audioTimingInfo")),x.audioSegmentStream.on("segmentTimingInfo",m.trigger.bind(m,"audioSegmentTimingInfo")),x.adtsStream.pipe(x.audioSegmentStream).pipe(x.coalesceStream)),m.trigger("trackinfo",{hasAudio:!!C,hasVideo:!!y})}}),x.coalesceStream.on("data",this.trigger.bind(this,"data")),x.coalesceStream.on("id3Frame",function(q){q.dispatchType=x.metadataStream.dispatchType,m.trigger("id3Frame",q)}),x.coalesceStream.on("caption",this.trigger.bind(this,"caption")),x.coalesceStream.on("done",this.trigger.bind(this,"done")),Jn(this,x)},this.setBaseMediaDecodeTime=function(x){var q=this.transmuxPipeline_;h.keepOriginalTimestamps||(this.baseMediaDecodeTime=x),C&&(C.timelineStartInfo.dts=void 0,C.timelineStartInfo.pts=void 0,Mi.clearDtsInfo(C),q.audioTimestampRolloverStream&&q.audioTimestampRolloverStream.discontinuity()),y&&(q.videoSegmentStream&&(q.videoSegmentStream.gopCache_=[]),y.timelineStartInfo.dts=void 0,y.timelineStartInfo.pts=void 0,Mi.clearDtsInfo(y),q.captionStream.reset()),q.timestampRolloverStream&&q.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(x){C&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(x)},this.setRemux=function(x){var q=this.transmuxPipeline_;h.remux=x,q&&q.coalesceStream&&q.coalesceStream.setRemux(x)},this.alignGopsWith=function(x){y&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(x)},this.getLogTrigger_=function(x){var q=this;return function(z){z.stream=x,q.trigger("log",z)}},this.push=function(x){if(_){var q=su(x);q&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!q&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),_=!1}this.transmuxPipeline_.headOfPipeline.push(x)},this.flush=function(){_=!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()}},Qn.prototype=new Kn;var wo={Transmuxer:Qn},ko=function(h){return h>>>0},En=function(h){return("00"+h.toString(16)).slice(-2)},Ps={toUnsigned:ko,toHexString:En},Ls=function(h){var m="";return m+=String.fromCharCode(h[0]),m+=String.fromCharCode(h[1]),m+=String.fromCharCode(h[2]),m+=String.fromCharCode(h[3]),m},da=Ls,fa=Ps.toUnsigned,Ao=da,ki=function(h,m){var _=[],y,C,x,q,z;if(!m.length)return null;for(y=0;y<h.byteLength;)C=fa(h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3]),x=Ao(h.subarray(y+4,y+8)),q=C>1?y+C:h.byteLength,x===m[0]&&(m.length===1?_.push(h.subarray(y+8,q)):(z=ki(h.subarray(y+8,q),m.slice(1)),z.length&&(_=_.concat(z)))),y=q;return _},Wi=ki,on=Ps.toUnsigned,ou=n.getUint64,lu=function(h){var m={version:h[0],flags:new Uint8Array(h.subarray(1,4))};return m.version===1?m.baseMediaDecodeTime=ou(h.subarray(4)):m.baseMediaDecodeTime=on(h[4]<<24|h[5]<<16|h[6]<<8|h[7]),m},Ua=lu,uu=function(h){var m=new DataView(h.buffer,h.byteOffset,h.byteLength),_={version:h[0],flags:new Uint8Array(h.subarray(1,4)),trackId:m.getUint32(4)},y=_.flags[2]&1,C=_.flags[2]&2,x=_.flags[2]&8,q=_.flags[2]&16,z=_.flags[2]&32,Q=_.flags[0]&65536,Z=_.flags[0]&131072,he;return he=8,y&&(he+=4,_.baseDataOffset=m.getUint32(12),he+=4),C&&(_.sampleDescriptionIndex=m.getUint32(he),he+=4),x&&(_.defaultSampleDuration=m.getUint32(he),he+=4),q&&(_.defaultSampleSize=m.getUint32(he),he+=4),z&&(_.defaultSampleFlags=m.getUint32(he)),Q&&(_.durationIsEmpty=!0),!y&&Z&&(_.baseDataOffsetIsMoof=!0),_},pa=uu,cu=function(h){return{isLeading:(h[0]&12)>>>2,dependsOn:h[0]&3,isDependedOn:(h[1]&192)>>>6,hasRedundancy:(h[1]&48)>>>4,paddingValue:(h[1]&14)>>>1,isNonSyncSample:h[1]&1,degradationPriority:h[2]<<8|h[3]}},hu=cu,wn=hu,Et=function(h){var m={version:h[0],flags:new Uint8Array(h.subarray(1,4)),samples:[]},_=new DataView(h.buffer,h.byteOffset,h.byteLength),y=m.flags[2]&1,C=m.flags[2]&4,x=m.flags[1]&1,q=m.flags[1]&2,z=m.flags[1]&4,Q=m.flags[1]&8,Z=_.getUint32(4),he=8,be;for(y&&(m.dataOffset=_.getInt32(he),he+=4),C&&Z&&(be={flags:wn(h.subarray(he,he+4))},he+=4,x&&(be.duration=_.getUint32(he),he+=4),q&&(be.size=_.getUint32(he),he+=4),Q&&(m.version===1?be.compositionTimeOffset=_.getInt32(he):be.compositionTimeOffset=_.getUint32(he),he+=4),m.samples.push(be),Z--);Z--;)be={},x&&(be.duration=_.getUint32(he),he+=4),q&&(be.size=_.getUint32(he),he+=4),z&&(be.flags=wn(h.subarray(he,he+4)),he+=4),Q&&(m.version===1?be.compositionTimeOffset=_.getInt32(he):be.compositionTimeOffset=_.getUint32(he),he+=4),m.samples.push(be);return m},Cr=Et,Ti={tfdt:Ua,trun:Cr},sr={parseTfdt:Ti.tfdt,parseTrun:Ti.trun},du=function(h){for(var m=0,_=String.fromCharCode(h[m]),y="";_!=="\0";)y+=_,m++,_=String.fromCharCode(h[m]);return y+=_,y},xo={uint8ToCString:du},ma=xo.uint8ToCString,fu=n.getUint64,pu=function(h){var m=4,_=h[0],y,C,x,q,z,Q,Z,he;if(_===0){y=ma(h.subarray(m)),m+=y.length,C=ma(h.subarray(m)),m+=C.length;var be=new DataView(h.buffer);x=be.getUint32(m),m+=4,z=be.getUint32(m),m+=4,Q=be.getUint32(m),m+=4,Z=be.getUint32(m),m+=4}else if(_===1){var be=new DataView(h.buffer);x=be.getUint32(m),m+=4,q=fu(h.subarray(m)),m+=8,Q=be.getUint32(m),m+=4,Z=be.getUint32(m),m+=4,y=ma(h.subarray(m)),m+=y.length,C=ma(h.subarray(m)),m+=C.length}he=new Uint8Array(h.subarray(m,h.byteLength));var Ue={scheme_id_uri:y,value:C,timescale:x||1,presentation_time:q,presentation_time_delta:z,event_duration:Q,id:Z,message_data:he};return gu(_,Ue)?Ue:void 0},mu=function(h,m,_,y){return h||h===0?h/m:y+_/m},gu=function(h,m){var _=m.scheme_id_uri!=="\0",y=h===0&&No(m.presentation_time_delta)&&_,C=h===1&&No(m.presentation_time)&&_;return!(h>1)&&y||C},No=function(h){return h!==void 0||h!==null},Do={parseEmsgBox:pu,scaleTime:mu},Zn;typeof window<"u"?Zn=window:typeof s<"u"?Zn=s:typeof self<"u"?Zn=self:Zn={};var M=Zn,p=Ps.toUnsigned,T=Ps.toHexString,v=Wi,b=da,A=Do,D=pa,V=Cr,X=Ua,se=n.getUint64,ee,le,Ce,Re,Fe,Ie,Ye,Gt=M,bi=mo.parseId3Frames;ee=function(h){var m={},_=v(h,["moov","trak"]);return _.reduce(function(y,C){var x,q,z,Q,Z;return x=v(C,["tkhd"])[0],!x||(q=x[0],z=q===0?12:20,Q=p(x[z]<<24|x[z+1]<<16|x[z+2]<<8|x[z+3]),Z=v(C,["mdia","mdhd"])[0],!Z)?null:(q=Z[0],z=q===0?12:20,y[Q]=p(Z[z]<<24|Z[z+1]<<16|Z[z+2]<<8|Z[z+3]),y)},m)},le=function(h,m){var _;_=v(m,["moof","traf"]);var y=_.reduce(function(C,x){var q=v(x,["tfhd"])[0],z=p(q[4]<<24|q[5]<<16|q[6]<<8|q[7]),Q=h[z]||9e4,Z=v(x,["tfdt"])[0],he=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),be;Z[0]===1?be=se(Z.subarray(4,12)):be=he.getUint32(4);let Ue;return typeof be=="bigint"?Ue=be/Gt.BigInt(Q):typeof be=="number"&&!isNaN(be)&&(Ue=be/Q),Ue<Number.MAX_SAFE_INTEGER&&(Ue=Number(Ue)),Ue<C&&(C=Ue),C},1/0);return typeof y=="bigint"||isFinite(y)?y:0},Ce=function(h,m){var _=v(m,["moof","traf"]),y=0,C=0,x;if(_&&_.length){var q=v(_[0],["tfhd"])[0],z=v(_[0],["trun"])[0],Q=v(_[0],["tfdt"])[0];if(q){var Z=D(q);x=Z.trackId}if(Q){var he=X(Q);y=he.baseMediaDecodeTime}if(z){var be=V(z);be.samples&&be.samples.length&&(C=be.samples[0].compositionTimeOffset||0)}}var Ue=h[x]||9e4;typeof y=="bigint"&&(C=Gt.BigInt(C),Ue=Gt.BigInt(Ue));var Ee=(y+C)/Ue;return typeof Ee=="bigint"&&Ee<Number.MAX_SAFE_INTEGER&&(Ee=Number(Ee)),Ee},Re=function(h){var m=v(h,["moov","trak"]),_=[];return m.forEach(function(y){var C=v(y,["mdia","hdlr"]),x=v(y,["tkhd"]);C.forEach(function(q,z){var Q=b(q.subarray(8,12)),Z=x[z],he,be,Ue;Q==="vide"&&(he=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),be=he.getUint8(0),Ue=be===0?he.getUint32(12):he.getUint32(20),_.push(Ue))})}),_},Ie=function(h){var m=h[0],_=m===0?12:20;return p(h[_]<<24|h[_+1]<<16|h[_+2]<<8|h[_+3])},Fe=function(h){var m=v(h,["moov","trak"]),_=[];return m.forEach(function(y){var C={},x=v(y,["tkhd"])[0],q,z;x&&(q=new DataView(x.buffer,x.byteOffset,x.byteLength),z=q.getUint8(0),C.id=z===0?q.getUint32(12):q.getUint32(20));var Q=v(y,["mdia","hdlr"])[0];if(Q){var Z=b(Q.subarray(8,12));Z==="vide"?C.type="video":Z==="soun"?C.type="audio":C.type=Z}var he=v(y,["mdia","minf","stbl","stsd"])[0];if(he){var be=he.subarray(8);C.codec=b(be.subarray(4,8));var Ue=v(be,[C.codec])[0],Ee,Ge;Ue&&(/^[asm]vc[1-9]$/i.test(C.codec)?(Ee=Ue.subarray(78),Ge=b(Ee.subarray(4,8)),Ge==="avcC"&&Ee.length>11?(C.codec+=".",C.codec+=T(Ee[9]),C.codec+=T(Ee[10]),C.codec+=T(Ee[11])):C.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(C.codec)?(Ee=Ue.subarray(28),Ge=b(Ee.subarray(4,8)),Ge==="esds"&&Ee.length>20&&Ee[19]!==0?(C.codec+="."+T(Ee[19]),C.codec+="."+T(Ee[20]>>>2&63).replace(/^0/,"")):C.codec="mp4a.40.2"):C.codec=C.codec.toLowerCase())}var ht=v(y,["mdia","mdhd"])[0];ht&&(C.timescale=Ie(ht)),_.push(C)}),_},Ye=function(h,m=0){var _=v(h,["emsg"]);return _.map(y=>{var C=A.parseEmsgBox(new Uint8Array(y)),x=bi(C.message_data);return{cueTime:A.scaleTime(C.presentation_time,C.timescale,C.presentation_time_delta,m),duration:A.scaleTime(C.event_duration,C.timescale),frames:x}})};var ar={findBox:v,parseType:b,timescale:ee,startTime:le,compositionStartTime:Ce,videoTrackIds:Re,tracks:Fe,getTimescaleFromMediaHeader:Ie,getEmsgID3:Ye};const{parseTrun:Fa}=sr,{findBox:w}=ar;var I=M,U=function(h){var m=w(h,["moof","traf"]),_=w(h,["mdat"]),y=[];return _.forEach(function(C,x){var q=m[x];y.push({mdat:C,traf:q})}),y},J=function(h,m,_){var y=m,C=_.defaultSampleDuration||0,x=_.defaultSampleSize||0,q=_.trackId,z=[];return h.forEach(function(Q){var Z=Fa(Q),he=Z.samples;he.forEach(function(be){be.duration===void 0&&(be.duration=C),be.size===void 0&&(be.size=x),be.trackId=q,be.dts=y,be.compositionTimeOffset===void 0&&(be.compositionTimeOffset=0),typeof y=="bigint"?(be.pts=y+I.BigInt(be.compositionTimeOffset),y+=I.BigInt(be.duration)):(be.pts=y+be.compositionTimeOffset,y+=be.duration)}),z=z.concat(he)}),z},ue={getMdatTrafPairs:U,parseSamples:J},oe=mi.discardEmulationPreventionBytes,ae=ea.CaptionStream,fe=Wi,pe=Ua,Ne=pa,{getMdatTrafPairs:Le,parseSamples:Pe}=ue,He=function(h,m){for(var _=h,y=0;y<m.length;y++){var C=m[y];if(_<C.size)return C;_-=C.size}return null},je=function(h,m,_){var y=new DataView(h.buffer,h.byteOffset,h.byteLength),C={logs:[],seiNals:[]},x,q,z,Q;for(q=0;q+4<h.length;q+=z)if(z=y.getUint32(q),q+=4,!(z<=0))switch(h[q]&31){case 6:var Z=h.subarray(q+1,q+1+z),he=He(q,m);if(x={nalUnitType:"sei_rbsp",size:z,data:Z,escapedRBSP:oe(Z),trackId:_},he)x.pts=he.pts,x.dts=he.dts,Q=he;else if(Q)x.pts=Q.pts,x.dts=Q.dts;else{C.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+q+" for trackId "+_+". See mux.js#223."});break}C.seiNals.push(x);break}return C},tt=function(h,m){var _={},y=Le(h);return y.forEach(function(C){var x=C.mdat,q=C.traf,z=fe(q,["tfhd"]),Q=Ne(z[0]),Z=Q.trackId,he=fe(q,["tfdt"]),be=he.length>0?pe(he[0]).baseMediaDecodeTime:0,Ue=fe(q,["trun"]),Ee,Ge;m===Z&&Ue.length>0&&(Ee=Pe(Ue,be,Q),Ge=je(x,Ee,Z),_[Z]||(_[Z]={seiNals:[],logs:[]}),_[Z].seiNals=_[Z].seiNals.concat(Ge.seiNals),_[Z].logs=_[Z].logs.concat(Ge.logs))}),_},gt=function(h,m,_){var y;if(m===null)return null;y=tt(h,m);var C=y[m]||{};return{seiNals:C.seiNals,logs:C.logs,timescale:_}},ot=function(){var h=!1,m,_,y,C,x,q;this.isInitialized=function(){return h},this.init=function(z){m=new ae,h=!0,q=z?z.isPartial:!1,m.on("data",function(Q){Q.startTime=Q.startPts/C,Q.endTime=Q.endPts/C,x.captions.push(Q),x.captionStreams[Q.stream]=!0}),m.on("log",function(Q){x.logs.push(Q)})},this.isNewInit=function(z,Q){return z&&z.length===0||Q&&typeof Q=="object"&&Object.keys(Q).length===0?!1:y!==z[0]||C!==Q[y]},this.parse=function(z,Q,Z){var he;if(this.isInitialized()){if(!Q||!Z)return null;if(this.isNewInit(Q,Z))y=Q[0],C=Z[y];else if(y===null||!C)return _.push(z),null}else return null;for(;_.length>0;){var be=_.shift();this.parse(be,Q,Z)}return he=gt(z,y,C),he&&he.logs&&(x.logs=x.logs.concat(he.logs)),he===null||!he.seiNals?x.logs.length?{logs:x.logs,captions:[],captionStreams:[]}:null:(this.pushNals(he.seiNals),this.flushStream(),x)},this.pushNals=function(z){if(!this.isInitialized()||!z||z.length===0)return null;z.forEach(function(Q){m.push(Q)})},this.flushStream=function(){if(!this.isInitialized())return null;q?m.partialFlush():m.flush()},this.clearParsedCaptions=function(){x.captions=[],x.captionStreams={},x.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;m.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){_=[],y=null,C=null,x?this.clearParsedCaptions():x={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},bt=ot;const{parseTfdt:Rt}=sr,Kt=Wi,{getTimescaleFromMediaHeader:Ai}=ar,{parseSamples:or,getMdatTrafPairs:vt}=ue;var Ze=function(){let h=9e4;this.init=function(m){const _=Kt(m,["moov","trak","mdia","mdhd"])[0];_&&(h=Ai(_))},this.parseSegment=function(m){const _=[],y=vt(m);let C=0;return y.forEach(function(x){const q=x.mdat,z=x.traf,Q=Kt(z,["tfdt"])[0],Z=Kt(z,["tfhd"])[0],he=Kt(z,["trun"]);if(Q&&(C=Rt(Q).baseMediaDecodeTime),he.length&&Z){const be=or(he,C,Z);let Ue=0;be.forEach(function(Ee){const Ge="utf-8",ht=new TextDecoder(Ge),Bi=q.slice(Ue,Ue+Ee.size);if(Kt(Bi,["vtte"])[0]){Ue+=Ee.size;return}Kt(Bi,["vttc"]).forEach(function(_u){const Tu=Kt(_u,["payl"])[0],bu=Kt(_u,["sttg"])[0],Su=Ee.pts/h,wc=(Ee.pts+Ee.duration)/h;let Zt,Cu;if(Tu)try{Zt=ht.decode(Tu)}catch(An){console.error(An)}if(bu)try{Cu=ht.decode(bu)}catch(An){console.error(An)}Ee.duration&&Zt&&_.push({cueText:Zt,start:Su,end:wc,settings:Cu})}),Ue+=Ee.size})}}),_}},ft=Cs,ct=function(h){var m=h[1]&31;return m<<=8,m|=h[2],m},xi=function(h){return!!(h[1]&64)},$t=function(h){var m=0;return(h[3]&48)>>>4>1&&(m+=h[4]+1),m},Dt=function(h,m){var _=ct(h);return _===0?"pat":_===m?"pmt":m?"pes":null},It=function(h){var m=xi(h),_=4+$t(h);return m&&(_+=h[_]+1),(h[_+10]&31)<<8|h[_+11]},hi=function(h){var m={},_=xi(h),y=4+$t(h);if(_&&(y+=h[y]+1),!!(h[y+5]&1)){var C,x,q;C=(h[y+1]&15)<<8|h[y+2],x=3+C-4,q=(h[y+10]&15)<<8|h[y+11];for(var z=12+q;z<x;){var Q=y+z;m[(h[Q+1]&31)<<8|h[Q+2]]=h[Q],z+=((h[Q+3]&15)<<8|h[Q+4])+5}return m}},Bt=function(h,m){var _=ct(h),y=m[_];switch(y){case ft.H264_STREAM_TYPE:return"video";case ft.ADTS_STREAM_TYPE:return"audio";case ft.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},es=function(h){var m=xi(h);if(!m)return null;var _=4+$t(h);if(_>=h.byteLength)return null;var y=null,C;return C=h[_+7],C&192&&(y={},y.pts=(h[_+9]&14)<<27|(h[_+10]&255)<<20|(h[_+11]&254)<<12|(h[_+12]&255)<<5|(h[_+13]&254)>>>3,y.pts*=4,y.pts+=(h[_+13]&6)>>>1,y.dts=y.pts,C&64&&(y.dts=(h[_+14]&14)<<27|(h[_+15]&255)<<20|(h[_+16]&254)<<12|(h[_+17]&255)<<5|(h[_+18]&254)>>>3,y.dts*=4,y.dts+=(h[_+18]&6)>>>1)),y},ts=function(h){switch(h){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}},$a=function(h){for(var m=4+$t(h),_=h.subarray(m),y=0,C=0,x=!1,q;C<_.byteLength-3;C++)if(_[C+2]===1){y=C+5;break}for(;y<_.byteLength;)switch(_[y]){case 0:if(_[y-1]!==0){y+=2;break}else if(_[y-2]!==0){y++;break}C+3!==y-2&&(q=ts(_[C+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(x=!0));do y++;while(_[y]!==1&&y<_.length);C=y-2,y+=3;break;case 1:if(_[y-1]!==0||_[y-2]!==0){y+=3;break}q=ts(_[C+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(x=!0),C=y-2,y+=3;break;default:y+=3;break}return _=_.subarray(C),y-=C,C=0,_&&_.byteLength>3&&(q=ts(_[C+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(x=!0)),x},vu={parseType:Dt,parsePat:It,parsePmt:hi,parsePayloadUnitStartIndicator:xi,parsePesType:Bt,parsePesTime:es,videoPacketContainsKeyFrame:$a},ja=Cs,Er=ws.handleRollover,yt={};yt.ts=vu,yt.aac=Gn;var kn=_t.ONE_SECOND_IN_TS,Ni=188,wr=71,yu=function(h,m){for(var _=0,y=Ni,C,x;y<h.byteLength;){if(h[_]===wr&&h[y]===wr){switch(C=h.subarray(_,y),x=yt.ts.parseType(C,m.pid),x){case"pat":m.pid=yt.ts.parsePat(C);break;case"pmt":var q=yt.ts.parsePmt(C);m.table=m.table||{},Object.keys(q).forEach(function(z){m.table[z]=q[z]});break}_+=Ni,y+=Ni;continue}_++,y++}},Yg=function(h,m,_){for(var y=0,C=Ni,x,q,z,Q,Z,he=!1;C<=h.byteLength;){if(h[y]===wr&&(h[C]===wr||C===h.byteLength)){switch(x=h.subarray(y,C),q=yt.ts.parseType(x,m.pid),q){case"pes":z=yt.ts.parsePesType(x,m.table),Q=yt.ts.parsePayloadUnitStartIndicator(x),z==="audio"&&Q&&(Z=yt.ts.parsePesTime(x),Z&&(Z.type="audio",_.audio.push(Z),he=!0));break}if(he)break;y+=Ni,C+=Ni;continue}y++,C++}for(C=h.byteLength,y=C-Ni,he=!1;y>=0;){if(h[y]===wr&&(h[C]===wr||C===h.byteLength)){switch(x=h.subarray(y,C),q=yt.ts.parseType(x,m.pid),q){case"pes":z=yt.ts.parsePesType(x,m.table),Q=yt.ts.parsePayloadUnitStartIndicator(x),z==="audio"&&Q&&(Z=yt.ts.parsePesTime(x),Z&&(Z.type="audio",_.audio.push(Z),he=!0));break}if(he)break;y-=Ni,C-=Ni;continue}y--,C--}},jC=function(h,m,_){for(var y=0,C=Ni,x,q,z,Q,Z,he,be,Ue,Ee=!1,Ge={data:[],size:0};C<h.byteLength;){if(h[y]===wr&&h[C]===wr){switch(x=h.subarray(y,C),q=yt.ts.parseType(x,m.pid),q){case"pes":if(z=yt.ts.parsePesType(x,m.table),Q=yt.ts.parsePayloadUnitStartIndicator(x),z==="video"&&(Q&&!Ee&&(Z=yt.ts.parsePesTime(x),Z&&(Z.type="video",_.video.push(Z),Ee=!0)),!_.firstKeyFrame)){if(Q&&Ge.size!==0){for(he=new Uint8Array(Ge.size),be=0;Ge.data.length;)Ue=Ge.data.shift(),he.set(Ue,be),be+=Ue.byteLength;if(yt.ts.videoPacketContainsKeyFrame(he)){var ht=yt.ts.parsePesTime(he);ht?(_.firstKeyFrame=ht,_.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.")}Ge.size=0}Ge.data.push(x),Ge.size+=x.byteLength}break}if(Ee&&_.firstKeyFrame)break;y+=Ni,C+=Ni;continue}y++,C++}for(C=h.byteLength,y=C-Ni,Ee=!1;y>=0;){if(h[y]===wr&&h[C]===wr){switch(x=h.subarray(y,C),q=yt.ts.parseType(x,m.pid),q){case"pes":z=yt.ts.parsePesType(x,m.table),Q=yt.ts.parsePayloadUnitStartIndicator(x),z==="video"&&Q&&(Z=yt.ts.parsePesTime(x),Z&&(Z.type="video",_.video.push(Z),Ee=!0));break}if(Ee)break;y-=Ni,C-=Ni;continue}y--,C--}},HC=function(h,m){if(h.audio&&h.audio.length){var _=m;(typeof _>"u"||isNaN(_))&&(_=h.audio[0].dts),h.audio.forEach(function(x){x.dts=Er(x.dts,_),x.pts=Er(x.pts,_),x.dtsTime=x.dts/kn,x.ptsTime=x.pts/kn})}if(h.video&&h.video.length){var y=m;if((typeof y>"u"||isNaN(y))&&(y=h.video[0].dts),h.video.forEach(function(x){x.dts=Er(x.dts,y),x.pts=Er(x.pts,y),x.dtsTime=x.dts/kn,x.ptsTime=x.pts/kn}),h.firstKeyFrame){var C=h.firstKeyFrame;C.dts=Er(C.dts,y),C.pts=Er(C.pts,y),C.dtsTime=C.dts/kn,C.ptsTime=C.pts/kn}}},VC=function(h){for(var m=!1,_=0,y=null,C=null,x=0,q=0,z;h.length-q>=3;){var Q=yt.aac.parseType(h,q);switch(Q){case"timed-metadata":if(h.length-q<10){m=!0;break}if(x=yt.aac.parseId3TagSize(h,q),x>h.length){m=!0;break}C===null&&(z=h.subarray(q,q+x),C=yt.aac.parseAacTimestamp(z)),q+=x;break;case"audio":if(h.length-q<7){m=!0;break}if(x=yt.aac.parseAdtsSize(h,q),x>h.length){m=!0;break}y===null&&(z=h.subarray(q,q+x),y=yt.aac.parseSampleRate(z)),_++,q+=x;break;default:q++;break}if(m)return null}if(y===null||C===null)return null;var Z=kn/y,he={audio:[{type:"audio",dts:C,pts:C},{type:"audio",dts:C+_*1024*Z,pts:C+_*1024*Z}]};return he},qC=function(h){var m={pid:null,table:null},_={};yu(h,m);for(var y in m.table)if(m.table.hasOwnProperty(y)){var C=m.table[y];switch(C){case ja.H264_STREAM_TYPE:_.video=[],jC(h,m,_),_.video.length===0&&delete _.video;break;case ja.ADTS_STREAM_TYPE:_.audio=[],Yg(h,m,_),_.audio.length===0&&delete _.audio;break}}return _},zC=function(h,m){var _=yt.aac.isLikelyAacData(h),y;return _?y=VC(h):y=qC(h),!y||!y.audio&&!y.video?null:(HC(y,m),y)},WC={inspect:zC,parseAudioPes_:Yg};const GC=function(h,m){m.on("data",function(_){const y=_.initSegment;_.initSegment={data:y.buffer,byteOffset:y.byteOffset,byteLength:y.byteLength};const C=_.data;_.data=C.buffer,h.postMessage({action:"data",segment:_,byteOffset:C.byteOffset,byteLength:C.byteLength},[_.data])}),m.on("done",function(_){h.postMessage({action:"done"})}),m.on("gopInfo",function(_){h.postMessage({action:"gopInfo",gopInfo:_})}),m.on("videoSegmentTimingInfo",function(_){const y={start:{decode:_t.videoTsToSeconds(_.start.dts),presentation:_t.videoTsToSeconds(_.start.pts)},end:{decode:_t.videoTsToSeconds(_.end.dts),presentation:_t.videoTsToSeconds(_.end.pts)},baseMediaDecodeTime:_t.videoTsToSeconds(_.baseMediaDecodeTime)};_.prependedContentDuration&&(y.prependedContentDuration=_t.videoTsToSeconds(_.prependedContentDuration)),h.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:y})}),m.on("audioSegmentTimingInfo",function(_){const y={start:{decode:_t.videoTsToSeconds(_.start.dts),presentation:_t.videoTsToSeconds(_.start.pts)},end:{decode:_t.videoTsToSeconds(_.end.dts),presentation:_t.videoTsToSeconds(_.end.pts)},baseMediaDecodeTime:_t.videoTsToSeconds(_.baseMediaDecodeTime)};_.prependedContentDuration&&(y.prependedContentDuration=_t.videoTsToSeconds(_.prependedContentDuration)),h.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:y})}),m.on("id3Frame",function(_){h.postMessage({action:"id3Frame",id3Frame:_})}),m.on("caption",function(_){h.postMessage({action:"caption",caption:_})}),m.on("trackinfo",function(_){h.postMessage({action:"trackinfo",trackInfo:_})}),m.on("audioTimingInfo",function(_){h.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:_t.videoTsToSeconds(_.start),end:_t.videoTsToSeconds(_.end)}})}),m.on("videoTimingInfo",function(_){h.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:_t.videoTsToSeconds(_.start),end:_t.videoTsToSeconds(_.end)}})}),m.on("log",function(_){h.postMessage({action:"log",log:_})})};class Qg{constructor(m,_){this.options=_||{},this.self=m,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new wo.Transmuxer(this.options),GC(this.self,this.transmuxer)}pushMp4Captions(m){this.captionParser||(this.captionParser=new bt,this.captionParser.init());const _=new Uint8Array(m.data,m.byteOffset,m.byteLength),y=this.captionParser.parse(_,m.trackIds,m.timescales);this.self.postMessage({action:"mp4Captions",captions:y&&y.captions||[],logs:y&&y.logs||[],data:_.buffer},[_.buffer])}initMp4WebVttParser(m){this.webVttParser||(this.webVttParser=new Ze);const _=new Uint8Array(m.data,m.byteOffset,m.byteLength);this.webVttParser.init(_)}getMp4WebVttText(m){this.webVttParser||(this.webVttParser=new Ze);const _=new Uint8Array(m.data,m.byteOffset,m.byteLength),y=this.webVttParser.parseSegment(_);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:y||[],data:_.buffer},[_.buffer])}probeMp4StartTime({timescales:m,data:_}){const y=ar.startTime(m,_);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:_},[_.buffer])}probeMp4Tracks({data:m}){const _=ar.tracks(m);this.self.postMessage({action:"probeMp4Tracks",tracks:_,data:m},[m.buffer])}probeEmsgID3({data:m,offset:_}){const y=ar.getEmsgID3(m,_);this.self.postMessage({action:"probeEmsgID3",id3Frames:y,emsgData:m},[m.buffer])}probeTs({data:m,baseStartTime:_}){const y=typeof _=="number"&&!isNaN(_)?_*_t.ONE_SECOND_IN_TS:void 0,C=WC.inspect(m,y);let x=null;C&&(x={hasVideo:C.video&&C.video.length===2||!1,hasAudio:C.audio&&C.audio.length===2||!1},x.hasVideo&&(x.videoStart=C.video[0].ptsTime),x.hasAudio&&(x.audioStart=C.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:x,data:m},[m.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(m){const _=new Uint8Array(m.data,m.byteOffset,m.byteLength);this.transmuxer.push(_)}reset(){this.transmuxer.reset()}setTimestampOffset(m){const _=m.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(_t.secondsToVideoTs(_)))}setAudioAppendStart(m){this.transmuxer.setAudioAppendStart(Math.ceil(_t.secondsToVideoTs(m.appendStart)))}setRemux(m){this.transmuxer.setRemux(m.remux)}flush(m){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(m){this.transmuxer.alignGopsWith(m.gopsToAlignWith.slice())}}self.onmessage=function(h){if(h.data.action==="init"&&h.data.options){this.messageHandlers=new Qg(self,h.data.options);return}this.messageHandlers||(this.messageHandlers=new Qg(self)),h.data&&h.data.action&&h.data.action!=="init"&&this.messageHandlers[h.data.action]&&this.messageHandlers[h.data.action](h.data)}}));var vN=y1(gN);const yN=(s,e,t)=>{const{type:r,initSegment:i,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const c=s.data.segment.boxes||{data:s.data.segment.data},d={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};typeof l<"u"&&(d.videoFrameDtsTime=l),typeof u<"u"&&(d.videoFramePtsTime=u),t(d)},_N=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},TN=(s,e)=>{e.gopInfo=s.data.gopInfo},b1=s=>{const{transmuxer:e,bytes:t,audioAppendStart:r,gopsToAlignWith:i,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:d,onId3:f,onCaptions:g,onDone:E,onEndedTimeline:S,onTransmuxerLog:k,isEndOfTimeline:F,segment:L,triggerSegmentEventFn:W}=s,H={buffer:[]};let $=F;const G=Y=>{e.currentTransmux===s&&(Y.data.action==="data"&&yN(Y,H,a),Y.data.action==="trackinfo"&&o(Y.data.trackInfo),Y.data.action==="gopInfo"&&TN(Y,H),Y.data.action==="audioTimingInfo"&&l(Y.data.audioTimingInfo),Y.data.action==="videoTimingInfo"&&u(Y.data.videoTimingInfo),Y.data.action==="videoSegmentTimingInfo"&&c(Y.data.videoSegmentTimingInfo),Y.data.action==="audioSegmentTimingInfo"&&d(Y.data.audioSegmentTimingInfo),Y.data.action==="id3Frame"&&f([Y.data.id3Frame],Y.data.id3Frame.dispatchType),Y.data.action==="caption"&&g(Y.data.caption),Y.data.action==="endedtimeline"&&($=!1,S()),Y.data.action==="log"&&k(Y.data.log),Y.data.type==="transmuxed"&&($||(e.onmessage=null,_N({transmuxedData:H,callback:E}),S1(e))))},K=()=>{const Y={message:"Received an error message from the transmuxer worker",metadata:{errorType:B.Error.StreamingFailedToTransmuxSegment,segmentInfo:Xa({segment:L})}};E(null,Y)};if(e.onmessage=G,e.onerror=K,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const Y=t instanceof ArrayBuffer?t:t.buffer,P=t instanceof ArrayBuffer?0:t.byteOffset;W({type:"segmenttransmuxingstart",segment:L}),e.postMessage({action:"push",data:Y,byteOffset:P,byteLength:t.byteLength},[Y])}F&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},S1=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():b1(s.currentTransmux))},Sy=(s,e)=>{s.postMessage({action:e}),S1(s)},C1=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,Sy(e,s);return}e.transmuxQueue.push(Sy.bind(null,e,s))},bN=s=>{C1("reset",s)},SN=s=>{C1("endTimeline",s)},E1=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,b1(s);return}s.transmuxer.transmuxQueue.push(s)},CN=s=>{const e=new vN;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:s}),e};var Sf={reset:bN,endTimeline:SN,transmux:E1,createTransmuxer:CN};const tl=function(s){const e=s.transmuxer,t=s.endAction||s.action,r=s.callback,i=jt({},s,{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,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),r(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;i.byteOffset=a?0:s.data.byteOffset,i.byteLength=s.data.byteLength;const o=[a?s.data:s.data.buffer];e.postMessage(i,o)}else e.postMessage(i)},cs={FAILURE:2,TIMEOUT:-101,ABORTED:-102},w1="wvtt",xp=s=>{s.forEach(e=>{e.abort()})},EN=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),wN=s=>{const e=s.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return r.bytesReceived=s.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Qm=(s,e)=>{const{requestType:t}=e,r=no({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:cs.TIMEOUT,xhr:e,metadata:r}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:cs.ABORTED,xhr:e,metadata:r}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:cs.FAILURE,xhr:e,metadata:r}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:cs.FAILURE,xhr:e,metadata:r}:null},Cy=(s,e,t,r)=>(i,n)=>{const a=n.response,o=Qm(i,n);if(o)return t(o,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:cs.FAILURE,xhr:n},s);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let d=0;d<e.length;d++)e[d].bytes=u;const c={uri:n.uri};return r({type:"segmentkeyloadcomplete",segment:s,keyInfo:c}),t(null,s)},kN=(s,e)=>{e===w1&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},AN=(s,e,t)=>{e===w1&&tl({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:r,mp4VttCues:i})=>{s.bytes=r,t(null,s,{mp4VttCues:i})}})},k1=(s,e)=>{const t=Tm(s.map.bytes);if(t!=="mp4"){const r=s.map.resolvedUri||s.map.uri,i=t||"unknown";return e({internal:!0,message:`Found unsupported ${i} container for initialization segment at URL: ${r}`,code:cs.FAILURE,metadata:{mediaType:i}})}tl({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:r,data:i})=>(s.map.bytes=i,r.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&kN(s,n.codec))}),e(null))})},xN=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(r,i)=>{const n=Qm(r,i);if(n)return e(n,s);const a=new Uint8Array(i.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,k1(s,function(o){if(o)return o.xhr=i,o.status=i.status,e(o,s);e(null,s)})},NN=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:r})=>(i,n)=>{const a=Qm(i,n);if(a)return e(a,s);r({type:"segmentloaded",segment:s});const o=t==="arraybuffer"||!n.responseText?n.response:pN(n.responseText.substring(s.lastReachedChar||0));return s.stats=EN(n),s.key?s.encryptedBytes=new Uint8Array(o):s.bytes=new Uint8Array(o),e(null,s)},DN=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{const E=s.map&&s.map.tracks||{},S=!!(E.audio&&E.video);let k=r.bind(null,s,"audio","start");const F=r.bind(null,s,"audio","end");let L=r.bind(null,s,"video","start");const W=r.bind(null,s,"video","end"),H=()=>E1({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:S,onData:$=>{$.type=$.type==="combined"?"video":$.type,c(s,$)},onTrackInfo:$=>{t&&(S&&($.isMuxed=!0),t(s,$))},onAudioTimingInfo:$=>{k&&typeof $.start<"u"&&(k($.start),k=null),F&&typeof $.end<"u"&&F($.end)},onVideoTimingInfo:$=>{L&&typeof $.start<"u"&&(L($.start),L=null),W&&typeof $.end<"u"&&W($.end)},onVideoSegmentTimingInfo:$=>{const G={pts:{start:$.start.presentation,end:$.end.presentation},dts:{start:$.start.decode,end:$.end.decode}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:G}),i($)},onAudioSegmentTimingInfo:$=>{const G={pts:{start:$.start.pts,end:$.end.pts},dts:{start:$.start.dts,end:$.end.dts}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:G}),n($)},onId3:($,G)=>{a(s,$,G)},onCaptions:$=>{o(s,[$])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:f,onDone:($,G)=>{d&&($.type=$.type==="combined"?"video":$.type,g({type:"segmenttransmuxingcomplete",segment:s}),d(G,s,$))},segment:s,triggerSegmentEventFn:g});tl({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:$=>{s.bytes=e=$.data;const G=$.result;G&&(t(s,{hasAudio:G.hasAudio,hasVideo:G.hasVideo,isMuxed:S}),t=null),H()}})},A1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let E=new Uint8Array(e);if(Qk(E)){s.isFmp4=!0;const{tracks:S}=s.map;if(S.text&&(!S.audio||!S.video)){c(s,{data:E,type:"text"}),AN(s,S.text.codec,d);return}const F={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&S.audio.codec!=="enca"&&(F.audioCodec=S.audio.codec),S.video&&S.video.codec&&S.video.codec!=="encv"&&(F.videoCodec=S.video.codec),S.video&&S.audio&&(F.isMuxed=!0),t(s,F);const L=(W,H)=>{c(s,{data:E,type:F.hasAudio&&!F.isMuxed?"audio":"video"}),H&&H.length&&a(s,H),W&&W.length&&o(s,W),d(null,s,{})};tl({action:"probeMp4StartTime",timescales:s.map.timescales,data:E,transmuxer:s.transmuxer,callback:({data:W,startTime:H})=>{e=W.buffer,s.bytes=E=W,F.hasAudio&&!F.isMuxed&&r(s,"audio","start",H),F.hasVideo&&r(s,"video","start",H),tl({action:"probeEmsgID3",data:E,transmuxer:s.transmuxer,offset:H,callback:({emsgData:$,id3Frames:G})=>{if(e=$.buffer,s.bytes=E=$,!S.video||!$.byteLength||!s.transmuxer){L(void 0,G);return}tl({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:E,timescales:s.map.timescales,trackIds:[S.video.id],callback:K=>{e=K.data.buffer,s.bytes=E=K.data,K.logs.forEach(function(Y){f(Pt(Y,{stream:"mp4CaptionParser"}))}),L(K.captions,G)}})}})}});return}if(!s.transmuxer){d(null,s,{});return}if(typeof s.container>"u"&&(s.container=Tm(E)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),d(null,s,{});return}DN({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})},x1=function({id:s,key:e,encryptedBytes:t,decryptionWorker:r,segment:i,doneFn:n},a){const o=u=>{if(u.data.source===s){r.removeEventListener("message",o);const c=u.data.decrypted;a(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};r.onerror=()=>{const u="An error occurred in the decryption worker",c=Xa({segment:i}),d={message:u,metadata:{error:new Error(u),errorType:B.Error.StreamingFailedToDecryptSegment,segmentInfo:c,keyInfo:{uri:i.key.resolvedUri||i.map.key.resolvedUri}}};n(d,i)},r.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(d1({source:s,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},IN=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{g({type:"segmentdecryptionstart"}),x1({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:d},E=>{e.bytes=E,g({type:"segmentdecryptioncomplete",segment:e}),A1({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})})},PN=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let E=0,S=!1;return(k,F)=>{if(!S){if(k)return S=!0,xp(s),d(k,F);if(E+=1,E===s.length){const L=function(){if(F.encryptedBytes)return IN({decryptionWorker:e,segment:F,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g});A1({segment:F,bytes:F.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:g})};if(F.endOfAllRequests=Date.now(),F.map&&F.map.encryptedBytes&&!F.map.bytes)return g({type:"segmentdecryptionstart",segment:F}),x1({decryptionWorker:e,id:F.requestId+"-init",encryptedBytes:F.map.encryptedBytes,key:F.map.key,segment:F,doneFn:d},W=>{F.map.bytes=W,g({type:"segmentdecryptioncomplete",segment:F}),k1(F,H=>{if(H)return xp(s),d(H,F);L()})});L()}}}},LN=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},ON=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>d=>{if(!d.target.aborted)return s.stats=Pt(s.stats,wN(d)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(d,s)},MN=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:r,abortFn:i,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:g,dataFn:E,doneFn:S,onTransmuxerLog:k,triggerSegmentEventFn:F})=>{const L=[],W=PN({activeXhrs:L,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:g,dataFn:E,doneFn:S,onTransmuxerLog:k,triggerSegmentEventFn:F});if(r.key&&!r.key.bytes){const Y=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&Y.push(r.map.key);const P=Pt(e,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),O=Cy(r,Y,W,F),ne={uri:r.key.resolvedUri};F({type:"segmentkeyloadstart",segment:r,keyInfo:ne});const te=s(P,O);L.push(te)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const te=Pt(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),re=Cy(r,[r.map.key],W,F),me={uri:r.map.key.resolvedUri};F({type:"segmentkeyloadstart",segment:r,keyInfo:me});const Se=s(te,re);L.push(Se)}const P=Pt(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:kp(r.map),requestType:"segment-media-initialization"}),O=xN({segment:r,finishProcessingFn:W,triggerSegmentEventFn:F});F({type:"segmentloadstart",segment:r});const ne=s(P,O);L.push(ne)}const H=Pt(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:kp(r),requestType:"segment"}),$=NN({segment:r,finishProcessingFn:W,responseType:H.responseType,triggerSegmentEventFn:F});F({type:"segmentloadstart",segment:r});const G=s(H,$);G.addEventListener("progress",ON({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:g,dataFn:E})),L.push(G);const K={};return L.forEach(Y=>{Y.addEventListener("loadend",LN({loadendState:K,abortFn:i}))}),()=>xp(L)},RN=pn("CodecUtils"),BN=function(s){const e=s.attributes||{};if(e.CODECS)return rs(e.CODECS)},N1=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},UN=(s,e)=>{if(!N1(s,e))return!0;const t=e.attributes||{},r=s.mediaGroups.AUDIO[t.AUDIO];for(const i in r)if(!r[i].uri&&!r[i].playlists)return!0;return!1},Dh=function(s){const e={};return s.forEach(({mediaType:t,type:r,details:i})=>{e[t]=e[t]||[],e[t].push(dT(`${r}${i}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){RN(`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},Ey=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},Gu=function(s,e){const t=e.attributes||{},r=Dh(BN(e)||[]);if(N1(s,e)&&!r.audio&&!UN(s,e)){const i=Dh(Ew(s,t.AUDIO)||[]);i.audio&&(r.audio=i.audio)}return r},Oc=pn("PlaylistSelector"),wy=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Ih=function(s,e){if(!s)return"";const t=N.getComputedStyle(s);return t?t[e]:""},il=function(s,e){const t=s.slice();s.sort(function(r,i){const n=e(r,i);return n===0?t.indexOf(r)-t.indexOf(i):n})},Jm=function(s,e){let t,r;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||N.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||N.Number.MAX_VALUE,t-r},FN=function(s,e){let t,r;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||N.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||N.Number.MAX_VALUE,t===r&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-r};let D1=function(s,e,t,r,i,n){if(!s)return;const a={bandwidth:e,width:t,height:r,limitRenditionByPlayerDimensions:i};let o=s.playlists;Dr.isAudioOnly(s)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map($=>{let G;const K=$.attributes&&$.attributes.RESOLUTION&&$.attributes.RESOLUTION.width,Y=$.attributes&&$.attributes.RESOLUTION&&$.attributes.RESOLUTION.height;return G=$.attributes&&$.attributes.BANDWIDTH,G=G||N.Number.MAX_VALUE,{bandwidth:G,width:K,height:Y,playlist:$}});il(l,($,G)=>$.bandwidth-G.bandwidth),l=l.filter($=>!Dr.isIncompatible($.playlist));let u=l.filter($=>Dr.isEnabled($.playlist));u.length||(u=l.filter($=>!Dr.isDisabled($.playlist)));const c=u.filter($=>$.bandwidth*Ui.BANDWIDTH_VARIANCE<e);let d=c[c.length-1];const f=c.filter($=>$.bandwidth===d.bandwidth)[0];if(i===!1){const $=f||u[0]||l[0];if($&&$.playlist){let G="sortedPlaylistReps";return f&&(G="bandwidthBestRep"),u[0]&&(G="enabledPlaylistReps"),Oc(`choosing ${wy($)} using ${G} with options`,a),$.playlist}return Oc("could not choose a playlist with options",a),null}const g=c.filter($=>$.width&&$.height);il(g,($,G)=>$.width-G.width);const E=g.filter($=>$.width===t&&$.height===r);d=E[E.length-1];const S=E.filter($=>$.bandwidth===d.bandwidth)[0];let k,F,L;S||(k=g.filter($=>$.width>t||$.height>r),F=k.filter($=>$.width===k[0].width&&$.height===k[0].height),d=F[F.length-1],L=F.filter($=>$.bandwidth===d.bandwidth)[0]);let W;if(n.leastPixelDiffSelector){const $=g.map(G=>(G.pixelDiff=Math.abs(G.width-t)+Math.abs(G.height-r),G));il($,(G,K)=>G.pixelDiff===K.pixelDiff?K.bandwidth-G.bandwidth:G.pixelDiff-K.pixelDiff),W=$[0]}const H=W||L||S||f||u[0]||l[0];if(H&&H.playlist){let $="sortedPlaylistReps";return W?$="leastPixelDiffRep":L?$="resolutionPlusOneRep":S?$="resolutionBestRep":f?$="bandwidthBestRep":u[0]&&($="enabledPlaylistReps"),Oc(`choosing ${wy(H)} using ${$} with options`,a),H.playlist}return Oc("could not choose a playlist with options",a),null};const ky=function(){let s=this.useDevicePixelRatio&&N.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),D1(this.playlists.main,this.systemBandwidth,parseInt(Ih(this.tech_.el(),"width"),10)*s,parseInt(Ih(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},$N=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&N.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),D1(this.playlists.main,e,parseInt(Ih(this.tech_.el(),"width"),10)*r,parseInt(Ih(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},jN=function(s){const{main:e,currentTime:t,bandwidth:r,duration:i,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=s,u=e.playlists.filter(E=>!Dr.isIncompatible(E));let c=u.filter(Dr.isEnabled);c.length||(c=u.filter(E=>!Dr.isDisabled(E)));const f=c.filter(Dr.hasAttribute.bind(null,"BANDWIDTH")).map(E=>{const k=l.getSyncPoint(E,i,o,t)?1:2,L=Dr.estimateSegmentRequestTime(n,r,E)*k-a;return{playlist:E,rebufferingImpact:L}}),g=f.filter(E=>E.rebufferingImpact<=0);return il(g,(E,S)=>Jm(S.playlist,E.playlist)),g.length?g[0]:(il(f,(E,S)=>E.rebufferingImpact-S.rebufferingImpact),f[0]||null)},HN=function(){const s=this.playlists.main.playlists.filter(Dr.isEnabled);return il(s,(t,r)=>Jm(t,r)),s.filter(t=>!!Gu(this.playlists.main,t).video)[0]||null},VN=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(r=>{t.set(r,e),e+=r.byteLength})),t};function I1(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const qN=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let r=t;/^cc708_/.test(t)&&(r="SERVICE"+t.split("_")[1]);const i=e.textTracks().getTrackById(r);if(i)s[t]=i;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const u=n[r];u&&(a=u.label,o=u.language,l=u.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:r,default:l,label:a,language:o},!1).track}}},zN=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const r=N.WebKitDataCue||N.VTTCue;e.forEach(i=>{const n=i.stream;i.content?i.content.forEach(a=>{const o=new r(i.startTime+t,i.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",s[n].addCue(o)}):s[n].addCue(new r(i.startTime+t,i.endTime+t,i.text))})},WN=function(s){Object.defineProperties(s.frame,{id:{get(){return B.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return B.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return B.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},GN=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:r})=>{if(!e)return;const i=N.WebKitDataCue||N.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(c=>{const d=c.cueTime+t;typeof d!="number"||N.isNaN(d)||d<0||!(d<1/0)||!c.frames||!c.frames.length||c.frames.forEach(f=>{const g=new i(d,d,f.value||f.url||f.data||"");g.frame=f,g.value=f,WN(g),n.addCue(g)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let c=0;c<a.length;c++)a[c]&&o.push(a[c]);const l=o.reduce((c,d)=>{const f=c[d.startTime]||[];return f.push(d),c[d.startTime]=f,c},{}),u=Object.keys(l).sort((c,d)=>Number(c)-Number(d));u.forEach((c,d)=>{const f=l[c],g=isFinite(r)?r:c,E=Number(u[d+1])||g;f.forEach(S=>{S.endTime=E})})},KN={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"},XN=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),YN=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const r=N.WebKitDataCue||N.VTTCue;e.forEach(i=>{for(const n of Object.keys(i)){if(XN.has(n))continue;const a=new r(i.startTime,i.endTime,"");a.id=i.id,a.type="com.apple.quicktime.HLS",a.value={key:KN[n],data:i[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}i.processDateRange()})},Ay=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,B.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},Uu=function(s,e,t){let r,i;if(t&&t.cues)for(r=t.cues.length;r--;)i=t.cues[r],i.startTime>=s&&i.endTime<=e&&t.removeCue(i)},QN=function(s){const e=s.cues;if(!e)return;const t={};for(let r=e.length-1;r>=0;r--){const i=e[r],n=`${i.startTime}-${i.endTime}-${i.text}`;t[n]?s.removeCue(i):t[n]=i}},JN=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const r=Math.ceil((e-t+3)*Qa.ONE_SECOND_IN_TS);let i;for(i=0;i<s.length&&!(s[i].pts>r);i++);return s.slice(i)},ZN=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const r=e[0].pts;let i=0;for(i;i<s.length&&!(s[i].pts>=r);i++);return s.slice(0,i).concat(e)},eD=(s,e,t,r)=>{const i=Math.ceil((e-r)*Qa.ONE_SECOND_IN_TS),n=Math.ceil((t-r)*Qa.ONE_SECOND_IN_TS),a=s.slice();let o=s.length;for(;o--&&!(s[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(s[l].pts<=i););return l=Math.max(l,0),a.splice(l,o-l+1),a},tD=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++){const n=t[i];if(n!==r[i]||s[n]!==e[n])return!1}return!0},iD=function(s,e,t){e=e||[];const r=[];let i=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(r.push(n),i+=a.duration,i>t))return n}return r.length===0?0:r[r.length-1]},xu=1,rD=500,xy=s=>typeof s=="number"&&isFinite(s),Mc=1/60,nD=(s,e,t)=>s!=="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,sD=(s,e,t)=>{let r=e-Ui.BACK_BUFFER_LENGTH;s.length&&(r=Math.max(r,s.start(0)));const i=e-t;return Math.min(i,r)},Oo=s=>{const{startOfSegment:e,duration:t,segment:r,part:i,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=s,d=o.length-1;let f="mediaIndex/partIndex increment";s.getMediaInfoForTime?f=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(f+=` with independent ${s.independent}`);const g=typeof u=="number",E=s.segment.uri?"segment":"pre-segment",S=g?Yb({preloadSegment:r})-1:0;return`${E} [${n+l}/${n+d}]`+(g?` part [${u}/${S}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(g?` part start/end [${i.start} => ${i.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${c}] selected by [${f}] playlist [${a}]`},Ny=s=>`${s}TimingInfo`,aD=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:r,overrideCheck:i})=>!i&&s===e?null:s<e?t:r.length?r.end(r.length-1):t,Np=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:r,audioDisabled:i})=>{if(e===t)return!1;if(r==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(r==="main"&&i){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},oD=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),r=e&&t,i=r&&e.to!==t.to;return!!(r&&e.from!==-1&&t.from!==-1&&i)},lD=s=>{s&&(s.pause(),s.resetEverything(),s.load())},uD=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},_a=s=>{const e=s.pendingSegment_;if(!e)return;if(Np({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&oD(s.timelineChangeController_)){if(uD(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}lD(s)}},cD=s=>{let e=0;return["video","audio"].forEach(function(t){const r=s[`${t}TimingInfo`];if(!r)return;const{start:i,end:n}=r;let a;typeof i=="bigint"||typeof n=="bigint"?a=N.BigInt(n)-N.BigInt(i):typeof i=="number"&&typeof n=="number"&&(a=n-i),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Dy=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+ls:!1,hD=(s,e)=>{if(e!=="hls")return null;const t=cD({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const r=s.playlist.targetDuration,i=Dy({segmentDuration:t,maxDuration:r*2}),n=Dy({segmentDuration:t,maxDuration:r}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${r}. 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 i||n?{severity:i?"warn":"info",message:a}:null},Xa=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),r=!!(e.map&&!e.map.bytes),i=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:i,duration:e.duration,isEncrypted:t,isMediaInitialization:r}};let Dp=class extends B.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_=pn(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():_a(this)}),this.sourceUpdater_.on("codecschange",r=>{this.trigger(jt({type:"codecschange"},r))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():_a(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",r=>{this.trigger(jt({type:"timelinechange"},r)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():_a(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():_a(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Sf.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_&&N.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);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,N.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_&&Sf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ji();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:r,isMuxed:i}=e;if(r&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const r=Nh(e);let i=this.initSegments_[r];return t&&!i&&e.bytes&&(this.initSegments_[r]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e}segmentKey(e,t=!1){if(!e)return null;const r=f1(e);let i=this.keyCache_[r];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[r]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(i||e).resolvedUri};return i&&(n.bytes=i.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)return;const r=this.playlist_,i=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(r&&(r.id?n=r.id:r.uri&&(n=r.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
|
|
260
|
+
currentTime: ${this.currentTime_()}
|
|
261
|
+
bufferedEnd: ${Tf(this.buffered_())}
|
|
262
|
+
`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.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-r.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 o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(N.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_&&Sf.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,r=()=>{},i=!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&&r()};(i||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(i||this.loaderType_==="main")&&(this.gopBuffer_=eD(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Uu(e,t,this.inbandTextTracks_[o]);Uu(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&N.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=N.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&N.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=N.setTimeout(this.monitorBufferTick_.bind(this),rD)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Xa({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_,r=this.partIndex){if(!t||!this.mediaSource_)return!1;const i=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!i||!i.parts||r+1===i.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Tf(e)||0,r=Gm(e,this.currentTime_()),i=!this.hasPlayed_()&&r>=1,n=r>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=iD(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const f=a[this.mediaIndex],g=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=f.end?f.end:t,f.parts&&f.parts[g+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=g+1):o.mediaIndex=this.mediaIndex+1}else{let f,g,E;const S=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
|
|
263
|
+
For TargetTime: ${S}.
|
|
264
|
+
CurrentTime: ${this.currentTime_()}
|
|
265
|
+
BufferedEnd: ${t}
|
|
266
|
+
Fetch At Buffer: ${this.fetchAtBuffer_}
|
|
267
|
+
`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const k=this.getSyncInfoFromMediaSequenceSync_(S);if(!k){const F="No sync info found while using media sequence sync";return this.error({message:F,metadata:{errorType:B.Error.StreamingFailedToSelectNextSegment,error:new Error(F)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${k.start} --> ${k.end})`),f=k.segmentIndex,g=k.partIndex,E=k.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const k=Dr.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:S,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});f=k.segmentIndex,g=k.partIndex,E=k.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${S}`:`currentTime ${S}`,o.mediaIndex=f,o.startOfSegment=E,o.partIndex=g,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let u=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,u=l.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&u&&!c&&!u.independent)if(o.partIndex===0){const f=a[o.mediaIndex-1],g=f.parts&&f.parts.length&&f.parts[f.parts.length-1];g&&g.independent&&(o.mediaIndex-=1,o.partIndex=f.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const d=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&d&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const r=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!r)return null;if(!r.isAppended)return r;const i=this.mediaSequenceSync_.getSyncInfoForTime(r.end);return i?(i.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),i):null}generateSegmentInfo_(e){const{independent:t,playlist:r,mediaIndex:i,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:u}=e,c=r.segments[i],d=typeof o=="number"&&c.parts[o],f={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||c.resolvedUri,mediaIndex:i,partIndex:d?o:null,isSyncRequest:a,startOfSegment:n,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:d&&d.duration||c.duration,segment:c,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},g=typeof l<"u"?l:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:g});const E=Tf(this.sourceUpdater_.audioBuffered());return typeof E=="number"&&(f.audioAppendStart=E-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(f.gopsToAlignWith=JN(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),f}timestampOffsetForSegment_(e){return aD(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_(),r=e.bandwidth,i=this.pendingSegment_.duration,n=Dr.estimateSegmentRequestTime(i,r,this.playlist_,e.bytesReceived),a=Ax(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=jN({main:this.vhs_.playlists.main,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=n-a-o.rebufferingImpact;let c=.5;a<=ls&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Ui.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Oo(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:r,hasVideo:i}=t,n={segmentInfo:Xa({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:r,hasVideo:i}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},tD(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_():_a(this))))}handleTimingInfo_(e,t,r,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Ny(t);n[a]=n[a]||{},n[a][r]=i,this.logger_(`timinginfo: ${t} - ${r} - ${i}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():_a(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 i=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 o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+i),o.endTime=Math.max(o.endTime,a.endTime+i),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:u}=n[a],c=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),qN(c,this.vhs_.tech_,a),Uu(o,l,c[a]),zN({captionArray:u,inbandTextTracks:c,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,r));return}this.addMetadataToTextTrack(r,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_()?!Np({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:r,hasVideo:i,isMuxed:n}=t;return!(i&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Np({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_()){_a(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[Ny(t.type)].start;else{const i=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&i&&i.hasVideo;let a;n&&(a=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,t.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=this.chooseNextRequest_();if(i.mediaIndex!==r.mediaIndex||i.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,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:r,playlist:i}){if(r){const n=Nh(r);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=i,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r},i){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ja(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ja(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,u=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=xu&&c-u<=xu){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${Ja(n).join(", ")}, video buffer: ${Ja(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:r}));const f=this.currentTime_()-xu;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${f}`),this.remove(0,f,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${xu}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=N.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},xu*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:r},i){if(i){if(i.code===o1){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error({message:`${t} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:B.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:r,data:i,bytes:n}){if(!n){const o=[i];let l=i.byteLength;r&&(o.unshift(r),l+=r.byteLength),n=VN({bytes:l,segments:o})}const a={segmentInfo:Xa({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,r){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const i=this.pendingSegment_.segment,n=`${e}TimingInfo`;i[n]||(i[n]={}),i[n].transmuxerPrependedSeconds=r.prependedContentDuration||0,i[n].transmuxedPresentationStart=r.start.presentation,i[n].transmuxedDecodeStart=r.start.decode,i[n].transmuxedPresentationEnd=r.end.presentation,i[n].transmuxedDecodeEnd=r.end.decode,i[n].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,t){const{type:r,data:i}=t;if(!i||!i.byteLength||r==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:r,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:n,data:i})}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_()){_a(this),this.loadQueue_.push(()=>{const t=jt({},e,{forceTimestampOffset:!0});jt(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),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=r||i&&n;this.logger_(`Requesting
|
|
268
|
+
${I1(e.uri)}
|
|
269
|
+
${Oo(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=MN({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:o,level:l,stream:u})=>{this.logger_(`${Oo(e)} logged from transmuxer stream ${u} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:u,trackInfo:c,timingInfo:d})=>{const g={segmentInfo:Xa({segment:l})};u&&(g.keyInfo=u),c&&(g.trackInfo=c),d&&(g.timingInfo=d),this.trigger({type:o,metadata:g})}})}trimBackBuffer_(e){const t=sD(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,r=e.part,i=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:r?r.resolvedUri:t.resolvedUri,byterange:r?r.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:i,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}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<Mc){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Mc}`);return}const r={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:r}),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,r){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,r));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===cs.ABORTED)return;if(this.pause(),e.code===cs.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=ZN(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}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:r,firstVideoFrameTimeForData:i,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!a)return l.start;const u=t.segments[r-1];return r===0||!u||typeof u.start>"u"||u.end!==i+n?i:o.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:r,hasVideo:i,isMuxed:n}=t,a=this.loaderType_==="main"&&i,o=!this.audioDisabled_&&r&&!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++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&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=nD(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:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end=typeof i.end=="number"?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:Xa({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}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=hD(e,this.sourceType_);if(t&&(t.severity==="warn"?B.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 ${Oo(e)}`);return}this.logger_(`Appended ${Oo(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 r=e.segment,i=e.part,n=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,a=i&&i.end&&this.currentTime_()-i.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Oo(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<Mc){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Mc}`);return}const t=this.throughput.rate,r=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/r*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,r=t.start,i=t.end;if(!xy(r)||!xy(i))return;Uu(r,i,this.segmentMetadataTrack_);const n=N.WebKitDataCue||N.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:r,end:i},o=JSON.stringify(a),l=new n(r,i,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}};function $s(){}const P1=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},dD=["video","audio"],Ip=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},fD=(s,e)=>{for(let t=0;t<e.length;t++){const r=e[t];if(r.type==="mediaSource")return null;if(r.type===s)return t}return null},rl=(s,e)=>{if(e.queue.length===0)return;let t=0,r=e.queue[t];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),rl("audio",e),rl("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Ip(s,e))){if(r.type!==s){if(t=fD(s,e.queue),t===null)return;r=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=r,r.action(s,e),!r.doneFn){e.queuePending[s]=null,rl(s,e);return}}},L1=(s,e)=>{const t=e[`${s}Buffer`],r=P1(s);t&&(t.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),t.removeEventListener("error",e[`on${r}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},ss=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Hr={appendBuffer:(s,e,t)=>(r,i)=>{const n=i[`${r}Buffer`];if(ss(i.mediaSource,n)){i.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${r}Buffer`);try{n.appendBuffer(s)}catch(a){i.logger_(`Error with code ${a.code} `+(a.code===o1?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,t(a)}}},remove:(s,e)=>(t,r)=>{const i=r[`${t}Buffer`];if(ss(r.mediaSource,i)){r.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{i.remove(s,e)}catch{r.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const r=t[`${e}Buffer`];ss(t.mediaSource,r)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),r.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){B.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){B.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(ss(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(r){B.log.warn(`Failed to abort on ${s}Buffer`,r)}}},addSourceBuffer:(s,e)=>t=>{const r=P1(s),i=ul(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(i);n.addEventListener("updateend",t[`on${r}UpdateEnd_`]),n.addEventListener("error",t[`on${r}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(L1(s,e),!!ss(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(r){B.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,r)}}},changeType:s=>(e,t)=>{const r=t[`${e}Buffer`],i=ul(s);if(!ss(t.mediaSource,r))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{r.changeType(i),t.codecs[e]=s}catch(u){l.errorType=B.Error.StreamingCodecsChangeError,l.error=u,u.metadata=l,t.error_=u,t.trigger("error"),B.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},Vr=({type:s,sourceUpdater:e,action:t,doneFn:r,name:i})=>{e.queue.push({type:s,action:t,doneFn:r,name:i}),rl(s,e)},Iy=(s,e)=>t=>{const r=e[`${s}Buffered`](),i=Ex(r);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}rl(s,e)};let O1=class extends B.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>rl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=pn("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Iy("video",this),this.onAudioUpdateEnd_=Iy("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){Vr({type:"mediaSource",sourceUpdater:this,action:Hr.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Vr({type:e,sourceUpdater:this,action:Hr.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){B.log.error("removeSourceBuffer is not supported!");return}Vr({type:"mediaSource",sourceUpdater:this,action:Hr.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!B.browser.IS_FIREFOX&&N.MediaSource&&N.MediaSource.prototype&&typeof N.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return N.SourceBuffer&&N.SourceBuffer.prototype&&typeof N.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){B.log.error("changeType is not supported!");return}Vr({type:e,sourceUpdater:this,action:Hr.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 r=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,r);this.canChangeType()&&this.changeType(t,r)})}appendBuffer(e,t){const{segmentInfo:r,type:i,bytes:n}=e;if(this.processedAppend_=!0,i==="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(Vr({type:i,sourceUpdater:this,action:Hr.appendBuffer(n,r||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),i==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return ss(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ji()}videoBuffered(){return ss(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ji()}buffered(){const e=ss(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=ss(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():kx(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=$s){Vr({type:"mediaSource",sourceUpdater:this,action:Hr.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=$s){typeof e!="string"&&(e=void 0),Vr({type:"mediaSource",sourceUpdater:this,action:Hr.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,r=$s){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}Vr({type:"audio",sourceUpdater:this,action:Hr.remove(e,t),doneFn:r,name:"remove"})}removeVideo(e,t,r=$s){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}Vr({type:"video",sourceUpdater:this,action:Hr.remove(e,t),doneFn:r,name:"remove"})}updating(){return!!(Ip("audio",this)||Ip("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Vr({type:"audio",sourceUpdater:this,action:Hr.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Vr({type:"video",sourceUpdater:this,action:Hr.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Vr({type:"audio",sourceUpdater:this,action:Hr.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Vr({type:"video",sourceUpdater:this,action:Hr.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),dD.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>L1(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const Py=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),pD=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Ly=new Uint8Array(`
|
|
270
|
+
|
|
271
|
+
`.split("").map(s=>s.charCodeAt(0)));let mD=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},gD=class extends Dp{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 ji();const e=this.subtitlesTrack_.cues,t=e[0].startTime,r=e[e.length-1].startTime;return ji([[t,r]])}initSegmentForMap(e,t=!1){if(!e)return null;const r=Nh(e);let i=this.initSegments_[r];if(t&&!i&&e.bytes){const n=Ly.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Ly,e.bytes.byteLength),this.initSegments_[r]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||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){Uu(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,r){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===cs.TIMEOUT&&this.handleTimeout_(),e.code===cs.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const i=this.pendingSegment_,n=r.mp4VttCues&&r.mp4VttCues.length;n&&(i.mp4VttCues=r.mp4VttCues),this.saveBandwidthRelatedStats_(i.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=i.segment;if(a.map&&(a.map.bytes=t.map.bytes),i.bytes=t.bytes,typeof N.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(i)}catch(o){this.stopForError({message:o.message,metadata:{errorType:B.Error.StreamingVttParserError,error:o}});return}if(n||this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,i.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new N.VTTCue(o.startTime,o.endTime,o.text):o)}),QN(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const r=e&&e.type==="vtt",i=t&&t.type==="text";r&&i&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(r=>{const i=r.start+t,n=r.end+t,a=new N.VTTCue(i,n,r.cueText);r.settings&&r.settings.split(" ").forEach(o=>{const l=o.split(":"),u=l[0],c=l[1];a[u]=isNaN(c)?c:Number(c)}),e.cues.push(a)})}parseVTTCues_(e){let t,r=!1;if(typeof N.WebVTT!="function")throw new mD;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof N.TextDecoder=="function"?t=new N.TextDecoder("utf8"):(t=N.WebVTT.StringDecoder(),r=!0);const i=new N.WebVTT.Parser(N,N.vttjs,t);if(i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=a=>{e.timestampmap=a},i.onparsingerror=a=>{B.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;r&&(a=Py(a)),i.parse(a)}let n=e.bytes;r&&(n=Py(n)),i.parse(n),i.flush()}updateTimeMapping_(e,t,r){const i=e.segment;if(!t)return;if(!e.cues.length){i.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/Qa.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const c=u.endTime-u.startTime,d=this.handleRollover_(u.startTime+l,t.time);u.startTime=Math.max(d,0),u.endTime=Math.max(d+c,0)}),!r.syncInfo){const u=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(u,c-i.duration)}}}handleRollover_(e,t){if(t===null)return e;let r=e*Qa.ONE_SECOND_IN_TS;const i=t*Qa.ONE_SECOND_IN_TS;let n;for(i<r?n=-8589934592:n=8589934592;Math.abs(r-i)>4294967296;)r+=n;return r/Qa.ONE_SECOND_IN_TS}};const vD=function(s,e){const t=s.cues;for(let r=0;r<t.length;r++){const i=t[r];if(e>=i.adStartTime&&e<=i.adEndTime)return i}return null},yD=function(s,e,t=0){if(!s.segments)return;let r=t,i;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(i||(i=vD(e,r+a.duration/2)),i){if("cueIn"in a){i.endTime=r,i.adEndTime=r,r+=a.duration,i=null;continue}if(r<i.endTime){r+=a.duration;continue}i.endTime+=a.duration}else if("cueOut"in a&&(i=new N.VTTCue(r,r+a.duration,a.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(a.cueOut),e.addCue(i)),"cueOutCont"in a){const[o,l]=a.cueOutCont.split("/").map(parseFloat);i=new N.VTTCue(r,r+a.duration,""),i.adStartTime=r-o,i.adEndTime=i.adStartTime+l,e.addCue(i)}r+=a.duration}};class Oy{constructor({start:e,end:t,segmentIndex:r,partIndex:i=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=r,this.partIndex_=i,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 _D{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 M1{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:r,segments:i}=e;if(this.isReliable_=this.isReliablePlaylist_(r,i),!!this.isReliable_)return this.updateStorage_(i,r,this.calculateBaseTime_(r,i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:r}of this.storage_.values())if(r.length){for(const i of r)if(i.isInRange(e))return i}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,r){const i=new Map;let n=`
|
|
272
|
+
`,a=r,o=t;this.start_=a,e.forEach((l,u)=>{const c=this.storage_.get(o),d=a,f=d+l.duration,g=!!(c&&c.segmentSyncInfo&&c.segmentSyncInfo.isAppended),E=new Oy({start:d,end:f,appended:g,segmentIndex:u});l.syncInfo=E;let S=a;const k=(l.parts||[]).map((F,L)=>{const W=S,H=S+F.duration,$=!!(c&&c.partsSyncInfo&&c.partsSyncInfo[L]&&c.partsSyncInfo[L].isAppended),G=new Oy({start:W,end:H,appended:$,segmentIndex:u,partIndex:L});return S=H,n+=`Media Sequence: ${o}.${L} | Range: ${W} --> ${H} | Appended: ${$}
|
|
273
|
+
`,F.syncInfo=G,G});i.set(o,new _D(E,k)),n+=`${I1(l.resolvedUri)} | Media Sequence: ${o} | Range: ${d} --> ${f} | Appended: ${g}
|
|
274
|
+
`,o++,a=f}),this.end_=a,this.storage_=i,this.diagnostics_=n}calculateBaseTime_(e,t,r){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(e<i){const n=i-e;let a=this.storage_.get(i).segmentSyncInfo.start;for(let o=0;o<n;o++){const l=t[o];a-=l.duration}return a}return r}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class My extends M1{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,r){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,r)}}const TD=86400,Cf=[{name:"VOD",run:(s,e,t,r,i)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,r,i,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(i);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,r,i)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=bp(e);i=i||0;for(let l=0;l<o.length;l++){const u=e.endList||i===0?l:o.length-(l+1),c=o[u],d=c.segment,f=s.timelineToDatetimeMappings[d.timeline];if(!f||!d.dateTimeObject)continue;let E=d.dateTimeObject.getTime()/1e3+f;if(d.parts&&typeof c.partIndex=="number")for(let k=0;k<c.partIndex;k++)E+=d.parts[k].duration;const S=Math.abs(i-E);if(a!==null&&(S===0||a<S))break;a=S,n={time:E,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return n}},{name:"Segment",run:(s,e,t,r,i)=>{let n=null,a=null;i=i||0;const o=bp(e);for(let l=0;l<o.length;l++){const u=e.endList||i===0?l:o.length-(l+1),c=o[u],d=c.segment,f=c.part&&c.part.start||d&&d.start;if(d.timeline===r&&typeof f<"u"){const g=Math.abs(i-f);if(a!==null&&a<g)break;(!n||a===null||a>=g)&&(a=g,n={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,r,i)=>{let n=null;if(i=i||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const l=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,c=s.discontinuities[u];if(c){const d=Math.abs(i-c.time);if(a!==null&&a<d)break;(!n||a===null||a>=d)&&(a=d,n={time:c.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,r,i)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];let bD=class extends B.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new M1,r=new My(t),i=new My(t);this.mediaSequenceStorage_={main:t,audio:r,vtt:i},this.logger_=pn("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,r,i,n){if(t!==1/0)return Cf.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,r,i,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:u}=o,{segmentIndex:c,time:d}=l;if(c<0)continue;const f=e.segments[c],g=d,E=g+f.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${c}. Time: [${g} -> ${E}]}`),i>=g&&i<E)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:i})}getExpiredTime(e,t){if(!e||!e.segments)return null;const r=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!r.length)return null;const i=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+Wu({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(e,t,r,i,n){const a=[];for(let o=0;o<Cf.length;o++){const l=Cf[o],u=l.run(this,e,t,r,i,n);u&&(u.strategy=l.name,a.push({strategy:l.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let r=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<i&&(i=o,r=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,t){const r=t.mediaSequence-e.mediaSequence;if(r>TD){B.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let i=r-1;i>=0;i--){const n=e.segments[i];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+i,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],r=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),i=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:i.start}));const n=i.dateTimeObject;i.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[i.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,r){const i=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},r&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!i.start||o<i.start)&&(i.start=o),i.end=l,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let i=0;i<t.discontinuityStarts.length;i++){const n=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>l){let u;o<0?u=r.start-Wu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):u=r.end+Wu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:u,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}},SD=class extends B.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:r}){return typeof t=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:r}){if(typeof t=="number"&&typeof r=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:r},delete this.pendingTimelineChanges_[e];const i={timelineChangeInfo:{from:t,to:r}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}};const CD=_1(T1(function(){var s=(function(){function S(){this.listeners={}}var k=S.prototype;return k.on=function(L,W){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(W)},k.off=function(L,W){if(!this.listeners[L])return!1;var H=this.listeners[L].indexOf(W);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(H,1),H>-1},k.trigger=function(L){var W=this.listeners[L];if(W)if(arguments.length===2)for(var H=W.length,$=0;$<H;++$)W[$].call(this,arguments[1]);else for(var G=Array.prototype.slice.call(arguments,1),K=W.length,Y=0;Y<K;++Y)W[Y].apply(this,G)},k.dispose=function(){this.listeners={}},k.pipe=function(L){this.on("data",function(W){L.push(W)})},S})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(S){return S.subarray(0,S.byteLength-S[S.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const S=[[[],[],[],[],[]],[[],[],[],[],[]]],k=S[0],F=S[1],L=k[4],W=F[4];let H,$,G;const K=[],Y=[];let P,O,ne,te,re,me;for(H=0;H<256;H++)Y[(K[H]=H<<1^(H>>7)*283)^H]=H;for($=G=0;!L[$];$^=P||1,G=Y[G]||1)for(te=G^G<<1^G<<2^G<<3^G<<4,te=te>>8^te&255^99,L[$]=te,W[te]=$,ne=K[O=K[P=K[$]]],me=ne*16843009^O*65537^P*257^$*16843008,re=K[te]*257^te*16843008,H=0;H<4;H++)k[H][$]=re=re<<24^re>>>8,F[H][te]=me=me<<24^me>>>8;for(H=0;H<5;H++)k[H]=k[H].slice(0),F[H]=F[H].slice(0);return S};let r=null;class i{constructor(k){r||(r=t()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let F,L,W;const H=this._tables[0][4],$=this._tables[1],G=k.length;let K=1;if(G!==4&&G!==6&&G!==8)throw new Error("Invalid aes key size");const Y=k.slice(0),P=[];for(this._key=[Y,P],F=G;F<4*G+28;F++)W=Y[F-1],(F%G===0||G===8&&F%G===4)&&(W=H[W>>>24]<<24^H[W>>16&255]<<16^H[W>>8&255]<<8^H[W&255],F%G===0&&(W=W<<8^W>>>24^K<<24,K=K<<1^(K>>7)*283)),Y[F]=Y[F-G]^W;for(L=0;F;L++,F--)W=Y[L&3?F:F-4],F<=4||L<4?P[L]=W:P[L]=$[0][H[W>>>24]]^$[1][H[W>>16&255]]^$[2][H[W>>8&255]]^$[3][H[W&255]]}decrypt(k,F,L,W,H,$){const G=this._key[1];let K=k^G[0],Y=W^G[1],P=L^G[2],O=F^G[3],ne,te,re;const me=G.length/4-2;let Se,Ae=4;const ve=this._tables[1],Te=ve[0],ye=ve[1],_e=ve[2],xe=ve[3],qe=ve[4];for(Se=0;Se<me;Se++)ne=Te[K>>>24]^ye[Y>>16&255]^_e[P>>8&255]^xe[O&255]^G[Ae],te=Te[Y>>>24]^ye[P>>16&255]^_e[O>>8&255]^xe[K&255]^G[Ae+1],re=Te[P>>>24]^ye[O>>16&255]^_e[K>>8&255]^xe[Y&255]^G[Ae+2],O=Te[O>>>24]^ye[K>>16&255]^_e[Y>>8&255]^xe[P&255]^G[Ae+3],Ae+=4,K=ne,Y=te,P=re;for(Se=0;Se<4;Se++)H[(3&-Se)+$]=qe[K>>>24]<<24^qe[Y>>16&255]<<16^qe[P>>8&255]<<8^qe[O&255]^G[Ae++],ne=K,K=Y,Y=P,P=O,O=ne}}class n extends s{constructor(){super(s),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(k){this.jobs.push(k),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(S){return S<<24|(S&65280)<<8|(S&16711680)>>8|S>>>24},o=function(S,k,F){const L=new Int32Array(S.buffer,S.byteOffset,S.byteLength>>2),W=new i(Array.prototype.slice.call(k)),H=new Uint8Array(S.byteLength),$=new Int32Array(H.buffer);let G,K,Y,P,O,ne,te,re,me;for(G=F[0],K=F[1],Y=F[2],P=F[3],me=0;me<L.length;me+=4)O=a(L[me]),ne=a(L[me+1]),te=a(L[me+2]),re=a(L[me+3]),W.decrypt(O,ne,te,re,$,me),$[me]=a($[me]^G),$[me+1]=a($[me+1]^K),$[me+2]=a($[me+2]^Y),$[me+3]=a($[me+3]^P),G=O,K=ne,Y=te,P=re;return H};class l{constructor(k,F,L,W){const H=l.STEP,$=new Int32Array(k.buffer),G=new Uint8Array(k.byteLength);let K=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_($.subarray(K,K+H),F,L,G)),K=H;K<$.length;K+=H)L=new Uint32Array([a($[K-4]),a($[K-3]),a($[K-2]),a($[K-1])]),this.asyncStream_.push(this.decryptChunk_($.subarray(K,K+H),F,L,G));this.asyncStream_.push(function(){W(null,e(G))})}static get STEP(){return 32e3}decryptChunk_(k,F,L,W){return function(){const H=o(k,F,L);W.set(H,k.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c;typeof window<"u"?c=window:typeof u<"u"?c=u:typeof self<"u"?c=self:c={};var d=c,f=function(k){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(k):k&&k.buffer instanceof ArrayBuffer},g=d.BigInt||Number;g("0x1"),g("0x100"),g("0x10000"),g("0x1000000"),g("0x100000000"),g("0x10000000000"),g("0x1000000000000"),g("0x100000000000000"),g("0x10000000000000000"),(function(){var S=new Uint16Array([65484]),k=new Uint8Array(S.buffer,S.byteOffset,S.byteLength);return k[0]===255?"big":k[0]===204?"little":"unknown"})();const E=function(S){const k={};return Object.keys(S).forEach(F=>{const L=S[F];f(L)?k[F]={bytes:L.buffer,byteOffset:L.byteOffset,byteLength:L.byteLength}:k[F]=L}),k};self.onmessage=function(S){const k=S.data,F=new Uint8Array(k.encrypted.bytes,k.encrypted.byteOffset,k.encrypted.byteLength),L=new Uint32Array(k.key.bytes,k.key.byteOffset,k.key.byteLength/4),W=new Uint32Array(k.iv.bytes,k.iv.byteOffset,k.iv.byteLength/4);new l(F,L,W,function(H,$){self.postMessage(E({source:k.source,decrypted:$}),[$.buffer])})}}));var ED=y1(CD);const wD=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},R1=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Pp=(s,e)=>{e.activePlaylistLoader=s,s.load()},kD=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:r},mediaTypes:{[s]:i}}=e,n=i.activeTrack(),a=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;if(!(a&&l&&a.id===l.id)&&(i.lastGroup_=a,i.lastTrack_=n,R1(t,i),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&r.resetEverything();return}t.resyncLoader(),Pp(a.playlistLoader,i)}},AD=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:r}}=e;r.lastGroup_=null,t.abort(),t.pause()},xD=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:r,main:i},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if(!(u&&a&&u.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,R1(r,n),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const c=e.vhs.playlistController_,d=c.selectPlaylist();if(c.media()===d)return;n.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),i.resetEverything(),c.fastQualityChange_(d);return}if(s==="AUDIO"){if(!o.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}if(l===o.playlistLoader){Pp(o.playlistLoader,n);return}r.track&&r.track(a),r.resetEverything(),Pp(o.playlistLoader,n)}},Ph={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:r}=e,i=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(i===o){r({error:{message:"Problem encountered loading the default audio track."}});return}B.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;B.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=t.activeTrack();r&&(r.mode="disabled"),t.onTrackChanged()}},Ry={AUDIO:(s,e,t)=>{if(!e)return;const{tech:r,requestOptions:i,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,i),(!r.paused()||a.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),i),r.paused()||n.load()}),e.on("error",Ph[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:r,requestOptions:i,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,i),n.track(a.activeTrack()),(!r.paused()||o.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),i),r.paused()||n.load()}),e.on("error",Ph[s](s,t))}},ND={AUDIO:(s,e)=>{const{vhs:t,sourceType:r,segmentLoaders:{[s]:i},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=e,d=gc(c.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},d&&(a[s].main.default.playlists=c.main.playlists));for(const f in a[s]){o[f]||(o[f]=[]);for(const g in a[s][f]){let E=a[s][f][g],S;if(d?(u(`AUDIO group '${f}' label '${g}' is a main playlist`),E.isMainPlaylist=!0,S=null):r==="vhs-json"&&E.playlists?S=new zo(E.playlists[0],t,n):E.resolvedUri?S=new zo(E.resolvedUri,t,n):E.playlists&&r==="dash"?S=new Ap(E.playlists[0],t,n,c):S=null,E=Pt({id:g,playlistLoader:S},E),Ry[s](s,E.playlistLoader,e),o[f].push(E),typeof l[g]>"u"){const k=new B.AudioTrack({id:g,kind:wD(E),enabled:!1,language:E.language,default:E.default,label:g});l[g]=k}}}i.on("error",Ph[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:r,sourceType:i,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[s]:{groups:l,tracks:u}},mainPlaylistLoader:c}=e;for(const d in o[s]){l[d]||(l[d]=[]);for(const f in o[s][d]){if(!r.options_.useForcedSubtitles&&o[s][d][f].forced)continue;let g=o[s][d][f],E;if(i==="hls")E=new zo(g.resolvedUri,r,a);else if(i==="dash"){if(!g.playlists.filter(k=>k.excludeUntil!==1/0).length)return;E=new Ap(g.playlists[0],r,a,c)}else i==="vhs-json"&&(E=new zo(g.playlists?g.playlists[0]:g.resolvedUri,r,a));if(g=Pt({id:f,playlistLoader:E},g),Ry[s](s,g.playlistLoader,e),l[d].push(g),typeof u[f]>"u"){const S=t.addRemoteTextTrack({id:f,kind:"subtitles",default:g.default&&g.autoselect,language:g.language,label:f},!1).track;u[f]=S}}}n.on("error",Ph[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:r},mediaTypes:{[s]:{groups:i,tracks:n}}}=e;for(const a in r[s]){i[a]||(i[a]=[]);for(const o in r[s][a]){const l=r[s][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let c={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(u[c.instreamId]&&(c=Pt(c,u[c.instreamId])),c.default===void 0&&delete c.default,i[a].push(Pt({id:o},l)),typeof n[o]>"u"){const d=t.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;n[o]=d}}}}},B1=(s,e)=>{for(let t=0;t<s.length;t++)if(Ym(e,s[t])||s[t].playlists&&B1(s[t].playlists,e))return!0;return!1},DD=(s,e)=>t=>{const{mainPlaylistLoader:r,mediaTypes:{[s]:{groups:i}}}=e,n=r.media();if(!n)return null;let a=null;n.attributes[s]&&(a=i[n.attributes[s]]);const o=Object.keys(i);if(!a)if(s==="AUDIO"&&o.length>1&&gc(e.main))for(let l=0;l<o.length;l++){const u=i[o[l]];if(B1(u,n)){a=u;break}}else i.main?a=i.main:o.length===1&&(a=i[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},ID={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const r in t)if(t[r].enabled)return t[r];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const r in t)if(t[r].mode==="showing"||t[r].mode==="hidden")return t[r];return null}},PD=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},LD=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{ND[u](u,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:r,vhs:i,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=DD(u,s),e[u].activeTrack=ID[u](u,s),e[u].onGroupChanged=kD(u,s),e[u].onGroupChanging=AD(u,s),e[u].onTrackChanged=xD(u,s),e[u].getActiveGroup=PD(u,s)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(d=>d.default)[0]||o[0]).id;e.AUDIO.tracks[u].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(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),i.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const u in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[u])},OD=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:$s,activeTrack:$s,getActiveGroup:$s,onGroupChanged:$s,onTrackChanged:$s,lastTrack_:null,logger_:pn(`MediaGroups[${e}]`)}}),s};class By{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_=Nr(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 MD extends B.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new By,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_=pn("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const r=t.serverUri||t.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=Nr(e,r),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 r=e?t:this.getRequestURI(t);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:r}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:r,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 ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const c={errorType:B.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:c})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new N.URL(e),r=new N.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const t=JSON.parse(N.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new N.URL(e),r=this.getPathway(),i=this.getBandwidth_();if(r){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,r)}if(i){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,i)}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 r=(i=>{for(const n of i)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const r=this.setSteeringParams_(e);return t(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=N.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){N.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 By}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&&(Nr(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const RD=10;let Ta;const BD=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],UD=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},FD=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return B.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${s&&s.id||"null"} -> ${r.id}`;if(!s)return l(`${u} as current playlist is not set`),!0;if(r.id===s.id)return!1;const c=!!qo(e,t).length;if(!s.endList)return!c&&typeof s.partTargetDuration=="number"?(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${u} as current playlist is live`),!0);const d=Gm(e,t),f=o?Ui.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ui.MAX_BUFFER_LOW_WATER_LINE;if(a<f)return l(`${u} as duration < max low water line (${a} < ${f})`),!0;const g=r.attributes.BANDWIDTH,E=s.attributes.BANDWIDTH;if(g<E&&(!o||d<n)){let S=`${u} as next bandwidth < current bandwidth (${g} < ${E})`;return o&&(S+=` and forwardBuffer < bufferHighWaterLine (${d} < ${n})`),l(S),!0}if((!o||g>E)&&d>=i){let S=`${u} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return o&&(S+=` and next bandwidth > current bandwidth (${g} > ${E})`),l(S),!0}return l(`not ${u} as no switching criteria met`),!1};class $D extends B.EventTarget{constructor(e){super();const{src:t,withCredentials:r,tech:i,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:d,bufferBasedABR:f,leastPixelDiffSelector:g,captionServices:E,experimentalUseMMS:S}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:k}=e;(k===null||typeof k>"u")&&(k=1/0),Ta=a,this.bufferBasedABR=!!f,this.leastPixelDiffSelector=!!g,this.withCredentials=r,this.tech_=i,this.vhs_=i.vhs,this.player_=e.player_,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=k,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:k,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=OD(),S&&N.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new N.ManagedMediaSource,B.log("Using ManagedMediaSource")):N.MediaSource&&(this.mediaSource=new N.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_=ji(),this.hasPlayed_=!1,this.syncController_=new bD(e),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new ED,this.sourceUpdater_=new O1(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new SD,this.keyStatusMap_=new Map;const F={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:E,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:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Ap(t,this.vhs_,Pt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new zo(t,this.vhs_,Pt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Dp(Pt(F,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Dp(Pt(F,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new gD(Pt(F,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((H,$)=>{function G(){i.off("vttjserror",K),H()}function K(){i.off("vttjsloaded",G),$()}i.one("vttjsloaded",G),i.one("vttjserror",K),i.addWebVttScript_()})}),e);const L=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new MD(this.vhs_.xhr,L),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),BD.forEach(H=>{this[H+"_"]=UD.bind(this,H)}),this.logger_=pn("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 W=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(W,()=>{const H=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-H,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,r){const i=this.media(),n=i&&(i.id||i.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],r=t?t.activeGroup():null,i=this.contentSteeringController_.getPathway();if(r&&i){const a=(r.length?r[0].playlists:r.playlists).filter(o=>o.attributes.serviceLocation===i);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=N.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(N.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 r=e.mediaGroups.AUDIO,i=Object.keys(r);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=r.main||i.length&&r[i[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in r)if(r[o][n.label]){const l=r[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const c=e.playlists[u];c.attributes&&c.attributes.AUDIO&&c.attributes.AUDIO===o&&a.push(c)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),r=t.targetDuration*1.5*1e3;Sp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),LD({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 r;if(this.enableLowInitialPlaylist&&(r=this.selectInitialPlaylist()),r||(r=this.selectPlaylist()),!r||!this.shouldSwitchToMedia_(r)||(this.initialMedia_=r,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(),r=t.targetDuration*1.5*1e3;Sp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,this.sourceType_==="dash"&&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,r=>{this.player_.trigger(jt({},r))})})}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 r=e.mediaGroups||{};let i=!0;const n=Object.keys(r.AUDIO);for(const a in r.AUDIO)for(const o in r.AUDIO[a])r.AUDIO[a][o].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ta.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(r.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_,r=this.tech_.currentTime(),i=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return FD({buffered:a,currentTime:r,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,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 r=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:r.playlist,error:r})}),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 r=this.audioSegmentLoader_.pendingSegment_;if(!r||!r.segment||!r.segment.syncInfo)return;const i=r.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",r=>{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:RD}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const r=this.getCodecsOrExclude_();r&&this.sourceUpdater_.addOrChangeSourceBuffers(r)};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(r=>{this.mainSegmentLoader_.on(r,i=>{this.player_.trigger(jt({},i))}),this.audioSegmentLoader_.on(r,i=>{this.player_.trigger(jt({},i))}),this.subtitleSegmentLoader_.on(r,i=>{this.player_.trigger(jt({},i))})})}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.mainSegmentLoader_.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 r=t.end(0);let i=r;if(e.start){const n=e.start.timeOffset;n<0?i=Math.max(r+n,t.start(0)):i=Math.min(r,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}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 r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const i=Ta.Playlist.playlistEnd(e,r),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return i-n<=us;const o=a.end(a.length-1);return o-n<=us&&i-o<=us}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,n=i.filter(Ed),a=n.length===1&&n[0]===e;if(i.length===1&&r!==1/0)return B.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 E=this.pathwayAttribute_(e),S=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(E),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(E)},S);return}let g=!1;i.forEach(E=>{if(E===e)return;const S=E.excludeUntil;typeof S<"u"&&S!==1/0&&(g=!0,delete E.excludeUntil)}),g&&(B.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+r*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:B.log.warn,c=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const d=l.targetDuration/2*1e3||5*1e3,f=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=d;return this.switchMedia_(l,"exclude",a||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const r=[],i=e==="all";(i||e==="main")&&r.push(this.mainPlaylistLoader_);const n=[];(i||e==="audio")&&n.push("AUDIO"),(i||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&r.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&r.push(o)}),r.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=qo(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:Ta.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const r=e.media();if(!r)return null;const i=this.syncController_.getMediaSequenceSync(t);if(i&&i.isReliable){const o=i.start,l=i.end;if(!isFinite(o)||!isFinite(l))return null;const u=Ta.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r),c=Math.max(0,l-u);return c<o?null:ji([[o,c]])}const n=this.syncController_.getExpiredTime(r,this.duration());if(n===null)return null;const a=Ta.Playlist.seekable(r,n,Ta.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const r=e.start(0),i=e.end(0),n=t.start(0),a=t.end(0);return n>i||r>a?e:ji([[Math.max(r,n),Math.min(i,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 r=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||r&&r.length&&this.seekable_.length&&r.start(0)===this.seekable_.start(0)&&r.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${Kb(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),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 i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const t=this.tech_.buffered();let r=Ta.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(r=Math.max(r,t.end(t.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}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 r in t)t[r].forEach(i=>{i.playlistLoader&&i.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_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=Gu(this.main(),t),i={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=r.video||e.main.videoCodec||kw),e.main.isMuxed&&(i.video+=`,${r.audio||e.main.audioCodec||Cv}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(i.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||Cv,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,c)=>u?Hu(c):rf(c),o={};let l;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!a(e[u].isFmp4,i[u])){const c=e[u].isFmp4?"browser":"muxer";o[c]=o[c]||[],o[c].push(i[u]),u==="audio"&&(l=c)}}),n&&l&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(c=>{(c.attributes&&c.attributes.AUDIO)===u&&c!==t&&(c.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${l} does not support codec(s): "${i.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((c,d)=>(c&&(c+=", "),c+=`${d} does not support codec(s): "${o[d].join(",")}"`,c),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(c=>{const d=(rs(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,f=(rs(i[c]||"")[0]||{}).type;d&&f&&d.toLowerCase()!==f.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[c]}" -> "${i[c]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}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(r=>{const i=e[r];if(t.indexOf(i.id)!==-1)return;t.push(i.id);const n=Gu(this.main,i),a=[];n.audio&&!rf(n.audio)&&!Hu(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!rf(n.video)&&!Hu(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],r=this.main().playlists,i=Dh(rs(e)),n=Ey(i),a=i.video&&rs(i.video)[0]||null,o=i.audio&&rs(i.audio)[0]||null;Object.keys(r).forEach(l=>{const u=r[l];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const c=[],d=Gu(this.mainPlaylistLoader_.main,u),f=Ey(d);if(!(!d.audio&&!d.video)){if(f!==n&&c.push(`codec count "${f}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const g=d.video&&rs(d.video)[0]||null,E=d.audio&&rs(d.audio)[0]||null;g&&a&&g.type.toLowerCase()!==a.type.toLowerCase()&&c.push(`video codec "${g.type}" !== "${a.type}"`),E&&o&&E.type.toLowerCase()!==o.type.toLowerCase()&&c.push(`audio codec "${E.type}" !== "${o.type}"`)}c.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${c.join(" && ")}`))}})}updateAdCues_(e){let t=0;const r=this.seekable();r.length&&(t=r.start(0)),yD(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ui.GOAL_BUFFER_LENGTH,r=Ui.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,Ui.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*r,i)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ui.BUFFER_LOW_WATER_LINE,r=Ui.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,Ui.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ui.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*r,this.bufferBasedABR?n:i)}bufferHighWaterLine(){return Ui.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Ay(this.inbandTextTracks_,"com.apple.streaming",this.tech_),YN({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,r){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ay(this.inbandTextTracks_,e,this.tech_),GN({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:r})}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,r=>{this.trigger(jt({},r))})}),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 o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,i=new Set;let n=!1;Object.keys(r).forEach(a=>{const o=r[a],l=this.pathwayAttribute_(o),u=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const d=!o.excludeUntil&&o.excludeUntil!==1/0;!i.has(o.id)&&u&&d&&(i.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||i&&i.size){for(const[a,o]of r.entries())i.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of i.entries()){const l=r.get(a);if(!l){t.filter(c=>c.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(c=>{this.mainPlaylistLoader_.addClonePathway(o,c)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}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 r=e["URI-REPLACEMENT"].PARAMS,i=t["URI-REPLACEMENT"].PARAMS;for(const n in r)if(r[n]!==i[n])return!1;for(const n in i)if(r[n]!==i[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(r=>{const i=this.mainPlaylistLoader_.getKeyIdSet(r);!i||!i.size||i.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=r.lastExcludeReason_===t&&r.excludeUntil===1/0;o?o&&l&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${n} is ${a}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==t&&(r.excludeUntil=1/0,r.lastExcludeReason_=t,this.logger_(`excluding playlist ${r.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(r=>{const i=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,n=r.excludeUntil===1/0&&r.lastExcludeReason_===t;i&&n&&(delete r.excludeUntil,B.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:pD(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 jD=(s,e,t)=>r=>{const i=s.main.playlists[e],n=Xm(i),a=Ed(i);if(typeof r>"u")return a;r?delete i.disabled:i.disabled=!0;const o={renditionInfo:{id:e,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return r!==a&&!n&&(t(i),r?s.trigger({type:"renditionenabled",metadata:o}):s.trigger({type:"renditiondisabled",metadata:o})),r};let HD=class{constructor(e,t,r){const{playlistController_:i}=e,n=i.fastQualityChange_.bind(i);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=Gu(i.main(),t),this.playlist=t,this.id=r,this.enabled=jD(e.playlists,t.id,n)}};const VD=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=gc(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(r=>!Xm(r)).map((r,i)=>new HD(s,r,r.id)):[]}},Uy=["seeking","seeked","pause","playing","error"];let qD=class extends B.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_=pn("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(c=>{l[c]={reset:()=>this.resetSegmentDownloads_(c),updateend:()=>this.checkSegmentDownloads_(c)},a[`${c}SegmentLoader_`].on("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].on("playlistupdate",l[c].reset),this.tech_.on(["seeked","seeking"],l[c].reset)});const u=c=>{["main","audio"].forEach(d=>{a[`${d}SegmentLoader_`][c]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(Uy,n),this.tech_.on("canplay",r),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(Uy,n),this.tech_.off("canplay",r),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(c=>{a[`${c}SegmentLoader_`].off("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].off("playlistupdate",l[c].reset),this.tech_.off(["seeked","seeking"],l[c].reset)}),this.checkCurrentTimeTimeout_&&N.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&N.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=N.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_,r=t[`${e}SegmentLoader_`],i=r.buffered_(),n=xx(this[`${e}Buffered_`],i);if(this[`${e}Buffered_`]=i,n){const a={bufferedRanges:i};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:r.playlist_&&r.playlist_.id,buffered:Ja(i)}),!(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+us>=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(ji([this.lastRecordedTime,e]));const r={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:r}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),r=this.tech_.currentTime(),i=this.afterSeekableWindow_(t,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(i&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,r)){const E=t.start(0);n=E+(E===t.end(0)?0:us)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${Kb(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,c=this.media(),d=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-ls)*2,f=[l,u];for(let E=0;E<f.length;E++){if(!f[E])continue;if(Gm(f[E],r)<d)return!1}const g=Lc(o,r);return g.length===0?!1:(n=g.start(0)+us,this.logger_(`Buffered region starts (${g.start(0)}) just beyond seek point (${r}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),r=qo(t,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.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 o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Lc(i,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,r,i=!1){if(!e.length)return!1;let n=e.end(e.length-1)+us;const a=!r.endList,o=typeof r.partTargetDuration=="number";return a&&(o||i)&&(n=e.end(e.length-1)+r.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:r}){if(!e)return;let i;if(e.length&&t.length){const n=qo(e,r-3),a=qo(e,r),o=qo(t,r);o.length&&!a.length&&n.length&&(i={start:n.end(0),end:o.end(0)})}else Lc(e,r).length||(i=this.gapFromVideoUnderflow_(e,r));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),r=this.tech_.currentTime(),i=Lc(t,r);if(this.resetTimeUpdate_(),i.length===0||r!==e)return;this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+ls);const n={gapInfo:{from:r,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const r=wx(e);for(let i=0;i<r.length;i++){const n=r.start(i),a=r.end(i);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}};const zD={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},U1=function(s,e){let t=0,r=0;const i=Pt(zD,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){r&&s.currentTime(r)},a=function(c){c!=null&&(r=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(c),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},o=function(){if(Date.now()-t<i.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){B.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),i.getSource.call(s,a)},l=function(){s.off("loadedmetadata",n),s.off("error",o),s.off("dispose",l)},u=function(c){l(),U1(s,c)};s.on("error",o),s.on("dispose",l),s.reloadSourceOnError=u},WD=function(s){U1(this,s)};var F1="3.16.0",GD="7.1.0",KD="1.3.1",XD="7.2.0",YD="4.0.2";const ui={PlaylistLoader:zo,Playlist:Dr,utils:Jx,STANDARD_PLAYLIST_SELECTOR:ky,INITIAL_PLAYLIST_SELECTOR:HN,lastBandwidthSelector:ky,movingAverageBandwidthSelector:$N,comparePlaylistBandwidth:Jm,comparePlaylistResolution:FN,xhr:h1()};Object.keys(Ui).forEach(s=>{Object.defineProperty(ui,s,{get(){return B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Ui[s]},set(e){if(B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){B.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}Ui[s]=e}})});const $1="videojs-vhs",j1=function(s,e){const t=e.media();let r=-1;for(let i=0;i<s.length;i++)if(s[i].id===t.id){r=i;break}s.selectedIndex_=r,s.trigger({selectedIndex:r,type:"change"})},QD=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),j1(s,e.playlists)};ui.canPlaySource=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const JD=(s,e,t)=>{if(!s)return s;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=Dh(rs(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(r.audio=t.attributes.CODECS);const i=ul(r.video),n=ul(r.audio),a={};for(const o in s)a[o]={},n&&(a[o].audioContentType=n),i&&(a[o].videoContentType=i),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof s[o]=="string"&&(a[o].url=s[o]);return Pt(s,a)},ZD=(s,e)=>s.reduce((t,r)=>{if(!r.contentProtection)return t;const i=e.reduce((n,a)=>{const o=r.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(i).length&&t.push(i),t},[]),eI=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:r})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const i=t?r.concat([t]):r,n=ZD(i,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((u,c)=>{s.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,c)=>{s.eme.initializeMediaKeys({keySystems:l},d=>{if(d){c(d);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},tI=({player:s,sourceKeySystems:e,media:t,audioMedia:r})=>{const i=JD(e,t,r);return i?(s.currentSource().keySystems=i,i&&!s.eme?(B.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},H1=()=>{if(!N.localStorage)return null;const s=N.localStorage.getItem($1);if(!s)return null;try{return JSON.parse(s)}catch{return null}},iI=s=>{if(!N.localStorage)return!1;let e=H1();e=e?Pt(e,s):s;try{N.localStorage.setItem($1,JSON.stringify(e))}catch{return!1}return e},rI=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,V1=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},q1=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},z1=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},W1=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};ui.supportsNativeHls=(function(){if(!de||!de.createElement)return!1;const s=de.createElement("video");return B.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(s.canPlayType(t))}):!1})();ui.supportsNativeDash=(function(){return!de||!de.createElement||!B.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(de.createElement("video").canPlayType("application/dash+xml"))})();ui.supportsTypeNatively=s=>s==="hls"?ui.supportsNativeHls:s==="dash"?ui.supportsNativeDash:!1;ui.isSupported=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ui.xhr.onRequest=function(s){V1(ui.xhr,s)};ui.xhr.onResponse=function(s){q1(ui.xhr,s)};ui.xhr.offRequest=function(s){z1(ui.xhr,s)};ui.xhr.offResponse=function(s){W1(ui.xhr,s)};const nI=B.getComponent("Component");let G1=class extends nI{constructor(e,t,r){if(super(t,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=pn("VhsHandler"),t.options_&&t.options_.playerId){const i=B.getPlayer(t.options_.playerId);this.player_=i}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(de,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const n=de.fullscreenElement||de.webkitFullscreenElement||de.mozFullScreenElement||de.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_=Pt(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_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,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 r=H1();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ui.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ui.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;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=rI(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ui,this.options_.sourceType=pT(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new $D(this.options_);const r=Pt({liveRangeSafeTimeDelta:us},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new qD(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=B.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 i=this.options_.bufferBasedABR?ui.movingAverageBandwidthSelector(.55):ui.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=ui.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=N.navigator.connection||N.navigator.mozConnection||N.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}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(){B.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:()=>Ja(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:()=>Ja(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&&iI({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{VD(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_=N.URL.createObjectURL(this.playlistController_.mediaSource),(B.browser.IS_ANY_SAFARI||B.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"),eI({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=tI({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.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=B.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{QD(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{j1(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":F1,"mux.js":GD,"mpd-parser":KD,"m3u8-parser":XD,"aes-decrypter":YD}}version(){return this.constructor.version()}canChangeType(){return O1.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_&&N.URL.revokeObjectURL&&(N.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return sN({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,r=!0,i=2){return g1({programTime:e,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{V1(this.xhr,e)},this.xhr.onResponse=e=>{q1(this.xhr,e)},this.xhr.offRequest=e=>{z1(this.xhr,e)},this.xhr.offResponse=e=>{W1(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(r=>{this.playlistController_.on(r,i=>{this.player_.trigger(jt({},i))})}),t.forEach(r=>{this.playbackWatcher_.on(r,i=>{this.player_.trigger(jt({},i))})})}};const Lh={name:"videojs-http-streaming",VERSION:F1,canHandleSource(s,e={}){const t=Pt(B.options,e);return!t.vhs.experimentalUseMMS&&!Hu("avc1.4d400d,mp4a.40.2",!1)?!1:Lh.canPlayType(s.type,t)},handleSource(s,e,t={}){const r=Pt(B.options,t);return e.vhs=new G1(s,e,r),e.vhs.xhr=h1(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=pT(s);if(!t)return"";const r=Lh.getOverrideNative(e);return!ui.supportsTypeNatively(t)||r?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(B.browser.IS_ANY_SAFARI||B.browser.IS_IOS),{overrideNative:r=t}=e;return r}},sI=()=>Hu("avc1.4d400d,mp4a.40.2",!0);sI()&&B.getTech("Html5").registerSourceHandler(Lh,0);B.VhsHandler=G1;B.VhsSourceHandler=Lh;B.Vhs=ui;B.use||B.registerComponent("Vhs",ui);B.options.vhs=B.options.vhs||{};(!B.getPlugin||!B.getPlugin("reloadSourceOnError"))&&B.registerPlugin("reloadSourceOnError",WD);const aI=B.getComponent("MenuItem");class oI extends aI{constructor(e,t){super(e,t)}handleClick(e){super.handleClick(e),this.requestAnimationFrame(()=>{this.options_.item.showCollapsibleMenu()})}createEl(e,t,r){if(!this.options_.item)return super.createEl(e,t,r);const i=this.options_.item.getCollabsibleName(),n=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,o=`<span class="vjs-menu-item-text">${i}</span>`;this.valueHolder_=B.dom.createEl("span",{innerHTML:n});const l=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item ${n?"cv-has-cog-value":""} ${a||""}`.trim(),innerHTML:o},r);return l.appendChild(this.valueHolder_),l}updateCollapsibleValue(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}const lI=B.getComponent("MenuButton"),Qu=class Qu extends lI{constructor(e,t){super(e,t),this.controlText("Settings")}buildWrapperCSSClass(){return`cv-menu-small cv-cog-menu-button ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-cog-button ${super.buildCSSClass()}`}pressButton(){if(this.player_.options_.deferMenus){this.player_.deferMenusPlugin().deferMenu();return}this.menu.children_.forEach(e=>{e.updateCollapsibleValue&&e.updateCollapsibleValue()}),super.pressButton()}createItems(){var t;const e=[];for(let r=0;r<this.options_.items.length;r++){const i=this.options_.items[r];i.isCollabsible&&i.showInCollabsibleMenu()&&i.isCollapsed&&e.push(new oI(this.player_,{item:i}))}return(t=this.additionalItems)!=null&&t.length&&[...this.additionalItems].sort((i,n)=>{const a=Qu.additionalItemOrder.indexOf(i.name);return Qu.additionalItemOrder.indexOf(n.name)-a}).forEach(i=>{const n=new i.ctor(this.player_,{...this.options_,...i.options??{}});e.splice(0,0,n)}),e}update(){super.update(),this.player_.trigger("resizemenus")}addItem(e){this.additionalItems||(this.additionalItems=[]),!this.additionalItems.some(t=>t.name===e.name)&&(this.additionalItems.push(e),this.update())}};Qu.additionalItemOrder=["EngagementOverlayMenuItem","PointsOfInterestMenuItem","LoopVideoMenuItem","NextVideoMenuItem"];let Lp=Qu;B.registerComponent("cogButton",Lp);const uI=B.getComponent("MenuItem");class vc extends uI{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:`<span class="vjs-menu-item-text">${this.localize(this.options_.label)}</span>`,tabIndex:-1})}handleClick(e){if(super.handleClick(e),this.options_.onClickBack){this.options_.onClickBack();return}this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("cogButton").pressButton()})}}const cI=B.getComponent("MenuItem"),Fy=B.getComponent("MenuButton"),hI=["large","medium","small"];let dI=class extends cI{constructor(e,t){super(e,t)}handleClick(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}};class fI extends Fy{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.player_.ready(()=>{this.update()})}createItems(){const e=this.player_.textTrackSettings;if(!e)return;const t=e.getSizeSetting(),r=[new vc(this.player_,{label:"Caption Text Size",onClickBack:()=>{this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()})}})];return hI.map(i=>{r.push(new dI(this.player_,{label:i.charAt(0).toUpperCase()+i.substring(1),selectable:!0,multiSelectable:!1,selected:i===t,value:i}))}),r}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){Fy.prototype.handleClick.apply(this)}}B.registerComponent("SubtitleSizeButton",fI);function Zm(s,e,t,r){if(!s.length)return[];const i=[];for(let n=s.length-1;n>=0;n--){const a=s[n];if(a.kind===e){if(t&&a.label!==t||r&&a.language!==r)continue;i.push(a)}}return i}function Oh(s,e,t,r,i){if(s.kind===e&&!(t&&s.label!==t)&&!(i&&s.language!==i)){if(s.loaded_){r(s);return}s.one("loadeddata",()=>{r(s)})}}function $y(s){if(s!=null&&s.cues.length)for(let e=0;e<s.cues.length;e++){const t=s.cues[e];t!=null&&t.text&&(t.text=YC.sanitize(t.text))}}function jy(s,e,t,r,i){const n=s.textTracks(),a=Zm(n,e,t,i)[0];if(a){Oh(a,e,t,r);return}const o=l=>{Oh(l.track,e,t,r),n.removeEventListener("addtrack",o)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}function Hy(s,e,t,r,i){const n=s.textTracks(),a=Zm(n,e,t,i);a.length&&a.forEach(l=>Oh(l,e,t,r,i));const o=l=>{Oh(l.track,e,t,r,i)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}const yr={getTrack(s,e,t,r){const i=s.textTracks();return Zm(i,e,t,r)[0]},useChapters(s,e){jy(s,"chapters",null,e)},useMetadataTrack(s,e,t){jy(s,"metadata",e,t,null)},useMetadataTracks(s,e,t,r){Hy(s,"metadata",e,t,r)},useSubtitles(s,e,t){Hy(s,"subtitles",null,e,t)},getCurrentTextTrack(s){return this.findTrackByPredicate(s,e=>e.mode==="showing")},findTrackByPredicate(s,e){if(!s)return null;const t=s.textTracks();for(let r=0;r<t.length;r++){const i=t[r];if(e(i))return i}return null},forEachTrack(s,e){if(!s)return;const t=s.textTracks();for(let r=0;r<t.length;r++){const i=t[r];e(i)}},sanitizeTrack(s,e){if(!s||!e)return;if(s.loaded){$y(s);return}const t=()=>$y(s);s.addEventListener("loadeddata",t),e.one("dispose",()=>{s.removeEventListener("loadeddata",t)})}},pI=function(s,e){let t=window.performance.now();return function(...i){const n=window.performance.now();n-t>=e&&(s(...i),t=n)}},eg=function(s,e,t,r=window){let i;const n=()=>{r.clearTimeout(i),i=null},a=(...o)=>{let l=!1,u=function(){i=null,u=null,s.apply(this,o)};return r.clearTimeout(i),i=r.setTimeout(u,e),l};return a.cancel=n,a},K1=B.getComponent("MenuItem");class X1 extends K1{constructor(e,t){super(e,t),this.onChange=eg(this.onChange,100,!1,this),this.bindEventListeners()}createEl(){const e=this.localize("Search");return super.createEl("li",{className:`vjs-menu-item cv-search-input-menu-item-container ${this.options_.className||""}`.trim(),innerHTML:`
|
|
275
|
+
<div class="cv-search-input-menu-item">
|
|
276
|
+
<span class="cv-search-icon">
|
|
277
|
+
<svg viewBox="0 0 24 24">
|
|
278
|
+
<path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>
|
|
279
|
+
</svg>
|
|
280
|
+
</span><input placeholder="${e}" type="text" autocomplete="off" spellcheck="false" aria-label="${e}" />
|
|
281
|
+
</div>
|
|
282
|
+
`})}focus(){this.$("input").focus()}handleClick(e){e.stopImmediatePropagation(),this.$("input").focus()}handleKeyDown(){this.focus()}bindEventListeners(){const e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",t=>{this.options_.menuButton.menu.handleBlur(t)})}onChange(e){const t=e.target;this.options_.search(t.value)}}B.registerComponent("SearchInputMenuItem",X1);class Y1 extends K1{createEl(e,t,r){return super.createEl(e,{...t,className:"vjs-menu-item cv-no-results"},r)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}B.registerComponent("NoMatchingResultsMenuItem",Y1);const mI=B.getComponent("MenuItem");class gI extends mI{constructor(e,t){super(e,t)}update(e,t){if(!(e!=null&&e.length)){this.el().innerHTML=`<span class="vjs-menu-item-text">${this.options_.label}</span>`;return}const r=[];let i=0;e.forEach(n=>{const a=this.options_.label.substr(i,n);a&&r.push(a),r.push('<span class="cv-highlight">'),r.push(this.options_.label.substr(n,t)),r.push("</span>"),i=n+t}),r.push(this.options_.label.substring(i,this.options_.label.length)),this.el().innerHTML=`<span class="vjs-menu-item-text">${r.join("")}</span>`}handleClick(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}const Vy=B.getComponent("MenuButton");class vI extends Vy{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.search=this.search.bind(this),this.player_.textTracks().addEventListener("selectedlanguagechange",this.update)}bindTrackEvents(e){e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.update)})}createItems(){var i;const e=yr.getCurrentTextTrack(this.player_);if(!e)return;if(!((i=e.cues)!=null&&i.length)){this.bindTrackEvents(e);return}const t=[new X1(this.player_,{menuButton:this,search:this.search})];for(let n=0;n<e.cues.length;n++){const a=e.cues[n];t.push(new gI(this.player_,{cue:a,label:a.text,selected:!1,multiSelectable:!1}))}const r=new Y1(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return r.hide(),t.push(r),t}search(e){var i;e=e.trim();const t=yr.getCurrentTextTrack(this.player_);if(!((i=t==null?void 0:t.cues)!=null&&i.length))return;const r=this.findMatches(e,t);this.toggleItemVisibility(e,r),this.toggleNoResults(e,r)}findMatches(e,t){const r={};if(!e)return r;const i=new RegExp(e,"gi");for(let n=0;n<t.cues.length;n++){const o=t.cues[n].text,l=[];let u;for(;u=i.exec(o);)l.push(u.index);l.length&&(r[n]=l)}return r}toggleItemVisibility(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((i,n)=>{!e||t[n]?i.show():i.hide(),i.update(t[n],e.length)})}toggleNoResults(e,t){const r=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?r.hide():r.show()}buildWrapperCSSClass(){return`cv-menu-big cv-subtitle-search-button ${super.buildWrapperCSSClass()}`}update(){super.update(),this.player_.trigger("resizemenus")}pressButton(){super.pressButton();const e=this.menu.children_[0];e!=null&&e.focus&&(e==null||e.focus())}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){Vy.prototype.handleClick.apply(this)}}B.registerComponent("subtitleSearchButton",vI);const yI=B.getComponent("MenuItem"),qy=B.getComponent("MenuButton"),_I=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"},{label:"Toggle theatre mode",type:"theatre-mode"}];class TI extends yI{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:`
|
|
283
|
+
<span class="vjs-menu-item-text">${this.options_.label}</span>
|
|
284
|
+
<span>${this.getDisplayHtml(this.options_.type)}
|
|
285
|
+
`})}getDisplayHtml(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return`<span class="cv-keyboard-button">Shift</span> +
|
|
286
|
+
<span class="cv-keyboard-button cv-single-key">⇑</span> /
|
|
287
|
+
<span class="cv-keyboard-button">Shift</span> +
|
|
288
|
+
<span class="cv-keyboard-button cv-single-key">⇓</span>`;case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>';case"theatre-mode":return'<span class="cv-keyboard-button cv-single-key">t</span>'}return""}}class bI extends qy{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=[];return e.push(new vc(this.player_,{label:"Keyboard shortcuts"})),_I.forEach(t=>{e.push(new TI(this.player_,t))}),e}buildWrapperCSSClass(){return`cv-menu-small cv-keyboard-shortcuts ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Keyboard shortcuts"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!this.player_.options_.mobile}showCollapsibleMenu(){qy.prototype.handleClick.apply(this)}}B.registerComponent("KeyboardShortcutsButton",bI);const SI=600,CI=1200,Ef="cv-collapsed",EI=B.getComponent("Component");class wI extends EI{constructor(e,t){super(e,t),this.addChild("cogButton",{items:this.children_},this.children_.length-1),this.update=this.update.bind(this),this.player_.on("cv-updatecog",this.update),this.player_.on("playerresize",this.update),this.player_.one("play",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-updatecog",this.update),this.player_.off("playerresize",this.update),this.player_.off("play",this.update)})}toggleHidden(e){for(let t=0;t<this.children_.length;t++){const r=this.children_[t];if(r.isCollabsible){if(r.alwaysCollapsed){r.isCollapsed=!0,r.addClass(Ef);continue}e?(r.isCollapsed=!0,r.addClass(Ef)):(r.isCollapsed=!1,r.removeClass(Ef))}}this.getChild("cogButton").update()}update(){const e=this.player_.isFullscreen(),t=this.player_.whiteboardModePlugin().side,r=this.player_.el().getBoundingClientRect(),i=e&&(t==="left"||t==="right")?r.height:r.width;if(!i)return;this.addClass("cv-collapsorator-ready");let a=i<(e&&(t==="left"||t==="right"||t==="top")?CI:SI);this.player_.options_.deferMenus&&(a=!0),this.toggleHidden(a)}buildCSSClass(){return`cv-collapsorator ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}}B.registerComponent("collapserator",wI);const kI=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];class AI{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;$d.cacheExists(e)||(this.collectionApiClient.log({type:er.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:Xo.V3}),$d&&$d.cacheSet(e,null,300))}logVideoProgress(e){const t=this.getAnalyticsData();this.collectionApiClient.log(e.map(r=>({type:er.StreamProgress,actionContext:this.getActionContext(),data:{...t,progress:r},eventVersion:Xo.V2})))}logUserAction(e,t){const r={...this.getAnalyticsData(),...e},i={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:r,actionContext:i,eventVersion:t.eventVersion||Xo.V2})}getAnalyticsData(){const e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);const t=this.getEntityType();return t===Gr.Interactive?e.interactive={id:+this.options.mediaId}:t===Gr.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),tv.lockWindowSession(),this.options.player.one("dispose",()=>tv.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new QC({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:iv.shouldLog,formatData:iv.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?JC.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return Gr.Video;case"MasterInteractive":return Gr.Interactive;case"MasterClip":return Gr.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return Wr.Player;case"interactive-player":return Wr.InteractivePlayer;case"create-clip-player":return Wr.CreateClipPlayer}}}class Op extends Error{constructor(e,t){super((t==null?void 0:t.title)||"Ajax error"),this.url=e,this.response=t}}class xI{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:"DELETE",headers:this.getHeaders(t)})}async post(e,t,r,i=!0){const n=await fetch(e,{method:"POST",headers:this.getHeaders(r),body:t,mode:"cors"});if(i)return await this.parseResponse(n)}async put(e,t,r,i=!0){const n=await fetch(e,{method:"PUT",headers:this.getHeaders(r),body:t,mode:"cors"});if(i)return await this.parseResponse(n)}setToken(e,t){this.tokens[e]=t}getHeaders(e={}){const t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let r;try{r=await e.json()}catch{throw new Op(e.url)}finally{throw new Op(e.url,r)}}return await e.json()}}const Mp=new xI;var Rc={exports:{}},zy;function NI(){return zy||(zy=1,(function(s,e){function t(l){if(l&&typeof l=="object"){var u=l.which||l.keyCode||l.charCode;u&&(l=u)}if(typeof l=="number")return a[l];var c=String(l),d=r[c.toLowerCase()];if(d)return d;var d=i[c.toLowerCase()];if(d)return d;if(c.length===1)return c.charCodeAt(0)}t.isEventKey=function(u,c){if(u&&typeof u=="object"){var d=u.which||u.keyCode||u.charCode;if(d==null)return!1;if(typeof c=="string"){var f=r[c.toLowerCase()];if(f)return f===d;var f=i[c.toLowerCase()];if(f)return f===d}else if(typeof c=="number")return c===d;return!1}},e=s.exports=t;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
|
|
289
|
+
* Programatically add the following
|
|
290
|
+
*/for(n=97;n<123;n++)r[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)r[n-48]=n;for(n=1;n<13;n++)r["f"+n]=n+111;for(n=0;n<10;n++)r["numpad "+n]=n+96;var a=e.names=e.title={};for(n in r)a[r[n]]=n;for(var o in i)r[o]=i[o]})(Rc,Rc.exports)),Rc.exports}var DI=NI();const st=Ln(DI);function II(s){document[s.fsApi_.fullscreenEnabled]&&(s.isFullscreen()?s.exitFullscreen():s.requestFullscreen())}function PI(s){const e=s.theatreModePlugin().getTheatreMode();s.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function LI(s){const e=s.volume(),t=s.lastVolume_();if(e===0){const r=t<.1?.1:t;s.volume(r),s.muted(!1)}else s.muted(!s.muted())}function Wy(s){s.paused()?s.play():s.pause()}function Bc(s,e){s.currentTime(s.currentTime()+e)}function Gy(s,e){s.volume(s.volume()+e)}function OI(s){const e=s.target,t=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!t.find(r=>e.classList.contains(r))}const Ky={f:II,m:LI,k:Wy,space:Wy,t:PI,left:s=>Bc(s,-5),right:s=>Bc(s,5),j:s=>Bc(s,-10),l:s=>Bc(s,10),up:s=>Gy(s,.05),down:s=>Gy(s,-.05)};function MI(s,e,t){if(s.ctrlKey||s.metaKey||s.altKey||s.shiftKey)return;const r=st(s);if(r==="t"&&!t.allowTheatreMode||r==="f"&&!t.allowFullscreen||!Ky[r])return;Ky[r](e,s);const i=OI(s),n=["space"].includes(r);(i||n)&&(s.preventDefault(),s.stopPropagation())}var Q1=(s=>(s.PhysicallyChapteredVideo="physically-chaptered-video",s))(Q1||{});const RI="1.38.0",BI={version:RI};var wf,Xy;function UI(){if(Xy)return wf;Xy=1,wf=s;function s(e,t){var r,i=null;try{r=JSON.parse(e,t)}catch(n){i=n}return[i,r]}return wf}var FI=UI();const $I=Ln(FI);var Uc={exports:{}},kf,Yy;function jI(){if(Yy)return kf;Yy=1;var s=Al(),e=function(i,n){return n===void 0&&(n=!1),function(a,o,l){if(a){i(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function t(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(i,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():i},"utf-8")}return kf=e,kf}var Qy;function HI(){if(Qy)return Uc.exports;Qy=1;var s=Al(),e=tT(),t=uT();o.httpHandler=jI();/**
|
|
291
|
+
* @license
|
|
292
|
+
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
293
|
+
* Copyright (c) 2014 David Björklund
|
|
294
|
+
* Available under the MIT license
|
|
295
|
+
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
|
296
|
+
*/var r=function(f){var g={};return f&&f.trim().split(`
|
|
297
|
+
`).forEach(function(E){var S=E.indexOf(":"),k=E.slice(0,S).trim().toLowerCase(),F=E.slice(S+1).trim();typeof g[k]>"u"?g[k]=F:Array.isArray(g[k])?g[k].push(F):g[k]=[g[k],F]}),g};Uc.exports=o,Uc.exports.default=o,o.XMLHttpRequest=s.XMLHttpRequest||c,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:s.XDomainRequest,i(["get","put","post","patch","head","delete"],function(d){o[d==="delete"?"del":d]=function(f,g,E){return g=a(f,g,E),g.method=d.toUpperCase(),l(g)}});function i(d,f){for(var g=0;g<d.length;g++)f(d[g])}function n(d){for(var f in d)if(d.hasOwnProperty(f))return!1;return!0}function a(d,f,g){var E=d;return t(f)?(g=f,typeof d=="string"&&(E={uri:d})):E=e({},f,{uri:d}),E.callback=g,E}function o(d,f,g){return f=a(d,f,g),l(f)}function l(d){if(typeof d.callback>"u")throw new Error("callback argument missing");var f=!1,g=function(me,Se,Ae){f||(f=!0,d.callback(me,Se,Ae))};function E(){L.readyState===4&&setTimeout(F,0)}function S(){var re=void 0;if(L.response?re=L.response:re=L.responseText||u(L),O)try{re=JSON.parse(re)}catch{}return re}function k(re){return clearTimeout(ne),re instanceof Error||(re=new Error(""+(re||"Unknown XMLHttpRequest Error"))),re.statusCode=0,g(re,te)}function F(){if(!H){var re;clearTimeout(ne),d.useXDR&&L.status===void 0?re=200:re=L.status===1223?204:L.status;var me=te,Se=null;return re!==0?(me={body:S(),statusCode:re,method:G,headers:{},url:$,rawRequest:L},L.getAllResponseHeaders&&(me.headers=r(L.getAllResponseHeaders()))):Se=new Error("Internal XMLHttpRequest Error"),g(Se,me,me.body)}}var L=d.xhr||null;L||(d.cors||d.useXDR?L=new o.XDomainRequest:L=new o.XMLHttpRequest);var W,H,$=L.url=d.uri||d.url,G=L.method=d.method||"GET",K=d.body||d.data,Y=L.headers=d.headers||{},P=!!d.sync,O=!1,ne,te={body:void 0,headers:{},statusCode:0,method:G,url:$,rawRequest:L};if("json"in d&&d.json!==!1&&(O=!0,Y.accept||Y.Accept||(Y.Accept="application/json"),G!=="GET"&&G!=="HEAD"&&(Y["content-type"]||Y["Content-Type"]||(Y["Content-Type"]="application/json"),K=JSON.stringify(d.json===!0?K:d.json))),L.onreadystatechange=E,L.onload=F,L.onerror=k,L.onprogress=function(){},L.onabort=function(){H=!0},L.ontimeout=k,L.open(G,$,!P,d.username,d.password),P||(L.withCredentials=!!d.withCredentials),!P&&d.timeout>0&&(ne=setTimeout(function(){if(!H){H=!0,L.abort("timeout");var re=new Error("XMLHttpRequest timeout");re.code="ETIMEDOUT",k(re)}},d.timeout)),L.setRequestHeader)for(W in Y)Y.hasOwnProperty(W)&&L.setRequestHeader(W,Y[W]);else if(d.headers&&!n(d.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in d&&(L.responseType=d.responseType),"beforeSend"in d&&typeof d.beforeSend=="function"&&d.beforeSend(L),L.send(K||null),L}function u(d){try{if(d.responseType==="document")return d.responseXML;var f=d.responseXML&&d.responseXML.documentElement.nodeName==="parsererror";if(d.responseType===""&&!f)return d.responseXML}catch{}return null}function c(){}return Uc.exports}var VI=HI();const J1=Ln(VI);function Z1(s,e,t){if(rT())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(s.bind.apply(s,r));return t&&hm(i,t.prototype),i}var Af={exports:{}},Jy;function qI(){return Jy||(Jy=1,(function(s,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var d=o.parseURL(l);if(!d)throw new Error("Error trying to parse base URL.");return d.path=o.normalizePath(d.path),o.buildURLFromParts(d)}var f=o.parseURL(u);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return c.alwaysNormalize?(f.path=o.normalizePath(f.path),o.buildURLFromParts(f)):u;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var E=i.exec(g.path);g.netLoc=E[1],g.path=E[2]}g.netLoc&&!g.path&&(g.path="/");var S={scheme:g.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(S.netLoc=g.netLoc,f.path[0]!=="/"))if(!f.path)S.path=g.path,f.params||(S.params=g.params,f.query||(S.query=g.query));else{var k=g.path,F=k.substring(0,k.lastIndexOf("/")+1)+f.path;S.path=o.normalizePath(F)}return S.path===null&&(S.path=c.alwaysNormalize?o.normalizePath(f.path):f.path),o.buildURLFromParts(S)},parseURL:function(l){var u=r.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})()})(Af)),Af.exports}var zI=qI();const Zy=Ln(zI);var e_="http://example.com",wd=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=N.location&&N.location.href||"");var r=typeof N.URL=="function",i=/^\/\//.test(e),n=!N.location&&!/\/\//i.test(e);if(r?e=new N.URL(e,N.location||e_):/\/\//i.test(e)||(e=Zy.buildAbsoluteURL(N.location&&N.location.href||"",e)),r){var a=new URL(t,e);return n?a.href.slice(e_.length):i?a.href.slice(a.protocol.length):a.href}return Zy.buildAbsoluteURL(e,t)},tg=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(r,i){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(i)},e.off=function(r,i){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(i);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var i=this.listeners[r];if(i)if(arguments.length===2)for(var n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=i.length,u=0;u<l;++u)i[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(i){r.push(i)})},s})(),WI=function(e){return N.atob?N.atob(e):Buffer.from(e,"base64").toString("binary")};function eS(s){for(var e=WI(s),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var GI=(function(s){Be(e,s);function e(){var r;return r=s.call(this)||this,r.buffer="",r}var t=e.prototype;return t.push=function(i){var n;for(this.buffer+=i,n=this.buffer.indexOf(`
|
|
298
|
+
`);n>-1;n=this.buffer.indexOf(`
|
|
299
|
+
`))this.trigger("data",this.buffer.substring(0,n)),this.buffer=this.buffer.substring(n+1)},e})(tg),KI=" ",xf=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),r={};return t[1]&&(r.length=parseInt(t[1],10)),t[2]&&(r.offset=parseInt(t[2],10)),r},XI=function(){var e="[^=]*",t='"[^"]*"|[^,]*',r="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+r+")")},xn=function(e){for(var t=e.split(XI()),r={},i=t.length,n;i--;)t[i]!==""&&(n=/([^=]*)=(.*)/.exec(t[i]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),r[n[0]]=n[1]);return r},YI=(function(s){Be(e,s);function e(){var r;return r=s.call(this)||this,r.customParsers=[],r.tagMappers=[],r}var t=e.prototype;return t.push=function(i){var n=this,a,o;if(i=i.trim(),i.length!==0){if(i[0]!=="#"){this.trigger("data",{type:"uri",uri:i});return}var l=this.tagMappers.reduce(function(u,c){var d=c(i);return d===i?u:u.concat([d])},[i]);l.forEach(function(u){for(var c=0;c<n.customParsers.length;c++)if(n.customParsers[c].call(n,u))return;if(u.indexOf("#EXT")!==0){n.trigger("data",{type:"comment",text:u.slice(1)});return}if(u=u.replace("\r",""),a=/^#EXTM3U/.exec(u),a){n.trigger("data",{type:"tag",tagType:"m3u"});return}if(a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(u),a){o={type:"tag",tagType:"inf"},a[1]&&(o.duration=parseFloat(a[1])),a[2]&&(o.title=a[2]),n.trigger("data",o);return}if(a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"targetduration"},a[1]&&(o.duration=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"version"},a[1]&&(o.version=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"media-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"discontinuity-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"playlist-type"},a[1]&&(o.playlistType=a[1]),n.trigger("data",o);return}if(a=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(u),a){o=jt(xf(a[1]),{type:"tag",tagType:"byterange"}),n.trigger("data",o);return}if(a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(u),a){o={type:"tag",tagType:"allow-cache"},a[1]&&(o.allowed=!/NO/.test(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-MAP:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"map"},a[1]){var d=xn(a[1]);d.URI&&(o.uri=d.URI),d.BYTERANGE&&(o.byterange=xf(d.BYTERANGE))}n.trigger("data",o);return}if(a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"stream-inf"},a[1]){if(o.attributes=xn(a[1]),o.attributes.RESOLUTION){var f=o.attributes.RESOLUTION.split("x"),g={};f[0]&&(g.width=parseInt(f[0],10)),f[1]&&(g.height=parseInt(f[1],10)),o.attributes.RESOLUTION=g}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA:?(.*)$/.exec(u),a){o={type:"tag",tagType:"media"},a[1]&&(o.attributes=xn(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-ENDLIST/.exec(u),a){n.trigger("data",{type:"tag",tagType:"endlist"});return}if(a=/^#EXT-X-DISCONTINUITY/.exec(u),a){n.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(u),a){o={type:"tag",tagType:"program-date-time"},a[1]&&(o.dateTimeString=a[1],o.dateTimeObject=new Date(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-KEY:?(.*)$/.exec(u),a){o={type:"tag",tagType:"key"},a[1]&&(o.attributes=xn(a[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),n.trigger("data",o);return}if(a=/^#EXT-X-START:?(.*)$/.exec(u),a){o={type:"tag",tagType:"start"},a[1]&&(o.attributes=xn(a[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out-cont"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-in"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-SKIP:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"skip"},o.attributes=xn(a[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(KI)),n.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=xn(a[1]),["DURATION"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=parseFloat(o.attributes[E]))}),["INDEPENDENT","GAP"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=/YES/.test(o.attributes[E]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=xf(o.attributes.BYTERANGE)),n.trigger("data",o);return}if(a=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"server-control"},o.attributes=xn(a[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=parseFloat(o.attributes[E]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=/YES/.test(o.attributes[E]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PART-INF:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part-inf"},o.attributes=xn(a[1]),["PART-TARGET"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=parseFloat(o.attributes[E]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=xn(a[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(E){if(o.attributes.hasOwnProperty(E)){o.attributes[E]=parseInt(o.attributes[E],10);var S=E==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[S]=o.attributes[E],delete o.attributes[E]}}),n.trigger("data",o);return}if(a=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=xn(a[1]),["LAST-MSN","LAST-PART"].forEach(function(E){o.attributes.hasOwnProperty(E)&&(o.attributes[E]=parseInt(o.attributes[E],10))}),n.trigger("data",o);return}n.trigger("data",{type:"tag",data:u.slice(4)})})}},t.addParser=function(i){var n=this,a=i.expression,o=i.customType,l=i.dataParser,u=i.segment;typeof l!="function"&&(l=function(d){return d}),this.customParsers.push(function(c){var d=a.exec(c);if(d)return n.trigger("data",{type:"custom",data:l(c),customType:o,segment:u}),!0})},t.addTagMapper=function(i){var n=i.expression,a=i.map,o=function(u){return n.test(u)?a(u):u};this.tagMappers.push(o)},e})(tg),QI=function(e){return e.toLowerCase().replace(/-(\w)/g,function(t){return t[1].toUpperCase()})},Mo=function(e){var t={};return Object.keys(e).forEach(function(r){t[QI(r)]=e[r]}),t},Nf=function(e){var t=e.serverControl,r=e.targetDuration,i=e.partTargetDuration;if(t){var n="#EXT-X-SERVER-CONTROL",a="holdBack",o="partHoldBack",l=r&&r*3,u=i&&i*2;r&&!t.hasOwnProperty(a)&&(t[a]=l,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+l+")."})),l&&t[a]<l&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+l+")"}),t[a]=l),i&&!t.hasOwnProperty(o)&&(t[o]=i*3,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[o]+")."})),i&&t[o]<u&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+t[o]+") to partTargetDuration * 2 ("+u+")."}),t[o]=u)}},JI=(function(s){Be(e,s);function e(){var r;r=s.call(this)||this,r.lineStream=new GI,r.parseStream=new YI,r.lineStream.pipe(r.parseStream);var i=rt(r),n=[],a={},o,l,u=!1,c=function(){},d={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",g=0;r.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var E=0,S=0;return r.on("end",function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&o&&(a.map=o),!a.key&&l&&(a.key=l),!a.timeline&&typeof g=="number"&&(a.timeline=g),r.manifest.preloadSegment=a)}),r.parseStream.on("data",function(k){var F,L;({tag:function(){({version:function(){k.version&&(this.manifest.version=k.version)},"allow-cache":function(){this.manifest.allowCache=k.allowed,"allowed"in k||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var $={};"length"in k&&(a.byterange=$,$.length=k.length,"offset"in k||(k.offset=E)),"offset"in k&&(a.byterange=$,$.offset=k.offset),E=$.offset+$.length},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),k.duration>0&&(a.duration=k.duration),k.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key:function(){if(!k.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(k.attributes.METHOD==="NONE"){l=null;return}if(!k.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(k.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:k.attributes};return}if(k.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:k.attributes.URI};return}if(k.attributes.KEYFORMAT===f){var $=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if($.indexOf(k.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(k.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),k.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(k.attributes.KEYID&&k.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:k.attributes.KEYFORMAT,keyId:k.attributes.KEYID.substring(2)},pssh:eS(k.attributes.URI.split(",")[1])};return}k.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:k.attributes.METHOD||"AES-128",uri:k.attributes.URI},typeof k.attributes.IV<"u"&&(l.iv=k.attributes.IV)},"media-sequence":function(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+k.number});return}this.manifest.mediaSequence=k.number},"discontinuity-sequence":function(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+k.number});return}this.manifest.discontinuitySequence=k.number,g=k.number},"playlist-type":function(){if(!/VOD|EVENT/.test(k.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+k.playlist});return}this.manifest.playlistType=k.playlistType},map:function(){o={},k.uri&&(o.uri=k.uri),k.byterange&&(o.byterange=k.byterange),l&&(o.key=l)},"stream-inf":function(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||d,!k.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),jt(a.attributes,k.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,!(k.attributes&&k.attributes.TYPE&&k.attributes["GROUP-ID"]&&k.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var $=this.manifest.mediaGroups[k.attributes.TYPE];$[k.attributes["GROUP-ID"]]=$[k.attributes["GROUP-ID"]]||{},F=$[k.attributes["GROUP-ID"]],L={default:/yes/i.test(k.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(k.attributes.AUTOSELECT),k.attributes.LANGUAGE&&(L.language=k.attributes.LANGUAGE),k.attributes.URI&&(L.uri=k.attributes.URI),k.attributes["INSTREAM-ID"]&&(L.instreamId=k.attributes["INSTREAM-ID"]),k.attributes.CHARACTERISTICS&&(L.characteristics=k.attributes.CHARACTERISTICS),k.attributes.FORCED&&(L.forced=/yes/i.test(k.attributes.FORCED)),F[k.attributes.NAME]=L},discontinuity:function(){g+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=k.dateTimeString,this.manifest.dateTimeObject=k.dateTimeObject),a.dateTimeString=k.dateTimeString,a.dateTimeObject=k.dateTimeObject},targetduration:function(){if(!isFinite(k.duration)||k.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+k.duration});return}this.manifest.targetDuration=k.duration,Nf.call(this,this.manifest)},start:function(){if(!k.attributes||isNaN(k.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:k.attributes["TIME-OFFSET"],precise:k.attributes.PRECISE}},"cue-out":function(){a.cueOut=k.data},"cue-out-cont":function(){a.cueOutCont=k.data},"cue-in":function(){a.cueIn=k.data},skip:function(){this.manifest.skip=Mo(k.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",k.attributes,["SKIPPED-SEGMENTS"])},part:function(){var $=this;u=!0;var G=this.manifest.segments.length,K=Mo(k.attributes);a.parts=a.parts||[],a.parts.push(K),K.byterange&&(K.byterange.hasOwnProperty("offset")||(K.byterange.offset=S),S=K.byterange.offset+K.byterange.length);var Y=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+Y+" for segment #"+G,k.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(P,O){P.hasOwnProperty("lastPart")||$.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+O+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var $=this.manifest.serverControl=Mo(k.attributes);$.hasOwnProperty("canBlockReload")||($.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Nf.call(this,this.manifest),$.canSkipDateranges&&!$.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":function(){var $=this.manifest.segments.length,G=Mo(k.attributes),K=G.type&&G.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(G),G.byterange&&(G.byterange.hasOwnProperty("offset")||(G.byterange.offset=K?S:0,K&&(S=G.byterange.offset+G.byterange.length)));var Y=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+Y+" for segment #"+$,k.attributes,["TYPE","URI"]),!!G.type)for(var P=0;P<a.preloadHints.length-1;P++){var O=a.preloadHints[P];O.type&&O.type===G.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+Y+" for segment #"+$+" has the same TYPE "+G.type+" as preload hint #"+P})}},"rendition-report":function(){var $=Mo(k.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push($);var G=this.manifest.renditionReports.length-1,K=["LAST-MSN","URI"];u&&K.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+G,k.attributes,K)},"part-inf":function(){this.manifest.partInf=Mo(k.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",k.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Nf.call(this,this.manifest)}}[k.tagType]||c).call(i)},uri:function(){a.uri=k.uri,n.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),l&&(a.key=l),a.timeline=g,o&&(a.map=o),S=0,a={}},comment:function(){},custom:function(){k.segment?(a.custom=a.custom||{},a.custom[k.customType]=k.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[k.customType]=k.data)}})[k.type].call(i)}),r}var t=e.prototype;return t.warnOnMissingAttributes_=function(i,n,a){var o=[];a.forEach(function(l){n.hasOwnProperty(l)||o.push(l)}),o.length&&this.trigger("warn",{message:i+" lacks required attribute(s): "+o.join(", ")})},t.push=function(i){this.lineStream.push(i)},t.end=function(){this.lineStream.push(`
|
|
300
|
+
`),this.trigger("end")},t.addParser=function(i){this.parseStream.addParser(i)},t.addTagMapper=function(i){this.parseStream.addTagMapper(i)},e})(tg),so={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^/},ZI=["video","audio","text"],t_=["Video","Audio","Text"],tS=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,i){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})},ns=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(i){i=i.trim();var n;ZI.forEach(function(a){var o=so[a].exec(i.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=i.substring(0,o[1].length),u=i.replace(l,"");r.push({type:l,details:u,mediaType:a})}}),n||r.push({type:i,details:"",mediaType:"unknown"})}),r},eP=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var i in r){var n=r[i];if(n.default&&n.playlists)return ns(n.playlists[0].attributes.CODECS)}return null},iS=function(e){return e===void 0&&(e=""),so.audio.test(e.trim().toLowerCase())},tP=function(e){return e===void 0&&(e=""),so.text.test(e.trim().toLowerCase())},rc=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return tS(n.trim())}),r="video";t.length===1&&iS(t[0])?r="audio":t.length===1&&tP(t[0])&&(r="application");var i="mp4";return t.every(function(n){return so.mp4.test(n)})?i="mp4":t.every(function(n){return so.webm.test(n)})?i="webm":t.every(function(n){return so.ogg.test(n)})&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},nh=function(e){return e===void 0&&(e=""),N.MediaSource&&N.MediaSource.isTypeSupported&&N.MediaSource.isTypeSupported(rc(e))||!1},Df=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<t_.length;r++){var i=t_[r];if(so["muxer"+i].test(t))return!0}return!1})},i_="mp4a.40.2",iP="avc1.4d400d",rP=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,nP=/^application\/dash\+xml/i,rS=function(e){return rP.test(e)?"hls":nP.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},sP=function(e){return e.toString(2).length},aP=function(e){return Math.ceil(sP(e)/8)},nS=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},oP=function(e){return nS(e)},Je=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!oP(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))},Ki=N.BigInt||Number,Rp=[Ki("0x1"),Ki("0x100"),Ki("0x10000"),Ki("0x1000000"),Ki("0x100000000"),Ki("0x10000000000"),Ki("0x1000000000000"),Ki("0x100000000000000"),Ki("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var lP=function(e,t){var r=t===void 0?{}:t,i=r.signed,n=i===void 0?!1:i,a=r.le,o=a===void 0?!1:a;e=Je(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,E){var S=o?E:Math.abs(E+1-e.length);return f+Ki(g)*Rp[S]},Ki(0));if(n){var d=Rp[e.length]/Ki(2)-Ki(1);c=Ki(c),c>d&&(c-=d,c-=d,c-=Ki(2))}return Number(c)},uP=function(e,t){var r={},i=r.le,n=i===void 0?!1:i;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ki(e);for(var a=aP(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/Rp[l]&Ki(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},sS=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 r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r},cP=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return Je(t[0]);var i=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(i),a=0;return t.forEach(function(o){o=Je(o),n.set(o,a),a+=o.byteLength}),n},si=function(e,t,r){var i=r===void 0?{}:r,n=i.offset,a=n===void 0?0:n,o=i.mask,l=o===void 0?[]:o;e=Je(e),t=Je(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,d){var f=l[d]?l[d]&e[a+d]:e[a+d];return c===f})},hP=function(e,t,r){t.forEach(function(i){for(var n in e.mediaGroups[i])for(var a in e.mediaGroups[i][n]){var o=e.mediaGroups[i][n][a];r(o,i,n,a)}})};/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var r_=function(e){return!!e&&typeof e=="object"},pr=function s(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(i,n){return typeof n!="object"||Object.keys(n).forEach(function(a){Array.isArray(i[a])&&Array.isArray(n[a])?i[a]=i[a].concat(n[a]):r_(i[a])&&r_(n[a])?i[a]=s(i[a],n[a]):i[a]=n[a]}),i},{})},aS=function(e){return Object.keys(e).map(function(t){return e[t]})},dP=function(e,t){for(var r=[],i=e;i<t;i++)r.push(i);return r},kd=function(e){return e.reduce(function(t,r){return t.concat(r)},[])},oS=function(e){if(!e.length)return[];for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t},fP=function(e,t){return e.reduce(function(r,i,n){return i[t]&&r.push(n),r},[])},Bp=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1},pP=function(e,t){return aS(e.reduce(function(r,i){return i.forEach(function(n){r[t(n)]=n}),r},{}))},_l={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},nc=function(e){var t=e.baseUrl,r=t===void 0?"":t,i=e.source,n=i===void 0?"":i,a=e.range,o=a===void 0?"":a,l=e.indexRange,u=l===void 0?"":l,c={uri:n,resolvedUri:wd(r||"",n)};if(o||u){var d=o||u,f=d.split("-"),g=N.BigInt?N.BigInt(f[0]):parseInt(f[0],10),E=N.BigInt?N.BigInt(f[1]):parseInt(f[1],10);g<Number.MAX_SAFE_INTEGER&&typeof g=="bigint"&&(g=Number(g)),E<Number.MAX_SAFE_INTEGER&&typeof E=="bigint"&&(E=Number(E));var S;typeof E=="bigint"||typeof g=="bigint"?S=N.BigInt(E)-N.BigInt(g)+N.BigInt(1):S=E-g+1,typeof S=="bigint"&&S<Number.MAX_SAFE_INTEGER&&(S=Number(S)),c.byterange={length:S,offset:g}}return c},mP=function(e){var t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=N.BigInt(e.offset)+N.BigInt(e.length)-N.BigInt(1):t=e.offset+e.length-1,e.offset+"-"+t},n_=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},gP={static:function(e){var t=e.duration,r=e.timescale,i=r===void 0?1:r,n=e.sourceDuration,a=e.periodDuration,o=n_(e.endNumber),l=t/i;return typeof o=="number"?{start:0,end:o}:typeof a=="number"?{start:0,end:a/l}:{start:0,end:n/l}},dynamic:function(e){var t=e.NOW,r=e.clientOffset,i=e.availabilityStartTime,n=e.timescale,a=n===void 0?1:n,o=e.duration,l=e.periodStart,u=l===void 0?0:l,c=e.minimumUpdatePeriod,d=c===void 0?0:c,f=e.timeShiftBufferDepth,g=f===void 0?1/0:f,E=n_(e.endNumber),S=(t+r)/1e3,k=i+u,F=S+d,L=F-k,W=Math.ceil(L*a/o),H=Math.floor((S-k-g)*a/o),$=Math.floor((S-k)*a/o);return{start:Math.max(0,H),end:typeof E=="number"?E:Math.min(W,$)}}},vP=function(e){return function(t){var r=e.duration,i=e.timescale,n=i===void 0?1:i,a=e.periodStart,o=e.startNumber,l=o===void 0?1:o;return{number:l+t,duration:r/n,timeline:a,time:t*r}}},ig=function(e){var t=e.type,r=e.duration,i=e.timescale,n=i===void 0?1:i,a=e.periodDuration,o=e.sourceDuration,l=gP[t](e),u=l.start,c=l.end,d=dP(u,c).map(vP(e));if(t==="static"){var f=d.length-1,g=typeof a=="number"?a:o;d[f].duration=g-r/n*f}return d},lS=function(e){var t=e.baseUrl,r=e.initialization,i=r===void 0?{}:r,n=e.sourceDuration,a=e.indexRange,o=a===void 0?"":a,l=e.periodStart,u=e.presentationTime,c=e.number,d=c===void 0?0:c,f=e.duration;if(!t)throw new Error(_l.NO_BASE_URL);var g=nc({baseUrl:t,source:i.sourceURL,range:i.range}),E=nc({baseUrl:t,source:t,indexRange:o});if(E.map=g,f){var S=ig(e);S.length&&(E.duration=S[0].duration,E.timeline=S[0].timeline)}else n&&(E.duration=n,E.timeline=l);return E.presentationTime=u||l,E.number=d,[E]},rg=function(e,t,r){var i=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter(function(P){return P.referenceType!==1}),d=[],f=e.endList?"static":"dynamic",g=e.sidx.timeline,E=g,S=e.mediaSequence||0,k;typeof t.firstOffset=="bigint"?k=N.BigInt(l)+t.firstOffset:k=l+t.firstOffset;for(var F=0;F<c.length;F++){var L=t.references[F],W=L.referencedSize,H=L.subsegmentDuration,$=void 0;typeof k=="bigint"?$=k+N.BigInt(W)-N.BigInt(1):$=k+W-1;var G=k+"-"+$,K={baseUrl:r,timescale:u,timeline:a,periodStart:g,presentationTime:E,number:S,duration:H,sourceDuration:n,indexRange:G,type:f},Y=lS(K)[0];i&&(Y.map=i),d.push(Y),typeof k=="bigint"?k+=N.BigInt(W):k+=W,E+=H/u,S++}return e.segments=d,e},yP=["AUDIO","SUBTITLES"],_P=1/60,uS=function(e){return pP(e,function(t){var r=t.timeline;return r}).sort(function(t,r){return t.timeline>r.timeline?1:-1})},TP=function(e,t){for(var r=0;r<e.length;r++)if(e[r].attributes.NAME===t)return e[r];return null},s_=function(e){var t=[];return hP(e,yP,function(r,i,n,a){t=t.concat(r.playlists||[])}),t},a_=function(e){var t=e.playlist,r=e.mediaSequence;t.mediaSequence=r,t.segments.forEach(function(i,n){i.number=t.mediaSequence+n})},bP=function(e){var t=e.oldPlaylists,r=e.newPlaylists,i=e.timelineStarts;r.forEach(function(n){n.discontinuitySequence=Bp(i,function(c){var d=c.timeline;return d===n.timeline});var a=TP(t,n.attributes.NAME);if(a&&!n.sidx){var o=n.segments[0],l=Bp(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<_P});if(l===-1){a_({playlist:n,mediaSequence:a.mediaSequence+a.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!a.segments.length&&n.timeline>a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--;return}var u=a.segments[l];u.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),a_({playlist:n,mediaSequence:a.segments[l].number})}})},SP=function(e){var t=e.oldManifest,r=e.newManifest,i=t.playlists.concat(s_(t)),n=r.playlists.concat(s_(r));return r.timelineStarts=uS([t.timelineStarts,r.timelineStarts]),bP({oldPlaylists:i,newPlaylists:n,timelineStarts:r.timelineStarts}),r},Ad=function(e){return e&&e.uri+"-"+mP(e.byterange)},If=function(e){var t=aS(e.reduce(function(r,i){var n=i.attributes.id+(i.attributes.lang||"");if(!r[n])r[n]=i,r[n].attributes.timelineStarts=[];else{if(i.segments){var a;i.segments[0]&&(i.segments[0].discontinuity=!0),(a=r[n].segments).push.apply(a,i.segments)}i.attributes.contentProtection&&(r[n].attributes.contentProtection=i.attributes.contentProtection)}return r[n].attributes.timelineStarts.push({start:i.attributes.periodStart,timeline:i.attributes.periodStart}),r},{}));return t.map(function(r){return r.discontinuityStarts=fP(r.segments||[],"discontinuity"),r})},ng=function(e,t){var r=Ad(e.sidx),i=r&&t[r]&&t[r].sidx;return i&&rg(e,i,e.sidx.resolvedUri),e},CP=function(e,t){if(t===void 0&&(t={}),!Object.keys(t).length)return e;for(var r in e)e[r]=ng(e[r],t);return e},EP=function(e,t){var r,i=e.attributes,n=e.segments,a=e.sidx,o=e.mediaSequence,l=e.discontinuitySequence,u=e.discontinuityStarts,c={attributes:(r={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuitySequence:l,discontinuityStarts:u,timelineStarts:i.timelineStarts,mediaSequence:o,segments:n};return i.contentProtection&&(c.contentProtection=i.contentProtection),a&&(c.sidx=a),t&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},wP=function(e){var t,r=e.attributes,i=e.segments,n=e.mediaSequence,a=e.discontinuityStarts,o=e.discontinuitySequence;typeof i>"u"&&(i=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var l=(t={NAME:r.id,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t);return r.codecs&&(l.CODECS=r.codecs),{attributes:l,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:n,segments:i}},kP=function(e,t,r){t===void 0&&(t={}),r===void 0&&(r=!1);var i,n=e.reduce(function(o,l){var u=l.attributes.role&&l.attributes.role.value||"",c=l.attributes.lang||"",d=l.attributes.label||"main";if(c&&!l.attributes.label){var f=u?" ("+u+")":"";d=""+l.attributes.lang+f}o[d]||(o[d]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});var g=ng(EP(l,r),t);return o[d].playlists.push(g),typeof i>"u"&&u==="main"&&(i=l,i.default=!0),o},{});if(!i){var a=Object.keys(n)[0];n[a].default=!0}return n},AP=function(e,t){return t===void 0&&(t={}),e.reduce(function(r,i){var n=i.attributes.lang||"text";return r[n]||(r[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),r[n].playlists.push(ng(wP(i),t)),r},{})},xP=function(e){return e.reduce(function(t,r){return r&&r.forEach(function(i){var n=i.channel,a=i.language;t[a]={autoselect:!1,default:!1,instreamId:n,language:a},i.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(t[a].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(t[a]["3D"]=i["3D"])}),t},{})},NP=function(e){var t,r=e.attributes,i=e.segments,n=e.sidx,a=e.discontinuityStarts,o={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:i};return r.frameRate&&(o.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(o.contentProtection=r.contentProtection),n&&(o.sidx=n),o},DP=function(e){var t=e.attributes;return t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video"},IP=function(e){var t=e.attributes;return t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio"},PP=function(e){var t=e.attributes;return t.mimeType==="text/vtt"||t.contentType==="text"},LP=function(e,t){e.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=Bp(t,function(i){var n=i.timeline;return n===r.timeline}),r.segments&&r.segments.forEach(function(i,n){i.number=n})})},o_=function(e){return e?Object.keys(e).reduce(function(t,r){var i=e[r];return t.concat(i.playlists)},[]):[]},OP=function(e){var t,r=e.dashPlaylists,i=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,o=e.previousManifest;if(!r.length)return{};var l=r[0].attributes,u=l.sourceDuration,c=l.type,d=l.suggestedPresentationDelay,f=l.minimumUpdatePeriod,g=If(r.filter(DP)).map(NP),E=If(r.filter(IP)),S=If(r.filter(PP)),k=r.map(function(K){return K.attributes.captionServices}).filter(Boolean),F={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:CP(g,a)};f>=0&&(F.minimumUpdatePeriod=f*1e3),i&&(F.locations=i),c==="dynamic"&&(F.suggestedPresentationDelay=d);var L=F.playlists.length===0,W=E.length?kP(E,a,L):null,H=S.length?AP(S,a):null,$=g.concat(o_(W),o_(H)),G=$.map(function(K){var Y=K.timelineStarts;return Y});return F.timelineStarts=uS(G),LP($,F.timelineStarts),W&&(F.mediaGroups.AUDIO.audio=W),H&&(F.mediaGroups.SUBTITLES.subs=H),k.length&&(F.mediaGroups["CLOSED-CAPTIONS"].cc=xP(k)),o?SP({oldManifest:o,newManifest:F}):F},MP=function(e,t,r){var i=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,l=o===void 0?1:o,u=e.periodStart,c=u===void 0?0:u,d=e.minimumUpdatePeriod,f=d===void 0?0:d,g=(i+n)/1e3,E=a+c,S=g+f,k=S-E;return Math.ceil((k*l-t)/r)},cS=function(e,t){for(var r=e.type,i=e.minimumUpdatePeriod,n=i===void 0?0:i,a=e.media,o=a===void 0?"":a,l=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,d=e.startNumber,f=d===void 0?1:d,g=e.periodStart,E=[],S=-1,k=0;k<t.length;k++){var F=t[k],L=F.d,W=F.r||0,H=F.t||0;S<0&&(S=H),H&&H>S&&(S=H);var $=void 0;if(W<0){var G=k+1;G===t.length?r==="dynamic"&&n>0&&o.indexOf("$Number$")>0?$=MP(e,S,L):$=(l*c-S)/L:$=(t[G].t-S)/L}else $=W+1;for(var K=f+E.length+$,Y=f+E.length;Y<K;)E.push({number:Y,duration:L/c,time:S,timeline:g}),S+=L,Y++}return E},RP=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,BP=function(e){return function(t,r,i,n){if(t==="$$")return"$";if(typeof e[r]>"u")return t;var a=""+e[r];return r==="RepresentationID"||(i?n=parseInt(n,10):n=1,a.length>=n)?a:""+new Array(n-a.length+1).join("0")+a}},l_=function(e,t){return e.replace(RP,BP(t))},UP=function(e,t){return!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?ig(e):cS(e,t)},FP=function(e,t){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},i=e.initialization,n=i===void 0?{sourceURL:"",range:""}:i,a=nc({baseUrl:e.baseUrl,source:l_(n.sourceURL,r),range:n.range}),o=UP(e,t);return o.map(function(l){r.Number=l.number,r.Time=l.time;var u=l_(e.media||"",r),c=e.timescale||1,d=e.presentationTimeOffset||0,f=e.periodStart+(l.time-d)/c,g={uri:u,timeline:l.timeline,duration:l.duration,resolvedUri:wd(e.baseUrl||"",u),map:a,number:l.number,presentationTime:f};return g})},$P=function(e,t){var r=e.baseUrl,i=e.initialization,n=i===void 0?{}:i,a=nc({baseUrl:r,source:n.sourceURL,range:n.range}),o=nc({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o},jP=function(e,t){var r=e.duration,i=e.segmentUrls,n=i===void 0?[]:i,a=e.periodStart;if(!r&&!t||r&&t)throw new Error(_l.SEGMENT_TIME_UNSPECIFIED);var o=n.map(function(c){return $P(e,c)}),l;r&&(l=ig(e)),t&&(l=cS(e,t));var u=l.map(function(c,d){if(o[d]){var f=o[d],g=e.timescale||1,E=e.presentationTimeOffset||0;return f.timeline=c.timeline,f.duration=c.duration,f.number=c.number,f.presentationTime=a+(c.time-E)/g,f}}).filter(function(c){return c});return u},HP=function(e){var t=e.attributes,r=e.segmentInfo,i,n;r.template?(n=FP,i=pr(t,r.template)):r.base?(n=lS,i=pr(t,r.base)):r.list&&(n=jP,i=pr(t,r.list));var a={attributes:t};if(!n)return a;var o=n(i,r.segmentTimeline);if(i.duration){var l=i,u=l.duration,c=l.timescale,d=c===void 0?1:c;i.duration=u/d}else o.length?i.duration=o.reduce(function(f,g){return Math.max(f,Math.ceil(g.duration))},0):i.duration=0;return a.attributes=i,a.segments=o,r.base&&i.indexRange&&(a.sidx=o[0],a.segments=[]),a},VP=function(e){return e.map(HP)},gi=function(e,t){return oS(e.childNodes).filter(function(r){var i=r.tagName;return i===t})},sg=function(e){return e.textContent.trim()},qP=function(e){return parseFloat(e.split("/").reduce(function(t,r){return t/r}))},Ro=function(e){var t=31536e3,r=720*60*60,i=1440*60,n=3600,a=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,l=o.exec(e);if(!l)return 0;var u=l.slice(1),c=u[0],d=u[1],f=u[2],g=u[3],E=u[4],S=u[5];return parseFloat(c||0)*t+parseFloat(d||0)*r+parseFloat(f||0)*i+parseFloat(g||0)*n+parseFloat(E||0)*a+parseFloat(S||0)},zP=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},u_={mediaPresentationDuration:function(e){return Ro(e)},availabilityStartTime:function(e){return zP(e)/1e3},minimumUpdatePeriod:function(e){return Ro(e)},suggestedPresentationDelay:function(e){return Ro(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ro(e)},start:function(e){return Ro(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return qP(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ro(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Zi=function(e){return e&&e.attributes?oS(e.attributes).reduce(function(t,r){var i=u_[r.name]||u_.DEFAULT;return t[r.name]=i(r.value),t},{}):{}},WP={"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"},xd=function(e,t){return t.length?kd(e.map(function(r){return t.map(function(i){return wd(r,sg(i))})})):e},ag=function(e){var t=gi(e,"SegmentTemplate")[0],r=gi(e,"SegmentList")[0],i=r&&gi(r,"SegmentURL").map(function(f){return pr({tag:"SegmentURL"},Zi(f))}),n=gi(e,"SegmentBase")[0],a=r||t,o=a&&gi(a,"SegmentTimeline")[0],l=r||n||t,u=l&&gi(l,"Initialization")[0],c=t&&Zi(t);c&&u?c.initialization=u&&Zi(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var d={template:c,segmentTimeline:o&&gi(o,"S").map(function(f){return Zi(f)}),list:r&&pr(Zi(r),{segmentUrls:i,initialization:Zi(u)}),base:n&&pr(Zi(n),{initialization:Zi(u)})};return Object.keys(d).forEach(function(f){d[f]||delete d[f]}),d},GP=function(e,t,r){return function(i){var n=gi(i,"BaseURL"),a=xd(t,n),o=pr(e,Zi(i)),l=ag(i);return a.map(function(u){return{segmentInfo:pr(r,l),attributes:pr(o,{baseUrl:u})}})}},KP=function(e){return e.reduce(function(t,r){var i=Zi(r);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());var n=WP[i.schemeIdUri];if(n){t[n]={attributes:i};var a=gi(r,"cenc:pssh")[0];if(a){var o=sg(a);t[n].pssh=o&&eS(o)}}return t},{})},XP=function(e){if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var t=typeof e.value!="string"?[]:e.value.split(";");return t.map(function(i){var n,a;if(a=i,/^CC\d=/.test(i)){var o=i.split("=");n=o[0],a=o[1]}else/^CC\d$/.test(i)&&(n=i);return{channel:n,language:a}})}else if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var r=typeof e.value!="string"?[]:e.value.split(";");return r.map(function(i){var n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){var a=i.split("="),o=a[0],l=a[1],u=l===void 0?"":l;n.channel=o,n.language=i,u.split(",").forEach(function(c){var d=c.split(":"),f=d[0],g=d[1];f==="lang"?n.language=g:f==="er"?n.easyReader=Number(g):f==="war"?n.aspectRatio=Number(g):f==="3D"&&(n["3D"]=Number(g))})}else n.language=i;return n.channel&&(n.channel="SERVICE"+n.channel),n})}},YP=function(e,t,r){return function(i){var n=Zi(i),a=xd(t,gi(i,"BaseURL")),o=gi(i,"Role")[0],l={role:Zi(o)},u=pr(e,n,l),c=gi(i,"Accessibility")[0],d=XP(Zi(c));d&&(u=pr(u,{captionServices:d}));var f=gi(i,"Label")[0];if(f&&f.childNodes.length){var g=f.childNodes[0].nodeValue.trim();u=pr(u,{label:g})}var E=KP(gi(i,"ContentProtection"));Object.keys(E).length&&(u=pr(u,{contentProtection:E}));var S=ag(i),k=gi(i,"Representation"),F=pr(r,S);return kd(k.map(GP(u,a,F)))}},QP=function(e,t){return function(r,i){var n=xd(t,gi(r.node,"BaseURL")),a=pr(e,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var o=gi(r.node,"AdaptationSet"),l=ag(r.node);return kd(o.map(YP(a,n,l)))}},JP=function(e){var t=e.attributes,r=e.priorPeriodAttributes,i=e.mpdType;return typeof t.start=="number"?t.start:r&&typeof r.start=="number"&&typeof r.duration=="number"?r.start+r.duration:!r&&i==="static"?0:null},ZP=function(e,t){t===void 0&&(t={});var r=t,i=r.manifestUri,n=i===void 0?"":i,a=r.NOW,o=a===void 0?Date.now():a,l=r.clientOffset,u=l===void 0?0:l,c=gi(e,"Period");if(!c.length)throw new Error(_l.INVALID_NUMBER_OF_PERIOD);var d=gi(e,"Location"),f=Zi(e),g=xd([n],gi(e,"BaseURL"));f.type=f.type||"static",f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=o,f.clientOffset=u,d.length&&(f.locations=d.map(sg));var E=[];return c.forEach(function(S,k){var F=Zi(S),L=E[k-1];F.start=JP({attributes:F,priorPeriodAttributes:L?L.attributes:null,mpdType:f.type}),E.push({node:S,attributes:F})}),{locations:f.locations,representationInfo:kd(E.map(QP(f,g)))}},hS=function(e){if(e==="")throw new Error(_l.DASH_EMPTY_MANIFEST);var t=new yT.DOMParser,r,i;try{r=t.parseFromString(e,"application/xml"),i=r&&r.documentElement.tagName==="MPD"?r.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(_l.DASH_INVALID_XML);return i},eL=function(e){var t=gi(e,"UTCTiming")[0];if(!t)return null;var r=Zi(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.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(_l.UNSUPPORTED_UTC_TIMING_SCHEME)}return r},tL=function(e,t){t===void 0&&(t={});var r=ZP(hS(e),t),i=VP(r.representationInfo);return OP({dashPlaylists:i,locations:r.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},iL=function(e){return eL(hS(e))},Pf,c_;function rL(){if(c_)return Pf;c_=1;var s=Math.pow(2,32),e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i;return r.getBigUint64?(i=r.getBigUint64(0),i<Number.MAX_SAFE_INTEGER?Number(i):i):r.getUint32(0)*s+r.getUint32(4)};return Pf={getUint64:e,MAX_UINT32:s},Pf}var Lf,h_;function nL(){if(h_)return Lf;h_=1;var s=rL().getUint64,e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},n=12;i.version===0?(i.earliestPresentationTime=r.getUint32(n),i.firstOffset=r.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(t.subarray(n)),i.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=r.getUint16(n);for(n+=2;a>0;n+=12,a--)i.references.push({referenceType:(t[n]&128)>>>7,referencedSize:r.getUint32(n)&2147483647,subsegmentDuration:r.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:r.getUint32(n+8)&268435455});return i};return Lf=e,Lf}var sL=nL();const aL=Ln(sL);var oL=Je([73,68,51]),lL=function(e,t){t===void 0&&(t=0),e=Je(e);var r=e[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?i+20:i+10},Fu=function s(e,t){return t===void 0&&(t=0),e=Je(e),e.length-t<10||!si(e,oL,{offset:t})?t:(t+=lL(e,t),s(e,t))},d_=function(e){return typeof e=="string"?sS(e):e},uL=function(e){return Array.isArray(e)?e.map(function(t){return d_(t)}):[d_(e)]},cL=function s(e,t,r){r===void 0&&(r=!1),t=uL(t),e=Je(e);var i=[];if(!t.length)return i;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(r)break;l=e.length}var u=e.subarray(n+8,l);si(o,t[0])&&(t.length===1?i.push(u):i.push.apply(i,s(u,t.slice(1),r))),n=l}return i},Fc={EBML:Je([26,69,223,163]),DocType:Je([66,130]),Segment:Je([24,83,128,103]),SegmentInfo:Je([21,73,169,102]),Tracks:Je([22,84,174,107]),Track:Je([174]),TrackNumber:Je([215]),DefaultDuration:Je([35,227,131]),TrackEntry:Je([174]),TrackType:Je([131]),FlagDefault:Je([136]),CodecID:Je([134]),CodecPrivate:Je([99,162]),VideoTrack:Je([224]),AudioTrack:Je([225]),Cluster:Je([31,67,182,117]),Timestamp:Je([231]),TimestampScale:Je([42,215,177]),BlockGroup:Je([160]),BlockDuration:Je([155]),Block:Je([161]),SimpleBlock:Je([163])},Up=[128,64,32,16,8,4,2,1],hL=function(e){for(var t=1,r=0;r<Up.length&&!(e&Up[r]);r++)t++;return t},Mh=function(e,t,r,i){r===void 0&&(r=!0),i===void 0&&(i=!1);var n=hL(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Up[n-1]),{length:n,value:lP(a,{signed:i}),bytes:a}},f_=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?uP(e):e},dL=function(e){return Array.isArray(e)?e.map(function(t){return f_(t)}):[f_(e)]},fL=function s(e,t,r){if(r>=t.length)return t.length;var i=Mh(t,r,!1);if(si(e.bytes,i.bytes))return r;var n=Mh(t,r+i.length);return s(e,t,r+n.length+n.value+i.length)},p_=function s(e,t){t=dL(t),e=Je(e);var r=[];if(!t.length)return r;for(var i=0;i<e.length;){var n=Mh(e,i,!1),a=Mh(e,i+n.length),o=i+n.length+a.length;a.value===127&&(a.value=fL(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);si(t[0],n.bytes)&&(t.length===1?r.push(u):r=r.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;i+=c}return r},pL=Je([0,0,0,1]),mL=Je([0,0,1]),gL=Je([0,0,3]),vL=function(e){for(var t=[],r=1;r<e.length-2;)si(e.subarray(r,r+3),gL)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var i=e.length-t.length,n=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},dS=function(e,t,r,i){e=Je(e),r=[].concat(r);for(var n=0,a,o=0;n<e.length&&(o<i||a);){var l=void 0;if(si(e.subarray(n),pL)?l=4:si(e.subarray(n),mL)&&(l=3),!l){n++;continue}if(o++,a)return vL(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),r.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},yL=function(e,t,r){return dS(e,"h264",t,r)},_L=function(e,t,r){return dS(e,"h265",t,r)},cr={webm:Je([119,101,98,109]),matroska:Je([109,97,116,114,111,115,107,97]),flac:Je([102,76,97,67]),ogg:Je([79,103,103,83]),ac3:Je([11,119]),riff:Je([82,73,70,70]),avi:Je([65,86,73]),wav:Je([87,65,86,69]),"3gp":Je([102,116,121,112,51,103]),mp4:Je([102,116,121,112]),fmp4:Je([115,116,121,112]),mov:Je([102,116,121,112,113,116]),moov:Je([109,111,111,118]),moof:Je([109,111,111,102])},Tl={aac:function(e){var t=Fu(e);return si(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Fu(e);return si(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=p_(e,[Fc.EBML,Fc.DocType])[0];return si(t,cr.webm)},mkv:function(e){var t=p_(e,[Fc.EBML,Fc.DocType])[0];return si(t,cr.matroska)},mp4:function(e){if(Tl["3gp"](e)||Tl.mov(e))return!1;if(si(e,cr.mp4,{offset:4})||si(e,cr.fmp4,{offset:4})||si(e,cr.moof,{offset:4})||si(e,cr.moov,{offset:4}))return!0},mov:function(e){return si(e,cr.mov,{offset:4})},"3gp":function(e){return si(e,cr["3gp"],{offset:4})},ac3:function(e){var t=Fu(e);return si(e,cr.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=Fu(e);return si(e,cr.flac,{offset:t})},ogg:function(e){return si(e,cr.ogg)},avi:function(e){return si(e,cr.riff)&&si(e,cr.avi,{offset:8})},wav:function(e){return si(e,cr.riff)&&si(e,cr.wav,{offset:8})},h264:function(e){return yL(e,7,3).length},h265:function(e){return _L(e,[32,33],3).length}},Fp=Object.keys(Tl).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);Fp.forEach(function(s){var e=Tl[s];Tl[s]=function(t){return e(Je(t))}});var TL=Tl,og=function(e){e=Je(e);for(var t=0;t<Fp.length;t++){var r=Fp[t];if(TL[r](e))return r}return""},bL=function(e){return cL(e,["moof"]).length>0},Of,m_;function SL(){if(m_)return Of;m_=1;var s=9e4,e,t,r,i,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},r=function(l){return l/s},i=function(l,u){return l/u},n=function(l,u){return e(i(l,u))},a=function(l,u){return t(r(l),u)},o=function(l,u,c){return r(c?l:l-u)},Of={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},Of}var Rh=SL();function CL(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function $p(s){var e=typeof Map=="function"?new Map:void 0;return $p=function(r){if(r===null||!CL(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return Z1(r,arguments,sp(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),hm(i,r)},$p(s)}/**
|
|
301
|
+
* @license
|
|
302
|
+
* Video.js 7.21.7 <http://videojs.com/>
|
|
303
|
+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
304
|
+
* Available under Apache License Version 2.0
|
|
305
|
+
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
306
|
+
*
|
|
307
|
+
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
308
|
+
* Available under Apache License Version 2.0
|
|
309
|
+
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
310
|
+
*/var fS="7.21.7",js={},Aa=function(e,t){return js[e]=js[e]||[],t&&(js[e]=js[e].concat(t)),js[e]},EL=function(e,t){Aa(e,t)},pS=function(e,t){var r=Aa(e).indexOf(t);return r<=-1?!1:(js[e]=js[e].slice(),js[e].splice(r,1),!0)},wL=function(e,t){Aa(e,[].concat(t).map(function(r){var i=function n(){return pS(e,n),r.apply(void 0,arguments)};return i}))},Bh={prefixed:!0},sh=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],g_=sh[0],$u;for(var $c=0;$c<sh.length;$c++)if(sh[$c][1]in de){$u=sh[$c];break}if($u){for(var jc=0;jc<$u.length;jc++)Bh[g_[jc]]=$u[jc];Bh.prefixed=$u[0]!==g_[0]}var xr=[],kL=function(e,t){return function(r,i,n){var a=t.levels[i],o=new RegExp("^("+a+")$");if(r!=="log"&&n.unshift(r.toUpperCase()+":"),n.unshift(e+":"),xr){xr.push([].concat(n));var l=xr.length-1e3;xr.splice(0,l>0?l:0)}if(N.console){var u=N.console[r];!u&&r==="debug"&&(u=N.console.info||N.console.log),!(!u||!a||!o.test(r))&&u[Array.isArray(n)?"apply":"call"](N.console,n)}}};function mS(s){var e="info",t,r=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];t("log",e,a)};return t=kL(s,r),r.createLogger=function(i){return mS(s+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:e},r.level=function(i){if(typeof i=="string"){if(!r.levels.hasOwnProperty(i))throw new Error('"'+i+'" in not a valid log level');e=i}return e},r.history=function(){return xr?[].concat(xr):[]},r.history.filter=function(i){return(xr||[]).filter(function(n){return new RegExp(".*"+i+".*").test(n[0])})},r.history.clear=function(){xr&&(xr.length=0)},r.history.disable=function(){xr!==null&&(xr.length=0,xr=null)},r.history.enable=function(){xr===null&&(xr=[])},r.error=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("error",e,n)},r.warn=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("warn",e,n)},r.debug=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("debug",e,n)},r}var pt=mS("VIDEOJS"),gS=pt.createLogger,AL=Object.prototype.toString,vS=function(e){return Ws(e)?Object.keys(e):[]};function nl(s,e){vS(s).forEach(function(t){return e(s[t],t)})}function xL(s,e,t){return t===void 0&&(t=0),vS(s).reduce(function(r,i){return e(r,s[i],i)},t)}function fi(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Object.assign?jt.apply(void 0,[s].concat(t)):(t.forEach(function(i){i&&nl(i,function(n,a){s[a]=n})}),s)}function Ws(s){return!!s&&typeof s=="object"}function sc(s){return Ws(s)&&AL.call(s)==="[object Object]"&&s.constructor===Object}function ac(s,e){if(!s||!e)return"";if(typeof N.getComputedStyle=="function"){var t;try{t=N.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}var Hi=N.navigator&&N.navigator.userAgent||"",v_=/AppleWebKit\/([\d.]+)/i.exec(Hi),NL=v_?parseFloat(v_.pop()):null,yS=/iPod/i.test(Hi),DL=(function(){var s=Hi.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null})(),Xs=/Android/i.test(Hi),lg=(function(){var s=Hi.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!s)return null;var e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]);return e&&t?parseFloat(s[1]+"."+s[2]):e||null})(),_S=Xs&&lg<5&&NL<537,TS=/Firefox/i.test(Hi),yc=/Edg/i.test(Hi),Ys=!yc&&(/Chrome/i.test(Hi)||/CriOS/i.test(Hi)),bS=(function(){var s=Hi.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null})(),_c=(function(){var s=/MSIE\s(\d+)\.\d/.exec(Hi),e=s&&parseFloat(s[1]);return!e&&/Trident\/7.0/i.test(Hi)&&/rv:11.0/.test(Hi)&&(e=11),e})(),ug=/Safari/i.test(Hi)&&!Ys&&!Xs&&!yc,SS=/Windows/i.test(Hi),bl=!!(Rl()&&("ontouchstart"in N||N.navigator.maxTouchPoints||N.DocumentTouch&&N.document instanceof N.DocumentTouch)),cg=/iPad/i.test(Hi)||ug&&bl&&!/iPhone/i.test(Hi),hg=/iPhone/i.test(Hi)&&!cg,_r=hg||cg||yS,Nd=(ug||_r)&&!Ys,IL=Object.freeze({__proto__:null,IS_IPOD:yS,IOS_VERSION:DL,IS_ANDROID:Xs,ANDROID_VERSION:lg,IS_NATIVE_ANDROID:_S,IS_FIREFOX:TS,IS_EDGE:yc,IS_CHROME:Ys,CHROME_VERSION:bS,IE_VERSION:_c,IS_SAFARI:ug,IS_WINDOWS:SS,TOUCH_ENABLED:bl,IS_IPAD:cg,IS_IPHONE:hg,IS_IOS:_r,IS_ANY_SAFARI:Nd});function y_(s){return typeof s=="string"&&!!s.trim()}function CS(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function PL(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function Rl(){return de===N.document}function Bl(s){return Ws(s)&&s.nodeType===1}function ES(){try{return N.parent!==N.self}catch{return!0}}function wS(s){return function(e,t){if(!y_(e))return de[s](null);y_(t)&&(t=de.querySelector(t));var r=Bl(t)?t:de;return r[s]&&r[s](e)}}function St(s,e,t,r){s===void 0&&(s="div"),e===void 0&&(e={}),t===void 0&&(t={});var i=de.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){var a=e[n];n.indexOf("aria-")!==-1||n==="role"||n==="type"?(pt.warn(`Setting attributes in the second argument of createEl()
|
|
311
|
+
has been deprecated. Use the third argument instead.
|
|
312
|
+
`+("createEl(type, properties, attributes). Attempting to set "+n+" to "+a+".")),i.setAttribute(n,a)):n==="textContent"?co(i,a):(i[n]!==a||n==="tabIndex")&&(i[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){i.setAttribute(n,t[n])}),r&&fg(i,r),i}function co(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function jp(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ao(s,e){return CS(e),s.classList?s.classList.contains(e):PL(e).test(s.className)}function qs(s,e){return s.classList?s.classList.add(e):ao(s,e)||(s.className=(s.className+" "+e).trim()),s}function Tc(s,e){return s?(s.classList?s.classList.remove(e):(CS(e),s.className=s.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),s):(pt.warn("removeClass was called with an element that doesn't exist"),null)}function kS(s,e,t){var r=ao(s,e);if(typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=!r),t!==r)return t?qs(s,e):Tc(s,e),s}function AS(s,e){Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];r===null||typeof r>"u"||r===!1?s.removeAttribute(t):s.setAttribute(t,r===!0?"":r)})}function Bs(s){var e={},t=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(s&&s.attributes&&s.attributes.length>0)for(var r=s.attributes,i=r.length-1;i>=0;i--){var n=r[i].name,a=r[i].value;(typeof s[n]=="boolean"||t.indexOf(","+n+",")!==-1)&&(a=a!==null),e[n]=a}return e}function xS(s,e){return s.getAttribute(e)}function Sl(s,e,t){s.setAttribute(e,t)}function Dd(s,e){s.removeAttribute(e)}function NS(){de.body.focus(),de.onselectstart=function(){return!1}}function DS(){de.onselectstart=function(){return!0}}function Cl(s){if(s&&s.getBoundingClientRect&&s.parentNode){var e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(r){e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(ac(s,"height"))),t.width||(t.width=parseFloat(ac(s,"width"))),t}}function oc(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var e=s.offsetWidth,t=s.offsetHeight,r=0,i=0;s.offsetParent&&s!==de[Bh.fullscreenElement];)r+=s.offsetLeft,i+=s.offsetTop,s=s.offsetParent;return{left:r,top:i,width:e,height:t}}function Id(s,e){var t={x:0,y:0};if(_r)for(var r=s;r&&r.nodeName.toLowerCase()!=="html";){var i=ac(r,"transform");if(/^matrix/.test(i)){var n=i.slice(7,-1).split(/,\s/).map(Number);t.x+=n[4],t.y+=n[5]}else if(/^matrix3d/.test(i)){var a=i.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}r=r.parentNode}var o={},l=oc(e.target),u=oc(s),c=u.width,d=u.height,f=e.offsetY-(u.top-l.top),g=e.offsetX-(u.left-l.left);return e.changedTouches&&(g=e.changedTouches[0].pageX-u.left,f=e.changedTouches[0].pageY+u.top,_r&&(g-=t.x,f-=t.y)),o.y=1-Math.max(0,Math.min(1,f/d)),o.x=Math.max(0,Math.min(1,g/c)),o}function IS(s){return Ws(s)&&s.nodeType===3}function dg(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function PS(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(e){if(typeof e=="function"&&(e=e()),Bl(e)||IS(e))return e;if(typeof e=="string"&&/\S/.test(e))return de.createTextNode(e)}).filter(function(e){return e})}function fg(s,e){return PS(e).forEach(function(t){return s.appendChild(t)}),s}function LS(s,e){return fg(dg(s),e)}function lc(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}var xa=wS("querySelector"),OS=wS("querySelectorAll"),MS=Object.freeze({__proto__:null,isReal:Rl,isEl:Bl,isInFrame:ES,createEl:St,textContent:co,prependTo:jp,hasClass:ao,addClass:qs,removeClass:Tc,toggleClass:kS,setAttributes:AS,getAttributes:Bs,getAttribute:xS,setAttribute:Sl,removeAttribute:Dd,blockTextSelection:NS,unblockTextSelection:DS,getBoundingClientRect:Cl,findPosition:oc,getPointerPosition:Id,isTextNode:IS,emptyEl:dg,normalizeContent:PS,appendContent:fg,insertContent:LS,isSingleLeftClick:lc,$:xa,$$:OS}),RS=!1,Hp,LL=function(){if(Hp.options.autoSetup!==!1){var e=Array.prototype.slice.call(de.getElementsByTagName("video")),t=Array.prototype.slice.call(de.getElementsByTagName("audio")),r=Array.prototype.slice.call(de.getElementsByTagName("video-js")),i=e.concat(t,r);if(i&&i.length>0)for(var n=0,a=i.length;n<a;n++){var o=i[n];if(o&&o.getAttribute){if(o.player===void 0){var l=o.getAttribute("data-setup");l!==null&&Hp(o)}}else{Vp(1);break}}else RS||Vp(1)}};function Vp(s,e){Rl()&&(e&&(Hp=e),N.setTimeout(LL,s))}function qp(){RS=!0,N.removeEventListener("load",qp)}Rl()&&(de.readyState==="complete"?qp():N.addEventListener("load",qp));var BS=function(e){var t=de.createElement("style");return t.className=e,t},US=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},OL=3,ML=OL;function Qs(){return ML++}var FS;N.WeakMap||(FS=(function(){function s(){this.vdata="vdata"+Math.floor(N.performance&&N.performance.now()||Date.now()),this.data={}}var e=s.prototype;return e.set=function(r,i){var n=r[this.vdata]||Qs();return r[this.vdata]||(r[this.vdata]=n),this.data[n]=i,this},e.get=function(r){var i=r[this.vdata];if(i)return this.data[i];pt("We have no data for this element",r)},e.has=function(r){var i=r[this.vdata];return i in this.data},e.delete=function(r){var i=r[this.vdata];i&&(delete this.data[i],delete r[this.vdata])},s})());var mr=N.WeakMap?new WeakMap:new FS;function __(s,e){if(mr.has(s)){var t=mr.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.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&&mr.delete(s)}}function pg(s,e,t,r){t.forEach(function(i){s(e,i,r)})}function Pd(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var r=s||N.event;s={};for(var i in r)i!=="layerX"&&i!=="layerY"&&i!=="keyLocation"&&i!=="webkitMovementX"&&i!=="webkitMovementY"&&i!=="path"&&(i==="returnValue"&&r.preventDefault||(s[i]=r[i]));if(s.target||(s.target=s.srcElement||de),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){r.preventDefault&&r.preventDefault(),s.returnValue=!1,r.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),s.cancelBubble=!0,r.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){var n=de.documentElement,a=de.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}var Hc,RL=function(){if(typeof Hc!="boolean"){Hc=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Hc=!0}});N.addEventListener("test",null,e),N.removeEventListener("test",null,e)}catch{}}return Hc},BL=["touchstart","touchmove"];function Yr(s,e,t){if(Array.isArray(e))return pg(Yr,s,e,t);mr.has(s)||mr.set(s,{});var r=mr.get(s);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=Qs()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(n,a){if(!r.disabled){n=Pd(n);var o=r.handlers[n.type];if(o)for(var l=o.slice(0),u=0,c=l.length;u<c&&!n.isImmediatePropagationStopped();u++)try{l[u].call(s,n,a)}catch(d){pt.error(d)}}}),r.handlers[e].length===1)if(s.addEventListener){var i=!1;RL()&&BL.indexOf(e)>-1&&(i={passive:!0}),s.addEventListener(e,r.dispatcher,i)}else s.attachEvent&&s.attachEvent("on"+e,r.dispatcher)}function rr(s,e,t){if(mr.has(s)){var r=mr.get(s);if(r.handlers){if(Array.isArray(e))return pg(rr,s,e,t);var i=function(u,c){r.handlers[c]=[],__(u,c)};if(e===void 0){for(var n in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},n)&&i(s,n);return}var a=r.handlers[e];if(a){if(!t){i(s,e);return}if(t.guid)for(var o=0;o<a.length;o++)a[o].guid===t.guid&&a.splice(o--,1);__(s,e)}}}}function Ul(s,e,t){var r=mr.has(s)?mr.get(s):{},i=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Pd(e),r.dispatcher&&r.dispatcher.call(s,e,t),i&&!e.isPropagationStopped()&&e.bubbles===!0)Ul.call(null,i,e,t);else if(!i&&!e.defaultPrevented&&e.target&&e.target[e.type]){mr.has(e.target)||mr.set(e.target,{});var n=mr.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 Ld(s,e,t){if(Array.isArray(e))return pg(Ld,s,e,t);var r=function i(){rr(s,e,i),t.apply(this,arguments)};r.guid=t.guid=t.guid||Qs(),Yr(s,e,r)}function $S(s,e,t){var r=function i(){rr(s,e,i),t.apply(this,arguments)};r.guid=t.guid=t.guid||Qs(),Yr(s,e,r)}var UL=Object.freeze({__proto__:null,fixEvent:Pd,on:Yr,off:rr,trigger:Ul,one:Ld,any:$S}),Pn=30,ti=function(e,t,r){t.guid||(t.guid=Qs());var i=t.bind(e);return i.guid=r?r+"_"+t.guid:t.guid,i},Gs=function(e,t){var r=N.performance.now(),i=function(){var a=N.performance.now();a-r>=t&&(e.apply(void 0,arguments),r=a)};return i},FL=function(e,t,r,i){i===void 0&&(i=N);var n,a=function(){i.clearTimeout(n),n=null},o=function(){var u=this,c=arguments,d=function(){n=null,d=null,e.apply(u,c)};i.clearTimeout(n),n=i.setTimeout(d,t)};return o.cancel=a,o},Vi=function(){};Vi.prototype.allowedEvents_={};Vi.prototype.on=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},Yr(this,s,e),this.addEventListener=t};Vi.prototype.addEventListener=Vi.prototype.on;Vi.prototype.off=function(s,e){rr(this,s,e)};Vi.prototype.removeEventListener=Vi.prototype.off;Vi.prototype.one=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},Ld(this,s,e),this.addEventListener=t};Vi.prototype.any=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},$S(this,s,e),this.addEventListener=t};Vi.prototype.trigger=function(s){var e=s.type||s;typeof s=="string"&&(s={type:e}),s=Pd(s),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](s),Ul(this,s)};Vi.prototype.dispatchEvent=Vi.prototype.trigger;var Nu;Vi.prototype.queueTrigger=function(s){var e=this;Nu||(Nu=new Map);var t=s.type||s,r=Nu.get(this);r||(r=new Map,Nu.set(this,r));var i=r.get(t);r.delete(t),N.clearTimeout(i);var n=N.setTimeout(function(){r.delete(t),r.size===0&&(r=null,Nu.delete(e)),e.trigger(s)},0);r.set(t,n)};var Od=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},zs=function(e){return e instanceof Vi||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return typeof e[t]=="function"})},$L=function(e,t){zs(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},zp=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Uh=function(e,t,r){if(!e||!e.nodeName&&!zs(e))throw new Error("Invalid target for "+Od(t)+"#"+r+"; must be a DOM node or evented object.")},jS=function(e,t,r){if(!zp(e))throw new Error("Invalid event type for "+Od(t)+"#"+r+"; must be a non-empty string or array.")},HS=function(e,t,r){if(typeof e!="function")throw new Error("Invalid listener for "+Od(t)+"#"+r+"; must be a function.")},Mf=function(e,t,r){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n,a,o;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(n=t[0],a=t[1],o=t[2]),Uh(n,e,r),jS(a,e,r),HS(o,e,r),o=ti(e,o),{isTargetingSelf:i,target:n,type:a,listener:o}},za=function(e,t,r,i){Uh(e,e,t),e.nodeName?UL[t](e,r,i):e[t](r,i)},jL={on:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Mf(this,r,"on"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(za(o,"on",l,u),!a){var c=function(){return e.off(o,l,u)};c.guid=u.guid;var d=function(){return e.off("dispose",c)};d.guid=u.guid,za(this,"on","dispose",c),za(o,"on","dispose",d)}},one:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Mf(this,r,"one"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)za(o,"one",l,u);else{var c=function d(){e.off(o,l,d);for(var f=arguments.length,g=new Array(f),E=0;E<f;E++)g[E]=arguments[E];u.apply(null,g)};c.guid=u.guid,za(o,"one",l,c)}},any:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Mf(this,r,"any"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)za(o,"any",l,u);else{var c=function d(){e.off(o,l,d);for(var f=arguments.length,g=new Array(f),E=0;E<f;E++)g[E]=arguments[E];u.apply(null,g)};c.guid=u.guid,za(o,"any",l,c)}},off:function(e,t,r){if(!e||zp(e))rr(this.eventBusEl_,e,t);else{var i=e,n=t;Uh(i,this,"off"),jS(n,this,"off"),HS(r,this,"off"),r=ti(this,r),this.off("dispose",r),i.nodeName?(rr(i,n,r),rr(i,"dispose",r)):zs(i)&&(i.off(n,r),i.off("dispose",r))}},trigger:function(e,t){Uh(this.eventBusEl_,this,"trigger");var r=e&&typeof e!="string"?e.type:e;if(!zp(r)){var i="Invalid event type for "+Od(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(e)(this.log||pt).error(i);else throw new Error(i)}return Ul(this.eventBusEl_,e,t)}};function mg(s,e){e===void 0&&(e={});var t=e,r=t.eventBusKey;if(r){if(!s[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');s.eventBusEl_=s[r]}else s.eventBusEl_=St("span",{className:"vjs-event-bus"});return fi(s,jL),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(i){i()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&mr.has(i)&&mr.delete(i)}),N.setTimeout(function(){s.eventBusEl_=null},0)}),s}var HL={state:{},setState:function(e){var t=this;typeof e=="function"&&(e=e());var r;return nl(e,function(i,n){t.state[n]!==i&&(r=r||{},r[n]={from:t.state[n],to:i}),t.state[n]=i}),r&&zs(this)&&this.trigger({changes:r,type:"statechanged"}),r}};function VS(s,e){return fi(s,HL),s.state=fi({},s.state,e),typeof s.handleStateChanged=="function"&&zs(s)&&s.on("statechanged",s.handleStateChanged),s}var ah=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toLowerCase()})},vi=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},VL=function(e,t){return vi(e)===vi(t)};function ei(){for(var s={},e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.forEach(function(i){i&&nl(i,function(n,a){if(!sc(n)){s[a]=n;return}sc(s[a])||(s[a]={}),s[a]=ei(s[a],n)})}),s}var qL=(function(){function s(){this.map_={}}var e=s.prototype;return e.has=function(r){return r in this.map_},e.delete=function(r){var i=this.has(r);return delete this.map_[r],i},e.set=function(r,i){return this.map_[r]=i,this},e.forEach=function(r,i){for(var n in this.map_)r.call(i,this.map_[n],n,this)},s})(),zL=N.Map?N.Map:qL,WL=(function(){function s(){this.set_={}}var e=s.prototype;return e.has=function(r){return r in this.set_},e.delete=function(r){var i=this.has(r);return delete this.set_[r],i},e.add=function(r){return this.set_[r]=1,this},e.forEach=function(r,i){for(var n in this.set_)r.call(i,n,n,this)},s})(),Rf=N.Set?N.Set:WL,De=(function(){function s(t,r,i){var n=this;if(!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ei({},this.options_),r=this.options_=ei(this.options_,r),this.id_=r.id||r.el&&r.el.id,!this.id_){var a=t&&t.id&&t.id()||"no_player";this.id_=a+"_component_"+Qs()}this.name_=r.name||null,r.el?this.el_=r.el:r.createEl!==!1&&(this.el_=this.createEl()),r.className&&this.el_&&r.className.split(" ").forEach(function(o){return n.addClass(o)}),r.evented!==!1&&(mg(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),VS(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Rf,this.setIntervalIds_=new Rf,this.rafIds_=new Rf,this.namedRafs_=new zL,this.clearingTimersOnDispose_=!1,r.initChildren!==!1&&this.initChildren(),this.ready(i),r.reportTouchActivity!==!1&&this.enableTouchActivity()}var e=s.prototype;return e.dispose=function(r){if(r===void 0&&(r={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},e.isDisposed=function(){return!!this.isDisposed_},e.player=function(){return this.player_},e.options=function(r){return r?(this.options_=ei(this.options_,r),this.options_):this.options_},e.el=function(){return this.el_},e.createEl=function(r,i,n){return St(r,i,n)},e.localize=function(r,i,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],u=a&&a.split("-")[0],c=o&&o[u],d=n;return l&&l[r]?d=l[r]:c&&c[r]&&(d=c[r]),i&&(d=d.replace(/\{(\d+)\}/g,function(f,g){var E=i[g-1],S=E;return typeof E>"u"&&(S=f),S})),d},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(r){return this.childIndex_[r]},e.getChild=function(r){if(r)return this.childNameIndex_[r]},e.getDescendant=function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];i=i.reduce(function(l,u){return l.concat(u)},[]);for(var a=this,o=0;o<i.length;o++)if(a=a.getChild(i[o]),!a||!a.getChild)return;return a},e.addChild=function(r,i,n){i===void 0&&(i={}),n===void 0&&(n=this.children_.length);var a,o;if(typeof r=="string"){o=vi(r);var l=i.componentClass||o;i.name=o;var u=s.getComponent(l);if(!u)throw new Error("Component "+l+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,i)}else a=r;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),o=o||a.name&&vi(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[ah(o)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[n+1]&&(this.children_[n+1].el_?c=this.children_[n+1].el_:Bl(this.children_[n+1])&&(c=this.children_[n+1])),this.contentEl().insertBefore(a.el(),c)}return a},e.removeChild=function(r){if(typeof r=="string"&&(r=this.getChild(r)),!(!r||!this.children_)){for(var i=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===r){i=!0,this.children_.splice(n,1);break}if(i){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[vi(r.name())]=null,this.childNameIndex_[ah(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},e.initChildren=function(){var r=this,i=this.options_.children;if(i){var n=this.options_,a=function(c){var d=c.name,f=c.opts;if(n[d]!==void 0&&(f=n[d]),f!==!1){f===!0&&(f={}),f.playerOptions=r.options_.playerOptions;var g=r.addChild(d,f);g&&(r[d]=g)}},o,l=s.getComponent("Tech");Array.isArray(i)?o=i:o=Object.keys(i),o.concat(Object.keys(this.options_).filter(function(u){return!o.some(function(c){return typeof c=="string"?u===c:u===c.name})})).map(function(u){var c,d;return typeof u=="string"?(c=u,d=i[c]||r.options_[c]||{}):(c=u.name,d=u),{name:c,opts:d}}).filter(function(u){var c=s.getComponent(u.opts.componentClass||vi(u.name));return c&&!l.isTech(c)}).forEach(a)}},e.buildCSSClass=function(){return""},e.ready=function(r,i){if(i===void 0&&(i=!1),!!r){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(r);return}i?r.call(this):this.setTimeout(r,1)}},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(i){i.call(this)},this),this.trigger("ready")},1)},e.$=function(r,i){return xa(r,i||this.contentEl())},e.$$=function(r,i){return OS(r,i||this.contentEl())},e.hasClass=function(r){return ao(this.el_,r)},e.addClass=function(r){qs(this.el_,r)},e.removeClass=function(r){Tc(this.el_,r)},e.toggleClass=function(r,i){kS(this.el_,r,i)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(r){return xS(this.el_,r)},e.setAttribute=function(r,i){Sl(this.el_,r,i)},e.removeAttribute=function(r){Dd(this.el_,r)},e.width=function(r,i){return this.dimension("width",r,i)},e.height=function(r,i){return this.dimension("height",r,i)},e.dimensions=function(r,i){this.width(r,!0),this.height(i)},e.dimension=function(r,i,n){if(i!==void 0){(i===null||i!==i)&&(i=0),(""+i).indexOf("%")!==-1||(""+i).indexOf("px")!==-1?this.el_.style[r]=i:i==="auto"?this.el_.style[r]="":this.el_.style[r]=i+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;var a=this.el_.style[r],o=a.indexOf("px");return parseInt(o!==-1?a.slice(0,o):this.el_["offset"+vi(r)],10)},e.currentDimension=function(r){var i=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(i=ac(this.el_,r),i=parseFloat(i),i===0||isNaN(i)){var n="offset"+vi(r);i=this.el_[n]}return i},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(r){this.player_&&(st.isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},e.handleKeyPress=function(r){this.handleKeyDown(r)},e.emitTapEvents=function(){var r=0,i=null,n=10,a=200,o;this.on("touchstart",function(u){u.touches.length===1&&(i={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},r=N.performance.now(),o=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)o=!1;else if(i){var c=u.touches[0].pageX-i.pageX,d=u.touches[0].pageY-i.pageY,f=Math.sqrt(c*c+d*d);f>n&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(u){if(i=null,o===!0){var c=N.performance.now()-r;c<a&&(u.preventDefault(),this.trigger("tap"))}})},e.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var r=ti(this.player(),this.player().reportUserActivity),i;this.on("touchstart",function(){r(),this.clearInterval(i),i=this.setInterval(r,250)});var n=function(o){r(),this.clearInterval(i)};this.on("touchmove",r),this.on("touchend",n),this.on("touchcancel",n)}},e.setTimeout=function(r,i){var n=this,a;return r=ti(this,r),this.clearTimersOnDispose_(),a=N.setTimeout(function(){n.setTimeoutIds_.has(a)&&n.setTimeoutIds_.delete(a),r()},i),this.setTimeoutIds_.add(a),a},e.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),N.clearTimeout(r)),r},e.setInterval=function(r,i){r=ti(this,r),this.clearTimersOnDispose_();var n=N.setInterval(r,i);return this.setIntervalIds_.add(n),n},e.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),N.clearInterval(r)),r},e.requestAnimationFrame=function(r){var i=this;if(!this.supportsRaf_)return this.setTimeout(r,1e3/60);this.clearTimersOnDispose_();var n;return r=ti(this,r),n=N.requestAnimationFrame(function(){i.rafIds_.has(n)&&i.rafIds_.delete(n),r()}),this.rafIds_.add(n),n},e.requestNamedAnimationFrame=function(r,i){var n=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),i=ti(this,i);var a=this.requestAnimationFrame(function(){i(),n.namedRafs_.has(r)&&n.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},e.cancelNamedAnimationFrame=function(r){this.namedRafs_.has(r)&&(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},e.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),N.cancelAnimationFrame(r)),r):this.clearTimeout(r)},e.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(i){var n=i[0],a=i[1];r[n].forEach(function(o,l){return r[a](l)})}),r.clearingTimersOnDispose_=!1}))},s.registerComponent=function(r,i){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var n=s.getComponent("Tech"),a=n&&n.isTech(i),o=s===i||s.prototype.isPrototypeOf(i.prototype);if(a||!o){var l;throw a?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error('Illegal component, "'+r+'"; '+l+".")}r=vi(r),s.components_||(s.components_={});var u=s.getComponent("Player");if(r==="Player"&&u&&u.players){var c=u.players,d=Object.keys(c);if(c&&d.length>0&&d.map(function(f){return c[f]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[r]=i,s.components_[ah(r)]=i,i},s.getComponent=function(r){if(!(!r||!s.components_))return s.components_[r]},s})();De.prototype.supportsRaf_=typeof N.requestAnimationFrame=="function"&&typeof N.cancelAnimationFrame=="function";De.registerComponent("Component",De);function GL(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+t+").")}function T_(s,e,t,r){return GL(s,r,t.length-1),t[r][e]}function Bf(s){var e;return s===void 0||s.length===0?e={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:T_.bind(null,"start",0,s),end:T_.bind(null,"end",1,s)},N.Symbol&&N.Symbol.iterator&&(e[N.Symbol.iterator]=function(){return(s||[]).values()}),e}function oo(s,e){return Array.isArray(s)?Bf(s):s===void 0||e===void 0?Bf():Bf([[s,e]])}function qS(s,e){var t=0,r,i;if(!e)return 0;(!s||!s.length)&&(s=oo(0,0));for(var n=0;n<s.length;n++)r=s.start(n),i=s.end(n),i>e&&(i=e),t+=i-r;return t/e}function gr(s){if(s instanceof gr)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Ws(s)&&(typeof s.code=="number"&&(this.code=s.code),fi(this,s)),this.message||(this.message=gr.defaultMessages[this.code]||"")}gr.prototype.code=0;gr.prototype.message="";gr.prototype.status=null;gr.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];gr.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."};for(var Bo=0;Bo<gr.errorTypes.length;Bo++)gr[gr.errorTypes[Bo]]=Bo,gr.prototype[gr.errorTypes[Bo]]=Bo;function Ku(s){return s!=null&&typeof s.then=="function"}function hs(s){Ku(s)&&s.then(null,function(e){})}var Wp=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(r,i,n){return e[i]&&(r[i]=e[i]),r},{cues:e.cues&&Array.prototype.map.call(e.cues,function(r){return{startTime:r.startTime,endTime:r.endTime,text:r.text,id:r.id}})});return t},KL=function(e){var t=e.$$("track"),r=Array.prototype.map.call(t,function(n){return n.track}),i=Array.prototype.map.call(t,function(n){var a=Wp(n.track);return n.src&&(a.src=n.src),a});return i.concat(Array.prototype.filter.call(e.textTracks(),function(n){return r.indexOf(n)===-1}).map(Wp))},XL=function(e,t){return e.forEach(function(r){var i=t.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(n){return i.addCue(n)})}),t.textTracks()},b_={textTracksToJson:KL,jsonToTextTracks:XL,trackToJson_:Wp},Uf="vjs-modal-dialog",Fl=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.close_=function(a){return n.close(a)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=St("div",{className:Uf+"-content"},{role:"document"}),n.descEl_=St("p",{className:Uf+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),co(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return Uf+" vjs-hidden "+s.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var i=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(i+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),i},t.open=function(){if(!this.opened_){var i=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!i.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&i.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=i.controls(),i.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.opened=function(i){return typeof i=="boolean"&&this[i?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var i=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&i.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&i.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.closeable=function(i){if(typeof i=="boolean"){var n=this.closeable_=!!i,a=this.getChild("closeButton");if(n&&!a){var o=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(i){var n=this.contentEl(),a=n.parentNode,o=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),LS(n,i),this.trigger("modalfill"),o?a.insertBefore(n,o):a.appendChild(n);var l=this.getChild("closeButton");l&&a.appendChild(l.el_)},t.empty=function(){this.trigger("beforemodalempty"),dg(this.contentEl()),this.trigger("modalempty")},t.content=function(i){return typeof i<"u"&&(this.content_=i),this.content_},t.conditionalFocus_=function(){var i=de.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(i)||n===i)&&(this.previouslyActiveEl_=i,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(i){if(i.stopPropagation(),st.isEventKey(i,"Escape")&&this.closeable()){i.preventDefault(),this.close();return}if(st.isEventKey(i,"Tab")){for(var n=this.focusableEls_(),a=this.el_.querySelector(":focus"),o,l=0;l<n.length;l++)if(a===n[l]){o=l;break}de.activeElement===this.el_&&(o=0),i.shiftKey&&o===0?(n[n.length-1].focus(),i.preventDefault()):!i.shiftKey&&o===n.length-1&&(n[0].focus(),i.preventDefault())}},t.focusableEls_=function(){var i=this.el_.querySelectorAll("*");return Array.prototype.filter.call(i,function(n){return(n instanceof N.HTMLAnchorElement||n instanceof N.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof N.HTMLInputElement||n instanceof N.HTMLSelectElement||n instanceof N.HTMLTextAreaElement||n instanceof N.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof N.HTMLIFrameElement||n instanceof N.HTMLObjectElement||n instanceof N.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},e})(De);Fl.prototype.options_={pauseOnOpen:!0,temporary:!0};De.registerComponent("ModalDialog",Fl);var El=(function(s){Be(e,s);function e(r){var i;r===void 0&&(r=[]),i=s.call(this)||this,i.tracks_=[],Object.defineProperty(rt(i),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<r.length;n++)i.addTrack(r[n]);return i}var t=e.prototype;return t.addTrack=function(i){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(i)===-1&&(this.tracks_.push(i),this.trigger({track:i,type:"addtrack",target:this})),i.labelchange_=function(){n.trigger({track:i,type:"labelchange",target:n})},zs(i)&&i.addEventListener("labelchange",i.labelchange_)},t.removeTrack=function(i){for(var n,a=0,o=this.length;a<o;a++)if(this[a]===i){n=this[a],n.off&&n.off(),this.tracks_.splice(a,1);break}n&&this.trigger({track:n,type:"removetrack",target:this})},t.getTrackById=function(i){for(var n=null,a=0,o=this.length;a<o;a++){var l=this[a];if(l.id===i){n=l;break}}return n},e})(Vi);El.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var YL in El.prototype.allowedEvents_)El.prototype["on"+YL]=null;var Ff=function(e,t){for(var r=0;r<e.length;r++)!Object.keys(e[r]).length||t.id===e[r].id||(e[r].enabled=!1)},QL=(function(s){Be(e,s);function e(r){var i;r===void 0&&(r=[]);for(var n=r.length-1;n>=0;n--)if(r[n].enabled){Ff(r,r[n]);break}return i=s.call(this,r)||this,i.changing_=!1,i}var t=e.prototype;return t.addTrack=function(i){var n=this;i.enabled&&Ff(this,i),s.prototype.addTrack.call(this,i),i.addEventListener&&(i.enabledChange_=function(){n.changing_||(n.changing_=!0,Ff(n,i),n.changing_=!1,n.trigger("change"))},i.addEventListener("enabledchange",i.enabledChange_))},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&i.enabledChange_&&(i.removeEventListener("enabledchange",i.enabledChange_),i.enabledChange_=null)},e})(El),$f=function(e,t){for(var r=0;r<e.length;r++)!Object.keys(e[r]).length||t.id===e[r].id||(e[r].selected=!1)},JL=(function(s){Be(e,s);function e(r){var i;r===void 0&&(r=[]);for(var n=r.length-1;n>=0;n--)if(r[n].selected){$f(r,r[n]);break}return i=s.call(this,r)||this,i.changing_=!1,Object.defineProperty(rt(i),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),i}var t=e.prototype;return t.addTrack=function(i){var n=this;i.selected&&$f(this,i),s.prototype.addTrack.call(this,i),i.addEventListener&&(i.selectedChange_=function(){n.changing_||(n.changing_=!0,$f(n,i),n.changing_=!1,n.trigger("change"))},i.addEventListener("selectedchange",i.selectedChange_))},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&i.selectedChange_&&(i.removeEventListener("selectedchange",i.selectedChange_),i.selectedChange_=null)},e})(El),zS=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.addTrack=function(i){var n=this;s.prototype.addTrack.call(this,i),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),i.addEventListener("modechange",this.queueChange_);var a=["metadata","chapters"];a.indexOf(i.kind)===-1&&i.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&(this.queueChange_&&i.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&i.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e})(El),ZL=(function(){function s(t){t===void 0&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var r=0,i=t.length;r<i;r++)this.addTrackElement_(t[r])}var e=s.prototype;return e.addTrackElement_=function(r){var i=this.trackElements_.length;""+i in this||Object.defineProperty(this,i,{get:function(){return this.trackElements_[i]}}),this.trackElements_.indexOf(r)===-1&&this.trackElements_.push(r)},e.getTrackElementByTrack_=function(r){for(var i,n=0,a=this.trackElements_.length;n<a;n++)if(r===this.trackElements_[n].track){i=this.trackElements_[n];break}return i},e.removeTrackElement_=function(r){for(var i=0,n=this.trackElements_.length;i<n;i++)if(r===this.trackElements_[i]){this.trackElements_[i].track&&typeof this.trackElements_[i].track.off=="function"&&this.trackElements_[i].track.off(),typeof this.trackElements_[i].off=="function"&&this.trackElements_[i].off(),this.trackElements_.splice(i,1);break}},s})(),S_=(function(){function s(t){s.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=s.prototype;return e.setCues_=function(r){var i=this.length||0,n=0,a=r.length;this.cues_=r,this.length_=r.length;var o=function(u){""+u in this||Object.defineProperty(this,""+u,{get:function(){return this.cues_[u]}})};if(i<a)for(n=i;n<a;n++)o.call(this,n)},e.getCueById=function(r){for(var i=null,n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===r){i=o;break}}return i},s})(),eO={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},tO={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},iO={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},C_={disabled:"disabled",hidden:"hidden",showing:"showing"},gg=(function(s){Be(e,s);function e(t){var r;t===void 0&&(t={}),r=s.call(this)||this;var i={id:t.id||"vjs_track_"+Qs(),kind:t.kind||"",language:t.language||""},n=t.label||"",a=function(u){Object.defineProperty(rt(r),u,{get:function(){return i[u]},set:function(){}})};for(var o in i)a(o);return Object.defineProperty(rt(r),"label",{get:function(){return n},set:function(u){u!==n&&(n=u,this.trigger("labelchange"))}}),r}return e})(Vi),vg=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],r=de.createElement("a");r.href=e;for(var i={},n=0;n<t.length;n++)i[t[n]]=r[t[n]];return i.protocol==="http:"&&(i.host=i.host.replace(/:80$/,"")),i.protocol==="https:"&&(i.host=i.host.replace(/:443$/,"")),i.protocol||(i.protocol=N.location.protocol),i.host||(i.host=N.location.host),i},WS=function(e){if(!e.match(/^https?:\/\//)){var t=de.createElement("a");t.href=e,e=t.href}return e},yg=function(e){if(typeof e=="string"){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,r=t.exec(e);if(r)return r.pop().toLowerCase()}return""},Md=function(e,t){t===void 0&&(t=N.location);var r=vg(e),i=r.protocol===":"?t.protocol:r.protocol,n=i+r.host!==t.protocol+t.host;return n},rO=Object.freeze({__proto__:null,parseUrl:vg,getAbsoluteURL:WS,getFileExtension:yg,isCrossOrigin:Md}),E_=function(e,t){var r=new N.WebVTT.Parser(N,N.vttjs,N.WebVTT.StringDecoder()),i=[];r.oncue=function(n){t.addCue(n)},r.onparsingerror=function(n){i.push(n)},r.onflush=function(){t.trigger({type:"loadeddata",target:t})},r.parse(e),i.length>0&&(N.console&&N.console.groupCollapsed&&N.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(n){return pt.error(n)}),N.console&&N.console.groupEnd&&N.console.groupEnd()),r.flush()},w_=function(e,t){var r={uri:e},i=Md(e);i&&(r.cors=i);var n=t.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),J1(r,ti(this,function(a,o,l){if(a)return pt.error(a,o);t.loaded_=!0,typeof N.WebVTT!="function"?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type==="vttjserror"){pt.error("vttjs failed to load, stopping trying to process "+t.src);return}return E_(l,t)}):E_(l,t)}))},bc=(function(s){Be(e,s);function e(r){var i;if(r===void 0&&(r={}),!r.tech)throw new Error("A tech was not provided.");var n=ei(r,{kind:iO[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=C_[n.mode]||"disabled",o=n.default;(n.kind==="metadata"||n.kind==="chapters")&&(a="hidden"),i=s.call(this,n)||this,i.tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=i.tech_.preloadTextTracks!==!1;var l=new S_(i.cues_),u=new S_(i.activeCues_),c=!1;i.timeupdateHandler=ti(rt(i),function(f){if(f===void 0&&(f={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var d=function(){i.stopTracking()};return i.tech_.one("dispose",d),a!=="disabled"&&i.startTracking(),Object.defineProperties(rt(i),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(g){C_[g]&&a!==g&&(a=g,!this.preload_&&a!=="disabled"&&this.cues.length===0&&w_(this.src,this),this.stopTracking(),a!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return u;for(var g=this.tech_.currentTime(),E=[],S=0,k=this.cues.length;S<k;S++){var F=this.cues[S];(F.startTime<=g&&F.endTime>=g||F.startTime===F.endTime&&F.startTime<=g&&F.startTime+.5>=g)&&E.push(F)}if(c=!1,E.length!==this.activeCues_.length)c=!0;else for(var L=0;L<E.length;L++)this.activeCues_.indexOf(E[L])===-1&&(c=!0);return this.activeCues_=E,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(i.src=n.src,i.preload_||(i.loaded_=!0),(i.preload_||n.kind!=="subtitles"&&n.kind!=="captions")&&w_(i.src,rt(i))):i.loaded_=!0,i}var t=e.prototype;return t.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},t.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},t.addCue=function(i){var n=i;if(!("getCueAsHTML"in n)){n=new N.vttjs.VTTCue(i.startTime,i.endTime,i.text);for(var a in i)a in n||(n[a]=i[a]);n.id=i.id,n.originalCue_=i}for(var o=this.tech_.textTracks(),l=0;l<o.length;l++)o[l]!==this&&o[l].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},t.removeCue=function(i){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===i||a.originalCue_&&a.originalCue_===i){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},e})(gg);bc.prototype.allowedEvents_={cuechange:"cuechange"};var GS=(function(s){Be(e,s);function e(t){var r;t===void 0&&(t={});var i=ei(t,{kind:tO[t.kind]||""});r=s.call(this,i)||this;var n=!1;return Object.defineProperty(rt(r),"enabled",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("enabledchange"))}}),i.enabled&&(r.enabled=i.enabled),r.loaded_=!0,r}return e})(gg),KS=(function(s){Be(e,s);function e(t){var r;t===void 0&&(t={});var i=ei(t,{kind:eO[t.kind]||""});r=s.call(this,i)||this;var n=!1;return Object.defineProperty(rt(r),"selected",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("selectedchange"))}}),i.selected&&(r.selected=i.selected),r}return e})(gg),XS=0,nO=1,YS=2,sO=3,$l=(function(s){Be(e,s);function e(t){var r;t===void 0&&(t={}),r=s.call(this)||this;var i,n=new bc(t);return r.kind=n.kind,r.src=n.src,r.srclang=n.language,r.label=n.label,r.default=n.default,Object.defineProperties(rt(r),{readyState:{get:function(){return i}},track:{get:function(){return n}}}),i=XS,n.addEventListener("loadeddata",function(){i=YS,r.trigger({type:"load",target:rt(r)})}),r}return e})(Vi);$l.prototype.allowedEvents_={load:"load"};$l.NONE=XS;$l.LOADING=nO;$l.LOADED=YS;$l.ERROR=sO;var hn={audio:{ListClass:QL,TrackClass:GS,capitalName:"Audio"},video:{ListClass:JL,TrackClass:KS,capitalName:"Video"},text:{ListClass:zS,TrackClass:bc,capitalName:"Text"}};Object.keys(hn).forEach(function(s){hn[s].getterName=s+"Tracks",hn[s].privateName=s+"Tracks_"});var wl={remoteText:{ListClass:zS,TrackClass:bc,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:ZL,TrackClass:$l,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},dr=jt({},hn,wl);wl.names=Object.keys(wl);hn.names=Object.keys(hn);dr.names=[].concat(wl.names).concat(hn.names);function aO(s,e,t,r,i){i===void 0&&(i={});var n=s.textTracks();i.kind=e,t&&(i.label=t),r&&(i.language=r),i.tech=s;var a=new dr.text.TrackClass(i);return n.addTrack(a),a}var zt=(function(s){Be(e,s);function e(r,i){var n;return r===void 0&&(r={}),i===void 0&&(i=function(){}),r.reportTouchActivity=!1,n=s.call(this,null,r,i)||this,n.onDurationChange_=function(a){return n.onDurationChange(a)},n.trackProgress_=function(a){return n.trackProgress(a)},n.trackCurrentTime_=function(a){return n.trackCurrentTime(a)},n.stopTrackingCurrentTime_=function(a){return n.stopTrackingCurrentTime(a)},n.disposeSourceHandler_=function(a){return n.disposeSourceHandler(a)},n.queuedHanders_=new Set,n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),dr.names.forEach(function(a){var o=dr[a];r&&r[o.getterName]&&(n[o.privateName]=r[o.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){r["native"+a+"Tracks"]===!1&&(n["featuresNative"+a+"Tracks"]=!1)}),r.nativeCaptions===!1||r.nativeTextTracks===!1?n.featuresNativeTextTracks=!1:(r.nativeCaptions===!0||r.nativeTextTracks===!0)&&(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=r.preloadTextTracks!==!1,n.autoRemoteTextTracks_=new dr.text.ListClass,n.initTrackListeners(),r.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}var t=e.prototype;return t.triggerSourceset=function(i){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(i)},1)}),this.trigger({src:i,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},t.trackProgress=function(i){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ti(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},t.onDurationChange=function(i){this.duration_=this.duration()},t.buffered=function(){return oo(0,0)},t.bufferedPercent=function(){return qS(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(hn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),s.prototype.dispose.call(this)},t.clearTracks=function(i){var n=this;i=[].concat(i),i.forEach(function(a){for(var o=n[a+"Tracks"]()||[],l=o.length;l--;){var u=o[l];a==="text"&&n.removeRemoteTextTrack(u),o.removeTrack(u)}})},t.cleanupAutoTextTracks=function(){for(var i=this.autoRemoteTextTracks_||[],n=i.length;n--;){var a=i[n];this.removeRemoteTextTrack(a)}},t.reset=function(){},t.crossOrigin=function(){},t.setCrossOrigin=function(){},t.error=function(i){return i!==void 0&&(this.error_=new gr(i),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?oo(0,0):oo()},t.play=function(){},t.setScrubbing=function(){},t.scrubbing=function(){},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var i=this;hn.names.forEach(function(n){var a=hn[n],o=function(){i.trigger(n+"trackchange")},l=i[a.getterName]();l.addEventListener("removetrack",o),l.addEventListener("addtrack",o),i.on("dispose",function(){l.removeEventListener("removetrack",o),l.removeEventListener("addtrack",o)})})},t.addWebVttScript_=function(){var i=this;if(!N.WebVTT)if(de.body.contains(this.el())){if(!this.options_["vtt.js"]&&sc(ll)&&Object.keys(ll).length>0){this.trigger("vttjsloaded");return}var n=de.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){i.trigger("vttjsloaded")},n.onerror=function(){i.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),N.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var i=this,n=this.textTracks(),a=this.remoteTextTracks(),o=function(f){return n.addTrack(f.track)},l=function(f){return n.removeTrack(f.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var u=function(){return i.trigger("texttrackchange")},c=function(){u();for(var f=0;f<n.length;f++){var g=n[f];g.removeEventListener("cuechange",u),g.mode==="showing"&&g.addEventListener("cuechange",u)}};c(),n.addEventListener("change",c),n.addEventListener("addtrack",c),n.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",o),a.off("removetrack",l),n.removeEventListener("change",c),n.removeEventListener("addtrack",c),n.removeEventListener("removetrack",c);for(var d=0;d<n.length;d++){var f=n[d];f.removeEventListener("cuechange",u)}})},t.addTextTrack=function(i,n,a){if(!i)throw new Error("TextTrack kind is required but was not provided");return aO(this,i,n,a)},t.createRemoteTextTrack=function(i){var n=ei(i,{tech:this});return new wl.remoteTextEl.TrackClass(n)},t.addRemoteTextTrack=function(i,n){var a=this;i===void 0&&(i={});var o=this.createRemoteTextTrack(i);return n!==!0&&n!==!1&&(pt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(o.track)}),o},t.removeRemoteTextTrack=function(i){var n=this.remoteTextTrackEls().getTrackElementByTrack_(i);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(i),this.autoRemoteTextTracks_.removeTrack(i)},t.getVideoPlaybackQuality=function(){return{}},t.requestPictureInPicture=function(){var i=this.options_.Promise||N.Promise;if(i)return i.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.requestVideoFrameCallback=function(i){var n=this,a=Qs();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),i())})):this.requestNamedAnimationFrame(a,i),a},t.cancelVideoFrameCallback=function(i){this.queuedHanders_.has(i)?this.queuedHanders_.delete(i):this.cancelNamedAnimationFrame(i)},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(i,n){return e.canPlayType(i.type)},e.isTech=function(i){return i.prototype instanceof e||i instanceof e||i===e},e.registerTech=function(i,n){if(e.techs_||(e.techs_={}),!e.isTech(n))throw new Error("Tech "+i+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return i=vi(i),e.techs_[i]=n,e.techs_[ah(i)]=n,i!=="Tech"&&e.defaultTechOrder_.push(i),n},e.getTech=function(i){if(i){if(e.techs_&&e.techs_[i])return e.techs_[i];if(i=vi(i),N&&N.videojs&&N.videojs[i])return pt.warn("The "+i+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),N.videojs[i]}},e})(De);dr.names.forEach(function(s){var e=dr[s];zt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});zt.prototype.featuresVolumeControl=!0;zt.prototype.featuresMuteControl=!0;zt.prototype.featuresFullscreenResize=!1;zt.prototype.featuresPlaybackRate=!1;zt.prototype.featuresProgressEvents=!1;zt.prototype.featuresSourceset=!1;zt.prototype.featuresTimeupdateEvents=!1;zt.prototype.featuresNativeTextTracks=!1;zt.prototype.featuresVideoFrameCallback=!1;zt.withSourceHandlers=function(s){s.registerSourceHandler=function(t,r){var i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),r===void 0&&(r=i.length),i.splice(r,0,t)},s.canPlayType=function(t){for(var r=s.sourceHandlers||[],i,n=0;n<r.length;n++)if(i=r[n].canPlayType(t),i)return i;return""},s.selectSourceHandler=function(t,r){for(var i=s.sourceHandlers||[],n,a=0;a<i.length;a++)if(n=i[a].canHandleSource(t,r),n)return i[a];return null},s.canPlaySource=function(t,r){var i=s.selectSourceHandler(t,r);return i?i.canHandleSource(t,r):""};var e=["seekable","seeking","duration"];e.forEach(function(t){var r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){var r=s.selectSourceHandler(t,this.options_);r||(s.nativeSourceHandler?r=s.nativeSourceHandler:pt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.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)}};De.registerComponent("Tech",zt);zt.registerTech("Tech",zt);zt.defaultTechOrder_=[];var lo={},Gp={},Fh={};function oO(s,e){lo[s]=lo[s]||[],lo[s].push(e)}function lO(s,e,t){s.setTimeout(function(){return Ka(e,lo[e.type],t,s)},1)}function uO(s,e){s.forEach(function(t){return t.setTech&&t.setTech(e)})}function cO(s,e,t){return s.reduceRight(_g(t),e[t]())}function hO(s,e,t,r){return e[t](s.reduce(_g(t),r))}function k_(s,e,t,r){r===void 0&&(r=null);var i="call"+vi(t),n=s.reduce(_g(i),r),a=n===Fh,o=a?null:e[t](n);return pO(s,t,o,a),o}var dO={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},fO={setCurrentTime:1,setMuted:1,setVolume:1},A_={play:1,pause:1};function _g(s){return function(e,t){return e===Fh?Fh:t[s]?t[s](e):e}}function pO(s,e,t,r){for(var i=s.length-1;i>=0;i--){var n=s[i];n[e]&&n[e](r,t)}}function mO(s){Gp[s.id()]=null}function gO(s,e){var t=Gp[s.id()],r=null;if(t==null)return r=e(s),Gp[s.id()]=[[e,r]],r;for(var i=0;i<t.length;i++){var n=t[i],a=n[0],o=n[1];a===e&&(r=o)}return r===null&&(r=e(s),t.push([e,r])),r}function Ka(s,e,t,r,i,n){s===void 0&&(s={}),e===void 0&&(e=[]),i===void 0&&(i=[]),n===void 0&&(n=!1);var a=e,o=a[0],l=a.slice(1);if(typeof o=="string")Ka(s,lo[o],t,r,i,n);else if(o){var u=gO(r,o);if(!u.setSource)return i.push(u),Ka(s,l,t,r,i,n);u.setSource(fi({},s),function(c,d){if(c)return Ka(s,l,t,r,i,n);i.push(u),Ka(d,s.type===d.type?l:lo[d.type],t,r,i,n)})}else l.length?Ka(s,l,t,r,i,n):n?t(s,i):Ka(s,lo["*"],t,r,i,!0)}var vO={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"},$h=function(e){e===void 0&&(e="");var t=yg(e),r=vO[t.toLowerCase()];return r||""},yO=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var r=e.cache_.sources.filter(function(o){return o.src===t});if(r.length)return r[0].type;for(var i=e.$$("source"),n=0;n<i.length;n++){var a=i[n];if(a.type&&a.src&&a.src===t)return a.type}return $h(t)},_O=function s(e){if(Array.isArray(e)){var t=[];e.forEach(function(r){r=s(r),Array.isArray(r)?t=t.concat(r):Ws(r)&&t.push(r)}),e=t}else typeof e=="string"&&e.trim()?e=[x_({src:e})]:Ws(e)&&typeof e.src=="string"&&e.src&&e.src.trim()?e=[x_(e)]:e=[];return e};function x_(s){if(!s.type){var e=$h(s.src);e&&(s.type=e)}return s}var TO=(function(s){Be(e,s);function e(t,r,i){var n,a=ei({createEl:!1},r);if(n=s.call(this,t,a,i)||this,!r.playerOptions.sources||r.playerOptions.sources.length===0)for(var o=0,l=r.playerOptions.techOrder;o<l.length;o++){var u=vi(l[o]),c=zt.getTech(u);if(u||(c=De.getComponent(u)),c&&c.isSupported()){t.loadTech_(u);break}}else t.src(r.playerOptions.sources);return n}return e})(De);De.registerComponent("MediaLoader",TO);var Rd=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.options_.controlText&&n.controlText(n.options_.controlText),n.handleMouseOver_=function(a){return n.handleMouseOver(a)},n.handleMouseOut_=function(a){return n.handleMouseOut(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.emitTapEvents(),n.enable(),n}var t=e.prototype;return t.createEl=function(i,n,a){i===void 0&&(i="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=fi({className:this.buildCSSClass(),tabIndex:0},n),i==="button"&&pt.error("Creating a ClickableComponent with an HTML element of "+i+" is not supported; use a Button instead."),a=fi({role:"button"},a),this.tabIndex_=n.tabIndex;var o=St(i,n,a);return o.appendChild(St("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.dispose=function(){this.controlTextEl_=null,s.prototype.dispose.call(this)},t.createControlTextEl=function(i){return this.controlTextEl_=St("span",{className:"vjs-control-text"},{"aria-live":"polite"}),i&&i.appendChild(this.controlTextEl_),this.controlText(this.controlText_,i),this.controlTextEl_},t.controlText=function(i,n){if(n===void 0&&(n=this.el()),i===void 0)return this.controlText_||"Need Text";var a=this.localize(i);this.controlText_=i,co(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",a)},t.buildCSSClass=function(){return"vjs-control vjs-button "+s.prototype.buildCSSClass.call(this)},t.enable=function(){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_))},t.disable=function(){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_)},t.handleLanguagechange=function(){this.controlText(this.controlText_)},t.handleClick=function(i){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(i){st.isEventKey(i,"Space")||st.isEventKey(i,"Enter")?(i.preventDefault(),i.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,i)},e})(De);De.registerComponent("ClickableComponent",Rd);var bO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update(),n.update_=function(a){return n.update(a)},r.on("posterchange",n.update_),n}var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update_),s.prototype.dispose.call(this)},t.createEl=function(){var i=St("div",{className:"vjs-poster",tabIndex:-1});return i},t.update=function(i){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},t.setSrc=function(i){var n="";i&&(n='url("'+i+'")'),this.el_.style.backgroundImage=n},t.handleClick=function(i){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((_c||yc)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?hs(this.player_.play()):this.player_.pause()}},e})(Rd);De.registerComponent("PosterImage",bO);var un="#222",N_="#ccc",SO={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 jf(s,e){var t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; 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 Hf(s,e,t){try{s.style[e]=t}catch{return}}var CO=(function(s){Be(e,s);function e(r,i,n){var a;a=s.call(this,r,i,n)||this;var o=function(u){return a.updateDisplay(u)};return r.on("loadstart",function(l){return a.toggleDisplay(l)}),r.on("texttrackchange",o),r.on("loadedmetadata",function(l){return a.preselectTrack(l)}),r.ready(ti(rt(a),function(){if(r.tech_&&r.tech_.featuresNativeTextTracks){this.hide();return}r.on("fullscreenchange",o),r.on("playerresize",o),N.addEventListener("orientationchange",o),r.on("dispose",function(){return N.removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()})),a}var t=e.prototype;return t.preselectTrack=function(){for(var i={captions:1,subtitles:1},n=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o,l,u,c=0;c<n.length;c++){var d=n[c];a&&a.enabled&&a.language&&a.language===d.language&&d.kind in i?d.kind===a.kind?u=d:u||(u=d):a&&!a.enabled?(u=null,o=null,l=null):d.default&&(d.kind==="descriptions"&&!o?o=d:d.kind in i&&!l&&(l=d))}u?u.mode="showing":l?l.mode="showing":o&&(o.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){typeof N.WebVTT=="function"&&N.WebVTT.processCues(N,[],this.el_)},t.updateDisplay=function(){var i=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],o=0;o<i.length;++o){var l=i[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}for(var u=null,c=null,d=i.length;d--;){var f=i[d];f.mode==="showing"&&(f.kind==="descriptions"?u=f:c=f)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))},t.updateDisplayState=function(i){for(var n=this.player_.textTrackSettings.getValues(),a=i.activeCues,o=a.length;o--;){var l=a[o];if(l){var u=l.displayState;if(n.color&&(u.firstChild.style.color=n.color),n.textOpacity&&Hf(u.firstChild,"color",jf(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Hf(u.firstChild,"backgroundColor",jf(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Hf(u,"backgroundColor",jf(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px "+un+", 2px 2px 4px "+un+", 2px 2px 5px "+un:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px "+un+", 2px 2px "+un+", 3px 3px "+un:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px "+N_+", 0 1px "+N_+", -1px -1px "+un+", 0 -1px "+un:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px "+un+", 0 0 4px "+un+", 0 0 4px "+un+", 0 0 4px "+un)),n.fontPercent&&n.fontPercent!==1){var c=N.parseFloat(u.style.fontSize);u.style.fontSize=c*n.fontPercent+"px",u.style.height="auto",u.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=SO[n.fontFamily])}}},t.updateForTrack=function(i){if(Array.isArray(i)||(i=[i]),!(typeof N.WebVTT!="function"||i.every(function(g){return!g.activeCues}))){for(var n=[],a=0;a<i.length;++a)for(var o=i[a],l=0;l<o.activeCues.length;++l)n.push(o.activeCues[l]);N.WebVTT.processCues(N,n,this.el_);for(var u=0;u<i.length;++u){for(var c=i[u],d=0;d<c.activeCues.length;++d){var f=c.activeCues[d].displayState;qs(f,"vjs-text-track-cue"),qs(f,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&Sl(f,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},e})(De);De.registerComponent("TextTrackDisplay",CO);var EO=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=this.player_.isAudio(),n=this.localize(i?"Audio Player":"Video Player"),a=St("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),o=s.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(a),o},e})(De);De.registerComponent("LoadingSpinner",EO);var In=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(i,n,a){n===void 0&&(n={}),a===void 0&&(a={}),i="button",n=fi({className:this.buildCSSClass()},n),a=fi({type:"button"},a);var o=St(i,n,a);return o.appendChild(St("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.addChild=function(i,n){n===void 0&&(n={});var a=this.constructor.name;return pt.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),De.prototype.addChild.call(this,i,n)},t.enable=function(){s.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.disable=function(){s.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.handleKeyDown=function(i){if(st.isEventKey(i,"Space")||st.isEventKey(i,"Enter")){i.stopPropagation();return}s.prototype.handleKeyDown.call(this,i)},e})(Rd);De.registerComponent("Button",In);var QS=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.mouseused_=!1,n.on("mousedown",function(a){return n.handleMouseDown(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(i){var n=this.player_.play();if(this.mouseused_&&i.clientX&&i.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;hs(n),this.player_.tech(!0)&&!((_c||yc)&&a)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(!l){this.player_.tech(!0).focus();return}var u=function(){return l.focus()};Ku(n)?n.then(u,function(){}):this.setTimeout(u,1)},t.handleKeyDown=function(i){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,i)},t.handleMouseDown=function(i){this.mouseused_=!0},e})(In);QS.prototype.controlText_="Play Video";De.registerComponent("BigPlayButton",QS);var wO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.controlText(i&&i.controlText||n.localize("Close")),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(i){st.isEventKey(i,"Esc")?(i.preventDefault(),i.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,i)},e})(In);De.registerComponent("CloseButton",wO);var JS=(function(s){Be(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,i.replay=i.replay===void 0||i.replay,n.on(r,"play",function(a){return n.handlePlay(a)}),n.on(r,"pause",function(a){return n.handlePause(a)}),i.replay&&n.on(r,"ended",function(a){return n.handleEnded(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){this.player_.paused()?hs(this.player_.play()):this.player_.pause()},t.handleSeeked=function(i){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(i):this.handlePlay(i)},t.handlePlay=function(i){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(i){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(i){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},e})(In);JS.prototype.controlText_="Play";De.registerComponent("PlayToggle",JS);var ZS=function(e,t){e=e<0?0:e;var r=Math.floor(e%60),i=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=i=r="-"),n=n>0||o>0?n+":":"",i=((n||a>=10)&&i<10?"0"+i:i)+":",r=r<10?"0"+r:r,n+i+r},Tg=ZS;function kO(s){Tg=s}function AO(){Tg=ZS}function kl(s,e){return e===void 0&&(e=s),Tg(s,e)}var jl=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,["timeupdate","ended"],function(a){return n.updateContent(a)}),n.updateTextNode_(),n}var t=e.prototype;return t.createEl=function(){var i=this.buildCSSClass(),n=s.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control"}),a=St("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=St("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(i){var n=this;i===void 0&&(i=0),i=kl(i),this.formattedTime_!==i&&(this.formattedTime_=i,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,pt.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=de.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},t.updateContent=function(i){},e})(De);jl.prototype.labelText_="Time";jl.prototype.controlText_="Time";De.registerComponent("TimeDisplay",jl);var bg=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(i){var n;this.player_.ended()?n=this.player_.duration():n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},e})(jl);bg.prototype.labelText_="Current Time";bg.prototype.controlText_="Current Time";De.registerComponent("CurrentTimeDisplay",bg);var Sg=(function(s){Be(e,s);function e(r,i){var n;n=s.call(this,r,i)||this;var a=function(l){return n.updateContent(l)};return n.on(r,"durationchange",a),n.on(r,"loadstart",a),n.on(r,"loadedmetadata",a),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(i){var n=this.player_.duration();this.updateTextNode_(n)},e})(jl);Sg.prototype.labelText_="Duration";Sg.prototype.controlText_="Duration";De.registerComponent("DurationDisplay",Sg);var xO=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(a),i.appendChild(n),i},e})(De);De.registerComponent("TimeDivider",xO);var Cg=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"durationchange",function(a){return n.updateContent(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var i=s.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&i.insertBefore(St("span",{},{"aria-hidden":!0},"-"),this.contentEl_),i},t.updateContent=function(i){if(typeof this.player_.duration()=="number"){var n;this.player_.ended()?n=0:this.player_.remainingTimeDisplay?n=this.player_.remainingTimeDisplay():n=this.player_.remainingTime(),this.updateTextNode_(n)}},e})(jl);Cg.prototype.labelText_="Remaining Time";Cg.prototype.controlText_="Remaining Time";De.registerComponent("RemainingTimeDisplay",Cg);var NO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.updateShowing(),n.on(n.player(),"durationchange",function(a){return n.updateShowing(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=St("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(St("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(de.createTextNode(this.localize("LIVE"))),i.appendChild(this.contentEl_),i},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(i){this.player().duration()===1/0?this.show():this.hide()},e})(De);De.registerComponent("LiveDisplay",NO);var e2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(a){return n.updateLiveEdgeStatus(a)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=St("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),i.appendChild(this.textEl_),i},t.updateLiveEdgeStatus=function(){!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"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},e})(In);e2.prototype.controlText_="Seek to live, currently playing live";De.registerComponent("SeekToLive",e2);var Bd=function(e,t,r){return e=Number(e),Math.min(r,Math.max(t,isNaN(e)?t:e))},Eg=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleMouseDown_=function(a){return n.handleMouseDown(a)},n.handleMouseUp_=function(a){return n.handleMouseUp(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleMouseMove_=function(a){return n.handleMouseMove(a)},n.update_=function(a){return n.update(a)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){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)},t.disable=function(){if(this.enabled()){var i=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(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(i,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=fi({tabIndex:0},n),a=fi({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,i,n,a)},t.handleMouseDown=function(i){var n=this.bar.el_.ownerDocument;i.type==="mousedown"&&i.preventDefault(),i.type==="touchstart"&&!Ys&&i.preventDefault(),NS(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(i,!0)},t.handleMouseMove=function(i){},t.handleMouseUp=function(){var i=this.bar.el_.ownerDocument;DS(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var i=this;if(!(!this.el_||!this.bar)){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=i.vertical()?"height":"width";i.bar.el().style[a]=(n*100).toFixed(2)+"%"})),n}},t.getProgress=function(){return Number(Bd(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(i){var n=Id(this.el_,i);return this.vertical()?n.y:n.x},t.handleKeyDown=function(i){st.isEventKey(i,"Left")||st.isEventKey(i,"Down")?(i.preventDefault(),i.stopPropagation(),this.stepBack()):st.isEventKey(i,"Right")||st.isEventKey(i,"Up")?(i.preventDefault(),i.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,i)},t.handleClick=function(i){i.stopPropagation(),i.preventDefault()},t.vertical=function(i){if(i===void 0)return this.vertical_||!1;this.vertical_=!!i,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e})(De);De.registerComponent("Slider",Eg);var Vf=function(e,t){return Bd(e/t*100,0,100).toFixed(2)+"%"},DO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.partEls_=[],n.on(r,"progress",function(a){return n.update(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=St("span",{className:"vjs-control-text"}),a=St("span",{textContent:this.localize("Loaded")}),o=de.createTextNode(": ");return this.percentageEl_=St("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),i.appendChild(n),n.appendChild(a),n.appendChild(o),n.appendChild(this.percentageEl_),i},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(i){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,o=n.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,d=Vf(u,l);n.percent_!==d&&(n.el_.style.width=d,co(n.percentageEl_,d),n.percent_=d);for(var f=0;f<o.length;f++){var g=o.start(f),E=o.end(f),S=c[f];S||(S=n.el_.appendChild(St()),c[f]=S),!(S.dataset.start===g&&S.dataset.end===E)&&(S.dataset.start=g,S.dataset.end=E,S.style.left=Vf(g,u),S.style.width=Vf(E-g,u))}for(var k=c.length;k>o.length;k--)n.el_.removeChild(c[k-1]);c.length=o.length})},e})(De);De.registerComponent("LoadProgressBar",DO);var IO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=Gs(ti(rt(n),n.update),Pn),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(i,n,a){var o=oc(this.el_),l=Cl(this.player_.el()),u=i.width*n;if(!(!l||!o)){var c=i.left-l.left+u,d=i.width-u+(l.right-i.right),f=o.width/2;c<f?f+=f-c:d<f&&(f=d),f<0?f=0:f>o.width&&(f=o.width),f=Math.round(f),this.el_.style.right="-"+f+"px",this.write(a)}},t.write=function(i){co(this.el_,i)},t.updateTime=function(i,n,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var d=l.player_.liveTracker.liveWindow(),f=d-n*d;u=(f<1?"":"-")+kl(f,d)}else u=kl(a,c);l.update(i,n,u),o&&o()})},e})(De);De.registerComponent("TimeTooltip",IO);var wg=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=Gs(ti(rt(n),n.update),Pn),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(i,n){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(i,n,o)}},e})(De);wg.prototype.options_={children:[]};!_r&&!Xs&&wg.prototype.options_.children.push("timeTooltip");De.registerComponent("PlayProgressBar",wg);var t2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=Gs(ti(rt(n),n.update),Pn),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(i,n){var a=this,o=n*this.player_.duration();this.getChild("timeTooltip").updateTime(i,n,o,function(){a.el_.style.left=i.width*n+"px"})},e})(De);t2.prototype.options_={children:["timeTooltip"]};De.registerComponent("MouseTimeDisplay",t2);var Vc=5,D_=12,kg=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.setEventHandlers_(),n}var t=e.prototype;return t.setEventHandlers_=function(){var i=this;this.update_=ti(this,this.update),this.update=Gs(this.update_,Pn),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return i.enableInterval_(n)},this.disableIntervalHandler_=function(n){return i.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in de&&"visibilityState"in de&&this.on(de,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(i){de.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(i)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Pn))},t.disableInterval_=function(i){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&i&&i.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(i){var n=this;if(de.visibilityState!=="hidden"){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),l=n.player_.liveTracker,u=n.player_.duration();l&&l.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(a*100).toFixed(2)),n.percent_=a),(n.currentTime_!==o||n.duration_!==u)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[kl(o,u),kl(u,u)],"{1} of {2}")),n.currentTime_=o,n.duration_=u),n.bar&&n.bar.update(Cl(n.el()),n.getProgress())}),a}},t.userSeek_=function(i){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(i)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var i=this.getCurrentTime_(),n,a=this.player_.liveTracker;return a&&a.isLive()?(n=(i-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(n=1)):n=i/this.player_.duration(),n},t.handleMouseDown=function(i){lc(i)&&(i.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,i))},t.handleMouseMove=function(i,n){if(n===void 0&&(n=!1),!!lc(i)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(i),l=this.player_.liveTracker;if(!l||!l.isLive())a=o*this.player_.duration(),a===this.player_.duration()&&(a=a-.1);else{if(o>=.99){l.seekToLiveEdge();return}var u=l.seekableStart(),c=l.liveCurrentTime();if(a=u+o*l.liveWindow(),a>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var i=this.getChild("mouseTimeDisplay");i&&i.show()},t.disable=function(){s.prototype.disable.call(this);var i=this.getChild("mouseTimeDisplay");i&&i.hide()},t.handleMouseUp=function(i){s.prototype.handleMouseUp.call(this,i),i&&i.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?hs(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+Vc)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-Vc)},t.handleAction=function(i){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(i){var n=this.player_.liveTracker;if(st.isEventKey(i,"Space")||st.isEventKey(i,"Enter"))i.preventDefault(),i.stopPropagation(),this.handleAction(i);else if(st.isEventKey(i,"Home"))i.preventDefault(),i.stopPropagation(),this.userSeek_(0);else if(st.isEventKey(i,"End"))i.preventDefault(),i.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(st(i))){i.preventDefault(),i.stopPropagation();var a=(st.codes[st(i)]-st.codes[0])*10/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else st.isEventKey(i,"PgDn")?(i.preventDefault(),i.stopPropagation(),this.userSeek_(this.player_.currentTime()-Vc*D_)):st.isEventKey(i,"PgUp")?(i.preventDefault(),i.stopPropagation(),this.userSeek_(this.player_.currentTime()+Vc*D_)):s.prototype.handleKeyDown.call(this,i)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],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 de&&"visibilityState"in de&&this.off(de,"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},e})(Eg);kg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!_r&&!Xs&&kg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");De.registerComponent("SeekBar",kg);var i2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleMouseMove=Gs(ti(rt(n),n.handleMouseMove),Pn),n.throttledHandleMouseSeek=Gs(ti(rt(n),n.handleMouseSeek),Pn),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.handleMouseDownHandler_=function(a){return n.handleMouseDown(a)},n.enable(),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(i){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),o=n.getChild("mouseTimeDisplay");if(!(!a&&!o)){var l=n.el(),u=oc(l),c=Id(l,i).x;c=Bd(c,0,1),o&&o.update(u,c),a&&a.update(u,n.getProgress())}}},t.handleMouseSeek=function(i){var n=this.getChild("seekBar");n&&n.handleMouseMove(i)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var i=this.getChild("seekBar");this.player_.scrubbing(!1),i.videoWasPlaying&&hs(this.player_.play())}},t.enable=function(){this.children().forEach(function(i){return i.enable&&i.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseSeek),this.off(i,"touchmove",this.throttledHandleMouseSeek),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(i){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(i),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(i){var n=this.getChild("seekBar");n&&n.handleMouseUp(i),this.removeListenersAddedOnMousedownAndTouchstart()},e})(De);i2.prototype.options_={children:["seekBar"]};De.registerComponent("ProgressControl",i2);var r2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,["enterpictureinpicture","leavepictureinpicture"],function(a){return n.handlePictureInPictureChange(a)}),n.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(a){return n.handlePictureInPictureEnabledChange(a)}),n.on(r,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var a=r.currentType().substring(0,5)==="audio";a||r.audioPosterMode()||r.audioOnlyMode()?(r.isInPictureInPicture()&&r.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){de.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},t.handlePictureInPictureChange=function(i){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(i){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e})(In);r2.prototype.controlText_="Picture-in-Picture";De.registerComponent("PictureInPictureToggle",r2);var n2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"fullscreenchange",function(a){return n.handleFullscreenChange(a)}),de[r.fsApi_.fullscreenEnabled]===!1&&n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(i){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(i){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e})(In);n2.prototype.controlText_="Fullscreen";De.registerComponent("FullscreenToggle",n2);var PO=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},LO=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return i.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),i},e})(De);De.registerComponent("VolumeLevel",LO);var OO=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=Gs(ti(rt(n),n.update),Pn),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(i,n,a,o){if(!a){var l=Cl(this.el_),u=Cl(this.player_.el()),c=i.width*n;if(!u||!l)return;var d=i.left-u.left+c,f=i.width-c+(u.right-i.right),g=l.width/2;d<g?g+=g-d:f<g&&(g=f),g<0?g=0:g>l.width&&(g=l.width),this.el_.style.right="-"+g+"px"}this.write(o+"%")},t.write=function(i){co(this.el_,i)},t.updateVolume=function(i,n,a,o,l){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(i,n,a,o.toFixed(0)),l&&l()})},e})(De);De.registerComponent("VolumeLevelTooltip",OO);var s2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=Gs(ti(rt(n),n.update),Pn),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(i,n,a){var o=this,l=100*n;this.getChild("volumeLevelTooltip").updateVolume(i,n,a,l,function(){a?o.el_.style.bottom=i.height*n+"px":o.el_.style.left=i.width*n+"px"})},e})(De);s2.prototype.options_={children:["volumeLevelTooltip"]};De.registerComponent("MouseVolumeLevelDisplay",s2);var Ud=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on("slideractive",function(a){return n.updateLastVolume_(a)}),n.on(r,"volumechange",function(a){return n.updateARIAAttributes(a)}),r.ready(function(){return n.updateARIAAttributes()}),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(i){lc(i)&&s.prototype.handleMouseDown.call(this,i)},t.handleMouseMove=function(i){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),o=Cl(a),l=this.vertical(),u=Id(a,i);u=l?u.y:u.x,u=Bd(u,0,1),n.update(o,u,l)}lc(i)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(i)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(i){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},t.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},t.updateLastVolume_=function(){var i=this,n=this.player_.volume();this.one("sliderinactive",function(){i.player_.volume()===0&&i.player_.lastVolume_(n)})},e})(Eg);Ud.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!_r&&!Xs&&Ud.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Ud.prototype.playerEvent="volumechange";De.registerComponent("VolumeBar",Ud);var a2=(function(s){Be(e,s);function e(r,i){var n;return i===void 0&&(i={}),i.vertical=i.vertical||!1,(typeof i.volumeBar>"u"||sc(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=s.call(this,r,i)||this,PO(rt(n),r),n.throttledHandleMouseMove=Gs(ti(rt(n),n.handleMouseMove),Pn),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.on("mousedown",function(a){return n.handleMouseDown(a)}),n.on("touchstart",function(a){return n.handleMouseDown(a)}),n.on("mousemove",function(a){return n.handleMouseMove(a)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}var t=e.prototype;return t.createEl=function(){var i="vjs-volume-horizontal";return this.options_.vertical&&(i="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+i})},t.handleMouseDown=function(i){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(i){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(i){this.volumeBar.handleMouseMove(i)},e})(De);a2.prototype.options_={children:["volumeBar"]};De.registerComponent("VolumeControl",a2);var MO=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},o2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,MO(rt(n),r),n.on(r,["loadstart","volumechange"],function(a){return n.update(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var o=a<.1?.1:a;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(i){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var i=this.player_.volume(),n=3;_r&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),i===0||this.player_.muted()?n=0:i<.33?n=1:i<.67&&(n=2);for(var a=0;a<4;a++)Tc(this.el_,"vjs-vol-"+a);qs(this.el_,"vjs-vol-"+n)},t.updateControlText_=function(){var i=this.player_.muted()||this.player_.volume()===0,n=i?"Unmute":"Mute";this.controlText()!==n&&this.controlText(n)},e})(In);o2.prototype.controlText_="Mute";De.registerComponent("MuteToggle",o2);var l2=(function(s){Be(e,s);function e(r,i){var n;return i===void 0&&(i={}),typeof i.inline<"u"?i.inline=i.inline:i.inline=!0,(typeof i.volumeControl>"u"||sc(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),n=s.call(this,r,i)||this,n.handleKeyPressHandler_=function(a){return n.handleKeyPress(a)},n.on(r,["loadstart"],function(a){return n.volumePanelState_(a)}),n.on(n.muteToggle,"keyup",function(a){return n.handleKeyPress(a)}),n.on(n.volumeControl,"keyup",function(a){return n.handleVolumeControlKeyUp(a)}),n.on("keydown",function(a){return n.handleKeyPress(a)}),n.on("mouseover",function(a){return n.handleMouseOver(a)}),n.on("mouseout",function(a){return n.handleMouseOut(a)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){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")},t.createEl=function(){var i="vjs-volume-panel-horizontal";return this.options_.inline||(i="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+i})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(i){st.isEventKey(i,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(i){this.addClass("vjs-hover"),Yr(de,"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(i){this.removeClass("vjs-hover"),rr(de,"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(i){st.isEventKey(i,"Esc")&&this.handleMouseOut()},e})(De);l2.prototype.options_={children:["muteToggle","volumeControl"]};De.registerComponent("VolumePanel",l2);var u2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(a){return n.handleKeyDown(a)}),n.boundHandleBlur_=function(a){return n.handleBlur(a)},n.boundHandleTapClick_=function(a){return n.handleTapClick(a)},n}var t=e.prototype;return t.addEventListenerForItem=function(i){i instanceof De&&(this.on(i,"blur",this.boundHandleBlur_),this.on(i,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(i){i instanceof De&&(this.off(i,"blur",this.boundHandleBlur_),this.off(i,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(i){typeof i=="string"&&(i=this.getChild(i)),this.removeEventListenerForItem(i),s.prototype.removeChild.call(this,i)},t.addItem=function(i){var n=this.addChild(i);n&&this.addEventListenerForItem(n)},t.createEl=function(){var i=this.options_.contentElType||"ul";this.contentEl_=St(i,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Yr(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(i){var n=i.relatedTarget||de.activeElement;if(!this.children().some(function(o){return o.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(i){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(o){return o.el()===i.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},t.handleKeyDown=function(i){st.isEventKey(i,"Left")||st.isEventKey(i,"Down")?(i.preventDefault(),i.stopPropagation(),this.stepForward()):(st.isEventKey(i,"Right")||st.isEventKey(i,"Up"))&&(i.preventDefault(),i.stopPropagation(),this.stepBack())},t.stepForward=function(){var i=0;this.focusedChild_!==void 0&&(i=this.focusedChild_+1),this.focus(i)},t.stepBack=function(){var i=0;this.focusedChild_!==void 0&&(i=this.focusedChild_-1),this.focus(i)},t.focus=function(i){i===void 0&&(i=0);var n=this.children().slice(),a=n.length&&n[0].hasClass("vjs-menu-title");a&&n.shift(),n.length>0&&(i<0?i=0:i>=n.length&&(i=n.length-1),this.focusedChild_=i,n[i].el_.focus())},e})(De);De.registerComponent("Menu",u2);var Ag=(function(s){Be(e,s);function e(r,i){var n;i===void 0&&(i={}),n=s.call(this,r,i)||this,n.menuButton_=new In(r,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=In.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+a,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var o=function(u){return n.handleClick(u)};return n.handleMenuKeyUp_=function(l){return n.handleMenuKeyUp(l)},n.on(n.menuButton_,"tap",o),n.on(n.menuButton_,"click",o),n.on(n.menuButton_,"keydown",function(l){return n.handleKeyDown(l)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),Yr(de,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(l){return n.handleMouseLeave(l)}),n.on("keydown",function(l){return n.handleSubmenuKeyDown(l)}),n}var t=e.prototype;return t.update=function(){var i=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=i,this.addChild(i),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"))},t.createMenu=function(){var i=new u2(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=St("li",{className:"vjs-menu-title",textContent:vi(this.options_.title),tabIndex:-1}),a=new De(this.player_,{el:n});i.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)i.addItem(this.items[o]);return i},t.createItems=function(){},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var i="vjs-menu-button";this.options_.inline===!0?i+="-inline":i+="-popup";var n=In.prototype.buildCSSClass();return"vjs-menu-button "+i+" "+n+" "+s.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var i="vjs-menu-button";return this.options_.inline===!0?i+="-inline":i+="-popup","vjs-menu-button "+i+" "+s.prototype.buildCSSClass.call(this)},t.controlText=function(i,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(i,n)},t.dispose=function(){this.handleMouseLeave(),s.prototype.dispose.call(this)},t.handleClick=function(i){this.buttonPressed_?this.unpressButton():this.pressButton()},t.handleMouseLeave=function(i){this.removeClass("vjs-hover"),rr(de,"keyup",this.handleMenuKeyUp_)},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(i){st.isEventKey(i,"Esc")||st.isEventKey(i,"Tab")?(this.buttonPressed_&&this.unpressButton(),st.isEventKey(i,"Tab")||(i.preventDefault(),this.menuButton_.focus())):(st.isEventKey(i,"Up")||st.isEventKey(i,"Down"))&&(this.buttonPressed_||(i.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(i){(st.isEventKey(i,"Esc")||st.isEventKey(i,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(i){this.handleSubmenuKeyDown(i)},t.handleSubmenuKeyDown=function(i){(st.isEventKey(i,"Esc")||st.isEventKey(i,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),st.isEventKey(i,"Tab")||(i.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),_r&&ES())return;this.menu.focus()}},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e})(De);De.registerComponent("MenuButton",Ag);var xg=(function(s){Be(e,s);function e(t,r){var i,n=r.tracks;if(i=s.call(this,t,r)||this,i.items.length<=1&&i.hide(),!n)return rt(i);var a=ti(rt(i),i.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),n.addEventListener("labelchange",a),i.player_.on("ready",a),i.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a),n.removeEventListener("labelchange",a)}),i}return e})(Ag);De.registerComponent("TrackButton",xg);var RO=["Tab","Esc","Up","Down","Right","Left"],Sc=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}var t=e.prototype;return t.createEl=function(i,n,a){this.nonIconControl=!0;var o=s.prototype.createEl.call(this,"li",fi({className:"vjs-menu-item",tabIndex:-1},n),a);return o.replaceChild(St("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},t.handleKeyDown=function(i){RO.some(function(n){return st.isEventKey(i,n)})||s.prototype.handleKeyDown.call(this,i)},t.handleClick=function(i){this.selected(!0)},t.selected=function(i){this.selectable&&(i?(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))},e})(Rd);De.registerComponent("MenuItem",Sc);var Cc=(function(s){Be(e,s);function e(r,i){var n,a=i.track,o=r.textTracks();i.label=a.label||a.language||"Unknown",i.selected=a.mode==="showing",n=s.call(this,r,i)||this,n.track=a,n.kinds=(i.kinds||[i.kind||n.track.kind]).filter(Boolean);var l=function(){for(var f=arguments.length,g=new Array(f),E=0;E<f;E++)g[E]=arguments[E];n.handleTracksChange.apply(rt(n),g)},u=function(){for(var f=arguments.length,g=new Array(f),E=0;E<f;E++)g[E]=arguments[E];n.handleSelectedLanguageChange.apply(rt(n),g)};if(r.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",u),n.on("dispose",function(){r.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",u)}),o.onchange===void 0){var c;n.on(["tap","click"],function(){if(typeof N.Event!="object")try{c=new N.Event("change")}catch{}c||(c=de.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return n.handleTracksChange(),n}var t=e.prototype;return t.handleClick=function(i){var n=this.track,a=this.player_.textTracks();if(s.prototype.handleClick.call(this,i),!!a)for(var o=0;o<a.length;o++){var l=a[o];this.kinds.indexOf(l.kind)!==-1&&(l===n?l.mode!=="showing"&&(l.mode="showing"):l.mode!=="disabled"&&(l.mode="disabled"))}},t.handleTracksChange=function(i){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},t.handleSelectedLanguageChange=function(i){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.dispose=function(){this.track=null,s.prototype.dispose.call(this)},e})(Sc);De.registerComponent("TextTrackMenuItem",Cc);var c2=(function(s){Be(e,s);function e(r,i){return i.track={player:r,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,s.call(this,r,i)||this}var t=e.prototype;return t.handleTracksChange=function(i){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(this.options_.kinds.indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(i){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(["captions","descriptions","subtitles"].indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},e})(Cc);De.registerComponent("OffTextTrackMenuItem",c2);var Hl=(function(s){Be(e,s);function e(r,i){return i===void 0&&(i={}),i.tracks=r.textTracks(),s.call(this,r,i)||this}var t=e.prototype;return t.createItems=function(i,n){i===void 0&&(i=[]),n===void 0&&(n=Cc);var a;this.label_&&(a=this.label_+" off"),i.push(new c2(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l<o.length;l++){var u=o[l];if(this.kinds_.indexOf(u.kind)>-1){var c=new n(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+u.kind+"-menu-item"),i.push(c)}}return i},e})(xg);De.registerComponent("TextTrackButton",Hl);var h2=(function(s){Be(e,s);function e(r,i){var n,a=i.track,o=i.cue,l=r.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=o.text,i.selected=o.startTime<=l&&l<o.endTime,n=s.call(this,r,i)||this,n.track=a,n.cue=o,n}var t=e.prototype;return t.handleClick=function(i){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},e})(Sc);De.registerComponent("ChaptersTrackMenuItem",h2);var Ng=(function(s){Be(e,s);function e(r,i,n){var a;return a=s.call(this,r,i,n)||this,a.selectCurrentItem_=function(){a.items.forEach(function(o){o.selected(a.track_.activeCues[0]===o.cue)})},a}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildWrapperCSSClass.call(this)},t.update=function(i){if(!(i&&i.track&&i.track.kind!=="chapters")){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),s.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&s.prototype.update.call(this)}},t.setTrack=function(i){if(this.track_!==i){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=i,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},t.findChaptersTrack=function(){for(var i=this.player_.textTracks()||[],n=i.length-1;n>=0;n--){var a=i[n];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(vi(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var i=[];if(!this.track_)return i;var n=this.track_.cues;if(!n)return i;for(var a=0,o=n.length;a<o;a++){var l=n[a],u=new h2(this.player_,{track:this.track_,cue:l});i.push(u)}return i},e})(Hl);Ng.prototype.kind_="chapters";Ng.prototype.controlText_="Chapters";De.registerComponent("ChaptersButton",Ng);var Dg=(function(s){Be(e,s);function e(r,i,n){var a;a=s.call(this,r,i,n)||this;var o=r.textTracks(),l=ti(rt(a),a.handleTracksChange);return o.addEventListener("change",l),a.on("dispose",function(){o.removeEventListener("change",l)}),a}var t=e.prototype;return t.handleTracksChange=function(i){for(var n=this.player().textTracks(),a=!1,o=0,l=n.length;o<l;o++){var u=n[o];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(Hl);Dg.prototype.kind_="descriptions";Dg.prototype.controlText_="Descriptions";De.registerComponent("DescriptionsButton",Dg);var Ig=(function(s){Be(e,s);function e(r,i,n){return s.call(this,r,i,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(Hl);Ig.prototype.kind_="subtitles";Ig.prototype.controlText_="Subtitles";De.registerComponent("SubtitlesButton",Ig);var Pg=(function(s){Be(e,s);function e(r,i){var n;return i.track={player:r,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",n=s.call(this,r,i)||this,n.addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}var t=e.prototype;return t.handleClick=function(i){this.player().getChild("textTrackSettings").open()},e})(Cc);De.registerComponent("CaptionSettingsMenuItem",Pg);var Lg=(function(s){Be(e,s);function e(r,i,n){return s.call(this,r,i,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var i=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(i.push(new Pg(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,i)},e})(Hl);Lg.prototype.kind_="captions";Lg.prototype.controlText_="Captions";De.registerComponent("CaptionsButton",Lg);var d2=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(i,n,a){var o=s.prototype.createEl.call(this,i,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(l.appendChild(St("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(St("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},e})(Cc);De.registerComponent("SubsCapsMenuItem",d2);var Og=(function(s){Be(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,n.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(vi(n.label_)),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var i=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(i.push(new Pg(this.player_,{kind:this.label_})),this.hideThreshold_+=1),i=s.prototype.createItems.call(this,i,d2),i},e})(Hl);Og.prototype.kinds_=["captions","subtitles"];Og.prototype.controlText_="Subtitles";De.registerComponent("SubsCapsButton",Og);var f2=(function(s){Be(e,s);function e(r,i){var n,a=i.track,o=r.audioTracks();i.label=a.label||a.language||"Unknown",i.selected=a.enabled,n=s.call(this,r,i)||this,n.track=a,n.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];n.handleTracksChange.apply(rt(n),d)};return o.addEventListener("change",l),n.on("dispose",function(){o.removeEventListener("change",l)}),n}var t=e.prototype;return t.createEl=function(i,n,a){var o=s.prototype.createEl.call(this,i,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(l.appendChild(St("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(St("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},t.handleClick=function(i){if(s.prototype.handleClick.call(this,i),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];o!==this.track&&(o.enabled=o===this.track)}},t.handleTracksChange=function(i){this.selected(this.track.enabled)},e})(Sc);De.registerComponent("AudioTrackMenuItem",f2);var p2=(function(s){Be(e,s);function e(r,i){return i===void 0&&(i={}),i.tracks=r.audioTracks(),s.call(this,r,i)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(i){i===void 0&&(i=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];i.push(new f2(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return i},e})(xg);p2.prototype.controlText_="Audio Track";De.registerComponent("AudioTrackButton",p2);var Mg=(function(s){Be(e,s);function e(r,i){var n,a=i.rate,o=parseFloat(a,10);return i.label=a,i.selected=o===r.playbackRate(),i.selectable=!0,i.multiSelectable=!1,n=s.call(this,r,i)||this,n.label=a,n.rate=o,n.on(r,"ratechange",function(l){return n.update(l)}),n}var t=e.prototype;return t.handleClick=function(i){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(i){this.selected(this.player().playbackRate()===this.rate)},e})(Sc);Mg.prototype.contentElType="button";De.registerComponent("PlaybackRateMenuItem",Mg);var m2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(r,"loadstart",function(a){return n.updateVisibility(a)}),n.on(r,"ratechange",function(a){return n.updateLabel(a)}),n.on(r,"playbackrateschange",function(a){return n.handlePlaybackRateschange(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=St("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),i.appendChild(this.labelEl_),i},t.dispose=function(){this.labelEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){for(var i=this.playbackRates(),n=[],a=i.length-1;a>=0;a--)n.push(new Mg(this.player(),{rate:i[a]+"x"}));return n},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(i){var n=this.player().playbackRate(),a=this.playbackRates(),o=a.indexOf(n),l=(o+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(i){this.update()},t.playbackRates=function(){var i=this.player();return i.playbackRates&&i.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(i){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(i){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},e})(Ag);m2.prototype.controlText_="Playback Rate";De.registerComponent("PlaybackRateMenuButton",m2);var g2=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(i,n,a){return i===void 0&&(i="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),s.prototype.createEl.call(this,i,n,a)},e})(De);De.registerComponent("Spacer",g2);var BO=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},e})(g2);De.registerComponent("CustomControlSpacer",BO);var jh=(function(s){Be(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e})(De);jh.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in de&&jh.prototype.options_.children.splice(jh.prototype.options_.children.length-1,0,"pictureInPictureToggle");De.registerComponent("ControlBar",jh);var v2=(function(s){Be(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"error",function(a){return n.open(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var i=this.player().error();return i?this.localize(i.message):""},e})(Fl);v2.prototype.options_=jt({},Fl.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});De.registerComponent("ErrorDisplay",v2);var qf="vjs-text-track-settings",I_=["#000","Black"],P_=["#00F","Blue"],L_=["#0FF","Cyan"],O_=["#0F0","Green"],M_=["#F0F","Magenta"],R_=["#F00","Red"],B_=["#FFF","White"],U_=["#FF0","Yellow"],zf=["1","Opaque"],Wf=["0.5","Semi-Transparent"],F_=["0","Transparent"],Ya={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[I_,B_,R_,O_,P_,U_,M_,L_]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[zf,Wf,F_]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[B_,I_,R_,O_,P_,U_,M_,L_]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(e){return e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[zf,Wf]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[F_,Wf,zf]}};Ya.windowColor.options=Ya.backgroundColor.options;function y2(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function UO(s,e){var t=s.options[s.options.selectedIndex].value;return y2(t,e)}function FO(s,e,t){if(e){for(var r=0;r<s.options.length;r++)if(y2(s.options[r].value,t)===e){s.selectedIndex=r;break}}}var $O=(function(s){Be(e,s);function e(r,i){var n;return i.temporary=!1,n=s.call(this,r,i)||this,n.updateDisplay=n.updateDisplay.bind(rt(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=St("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),i.persistTextTrackSettings===void 0&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),nl(Ya,function(a){n.on(n.$(a.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}var t=e.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(i,n,a){var o=this;n===void 0&&(n=""),a===void 0&&(a="label");var l=Ya[i],u=l.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(l.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(l.options.map(function(d){var f=u+"-"+d[1].replace(/\W+/g,"");return['<option id="'+f+'" value="'+d[0]+'" ','aria-labelledby="'+c+" "+f+'">',o.localize(d[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var i="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",i),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",i),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var i="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",i),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",i),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var i="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",i),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",i),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return St("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return St("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.createElControls_=function(){var i=this.localize("restore all settings to the default values");return St("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+i+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+i+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var i=this;return xL(Ya,function(n,a,o){var l=UO(i.$(a.selector),a.parser);return l!==void 0&&(n[o]=l),n},{})},t.setValues=function(i){var n=this;nl(Ya,function(a,o){FO(n.$(a.selector),i[o],a.parser)})},t.setDefaults=function(){var i=this;nl(Ya,function(n){var a=n.hasOwnProperty("default")?n.default:0;i.$(n.selector).selectedIndex=a})},t.restoreSettings=function(){var i;try{i=JSON.parse(N.localStorage.getItem(qf))}catch(n){pt.warn(n)}i&&this.setValues(i)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var i=this.getValues();try{Object.keys(i).length?N.localStorage.setItem(qf,JSON.stringify(i)):N.localStorage.removeItem(qf)}catch(n){pt.warn(n)}}},t.updateDisplay=function(){var i=this.player_.getChild("textTrackDisplay");i&&i.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var i=this.player_.controlBar,n=i&&i.subsCapsButton,a=i&&i.captionsButton;n?n.focus():a&&a.focus()},e})(Fl);De.registerComponent("TextTrackSettings",$O);var jO=(function(s){Be(e,s);function e(r,i){var n,a=i.ResizeObserver||N.ResizeObserver;i.ResizeObserver===null&&(a=!1);var o=ei({createEl:!a,reportTouchActivity:!1},i);return n=s.call(this,r,o)||this,n.ResizeObserver=i.ResizeObserver||N.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=FL(function(){n.resizeHandler()},100,!1,rt(n)),a?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(r.el())):(n.loadListener_=function(){if(!(!n.el_||!n.el_.contentWindow)){var l=n.debouncedHandler_,u=n.unloadListener_=function(){rr(this,"resize",l),rr(this,"unload",u),u=null};Yr(n.el_.contentWindow,"unload",u),Yr(n.el_.contentWindow,"resize",l)}},n.one("load",n.loadListener_)),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},t.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},t.dispose=function(){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,s.prototype.dispose.call(this)},e})(De);De.registerComponent("ResizeManager",jO);var HO={trackingThreshold:20,liveTolerance:15},VO=(function(s){Be(e,s);function e(r,i){var n,a=ei(HO,i,{createEl:!1});return n=s.call(this,r,a)||this,n.handleVisibilityChange_=function(o){return n.handleVisibilityChange(o)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(o){return n.handlePlay(o)},n.handleFirstTimeupdate_=function(o){return n.handleFirstTimeupdate(o)},n.handleSeeked_=function(o){return n.handleSeeked(o)},n.seekToLiveEdge_=function(o){return n.seekToLiveEdge(o)},n.reset_(),n.on(n.player_,"durationchange",function(o){return n.handleDurationchange(o)}),n.on(n.player_,"canplay",function(){return n.toggleTracking()}),_c&&"hidden"in de&&"visibilityState"in de&&n.on(de,"visibilitychange",n.handleVisibilityChange_),n}var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(de.hidden?this.stopTracking():this.startTracking())},t.trackLive_=function(){var i=this.player_.seekable();if(!(!i||!i.length)){var n=Number(N.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var o=this.liveCurrentTime(),l=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){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())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Pn),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_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var i=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&i>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){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_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var i=this.player_.seekable(),n=[],a=i?i.length:0;a--;)n.push(i.end(a));return n.length?n.sort()[n.length-1]:1/0},t.seekableStart=function(){for(var i=this.player_.seekable(),n=[],a=i?i.length:0;a--;)n.push(i.start(a));return n.length?n.sort()[0]:0},t.liveWindow=function(){var i=this.liveCurrentTime();return i===1/0?0:i-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var i=this.seekableEnd();return this.lastSeekEnd_!==-1&&i!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=i,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return typeof this.trackingInterval_=="number"},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(de,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},e})(De);De.registerComponent("LiveTracker",VO);var Kp=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var r=e.$$("source"),i=[],n="";if(!r.length)return!1;for(var a=0;a<r.length;a++){var o=r[a].src;o&&i.indexOf(o)===-1&&i.push(o)}return i.length?(i.length===1&&(n=i[0]),e.triggerSourceset(n),!0):!1},qO=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=de.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var r=de.createDocumentFragment();t.childNodes.length;)r.appendChild(t.childNodes[0]);return this.innerText="",N.Element.prototype.appendChild.call(this,r),this.innerHTML}}),_2=function(e,t){for(var r={},i=0;i<e.length&&(r=Object.getOwnPropertyDescriptor(e[i],t),!(r&&r.set&&r.get));i++);return r.enumerable=!0,r.configurable=!0,r},zO=function(e){return _2([e.el(),N.HTMLMediaElement.prototype,N.Element.prototype,qO],"innerHTML")},$_=function(e){var t=e.el();if(!t.resetSourceWatch_){var r={},i=zO(e),n=function(o){return function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];var d=o.apply(t,u);return Kp(e),d}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){t[a]&&(r[a]=t[a],t[a]=n(r[a]))}),Object.defineProperty(t,"innerHTML",ei(i,{set:n(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(r).forEach(function(a){t[a]=r[a]}),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},WO=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?WS(N.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return N.Element.prototype.setAttribute.call(this,"src",e),e}}),GO=function(e){return _2([e.el(),N.HTMLMediaElement.prototype,WO],"src")},KO=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var r=GO(e),i=t.setAttribute,n=t.load;Object.defineProperty(t,"src",ei(r,{set:function(o){var l=r.set.call(t,o);return e.triggerSourceset(t.src),l}})),t.setAttribute=function(a,o){var l=i.call(t,a,o);return/src/i.test(a)&&e.triggerSourceset(t.src),l},t.load=function(){var a=n.call(t);return Kp(e)||(e.triggerSourceset(""),$_(e)),a},t.currentSrc?e.triggerSourceset(t.currentSrc):Kp(e)||$_(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=n,t.setAttribute=i,Object.defineProperty(t,"src",r),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Rg=function(e,t,r,i){i===void 0&&(i=!0);var n=function(l){return Object.defineProperty(e,t,{value:l,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var l=r();return n(l),l}};return i&&(a.set=n),Object.defineProperty(e,t,a)},$e=(function(s){Be(e,s);function e(r,i){var n;n=s.call(this,r,i)||this;var a=r.source,o=!1;if(n.featuresVideoFrameCallback=n.featuresVideoFrameCallback&&n.el_.tagName==="VIDEO",a&&(n.el_.currentSrc!==a.src||r.tag&&r.tag.initNetworkState_===3)?n.setSource(a):n.handleLateInit_(n.el_),r.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var l=n.el_.childNodes,u=l.length,c=[];u--;){var d=l[u],f=d.nodeName.toLowerCase();f==="track"&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(d),n.remoteTextTracks().addTrack(d.track),n.textTracks().addTrack(d.track),!o&&!n.el_.hasAttribute("crossorigin")&&Md(d.src)&&(o=!0)):c.push(d))}for(var g=0;g<c.length;g++)n.el_.removeChild(c[g])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&pt.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
313
|
+
This may prevent text tracks from loading.`),n.restoreMetadataTracksInIOSNativePlayer_(),(bl||hg||_S)&&r.nativeControlsForTouch===!0&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}var t=e.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,s.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){KO(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){var i=this.textTracks(),n,a=function(){n=[];for(var u=0;u<i.length;u++){var c=i[u];c.kind==="metadata"&&n.push({track:c,storedMode:c.mode})}};a(),i.addEventListener("change",a),this.on("dispose",function(){return i.removeEventListener("change",a)});var o=function l(){for(var u=0;u<n.length;u++){var c=n[u];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}i.removeEventListener("change",l)};this.on("webkitbeginfullscreen",function(){i.removeEventListener("change",a),i.removeEventListener("change",o),i.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){i.removeEventListener("change",a),i.addEventListener("change",a),i.removeEventListener("change",o)})},t.overrideNative_=function(i,n){var a=this;if(n===this["featuresNative"+i+"Tracks"]){var o=i.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(l){var u=a.el()[o+"Tracks"];u.removeEventListener(l,a[o+"TracksListeners_"][l])}),this["featuresNative"+i+"Tracks"]=!n,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},t.overrideNativeAudioTracks=function(i){this.overrideNative_("Audio",i)},t.overrideNativeVideoTracks=function(i){this.overrideNative_("Video",i)},t.proxyNativeTracksForType_=function(i){var n=this,a=hn[i],o=this.el()[a.getterName],l=this[a.getterName]();if(!(!this["featuresNative"+a.capitalName+"Tracks"]||!o||!o.addEventListener)){var u={change:function(f){var g={type:"change",target:l,currentTarget:l,srcElement:l};l.trigger(g),i==="text"&&n[wl.remoteText.getterName]().trigger(g)},addtrack:function(f){l.addTrack(f.track)},removetrack:function(f){l.removeTrack(f.track)}},c=function(){for(var f=[],g=0;g<l.length;g++){for(var E=!1,S=0;S<o.length;S++)if(o[S]===l[g]){E=!0;break}E||f.push(l[g])}for(;f.length;)l.removeTrack(f.shift())};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(d){var f=u[d];o.addEventListener(d,f),n.on("dispose",function(g){return o.removeEventListener(d,f)})}),this.on("loadstart",c),this.on("dispose",function(d){return n.off("loadstart",c)})}},t.proxyNativeTracks_=function(){var i=this;hn.names.forEach(function(n){i.proxyNativeTracksForType_(n)})},t.createEl=function(){var i=this.options_.tag;if(!i||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(i){var n=i.cloneNode(!0);i.parentNode&&i.parentNode.insertBefore(n,i),e.disposeMediaElement(i),i=n}else{i=de.createElement("video");var a=this.options_.tag&&Bs(this.options_.tag),o=ei({},a);(!bl||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,AS(i,fi(o,{id:this.options_.techId,class:"vjs-tech"}))}i.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Sl(i,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(i.disablePictureInPicture=this.options_.disablePictureInPicture);for(var l=["loop","muted","playsinline","autoplay"],u=0;u<l.length;u++){var c=l[u],d=this.options_[c];typeof d<"u"&&(d?Sl(i,c,c):Dd(i,c),i[c]=d)}return i},t.handleLateInit_=function(i){if(!(i.networkState===0||i.networkState===3)){if(i.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var o=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",o),n||this.trigger("loadstart")});return}var l=["loadstart"];l.push("loadedmetadata"),i.readyState>=2&&l.push("loadeddata"),i.readyState>=3&&l.push("canplay"),i.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(u){this.trigger(u)},this)})}},t.setScrubbing=function(i){this.isScrubbing_=i},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(i){try{this.isScrubbing_&&this.el_.fastSeek&&Nd?this.el_.fastSeek(i):this.el_.currentTime=i}catch(n){pt(n,"Video is not ready. (Video.js)")}},t.duration=function(){var i=this;if(this.el_.duration===1/0&&Xs&&Ys&&this.el_.currentTime===0){var n=function a(){i.el_.currentTime>0&&(i.el_.duration===1/0&&i.trigger("durationchange"),i.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var i=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){i.off("webkitbeginfullscreen",a),i.off("webkitendfullscreen",n)})}},t.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var i=N.navigator&&N.navigator.userAgent||"";if(/Android/.test(i)||!/Chrome|Mac OS X 10.5/.test(i))return!0}return!1},t.enterFullScreen=function(){var i=this.el_;if(i.paused&&i.networkState<=i.HAVE_METADATA)hs(this.el_.play()),this.setTimeout(function(){i.pause();try{i.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{i.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},t.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.requestVideoFrameCallback=function(i){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(i):s.prototype.requestVideoFrameCallback.call(this,i)},t.cancelVideoFrameCallback=function(i){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(i):s.prototype.cancelVideoFrameCallback.call(this,i)},t.src=function(i){if(i===void 0)return this.el_.src;this.setSrc(i)},t.reset=function(){e.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(i){this.el_.controls=!!i},t.addTextTrack=function(i,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(i,n,a):s.prototype.addTextTrack.call(this,i,n,a)},t.createRemoteTextTrack=function(i){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,i);var n=de.createElement("track");return i.kind&&(n.kind=i.kind),i.label&&(n.label=i.label),(i.language||i.srclang)&&(n.srclang=i.language||i.srclang),i.default&&(n.default=i.default),i.id&&(n.id=i.id),i.src&&(n.src=i.src),n},t.addRemoteTextTrack=function(i,n){var a=s.prototype.addRemoteTextTrack.call(this,i,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(i){if(s.prototype.removeRemoteTextTrack.call(this,i),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(i===n[a]||i===n[a].track)&&this.el().removeChild(n[a])},t.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var i={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(i.droppedVideoFrames=this.el().webkitDroppedFrameCount,i.totalVideoFrames=this.el().webkitDecodedFrameCount),N.performance&&typeof N.performance.now=="function"?i.creationTime=N.performance.now():N.performance&&N.performance.timing&&typeof N.performance.timing.navigationStart=="number"&&(i.creationTime=N.Date.now()-N.performance.timing.navigationStart),i},e})(zt);Rg($e,"TEST_VID",function(){if(Rl()){var s=de.createElement("video"),e=de.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}});$e.isSupported=function(){try{$e.TEST_VID.volume=.5}catch{return!1}return!!($e.TEST_VID&&$e.TEST_VID.canPlayType)};$e.canPlayType=function(s){return $e.TEST_VID.canPlayType(s)};$e.canPlaySource=function(s,e){return $e.canPlayType(s.type)};$e.canControlVolume=function(){try{var s=$e.TEST_VID.volume;$e.TEST_VID.volume=s/2+.1;var e=s!==$e.TEST_VID.volume;return e&&_r?(N.setTimeout(function(){$e&&$e.prototype&&($e.prototype.featuresVolumeControl=s!==$e.TEST_VID.volume)}),!1):e}catch{return!1}};$e.canMuteVolume=function(){try{var s=$e.TEST_VID.muted;return $e.TEST_VID.muted=!s,$e.TEST_VID.muted?Sl($e.TEST_VID,"muted","muted"):Dd($e.TEST_VID,"muted","muted"),s!==$e.TEST_VID.muted}catch{return!1}};$e.canControlPlaybackRate=function(){if(Xs&&Ys&&bS<58)return!1;try{var s=$e.TEST_VID.playbackRate;return $e.TEST_VID.playbackRate=s/2+.1,s!==$e.TEST_VID.playbackRate}catch{return!1}};$e.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(de.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(de.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(de.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(de.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};$e.supportsNativeTextTracks=function(){return Nd||_r&&Ys};$e.supportsNativeVideoTracks=function(){return!!($e.TEST_VID&&$e.TEST_VID.videoTracks)};$e.supportsNativeAudioTracks=function(){return!!($e.TEST_VID&&$e.TEST_VID.audioTracks)};$e.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(s){var e=s[0],t=s[1];Rg($e.prototype,e,function(){return $e[t]()},!0)});$e.prototype.featuresVolumeControl=$e.canControlVolume();$e.prototype.movingMediaElementInDOM=!_r;$e.prototype.featuresFullscreenResize=!0;$e.prototype.featuresProgressEvents=!0;$e.prototype.featuresTimeupdateEvents=!0;$e.prototype.featuresVideoFrameCallback=!!($e.TEST_VID&&$e.TEST_VID.requestVideoFrameCallback);var Hh;$e.patchCanPlayType=function(){lg>=4&&!TS&&!Ys&&(Hh=$e.TEST_VID&&$e.TEST_VID.constructor.prototype.canPlayType,$e.TEST_VID.constructor.prototype.canPlayType=function(s){var e=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&e.test(s)?"maybe":Hh.call(this,s)})};$e.unpatchCanPlayType=function(){var s=$e.TEST_VID.constructor.prototype.canPlayType;return Hh&&($e.TEST_VID.constructor.prototype.canPlayType=Hh),s};$e.patchCanPlayType();$e.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};$e.resetMediaElement=function(s){if(s){for(var e=s.querySelectorAll("source"),t=e.length;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){$e.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){$e.prototype["set"+vi(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){$e.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){$e.prototype["set"+vi(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){$e.prototype[s]=function(){return this.el_[s]()}});zt.withSourceHandlers($e);$e.nativeSourceHandler={};$e.nativeSourceHandler.canPlayType=function(s){try{return $e.TEST_VID.canPlayType(s)}catch{return""}};$e.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return $e.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=yg(s.src);return $e.nativeSourceHandler.canPlayType("video/"+t)}return""};$e.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};$e.nativeSourceHandler.dispose=function(){};$e.registerSourceHandler($e.nativeSourceHandler);zt.registerTech("Html5",$e);var T2=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Gf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Xp=["tiny","xsmall","small","medium","large","xlarge","huge"],oh={};Xp.forEach(function(s){var e=s.charAt(0)==="x"?"x-"+s.substring(1):s;oh[s]="vjs-layout-"+e});var XO={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ei=(function(s){Be(e,s);function e(r,i,n){var a;if(r.id=r.id||i.id||"vjs_video_"+Qs(),i=fi(e.getTagSettings(r),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if(typeof r.closest=="function"){var o=r.closest("[lang]");o&&o.getAttribute&&(i.language=o.getAttribute("lang"))}else for(var l=r;l&&l.nodeType===1;){if(Bs(l).hasOwnProperty("lang")){i.language=l.getAttribute("lang");break}l=l.parentNode}if(a=s.call(this,null,i,n)||this,a.boundDocumentFullscreenChange_=function(f){return a.documentFullscreenChange_(f)},a.boundFullWindowOnEscKey_=function(f){return a.fullWindowOnEscKey(f)},a.boundUpdateStyleEl_=function(f){return a.updateStyleEl_(f)},a.boundApplyInitTime_=function(f){return a.applyInitTime_(f)},a.boundUpdateCurrentBreakpoint_=function(f){return a.updateCurrentBreakpoint_(f)},a.boundHandleTechClick_=function(f){return a.handleTechClick_(f)},a.boundHandleTechDoubleClick_=function(f){return a.handleTechDoubleClick_(f)},a.boundHandleTechTouchStart_=function(f){return a.handleTechTouchStart_(f)},a.boundHandleTechTouchMove_=function(f){return a.handleTechTouchMove_(f)},a.boundHandleTechTouchEnd_=function(f){return a.handleTechTouchEnd_(f)},a.boundHandleTechTap_=function(f){return a.handleTechTap_(f)},a.isFullscreen_=!1,a.log=gS(a.id_),a.fsApi_=Bh,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.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(a.tag=r,a.tagAttributes=r&&Bs(r),a.language(a.options_.language),i.languages){var u={};Object.getOwnPropertyNames(i.languages).forEach(function(f){u[f.toLowerCase()]=i.languages[f]}),a.languages_=u}else a.languages_=e.prototype.options_.languages;a.resetCache_(),a.poster_=i.poster||"",a.controls_=!!i.controls,r.controls=!1,r.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],r.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach(function(f){if(typeof a[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),mg(rt(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Yr(de,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=ei(a.options_);i.plugins&&Object.keys(i.plugins).forEach(function(f){a[f](i.plugins[f])}),i.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(i.playbackRates),a.initChildren(),a.isAudio(r.nodeName.toLowerCase()==="audio"),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),bl&&a.addClass("vjs-touch-enabled"),_r||a.addClass("vjs-workinghover"),e.players[a.id_]=rt(a);var d=fS.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",function(f){return a.listenForUserActivity_(f)}),a.on("stageclick",function(f){return a.handleStageClick_(f)}),a.on("keydown",function(f){return a.handleKeyDown(f)}),a.on("languagechange",function(f){return a.handleLanguagechange(f)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}var t=e.prototype;return t.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),rr(de,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),rr(de,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.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),mO(this),dr.names.forEach(function(n){var a=dr[n],o=i[a.getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},t.createEl=function(){var i=this.tag,n,a=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";a?n=this.el_=i.parentNode:o||(n=this.el_=s.prototype.createEl.call(this,"div"));var l=Bs(i);if(o){for(n=this.el_=i,i=this.tag=de.createElement("video");n.children.length;)i.appendChild(n.firstChild);ao(n,"video-js")||qs(n,"video-js"),n.appendChild(i),a=this.playerElIngest_=n,Object.keys(n).forEach(function(E){try{i[E]=n[E]}catch{}})}if(i.setAttribute("tabindex","-1"),l.tabindex="-1",(_c||Ys&&SS)&&(i.setAttribute("role","application"),l.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(E){o&&E==="class"||n.setAttribute(E,l[E]),o&&i.setAttribute(E,l[E])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=n.player=this,this.addClass("vjs-paused"),N.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=BS("vjs-styles-dimensions");var u=xa(".vjs-styles-defaults"),c=xa("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.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);for(var d=i.getElementsByTagName("a"),f=0;f<d.length;f++){var g=d.item(f);qs(g,"vjs-hidden"),g.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!a&&i.parentNode.insertBefore(n,i),jp(i,n),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=n,n},t.crossOrigin=function(i){if(!i)return this.techGet_("crossOrigin");if(i!=="anonymous"&&i!=="use-credentials"){pt.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+i+'"');return}this.techCall_("setCrossOrigin",i)},t.width=function(i){return this.dimension("width",i)},t.height=function(i){return this.dimension("height",i)},t.dimension=function(i,n){var a=i+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto"){this[a]=void 0,this.updateStyleEl_();return}var o=parseFloat(n);if(isNaN(o)){pt.error('Improper value "'+n+'" supplied for for '+i);return}this[a]=o,this.updateStyleEl_()},t.fluid=function(i){var n=this;if(i===void 0)return!!this.fluid_;this.fluid_=!!i,zs(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),i?(this.addClass("vjs-fluid"),this.fill(!1),$L(this,function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.fill=function(i){if(i===void 0)return!!this.fill_;this.fill_=!!i,i?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.aspectRatio=function(i){if(i===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(i))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=i,this.fluid(!0),this.updateStyleEl_()},t.updateStyleEl_=function(){if(N.VIDEOJS_NO_DYNAMIC_STYLE===!0){var i=typeof this.width_=="number"?this.width_:this.options_.width,n=typeof this.height_=="number"?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(i>=0&&(a.width=i),n>=0&&(a.height=n));return}var o,l,u,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?u=this.aspectRatio_:this.videoWidth()>0?u=this.videoWidth()+":"+this.videoHeight():u="16:9";var d=u.split(":"),f=d[1]/d[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/f:o=this.videoWidth()||300,this.height_!==void 0?l=this.height_:l=o*f,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),US(this.styleEl_,`
|
|
314
|
+
.`+c+` {
|
|
315
|
+
width: `+o+`px;
|
|
316
|
+
height: `+l+`px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
320
|
+
padding-top: `+f*100+`%;
|
|
321
|
+
}
|
|
322
|
+
`)},t.loadTech_=function(i,n){var a=this;this.tech_&&this.unloadTech_();var o=vi(i),l=i.charAt(0).toLowerCase()+i.slice(1);o!=="Html5"&&this.tag&&(zt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_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,Promise:this.options_.Promise};dr.names.forEach(function(f){var g=dr[f];c[g.getterName]=a[g.privateName]}),fi(c,this.options_[o]),fi(c,this.options_[l]),fi(c,this.options_[i.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var d=zt.getTech(i);if(!d)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new d(c),this.tech_.ready(ti(this,this.handleTechReady_),!0),b_.jsonToTextTracks(this.textTracksJson_||[],this.tech_),T2.forEach(function(f){a.on(a.tech_,f,function(g){return a["handleTech"+vi(f)+"_"](g)})}),Object.keys(Gf).forEach(function(f){a.on(a.tech_,f,function(g){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+Gf[f]+"_"].bind(a),event:g});return}a["handleTech"+Gf[f]+"_"](g)})}),this.on(this.tech_,"loadstart",function(f){return a.handleTechLoadStart_(f)}),this.on(this.tech_,"sourceset",function(f){return a.handleTechSourceset_(f)}),this.on(this.tech_,"waiting",function(f){return a.handleTechWaiting_(f)}),this.on(this.tech_,"ended",function(f){return a.handleTechEnded_(f)}),this.on(this.tech_,"seeking",function(f){return a.handleTechSeeking_(f)}),this.on(this.tech_,"play",function(f){return a.handleTechPlay_(f)}),this.on(this.tech_,"firstplay",function(f){return a.handleTechFirstPlay_(f)}),this.on(this.tech_,"pause",function(f){return a.handleTechPause_(f)}),this.on(this.tech_,"durationchange",function(f){return a.handleTechDurationChange_(f)}),this.on(this.tech_,"fullscreenchange",function(f,g){return a.handleTechFullscreenChange_(f,g)}),this.on(this.tech_,"fullscreenerror",function(f,g){return a.handleTechFullscreenError_(f,g)}),this.on(this.tech_,"enterpictureinpicture",function(f){return a.handleTechEnterPictureInPicture_(f)}),this.on(this.tech_,"leavepictureinpicture",function(f){return a.handleTechLeavePictureInPicture_(f)}),this.on(this.tech_,"error",function(f){return a.handleTechError_(f)}),this.on(this.tech_,"posterchange",function(f){return a.handleTechPosterChange_(f)}),this.on(this.tech_,"textdata",function(f){return a.handleTechTextData_(f)}),this.on(this.tech_,"ratechange",function(f){return a.handleTechRateChange_(f)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(o!=="Html5"||!this.tag)&&jp(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var i=this;dr.names.forEach(function(n){var a=dr[n];i[a.privateName]=i[a.getterName]()}),this.textTracksJson_=b_.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(i){return i===void 0&&pt.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
323
|
+
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
324
|
+
`),this.tech_},t.addTechControlsListeners_=function(){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_)},t.removeTechControlsListeners_=function(){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_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(i){var n=this;if(!(!this.tech_||typeof i!="string")){var a=function(){var u=n.muted();n.muted(!0);var c=function(){n.muted(u)};n.playTerminatedQueue_.push(c);var d=n.play();if(Ku(d))return d.catch(function(f){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(f||""))})},o;if(i==="any"&&!this.muted()?(o=this.play(),Ku(o)&&(o=o.catch(a))):i==="muted"&&!this.muted()?o=a():o=this.play(),!!Ku(o))return o.then(function(){n.trigger({type:"autoplay-success",autoplay:i})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:i})})}},t.updateSourceCaches_=function(i){i===void 0&&(i="");var n=i,a="";typeof n!="string"&&(n=i.src,a=i.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=yO(this,n)),this.cache_.source=ei({},i,{src:n,type:a});for(var o=this.cache_.sources.filter(function(g){return g.src&&g.src===n}),l=[],u=this.$$("source"),c=[],d=0;d<u.length;d++){var f=Bs(u[d]);l.push(f),f.src&&f.src===n&&c.push(f.src)}c.length&&!o.length?this.cache_.sources=l:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},t.handleTechSourceset_=function(i){var n=this;if(!this.changingSrc_){var a=function(c){return n.updateSourceCaches_(c)},o=this.currentSource().src,l=i.src;o&&!/^blob:/.test(o)&&/^blob:/.test(l)&&(!this.lastSource_||this.lastSource_.tech!==l&&this.lastSource_.player!==o)&&(a=function(){}),a(l),i.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=n.techGet("currentSrc");n.lastSource_.tech=c,n.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:i.src},this.trigger({src:i.src,type:"sourceset"})},t.hasStarted=function(i){if(i===void 0)return this.hasStarted_;i!==this.hasStarted_&&(this.hasStarted_=i,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(i){return i.callback(i.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var i=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function o(){n!==i.currentTime()&&(i.removeClass("vjs-waiting"),i.off("timeupdate",o))};this.on("timeupdate",a)},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(pt.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(i){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,i):this.paused()?hs(this.play()):this.pause())},t.handleTechDoubleClick_=function(i){if(this.controls_){var n=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(i.target)});n||(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,i):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(i){i.cancelable&&i.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(i){var n=i.target.player;if(!(n&&n!==this)){var a=this.el(),o=de[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(i,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},t.handleTechFullscreenError_=function(i,n){this.trigger("fullscreenerror",n)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(i){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(i){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var i=this.tech_.error();this.error(i)},t.handleTechTextData_=function(){var i=null;arguments.length>1&&(i=arguments[1]),this.trigger("textdata",i)},t.getCache=function(){return this.cache_},t.resetCache_=function(){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}},t.techCall_=function(i,n){this.ready(function(){if(i in fO)return hO(this.middleware_,this.tech_,i,n);if(i in A_)return k_(this.middleware_,this.tech_,i,n);try{this.tech_&&this.tech_[i](n)}catch(a){throw pt(a),a}},!0)},t.techGet_=function(i){if(!(!this.tech_||!this.tech_.isReady_)){if(i in dO)return cO(this.middleware_,this.tech_,i);if(i in A_)return k_(this.middleware_,this.tech_,i);try{return this.tech_[i]()}catch(n){throw this.tech_[i]===void 0?(pt("Video.js: "+i+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(pt("Video.js: "+i+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(pt(n),n)}}},t.play=function(){var i=this,n=this.options_.Promise||N.Promise;return n?new n(function(a){i.play_(a)}):this.play_()},t.play_=function(i){var n=this;i===void 0&&(i=hs),this.playCallbacks_.push(i);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(Nd||_r);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a){this.waitToPlay_=function(c){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!a&&o&&this.load();return}var l=this.techGet_("play"),u=o&&this.hasClass("vjs-ended");u&&this.resetProgressBar_(),l===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(l)},t.runPlayTerminatedQueue_=function(){var i=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],i.forEach(function(n){n()})},t.runPlayCallbacks_=function(i){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(i)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return this.techGet_("paused")!==!1},t.played=function(){return this.techGet_("played")||oo(0,0)},t.scrubbing=function(i){if(typeof i>"u")return this.scrubbing_;this.scrubbing_=!!i,this.techCall_("setScrubbing",this.scrubbing_),i?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(i){if(typeof i<"u"){if(i<0&&(i=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=i,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",i),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(i){if(i===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;i=parseFloat(i),i<0&&(i=1/0),i!==this.cache_.duration&&(this.cache_.duration=i,i===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(i)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var i=this.techGet_("buffered");return(!i||!i.length)&&(i=oo(0,0)),i},t.bufferedPercent=function(){return qS(this.buffered(),this.duration())},t.bufferedEnd=function(){var i=this.buffered(),n=this.duration(),a=i.end(i.length-1);return a>n&&(a=n),a},t.volume=function(i){var n;if(i!==void 0){n=Math.max(0,Math.min(1,parseFloat(i))),this.cache_.volume=n,this.techCall_("setVolume",n),n>0&&this.lastVolume_(n);return}return n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n},t.muted=function(i){if(i!==void 0){this.techCall_("setMuted",i);return}return this.techGet_("muted")||!1},t.defaultMuted=function(i){return i!==void 0?this.techCall_("setDefaultMuted",i):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(i){if(i!==void 0&&i!==0){this.cache_.lastVolume=i;return}return this.cache_.lastVolume},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(i){if(i!==void 0){var n=this.isFullscreen_;this.isFullscreen_=!!i,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},t.requestFullscreen=function(i){var n=this.options_.Promise||N.Promise;if(n){var a=this;return new n(function(o,l){function u(){a.off("fullscreenerror",d),a.off("fullscreenchange",c)}function c(){u(),o()}function d(g,E){u(),l(E)}a.one("fullscreenchange",c),a.one("fullscreenerror",d);var f=a.requestFullscreenHelper_(i);f&&(f.then(u,u),f.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(i){var n=this,a;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},i!==void 0&&(a=i)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return n.isFullscreen(!0)},function(){return n.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var i=this.options_.Promise||N.Promise;if(i){var n=this;return new i(function(a,o){function l(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){l(),a()}function c(f,g){l(),o(g)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var d=n.exitFullscreenHelper_();d&&(d.then(l,l),d.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var i=this;if(this.fsApi_.requestFullscreen){var n=de[this.fsApi_.exitFullscreen]();return n&&hs(n.then(function(){return i.isFullscreen(!1)})),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=de.documentElement.style.overflow,Yr(de,"keydown",this.boundFullWindowOnEscKey_),de.documentElement.style.overflow="hidden",qs(de.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(i){st.isEventKey(i,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,rr(de,"keydown",this.boundFullWindowOnEscKey_),de.documentElement.style.overflow=this.docOrigOverflow,Tc(de.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(i){if(i===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",i),this.options_.disablePictureInPicture=i,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(i){if(i!==void 0){this.isInPictureInPicture_=!!i,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in de&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in de)return de.exitPictureInPicture()},t.handleKeyDown=function(i){var n=this.options_.userActions;if(!(!n||!n.hotkeys)){var a=function(l){var u=l.tagName.toLowerCase();if(l.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(u==="input")return c.indexOf(l.type)===-1;var d=["textarea"];return d.indexOf(u)!==-1};a(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,i):this.handleHotkeys(i))}},t.handleHotkeys=function(i){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,o=a===void 0?function(S){return st.isEventKey(S,"f")}:a,l=n.muteKey,u=l===void 0?function(S){return st.isEventKey(S,"m")}:l,c=n.playPauseKey,d=c===void 0?function(S){return st.isEventKey(S,"k")||st.isEventKey(S,"Space")}:c;if(o.call(this,i)){i.preventDefault(),i.stopPropagation();var f=De.getComponent("FullscreenToggle");de[this.fsApi_.fullscreenEnabled]!==!1&&f.prototype.handleClick.call(this,i)}else if(u.call(this,i)){i.preventDefault(),i.stopPropagation();var g=De.getComponent("MuteToggle");g.prototype.handleClick.call(this,i)}else if(d.call(this,i)){i.preventDefault(),i.stopPropagation();var E=De.getComponent("PlayToggle");E.prototype.handleClick.call(this,i)}},t.canPlayType=function(i){for(var n,a=0,o=this.options_.techOrder;a<o.length;a++){var l=o[a],u=zt.getTech(l);if(u||(u=De.getComponent(l)),!u){pt.error('The "'+l+'" tech is undefined. Skipped browser support check for that tech.');continue}if(u.isSupported()&&(n=u.canPlayType(i),n))return n}return""},t.selectSource=function(i){var n=this,a=this.options_.techOrder.map(function(d){return[d,zt.getTech(d)]}).filter(function(d){var f=d[0],g=d[1];return g?g.isSupported():(pt.error('The "'+f+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(f,g,E){var S;return f.some(function(k){return g.some(function(F){if(S=E(k,F),S)return!0})}),S},l,u=function(f){return function(g,E){return f(E,g)}},c=function(f,g){var E=f[0],S=f[1];if(S.canPlaySource(g,n.options_[E.toLowerCase()]))return{source:g,tech:E}};return this.options_.sourceOrder?l=o(i,a,u(c)):l=o(a,i,c),l||!1},t.handleSrc_=function(i,n){var a=this;if(typeof i>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=_O(i);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,n||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),lO(this,o[0],function(c,d){a.middleware_=d,n||(a.cache_.sources=o),a.updateSourceCaches_(c);var f=a.src_(c);if(f){if(o.length>1)return a.handleSrc_(o.slice(1));a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),a.triggerReady();return}uO(d,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},u=function(){a.off("error",l)};this.one("error",l),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",u)}}},t.src=function(i){return this.handleSrc_(i,!1)},t.src_=function(i){var n=this,a=this.selectSource([i]);return a?VL(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",i):this.techCall_("src",i.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):!0},t.load=function(){this.techCall_("load")},t.reset=function(){var i=this,n=this.options_.Promise||N.Promise;if(this.paused()||!n)this.doReset_();else{var a=this.play();hs(a.then(function(){return i.doReset_()}))}},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),zs(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var i=this.controlBar||{},n=i.durationDisplay,a=i.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var i=this.currentSource(),n=[];return Object.keys(i).length!==0&&n.push(i),this.cache_.sources||n},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(i){if(i!==void 0){this.techCall_("setPreload",i),this.options_.preload=i;return}return this.techGet_("preload")},t.autoplay=function(i){if(i===void 0)return this.options_.autoplay||!1;var n;typeof i=="string"&&/(any|play|muted)/.test(i)||i===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=i,this.manualAutoplay_(typeof i=="string"?i:"play"),n=!1):i?this.options_.autoplay=!0:this.options_.autoplay=!1,n=typeof n>"u"?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},t.playsinline=function(i){return i!==void 0?(this.techCall_("setPlaysinline",i),this.options_.playsinline=i,this):this.techGet_("playsinline")},t.loop=function(i){if(i!==void 0){this.techCall_("setLoop",i),this.options_.loop=i;return}return this.techGet_("loop")},t.poster=function(i){if(i===void 0)return this.poster_;i||(i=""),i!==this.poster_&&(this.poster_=i,this.techCall_("setPoster",i),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var i=this.tech_.poster()||"";i!==this.poster_&&(this.poster_=i,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(i){if(i===void 0)return!!this.controls_;i=!!i,this.controls_!==i&&(this.controls_=i,this.usingNativeControls()&&this.techCall_("setControls",i),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_()))},t.usingNativeControls=function(i){if(i===void 0)return!!this.usingNativeControls_;i=!!i,this.usingNativeControls_!==i&&(this.usingNativeControls_=i,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(i){var n=this;if(i===void 0)return this.error_||null;if(Aa("beforeerror").forEach(function(o){var l=o(n,i);if(!(Ws(l)&&!Array.isArray(l)||typeof l=="string"||typeof l=="number"||l===null)){n.log.error("please return a value that MediaError expects in beforeerror hooks");return}i=l}),this.options_.suppressNotSupportedError&&i&&i.code===4){var a=function(){this.error(i)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),this.one("loadstart",function(){this.off(["click","touchstart"],a)});return}if(i===null){this.error_=i,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new gr(i),this.addClass("vjs-error"),pt.error("(CODE:"+this.error_.code+" "+gr.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Aa("error").forEach(function(o){return o(n,n.error_)})},t.reportUserActivity=function(i){this.userActivity_=!0},t.userActive=function(i){if(i===void 0)return this.userActive_;if(i=!!i,i!==this.userActive_){if(this.userActive_=i,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(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var i,n,a,o=ti(this,this.reportUserActivity),l=function(E){(E.screenX!==n||E.screenY!==a)&&(n=E.screenX,a=E.screenY,o())},u=function(){o(),this.clearInterval(i),i=this.setInterval(o,250)},c=function(E){o(),this.clearInterval(i)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",c),this.on("mouseleave",c);var d=this.getChild("controlBar");d&&!_r&&!Xs&&(d.on("mouseenter",function(g){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),d.on("mouseleave",function(g){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var f;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);var g=this.options_.inactivityTimeout;g<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},g))}},250)},t.playbackRate=function(i){if(i!==void 0){this.techCall_("setPlaybackRate",i);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.defaultPlaybackRate=function(i){return i!==void 0?this.techCall_("setDefaultPlaybackRate",i):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(i){if(i!==void 0){this.isAudio_=!!i;return}return!!this.isAudio_},t.enableAudioOnlyUI_=function(){var i=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),o=a&&a.currentHeight();n.forEach(function(l){l!==a&&l.el_&&!l.hasClass("vjs-hidden")&&(l.hide(),i.audioOnlyCache_.hiddenChildren.push(l))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},t.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(i){return i.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},t.audioOnlyMode=function(i){var n=this;if(typeof i!="boolean"||i===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=i;var a=this.options_.Promise||N.Promise;if(a){if(i){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),a.all(o).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}i?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},t.enablePosterModeUI_=function(){var i=this.tech_&&this.tech_;i.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.disablePosterModeUI_=function(){var i=this.tech_&&this.tech_;i.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.audioPosterMode=function(i){var n=this;if(typeof i!="boolean"||i===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=i;var a=this.options_.Promise||N.Promise;if(a){if(i){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.disablePosterModeUI_()})}if(i){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},t.addTextTrack=function(i,n,a){if(this.tech_)return this.tech_.addTextTrack(i,n,a)},t.addRemoteTextTrack=function(i,n){if(this.tech_)return this.tech_.addRemoteTextTrack(i,n)},t.removeRemoteTextTrack=function(i){i===void 0&&(i={});var n=i,a=n.track;if(a||(a=i),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(i){if(i===void 0)return this.language_;this.language_!==String(i).toLowerCase()&&(this.language_=String(i).toLowerCase(),zs(this)&&this.trigger("languagechange"))},t.languages=function(){return ei(e.prototype.options_.languages,this.languages_)},t.toJSON=function(){var i=ei(this.options_),n=i.tracks;i.tracks=[];for(var a=0;a<n.length;a++){var o=n[a];o=ei(o),o.player=void 0,i.tracks[a]=o}return i},t.createModal=function(i,n){var a=this;n=n||{},n.content=i||"";var o=new Fl(this,n);return this.addChild(o),o.on("dispose",function(){a.removeChild(o)}),o.open(),o},t.updateCurrentBreakpoint_=function(){if(this.responsive())for(var i=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<Xp.length;a++){var o=Xp[a],l=this.breakpoints_[o];if(n<=l){if(i===o)return;i&&this.removeClass(oh[i]),this.addClass(oh[o]),this.breakpoint_=o;break}}},t.removeCurrentBreakpoint_=function(){var i=this.currentBreakpointClass();this.breakpoint_="",i&&this.removeClass(i)},t.breakpoints=function(i){return i===void 0?fi(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=fi({},XO,i),this.updateCurrentBreakpoint_(),fi(this.breakpoints_))},t.responsive=function(i){if(i===void 0)return this.responsive_;i=!!i;var n=this.responsive_;if(i!==n)return this.responsive_=i,i?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),i},t.currentBreakpoint=function(){return this.breakpoint_},t.currentBreakpointClass=function(){return oh[this.breakpoint_]||""},t.loadMedia=function(i,n){var a=this;if(!(!i||typeof i!="object")){this.reset(),this.cache_.media=ei(i);var o=this.cache_.media,l=o.artwork,u=o.poster,c=o.src,d=o.textTracks;!l&&u&&(this.cache_.media.artwork=[{src:u,type:$h(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(d)&&d.forEach(function(f){return a.addRemoteTextTrack(f,!1)}),this.ready(n)}},t.getMedia=function(){if(!this.cache_.media){var i=this.poster(),n=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(l){return{kind:l.kind,label:l.label,language:l.language,src:l.src}}),o={src:n,textTracks:a};return i&&(o.poster=i,o.artwork=[{src:o.poster,type:$h(o.poster)}]),o}return ei(this.cache_.media)},e.getTagSettings=function(i){var n={sources:[],tracks:[]},a=Bs(i),o=a["data-setup"];if(ao(i,"vjs-fill")&&(a.fill=!0),ao(i,"vjs-fluid")&&(a.fluid=!0),o!==null){var l=$I(o||"{}"),u=l[0],c=l[1];u&&pt.error(u),fi(a,c)}if(fi(n,a),i.hasChildNodes())for(var d=i.childNodes,f=0,g=d.length;f<g;f++){var E=d[f],S=E.nodeName.toLowerCase();S==="source"?n.sources.push(Bs(E)):S==="track"&&n.tracks.push(Bs(E))}return n},t.flexNotSupported_=function(){var i=de.createElement("i");return!("flexBasis"in i.style||"webkitFlexBasis"in i.style||"mozFlexBasis"in i.style||"msFlexBasis"in i.style||"msFlexOrder"in i.style)},t.debug=function(i){if(i===void 0)return this.debugEnabled_;i?(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)},t.playbackRates=function(i){if(i===void 0)return this.cache_.playbackRates;Array.isArray(i)&&i.every(function(n){return typeof n=="number"})&&(this.cache_.playbackRates=i,this.trigger("playbackrateschange"))},e})(De);dr.names.forEach(function(s){var e=dr[s];Ei.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ei.prototype.crossorigin=Ei.prototype.crossOrigin;Ei.players={};var Du=N.navigator;Ei.prototype.options_={techOrder:zt.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Du&&(Du.languages&&Du.languages[0]||Du.userLanguage||Du.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};["ended","seeking","seekable","networkState","readyState"].forEach(function(s){Ei.prototype[s]=function(){return this.techGet_(s)}});T2.forEach(function(s){Ei.prototype["handleTech"+vi(s)+"_"]=function(){return this.trigger(s)}});De.registerComponent("Player",Ei);var Vh="plugin",sl="activePlugins_",Wo={},qh=function(e){return Wo.hasOwnProperty(e)},lh=function(e){return qh(e)?Wo[e]:void 0},b2=function(e,t){e[sl]=e[sl]||{},e[sl][t]=!0},zh=function(e,t,r){var i=(r?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},YO=function(e,t){var r=function(){zh(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return b2(this,e),zh(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(i){r[i]=t[i]}),r},j_=function(e,t){return t.prototype.name=e,function(){zh(this,{name:e,plugin:t,instance:null},!0);for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];var a=Z1(t,[this].concat(i));return this[e]=function(){return a},zh(this,a.getEventHash()),a}},_s=(function(){function s(t){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),mg(this),delete this.trigger,VS(this,this.constructor.defaultState),b2(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var e=s.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(r){return r===void 0&&(r={}),r.name=this.name,r.plugin=this.constructor,r.instance=this,r},e.trigger=function(r,i){return i===void 0&&(i={}),Ul(this.eventBusEl_,r,this.getEventHash(i))},e.handleStateChanged=function(r){},e.dispose=function(){var r=this.name,i=this.player;this.trigger("dispose"),this.off(),i.off("dispose",this.dispose),i[sl][r]=!1,this.player=this.state=null,i[r]=j_(r,Wo[r])},s.isBasic=function(r){var i=typeof r=="string"?lh(r):r;return typeof i=="function"&&!s.prototype.isPrototypeOf(i.prototype)},s.registerPlugin=function(r,i){if(typeof r!="string")throw new Error('Illegal plugin name, "'+r+'", must be a string, was '+typeof r+".");if(qh(r))pt.warn('A plugin named "'+r+'" already exists. You may want to avoid re-registering plugins!');else if(Ei.prototype.hasOwnProperty(r))throw new Error('Illegal plugin name, "'+r+'", cannot share a name with an existing player method!');if(typeof i!="function")throw new Error('Illegal plugin for "'+r+'", must be a function, was '+typeof i+".");return Wo[r]=i,r!==Vh&&(s.isBasic(i)?Ei.prototype[r]=YO(r,i):Ei.prototype[r]=j_(r,i)),i},s.deregisterPlugin=function(r){if(r===Vh)throw new Error("Cannot de-register base plugin.");qh(r)&&(delete Wo[r],delete Ei.prototype[r])},s.getPlugins=function(r){r===void 0&&(r=Object.keys(Wo));var i;return r.forEach(function(n){var a=lh(n);a&&(i=i||{},i[n]=a)}),i},s.getPluginVersion=function(r){var i=lh(r);return i&&i.VERSION||""},s})();_s.getPlugin=lh;_s.BASE_PLUGIN_NAME=Vh;_s.registerPlugin(Vh,_s);Ei.prototype.usingPlugin=function(s){return!!this[sl]&&this[sl][s]===!0};Ei.prototype.hasPlugin=function(s){return!!qh(s)};var H_=!1,QO=function(e,t){t===void 0&&(t={}),H_||(pt.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),H_=!0);var r=function(){e.apply(this,arguments)},i={};typeof t=="object"?(t.constructor!==Object.prototype.constructor&&(r=t.constructor),i=t):typeof t=="function"&&(r=t),AE(r,e),e&&(r.super_=e);for(var n in i)i.hasOwnProperty(n)&&(r.prototype[n]=i[n]);return r},S2=function(e){return e.indexOf("#")===0?e.slice(1):e};function ce(s,e,t){var r=ce.getPlayer(s);if(r)return e&&pt.warn('Player "'+s+'" is already initialised. Options will not be applied.'),t&&r.ready(t),r;var i=typeof s=="string"?xa("#"+S2(s)):s;if(!Bl(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!i.ownerDocument.defaultView||!i.ownerDocument.body.contains(i))&&pt.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(i.parentNode&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),Aa("beforesetup").forEach(function(a){var o=a(i,ei(e));if(!Ws(o)||Array.isArray(o)){pt.error("please return an object in beforesetup hooks");return}e=ei(e,o)});var n=De.getComponent("Player");return r=new n(i,e,t),Aa("setup").forEach(function(a){return a(r)}),r}ce.hooks_=js;ce.hooks=Aa;ce.hook=EL;ce.hookOnce=wL;ce.removeHook=pS;if(N.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Rl()){var qc=xa(".vjs-styles-defaults");if(!qc){qc=BS("vjs-styles-defaults");var Kf=xa("head");Kf&&Kf.insertBefore(qc,Kf.firstChild),US(qc,`
|
|
325
|
+
.video-js {
|
|
326
|
+
width: 300px;
|
|
327
|
+
height: 150px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
331
|
+
padding-top: 56.25%
|
|
332
|
+
}
|
|
333
|
+
`)}}Vp(1,ce);ce.VERSION=fS;ce.options=Ei.prototype.options_;ce.getPlayers=function(){return Ei.players};ce.getPlayer=function(s){var e=Ei.players,t;if(typeof s=="string"){var r=S2(s),i=e[r];if(i)return i;t=xa("#"+r)}else t=s;if(Bl(t)){var n=t,a=n.player,o=n.playerId;if(a||e[o])return a||e[o]}};ce.getAllPlayers=function(){return Object.keys(Ei.players).map(function(s){return Ei.players[s]}).filter(Boolean)};ce.players=Ei.players;ce.getComponent=De.getComponent;ce.registerComponent=function(s,e){zt.isTech(e)&&pt.warn("The "+s+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),De.registerComponent.call(De,s,e)};ce.getTech=zt.getTech;ce.registerTech=zt.registerTech;ce.use=oO;Object.defineProperty(ce,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(ce.middleware,"TERMINATOR",{value:Fh,writeable:!1,enumerable:!0});ce.browser=IL;ce.TOUCH_ENABLED=bl;ce.extend=QO;ce.mergeOptions=ei;ce.bind=ti;ce.registerPlugin=_s.registerPlugin;ce.deregisterPlugin=_s.deregisterPlugin;ce.plugin=function(s,e){return pt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_s.registerPlugin(s,e)};ce.getPlugins=_s.getPlugins;ce.getPlugin=_s.getPlugin;ce.getPluginVersion=_s.getPluginVersion;ce.addLanguage=function(s,e){var t;return s=(""+s).toLowerCase(),ce.options.languages=ei(ce.options.languages,(t={},t[s]=e,t)),ce.options.languages[s]};ce.log=pt;ce.createLogger=gS;ce.createTimeRange=ce.createTimeRanges=oo;ce.formatTime=kl;ce.setFormatTime=kO;ce.resetFormatTime=AO;ce.parseUrl=vg;ce.isCrossOrigin=Md;ce.EventTarget=Vi;ce.on=Yr;ce.one=Ld;ce.off=rr;ce.trigger=Ul;ce.xhr=J1;ce.TextTrack=bc;ce.AudioTrack=GS;ce.VideoTrack=KS;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){ce[s]=function(){return pt.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),MS[s].apply(null,arguments)}});ce.computedStyle=ac;ce.dom=MS;ce.url=rO;ce.defineLazyProperty=Rg;ce.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var Nn=wd,Wh=function(e,t,r){return e&&r&&r.responseURL&&t!==r.responseURL?r.responseURL:t},Mn=function(e){return ce.log.debug?ce.log.debug.bind(ce,"VHS:",e+" >"):function(){}},Na=1/30,ds=Na*3,C2=function(e,t){var r=[],i;if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&r.push([e.start(i),e.end(i)]);return ce.createTimeRanges(r)},Go=function(e,t){return C2(e,function(r,i){return r-ds<=t&&i+ds>=t})},zc=function(e,t){return C2(e,function(r){return r-Na>=t})},JO=function(e){if(e.length<2)return ce.createTimeRanges();for(var t=[],r=1;r<e.length;r++){var i=e.end(r-1),n=e.start(r);t.push([i,n])}return ce.createTimeRanges(t)},ZO=function(e,t){var r=null,i=null,n=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return ce.createTimeRange();for(var l=e.length;l--;)a.push({time:e.start(l),type:"start"}),a.push({time:e.end(l),type:"end"});for(l=t.length;l--;)a.push({time:t.start(l),type:"start"}),a.push({time:t.end(l),type:"end"});for(a.sort(function(u,c){return u.time-c.time}),l=0;l<a.length;l++)a[l].type==="start"?(n++,n===2&&(r=a[l].time)):a[l].type==="end"&&(n--,n===1&&(i=a[l].time)),r!==null&&i!==null&&(o.push([r,i]),r=null,i=null);return ce.createTimeRanges(o)},E2=function(e){var t=[];if(!e||!e.length)return"";for(var r=0;r<e.length;r++)t.push(e.start(r)+" => "+e.end(r));return t.join(", ")},eM=function(e,t,r){r===void 0&&(r=1);var i=e.length?e.end(e.length-1):0;return(i-t)/r},Za=function(e){for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t},tM=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(var r=0;r<e.length;r++)if(e.start(r)!==t.start(r)||e.end(r)!==t.end(r))return!0;return!1},V_=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},Bg=function(e,t){var r=0;if(!e||!e.length)return r;for(var i=0;i<e.length;i++){var n=e.start(i),a=e.end(i);if(!(t>a)){if(t>n&&t<=a){r+=a-t;continue}r+=a-n}}return r},q_=ce.createTimeRange,Ug=function(e,t){if(!t.preload)return t.duration;var r=0;return(t.parts||[]).forEach(function(i){r+=i.duration}),(t.preloadHints||[]).forEach(function(i){i.type==="PART"&&(r+=e.partTargetDuration)}),r},Yp=function(e){return(e.segments||[]).reduce(function(t,r,i){return r.parts?r.parts.forEach(function(n,a){t.push({duration:n.duration,segmentIndex:i,partIndex:a,part:n,segment:r})}):t.push({duration:r.duration,segmentIndex:i,partIndex:null,segment:r,part:null}),t},[])},w2=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},k2=function(e){var t=e.preloadSegment;if(t){var r=t.parts,i=t.preloadHints,n=(i||[]).reduce(function(a,o){return a+(o.type==="PART"?1:0)},0);return n+=r&&r.length?r.length:0,n}},A2=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var r=w2(t).length>0;return r&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:r&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},iM=function(e,t){var r=0,i=t-e.mediaSequence,n=e.segments[i];if(n){if(typeof n.start<"u")return{result:n.start,precise:!0};if(typeof n.end<"u")return{result:n.end-n.duration,precise:!0}}for(;i--;){if(n=e.segments[i],typeof n.end<"u")return{result:r+n.end,precise:!0};if(r+=Ug(e,n),typeof n.start<"u")return{result:r+n.start,precise:!0}}return{result:r,precise:!1}},rM=function(e,t){for(var r=0,i,n=t-e.mediaSequence;n<e.segments.length;n++){if(i=e.segments[n],typeof i.start<"u")return{result:i.start-r,precise:!0};if(r+=Ug(e,i),typeof i.end<"u")return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}},x2=function(e,t,r){if(typeof t>"u"&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=iM(e,t);if(i.precise)return i.result;var n=rM(e,t);return n.precise?n.result:i.result+r},N2=function(e,t,r){if(!e)return 0;if(typeof r!="number"&&(r=0),typeof t>"u"){if(e.totalDuration)return e.totalDuration;if(!e.endList)return N.Infinity}return x2(e,t,r)},Xu=function(e){var t=e.defaultDuration,r=e.durationList,i=e.startIndex,n=e.endIndex,a=0;if(i>n){var o=[n,i];i=o[0],n=o[1]}if(i<0){for(var l=i;l<Math.min(0,n);l++)a+=t;i=0}for(var u=i;u<n;u++)a+=r[u].duration;return a},D2=function(e,t,r,i){if(!e||!e.segments)return null;if(e.endList)return N2(e);if(t===null)return null;t=t||0;var n=x2(e,e.mediaSequence+e.segments.length,t);return r&&(i=typeof i=="number"?i:A2(null,e),n-=i),Math.max(0,n)},nM=function(e,t,r){var i=!0,n=t||0,a=D2(e,t,i,r);return a===null?q_():q_(n,a)},sM=function(e){for(var t=e.playlist,r=e.currentTime,i=e.startingSegmentIndex,n=e.startingPartIndex,a=e.startTime,o=e.experimentalExactManifestTimings,l=r-a,u=Yp(t),c=0,d=0;d<u.length;d++){var f=u[d];if(i===f.segmentIndex&&!(typeof n=="number"&&typeof f.partIndex=="number"&&n!==f.partIndex)){c=d;break}}if(l<0){if(c>0)for(var g=c-1;g>=0;g--){var E=u[g];if(l+=E.duration,o){if(l<0)continue}else if(l+Na<=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a-Xu({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:g})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r}}if(c<0){for(var S=c;S<0;S++)if(l-=t.targetDuration,l<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r};c=0}for(var k=c;k<u.length;k++){var F=u[k];if(l-=F.duration,o){if(l>0)continue}else if(l-Na>=0)continue;return{partIndex:F.partIndex,segmentIndex:F.segmentIndex,startTime:a+Xu({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:k})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:r}},I2=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Fg=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Fd=function(e){var t=I2(e);return!e.disabled&&!t},aM=function(e){return e.disabled},oM=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},P2=function(e,t){return t.attributes&&t.attributes[e]},lM=function(e,t,r,i){if(i===void 0&&(i=0),!P2("BANDWIDTH",r))return NaN;var n=e*r.attributes.BANDWIDTH;return(n-i*8)/t},Qp=function(e,t){if(e.playlists.length===1)return!0;var r=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(i){return Fd(i)?(i.attributes.BANDWIDTH||0)<r:!1}).length===0},$g=function(e,t){return!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri)},z_=function(e,t){var r=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var n in r){for(var a in r[n])if(i=t(r[n][a]),i)break;if(i)break}return!!i},Ec=function(e){if(!e||!e.playlists||!e.playlists.length){var t=z_(e,function(a){return a.playlists&&a.playlists.length||a.uri});return t}for(var r=function(o){var l=e.playlists[o],u=l.attributes&&l.attributes.CODECS;if(u&&u.split(",").every(function(d){return iS(d)}))return"continue";var c=z_(e,function(d){return $g(l,d)});return c?"continue":{v:!1}},i=0;i<e.playlists.length;i++){var n=r(i);if(n!=="continue"&&typeof n=="object")return n.v}return!0},Ir={liveEdgeDelay:A2,duration:N2,seekable:nM,getMediaInfoForTime:sM,isEnabled:Fd,isDisabled:aM,isBlacklisted:I2,isIncompatible:Fg,playlistEnd:D2,isAes:oM,hasAttribute:P2,estimateSegmentRequestTime:lM,isLowestEnabledRendition:Qp,isAudioOnly:Ec,playlistMatch:$g,segmentDurationWithParts:Ug},L2=ce.log,jg=function(e,t){return e+"-"+t},uM=function(e,t,r){return"placeholder-uri-"+e+"-"+t+"-"+r},cM=function(e){var t=e.onwarn,r=e.oninfo,i=e.manifestString,n=e.customTagParsers,a=n===void 0?[]:n,o=e.customTagMappers,l=o===void 0?[]:o,u=e.experimentalLLHLS,c=new JI;t&&c.on("warn",t),r&&c.on("info",r),a.forEach(function(S){return c.addParser(S)}),l.forEach(function(S){return c.addTagMapper(S)}),c.push(i),c.end();var d=c.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(S){d.hasOwnProperty(S)&&delete d[S]}),d.segments&&d.segments.forEach(function(S){["parts","preloadHints"].forEach(function(k){S.hasOwnProperty(k)&&delete S[k]})})),!d.targetDuration){var f=10;d.segments&&d.segments.length&&(f=d.segments.reduce(function(S,k){return Math.max(S,k.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+f),d.targetDuration=f}var g=w2(d);if(g.length&&!d.partTargetDuration){var E=g.reduce(function(S,k){return Math.max(S,k.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+E),L2.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.")),d.partTargetDuration=E}return d},Vl=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(r){if(e.mediaGroups[r])for(var i in e.mediaGroups[r])for(var n in e.mediaGroups[r][i]){var a=e.mediaGroups[r][i][n];t(a,r,i,n)}})},O2=function(e){var t=e.playlist,r=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,r&&(t.uri=r),t.attributes=t.attributes||{}},hM=function(e){for(var t=e.playlists.length;t--;){var r=e.playlists[t];O2({playlist:r,id:jg(t,r.uri)}),r.resolvedUri=Nn(e.uri,r.uri),e.playlists[r.id]=r,e.playlists[r.uri]=r,r.attributes.BANDWIDTH||L2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},dM=function(e){Vl(e,function(t){t.uri&&(t.resolvedUri=Nn(e.uri,t.uri))})},fM=function(e,t){var r=jg(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:N.location.href,resolvedUri:N.location.href,playlists:[{uri:t,id:r,resolvedUri:t,attributes:{}}]};return i.playlists[r]=i.playlists[0],i.playlists[t]=i.playlists[0],i},M2=function(e,t,r){r===void 0&&(r=uM),e.uri=t;for(var i=0;i<e.playlists.length;i++)if(!e.playlists[i].uri){var n="placeholder-uri-"+i;e.playlists[i].uri=n}var a=Ec(e);Vl(e,function(o,l,u,c){if(!o.playlists||!o.playlists.length){if(a&&l==="AUDIO"&&!o.uri)for(var d=0;d<e.playlists.length;d++){var f=e.playlists[d];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===u)return}o.playlists=[jt({},o)]}o.playlists.forEach(function(g,E){var S=r(l,u,c,g),k=jg(E,S);g.uri?g.resolvedUri=g.resolvedUri||Nn(e.uri,g.uri):(g.uri=E===0?S:k,g.resolvedUri=g.uri),g.id=g.id||k,g.attributes=g.attributes||{},e.playlists[g.id]=g,e.playlists[g.uri]=g})}),hM(e),dM(e)},Gh=ce.mergeOptions,pM=ce.EventTarget,mM=function(e,t){if(t.endList||!t.serverControl)return e;var r={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,n=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],o=k2(t)-1;o>-1&&o!==a.length-1&&(r._HLS_part=o),(o>-1||a.length)&&n--}r._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(r._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var l=new N.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(u){r.hasOwnProperty(u)&&l.searchParams.set(u,r[u])}),e=l.toString()}return e},gM=function(e,t){if(!e)return t;var r=Gh(e,t);if(e.preloadHints&&!t.preloadHints&&delete r.preloadHints,e.parts&&!t.parts)delete r.parts;else if(e.parts&&t.parts)for(var i=0;i<t.parts.length;i++)e.parts&&e.parts[i]&&(r.parts[i]=Gh(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(r.skipped=!1),e.preload&&!t.preload&&(r.preload=!1),r},vM=function(e,t,r){var i=e.slice(),n=t.slice();r=r||0;for(var a=[],o,l=0;l<n.length;l++){var u=i[l+r],c=n[l];u?(o=u.map||o,a.push(gM(u,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},R2=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Nn(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Nn(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Nn(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Nn(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(r){r.resolvedUri||(r.resolvedUri=Nn(t,r.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(r){r.resolvedUri||(r.resolvedUri=Nn(t,r.uri))})},B2=function(e){var t=e.segments||[],r=e.preloadSegment;if(r&&r.parts&&r.parts.length){if(r.preloadHints){for(var i=0;i<r.preloadHints.length;i++)if(r.preloadHints[i].type==="MAP")return t}r.duration=e.targetDuration,r.preload=!0,t.push(r)}return t},U2=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Jp=function(e,t,r){r===void 0&&(r=U2);var i=Gh(e,{}),n=i.playlists[t.id];if(!n||r(n,t))return null;t.segments=B2(t);var a=Gh(n,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(var o=0;o<t.skip.skippedSegments;o++)t.segments.unshift({skipped:!0})}a.segments=vM(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){R2(u,a.resolvedUri)});for(var l=0;l<i.playlists.length;l++)i.playlists[l].id===t.id&&(i.playlists[l]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,Vl(e,function(u,c,d,f){if(u.playlists)for(var g=0;g<u.playlists.length;g++)t.id===u.playlists[g].id&&(u.playlists[g]=a)}),i},Zp=function(e,t){var r=e.segments||[],i=r[r.length-1],n=i&&i.parts&&i.parts[i.parts.length-1],a=n&&n.duration||i&&i.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},Ko=(function(s){Be(e,s);function e(r,i,n){var a;if(n===void 0&&(n={}),a=s.call(this)||this,!r)throw new Error("A non-empty playlist URL or object is required");a.logger_=Mn("PlaylistLoader");var o=n,l=o.withCredentials,u=l===void 0?!1:l,c=o.handleManifestRedirects,d=c===void 0?!1:c;a.src=r,a.vhs_=i,a.withCredentials=u,a.handleManifestRedirects=d;var f=i.options_;return a.customTagParsers=f&&f.customTagParsers||[],a.customTagMappers=f&&f.customTagMappers||[],a.experimentalLLHLS=f&&f.experimentalLLHLS||!1,ce.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(rt(a)),a.on("mediaupdatetimeout",a.handleMediaupdatetimeout_),a}var t=e.prototype;return t.handleMediaupdatetimeout_=function(){var i=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=Nn(this.master.uri,n.uri);this.experimentalLLHLS&&(a=mM(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(i.request){if(o)return i.playlistRequestError(i.request,i.media(),"HAVE_METADATA");i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})}})}},t.playlistRequestError=function(i,n,a){var o=n.uri,l=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:i.status,message:"HLS playlist request error at URL: "+o+".",responseText:i.responseText,code:i.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(i){var n=this,a=i.url,o=i.manifestString;return cM({onwarn:function(u){var c=u.message;return n.logger_("m3u8-parser warn for "+a+": "+c)},oninfo:function(u){var c=u.message;return n.logger_("m3u8-parser info for "+a+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(i){var n=i.playlistString,a=i.playlistObject,o=i.url,l=i.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:o,manifestString:n});u.lastRequest=Date.now(),O2({playlist:u,uri:o,id:l});var c=Jp(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Zp(this.media(),!!c)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),N.clearTimeout(this.mediaUpdateTimeout),N.clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var i=this.request;this.request=null,i.onreadystatechange=null,i.abort()}},t.media=function(i,n){var a=this;if(!i)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof i=="string"){if(!this.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.master.playlists[i]}if(N.clearTimeout(this.finalRenditionTimeout),n){var o=(i.partTargetDuration||i.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=N.setTimeout(this.media.bind(this,i,!1),o);return}var l=this.state,u=!this.media_||i.id!==this.media_.id,c=this.master.playlists[i.id];if(c&&c.endList||i.endList&&i.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=i,u&&(this.trigger("mediachanging"),l==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Zp(i,!0)),!!u){if(this.state="SWITCHING_MEDIA",this.request){if(i.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=i,this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},function(d,f){if(a.request){if(i.lastRequest=Date.now(),i.resolvedUri=Wh(a.handleManifestRedirects,i.resolvedUri,f),d)return a.playlistRequestError(a.request,i,l);a.haveMetadata({playlistString:f.responseText,url:i.uri,id:i.id}),l==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},t.pause=function(){this.mediaUpdateTimeout&&(N.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_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},t.load=function(i){var n=this;this.mediaUpdateTimeout&&(N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(i){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=N.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},t.updateMediaUpdateTimeout_=function(i){var n=this;this.mediaUpdateTimeout&&(N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=N.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(i)},i))},t.start=function(){var i=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=N.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){i.setupInitialPlaylist(i.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(i.request){if(i.request=null,n)return i.error={status:a.status,message:"HLS playlist request error at URL: "+i.src+".",responseText:a.responseText,code:2},i.state==="HAVE_NOTHING"&&(i.started=!1),i.trigger("error");i.src=Wh(i.handleManifestRedirects,i.src,a);var o=i.parseManifest_({manifestString:a.responseText,url:i.src});i.setupInitialPlaylist(o)}})},t.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},t.setupInitialPlaylist=function(i){if(this.state="HAVE_MASTER",i.playlists){this.master=i,M2(this.master,this.srcUri()),i.playlists.forEach(function(a){a.segments=B2(a),a.segments.forEach(function(o){R2(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var n=this.srcUri()||N.location.href;this.master=fM(i,n),this.haveMetadata({playlistObject:i,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e})(pM),yM=ce.xhr,_M=ce.mergeOptions,em=function(e,t,r,i){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),r.headers&&(e.responseHeaders=r.headers),t&&t.code==="ETIMEDOUT"&&(e.timedout=!0),!t&&!e.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),i(t,e)},F2=function(){var e=function t(r,i){r=_M({timeout:45e3},r);var n=t.beforeRequest||ce.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var o=ce.Vhs.xhr.original===!0?yM:ce.Vhs.xhr,l=o(r,function(c,d){return em(l,c,d,i)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=r.uri,l.requestTime=Date.now(),l};return e.original=!0,e},TM=function(e){var t,r=e.offset;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=N.BigInt(e.offset)+N.BigInt(e.length)-N.BigInt(1):t=e.offset+e.length-1,"bytes="+r+"-"+t},tm=function(e){var t={};return e.byterange&&(t.Range=TM(e.byterange)),t},bM=function(e,t){return e.start(t)+"-"+e.end(t)},SM=function(e,t){var r=e.toString(16);return"00".substring(0,2-r.length)+r+(t%2?" ":"")},CM=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},$2=function(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r];nS(i)?t[r]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[r]=i}),t},Kh=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},j2=function(e){return e.resolvedUri},H2=function(e){for(var t=Array.prototype.slice.call(e),r=16,i="",n,a,o=0;o<t.length/r;o++)n=t.slice(o*r,o*r+r).map(SM).join(""),a=t.slice(o*r,o*r+r).map(CM).join(""),i+=n+" "+a+`
|
|
334
|
+
`;return i},EM=function(e){var t=e.bytes;return H2(t)},wM=function(e){var t="",r;for(r=0;r<e.length;r++)t+=bM(e,r)+" ";return t},kM=Object.freeze({__proto__:null,createTransferableMessage:$2,initSegmentId:Kh,segmentKeyId:j2,hexDump:H2,tagDump:EM,textRanges:wM}),V2=.25,AM=function(e,t){if(!t.dateTimeObject)return null;var r=t.videoTimingInfo.transmuxerPrependedSeconds,i=t.videoTimingInfo.transmuxedPresentationStart,n=i+r,a=e-n;return new Date(t.dateTimeObject.getTime()+a*1e3)},xM=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},NM=function(e,t){var r;try{r=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;var i=t.segments[0];if(r<i.dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){i=t.segments[n];var a=t.segments[n+1].dateTimeObject;if(r<a)break}var o=t.segments[t.segments.length-1],l=o.dateTimeObject,u=o.videoTimingInfo?xM(o.videoTimingInfo):o.duration+o.duration*V2,c=new Date(l.getTime()+u*1e3);return r>c?null:(r>l&&(i=o),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Ir.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},DM=function(e,t){if(!t||!t.segments||t.segments.length===0)return null;for(var r=0,i,n=0;n<t.segments.length&&(i=t.segments[n],r=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration,!(e<=r));n++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+a.duration*V2)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},IM=function(e,t){var r,i;try{r=new Date(e),i=new Date(t)}catch{}var n=r.getTime(),a=i.getTime();return(a-n)/1e3},PM=function(e){if(!e.segments||e.segments.length===0)return!1;for(var t=0;t<e.segments.length;t++){var r=e.segments[t];if(!r.dateTimeObject)return!1}return!0},LM=function(e){var t=e.playlist,r=e.time,i=r===void 0?void 0:r,n=e.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!t||i===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=DM(i,t);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:i},l=AM(i,a.segment);return l&&(o.programDateTime=l.toISOString()),n(null,o)},OM=function s(e){var t=e.programTime,r=e.playlist,i=e.retryCount,n=i===void 0?2:i,a=e.seekTo,o=e.pauseAfterSeek,l=o===void 0?!0:o,u=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!r||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!PM(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var d=NM(t,r);if(!d)return c({message:t+" was not found in the stream"});var f=d.segment,g=IM(f.dateTimeObject,t);if(d.type==="estimate"){if(n===0)return c({message:t+" is not buffered yet. Try again"});a(d.estimatedStart+g),u.one("seeked",function(){s({programTime:t,playlist:r,retryCount:n-1,seekTo:a,pauseAfterSeek:l,tech:u,callback:c})});return}var E=f.start+g,S=function(){return c(null,u.currentTime())};u.one("seeked",S),l&&u.pause(),a(E)},Xf=function(e,t){if(e.readyState===4)return t()},MM=function(e,t,r){var i=[],n,a=!1,o=function(f,g,E,S){return g.abort(),a=!0,r(f,g,E,S)},l=function(f,g){if(!a){if(f)return o(f,g,"",i);var E=g.responseText.substring(i&&i.byteLength||0,g.responseText.length);if(i=cP(i,sS(E,!0)),n=n||Fu(i),i.length<10||n&&i.length<n+2)return Xf(g,function(){return o(f,g,"",i)});var S=og(i);return S==="ts"&&i.length<188?Xf(g,function(){return o(f,g,"",i)}):!S&&i.length<376?Xf(g,function(){return o(f,g,"",i)}):o(null,g,S,i)}},u={uri:e,beforeSend:function(f){f.overrideMimeType("text/plain; charset=x-user-defined"),f.addEventListener("progress",function(g){return g.total,g.loaded,em(f,null,{statusCode:f.status},l)})}},c=t(u,function(d,f){return em(c,d,f,l)});return c},RM=ce.EventTarget,q2=ce.mergeOptions,W_=function(e,t){if(!U2(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var r=0;r<e.segments.length;r++){var i=e.segments[r],n=t.segments[r];if(i.uri!==n.uri)return!1;if(!(!i.byterange&&!n.byterange)){var a=i.byterange,o=n.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}}return!0},BM=function(e,t,r,i){var n=i.attributes.NAME||r;return"placeholder-uri-"+e+"-"+t+"-"+n},UM=function(e){var t=e.masterXml,r=e.srcUrl,i=e.clientOffset,n=e.sidxMapping,a=e.previousManifest,o=tL(t,{manifestUri:r,clientOffset:i,sidxMapping:n,previousManifest:a});return M2(o,r,BM),o},FM=function(e,t){Vl(e,function(r,i,n,a){a in t.mediaGroups[i][n]||delete e.mediaGroups[i][n][a]})},$M=function(e,t,r){for(var i=!0,n=q2(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var o=t.playlists[a];if(o.sidx){var l=Ad(o.sidx);r&&r[l]&&r[l].sidx&&rg(o,r[l].sidx,o.sidx.resolvedUri)}var u=Jp(n,o,W_);u&&(n=u,i=!1)}return Vl(t,function(c,d,f,g){if(c.playlists&&c.playlists.length){var E=c.playlists[0].id,S=Jp(n,c.playlists[0],W_);S&&(n=S,g in n.mediaGroups[d][f]||(n.mediaGroups[d][f][g]=c),n.mediaGroups[d][f][g].playlists[0]=n.playlists[E],i=!1)}}),FM(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:n},jM=function(e,t){var r=!e.map&&!t.map,i=r||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return i&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},G_=function(e,t){var r={};for(var i in e){var n=e[i],a=n.sidx;if(a){var o=Ad(a);if(!t[o])break;var l=t[o].sidxInfo;jM(l,a)&&(r[o]=t[o])}}return r},HM=function(e,t){var r=G_(e.playlists,t),i=r;return Vl(e,function(n,a,o,l){if(n.playlists&&n.playlists.length){var u=n.playlists;i=q2(i,G_(u,t))}}),i},im=(function(s){Be(e,s);function e(r,i,n,a){var o;n===void 0&&(n={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||rt(o),a||(o.isMaster_=!0);var l=n,u=l.withCredentials,c=u===void 0?!1:u,d=l.handleManifestRedirects,f=d===void 0?!1:d;if(o.vhs_=i,o.withCredentials=c,o.handleManifestRedirects=f,!r)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Mn("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=r,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=r,o}var t=e.prototype;return t.requestErrored_=function(i,n,a){if(!this.request)return!0;if(this.request=null,i)return this.error=typeof i=="object"&&!(i instanceof Error)?i:{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2},a&&(this.state=a),this.trigger("error"),!0},t.addSidxSegments_=function(i,n,a){var o=this,l=i.sidx&&Ad(i.sidx);if(!i.sidx||!l||this.masterPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=N.setTimeout(function(){return a(!1)},0);return}var u=Wh(this.handleManifestRedirects,i.sidx.resolvedUri),c=function(f,g){if(!o.requestErrored_(f,g,n)){var E=o.masterPlaylistLoader_.sidxMapping_,S;try{S=aL(Je(g.response).subarray(8))}catch(k){o.requestErrored_(k,g,n);return}return E[l]={sidxInfo:i.sidx,sidx:S},rg(i,S,i.sidx.resolvedUri),a(!0)}};this.request=MM(u,this.vhs_.xhr,function(d,f,g,E){if(d)return c(d,f);if(!g||g!=="mp4")return c({status:f.status,message:"Unsupported "+(g||"unknown")+" container type for sidx segment at URL: "+u,response:"",playlist:i,internal:!0,blacklistDuration:1/0,code:2},f);var S=i.sidx.byterange,k=S.offset,F=S.length;if(E.length>=F+k)return c(d,{response:E.subarray(k,k+F),status:f.status,uri:f.uri});o.request=o.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:tm({byterange:i.sidx.byterange})},c)})},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},N.clearTimeout(this.minimumUpdatePeriodTimeout_),N.clearTimeout(this.mediaRequest_),N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var i=this.request;this.request=null,i.onreadystatechange=null,i.abort()}},t.media=function(i){var n=this;if(!i)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof i=="string"){if(!this.masterPlaylistLoader_.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.masterPlaylistLoader_.master.playlists[i]}var o=!this.media_||i.id!==this.media_.id;if(o&&this.loadedPlaylists_[i.id]&&this.loadedPlaylists_[i.id].endList){this.state="HAVE_METADATA",this.media_=i,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(i,a,function(l){n.haveMetadata({startingState:a,playlist:i})}))},t.haveMetadata=function(i){var n=i.startingState,a=i.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(N.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},t.load=function(i){var n=this;N.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(i){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=N.setTimeout(function(){return n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},t.start=function(){var i=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=N.setTimeout(function(){return i.haveMaster_()},0);return}this.requestMaster_(function(n,a){i.haveMaster_(),!i.hasPendingRequest()&&!i.media_&&i.media(i.masterPlaylistLoader_.master.playlists[0])})},t.requestMaster_=function(i){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(n.requestErrored_(a,o)){n.state==="HAVE_NOTHING"&&(n.started=!1);return}var l=o.responseText!==n.masterPlaylistLoader_.masterXml_;if(n.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?n.masterLoaded_=Date.parse(o.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=Wh(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,o),l){n.handleMaster_(),n.syncClientServerClock_(function(){return i(o,l)});return}return i(o,l)})},t.syncClientServerClock_=function(i){var n=this,a=iL(this.masterPlaylistLoader_.masterXml_);if(a===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),i();if(a.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),i();this.request=this.vhs_.xhr({uri:Nn(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(n.request){if(o)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),i();var u;a.method==="HEAD"?!l.responseHeaders||!l.responseHeaders.date?u=n.masterLoaded_:u=Date.parse(l.responseHeaders.date):u=Date.parse(l.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),i()}})},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var i=this.masterPlaylistLoader_.master,n=UM({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:i});i&&(n=$M(i,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||i;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!i||n&&n.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},t.updateMinimumUpdatePeriodTimeout_=function(){var i=this.masterPlaylistLoader_;i.createMupOnMedia_&&(i.off("loadedmetadata",i.createMupOnMedia_),i.createMupOnMedia_=null),i.minimumUpdatePeriodTimeout_&&(N.clearTimeout(i.minimumUpdatePeriodTimeout_),i.minimumUpdatePeriodTimeout_=null);var n=i.master&&i.master.minimumUpdatePeriod;if(n===0&&(i.media()?n=i.media().targetDuration*1e3:(i.createMupOnMedia_=i.updateMinimumUpdatePeriodTimeout_,i.one("loadedmetadata",i.createMupOnMedia_))),typeof n!="number"||n<=0){n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout");return}this.createMUPTimeout_(n)},t.createMUPTimeout_=function(i){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=N.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(i)},i)},t.refreshXml_=function(){var i=this;this.requestMaster_(function(n,a){a&&(i.media_&&(i.media_=i.masterPlaylistLoader_.master.playlists[i.media_.id]),i.masterPlaylistLoader_.sidxMapping_=HM(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.sidxMapping_),i.addSidxSegments_(i.media(),i.state,function(o){i.refreshMedia_(i.media().id)}))})},t.refreshMedia_=function(i){var n=this;if(!i)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==a[i];if(o?this.media_=a[i]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var l=function u(){n.media().endList||(n.mediaUpdateTimeout=N.setTimeout(function(){n.trigger("mediaupdatetimeout"),u()},Zp(n.media(),!!o)))};l()}this.trigger("loadedplaylist")},e})(RM),Fi={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},VM=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer},z2=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},qM=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch{var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},W2=function(e){return function(){var t=qM(e),r=z2(new Worker(t));r.objURL=t;var i=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},r}},G2=function(e){return"var browserWorkerPolyFill = "+z2.toString()+`;
|
|
335
|
+
browserWorkerPolyFill(self);
|
|
336
|
+
`+e},K2=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},zM=G2(K2(function(){var s=function(){this.init=function(){var p={};this.on=function(T,v){p[T]||(p[T]=[]),p[T]=p[T].concat(v)},this.off=function(T,v){var b;return p[T]?(b=p[T].indexOf(v),p[T]=p[T].slice(),p[T].splice(b,1),b>-1):!1},this.trigger=function(T){var v,b,A,D;if(v=p[T],!!v)if(arguments.length===2)for(A=v.length,b=0;b<A;++b)v[b].call(this,arguments[1]);else{for(D=[],b=arguments.length,b=1;b<arguments.length;++b)D.push(arguments[b]);for(A=v.length,b=0;b<A;++b)v[b].apply(this,D)}},this.dispose=function(){p={}}}};s.prototype.pipe=function(M){return this.on("data",function(p){M.push(p)}),this.on("done",function(p){M.flush(p)}),this.on("partialdone",function(p){M.partialFlush(p)}),this.on("endedtimeline",function(p){M.endTimeline(p)}),this.on("reset",function(p){M.reset(p)}),M},s.prototype.push=function(M){this.trigger("data",M)},s.prototype.flush=function(M){this.trigger("done",M)},s.prototype.partialFlush=function(M){this.trigger("partialdone",M)},s.prototype.endTimeline=function(M){this.trigger("endedtimeline",M)},s.prototype.reset=function(M){this.trigger("reset",M)};var e=s,t=Math.pow(2,32),r=function(p){var T=new DataView(p.buffer,p.byteOffset,p.byteLength),v;return T.getBigUint64?(v=T.getBigUint64(0),v<Number.MAX_SAFE_INTEGER?Number(v):v):T.getUint32(0)*t+T.getUint32(4)},i={getUint64:r,MAX_UINT32:t},n=i.MAX_UINT32,a,o,l,u,c,d,f,g,E,S,k,F,L,W,H,$,G,K,Y,P,O,ne,te,re,me,Se,Ae,ve,Te,ye,_e,xe,qe,We,Ke,ze;(function(){var M;if(te={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(M in te)te.hasOwnProperty(M)&&(te[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);re=new Uint8Array([105,115,111,109]),Se=new Uint8Array([97,118,99,49]),me=new Uint8Array([0,0,0,1]),Ae=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]),ve=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]),Te={video:Ae,audio:ve},xe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),_e=new Uint8Array([0,0,0,0,0,0,0,0]),qe=new Uint8Array([0,0,0,0,0,0,0,0]),We=qe,Ke=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ze=qe,ye=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(p){var T=[],v=0,b,A,D;for(b=1;b<arguments.length;b++)T.push(arguments[b]);for(b=T.length;b--;)v+=T[b].byteLength;for(A=new Uint8Array(v+8),D=new DataView(A.buffer,A.byteOffset,A.byteLength),D.setUint32(0,A.byteLength),A.set(p,4),b=0,v=8;b<T.length;b++)A.set(T[b],v),v+=T[b].byteLength;return A},o=function(){return a(te.dinf,a(te.dref,xe))},l=function(p){return a(te.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,p.audioobjecttype<<3|p.samplingfrequencyindex>>>1,p.samplingfrequencyindex<<7|p.channelcount<<3,6,1,2]))},u=function(){return a(te.ftyp,re,me,re,Se)},$=function(p){return a(te.hdlr,Te[p])},c=function(p){return a(te.mdat,p)},H=function(p){var T=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,p.duration>>>24&255,p.duration>>>16&255,p.duration>>>8&255,p.duration&255,85,196,0,0]);return p.samplerate&&(T[12]=p.samplerate>>>24&255,T[13]=p.samplerate>>>16&255,T[14]=p.samplerate>>>8&255,T[15]=p.samplerate&255),a(te.mdhd,T)},W=function(p){return a(te.mdia,H(p),$(p.type),f(p))},d=function(p){return a(te.mfhd,new Uint8Array([0,0,0,0,(p&4278190080)>>24,(p&16711680)>>16,(p&65280)>>8,p&255]))},f=function(p){return a(te.minf,p.type==="video"?a(te.vmhd,ye):a(te.smhd,_e),o(),K(p))},g=function(p,T){for(var v=[],b=T.length;b--;)v[b]=P(T[b]);return a.apply(null,[te.moof,d(p)].concat(v))},E=function(p){for(var T=p.length,v=[];T--;)v[T]=F(p[T]);return a.apply(null,[te.moov,k(4294967295)].concat(v).concat(S(p)))},S=function(p){for(var T=p.length,v=[];T--;)v[T]=O(p[T]);return a.apply(null,[te.mvex].concat(v))},k=function(p){var T=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(p&4278190080)>>24,(p&16711680)>>16,(p&65280)>>8,p&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 a(te.mvhd,T)},G=function(p){var T=p.samples||[],v=new Uint8Array(4+T.length),b,A;for(A=0;A<T.length;A++)b=T[A].flags,v[A+4]=b.dependsOn<<4|b.isDependedOn<<2|b.hasRedundancy;return a(te.sdtp,v)},K=function(p){return a(te.stbl,Y(p),a(te.stts,ze),a(te.stsc,We),a(te.stsz,Ke),a(te.stco,qe))},(function(){var M,p;Y=function(v){return a(te.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),v.type==="video"?M(v):p(v))},M=function(v){var b=v.sps||[],A=v.pps||[],D=[],V=[],X,se;for(X=0;X<b.length;X++)D.push((b[X].byteLength&65280)>>>8),D.push(b[X].byteLength&255),D=D.concat(Array.prototype.slice.call(b[X]));for(X=0;X<A.length;X++)V.push((A[X].byteLength&65280)>>>8),V.push(A[X].byteLength&255),V=V.concat(Array.prototype.slice.call(A[X]));if(se=[te.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,(v.width&65280)>>8,v.width&255,(v.height&65280)>>8,v.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]),a(te.avcC,new Uint8Array([1,v.profileIdc,v.profileCompatibility,v.levelIdc,255].concat([b.length],D,[A.length],V))),a(te.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],v.sarRatio){var ee=v.sarRatio[0],le=v.sarRatio[1];se.push(a(te.pasp,new Uint8Array([(ee&4278190080)>>24,(ee&16711680)>>16,(ee&65280)>>8,ee&255,(le&4278190080)>>24,(le&16711680)>>16,(le&65280)>>8,le&255])))}return a.apply(null,se)},p=function(v){return a(te.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(v.channelcount&65280)>>8,v.channelcount&255,(v.samplesize&65280)>>8,v.samplesize&255,0,0,0,0,(v.samplerate&65280)>>8,v.samplerate&255,0,0]),l(v))}})(),L=function(p){var T=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,0,(p.duration&4278190080)>>24,(p.duration&16711680)>>16,(p.duration&65280)>>8,p.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,(p.width&65280)>>8,p.width&255,0,0,(p.height&65280)>>8,p.height&255,0,0]);return a(te.tkhd,T)},P=function(p){var T,v,b,A,D,V,X;return T=a(te.tfhd,new Uint8Array([0,0,0,58,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),V=Math.floor(p.baseMediaDecodeTime/n),X=Math.floor(p.baseMediaDecodeTime%n),v=a(te.tfdt,new Uint8Array([1,0,0,0,V>>>24&255,V>>>16&255,V>>>8&255,V&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),D=92,p.type==="audio"?(b=ne(p,D),a(te.traf,T,v,b)):(A=G(p),b=ne(p,A.length+D),a(te.traf,T,v,b,A))},F=function(p){return p.duration=p.duration||4294967295,a(te.trak,L(p),W(p))},O=function(p){var T=new Uint8Array([0,0,0,0,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return p.type!=="video"&&(T[T.length-1]=0),a(te.trex,T)},(function(){var M,p,T;T=function(b,A){var D=0,V=0,X=0,se=0;return b.length&&(b[0].duration!==void 0&&(D=1),b[0].size!==void 0&&(V=2),b[0].flags!==void 0&&(X=4),b[0].compositionTimeOffset!==void 0&&(se=8)),[0,0,D|V|X|se,1,(b.length&4278190080)>>>24,(b.length&16711680)>>>16,(b.length&65280)>>>8,b.length&255,(A&4278190080)>>>24,(A&16711680)>>>16,(A&65280)>>>8,A&255]},p=function(b,A){var D,V,X,se,ee,le;for(se=b.samples||[],A+=20+16*se.length,X=T(se,A),V=new Uint8Array(X.length+se.length*16),V.set(X),D=X.length,le=0;le<se.length;le++)ee=se[le],V[D++]=(ee.duration&4278190080)>>>24,V[D++]=(ee.duration&16711680)>>>16,V[D++]=(ee.duration&65280)>>>8,V[D++]=ee.duration&255,V[D++]=(ee.size&4278190080)>>>24,V[D++]=(ee.size&16711680)>>>16,V[D++]=(ee.size&65280)>>>8,V[D++]=ee.size&255,V[D++]=ee.flags.isLeading<<2|ee.flags.dependsOn,V[D++]=ee.flags.isDependedOn<<6|ee.flags.hasRedundancy<<4|ee.flags.paddingValue<<1|ee.flags.isNonSyncSample,V[D++]=ee.flags.degradationPriority&61440,V[D++]=ee.flags.degradationPriority&15,V[D++]=(ee.compositionTimeOffset&4278190080)>>>24,V[D++]=(ee.compositionTimeOffset&16711680)>>>16,V[D++]=(ee.compositionTimeOffset&65280)>>>8,V[D++]=ee.compositionTimeOffset&255;return a(te.trun,V)},M=function(b,A){var D,V,X,se,ee,le;for(se=b.samples||[],A+=20+8*se.length,X=T(se,A),D=new Uint8Array(X.length+se.length*8),D.set(X),V=X.length,le=0;le<se.length;le++)ee=se[le],D[V++]=(ee.duration&4278190080)>>>24,D[V++]=(ee.duration&16711680)>>>16,D[V++]=(ee.duration&65280)>>>8,D[V++]=ee.duration&255,D[V++]=(ee.size&4278190080)>>>24,D[V++]=(ee.size&16711680)>>>16,D[V++]=(ee.size&65280)>>>8,D[V++]=ee.size&255;return a(te.trun,D)},ne=function(b,A){return b.type==="audio"?M(b,A):p(b,A)}})();var xt={ftyp:u,mdat:c,moof:g,moov:E,initSegment:function(p){var T=u(),v=E(p),b;return b=new Uint8Array(T.byteLength+v.byteLength),b.set(T),b.set(v,T.byteLength),b}},Qt=function(p){var T,v,b=[],A=[];for(A.byteLength=0,A.nalCount=0,A.duration=0,b.byteLength=0,T=0;T<p.length;T++)v=p[T],v.nalUnitType==="access_unit_delimiter_rbsp"?(b.length&&(b.duration=v.dts-b.dts,A.byteLength+=b.byteLength,A.nalCount+=b.length,A.duration+=b.duration,A.push(b)),b=[v],b.byteLength=v.data.byteLength,b.pts=v.pts,b.dts=v.dts):(v.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(b.keyFrame=!0),b.duration=v.dts-b.dts,b.byteLength+=v.data.byteLength,b.push(v));return A.length&&(!b.duration||b.duration<=0)&&(b.duration=A[A.length-1].duration),A.byteLength+=b.byteLength,A.nalCount+=b.length,A.duration+=b.duration,A.push(b),A},wt=function(p){var T,v,b=[],A=[];for(b.byteLength=0,b.nalCount=0,b.duration=0,b.pts=p[0].pts,b.dts=p[0].dts,A.byteLength=0,A.nalCount=0,A.duration=0,A.pts=p[0].pts,A.dts=p[0].dts,T=0;T<p.length;T++)v=p[T],v.keyFrame?(b.length&&(A.push(b),A.byteLength+=b.byteLength,A.nalCount+=b.nalCount,A.duration+=b.duration),b=[v],b.nalCount=v.length,b.byteLength=v.byteLength,b.pts=v.pts,b.dts=v.dts,b.duration=v.duration):(b.duration+=v.duration,b.nalCount+=v.length,b.byteLength+=v.byteLength,b.push(v));return A.length&&b.duration<=0&&(b.duration=A[A.length-1].duration),A.byteLength+=b.byteLength,A.nalCount+=b.nalCount,A.duration+=b.duration,A.push(b),A},Jt=function(p){var T;return!p[0][0].keyFrame&&p.length>1&&(T=p.shift(),p.byteLength-=T.byteLength,p.nalCount-=T.nalCount,p[0][0].dts=T.dts,p[0][0].pts=T.pts,p[0][0].duration+=T.duration),p},Ii=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},oi=function(p,T){var v=Ii();return v.dataOffset=T,v.compositionTimeOffset=p.pts-p.dts,v.duration=p.duration,v.size=4*p.length,v.size+=p.byteLength,p.keyFrame&&(v.flags.dependsOn=2,v.flags.isNonSyncSample=0),v},yi=function(p,T){var v,b,A,D,V,X=T||0,se=[];for(v=0;v<p.length;v++)for(D=p[v],b=0;b<D.length;b++)V=D[b],A=oi(V,X),X+=A.size,se.push(A);return se},Pr=function(p){var T,v,b,A,D,V,X=0,se=p.byteLength,ee=p.nalCount,le=se+4*ee,Ce=new Uint8Array(le),Re=new DataView(Ce.buffer);for(T=0;T<p.length;T++)for(A=p[T],v=0;v<A.length;v++)for(D=A[v],b=0;b<D.length;b++)V=D[b],Re.setUint32(X,V.data.byteLength),X+=4,Ce.set(V.data,X),X+=V.data.byteLength;return Ce},li=function(p,T){var v,b=T||0,A=[];return v=oi(p,b),A.push(v),A},Lr=function(p){var T,v,b=0,A=p.byteLength,D=p.length,V=A+4*D,X=new Uint8Array(V),se=new DataView(X.buffer);for(T=0;T<p.length;T++)v=p[T],se.setUint32(b,v.data.byteLength),b+=4,X.set(v.data,b),b+=v.data.byteLength;return X},Ut={groupNalsIntoFrames:Qt,groupFramesIntoGops:wt,extendFirstKeyFrame:Jt,generateSampleTable:yi,concatenateNalData:Pr,generateSampleTableForFrame:li,concatenateNalDataForFrame:Lr},Pi=[33,16,5,32,164,27],_i=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],nt=function(p){for(var T=[];p--;)T.push(0);return T},lt=function(p){return Object.keys(p).reduce(function(T,v){return T[v]=new Uint8Array(p[v].reduce(function(b,A){return b.concat(A)},[])),T},{})},kt,Ft=function(){if(!kt){var p={96e3:[Pi,[227,64],nt(154),[56]],88200:[Pi,[231],nt(170),[56]],64e3:[Pi,[248,192],nt(240),[56]],48e3:[Pi,[255,192],nt(268),[55,148,128],nt(54),[112]],44100:[Pi,[255,192],nt(268),[55,163,128],nt(84),[112]],32e3:[Pi,[255,192],nt(268),[55,234],nt(226),[112]],24e3:[Pi,[255,192],nt(268),[55,255,128],nt(268),[111,112],nt(126),[224]],16e3:[Pi,[255,192],nt(268),[55,255,128],nt(268),[111,255],nt(269),[223,108],nt(195),[1,192]],12e3:[_i,nt(268),[3,127,248],nt(268),[6,255,240],nt(268),[13,255,224],nt(268),[27,253,128],nt(259),[56]],11025:[_i,nt(268),[3,127,248],nt(268),[6,255,240],nt(268),[13,255,224],nt(268),[27,255,192],nt(268),[55,175,128],nt(108),[112]],8e3:[_i,nt(268),[3,121,16],nt(47),[7]]};kt=lt(p)}return kt},Tr=9e4,nr,Or,br,Sr,Mr,Rn,Bn;nr=function(p){return p*Tr},Or=function(p,T){return p*T},br=function(p){return p/Tr},Sr=function(p,T){return p/T},Mr=function(p,T){return nr(Sr(p,T))},Rn=function(p,T){return Or(br(p),T)},Bn=function(p,T,v){return br(v?p:p-T)};var dt={ONE_SECOND_IN_TS:Tr,secondsToVideoTs:nr,secondsToAudioTs:Or,videoTsToSeconds:br,audioTsToSeconds:Sr,audioTsToVideoTs:Mr,videoTsToAudioTs:Rn,metadataTsToSeconds:Bn},_t=function(p){var T,v,b=0;for(T=0;T<p.length;T++)v=p[T],b+=v.data.byteLength;return b},Jr=function(p,T,v,b){var A,D=0,V=0,X=0,se=0,ee,le,Ce;if(T.length&&(A=dt.audioTsToVideoTs(p.baseMediaDecodeTime,p.samplerate),D=Math.ceil(dt.ONE_SECOND_IN_TS/(p.samplerate/1024)),v&&b&&(V=A-Math.max(v,b),X=Math.floor(V/D),se=X*D),!(X<1||se>dt.ONE_SECOND_IN_TS/2))){for(ee=Ft()[p.samplerate],ee||(ee=T[0].data),le=0;le<X;le++)Ce=T[0],T.splice(0,0,{data:ee,dts:Ce.dts-D,pts:Ce.pts-D});return p.baseMediaDecodeTime-=Math.floor(dt.videoTsToAudioTs(se,p.samplerate)),se}},mn=function(p,T,v){return T.minSegmentDts>=v?p:(T.minSegmentDts=1/0,p.filter(function(b){return b.dts>=v?(T.minSegmentDts=Math.min(T.minSegmentDts,b.dts),T.minSegmentPts=T.minSegmentDts,!0):!1}))},Ts=function(p){var T,v,b=[];for(T=0;T<p.length;T++)v=p[T],b.push({size:v.data.byteLength,duration:1024});return b},Js=function(p){var T,v,b=0,A=new Uint8Array(_t(p));for(T=0;T<p.length;T++)v=p[T],A.set(v.data,b),b+=v.data.byteLength;return A},Zr={prefixWithSilence:Jr,trimAdtsFramesByEarliestDts:mn,generateSampleTable:Ts,concatenateFrameData:Js},en=dt.ONE_SECOND_IN_TS,bs=function(p,T){typeof T.pts=="number"&&(p.timelineStartInfo.pts===void 0&&(p.timelineStartInfo.pts=T.pts),p.minSegmentPts===void 0?p.minSegmentPts=T.pts:p.minSegmentPts=Math.min(p.minSegmentPts,T.pts),p.maxSegmentPts===void 0?p.maxSegmentPts=T.pts:p.maxSegmentPts=Math.max(p.maxSegmentPts,T.pts)),typeof T.dts=="number"&&(p.timelineStartInfo.dts===void 0&&(p.timelineStartInfo.dts=T.dts),p.minSegmentDts===void 0?p.minSegmentDts=T.dts:p.minSegmentDts=Math.min(p.minSegmentDts,T.dts),p.maxSegmentDts===void 0?p.maxSegmentDts=T.dts:p.maxSegmentDts=Math.max(p.maxSegmentDts,T.dts))},Ss=function(p){delete p.minSegmentDts,delete p.maxSegmentDts,delete p.minSegmentPts,delete p.maxSegmentPts},Zs=function(p,T){var v,b,A=p.minSegmentDts;return T||(A-=p.timelineStartInfo.dts),v=p.timelineStartInfo.baseMediaDecodeTime,v+=A,v=Math.max(0,v),p.type==="audio"&&(b=p.samplerate/en,v*=b,v=Math.floor(v)),v},R={clearDtsInfo:Ss,calculateTrackBaseMediaDecodeTime:Zs,collectDtsInfo:bs},j=4,ie=128,ge=function(p){for(var T=0,v={payloadType:-1,payloadSize:0},b=0,A=0;T<p.byteLength&&p[T]!==ie;){for(;p[T]===255;)b+=255,T++;for(b+=p[T++];p[T]===255;)A+=255,T++;if(A+=p[T++],!v.payload&&b===j){var D=String.fromCharCode(p[T+3],p[T+4],p[T+5],p[T+6]);if(D==="GA94"){v.payloadType=b,v.payloadSize=A,v.payload=p.subarray(T,T+A);break}else v.payload=void 0}T+=A,b=0,A=0}return v},Me=function(p){return p.payload[0]!==181||(p.payload[1]<<8|p.payload[2])!==49||String.fromCharCode(p.payload[3],p.payload[4],p.payload[5],p.payload[6])!=="GA94"||p.payload[7]!==3?null:p.payload.subarray(8,p.payload.length-1)},Xe=function(p,T){var v=[],b,A,D,V;if(!(T[0]&64))return v;for(A=T[0]&31,b=0;b<A;b++)D=b*3,V={type:T[D+2]&3,pts:p},T[D+2]&4&&(V.ccData=T[D+3]<<8|T[D+4],v.push(V));return v},At=function(p){for(var T=p.byteLength,v=[],b=1,A,D;b<T-2;)p[b]===0&&p[b+1]===0&&p[b+2]===3?(v.push(b+2),b+=2):b++;if(v.length===0)return p;A=T-v.length,D=new Uint8Array(A);var V=0;for(b=0;b<A;V++,b++)V===v[0]&&(V++,v.shift()),D[b]=p[V];return D},Wt={parseSei:ge,parseUserData:Me,parseCaptionPackets:Xe,discardEmulationPreventionBytes:At,USER_DATA_REGISTERED_ITU_T_T35:j},Tt=function M(p){p=p||{},M.prototype.init.call(this),this.parse708captions_=typeof p.parse708captions=="boolean"?p.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Nt(0,0),new Nt(0,1),new Nt(1,0),new Nt(1,1)],this.parse708captions_&&(this.cc708Stream_=new ut({captionServices:p.captionServices})),this.reset(),this.ccStreams_.forEach(function(T){T.on("data",this.trigger.bind(this,"data")),T.on("partialdone",this.trigger.bind(this,"partialdone")),T.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")))};Tt.prototype=new e,Tt.prototype.push=function(M){var p,T,v;if(M.nalUnitType==="sei_rbsp"&&(p=Wt.parseSei(M.escapedRBSP),!!p.payload&&p.payloadType===Wt.USER_DATA_REGISTERED_ITU_T_T35&&(T=Wt.parseUserData(p),!!T))){if(M.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(M.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}v=Wt.parseCaptionPackets(M.pts,T),this.captionPackets_=this.captionPackets_.concat(v),this.latestDts_!==M.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=M.dts}},Tt.prototype.flushCCStreams=function(M){this.ccStreams_.forEach(function(p){return M==="flush"?p.flush():p.partialFlush()},this)},Tt.prototype.flushStream=function(M){if(!this.captionPackets_.length){this.flushCCStreams(M);return}this.captionPackets_.forEach(function(p,T){p.presortIndex=T}),this.captionPackets_.sort(function(p,T){return p.pts===T.pts?p.presortIndex-T.presortIndex:p.pts-T.pts}),this.captionPackets_.forEach(function(p){p.type<2?this.dispatchCea608Packet(p):this.dispatchCea708Packet(p)},this),this.captionPackets_.length=0,this.flushCCStreams(M)},Tt.prototype.flush=function(){return this.flushStream("flush")},Tt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Tt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(M){M.reset()})},Tt.prototype.dispatchCea608Packet=function(M){this.setsTextOrXDSActive(M)?this.activeCea608Channel_[M.type]=null:this.setsChannel1Active(M)?this.activeCea608Channel_[M.type]=0:this.setsChannel2Active(M)&&(this.activeCea608Channel_[M.type]=1),this.activeCea608Channel_[M.type]!==null&&this.ccStreams_[(M.type<<1)+this.activeCea608Channel_[M.type]].push(M)},Tt.prototype.setsChannel1Active=function(M){return(M.ccData&30720)===4096},Tt.prototype.setsChannel2Active=function(M){return(M.ccData&30720)===6144},Tt.prototype.setsTextOrXDSActive=function(M){return(M.ccData&28928)===256||(M.ccData&30974)===4138||(M.ccData&30974)===6186},Tt.prototype.dispatchCea708Packet=function(M){this.parse708captions_&&this.cc708Stream_.push(M)};var Yi={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},mi=function(p){var T=Yi[p]||p;return p&4096&&p===T?"":String.fromCharCode(T)},Li=function(p){return 32<=p&&p<=127||160<=p&&p<=255},ii=function(p){this.windowNum=p,this.reset()};ii.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},ii.prototype.getText=function(){return this.rows.join(`
|
|
337
|
+
`)},ii.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ii.prototype.newLine=function(M){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(M),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ii.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ii.prototype.addText=function(M){this.rows[this.rowIdx]+=M},ii.prototype.backspace=function(){if(!this.isEmpty()){var M=this.rows[this.rowIdx];this.rows[this.rowIdx]=M.substr(0,M.length-1)}};var Lt=function(p,T,v){this.serviceNum=p,this.text="",this.currentWindow=new ii(-1),this.windows=[],this.stream=v,typeof T=="string"&&this.createTextDecoder(T)};Lt.prototype.init=function(M,p){this.startPts=M;for(var T=0;T<8;T++)this.windows[T]=new ii(T),typeof p=="function"&&(this.windows[T].beforeRowOverflow=p)},Lt.prototype.setCurrentWindow=function(M){this.currentWindow=this.windows[M]},Lt.prototype.createTextDecoder=function(M){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(M)}catch(p){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+M+" encoding. "+p})}};var ut=function M(p){p=p||{},M.prototype.init.call(this);var T=this,v=p.captionServices||{},b={},A;Object.keys(v).forEach(function(D){A=v[D],/^SERVICE/.test(D)&&(b[D]=A.encoding)}),this.serviceEncodings=b,this.current708Packet=null,this.services={},this.push=function(D){D.type===3?(T.new708Packet(),T.add708Bytes(D)):(T.current708Packet===null&&T.new708Packet(),T.add708Bytes(D))}};ut.prototype=new e,ut.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ut.prototype.add708Bytes=function(M){var p=M.ccData,T=p>>>8,v=p&255;this.current708Packet.ptsVals.push(M.pts),this.current708Packet.data.push(T),this.current708Packet.data.push(v)},ut.prototype.push708Packet=function(){var M=this.current708Packet,p=M.data,T=null,v=null,b=0,A=p[b++];for(M.seq=A>>6,M.sizeCode=A&63;b<p.length;b++)A=p[b++],T=A>>5,v=A&31,T===7&&v>0&&(A=p[b++],T=A),this.pushServiceBlock(T,b,v),v>0&&(b+=v-1)},ut.prototype.pushServiceBlock=function(M,p,T){var v,b=p,A=this.current708Packet.data,D=this.services[M];for(D||(D=this.initService(M,b));b<p+T&&b<A.length;b++)v=A[b],Li(v)?b=this.handleText(b,D):v===24?b=this.multiByteCharacter(b,D):v===16?b=this.extendedCommands(b,D):128<=v&&v<=135?b=this.setCurrentWindow(b,D):152<=v&&v<=159?b=this.defineWindow(b,D):v===136?b=this.clearWindows(b,D):v===140?b=this.deleteWindows(b,D):v===137?b=this.displayWindows(b,D):v===138?b=this.hideWindows(b,D):v===139?b=this.toggleWindows(b,D):v===151?b=this.setWindowAttributes(b,D):v===144?b=this.setPenAttributes(b,D):v===145?b=this.setPenColor(b,D):v===146?b=this.setPenLocation(b,D):v===143?D=this.reset(b,D):v===8?D.currentWindow.backspace():v===12?D.currentWindow.clearText():v===13?D.currentWindow.pendingNewLine=!0:v===14?D.currentWindow.clearText():v===141&&b++},ut.prototype.extendedCommands=function(M,p){var T=this.current708Packet.data,v=T[++M];return Li(v)&&(M=this.handleText(M,p,{isExtended:!0})),M},ut.prototype.getPts=function(M){return this.current708Packet.ptsVals[Math.floor(M/2)]},ut.prototype.initService=function(M,p){var v="SERVICE"+M,T=this,v,b;return v in this.serviceEncodings&&(b=this.serviceEncodings[v]),this.services[M]=new Lt(M,b,T),this.services[M].init(this.getPts(p),function(A){T.flushDisplayed(A,T.services[M])}),this.services[M]},ut.prototype.handleText=function(M,p,T){var v=T&&T.isExtended,b=T&&T.isMultiByte,A=this.current708Packet.data,D=v?4096:0,V=A[M],X=A[M+1],se=p.currentWindow,ee,le;return p.textDecoder_&&!v?(b?(le=[V,X],M++):le=[V],ee=p.textDecoder_.decode(new Uint8Array(le))):ee=mi(D|V),se.pendingNewLine&&!se.isEmpty()&&se.newLine(this.getPts(M)),se.pendingNewLine=!1,se.addText(ee),M},ut.prototype.multiByteCharacter=function(M,p){var T=this.current708Packet.data,v=T[M+1],b=T[M+2];return Li(v)&&Li(b)&&(M=this.handleText(++M,p,{isMultiByte:!0})),M},ut.prototype.setCurrentWindow=function(M,p){var T=this.current708Packet.data,v=T[M],b=v&7;return p.setCurrentWindow(b),M},ut.prototype.defineWindow=function(M,p){var T=this.current708Packet.data,v=T[M],b=v&7;p.setCurrentWindow(b);var A=p.currentWindow;return v=T[++M],A.visible=(v&32)>>5,A.rowLock=(v&16)>>4,A.columnLock=(v&8)>>3,A.priority=v&7,v=T[++M],A.relativePositioning=(v&128)>>7,A.anchorVertical=v&127,v=T[++M],A.anchorHorizontal=v,v=T[++M],A.anchorPoint=(v&240)>>4,A.rowCount=v&15,v=T[++M],A.columnCount=v&63,v=T[++M],A.windowStyle=(v&56)>>3,A.penStyle=v&7,A.virtualRowCount=A.rowCount+1,M},ut.prototype.setWindowAttributes=function(M,p){var T=this.current708Packet.data,v=T[M],b=p.currentWindow.winAttr;return v=T[++M],b.fillOpacity=(v&192)>>6,b.fillRed=(v&48)>>4,b.fillGreen=(v&12)>>2,b.fillBlue=v&3,v=T[++M],b.borderType=(v&192)>>6,b.borderRed=(v&48)>>4,b.borderGreen=(v&12)>>2,b.borderBlue=v&3,v=T[++M],b.borderType+=(v&128)>>5,b.wordWrap=(v&64)>>6,b.printDirection=(v&48)>>4,b.scrollDirection=(v&12)>>2,b.justify=v&3,v=T[++M],b.effectSpeed=(v&240)>>4,b.effectDirection=(v&12)>>2,b.displayEffect=v&3,M},ut.prototype.flushDisplayed=function(M,p){for(var T=[],v=0;v<8;v++)p.windows[v].visible&&!p.windows[v].isEmpty()&&T.push(p.windows[v].getText());p.endPts=M,p.text=T.join(`
|
|
338
|
+
|
|
339
|
+
`),this.pushCaption(p),p.startPts=M},ut.prototype.pushCaption=function(M){M.text!==""&&(this.trigger("data",{startPts:M.startPts,endPts:M.endPts,text:M.text,stream:"cc708_"+M.serviceNum}),M.text="",M.startPts=M.endPts)},ut.prototype.displayWindows=function(M,p){var T=this.current708Packet.data,v=T[++M],b=this.getPts(M);this.flushDisplayed(b,p);for(var A=0;A<8;A++)v&1<<A&&(p.windows[A].visible=1);return M},ut.prototype.hideWindows=function(M,p){var T=this.current708Packet.data,v=T[++M],b=this.getPts(M);this.flushDisplayed(b,p);for(var A=0;A<8;A++)v&1<<A&&(p.windows[A].visible=0);return M},ut.prototype.toggleWindows=function(M,p){var T=this.current708Packet.data,v=T[++M],b=this.getPts(M);this.flushDisplayed(b,p);for(var A=0;A<8;A++)v&1<<A&&(p.windows[A].visible^=1);return M},ut.prototype.clearWindows=function(M,p){var T=this.current708Packet.data,v=T[++M],b=this.getPts(M);this.flushDisplayed(b,p);for(var A=0;A<8;A++)v&1<<A&&p.windows[A].clearText();return M},ut.prototype.deleteWindows=function(M,p){var T=this.current708Packet.data,v=T[++M],b=this.getPts(M);this.flushDisplayed(b,p);for(var A=0;A<8;A++)v&1<<A&&p.windows[A].reset();return M},ut.prototype.setPenAttributes=function(M,p){var T=this.current708Packet.data,v=T[M],b=p.currentWindow.penAttr;return v=T[++M],b.textTag=(v&240)>>4,b.offset=(v&12)>>2,b.penSize=v&3,v=T[++M],b.italics=(v&128)>>7,b.underline=(v&64)>>6,b.edgeType=(v&56)>>3,b.fontStyle=v&7,M},ut.prototype.setPenColor=function(M,p){var T=this.current708Packet.data,v=T[M],b=p.currentWindow.penColor;return v=T[++M],b.fgOpacity=(v&192)>>6,b.fgRed=(v&48)>>4,b.fgGreen=(v&12)>>2,b.fgBlue=v&3,v=T[++M],b.bgOpacity=(v&192)>>6,b.bgRed=(v&48)>>4,b.bgGreen=(v&12)>>2,b.bgBlue=v&3,v=T[++M],b.edgeRed=(v&48)>>4,b.edgeGreen=(v&12)>>2,b.edgeBlue=v&3,M},ut.prototype.setPenLocation=function(M,p){var T=this.current708Packet.data,v=T[M],b=p.currentWindow.penLoc;return p.currentWindow.pendingNewLine=!0,v=T[++M],b.row=v&15,v=T[++M],b.column=v&63,M},ut.prototype.reset=function(M,p){var T=this.getPts(M);return this.flushDisplayed(T,p),this.initService(p.serviceNum,M)};var Rr={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},qi=function(p){return p===null?"":(p=Rr[p]||p,String.fromCharCode(p))},Ct=14,gn=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],at=function(){for(var p=[],T=Ct+1;T--;)p.push("");return p},Nt=function M(p,T){M.prototype.init.call(this),this.field_=p||0,this.dataChannel_=T||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(v){var b,A,D,V,X;if(b=v.ccData&32639,b===this.lastControlCode_){this.lastControlCode_=null;return}if((b&61440)===4096?this.lastControlCode_=b:b!==this.PADDING_&&(this.lastControlCode_=null),D=b>>>8,V=b&255,b!==this.PADDING_)if(b===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(b===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(v.pts),this.flushDisplayed(v.pts),A=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=A,this.startPts_=v.pts;else if(b===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(v.pts);else if(b===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(v.pts);else if(b===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(v.pts);else if(b===this.CARRIAGE_RETURN_)this.clearFormatting(v.pts),this.flushDisplayed(v.pts),this.shiftRowsUp_(),this.startPts_=v.pts;else if(b===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(b===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(v.pts),this.displayed_=at();else if(b===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=at();else if(b===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(v.pts),this.displayed_=at()),this.mode_="paintOn",this.startPts_=v.pts;else if(this.isSpecialCharacter(D,V))D=(D&3)<<8,X=qi(D|V),this[this.mode_](v.pts,X),this.column_++;else if(this.isExtCharacter(D,V))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),D=(D&3)<<8,X=qi(D|V),this[this.mode_](v.pts,X),this.column_++;else if(this.isMidRowCode(D,V))this.clearFormatting(v.pts),this[this.mode_](v.pts," "),this.column_++,(V&14)===14&&this.addFormatting(v.pts,["i"]),(V&1)===1&&this.addFormatting(v.pts,["u"]);else if(this.isOffsetControlCode(D,V))this.column_+=V&3;else if(this.isPAC(D,V)){var se=gn.indexOf(b&7968);this.mode_==="rollUp"&&(se-this.rollUpRows_+1<0&&(se=this.rollUpRows_-1),this.setRollUp(v.pts,se)),se!==this.row_&&(this.clearFormatting(v.pts),this.row_=se),V&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(v.pts,["u"]),(b&16)===16&&(this.column_=((b&14)>>1)*4),this.isColorPAC(V)&&(V&14)===14&&this.addFormatting(v.pts,["i"])}else this.isNormalChar(D)&&(V===0&&(V=null),X=qi(D),X+=qi(V),this[this.mode_](v.pts,X),this.column_+=X.length)}};Nt.prototype=new e,Nt.prototype.flushDisplayed=function(M){var p=this.displayed_.map(function(T,v){try{return T.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+v+"."}),""}},this).join(`
|
|
340
|
+
`).replace(/^\n+|\n+$/g,"");p.length&&this.trigger("data",{startPts:this.startPts_,endPts:M,text:p,stream:this.name_})},Nt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=at(),this.nonDisplayed_=at(),this.lastControlCode_=null,this.column_=0,this.row_=Ct,this.rollUpRows_=2,this.formatting_=[]},Nt.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},Nt.prototype.isSpecialCharacter=function(M,p){return M===this.EXT_&&p>=48&&p<=63},Nt.prototype.isExtCharacter=function(M,p){return(M===this.EXT_+1||M===this.EXT_+2)&&p>=32&&p<=63},Nt.prototype.isMidRowCode=function(M,p){return M===this.EXT_&&p>=32&&p<=47},Nt.prototype.isOffsetControlCode=function(M,p){return M===this.OFFSET_&&p>=33&&p<=35},Nt.prototype.isPAC=function(M,p){return M>=this.BASE_&&M<this.BASE_+8&&p>=64&&p<=127},Nt.prototype.isColorPAC=function(M){return M>=64&&M<=79||M>=96&&M<=127},Nt.prototype.isNormalChar=function(M){return M>=32&&M<=127},Nt.prototype.setRollUp=function(M,p){if(this.mode_!=="rollUp"&&(this.row_=Ct,this.mode_="rollUp",this.flushDisplayed(M),this.nonDisplayed_=at(),this.displayed_=at()),p!==void 0&&p!==this.row_)for(var T=0;T<this.rollUpRows_;T++)this.displayed_[p-T]=this.displayed_[this.row_-T],this.displayed_[this.row_-T]="";p===void 0&&(p=this.row_),this.topRow_=p-this.rollUpRows_+1},Nt.prototype.addFormatting=function(M,p){this.formatting_=this.formatting_.concat(p);var T=p.reduce(function(v,b){return v+"<"+b+">"},"");this[this.mode_](M,T)},Nt.prototype.clearFormatting=function(M){if(this.formatting_.length){var p=this.formatting_.reverse().reduce(function(T,v){return T+"</"+v+">"},"");this.formatting_=[],this[this.mode_](M,p)}},Nt.prototype.popOn=function(M,p){var T=this.nonDisplayed_[this.row_];T+=p,this.nonDisplayed_[this.row_]=T},Nt.prototype.rollUp=function(M,p){var T=this.displayed_[this.row_];T+=p,this.displayed_[this.row_]=T},Nt.prototype.shiftRowsUp_=function(){var M;for(M=0;M<this.topRow_;M++)this.displayed_[M]="";for(M=this.row_+1;M<Ct+1;M++)this.displayed_[M]="";for(M=this.topRow_;M<this.row_;M++)this.displayed_[M]=this.displayed_[M+1];this.displayed_[this.row_]=""},Nt.prototype.paintOn=function(M,p){var T=this.displayed_[this.row_];T+=p,this.displayed_[this.row_]=T};var vn={CaptionStream:Tt,Cea608Stream:Nt,Cea708Stream:ut},ri={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},zl=8589934592,yn=4294967296,Ot="shared",ea=function(p,T){var v=1;for(p>T&&(v=-1);Math.abs(T-p)>yn;)p+=v*zl;return p},Cs=function M(p){var T,v;M.prototype.init.call(this),this.type_=p||Ot,this.push=function(b){this.type_!==Ot&&b.type!==this.type_||(v===void 0&&(v=b.dts),b.dts=ea(b.dts,v),b.pts=ea(b.pts,v),T=b.dts,this.trigger("data",b))},this.flush=function(){v=T,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){v=void 0,T=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Cs.prototype=new e;var wi={TimestampRolloverStream:Cs,handleRollover:ea},ho=function(p,T,v){var b,A="";for(b=T;b<v;b++)A+="%"+("00"+p[b].toString(16)).slice(-2);return A},Es=function(p,T,v){return decodeURIComponent(ho(p,T,v))},fo=function(p,T,v){return unescape(ho(p,T,v))},tn=function(p){return p[0]<<21|p[1]<<14|p[2]<<7|p[3]},Un={TXXX:function(p){var T;if(p.data[0]===3){for(T=1;T<p.data.length;T++)if(p.data[T]===0){p.description=Es(p.data,1,T),p.value=Es(p.data,T+1,p.data.length).replace(/\0*$/,"");break}p.data=p.value}},WXXX:function(p){var T;if(p.data[0]===3){for(T=1;T<p.data.length;T++)if(p.data[T]===0){p.description=Es(p.data,1,T),p.url=Es(p.data,T+1,p.data.length);break}}},PRIV:function(p){var T;for(T=0;T<p.data.length;T++)if(p.data[T]===0){p.owner=fo(p.data,0,T);break}p.privateData=p.data.subarray(T+1),p.data=p.privateData}},ws;ws=function(p){var T={descriptor:p&&p.descriptor},v=0,b=[],A=0,D;if(ws.prototype.init.call(this),this.dispatchType=ri.METADATA_STREAM_TYPE.toString(16),T.descriptor)for(D=0;D<T.descriptor.length;D++)this.dispatchType+=("00"+T.descriptor[D].toString(16)).slice(-2);this.push=function(V){var X,se,ee,le,Ce,Re;if(V.type==="timed-metadata"){if(V.dataAlignmentIndicator&&(A=0,b.length=0),b.length===0&&(V.data.length<10||V.data[0]!==73||V.data[1]!==68||V.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(b.push(V),A+=V.data.byteLength,b.length===1&&(v=tn(V.data.subarray(6,10)),v+=10),!(A<v)){for(X={data:new Uint8Array(v),frames:[],pts:b[0].pts,dts:b[0].dts},Ce=0;Ce<v;)X.data.set(b[0].data.subarray(0,v-Ce),Ce),Ce+=b[0].data.byteLength,A-=b[0].data.byteLength,b.shift();se=10,X.data[5]&64&&(se+=4,se+=tn(X.data.subarray(10,14)),v-=tn(X.data.subarray(16,20)));do{if(ee=tn(X.data.subarray(se+4,se+8)),ee<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(Re=String.fromCharCode(X.data[se],X.data[se+1],X.data[se+2],X.data[se+3]),le={id:Re,data:X.data.subarray(se+10,se+ee+10)},le.key=le.id,Un[le.id]&&(Un[le.id](le),le.owner==="com.apple.streaming.transportStreamTimestamp")){var Fe=le.data,Ie=(Fe[3]&1)<<30|Fe[4]<<22|Fe[5]<<14|Fe[6]<<6|Fe[7]>>>2;Ie*=4,Ie+=Fe[7]&3,le.timeStamp=Ie,X.pts===void 0&&X.dts===void 0&&(X.pts=le.timeStamp,X.dts=le.timeStamp),this.trigger("timestamp",le)}X.frames.push(le),se+=10,se+=ee}while(se<v);this.trigger("data",X)}}}},ws.prototype=new e;var po=ws,Wl=wi.TimestampRolloverStream,_n,rn,Tn,Qi=188,nn=71;_n=function(){var p=new Uint8Array(Qi),T=0;_n.prototype.init.call(this),this.push=function(v){var b=0,A=Qi,D;for(T?(D=new Uint8Array(v.byteLength+T),D.set(p.subarray(0,T)),D.set(v,T),T=0):D=v;A<D.byteLength;){if(D[b]===nn&&D[A]===nn){this.trigger("data",D.subarray(b,A)),b+=Qi,A+=Qi;continue}b++,A++}b<D.byteLength&&(p.set(D.subarray(b),0),T=D.byteLength-b)},this.flush=function(){T===Qi&&p[0]===nn&&(this.trigger("data",p),T=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){T=0,this.trigger("reset")}},_n.prototype=new e,rn=function(){var p,T,v,b;rn.prototype.init.call(this),b=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,p=function(D,V){var X=0;V.payloadUnitStartIndicator&&(X+=D[X]+1),V.type==="pat"?T(D.subarray(X),V):v(D.subarray(X),V)},T=function(D,V){V.section_number=D[7],V.last_section_number=D[8],b.pmtPid=(D[10]&31)<<8|D[11],V.pmtPid=b.pmtPid},v=function(D,V){var X,se,ee,le;if(D[5]&1){for(b.programMapTable={video:null,audio:null,"timed-metadata":{}},X=(D[1]&15)<<8|D[2],se=3+X-4,ee=(D[10]&15)<<8|D[11],le=12+ee;le<se;){var Ce=D[le],Re=(D[le+1]&31)<<8|D[le+2];Ce===ri.H264_STREAM_TYPE&&b.programMapTable.video===null?b.programMapTable.video=Re:Ce===ri.ADTS_STREAM_TYPE&&b.programMapTable.audio===null?b.programMapTable.audio=Re:Ce===ri.METADATA_STREAM_TYPE&&(b.programMapTable["timed-metadata"][Re]=Ce),le+=((D[le+3]&15)<<8|D[le+4])+5}V.programMapTable=b.programMapTable}},this.push=function(A){var D={},V=4;if(D.payloadUnitStartIndicator=!!(A[1]&64),D.pid=A[1]&31,D.pid<<=8,D.pid|=A[2],(A[3]&48)>>>4>1&&(V+=A[V]+1),D.pid===0)D.type="pat",p(A.subarray(V),D),this.trigger("data",D);else if(D.pid===this.pmtPid)for(D.type="pmt",p(A.subarray(V),D),this.trigger("data",D);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([A,V,D]):this.processPes_(A,V,D)},this.processPes_=function(A,D,V){V.pid===this.programMapTable.video?V.streamType=ri.H264_STREAM_TYPE:V.pid===this.programMapTable.audio?V.streamType=ri.ADTS_STREAM_TYPE:V.streamType=this.programMapTable["timed-metadata"][V.pid],V.type="pes",V.data=A.subarray(D),this.trigger("data",V)}},rn.prototype=new e,rn.STREAM_TYPES={h264:27,adts:15},Tn=function(){var p=this,T=!1,v={data:[],size:0},b={data:[],size:0},A={data:[],size:0},D,V=function(ee,le){var Ce,Re=ee[0]<<16|ee[1]<<8|ee[2];le.data=new Uint8Array,Re===1&&(le.packetLength=6+(ee[4]<<8|ee[5]),le.dataAlignmentIndicator=(ee[6]&4)!==0,Ce=ee[7],Ce&192&&(le.pts=(ee[9]&14)<<27|(ee[10]&255)<<20|(ee[11]&254)<<12|(ee[12]&255)<<5|(ee[13]&254)>>>3,le.pts*=4,le.pts+=(ee[13]&6)>>>1,le.dts=le.pts,Ce&64&&(le.dts=(ee[14]&14)<<27|(ee[15]&255)<<20|(ee[16]&254)<<12|(ee[17]&255)<<5|(ee[18]&254)>>>3,le.dts*=4,le.dts+=(ee[18]&6)>>>1)),le.data=ee.subarray(9+ee[8]))},X=function(ee,le,Ce){var Re=new Uint8Array(ee.size),Fe={type:le},Ie=0,Ye=0,Gt=!1,bi;if(!(!ee.data.length||ee.size<9)){for(Fe.trackId=ee.data[0].pid,Ie=0;Ie<ee.data.length;Ie++)bi=ee.data[Ie],Re.set(bi.data,Ye),Ye+=bi.data.byteLength;V(Re,Fe),Gt=le==="video"||Fe.packetLength<=ee.size,(Ce||Gt)&&(ee.size=0,ee.data.length=0),Gt&&p.trigger("data",Fe)}};Tn.prototype.init.call(this),this.push=function(se){({pat:function(){},pes:function(){var le,Ce;switch(se.streamType){case ri.H264_STREAM_TYPE:le=v,Ce="video";break;case ri.ADTS_STREAM_TYPE:le=b,Ce="audio";break;case ri.METADATA_STREAM_TYPE:le=A,Ce="timed-metadata";break;default:return}se.payloadUnitStartIndicator&&X(le,Ce,!0),le.data.push(se),le.size+=se.data.byteLength},pmt:function(){var le={type:"metadata",tracks:[]};D=se.programMapTable,D.video!==null&&le.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.video,codec:"avc",type:"video"}),D.audio!==null&&le.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.audio,codec:"adts",type:"audio"}),T=!0,p.trigger("data",le)}})[se.type]()},this.reset=function(){v.size=0,v.data.length=0,b.size=0,b.data.length=0,this.trigger("reset")},this.flushStreams_=function(){X(v,"video"),X(b,"audio"),X(A,"timed-metadata")},this.flush=function(){if(!T&&D){var se={type:"metadata",tracks:[]};D.video!==null&&se.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.video,codec:"avc",type:"video"}),D.audio!==null&&se.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.audio,codec:"adts",type:"audio"}),p.trigger("data",se)}T=!1,this.flushStreams_(),this.trigger("done")}},Tn.prototype=new e;var Fn={PAT_PID:0,MP2T_PACKET_LENGTH:Qi,TransportPacketStream:_n,TransportParseStream:rn,ElementaryStream:Tn,TimestampRolloverStream:Wl,CaptionStream:vn.CaptionStream,Cea608Stream:vn.Cea608Stream,Cea708Stream:vn.Cea708Stream,MetadataStream:po};for(var bn in ri)ri.hasOwnProperty(bn)&&(Fn[bn]=ri[bn]);var Br=Fn,mo=dt.ONE_SECOND_IN_TS,ta,go=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ta=function(p){var T,v=0;ta.prototype.init.call(this),this.skipWarn_=function(b,A){this.trigger("log",{level:"warn",message:"adts skiping bytes "+b+" to "+A+" in frame "+v+" outside syncword"})},this.push=function(b){var A=0,D,V,X,se,ee;if(p||(v=0),b.type==="audio"){T&&T.length?(X=T,T=new Uint8Array(X.byteLength+b.data.byteLength),T.set(X),T.set(b.data,X.byteLength)):T=b.data;for(var le;A+7<T.length;){if(T[A]!==255||(T[A+1]&246)!==240){typeof le!="number"&&(le=A),A++;continue}if(typeof le=="number"&&(this.skipWarn_(le,A),le=null),V=(~T[A+1]&1)*2,D=(T[A+3]&3)<<11|T[A+4]<<3|(T[A+5]&224)>>5,se=((T[A+6]&3)+1)*1024,ee=se*mo/go[(T[A+2]&60)>>>2],T.byteLength-A<D)break;this.trigger("data",{pts:b.pts+v*ee,dts:b.dts+v*ee,sampleCount:se,audioobjecttype:(T[A+2]>>>6&3)+1,channelcount:(T[A+2]&1)<<2|(T[A+3]&192)>>>6,samplerate:go[(T[A+2]&60)>>>2],samplingfrequencyindex:(T[A+2]&60)>>>2,samplesize:16,data:T.subarray(A+7+V,A+D)}),v++,A+=D}typeof le=="number"&&(this.skipWarn_(le,A),le=null),T=T.subarray(A)}},this.flush=function(){v=0,this.trigger("done")},this.reset=function(){T=void 0,this.trigger("reset")},this.endTimeline=function(){T=void 0,this.trigger("endedtimeline")}},ta.prototype=new e;var Ur=ta,ks;ks=function(p){var T=p.byteLength,v=0,b=0;this.length=function(){return 8*T},this.bitsAvailable=function(){return 8*T+b},this.loadWord=function(){var A=p.byteLength-T,D=new Uint8Array(4),V=Math.min(4,T);if(V===0)throw new Error("no bytes available");D.set(p.subarray(A,A+V)),v=new DataView(D.buffer).getUint32(0),b=V*8,T-=V},this.skipBits=function(A){var D;b>A?(v<<=A,b-=A):(A-=b,D=Math.floor(A/8),A-=D*8,T-=D,this.loadWord(),v<<=A,b-=A)},this.readBits=function(A){var D=Math.min(b,A),V=v>>>32-D;return b-=D,b>0?v<<=D:T>0&&this.loadWord(),D=A-D,D>0?V<<D|this.readBits(D):V},this.skipLeadingZeros=function(){var A;for(A=0;A<b;++A)if((v&2147483648>>>A)!==0)return v<<=A,b-=A,A;return this.loadWord(),A+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var A=this.skipLeadingZeros();return this.readBits(A+1)-1},this.readExpGolomb=function(){var A=this.readUnsignedExpGolomb();return 1&A?1+A>>>1:-1*(A>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Gl=ks,$n,jn,zi;jn=function(){var p=0,T,v;jn.prototype.init.call(this),this.push=function(b){var A;v?(A=new Uint8Array(v.byteLength+b.data.byteLength),A.set(v),A.set(b.data,v.byteLength),v=A):v=b.data;for(var D=v.byteLength;p<D-3;p++)if(v[p+2]===1){T=p+5;break}for(;T<D;)switch(v[T]){case 0:if(v[T-1]!==0){T+=2;break}else if(v[T-2]!==0){T++;break}p+3!==T-2&&this.trigger("data",v.subarray(p+3,T-2));do T++;while(v[T]!==1&&T<D);p=T-2,T+=3;break;case 1:if(v[T-1]!==0||v[T-2]!==0){T+=3;break}this.trigger("data",v.subarray(p+3,T-2)),p=T-2,T+=3;break;default:T+=3;break}v=v.subarray(p),T-=p,p=0},this.reset=function(){v=null,p=0,this.trigger("reset")},this.flush=function(){v&&v.byteLength>3&&this.trigger("data",v.subarray(p+3)),v=null,p=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},jn.prototype=new e,zi={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$n=function(){var p=new jn,T,v,b,A,D,V,X;$n.prototype.init.call(this),T=this,this.push=function(se){se.type==="video"&&(v=se.trackId,b=se.pts,A=se.dts,p.push(se))},p.on("data",function(se){var ee={trackId:v,pts:b,dts:A,data:se,nalUnitTypeCode:se[0]&31};switch(ee.nalUnitTypeCode){case 5:ee.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:ee.nalUnitType="sei_rbsp",ee.escapedRBSP=D(se.subarray(1));break;case 7:ee.nalUnitType="seq_parameter_set_rbsp",ee.escapedRBSP=D(se.subarray(1)),ee.config=V(ee.escapedRBSP);break;case 8:ee.nalUnitType="pic_parameter_set_rbsp";break;case 9:ee.nalUnitType="access_unit_delimiter_rbsp";break}T.trigger("data",ee)}),p.on("done",function(){T.trigger("done")}),p.on("partialdone",function(){T.trigger("partialdone")}),p.on("reset",function(){T.trigger("reset")}),p.on("endedtimeline",function(){T.trigger("endedtimeline")}),this.flush=function(){p.flush()},this.partialFlush=function(){p.partialFlush()},this.reset=function(){p.reset()},this.endTimeline=function(){p.endTimeline()},X=function(ee,le){var Ce=8,Re=8,Fe,Ie;for(Fe=0;Fe<ee;Fe++)Re!==0&&(Ie=le.readExpGolomb(),Re=(Ce+Ie+256)%256),Ce=Re===0?Ce:Re},D=function(ee){for(var le=ee.byteLength,Ce=[],Re=1,Fe,Ie;Re<le-2;)ee[Re]===0&&ee[Re+1]===0&&ee[Re+2]===3?(Ce.push(Re+2),Re+=2):Re++;if(Ce.length===0)return ee;Fe=le-Ce.length,Ie=new Uint8Array(Fe);var Ye=0;for(Re=0;Re<Fe;Ye++,Re++)Ye===Ce[0]&&(Ye++,Ce.shift()),Ie[Re]=ee[Ye];return Ie},V=function(ee){var le=0,Ce=0,Re=0,Fe=0,Ie,Ye,Gt,bi,ar,Fa,w,I,U,J,ue,oe=[1,1],ae,fe;if(Ie=new Gl(ee),Ye=Ie.readUnsignedByte(),bi=Ie.readUnsignedByte(),Gt=Ie.readUnsignedByte(),Ie.skipUnsignedExpGolomb(),zi[Ye]&&(ar=Ie.readUnsignedExpGolomb(),ar===3&&Ie.skipBits(1),Ie.skipUnsignedExpGolomb(),Ie.skipUnsignedExpGolomb(),Ie.skipBits(1),Ie.readBoolean()))for(ue=ar!==3?8:12,fe=0;fe<ue;fe++)Ie.readBoolean()&&(fe<6?X(16,Ie):X(64,Ie));if(Ie.skipUnsignedExpGolomb(),Fa=Ie.readUnsignedExpGolomb(),Fa===0)Ie.readUnsignedExpGolomb();else if(Fa===1)for(Ie.skipBits(1),Ie.skipExpGolomb(),Ie.skipExpGolomb(),w=Ie.readUnsignedExpGolomb(),fe=0;fe<w;fe++)Ie.skipExpGolomb();if(Ie.skipUnsignedExpGolomb(),Ie.skipBits(1),I=Ie.readUnsignedExpGolomb(),U=Ie.readUnsignedExpGolomb(),J=Ie.readBits(1),J===0&&Ie.skipBits(1),Ie.skipBits(1),Ie.readBoolean()&&(le=Ie.readUnsignedExpGolomb(),Ce=Ie.readUnsignedExpGolomb(),Re=Ie.readUnsignedExpGolomb(),Fe=Ie.readUnsignedExpGolomb()),Ie.readBoolean()&&Ie.readBoolean()){switch(ae=Ie.readUnsignedByte(),ae){case 1:oe=[1,1];break;case 2:oe=[12,11];break;case 3:oe=[10,11];break;case 4:oe=[16,11];break;case 5:oe=[40,33];break;case 6:oe=[24,11];break;case 7:oe=[20,11];break;case 8:oe=[32,11];break;case 9:oe=[80,33];break;case 10:oe=[18,11];break;case 11:oe=[15,11];break;case 12:oe=[64,33];break;case 13:oe=[160,99];break;case 14:oe=[4,3];break;case 15:oe=[3,2];break;case 16:oe=[2,1];break;case 255:{oe=[Ie.readUnsignedByte()<<8|Ie.readUnsignedByte(),Ie.readUnsignedByte()<<8|Ie.readUnsignedByte()];break}}oe&&oe[0]/oe[1]}return{profileIdc:Ye,levelIdc:Gt,profileCompatibility:bi,width:(I+1)*16-le*2-Ce*2,height:(2-J)*(U+1)*16-Re*2-Fe*2,sarRatio:oe}}},$n.prototype=new e;var Kl={H264Stream:$n},ia=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Hn=function(p,T){var v=p[T+6]<<21|p[T+7]<<14|p[T+8]<<7|p[T+9],b=p[T+5],A=(b&16)>>4;return v=v>=0?v:0,A?v+20:v+10},ra=function M(p,T){return p.length-T<10||p[T]!==73||p[T+1]!==68||p[T+2]!==51?T:(T+=Hn(p,T),M(p,T))},Vn=function(p){var T=ra(p,0);return p.length>=T+2&&(p[T]&255)===255&&(p[T+1]&240)===240&&(p[T+1]&22)===16},na=function(p){return p[0]<<21|p[1]<<14|p[2]<<7|p[3]},vo=function(p,T,v){var b,A="";for(b=T;b<v;b++)A+="%"+("00"+p[b].toString(16)).slice(-2);return A},Ia=function(p,T,v){return unescape(vo(p,T,v))},yo=function(p,T){var v=(p[T+5]&224)>>5,b=p[T+4]<<3,A=p[T+3]&6144;return A|b|v},Xl=function(p,T){return p[T]===73&&p[T+1]===68&&p[T+2]===51?"timed-metadata":p[T]&!0&&(p[T+1]&240)===240?"audio":null},Yl=function(p){for(var T=0;T+5<p.length;){if(p[T]!==255||(p[T+1]&246)!==240){T++;continue}return ia[(p[T+2]&60)>>>2]}return null},sa=function(p){var T,v,b,A;T=10,p[5]&64&&(T+=4,T+=na(p.subarray(10,14)));do{if(v=na(p.subarray(T+4,T+8)),v<1)return null;if(A=String.fromCharCode(p[T],p[T+1],p[T+2],p[T+3]),A==="PRIV"){b=p.subarray(T+10,T+v+10);for(var D=0;D<b.byteLength;D++)if(b[D]===0){var V=Ia(b,0,D);if(V==="com.apple.streaming.transportStreamTimestamp"){var X=b.subarray(D+1),se=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;return se*=4,se+=X[7]&3,se}break}}T+=10,T+=v}while(T<p.byteLength);return null},As={isLikelyAacData:Vn,parseId3TagSize:Hn,parseAdtsSize:yo,parseType:Xl,parseSampleRate:Yl,parseAacTimestamp:sa},aa;aa=function(){var p=new Uint8Array,T=0;aa.prototype.init.call(this),this.setTimestamp=function(v){T=v},this.push=function(v){var b=0,A=0,D,V,X,se;for(p.length?(se=p.length,p=new Uint8Array(v.byteLength+se),p.set(p.subarray(0,se)),p.set(v,se)):p=v;p.length-A>=3;){if(p[A]===73&&p[A+1]===68&&p[A+2]===51){if(p.length-A<10||(b=As.parseId3TagSize(p,A),A+b>p.length))break;V={type:"timed-metadata",data:p.subarray(A,A+b)},this.trigger("data",V),A+=b;continue}else if((p[A]&255)===255&&(p[A+1]&240)===240){if(p.length-A<7||(b=As.parseAdtsSize(p,A),A+b>p.length))break;X={type:"audio",data:p.subarray(A,A+b),pts:T,dts:T},this.trigger("data",X),A+=b;continue}A++}D=p.length-A,D>0?p=p.subarray(A):p=new Uint8Array},this.reset=function(){p=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){p=new Uint8Array,this.trigger("endedtimeline")}},aa.prototype=new e;var _o=aa,qn=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Pa=qn,Ql=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],xs=Ql,oa=Kl.H264Stream,To=As.isLikelyAacData,Jl=dt.ONE_SECOND_IN_TS,la,zn,Wn,sn,La=function(p,T){T.stream=p,this.trigger("log",T)},Ns=function(p,T){for(var v=Object.keys(T),b=0;b<v.length;b++){var A=v[b];A==="headOfPipeline"||!T[A].on||T[A].on("log",La.bind(p,A))}},bo=function(p,T){var v;if(p.length!==T.length)return!1;for(v=0;v<p.length;v++)if(p[v]!==T[v])return!1;return!0},Oa=function(p,T,v,b,A,D){var V=v-T,X=b-T,se=A-v;return{start:{dts:p,pts:p+V},end:{dts:p+X,pts:p+se},prependedContentDuration:D,baseMediaDecodeTime:p}};zn=function(p,T){var v=[],b,A=0,D=0,V=1/0;T=T||{},b=T.firstSequenceNumber||0,zn.prototype.init.call(this),this.push=function(X){R.collectDtsInfo(p,X),p&&Pa.forEach(function(se){p[se]=X[se]}),v.push(X)},this.setEarliestDts=function(X){A=X},this.setVideoBaseMediaDecodeTime=function(X){V=X},this.setAudioAppendStart=function(X){D=X},this.flush=function(){var X,se,ee,le,Ce,Re,Fe;if(v.length===0){this.trigger("done","AudioSegmentStream");return}X=Zr.trimAdtsFramesByEarliestDts(v,p,A),p.baseMediaDecodeTime=R.calculateTrackBaseMediaDecodeTime(p,T.keepOriginalTimestamps),Fe=Zr.prefixWithSilence(p,X,D,V),p.samples=Zr.generateSampleTable(X),ee=xt.mdat(Zr.concatenateFrameData(X)),v=[],se=xt.moof(b,[p]),le=new Uint8Array(se.byteLength+ee.byteLength),b++,le.set(se),le.set(ee,se.byteLength),R.clearDtsInfo(p),Ce=Math.ceil(Jl*1024/p.samplerate),X.length&&(Re=X.length*Ce,this.trigger("segmentTimingInfo",Oa(dt.audioTsToVideoTs(p.baseMediaDecodeTime,p.samplerate),X[0].dts,X[0].pts,X[0].dts+Re,X[0].pts+Re,Fe||0)),this.trigger("timingInfo",{start:X[0].pts,end:X[0].pts+Re})),this.trigger("data",{track:p,boxes:le}),this.trigger("done","AudioSegmentStream")},this.reset=function(){R.clearDtsInfo(p),v=[],this.trigger("reset")}},zn.prototype=new e,la=function(p,T){var v,b=[],A=[],D,V;T=T||{},v=T.firstSequenceNumber||0,la.prototype.init.call(this),delete p.minPTS,this.gopCache_=[],this.push=function(X){R.collectDtsInfo(p,X),X.nalUnitType==="seq_parameter_set_rbsp"&&!D&&(D=X.config,p.sps=[X.data],xs.forEach(function(se){p[se]=D[se]},this)),X.nalUnitType==="pic_parameter_set_rbsp"&&!V&&(V=X.data,p.pps=[X.data]),b.push(X)},this.flush=function(){for(var X,se,ee,le,Ce,Re,Fe=0,Ie,Ye;b.length&&b[0].nalUnitType!=="access_unit_delimiter_rbsp";)b.shift();if(b.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(X=Ut.groupNalsIntoFrames(b),ee=Ut.groupFramesIntoGops(X),ee[0][0].keyFrame||(se=this.getGopForFusion_(b[0],p),se?(Fe=se.duration,ee.unshift(se),ee.byteLength+=se.byteLength,ee.nalCount+=se.nalCount,ee.pts=se.pts,ee.dts=se.dts,ee.duration+=se.duration):ee=Ut.extendFirstKeyFrame(ee)),A.length){var Gt;if(T.alignGopsAtEnd?Gt=this.alignGopsAtEnd_(ee):Gt=this.alignGopsAtStart_(ee),!Gt){this.gopCache_.unshift({gop:ee.pop(),pps:p.pps,sps:p.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),b=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}R.clearDtsInfo(p),ee=Gt}R.collectDtsInfo(p,ee),p.samples=Ut.generateSampleTable(ee),Ce=xt.mdat(Ut.concatenateNalData(ee)),p.baseMediaDecodeTime=R.calculateTrackBaseMediaDecodeTime(p,T.keepOriginalTimestamps),this.trigger("processedGopsInfo",ee.map(function(bi){return{pts:bi.pts,dts:bi.dts,byteLength:bi.byteLength}})),Ie=ee[0],Ye=ee[ee.length-1],this.trigger("segmentTimingInfo",Oa(p.baseMediaDecodeTime,Ie.dts,Ie.pts,Ye.dts+Ye.duration,Ye.pts+Ye.duration,Fe)),this.trigger("timingInfo",{start:ee[0].pts,end:ee[ee.length-1].pts+ee[ee.length-1].duration}),this.gopCache_.unshift({gop:ee.pop(),pps:p.pps,sps:p.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),b=[],this.trigger("baseMediaDecodeTime",p.baseMediaDecodeTime),this.trigger("timelineStartInfo",p.timelineStartInfo),le=xt.moof(v,[p]),Re=new Uint8Array(le.byteLength+Ce.byteLength),v++,Re.set(le),Re.set(Ce,le.byteLength),this.trigger("data",{track:p,boxes:Re}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),b=[],this.gopCache_.length=0,A.length=0,this.trigger("reset")},this.resetStream_=function(){R.clearDtsInfo(p),D=void 0,V=void 0},this.getGopForFusion_=function(X){var se=45e3,ee=1/0,le,Ce,Re,Fe,Ie;for(Ie=0;Ie<this.gopCache_.length;Ie++)Fe=this.gopCache_[Ie],Re=Fe.gop,!(!(p.pps&&bo(p.pps[0],Fe.pps[0]))||!(p.sps&&bo(p.sps[0],Fe.sps[0])))&&(Re.dts<p.timelineStartInfo.dts||(le=X.dts-Re.dts-Re.duration,le>=-1e4&&le<=se&&(!Ce||ee>le)&&(Ce=Fe,ee=le)));return Ce?Ce.gop:null},this.alignGopsAtStart_=function(X){var se,ee,le,Ce,Re,Fe,Ie,Ye;for(Re=X.byteLength,Fe=X.nalCount,Ie=X.duration,se=ee=0;se<A.length&&ee<X.length&&(le=A[se],Ce=X[ee],le.pts!==Ce.pts);){if(Ce.pts>le.pts){se++;continue}ee++,Re-=Ce.byteLength,Fe-=Ce.nalCount,Ie-=Ce.duration}return ee===0?X:ee===X.length?null:(Ye=X.slice(ee),Ye.byteLength=Re,Ye.duration=Ie,Ye.nalCount=Fe,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye)},this.alignGopsAtEnd_=function(X){var se,ee,le,Ce,Re,Fe;for(se=A.length-1,ee=X.length-1,Re=null,Fe=!1;se>=0&&ee>=0;){if(le=A[se],Ce=X[ee],le.pts===Ce.pts){Fe=!0;break}if(le.pts>Ce.pts){se--;continue}se===A.length-1&&(Re=ee),ee--}if(!Fe&&Re===null)return null;var Ie;if(Fe?Ie=ee:Ie=Re,Ie===0)return X;var Ye=X.slice(Ie),Gt=Ye.reduce(function(bi,ar){return bi.byteLength+=ar.byteLength,bi.duration+=ar.duration,bi.nalCount+=ar.nalCount,bi},{byteLength:0,duration:0,nalCount:0});return Ye.byteLength=Gt.byteLength,Ye.duration=Gt.duration,Ye.nalCount=Gt.nalCount,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye},this.alignGopsWith=function(X){A=X}},la.prototype=new e,sn=function(p,T){this.numberOfTracks=0,this.metadataStream=T,p=p||{},typeof p.remux<"u"?this.remuxTracks=!!p.remux:this.remuxTracks=!0,typeof p.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=p.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,sn.prototype.init.call(this),this.push=function(v){if(v.text)return this.pendingCaptions.push(v);if(v.frames)return this.pendingMetadata.push(v);this.pendingTracks.push(v.track),this.pendingBytes+=v.boxes.byteLength,v.track.type==="video"&&(this.videoTrack=v.track,this.pendingBoxes.push(v.boxes)),v.track.type==="audio"&&(this.audioTrack=v.track,this.pendingBoxes.unshift(v.boxes))}},sn.prototype=new e,sn.prototype.flush=function(M){var p=0,T={captions:[],captionStreams:{},metadata:[],info:{}},v,b,A,D=0,V;if(this.pendingTracks.length<this.numberOfTracks){if(M!=="VideoSegmentStream"&&M!=="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?(D=this.videoTrack.timelineStartInfo.pts,xs.forEach(function(X){T.info[X]=this.videoTrack[X]},this)):this.audioTrack&&(D=this.audioTrack.timelineStartInfo.pts,Pa.forEach(function(X){T.info[X]=this.audioTrack[X]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?T.type=this.pendingTracks[0].type:T.type="combined",this.emittedTracks+=this.pendingTracks.length,A=xt.initSegment(this.pendingTracks),T.initSegment=new Uint8Array(A.byteLength),T.initSegment.set(A),T.data=new Uint8Array(this.pendingBytes),V=0;V<this.pendingBoxes.length;V++)T.data.set(this.pendingBoxes[V],p),p+=this.pendingBoxes[V].byteLength;for(V=0;V<this.pendingCaptions.length;V++)v=this.pendingCaptions[V],v.startTime=dt.metadataTsToSeconds(v.startPts,D,this.keepOriginalTimestamps),v.endTime=dt.metadataTsToSeconds(v.endPts,D,this.keepOriginalTimestamps),T.captionStreams[v.stream]=!0,T.captions.push(v);for(V=0;V<this.pendingMetadata.length;V++)b=this.pendingMetadata[V],b.cueTime=dt.metadataTsToSeconds(b.pts,D,this.keepOriginalTimestamps),T.metadata.push(b);for(T.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",T),V=0;V<T.captions.length;V++)v=T.captions[V],this.trigger("caption",v);for(V=0;V<T.metadata.length;V++)b=T.metadata[V],this.trigger("id3Frame",b)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},sn.prototype.setRemux=function(M){this.remuxTracks=M},Wn=function(p){var T=this,v=!0,b,A;Wn.prototype.init.call(this),p=p||{},this.baseMediaDecodeTime=p.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var D={};this.transmuxPipeline_=D,D.type="aac",D.metadataStream=new Br.MetadataStream,D.aacStream=new _o,D.audioTimestampRolloverStream=new Br.TimestampRolloverStream("audio"),D.timedMetadataTimestampRolloverStream=new Br.TimestampRolloverStream("timed-metadata"),D.adtsStream=new Ur,D.coalesceStream=new sn(p,D.metadataStream),D.headOfPipeline=D.aacStream,D.aacStream.pipe(D.audioTimestampRolloverStream).pipe(D.adtsStream),D.aacStream.pipe(D.timedMetadataTimestampRolloverStream).pipe(D.metadataStream).pipe(D.coalesceStream),D.metadataStream.on("timestamp",function(V){D.aacStream.setTimestamp(V.timeStamp)}),D.aacStream.on("data",function(V){V.type!=="timed-metadata"&&V.type!=="audio"||D.audioSegmentStream||(A=A||{timelineStartInfo:{baseMediaDecodeTime:T.baseMediaDecodeTime},codec:"adts",type:"audio"},D.coalesceStream.numberOfTracks++,D.audioSegmentStream=new zn(A,p),D.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),D.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),D.adtsStream.pipe(D.audioSegmentStream).pipe(D.coalesceStream),T.trigger("trackinfo",{hasAudio:!!A,hasVideo:!!b}))}),D.coalesceStream.on("data",this.trigger.bind(this,"data")),D.coalesceStream.on("done",this.trigger.bind(this,"done")),Ns(this,D)},this.setupTsPipeline=function(){var D={};this.transmuxPipeline_=D,D.type="ts",D.metadataStream=new Br.MetadataStream,D.packetStream=new Br.TransportPacketStream,D.parseStream=new Br.TransportParseStream,D.elementaryStream=new Br.ElementaryStream,D.timestampRolloverStream=new Br.TimestampRolloverStream,D.adtsStream=new Ur,D.h264Stream=new oa,D.captionStream=new Br.CaptionStream(p),D.coalesceStream=new sn(p,D.metadataStream),D.headOfPipeline=D.packetStream,D.packetStream.pipe(D.parseStream).pipe(D.elementaryStream).pipe(D.timestampRolloverStream),D.timestampRolloverStream.pipe(D.h264Stream),D.timestampRolloverStream.pipe(D.adtsStream),D.timestampRolloverStream.pipe(D.metadataStream).pipe(D.coalesceStream),D.h264Stream.pipe(D.captionStream).pipe(D.coalesceStream),D.elementaryStream.on("data",function(V){var X;if(V.type==="metadata"){for(X=V.tracks.length;X--;)!b&&V.tracks[X].type==="video"?(b=V.tracks[X],b.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime):!A&&V.tracks[X].type==="audio"&&(A=V.tracks[X],A.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime);b&&!D.videoSegmentStream&&(D.coalesceStream.numberOfTracks++,D.videoSegmentStream=new la(b,p),D.videoSegmentStream.on("log",T.getLogTrigger_("videoSegmentStream")),D.videoSegmentStream.on("timelineStartInfo",function(se){A&&!p.keepOriginalTimestamps&&(A.timelineStartInfo=se,D.audioSegmentStream.setEarliestDts(se.dts-T.baseMediaDecodeTime))}),D.videoSegmentStream.on("processedGopsInfo",T.trigger.bind(T,"gopInfo")),D.videoSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"videoSegmentTimingInfo")),D.videoSegmentStream.on("baseMediaDecodeTime",function(se){A&&D.audioSegmentStream.setVideoBaseMediaDecodeTime(se)}),D.videoSegmentStream.on("timingInfo",T.trigger.bind(T,"videoTimingInfo")),D.h264Stream.pipe(D.videoSegmentStream).pipe(D.coalesceStream)),A&&!D.audioSegmentStream&&(D.coalesceStream.numberOfTracks++,D.audioSegmentStream=new zn(A,p),D.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),D.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),D.audioSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"audioSegmentTimingInfo")),D.adtsStream.pipe(D.audioSegmentStream).pipe(D.coalesceStream)),T.trigger("trackinfo",{hasAudio:!!A,hasVideo:!!b})}}),D.coalesceStream.on("data",this.trigger.bind(this,"data")),D.coalesceStream.on("id3Frame",function(V){V.dispatchType=D.metadataStream.dispatchType,T.trigger("id3Frame",V)}),D.coalesceStream.on("caption",this.trigger.bind(this,"caption")),D.coalesceStream.on("done",this.trigger.bind(this,"done")),Ns(this,D)},this.setBaseMediaDecodeTime=function(D){var V=this.transmuxPipeline_;p.keepOriginalTimestamps||(this.baseMediaDecodeTime=D),A&&(A.timelineStartInfo.dts=void 0,A.timelineStartInfo.pts=void 0,R.clearDtsInfo(A),V.audioTimestampRolloverStream&&V.audioTimestampRolloverStream.discontinuity()),b&&(V.videoSegmentStream&&(V.videoSegmentStream.gopCache_=[]),b.timelineStartInfo.dts=void 0,b.timelineStartInfo.pts=void 0,R.clearDtsInfo(b),V.captionStream.reset()),V.timestampRolloverStream&&V.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(D){A&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(D)},this.setRemux=function(D){var V=this.transmuxPipeline_;p.remux=D,V&&V.coalesceStream&&V.coalesceStream.setRemux(D)},this.alignGopsWith=function(D){b&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(D)},this.getLogTrigger_=function(D){var V=this;return function(X){X.stream=D,V.trigger("log",X)}},this.push=function(D){if(v){var V=To(D);V&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!V&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),v=!1}this.transmuxPipeline_.headOfPipeline.push(D)},this.flush=function(){v=!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()}},Wn.prototype=new e;var Zl={Transmuxer:Wn},eu=function(p){return p>>>0},tu=function(p){return("00"+p.toString(16)).slice(-2)},Gn={toUnsigned:eu,toHexString:tu},iu=function(p){var T="";return T+=String.fromCharCode(p[0]),T+=String.fromCharCode(p[1]),T+=String.fromCharCode(p[2]),T+=String.fromCharCode(p[3]),T},an=iu,ua=Gn.toUnsigned,ru=function M(p,T){var v=[],b,A,D,V,X;if(!T.length)return null;for(b=0;b<p.byteLength;)A=ua(p[b]<<24|p[b+1]<<16|p[b+2]<<8|p[b+3]),D=an(p.subarray(b+4,b+8)),V=A>1?b+A:p.byteLength,D===T[0]&&(T.length===1?v.push(p.subarray(b+8,V)):(X=M(p.subarray(b+8,V),T.slice(1)),X.length&&(v=v.concat(X)))),b=V;return v},Mt=ru,nu=Gn.toUnsigned,Ma=i.getUint64,Oi=function(p){var T={version:p[0],flags:new Uint8Array(p.subarray(1,4))};return T.version===1?T.baseMediaDecodeTime=Ma(p.subarray(4)):T.baseMediaDecodeTime=nu(p[4]<<24|p[5]<<16|p[6]<<8|p[7]),T},Kn=Oi,Xn=function(p){return{isLeading:(p[0]&12)>>>2,dependsOn:p[0]&3,isDependedOn:(p[1]&192)>>>6,hasRedundancy:(p[1]&48)>>>4,paddingValue:(p[1]&14)>>>1,isNonSyncSample:p[1]&1,degradationPriority:p[2]<<8|p[3]}},Sn=Xn,ca=function(p){var T={version:p[0],flags:new Uint8Array(p.subarray(1,4)),samples:[]},v=new DataView(p.buffer,p.byteOffset,p.byteLength),b=T.flags[2]&1,A=T.flags[2]&4,D=T.flags[1]&1,V=T.flags[1]&2,X=T.flags[1]&4,se=T.flags[1]&8,ee=v.getUint32(4),le=8,Ce;for(b&&(T.dataOffset=v.getInt32(le),le+=4),A&&ee&&(Ce={flags:Sn(p.subarray(le,le+4))},le+=4,D&&(Ce.duration=v.getUint32(le),le+=4),V&&(Ce.size=v.getUint32(le),le+=4),se&&(T.version===1?Ce.compositionTimeOffset=v.getInt32(le):Ce.compositionTimeOffset=v.getUint32(le),le+=4),T.samples.push(Ce),ee--);ee--;)Ce={},D&&(Ce.duration=v.getUint32(le),le+=4),V&&(Ce.size=v.getUint32(le),le+=4),X&&(Ce.flags=Sn(p.subarray(le,le+4)),le+=4),se&&(T.version===1?Ce.compositionTimeOffset=v.getInt32(le):Ce.compositionTimeOffset=v.getUint32(le),le+=4),T.samples.push(Ce);return T},Mi=ca,Ri=function(p){var T=new DataView(p.buffer,p.byteOffset,p.byteLength),v={version:p[0],flags:new Uint8Array(p.subarray(1,4)),trackId:T.getUint32(4)},b=v.flags[2]&1,A=v.flags[2]&2,D=v.flags[2]&8,V=v.flags[2]&16,X=v.flags[2]&32,se=v.flags[0]&65536,ee=v.flags[0]&131072,le;return le=8,b&&(le+=4,v.baseDataOffset=T.getUint32(12),le+=4),A&&(v.sampleDescriptionIndex=T.getUint32(le),le+=4),D&&(v.defaultSampleDuration=T.getUint32(le),le+=4),V&&(v.defaultSampleSize=T.getUint32(le),le+=4),X&&(v.defaultSampleFlags=T.getUint32(le)),se&&(v.durationIsEmpty=!0),!b&&ee&&(v.baseDataOffsetIsMoof=!0),v},Ds=Ri,Ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},Fr;typeof window<"u"?Fr=window:typeof Ra<"u"?Fr=Ra:typeof self<"u"?Fr=self:Fr={};var Yn=Fr,su=Wt.discardEmulationPreventionBytes,au=vn.CaptionStream,So=function(p,T){for(var v=p,b=0;b<T.length;b++){var A=T[b];if(v<A.size)return A;v-=A.size}return null},Co=function(p,T,v){var b=new DataView(p.buffer,p.byteOffset,p.byteLength),A={logs:[],seiNals:[]},D,V,X,se;for(V=0;V+4<p.length;V+=X)if(X=b.getUint32(V),V+=4,!(X<=0))switch(p[V]&31){case 6:var ee=p.subarray(V+1,V+1+X),le=So(V,T);if(D={nalUnitType:"sei_rbsp",size:X,data:ee,escapedRBSP:su(ee),trackId:v},le)D.pts=le.pts,D.dts=le.dts,se=le;else if(se)D.pts=se.pts,D.dts=se.dts;else{A.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+V+" for trackId "+v+". See mux.js#223."});break}A.seiNals.push(D);break}return A},ha=function(p,T,v){var b=T,A=v.defaultSampleDuration||0,D=v.defaultSampleSize||0,V=v.trackId,X=[];return p.forEach(function(se){var ee=Mi(se),le=ee.samples;le.forEach(function(Ce){Ce.duration===void 0&&(Ce.duration=A),Ce.size===void 0&&(Ce.size=D),Ce.trackId=V,Ce.dts=b,Ce.compositionTimeOffset===void 0&&(Ce.compositionTimeOffset=0),typeof b=="bigint"?(Ce.pts=b+Yn.BigInt(Ce.compositionTimeOffset),b+=Yn.BigInt(Ce.duration)):(Ce.pts=b+Ce.compositionTimeOffset,b+=Ce.duration)}),X=X.concat(le)}),X},Is=function(p,T){var v=Mt(p,["moof","traf"]),b=Mt(p,["mdat"]),A={},D=[];return b.forEach(function(V,X){var se=v[X];D.push({mdat:V,traf:se})}),D.forEach(function(V){var X=V.mdat,se=V.traf,ee=Mt(se,["tfhd"]),le=Ds(ee[0]),Ce=le.trackId,Re=Mt(se,["tfdt"]),Fe=Re.length>0?Kn(Re[0]).baseMediaDecodeTime:0,Ie=Mt(se,["trun"]),Ye,Gt;T===Ce&&Ie.length>0&&(Ye=ha(Ie,Fe,le),Gt=Co(X,Ye,Ce),A[Ce]||(A[Ce]={seiNals:[],logs:[]}),A[Ce].seiNals=A[Ce].seiNals.concat(Gt.seiNals),A[Ce].logs=A[Ce].logs.concat(Gt.logs))}),A},Qn=function(p,T,v){var b;if(T===null)return null;b=Is(p,T);var A=b[T]||{};return{seiNals:A.seiNals,logs:A.logs,timescale:v}},$r=function(){var p=!1,T,v,b,A,D,V;this.isInitialized=function(){return p},this.init=function(X){T=new au,p=!0,V=X?X.isPartial:!1,T.on("data",function(se){se.startTime=se.startPts/A,se.endTime=se.endPts/A,D.captions.push(se),D.captionStreams[se.stream]=!0}),T.on("log",function(se){D.logs.push(se)})},this.isNewInit=function(X,se){return X&&X.length===0||se&&typeof se=="object"&&Object.keys(se).length===0?!1:b!==X[0]||A!==se[b]},this.parse=function(X,se,ee){var le;if(this.isInitialized()){if(!se||!ee)return null;if(this.isNewInit(se,ee))b=se[0],A=ee[b];else if(b===null||!A)return v.push(X),null}else return null;for(;v.length>0;){var Ce=v.shift();this.parse(Ce,se,ee)}return le=Qn(X,b,A),le&&le.logs&&(D.logs=D.logs.concat(le.logs)),le===null||!le.seiNals?D.logs.length?{logs:D.logs,captions:[],captionStreams:[]}:null:(this.pushNals(le.seiNals),this.flushStream(),D)},this.pushNals=function(X){if(!this.isInitialized()||!X||X.length===0)return null;X.forEach(function(se){T.push(se)})},this.flushStream=function(){if(!this.isInitialized())return null;V?T.partialFlush():T.flush()},this.clearParsedCaptions=function(){D.captions=[],D.captionStreams={},D.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;T.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){v=[],b=null,A=null,D?this.clearParsedCaptions():D={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ba=$r,Jn=Gn.toUnsigned,Cn=Gn.toHexString,Eo=i.getUint64,wo,ko,En,Ps,Ls,da;wo=function(p){var T={},v=Mt(p,["moov","trak"]);return v.reduce(function(b,A){var D,V,X,se,ee;return D=Mt(A,["tkhd"])[0],!D||(V=D[0],X=V===0?12:20,se=Jn(D[X]<<24|D[X+1]<<16|D[X+2]<<8|D[X+3]),ee=Mt(A,["mdia","mdhd"])[0],!ee)?null:(V=ee[0],X=V===0?12:20,b[se]=Jn(ee[X]<<24|ee[X+1]<<16|ee[X+2]<<8|ee[X+3]),b)},T)},ko=function(p,T){var v;v=Mt(T,["moof","traf"]);var b=v.reduce(function(A,D){var V=Mt(D,["tfhd"])[0],X=Jn(V[4]<<24|V[5]<<16|V[6]<<8|V[7]),se=p[X]||9e4,ee=Mt(D,["tfdt"])[0],le=new DataView(ee.buffer,ee.byteOffset,ee.byteLength),Ce;ee[0]===1?Ce=Eo(ee.subarray(4,12)):Ce=le.getUint32(4);var Re;return typeof Ce=="bigint"?Re=Ce/Yn.BigInt(se):typeof Ce=="number"&&!isNaN(Ce)&&(Re=Ce/se),Re<Number.MAX_SAFE_INTEGER&&(Re=Number(Re)),Re<A&&(A=Re),A},1/0);return typeof b=="bigint"||isFinite(b)?b:0},En=function(p,T){var v=Mt(T,["moof","traf"]),b=0,A=0,D;if(v&&v.length){var V=Mt(v[0],["tfhd"])[0],X=Mt(v[0],["trun"])[0],se=Mt(v[0],["tfdt"])[0];if(V){var ee=Ds(V);D=ee.trackId}if(se){var le=Kn(se);b=le.baseMediaDecodeTime}if(X){var Ce=Mi(X);Ce.samples&&Ce.samples.length&&(A=Ce.samples[0].compositionTimeOffset||0)}}var Re=p[D]||9e4;typeof b=="bigint"&&(A=Yn.BigInt(A),Re=Yn.BigInt(Re));var Fe=(b+A)/Re;return typeof Fe=="bigint"&&Fe<Number.MAX_SAFE_INTEGER&&(Fe=Number(Fe)),Fe},Ps=function(p){var T=Mt(p,["moov","trak"]),v=[];return T.forEach(function(b){var A=Mt(b,["mdia","hdlr"]),D=Mt(b,["tkhd"]);A.forEach(function(V,X){var se=an(V.subarray(8,12)),ee=D[X],le,Ce,Re;se==="vide"&&(le=new DataView(ee.buffer,ee.byteOffset,ee.byteLength),Ce=le.getUint8(0),Re=Ce===0?le.getUint32(12):le.getUint32(20),v.push(Re))})}),v},da=function(p){var T=p[0],v=T===0?12:20;return Jn(p[v]<<24|p[v+1]<<16|p[v+2]<<8|p[v+3])},Ls=function(p){var T=Mt(p,["moov","trak"]),v=[];return T.forEach(function(b){var A={},D=Mt(b,["tkhd"])[0],V,X;D&&(V=new DataView(D.buffer,D.byteOffset,D.byteLength),X=V.getUint8(0),A.id=X===0?V.getUint32(12):V.getUint32(20));var se=Mt(b,["mdia","hdlr"])[0];if(se){var ee=an(se.subarray(8,12));ee==="vide"?A.type="video":ee==="soun"?A.type="audio":A.type=ee}var le=Mt(b,["mdia","minf","stbl","stsd"])[0];if(le){var Ce=le.subarray(8);A.codec=an(Ce.subarray(4,8));var Re=Mt(Ce,[A.codec])[0],Fe,Ie;Re&&(/^[asm]vc[1-9]$/i.test(A.codec)?(Fe=Re.subarray(78),Ie=an(Fe.subarray(4,8)),Ie==="avcC"&&Fe.length>11?(A.codec+=".",A.codec+=Cn(Fe[9]),A.codec+=Cn(Fe[10]),A.codec+=Cn(Fe[11])):A.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(A.codec)?(Fe=Re.subarray(28),Ie=an(Fe.subarray(4,8)),Ie==="esds"&&Fe.length>20&&Fe[19]!==0?(A.codec+="."+Cn(Fe[19]),A.codec+="."+Cn(Fe[20]>>>2&63).replace(/^0/,"")):A.codec="mp4a.40.2"):A.codec=A.codec.toLowerCase())}var Ye=Mt(b,["mdia","mdhd"])[0];Ye&&(A.timescale=da(Ye)),v.push(A)}),v};var fa={findBox:Mt,parseType:an,timescale:wo,startTime:ko,compositionStartTime:En,videoTrackIds:Ps,tracks:Ls,getTimescaleFromMediaHeader:da},Ao=function(p){var T=p[1]&31;return T<<=8,T|=p[2],T},ki=function(p){return!!(p[1]&64)},Wi=function(p){var T=0;return(p[3]&48)>>>4>1&&(T+=p[4]+1),T},on=function(p,T){var v=Ao(p);return v===0?"pat":v===T?"pmt":T?"pes":null},ou=function(p){var T=ki(p),v=4+Wi(p);return T&&(v+=p[v]+1),(p[v+10]&31)<<8|p[v+11]},lu=function(p){var T={},v=ki(p),b=4+Wi(p);if(v&&(b+=p[b]+1),!!(p[b+5]&1)){var A,D,V;A=(p[b+1]&15)<<8|p[b+2],D=3+A-4,V=(p[b+10]&15)<<8|p[b+11];for(var X=12+V;X<D;){var se=b+X;T[(p[se+1]&31)<<8|p[se+2]]=p[se],X+=((p[se+3]&15)<<8|p[se+4])+5}return T}},Ua=function(p,T){var v=Ao(p),b=T[v];switch(b){case ri.H264_STREAM_TYPE:return"video";case ri.ADTS_STREAM_TYPE:return"audio";case ri.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},uu=function(p){var T=ki(p);if(!T)return null;var v=4+Wi(p);if(v>=p.byteLength)return null;var b=null,A;return A=p[v+7],A&192&&(b={},b.pts=(p[v+9]&14)<<27|(p[v+10]&255)<<20|(p[v+11]&254)<<12|(p[v+12]&255)<<5|(p[v+13]&254)>>>3,b.pts*=4,b.pts+=(p[v+13]&6)>>>1,b.dts=b.pts,A&64&&(b.dts=(p[v+14]&14)<<27|(p[v+15]&255)<<20|(p[v+16]&254)<<12|(p[v+17]&255)<<5|(p[v+18]&254)>>>3,b.dts*=4,b.dts+=(p[v+18]&6)>>>1)),b},pa=function(p){switch(p){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}},cu=function(p){for(var T=4+Wi(p),v=p.subarray(T),b=0,A=0,D=!1,V;A<v.byteLength-3;A++)if(v[A+2]===1){b=A+5;break}for(;b<v.byteLength;)switch(v[b]){case 0:if(v[b-1]!==0){b+=2;break}else if(v[b-2]!==0){b++;break}A+3!==b-2&&(V=pa(v[A+3]&31),V==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0));do b++;while(v[b]!==1&&b<v.length);A=b-2,b+=3;break;case 1:if(v[b-1]!==0||v[b-2]!==0){b+=3;break}V=pa(v[A+3]&31),V==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0),A=b-2,b+=3;break;default:b+=3;break}return v=v.subarray(A),b-=A,A=0,v&&v.byteLength>3&&(V=pa(v[A+3]&31),V==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0)),D},hu={parseType:on,parsePat:ou,parsePmt:lu,parsePayloadUnitStartIndicator:ki,parsePesType:Ua,parsePesTime:uu,videoPacketContainsKeyFrame:cu},wn=wi.handleRollover,Et={};Et.ts=hu,Et.aac=As;var Cr=dt.ONE_SECOND_IN_TS,Ti=188,sr=71,du=function(p,T){for(var v=0,b=Ti,A,D;b<p.byteLength;){if(p[v]===sr&&p[b]===sr){switch(A=p.subarray(v,b),D=Et.ts.parseType(A,T.pid),D){case"pat":T.pid=Et.ts.parsePat(A);break;case"pmt":var V=Et.ts.parsePmt(A);T.table=T.table||{},Object.keys(V).forEach(function(X){T.table[X]=V[X]});break}v+=Ti,b+=Ti;continue}v++,b++}},xo=function(p,T,v){for(var b=0,A=Ti,D,V,X,se,ee,le=!1;A<=p.byteLength;){if(p[b]===sr&&(p[A]===sr||A===p.byteLength)){switch(D=p.subarray(b,A),V=Et.ts.parseType(D,T.pid),V){case"pes":X=Et.ts.parsePesType(D,T.table),se=Et.ts.parsePayloadUnitStartIndicator(D),X==="audio"&&se&&(ee=Et.ts.parsePesTime(D),ee&&(ee.type="audio",v.audio.push(ee),le=!0));break}if(le)break;b+=Ti,A+=Ti;continue}b++,A++}for(A=p.byteLength,b=A-Ti,le=!1;b>=0;){if(p[b]===sr&&(p[A]===sr||A===p.byteLength)){switch(D=p.subarray(b,A),V=Et.ts.parseType(D,T.pid),V){case"pes":X=Et.ts.parsePesType(D,T.table),se=Et.ts.parsePayloadUnitStartIndicator(D),X==="audio"&&se&&(ee=Et.ts.parsePesTime(D),ee&&(ee.type="audio",v.audio.push(ee),le=!0));break}if(le)break;b-=Ti,A-=Ti;continue}b--,A--}},ma=function(p,T,v){for(var b=0,A=Ti,D,V,X,se,ee,le,Ce,Re,Fe=!1,Ie={data:[],size:0};A<p.byteLength;){if(p[b]===sr&&p[A]===sr){switch(D=p.subarray(b,A),V=Et.ts.parseType(D,T.pid),V){case"pes":if(X=Et.ts.parsePesType(D,T.table),se=Et.ts.parsePayloadUnitStartIndicator(D),X==="video"&&(se&&!Fe&&(ee=Et.ts.parsePesTime(D),ee&&(ee.type="video",v.video.push(ee),Fe=!0)),!v.firstKeyFrame)){if(se&&Ie.size!==0){for(le=new Uint8Array(Ie.size),Ce=0;Ie.data.length;)Re=Ie.data.shift(),le.set(Re,Ce),Ce+=Re.byteLength;if(Et.ts.videoPacketContainsKeyFrame(le)){var Ye=Et.ts.parsePesTime(le);Ye?(v.firstKeyFrame=Ye,v.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.")}Ie.size=0}Ie.data.push(D),Ie.size+=D.byteLength}break}if(Fe&&v.firstKeyFrame)break;b+=Ti,A+=Ti;continue}b++,A++}for(A=p.byteLength,b=A-Ti,Fe=!1;b>=0;){if(p[b]===sr&&p[A]===sr){switch(D=p.subarray(b,A),V=Et.ts.parseType(D,T.pid),V){case"pes":X=Et.ts.parsePesType(D,T.table),se=Et.ts.parsePayloadUnitStartIndicator(D),X==="video"&&se&&(ee=Et.ts.parsePesTime(D),ee&&(ee.type="video",v.video.push(ee),Fe=!0));break}if(Fe)break;b-=Ti,A-=Ti;continue}b--,A--}},fu=function(p,T){if(p.audio&&p.audio.length){var v=T;(typeof v>"u"||isNaN(v))&&(v=p.audio[0].dts),p.audio.forEach(function(D){D.dts=wn(D.dts,v),D.pts=wn(D.pts,v),D.dtsTime=D.dts/Cr,D.ptsTime=D.pts/Cr})}if(p.video&&p.video.length){var b=T;if((typeof b>"u"||isNaN(b))&&(b=p.video[0].dts),p.video.forEach(function(D){D.dts=wn(D.dts,b),D.pts=wn(D.pts,b),D.dtsTime=D.dts/Cr,D.ptsTime=D.pts/Cr}),p.firstKeyFrame){var A=p.firstKeyFrame;A.dts=wn(A.dts,b),A.pts=wn(A.pts,b),A.dtsTime=A.dts/Cr,A.ptsTime=A.pts/Cr}}},pu=function(p){for(var T=!1,v=0,b=null,A=null,D=0,V=0,X;p.length-V>=3;){var se=Et.aac.parseType(p,V);switch(se){case"timed-metadata":if(p.length-V<10){T=!0;break}if(D=Et.aac.parseId3TagSize(p,V),D>p.length){T=!0;break}A===null&&(X=p.subarray(V,V+D),A=Et.aac.parseAacTimestamp(X)),V+=D;break;case"audio":if(p.length-V<7){T=!0;break}if(D=Et.aac.parseAdtsSize(p,V),D>p.length){T=!0;break}b===null&&(X=p.subarray(V,V+D),b=Et.aac.parseSampleRate(X)),v++,V+=D;break;default:V++;break}if(T)return null}if(b===null||A===null)return null;var ee=Cr/b,le={audio:[{type:"audio",dts:A,pts:A},{type:"audio",dts:A+v*1024*ee,pts:A+v*1024*ee}]};return le},mu=function(p){var T={pid:null,table:null},v={};du(p,T);for(var b in T.table)if(T.table.hasOwnProperty(b)){var A=T.table[b];switch(A){case ri.H264_STREAM_TYPE:v.video=[],ma(p,T,v),v.video.length===0&&delete v.video;break;case ri.ADTS_STREAM_TYPE:v.audio=[],xo(p,T,v),v.audio.length===0&&delete v.audio;break}}return v},gu=function(p,T){var v=Et.aac.isLikelyAacData(p),b;return v?b=pu(p):b=mu(p),!b||!b.audio&&!b.video?null:(fu(b,T),b)},No={inspect:gu,parseAudioPes_:xo},Do=function(p,T){T.on("data",function(v){var b=v.initSegment;v.initSegment={data:b.buffer,byteOffset:b.byteOffset,byteLength:b.byteLength};var A=v.data;v.data=A.buffer,p.postMessage({action:"data",segment:v,byteOffset:A.byteOffset,byteLength:A.byteLength},[v.data])}),T.on("done",function(v){p.postMessage({action:"done"})}),T.on("gopInfo",function(v){p.postMessage({action:"gopInfo",gopInfo:v})}),T.on("videoSegmentTimingInfo",function(v){var b={start:{decode:dt.videoTsToSeconds(v.start.dts),presentation:dt.videoTsToSeconds(v.start.pts)},end:{decode:dt.videoTsToSeconds(v.end.dts),presentation:dt.videoTsToSeconds(v.end.pts)},baseMediaDecodeTime:dt.videoTsToSeconds(v.baseMediaDecodeTime)};v.prependedContentDuration&&(b.prependedContentDuration=dt.videoTsToSeconds(v.prependedContentDuration)),p.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:b})}),T.on("audioSegmentTimingInfo",function(v){var b={start:{decode:dt.videoTsToSeconds(v.start.dts),presentation:dt.videoTsToSeconds(v.start.pts)},end:{decode:dt.videoTsToSeconds(v.end.dts),presentation:dt.videoTsToSeconds(v.end.pts)},baseMediaDecodeTime:dt.videoTsToSeconds(v.baseMediaDecodeTime)};v.prependedContentDuration&&(b.prependedContentDuration=dt.videoTsToSeconds(v.prependedContentDuration)),p.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:b})}),T.on("id3Frame",function(v){p.postMessage({action:"id3Frame",id3Frame:v})}),T.on("caption",function(v){p.postMessage({action:"caption",caption:v})}),T.on("trackinfo",function(v){p.postMessage({action:"trackinfo",trackInfo:v})}),T.on("audioTimingInfo",function(v){p.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:dt.videoTsToSeconds(v.start),end:dt.videoTsToSeconds(v.end)}})}),T.on("videoTimingInfo",function(v){p.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:dt.videoTsToSeconds(v.start),end:dt.videoTsToSeconds(v.end)}})}),T.on("log",function(v){p.postMessage({action:"log",log:v})})},Zn=(function(){function M(T,v){this.options=v||{},this.self=T,this.init()}var p=M.prototype;return p.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Zl.Transmuxer(this.options),Do(this.self,this.transmuxer)},p.pushMp4Captions=function(v){this.captionParser||(this.captionParser=new Ba,this.captionParser.init());var b=new Uint8Array(v.data,v.byteOffset,v.byteLength),A=this.captionParser.parse(b,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:A&&A.captions||[],logs:A&&A.logs||[],data:b.buffer},[b.buffer])},p.probeMp4StartTime=function(v){var b=v.timescales,A=v.data,D=fa.startTime(b,A);this.self.postMessage({action:"probeMp4StartTime",startTime:D,data:A},[A.buffer])},p.probeMp4Tracks=function(v){var b=v.data,A=fa.tracks(b);this.self.postMessage({action:"probeMp4Tracks",tracks:A,data:b},[b.buffer])},p.probeTs=function(v){var b=v.data,A=v.baseStartTime,D=typeof A=="number"&&!isNaN(A)?A*dt.ONE_SECOND_IN_TS:void 0,V=No.inspect(b,D),X=null;V&&(X={hasVideo:V.video&&V.video.length===2||!1,hasAudio:V.audio&&V.audio.length===2||!1},X.hasVideo&&(X.videoStart=V.video[0].ptsTime),X.hasAudio&&(X.audioStart=V.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:X,data:b},[b.buffer])},p.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},p.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},p.push=function(v){var b=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(b)},p.reset=function(){this.transmuxer.reset()},p.setTimestampOffset=function(v){var b=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(dt.secondsToVideoTs(b)))},p.setAudioAppendStart=function(v){this.transmuxer.setAudioAppendStart(Math.ceil(dt.secondsToVideoTs(v.appendStart)))},p.setRemux=function(v){this.transmuxer.setRemux(v.remux)},p.flush=function(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},p.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},p.alignGopsWith=function(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())},M})();self.onmessage=function(M){if(M.data.action==="init"&&M.data.options){this.messageHandlers=new Zn(self,M.data.options);return}this.messageHandlers||(this.messageHandlers=new Zn(self)),M.data&&M.data.action&&M.data.action!=="init"&&this.messageHandlers[M.data.action]&&this.messageHandlers[M.data.action](M.data)}})),WM=W2(zM),GM=function(e,t,r){var i=e.data.segment,n=i.type,a=i.initSegment,o=i.captions,l=i.captionStreams,u=i.metadata,c=i.videoFrameDtsTime,d=i.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:l,metadata:u});var f=e.data.segment.boxes||{data:e.data.segment.data},g={type:n,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof c<"u"&&(g.videoFrameDtsTime=c),typeof d<"u"&&(g.videoFramePtsTime=d),r(g)},KM=function(e){var t=e.transmuxedData,r=e.callback;t.buffer=[],r(t)},XM=function(e,t){t.gopInfo=e.data.gopInfo},X2=function(e){var t=e.transmuxer,r=e.bytes,i=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,o=e.onData,l=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,f=e.onAudioSegmentTimingInfo,g=e.onId3,E=e.onCaptions,S=e.onDone,k=e.onEndedTimeline,F=e.onTransmuxerLog,L=e.isEndOfTimeline,W={buffer:[]},H=L,$=function(P){t.currentTransmux===e&&(P.data.action==="data"&&GM(P,W,o),P.data.action==="trackinfo"&&l(P.data.trackInfo),P.data.action==="gopInfo"&&XM(P,W),P.data.action==="audioTimingInfo"&&u(P.data.audioTimingInfo),P.data.action==="videoTimingInfo"&&c(P.data.videoTimingInfo),P.data.action==="videoSegmentTimingInfo"&&d(P.data.videoSegmentTimingInfo),P.data.action==="audioSegmentTimingInfo"&&f(P.data.audioSegmentTimingInfo),P.data.action==="id3Frame"&&g([P.data.id3Frame],P.data.id3Frame.dispatchType),P.data.action==="caption"&&E(P.data.caption),P.data.action==="endedtimeline"&&(H=!1,k()),P.data.action==="log"&&F(P.data.log),P.data.type==="transmuxed"&&(H||(t.onmessage=null,KM({transmuxedData:W,callback:S}),Y2(t))))};if(t.onmessage=$,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),r.byteLength){var G=r instanceof ArrayBuffer?r:r.buffer,K=r instanceof ArrayBuffer?0:r.byteOffset;t.postMessage({action:"push",data:G,byteOffset:K,byteLength:r.byteLength},[G])}L&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Y2=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():X2(e.currentTransmux))},K_=function(e,t){e.postMessage({action:t}),Y2(e)},Q2=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,K_(t,e);return}t.transmuxQueue.push(K_.bind(null,t,e))},YM=function(e){Q2("reset",e)},QM=function(e){Q2("endTimeline",e)},J2=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,X2(e);return}e.transmuxer.transmuxQueue.push(e)},JM=function(e){var t=new WM;t.currentTransmux=null,t.transmuxQueue=[];var r=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,r.call(t)},t.postMessage({action:"init",options:e}),t},Yf={reset:YM,endTimeline:QM,transmux:J2,createTransmuxer:JM},Xh=function(e){var t=e.transmuxer,r=e.endAction||e.action,i=e.callback,n=jt({},e,{endAction:null,transmuxer:null,callback:null}),a=function u(c){c.data.action===r&&(t.removeEventListener("message",u),c.data.data&&(c.data.data=new Uint8Array(c.data.data,e.byteOffset||0,e.byteLength||c.data.data.byteLength),e.data&&(e.data=c.data.data)),i(c.data))};if(t.addEventListener("message",a),e.data){var o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},fs={FAILURE:2,TIMEOUT:-101,ABORTED:-102},rm=function(e){e.forEach(function(t){t.abort()})},ZM=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},e4=function(e){var t=e.target,r=Date.now()-t.requestTime,i={bandwidth:1/0,bytesReceived:0,roundTripTime:r||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},Hg=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fs.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:fs.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:fs.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:fs.FAILURE,xhr:t}:null},X_=function(e,t,r){return function(i,n){var a=n.response,o=Hg(i,n);if(o)return r(o,e);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:fs.FAILURE,xhr:n},e);for(var l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),c=0;c<t.length;c++)t[c].bytes=u;return r(null,e)}},Z2=function(e,t){var r=og(e.map.bytes);if(r!=="mp4"){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(r||"unknown")+" container for initialization segment at URL: "+i,code:fs.FAILURE})}Xh({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(a){var o=a.tracks,l=a.data;return e.map.bytes=l,o.forEach(function(u){e.map.tracks=e.map.tracks||{},!e.map.tracks[u.type]&&(e.map.tracks[u.type]=u,typeof u.id=="number"&&u.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[u.id]=u.timescale))}),t(null)}})},t4=function(e){var t=e.segment,r=e.finishProcessingFn;return function(i,n){var a=Hg(i,n);if(a)return r(a,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,r(null,t);t.map.bytes=o,Z2(t,function(l){if(l)return l.xhr=n,l.status=n.status,r(l,t);r(null,t)})}},i4=function(e){var t=e.segment,r=e.finishProcessingFn,i=e.responseType;return function(n,a){var o=Hg(n,a);if(o)return r(o,t);var l=i==="arraybuffer"||!a.responseText?a.response:VM(a.responseText.substring(t.lastReachedChar||0));return t.stats=ZM(a),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),r(null,t)}},r4=function(e){var t=e.segment,r=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,E=e.onTransmuxerLog,S=t.map&&t.map.tracks||{},k=!!(S.audio&&S.video),F=n.bind(null,t,"audio","start"),L=n.bind(null,t,"audio","end"),W=n.bind(null,t,"video","start"),H=n.bind(null,t,"video","end"),$=function(){return J2({bytes:r,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:k,onData:function(Y){Y.type=Y.type==="combined"?"video":Y.type,f(t,Y)},onTrackInfo:function(Y){i&&(k&&(Y.isMuxed=!0),i(t,Y))},onAudioTimingInfo:function(Y){F&&typeof Y.start<"u"&&(F(Y.start),F=null),L&&typeof Y.end<"u"&&L(Y.end)},onVideoTimingInfo:function(Y){W&&typeof Y.start<"u"&&(W(Y.start),W=null),H&&typeof Y.end<"u"&&H(Y.end)},onVideoSegmentTimingInfo:function(Y){a(Y)},onAudioSegmentTimingInfo:function(Y){o(Y)},onId3:function(Y,P){l(t,Y,P)},onCaptions:function(Y){u(t,[Y])},isEndOfTimeline:c,onEndedTimeline:function(){d()},onTransmuxerLog:E,onDone:function(Y){g&&(Y.type=Y.type==="combined"?"video":Y.type,g(null,t,Y))}})};Xh({action:"probeTs",transmuxer:t.transmuxer,data:r,baseStartTime:t.baseStartTime,callback:function(K){t.bytes=r=K.data;var Y=K.result;Y&&(i(t,{hasAudio:Y.hasAudio,hasVideo:Y.hasVideo,isMuxed:k}),i=null,Y.hasAudio&&!k&&F(Y.audioStart),Y.hasVideo&&W(Y.videoStart),F=null,W=null),$()}})},eC=function(e){var t=e.segment,r=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,E=e.onTransmuxerLog,S=new Uint8Array(r);if(bL(S)){t.isFmp4=!0;var k=t.map.tracks,F={isFmp4:!0,hasVideo:!!k.video,hasAudio:!!k.audio};k.audio&&k.audio.codec&&k.audio.codec!=="enca"&&(F.audioCodec=k.audio.codec),k.video&&k.video.codec&&k.video.codec!=="encv"&&(F.videoCodec=k.video.codec),k.video&&k.audio&&(F.isMuxed=!0),i(t,F);var L=function(H){f(t,{data:S,type:F.hasAudio&&!F.isMuxed?"audio":"video"}),H&&H.length&&u(t,H),g(null,t,{})};Xh({action:"probeMp4StartTime",timescales:t.map.timescales,data:S,transmuxer:t.transmuxer,callback:function(H){var $=H.data,G=H.startTime;if(r=$.buffer,t.bytes=S=$,F.hasAudio&&!F.isMuxed&&n(t,"audio","start",G),F.hasVideo&&n(t,"video","start",G),!k.video||!$.byteLength||!t.transmuxer){L();return}Xh({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:S,timescales:t.map.timescales,trackIds:[k.video.id],callback:function(Y){r=Y.data.buffer,t.bytes=S=Y.data,Y.logs.forEach(function(P){E(ce.mergeOptions(P,{stream:"mp4CaptionParser"}))}),L(Y.captions)}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=og(S)),t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}r4({segment:t,bytes:r,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:f,doneFn:g,onTransmuxerLog:E})},tC=function(e,t){var r=e.id,i=e.key,n=e.encryptedBytes,a=e.decryptionWorker,o=function u(c){if(c.data.source===r){a.removeEventListener("message",u);var d=c.data.decrypted;t(new Uint8Array(d.bytes,d.byteOffset,d.byteLength))}};a.addEventListener("message",o);var l;i.bytes.slice?l=i.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(i.bytes)),a.postMessage($2({source:r,encrypted:n,key:l,iv:i.iv}),[n.buffer,l.buffer])},n4=function(e){var t=e.decryptionWorker,r=e.segment,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,E=e.onTransmuxerLog;tC({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:t},function(S){r.bytes=S,eC({segment:r,bytes:r.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:f,doneFn:g,onTransmuxerLog:E})})},s4=function(e){var t=e.activeXhrs,r=e.decryptionWorker,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,E=e.onTransmuxerLog,S=0,k=!1;return function(F,L){if(!k){if(F)return k=!0,rm(t),g(F,L);if(S+=1,S===t.length){var W=function(){if(L.encryptedBytes)return n4({decryptionWorker:r,segment:L,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:f,doneFn:g,onTransmuxerLog:E});eC({segment:L,bytes:L.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:f,doneFn:g,onTransmuxerLog:E})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return tC({decryptionWorker:r,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key},function(H){L.map.bytes=H,Z2(L,function($){if($)return rm(t),g($,L);W()})});W()}}}},a4=function(e){var t=e.loadendState,r=e.abortFn;return function(i){var n=i.target;n.aborted&&r&&!t.calledAbortFn&&(r(),t.calledAbortFn=!0)}},o4=function(e){var t=e.segment,r=e.progressFn;return function(i){var n=i.target;if(!n.aborted)return t.stats=ce.mergeOptions(t.stats,e4(i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),r(i,t)}},l4=function(e){var t=e.xhr,r=e.xhrOptions,i=e.decryptionWorker,n=e.segment,a=e.abortFn,o=e.progressFn,l=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,d=e.audioSegmentTimingInfoFn,f=e.id3Fn,g=e.captionsFn,E=e.isEndOfTimeline,S=e.endedTimelineFn,k=e.dataFn,F=e.doneFn,L=e.onTransmuxerLog,W=[],H=s4({activeXhrs:W,decryptionWorker:i,trackInfoFn:l,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:f,captionsFn:g,isEndOfTimeline:E,endedTimelineFn:S,dataFn:k,doneFn:F,onTransmuxerLog:L});if(n.key&&!n.key.bytes){var $=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&$.push(n.map.key);var G=ce.mergeOptions(r,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),K=X_(n,$,H),Y=t(G,K);W.push(Y)}if(n.map&&!n.map.bytes){var P=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(P){var O=ce.mergeOptions(r,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),ne=X_(n,[n.map.key],H),te=t(O,ne);W.push(te)}var re=ce.mergeOptions(r,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:tm(n.map)}),me=t4({segment:n,finishProcessingFn:H}),Se=t(re,me);W.push(Se)}var Ae=ce.mergeOptions(r,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:tm(n)}),ve=i4({segment:n,finishProcessingFn:H,responseType:Ae.responseType}),Te=t(Ae,ve);Te.addEventListener("progress",o4({segment:n,progressFn:o})),W.push(Te);var ye={};return W.forEach(function(_e){_e.addEventListener("loadend",a4({loadendState:ye,abortFn:a}))}),function(){return rm(W)}},u4=Mn("CodecUtils"),c4=function(e){var t=e.attributes||{};if(t.CODECS)return ns(t.CODECS)},iC=function(e,t){var r=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&r.AUDIO&&e.mediaGroups.AUDIO[r.AUDIO]},h4=function(e,t){if(!iC(e,t))return!0;var r=t.attributes||{},i=e.mediaGroups.AUDIO[r.AUDIO];for(var n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},Yh=function(e){var t={};return e.forEach(function(r){var i=r.mediaType,n=r.type,a=r.details;t[i]=t[i]||[],t[i].push(tS(""+n+a))}),Object.keys(t).forEach(function(r){if(t[r].length>1){u4("multiple "+r+" codecs found as attributes: "+t[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),t[r]=null;return}t[r]=t[r][0]}),t},Y_=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Yu=function(e,t){var r=t.attributes||{},i=Yh(c4(t)||[]);if(iC(e,t)&&!i.audio&&!h4(e,t)){var n=Yh(eP(e,r.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},Wc=Mn("PlaylistSelector"),Q_=function(e){if(!(!e||!e.playlist)){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Qh=function(e,t){if(!e)return"";var r=N.getComputedStyle(e);return r?r[t]:""},al=function(e,t){var r=e.slice();e.sort(function(i,n){var a=t(i,n);return a===0?r.indexOf(i)-r.indexOf(n):a})},Vg=function(e,t){var r,i;return e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||N.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||N.Number.MAX_VALUE,r-i},d4=function(e,t){var r,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||N.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||N.Number.MAX_VALUE,r===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:r-i},rC=function(e,t,r,i,n,a){if(e){var o={bandwidth:t,width:r,height:i,limitRenditionByPlayerDimensions:n},l=e.playlists;Ir.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map(function(O){var ne,te=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.width,re=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.height;return ne=O.attributes&&O.attributes.BANDWIDTH,ne=ne||N.Number.MAX_VALUE,{bandwidth:ne,width:te,height:re,playlist:O}});al(u,function(O,ne){return O.bandwidth-ne.bandwidth}),u=u.filter(function(O){return!Ir.isIncompatible(O.playlist)});var c=u.filter(function(O){return Ir.isEnabled(O.playlist)});c.length||(c=u.filter(function(O){return!Ir.isDisabled(O.playlist)}));var d=c.filter(function(O){return O.bandwidth*Fi.BANDWIDTH_VARIANCE<t}),f=d[d.length-1],g=d.filter(function(O){return O.bandwidth===f.bandwidth})[0];if(n===!1){var E=g||c[0]||u[0];if(E&&E.playlist){var S="sortedPlaylistReps";return g&&(S="bandwidthBestRep"),c[0]&&(S="enabledPlaylistReps"),Wc("choosing "+Q_(E)+" using "+S+" with options",o),E.playlist}return Wc("could not choose a playlist with options",o),null}var k=d.filter(function(O){return O.width&&O.height});al(k,function(O,ne){return O.width-ne.width});var F=k.filter(function(O){return O.width===r&&O.height===i});f=F[F.length-1];var L=F.filter(function(O){return O.bandwidth===f.bandwidth})[0],W,H,$;L||(W=k.filter(function(O){return O.width>r||O.height>i}),H=W.filter(function(O){return O.width===W[0].width&&O.height===W[0].height}),f=H[H.length-1],$=H.filter(function(O){return O.bandwidth===f.bandwidth})[0]);var G;if(a.experimentalLeastPixelDiffSelector){var K=k.map(function(O){return O.pixelDiff=Math.abs(O.width-r)+Math.abs(O.height-i),O});al(K,function(O,ne){return O.pixelDiff===ne.pixelDiff?ne.bandwidth-O.bandwidth:O.pixelDiff-ne.pixelDiff}),G=K[0]}var Y=G||$||L||g||c[0]||u[0];if(Y&&Y.playlist){var P="sortedPlaylistReps";return G?P="leastPixelDiffRep":$?P="resolutionPlusOneRep":L?P="resolutionBestRep":g?P="bandwidthBestRep":c[0]&&(P="enabledPlaylistReps"),Wc("choosing "+Q_(Y)+" using "+P+" with options",o),Y.playlist}return Wc("could not choose a playlist with options",o),null}},J_=function(){var e=this.useDevicePixelRatio&&N.devicePixelRatio||1;return rC(this.playlists.master,this.systemBandwidth,parseInt(Qh(this.tech_.el(),"width"),10)*e,parseInt(Qh(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},f4=function(e){var t=-1,r=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio&&N.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(t=e*this.systemBandwidth+(1-e)*t,r=this.systemBandwidth),rC(this.playlists.master,t,parseInt(Qh(this.tech_.el(),"width"),10)*i,parseInt(Qh(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},p4=function(e){var t=e.master,r=e.currentTime,i=e.bandwidth,n=e.duration,a=e.segmentDuration,o=e.timeUntilRebuffer,l=e.currentTimeline,u=e.syncController,c=t.playlists.filter(function(S){return!Ir.isIncompatible(S)}),d=c.filter(Ir.isEnabled);d.length||(d=c.filter(function(S){return!Ir.isDisabled(S)}));var f=d.filter(Ir.hasAttribute.bind(null,"BANDWIDTH")),g=f.map(function(S){var k=u.getSyncPoint(S,n,l,r),F=k?1:2,L=Ir.estimateSegmentRequestTime(a,i,S),W=L*F-o;return{playlist:S,rebufferingImpact:W}}),E=g.filter(function(S){return S.rebufferingImpact<=0});return al(E,function(S,k){return Vg(k.playlist,S.playlist)}),E.length?E[0]:(al(g,function(S,k){return S.rebufferingImpact-k.rebufferingImpact}),g[0]||null)},m4=function(){var e=this,t=this.playlists.master.playlists.filter(Ir.isEnabled);al(t,function(i,n){return Vg(i,n)});var r=t.filter(function(i){return!!Yu(e.playlists.master,i).video});return r[0]||null},g4=function(e){var t=0,r;return e.bytes&&(r=new Uint8Array(e.bytes),e.segments.forEach(function(i){r.set(i,t),t+=i.byteLength})),r},v4=function(e,t,r){if(!e[r]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=r;/^cc708_/.test(r)&&(i="SERVICE"+r.split("_")[1]);var n=t.textTracks().getTrackById(i);if(n)e[r]=n;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},o=r,l=r,u=!1,c=a[i];c&&(o=c.label,l=c.language,u=c.default),e[r]=t.addRemoteTextTrack({kind:"captions",id:i,default:u,label:o,language:l},!1).track}}},y4=function(e){var t=e.inbandTextTracks,r=e.captionArray,i=e.timestampOffset;if(r){var n=N.WebKitDataCue||N.VTTCue;r.forEach(function(a){var o=a.stream;t[o].addCue(new n(a.startTime+i,a.endTime+i,a.text))})}},_4=function(e){Object.defineProperties(e.frame,{id:{get:function(){return ce.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ce.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ce.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},T4=function(e){var t=e.inbandTextTracks,r=e.metadataArray,i=e.timestampOffset,n=e.videoDuration;if(r){var a=N.WebKitDataCue||N.VTTCue,o=t.metadataTrack_;if(o&&(r.forEach(function(g){var E=g.cueTime+i;typeof E!="number"||N.isNaN(E)||E<0||!(E<1/0)||g.frames.forEach(function(S){var k=new a(E,E,S.value||S.url||S.data||"");k.frame=S,k.value=S,_4(k),o.addCue(k)})}),!(!o.cues||!o.cues.length))){for(var l=o.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var d=u.reduce(function(g,E){var S=g[E.startTime]||[];return S.push(E),g[E.startTime]=S,g},{}),f=Object.keys(d).sort(function(g,E){return Number(g)-Number(E)});f.forEach(function(g,E){var S=d[g],k=Number(f[E+1])||n;S.forEach(function(F){F.endTime=k})})}}},b4=function(e,t,r){e.metadataTrack_||(e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},ju=function(e,t,r){var i,n;if(r&&r.cues)for(i=r.cues.length;i--;)n=r.cues[i],n.startTime>=e&&n.endTime<=t&&r.removeCue(n)},S4=function(e){var t=e.cues;if(t)for(var r=0;r<t.length;r++){for(var i=[],n=0,a=0;a<t.length;a++)t[r].startTime===t[a].startTime&&t[r].endTime===t[a].endTime&&t[r].text===t[a].text&&(n++,n>1&&i.push(t[a]));i.length&&i.forEach(function(o){return e.removeCue(o)})}},C4=function(e,t,r){if(typeof t>"u"||t===null||!e.length)return[];var i=Math.ceil((t-r+3)*Rh.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)},E4=function(e,t,r){if(!t.length)return e;if(r)return t.slice();var i=t[0].pts,n=0;for(n;n<e.length&&!(e[n].pts>=i);n++);return e.slice(0,n).concat(t)},w4=function(e,t,r,i){for(var n=Math.ceil((t-i)*Rh.ONE_SECOND_IN_TS),a=Math.ceil((r-i)*Rh.ONE_SECOND_IN_TS),o=e.slice(),l=e.length;l--&&!(e[l].pts<=a););if(l===-1)return o;for(var u=l+1;u--&&!(e[u].pts<=n););return u=Math.max(u,0),o.splice(u,l-u+1),o},k4=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var r=Object.keys(e).sort(),i=Object.keys(t).sort();if(r.length!==i.length)return!1;for(var n=0;n<r.length;n++){var a=r[n];if(a!==i[n]||e[a]!==t[a])return!1}return!0},nC=22,A4=function(e,t,r){t=t||[];for(var i=[],n=0,a=0;a<t.length;a++){var o=t[a];if(e===o.timeline&&(i.push(a),n+=o.duration,n>r))return a}return i.length===0?0:i[i.length-1]},Iu=1,x4=500,Z_=function(e){return typeof e=="number"&&isFinite(e)},Gc=1/60,N4=function(e,t,r){return e!=="main"||!t||!r?null:!r.hasAudio&&!r.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!r.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.":!t.hasVideo&&r.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},D4=function(e,t,r){var i=t-Fi.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var n=t-r;return Math.min(n,i)},Uo=function(e){var t=e.startOfSegment,r=e.duration,i=e.segment,n=e.part,a=e.playlist,o=a.mediaSequence,l=a.id,u=a.segments,c=u===void 0?[]:u,d=e.mediaIndex,f=e.partIndex,g=e.timeline,E=c.length-1,S="mediaIndex/partIndex increment";e.getMediaInfoForTime?S="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(S="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(S+=" with independent "+e.independent);var k=typeof f=="number",F=e.segment.uri?"segment":"pre-segment",L=k?k2({preloadSegment:i})-1:0;return F+" ["+(o+d)+"/"+(o+E)+"]"+(k?" part ["+f+"/"+L+"]":"")+(" segment start/end ["+i.start+" => "+i.end+"]")+(k?" part start/end ["+n.start+" => "+n.end+"]":"")+(" startOfSegment ["+t+"]")+(" duration ["+r+"]")+(" timeline ["+g+"]")+(" selected by ["+S+"]")+(" playlist ["+l+"]")},e0=function(e){return e+"TimingInfo"},I4=function(e){var t=e.segmentTimeline,r=e.currentTimeline,i=e.startOfSegment,n=e.buffered,a=e.overrideCheck;return!a&&t===r?null:t<r?i:n.length?n.end(n.length-1):i},t0=function(e){var t=e.timelineChangeController,r=e.currentTimeline,i=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(r===i)return!1;if(n==="audio"){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==i}if(n==="main"&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===i)}return!1},P4=function(e){var t=0;return["video","audio"].forEach(function(r){var i=e[r+"TimingInfo"];if(i){var n=i.start,a=i.end,o;typeof n=="bigint"||typeof a=="bigint"?o=N.BigInt(a)-N.BigInt(n):typeof n=="number"&&typeof a=="number"&&(o=a-n),typeof o<"u"&&o>t&&(t=o)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},i0=function(e){var t=e.segmentDuration,r=e.maxDuration;return t?Math.round(t)>r+Na:!1},L4=function(e,t){if(t!=="hls")return null;var r=P4({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!r)return null;var i=e.playlist.targetDuration,n=i0({segmentDuration:r,maxDuration:i*2}),a=i0({segmentDuration:r,maxDuration:i}),o="Segment with index "+e.mediaIndex+" "+("from playlist "+e.playlist.id+" ")+("has a duration of "+r+" ")+("when the reported duration is "+e.duration+" ")+("and the target duration is "+i+". ")+"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 n||a?{severity:n?"warn":"info",message:o}:null},nm=(function(s){Be(e,s);function e(r,i){var n;if(n=s.call(this)||this,!r)throw new TypeError("Initialization settings are required");if(typeof r.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!r.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=r.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=r.hasPlayed,n.currentTime_=r.currentTime,n.seekable_=r.seekable,n.seeking_=r.seeking,n.duration_=r.duration,n.mediaSource_=r.mediaSource,n.vhs_=r.vhs,n.loaderType_=r.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=r.segmentMetadataTrack,n.goalBufferLength_=r.goalBufferLength,n.sourceType_=r.sourceType,n.sourceUpdater_=r.sourceUpdater,n.inbandTextTracks_=r.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=r.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=r.parse708captions,n.useDtsForTimestampOffset_=r.useDtsForTimestampOffset,n.captionServices_=r.captionServices,n.experimentalExactManifestTimings=r.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=ce.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=r.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=r.decrypter,n.syncController_=r.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=Mn("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(rt(n),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="main"&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="audio"&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}var t=e.prototype;return t.createTransmuxer_=function(){return Yf.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&N.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(i){this.audioDisabled_=!i,i?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},t.abort_=function(){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,N.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(i){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==i},t.error=function(i){return typeof i<"u"&&(this.logger_("error occurred:",i),this.error_=i),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Yf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var i=this.getMediaInfo_();if(!this.sourceUpdater_||!i)return ce.createTimeRanges();if(this.loaderType_==="main"){var n=i.hasAudio,a=i.hasVideo,o=i.isMuxed;if(a&&n&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=Kh(i),o=this.initSegments_[a];return n&&!o&&i.bytes&&(this.initSegments_[a]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:i.bytes,tracks:i.tracks,timescales:i.timescales}),o||i},t.segmentKey=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=j2(i),o=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!o&&i.bytes&&(this.keyCache_[a]=o={resolvedUri:i.resolvedUri,bytes:i.bytes});var l={resolvedUri:(o||i).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){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")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(i,n){if(n===void 0&&(n={}),!!i){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=i,this.xhrOptions_=n,this.state==="INIT"&&(i.syncInfo={mediaSequence:i.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(i));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(i.id||i.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==i.uri){this.mediaIndex!==null&&(i.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var u=i.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var d=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=d}}o&&(o.mediaIndex-=u,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=i.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,i)}},t.pause=function(){this.checkBufferTimeout_&&(N.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return this.checkBufferTimeout_===null},t.resetEverything=function(i){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,i),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Yf.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(i,n,a,o){if(a===void 0&&(a=function(){}),o===void 0&&(o=!1),n===1/0&&(n=this.duration_()),n<=i){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}var l=1,u=function(){l--,l===0&&a()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(i,n,u)),(o||this.loaderType_==="main")&&(this.gopBuffer_=w4(this.gopBuffer_,i,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(i,n,u));for(var c in this.inbandTextTracks_)ju(i,n,this.inbandTextTracks_[c]);ju(i,n,this.segmentMetadataTrack_),u()},t.monitorBuffer_=function(){this.checkBufferTimeout_&&N.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=N.setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&N.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=N.setTimeout(this.monitorBufferTick_.bind(this),x4)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var i=this.chooseNextRequest_();i&&(typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline})),this.loadSegment_(i))}},t.isEndOfStream_=function(i,n,a){if(i===void 0&&(i=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var o=typeof i=="number"&&n.segments[i],l=i+1===n.segments.length,u=!o||!o.parts||a+1===o.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&l&&u},t.chooseNextRequest_=function(){var i=this.buffered_(),n=V_(i)||0,a=Bg(i,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=A4(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var d=u[this.mediaIndex],f=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=d.end?d.end:n,d.parts&&d.parts[f+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=f+1):c.mediaIndex=this.mediaIndex+1}else{var g=Ir.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),E=g.segmentIndex,S=g.startTime,k=g.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=E,c.startOfSegment=S,c.partIndex=k}var F=u[c.mediaIndex],L=F&&typeof c.partIndex=="number"&&F.parts&&F.parts[c.partIndex];if(!F||typeof c.partIndex=="number"&&!L)return null;if(typeof c.partIndex!="number"&&F.parts&&(c.partIndex=0,L=F.parts[0]),!a&&L&&!L.independent)if(c.partIndex===0){var W=u[c.mediaIndex-1],H=W.parts&&W.parts.length&&W.parts[W.parts.length-1];H&&H.independent&&(c.mediaIndex-=1,c.partIndex=W.parts.length-1,c.independent="previous segment")}else F.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var $=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&$&&!this.seeking_()?null:this.generateSegmentInfo_(c)},t.generateSegmentInfo_=function(i){var n=i.independent,a=i.playlist,o=i.mediaIndex,l=i.startOfSegment,u=i.isSyncRequest,c=i.partIndex,d=i.forceTimestampOffset,f=i.getMediaInfoForTime,g=a.segments[o],E=typeof c=="number"&&g.parts[c],S={requestId:"segment-loader-"+Math.random(),uri:E&&E.resolvedUri||g.resolvedUri,mediaIndex:o,partIndex:E?c:null,isSyncRequest:u,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:E&&E.duration||g.duration,segment:g,part:E,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:n},k=typeof d<"u"?d:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:k});var F=V_(this.sourceUpdater_.audioBuffered());return typeof F=="number"&&(S.audioAppendStart=F-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=C4(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S},t.timestampOffsetForSegment_=function(i){return I4(i)},t.earlyAbortWhenNeeded_=function(i){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(i.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=i.bandwidth,o=this.pendingSegment_.duration,l=Ir.estimateSegmentRequestTime(o,a,this.playlist_,i.bytesReceived),u=eM(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=u)){var c=p4({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var d=l-u,f=d-c.rebufferingImpact,g=.5;u<=Na&&(g=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*Fi.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},t.handleAbort_=function(i){this.logger_("Aborting "+Uo(i)),this.mediaRequestsAborted+=1},t.handleProgress_=function(i,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},t.handleTrackInfo_=function(i,n){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},k4(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(i.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},t.handleTimingInfo_=function(i,n,a,o){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var l=this.pendingSegment_,u=e0(n);l[u]=l[u]||{},l[u][a]=o,this.logger_("timinginfo: "+n+" - "+a+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},t.handleCaptions_=function(i,n){var a=this;if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(n.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,i,n));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),u={};n.forEach(function(c){u[c.stream]=u[c.stream]||{startTime:1/0,captions:[],endTime:0};var d=u[c.stream];d.startTime=Math.min(d.startTime,c.startTime+l),d.endTime=Math.max(d.endTime,c.endTime+l),d.captions.push(c)}),Object.keys(u).forEach(function(c){var d=u[c],f=d.startTime,g=d.endTime,E=d.captions,S=a.inbandTextTracks_;a.logger_("adding cues from "+f+" -> "+g+" for "+c),v4(S,a.vhs_.tech_,c),ju(f,g,S[c]),y4({captionArray:E,inbandTextTracks:S,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(i,n,a){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,i,n,a));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();b4(this.inbandTextTracks_,a,this.vhs_.tech_),T4({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:l,videoDuration:this.duration_()})}},t.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(i){return i()}),this.metadataQueue_.caption.forEach(function(i){return i()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},t.processCallQueue_=function(){var i=this.callQueue_;this.callQueue_=[],i.forEach(function(n){return n()})},t.processLoadQueue_=function(){var i=this.loadQueue_;this.loadQueue_=[],i.forEach(function(n){return n()})},t.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var i=this.pendingSegment_;return i?this.getCurrentMediaInfo_()?!t0({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},t.getCurrentMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),i&&i.trackInfo||this.currentMediaInfo_},t.getMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),this.getCurrentMediaInfo_(i)||this.startingMediaInfo_},t.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},t.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var i=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!i||!n)return!1;var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed;return!(o&&!i.videoTimingInfo||a&&!this.audioDisabled_&&!l&&!i.audioTimingInfo||t0({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},t.handleData_=function(i,n){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,i,n));return}var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(i.map&&(i.map=this.initSegmentForMap(i.map,!0),a.segment.map=i.map),i.key&&this.segmentKey(i.key,!0),a.isFmp4=i.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[e0(n.type)].start;else{var o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo,u;l&&(u=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:u,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},t.updateAppendInitSegmentStatus=function(i,n){this.loaderType_==="main"&&typeof i.timestampOffset=="number"&&!i.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==i.playlist&&(this.appendInitSegment_[n]=!0)},t.getInitSegmentAndUpdateState_=function(i){var n=i.type,a=i.initSegment,o=i.map,l=i.playlist;if(o){var u=Kh(o);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=l,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},t.handleQuotaExceededError_=function(i,n){var a=this,o=i.segmentInfo,l=i.type,u=i.bytes,c=this.sourceUpdater_.audioBuffered(),d=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Za(c).join(", ")),d.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Za(d).join(", "));var f=c.length?c.start(0):0,g=c.length?c.end(c.length-1):0,E=d.length?d.start(0):0,S=d.length?d.end(d.length-1):0;if(g-f<=Iu&&S-E<=Iu){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+u.byteLength+", ")+("audio buffer: "+Za(c).join(", ")+", ")+("video buffer: "+Za(d).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:o,type:l,bytes:u}));var k=this.currentTime_(),F=k-Iu;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+F),this.remove(0,F,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+Iu+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=N.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},Iu*1e3)},!0)},t.handleAppendError_=function(i,n){var a=i.segmentInfo,o=i.type,l=i.bytes;if(n){if(n.code===nC){this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(o+" append of "+l.length+"b failed for segment "+("#"+a.mediaIndex+" in playlist "+a.playlist.id)),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(i){var n=i.segmentInfo,a=i.type,o=i.initSegment,l=i.data,u=i.bytes;if(!u){var c=[l],d=l.byteLength;o&&(c.unshift(o),d+=o.byteLength),u=g4({bytes:d,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:u}))},t.handleSegmentTimingInfo_=function(i,n,a){if(!(!this.pendingSegment_||n!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,l=i+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(i,n){var a=n.type,o=n.data;if(!(!o||!o.byteLength)&&!(a==="audio"&&this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:i.playlist,map:i.isFmp4?i.segment.map:null});this.appendToSourceBuffer_({segmentInfo:i,type:a,initSegment:l,data:o})}},t.loadSegment_=function(i){var n=this;if(this.state="WAITING",this.pendingSegment_=i,this.trimBackBuffer_(i),typeof i.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var a=jt({},i,{forceTimestampOffset:!0});jt(i,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(i)});return}this.updateTransmuxerAndRequestSegment_(i)},t.updateTransmuxerAndRequestSegment_=function(i){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(i.timestampOffset)&&(this.gopBuffer_.length=0,i.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:i.timestampOffset}));var a=this.createSimplifiedSegmentObj_(i),o=this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex),l=this.mediaIndex!==null,u=i.timeline!==this.currentTimeline_&&i.timeline>0,c=o||l&&u;this.logger_("Requesting "+Uo(i)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),i.abortRequests=l4({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,i),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",i.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",i.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(f){var g=f.message,E=f.level,S=f.stream;n.logger_(Uo(i)+" logged from transmuxer stream "+S+" as a "+E+": "+g)}})},t.trimBackBuffer_=function(i){var n=D4(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},t.createSimplifiedSegmentObj_=function(i){var n=i.segment,a=i.part,o={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:i.requestId,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,part:i.part},l=i.playlist.segments[i.mediaIndex-1];if(l&&l.timeline===n.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,i.mediaIndex+i.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=u}return n.map&&(o.map=this.initSegmentForMap(n.map)),o},t.saveTransferStats_=function(i){this.mediaRequests+=1,i&&(this.mediaBytesTransferred+=i.bytesReceived,this.mediaTransferDuration+=i.roundTripTime)},t.saveBandwidthRelatedStats_=function(i,n){if(this.pendingSegment_.byteLength=n.bytesReceived,i<Gc){this.logger_("Ignoring segment's bandwidth because its duration of "+i+(" is less than the min to record "+Gc));return}this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime},t.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},t.segmentRequestFinished_=function(i,n,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,i,n,a));return}if(this.saveTransferStats_(n.stats),!!this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(i){if(this.pendingSegment_=null,this.state="READY",i.code===fs.ABORTED)return;if(this.pause(),i.code===fs.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(i),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),o.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=E4(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(i){var n=this.syncController_.mappingForTimeline(i);n!==null&&(this.timeMapping_=n)},t.updateMediaSecondsLoaded_=function(i){typeof i.start=="number"&&typeof i.end=="number"?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(i){return i===null?!1:this.loaderType_==="main"&&i!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&i!==this.sourceUpdater_.audioTimestampOffset()},t.trueSegmentStart_=function(i){var n=i.currentStart,a=i.playlist,o=i.mediaIndex,l=i.firstVideoFrameTimeForData,u=i.currentVideoTimestampOffset,c=i.useVideoTimingInfo,d=i.videoTimingInfo,f=i.audioTimingInfo;if(typeof n<"u")return n;if(!c)return f.start;var g=a.segments[o-1];return o===0||!g||typeof g.start>"u"||g.end!==l+u?l:d.start},t.waitForAppendsToComplete_=function(i){var n=this.getCurrentMediaInfo_(i);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed,u=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&a&&!l;if(i.waitingOnAppends=0,!i.hasAppendedData_){!i.timingInfo&&typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),i.timingInfo={start:0},i.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(i),this.processMetadataQueue_()),this.checkAppendsDone_(i);return}u&&i.waitingOnAppends++,c&&i.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,i)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,i))},t.checkAppendsDone_=function(i){this.checkForAbort_(i.requestId)||(i.waitingOnAppends--,i.waitingOnAppends===0&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(i){var n=N4(this.loaderType_,this.getCurrentMediaInfo_(),i);return n?(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0):!1},t.updateSourceBufferTimestampOffset_=function(i){if(!(i.timestampOffset===null||typeof i.timingInfo.start!="number"||i.changedTimestampOffset||this.loaderType_!=="main")){var n=!1;i.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:i.segment.videoTimingInfo,audioTimingInfo:i.segment.audioTimingInfo,timingInfo:i.timingInfo}),i.changedTimestampOffset=!0,i.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(i.timestampOffset),n=!0),i.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(i.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},t.getSegmentStartTimeForTimestampOffsetCalculation_=function(i){var n=i.videoTimingInfo,a=i.audioTimingInfo,o=i.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:o.start:o.start},t.updateTimingInfoEnd_=function(i){i.timingInfo=i.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo,o=a&&i.videoTimingInfo?i.videoTimingInfo:i.audioTimingInfo;o&&(i.timingInfo.end=typeof o.end=="number"?o.end:o.start+i.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var i=this.pendingSegment_;this.updateTimingInfoEnd_(i),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=L4(i,this.sourceType_);if(n&&(n.severity==="warn"?ce.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(i),this.pendingSegment_=null,this.state="READY",i.isSyncRequest&&(this.trigger("syncinfoupdate"),!i.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+Uo(i));return}this.logger_("Appended "+Uo(i)),this.addSegmentMetadataCue_(i),this.fetchAtBuffer_=!0,this.currentTimeline_!==i.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:i.timeline})),this.currentTimeline_=i.timeline,this.trigger("syncinfoupdate");var a=i.segment,o=i.part,l=a.end&&this.currentTime_()-a.end>i.playlist.targetDuration*3,u=o&&o.end&&this.currentTime_()-o.end>i.playlist.partTargetDuration*3;if(l||u){this.logger_("bad "+(l?"segment":"part")+" "+Uo(i)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=i.mediaIndex,this.partIndex=i.partIndex,this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex)&&this.endOfStream(),this.trigger("appended"),i.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},t.recordThroughput_=function(i){if(i.duration<Gc){this.logger_("Ignoring segment's throughput because its duration of "+i.duration+(" is less than the min to record "+Gc));return}var n=this.throughput.rate,a=Date.now()-i.endOfAllRequests+1,o=Math.floor(i.byteLength/a*8*1e3);this.throughput.rate+=(o-n)/++this.throughput.count},t.addSegmentMetadataCue_=function(i){if(this.segmentMetadataTrack_){var n=i.segment,a=n.start,o=n.end;if(!(!Z_(a)||!Z_(o))){ju(a,o,this.segmentMetadataTrack_);var l=N.WebKitDataCue||N.VTTCue,u={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:i.playlist.attributes.BANDWIDTH,resolution:i.playlist.attributes.RESOLUTION,codecs:i.playlist.attributes.CODECS,byteLength:i.byteLength,uri:i.uri,timeline:i.timeline,playlist:i.playlist.id,start:a,end:o},c=JSON.stringify(u),d=new l(a,o,c);d.value=u,this.segmentMetadataTrack_.addCue(d)}}},e})(ce.EventTarget);function Hs(){}var sC=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},O4=["video","audio"],sm=function(e,t){var r=t[e+"Buffer"];return r&&r.updating||t.queuePending[e]},M4=function(e,t){for(var r=0;r<t.length;r++){var i=t[r];if(i.type==="mediaSource")return null;if(i.type===e)return r}return null},qg=function s(e,t){if(t.queue.length!==0){var r=0,i=t.queue[r];if(i.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),i.action(t),i.doneFn&&i.doneFn(),s("audio",t),s("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||sm(e,t))){if(i.type!==e){if(r=M4(e,t.queue),r===null)return;i=t.queue[r]}if(t.queue.splice(r,1),t.queuePending[e]=i,i.action(e,t),!i.doneFn){t.queuePending[e]=null,s(e,t);return}}}},aC=function(e,t){var r=t[e+"Buffer"],i=sC(e);r&&(r.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),r.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},as=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},qr={appendBuffer:function(e,t,r){return function(i,n){var a=n[i+"Buffer"];if(as(n.mediaSource,a)){n.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{a.appendBuffer(e)}catch(o){n.logger_("Error with code "+o.code+" "+(o.code===nC?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+t.mediaIndex+" to "+i+"Buffer")),n.queuePending[i]=null,r(o)}}}},remove:function(e,t){return function(r,i){var n=i[r+"Buffer"];if(as(i.mediaSource,n)){i.logger_("Removing "+e+" to "+t+" from "+r+"Buffer");try{n.remove(e,t)}catch{i.logger_("Remove "+e+" to "+t+" from "+r+"Buffer failed")}}}},timestampOffset:function(e){return function(t,r){var i=r[t+"Buffer"];as(r.mediaSource,i)&&(r.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},callback:function(e){return function(t,r){e()}},endOfStream:function(e){return function(t){if(t.mediaSource.readyState==="open"){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(r){ce.log.warn("Failed to call media source endOfStream",r)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(r){ce.log.warn("Failed to set media source duration",r)}}},abort:function(){return function(e,t){if(t.mediaSource.readyState==="open"){var r=t[e+"Buffer"];if(as(t.mediaSource,r)){t.logger_("calling abort on "+e+"Buffer");try{r.abort()}catch(i){ce.log.warn("Failed to abort on "+e+"Buffer",i)}}}}},addSourceBuffer:function(e,t){return function(r){var i=sC(e),n=rc(t);r.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=r.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",r["on"+i+"UpdateEnd_"]),a.addEventListener("error",r["on"+i+"Error_"]),r.codecs[e]=t,r[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var r=t[e+"Buffer"];if(aC(e,t),!!as(t.mediaSource,r)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(r)}catch(i){ce.log.warn("Failed to removeSourceBuffer "+e+"Buffer",i)}}}},changeType:function(e){return function(t,r){var i=r[t+"Buffer"],n=rc(e);if(as(r.mediaSource,i)&&r.codecs[t]!==e){r.logger_("changing "+t+"Buffer codec from "+r.codecs[t]+" to "+e);try{i.changeType(n),r.codecs[t]=e}catch(a){ce.log.warn("Failed to changeType on "+t+"Buffer",a)}}}}},zr=function(e){var t=e.type,r=e.sourceUpdater,i=e.action,n=e.doneFn,a=e.name;r.queue.push({type:t,action:i,doneFn:n,name:a}),qg(t,r)},r0=function(e,t){return function(r){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}qg(e,t)}},oC=(function(s){Be(e,s);function e(r){var i;return i=s.call(this)||this,i.mediaSource=r,i.sourceopenListener_=function(){return qg("mediaSource",rt(i))},i.mediaSource.addEventListener("sourceopen",i.sourceopenListener_),i.logger_=Mn("SourceUpdater"),i.audioTimestampOffset_=0,i.videoTimestampOffset_=0,i.queue=[],i.queuePending={audio:null,video:null},i.delayedAudioAppendQueue_=[],i.videoAppendQueued_=!1,i.codecs={},i.onVideoUpdateEnd_=r0("video",rt(i)),i.onAudioUpdateEnd_=r0("audio",rt(i)),i.onVideoError_=function(n){i.videoError_=n},i.onAudioError_=function(n){i.audioError_=n},i.createdSourceBuffers_=!1,i.initializedEme_=!1,i.triggeredReady_=!1,i}var t=e.prototype;return t.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},t.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},t.hasInitializedAnyEme=function(){return this.initializedEme_},t.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},t.createSourceBuffers=function(i){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(i),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},t.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},t.addSourceBuffer=function(i,n){zr({type:"mediaSource",sourceUpdater:this,action:qr.addSourceBuffer(i,n),name:"addSourceBuffer"})},t.abort=function(i){zr({type:i,sourceUpdater:this,action:qr.abort(i),name:"abort"})},t.removeSourceBuffer=function(i){if(!this.canRemoveSourceBuffer()){ce.log.error("removeSourceBuffer is not supported!");return}zr({type:"mediaSource",sourceUpdater:this,action:qr.removeSourceBuffer(i),name:"removeSourceBuffer"})},t.canRemoveSourceBuffer=function(){return!ce.browser.IE_VERSION&&!ce.browser.IS_FIREFOX&&N.MediaSource&&N.MediaSource.prototype&&typeof N.MediaSource.prototype.removeSourceBuffer=="function"},e.canChangeType=function(){return N.SourceBuffer&&N.SourceBuffer.prototype&&typeof N.SourceBuffer.prototype.changeType=="function"},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(i,n){if(!this.canChangeType()){ce.log.error("changeType is not supported!");return}zr({type:i,sourceUpdater:this,action:qr.changeType(n),name:"changeType"})},t.addOrChangeSourceBuffers=function(i){var n=this;if(!i||typeof i!="object"||Object.keys(i).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(i).forEach(function(a){var o=i[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,o);n.canChangeType()&&n.changeType(a,o)})},t.appendBuffer=function(i,n){var a=this,o=i.segmentInfo,l=i.type,u=i.bytes;if(this.processedAppend_=!0,l==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([i,n]),this.logger_("delayed audio append of "+u.length+" until video append");return}var c=n;if(zr({type:l,sourceUpdater:this,action:qr.appendBuffer(u,o||{mediaIndex:-1},c),doneFn:n,name:"appendBuffer"}),l==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var d=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+d.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,d.forEach(function(f){a.appendBuffer.apply(a,f)})}},t.audioBuffered=function(){return as(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ce.createTimeRange()},t.videoBuffered=function(){return as(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ce.createTimeRange()},t.buffered=function(){var i=as(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=as(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!i?this.audioBuffered():i&&!n?this.videoBuffered():ZO(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(i,n){n===void 0&&(n=Hs),zr({type:"mediaSource",sourceUpdater:this,action:qr.duration(i),name:"duration",doneFn:n})},t.endOfStream=function(i,n){i===void 0&&(i=null),n===void 0&&(n=Hs),typeof i!="string"&&(i=void 0),zr({type:"mediaSource",sourceUpdater:this,action:qr.endOfStream(i),name:"endOfStream",doneFn:n})},t.removeAudio=function(i,n,a){if(a===void 0&&(a=Hs),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}zr({type:"audio",sourceUpdater:this,action:qr.remove(i,n),doneFn:a,name:"remove"})},t.removeVideo=function(i,n,a){if(a===void 0&&(a=Hs),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}zr({type:"video",sourceUpdater:this,action:qr.remove(i,n),doneFn:a,name:"remove"})},t.updating=function(){return!!(sm("audio",this)||sm("video",this))},t.audioTimestampOffset=function(i){return typeof i<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==i&&(zr({type:"audio",sourceUpdater:this,action:qr.timestampOffset(i),name:"timestampOffset"}),this.audioTimestampOffset_=i),this.audioTimestampOffset_},t.videoTimestampOffset=function(i){return typeof i<"u"&&this.videoBuffer&&this.videoTimestampOffset!==i&&(zr({type:"video",sourceUpdater:this,action:qr.timestampOffset(i),name:"timestampOffset"}),this.videoTimestampOffset_=i),this.videoTimestampOffset_},t.audioQueueCallback=function(i){this.audioBuffer&&zr({type:"audio",sourceUpdater:this,action:qr.callback(i),name:"callback"})},t.videoQueueCallback=function(i){this.videoBuffer&&zr({type:"video",sourceUpdater:this,action:qr.callback(i),name:"callback"})},t.dispose=function(){var i=this;this.trigger("dispose"),O4.forEach(function(n){i.abort(n),i.canRemoveSourceBuffer()?i.removeSourceBuffer(n):i[n+"QueueCallback"](function(){return aC(n,i)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e})(ce.EventTarget),n0=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},s0=new Uint8Array(`
|
|
341
|
+
|
|
342
|
+
`.split("").map(function(s){return s.charCodeAt(0)})),R4=(function(s){Be(e,s);function e(){return s.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return e})($p(Error)),B4=(function(s){Be(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,n.mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=r.featuresNativeTextTracks,n.loadVttJs=r.loadVttJs,n.shouldSaveSegmentTimingInfo_=!1,n}var t=e.prototype;return t.createTransmuxer_=function(){return null},t.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ce.createTimeRanges();var i=this.subtitlesTrack_.cues,n=i[0].startTime,a=i[i.length-1].startTime;return ce.createTimeRanges([[n,a]])},t.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=Kh(i),o=this.initSegments_[a];if(n&&!o&&i.bytes){var l=s0.byteLength+i.bytes.byteLength,u=new Uint8Array(l);u.set(i.bytes),u.set(s0,i.bytes.byteLength),this.initSegments_[a]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:u}}return o||i},t.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.track=function(i){return typeof i>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=i,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},t.remove=function(i,n){ju(i,n,this.subtitlesTrack_)},t.fillBuffer_=function(){var i=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var a=function(){i.state="READY",i.paused()||i.monitorBuffer_()};this.syncController_.one("timestampoffset",a),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(i){for(;i&&i.segment.empty;){if(i.mediaIndex+1>=i.playlist.segments.length){i=null;break}i=this.generateSegmentInfo_({playlist:i.playlist,mediaIndex:i.mediaIndex+1,startOfSegment:i.startOfSegment+i.duration,isSyncRequest:i.isSyncRequest})}return i},t.stopForError=function(i){this.error(i),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(i,n,a){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(i){i.code===fs.TIMEOUT&&this.handleTimeout_(),i.code===fs.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(i);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=l.segment;if(u.map&&(u.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof N.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(i,n,a)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}u.requested=!0;try{this.parseVTTCues_(l)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,l.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new N.VTTCue(c.startTime,c.endTime,c.text):c)}),S4(this.subtitlesTrack_),this.handleAppendsDone_()},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(i){var n,a=!1;if(typeof N.WebVTT!="function")throw new R4;typeof N.TextDecoder=="function"?n=new N.TextDecoder("utf8"):(n=N.WebVTT.StringDecoder(),a=!0);var o=new N.WebVTT.Parser(N,N.vttjs,n);if(i.cues=[],i.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=i.cues.push.bind(i.cues),o.ontimestampmap=function(c){i.timestampmap=c},o.onparsingerror=function(c){ce.log.warn("Error encountered when parsing cues: "+c.message)},i.segment.map){var l=i.segment.map.bytes;a&&(l=n0(l)),o.parse(l)}var u=i.bytes;a&&(u=n0(u)),o.parse(u),o.flush()},t.updateTimeMapping_=function(i,n,a){var o=i.segment;if(n){if(!i.cues.length){o.empty=!0;return}var l=i.timestampmap,u=l.MPEGTS/Rh.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(i.cues.forEach(function(f){f.startTime+=u,f.endTime+=u}),!a.syncInfo){var c=i.cues[0].startTime,d=i.cues[i.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+i.mediaIndex,time:Math.min(c,d-o.duration)}}}},e})(nm),U4=function(e,t){for(var r=e.cues,i=0;i<r.length;i++){var n=r[i];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},F4=function(e,t,r){if(r===void 0&&(r=0),!!e.segments)for(var i=r,n,a=0;a<e.segments.length;a++){var o=e.segments[a];if(n||(n=U4(t,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new N.VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),u=l[0],c=l[1];n=new N.VTTCue(i,i+o.duration,""),n.adStartTime=i-u,n.adEndTime=n.adStartTime+c,t.addCue(n)}i+=o.duration}},$4=86400,a0=[{name:"VOD",run:function(e,t,r,i,n){if(r!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(e,t,r,i,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=Yp(t);n=n||0;for(var u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),d=l[c],f=d.segment,g=e.timelineToDatetimeMappings[f.timeline];if(!(!g||!f.dateTimeObject)){var E=f.dateTimeObject.getTime()/1e3,S=E+g;if(f.parts&&typeof d.partIndex=="number")for(var k=0;k<d.partIndex;k++)S+=f.parts[k].duration;var F=Math.abs(n-S);if(o!==null&&(F===0||o<F))break;o=F,a={time:S,segmentIndex:d.segmentIndex,partIndex:d.partIndex}}}return a}},{name:"Segment",run:function(e,t,r,i,n){var a=null,o=null;n=n||0;for(var l=Yp(t),u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),d=l[c],f=d.segment,g=d.part&&d.part.start||f&&f.start;if(f.timeline===i&&typeof g<"u"){var E=Math.abs(n-g);if(o!==null&&o<E)break;(!a||o===null||o>=E)&&(o=E,a={time:g,segmentIndex:d.segmentIndex,partIndex:d.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,r,i,n){var a=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var u=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,d=e.discontinuities[c];if(d){var f=Math.abs(n-d.time);if(o!==null&&o<f)break;(!a||o===null||o>=f)&&(o=f,a={time:d.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,r,i,n){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],j4=(function(s){Be(e,s);function e(r){var i;return i=s.call(this)||this,i.timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=Mn("SyncController"),i}var t=e.prototype;return t.getSyncPoint=function(i,n,a,o){var l=this.runStrategies_(i,n,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(i,n){if(!i||!i.segments)return null;var a=this.runStrategies_(i,n,i.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Xu({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(i,n,a,o){for(var l=[],u=0;u<a0.length;u++){var c=a0[u],d=c.run(this,i,n,a,o);d&&(d.strategy=c.name,l.push({strategy:c.name,syncPoint:d}))}return l},t.selectSyncPoint_=function(i,n){for(var a=i[0].syncPoint,o=Math.abs(i[0].syncPoint[n.key]-n.value),l=i[0].strategy,u=1;u<i.length;u++){var c=Math.abs(i[u].syncPoint[n.key]-n.value);c<o&&(o=c,a=i[u].syncPoint,l=i[u].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex)+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},t.saveExpiredSegmentInfo=function(i,n){var a=n.mediaSequence-i.mediaSequence;if(a>$4){ce.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");return}for(var o=a-1;o>=0;o--){var l=i.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:i.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(i){if(this.timelineToDatetimeMappings={},i.segments&&i.segments.length&&i.segments[0].dateTimeObject){var n=i.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},t.saveSegmentTimingInfo=function(i){var n=i.segmentInfo,a=i.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var u=l.dateTimeObject;l.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[l.timeline]=-(u.getTime()/1e3))},t.timestampOffsetForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].time},t.mappingForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].mapping},t.calculateSegmentTimeMapping_=function(i,n,a){var o=i.segment,l=i.part,u=this.timelines[i.timeline],c,d;if(typeof i.timestampOffset=="number")u={time:i.startOfSegment,mapping:i.startOfSegment-n.start},a&&(this.timelines[i.timeline]=u,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+i.timeline+": "+("[time: "+u.time+"] [mapping: "+u.mapping+"]"))),c=i.startOfSegment,d=n.end+u.mapping;else if(u)c=n.start+u.mapping,d=n.end+u.mapping;else return!1;return l&&(l.start=c,l.end=d),(!o.start||c<o.start)&&(o.start=c),o.end=d,!0},t.saveDiscontinuitySyncInfo_=function(i){var n=i.playlist,a=i.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],u=n.discontinuitySequence+o+1,c=l-i.mediaIndex,d=Math.abs(c);if(!this.discontinuities[u]||this.discontinuities[u].accuracy>d){var f=void 0;c<0?f=a.start-Xu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex,endIndex:l}):f=a.end+Xu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex+1,endIndex:l}),this.discontinuities[u]={time:f,accuracy:d}}}},t.dispose=function(){this.trigger("dispose"),this.off()},e})(ce.EventTarget),H4=(function(s){Be(e,s);function e(){var r;return r=s.call(this)||this,r.pendingTimelineChanges_={},r.lastTimelineChanges_={},r}var t=e.prototype;return t.clearPendingTimelineChange=function(i){this.pendingTimelineChanges_[i]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(i){var n=i.type,a=i.from,o=i.to;return typeof a=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},t.lastTimelineChange=function(i){var n=i.type,a=i.from,o=i.to;return typeof a=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},e})(ce.EventTarget),V4=G2(K2(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function e(H,$,G){return G={path:$,exports:{},require:function(Y,P){return t(Y,P??G.path)}},H(G,G.exports),G.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var r=e(function(H){function $(K,Y){for(var P=0;P<Y.length;P++){var O=Y[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(K,O.key,O)}}function G(K,Y,P){return Y&&$(K.prototype,Y),P&&$(K,P),K}H.exports=G,H.exports.default=H.exports,H.exports.__esModule=!0}),i=e(function(H){function $(G,K){return H.exports=$=Object.setPrototypeOf||function(P,O){return P.__proto__=O,P},H.exports.default=H.exports,H.exports.__esModule=!0,$(G,K)}H.exports=$,H.exports.default=H.exports,H.exports.__esModule=!0}),n=e(function(H){function $(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,i(G,K)}H.exports=$,H.exports.default=H.exports,H.exports.__esModule=!0}),a=(function(){function H(){this.listeners={}}var $=H.prototype;return $.on=function(K,Y){this.listeners[K]||(this.listeners[K]=[]),this.listeners[K].push(Y)},$.off=function(K,Y){if(!this.listeners[K])return!1;var P=this.listeners[K].indexOf(Y);return this.listeners[K]=this.listeners[K].slice(0),this.listeners[K].splice(P,1),P>-1},$.trigger=function(K){var Y=this.listeners[K];if(Y)if(arguments.length===2)for(var P=Y.length,O=0;O<P;++O)Y[O].call(this,arguments[1]);else for(var ne=Array.prototype.slice.call(arguments,1),te=Y.length,re=0;re<te;++re)Y[re].apply(this,ne)},$.dispose=function(){this.listeners={}},$.pipe=function(K){this.on("data",function(Y){K.push(Y)})},H})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(H){return H.subarray(0,H.byteLength-H[H.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var l=function(){var $=[[[],[],[],[],[]],[[],[],[],[],[]]],G=$[0],K=$[1],Y=G[4],P=K[4],O,ne,te,re=[],me=[],Se,Ae,ve,Te,ye,_e;for(O=0;O<256;O++)me[(re[O]=O<<1^(O>>7)*283)^O]=O;for(ne=te=0;!Y[ne];ne^=Se||1,te=me[te]||1)for(Te=te^te<<1^te<<2^te<<3^te<<4,Te=Te>>8^Te&255^99,Y[ne]=Te,P[Te]=ne,ve=re[Ae=re[Se=re[ne]]],_e=ve*16843009^Ae*65537^Se*257^ne*16843008,ye=re[Te]*257^Te*16843008,O=0;O<4;O++)G[O][ne]=ye=ye<<24^ye>>>8,K[O][Te]=_e=_e<<24^_e>>>8;for(O=0;O<5;O++)G[O]=G[O].slice(0),K[O]=K[O].slice(0);return $},u=null,c=(function(){function H(G){u||(u=l()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var K,Y,P,O=this._tables[0][4],ne=this._tables[1],te=G.length,re=1;if(te!==4&&te!==6&&te!==8)throw new Error("Invalid aes key size");var me=G.slice(0),Se=[];for(this._key=[me,Se],K=te;K<4*te+28;K++)P=me[K-1],(K%te===0||te===8&&K%te===4)&&(P=O[P>>>24]<<24^O[P>>16&255]<<16^O[P>>8&255]<<8^O[P&255],K%te===0&&(P=P<<8^P>>>24^re<<24,re=re<<1^(re>>7)*283)),me[K]=me[K-te]^P;for(Y=0;K;Y++,K--)P=me[Y&3?K:K-4],K<=4||Y<4?Se[Y]=P:Se[Y]=ne[0][O[P>>>24]]^ne[1][O[P>>16&255]]^ne[2][O[P>>8&255]]^ne[3][O[P&255]]}var $=H.prototype;return $.decrypt=function(K,Y,P,O,ne,te){var re=this._key[1],me=K^re[0],Se=O^re[1],Ae=P^re[2],ve=Y^re[3],Te,ye,_e,xe=re.length/4-2,qe,We=4,Ke=this._tables[1],ze=Ke[0],xt=Ke[1],Qt=Ke[2],wt=Ke[3],Jt=Ke[4];for(qe=0;qe<xe;qe++)Te=ze[me>>>24]^xt[Se>>16&255]^Qt[Ae>>8&255]^wt[ve&255]^re[We],ye=ze[Se>>>24]^xt[Ae>>16&255]^Qt[ve>>8&255]^wt[me&255]^re[We+1],_e=ze[Ae>>>24]^xt[ve>>16&255]^Qt[me>>8&255]^wt[Se&255]^re[We+2],ve=ze[ve>>>24]^xt[me>>16&255]^Qt[Se>>8&255]^wt[Ae&255]^re[We+3],We+=4,me=Te,Se=ye,Ae=_e;for(qe=0;qe<4;qe++)ne[(3&-qe)+te]=Jt[me>>>24]<<24^Jt[Se>>16&255]<<16^Jt[Ae>>8&255]<<8^Jt[ve&255]^re[We++],Te=me,me=Se,Se=Ae,Ae=ve,ve=Te},H})(),d=(function(H){n($,H);function $(){var K;return K=H.call(this,a)||this,K.jobs=[],K.delay=1,K.timeout_=null,K}var G=$.prototype;return G.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},G.push=function(Y){this.jobs.push(Y),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},$})(a),f=function($){return $<<24|($&65280)<<8|($&16711680)>>8|$>>>24},g=function($,G,K){var Y=new Int32Array($.buffer,$.byteOffset,$.byteLength>>2),P=new c(Array.prototype.slice.call(G)),O=new Uint8Array($.byteLength),ne=new Int32Array(O.buffer),te,re,me,Se,Ae,ve,Te,ye,_e;for(te=K[0],re=K[1],me=K[2],Se=K[3],_e=0;_e<Y.length;_e+=4)Ae=f(Y[_e]),ve=f(Y[_e+1]),Te=f(Y[_e+2]),ye=f(Y[_e+3]),P.decrypt(Ae,ve,Te,ye,ne,_e),ne[_e]=f(ne[_e]^te),ne[_e+1]=f(ne[_e+1]^re),ne[_e+2]=f(ne[_e+2]^me),ne[_e+3]=f(ne[_e+3]^Se),te=Ae,re=ve,me=Te,Se=ye;return O},E=(function(){function H(G,K,Y,P){var O=H.STEP,ne=new Int32Array(G.buffer),te=new Uint8Array(G.byteLength),re=0;for(this.asyncStream_=new d,this.asyncStream_.push(this.decryptChunk_(ne.subarray(re,re+O),K,Y,te)),re=O;re<ne.length;re+=O)Y=new Uint32Array([f(ne[re-4]),f(ne[re-3]),f(ne[re-2]),f(ne[re-1])]),this.asyncStream_.push(this.decryptChunk_(ne.subarray(re,re+O),K,Y,te));this.asyncStream_.push(function(){P(null,o(te))})}var $=H.prototype;return $.decryptChunk_=function(K,Y,P,O){return function(){var ne=g(K,Y,P);O.set(ne,K.byteOffset)}},r(H,null,[{key:"STEP",get:function(){return 32e3}}]),H})(),S;typeof window<"u"?S=window:typeof s<"u"?S=s:typeof self<"u"?S=self:S={};var k=S,F=function($){return ArrayBuffer.isView==="function"?ArrayBuffer.isView($):$&&$.buffer instanceof ArrayBuffer},L=k.BigInt||Number;L("0x1"),L("0x100"),L("0x10000"),L("0x1000000"),L("0x100000000"),L("0x10000000000"),L("0x1000000000000"),L("0x100000000000000"),L("0x10000000000000000");var W=function($){var G={};return Object.keys($).forEach(function(K){var Y=$[K];F(Y)?G[K]={bytes:Y.buffer,byteOffset:Y.byteOffset,byteLength:Y.byteLength}:G[K]=Y}),G};self.onmessage=function(H){var $=H.data,G=new Uint8Array($.encrypted.bytes,$.encrypted.byteOffset,$.encrypted.byteLength),K=new Uint32Array($.key.bytes,$.key.byteOffset,$.key.byteLength/4),Y=new Uint32Array($.iv.bytes,$.iv.byteOffset,$.iv.byteLength/4);new E(G,K,Y,function(P,O){self.postMessage(W({source:$.source,decrypted:O}),[O.buffer])})}})),q4=W2(V4),z4=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Jh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},am=function(e,t){t.activePlaylistLoader=e,e.load()},W4=function(e,t){return function(){var r=t.segmentLoaders,i=r[e],n=r.main,a=t.mediaTypes[e],o=a.activeTrack(),l=a.getActiveGroup(),u=a.activePlaylistLoader,c=a.lastGroup_;if(!(l&&c&&l.id===c.id)&&(a.lastGroup_=l,a.lastTrack_=o,Jh(i,a),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){u&&n.resetEverything();return}i.resyncLoader(),am(l.playlistLoader,a)}}},G4=function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e];i.lastGroup_=null,r.abort(),r.pause()}},K4=function(e,t){return function(){var r=t.masterPlaylistLoader,i=t.segmentLoaders,n=i[e],a=i.main,o=t.mediaTypes[e],l=o.activeTrack(),u=o.getActiveGroup(),c=o.activePlaylistLoader,d=o.lastTrack_;if(!(d&&l&&d.id===l.id)&&(o.lastGroup_=u,o.lastTrack_=l,Jh(n,o),!!u)){if(u.isMasterPlaylist){if(!l||!d||l.id===d.id)return;var f=t.vhs.masterPlaylistController_,g=f.selectPlaylist();if(f.media()===g)return;o.logger_("track change. Switching master audio from "+d.id+" to "+l.id),r.pause(),a.resetEverything(),f.fastQualityChange_(g);return}if(e==="AUDIO"){if(!u.playlistLoader){a.setAudio(!0),a.resetEverything();return}n.setAudio(!0),a.setAudio(!1)}if(c===u.playlistLoader){am(u.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),am(u.playlistLoader,o)}}},Zh={AUDIO:function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;Jh(r,i);var a=i.activeTrack(),o=i.activeGroup(),l=(o.filter(function(d){return d.default})[0]||o[0]).id,u=i.tracks[l];if(a===u){n({message:"Problem encountered loading the default audio track."});return}ce.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in i.tracks)i.tracks[c].enabled=i.tracks[c]===u;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e];ce.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Jh(r,i);var n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}}},o0={AUDIO:function(e,t,r){if(t){var i=r.tech,n=r.requestOptions,a=r.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,n),(!i.paused()||o.endList&&i.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),i.paused()||a.load()}),t.on("error",Zh[e](e,r))}},SUBTITLES:function(e,t,r){var i=r.tech,n=r.requestOptions,a=r.segmentLoaders[e],o=r.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,n),a.track(o.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),i.paused()||a.load()}),t.on("error",Zh[e](e,r))}},X4={AUDIO:function(e,t){var r=t.vhs,i=t.sourceType,n=t.segmentLoaders[e],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,d=l.logger_,f=t.masterPlaylistLoader,g=Ec(f.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},g&&(o[e].main.default.playlists=f.master.playlists));for(var E in o[e]){u[E]||(u[E]=[]);for(var S in o[e][E]){var k=o[e][E][S],F=void 0;if(g?(d("AUDIO group '"+E+"' label '"+S+"' is a master playlist"),k.isMasterPlaylist=!0,F=null):i==="vhs-json"&&k.playlists?F=new Ko(k.playlists[0],r,a):k.resolvedUri?F=new Ko(k.resolvedUri,r,a):k.playlists&&i==="dash"?F=new im(k.playlists[0],r,a,f):F=null,k=ce.mergeOptions({id:S,playlistLoader:F},k),o0[e](e,k.playlistLoader,t),u[E].push(k),typeof c[S]>"u"){var L=new ce.AudioTrack({id:S,kind:z4(k),enabled:!1,language:k.language,default:k.default,label:S});c[S]=L}}}n.on("error",Zh[e](e,t))},SUBTITLES:function(e,t){var r=t.tech,i=t.vhs,n=t.sourceType,a=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,u=t.mediaTypes[e],c=u.groups,d=u.tracks,f=t.masterPlaylistLoader;for(var g in l[e]){c[g]||(c[g]=[]);for(var E in l[e][g])if(!l[e][g][E].forced){var S=l[e][g][E],k=void 0;if(n==="hls")k=new Ko(S.resolvedUri,i,o);else if(n==="dash"){var F=S.playlists.filter(function(W){return W.excludeUntil!==1/0});if(!F.length)return;k=new im(S.playlists[0],i,o,f)}else n==="vhs-json"&&(k=new Ko(S.playlists?S.playlists[0]:S.resolvedUri,i,o));if(S=ce.mergeOptions({id:E,playlistLoader:k},S),o0[e](e,S.playlistLoader,t),c[g].push(S),typeof d[E]>"u"){var L=r.addRemoteTextTrack({id:E,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:E},!1).track;d[E]=L}}}a.on("error",Zh[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var r=t.tech,i=t.master.mediaGroups,n=t.mediaTypes[e],a=n.groups,o=n.tracks;for(var l in i[e]){a[l]||(a[l]=[]);for(var u in i[e][l]){var c=i[e][l][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var d=r.options_.vhs&&r.options_.vhs.captionServices||{},f={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(d[f.instreamId]&&(f=ce.mergeOptions(f,d[f.instreamId])),f.default===void 0&&delete f.default,a[l].push(ce.mergeOptions({id:u},c)),typeof o[u]>"u"){var g=r.addRemoteTextTrack({id:f.instreamId,kind:"captions",default:f.default,language:f.language,label:f.label},!1).track;o[u]=g}}}}}},Y4=function s(e,t){for(var r=0;r<e.length;r++)if($g(t,e[r])||e[r].playlists&&s(e[r].playlists,t))return!0;return!1},Q4=function(e,t){return function(r){var i=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var o=null;a.attributes[e]&&(o=n[a.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&Ec(t.master))for(var u=0;u<l.length;u++){var c=n[l[u]];if(Y4(c,a)){o=c;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof r>"u"?o:r===null||!o?null:o.filter(function(d){return d.id===r.id})[0]||null}},J4={AUDIO:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var i in r)if(r[i].enabled)return r[i];return null}},SUBTITLES:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var i in r)if(r[i].mode==="showing"||r[i].mode==="hidden")return r[i];return null}}},Z4=function(e,t){var r=t.mediaTypes;return function(){var i=r[e].activeTrack();return i?r[e].activeGroup(i):null}},e3=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(E){X4[E](E,e)});var t=e.mediaTypes,r=e.masterPlaylistLoader,i=e.tech,n=e.vhs,a=e.segmentLoaders,o=a.AUDIO,l=a.main;["AUDIO","SUBTITLES"].forEach(function(E){t[E].activeGroup=Q4(E,e),t[E].activeTrack=J4[E](E,e),t[E].onGroupChanged=W4(E,e),t[E].onGroupChanging=G4(E,e),t[E].onTrackChanged=K4(E,e),t[E].getActiveGroup=Z4(E,e)});var u=t.AUDIO.activeGroup();if(u){var c=(u.filter(function(E){return E.default})[0]||u[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var d=t.AUDIO.getActiveGroup();d.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanging()})});var f=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",f),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){i.audioTracks().removeEventListener("change",f),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var g in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[g])},t3=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Hs,activeTrack:Hs,getActiveGroup:Hs,onGroupChanged:Hs,onTrackChanged:Hs,lastTrack_:null,logger_:Mn("MediaGroups["+t+"]")}}),e},i3=120,Rs,r3=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],n3=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},s3=function(e){var t=e.currentPlaylist,r=e.buffered,i=e.currentTime,n=e.nextPlaylist,a=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,u=e.experimentalBufferBasedABR,c=e.log;if(!n)return ce.log.warn("We received no playlist to switch to. Please check your stream."),!1;var d="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return c(d+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var f=!!Go(r,i).length;if(!t.endList)return!f&&typeof t.partTargetDuration=="number"?(c("not "+d+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(d+" as current playlist is live"),!0);var g=Bg(r,i),E=u?Fi.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Fi.MAX_BUFFER_LOW_WATER_LINE;if(l<E)return c(d+" as duration < max low water line ("+l+" < "+E+")"),!0;var S=n.attributes.BANDWIDTH,k=t.attributes.BANDWIDTH;if(S<k&&(!u||g<o)){var F=d+" as next bandwidth < current bandwidth ("+S+" < "+k+")";return u&&(F+=" and forwardBuffer < bufferHighWaterLine ("+g+" < "+o+")"),c(F),!0}if((!u||S>k)&&g>=a){var L=d+" as forwardBuffer >= bufferLowWaterLine ("+g+" >= "+a+")";return u&&(L+=" and next bandwidth > current bandwidth ("+S+" > "+k+")"),c(L),!0}return c("not "+d+" as no switching criteria met"),!1},a3=(function(s){Be(e,s);function e(r){var i;i=s.call(this)||this;var n=r.src,a=r.handleManifestRedirects,o=r.withCredentials,l=r.tech,u=r.bandwidth,c=r.externVhs,d=r.useCueTags,f=r.blacklistDuration,g=r.enableLowInitialPlaylist,E=r.sourceType,S=r.cacheEncryptionKeys,k=r.experimentalBufferBasedABR,F=r.experimentalLeastPixelDiffSelector,L=r.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var W=r.maxPlaylistRetries;(W===null||typeof W>"u")&&(W=1/0),Rs=c,i.experimentalBufferBasedABR=!!k,i.experimentalLeastPixelDiffSelector=!!F,i.withCredentials=o,i.tech_=l,i.vhs_=l.vhs,i.sourceType_=E,i.useCueTags_=d,i.blacklistDuration=f,i.maxPlaylistRetries=W,i.enableLowInitialPlaylist=g,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:W,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=t3(),i.mediaSource=new N.MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind(rt(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind(rt(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind(rt(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=ce.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new j4(r),i.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new q4,i.sourceUpdater_=new oC(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new H4;var H={vhs:i.vhs_,parse708captions:r.parse708captions,useDtsForTimestampOffset:r.useDtsForTimestampOffset,captionServices:L,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:u,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:S,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:r.experimentalExactManifestTimings};i.masterPlaylistLoader_=i.sourceType_==="dash"?new im(n,i.vhs_,i.requestOptions_):new Ko(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new nm(ce.mergeOptions(H,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),r),i.audioSegmentLoader_=new nm(ce.mergeOptions(H,{loaderType:"audio"}),r),i.subtitleSegmentLoader_=new B4(ce.mergeOptions(H,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(K,Y){function P(){l.off("vttjserror",O),K()}function O(){l.off("vttjsloaded",P),Y()}l.one("vttjsloaded",P),l.one("vttjserror",O),l.addWebVttScript_()})}}),r),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",function(){return i.startABRTimer_()}),i.tech_.on("pause",function(){return i.stopABRTimer_()}),i.tech_.on("play",function(){return i.startABRTimer_()})),r3.forEach(function(G){i[G+"_"]=n3.bind(rt(i),G)}),i.logger_=Mn("MPC"),i.triggeredFmp4Usage=!1,i.tech_.preload()==="none"?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var $=i.tech_.preload()==="none"?"play":"loadstart";return i.tech_.one($,function(){var G=Date.now();i.tech_.one("loadeddata",function(){i.timeToLoadedData__=Date.now()-G,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends})}),i}var t=e.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var i=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return i===-1||n===-1?-1:i+n},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(i){i===void 0&&(i="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,i)},t.switchMedia_=function(i,n,a){var o=this.media(),l=o&&(o.id||o.uri),u=i.id||i.uri;l&&l!==u&&(this.logger_("switch media "+l+" -> "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(i,a)},t.startABRTimer_=function(){var i=this;this.stopABRTimer_(),this.abrTimer_=N.setInterval(function(){return i.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(N.clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var i=this.master(),n=i&&i.playlists||[];if(!i||!i.mediaGroups||!i.mediaGroups.AUDIO)return n;var a=i.mediaGroups.AUDIO,o=Object.keys(a),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var u=a.main||o.length&&a[o[0]];for(var c in u)if(u[c].default){l={label:c};break}}if(!l)return n;var d=[];for(var f in a)if(a[f][l.label]){var g=a[f][l.label];if(g.playlists&&g.playlists.length)d.push.apply(d,g.playlists);else if(g.uri)d.push(g);else if(i.playlists.length)for(var E=0;E<i.playlists.length;E++){var S=i.playlists[E];S.attributes&&S.attributes.AUDIO&&S.attributes.AUDIO===f&&d.push(S)}}return d.length?d:n},t.setupMasterPlaylistLoaderListeners_=function(){var i=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=i.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;Qp(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=a,n.endList&&i.tech_.preload()!=="none"&&(i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load()),e3({sourceType:i.sourceType_,segmentLoaders:{AUDIO:i.audioSegmentLoader_,SUBTITLES:i.subtitleSegmentLoader_,main:i.mainSegmentLoader_},tech:i.tech_,requestOptions:i.requestOptions_,masterPlaylistLoader:i.masterPlaylistLoader_,vhs:i.vhs_,master:i.master(),mediaTypes:i.mediaTypes_,blacklistCurrentPlaylist:i.blacklistCurrentPlaylist.bind(i)}),i.triggerPresenceUsage_(i.master(),n),i.setupFirstPlay(),!i.mediaTypes_.AUDIO.activePlaylistLoader||i.mediaTypes_.AUDIO.activePlaylistLoader.media()?i.trigger("selectedinitialmedia"):i.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){i.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){i.loadOnPlay_&&i.tech_.off("play",i.loadOnPlay_);var n=i.masterPlaylistLoader_.media();if(!n){i.excludeUnsupportedVariants_();var a;if(i.enableLowInitialPlaylist&&(a=i.selectInitialPlaylist()),a||(a=i.selectPlaylist()),!a||!i.shouldSwitchToMedia_(a))return;i.initialMedia_=a,i.switchMedia_(i.initialMedia_,"initial");var o=i.sourceType_==="vhs-json"&&i.initialMedia_.segments;if(!o)return;n=i.initialMedia_}i.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){i.mainSegmentLoader_.abort(),i.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=i.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;Qp(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=a,i.masterPlaylistLoader_.load(),i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load(),i.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=i.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var a=i.stuckAtPlaylistEnd_(n);a&&(i.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),i.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(i){this.useCueTags_&&this.updateAdCues_(i),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.updateDuration(!i.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(i,n){var a=i.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var u in a.AUDIO)for(var c in a.AUDIO[u]){var d=a.AUDIO[u][c];d.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Rs.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(i){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),u=this.tech_.buffered();return s3({buffered:u,currentTime:a,currentPlaylist:n,nextPlaylist:i,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var i=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){i.checkABR_("bandwidthupdate"),i.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){i.experimentalBufferBasedABR&&i.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){i.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){i.error=i.mainSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){i.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),i.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){i.error=i.audioSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){i.logger_("main segment loader ended"),i.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){i.experimentalBufferBasedABR||(i.delegateLoaders_("all",["abort"]),i.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},i3))});var n=function(){if(!i.sourceUpdater_.hasCreatedSourceBuffers())return i.tryToCreateSourceBuffers_();var o=i.getCodecsOrExclude_();o&&i.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){i.logger_("audioSegmentLoader ended"),i.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(i){i===void 0&&(i=this.selectPlaylist()),this.fastQualityChange_(i)},t.fastQualityChange_=function(i){var n=this;if(i===void 0&&(i=this.selectPlaylist()),i===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(i,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){ce.browser.IE_VERSION||ce.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var i=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<i.start(0))return this.tech_.setCurrentTime(i.end(i.length-1))}},t.setupFirstPlay=function(){var i=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(ce.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){i.trigger("firstplay"),i.tech_.setCurrentTime(a.end(0)),i.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},t.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var i=this.tech_.play();typeof i<"u"&&typeof i.then=="function"&&i.then(null,function(n){})}this.trigger("sourceopen")},t.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var i=this.inbandTextTracks_.metadataTrack_.cues;if(!(!i||!i.length)){var n=this.duration();i[i.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},t.handleDurationChange_=function(){this.tech_.trigger("durationchange")},t.onEndOfStream=function(){var i=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?i=i&&this.audioSegmentLoader_.ended_:i=this.audioSegmentLoader_.ended_}i&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},t.stuckAtPlaylistEnd_=function(i){var n=this.seekable();if(!n.length)return!1;var a=this.syncController_.getExpiredTime(i,this.duration());if(a===null)return!1;var o=Rs.Playlist.playlistEnd(i,a),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return o-l<=ds;var c=u.end(u.length-1);return c-l<=ds&&o-c<=ds},t.blacklistCurrentPlaylist=function(i,n){i===void 0&&(i={});var a=i.playlist||this.masterPlaylistLoader_.media();if(n=n||i.blacklistDuration||this.blacklistDuration,!a){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}a.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(Fd),u=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return ce.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(u);if(u){var c=!1;o.forEach(function(F){if(F!==a){var L=F.excludeUntil;typeof L<"u"&&L!==1/0&&(c=!0,delete F.excludeUntil)}}),c&&(ce.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var d;a.playlistErrors_>this.maxPlaylistRetries?d=1/0:d=Date.now()+n*1e3,a.excludeUntil=d,i.reason&&(a.lastExcludeReason_=i.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var f=this.selectPlaylist();if(!f){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var g=i.internal?this.logger_:ce.log.warn,E=i.message?" "+i.message:"";g((i.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(E+" Switching to playlist "+f.id+".")),f.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var S=f.targetDuration/2*1e3||5*1e3,k=typeof f.lastRequest=="number"&&Date.now()-f.lastRequest<=S;return this.switchMedia_(f,"exclude",u||k)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(i,n){var a=this,o=[],l=i==="all";(l||i==="main")&&o.push(this.masterPlaylistLoader_);var u=[];(l||i==="audio")&&u.push("AUDIO"),(l||i==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var d=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;d&&o.push(d)}),["main","audio","subtitle"].forEach(function(c){var d=a[c+"SegmentLoader_"];d&&(i===c||i==="all")&&o.push(d)}),o.forEach(function(c){return n.forEach(function(d){typeof c[d]=="function"&&c[d]()})})},t.setCurrentTime=function(i){var n=Go(this.tech_.buffered(),i);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return i;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var i=this.masterPlaylistLoader_.media();return i?i.endList?this.mediaSource?this.mediaSource.duration:Rs.Playlist.duration(i):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var i;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var o=this.masterPlaylistLoader_.master,l=Rs.Playlist.seekable(n,a,Rs.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),a=this.syncController_.getExpiredTime(n,this.duration()),a===null||(i=Rs.Playlist.seekable(n,a,Rs.Playlist.liveEdgeDelay(o,n)),i.length===0)))){var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),i?i.start(0)>l.end(0)||l.start(0)>i.end(0)?this.seekable_=l:this.seekable_=ce.createTimeRanges([[i.start(0)>l.start(0)?i.start(0):l.start(0),i.end(0)<l.end(0)?i.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===u&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+E2(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},t.updateDuration=function(i){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,i),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(i){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var a=this.tech_.buffered(),o=Rs.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},t.dispose=function(){var i=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=i.mediaTypes_[n].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.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()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var i=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=i?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!a)},t.getCodecsOrExclude_=function(){var i=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=Yu(this.master(),a),l={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||iP),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||i_)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||i_,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(F,L){return F?nh(L):Df(L)},d={},f;if(["video","audio"].forEach(function(k){if(l.hasOwnProperty(k)&&!c(n[k].isFmp4,l[k])){var F=n[k].isFmp4?"browser":"muxer";d[F]=d[F]||[],d[F].push(l[k]),k==="audio"&&(f=F)}}),u&&f&&a.attributes.AUDIO){var g=a.attributes.AUDIO;this.master().playlists.forEach(function(k){var F=k.attributes&&k.attributes.AUDIO;F===g&&k!==a&&(k.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+f+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(d).length){var E=Object.keys(d).reduce(function(k,F){return k&&(k+=", "),k+=F+' does not support codec(s): "'+d[F].join(",")+'"',k},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:E,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var S=[];if(["video","audio"].forEach(function(k){var F=(ns(i.sourceUpdater_.codecs[k]||"")[0]||{}).type,L=(ns(l[k]||"")[0]||{}).type;F&&L&&F.toLowerCase()!==L.toLowerCase()&&S.push('"'+i.sourceUpdater_.codecs[k]+'" -> "'+l[k]+'"')}),S.length){this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+S.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},t.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var i=this.getCodecsOrExclude_();if(i){this.sourceUpdater_.createSourceBuffers(i);var n=[i.video,i.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},t.excludeUnsupportedVariants_=function(){var i=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(o){var l=n[o];if(a.indexOf(l.id)===-1){a.push(l.id);var u=Yu(i.master,l),c=[];u.audio&&!Df(u.audio)&&!nh(u.audio)&&c.push("audio codec "+u.audio),u.video&&!Df(u.video)&&!nh(u.video)&&c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(l.excludeUntil=1/0,i.logger_("excluding "+l.id+" for unsupported: "+c.join(", ")))}})},t.excludeIncompatibleVariants_=function(i){var n=this,a=[],o=this.master().playlists,l=Yh(ns(i)),u=Y_(l),c=l.video&&ns(l.video)[0]||null,d=l.audio&&ns(l.audio)[0]||null;Object.keys(o).forEach(function(f){var g=o[f];if(!(a.indexOf(g.id)!==-1||g.excludeUntil===1/0)){a.push(g.id);var E=[],S=Yu(n.masterPlaylistLoader_.master,g),k=Y_(S);if(!(!S.audio&&!S.video)){if(k!==u&&E.push('codec count "'+k+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var F=S.video&&ns(S.video)[0]||null,L=S.audio&&ns(S.audio)[0]||null;F&&c&&F.type.toLowerCase()!==c.type.toLowerCase()&&E.push('video codec "'+F.type+'" !== "'+c.type+'"'),L&&d&&L.type.toLowerCase()!==d.type.toLowerCase()&&E.push('audio codec "'+L.type+'" !== "'+d.type+'"')}E.length&&(g.excludeUntil=1/0,n.logger_("blacklisting "+g.id+": "+E.join(" && ")))}}})},t.updateAdCues_=function(i){var n=0,a=this.seekable();a.length&&(n=a.start(0)),F4(i,this.cueTagsTrack_,n)},t.goalBufferLength=function(){var i=this.tech_.currentTime(),n=Fi.GOAL_BUFFER_LENGTH,a=Fi.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,Fi.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+i*a,o)},t.bufferLowWaterLine=function(){var i=this.tech_.currentTime(),n=Fi.BUFFER_LOW_WATER_LINE,a=Fi.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,Fi.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,Fi.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+i*a,this.experimentalBufferBasedABR?l:o)},t.bufferHighWaterLine=function(){return Fi.BUFFER_HIGH_WATER_LINE},e})(ce.EventTarget),o3=function(e,t,r){return function(i){var n=e.master.playlists[t],a=Fg(n),o=Fd(n);return typeof i>"u"?o:(i?delete n.disabled:n.disabled=!0,i!==o&&!a&&(r(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},l3=function(e,t,r){var i=e.masterPlaylistController_,n=e.options_.smoothQualityChange,a=n?"smooth":"fast",o=i[a+"QualityChange_"].bind(i);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Yu(i.master(),t),this.playlist=t,this.id=r,this.enabled=o3(e.playlists,t.id,o)},u3=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),r=Ec(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return r?r.filter(function(i){return!Fg(i)}).map(function(i,n){return new l3(e,i,i.id)}):[]}},l0=["seeking","seeked","pause","playing","error"],c3=(function(){function s(t){var r=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Mn("PlaybackWatcher"),this.logger_("initialize");var i=function(){return r.monitorCurrentTime_()},n=function(){return r.monitorCurrentTime_()},a=function(){return r.techWaiting_()},o=function(){return r.cancelTimer_()},l=this.masterPlaylistController_,u=["main","subtitle","audio"],c={};u.forEach(function(f){c[f]={reset:function(){return r.resetSegmentDownloads_(f)},updateend:function(){return r.checkSegmentDownloads_(f)}},l[f+"SegmentLoader_"].on("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].on("playlistupdate",c[f].reset),r.tech_.on(["seeked","seeking"],c[f].reset)});var d=function(g){["main","audio"].forEach(function(E){l[E+"SegmentLoader_"][g]("appended",r.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){r.fixesBadSeeks_()&&(r.consecutiveUpdates=0,r.lastRecordedTime=r.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=function(){return d("off")},this.watchForBadSeeking_=function(){r.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(l0,o),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){r.clearSeekingAppendCheck_(),r.logger_("dispose"),r.tech_.off("waiting",a),r.tech_.off(l0,o),r.tech_.off("canplay",n),r.tech_.off("play",i),r.tech_.off("seeking",r.watchForBadSeeking_),r.tech_.off("seeked",r.clearSeekingAppendCheck_),u.forEach(function(f){l[f+"SegmentLoader_"].off("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].off("playlistupdate",c[f].reset),r.tech_.off(["seeked","seeking"],c[f].reset)}),r.checkCurrentTimeTimeout_&&N.clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}var e=s.prototype;return e.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&N.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=N.setTimeout(this.monitorCurrentTime_.bind(this),250)},e.resetSegmentDownloads_=function(r){var i=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=i.buffered_()},e.checkSegmentDownloads_=function(r){var i=this.masterPlaylistController_,n=i[r+"SegmentLoader_"],a=n.buffered_(),o=tM(this[r+"Buffered_"],a);if(this[r+"Buffered_"]=a,o){this.resetSegmentDownloads_(r);return}this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Za(a)}),!(this[r+"StalledDownloads_"]<10)&&(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&i.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0))},e.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var r=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===r&&(!i.length||r+ds>=i.end(i.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},e.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},e.fixesBadSeeks_=function(){var r=this.tech_.seeking();if(!r)return!1;var i=this.seekable(),n=this.tech_.currentTime(),a=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(a){var l=i.end(i.length-1);o=l}if(this.beforeSeekableWindow_(i,n)){var u=i.start(0);o=u+(u===i.end(0)?0:ds)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+E2(i)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,d=this.tech_.buffered(),f=c.audioBuffer?c.audioBuffered():null,g=c.videoBuffer?c.videoBuffered():null,E=this.media(),S=E.partTargetDuration?E.partTargetDuration:(E.targetDuration-Na)*2,k=[f,g],F=0;F<k.length;F++)if(k[F]){var L=Bg(k[F],n);if(L<S)return!1}var W=zc(d,n);return W.length===0?!1:(o=W.start(0)+ds,this.logger_("Buffered region starts ("+W.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},e.waiting_=function(){if(!this.techWaiting_()){var r=this.tech_.currentTime(),i=this.tech_.buffered(),n=Go(i,r);if(n.length&&r+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(r),this.logger_("Stopped at "+r+" while inside a buffered region "+("["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},e.techWaiting_=function(){var r=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,i)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+i+". Seeking to "+("live point (seekable end) "+n)),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:i});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var u=zc(o,i);if(u.length>0){var c=u.start(0)-i;return this.logger_("Stopped at "+i+", setting timer for "+c+", seeking "+("to "+u.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,i),!0}return!1},e.afterSeekableWindow_=function(r,i,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var o=r.end(r.length-1)+ds,l=!n.endList;return l&&a&&(o=r.end(r.length-1)+n.targetDuration*3),i>o},e.beforeSeekableWindow_=function(r,i){return!!(r.length&&r.start(0)>0&&i<r.start(0)-this.liveRangeSafeTimeDelta)},e.videoUnderflow_=function(r){var i=r.videoBuffered,n=r.audioBuffered,a=r.currentTime;if(i){var o;if(i.length&&n.length){var l=Go(i,a-3),u=Go(i,a),c=Go(n,a);c.length&&!u.length&&l.length&&(o={start:l.end(0),end:c.end(0)})}else{var d=zc(i,a);d.length||(o=this.gapFromVideoUnderflow_(i,a))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+a)),!0):!1}},e.skipTheGap_=function(r){var i=this.tech_.buffered(),n=this.tech_.currentTime(),a=zc(i,n);this.cancelTimer_(),!(a.length===0||n!==r)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",r,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+Na),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},e.gapFromVideoUnderflow_=function(r,i){for(var n=JO(r),a=0;a<n.length;a++){var o=n.start(a),l=n.end(a);if(i-o<4&&i-o>2)return{start:o,end:l}}return null},s})(),h3={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),r=t.currentSource_||this.currentSource();return e(r)}},d3=function s(e,t){var r=0,i=0,n=ce.mergeOptions(h3,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){i&&e.currentTime(i)},o=function(f){f!=null&&(i=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(f),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},l=function(){if(Date.now()-r<n.errorInterval*1e3){e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),e.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!="function"){ce.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return r=Date.now(),n.getSource.call(e,o)},u=function d(){e.off("loadedmetadata",a),e.off("error",l),e.off("dispose",d)},c=function(f){u(),s(e,f)};e.on("error",l),e.on("dispose",u),e.reloadSourceOnError=c},f3=function(e){d3(this,e)},lC="2.16.3",p3="6.0.1",m3="0.22.1",g3="4.8.0",v3="3.1.3",Xi={PlaylistLoader:Ko,Playlist:Ir,utils:kM,STANDARD_PLAYLIST_SELECTOR:J_,INITIAL_PLAYLIST_SELECTOR:m4,lastBandwidthSelector:J_,movingAverageBandwidthSelector:f4,comparePlaylistBandwidth:Vg,comparePlaylistResolution:d4,xhr:F2()};Object.keys(Fi).forEach(function(s){Object.defineProperty(Xi,s,{get:function(){return ce.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Fi[s]},set:function(t){if(ce.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){ce.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}Fi[s]=t}})});var uC="videojs-vhs",cC=function(e,t){for(var r=t.media(),i=-1,n=0;n<e.length;n++)if(e[n].id===r.id){i=n;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},y3=function(e,t){t.representations().forEach(function(r){e.addQualityLevel(r)}),cC(e,t.playlists)};Xi.canPlaySource=function(){return ce.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var _3=function(e,t,r){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=Yh(ns(t.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(i.audio=r.attributes.CODECS);var n=rc(i.video),a=rc(i.audio),o={};for(var l in e)o[l]={},a&&(o[l].audioContentType=a),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return ce.mergeOptions(e,o)},T3=function(e,t){return e.reduce(function(r,i){if(!i.contentProtection)return r;var n=t.reduce(function(a,o){var l=i.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(n).length&&r.push(n),r},[])},b3=function(e){var t=e.player,r=e.sourceKeySystems,i=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=i?n.concat([i]):n,o=T3(a,Object.keys(r)),l=[],u=[];return o.forEach(function(c){u.push(new Promise(function(d,f){t.tech_.one("keysessioncreated",d)})),l.push(new Promise(function(d,f){t.eme.initializeMediaKeys({keySystems:c},function(g){if(g){f(g);return}d()})}))}),Promise.race([Promise.all(l),Promise.race(u)])},S3=function(e){var t=e.player,r=e.sourceKeySystems,i=e.media,n=e.audioMedia,a=_3(r,i,n);return a?(t.currentSource().keySystems=a,a&&!t.eme?(ce.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},hC=function(){if(!N.localStorage)return null;var e=N.localStorage.getItem(uC);if(!e)return null;try{return JSON.parse(e)}catch{return null}},C3=function(e){if(!N.localStorage)return!1;var t=hC();t=t?ce.mergeOptions(t,e):e;try{N.localStorage.setItem(uC,JSON.stringify(t))}catch{return!1}return t},E3=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};Xi.supportsNativeHls=(function(){if(!de||!de.createElement)return!1;var s=de.createElement("video");if(!ce.getTech("Html5").isSupported())return!1;var e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(t){return/maybe|probably/i.test(s.canPlayType(t))})})();Xi.supportsNativeDash=(function(){return!de||!de.createElement||!ce.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(de.createElement("video").canPlayType("application/dash+xml"))})();Xi.supportsTypeNatively=function(s){return s==="hls"?Xi.supportsNativeHls:s==="dash"?Xi.supportsNativeDash:!1};Xi.isSupported=function(){return ce.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var w3=ce.getComponent("Component"),zg=(function(s){Be(e,s);function e(r,i,n){var a;if(a=s.call(this,i,ce.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&ce.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof n.initialBandwidth=="number"&&(a.options_.bandwidth=n.initialBandwidth),a.logger_=Mn("VhsHandler"),i.options_&&i.options_.playerId){var o=ce(i.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return ce.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"hls-player-access"}),rt(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return ce.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"vhs-player-access"}),rt(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return ce.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),rt(a)},configurable:!0}),a.player_=o}if(a.tech_=i,a.source_=r,a.stats={},a.ignoreNextSeekingEvent_=!1,a.setOptions_(),a.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(de,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(l){var u=de.fullscreenElement||de.webkitFullscreenElement||de.mozFullScreenElement||de.msFullscreenElement;u&&u.contains(a.tech_.el())?a.masterPlaylistController_.fastQualityChange_():a.masterPlaylistController_.checkABR_()}),a.on(a.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),a.on(a.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),a.on(a.tech_,"play",a.play),a}var t=e.prototype;return t.setOptions_=function(){var i=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,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,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=hC();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Fi.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Fi.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){typeof i.source_[a]<"u"&&(i.options_[a]=i.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},t.src=function(i,n){var a=this;if(i){this.setOptions_(),this.options_.src=E3(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Xi,this.options_.sourceType=rS(n),this.options_.seekTo=function(u){a.tech_.setCurrentTime(u)},this.options_.smoothQualityChange&&ce.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new a3(this.options_);var o=ce.mergeOptions({liveRangeSafeTimeDelta:ds},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new c3(o),this.masterPlaylistController_.on("error",function(){var u=ce.players[a.tech_.options_.playerId],c=a.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),u.error(c)});var l=this.options_.experimentalBufferBasedABR?Xi.movingAverageBandwidthSelector(.55):Xi.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Xi.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,d=N.navigator.connection||N.navigator.mozConnection||N.navigator.webkitConnection,f=1e7;if(this.options_.useNetworkInformationApi&&d){var g=d.downlink*1e3*1e3;g>=f&&c>=f?c=Math.max(c,g):c=g}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),d;this.throughput>0?d=1/this.throughput:d=0;var f=Math.floor(1/(c+d));return f},set:function(){ce.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:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Za(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Za(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&C3({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){u3(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=N.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),b3({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){i.logger_("created EME key session"),i.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){i.logger_("error while creating EME key session",a),i.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=S3({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=i.masterPlaylistController_.master();if(!(!l||!l.playlists)){var u=[];if(l.playlists.forEach(function(d){d&&d.attributes&&d.attributes.RESOLUTION&&d.attributes.RESOLUTION.height>=720&&(!d.excludeUntil||d.excludeUntil<1/0)&&(d.excludeUntil=1/0,u.push(d))}),u.length){var c;(c=ce.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(u)),i.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),ce.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},t.setupQualityLevels_=function(){var i=this,n=ce.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){y3(i.qualityLevels_,i)}),this.playlists.on("mediachange",function(){cC(i.qualityLevels_,i.playlists)}))},e.version=function(){return{"@videojs/http-streaming":lC,"mux.js":p3,"mpd-parser":m3,"m3u8-parser":g3,"aes-decrypter":v3}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return oC.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(i){this.masterPlaylistController_.setCurrentTime(i)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&N.URL.revokeObjectURL&&(N.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(i,n){return LM({playlist:this.masterPlaylistController_.media(),time:i,callback:n})},t.seekToProgramTime=function(i,n,a,o){return a===void 0&&(a=!0),o===void 0&&(o=2),OM({programTime:i,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},e})(w3),uc={name:"videojs-http-streaming",VERSION:lC,canHandleSource:function(e,t){t===void 0&&(t={});var r=ce.mergeOptions(ce.options,t);return uc.canPlayType(e.type,r)},handleSource:function(e,t,r){r===void 0&&(r={});var i=ce.mergeOptions(ce.options,r);return t.vhs=new zg(e,t,i),ce.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ce.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=F2(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var r=rS(e);if(!r)return"";var i=uc.getOverrideNative(t),n=Xi.supportsTypeNatively(r),a=!n||i;return a?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,r=t.vhs,i=r===void 0?{}:r,n=t.hls,a=n===void 0?{}:n,o=!(ce.browser.IS_ANY_SAFARI||ce.browser.IS_IOS),l=i.overrideNative,u=l===void 0?o:l,c=a.overrideNative,d=c===void 0?!1:c;return d||u}},k3=function(){return nh("avc1.4d400d,mp4a.40.2")};k3()&&ce.getTech("Html5").registerSourceHandler(uc,0);ce.VhsHandler=zg;Object.defineProperty(ce,"HlsHandler",{get:function(){return ce.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),zg},configurable:!0});ce.VhsSourceHandler=uc;Object.defineProperty(ce,"HlsSourceHandler",{get:function(){return ce.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),uc},configurable:!0});ce.Vhs=Xi;Object.defineProperty(ce,"Hls",{get:function(){return ce.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Xi},configurable:!0});ce.use||(ce.registerComponent("Hls",Xi),ce.registerComponent("Vhs",Xi));ce.options.vhs=ce.options.vhs||{};ce.options.hls=ce.options.hls||{};if(!ce.getPlugin||!ce.getPlugin("reloadSourceOnError")){var A3=ce.registerPlugin||ce.plugin;A3("reloadSourceOnError",f3)}/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */function x3(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e}function Qf(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var N3=(function s(e){var t=this;if(ce.browser.IS_IE8){t=de.createElement("custom");for(var r in s.prototype)r!=="constructor"&&(t[r]=s.prototype[r])}return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:function(){return t.enabled_()},set:function(n){t.enabled_(n)}}),t}),ed=(function(s){x3(e,s);function e(){var r;r=s.call(this)||this;var i=Qf(Qf(r));if(ce.browser.IS_IE8){i=de.createElement("custom");for(var n in e.prototype)n!=="constructor"&&(i[n]=e.prototype[n])}return i.levels_=[],i.selectedIndex_=-1,Object.defineProperty(i,"selectedIndex",{get:function(){return i.selectedIndex_}}),Object.defineProperty(i,"length",{get:function(){return i.levels_.length}}),i||Qf(r)}var t=e.prototype;return t.addQualityLevel=function(i){var n=this.getQualityLevelById(i.id);if(n)return n;var a=this.levels_.length;return n=new N3(i),""+a in this||Object.defineProperty(this,a,{get:function(){return this.levels_[a]}}),this.levels_.push(n),this.trigger({qualityLevel:n,type:"addqualitylevel"}),n},t.removeQualityLevel=function(i){for(var n=null,a=0,o=this.length;a<o;a++)if(this[a]===i){n=this.levels_.splice(a,1)[0],this.selectedIndex_===a?this.selectedIndex_=-1:this.selectedIndex_>a&&this.selectedIndex_--;break}return n&&this.trigger({qualityLevel:i,type:"removequalitylevel"}),n},t.getQualityLevelById=function(i){for(var n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===i)return o}return null},t.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},e})(ce.EventTarget);ed.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(var D3 in ed.prototype.allowedEvents_)ed.prototype["on"+D3]=null;var dC="2.0.9",I3=ce.registerPlugin||ce.plugin,P3=function(e,t){var r=e.qualityLevels,i=new ed,n=function a(){i.dispose(),e.qualityLevels=r,e.off("dispose",a)};return e.on("dispose",n),e.qualityLevels=function(){return i},e.qualityLevels.VERSION=dC,i},fC=function(e){return P3(this,ce.mergeOptions({},e))};I3("qualityLevels",fC);fC.VERSION=dC;const L3={SMALL:450},O3=B.getPlugin("plugin");class M3 extends O3{constructor(e,t){super(e),this.options=t,this.configureMenuDimensions=this.configureMenuDimensions.bind(this),this.initialize()}initialize(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}dispose(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),super.dispose()}configureMenuDimensions(){const e=u=>{if(this.options.mobile)return;const c=this.player.getChild("collapserator"),d=c.getChild("volumePanel"),f=c.children_.indexOf(d);c.removeChild(d),c.addChild("volumePanel",{inline:u},f),this.player.trigger("volumechange")},t=this.player.isFullscreen();if(t&&!this.options.mobile){const u=this.player.whiteboardModePlugin().side;if(e(u!=="top"),u==="left"||u==="right"||u==="top"){const c=this.player.currentWidth();this.player.el().querySelectorAll(".vjs-menu").forEach(f=>{f.style.paddingTop=null,f.style.marginBottom=null,f.style.width=`calc(${c}px - 4em)`});return}}t||e(!0);const r=this.player.currentWidth(),n=this.player.currentHeight()/r*100,a=this.player.el().querySelector(".cv-collapsorator"),o=this.player.el().querySelectorAll(".vjs-menu");let l=a&&a.offsetHeight;if(!l){this.player.one("play",this.configureMenuDimensions);return}this.options.seekBarName==="CreateClipSeekBar"&&(l+=22),!(!o||!o.length)&&o.forEach(u=>{!t&&this.options.overflowControls?u.style.paddingTop="80%":u.style.paddingTop=`calc(${n}% - ${l}px)`,u.style.marginBottom=`${l}px`,u.style.width=null,u.querySelector(".vjs-menu-content")&&(r<=L3.SMALL?this.player.addClass("cv-player-small"):this.player.removeClass("cv-player-small"))})}}B.registerPlugin("configureMenuDimensionsPlugin",M3);const u0="cv-persisttest",Xt={hasLocalStorage:()=>{try{return window.localStorage.setItem(u0,"cv-player-storage-test"),window.localStorage.removeItem(u0),!0}catch{return!1}},get:s=>window.localStorage.getItem(s),set:(s,e)=>{window.localStorage.setItem(s,e)},remove:s=>{window.localStorage.removeItem(s)}},R3=B.getPlugin("plugin"),c0="cvplayer-volume",h0="cvplayer-mute";class B3 extends R3{constructor(e){super(e),this.enabled=!0,this.player.ready(()=>this.initialize())}initialize(){if(this.player.options_.mobile){this.removeVolumeControl();return}Xt.hasLocalStorage()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}applyUserPreferences(){const e=Xt.get(c0),t=Xt.get(h0);e&&this.player.volume(+e),t&&this.player.muted(t==="true")}saveVolumeState(){this.enabled&&(Xt.set(c0,this.player.volume().toString()),Xt.set(h0,this.player.muted().toString()))}removeVolumeControl(){this.player.volume(1);const e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}enable(){this.enabled=!0}disable(){this.enabled=!1}dispose(){this.player.off("volumechange",this.saveVolumeState),super.dispose()}}B.registerPlugin("persistVolumePlugin",B3);const U3=B.getPlugin("plugin"),d0="cvplayer-playback-rate";class F3 extends U3{constructor(e,t){super(e),this.options=t,this.player.dataLoaded(()=>this.initialize())}initialize(){var r;if(!Xt.hasLocalStorage())return;this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",()=>{this.player.off("ratechange",this.savePlaybackRate)});const e=+Xt.get(d0);((r=this.player.options_.playbackRates)==null?void 0:r.some(i=>i===e))&&(this.player.playbackRate(e),this.player.defaultPlaybackRate(e))}savePlaybackRate(){var t;const e=this.player.playbackRate().toString();Xt.set(d0,e),(t=this.options.analyticsService)==null||t.logUserAction({rate:e},{actionType:er.Select,workflowPhase:Ju.Complete,descriptor:ol.ChangeSpeed,entity:Gr.PlaybackSpeed,eventVersion:Xo.V3})}}B.registerPlugin("persistPlaybackRatePlugin",F3);const $3=B.getPlugin("plugin");class j3 extends $3{constructor(e){super(e),this.fullscreenBecauseOfRotate=!1,this.player.supportsFullScreen()&&(this.onRotate=this.onRotate.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.ready(()=>this.initialize()))}initialize(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}dispose(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}onFullscreenChange(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}onRotate(){const e=this.getAngle();if(e!==90&&e!==-90&&e!==270){this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen();return}this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0}getAngle(){var e,t;return typeof((t=(e=window.screen)==null?void 0:e.orientation)==null?void 0:t.angle)=="number"?window.screen.orientation.angle:0}}B.registerPlugin("fullscreenOnRotatePlugin",j3);const pC=`
|
|
343
|
+
<svg viewBox='0 0 434 71'>
|
|
344
|
+
<g>
|
|
345
|
+
<path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>
|
|
346
|
+
<path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>
|
|
347
|
+
</g>
|
|
348
|
+
</svg>
|
|
349
|
+
`,H3=B.getComponent("Button");class mC extends H3{constructor(e,t){super(e,t),this.update=pI(this.update.bind(this),1e3),e.on("timeupdate",this.update),e.one("dispose",()=>{e.off("timeupdate",this.update),this.el_.removeEventListener("click",this.pause)})}update(){const e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}buildCSSClass(){return"cv-open-externally-button"}createEl(){const t={innerHTML:pC,className:this.buildCSSClass()},r={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},i=B.dom.createEl("a",t,r);return this.createControlTextEl(i),i.addEventListener("click",this.pause.bind(this)),i}pause(){this.player_.pause()}}mC.prototype.controlText_="Open in ClickView";B.registerComponent("OpenExternallyButton",mC);const V3=B.getPlugin("plugin");class q3 extends V3{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){const e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),r=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},r+1)}}B.registerPlugin("openExternallyPlugin",q3);const z3=B.getComponent("component");class W3 extends z3{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-touch-control-ui ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}setUi(e,t){const r=e>0,i=r?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML=`
|
|
350
|
+
<div class='${i}'>
|
|
351
|
+
<div class='cv-touch-text'>
|
|
352
|
+
${r?"+":""}${e*10}s
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
`,window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.removeText()},t)}removeText(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}B.registerComponent("TouchControls",W3);const G3=B.getPlugin("plugin"),Pu=300;class K3 extends G3{constructor(e){super(e),this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0,this.bindFunctions(),this.player.ready(()=>this.initialize())}bindFunctions(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}initialize(){this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",()=>{this.player.off("ready",this.reBindEventListeners)}),this.reBindEventListeners()}reBindEventListeners(){this.unBindEventListeners(),this.tech=this.player.tech(!0),this.tech.name()==="Html5"&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}unBindEventListeners(){this.tech&&this.tech.name()==="Html5"&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}dispose(){super.dispose(),this.unBindEventListeners()}onTouchStart(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}onTouchEnd(e){if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<Pu){this.onDoubleTouch(e),this.lastTouchTime=e.timeStamp;return}if(this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<Pu){window.setTimeout(()=>{this.doubleTouchCount||(this.player.paused()?this.player.play():this.userActive&&this.player.pause())},Pu);return}}}resetProperties(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}onDoubleTouch(e){const t=this.player.el().getBoundingClientRect(),r=t.left+t.width/2;if(this.doubleTouchCount===0&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<r?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(this.doubleTouchCount*10>this.seekStartTime+10)return;this.touchControls.setUi(-this.doubleTouchCount,Pu*3),this.player.currentTime(this.player.currentTime()-10);return}const i=this.player.duration()-this.seekStartTime;this.doubleTouchCount*10>i+10||(this.touchControls.setUi(this.doubleTouchCount,Pu*3),this.player.currentTime(this.player.currentTime()+10))}}B.registerPlugin("touchControls",K3);class X3{constructor(e,t){this.id=t.id,this.plugin=e,this.source=t,this.enabled=this.enabled.bind(this)}enabled(e){return e===void 0?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}const Y3=B.getPlugin("plugin");class Q3 extends Y3{constructor(e,t){super(e),this.options_=t,this.player.ready(()=>this.initialize())}initialize(){this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",()=>{this.qualityLevels.off("change",this.onQualityChange)})}get currentSource(){return this._currentSource}onQualityChange(){const e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}setSource(e){const t=this.getSourceById(e);if(t===null)return this.currentSource;const r=this.player.currentTime(),i=!this.player.paused();this._currentSource=t;const n=this.player.hasStarted();this.player.src({src:t.url,type:t.mimeType});const a=()=>{this.player.currentTime()!==r&&this.player.currentTime(r),i&&this.player.play(),n&&this.player.hasStarted(!0)};return this.player.one("loadedmetadata",a),this.trigger({event:"sourcechange",source:t}),this.sourceChangeUpdateQualityLevels(t),t}getSourceById(e){return this.sources.find(t=>t.id===e)}repopulateSources(e){let t=null;for(;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}sortSources(e){return e.sort((t,r)=>t.id===r.id?0:+t.id>+r.id?-1:1)}populateSources(e,t=null){let r=null;e=this.sortSources(e),e.forEach(i=>{if(this.qualityLevels.addQualityLevel(new X3(this,i)),this.sources.push(i),this.trigger({event:"addsource",source:i}),t!==null){i.id===t&&(r=i);return}i.default&&(r=i)}),r===null&&(r=this.sources[0]),r!==null&&this.setSource(r.id)}sourceChangeUpdateQualityLevels(e){const t=this.qualityLevels;let r=-1;for(let i=0;i<t.length;i++)if(t[i].id===e.id){r=i;break}t.selectedIndex_=r,t.trigger({selectedIndex:r,type:"change"})}}B.registerPlugin("progressiveFiles",Q3);class gC{static getKnownProfiles(){return["1080","720","480","360","240"]}static enableProfileOrNextBest(e,t){let r=e.getQualityLevelById(t);if(r||(r=this.getNextBestQuality(e,t)),!r)return null;for(let i=0;i<e.length;i++){const n=e[i];n.enabled=r.id===n.id}return r}static getNextBestQuality(e,t){const r=this.getKnownProfiles(),i=r.indexOf(t);if(i>=0){for(let n=i+1;n<r.length;n++){const a=r[n],o=e.getQualityLevelById(a);if(o)return o}for(let n=i-1;n>0;n--){const a=r[n],o=e.getQualityLevelById(a);if(o)return o}}return null}}class J3{constructor(e){this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)}getUrl(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}async ping(){const t=new AbortController,r=setTimeout(()=>t.abort(),1e3);try{const n=await(await fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal})).text();return clearTimeout(r),n==="PONG"}catch{return!1}}}class Z3{constructor(e){this.player=e,this.logger=B.log.createLogger("localcache")}async setSource(e,t){if(this.player.localCache&&(e==null?void 0:e.src)!==void 0){const r=await this.player.localCache().getActiveLocalCache();r!==null&&(this.logger.debug("Using Local Cache",r),e.src=r.getUrl(e.src))}t(null,e)}}B.use("*",s=>new Z3(s));const vC='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',e5=B.getComponent("Component");class t5 extends e5{constructor(e,t){super(e,t),this.hide(),this.onLocalCacheChange=this.onLocalCacheChange.bind(this),e.ready(()=>{this.initialize()})}createEl(){return super.createEl("div",{className:"vjs-local-cache-indicator",innerHTML:`<div class="vjs-local-cache-indicator-icon">${vC}</div>`},{title:"Streaming from ClickView Local Cache"})}initialize(){this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",()=>{this.localCachePlugin.off("localcachechanged",this.onLocalCacheChange)}),this.onLocalCacheChange())}async onLocalCacheChange(){await this.localCachePlugin.getActiveLocalCache()?this.show():this.hide()}}B.registerComponent("localCacheIndicator",t5);const i5=B.getPlugin("plugin");class r5 extends i5{constructor(e,t){if(super(e),this.logger_=B.log.createLogger("localcache"),t===void 0)throw Error("no options defined");this.localCaches_=t.localCacheAddresses.map(r=>new J3(r)),this.player.ready(()=>{this.initialize(),t.enabled&&this.enable()})}get isEnabled(){return this.enabled_}enable(){this.enabled_=!0,this.resetActiveLocalCache()}disable(){this.enabled_=!1}getActiveLocalCache(){return this.enabled_?this.activeLocalCache_:null}resetActiveLocalCache(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}clearActiveLocalCache(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}removeLocalCache(e){this.localCaches_=this.localCaches_.filter(t=>t!==e)}dispose(){super.dispose()}initialize(){this.player.controlBar.addChild("localCacheIndicator")}async handleNetworkError(){const e=await this.getActiveLocalCache();return e&&await e.ping()&&this.removeLocalCache(e),this.resetActiveLocalCache(),await this.getActiveLocalCache(),this.resetSource(),!0}resetSource(){const e=this.player.qualityLevels();for(let t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}async getActiveLocalCacheInternal(){const e=[],t=async r=>{await r.ping()&&e.push(r)};if(await Promise.all(this.localCaches_.map(r=>t(r))),e.length>0){const r=e[0];return this.onLocalCacheChange(r),r}return null}onLocalCacheChange(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});let t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),gC.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}B.registerPlugin("localCache",r5);const n5=9e5,s5=B.getPlugin("plugin");class a5 extends s5{constructor(e,t){super(e),this.playerApi=t.playerApi,this.fileToken=t.fileToken,this.logger=B.log.createLogger("video-signature-expiry-plugin"),this.bindErrorHandlers()}bindErrorHandlers(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}dispose(){this.player.off("error",this.onError),super.dispose()}async onError(){const e=this.player.error().code;if(!(e!==MediaError.MEDIA_ERR_NETWORK&&e!==MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)){if(await this.player.localCache().getActiveLocalCache()){this.callErrorHandler(()=>this.player.localCache().handleNetworkError());return}this.callErrorHandler(()=>this.handleVideoSignatureExpiry())}}async handleVideoSignatureExpiry(){if(!this.playerApi||!this.fileToken||this.refetchedSourcesTimestamp+n5>Date.now())return!1;this.refetchedSourcesTimestamp=Date.now();let e=null;try{this.logger.debug("Detected expired mp4 urls, attempting to refetch");const t=`${this.playerApi.origin}/api/files?fileToken=${this.fileToken}`;e=await Mp.get(t)}catch{return this.logger.error("Failed to refetch expired mp4 urls"),!1}return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map(t=>({id:t.profile,mimeType:t.mimeType,url:t.url}))),this.fileToken=e.fileToken,!0}async callErrorHandler(e){const t=this.player.currentTime(),r=!this.player.paused(),i=()=>{this.player.currentTime(t),r&&this.player.play(),this.player.error(null)};this.player.one("loadedmetadata",i),!await e()&&this.player.off("loadedmetadata",i)}}B.registerPlugin("handleNetworkErrors",a5);const o5=B.getPlugin("plugin"),Jf="cvplayer-show-subtitles",Zf="cvplayer-selected-language",f0="cvplayer-subtitle-size";class l5 extends o5{constructor(e,t){super(e),this.options=t,this.initialize()}initialize(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.applyUserPreferences(),this.bindEventListeners())}applyUserPreferences(){let e=!!this.options.showSubtitles;const t=this.safeGet(Jf);if(t==="true"&&(e=!0),t==="false"&&(e=!1),e){const i=this.guessWhichTrack();i&&(i.mode="showing",this.player.trigger("cv:languageselected"))}else this.hideSubtitles();let r=this.safeGet(f0);r||(r=this.options.subtitleSize),this.player.options_.mobile&&(r="medium"),r&&this.player.textTrackSettings.setSizeSetting(r)}safeGet(e){if(Xt.hasLocalStorage())return Xt.get(e)}onSelectedLanguageChange(){var t,r;const e=this.player.textTracks();for(let i=0;i<e.length;i++){const n=e[i];if(n.kind==="subtitles"&&n.mode==="showing"){Xt.set(Jf,"true"),Xt.set(Zf,n.language),(t=this.options.analyticsService)==null||t.logUserAction({language:n.language},{actionType:er.Select,entity:Gr.Subtitle,workflowPhase:Ju.Complete,descriptor:rv.On});return}}Xt.set(Jf,"false"),Xt.remove(Zf),(r=this.options.analyticsService)==null||r.logUserAction({language:""},{actionType:er.Select,entity:Gr.Subtitle,workflowPhase:Ju.Complete,descriptor:rv.Off,eventVersion:Xo.V3})}bindEventListeners(){Xt.hasLocalStorage()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",()=>{this.player.off("cv:languageselected",this.onSelectedLanguageChange),this.player.off("changesubtitlesize",this.onChangeSubtitleSize)}))}onChangeSubtitleSize(){const t=this.player.textTrackSettings.getSizeSetting();Xt.set(f0,t)}guessWhichTrack(){const e=this.safeGet(Zf)||window.navigator.language,{language:t,country:r}=this.getLanguageParts(e);let i,n;const a=this.player.textTracks();for(let o=0;o<a.length;o++){const l=a[o];if(l.kind!=="subtitles")continue;const{language:u,country:c}=this.getLanguageParts(l.language);if(u===t&&(i=l,c||(n=l),c===r))return i}return n||i||null}getLanguageParts(e){const t=e.toLowerCase().split("-"),r=t[0],i=t[1];return{language:r,country:i}}hideSubtitles(){const e=this.player.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(r.kind!=="subtitles")return;r.mode="disabled"}}previewModeSubtitles(){const e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}B.registerPlugin("persistSubtitleSettingsPlugin",l5);const u5=B.getPlugin("plugin"),c5="cvplayer-playback-quality",h5="cvplayer-localcache-playback-quality",d5="1080";class f5 extends u5{constructor(e,t){super(e),this.options=t,this.player.ready(()=>this.initialize())}async initialize(){const e=await this.getActiveLocalCache();let t=e?this.options.playbackProfileLocalCache:this.options.playbackProfile;if(t||(t=d5),Xt.hasLocalStorage()){const i=Xt.get(this.getStorageKey(!!e));i&&(t=i)}const r=this.player.qualityLevels();e!=null&&e.playbackProfile||gC.enableProfileOrNextBest(r,t),Xt.hasLocalStorage()&&(this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),r.on("change",this.onQualityLevelsChange),this.on("dispose",()=>{r.off("change",this.onQualityLevelsChange)}))}async onQualityLevelsChange(){var i;const e=await this.isLocalCacheActive(),t=this.player.qualityLevels(),r=t[t.selectedIndex];Xt.set(this.getStorageKey(e),r.id),(i=this.options.analyticsService)==null||i.logUserAction({quality:r.id},{actionType:er.Select,workflowPhase:Ju.Complete,descriptor:ol.ChangeResolution,entity:Gr.Resolution,eventVersion:Xo.V3})}async isLocalCacheActive(){return!!await this.player.localCache().getActiveLocalCache()}getActiveLocalCache(){return this.player.localCache().getActiveLocalCache()}getStorageKey(e){return e?h5:c5}}B.registerPlugin("persistQualitySettingsPlugin",f5);const yC=B.getComponent("Component");class p5 extends yC{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("div",{className:"cv-progress-reporter-item"})}update(){const e=this.options_.event,t=this.player_.duration(),i=(e.end.time-e.start.time)/t;this.el_.style.width=i*100+"%";const n=e.start.time/t;this.el_.style.left=n*100+"%"}}class m5 extends yC{constructor(){super(...arguments),this.events_=[]}update(){const e=this.children();for(let t=e.length;t>0;t--)this.removeChild(e[t]);this.events_.forEach(t=>{const r=new p5(this.player(),{event:t});this.addChild(r),r.update()})}addEvents(e){this.events_.push(...e),this.update()}createEl(){return B.dom.createEl("div",{className:"cv-progress-reporter-display"})}}const g5=B.getPlugin("plugin"),p0=5e3,v5="ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba",di={PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEKING:"seeking",SEEK_START:"seekstart",SEEK_END:"seekend",ENDED:"ended",PAUSED_SEEK:"pausedseek",TIME_UPDATE:"timeupdate"};class y5 extends g5{constructor(e,t){super(e,t),this.eventBuffer=[],this.latestTime=0,this.lastPlayingTime=0,this.isPlaying=!1,this.isSeeking=!1,this.hasEnded=!1,this.shouldLogPlayOnTimeUpdate=!1,this.options=t,this.player.ready(()=>this.initialize())}initialize(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}validateOptions(){if(typeof this.options.onFlush!="function")throw new Error("Please provide the onFlush option")}bindListeners(){const e={[di.PLAY]:()=>this.onPlay(),[di.PAUSE]:()=>this.onPause(),[di.TIME_UPDATE]:()=>this.onTimeUpdate(),[di.SEEKING]:()=>this.onSeeking(),[di.ENDED]:()=>this.onEnded(),[di.PLAYING]:()=>this.onPlaying()},t=Object.keys(e);t.forEach(r=>this.player.on(r,e[r])),this.one("dispose",()=>{t.forEach(r=>this.player.off(r,e[r]))})}startInterval(){const e=this.options.interval||p0;this.interval=window.setInterval(()=>this.flushBuffer(),e),this.player.one("dispose",()=>window.clearInterval(this.interval))}addEasterEgg(){let e="",t;const r=u=>{e=e+u.key,e===v5&&this.addDisplay(),window.clearTimeout(t),t=window.setTimeout(()=>{e=""},500)};let i=!1,n;const a=()=>{i=!0,n=window.setTimeout(()=>{i&&this.addDisplay()},1e4)};function o(){i=!1,window.clearTimeout(n)}this.player.el().addEventListener("keyup",r);const l=this.player.getChild("Collapserator").getChild("PlayToggle");l.on("touchstart",a),l.on("touchend",o),this.player.one("dispose",()=>{var u,c;(c=(u=this.player)==null?void 0:u.el())==null||c.removeEventListener("keyup",r),l.off("touchstart",a),l.off("touchend",o)})}addDisplay(){this.progressReporterDisplay||(this.progressReporterDisplay=new m5(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",()=>{this.progressReporterDisplay=void 0}))}onPlay(){if(this.isPlaying=!0,this.isSeeking){this.logEvent(di.SEEK_END),this.isSeeking=!1;return}if(this.hasEnded){this.shouldLogPlayOnTimeUpdate=!0,this.hasEnded=!1;return}this.logEvent(di.PLAY)}onPause(){this.isSeeking||(this.pauseTimeout=window.setTimeout(()=>{this.isPlaying=!1,this.logEvent(di.PAUSE),delete this.pauseTimeout},50))}onTimeUpdate(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(di.PLAY)),!(!this.isPlaying||this.isSeeking)&&this.logEvent(di.PLAYING)}onSeeking(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(di.PAUSED_SEEK),!(this.isSeeking||!this.isPlaying)&&(this.isSeeking=!0,this.logEvent(di.SEEK_START))}onEnded(){this.hasEnded=!0,this.logEvent(di.ENDED)}onPlaying(){this.isSeeking=!1,this.isPlaying=!0}logEvent(e){if(!this.player)return;let t=this.player.currentTime();e===di.SEEK_START&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}shouldUseCarriedOverTime(e){return this.lastPlayingTime&&(e===di.PLAYING||e===di.PLAY)}shouldSaveCarriedOverTime(e){return e===di.PLAYING||e===di.PAUSE}shouldClearCarriedOverTime(e){return e===di.ENDED||e===di.PAUSED_SEEK}flushBuffer(){var r,i;const e=[];let t={};for(;this.eventBuffer.length;){const n=this.eventBuffer.shift();if(this.shouldClearCarriedOverTime(n.type)){delete this.lastPlayingTime;continue}if(!t.start){this.shouldUseCarriedOverTime(n.type)&&(n.time=this.lastPlayingTime,delete this.lastPlayingTime),t.start=n;continue}n.type===di.PLAYING&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(n.type)&&(this.lastPlayingTime=n.time),t.end=n,e.push(t),t={})}this.eventBuffer=[],e.length&&this.validateEvents(e)&&(this.options.onFlush(e),(r=this.player)==null||r.trigger("progressflush"),(i=this.progressReporterDisplay)==null||i.addEvents(e))}validateEvents(e){let t=0;e.forEach(i=>{t+=i.end.time-i.start.time});let r=this.options.interval||p0;return r=r/1e3,r+=.5,r=r*this.player.playbackRate(),t<r}}B.registerPlugin("progressReporterPlugin",y5);const _5=B.getComponent("Component");class T5 extends _5{createEl(){const e="span",t={innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"};return B.dom.createEl(e,t,{})}}const _C=["top","left","right","bottom"],m0={top:"Top",left:"Left",right:"Right",bottom:"Bottom"},TC=B.getComponent("Component");class b5 extends TC{constructor(e,t){super(e,t),this.bindEventListeners()}createEl(){return super.createEl("div",{},{class:`cv-drop-target cv-drop-${this.options_.side}`})}bindEventListeners(){const e=this.el(),t=n=>{n.preventDefault(),n.dataTransfer.dropEffect="move",this.addClass("cv-drag-over")},r=n=>{n.preventDefault(),this.removeClass("cv-drag-over"),this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)},i=()=>{this.removeClass("cv-drag-over")};e.addEventListener("dragover",t),e.addEventListener("drop",r),e.addEventListener("dragleave",i),this.on("dispose",()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",r),e.removeEventListener("dragleave",i)})}}class S5 extends TC{constructor(e,t){super(e,t),this.addChildren()}addChildren(){_C.forEach(e=>{this.addChild(new b5(this.player_,{side:e}))})}}const C5=B.getComponent("MenuItem");class E5 extends C5{constructor(e,t){super(e,t)}handleClick(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}const g0=B.getComponent("MenuButton");class w5 extends g0{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=this.player_.whiteboardModePlugin().side,t=[new vc(this.player_,{label:"Video Controls"})];return _C.forEach(r=>{t.push(new E5(this.player_,{side:r,label:m0[r],selectable:!0,multiSelectable:!1,selected:r===e}))}),t}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Video Controls"}getCollabsibleValue(){const e=this.player_.whiteboardModePlugin().side;return m0[e]}showInCollabsibleMenu(){return this.player_.whiteboardModePlugin().isEnabled()?this.player_.isFullscreen():!1}showCollapsibleMenu(){g0.prototype.handleClick.apply(this)}}const v0="cv-whiteboard-side",k5=B.getPlugin("plugin");class A5 extends k5{constructor(e){super(e),this.side="bottom",this.enabled=!0,this.player.ready(()=>{this.initialize()})}initialize(){if(!this.player.options_.mobile){if(Xt.hasLocalStorage()){const e=Xt.get(v0);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}initCollapserator(){var a,o;if((o=(a=this.player).viewTranscriptPlugin)!=null&&o.call(a).isTranscriptOn())return;const e=this.player.getChild("collapserator");this.dragHandle=new T5(this.player),this.button=new w5(this.player),e.addChild(this.dragHandle),e.addChild(this.button),this.player.trigger("cv-updatecog");const t=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","true")},r=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","false")},i=l=>{this.player.isFullscreen()&&(this.player.addClass("cv-dragging"),l.dataTransfer.setData("text/plain","handle"))},n=()=>{this.player.isFullscreen()&&(this.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};this.dragHandle.el().addEventListener("mousedown",t),this.dragHandle.el().addEventListener("mouseup",r),e.el().addEventListener("dragstart",i),e.el().addEventListener("dragend",n),this.on("dispose",()=>{this.dragHandle.el().removeEventListener("mousedown",t),this.dragHandle.el().removeEventListener("mouseup",r),e.el().removeEventListener("dragstart",i),e.el().removeEventListener("dragend",n)})}initDragTargets(){this.player.addChild(new S5(this.player))}initFullscreenListener(){this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.player.on("cv-transcript-toggle",this.update),this.one("dispose",()=>{this.player.off("fullscreenchange",this.update)})}setWhiteboardMode(e){this.side=e,this.button.update(),Xt.hasLocalStorage()&&Xt.set(v0,e),this.player.trigger("cv-whiteboard-change"),this.update()}setEnabled(e){this.enabled=e,this.update()}isEnabled(){return this.enabled}getSide(){return this.isEnabled()?this.side:"bottom"}update(){var t,r;if(this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),B.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),!this.isEnabled()){(t=this.dragHandle)==null||t.hide();return}(r=this.dragHandle)==null||r.show();const e=this.getSide();!this.player.isFullscreen()||e==="bottom"||(this.player.addClass(`cv-whiteboard-${e}`),B.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}B.registerPlugin("whiteboardModePlugin",A5);const x5=B.getPlugin("plugin");class N5 extends x5{constructor(e){super(e)}deferMenu(){const e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}buildSubtitles(){const e=[];let t=!1;const r=this.player.textTracks();for(let i=0;i<r.length;i++){const n=r[i],a=n.mode==="showing";e.unshift({id:n.label,name:n.label,selected:a}),a&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}buildQualities(){const e=[],t=this.player.qualityLevels();for(let r=0;r<t.length;r++){const i=t[r];e.push({id:i.id,name:i.id+"p",selected:i.enabled})}return e}buildPlaybackSpeeds(){const e=this.player.playbackRate();return this.player.options_.playbackRates.map(t=>({id:t,name:t+"x"+(t===1?" (Normal)":""),selected:e===t}))}}B.registerPlugin("deferMenusPlugin",N5);const D5="No skipping ahead!",td="PreventScrubbingTooltip",bC=1e3,I5=B.getComponent("Component"),y0="cv-prevent-scrubbing-tooltip-show",_0="cv-prevent-scrubbing-tooltip-remove-transition";class P5 extends I5{constructor(){super(...arguments),this.isShowing=!1}buildCSSClass(){return`cv-prevent-scrubbing-tooltip ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass(),innerText:D5},r)}show(){this.isShowing||(this.player_.userActive(!0),this.addClass(y0),this.isShowing=!0)}hide(e=!1){this.isShowing&&(e&&(this.addClass(_0),window.requestAnimationFrame(()=>{this.removeClass(_0)})),this.player_.userActive(!1),this.removeClass(y0),this.isShowing=!1)}}B.registerComponent(td,P5);const L5=B.getPlugin("plugin");class O5 extends L5{constructor(e,t){super(e),this.isEnabled=!1,this.isPreviewing=!1;const{furthestVisitedTime:r=0,isEnabled:i=!1}=t??{};this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.player.currentTime=this.currentTime.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.furthestVisitedTime=r,this.isEnabled=i,i&&this.enable()}dispose(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),super.dispose())}togglePreview(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}configurePreview(){this.player.currentTime(0),this.furthestVisitedTime=0}enable(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(td),this.isEnabled=!0}disable(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}getProgressControl(){return this.player.controlBar.getChild("progressControl")}onTimeUpdate(){const e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}currentTime(e,...t){var n;if(typeof e!="number")return this.playerCurrentTimeFn(e,...t);if(!this.isEnabled){this.playerCurrentTimeFn(e,...t);return}const r=this.getPreventScrubbingTooltip(),i=(n=this.getSeekBar())==null?void 0:n.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime){r.show(),eg(r.hide,bC,!1,r)(),i==null||i.hide(),this.playerCurrentTimeFn(this.furthestVisitedTime,t);return}i==null||i.show(),r.hide(!0),this.playerCurrentTimeFn(e,t)}getPreventScrubbingTooltip(){return this.getProgressControl().getChild(td)}getSeekBar(){var e;return(e=this.player.controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}}B.registerPlugin("preventScrubbingPlugin",O5);const M5=B.getComponent("Button"),T0="cv-muted";class Wg extends M5{constructor(e){super(e),this.update(),this.update=this.update.bind(this),e.on("volumechange",this.update),e.on("dispose",()=>e.off("volumechange",this.update))}handleClick(){this.player_.muted(!this.player_.muted()),this.update()}update(){this.player_.muted()?this.addClass(T0):this.removeClass(T0)}buildCSSClass(){return"cv-mute-button cv-muted"}}B.registerComponent("muteButton",Wg);Wg.prototype.controlText_="Mute";const R5=B.getComponent("Component");class SC extends R5{constructor(e,t){super(e,t),this._onClickHandler=t.onClickHandler,this.bindEventListeners()}createEl(){return B.dom.createEl("div",{className:"cv-player-overlay"})}handleClick(e){typeof this._onClickHandler=="function"&&(e.stopImmediatePropagation(),this._onClickHandler())}dispose(){this.off("click",this.handleClick),super.dispose()}bindEventListeners(){this.on("click",this.handleClick)}}B.registerComponent("playerOverlay",SC);var CC=(s=>(s.Default="play",s.Hover="hover",s))(CC||{});const B5=B.getPlugin("plugin"),b0="cv-preview-mode";class U5 extends B5{constructor(e){super(e),this.buttonAdded=!1,this.mode=null}getMode(){return this.mode}setPlayerMode(e,t){const r=this.mode;if(this.mode=e,e==="hover"){this.buttonAdded||this.addButtons(t),this.player.addClass(b0),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),this.player.trigger("resize");return}r==="hover"&&(this.player.removeClass(b0),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}addButtons(e){const t=new Wg(this.player),r=new SC(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(r),this.buttonAdded=!0}enableSubtites(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}B.registerPlugin("playerModePlugin",U5);const om=B.getComponent("Component"),F5=B.getComponent("ClickableComponent"),$5=`
|
|
356
|
+
<svg version="1.1" viewBox="0 0 24 24">
|
|
357
|
+
<path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>
|
|
358
|
+
</svg>
|
|
359
|
+
`,j5=`
|
|
360
|
+
<svg version="1.1" viewBox="0 0 24 24">
|
|
361
|
+
<path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>
|
|
362
|
+
</svg>
|
|
363
|
+
`;class H5 extends om{createEl(){return om.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:`<span class='cv-favourite-heart'>${$5}</span><span class='cv-favourite-outline'>${j5}</span>`})}}class EC extends F5{constructor(e,t){super(e,t),this.isFavourited=t.isFavourited,this.renderIcon(),this.update()}renderIcon(){this.icon&&this.removeChild(this.icon),this.icon=new H5(this.player_),this.addChild(this.icon)}update(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}createEl(e,t,r){e="button",t={innerHTML:"",className:"cv-favourite-button",...t},r={type:"button",...r};const i=om.prototype.createEl.call(this,e,t,r);return this.createControlTextEl(i),i}handleClick(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}EC.prototype.controlText_="Favourite";const V5=B.getPlugin("plugin");class q5 extends V5{setFavourite(e,t){if(this.initialized)return;const r=new EC(this.player,{isFavourited:e,onClick:t});this.player.addChild(r),this.initialized=!0}}B.registerPlugin("favouritePlugin",q5);const z5=B.getComponent("MenuButton"),W5=992,wC="Theatre mode (t)",kC="Default view (t)",S0="cv-theatre-mode-button";class G5 extends z5{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.updateControlText()}getCollabsibleName(){return""}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!(window.innerWidth<W5)}showCollapsibleMenu(){super.handleClick(null)}buildCSSClass(){return`cv-default-mode-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}handleClick(){this.player_.theatreModePlugin().toggleTheatreMode(void 0,{shouldLog:!0}),this.updateControlText()}updateControlText(){this.player().theatreModePlugin().getTheatreMode()?this.controlText(kC):this.controlText(wC)}}B.registerComponent("theatreModeButton",G5);const K5=B.getPlugin("plugin"),C0=992;class X5 extends K5{constructor(e,t){super(e,t),this.options=t,this.bindListeners(),e.ready(()=>this.onReady())}bindListeners(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}onReady(){if(!this.options||window.innerWidth<C0||!this.getCollapserator())return;this.button=this.createButton();const t=this.options.theatreMode;t&&(this.toggleButton(!0),this.options.onRequestTheatreMode(t))}dispose(){this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),super.dispose()}toggleTheatreMode(e,t){var n;if(!this.options)return;const r=this.options.theatreMode,i=e!==void 0?e:!r;if(this.options.onRequestTheatreMode(i),this.options.theatreMode=i,window.requestAnimationFrame(()=>this.player.trigger("resize")),!!this.button)return r!==i&&(t!=null&&t.shouldLog)&&((n=this.analyticsService)==null||n.logUserAction({id:this.options.playbackObject.videoId,name:this.options.playbackObject.title},{actionType:er.Click,descriptor:i?ol.EnableTheatreMode:ol.DisableTheatreMode,entity:Gr.Video})),i?(r||this.player.fill(!0),this.toggleButton(!0),i):(r&&this.player.fluid(!0),this.toggleButton(!1),this.player.viewTranscriptPlugin&&this.player.viewTranscriptPlugin().toggleTranscript(!1,{shouldLog:!1}),i)}onResize(){var e,t;window.innerWidth<C0?(e=this.button)==null||e.hide():this.player.isFullscreen()||(this.button||(this.button=this.createButton()),(t=this.button)==null||t.show())}createButton(){const e=this.getCollapserator();return(e==null?void 0:e.getChild("theatreModeButton"))||e.addChild("theatreModeButton",{},e.children_.length-3),e==null?void 0:e.getChild("theatreModeButton")}onFullscreenChange(){var e,t;this.player.isFullscreen()?(e=this.button)==null||e.hide():(t=this.button)==null||t.show()}getCollapserator(){return this.player.getChild("collapserator")}getTheatreMode(){return this.options.theatreMode}registerAnalytics(e){this.analyticsService=e}toggleButton(e){var t;this.button&&(e?(this.button.addClass(S0),this.button.updateControlText(wC),this.button.setActive(!0)):((t=this.button)==null||t.removeClass(S0),this.button.updateControlText(kC),this.button.setActive(!1)))}}B.registerPlugin("theatreModePlugin",X5);ZC();var jo=null,E0=null;dm&&window.addEventListener("resize",function(){E0!==window.devicePixelRatio&&(E0=window.devicePixelRatio,jo=null)});function w0(){if(jo===null){if(typeof document>"u")return jo=0,jo;var s=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),s.appendChild(e);var t=e.getBoundingClientRect().right;s.removeChild(e),jo=t}return jo}var id=function(e){var t=Array.prototype.reduce.call(e,function(r,i){var n=i.name.match(/data-simplebar-(.+)/);if(n){var a=n[1].replace(/\W+(.)/g,function(o,l){return l.toUpperCase()});switch(i.value){case"true":r[a]=!0;break;case"false":r[a]=!1;break;case void 0:r[a]=!0;break;default:r[a]=i.value}}return r},{});return t};function ba(s){return!s||!s.ownerDocument||!s.ownerDocument.defaultView?window:s.ownerDocument.defaultView}function ep(s){return!s||!s.ownerDocument?document:s.ownerDocument}var Si=(function(){function s(t,r){var i=this;this.onScroll=function(){var n=ba(i.el);i.scrollXTicking||(n.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(n.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(n){i.mouseX=n.clientX,i.mouseY=n.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var a,o;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(a=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(o=i.isWithinBounds(i.axis.y.track.rect)),(a||o)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown"&&(a&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(n,"x"):i.onTrackClick(n,"x")),o&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(n,"y"):i.onTrackClick(n,"y"))))},this.drag=function(n){var a,o=i.axis[i.draggedAxis].track,l=o.rect[i.axis[i.draggedAxis].sizeAttr],u=i.axis[i.draggedAxis].scrollbar,c=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],d=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);n.preventDefault(),n.stopPropagation(),i.draggedAxis==="y"?a=n.pageY:a=n.pageX;var f=a-o.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset,g=f/(l-u.size),E=g*(c-d);i.draggedAxis==="x"&&(E=i.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?E-(l+u.size):E,E=i.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-E:E),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=E},this.onEndDrag=function(n){var a=ep(i.el),o=ba(i.el);n.preventDefault(),n.stopPropagation(),i.el.classList.remove(i.classNames.dragging),a.removeEventListener("mousemove",i.drag,!0),a.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",i.preventClick,!0),a.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault(),n.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},s.defaultOptions,{},r),this.classNames=Object.assign({},s.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!s.instances.has(this.el)&&(this.recalculate=sv(this.recalculate.bind(this),64),this.onMouseMove=sv(this.onMouseMove.bind(this),64),this.hideScrollbars=av(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=av(this.onWindowResize.bind(this),64,{leading:!0}),s.getRtlHelpers=TE(s.getRtlHelpers),this.init())}s.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var i=r.firstElementChild;document.body.appendChild(i);var n=i.firstElementChild;i.scrollLeft=0;var a=s.getOffset(i),o=s.getOffset(n);i.scrollLeft=999;var l=s.getOffset(n);return{isRtlScrollingInverted:a.left!==o.left&&o.left-l.left!==0,isRtlScrollbarInverted:a.left!==o.left}},s.getOffset=function(r){var i=r.getBoundingClientRect(),n=ep(r),a=ba(r);return{top:i.top+(a.pageYOffset||n.documentElement.scrollTop),left:i.left+(a.pageXOffset||n.documentElement.scrollLeft)}};var e=s.prototype;return e.init=function(){s.instances.set(this.el,this),dm&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var r=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(r.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var i=document.createElement("div"),n=document.createElement("div");i.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),i.appendChild(n),this.axis.x.track.el=i.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=i.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.initListeners=function(){var r=this,i=ba(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){r.el.addEventListener(o,r.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){r.el.addEventListener(o,r.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize);var n=!1,a=i.ResizeObserver||_E;this.resizeObserver=new a(function(){n&&r.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){n=!0}),this.mutationObserver=new i.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var r=ba(this.el);this.elStyles=r.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var i=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,l=this.elStyles.overflowX,u=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var c=this.contentEl.scrollHeight,d=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=n?a+"px":"auto",this.placeholderEl.style.height=c+"px";var f=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=d>a,this.axis.y.isOverflowing=c>f,this.axis.x.isOverflowing=l==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=u==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var g=this.axis.x.isOverflowing?this.scrollbarWidth:0,E=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&d>o-E,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&c>f-g,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(r){if(r===void 0&&(r="y"),!this.axis[r].isOverflowing)return 0;var i=this.contentEl[this.axis[r].scrollSizeAttr],n=this.axis[r].track.el[this.axis[r].offsetSizeAttr],a,o=n/i;return a=Math.max(~~(o*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},e.positionScrollbar=function(r){if(r===void 0&&(r="y"),!!this.axis[r].isOverflowing){var i=this.contentWrapperEl[this.axis[r].scrollSizeAttr],n=this.axis[r].track.el[this.axis[r].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[r].sizeAttr],10),o=this.axis[r].scrollbar,l=this.contentWrapperEl[this.axis[r].scrollOffsetAttr];l=r==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-l:l;var u=l/(i-a),c=~~((n-o.size)*u);c=r==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?c+(n-o.size):c,o.el.style.transform=r==="x"?"translate3d("+c+"px, 0, 0)":"translate3d(0, "+c+"px, 0)"}},e.toggleTrackVisibility=function(r){r===void 0&&(r="y");var i=this.axis[r].track.el,n=this.axis[r].scrollbar.el;this.axis[r].isOverflowing||this.axis[r].forceVisible?(i.style.visibility="visible",this.contentWrapperEl.style[this.axis[r].overflowAttr]="scroll"):(i.style.visibility="hidden",this.contentWrapperEl.style[this.axis[r].overflowAttr]="hidden"),this.axis[r].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(r){r===void 0&&(r="y"),this.axis[r].track.rect=this.axis[r].track.el.getBoundingClientRect(),this.axis[r].scrollbar.rect=this.axis[r].scrollbar.el.getBoundingClientRect();var i=this.isWithinBounds(this.axis[r].scrollbar.rect);i?this.axis[r].scrollbar.el.classList.add(this.classNames.hover):this.axis[r].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[r].track.rect)?(this.showScrollbar(r),this.axis[r].track.el.classList.add(this.classNames.hover)):this.axis[r].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(r){r===void 0&&(r="y"),this.axis[r].track.el.classList.remove(this.classNames.hover),this.axis[r].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(r){r===void 0&&(r="y");var i=this.axis[r].scrollbar.el;this.axis[r].isVisible||(i.classList.add(this.classNames.visible),this.axis[r].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(r,i){i===void 0&&(i="y");var n=ep(this.el),a=ba(this.el),o=this.axis[i].scrollbar,l=i==="y"?r.pageY:r.pageX;this.axis[i].dragOffset=l-o.rect[this.axis[i].offsetAttr],this.draggedAxis=i,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(r,i){var n=this;if(i===void 0&&(i="y"),!!this.options.clickOnTrack){var a=ba(this.el);this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var o=this.axis[i].scrollbar,l=o.rect[this.axis[i].offsetAttr],u=parseInt(this.elStyles[this.axis[i].sizeAttr],10),c=this.contentWrapperEl[this.axis[i].scrollOffsetAttr],d=i==="y"?this.mouseY-l:this.mouseX-l,f=d<0?-1:1,g=f===-1?c-u:c+u,E=function S(){if(f===-1){if(c>g){var k;c-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((k={},k[n.axis[i].offsetAttr]=c,k)),a.requestAnimationFrame(S)}}else if(c<g){var F;c+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((F={},F[n.axis[i].offsetAttr]=c,F)),a.requestAnimationFrame(S)}};E()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:w0()}catch{return w0()}},e.removeListeners=function(){var r=this,i=ba(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(n){r.el.removeEventListener(n,r.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(n){r.el.removeEventListener(n,r.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),i.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),s.instances.delete(this.el)},e.isWithinBounds=function(r){return this.mouseX>=r.left&&this.mouseX<=r.left+r.width&&this.mouseY>=r.top&&this.mouseY<=r.top+r.height},e.findChild=function(r,i){var n=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector;return Array.prototype.filter.call(r.children,function(a){return n.call(a,i)})[0]},s})();Si.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};Si.instances=new WeakMap;Si.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(s){s.getAttribute("data-simplebar")!=="init"&&!Si.instances.has(s)&&new Si(s,id(s.attributes))})};Si.removeObserver=function(){this.globalObserver.disconnect()};Si.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),typeof MutationObserver<"u"&&(this.globalObserver=new MutationObserver(Si.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))};Si.handleMutations=function(s){s.forEach(function(e){Array.prototype.forEach.call(e.addedNodes,function(t){t.nodeType===1&&(t.hasAttribute("data-simplebar")?!Si.instances.has(t)&&new Si(t,id(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(r){r.getAttribute("data-simplebar")!=="init"&&!Si.instances.has(r)&&new Si(r,id(r.attributes))}))}),Array.prototype.forEach.call(e.removedNodes,function(t){t.nodeType===1&&(t.hasAttribute('[data-simplebar="init"]')?Si.instances.has(t)&&Si.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(r){Si.instances.has(r)&&Si.instances.get(r).unMount()}))})})};Si.getOptions=id;dm&&Si.initHtmlApi();const Qr=B.getComponent("Menu"),Y5=Qr.prototype.createEl;Qr.prototype.createEl=function(){const e=Y5.call(this);return this.simpleBar=new Si(this.contentEl(),{autoHide:!1}),e};const Q5=Qr.prototype.contentEl;Qr.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():Q5.call(this)};const J5=Qr.prototype.dispose;Qr.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),J5.call(this)};const Z5=Qr.prototype.addItem;Qr.prototype.addItem=function(e){Z5.call(this,e),this.simpleBar.recalculate()};const eR=Qr.prototype.lockShowing;Qr.prototype.lockShowing=function(){eR.call(this),this.simpleBar.recalculate()};Qr.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};const tR=Qr.prototype.handleBlur;Qr.prototype.handleBlur=function(e){const t=e.relatedTarget||document.activeElement;this.el().contains(t)||tR.call(this,e)};const k0="cv-active-button",iR=B.getComponent("Menu"),rR=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},nR=B.getComponent("Component"),ql=B.getComponent("MenuButton");let sR=class extends ql{createMenu(){const e=new iR(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=B.dom.createEl("li",{className:"vjs-menu-title",innerHTML:rR(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;const r=new nR(this.player_,{el:t});e.addItem(r)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}};const aR=ql.prototype.pressButton;ql.prototype.pressButton=function(){aR.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};const oR=ql.prototype.unpressButton;ql.prototype.unpressButton=function(){oR.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()};ql.prototype.setActive=function(e){e?this.addClass(k0):this.removeClass(k0)};B.registerComponent("MenuButton",sR);const lR=B.getComponent("Component");class AC extends lR{buildCSSClass(){return`cv-time-wrapper ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}}AC.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]};B.registerComponent("TimeWrapper",AC);const Lu=B.getComponent("SeekBar");let uR=class extends Lu{handleMouseDown(e){const t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(Lu.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}handleMouseMove(e){Lu.prototype.handleMouseMove.call(this,e),this.update()}getPercent(){const t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}handleMouseUp(e){Lu.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}clamp(e,t,r){return Math.min(Math.max(e,t),r)}getMouseTime(e){return this.clamp(Lu.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}};B.registerComponent("SeekBar",uR);const cR=B.getComponent("Component");class hR extends cR{buildCSSClass(){return`cv-chapter-bar-load-progress ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(e){this.el_.style.width=e*100+"%"}}const dR=B.getComponent("Component");class fR extends dR{buildCSSClass(){return`cv-chapter-bar-play-progress ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=e*100+"%"}}const pR=B.getComponent("Component");class A0 extends pR{constructor(e,t){super(e,t),this.playProgress=new fR(this.player_),this.addChild(this.playProgress),this.loadProgress=new hR(this.player_),this.addChild(this.loadProgress),this.update(),this.updateBuffered(0)}buildCSSClass(){return`cv-chapter-bar-item ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}getCurrentTime(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}update(){const e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){const i=t/e;this.el_.style.width=i*100+"%";const n=this.options_.startTime/e;this.el_.style.left=n*100+"%",this.duration_=e}const r=this.getCurrentTime();r<this.options_.startTime?this.playProgress.update(0):r>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((r-this.options_.startTime)/t)}updateBuffered(e){const t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}function mR(s){const e=s.buffered(),t=s.currentTime();let r=0;for(let i=0;i<e.length;i++){const n=e.start(i),a=e.end(i);if(n<=t&&a>=t){r=a;break}}return r}const gR=B.getComponent("Component");class vR extends gR{buildCSSClass(){return`cv-chapter-bar-items ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(){this.children_.forEach(e=>{e.update()})}updateBuffered(){this.children_.forEach(e=>{e.updateBuffered(mR(this.player_))})}}const yR=B.getComponent("SeekBar");class Gg extends yR{constructor(e,t){super(e,t),this.onDurationChange=this.onDurationChange.bind(this),this.createChapterItems=this.createChapterItems.bind(this),this.updateBuffered=this.updateBuffered.bind(this),yr.useChapters(this.player_,this.createChapterItems),this.player_.on("durationchange",this.onDurationChange),this.player_.on("progress",this.updateBuffered),this.createChapterItems(),this.update()}dispose(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),super.dispose()}createEl(){return B.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}onDurationChange(){this.createChapterItems(),this.update()}update(){const e=super.update();return this.chapterBarItems&&this.chapterBarItems.update(),e}updateBuffered(){this.chapterBarItems.updateBuffered()}bindUpdateListener(e){const t=()=>{this.createChapterItems(),this.updateBuffered()};e.addEventListener("cv:cuechange",t),this.player_.one("dispose",()=>e.removeEventListener("cv:cuechange",t))}createChapterItems(e){var r,i;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);const t=new vR(this.player_);if((i=(r=this.track_)==null?void 0:r.cues)!=null&&i.length&&!this.options_.ignoreChapters)for(let n=0;n<this.track_.cues.length;n++){const a=this.track_.cues[n],o=a.startTime;let l=a.endTime;const u=this.player_.duration();u&&(n===this.track_.cues.length-1&&a.endTime<this.player_.duration()&&(l=this.player_.duration()),l>u&&(l=u));const c=new A0(this.player_,{startTime:o,endTime:l});if(t.addChild(c),u&&l===u)break}else t.addChild(new A0(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=t,this.addChild(this.chapterBarItems)}}Gg.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"};!B.browser.IS_IOS&&!B.browser.IS_ANDROID&&Gg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");B.registerComponent("ChapterSeekBar",Gg);const _R=B.getComponent("ProgressControl"),x0="seekBar";class xC extends _R{constructor(){super(...arguments),this.seekBarName_=x0}setSeekBarName(e){this.seekBarName_=e}getChild(e){return(e==null?void 0:e.toLowerCase())===x0.toLowerCase()&&(e=this.seekBarName_),super.getChild(e)}}xC.prototype.options_={children:[]};B.registerComponent("ProgressControl",xC);function Kg(s,e=s){s=s<0?0:s;let t=Math.floor(s%60),r=Math.floor(s/60%60),i=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(i=r=t="-"),i=i>0||a>0?i+":":"",r=((i||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,i+r+t}const TR=B.getComponent("TimeTooltip");class bR extends TR{constructor(e,t){super(e,t),this.hasCustomChapterText=!1,yr.useChapters(this.player_,r=>{this.track_=r})}createEl(){const e=super.createEl();return this.chapter_=B.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=B.dom.createEl("div"),e.appendChild(this.time_),e}updateTime(e){const t=this.player_.duration();if(B.dom.textContent(this.time_,Kg(e,t)),!(!this.track_||this.hasCustomChapterText)){for(let r=0;r<this.track_.cues.length;r++){const i=this.track_.cues[r],n=i.endTime||t;if(i.startTime<=e&&n>=e){B.dom.textContent(this.chapter_,i.text);return}}B.dom.textContent(this.chapter_,"")}}clearChapterContent(){B.dom.textContent(this.chapter_,"")}updateText(e){B.dom.textContent(this.time_,e)}setCustomChapterText(e){this.hasCustomChapterText=!!e,B.dom.textContent(this.chapter_,e??"")}}B.registerComponent("TimeTooltip",bR);const SR=B.getComponent("Component");class Xg extends SR{constructor(e,t){super(e,t)}setTrack(e){this.track_=e}createEl(){const e=super.createEl("div",{className:"cv-thumbnail-display"});return this.img_=B.dom.createEl("img"),e.appendChild(this.img_),e}enable(){this.addClass("cv-thumbnail-display-enabled")}disable(){this.removeClass("cv-thumbnail-display-enabled")}parseImageLink(e){const t=e.indexOf("#");if(t===-1)return{src:e,w:0,h:0,x:0,y:0};const r=e.substr(0,t),i=e.substr(t+1);if(i.substr(0,5)!=="xywh=")return{src:e,w:0,h:0,x:0,y:0};const n=this.getScale(),a=i.substr(5).split(",");return{src:r,w:parseInt(a[2])*n,h:parseInt(a[3])*n,x:parseInt(a[0])*n,y:parseInt(a[1])*n}}getScale(){let e=this.options_.scaleFactor;const t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&t!=="bottom"&&(e=e*2),e}update(e){var d,f;if(!((f=(d=this.track_)==null?void 0:d.cues)!=null&&f.length))return;const t=e;let r,i=0;for(;i<this.track_.cues.length;){const g=this.track_.cues[i];if(g.startTime<=t&&g.endTime>=t){r=this.parseImageLink(g.text);break}i++}if(!(r!=null&&r.src)){this.disable();return}this.enable();const{src:n,w:a,h:o,x:l,y:u}=r,c=this.getScale();this.img_.src=n,this.img_.style.left=-l+"px",this.img_.style.top=-u+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform=`scale(${c})`,this.el_.style.width=a+"px",this.el_.style.height=o+"px"}}Xg.prototype.options_={scaleFactor:1};B.registerComponent("ThumbnailDisplay",Xg);const CR=B.getComponent("MouseTimeDisplay"),N0="cv-mouse-time-display-force-show";class NC extends CR{constructor(e,t){super(e,t),yr.useMetadataTrack(this.player_,"thumbnails",r=>{this.getChild("ThumbnailDisplay").setTrack(r)}),this.update=this.update.bind(this),this.player_.on("durationchange",this.update),this.player_.one("dispose",()=>{this.player_.off("durationchange",this.update)})}update(e,t){this.requestAnimationFrame(()=>{const r=this.getChild("TimeTooltip"),i=this.getChild("ThumbnailDisplay"),n=t*this.player_.duration(),a=this.player_.preventScrubbingPlugin(),o=this.player_.controlBar.getChild("progressControl").getChild(td);let l=!1;a.isEnabled&&(l=n>a.furthestVisitedTime),l?(this.hide(),o.show(),eg(o.hide,bC,!1,o)()):(this.show(),o&&o.hide(!0),i.update(n),r.updateTime(n));const u=this.el_.getBoundingClientRect();this.el_.style.marginLeft=-(u.width/2)+"px";const c=e.width*t;c<u.width/2?this.el_.style.left=u.width/2+"px":c>e.width-u.width/2?this.el_.style.left=e.width-u.width/2+"px":this.el_.style.left=e.width*t+"px"})}forceShow(){this.addClass(N0)}removeForceShow(){this.removeClass(N0)}}NC.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]};B.registerComponent("MouseTimeDisplay",NC);const D0=B.getComponent("ChaptersTrackMenuItem");class ER extends D0{constructor(e,t){super(e,t),this.nonIconControl=!1,this.thumbnailDisplay=new Xg(this.player_,{scaleFactor:.5}),this.el().insertBefore(this.thumbnailDisplay.el(),this.el().firstChild),yr.useMetadataTrack(this.player_,"thumbnails",r=>{this.addClass("cv-has-thumbnails"),this.thumbnailDisplay.setTrack(r),this.thumbnailDisplay.update(this.options_.cue.startTime)})}update(){this.player_&&D0.prototype.update.call(this)}buildCSSClass(){return"vjs-menu-item cv-chapter-menu-item"}createEl(e,t,r){return this.nonIconControl=!0,super.createEl("li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},t),r)}getInnerHTML(){const e=this.player_.duration();return`<span class="vjs-menu-item-text cv-chapter-menu-item-text"><p>${this.localize(this.options_.label)}</p><p>(${Kg(this.options_.cue.startTime,e)})</p></span>`}}const wR=B.getComponent("ChaptersButton");class kR extends wR{constructor(e,t,r){super(e,t,r),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.player_.on("cv-whiteboard-change",this.update),this.player_.on("fullscreenchange",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-whiteboard-change",this.update),this.player_.off("fullscreenchange",this.update)})}buildCSSClass(){return`cv-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t||t.length<2)return e;for(let r=0,i=t.length;r<i;r++){const n=t[r],a=new ER(this.player_,{track:this.track_,cue:n});e.push(a)}return e}setTrack(e){if(super.setTrack(e),this.track_&&this.track_.kind==="chapters"){e.one("loadeddata",this.update);const t=()=>{this.update(),this.player_.trigger("resizemenus")};e.on("cv:cuechange",t),this.player_.one("dispose",()=>e.off("cv:cueupdate",t))}}update(e){super.update(e)}getCollabsibleName(){return"Chapters"}getCollabsibleValue(){const e=this.track_.activeCues[0];return(e==null?void 0:e.text)||""}showInCollabsibleMenu(){if(!this.track_)return!1;const e=this.track_.cues;return!(!e||!e.length)}showCollapsibleMenu(){this.handleClick(null)}}B.registerComponent("ChaptersButton",kR);const I0=B.getComponent("OffTextTrackMenuItem");let AR=class extends I0{handleClick(e){I0.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}createEl(e,t,r){return super.createEl("li",{className:"vjs-menu-item",tabIndex:-1,...t,innerHTML:'<span class="vjs-menu-item-text">Off</span>'},r)}};B.registerComponent("OffTextTrackMenuItem",AR);const xR=B.getComponent("TextTrackButton"),NR=B.getComponent("TextTrackMenuItem"),DR=B.getComponent("OffTextTrackMenuItem");let IR=class extends xR{createItems(e=[],t=NR){let r;this.label_&&(r=`${this.label_} off`),e.push(new DR(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;const i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<i.length;n++){const a=i[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return this.player().trigger("resizemenus"),e}};B.registerComponent("TextTrackButton",IR);const P0=B.getComponent("SubsCapsMenuItem");class PR extends P0{handleClick(e){P0.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}}const LR=B.getComponent("TextTrackMenuItem");class OR extends LR{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSearchMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-subtitle-search-menu-item"),this.controlText(", opens subtitle search"),this.toggleEnabled=this.toggleEnabled.bind(this);const r=this.player_.textTracks();r.addEventListener("selectedlanguagechange",this.toggleEnabled),this.player_.one("dispose",()=>{r.removeEventListener("selectedlanguagechange",this.toggleEnabled)}),this.toggleEnabled()}toggleEnabled(){var t;if(!this.player_)return;const e=yr.getCurrentTextTrack(this.player_);if(!e){this.addClass("vjs-disabled");return}(t=e.cues)!=null&&t.length?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled"))}bindTrackEvents(e){e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.toggleEnabled)})}handleClick(){var t;const e=yr.getCurrentTextTrack(this.player_);(t=e==null?void 0:e.cues)!=null&&t.length&&this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()})}}const MR=B.getComponent("TextTrackMenuItem");class RR extends MR{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSizeMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-divider-after-menu-item"),this.addClass("cv-subtitle-size-menu-item"),this.controlText(", opens subtitle size settings")}handleClick(){this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()})}}class BR extends eE{constructor(e){super(e)}get name(){return"FormatError"}}const UR={englishName:"Afar",nativeName:"Qafar"},FR={englishName:"Afrikaans",nativeName:"Afrikaans"},$R={englishName:"Aghem",nativeName:"Aghem"},jR={englishName:"Akan",nativeName:"Akan"},HR={englishName:"Amharic",nativeName:"�� ማáˆáŠ›"},VR={englishName:"Arabic",nativeName:"العربية"},qR={englishName:"Mapudungun",nativeName:"Mapudungun"},zR={englishName:"Assamese",nativeName:"অসমীয়া"},WR={englishName:"Asu",nativeName:"Kipare"},GR={englishName:"Asturian",nativeName:"asturianu"},KR={englishName:"Azerbaijani",nativeName:"azÉ™rbaycan dili"},XR={englishName:"Bashkir",nativeName:"Башҡорт"},YR={englishName:"Basaa",nativeName:"Æï¿½ s� a"},QR={englishName:"Belarusian",nativeName:"БеларуÑкаÑ"},JR={englishName:"Bemba",nativeName:"Ichibemba"},ZR={englishName:"Bena",nativeName:"Hibena"},e8={englishName:"Bulgarian",nativeName:"българÑки"},t8={englishName:"Edo",nativeName:"Ẹ̀dó"},i8={englishName:"Bamanankan",nativeName:"bamanakan"},r8={englishName:"Bangla",nativeName:"বাংলা"},n8={englishName:"Tibetan",nativeName:"བོད་ཡིག"},s8={englishName:"Breton",nativeName:"brezhoneg"},a8={englishName:"Bodo",nativeName:"बड़ो"},o8={englishName:"Bosnian",nativeName:"bosanski"},l8={englishName:"Blin",nativeName:"ብሊን"},u8={englishName:"Catalan",nativeName:"catal� "},c8={englishName:"Chechen",nativeName:"нохчийн"},h8={englishName:"Chiga",nativeName:"Rukiga"},d8={englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},f8={englishName:"Corsican",nativeName:"Corsu"},p8={englishName:"Czech",nativeName:"ÄeÅ¡tina"},m8={englishName:"Church Slavic",nativeName:"церковноÑловеÌнÑкїй"},g8={englishName:"Welsh",nativeName:"Cymraeg"},v8={englishName:"Danish",nativeName:"dansk"},y8={englishName:"Taita",nativeName:"Kitaita"},_8={englishName:"German",nativeName:"Deutsch"},T8={englishName:"Zarma",nativeName:"Zarmaciine"},b8={englishName:"Lower Sorbian",nativeName:"dolnoserbšćina"},S8={englishName:"Duala",nativeName:"duálá"},C8={englishName:"Divehi",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ°"},E8={englishName:"Jola-Fonyi",nativeName:"joola"},w8={englishName:"Dzongkha",nativeName:"རྫོང་à½"},k8={englishName:"Embu",nativeName:"KÄ©embu"},A8={englishName:"Ewe",nativeName:"EÊ‹egbe"},x8={englishName:"Greek",nativeName:"Ελληνικά"},N8={englishName:"English",nativeName:"English"},D8={englishName:"Esperanto",nativeName:"esperanto"},I8={englishName:"Spanish",nativeName:"español"},P8={englishName:"Estonian",nativeName:"eesti"},L8={englishName:"Basque",nativeName:"euskara"},O8={englishName:"Ewondo",nativeName:"ewondo"},M8={englishName:"Persian",nativeName:"ÙØ§Ø±Ø³Ù‰"},R8={englishName:"Fulah",nativeName:"Fulah"},B8={englishName:"Finnish",nativeName:"suomi"},U8={englishName:"Filipino",nativeName:"Filipino"},F8={englishName:"Faroese",nativeName:"føroyskt"},$8={englishName:"French",nativeName:"français"},j8={englishName:"Friulian",nativeName:"furlan"},H8={englishName:"Western Frisian",nativeName:"Frysk"},V8={englishName:"Irish",nativeName:"Gaeilge"},q8={englishName:"Scottish Gaelic",nativeName:"G� idhlig"},z8={englishName:"Galician",nativeName:"galego"},W8={englishName:"Guarani",nativeName:"Avañe’ẽ"},G8={englishName:"Alsatian",nativeName:"Elsässisch"},K8={englishName:"Gujarati",nativeName:"ગà«àªœàª°àª¾àª¤à«€"},X8={englishName:"Gusii",nativeName:"Ekegusii"},Y8={englishName:"Manx",nativeName:"Gaelg"},Q8={englishName:"Hausa",nativeName:"Hausa"},J8={englishName:"Hawaiian",nativeName:"ʻŌlelo HawaiÊ»i"},Z8={englishName:"Hebrew",nativeName:"עברית"},e6={englishName:"Hindi",nativeName:"हिंदी"},t6={englishName:"Croatian",nativeName:"hrvatski"},i6={englishName:"Upper Sorbian",nativeName:"hornjoserbšćina"},r6={englishName:"Hungarian",nativeName:"magyar"},n6={englishName:"Armenian",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},s6={englishName:"Interlingua",nativeName:"interlingua"},a6={englishName:"Ibibio",nativeName:"Ibibio-Efik"},o6={englishName:"Indonesian",nativeName:"Indonesia"},l6={englishName:"Igbo",nativeName:"Igbo"},u6={englishName:"Yi",nativeName:"ꆈ�� ê±ê‚·"},c6={englishName:"Icelandic",nativeName:"Ãslenska"},h6={englishName:"Italian",nativeName:"italiano"},d6={englishName:"Inuktitut",nativeName:"Inuktitut"},f6={englishName:"Japanese",nativeName:"日本語"},p6={englishName:"Ngomba",nativeName:"Ndaꞌa"},m6={englishName:"Machame",nativeName:"Kimachame"},g6={englishName:"Javanese",nativeName:"Basa Jawa"},v6={englishName:"Georgian",nativeName:"ქáƒï¿½ï¿½ თული"},y6={englishName:"Kabyle",nativeName:"Taqbaylit"},_6={englishName:"Kamba",nativeName:"Kikamba"},T6={englishName:"Makonde",nativeName:"Chimakonde"},b6={englishName:"Kabuverdianu",nativeName:"kabuverdianu"},S6={englishName:"Koyra Chiini",nativeName:"Koyra ciini"},C6={englishName:"Kikuyu",nativeName:"Gikuyu"},E6={englishName:"Kazakh",nativeName:"қазақ тілі"},w6={englishName:"Kako",nativeName:"kakÉ”"},k6={englishName:"Greenlandic",nativeName:"kalaallisut"},A6={englishName:"Kalenjin",nativeName:"Kalenjin"},x6={englishName:"Khmer",nativeName:"ភាសាážáŸ’មែរ"},N6={englishName:"Kannada",nativeName:"ಕನà³à²¨à²¡"},D6={englishName:"Korean",nativeName:"한êµì–´"},I6={englishName:"Konkani",nativeName:"कोंकणी"},P6={englishName:"Kanuri",nativeName:"Kanuri"},L6={englishName:"Kashmiri",nativeName:"Ú©Ù²Ø´ÙØ±"},O6={englishName:"Shambala",nativeName:"Kishambaa"},M6={englishName:"Bafia",nativeName:"rikpa"},R6={englishName:"Ripuarian",nativeName:"Kölsch"},B6={englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},U6={englishName:"Cornish",nativeName:"kernewek"},F6={englishName:"Kyrgyz",nativeName:"Кыргыз"},$6={englishName:"Latin",nativeName:"lingua latÄ«na"},j6={englishName:"Langi",nativeName:"Kɨlaangi"},H6={englishName:"Luxembourgish",nativeName:"Lëtzebuergesch"},V6={englishName:"Ganda",nativeName:"Luganda"},q6={englishName:"Lakota",nativeName:"Lakȟólʼiyapi"},z6={englishName:"Lingala",nativeName:"lingála"},W6={englishName:"Lao",nativeName:"ລາວ"},G6={englishName:"Northern Luri",nativeName:"لۊری شومالی"},K6={englishName:"Lithuanian",nativeName:"lietuvių"},X6={englishName:"Luba-Katanga",nativeName:"Tshiluba"},Y6={englishName:"Luo",nativeName:"Dholuo"},Q6={englishName:"Luyia",nativeName:"Luluhia"},J6={englishName:"Latvian",nativeName:"latvieÅ¡u"},Z6={englishName:"Masai",nativeName:"Maa"},eB={englishName:"Meru",nativeName:"KÄ©mÄ©rÅ©"},tB={englishName:"Morisyen",nativeName:"kreol morisien"},iB={englishName:"Malagasy",nativeName:"Malagasy"},rB={englishName:"Makhuwa-Meetto",nativeName:"Makua"},nB={englishName:"Metaʼ",nativeName:"metaʼ"},sB={englishName:"Maori",nativeName:"Reo MÄori"},aB={englishName:"Macedonian",nativeName:"македонÑки"},oB={englishName:"Malayalam",nativeName:"മലയാളം"},lB={englishName:"Mongolian",nativeName:"Монгол Ñ…Ñл"},uB={englishName:"Manipuri",nativeName:"মৈতৈলোনà§"},cB={englishName:"Mohawk",nativeName:"Kanien’kéha"},hB={englishName:"Marathi",nativeName:"मरा�� ी"},dB={englishName:"Malay",nativeName:"Bahasa Melayu"},fB={englishName:"Maltese",nativeName:"Malti"},pB={englishName:"Mundang",nativeName:"MUNDAÅŠ"},mB={englishName:"Burmese",nativeName:"ဗမာ"},gB={englishName:"Mazanderani",nativeName:"مازرونی"},vB={englishName:"Nama",nativeName:"Khoekhoegowab"},yB={englishName:"Norwegian BokmÃ¥l",nativeName:"norsk bokmÃ¥l"},_B={englishName:"North Ndebele",nativeName:"isiNdebele"},TB={englishName:"Nepali",nativeName:"नेपाली"},bB={englishName:"Dutch",nativeName:"Nederlands"},SB={englishName:"Kwasio",nativeName:"Kwasio"},CB={englishName:"Norwegian Nynorsk",nativeName:"nynorsk"},EB={englishName:"Ngiemboon",nativeName:"Shwóŋò ngiembɔɔn"},wB={englishName:"Norwegian",nativeName:"norsk"},kB={englishName:"N'ko",nativeName:"ß’ßžß"},AB={englishName:"South Ndebele",nativeName:"isiNdebele"},xB={englishName:"Sesotho sa Leboa",nativeName:"Sesotho sa Leboa"},NB={englishName:"Nuer",nativeName:"Thok Nath"},DB={englishName:"Nyankole",nativeName:"Runyankore"},IB={englishName:"Occitan",nativeName:"Occitan"},PB={englishName:"Oromo",nativeName:"Oromoo"},LB={englishName:"Odia",nativeName:"ଓàœà¬¿à¬†"},OB={englishName:"Ossetian",nativeName:"Ирон æвзаг"},MB={englishName:"Punjabi",nativeName:"ਪੰਜਾਬੀ"},RB={englishName:"Papiamento",nativeName:"Papiamentu"},BB={englishName:"Polish",nativeName:"polski"},UB={englishName:"Prussian",nativeName:"prÅ«siskan"},FB={englishName:"Dari",nativeName:"درى"},$B={englishName:"Pashto",nativeName:"پښتو"},jB={englishName:"Portuguese",nativeName:"português"},HB={englishName:"K'iche'",nativeName:"K'iche'"},VB={englishName:"Quechua",nativeName:"runasimi"},qB={englishName:"Romansh",nativeName:"rumantsch"},zB={englishName:"Rundi",nativeName:"Ikirundi"},WB={englishName:"Romanian",nativeName:"română"},GB={englishName:"Rombo",nativeName:"Kihorombo"},KB={englishName:"Russian",nativeName:"руÑÑкий"},XB={englishName:"Kinyarwanda",nativeName:"Kinyarwanda"},YB={englishName:"Rwa",nativeName:"Kiruwa"},QB={englishName:"Sanskrit",nativeName:"संसà¥à¤•ृत"},JB={englishName:"Sakha",nativeName:"Саха"},ZB={englishName:"Samburu",nativeName:"Kisampur"},eU={englishName:"Sangu",nativeName:"Ishisangu"},tU={englishName:"Sindhi",nativeName:"سنڌي"},iU={englishName:"Northern Sami",nativeName:"davvisámegiella"},rU={englishName:"Sena",nativeName:"sena"},nU={englishName:"Koyraboro Senni",nativeName:"Koyraboro senni"},sU={englishName:"Sango",nativeName:"Sängö"},aU={englishName:"Tachelhit",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ"},oU={englishName:"Sinhala",nativeName:"සිංහල"},lU={englishName:"Slovak",nativeName:"slovenÄina"},uU={englishName:"Slovenian",nativeName:"slovenÅ¡Äina"},cU={englishName:"Sami (Southern)",nativeName:"Ã¥arjelsaemiengïele"},hU={englishName:"Sami (Lule)",nativeName:"julevusámegiella"},dU={englishName:"Sami (Inari)",nativeName:"anarâškielâ"},fU={englishName:"Sami (Skolt)",nativeName:"sää´mÇ©iõll"},pU={englishName:"Shona",nativeName:"chiShona"},mU={englishName:"Somali",nativeName:"Soomaali"},gU={englishName:"Albanian",nativeName:"shqip"},vU={englishName:"Serbian",nativeName:"srpski"},yU={englishName:"siSwati",nativeName:"Siswati"},_U={englishName:"Saho",nativeName:"Saho"},TU={englishName:"Sesotho",nativeName:"Sesotho"},bU={englishName:"Swedish",nativeName:"svenska"},SU={englishName:"Kiswahili",nativeName:"Kiswahili"},CU={englishName:"Syriac",nativeName:"ܣܘܪÜÜÜ"},EU={englishName:"Tamil",nativeName:"தமிழà¯"},wU={englishName:"Telugu",nativeName:"తెలà±à°—à±"},kU={englishName:"Teso",nativeName:"Kiteso"},AU={englishName:"Tajik",nativeName:"Тоҷикӣ"},xU={englishName:"Thai",nativeName:"ไทย"},NU={englishName:"Tigrinya",nativeName:"ትáŒáˆáŠ›"},DU={englishName:"Tigre",nativeName:"ትáŒáˆ¨"},IU={englishName:"Turkmen",nativeName:"Türkmen dili"},PU={englishName:"Setswana",nativeName:"Setswana"},LU={englishName:"Tongan",nativeName:"lea fakatonga"},OU={englishName:"Turkish",nativeName:"Türkçe"},MU={englishName:"Tsonga",nativeName:"Xitsonga"},RU={englishName:"Tatar",nativeName:"Татар"},BU={englishName:"Tasawaq",nativeName:"Tasawaq senni"},UU={englishName:"Central Atlas Tamazight",nativeName:"TamaziÉ£t n laá¹laá¹£"},FU={englishName:"Uyghur",nativeName:"ئۇيغۇرچە"},$U={englishName:"Ukrainian",nativeName:"українÑька"},jU={englishName:"Urdu",nativeName:"Ø§ÙØ±Ø¯Ùˆ"},HU={englishName:"Uzbek",nativeName:"o‘zbek"},VU={englishName:"Vai",nativeName:"ꕙꔤ"},qU={englishName:"Venda",nativeName:"Tshivenḓa"},zU={englishName:"Vietnamese",nativeName:"TiêÌng Việt"},WU={englishName:"Volapük",nativeName:"Volapük"},GU={englishName:"Vunjo",nativeName:"Kyivunjo"},KU={englishName:"Walser",nativeName:"Walser"},XU={englishName:"Wolaytta",nativeName:"ወላá‹á‰³á‰±"},YU={englishName:"Wolof",nativeName:"Wolof"},QU={englishName:"isiXhosa",nativeName:"isiXhosa"},JU={englishName:"Soga",nativeName:"Olusoga"},ZU={englishName:"Yangben",nativeName:"nuasue"},eF={englishName:"Yiddish",nativeName:"ייִדיש"},tF={englishName:"Yoruba",nativeName:"Èdè Yorùbá"},iF={englishName:"Standard Moroccan Tamazight",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},rF={englishName:"Chinese",nativeName:"䏿–‡"},nF={englishName:"isiZulu",nativeName:"isiZulu"},lm={aa:UR,"aa-dj":{englishName:"Afar (Djibouti)",nativeName:"Qafar (Yabuuti)"},"aa-er":{englishName:"Afar (Eritrea)",nativeName:"Qafar (Eretria)"},"aa-et":{englishName:"Afar (Ethiopia)",nativeName:"Qafar (Otobbia)"},af:FR,"af-na":{englishName:"Afrikaans (Namibia)",nativeName:"Afrikaans (Namibië)"},"af-za":{englishName:"Afrikaans (South Africa)",nativeName:"Afrikaans (Suid-Afrika)"},agq:$R,"agq-cm":{englishName:"Aghem (Cameroon)",nativeName:"Aghem (K� m� lûŋ)"},ak:jR,"ak-gh":{englishName:"Akan (Ghana)",nativeName:"Akan (Gaana)"},am:HR,"am-et":{englishName:"Amharic (Ethiopia)",nativeName:"�� ማáˆáŠ› (ኢትዮጵያ)"},ar:VR,"ar-001":{englishName:"Arabic (World)",nativeName:"العربية (العالم)"},"ar-ae":{englishName:"Arabic (United Arab Emirates)",nativeName:"العربية (الإمارات العربية Ø§Ù„Ù…ØªØØ¯Ø©)"},"ar-bh":{englishName:"Arabic (Bahrain)",nativeName:"العربية (Ø§Ù„Ø¨ØØ±ÙŠÙ†)"},"ar-dj":{englishName:"Arabic (Djibouti)",nativeName:"العربية (جيبوتي)"},"ar-dz":{englishName:"Arabic (Algeria)",nativeName:"العربية (الجزائر)"},"ar-eg":{englishName:"Arabic (Egypt)",nativeName:"العربية (مصر)"},"ar-er":{englishName:"Arabic (Eritrea)",nativeName:"العربية (إريتريا)"},"ar-il":{englishName:"Arabic (Israel)",nativeName:"العربية (إسرائيل)"},"ar-iq":{englishName:"Arabic (Iraq)",nativeName:"العربية (العراق)"},"ar-jo":{englishName:"Arabic (Jordan)",nativeName:"العربية (الأردن)"},"ar-km":{englishName:"Arabic (Comoros)",nativeName:"العربية (جزر القمر)"},"ar-kw":{englishName:"Arabic (Kuwait)",nativeName:"العربية (الكويت)"},"ar-lb":{englishName:"Arabic (Lebanon)",nativeName:"العربية (لبنان)"},"ar-ly":{englishName:"Arabic (Libya)",nativeName:"العربية (ليبيا)"},"ar-ma":{englishName:"Arabic (Morocco)",nativeName:"العربية (المملكة المغربية)"},"ar-mr":{englishName:"Arabic (Mauritania)",nativeName:"العربية (موريتانيا)"},"ar-om":{englishName:"Arabic (Oman)",nativeName:"العربية (عمان)"},"ar-ps":{englishName:"Arabic (Palestinian Authority)",nativeName:"العربية (السلطة الÙلسطينية)"},"ar-qa":{englishName:"Arabic (Qatar)",nativeName:"العربية (قطر)"},"ar-sa":{englishName:"Arabic (Saudi Arabia)",nativeName:"العربية (المملكة العربية السعودية)"},"ar-sd":{englishName:"Arabic (Sudan)",nativeName:"العربية (السودان)"},"ar-so":{englishName:"Arabic (Somalia)",nativeName:"العربية (الصومال)"},"ar-ss":{englishName:"Arabic (South Sudan)",nativeName:"العربية (جنوب السودان)"},"ar-sy":{englishName:"Arabic (Syria)",nativeName:"العربية (سوريا)"},"ar-td":{englishName:"Arabic (Chad)",nativeName:"العربية (تشاد)"},"ar-tn":{englishName:"Arabic (Tunisia)",nativeName:"العربية (تونس)"},"ar-ye":{englishName:"Arabic (Yemen)",nativeName:"العربية (اليمن)"},arn:qR,"arn-cl":{englishName:"Mapudungun (Chile)",nativeName:"Mapudungun (Chile)"},as:zR,"as-in":{englishName:"Assamese (India)",nativeName:"অসমীয়া (à¦à¦¾à§°à¦¤)"},asa:WR,"asa-tz":{englishName:"Asu (Tanzania)",nativeName:"Kipare (Tadhania)"},ast:GR,"ast-es":{englishName:"Asturian (Spain)",nativeName:"asturianu (España)"},az:KR,"az-cyrl":{englishName:"Azerbaijani (Cyrillic)",nativeName:"Ðзәрбајҹан дили"},"az-cyrl-az":{englishName:"Azerbaijani (Cyrillic, Azerbaijan)",nativeName:"Ðзәрбајҹан дили (Ðзәрбајҹан)"},"az-latn":{englishName:"Azerbaijani (Latin)",nativeName:"AzÉ™rbaycan dili"},"az-latn-az":{englishName:"Azerbaijani (Latin, Azerbaijan)",nativeName:"AzÉ™rbaycan dili (AzÉ™rbaycan)"},ba:XR,"ba-ru":{englishName:"Bashkir (Russia)",nativeName:"Башҡорт (� Ó™Ñәй)"},bas:YR,"bas-cm":{englishName:"Basaa (Cameroon)",nativeName:"Æï¿½ s� a (K� mɛ̀rûn)"},be:QR,"be-by":{englishName:"Belarusian (Belarus)",nativeName:"БеларуÑÐºÐ°Ñ (БеларуÑÑŒ)"},bem:JR,"bem-zm":{englishName:"Bemba (Zambia)",nativeName:"Ichibemba (Zambia)"},bez:ZR,"bez-tz":{englishName:"Bena (Tanzania)",nativeName:"Hibena (Hutanzania)"},bg:e8,"bg-bg":{englishName:"Bulgarian (Bulgaria)",nativeName:"българÑки (БългариÑ)"},bin:t8,"bin-ng":{englishName:"Edo (Nigeria)",nativeName:"Ẹ̀dó (Nigeria)"},bm:i8,"bm-latn":{englishName:"Bamanankan (Latin)",nativeName:"bamanakan"},"bm-latn-ml":{englishName:"Bamanankan (Latin, Mali)",nativeName:"bamanakan (Mali)"},bn:r8,"bn-bd":{englishName:"Bangla (Bangladesh)",nativeName:"বাংলা (বাংলাদেশ)"},"bn-in":{englishName:"Bangla (India)",nativeName:"বাংলা (à¦à¦¾à¦°à¦¤)"},bo:n8,"bo-cn":{englishName:"Tibetan (China)",nativeName:"བོད་ཡིག (ཀྲུང་ཧà¾à¼‹à½˜à½²à¼‹à½‘མངས་སྤྱི་མà½à½´à½“་རྒྱལ་à½à½–à¼)"},"bo-in":{englishName:"Tibetan (India)",nativeName:"བོད་སà¾à½‘་ (རྒྱ་གར་)"},br:s8,"br-fr":{englishName:"Breton (France)",nativeName:"brezhoneg (Frañs)"},brx:a8,"brx-in":{englishName:"Bodo (India)",nativeName:"बड़ो (à¤à¤¾à¤°à¤¤)"},bs:o8,"bs-cyrl":{englishName:"Bosnian (Cyrillic)",nativeName:"боÑанÑки"},"bs-cyrl-ba":{englishName:"Bosnian (Cyrillic, Bosnia and Herzegovina)",nativeName:"боÑанÑки (БоÑна и Херцеговина)"},"bs-latn":{englishName:"Bosnian (Latin)",nativeName:"bosanski"},"bs-latn-ba":{englishName:"Bosnian (Latin, Bosnia and Herzegovina)",nativeName:"bosanski (Bosna i Hercegovina)"},byn:l8,"byn-er":{englishName:"Blin (Eritrea)",nativeName:"ብሊን (ኤáˆá‰µáˆ«)"},ca:u8,"ca-ad":{englishName:"Catalan (Andorra)",nativeName:"catal� (Andorra)"},"ca-es":{englishName:"Catalan (Catalan)",nativeName:"catal� (catal� )"},"ca-es-valencia":{englishName:"Valencian (Spain)",nativeName:"valenci� (Espanya)"},"ca-fr":{englishName:"Catalan (France)",nativeName:"catal� (França)"},"ca-it":{englishName:"Catalan (Italy)",nativeName:"catal� (It� lia)"},ce:c8,"ce-ru":{englishName:"Chechen (Russia)",nativeName:"нохчийн (� оÑÑи)"},cgg:h8,"cgg-ug":{englishName:"Chiga (Uganda)",nativeName:"Rukiga (Uganda)"},chr:d8,"chr-cher":{englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},"chr-cher-us":{englishName:"Cherokee (Cherokee)",nativeName:"á£áŽ³áŽ© (á£áŽ³áŽ©)"},co:f8,"co-fr":{englishName:"Corsican (France)",nativeName:"Corsu (Francia)"},cs:p8,"cs-cz":{englishName:"Czech (Czech Republic)",nativeName:"ÄeÅ¡tina (ÄŒeská republika)"},cu:m8,"cu-ru":{englishName:"Church Slavic (Russia)",nativeName:"церковноÑловеÌнÑкїй (рѡÑÑÑ–Ìа)"},cy:g8,"cy-gb":{englishName:"Welsh (United Kingdom)",nativeName:"Cymraeg (Y Deyrnas Unedig)"},da:v8,"da-dk":{englishName:"Danish (Denmark)",nativeName:"dansk (Danmark)"},"da-gl":{englishName:"Danish (Greenland)",nativeName:"dansk (Grønland)"},dav:y8,"dav-ke":{englishName:"Taita (Kenya)",nativeName:"Kitaita (Kenya)"},de:_8,"de-at":{englishName:"German (Austria)",nativeName:"Deutsch (Österreich)"},"de-be":{englishName:"German (Belgium)",nativeName:"Deutsch (Belgien)"},"de-ch":{englishName:"German (Switzerland)",nativeName:"Deutsch (Schweiz)"},"de-de":{englishName:"German (Germany)",nativeName:"Deutsch (Deutschland)"},"de-li":{englishName:"German (Liechtenstein)",nativeName:"Deutsch (Liechtenstein)"},"de-lu":{englishName:"German (Luxembourg)",nativeName:"Deutsch (Luxemburg)"},dje:T8,"dje-ne":{englishName:"Zarma (Niger)",nativeName:"Zarmaciine (Nižer)"},dsb:b8,"dsb-de":{englishName:"Lower Sorbian (Germany)",nativeName:"dolnoserbšćina (Nimska)"},dua:S8,"dua-cm":{englishName:"Duala (Cameroon)",nativeName:"duálá (Cameroun)"},dv:C8,"dv-mv":{englishName:"Divehi (Maldives)",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ° (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},dyo:E8,"dyo-sn":{englishName:"Jola-Fonyi (Senegal)",nativeName:"joola (Senegal)"},dz:w8,"dz-bt":{englishName:"Dzongkha (Bhutan)",nativeName:"རྫོང་འ(�� བྲུག)"},ebu:k8,"ebu-ke":{englishName:"Embu (Kenya)",nativeName:"KÄ©embu (Kenya)"},ee:A8,"ee-gh":{englishName:"Ewe (Ghana)",nativeName:"EÊ‹egbe (Ghana nutome)"},"ee-tg":{englishName:"Ewe (Togo)",nativeName:"EÊ‹egbe (Togo nutome)"},el:x8,"el-cy":{englishName:"Greek (Cyprus)",nativeName:"Ελληνικά (ΚÏÏ€Ïος)"},"el-gr":{englishName:"Greek (Greece)",nativeName:"Ελληνικά (Ελλάδα)"},en:N8,"en-001":{englishName:"English (World)",nativeName:"English (World)"},"en-029":{englishName:"English (Caribbean)",nativeName:"English (Caribbean)"},"en-150":{englishName:"English (Europe)",nativeName:"English (Europe)"},"en-ag":{englishName:"English (Antigua and Barbuda)",nativeName:"English (Antigua and Barbuda)"},"en-ai":{englishName:"English (Anguilla)",nativeName:"English (Anguilla)"},"en-as":{englishName:"English (American Samoa)",nativeName:"English (American Samoa)"},"en-at":{englishName:"English (Austria)",nativeName:"English (Austria)"},"en-au":{englishName:"English (Australia)",nativeName:"English (Australia)"},"en-bb":{englishName:"English (Barbados)",nativeName:"English (Barbados)"},"en-be":{englishName:"English (Belgium)",nativeName:"English (Belgium)"},"en-bi":{englishName:"English (Burundi)",nativeName:"English (Burundi)"},"en-bm":{englishName:"English (Bermuda)",nativeName:"English (Bermuda)"},"en-bs":{englishName:"English (Bahamas)",nativeName:"English (Bahamas)"},"en-bw":{englishName:"English (Botswana)",nativeName:"English (Botswana)"},"en-bz":{englishName:"English (Belize)",nativeName:"English (Belize)"},"en-ca":{englishName:"English (Canada)",nativeName:"English (Canada)"},"en-cc":{englishName:"English (Cocos (Keeling) Islands)",nativeName:"English (Cocos (Keeling) Islands)"},"en-ch":{englishName:"English (Switzerland)",nativeName:"English (Switzerland)"},"en-ck":{englishName:"English (Cook Islands)",nativeName:"English (Cook Islands)"},"en-cm":{englishName:"English (Cameroon)",nativeName:"English (Cameroon)"},"en-cx":{englishName:"English (Christmas Island)",nativeName:"English (Christmas Island)"},"en-cy":{englishName:"English (Cyprus)",nativeName:"English (Cyprus)"},"en-de":{englishName:"English (Germany)",nativeName:"English (Germany)"},"en-dk":{englishName:"English (Denmark)",nativeName:"English (Denmark)"},"en-dm":{englishName:"English (Dominica)",nativeName:"English (Dominica)"},"en-er":{englishName:"English (Eritrea)",nativeName:"English (Eritrea)"},"en-fi":{englishName:"English (Finland)",nativeName:"English (Finland)"},"en-fj":{englishName:"English (Fiji)",nativeName:"English (Fiji)"},"en-fk":{englishName:"English (Falkland Islands)",nativeName:"English (Falkland Islands)"},"en-fm":{englishName:"English (Micronesia)",nativeName:"English (Micronesia)"},"en-gb":{englishName:"English (United Kingdom)",nativeName:"English (United Kingdom)"},"en-gd":{englishName:"English (Grenada)",nativeName:"English (Grenada)"},"en-gg":{englishName:"English (Guernsey)",nativeName:"English (Guernsey)"},"en-gh":{englishName:"English (Ghana)",nativeName:"English (Ghana)"},"en-gi":{englishName:"English (Gibraltar)",nativeName:"English (Gibraltar)"},"en-gm":{englishName:"English (Gambia)",nativeName:"English (Gambia)"},"en-gu":{englishName:"English (Guam)",nativeName:"English (Guam)"},"en-gy":{englishName:"English (Guyana)",nativeName:"English (Guyana)"},"en-hk":{englishName:"English (Hong Kong SAR)",nativeName:"English (Hong Kong SAR)"},"en-id":{englishName:"English (Indonesia)",nativeName:"English (Indonesia)"},"en-ie":{englishName:"English (Ireland)",nativeName:"English (Ireland)"},"en-il":{englishName:"English (Israel)",nativeName:"English (Israel)"},"en-im":{englishName:"English (Isle of Man)",nativeName:"English (Isle of Man)"},"en-in":{englishName:"English (India)",nativeName:"English (India)"},"en-io":{englishName:"English (British Indian Ocean Territory)",nativeName:"English (British Indian Ocean Territory)"},"en-je":{englishName:"English (Jersey)",nativeName:"English (Jersey)"},"en-jm":{englishName:"English (Jamaica)",nativeName:"English (Jamaica)"},"en-ke":{englishName:"English (Kenya)",nativeName:"English (Kenya)"},"en-ki":{englishName:"English (Kiribati)",nativeName:"English (Kiribati)"},"en-kn":{englishName:"English (Saint Kitts and Nevis)",nativeName:"English (Saint Kitts and Nevis)"},"en-ky":{englishName:"English (Cayman Islands)",nativeName:"English (Cayman Islands)"},"en-lc":{englishName:"English (Saint Lucia)",nativeName:"English (Saint Lucia)"},"en-lr":{englishName:"English (Liberia)",nativeName:"English (Liberia)"},"en-ls":{englishName:"English (Lesotho)",nativeName:"English (Lesotho)"},"en-mg":{englishName:"English (Madagascar)",nativeName:"English (Madagascar)"},"en-mh":{englishName:"English (Marshall Islands)",nativeName:"English (Marshall Islands)"},"en-mo":{englishName:"English (Macao SAR)",nativeName:"English (Macao SAR)"},"en-mp":{englishName:"English (Northern Mariana Islands)",nativeName:"English (Northern Mariana Islands)"},"en-ms":{englishName:"English (Montserrat)",nativeName:"English (Montserrat)"},"en-mt":{englishName:"English (Malta)",nativeName:"English (Malta)"},"en-mu":{englishName:"English (Mauritius)",nativeName:"English (Mauritius)"},"en-mw":{englishName:"English (Malawi)",nativeName:"English (Malawi)"},"en-my":{englishName:"English (Malaysia)",nativeName:"English (Malaysia)"},"en-na":{englishName:"English (Namibia)",nativeName:"English (Namibia)"},"en-nf":{englishName:"English (Norfolk Island)",nativeName:"English (Norfolk Island)"},"en-ng":{englishName:"English (Nigeria)",nativeName:"English (Nigeria)"},"en-nl":{englishName:"English (Netherlands)",nativeName:"English (Netherlands)"},"en-nr":{englishName:"English (Nauru)",nativeName:"English (Nauru)"},"en-nu":{englishName:"English (Niue)",nativeName:"English (Niue)"},"en-nz":{englishName:"English (New Zealand)",nativeName:"English (New Zealand)"},"en-pg":{englishName:"English (Papua New Guinea)",nativeName:"English (Papua New Guinea)"},"en-ph":{englishName:"English (Philippines)",nativeName:"English (Philippines)"},"en-pk":{englishName:"English (Pakistan)",nativeName:"English (Pakistan)"},"en-pn":{englishName:"English (Pitcairn Islands)",nativeName:"English (Pitcairn Islands)"},"en-pr":{englishName:"English (Puerto Rico)",nativeName:"English (Puerto Rico)"},"en-pw":{englishName:"English (Palau)",nativeName:"English (Palau)"},"en-rw":{englishName:"English (Rwanda)",nativeName:"English (Rwanda)"},"en-sb":{englishName:"English (Solomon Islands)",nativeName:"English (Solomon Islands)"},"en-sc":{englishName:"English (Seychelles)",nativeName:"English (Seychelles)"},"en-sd":{englishName:"English (Sudan)",nativeName:"English (Sudan)"},"en-se":{englishName:"English (Sweden)",nativeName:"English (Sweden)"},"en-sg":{englishName:"English (Singapore)",nativeName:"English (Singapore)"},"en-sh":{englishName:"English (St Helena, Ascension, Tristan da Cunha)",nativeName:"English (St Helena, Ascension, Tristan da Cunha)"},"en-si":{englishName:"English (Slovenia)",nativeName:"English (Slovenia)"},"en-sl":{englishName:"English (Sierra Leone)",nativeName:"English (Sierra Leone)"},"en-ss":{englishName:"English (South Sudan)",nativeName:"English (South Sudan)"},"en-sx":{englishName:"English (Sint Maarten)",nativeName:"English (Sint Maarten)"},"en-sz":{englishName:"English (Swaziland)",nativeName:"English (Swaziland)"},"en-tc":{englishName:"English (Turks and Caicos Islands)",nativeName:"English (Turks and Caicos Islands)"},"en-tk":{englishName:"English (Tokelau)",nativeName:"English (Tokelau)"},"en-to":{englishName:"English (Tonga)",nativeName:"English (Tonga)"},"en-tt":{englishName:"English (Trinidad and Tobago)",nativeName:"English (Trinidad and Tobago)"},"en-tv":{englishName:"English (Tuvalu)",nativeName:"English (Tuvalu)"},"en-tz":{englishName:"English (Tanzania)",nativeName:"English (Tanzania)"},"en-ug":{englishName:"English (Uganda)",nativeName:"English (Uganda)"},"en-um":{englishName:"English (U.S. Outlying Islands)",nativeName:"English (U.S. Outlying Islands)"},"en-us":{englishName:"English (United States)",nativeName:"English (United States)"},"en-vc":{englishName:"English (Saint Vincent and the Grenadines)",nativeName:"English (Saint Vincent and the Grenadines)"},"en-vg":{englishName:"English (British Virgin Islands)",nativeName:"English (British Virgin Islands)"},"en-vi":{englishName:"English (U.S. Virgin Islands)",nativeName:"English (U.S. Virgin Islands)"},"en-vu":{englishName:"English (Vanuatu)",nativeName:"English (Vanuatu)"},"en-ws":{englishName:"English (Samoa)",nativeName:"English (Samoa)"},"en-za":{englishName:"English (South Africa)",nativeName:"English (South Africa)"},"en-zm":{englishName:"English (Zambia)",nativeName:"English (Zambia)"},"en-zw":{englishName:"English (Zimbabwe)",nativeName:"English (Zimbabwe)"},eo:D8,"eo-001":{englishName:"Esperanto (World)",nativeName:"esperanto (World)"},es:I8,"es-419":{englishName:"Spanish (Latin America)",nativeName:"español (Latinoamérica)"},"es-ar":{englishName:"Spanish (Argentina)",nativeName:"español (Argentina)"},"es-bo":{englishName:"Spanish (Bolivia)",nativeName:"español (Bolivia)"},"es-cl":{englishName:"Spanish (Chile)",nativeName:"español (Chile)"},"es-co":{englishName:"Spanish (Colombia)",nativeName:"español (Colombia)"},"es-cr":{englishName:"Spanish (Costa Rica)",nativeName:"español (Costa Rica)"},"es-cu":{englishName:"Spanish (Cuba)",nativeName:"español (Cuba)"},"es-do":{englishName:"Spanish (Dominican Republic)",nativeName:"español (República Dominicana)"},"es-ec":{englishName:"Spanish (Ecuador)",nativeName:"español (Ecuador)"},"es-es":{englishName:"Spanish (Spain, International Sort)",nativeName:"español (España, alfabetización internacional)"},"es-gq":{englishName:"Spanish (Equatorial Guinea)",nativeName:"español (Guinea Ecuatorial)"},"es-gt":{englishName:"Spanish (Guatemala)",nativeName:"español (Guatemala)"},"es-hn":{englishName:"Spanish (Honduras)",nativeName:"español (Honduras)"},"es-mx":{englishName:"Spanish (Mexico)",nativeName:"español (México)"},"es-ni":{englishName:"Spanish (Nicaragua)",nativeName:"español (Nicaragua)"},"es-pa":{englishName:"Spanish (Panama)",nativeName:"español (Panamá)"},"es-pe":{englishName:"Spanish (Peru)",nativeName:"español (Perú)"},"es-ph":{englishName:"Spanish (Philippines)",nativeName:"español (Filipinas)"},"es-pr":{englishName:"Spanish (Puerto Rico)",nativeName:"español (Puerto Rico)"},"es-py":{englishName:"Spanish (Paraguay)",nativeName:"español (Paraguay)"},"es-sv":{englishName:"Spanish (El Salvador)",nativeName:"español (El Salvador)"},"es-us":{englishName:"Spanish (United States)",nativeName:"español (Estados Unidos)"},"es-uy":{englishName:"Spanish (Uruguay)",nativeName:"español (Uruguay)"},"es-ve":{englishName:"Spanish (Venezuela)",nativeName:"español (Venezuela)"},et:P8,"et-ee":{englishName:"Estonian (Estonia)",nativeName:"eesti (Eesti)"},eu:L8,"eu-es":{englishName:"Basque (Basque)",nativeName:"euskara (euskara)"},ewo:O8,"ewo-cm":{englishName:"Ewondo (Cameroon)",nativeName:"ewondo (KamÉ™rún)"},fa:M8,"fa-ir":{englishName:"Persian (Iran)",nativeName:"ÙØ§Ø±Ø³Ù‰ (ایران)"},ff:R8,"ff-cm":{englishName:"Fulah (Cameroon)",nativeName:"Pulaar (Kameruun)"},"ff-gn":{englishName:"Fulah (Guinea)",nativeName:"Pulaar (Gine)"},"ff-latn":{englishName:"Fulah",nativeName:"Fulah"},"ff-latn-sn":{englishName:"Fulah (Latin, Senegal)",nativeName:"Fulah (Sénégal)"},"ff-mr":{englishName:"Fulah (Mauritania)",nativeName:"Pulaar (Muritani)"},"ff-ng":{englishName:"Fulah (Nigeria)",nativeName:"Pulaar (Nigeria)"},fi:B8,"fi-fi":{englishName:"Finnish (Finland)",nativeName:"suomi (Suomi)"},fil:U8,"fil-ph":{englishName:"Filipino (Philippines)",nativeName:"Filipino (Pilipinas)"},fo:F8,"fo-dk":{englishName:"Faroese (Denmark)",nativeName:"føroyskt (Danmark)"},"fo-fo":{englishName:"Faroese (Faroe Islands)",nativeName:"føroyskt (Føroyar)"},fr:$8,"fr-029":{englishName:"French (Caribbean)",nativeName:"français (caraïbes)"},"fr-be":{englishName:"French (Belgium)",nativeName:"français (Belgique)"},"fr-bf":{englishName:"French (Burkina Faso)",nativeName:"français (Burkina Faso)"},"fr-bi":{englishName:"French (Burundi)",nativeName:"français (Burundi)"},"fr-bj":{englishName:"French (Benin)",nativeName:"français (Bénin)"},"fr-bl":{englishName:"French (Saint Barthélemy)",nativeName:"français (Saint-Barthélemy)"},"fr-ca":{englishName:"French (Canada)",nativeName:"français (Canada)"},"fr-cd":{englishName:"French (Congo DRC)",nativeName:"français (Congo, République démocratique du)"},"fr-cf":{englishName:"French (Central African Republic)",nativeName:"français (République centrafricaine)"},"fr-cg":{englishName:"French (Congo)",nativeName:"français (Congo)"},"fr-ch":{englishName:"French (Switzerland)",nativeName:"français (Suisse)"},"fr-ci":{englishName:"French (Côte d’Ivoire)",nativeName:"français (Côte d’Ivoire)"},"fr-cm":{englishName:"French (Cameroon)",nativeName:"français (Cameroun)"},"fr-dj":{englishName:"French (Djibouti)",nativeName:"français (Djibouti)"},"fr-dz":{englishName:"French (Algeria)",nativeName:"français (Algérie)"},"fr-fr":{englishName:"French (France)",nativeName:"français (France)"},"fr-ga":{englishName:"French (Gabon)",nativeName:"français (Gabon)"},"fr-gf":{englishName:"French (French Guiana)",nativeName:"français (Guyane française)"},"fr-gn":{englishName:"French (Guinea)",nativeName:"français (Guinée)"},"fr-gp":{englishName:"French (Guadeloupe)",nativeName:"français (Guadeloupe)"},"fr-gq":{englishName:"French (Equatorial Guinea)",nativeName:"français (Guinée équatoriale)"},"fr-ht":{englishName:"French (Haiti)",nativeName:"français (Haïti)"},"fr-km":{englishName:"French (Comoros)",nativeName:"français (Comores)"},"fr-lu":{englishName:"French (Luxembourg)",nativeName:"français (Luxembourg)"},"fr-ma":{englishName:"French (Morocco)",nativeName:"français (Maroc)"},"fr-mc":{englishName:"French (Monaco)",nativeName:"français (Monaco)"},"fr-mf":{englishName:"French (Saint Martin)",nativeName:"français (Saint-Martin)"},"fr-mg":{englishName:"French (Madagascar)",nativeName:"français (Madagascar)"},"fr-ml":{englishName:"French (Mali)",nativeName:"français (Mali)"},"fr-mq":{englishName:"French (Martinique)",nativeName:"français (Martinique)"},"fr-mr":{englishName:"French (Mauritania)",nativeName:"français (Mauritanie)"},"fr-mu":{englishName:"French (Mauritius)",nativeName:"français (Maurice)"},"fr-nc":{englishName:"French (New Caledonia)",nativeName:"français (Nouvelle-Calédonie)"},"fr-ne":{englishName:"French (Niger)",nativeName:"français (Niger)"},"fr-pf":{englishName:"French (French Polynesia)",nativeName:"français (Polynésie française)"},"fr-pm":{englishName:"French (Saint Pierre and Miquelon)",nativeName:"français (Saint-Pierre-et-Miquelon)"},"fr-re":{englishName:"French (Réunion)",nativeName:"français (La Réunion)"},"fr-rw":{englishName:"French (Rwanda)",nativeName:"français (Rwanda)"},"fr-sc":{englishName:"French (Seychelles)",nativeName:"français (Seychelles)"},"fr-sn":{englishName:"French (Senegal)",nativeName:"français (Sénégal)"},"fr-sy":{englishName:"French (Syria)",nativeName:"français (Syrie)"},"fr-td":{englishName:"French (Chad)",nativeName:"français (Tchad)"},"fr-tg":{englishName:"French (Togo)",nativeName:"français (Togo)"},"fr-tn":{englishName:"French (Tunisia)",nativeName:"français (Tunisie)"},"fr-vu":{englishName:"French (Vanuatu)",nativeName:"français (Vanuatu)"},"fr-wf":{englishName:"French (Wallis and Futuna)",nativeName:"français (Wallis-et-Futuna)"},"fr-yt":{englishName:"French (Mayotte)",nativeName:"français (Mayotte)"},fur:j8,"fur-it":{englishName:"Friulian (Italy)",nativeName:"furlan (Italie)"},fy:H8,"fy-nl":{englishName:"Western Frisian (Netherlands)",nativeName:"Frysk (Nederlân)"},ga:V8,"ga-ie":{englishName:"Irish (Ireland)",nativeName:"Gaeilge (Éire)"},gd:q8,"gd-gb":{englishName:"Scottish Gaelic (United Kingdom)",nativeName:"G� idhlig (An Rìoghachd Aonaichte)"},gl:z8,"gl-es":{englishName:"Galician (Galician)",nativeName:"galego (galego)"},gn:W8,"gn-py":{englishName:"Guarani (Paraguay)",nativeName:"Avañe’ẽ (Paraguái)"},gsw:G8,"gsw-ch":{englishName:"Alsatian (Switzerland)",nativeName:"Elsässisch (Schwiiz)"},"gsw-fr":{englishName:"Alsatian (France)",nativeName:"Elsässisch (Fr� nkrisch)"},"gsw-li":{englishName:"Alsatian (Liechtenstein)",nativeName:"Elsässisch (Liächteschtäi)"},gu:K8,"gu-in":{englishName:"Gujarati (India)",nativeName:"ગà«àªœàª°àª¾àª¤à«€ (àªàª¾àª°àª¤)"},guz:X8,"guz-ke":{englishName:"Gusii (Kenya)",nativeName:"Ekegusii (Kenya)"},gv:Y8,"gv-im":{englishName:"Manx (Isle of Man)",nativeName:"Gaelg (Ellan Vannin)"},ha:Q8,"ha-latn":{englishName:"Hausa (Latin)",nativeName:"Hausa"},"ha-latn-gh":{englishName:"Hausa (Latin, Ghana)",nativeName:"Hausa (Gana)"},"ha-latn-ne":{englishName:"Hausa (Latin, Niger)",nativeName:"Hausa (Nijar)"},"ha-latn-ng":{englishName:"Hausa (Latin, Nigeria)",nativeName:"Hausa (Najeriya)"},haw:J8,"haw-us":{englishName:"Hawaiian (United States)",nativeName:"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},he:Z8,"he-il":{englishName:"Hebrew (Israel)",nativeName:"עברית (ישר×ל)"},hi:e6,"hi-in":{englishName:"Hindi (India)",nativeName:"हिंदी (à¤à¤¾à¤°à¤¤)"},hr:t6,"hr-ba":{englishName:"Croatian (Bosnia and Herzegovina)",nativeName:"hrvatski (Bosna i Hercegovina)"},"hr-hr":{englishName:"Croatian (Croatia)",nativeName:"hrvatski (Hrvatska)"},hsb:i6,"hsb-de":{englishName:"Upper Sorbian (Germany)",nativeName:"hornjoserbšćina (NÄ›mska)"},hu:r6,"hu-hu":{englishName:"Hungarian (Hungary)",nativeName:"magyar (Magyarország)"},hy:n6,"hy-am":{englishName:"Armenian (Armenia)",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},ia:s6,"ia-001":{englishName:"Interlingua (World)",nativeName:"interlingua (World)"},"ia-fr":{englishName:"Interlingua (France)",nativeName:"interlingua (Francia)"},ibb:a6,"ibb-ng":{englishName:"Ibibio (Nigeria)",nativeName:"Ibibio-Efik (Nigeria)"},id:o6,"id-id":{englishName:"Indonesian (Indonesia)",nativeName:"Indonesia (Indonesia)"},ig:l6,"ig-ng":{englishName:"Igbo (Nigeria)",nativeName:"Igbo (Nigeria)"},ii:u6,"ii-cn":{englishName:"Yi (China)",nativeName:"ꆈ�� ê±ê‚· (êꉸê“ꂱê‡ê‰¼ê‡©)"},is:c6,"is-is":{englishName:"Icelandic (Iceland)",nativeName:"Ãslenska (Ãsland)"},it:h6,"it-ch":{englishName:"Italian (Switzerland)",nativeName:"italiano (Svizzera)"},"it-it":{englishName:"Italian (Italy)",nativeName:"italiano (Italia)"},"it-sm":{englishName:"Italian (San Marino)",nativeName:"italiano (San Marino)"},iu:d6,"iu-cans":{englishName:"Inuktitut (Syllabics)",nativeName:"áƒá“„ᒃᑎá‘ᑦ"},"iu-cans-ca":{englishName:"Inuktitut (Syllabics, Canada)",nativeName:"áƒá“„ᒃᑎá‘ᑦ (ᑲᓇᑕᒥ)"},"iu-latn":{englishName:"Inuktitut (Latin)",nativeName:"Inuktitut"},"iu-latn-ca":{englishName:"Inuktitut (Latin, Canada)",nativeName:"Inuktitut (Kanatami)"},ja:f6,"ja-jp":{englishName:"Japanese (Japan)",nativeName:"日本語 (日本)"},jgo:p6,"jgo-cm":{englishName:"Ngomba (Cameroon)",nativeName:"Ndaꞌa (KamÉ›lûn)"},jmc:m6,"jmc-tz":{englishName:"Machame (Tanzania)",nativeName:"Kimachame (Tanzania)"},jv:g6,"jv-java":{englishName:"Javanese (Javanese)",nativeName:"ꦧꦱꦗꦮ"},"jv-java-id":{englishName:"Javanese (Javanese, Indonesia)",nativeName:"ꦧꦱꦗꦮ (Indonesia)"},"jv-latn":{englishName:"Javanese",nativeName:"Basa Jawa"},"jv-latn-id":{englishName:"Javanese (Indonesia)",nativeName:"Basa Jawa (Indonesia)"},ka:v6,"ka-ge":{englishName:"Georgian (Georgia)",nativeName:"ქáƒï¿½ï¿½ თული (სáƒáƒ¥áƒï¿½ï¿½ თველáƒ)"},kab:y6,"kab-dz":{englishName:"Kabyle (Algeria)",nativeName:"Taqbaylit (Lezzayer)"},kam:_6,"kam-ke":{englishName:"Kamba (Kenya)",nativeName:"Kikamba (Kenya)"},kde:T6,"kde-tz":{englishName:"Makonde (Tanzania)",nativeName:"Chimakonde (Tanzania)"},kea:b6,"kea-cv":{englishName:"Kabuverdianu (Cabo Verde)",nativeName:"kabuverdianu (Kabu Verdi)"},khq:S6,"khq-ml":{englishName:"Koyra Chiini (Mali)",nativeName:"Koyra ciini (Maali)"},ki:C6,"ki-ke":{englishName:"Kikuyu (Kenya)",nativeName:"Gikuyu (Kenya)"},kk:E6,"kk-kz":{englishName:"Kazakh (Kazakhstan)",nativeName:"қазақ тілі (ҚазақÑтан)"},kkj:w6,"kkj-cm":{englishName:"Kako (Cameroon)",nativeName:"kakÉ” (KamÉ›run)"},kl:k6,"kl-gl":{englishName:"Greenlandic (Greenland)",nativeName:"kalaallisut (Kalaallit Nunaat)"},kln:A6,"kln-ke":{englishName:"Kalenjin (Kenya)",nativeName:"Kalenjin (Emetab Kenya)"},km:x6,"km-kh":{englishName:"Khmer (Cambodia)",nativeName:"ភាសាážáŸ’មែរ (កម្ពុជា)"},kn:N6,"kn-in":{englishName:"Kannada (India)",nativeName:"ಕನà³à²¨à²¡ (à²à²¾à²°à²¤)"},ko:D6,"ko-kp":{englishName:"Korean (North Korea)",nativeName:"한êµì–´ (조�� 민주주ì˜ì¸ë¯¼ê³µí™”êµ)"},"ko-kr":{englishName:"Korean (Korea)",nativeName:"한êµì–´(대한민êµ)"},kok:I6,"kok-in":{englishName:"Konkani (India)",nativeName:"कोंकणी (à¤à¤¾à¤°à¤¤)"},kr:P6,"kr-ng":{englishName:"Kanuri (Nigeria)",nativeName:"Kanuri (Nigeria)"},ks:L6,"ks-arab":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"Ú©Ù²Ø´ÙØ±"},"ks-arab-in":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"Ú©Ù²Ø´ÙØ± (اَربی)"},"ks-deva":{englishName:"Kashmiri (Devanagari)",nativeName:"कॉशà¥à¤°"},"ks-deva-in":{englishName:"Kashmiri (Devanagari, India)",nativeName:"कॉशà¥à¤° (India)"},ksb:O6,"ksb-tz":{englishName:"Shambala (Tanzania)",nativeName:"Kishambaa (Tanzania)"},ksf:M6,"ksf-cm":{englishName:"Bafia (Cameroon)",nativeName:"rikpa (kamÉ›rún)"},ksh:R6,"ksh-de":{englishName:"Ripuarian (Germany)",nativeName:"Kölsch (Doütschland)"},ku:B6,"ku-arab":{englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},"ku-arab-iq":{englishName:"Central Kurdish (Iraq)",nativeName:"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{englishName:"Kurdish (Perso-Arabic, Iran)",nativeName:"کوردی (ئێران)"},kw:U6,"kw-gb":{englishName:"Cornish (United Kingdom)",nativeName:"kernewek (Rywvaneth Unys)"},ky:F6,"ky-kg":{englishName:"Kyrgyz (Kyrgyzstan)",nativeName:"Кыргыз (КыргызÑтан)"},la:$6,"la-001":{englishName:"Latin (World)",nativeName:"lingua latÄ«na (World)"},lag:j6,"lag-tz":{englishName:"Langi (Tanzania)",nativeName:"Kɨlaangi (TaansanÃa)"},lb:H6,"lb-lu":{englishName:"Luxembourgish (Luxembourg)",nativeName:"Lëtzebuergesch (Lëtzebuerg)"},lg:V6,"lg-ug":{englishName:"Ganda (Uganda)",nativeName:"Luganda (Yuganda)"},lkt:q6,"lkt-us":{englishName:"Lakota (United States)",nativeName:"Lakȟólʼiyapi (MÃlahaÅ‹ska TÈŸamákÈŸoÄhe)"},ln:z6,"ln-ao":{englishName:"Lingala (Angola)",nativeName:"lingála (Angóla)"},"ln-cd":{englishName:"Lingala (Congo DRC)",nativeName:"lingála (Repibiki demokratiki ya Kongó)"},"ln-cf":{englishName:"Lingala (Central African Republic)",nativeName:"lingála (Repibiki ya AfrÃka ya Káti)"},"ln-cg":{englishName:"Lingala (Congo)",nativeName:"lingála (Kongo)"},lo:W6,"lo-la":{englishName:"Lao (Laos)",nativeName:"ລາວ (ລາວ)"},lrc:G6,"lrc-iq":{englishName:"Northern Luri (Iraq)",nativeName:"لۊری شومالی (Iraq)"},"lrc-ir":{englishName:"Northern Luri (Iran)",nativeName:"لۊری شومالی (Iran)"},lt:K6,"lt-lt":{englishName:"Lithuanian (Lithuania)",nativeName:"lietuvių (Lietuva)"},lu:X6,"lu-cd":{englishName:"Luba-Katanga (Congo DRC)",nativeName:"Tshiluba (Ditunga wa Kongu)"},luo:Y6,"luo-ke":{englishName:"Luo (Kenya)",nativeName:"Dholuo (Kenya)"},luy:Q6,"luy-ke":{englishName:"Luyia (Kenya)",nativeName:"Luluhia (Kenya)"},lv:J6,"lv-lv":{englishName:"Latvian (Latvia)",nativeName:"latvieÅ¡u (Latvija)"},mas:Z6,"mas-ke":{englishName:"Masai (Kenya)",nativeName:"Maa (Kenya)"},"mas-tz":{englishName:"Masai (Tanzania)",nativeName:"Maa (Tansania)"},mer:eB,"mer-ke":{englishName:"Meru (Kenya)",nativeName:"KÄ©mÄ©rÅ© (Kenya)"},mfe:tB,"mfe-mu":{englishName:"Morisyen (Mauritius)",nativeName:"kreol morisien (Moris)"},mg:iB,"mg-mg":{englishName:"Malagasy (Madagascar)",nativeName:"Malagasy (Madagasikara)"},mgh:rB,"mgh-mz":{englishName:"Makhuwa-Meetto (Mozambique)",nativeName:"Makua (Umozambiki)"},mgo:nB,"mgo-cm":{englishName:"Metaʼ (Cameroon)",nativeName:"metaʼ (Kamalun)"},mi:sB,"mi-nz":{englishName:"Maori (New Zealand)",nativeName:"Reo MÄori (Aotearoa)"},mk:aB,"mk-mk":{englishName:"Macedonian (Macedonia, FYRO)",nativeName:"македонÑки (� епублика Македонија)"},ml:oB,"ml-in":{englishName:"Malayalam (India)",nativeName:"മലയാളം (ഇനàµà´¤àµà´¯)"},mn:lB,"mn-cyrl":{englishName:"Mongolian",nativeName:"монгол"},"mn-mn":{englishName:"Mongolian (Mongolia)",nativeName:"монгол (Монгол)"},"mn-mong":{englishName:"Mongolian (Traditional Mongolian)",nativeName:"� �� �� �� �� �� �� � � �� �� �� �"},"mn-mong-cn":{englishName:"Mongolian (Traditional Mongolian, China)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� � � �� � �� �� � �� �� � �� � � �� �� �� �� � �� � � � �� � � � �� �� �� �)"},"mn-mong-mn":{englishName:"Mongolian (Traditional Mongolian, Mongolia)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� �� � � �� �� �� �)"},mni:uB,"mni-in":{englishName:"Manipuri (India)",nativeName:"মৈতৈলোনৠ(India)"},moh:cB,"moh-ca":{englishName:"Mohawk (Mohawk)",nativeName:"Kanien'kéha"},mr:hB,"mr-in":{englishName:"Marathi (India)",nativeName:"मरा�� ी (à¤à¤¾à¤°à¤¤)"},ms:dB,"ms-bn":{englishName:"Malay (Brunei)",nativeName:"Bahasa Melayu (Brunei)"},"ms-my":{englishName:"Malay (Malaysia)",nativeName:"Bahasa Melayu (Malaysia)"},"ms-sg":{englishName:"Malay (Singapore)",nativeName:"Bahasa Melayu (Singapura)"},mt:fB,"mt-mt":{englishName:"Maltese (Malta)",nativeName:"Malti (Malta)"},mua:pB,"mua-cm":{englishName:"Mundang (Cameroon)",nativeName:"MUNDAÅŠ (kameruÅ‹)"},my:mB,"my-mm":{englishName:"Burmese (Myanmar)",nativeName:"ဗမာ (မြန်မာ)"},mzn:gB,"mzn-ir":{englishName:"Mazanderani (Iran)",nativeName:"مازرونی (ایران)"},naq:vB,"naq-na":{englishName:"Nama (Namibia)",nativeName:"Khoekhoegowab (Namibiab)"},nb:yB,"nb-no":{englishName:"Norwegian BokmÃ¥l (Norway)",nativeName:"norsk bokmÃ¥l (Norge)"},"nb-sj":{englishName:"Norwegian BokmÃ¥l (Svalbard and Jan Mayen)",nativeName:"norsk bokmÃ¥l (Svalbard og Jan Mayen)"},nd:_B,"nd-zw":{englishName:"North Ndebele (Zimbabwe)",nativeName:"isiNdebele (Zimbabwe)"},ne:TB,"ne-in":{englishName:"Nepali (India)",nativeName:"नेपाली (à¤à¤¾à¤°à¤¤)"},"ne-np":{englishName:"Nepali (Nepal)",nativeName:"नेपाली (नेपाल)"},nl:bB,"nl-aw":{englishName:"Dutch (Aruba)",nativeName:"Nederlands (Aruba)"},"nl-be":{englishName:"Dutch (Belgium)",nativeName:"Nederlands (België)"},"nl-bq":{englishName:"Dutch (Bonaire, Sint Eustatius and Saba)",nativeName:"Nederlands (Bonaire, Sint Eustatius en Saba)"},"nl-cw":{englishName:"Dutch (Curaçao)",nativeName:"Nederlands (Curaçao)"},"nl-nl":{englishName:"Dutch (Netherlands)",nativeName:"Nederlands (Nederland)"},"nl-sr":{englishName:"Dutch (Suriname)",nativeName:"Nederlands (Suriname)"},"nl-sx":{englishName:"Dutch (Sint Maarten)",nativeName:"Nederlands (Sint-Maarten)"},nmg:SB,"nmg-cm":{englishName:"Kwasio (Cameroon)",nativeName:"Kwasio (Kamerun)"},nn:CB,"nn-no":{englishName:"Norwegian Nynorsk (Norway)",nativeName:"nynorsk (Noreg)"},nnh:EB,"nnh-cm":{englishName:"Ngiemboon (Cameroon)",nativeName:"Shwóŋò ngiembɔɔn (K� malûm)"},no:wB,nqo:kB,"nqo-gn":{englishName:"N'ko (Guinea)",nativeName:"ß’ßžß (ߖߌ߬ߣß߬ ߞߊ߲ߓßß²)"},nr:AB,"nr-za":{englishName:"South Ndebele (South Africa)",nativeName:"isiNdebele (South Africa)"},nso:xB,"nso-za":{englishName:"Sesotho sa Leboa (South Africa)",nativeName:"Sesotho sa Leboa (Afrika Borwa)"},nus:NB,"nus-ss":{englishName:"Nuer (South Sudan)",nativeName:"Thok Nath (South Sudan)"},nyn:DB,"nyn-ug":{englishName:"Nyankole (Uganda)",nativeName:"Runyankore (Uganda)"},oc:IB,"oc-fr":{englishName:"Occitan (France)",nativeName:"Occitan (França)"},om:PB,"om-et":{englishName:"Oromo (Ethiopia)",nativeName:"Oromoo (Itoophiyaa)"},"om-ke":{englishName:"Oromo (Kenya)",nativeName:"Oromoo (Keeniyaa)"},or:LB,"or-in":{englishName:"Odia (India)",nativeName:"ଓàœà¬¿à¬† (à¬à¬¾à¬°à¬¤)"},os:OB,"os-ge":{englishName:"Ossetian (Georgia)",nativeName:"Ирон æвзаг (ГуырдзыÑтон)"},"os-ru":{englishName:"Ossetian (Russia)",nativeName:"Ирон æвзаг (УӕрӕÑе)"},pa:MB,"pa-arab":{englishName:"Punjabi",nativeName:"پنجابی"},"pa-arab-pk":{englishName:"Punjabi (Pakistan)",nativeName:"پنجابی (پاکستان)"},"pa-in":{englishName:"Punjabi (India)",nativeName:"ਪੰਜਾਬੀ (à¨à¨¾à¨°à¨¤)"},pap:RB,"pap-029":{englishName:"Papiamento (Caribbean)",nativeName:"Papiamentu (Caribbean)"},pl:BB,"pl-pl":{englishName:"Polish (Poland)",nativeName:"polski (Polska)"},prg:UB,"prg-001":{englishName:"Prussian (World)",nativeName:"prÅ«siskan (swÄ«tai)"},prs:FB,"prs-af":{englishName:"Dari (Afghanistan)",nativeName:"درى (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},ps:$B,"ps-af":{englishName:"Pashto (Afghanistan)",nativeName:"پښتو (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},pt:jB,"pt-ao":{englishName:"Portuguese (Angola)",nativeName:"português (Angola)"},"pt-br":{englishName:"Portuguese (Brazil)",nativeName:"português (Brasil)"},"pt-cv":{englishName:"Portuguese (Cabo Verde)",nativeName:"português (Cabo Verde)"},"pt-gw":{englishName:"Portuguese (Guinea-Bissau)",nativeName:"português (Guiné-Bissau)"},"pt-mo":{englishName:"Portuguese (Macao SAR)",nativeName:"português (RAE de Macau)"},"pt-mz":{englishName:"Portuguese (Mozambique)",nativeName:"português (Moçambique)"},"pt-pt":{englishName:"Portuguese (Portugal)",nativeName:"português (Portugal)"},"pt-st":{englishName:"Portuguese (São Tomé and PrÃncipe)",nativeName:"português (São Tomé e PrÃncipe)"},"pt-tl":{englishName:"Portuguese (Timor-Leste)",nativeName:"português (Timor-Leste)"},quc:HB,"quc-latn":{englishName:"K'iche'",nativeName:"K'iche'"},"quc-latn-gt":{englishName:"K'iche' (Guatemala)",nativeName:"K'iche' (Guatemala)"},quz:VB,"quz-bo":{englishName:"Quechua (Bolivia)",nativeName:"runasimi (Qullasuyu)"},"quz-ec":{englishName:"Quichua (Ecuador)",nativeName:"runa shimi (Ecuador Suyu)"},"quz-pe":{englishName:"Quechua (Peru)",nativeName:"runasimi (Peru)"},rm:qB,"rm-ch":{englishName:"Romansh (Switzerland)",nativeName:"rumantsch (Svizra)"},rn:zB,"rn-bi":{englishName:"Rundi (Burundi)",nativeName:"Ikirundi (Uburundi)"},ro:WB,"ro-md":{englishName:"Romanian (Moldova)",nativeName:"română (Republica Moldova)"},"ro-ro":{englishName:"Romanian (Romania)",nativeName:"română (România)"},rof:GB,"rof-tz":{englishName:"Rombo (Tanzania)",nativeName:"Kihorombo (Tanzania)"},ru:KB,"ru-by":{englishName:"Russian (Belarus)",nativeName:"руÑÑкий (БеларуÑÑŒ)"},"ru-kg":{englishName:"Russian (Kyrgyzstan)",nativeName:"руÑÑкий (КиргизиÑ)"},"ru-kz":{englishName:"Russian (Kazakhstan)",nativeName:"руÑÑкий (КазахÑтан)"},"ru-md":{englishName:"Russian (Moldova)",nativeName:"руÑÑкий (Молдова)"},"ru-ru":{englishName:"Russian (Russia)",nativeName:"руÑÑкий (� оÑÑиÑ)"},"ru-ua":{englishName:"Russian (Ukraine)",nativeName:"руÑÑкий (Украина)"},rw:XB,"rw-rw":{englishName:"Kinyarwanda (Rwanda)",nativeName:"Kinyarwanda (Rwanda)"},rwk:YB,"rwk-tz":{englishName:"Rwa (Tanzania)",nativeName:"Kiruwa (Tanzania)"},sa:QB,"sa-in":{englishName:"Sanskrit (India)",nativeName:"संसà¥à¤•ृत (à¤à¤¾à¤°à¤¤à¤®à¥)"},sah:JB,"sah-ru":{englishName:"Sakha (Russia)",nativeName:"Саха (� оÑÑиÑ)"},saq:ZB,"saq-ke":{englishName:"Samburu (Kenya)",nativeName:"Kisampur (Kenya)"},sbp:eU,"sbp-tz":{englishName:"Sangu (Tanzania)",nativeName:"Ishisangu (Tansaniya)"},sd:tU,"sd-arab":{englishName:"Sindhi",nativeName:"سنڌي"},"sd-arab-pk":{englishName:"Sindhi (Pakistan)",nativeName:"سنڌي (پاکستان)"},"sd-deva":{englishName:"Sindhi (Devanagari)",nativeName:"सिनà¥à¤§à¥€"},"sd-deva-in":{englishName:"Sindhi (Devanagari, India)",nativeName:"सिनà¥à¤§à¥€ (India)"},se:iU,"se-fi":{englishName:"Sami, Northern (Finland)",nativeName:"davvisámegiella (Suopma)"},"se-no":{englishName:"Sami, Northern (Norway)",nativeName:"davvisámegiella (Norga)"},"se-se":{englishName:"Sami, Northern (Sweden)",nativeName:"davvisámegiella (Ruoŧŧa)"},seh:rU,"seh-mz":{englishName:"Sena (Mozambique)",nativeName:"sena (Moçambique)"},ses:nU,"ses-ml":{englishName:"Koyraboro Senni (Mali)",nativeName:"Koyraboro senni (Maali)"},sg:sU,"sg-cf":{englishName:"Sango (Central African Republic)",nativeName:"Sängö (Ködörösêse tî Bêafrîka)"},shi:aU,"shi-latn":{englishName:"Tachelhit (Latin)",nativeName:"Tashelḥiyt"},"shi-latn-ma":{englishName:"Tachelhit (Latin, Morocco)",nativeName:"Tashelḥiyt (lmÉ£rib)"},"shi-tfng":{englishName:"Tachelhit (Tifinagh)",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ"},"shi-tfng-ma":{englishName:"Tachelhit (Tifinagh, Morocco)",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ (âµâµŽâµ–ⵔⵉⴱ)"},si:oU,"si-lk":{englishName:"Sinhala (Sri Lanka)",nativeName:"සිංහල (à·à·Šâ€à¶»à·“ ලංකà·à·€)"},sk:lU,"sk-sk":{englishName:"Slovak (Slovakia)",nativeName:"slovenÄina (Slovensko)"},sl:uU,"sl-si":{englishName:"Slovenian (Slovenia)",nativeName:"slovenÅ¡Äina (Slovenija)"},sma:cU,"sma-no":{englishName:"Sami, Southern (Norway)",nativeName:"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{englishName:"Sami, Southern (Sweden)",nativeName:"Ã¥arjelsaemiengïele (Sveerje)"},smj:hU,"smj-no":{englishName:"Sami, Lule (Norway)",nativeName:"julevusámegiella (Vuodna)"},"smj-se":{englishName:"Sami, Lule (Sweden)",nativeName:"julevusámegiella (Svierik)"},smn:dU,"smn-fi":{englishName:"Sami, Inari (Finland)",nativeName:"anarâškielâ (Suomâ)"},sms:fU,"sms-fi":{englishName:"Sami, Skolt (Finland)",nativeName:"sää´mÇ©iõll (Lää´ddjânnam)"},sn:pU,"sn-latn":{englishName:"Shona (Latin)",nativeName:"chiShona (Latin)"},"sn-latn-zw":{englishName:"Shona (Latin, Zimbabwe)",nativeName:"chiShona (Zimbabwe)"},so:mU,"so-dj":{englishName:"Somali (Djibouti)",nativeName:"Soomaali (Jabuuti)"},"so-et":{englishName:"Somali (Ethiopia)",nativeName:"Soomaali (Itoobiya)"},"so-ke":{englishName:"Somali (Kenya)",nativeName:"Soomaali (Kiiniya)"},"so-so":{englishName:"Somali (Somalia)",nativeName:"Soomaali (Soomaaliya)"},sq:gU,"sq-al":{englishName:"Albanian (Albania)",nativeName:"shqip (Shqipëri)"},"sq-mk":{englishName:"Albanian (Macedonia, FYRO)",nativeName:"shqip (Republika e Maqedonisë)"},"sq-xk":{englishName:"Albanian (Kosovo)",nativeName:"shqip (Kosovë)"},sr:vU,"sr-cyrl":{englishName:"Serbian (Cyrillic)",nativeName:"ÑрпÑки"},"sr-cyrl-ba":{englishName:"Serbian (Cyrillic, Bosnia and Herzegovina)",nativeName:"ÑрпÑки (БоÑна и Херцеговина)"},"sr-cyrl-me":{englishName:"Serbian (Cyrillic, Montenegro)",nativeName:"ÑрпÑки (Црна Гора)"},"sr-cyrl-rs":{englishName:"Serbian (Cyrillic, Serbia)",nativeName:"ÑрпÑки (Србија)"},"sr-cyrl-xk":{englishName:"Serbian (Cyrillic, Kosovo)",nativeName:"ÑрпÑки (КоÑово)"},"sr-latn":{englishName:"Serbian (Latin)",nativeName:"srpski"},"sr-latn-ba":{englishName:"Serbian (Latin, Bosnia and Herzegovina)",nativeName:"srpski (Bosna i Hercegovina)"},"sr-latn-me":{englishName:"Serbian (Latin, Montenegro)",nativeName:"srpski (Crna Gora)"},"sr-latn-rs":{englishName:"Serbian (Latin, Serbia)",nativeName:"srpski (Srbija)"},"sr-latn-xk":{englishName:"Serbian (Latin, Kosovo)",nativeName:"srpski (Kosovo)"},ss:yU,"ss-sz":{englishName:"siSwati (Swaziland)",nativeName:"siSwati (Swaziland)"},"ss-za":{englishName:"siSwati (South Africa)",nativeName:"siSwati (South Africa)"},ssy:_U,"ssy-er":{englishName:"Saho (Eritrea)",nativeName:"Saho (Eretria)"},st:TU,"st-ls":{englishName:"Sesotho (Lesotho)",nativeName:"Sesotho (Lesotho)"},"st-za":{englishName:"Sesotho (South Africa)",nativeName:"Sesotho (South Africa)"},sv:bU,"sv-ax":{englishName:"Swedish (Ã…land Islands)",nativeName:"svenska (Ã…land)"},"sv-fi":{englishName:"Swedish (Finland)",nativeName:"svenska (Finland)"},"sv-se":{englishName:"Swedish (Sweden)",nativeName:"svenska (Sverige)"},sw:SU,"sw-cd":{englishName:"Kiswahili (Congo DRC)",nativeName:"Kiswahili (Jamhuri ya Kidemokrasia ya Kongo)"},"sw-ke":{englishName:"Kiswahili (Kenya)",nativeName:"Kiswahili (Kenya)"},"sw-tz":{englishName:"Kiswahili (Tanzania)",nativeName:"Kiswahili (Tanzania)"},"sw-ug":{englishName:"Kiswahili (Uganda)",nativeName:"Kiswahili (Uganda)"},syr:CU,"syr-sy":{englishName:"Syriac (Syria)",nativeName:"ܣܘܪÜÜÜ (ܣܘܪÜÜ)"},ta:EU,"ta-in":{englishName:"Tamil (India)",nativeName:"தமிழ௠(இநà¯à®¤à®¿à®¯à®¾)"},"ta-lk":{englishName:"Tamil (Sri Lanka)",nativeName:"தமிழ௠(இலஙà¯à®•ை)"},"ta-my":{englishName:"Tamil (Malaysia)",nativeName:"தமிழ௠(மலேசியா)"},"ta-sg":{englishName:"Tamil (Singapore)",nativeName:"தமிழ௠(சிஙà¯à®•பà¯à®ªà¯‚à®°à¯)"},te:wU,"te-in":{englishName:"Telugu (India)",nativeName:"తెలà±à°—à± (à°à°¾à°°à°¤ దేశం)"},teo:kU,"teo-ke":{englishName:"Teso (Kenya)",nativeName:"Kiteso (Kenia)"},"teo-ug":{englishName:"Teso (Uganda)",nativeName:"Kiteso (Uganda)"},tg:AU,"tg-cyrl":{englishName:"Tajik (Cyrillic)",nativeName:"Тоҷикӣ"},"tg-cyrl-tj":{englishName:"Tajik (Cyrillic, Tajikistan)",nativeName:"Тоҷикӣ (ТоҷикиÑтон)"},th:xU,"th-th":{englishName:"Thai (Thailand)",nativeName:"ไทย (ไทย)"},ti:NU,"ti-er":{englishName:"Tigrinya (Eritrea)",nativeName:"ትáŒáˆáŠ› (ኤáˆá‰µáˆ«)"},"ti-et":{englishName:"Tigrinya (Ethiopia)",nativeName:"ትáŒáˆáŠ› (ኢትዮጵያ)"},tig:DU,"tig-er":{englishName:"Tigre (Eritrea)",nativeName:"ትáŒáˆ¨ (ኤáˆá‰µáˆ«)"},tk:IU,"tk-tm":{englishName:"Turkmen (Turkmenistan)",nativeName:"Türkmen dili (Türkmenistan)"},tn:PU,"tn-bw":{englishName:"Setswana (Botswana)",nativeName:"Setswana (Botswana)"},"tn-za":{englishName:"Setswana (South Africa)",nativeName:"Setswana (Aforika Borwa)"},to:LU,"to-to":{englishName:"Tongan (Tonga)",nativeName:"lea fakatonga (Tonga)"},tr:OU,"tr-cy":{englishName:"Turkish (Cyprus)",nativeName:"Türkçe (Kıbrıs)"},"tr-tr":{englishName:"Turkish (Turkey)",nativeName:"Türkçe (Türkiye)"},ts:MU,"ts-za":{englishName:"Xitsonga (South Africa)",nativeName:"Xitsonga (South Africa)"},tt:RU,"tt-ru":{englishName:"Tatar (Russia)",nativeName:"Татар (� оÑÑиÑ)"},twq:BU,"twq-ne":{englishName:"Tasawaq (Niger)",nativeName:"Tasawaq senni (Nižer)"},tzm:UU,"tzm-arab":{englishName:"Central Atlas Tamazight (Arabic)",nativeName:"أطلس المركزية التامازيتية"},"tzm-arab-ma":{englishName:"Central Atlas Tamazight (Arabic, Morocco)",nativeName:"أطلس المركزية التامازيتية (Morocco)"},"tzm-latn":{englishName:"Central Atlas Tamazight (Latin)",nativeName:"TamaziÉ£t n laá¹laá¹£"},"tzm-latn-dz":{englishName:"Central Atlas Tamazight (Latin, Algeria)",nativeName:"TamaziÉ£t n laá¹laá¹£ (Djazaïr)"},"tzm-latn-ma":{englishName:"Central Atlas Tamazight (Latin, Morocco)",nativeName:"TamaziÉ£t n laá¹laá¹£ (Meṛṛuk)"},"tzm-tfng":{englishName:"Central Atlas Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"tzm-tfng-ma":{englishName:"Central Atlas Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (âµâµŽâµ–ⵔⵉⴱ)"},ug:FU,"ug-cn":{englishName:"Uyghur (China)",nativeName:"ئۇيغۇرچە (Ø¬Û‡ÚØ®Û‡Ø§ خەلق جۇمھۇرىيىتى)"},uk:$U,"uk-ua":{englishName:"Ukrainian (Ukraine)",nativeName:"українÑька (Україна)"},ur:jU,"ur-in":{englishName:"Urdu (India)",nativeName:"اردو (بھارت)"},"ur-pk":{englishName:"Urdu (Pakistan)",nativeName:"Ø§ÙØ±Ø¯Ùˆ (پاکستان)"},uz:HU,"uz-arab":{englishName:"Uzbek (Perso-Arabic)",nativeName:"اوزبیک"},"uz-arab-af":{englishName:"Uzbek (Perso-Arabic, Afghanistan)",nativeName:"اوزبیک (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},"uz-cyrl":{englishName:"Uzbek (Cyrillic)",nativeName:"Ўзбек"},"uz-cyrl-uz":{englishName:"Uzbek (Cyrillic, Uzbekistan)",nativeName:"Ўзбек (ЎзбекиÑтон)"},"uz-latn":{englishName:"Uzbek (Latin)",nativeName:"o‘zbek"},"uz-latn-uz":{englishName:"Uzbek (Latin, Uzbekistan)",nativeName:"o‘zbek (OÊ»zbekiston)"},vai:VU,"vai-latn":{englishName:"Vai (Latin)",nativeName:"Vai"},"vai-latn-lr":{englishName:"Vai (Latin, Liberia)",nativeName:"Vai (Laibhiya)"},"vai-vaii":{englishName:"Vai (Vai)",nativeName:"ꕙꔤ"},"vai-vaii-lr":{englishName:"Vai (Vai, Liberia)",nativeName:"ꕙꔤ (ꕞꔤꔫꕩ)"},ve:qU,"ve-za":{englishName:"Venda (South Africa)",nativeName:"Tshivenḓa (South Africa)"},vi:zU,"vi-vn":{englishName:"Vietnamese (Vietnam)",nativeName:"TiêÌng Việt (Việt Nam)"},vo:WU,"vo-001":{englishName:"Volapük (World)",nativeName:"Volapük (World)"},vun:GU,"vun-tz":{englishName:"Vunjo (Tanzania)",nativeName:"Kyivunjo (Tanzania)"},wae:KU,"wae-ch":{englishName:"Walser (Switzerland)",nativeName:"Walser (Schwiz)"},wal:XU,"wal-et":{englishName:"Wolaytta (Ethiopia)",nativeName:"ወላá‹á‰³á‰± (ኢትዮጵያ)"},wo:YU,"wo-sn":{englishName:"Wolof (Senegal)",nativeName:"Wolof (Senegaal)"},xh:QU,"xh-za":{englishName:"isiXhosa (South Africa)",nativeName:"isiXhosa (eMzantsi Afrika)"},xog:JU,"xog-ug":{englishName:"Soga (Uganda)",nativeName:"Olusoga (Yuganda)"},yav:ZU,"yav-cm":{englishName:"Yangben (Cameroon)",nativeName:"nuasue (Kemelún)"},yi:eF,"yi-001":{englishName:"Yiddish (World)",nativeName:"ייִדיש (וועלט)"},yo:tF,"yo-bj":{englishName:"Yoruba (Benin)",nativeName:"Èdè Yorùbá (OrÃlÉ›Ìède Bɛ̀nɛ̀)"},"yo-ng":{englishName:"Yoruba (Nigeria)",nativeName:"Èdè Yorùbá (OrÃlẹÌède N� ìjÃrÃ� )"},zgh:iF,"zgh-tfng":{englishName:"Standard Moroccan Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{englishName:"Standard Moroccan Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (âµâµŽâµ–ⵔⵉⴱ)"},zh:rF,"zh-cn":{englishName:"Chinese (Simplified, China)",nativeName:"䏿–‡(ä¸å›½)"},"zh-hans":{englishName:"Chinese (Simplified)",nativeName:"䏿–‡(简体)"},"zh-hans-hk":{englishName:"Chinese (Simplified Han, Hong Kong SAR)",nativeName:"䏿–‡ (香港特别行政区)"},"zh-hans-mo":{englishName:"Chinese (Simplified Han, Macao SAR)",nativeName:"䏿–‡ (澳门特别行政区)"},"zh-hant":{englishName:"Chinese (Traditional)",nativeName:"䏿–‡(ç¹é«”)"},"zh-hk":{englishName:"Chinese (Traditional, Hong Kong SAR)",nativeName:"䏿–‡(香港特別行政å€)"},"zh-mo":{englishName:"Chinese (Traditional, Macao SAR)",nativeName:"䏿–‡(澳門特別行政å€)"},"zh-sg":{englishName:"Chinese (Simplified, Singapore)",nativeName:"䏿–‡(新�� å¡)"},"zh-tw":{englishName:"Chinese (Traditional, Taiwan)",nativeName:"䏿–‡(å°ç£)"},zu:nF,"zu-za":{englishName:"isiZulu (South Africa)",nativeName:"isiZulu (i-South Africa)"},"zh-chs":{englishName:"Chinese (Simplified) Legacy",nativeName:"䏿–‡(简体) 旧版"},"zh-cht":{englishName:"Chinese (Traditional) Legacy",nativeName:"䏿–‡(ç¹é«”) 舊版"}};function rd(s){return lm[s.toLowerCase()]}function L0(s){const e=s.indexOf("-");if(e===-1)return rd(s);const t=s.substring(0,e);return rd(t)}function sF(s){const e={},t=s.toLowerCase();for(const r in lm){const i=lm[r];i.englishName.toLowerCase().indexOf(t)>-1&&(e[r]=i)}return e}const uh={getEnglishName(s){var e;return(e=L0(s))==null?void 0:e.englishName},getNativeName(s){var e;return(e=L0(s))==null?void 0:e.nativeName},getFullEnglishName(s){var e;return(e=rd(s))==null?void 0:e.englishName},getFullNativeName(s){var e;return(e=rd(s))==null?void 0:e.nativeName},getEnglishNameContains(s){return sF(s)},VERSION:"1.2.0"},aF={ALLOWED_TAGS:["i","b","u","ruby","rt"]},oF="en-US",lF="English",uF="subtitles",tp=new Map,um={getLanguagesOptions:s=>s?s.map(e=>({label:s.length>1?uh.getFullEnglishName(e.language):uh.getEnglishName(e.language),value:e.language,id:e.id,url:e.src})).sort((e,t)=>{const r=e.value.includes(cc)?1:0;return(t.value.includes(cc)?1:0)-r}):[],transformVtt:s=>{if(!s)return[];const e=[],t=new ll.WebVTT.Parser(window,ll.WebVTT.StringDecoder()),r=[];if(t.oncue=function(i){r.push(i)},t.onparsingerror=function(i){e.push(i)},t.parse(s),t.flush(),e.length>0){const i=e.map(n=>n.message).join(", ");iE.throw(new BR(`Failed to parse WebVTT format: ${i}`))}return r},createTextTrackList:(s,e)=>{const t=document.createElement("video"),r=t.addTextTrack(uF,e?uh.getEnglishName(e):lF,e||oF);return s.forEach(i=>{r.addCue(i)}),t.textTracks},transformVttToTextTrackList:(s,e,t)=>{const r=`${t}-${e}`;if(tp.has(r))return tp.get(r);if(!s)return null;const i=um.transformVtt(s),n=um.createTextTrackList(i,e);return tp.set(r,n),n},sanitizeCueText:s=>tE.sanitize(s,aF)},O0="transcript-selected-language",cc="en";function M0(s){var e,t;return((e=s.find(r=>r.language.includes(cc)))==null?void 0:e.language)||((t=s[0])==null?void 0:t.language)}function Fo(s,e,t){let r=t.initialDeps??[],i;return()=>{var n,a,o,l;let u;t.key&&((n=t.debug)!=null&&n.call(t))&&(u=Date.now());const c=s();if(!(c.length!==r.length||c.some((g,E)=>r[E]!==g)))return i;r=c;let f;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(f=Date.now()),i=e(...c),t.key&&((o=t.debug)!=null&&o.call(t))){const g=Math.round((Date.now()-u)*100)/100,E=Math.round((Date.now()-f)*100)/100,S=E/16,k=(F,L)=>{for(F=String(F);F.length<L;)F=" "+F;return F};console.info(`%c⏱ ${k(E,5)} /${k(g,5)} ms`,`
|
|
364
|
+
font-size: .6rem;
|
|
365
|
+
font-weight: bold;
|
|
366
|
+
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,i),i}}function ip(s,e){if(s===void 0)throw new Error("Unexpected undefined");return s}const cF=(s,e)=>Math.abs(s-e)<1,hF=(s,e,t)=>{let r;return function(...i){s.clearTimeout(r),r=s.setTimeout(()=>e.apply(this,i),t)}},dF=s=>s,fF=s=>{const e=Math.max(s.startIndex-s.overscan,0),t=Math.min(s.endIndex+s.overscan,s.count-1),r=[];for(let i=e;i<=t;i++)r.push(i);return r},pF=(s,e)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(i(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const n=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(t.getBoundingClientRect())};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},R0={passive:!0},B0=typeof window>"u"?!0:"onscrollend"in window,mF=(s,e)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;let i=0;const n=s.options.useScrollendEvent&&B0?()=>{}:hF(r,()=>{e(i,!1)},s.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:d,isRtl:f}=s.options;i=d?t.scrollLeft*(f&&-1||1):t.scrollTop,n(),e(i,c)},o=a(!0),l=a(!1);l(),t.addEventListener("scroll",o,R0);const u=s.options.useScrollendEvent&&B0;return u&&t.addEventListener("scrollend",l,R0),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},gF=(s,e,t)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(s.getBoundingClientRect()[t.options.horizontal?"width":"height"])},vF=(s,{adjustments:e=0,behavior:t},r)=>{var i,n;const a=s+e;(n=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||n.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:t})};class yF{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(i=>{i.forEach(n=>{const a=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),t=null},observe:i=>{var n;return(n=r())==null?void 0:n.observe(i,{box:"border-box"})},unobserve:i=>{var n;return(n=r())==null?void 0:n.unobserve(i)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,i])=>{typeof i>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dF,rangeExtractor:fF,onChange:()=>{},measureElement:gF,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,t)},this.maybeNotify=Fo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const i=new Map,n=new Map;for(let a=r-1;a>=0;a--){const o=t[a];if(i.has(o.lane))continue;const l=n.get(o.lane);if(l==null||o.end>l.end?n.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Fo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,i,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:i,getItemKey:n,enabled:a}),{key:!1}),this.getMeasurements=Fo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:i,getItemKey:n,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<t;c++){const d=n(c),f=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=f?f.end+this.options.gap:r+i,E=o.get(d),S=typeof E=="number"?E:this.options.estimateSize(c),k=g+S,F=f?f.lane:c%this.options.lanes;u[c]={index:c,start:g,size:S,end:k,key:d,lane:F}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Fo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,i,n)=>this.range=t.length>0&&r>0?_F({measurements:t,outerSize:r,scrollOffset:i,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fo(()=>{let t=null,r=null;const i=this.calculateRange();return i&&(t=i.startIndex,r=i.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,i,n,a)=>n===null||a===null?[]:t({startIndex:n,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,i=t.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const i=this.indexFromElement(t),n=this.measurementsCache[i];if(!n)return;const a=n.key,o=this.elementsCache.get(a);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(i,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const i=this.measurementsCache[t];if(!i)return;const n=this.itemSizeCache.get(i.key)??i.size,a=r-n;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(t,void 0)},this.getVirtualItems=Fo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const i=[];for(let n=0,a=t.length;n<a;n++){const o=t[n],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return ip(r[DC(0,r.length-1,i=>ip(r[i]).start,t)])},this.getOffsetForAlignment=(t,r,i=0)=>{const n=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+n?"end":"start"),r==="center"?t+=(i-n)/2:r==="end"&&(t-=n);const o=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(u,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.measurementsCache[t];if(!i)return;const n=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+n-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const o=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(t,{align:r="auto",behavior:i}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(t,r);if(!n)return;const[a,o]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=ip(this.getOffsetForIndex(t,o));cF(u,this.getScrollOffset())||this.scrollToIndex(t,{align:o,behavior:i})}else this.scrollToIndex(t,{align:o,behavior:i})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((t=r[r.length-1])==null?void 0:t.end)??0:Math.max(...r.slice(-this.options.lanes).map(n=>n.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:i})=>{this.options.scrollToFn(t,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const DC=(s,e,t,r)=>{for(;s<=e;){const i=(s+e)/2|0,n=t(i);if(n<r)s=i+1;else if(n>r)e=i-1;else return i}return s>0?s-1:0};function _F({measurements:s,outerSize:e,scrollOffset:t,lanes:r}){const i=s.length-1;let a=DC(0,i,l=>s[l].start,t),o=a;for(;o<i&&s[o].end<t+e;)o++;return r>1&&(a=Math.max(0,a-a%r),o=Math.min(i,o+(r-1-o%r))),{startIndex:a,endIndex:o}}const U0=typeof document<"u"?dh.useLayoutEffect:dh.useEffect;function TF(s){const e=dh.useReducer(()=>({}),{})[1],t={...s,onChange:(i,n)=>{var a;n?rE.flushSync(e):e(),(a=s.onChange)==null||a.call(s,i,n)}},[r]=dh.useState(()=>new yF(t));return r.setOptions(t),U0(()=>r._didMount(),[]),U0(()=>r._willUpdate()),r}function bF(s){return TF({observeElementRect:pF,observeElementOffset:mF,scrollToFn:vF,...s})}function SF(s){function e(r){const i=Array.from((r==null?void 0:r.activeCues)||[]);if(!i.length)return;const n=s.cuesToDisplay.findIndex(a=>a.startTime===nE.last(i).startTime);if(n===-1){s.setCurrentCueIndex(null);return}s.setCurrentCueIndex(n)}Ht.useEffect(()=>{s.hasStarted&&e(s.currentTranscriptTrack)},[s.hasStarted]);function t(){e(s.currentTranscriptTrack)}Ht.useEffect(()=>(s.currentTranscriptTrack&&s.currentTranscriptTrack.addEventListener("cuechange",t),()=>{var r;return(r=s.currentTranscriptTrack)==null?void 0:r.removeEventListener("cuechange",t)}),[s.currentTranscriptTrack])}function CF(s,e,t){function r(i){t&&t.scrollToIndex(i,{align:"start"})}return Ht.useEffect(()=>{!e||typeof s!="number"||r(s)},[s,e,t]),r}const F0=/\n/g;function EF({cuesToDisplay:s,resetHighlightedCues:e,setHighlightedCues:t,scrollToCue:r}){const[i,n]=Ht.useState(""),[a,o]=Ht.useState(null),[l,u]=Ht.useState(0),[,c]=Ht.useTransition();function d(S){n(S),l!==0&&u(0),c(()=>{f(S)})}function f(S){if(!S.length){o(null),e();return}const k=new RegExp(S.replace(F0," "),"gi"),F=[];let L=0;const W=s.map((H,$)=>{const G=H.text,K=G.replace(F0," ").matchAll(k);if(K.length===0)return Object.assign(H,{nodes:[{text:G,searchResultIndex:null}]});const Y=[];let P=0;return K.forEach((O,ne)=>{const te=O[0],re=O.index;re>P&&Y.push({text:G.substring(P,re),searchResultIndex:null}),Y.push({text:te,searchResultIndex:L}),L++,F.push({cueIndex:$,cueMatchIndex:ne}),P=re+te.length}),P<G.length&&Y.push({text:G.substring(P),searchResultIndex:null}),Object.assign(H,{nodes:Y})});o(F),t(W),F.length&&r(F[0].cueIndex)}function g(S){const k=a[S];k&&(u(S),r(k.cueIndex))}function E(){o(null),n(""),u(0),e()}return{isSearching:a!==null,searchQuery:i,onSearch:d,jumpToSearchResult:g,totalSearchResults:a==null?void 0:a.length,currentSearchResultIndex:l,resetSearchResults:E}}const wF="_hide_i94hz_1",kF="_show_i94hz_4",$0={hide:wF,show:kF},AF="shared.copyContentIconButton",j0=Ks.encloseNamespace(AF);function xF(s){const[e,t]=Ht.useState(!1);return Ht.useEffect(()=>{if(!e)return;const r=window.setTimeout(()=>{t(!1)},1e3);return()=>window.clearTimeout(r)},[e]),we.jsx(J0,{title:j0(e?"copied":"copy"),spanHack:!0,spanHackClassName:s.tooltipClassName||"",children:we.jsx(Qc,{"aria-label":"Copy to clipboard",className:s.visible?$0.show:$0.hide,onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(s.copyableContent).then(()=>{var i;t(!0),(i=s.onClick)==null||i.call(s)})},children:we.jsx(Ho,{svg:bE,size:sE.Small})})})}const NF="_timePoint_1jw83_1",DF="_wide_1jw83_6",IF="_item_1jw83_9",PF="_inPlayer_1jw83_9",Ou={timePoint:NF,wide:DF,item:IF,inPlayer:PF};function LF(s){const e=s.currentTimePoint===s.timePoint,[t,r]=iT(),i=CE.ToDisplayDuration(s.timePoint*1e3);return we.jsxs("section",{...s.isAuthenticated&&{role:"button"},className:`d-flex p-2 align-items-center cursor-pointer rounded text-dark ${s.inPlayer?Ou.inPlayer:""} ${s.isAuthenticated?"cursor-pointer":""} ${Ou.item} ${e?"bg-gray-100":""}`,id:s.timePoint.toString(),onClick:()=>{s.onClick(),Ea.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,descriptor:aE.TranscriptTimepoint,actionType:er.Click})},ref:t,children:[we.jsx("p",{className:"mb-0 d-flex flex-column align-items-center",children:we.jsx("time",{dateTime:`PT${s.timePoint}S`,"aria-label":`time-stamp-${i}`,className:`bg-light-blue text-info rounded-pill d-inline py-1 text-center ${Ou.timePoint} ${s.wideTimeTag?Ou.wide:""} ${e?"bg-white":""}`,children:i})}),we.jsx("p",{className:"ms-3 w-100 mb-0",children:s.nodes.map((n,a)=>{const o=um.sanitizeCueText(n.text);return n.searchResultIndex===null?we.jsx("span",{dangerouslySetInnerHTML:{__html:o}},a):we.jsx("mark",{className:`${Ou.mark} ${n.searchResultIndex===s.currentSearchResultIndex?"bg-orange":"bg-yellow"}`,dangerouslySetInnerHTML:{__html:o}},a)})}),we.jsx(xF,{copyableContent:s.transcript,visible:r,onClick:()=>{Ea.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,actionType:er.Copy})}})]})}function OF(s){var r;const e=s.cuesToDisplay.some(i=>i.startTime>=3600),t=new Map;return s.chapters.forEach((i,n)=>{const a=s.cuesToDisplay.findIndex(o=>o.startTime>i.startTime);t.set(a,n)}),we.jsx("article",{"aria-label":"transcript",className:"w-100 position-relative",style:{height:s.virtualizer.getTotalSize()},children:we.jsx("div",{className:"w-100 position-absolute top-0 start-0",style:{transform:`translateY(${((r=s.items[0])==null?void 0:r.start)??0}px)`},children:s.items.map(i=>{var u;const n=i.index,a=s.cuesToDisplay[n];let o=!1,l="";return t.has(n)&&(o=!0,l=s.chapters[t.get(n)].name),we.jsxs("section",{className:s.inPlayer?"":"px-3",ref:s.virtualizer.measureElement,"data-index":n,children:[o&&we.jsx("h3",{className:`${t.get(n)!==0?"mt-2":""} my-2 h6 ${s.inPlayer?"px-2":""}`,children:we.jsx("span",{children:l})}),we.jsx(LF,{timePoint:a.startTime,transcript:a.text,nodes:a.nodes,onClick:()=>s.onClickTranscriptionItem(a),currentTimePoint:(u=s.timepoint)==null?void 0:u.startTime,currentSearchResultIndex:s.currentSearchResultIndex,wideTimeTag:!!e,inPlayer:s.inPlayer,analyticsOptions:s.analyticsOptions,analyticsData:s.analyticsData,cueIndex:n,isAuthenticated:s.isAuthenticated})]},a.startTime)})})})}function MF(s){return we.jsx("svg",{...s,children:we.jsx("path",{d:"m12.733 8.305 5.963 5.906a1.046 1.046 0 0 1 0 1.473l-.01.011a1.034 1.034 0 0 1-1.467 0L12 10.526l-5.22 5.17a1.034 1.034 0 0 1-1.465 0l-.011-.012a1.046 1.046 0 0 1 0-1.473l5.963-5.906a1.034 1.034 0 0 1 1.466 0",fill:"currentColor"})})}const RF="_inputWithoutHighlight_1eq4x_1",BF="_inputFocus_1eq4x_5",UF="_inputBlur_1eq4x_9",FF="_cursor_1eq4x_13",Kc={inputWithoutHighlight:RF,inputFocus:BF,inputBlur:UF,cursor:FF},$F="playPage.transcriptSearchBar",Xc=Ks.encloseNamespace($F);function jF(s){const e=Ht.useRef(null),[t,r]=Ht.useState(!1);function i(E){Ea.logUserAction({...s.analyticsData,query:E},{...s.analyticsOptions,actionType:er.Search,descriptor:E?kc.SearchTranscript:kc.ResetResults})}const n=Ht.useCallback(oE.debounce(E=>i(E),500),[]);function a(){Ea.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:er.Search,descriptor:kc.NextResult}),s.currentSearchResultIndex===s.totalSearchResults-1?s.jumpToSearchResult(0):s.jumpToSearchResult(s.currentSearchResultIndex+1)}function o(){Ea.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:er.Search,descriptor:kc.PreviousResult}),s.currentSearchResultIndex===0?s.jumpToSearchResult(s.totalSearchResults-1):s.jumpToSearchResult(s.currentSearchResultIndex-1)}function l(E){n(E.target.value),s.onSearch(E.target.value)}function u(E){var S;E.keepFocus||(S=e.current)==null||S.focus(),a()}function c(E){var S;E.keepFocus||(S=e.current)==null||S.focus(),o()}function d(){var E;i(""),(E=e.current)==null||E.focus(),s.onSearch("")}function f(E){E.key==="Enter"&&(E.preventDefault(),E.shiftKey?o():a())}function g(E){if(E==="focus"){r(!0);return}r(!1)}return we.jsxs("div",{className:lE("form-control py-0 px-1 d-flex align-items-center",t?Kc.inputFocus:Kc.inputBlur,Kc.cursor),onClick:()=>{var E;return(E=e.current)==null?void 0:E.focus()},role:"search",children:[we.jsx("div",{"aria-hidden":"true",children:we.jsx(Ho,{svg:uE})}),we.jsx("input",{className:`form-control border-0 px-1 ${Kc.inputWithoutHighlight}`,value:s.query,onChange:l,autoComplete:"off",placeholder:Xc("searchPlaceholder"),ref:e,onKeyDown:f,onFocus:()=>g("focus"),onBlur:()=>g("blur")}),!!s.query&&we.jsxs("div",{className:"d-flex align-items-center",children:[we.jsx("div",{children:s.totalSearchResults?`${s.currentSearchResultIndex+1}/${s.totalSearchResults}`:"0/0"}),we.jsx(Qc,{"aria-label":Xc("previousResult"),onClick:()=>c({keepFocus:!1}),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&c({keepFocus:!0})},children:we.jsx(Ho,{svg:MF})}),we.jsx(Qc,{"aria-label":Xc("nextResult"),onClick:()=>u({keepFocus:!1}),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&u({keepFocus:!0})},children:we.jsx(Ho,{svg:SE})}),we.jsx(Qc,{"aria-label":Xc("clearSearch"),onClick:d,children:we.jsx(Ho,{svg:Z0})})]})]})}function HF(s){return we.jsx("svg",{...s,children:we.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16m0-15a7 7 0 1 1 0 14 7 7 0 0 1 0-14m.5 4a.5.5 0 0 0-1 0v5.293l-2.146-2.147a.5.5 0 0 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L12.5 14.293z",clipRule:"evenodd"})})}function VF(s){return we.jsx("svg",{...s,children:we.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0M5.493 14.585a7 7 0 0 0 9.244 3.86l-.59-.591c-.008-.008-.062-.05-.232-.068a2.7 2.7 0 0 0-.603.023c-.205.025-.41.062-.61.098l-.083.015c-.203.036-.44.078-.619.078a.72.72 0 0 1-.544-.261 1.2 1.2 0 0 1-.215-.39 4 4 0 0 1-.175-.856C11 15.903 11 15.256 11 15.005V15c0-.209.088-.397.245-.528a.9.9 0 0 1 .394-.18c.2-.042.45-.042.644-.042h.03c.226 0 .422-.001.59-.026.176-.026.233-.067.243-.078.187-.187.282-.37.407-.62l.006-.013c.124-.248.28-.559.587-.867a1.14 1.14 0 0 1 .667-.345 1.15 1.15 0 0 1 .66.127c.325.162.624.462.851.689l.023.023c.043-.01.103-.033.24-.088l.04-.016c.352-.141.9-.331 1.597.017.267.133.459.326.594.54a7.003 7.003 0 0 0-5.136-8.389.4.4 0 0 0-.026.108c.006.01.021.033.073.084q.022.022.059.057c.103.097.278.26.41.457.182.274.302.622.302 1.09 0 .357-.081.667-.264.925-.18.253-.423.405-.652.51-.191.09-.409.16-.605.223l-.09.03c-.23.075-.45.152-.665.26l-.066.035.04.102.016.042c.063.158.17.426.144.749q-.039.51-.504.978c-.573.572-1.07.771-1.604.771-.215 0-.426-.033-.605-.06l-.05-.008a4 4 0 0 0-.567-.057c-.023.096-.028.249-.028.5v.036c0 .221 0 .543-.088.81a.96.96 0 0 1-.316.463A.95.95 0 0 1 8 13.5c-.384 0-.7-.146-.956-.323a5 5 0 0 1-.633-.56l-.015-.013a4 4 0 0 0-.509-.458.74.74 0 0 0-.325-.142l-.012.03q-.08.204-.1.673c-.012.3 0 .63.015.948l.011.215c.012.233.024.458.024.63a1 1 0 0 1-.007.085M12 5a7 7 0 0 0-6.945 6.118A.85.85 0 0 1 5.5 11c.384 0 .7.146.956.323.241.167.456.382.633.56l.015.013c.194.195.35.348.509.458a.7.7 0 0 0 .359.145C7.995 12.403 8 12.25 8 12v-.036c0-.221 0-.543.088-.81a.96.96 0 0 1 .316-.463A.95.95 0 0 1 9 10.5c.291 0 .542.037.748.068l.03.005c.2.03.338.052.472.052.215 0 .469-.051.896-.479.188-.188.211-.3.215-.35.005-.068-.013-.143-.075-.298l-.012-.03c-.026-.063-.061-.15-.087-.235a1 1 0 0 1-.043-.409c.044-.378.319-.614.632-.771.285-.143.565-.238.803-.316l.097-.032a5 5 0 0 0 .49-.177c.146-.068.215-.127.255-.182.035-.05.079-.144.079-.346 0-.282-.068-.434-.135-.535a1.2 1.2 0 0 0-.207-.23q-.059-.054-.136-.131c-.153-.153-.366-.4-.366-.792q0-.137.035-.278A7 7 0 0 0 12 5m3.651 12.944.018.018a7.04 7.04 0 0 0 2.34-2.369.5.5 0 0 1 .044-.317l.007-.018.016-.053q.019-.067.033-.17c.019-.136.024-.296.007-.454-.038-.335-.16-.544-.34-.634-.303-.152-.505-.092-.778.017l-.023.01-.025.01c-.125.051-.319.13-.509.153a.93.93 0 0 1-.795-.283c-.27-.27-.458-.451-.62-.532a.3.3 0 0 0-.07-.027q-.02-.003-.019-.002h-.003l-.012.006a.3.3 0 0 0-.068.055c-.187.187-.282.37-.407.62l-.006.013c-.124.248-.28.559-.587.867-.24.239-.558.323-.804.36-.248.036-.513.036-.722.036h-.015q-.195-.001-.312.004c.003.3.014.733.058 1.128.029.254.067.461.113.6q.105-.015.271-.044l.081-.015c.197-.035.43-.077.664-.107.264-.033.559-.054.834-.024.268.029.59.112.832.354l.795.796zm-1.098-9.293c.23-.46.53-.776.91-.873a.93.93 0 0 1 .82.18c.19.1.445.259.668.45.124.107.252.236.353.384.099.145.196.345.196.583 0 .267-.123.521-.239.709a3.3 3.3 0 0 1-.47.582 3.3 3.3 0 0 1-.582.47c-.188.116-.442.239-.709.239-.065 0-.157.017-.337.05l-.027.004c-.172.032-.399.071-.636.071a1.6 1.6 0 0 1-.786-.186 1.6 1.6 0 0 1-.661-.715c-.15-.3-.251-.688-.007-1.03a.96.96 0 0 1 .349-.29c.108-.055.226-.096.322-.128l.057-.02c.404-.134.646-.214.779-.48m1.13.114c-.043.034-.129.12-.236.334-.329.658-.975.862-1.322.971q-.051.015-.092.03l-.095.033.01.018c.085.171.174.246.245.285a.63.63 0 0 0 .307.064c.138 0 .286-.023.457-.054l.052-.01a3 3 0 0 1 .491-.061q-.006 0 .001-.002c.016-.004.075-.022.181-.087.125-.077.267-.192.402-.327s.25-.277.327-.402a.8.8 0 0 0 .085-.172l-.019-.03a1 1 0 0 0-.178-.188 2.8 2.8 0 0 0-.523-.345l-.072-.036z",clipRule:"evenodd"})})}let rp=null;const qF={getVideoDownloadUrl(s,e){return nv.safeUrlConcat(nv.makeHttps(s),`/download?token=${e}`)},downloadResource(s,e,t,r){var n;let i=rp;rp||(i=rp=document.createElement("iframe"),document.body.appendChild(i),i.style.display="none"),i.src=s.url,r||Ea.logUserAction({id:s==null?void 0:s.id,name:s==null?void 0:s.name,resourceType:(n=s==null?void 0:s.metadata)==null?void 0:n.resourceType,...e},{actionType:er.Download,entity:Gr.Resource,workflowPhase:Ju.Complete,...t})},async downloadBlob(s,e){const t=await fetch(s);if(!t.ok)throw new Error("Error downloading file");const r=URL.createObjectURL(await t.blob()),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.setTimeout(()=>URL.revokeObjectURL(r),100)}},zF="subjects.utils";Ks.encloseNamespace(zF);const WF="onboarding.constants";Ks.encloseNamespace(WF);Os.HasCompletedOnboardingStepWelcomeVideo,Wr.OnboardingWelcomeVideoScreen,Os.HasCompletedOnboardingStepSelectRole,Wr.OnboardingSelectRoleScreen,Os.HasCompletedOnboardingStepUsageIntention,Wr.OnboardingUsageIntentionScreen,Os.HasCompletedOnboardingStepSubjectsSummary,Wr.OnboardingSubjectsSummaryScreen,Os.HasCompletedOnboardingStepSchoolLevel,Wr.OnboardingSchoolLevelScreen,Os.HasCompletedOnboardingStepSelectCurriculum,Wr.OnboardingSelectCurriculumScreen,Os.HasCompletedOnboardingStepSubjects,Wr.OnboardingSubjectsScreen,Os.HasCompletedOnboardingStepSelectVideos,Wr.OnboardingSelectVideosScreen,Os.HasCompletedOnboardingStepCreatePlaylist,Wr.OnboardingCreatePlaylistScreen;const GF=["sort","classification","presentation","audience","yearGroup","moviesAndTv","type","rating","interactives","clips","classroom","hasResources","hasSubtitles","productionYear","isHd","producedByClickView","duration","tagOrClassification","status","isAdmin","bulkActionType","userType","filter","channel","dateBroadcast","categoryId","hasInteractives","jobStatus","source","customerStatus","specialEventType","customerType"],KF={type:!0};GF.reduce((s,e)=>({...s,[e]:!KF[e]}),{});var et=(s=>(s.CuratedMedia="curated_media",s.PlaylistMedia="playlist_media",s.SeriesMedia="series_media",s.ClassificationMedia="classification_media",s.LatestReleasedVideos="latest_released_videos",s.ContinueWatching="continue_watching_videos",s.CompanyLatestReleasedVideo="company_latest_released_video",s.CompanyVideos="company_videos",s.ClassificationLatestReleasedVideo="classification_latest_released_video",s.ClassificationLatestReleasedVideosV2="classification_latest_released_videos_v2",s.CompanyClassificationVideos="company_classification_videos",s.ClassificationDashboardMedia="classification_dashboard_media",s.ClassificationDashboardExternalMedia="classification_dashboard_external_media",s.SeasonalClassificationMedia="seasonal_classification_media",s.TrendingClassificationsMedia="trending_classifications_media",s.ClassificationCurriculumMedia="classification_curriculum_media",s.CuratedClassifications="curated_classifications",s.Classifications="classifications",s.ClassificationLatestReleasedVideos="classification_latest_released_videos",s.SpecialEventClassifications="special_event_classifications",s.LatestReleasedClassifications="latest_released_classifications",s.TrendingClassifications="trending_classifications",s.CuratedSeries="curated_series",s.CuratedPlaylists="curated_playlists",s.Blurb="blurb",s.DynamicBlurb="dynamic_blurb",s.AuthorReviewer="author_reviewer",s.Faq="faq",s.CuratedCompanies="curated_companies",s.Ratings="ratings",s.Presentations="presentations",s.UpcomingLivestreams="upcoming_livestreams",s.CuratedMultimedia="curated_multimedia",s.ClassificationPlaylists="classification_playlists",s.ClassificationSeries="classification_series",s.ClassificationFeaturedVideo="classification_featured_video",s.ClassificationPinnedVideos="classification_pinned_videos",s.SearchRelevantTopics="search_relevant_topics",s.SearchCompanies="search_companies",s.SearchTopResults="search_top_results",s.SearchSeries="search_series",s.SearchPlaylists="search_playlists",s.SearchMyVideosFolder="search_my_videos_folders",s.SearchMySchoolLibraryFolder="search_my_school_library_folders",s.SearchMyVideos="search_my_videos",s.SearchMySchoolLibraryVideos="search_my_school_library_videos",s.SearchExchangeArchive="search_exchange_archive",s.SearchRelatedResults="search_related_results",s.SearchTags="search_tags",s.SearchCurriculumCode="search_curriculum_code",s.SearchSuggestions="search_suggestions",s))(et||{});et.CuratedMedia+"",et.PlaylistMedia+"",et.SeriesMedia+"",et.ClassificationMedia+"",et.LatestReleasedVideos+"",et.ContinueWatching+"",et.CompanyLatestReleasedVideo+"",et.CompanyVideos+"",et.ClassificationLatestReleasedVideo+"",et.ClassificationLatestReleasedVideosV2+"",et.SeasonalClassificationMedia+"",et.CompanyClassificationVideos+"",et.TrendingClassificationsMedia+"",et.CuratedClassifications+"",et.TrendingClassifications+"",et.Classifications+"",et.ClassificationLatestReleasedVideos+"",et.SpecialEventClassifications+"",et.LatestReleasedClassifications+"",et.CuratedSeries+"",et.CuratedPlaylists+"",et.Blurb+"",et.DynamicBlurb+"",et.AuthorReviewer+"",et.Faq+"",et.CuratedCompanies+"",et.Ratings+"",et.Presentations+"",et.UpcomingLivestreams+"",et.CuratedMultimedia+"",et.ClassificationPlaylists+"",et.ClassificationSeries+"",et.ClassificationFeaturedVideo+"",et.ClassificationPinnedVideos+"",et.ClassificationDashboardExternalMedia+"",et.ClassificationDashboardMedia+"",et.SearchRelevantTopics+"",et.SearchCompanies+"",et.SearchSeries+"",et.SearchPlaylists+"",et.SearchMyVideosFolder+"",et.SearchMySchoolLibraryFolder+"",et.SearchMyVideos+"",et.SearchMySchoolLibraryVideos+"",et.SearchExchangeArchive+"",et.SearchRelatedResults+"",et.SearchTopResults+"",et.ClassificationCurriculumMedia+"",et.SearchTags+"",et.SearchCurriculumCode+"",et.SearchSuggestions+"";const XF="shared.widgetHeader";Ks.encloseNamespace(XF);const YF="shared.playPageTranscription";Ks.encloseNamespace(YF);function QF(s){return s.map(e=>Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]}))}const JF="_languageSelect_1ws0w_1",H0={languageSelect:JF};function ZF(s){var n,a;const e=(n=s.languageOptions[0])==null?void 0:n.label,t=s.track.src,r=EE();async function i(){Ea.logUserAction(s.analyticsData,{...s.analyticsOptions,actionType:er.Download});try{await qF.downloadBlob(t,`Subtitles-${s.selectedLanguage}.vtt`)}catch{r.error("Error downloading transcript")}}return we.jsxs("div",{className:"d-flex px-1 mb-3",children:[we.jsx(jF,{query:s.searchQuery,currentSearchResultIndex:s.currentSearchResultIndex,onSearch:s.onSearch,totalSearchResults:s.totalSearchResults,jumpToSearchResult:s.jumpToSearchResult,analyticsData:s.analyticsData,analyticsOptions:s.analyticsOptions}),we.jsx(J0,{spanHack:!0,title:s.languageOptions.length>1?"":`Only available in ${e}`,children:we.jsxs(Ac,{children:[we.jsx(Ac.Toggle,{className:`text-dark ${H0.languageSelect}`,id:"language-select",disabled:((a=s.languageOptions)==null?void 0:a.length)<=1,variant:"outline-dark",children:we.jsx(Ho,{svg:VF})}),we.jsx(Ac.Menu,{className:H0.menu,"aria-labelledby":"language-select",children:s.languageOptions.map((o,l)=>we.jsx(Ac.Item,{onClick:()=>{var u;(u=s.onChangeLanguage)==null||u.call(s,o.value),Ea.logUserAction({...s.analyticsData,language:o.value,previousLanguageName:s.selectedLanguage},{...s.analyticsOptions,actionType:er.Select})},className:"cursor-pointer",active:o.value===s.selectedLanguage,children:o.label},l))})]})}),we.jsx(eT,{svg:HF,onClick:i,className:"position-relative d-flex align-items-center text-dark"})]})}const e7=B.getComponent("Component");class t7 extends e7{constructor(e,t){super(e,t)}dispose(){setImmediate(()=>{var e;(e=this.root)==null||e.unmount()}),super.dispose()}}const i7={tagName:"div"};function r7(s,e=i7){if(!s)throw new Error("componentCtor is required");class t extends t7{createEl(){const i=B.dom.createEl(e.tagName,e.properties,e.attributes),n=cE.createRoot(i);return n.render(s(this.player_,this.options_)),this.root=n,i}}return t}function n7(s){const e=Xt.get(O0)||M0(s.allTracks);function t(){return s.allTracks.find(ye=>ye.language===e)||s.allTracks.find(ye=>ye.language===M0(s.allTracks))}const[r,i]=Ht.useState(()=>t()),[n,a]=Ht.useState(e),[o,l]=Ht.useState(-1),[u,c]=Ht.useState(!0),[d,f]=Ht.useState([]),g=Ht.useMemo(()=>Array.from((r==null?void 0:r.cues)||[]),[n]),E={videoId:s.playbackObject.videoId,videoName:s.playbackObject.title,language:n},S={location:Wr.Player,entity:Gr.Transcript},k=s.player.hasStarted();SF({currentTranscriptTrack:r,cuesToDisplay:g,setCurrentCueIndex:l,hasStarted:k});const F=Ht.useRef(),L=bF({count:d.length,getScrollElement:()=>{var ye;return(ye=F.current)==null?void 0:ye.view},estimateSize:()=>40,enabled:d.length>0}),W=L.getVirtualItems(),H=CF(o,u,L),{isSearching:$,searchQuery:G,totalSearchResults:K,jumpToSearchResult:Y,onSearch:P,currentSearchResultIndex:O,resetSearchResults:ne}=EF({cuesToDisplay:g,resetHighlightedCues:Se,setHighlightedCues:f,scrollToCue:H}),te=s.player.paused(),[re,me]=iT();Ht.useEffect(()=>{c(!me&&!$&&k&&!te)},[me,$,k,te]);function Se(){f(QF(g))}Ht.useEffect(()=>{Se()},[g]);function Ae(){s.toggleTranscript(!1)}function ve(ye){i(s.allTracks.find(_e=>_e.language===ye)),a(ye),Xt.set(O0,ye),ne()}function Te(ye){var _e;(_e=s.setStartTime)==null||_e.call(s,ye.startTime)}return!r||!g.length?we.jsx(we.Fragment,{}):we.jsxs("div",{ref:re,className:`cv-transcript py-3 px-2 ${s.showTranscript?"cv-open":""}`,children:[we.jsxs("div",{className:"text-dark d-flex justify-content-between px-1",children:[we.jsx("h3",{children:"Transcript"}),we.jsx(eT,{svg:Z0,onClick:Ae,ariaLabel:"Close transcript"})]}),we.jsx(ZF,{selectedLanguage:n,languageOptions:s.languageOptions,onChangeLanguage:ve,track:r,onSearch:P,searchQuery:G,currentSearchResultIndex:O,totalSearchResults:K,jumpToSearchResult:Y,analyticsData:E,analyticsOptions:S}),we.jsx("div",{className:"cv-transcript-list-wrapper text-dark",children:we.jsx(hE,{ref:F,children:we.jsx(OF,{timepoint:g[o],onClickTranscriptionItem:Te,cuesToDisplay:d,chapters:s.chapters,currentSearchResultIndex:O,inPlayer:!0,virtualizer:L,items:W,analyticsOptions:S,analyticsData:E,isAuthenticated:!1})})})]})}B.registerComponent("Transcript",r7((s,e)=>we.jsx(n7,{player:s,...e})));const s7=B.getPlugin("plugin"),IC=992;class a7 extends s7{constructor(e){super(e),this.allClickViewTracks=[],this.player=e,this.bindListeners(),e.ready(()=>this.initialize())}bindListeners(){this.onResize=this.onResize.bind(this),yr.useMetadataTracks(this.player,"transcript",()=>this.player.trigger("resizemenus")),this.player.on("playerresize",this.onResize)}dispose(){this.player.off("playerresize",this.onResize),super.dispose()}initialize(){yr.useMetadataTracks(this.player,"transcript",this.onTranscriptLoaded.bind(this)),yr.useChapters(this.player,this.onChaptersLoaded.bind(this))}onChaptersLoaded(e){this.chapterTrack=e}onTranscriptLoaded(e){const t=e.isClickViewProduced;!this.allClickViewTracks.find(r=>r.language===e.language)&&t&&this.allClickViewTracks.push(e),this.languageOptions=this.buildOptions(this.allClickViewTracks)}buildOptions(e){return e.map(t=>({label:uh.getFullEnglishName(t.language),value:t.language})).sort((t,r)=>{const i=t.value.includes(cc)?1:0;return(r.value.includes(cc)?1:0)-i})}buildComponentProps(e,t,r){var n;const i=Array.from(((n=this.chapterTrack)==null?void 0:n.cues)||[]).map(a=>({endTimestamp:a.endTime,startTime:a.startTime,name:a.text}));return{showTranscript:e,languageOptions:this.languageOptions,toggleTranscript:a=>t(a,{shouldLog:!0}),allTracks:this.allClickViewTracks,setStartTime:r,chapters:i,playbackObject:this.playbackObject}}addChildren(e){if(this.component)return this.component.show(),this.component;const t=this.toggleTranscript.bind(this),r=this.setStartTime.bind(this),i=this.buildComponentProps(e,t,r);this.component=this.player.addChild("Transcript",i)}toggleTranscript(e,t){var i,n,a;const r=e!==void 0?e:!this.showTranscript;this.showTranscript=r,r?((i=this.player.theatreModePlugin())==null||i.toggleTheatreMode(!0,{shouldLog:!1}),this.addChildren(!0),this.player.addClass("cv-transcript-plugin")):((n=this.component)==null||n.hide(),this.player.removeClass("cv-transcript-plugin")),this.player.whiteboardModePlugin&&this.player.whiteboardModePlugin().setEnabled(!r),this.player.trigger("cv-transcript-toggle",r),this.player.trigger("resizemenus"),this.player.trigger("playerresize"),t!=null&&t.shouldLog&&((a=this.analyticsService)==null||a.logUserAction({videoId:this.playbackObject.videoId,videoName:this.playbackObject.title},{actionType:er.Click,descriptor:r?ol.ShowTranscript:ol.HideTranscript,entity:Gr.Transcript}))}setStartTime(e){this.player.currentTime(e)}isTranscriptOn(){return!!this.showTranscript}onResize(){if(window.innerWidth<IC){this.player.addClass("hide-transcript");return}this.showTranscript&&this.player.removeClass("hide-transcript")}registerAnalytics(e,t){this.analyticsService=e,this.playbackObject=t}}B.registerPlugin("viewTranscriptPlugin",a7);const o7=B.getComponent("TextTrackMenuItem");class PC extends o7{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Video Transcript",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="TranscriptMenuItem",super(e,t),this.transcriptOn=this.player_.viewTranscriptPlugin&&this.player_.viewTranscriptPlugin().isTranscriptOn(),this.bindEventListeners()}bindEventListeners(){const e=this.toggleListener.bind(this),t=this.onResize.bind(this);this.player_.on("cv-transcript-toggle",e),this.player_.on("playerresize",t),this.on("dispose",()=>{this.player_.off("cv-transcript-toggle",e),this.player_.off("playerresize",t)})}onResize(){const e=window.innerWidth<IC;this.item&&(this.item.style.display=e?"none":"block")}handleToggleListener(){this.transcriptOn?this.toggleOff():this.toggleOn()}toggleListener(e,t){var r,i;t?(this.transcriptOn=!0,B.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,(i=(r=B.dom).removeClass)==null||i.call(r,this.toggleEl,"on"))}toggleOn(){var e,t;this.transcriptOn=!0,B.dom.addClass(this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((t=(e=this.player_.viewTranscriptPlugin())==null?void 0:e.toggleTranscript)==null||t.call(e,!0,{shouldLog:!0})),this.player_.whiteboardModePlugin&&this.player_.whiteboardModePlugin().setEnabled(!1)}toggleOff(){var e,t,r,i;this.transcriptOn=!1,(t=(e=B.dom).removeClass)==null||t.call(e,this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((i=(r=this.player_.viewTranscriptPlugin())==null?void 0:r.toggleTranscript)==null||i.call(r,!1,{shouldLog:!0}))}createEl(e,t,r){this.handlerBound||(this.handleToggleListener=this.handleToggleListener.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggleListener),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggleListener);const i=`
|
|
367
|
+
<span class="vjs-menu-item-text">Video Transcript</span>
|
|
368
|
+
<span class="cv-toggle-container"></span>
|
|
369
|
+
<span class="vjs-control-text" aria-live="polite">, opens transcript</span>
|
|
370
|
+
`;return this.item=B.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:i,tabIndex:-1},r),this.item.children[1].appendChild(this.toggleEl),this.item}}B.registerComponent("ToggleTranscriptMenuItem",PC);const l7=B.getComponent("TextTrackButton"),V0=B.getComponent("SubsCapsButton");class u7 extends V0{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-subs-caps-menu-button",this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.player_.on("cv:languageselected",this.onSelectedLanguageChange),this.player_.one("dispose",()=>this.player_.off("cv:languageselected",this.onSelectedLanguageChange))}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.player_.options_.mobile){const t=this.player().textTracks(),r=Array.from(t||[]).some(n=>n.kind==="subtitles");this.player_.options_.allowTranscript&&!!r&&this.player_.viewTranscriptPlugin&&e.push(new PC(this.player_)),this.player_.options_.allowTranscript||e.push(new OR(this.player_)),e.push(new RR(this.player_)),this.hideThreshold_=e.length}return this.player().trigger("resizemenus"),l7.prototype.createItems.call(this,e,PR)}onSelectedLanguageChange(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(r.kind==="subtitles"&&r.mode==="showing"){this.setActive(!0);return}}this.setActive(!1)}getCollabsibleName(){return"Subtitles"}getCollabsibleValue(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(this.kinds_.indexOf(r.kind)>-1&&r.mode==="showing")return r.label}return"Off"}showInCollabsibleMenu(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(this.kinds_.indexOf(r.kind)>-1)return!0}return!1}showCollapsibleMenu(){V0.prototype.handleClick.apply(this)}}B.registerComponent("SubsCapsButton",u7);const c7=`<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>${vC}</span>`,h7=B.getComponent("MenuItem");class d7 extends h7{constructor(e,t){super(e,t),this.qualityId=t.qualityId;const r=e.qualityLevels(),i=this.handleQualityChange.bind(this);r.on("change",i),e.one("dispose",()=>{r.off("change",i)}),this.handleLocalCacheChange=this.handleLocalCacheChange.bind(this),this.player_.ready(()=>{this.player_&&(this.player_.on("localcachechanged",this.handleLocalCacheChange),this.player_.one("dispose",()=>{var n;(n=this.player_)==null||n.off("localcachechanged",this.handleLocalCacheChange)}),this.handleLocalCacheChange())})}async handleLocalCacheChange(){const t=await this.player_.localCache().getActiveLocalCache();if(!(t!=null&&t.playbackProfile)){this.show(),this.enable(),this.setLabel(this.options_.label);return}t.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+c7)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}buildCSSClass(){return"vjs-menu-item cv-quality-menu-item"}handleClick(){const e=this.player_.qualityLevels();for(let t=0;t<e.length;t++){const r=e[t];r.enabled=r.id===this.qualityId}}handleQualityChange(){if(!this.player_)return;const e=this.player_.qualityLevels(),t=e[e.selectedIndex],r=t&&t.id===this.qualityId;r!==this.isSelected_&&this.selected(r)}}const q0={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},z0=B.getComponent("MenuButton");class f7 extends z0{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-quality-menu-button";const r=this.player_.qualityLevels(),i=this.update.bind(this);r.on("addqualitylevel",i),r.on("removequalitylevel",i),e.one("dispose",()=>{r.removeEventListener("addqualitylevel",i),r.removeEventListener("removequalitylevel",i)})}buildCSSClass(){return`cv-quality-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-small vjs-quality-button cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[],t=this.player_.qualityLevels();e.push(new vc(this.player_,{label:"Quality"}));for(let r=0;r<t.length;r++){const i=t[r];if(!i)continue;const n=q0[i.id];n&&e.push(new d7(this.player_,{qualityId:i.id,label:n,selectable:!0,multiSelectable:!1}))}return e}getCollabsibleName(){return"Quality"}getCollabsibleValue(){const e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?q0[t.id]:""}showInCollabsibleMenu(){return!!this.player_.qualityLevels().length}showCollapsibleMenu(){z0.prototype.handleClick.apply(this)}}B.registerComponent("QualityButton",f7);const p7=B.getComponent("Menu"),W0=B.getComponent("MenuButton"),m7=B.getComponent("PlaybackRateMenuItem"),G0=B.getComponent("PlaybackRateMenuButton");class g7 extends G0{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-playback-rate-menu-button"}createEl(...e){return W0.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createMenu(){const e=new p7(this.player(),{menuButton:this});e.addItem(new vc(this.player_,{label:"Playback speed"}));const t=this.playbackRates();if(t)for(let r=0;r<t.length;r++){let i=t[r]+"x";t[r]===1&&(i+=" (Normal)"),e.addItem(new m7(this.player(),{rate:i}))}return e}handleClick(...e){return W0.prototype.handleClick.apply(this,...e)}updateLabel(...e){return this.setupLabelEl(),G0.prototype.updateLabel.apply(this,...e)}setupLabelEl(){if(this.labelEl_)return;const e=this.$("button");e&&(this.labelEl_=B.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}getCollabsibleName(){return"Playback speed"}getCollabsibleValue(){return this.player().playbackRate()+"x"}showInCollabsibleMenu(){return!!this.playbackRates()}showCollapsibleMenu(){this.handleClick(null)}}B.registerComponent("PlaybackRateMenuButton",g7);const v7=B.getComponent("TextTrackSettings"),ch={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},K0={small:ch,medium:{...ch,fontPercent:1.5},large:{...ch,fontPercent:2}};class y7 extends v7{setSizeSetting(e){this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();const r=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame(()=>{r.update(),this.player_.trigger("resizemenus")})}getSizeSetting(){return this.size_||"small"}getValues(){return K0[this.size_]?K0[this.size_]:ch}}B.registerComponent("TextTrackSettings",y7);const _7="cv-video-wrapper",hh=B.getComponent("Player");class LC extends hh{constructor(e,t){super(e,t),this._dataLoaded=!1,t.mobile&&this.addClass("cv-mobile-player");const r=()=>this._dataLoaded=!0;this.on("cv-playback-data-loaded",r),this.on("dispose",()=>this.off("cv-playback-data-loaded",r))}dataLoaded(e){if(this._dataLoaded){e();return}this.one("cv-playback-data-loaded",e),this.one("dispose",()=>{this.off("cv-playback-data-loaded",e)})}lock(e){this.callback_=e}unlock(){delete this.callback_}currentTime(e,t){if(typeof e!="number"||!this.callback_||t)return super.currentTime(e);this.callback_(()=>{this.unlock(),this.currentTime(e)})}play(){if(!this.callback_)return super.play();this.callback_(()=>{this.unlock(),this.play()})}createEl(){const e=super.createEl();return this.videoContainer||(this.videoContainer=B.dom.createEl("div",{className:_7}),e.appendChild(this.videoContainer)),Array.from(e.childNodes).forEach(t=>t!==this.videoContainer&&this.videoContainer.appendChild(t)),e}addChild(e,t={},r=this.children_.length){const i=super.addChild(e,t,r),n=i.el();return n&&this.videoContainer.appendChild(n),i}updateStyleEl_(){if(hh.prototype.updateStyleEl_.call(this),!this.options_.fluid)return;const e=this.el_.parentNode;if(!e||!this.options_.setMaxHeight)return;let t=this.aspectRatio();if((t===void 0||t==="auto")&&(this.videoWidth()>0?t=this.videoWidth()+":"+this.videoHeight():t="16:9"),this.player_.playerModePlugin().getMode()===CC.Hover){e.style.removeProperty("maxWidth"),e.style.removeProperty("margin");return}const r=t.split(":"),i=+r[1]/+r[0];e.style.maxWidth=85/i+"vh",e.style.margin="0 auto"}listenForUserActivity_(){hh.prototype.listenForUserActivity_.call(this);const e=this.getChild("collapserator");e.on("mouseenter",()=>{this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",()=>{this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}}LC.prototype.options_={...hh.prototype.options_,setMaxHeight:!0};B.registerComponent("player",LC);const T7=B.getComponent("Component");class b7 extends T7{constructor(e,t){super(e,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.onFirstPlay=this.onFirstPlay.bind(this),this.player_.one("play",this.onFirstPlay)}dispose(){this.player_.off("play",this.onFirstPlay)}onFirstPlay(){window.setTimeout(()=>{this.player_.isDisposed()||this.player_.removeClass("cv-disable-play-pause-feedback")},500)}createEl(){return B.dom.createEl("div",{className:"cv-play-pause-feedback"})}}B.registerComponent("PlayPauseFeedback",b7);const Yc=B.getComponent("PlayToggle"),OC="Play (space)",S7="Pause (space)";class MC extends Yc{handlePlay(){Yc.prototype.handlePlay.call(this),this.controlText(S7)}handlePause(){Yc.prototype.handlePause.call(this),this.controlText(OC)}handleClick(e){Yc.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}}B.registerComponent("PlayToggle",MC);MC.prototype.controlText_=OC;const X0=B.getComponent("TextTrackDisplay"),C7=.025;class E7 extends X0{constructor(e,t){super(e,t),this.bindListeners()}bindListeners(){this.onResize=this.onResize.bind(this),this.player_.on("resize",this.onResize)}onResize(){this.updateDisplay()}updateDisplayState(e){X0.prototype.updateDisplayState.call(this,e);const t=this.player_.textTrackSettings.getValues(),r=e.activeCues;let i=r.length;for(;i--;){const n=r[i];if(!n)continue;const a=n.displayState;if(t.fontPercent&&t.fontPercent!==1){const l=this.el().getBoundingClientRect().width*C7*100/100;a.style.fontSize=l*t.fontPercent+"px"}}}}B.registerComponent("TextTrackDisplay",E7);const w7=B.getComponent("Component");class k7 extends w7{createEl(){return B.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}B.registerComponent("ControlBarGradient",k7);const A7=B.getComponent("Component");class x7 extends A7{constructor(e,t){super(e,t),this.options_=t}createEl(){let e=this.options_.title;if(!this.options_.seriesName)return super.createEl("h1",{innerHTML:e});const t=this.buildSeasonEpisodeString();return t?(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()} ${t}</div>`+e,super.createEl("h1",{innerHTML:e})):(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()}</div>`+e,super.createEl("h1",{innerHTML:e}))}buildSeasonEpisodeString(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";const e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return`S${e} • E${t}`}padNumber(e,t){let r=e.toString();if(r.length>=t)return r;for(t=t-r.length;t>0;)r="0"+r,t--;return r}}function N7(s){return s?(t=>{switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}})(s):""}const D7=B.getComponent("Component");class I7 extends D7{constructor(e,t){super(e,t),this.options_=t}buildCSSClass(){return`cv-splash-rating ${N7(this.options_.ratingValue)}`}createEl(e,t,r){return this.options_.ratingCode?super.createEl(e,{...t,className:this.buildCSSClass(),innerHTML:this.options_.ratingCode},r):null}}const P7=B.getComponent("Component");class L7 extends P7{constructor(e,t){if(super(e,t),!t.embed)return this;this.addChild(new x7(e,t)),this.addChild(new I7(e,t))}createEl(){return B.dom.createEl("div",{className:"cv-splash-metadata"})}}const O7=B.getComponent("posterImage");class M7 extends O7{constructor(e,t){super(e,t),this.addChild(new L7(e,t))}createEl(){let e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+=`<div class='cv-splash-logo'>${pC}</div>`),B.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}setSrc(e){let t="";e&&(t=`url("${e}")`),this.el_.style.backgroundImage=t}}B.registerComponent("posterImage",M7);const R7=B.getComponent("ErrorDisplay");class B7 extends R7{constructor(e,t){super(e,t),this.el().prepend(this.getErrorImage())}getErrorImage(){return B.dom.createEl("div",{className:"cv-error-image",innerHTML:`
|
|
371
|
+
<svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">
|
|
372
|
+
<path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>
|
|
373
|
+
<path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>
|
|
374
|
+
<path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
375
|
+
<path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
376
|
+
</svg>
|
|
377
|
+
`})}}B.registerComponent("ErrorDisplay",B7);const Y0=B.getComponent("FullscreenToggle"),RC="Fullscreen (f)";class BC extends Y0{handleFullscreenChange(){Y0.prototype.handleFullscreenChange.call(this),this.controlText(RC)}}B.registerComponent("FullscreenToggle",BC);BC.prototype.controlText_=RC;const U7=B.getComponent("MuteToggle"),UC="Mute (m)",F7="Unmute (m)";class FC extends U7{updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?F7:UC;this.controlText_!==t&&this.controlText(t)}}B.registerComponent("MuteToggle",FC);FC.prototype.controlText_=UC;const $7=B.getComponent("Player"),j7=s=>s.indexOf("#")===0?s.slice(1):s,H7=3;let Mu;const nd=class nd{constructor(e,t){if(this.streamLogged=!1,this.options=B.obj.merge({},nd.options_,t),this.options.playerApi===null)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(r=>this.handleFetchError(r))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}configurePlugins(){}onFlushProgress(e){var t;(t=this.analyticsService)==null||t.logVideoProgress(e)}buildVideoJs(){return this.player=B(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout=="number")return this.options.inactivityTimeout;let e=500;return(this.options.mobile||B.browser.IS_IOS||B.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=$7.prototype.options_.children;return e=e.filter(t=>!(t==="bigPlayButton"||t==="posterImage")),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[...e,{name:"collapserator",children:kI.filter(t=>!(t==="fullscreenToggle"&&!this.options.allowFullscreen))},"playPauseFeedback","controlBarGradient"],userActions:{hotkeys:t=>MI(t,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=r=>{const i=`${this.options.playerApi.origin}/api/playback?viewKey=${r}`;return Mp.get(i)}),!this.options.viewKey)throw new Error("Please specify a viewKey or a fetch function");const t=await e(this.options.viewKey);if(!t)throw new Error("Error fetching playback object");return t}setChaptersInternal(e,t){let r=yr.getTrack(this.player,"chapters",null);r||(r=this.player.addTextTrack("chapters")),[...r.cues.cues_].forEach(n=>r.removeCue(n)),e.forEach(n=>{r.addCue({startTime:n.timestamp,endTime:n.endTimestamp,text:n.name})}),t&&r.trigger({type:"cv:cuechange",target:r}),r.trigger({type:"loadeddata",target:r})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){var i,n,a;const e=await this.getPlaybackObject();if(this.isDisposed())return;const t=e.mediaType==="MasterClip",r=(i=e.additionalData)==null?void 0:i.clipData;((a=(n=e.chapters)==null?void 0:n.list)==null?void 0:a.length)>0&&!t&&!r&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(o=>({id:o.profile,mimeType:o.mimeType,url:o.url}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(o=>{if(o.mimeType!=="text/vtt")return;const l=this.player.addRemoteTextTrack({kind:"subtitles",src:o.url,language:o.language,label:o.label},!0);if(yr.sanitizeTrack(l.track,this.player),this.options.allowTranscript){const u=this.player.addRemoteTextTrack({kind:"metadata",src:o.url+(o.url.includes("?")?"&":"?")+"fullSentences=true",language:o.language,label:"transcript"},!0);u.track.isClickViewProduced=o.isClickViewProduced,yr.sanitizeTrack(u.track,this.player)}}),e.posterUrl&&this.player.poster(dE.createUrl(e.posterUrl,{size:fE.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger("cv-playback-data-loaded",e)}handleFetchError(e){var r;let t=e.message;e instanceof Op&&((r=e.response)==null?void 0:r.type)===Q1.PhysicallyChapteredVideo&&(t="Video cannot be played because it is either corrupt or damaged."),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(Mu||this.options.fetch||this.options.offlinePlaybackObject)return;const e=`${this.options.playerApi.origin}/api/config`;Mu=await Mp.get(e),!this.isDisposed()&&this.trigger("config:loaded")}additionalSetup(e){var r;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();const t=this.options.enableLocalCache&&!!((r=e.localCacheAddresses)!=null&&r.length);Mu?this.setupAnalyticsService(e,t):this.one("config:loaded",()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new AI({player:this.player,collectionApiUrls:Mu.collectionApi.urls,collectionApiClientId:Mu.collectionApi.clientId,productVersion:BI.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||pE.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}setupAnalyticsDependentPlugins(e){var t,r,i,n;this.player.persistSubtitleSettingsPlugin({showSubtitles:(t=e.settings)==null?void 0:t.showSubtitles,subtitleSize:(r=e.settings)==null?void 0:r.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:(i=e.settings)==null?void 0:i.playbackProfile,playbackProfileLocalCache:(n=e.settings)==null?void 0:n.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<H7||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}getAnalyticsPlayerType(){return"player"}createEl(e){let t;typeof e=="string"?(e=j7(e),t=B.dom.$("#"+e)):t=e;let r="video-js";return this.getPlayerClassName()&&(r+=` ${this.getPlayerClassName()}`),this.el=B.dom.createEl("video",{},{class:r}),t.appendChild(this.el),this.el}getPlayerClassName(){return""}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){const t=this.player.qualityLevels();for(let r=0;r<t.length;r++){const i=t[r];if(e){i.enabled=i.id===e.toString();continue}if(i.enabled)return i.id}}subtitles(e){const t=this.player.textTracks();for(let r=0;r<t.length;r++){const i=t[r];if(i.kind==="subtitles"){if(e!==void 0){i.label===e?i.mode="showing":i.mode="disabled";continue}if(i.mode==="showing")return i.label}}}bindEventListeners(){const e=r=>r.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",()=>{this.off("ended",this.showSplash),this.off("play",this.hideSplash),this.player.tech(!0).off("contextmenu",e)}),!this.options.hotkeyElQuerySelector)return;const t=B.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,"keydown",this.player.handleKeyDown),this.player.one("dispose",()=>{this.player.off(t,"keydown",this.player.handleKeyDown)}))}setupSeekBar(){const e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",{embed:this.options.embed,...e}),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}hideSplash(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}getSeekBarOptions(){return{}}getSeekBarName(){return"ChapterSeekBar"}};nd.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};let cm=nd;const V7={getInteractiveTrack(s,e){var n;const t=s.addTextTrack("metadata","interactive"),r=e.additionalData.interactive,i=(n=e.additionalData.clipData)==null?void 0:n.startTime;return r.timepoints.forEach(a=>{var u;let o=a.visibleAt/1e3,l=a.visibleFor?o+a.visibleFor/1e3:o+1;i&&(o+=i,l+=i),(u=a.interactions)!=null&&u.length&&t.addCue({startTime:Math.max(.001,o-.001),endTime:l,text:a.id})}),t}},q7=B.getComponent("MenuItem");class $C extends q7{constructor(e,t){super(e,t),this.overlayVisible=t.overlayVisible,this.toggle(this.overlayVisible)}handleToggle(){this.toggle(!this.overlayVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){B.dom.addClass(this.toggleEl,"on"),this.overlayVisible=!0,this.player().engagementOverlayPlugin().toggleOverlay(this.overlayVisible),this.player().addClass("cv-reports-player-overlay-visible")}toggleOff(){B.dom.removeClass(this.toggleEl,"on"),this.overlayVisible=!1,this.player().engagementOverlayPlugin().toggleOverlay(this.overlayVisible),this.player().removeClass("cv-reports-player-overlay-visible")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:`
|
|
378
|
+
<span class="vjs-menu-item-text">Heat Map</span>
|
|
379
|
+
<span class="cv-toggle-container"></span>`},r);return n.children[1].appendChild(this.toggleEl),n}}B.registerComponent("EngagementOverlayMenuItem",$C);const Q0=3;function z7(s){var i;const e=s.interactive.timepoints.find(n=>{const a=n.visibleAt/1e3;return Math.floor(s.time)===Math.floor(a)||Math.ceil(s.time)===Math.ceil(a)});if(!((i=e==null?void 0:e.interactions)!=null&&i.length))return we.jsx(we.Fragment,{});const t=e.interactions.length>Q0?e.interactions.slice(0,Q0-1):e.interactions,r=e.interactions.length-t.length;return we.jsxs("div",{className:"d-flex justify-content-end ms-2",children:[t.map((n,a)=>we.jsx(wE,{interaction:n,showQuestion:!1,iconClassName:"ms-1"},a)),!!r&&we.jsx("div",{className:"interaction-type-icon d-flex justify-content-center align-items-center border border-dark text-body ms-1",children:`+${r}`})]})}const W7={title:{text:null},xAxis:{visible:!1,minPadding:0,maxPadding:0},legend:{enabled:!1},credits:{enabled:!1},defs:{gradient:{tagName:"linearGradient",id:"area-gradient",x1:0,y1:1,x2:0,y2:0,children:[{tagName:"stop",offset:0},{tagName:"stop",offset:1}]}}};function G7(s,e){return{styledMode:!0,spacing:[15,0,0,0],width:s,height:e}}function K7(s){return{max:Math.max(...s)*1.05,min:0,minPadding:0,maxPadding:0,allowDecimals:!0,startOnTick:!1,endOnTick:!1,visible:!1}}function X7(s){return{formatter:function(){const e=s?Q7(s,this.x):"";return`<div class="cv-engagement-tooltip bg-white rounded"><div class="d-flex justify-content-between"><strong>${Kg(this.x)}</strong>${e}</div><div class="d-flex justify-content-between rounded bg-light cv-view-count-container"><strong>Views</strong> <span class="cv-view-count">${this.y}</span></div></div>`},positioner:function(e,t,r){const n=this.chart.plotWidth-e,a=r.plotX-e/2;return{x:Math.min(Math.max(a,0),n),y:this.chart.plotTop}},useHTML:!0,padding:0}}function Y7(s){return{area:{point:{events:{mouseOver:function(){s(this.x)},mouseOut:function(){s(null)}}}},series:{marker:{enabled:!1}}}}function Q7(s,e){return mE.renderToStaticMarkup(we.jsx(z7,{time:e,interactive:s}))}const J7=B.getComponent("Component");fm.AST.allowedTags.push("g");fm.AST.allowedAttributes.push("viewBox","transform");class Z7 extends J7{constructor(e,t){super(e,t),this.initialize(),this.bindListeners()}initialize(){this.player().ready(()=>this.buildChart())}buildCSSClass(){return"cv-engagement-overlay"}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass(),innerHTML:'<div class="cv-engagement-chart"></div><div class="cv-engagement-timepoint-indicator"></div>'},r)}toggleChart(e){e?this.buildChart():this.destroyChart()}bindListeners(){this.handleClick=this.handleClick.bind(this),this.resizeChart=this.resizeChart.bind(this),this.player().on("playerresize",this.resizeChart),this.on(this.el(),"mouseup",this.handleClick),this.player().on("dispose",()=>{this.player().off("playerresize",this.resizeChart),this.off(this.el(),"mouseup",this.handleClick)})}handleClick(e){if(B.dom.isSingleLeftClick(e)){if(this.player().paused()){this.player().play();return}this.player().pause()}}buildChart(){if(this.chart)return;const e=this.getChartDimensions();if(!e){this.player().one("play",()=>this.buildChart());return}const t=this.el().querySelector(".cv-engagement-chart");this.chart=fm.chart(t,this.getHighchartOptions(e))}resizeChart(){const e=this.getChartDimensions();!this.chart||!e||this.chart.setSize(e.width,e.height)}destroyChart(){var e;(e=this.chart)==null||e.destroy(),this.chart=null}getChartDimensions(){const e=this.player().getChild("collapserator"),t=e==null?void 0:e.currentHeight(),r=this.el().clientWidth;if(!t||!r)return null;const{height:i}=this.player().currentDimensions();return{width:r,height:i-t}}getHighchartOptions({width:e,height:t}){return{...W7,chart:G7(e,t),yAxis:K7(this.options_.heatMap),tooltip:X7(this.options_.interactive),plotOptions:Y7(this.moveTimepointIndicator.bind(this)),series:[{type:"area",data:this.options_.heatMap}]}}moveTimepointIndicator(e){this.options_.onTimepointHover&&this.options_.onTimepointHover(e);const t=this.el().querySelector(".cv-engagement-timepoint-indicator");if(e===null){B.dom.removeClass(t,"cv-engagement-timepoint-indicator-visible");return}B.dom.addClass(t,"cv-engagement-timepoint-indicator-visible"),t.style.left=`${e/this.options_.heatMap.length*100}%`}}B.registerComponent("EngagementOverlay",Z7);const e9=B.getPlugin("plugin");class t9 extends e9{constructor(e,t){super(e,t),this.options=t,e.ready(()=>{this.initialize()})}initialize(){var t;if(!this.hasHeatMapData())return;this.player.addChild("engagementOverlay",{heatMap:this.options.heatMap,interactive:this.options.interactive,onTimepointHover:this.options.onTimepointHover}),((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({ctor:$C,name:"EngagementOverlayMenuItem",options:{overlayVisible:!0}})}toggleOverlay(e){const t=this.player.getChild("engagementOverlay");t==null||t.toggleChart(e)}hasHeatMapData(){var e;return((e=this.options.heatMap)==null?void 0:e.reduce((t,r)=>t+r,0))>0}}B.registerPlugin("engagementOverlayPlugin",t9);const i9=B.getPlugin("plugin"),r9=10;class n9 extends i9{constructor(e,t){if(super(e),t.startTime===void 0)throw Error("Invalid clip start");if(t.endTime===void 0)throw Error("Invalid clip end");if(t.startTime>t.endTime)throw Error("Clip start cannot be greater than clip end");this._clipStart=parseFloat(t.startTime.toPrecision(4)),this._clipEnd=parseFloat(t.endTime.toPrecision(4)),this.playerEndedFn=this.player.ended.bind(e),this.playerDurationFn=this.player.duration.bind(e),this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.playerbufferedFn=this.player.buffered.bind(e),this.player.ended=this.ended.bind(this),this.player.duration=this.duration.bind(this),this.player.currentTime=this.currentTime.bind(this),this.player.buffered=this.buffered.bind(this),this.initialize(),this.player.ready(()=>{this.player.trigger("durationchange")})}get clipStart(){const e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}get clipEnd(){const e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),super.dispose()}initialize(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}onPlay(){this._isEnded&&this.player.currentTime(0)}onTimeUpdate(){const e=this.getCurrentTime(!1);if(e>this.clipEnd){this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0);return}this._isEnded=!1,e<this.clipStart-r9&&this.playerCurrentTimeFn(this.clipStart,!0)}ended(){return this.getCurrentTime(!1)>this.clipEnd}duration(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}currentTime(e,...t){if(typeof e!="number")return this.getCurrentTime(!0);const r=e+this.clipStart;this.playerCurrentTimeFn(r,t)}getCurrentTime(e){const t=this.playerCurrentTimeFn();let r=0;return t>=this.clipStart&&(r=t-this.clipStart),this.player.getCache().currentTime=r,e?r:t}buffered(){const e=this.playerbufferedFn(),t=[];for(let r=0;r<e.length;r++)t[r]=[Math.max(0,e.start(r)-this.clipStart),Math.min(Math.max(0,e.end(r)-this.clipStart),this.player.duration())];return B.createTimeRanges(t)}}B.registerPlugin("clipPlugin",n9);const s9=B.getComponent("Button");class a9 extends s9{constructor(e,t){super(e,t),this.timepoint_=t.timepoint,this.time_=t.timepoint.visibleAt/1e3;const r=t.timepoint.interactions[0];r||this.hide();const{bgClassName:i}=kE.getTypeInfo(r.typeId);this.$(".vjs-icon-placeholder").classList.add(i),this.controlText(r.name),this.update()}buildCSSClass(){return`cv-interactive-bar-item ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},{...r,tabindex:0})}update(){const e=this.player_.duration(),t=this.time_/e;this.el().style.left=t*100+"%",t>100||t<0?this.hide():this.show()}handleClick(e){e.stopPropagation(),this.player_.currentTime(this.time_)}}const o9=B.getComponent("Component");class l9 extends o9{constructor(e,t){super(e,t),this.track_=t.track,this.interactive_=t.interactive,this.onDurationChange=this.onDurationChange.bind(this),this.createInteractionItems=this.createInteractionItems.bind(this),this.createInteractionItems(),this.track_.on("cv:cuechange",this.createInteractionItems),this.player_.on("durationchange",this.onDurationChange),this.player_.on("dispose",()=>{this.track_.off("cv:cuechange"),this.player_.off("durationchange",this.onDurationChange)})}buildCSSClass(){return`cv-interactive-bar-items ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(){this.children_.forEach(e=>{e.update()})}createInteractionItems(){var e;if(this.track_){[...this.children_].forEach(t=>{this.removeChild(t)});for(let t=0;t<this.track_.cues.length;t++){const r=this.track_.cues[t],i=this.getTimepointById(r.text);!i||!((e=i.interactions)!=null&&e.length)||this.addChild(new a9(this.player_,{timepoint:i}))}}}onDurationChange(){this.update()}getTimepointById(e){var t;return(t=this.interactive_.timepoints)==null?void 0:t.find(r=>r.id.toString()===e.toString())}}const u9=B.getPlugin("plugin");class c9 extends u9{constructor(e,t){super(e),this.options=t,this.player.one("loadedmetadata",()=>this.player.ready(this.initialize.bind(this)))}initialize(){yr.useMetadataTrack(this.player,"interactive",this.onTrackLoaded.bind(this)),this.player.addClass("cv-interactive-plugin")}onTrackLoaded(e){this.addChildren(e)}addChildren(e){this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new l9(this.player,{interactive:this.options.interactive,track:e}))}}B.registerPlugin("interactiveSeekBarPlugin",c9);class h9 extends cm{constructor(e,t){super(e,t)}getPlayerClassName(){return"cv-reports-player"}getAnalyticsPlayerType(){return"reports-player"}async additionalSetup(e){super.additionalSetup(e),this.setupEngagementOverlayPlugin(e),this.setupUpClipPlugin(e),this.setupInteractiveSeekBarPlugin(e)}setupEngagementOverlayPlugin(e){var t;this.player.engagementOverlayPlugin({heatMap:this.options.heatMap,interactive:(t=e.additionalData)==null?void 0:t.interactive,onTimepointHover:this.options.onTimepointHover})}setupUpClipPlugin(e){var n;const t=e.mediaType==="MasterClip",r=e.mediaType==="MasterInteractive";if(!t&&!r)return;let i;if(t&&(i=e.additionalData),!(r&&(i=(n=e.additionalData)==null?void 0:n.clipData,!i))){if(!i)throw Error("Invalid clip data");this.player.clipPlugin({startTime:i.startTime,endTime:i.endTime})}}setupInteractiveSeekBarPlugin(e){var r,i;const t=(r=e.additionalData)==null?void 0:r.interactive;(i=e.additionalData)!=null&&i.interactive&&(this.track=V7.getInteractiveTrack(this.player,e),this.player.interactiveSeekBarPlugin({interactive:t}))}getSeekBarOptions(){return{ignoreChapters:!0}}}function d9(s){const e=Ht.useRef(null),t=Ht.useRef(null);return Ht.useEffect(()=>{t.current=new h9(e.current,s)},[]),we.jsx("div",{ref:e})}const f9="shared.videoEngagementOverlay",p9=Ks.encloseNamespace(f9);function pj(s){const e=Ht.useRef(null),t=nT(s.engagement);function r(i){const n=e.current;if(n){if(i===null){n.classList.remove(Us.heatMapTimepointIndicatorVisible);return}n.classList.add(Us.heatMapTimepointIndicatorVisible),n.style.left=`${i/t.length*100}%`}}return we.jsxs("div",{className:`bg-white rounded p-2 h-100 ${s.className}`,children:[s.heading&&we.jsx("h2",{className:"h6 mb-3",children:s.heading}),we.jsxs("div",{className:"mb-2 position-relative",children:[we.jsx("div",{className:Us.playerPlaceholder}),we.jsx("div",{className:Us.playerContainer,children:we.jsx(d9,{viewKey:s.viewKey,playerApi:new URL(s.playerApiUrl),hotkeyElQuerySelector:"body",heatMap:t,onTimepointHover:r,aspectRatio:"16:9"})})]}),we.jsxs("div",{className:"position-relative",children:[we.jsx(pm,{engagement:s.engagement,className:Us.heatMap}),we.jsx("div",{ref:e,className:Us.heatMapTimepointIndicator})]}),we.jsxs("div",{className:"d-flex justify-content-between mt-2",children:[we.jsx("div",{children:!s.heading&&we.jsx("strong",{children:p9("engagement")})}),we.jsx("div",{className:"w-33",children:we.jsx(oT,{})})]})]})}export{N9 as E,GE as M,D9 as P,pj as V,I9 as a};
|
|
380
|
+
//# sourceMappingURL=BZf-mjTJ.chunk.js.map
|