CINXE.COM
<!DOCTYPE html> <html lang="" class="bc-iframe"> <head> <meta charset="utf-8"> <title></title> <meta name="viewport" content="user-scalable=0, width=device-width, maximum-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="icon" href="data:;base64,iVBORw0KGgo="> <style class="bc-style-vjs"> .video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 6px 8px}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:14px}.vjs-text-track-settings .vjs-label{clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);margin:0 5px 5px 0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0} </style> <style class="bc-style-XvkzQ10d0-default"> .bc-player-XvkzQ10d0_default *,.bc-player-XvkzQ10d0_default :after,.bc-player-XvkzQ10d0_default :before{box-sizing:inherit;font-size:inherit;color:inherit;line-height:inherit}.bc-player-XvkzQ10d0_default{width:300px;height:150px;font-size:14px;overflow:hidden}.bc-player-XvkzQ10d0_default.vjs-fluid.vjs-16-9:not(.vjs-audio-only-mode),.bc-player-XvkzQ10d0_default.vjs-fluid:not(.vjs-audio-only-mode){padding-top:56.25%}.bc-player-XvkzQ10d0_default.vjs-fluid.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.bc-player-XvkzQ10d0_default.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.bc-iframe,.bc-iframe body,.bc-player-XvkzQ10d0_default,.bc-player-XvkzQ10d0_default .vjs-poster{background-color:#151b17}.bc-iframe,.bc-iframe .bc-player-XvkzQ10d0_default,.bc-iframe body{margin:0;width:100%;height:100%;overflow:hidden}.bc-player-XvkzQ10d0_default.vjs-fullscreen,.bc-player-XvkzQ10d0_default.vjs-fullscreen .vjs-tech{width:100%!important;height:100%!important}.bc-player-XvkzQ10d0_default .vjs-track-setting select{color:#000;background-color:#fff}.bc-player-XvkzQ10d0_default .vjs-audio-button .vjs-menu-item,.bc-player-XvkzQ10d0_default .vjs-chapters-button .vjs-menu-item,.bc-player-XvkzQ10d0_default .vjs-descriptions-button .vjs-menu-item,.bc-player-XvkzQ10d0_default .vjs-subs-caps-button .vjs-menu-item{text-transform:none}.bc-player-XvkzQ10d0_default.vjs-waiting-for-autoplay .vjs-big-play-button{opacity:0}.bc-player-XvkzQ10d0_default .vjs-progress-control .vjs-mouse-display{z-index:2}/*! @name @brightcove/player-core @version 1.7.3 @license UNLICENSED */.vjs-download-button{cursor:pointer}.vjs-download-button.has-icon-downloading{cursor:wait}.vjs-download-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-download-button.has-icon-file-download .vjs-icon-placeholder:before{content:"\f110"}.vjs-download-button.has-icon-downloading .vjs-icon-placeholder:before{content:"\f10f"}.vjs-download-button.has-icon-file-download-off .vjs-icon-placeholder:before{content:"\f112"}.vjs-modal-dialog.vjs-player-info-modal{background:rgba(0,0,0,.9)}.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{overflow:auto;display:grid;grid-template-columns:1fr 1fr;grid-gap:1em}@media screen and (max-width:640px){.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-modal-dialog.vjs-player-info-modal h2{font-size:1.1667em;margin:0 0 .4286em}.vjs-modal-dialog.vjs-player-info-modal table{border-bottom:1px solid #333;border-collapse:collapse;border-top:1px solid #333;margin-bottom:1.5em;width:100%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-two td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-two th{width:50%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-three td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-three th{width:33.333%}.vjs-modal-dialog.vjs-player-info-modal th{font-weight:400;text-align:left}.vjs-modal-dialog.vjs-player-info-modal td{border-bottom:1px solid #333;opacity:.5}.vjs-modal-dialog.vjs-player-info-modal tr:last-child td{border-bottom:0}.vjs-modal-dialog.vjs-player-info-modal tr:hover td{opacity:1}/*! @name videojs-contextmenu-ui @version 6.0.0 @license Apache-2.0 */.vjs-contextmenu-ui-menu{position:absolute}.vjs-contextmenu-ui-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;padding:.25em}.vjs-contextmenu-ui-menu .vjs-menu-item{border-radius:.3em;cursor:pointer;margin:0 0 1px;padding:.5em 1em;font-size:1em;line-height:1.2;text-transform:none}.vjs-contextmenu-ui-menu .vjs-menu-item:active,.vjs-contextmenu-ui-menu .vjs-menu-item:hover{background-color:rgba(0,0,0,.5);text-shadow:0 0 1em #fff}/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-errors-flashmessage{float:right;font-size:9px;font-style:italic}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}.vjs-xs.vjs-errors-flashmessage{display:none}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message,.vjs-errors-flashmessage{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}.vjs-errors-ref-id{color:rgba(255,255,255,.5);font-size:.75em;margin:.5em 0 0}.bc-player-XvkzQ10d0_default .vjs-control-bar{background-color:rgba(0,0,0,.6);color:#fff}.bc-player-XvkzQ10d0_default .vjs-control{color:inherit}.bc-player-XvkzQ10d0_default .vjs-mouse-display:after,.bc-player-XvkzQ10d0_default .vjs-play-progress:after{border-radius:0}.bc-player-XvkzQ10d0_default .vjs-menu-button-inline:hover,.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-menu-button-inline{width:8.35em}.bc-player-XvkzQ10d0_default .vjs-control:focus:before,.bc-player-XvkzQ10d0_default .vjs-control:hover:before{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff}.bc-player-XvkzQ10d0_default .vjs-spacer{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1 1 auto;-moz-box-flex:1 1 auto;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.bc-player-XvkzQ10d0_default .vjs-time-control{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:0 1 auto;-moz-box-flex:0 1 auto;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;width:auto}.bc-player-XvkzQ10d0_default .vjs-time-control.vjs-time-divider{width:14px}.bc-player-XvkzQ10d0_default .vjs-time-control.vjs-time-divider div{width:100%;text-align:center}.bc-player-XvkzQ10d0_default .vjs-time-control.vjs-current-time{margin-left:1em}.bc-player-XvkzQ10d0_default .vjs-time-control .vjs-current-time-display,.bc-player-XvkzQ10d0_default .vjs-time-control .vjs-duration-display{width:100%}.bc-player-XvkzQ10d0_default .vjs-time-control .vjs-current-time-display{text-align:right}.bc-player-XvkzQ10d0_default .vjs-time-control .vjs-duration-display{text-align:left}.bc-player-XvkzQ10d0_default .vjs-remaining-time{display:none}.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-time-control.vjs-remaining-time{display:none}.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-XvkzQ10d0_default .vjs-play-progress,.bc-player-XvkzQ10d0_default .vjs-volume-level{background-color:#08088c}.bc-player-XvkzQ10d0_default.vjs-ad-playing .vjs-play-progress,.bc-player-XvkzQ10d0_default.vjs-ad-playing .vjs-volume-level{background-color:#ffe400}.bc-player-XvkzQ10d0_default .vjs-play-progress:before,.bc-player-XvkzQ10d0_default .vjs-volume-level:before{display:none}.bc-player-XvkzQ10d0_default .vjs-volume-level:after{display:none}.bc-player-XvkzQ10d0_default .vjs-progress-control{position:absolute;left:0;right:0;width:100%;height:1.5em;top:-1.5em}.bc-player-XvkzQ10d0_default .vjs-progress-control .vjs-load-progress,.bc-player-XvkzQ10d0_default .vjs-progress-control .vjs-play-progress,.bc-player-XvkzQ10d0_default .vjs-progress-control .vjs-progress-holder{height:100%}.bc-player-XvkzQ10d0_default .vjs-progress-control .vjs-progress-holder{margin:0}.bc-player-XvkzQ10d0_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-XvkzQ10d0_default .vjs-control-bar:not(.vjs-focus-within){-webkit-transition:-webkit-transform .1s ease 0s;-moz-transition:-moz-transform .1s ease 0s;-ms-transition:-ms-transform .1s ease 0s;-o-transition:-o-transform .1s ease 0s;transition:transform .1s ease 0s}.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible){visibility:visible;opacity:1;-webkit-backface-visibility:hidden;-webkit-transform:translateY(3em);-moz-transform:translateY(3em);-ms-transform:translateY(3em);-o-transform:translateY(3em);transform:translateY(3em);-webkit-transition:-webkit-transform 1s ease 0s;-moz-transition:-moz-transform 1s ease 0s;-ms-transition:-ms-transform 1s ease 0s;-o-transition:-o-transform 1s ease 0s;transition:transform 1s ease 0s}.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control{height:.3em;top:-.3em;pointer-events:none;-webkit-transition:height 1s,top 1s;-moz-transition:height 1s,top 1s;-ms-transition:height 1s,top 1s;-o-transition:height 1s,top 1s;transition:height 1s,top 1s}.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-volume-vertical,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-volume-vertical,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-volume-vertical,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu-item,.bc-player-XvkzQ10d0_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-XvkzQ10d0_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu{opacity:1}.bc-player-XvkzQ10d0_default.vjs-live .vjs-live-control{margin-left:1em}.bc-player-XvkzQ10d0_default.vjs-live .vjs-time-control.vjs-current-time,.bc-player-XvkzQ10d0_default.vjs-live .vjs-time-control.vjs-duration,.bc-player-XvkzQ10d0_default.vjs-live .vjs-time-control.vjs-time-divider{display:none}.bc-player-XvkzQ10d0_default .vjs-big-play-button{top:50%;left:50%;margin-left:-1em;margin-top:-1em;width:2em;height:2em;line-height:2em;border:none;border-radius:50%;font-size:3.5em;background-color:rgba(0,0,0,.45);color:#fff;-webkit-transition:border-color .4s,outline .4s,background-color .4s;-moz-transition:border-color .4s,outline .4s,background-color .4s;-ms-transition:border-color .4s,outline .4s,background-color .4s;-o-transition:border-color .4s,outline .4s,background-color .4s;transition:border-color .4s,outline .4s,background-color .4s}.bc-player-XvkzQ10d0_default .vjs-big-play-button:active,.bc-player-XvkzQ10d0_default .vjs-big-play-button:focus,.bc-player-XvkzQ10d0_default:active .vjs-big-play-button,.bc-player-XvkzQ10d0_default:hover .vjs-big-play-button{background-color:#08088c}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu{left:-3em}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:transparent;width:12em;left:-1.5em;padding-bottom:.5em}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item,.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-title{background-color:#151b17;margin:.3em 0;padding:.5em;border-radius:.3em}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected{background-color:#08088c;color:#fff}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:active,.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus,.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:hover{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff;color:#fff}.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus:not(.vjs-selected){background-color:#151b17}.bc-player-XvkzQ10d0_default.vjs-ad-playing .vjs-mouse-display,.bc-player-XvkzQ10d0_default.vjs-ad-playing .vjs-mouse-display:after{display:none}.bc-player-XvkzQ10d0_default.vjs-ad-playing.vjs-ad-playing .vjs-progress-control:after{pointer-events:auto;width:100%;height:100%;position:absolute;left:0;bottom:0;content:" ";user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.bc-player-XvkzQ10d0_default.vjs-ad-playing .vjs-picture-in-picture-control{display:none}.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-spacer{display:table-cell}.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-XvkzQ10d0_default.vjs-no-flex .vjs-remaining-time{display:none}.vjs-mouse.bc-player-XvkzQ10d0_default .vjs-control-bar{font-size:10px}.vjs-mouse.bc-player-XvkzQ10d0_default .vjs-progress-control{height:.5em;top:-.5em}.vjs-mouse.bc-player-XvkzQ10d0_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-XvkzQ10d0_default select{width:inherit}.bc-player-XvkzQ10d0_default.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.bc-player-XvkzQ10d0_default.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:block}.bc-player-XvkzQ10d0_default .vjs-title-bar{line-height:1.5;padding-top:1em}.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:active,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:focus,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-glow:active .vjs-big-play-button,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-glow:hover .vjs-big-play-button{box-shadow:0 0 15px 3px #fff;background-color:rgba(0,0,0,.45)}.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:active,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:focus,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-darken:active .vjs-big-play-button,.bc-player-XvkzQ10d0_default.video-js.vjs-play-button-hover-darken:hover .vjs-big-play-button{background-color:rgba(0,0,0,.85)}.bc-player-XvkzQ10d0_default.vjs-play-button-shape-square .vjs-big-play-button{border-radius:11px;height:2em;width:2em;margin-left:-1em;margin-top:-1em}.bc-player-XvkzQ10d0_default.vjs-play-button-shape-rectangle .vjs-big-play-button{border-radius:21px;height:2em;width:3em;margin-left:-1.5em;margin-top:-1em}.bc-player-XvkzQ10d0_default.vjs-play-button-position-top-left .vjs-big-play-button{margin:0;left:17px;top:17px}.bc-player-XvkzQ10d0_default.vjs-play-button-position-top-right .vjs-big-play-button{margin:0;right:17px;left:auto;top:17px}.bc-player-XvkzQ10d0_default .vjs-big-play-button,.bc-player-XvkzQ10d0_default .vjs-big-play-state.vjs-play-control.vjs-control,.bc-player-XvkzQ10d0_default .vjs-control-bar{background-color:rgba(0,0,0,.45)}.bc-player-XvkzQ10d0_default .vjs-big-play-button,.bc-player-XvkzQ10d0_default .vjs-big-play-state,.bc-player-XvkzQ10d0_default .vjs-control-bar{color:#fff}.bc-iframe .vjs-playlist-sidebar .vjs-playlist-show-hide button:hover,.bc-player-XvkzQ10d0_default .vjs-big-play-button:active,.bc-player-XvkzQ10d0_default .vjs-big-play-button:focus,.bc-player-XvkzQ10d0_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected,.bc-player-XvkzQ10d0_default .vjs-play-progress,.bc-player-XvkzQ10d0_default .vjs-volume-level,.bc-player-XvkzQ10d0_default:active .vjs-big-play-button,.bc-player-XvkzQ10d0_default:hover .vjs-big-play-button{background-color:rgba(0,0,0,0)}.bc-player-XvkzQ10d0_default.vjs-audio-mode.vjs-has-started.vjs-focus-within.video-js.video-js.video-js .vjs-control-bar,.bc-player-XvkzQ10d0_default.vjs-audio-mode.vjs-has-started.vjs-user-active.video-js.video-js.video-js .vjs-control-bar:not(.vjs-focus-within),.bc-player-XvkzQ10d0_default.vjs-audio-mode.vjs-has-started.vjs-user-inactive.video-js.video-js.video-js .vjs-control-bar{opacity:1;visibility:visible;transform:none}.bc-player-XvkzQ10d0_default.vjs-audio-only-mode .vjs-poster{display:none}.bc-player-XvkzQ10d0_default.vjs-audio-only-mode .vjs-progress-control{height:1.5em;top:-1.5em}.vjs-bumper-video .vjs-play-progress.vjs-play-progress-resetting{transition:width 0s linear}.vjs-bumper-video .vjs-dock-text{display:none}.vjs-social-overlay{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:10px;letter-spacing:1px}.vjs-social-overlay .vjs-icon-facebook{background-color:#3b5998}.vjs-social-overlay .vjs-icon-facebook:not(:focus-visible){background-color:#3b5998}.vjs-social-overlay .vjs-icon-gplus{background-color:#d53326}.vjs-social-overlay .vjs-icon-gplus:not(:focus-visible){background-color:#d53326}.vjs-social-overlay .vjs-icon-linkedin{background-color:#069}.vjs-social-overlay .vjs-icon-linkedin:not(:focus-visible){background-color:#069}.vjs-social-overlay .vjs-icon-twitter{background-color:#55acee}.vjs-social-overlay .vjs-icon-twitter:not(:focus-visible){background-color:#55acee}.vjs-social-overlay .vjs-icon-tumblr{background-color:#29364b}.vjs-social-overlay .vjs-icon-tumblr:not(:focus-visible){background-color:#29364b}.vjs-social-overlay .vjs-icon-pinterest{background-color:#c10218}.vjs-social-overlay .vjs-icon-pinterest:not(:focus-visible){background-color:#c10218}.vjs-social-overlay a{color:#fff}.vjs-social-overlay .vjs-social-description,.vjs-social-overlay .vjs-social-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-social-overlay .vjs-social-title{font-size:1.25em;font-weight:700;line-height:1.33333;margin-bottom:.33333em}.vjs-social-overlay .vjs-social-description{font-size:1em;font-weight:400;line-height:1.5;margin-bottom:1em}.vjs-social-overlay .vjs-social-share-links{margin:-.33333em 0 .66667em -.28333em;overflow:auto}.vjs-social-overlay .vjs-social-share-link{border-radius:2px;float:left;font-size:1.16667em;line-height:1.07143;margin:.33571em .28571em;padding:.42857em;text-decoration:none}.vjs-social-overlay .vjs-social-direct-link,.vjs-social-overlay .vjs-social-embed-code,.vjs-social-overlay .vjs-social-start-from{float:left;margin-bottom:.66667em}.vjs-social-overlay .vjs-social-direct-link .vjs-social-label-text,.vjs-social-overlay .vjs-social-embed-code .vjs-social-label-text,.vjs-social-overlay .vjs-social-start-from .vjs-social-label-text{display:block;margin-bottom:.16667em}.vjs-social-overlay .vjs-social-direct-link input,.vjs-social-overlay .vjs-social-embed-code input,.vjs-social-overlay .vjs-social-start-from input{border:0;color:#333;display:block;font-size:1em;padding:.5em .66667em;width:100%}.vjs-social-overlay .vjs-social-direct-link input.vjs-invalid,.vjs-social-overlay .vjs-social-embed-code input.vjs-invalid,.vjs-social-overlay .vjs-social-start-from input.vjs-invalid{background-color:red;color:#fff}.vjs-social-overlay .vjs-social-direct-link{padding-right:24px;width:80%}.vjs-social-overlay .vjs-social-start-from{width:20%}.vjs-social-overlay .vjs-social-embed-code{margin-bottom:.33333em;width:100%}.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart{border:0;cursor:pointer;display:block;font-size:4em;margin:0 auto;outline:0;padding:0}.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart:focus:before,.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart:hover:before{text-shadow:1px -1px 20px #fff,-1px 1px 20px #fff}.vjs-social-overlay.vjs-social-as-endscreen.vjs-social-short-player .vjs-social-description{display:none}.vjs-social-overlay .vjs-control.vjs-close-button{height:4.5em;top:0;width:4.5em}.vjs-social-overlay .vjs-control.vjs-close-button .vjs-icon-placeholder:before{line-height:2.5}.vjs-title-bar .vjs-title-bar-description,.vjs-title-bar .vjs-title-bar-title{padding-right:25%}.vjs-button.vjs-share-control{cursor:pointer;font-weight:700}.vjs-button.vjs-share-control:hover{text-shadow:0 0 1em rgba(255,255,255,.5),0 0 1em rgba(255,255,255,.5),0 0 1em rgba(255,255,255,.5)}.vjs-title-bar .vjs-button.vjs-share-control{pointer-events:auto;position:absolute;right:0;top:0;padding:1em}.vjs-title-bar .vjs-button.vjs-share-control:before{vertical-align:top;font-family:VideoJS;font-weight:400;font-style:normal;content:"\f10f"}.vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before{content:none}.vjs-title-bar .vjs-button.vjs-share-control span{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;vertical-align:top;text-decoration:underline;margin-left:2px}.vjs-button.vjs-share-control:before{content:none}.vjs-button.vjs-share-control .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal;content:"\f10f"}.vjs-v6 .vjs-button.vjs-share-control:before,.vjs-v7 .vjs-button.vjs-share-control:before{content:none}.vjs-v6 .vjs-button.vjs-share-control .vjs-icon-placeholder:before,.vjs-v7 .vjs-button.vjs-share-control .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal;content:"\f10f"}.vjs-v6 .vjs-title-bar .vjs-button.vjs-share-control:before,.vjs-v7 .vjs-title-bar .vjs-button.vjs-share-control:before{content:"\f10f"}.vjs-v6 .vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before,.vjs-v7 .vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before{content:none}.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-button.vjs-share-control,.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-button.vjs-share-control{display:none}.vjs-layout-small .vjs-social-overlay .vjs-social-direct-link,.vjs-layout-tiny .vjs-social-overlay .vjs-social-direct-link,.vjs-layout-x-small .vjs-social-overlay .vjs-social-direct-link,.vjs-social-small .vjs-social-overlay .vjs-social-direct-link{width:100%;padding-right:0}.vjs-layout-small .vjs-social-overlay .vjs-social-start-from,.vjs-layout-tiny .vjs-social-overlay .vjs-social-start-from,.vjs-layout-x-small .vjs-social-overlay .vjs-social-start-from,.vjs-social-small .vjs-social-overlay .vjs-social-start-from{width:100%}.vjs-layout-small .vjs-social-overlay .vjs-social-embed-code,.vjs-layout-tiny .vjs-social-overlay .vjs-social-embed-code,.vjs-layout-x-small .vjs-social-overlay .vjs-social-embed-code,.vjs-social-small .vjs-social-overlay .vjs-social-embed-code{margin-bottom:2em}.video-container{margin-bottom:10px}.video-container:after{display:block;content:'';clear:both}.modal-video .video-container{margin-bottom:0}.video-container.video-playlist-right .video-player-wrapper{position:relative}.video-container.video-playlist-right .video-player-wrapper{width:65%;float:left}.video-container.video-playlist-right .video-playlist-wrapper{width:35%;float:left}.video-container .brightcove-container{display:block;position:relative}.video-container .brightcove-container:after{content:'';padding-top:56.25%;display:block}.video-container .brightcove-container .video-js{position:absolute;top:0;bottom:0;right:0;left:0;width:100%;height:100%}.vjs-player-info.vjs-playlist{font-size:11px;line-height:16pt}.brightcoveplaylist ol{margin:0;padding:0}.vjs-player-info.vjs-playlist{background-color:#f3f3f3;color:#dcdcdc;min-width:100%;padding:0;margin:0}.vjs-player-info.vjs-playlist li.vjs-playlist-item{padding-right:12px;margin-bottom:0;background:#fff;border-right:1px #dcdcdc solid;border-bottom:1px #dcdcdc solid;border-left:1px #dcdcdc solid}.vjs-player-info.vjs-playlist li.vjs-playlist-item:first-child{border-top:1px #dcdcdc solid}.vjs-player-info.vjs-playlist cite{height:initial;font-size:11px;line-height:16px;font-weight:700;padding-top:4px;color:#1e8ae7}.vjs-player-info.vjs-playlist .vjs-playlist-description{height:initial;white-space:normal;font-size:11px;line-height:11pt;color:#737373;margin:0;display:block;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.vjs-player-info.vjs-playlist .vjs-playlist-thumbnail{margin-right:12px;width:90px;overflow:hidden}.vjs-player-info.vjs-playlist .vjs-playlist-thumbnail img{width:121px;margin-left:-15px;max-width:none}.vjs-player-info.vjs-playlist time{display:none}.vjs-player-info.vjs-playlist li.vjs-playlist-item:hover{background:#eee}.vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected{background:#eee}.vjs-player-info.vjs-playlist .vjs-selected .vjs-playlist-thumbnail:before{content:"";left:0;top:0;background-color:transparent}.vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected:hover .vjs-playlist-thumbnail:before{border:none}.vjs-player-info.vjs-playlist li.vjs-playlist-item:hover .vjs-playlist-thumbnail:before{height:2.5em;width:2.5em;margin-left:-15px;color:rgba(255,255,255,.75);background-color:transparent;border:.19999em solid rgba(255,255,255,.75);-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.video-js.vjs-player-info{font-size:10px;color:#555759}.vjs-player-info.vjs-has-started.vjs-user-inactive .vjs-progress-control{transform:none!important}.video-js.vjs-controls-enabled.vjs-paused .vjs-big-play-button span.vjs-icon-placeholder::before{display:none}.video-js.vjs-player-info div.vjs-progress-holder{padding:0;border-radius:10px}.video-js.vjs-player-info .vjs-play-progress{margin-top:0!important}.vjs-progress-control.vjs-control{position:relative!important;top:0!important;margin-left:15px!important;height:auto!important}.video-js.vjs-player-info .vjs-control-bar{display:flex!important;opacity:1!important;transform:none!important}button:focus,div:focus,li:focus{outline:0}.vjs-modal-dialog .vjs-modal-dialog-content{color:#fff;text-align:left}.vjs-modal-dialog .vjs-icon-placeholder{color:#fff}.vjs-social-overlay .vjs-modal-dialog-content .vjs-social-direct-link{padding-right:0;width:100%}.brightcove-container .video-js .vjs-modal-dialog{background:rgba(0,0,0,.8)}.vjs-modal-dialog .vjs-modal-dialog-content h1{font-weight:300}.vjs-modal-dialog-content .vjs-social-direct-link .vjs-social-label-text,.vjs-modal-dialog-content .vjs-social-embed-code .vjs-social-label-text{font-weight:400}.vjs-volume-control.vjs-control.vjs-volume-vertical{width:23px!important;height:107px!important;padding:10px 0;overflow:visible;margin:-27px 0 0 3px;background-color:rgba(238,238,238,.5);color:#555759;display:flex!important}.vjs-volume-bar.vjs-slider-bar.vjs-slider.vjs-slider-vertical{background:#555759!important;padding:0;margin-top:2px!important;width:10px;height:87px}.video-js.vjs-player-info .vjs-volume-level{width:10px;padding-top:10px;margin:0}.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-control{display:block}.video-js.vjs-player-info:hover .vjs-big-play-button,.video-js.vjs-player-info:hover .vjs-big-play-button:before{border-color:rgba(255,255,255,.85);box-shadow:none}.video-js .vjs-big-play-button{background:url('https://www.thermofisher.com/content/dam/LifeTech/components/video/play-lg.png') no-repeat;font-size:5em;background-color:transparent;line-height:1.3em;border-radius:50%;left:50%;top:50%;width:75px;height:75px;margin-left:-37.5px;margin-top:-37.5px}.video-js.vjs-player-info .vjs-big-play-button:before{position:initial;color:transparent;font-size:inherit;line-height:inherit;margin:.09999em auto;text-align:center;width:initial}.video-js.vjs-player-info .vjs-control-bar,.video-js.vjs-player-info .vjs-menu-button .vjs-menu-content{color:#555759;background-color:#eee;filter:none}.video-js.vjs-player-info .vjs-menu-button .vjs-menu-content{background-color:rgba(238,238,238,.5)}.video-js .vjs-menu.vjs-contextmenu-ui-menu{display:none}.video-js.vjs-player-info .vjs-slider-bar,.video-js.vjs-player-info .vjs-volume-level{background:#555759;min-width:11.5%;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;border-radius:10px}.video-js.vjs-player-info .vjs-volume-bar{height:3px;padding:6px 0 6px;position:relative}.video-js.vjs-player-info .vjs-progress-holder:before,.video-js.vjs-player-info .vjs-volume-bar:before{height:10px;box-shadow:none;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;border-radius:10px}.video-js.vjs-player-info .vjs-progress-holder:before{background-color:rgba(112,109,109,.3)}.video-js.vjs-player-info .vjs-load-progress,.video-js.vjs-player-info .vjs-volume-bar:before{background:#555759}.video-js.vjs-player-info .vjs-play-progress{margin-top:-10px;background:#ee3134;background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:10px 10px;background-size:10px 10px;-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.video-js.vjs-player-info .vjs-volume-handle{background-color:#eee;width:1em;height:1em;margin-top:6px;left:88.5%;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.video-js.vjs-player-info .vjs-slider-handle{position:absolute;top:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.video-js.vjs-player-info .vjs-seek-handle.vjs-slider-handle:before{background:url('https://www.thermofisher.com/content/dam/LifeTech/components/video/play-lg.png') no-repeat;content:"";font-size:1em;background-color:#eee;border:1px solid #555759;width:1.25em;height:1.25em;text-shadow:0 0 1em #fff;position:absolute;top:1.1em;left:-.5em;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.vjs-volume-bar.vjs-slider-vertical.vjs-slider-vertical{background:0 0!important}.video-js.vjs-player-info .vjs-volume-level{background:#eee!important}.video-js.vjs-player-info .vjs-progress-holder{padding:13px 0 5px;height:10px}.video-js.vjs-player-info .vjs-load-progress,.video-js.vjs-player-info .vjs-play-progress{height:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;border-radius:10px}.video-js.vjs-player-info .vjs-play-progress{margin-top:-10px;min-width:auto}.video-js.vjs-player-info .vjs-control-bar .vjs-play-control{border-right:1px solid #c8c8c8}.video-js.vjs-player-info .vjs-control-bar .vjs-progress-control{border-right:1px solid #c8c8c8;padding-right:10px}.video-js.vjs-player-info .vjs-control-bar .vjs-control:before{color:#555759}.video-js.vjs-player-info .vjs-control-bar .vjs-control:hover:before{color:#333}ul.vjs-share-options li a,ul.vjs-share-options li a:active,ul.vjs-share-options li a:hover,ul.vjs-share-options li a:visited{color:#fff}.vjs-social-overlay{padding:20px}.vjs-social-overlay input[readonly]{cursor:pointer}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.video-playlist-right .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail:before{content:'\e001';border-radius:5px;font-family:VideoJS;height:34px;left:40.5px;line-height:34px;top:17px;width:40px}.video-playlist-right .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail:before{height:2.5em;width:2.5em;margin-left:-15px;color:rgba(255,255,255,.75);background-color:transparent;border:.19999em solid rgba(255,255,255,.75);-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.video-playlist-right .vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected .vjs-playlist-thumbnail:before,.video-playlist-right .vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected:hover .vjs-playlist-thumbnail:before{content:' ';border:none}.video-playlist-right .video-description p.playlist-description{-webkit-line-clamp:2!important}.video-playlist-right .vjs-player-info.vjs-playlist .vjs-playlist-description{max-height:46px}.video-playlist-right .vjs-social-overlay{padding:10px 70px}.video-playlist-right .vjs-social-overlay legend{display:none}.video-playlist-bottom .playlist-wrapper{border:1px #dcdcdc solid}.video-playlist-bottom .vjs-player-info.vjs-playlist{margin:0;width:auto;overflow:auto;overflow-x:scroll;overflow-y:hidden;-ms-overflow-y:hidden;white-space:nowrap;max-height:220px}.video-playlist-bottom .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail{margin-right:0;width:183px;height:103px}.video-playlist-bottom .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail img{width:183px;height:103px;margin-left:0}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item{display:table-cell;width:183px;word-break:break-word;height:210px;padding-right:0;border-top:1px #dcdcdc solid;border-left:none;border-right:1px #dcdcdc solid}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item:first-child{border-left:1px #dcdcdc solid}.video-playlist-bottom .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail:before,.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected .vjs-playlist-thumbnail:before{width:183px;height:103px}.video-playlist-bottom .vjs-player-info.vjs-playlist .vjs-playlist-thumbnail:before,.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item:hover .vjs-playlist-thumbnail:before{content:"";left:0;top:0;width:183px;height:103px;background:url('https://www.thermofisher.com/content/dam/LifeTech/components/video/play-video-thumbnail.png') 0 0 no-repeat;background-size:100% 100%;margin-left:0;border:none}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected .vjs-playlist-thumbnail:before,.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item.vjs-selected:hover .vjs-playlist-thumbnail:before{background:0 0}.video-playlist-bottom .vjs-player-info.vjs-playlist cite{width:153px;padding-left:15px;padding-right:15px;text-overflow:ellipsis}.video-playlist-bottom .vjs-player-info.vjs-playlist .vjs-playlist-description{padding-left:15px;width:153px;height:54pt;-webkit-line-clamp:5}.video-playlist-bottom .video-description cite.playlist-name{padding:6px 15px 0!important;-webkit-line-clamp:5!important}.video-playlist-bottom .video-description p.playlist-description{padding:0 15px!important;-webkit-line-clamp:5!important}.video-playlist-bottom .video-description p.playlist-cta{padding:0 15px!important}.bc-iframe .vjs-playlist{display:none!important}.bc-iframe .video-js{display:block!important;float:none!important;width:100%!important}.vjs-player-info .vjs-text-track-display>div{margin-right:0!important;margin-bottom:0!important;margin-left:0!important}.vjs-player-info .vjs-text-track-display>div>div{width:auto}.vjs-player-info .vjs-text-track-display>div>div>div{display:block!important;background-color:rgba(0,0,0,.6)!important;padding-top:10px;padding-bottom:10px}.video-js.vjs-player-info .vjs-control-bar .vjs-subtitles-button:before,.vjs-player-info .vjs-subtitles-button:before,.vjs-subtitles-button:before{content:'\e008'!important}.video-js .vjs-progress-holder .vjs-load-progress div{border-radius:10px}.video-js:not(.vjs-has-started) .vjs-control-bar .vjs-progress-control .vjs-progress-holder .vjs-load-progress{width:auto!important}.modal.modal-video{max-width:100%}.video-js .vjs-dock-text{display:none}.video-js .vjs-loading-spinner{border-color:rgba(255,255,255,.15)}.video-container .brightcove-container .video-js .vjs-current-time,.video-container .brightcove-container .video-js .vjs-duration,.video-container .brightcove-container .video-js .vjs-time-divider{display:flex}.video-container .brightcove-container .video-js .vjs-current-time{margin-left:0}@media screen and (max-width:979px){.video-js .vjs-volume-panel.vjs-volume-panel-vertical{display:none}}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:hidden!important}@media screen and (max-width:767px){.video-container.video-playlist-right .video-player-wrapper,.video-container.video-playlist-right .video-playlist-wrapper{width:auto;float:none}.video-playlist-bottom .vjs-player-info.vjs-playlist{overflow:auto}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item{display:block;width:auto;height:68px;padding-right:0;margin-bottom:0;background:#fff;border-right:1px #dcdcdc solid;border-bottom:1px #dcdcdc solid;border-left:1px #dcdcdc solid}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item .vjs-playlist-thumbnail{background-color:#a6a6a6;display:block;float:left;margin-right:0;width:90px;overflow:hidden;font-size:13px}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item .vjs-playlist-thumbnail:before{content:'\e001';border-radius:5px;font-family:VideoJS;height:34px;left:40.5px;line-height:34px;top:17px;width:40px;height:2.5em;width:2.5em;margin-left:-15px;color:rgba(255,255,255,.75);background-color:transparent;border:.19999em solid rgba(255,255,255,.75);-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item cite{font-size:11px;line-height:16px;font-weight:700;padding-top:4px;color:#1e8ae7;display:block;width:auto}.video-playlist-bottom .vjs-player-info.vjs-playlist li.vjs-playlist-item .vjs-playlist-description{height:initial;white-space:normal;font-size:11px;line-height:11pt;color:#737373;margin:0;display:block;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;width:auto}.vjs-player-info.vjs-playlist{max-height:220px!important}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.vjs-control.vjs-mute-control{width:3em}.video-container .brightcove-container .video-js .vjs-current-time{padding-right:20px}.vjs-button.vjs-share-control{display:none}}@media screen and (max-width:480px){.video-js:not(.vjs-has-started) .vjs-control-bar{visibility:hidden!important}}.unsuppported-videoplayer{box-sizing:border-box;border:1px solid #ccc;border-left-color:#e71316;border-left-width:8px;display:block;width:100%;max-width:700px;color:#54545c;padding:10px;text-align:left;margin:10px 0}.brightcoveplayer-ie{display:none}.unsuppported-videoplayer .warning-triangle-icon{font-family:"icon-web-font, serif";font-size:26px;line-height:26px;float:left;background-image:url(/etc/designs/cs/brightcove/images/exclamation-triangle.png);background-repeat:no-repeat;background-position:top center;height:25px;margin-top:5px;margin-right:10px;background-size:20px 20px;width:25px;margin-left:0}.unsuppported-videoplayer .span11{display:inline;margin-left:0;padding:0;max-width:630px}.vjs-next-button.vjs-control.vjs-button{display:none} </style> </head> <body><video-js data-account="1964492303001" data-player="XvkzQ10d0" data-embed="default" data-application-id="" class="video-js vjs-default-skin" > </video-js> <script>(function(p){p.mark&&p.mark('bcParseStart')})(window.performance||{})</script> <script>(function(){var e=function e(t){return Boolean(t.IE_VERSION)};var t;try{t=function(e,t){var i=undefined;var s=e.define;var n=e.videojs;e.VIDEOJS_NO_DYNAMIC_STYLE=true;(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof i==="function"&&i.amd?i(t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojs=t())})(this,function(){"use strict";var i="8.3.0";const s={};const n=function(e,t){s[e]=s[e]||[];if(t){s[e]=s[e].concat(t)}return s[e]};const r=function(e,t){n(e,t)};const a=function(e,t){const i=n(e).indexOf(t);if(i<=-1){return false}s[e]=s[e].slice();s[e].splice(i,1);return true};const o=function(e,t){n(e,[].concat(t).map(t=>{const i=(...s)=>{a(e,i);return t(...s)};return i}))};const l={prefixed:true};const u=[["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"]];const c=u[0];let d;for(let e=0;e<u.length;e++){if(u[e][1]in t){d=u[e];break}}if(d){for(let e=0;e<d.length;e++){l[c[e]]=d[e]}l.prefixed=d[0]!==c[0]}let h=[];const f=(t,i)=>(s,n,r)=>{const a=i.levels[n];const o=new RegExp(`^(${a})$`);if(s!=="log"){r.unshift(s.toUpperCase()+":")}r.unshift(t+":");if(h){h.push([].concat(r));const e=h.length-1e3;h.splice(0,e>0?e:0)}if(!e.console){return}let l=e.console[s];if(!l&&s==="debug"){l=e.console.info||e.console.log}if(!l||!a||!o.test(s)){return}l[Array.isArray(r)?"apply":"call"](e.console,r)};function p(e){let t="info";let i;const s=function(...e){i("log",t,e)};i=f(e,s);s.createLogger=(t=>p(e+": "+t));s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};s.level=(e=>{if(typeof e==="string"){if(!s.levels.hasOwnProperty(e)){throw new Error(`"${e}" in not a valid log level`)}t=e}return t});s.history=(()=>h?[].concat(h):[]);s.history.filter=(e=>{return(h||[]).filter(t=>{return new RegExp(`.*${e}.*`).test(t[0])})});s.history.clear=(()=>{if(h){h.length=0}});s.history.disable=(()=>{if(h!==null){h.length=0;h=null}});s.history.enable=(()=>{if(h===null){h=[]}});s.error=((...e)=>i("error",t,e));s.warn=((...e)=>i("warn",t,e));s.debug=((...e)=>i("debug",t,e));return s}const m=p("VIDEOJS");const g=m.createLogger;const y=Object.prototype.toString;const _=function(e){return T(e)?Object.keys(e):[]};function v(e,t){_(e).forEach(i=>t(e[i],i))}function b(e,t,i=0){return _(e).reduce((i,s)=>t(i,e[s],s),i)}function T(e){return!!e&&typeof e==="object"}function S(e){return T(e)&&y.call(e)==="[object Object]"&&e.constructor===Object}function E(...e){const t={};e.forEach(e=>{if(!e){return}v(e,(e,i)=>{if(!S(e)){t[i]=e;return}if(!S(t[i])){t[i]={}}t[i]=E(t[i],e)})});return t}function I(e,t,i,s=true){const n=i=>Object.defineProperty(e,t,{value:i,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const e=i();n(e);return e}};if(s){r.set=n}return Object.defineProperty(e,t,r)}var k=Object.freeze({__proto__:null,each:v,reduce:b,isObject:T,isPlain:S,merge:E,defineLazyProperty:I});let C=false;let w=null;let A=false;let O;let D=false;let P=false;let x=false;let L=false;let R=null;let N=null;let M=null;let U=false;let B=false;let F=false;let j=false;const V=Boolean(z()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch));const $=e.navigator&&e.navigator.userAgentData;if($){A=$.platform==="Android";P=Boolean($.brands.find(e=>e.brand==="Microsoft Edge"));x=Boolean($.brands.find(e=>e.brand==="Chromium"));L=!P&&x;R=N=($.brands.find(e=>e.brand==="Chromium")||{}).version||null;B=$.platform==="Windows"}if(!x){const t=e.navigator&&e.navigator.userAgent||"";C=/iPod/i.test(t);w=function(){const e=t.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}();A=/Android/i.test(t);O=function(){const e=t.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}const i=e[1]&&parseFloat(e[1]);const s=e[2]&&parseFloat(e[2]);if(i&&s){return parseFloat(e[1]+"."+e[2])}else if(i){return i}return null}();D=/Firefox/i.test(t);P=/Edg/i.test(t);x=/Chrome/i.test(t)||/CriOS/i.test(t);L=!P&&x;R=N=function(){const e=t.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}();M=function(){const e=/MSIE\s(\d+)\.\d/.exec(t);let i=e&&parseFloat(e[1]);if(!i&&/Trident\/7.0/i.test(t)&&/rv:11.0/.test(t)){i=11}return i}();U=/Safari/i.test(t)&&!L&&!A&&!P;B=/Windows/i.test(t);F=/iPad/i.test(t)||U&&V&&!/iPhone/i.test(t);j=/iPhone/i.test(t)&&!F}const q=j||F||C;const H=(U||q)&&!L;var W=Object.freeze({__proto__:null,get IS_IPOD(){return C},get IOS_VERSION(){return w},get IS_ANDROID(){return A},get ANDROID_VERSION(){return O},get IS_FIREFOX(){return D},get IS_EDGE(){return P},get IS_CHROMIUM(){return x},get IS_CHROME(){return L},get CHROMIUM_VERSION(){return R},get CHROME_VERSION(){return N},get IE_VERSION(){return M},get IS_SAFARI(){return U},get IS_WINDOWS(){return B},get IS_IPAD(){return F},get IS_IPHONE(){return j},TOUCH_ENABLED:V,IS_IOS:q,IS_ANY_SAFARI:H});function G(e){return typeof e==="string"&&Boolean(e.trim())}function K(e){if(e.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function z(){return t===e.document}function Y(e){return T(e)&&e.nodeType===1}function X(){try{return e.parent!==e.self}catch(e){return true}}function Q(e){return function(i,s){if(!G(i)){return t[e](null)}if(G(s)){s=t.querySelector(s)}const n=Y(s)?s:t;return n[e]&&n[e](i)}}function J(e="div",i={},s={},n){const r=t.createElement(e);Object.getOwnPropertyNames(i).forEach(function(e){const t=i[e];if(e==="textContent"){Z(r,t)}else if(r[e]!==t||e==="tabIndex"){r[e]=t}});Object.getOwnPropertyNames(s).forEach(function(e){r.setAttribute(e,s[e])});if(n){_e(r,n)}return r}function Z(e,t){if(typeof e.textContent==="undefined"){e.innerText=t}else{e.textContent=t}return e}function ee(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function te(e,t){K(t);return e.classList.contains(t)}function ie(e,...t){e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function se(e,...t){if(!e){m.warn("removeClass was called with an element that doesn't exist");return null}e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function ne(e,t,i){if(typeof i==="function"){i=i(e,t)}if(typeof i!=="boolean"){i=undefined}t.split(/\s+/).forEach(t=>e.classList.toggle(t,i));return e}function re(e,t){Object.getOwnPropertyNames(t).forEach(function(i){const s=t[i];if(s===null||typeof s==="undefined"||s===false){e.removeAttribute(i)}else{e.setAttribute(i,s===true?"":s)}})}function ae(e){const t={};const i=","+"autoplay,controls,playsinline,loop,muted,default,defaultMuted"+",";if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let n=s.length-1;n>=0;n--){const r=s[n].name;let a=s[n].value;if(typeof e[r]==="boolean"||i.indexOf(","+r+",")!==-1){a=a!==null?true:false}t[r]=a}}return t}function oe(e,t){return e.getAttribute(t)}function le(e,t,i){e.setAttribute(t,i)}function ue(e,t){e.removeAttribute(t)}function ce(){t.body.focus();t.onselectstart=function(){return false}}function de(){t.onselectstart=function(){return true}}function he(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});if(!i.height){i.height=parseFloat(Ee(e,"height"))}if(!i.width){i.width=parseFloat(Ee(e,"width"))}return i}}function fe(e){if(!e||e&&!e.offsetParent){return{left:0,top:0,width:0,height:0}}const i=e.offsetWidth;const s=e.offsetHeight;let n=0;let r=0;while(e.offsetParent&&e!==t[l.fullscreenElement]){n+=e.offsetLeft;r+=e.offsetTop;e=e.offsetParent}return{left:n,top:r,width:i,height:s}}function pe(e,t){const i={x:0,y:0};if(q){let t=e;while(t&&t.nodeName.toLowerCase()!=="html"){const e=Ee(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4];i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12];i.y+=t[13]}t=t.parentNode}}const s={};const n=fe(t.target);const r=fe(e);const a=r.width;const o=r.height;let l=t.offsetY-(r.top-n.top);let u=t.offsetX-(r.left-n.left);if(t.changedTouches){u=t.changedTouches[0].pageX-r.left;l=t.changedTouches[0].pageY+r.top;if(q){u-=i.x;l-=i.y}}s.y=1-Math.max(0,Math.min(1,l/o));s.x=Math.max(0,Math.min(1,u/a));return s}function me(e){return T(e)&&e.nodeType===3}function ge(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function ye(e){if(typeof e==="function"){e=e()}return(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==="function"){e=e()}if(Y(e)||me(e)){return e}if(typeof e==="string"&&/\S/.test(e)){return t.createTextNode(e)}}).filter(e=>e)}function _e(e,t){ye(t).forEach(t=>e.appendChild(t));return e}function ve(e,t){return _e(ge(e),t)}function be(e){if(e.button===undefined&&e.buttons===undefined){return true}if(e.button===0&&e.buttons===undefined){return true}if(e.type==="mouseup"&&e.button===0&&e.buttons===0){return true}if(e.button!==0||e.buttons!==1){return false}return true}const Te=Q("querySelector");const Se=Q("querySelectorAll");function Ee(t,i){if(!t||!i){return""}if(typeof e.getComputedStyle==="function"){let s;try{s=e.getComputedStyle(t)}catch(e){return""}return s?s.getPropertyValue(i)||s[i]:""}return""}var Ie=Object.freeze({__proto__:null,isReal:z,isEl:Y,isInFrame:X,createEl:J,textContent:Z,prependTo:ee,hasClass:te,addClass:ie,removeClass:se,toggleClass:ne,setAttributes:re,getAttributes:ae,getAttribute:oe,setAttribute:le,removeAttribute:ue,blockTextSelection:ce,unblockTextSelection:de,getBoundingClientRect:he,findPosition:fe,getPointerPosition:pe,isTextNode:me,emptyEl:ge,normalizeContent:ye,appendContent:_e,insertContent:ve,isSingleLeftClick:be,$:Te,$$:Se,computedStyle:Ee});let ke=false;let Ce;const we=function(){if(Ce.options.autoSetup===false){return}const e=Array.prototype.slice.call(t.getElementsByTagName("video"));const i=Array.prototype.slice.call(t.getElementsByTagName("audio"));const s=Array.prototype.slice.call(t.getElementsByTagName("video-js"));const n=e.concat(i,s);if(n&&n.length>0){for(let e=0,t=n.length;e<t;e++){const t=n[e];if(t&&t.getAttribute){if(t.player===undefined){const e=t.getAttribute("data-setup");if(e!==null){Ce(t)}}}else{Ae(1);break}}}else if(!ke){Ae(1)}};function Ae(t,i){if(!z()){return}if(i){Ce=i}e.setTimeout(we,t)}function Oe(){ke=true;e.removeEventListener("load",Oe)}if(z()){if(t.readyState==="complete"){Oe()}else{e.addEventListener("load",Oe)}}const De=function(e){const i=t.createElement("style");i.className=e;return i};const Pe=function(e,t){if(e.styleSheet){e.styleSheet.cssText=t}else{e.textContent=t}};var xe=new WeakMap;const Le=3;let Re=Le;function Ne(){return Re++}function Me(e,t){if(!xe.has(e)){return}const i=xe.get(e);if(i.handlers[t].length===0){delete i.handlers[t];if(e.removeEventListener){e.removeEventListener(t,i.dispatcher,false)}else if(e.detachEvent){e.detachEvent("on"+t,i.dispatcher)}}if(Object.getOwnPropertyNames(i.handlers).length<=0){delete i.handlers;delete i.dispatcher;delete i.disabled}if(Object.getOwnPropertyNames(i).length===0){xe.delete(e)}}function Ue(e,t,i,s){i.forEach(function(i){e(t,i,s)})}function Be(i){if(i.fixed_){return i}function s(){return true}function n(){return false}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const r=i||e.event;i={};for(const e in r){if(e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"){if(!(e==="returnValue"&&r.preventDefault)){i[e]=r[e]}}}if(!i.target){i.target=i.srcElement||t}if(!i.relatedTarget){i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement}i.preventDefault=function(){if(r.preventDefault){r.preventDefault()}i.returnValue=false;r.returnValue=false;i.defaultPrevented=true};i.defaultPrevented=false;i.stopPropagation=function(){if(r.stopPropagation){r.stopPropagation()}i.cancelBubble=true;r.cancelBubble=true;i.isPropagationStopped=s};i.isPropagationStopped=n;i.stopImmediatePropagation=function(){if(r.stopImmediatePropagation){r.stopImmediatePropagation()}i.isImmediatePropagationStopped=s;i.stopPropagation()};i.isImmediatePropagationStopped=n;if(i.clientX!==null&&i.clientX!==undefined){const e=t.documentElement;const s=t.body;i.pageX=i.clientX+(e&&e.scrollLeft||s&&s.scrollLeft||0)-(e&&e.clientLeft||s&&s.clientLeft||0);i.pageY=i.clientY+(e&&e.scrollTop||s&&s.scrollTop||0)-(e&&e.clientTop||s&&s.clientTop||0)}i.which=i.charCode||i.keyCode;if(i.button!==null&&i.button!==undefined){i.button=i.button&1?0:i.button&4?1:i.button&2?2:0}}i.fixed_=true;return i}let Fe;const je=function(){if(typeof Fe!=="boolean"){Fe=false;try{const t=Object.defineProperty({},"passive",{get(){Fe=true}});e.addEventListener("test",null,t);e.removeEventListener("test",null,t)}catch(e){}}return Fe};const Ve=["touchstart","touchmove"];function $e(e,t,i){if(Array.isArray(t)){return Ue($e,e,t,i)}if(!xe.has(e)){xe.set(e,{})}const s=xe.get(e);if(!s.handlers){s.handlers={}}if(!s.handlers[t]){s.handlers[t]=[]}if(!i.guid){i.guid=Ne()}s.handlers[t].push(i);if(!s.dispatcher){s.disabled=false;s.dispatcher=function(t,i){if(s.disabled){return}t=Be(t);const n=s.handlers[t.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r;n++){if(t.isImmediatePropagationStopped()){break}else{try{s[n].call(e,t,i)}catch(e){m.error(e)}}}}}}if(s.handlers[t].length===1){if(e.addEventListener){let i=false;if(je()&&Ve.indexOf(t)>-1){i={passive:true}}e.addEventListener(t,s.dispatcher,i)}else if(e.attachEvent){e.attachEvent("on"+t,s.dispatcher)}}}function qe(e,t,i){if(!xe.has(e)){return}const s=xe.get(e);if(!s.handlers){return}if(Array.isArray(t)){return Ue(qe,e,t,i)}const n=function(e,t){s.handlers[t]=[];Me(e,t)};if(t===undefined){for(const t in s.handlers){if(Object.prototype.hasOwnProperty.call(s.handlers||{},t)){n(e,t)}}return}const r=s.handlers[t];if(!r){return}if(!i){n(e,t);return}if(i.guid){for(let e=0;e<r.length;e++){if(r[e].guid===i.guid){r.splice(e--,1)}}}Me(e,t)}function He(e,t,i){const s=xe.has(e)?xe.get(e):{};const n=e.parentNode||e.ownerDocument;if(typeof t==="string"){t={type:t,target:e}}else if(!t.target){t.target=e}t=Be(t);if(s.dispatcher){s.dispatcher.call(e,t,i)}if(n&&!t.isPropagationStopped()&&t.bubbles===true){He.call(null,n,t,i)}else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){if(!xe.has(t.target)){xe.set(t.target,{})}const e=xe.get(t.target);if(t.target[t.type]){e.disabled=true;if(typeof t.target[t.type]==="function"){t.target[t.type]()}e.disabled=false}}return!t.defaultPrevented}function We(e,t,i){if(Array.isArray(t)){return Ue(We,e,t,i)}const s=function(){qe(e,t,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Ne();$e(e,t,s)}function Ge(e,t,i){const s=function(){qe(e,t,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Ne();$e(e,t,s)}var Ke=Object.freeze({__proto__:null,fixEvent:Be,on:$e,off:qe,trigger:He,one:We,any:Ge});const ze=30;const Ye=function(e,t,i){if(!t.guid){t.guid=Ne()}const s=t.bind(e);s.guid=i?i+"_"+t.guid:t.guid;return s};const Xe=function(t,i){let s=e.performance.now();const n=function(...n){const r=e.performance.now();if(r-s>=i){t(...n);s=r}};return n};const Qe=function(t,i,s,n=e){let r;const a=()=>{n.clearTimeout(r);r=null};const o=function(){const e=this;const a=arguments;let o=function(){r=null;o=null;if(!s){t.apply(e,a)}};if(!r&&s){t.apply(e,a)}n.clearTimeout(r);r=n.setTimeout(o,i)};o.cancel=a;return o};var Je=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ze,bind_:Ye,throttle:Xe,debounce:Qe});let Ze;class et{on(e,t){const i=this.addEventListener;this.addEventListener=(()=>{});$e(this,e,t);this.addEventListener=i}off(e,t){qe(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=(()=>{});We(this,e,t);this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=(()=>{});Ge(this,e,t);this.addEventListener=i}trigger(e){const t=e.type||e;if(typeof e==="string"){e={type:t}}e=Be(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}He(this,e)}queueTrigger(t){if(!Ze){Ze=new Map}const i=t.type||t;let s=Ze.get(this);if(!s){s=new Map;Ze.set(this,s)}const n=s.get(i);s.delete(i);e.clearTimeout(n);const r=e.setTimeout(()=>{s.delete(i);if(s.size===0){s=null;Ze.delete(this)}this.trigger(t)},0);s.set(i,r)}}et.prototype.allowedEvents_={};et.prototype.addEventListener=et.prototype.on;et.prototype.removeEventListener=et.prototype.off;et.prototype.dispatchEvent=et.prototype.trigger;const tt=e=>{if(typeof e.name==="function"){return e.name()}if(typeof e.name==="string"){return e.name}if(e.name_){return e.name_}if(e.constructor&&e.constructor.name){return e.constructor.name}return typeof e};const it=e=>e instanceof et||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>typeof e[t]==="function");const st=(e,t)=>{if(it(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}};const nt=e=>typeof e==="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length;const rt=(e,t,i)=>{if(!e||!e.nodeName&&!it(e)){throw new Error(`Invalid target for ${tt(t)}#${i}; must be a DOM node or evented object.`)}};const at=(e,t,i)=>{if(!nt(e)){throw new Error(`Invalid event type for ${tt(t)}#${i}; must be a non-empty string or array.`)}};const ot=(e,t,i)=>{if(typeof e!=="function"){throw new Error(`Invalid listener for ${tt(t)}#${i}; must be a function.`)}};const lt=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n;let r;let a;if(s){n=e.eventBusEl_;if(t.length>=3){t.shift()}[r,a]=t}else{[n,r,a]=t}rt(n,e,i);at(r,e,i);ot(a,e,i);a=Ye(e,a);return{isTargetingSelf:s,target:n,type:r,listener:a}};const ut=(e,t,i,s)=>{rt(e,e,t);if(e.nodeName){Ke[t](e,i,s)}else{e[t](i,s)}};const ct={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=lt(this,e,"on");ut(i,"on",s,n);if(!t){const e=()=>this.off(i,s,n);e.guid=n.guid;const t=()=>this.off("dispose",e);t.guid=n.guid;ut(this,"on","dispose",e);ut(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=lt(this,e,"one");if(t){ut(i,"one",s,n)}else{const e=(...t)=>{this.off(i,s,e);n.apply(null,t)};e.guid=n.guid;ut(i,"one",s,e)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=lt(this,e,"any");if(t){ut(i,"any",s,n)}else{const e=(...t)=>{this.off(i,s,e);n.apply(null,t)};e.guid=n.guid;ut(i,"any",s,e)}},off(e,t,i){if(!e||nt(e)){qe(this.eventBusEl_,e,t)}else{const s=e;const n=t;rt(s,this,"off");at(n,this,"off");ot(i,this,"off");i=Ye(this,i);this.off("dispose",i);if(s.nodeName){qe(s,n,i);qe(s,"dispose",i)}else if(it(s)){s.off(n,i);s.off("dispose",i)}}},trigger(e,t){rt(this.eventBusEl_,this,"trigger");const i=e&&typeof e!=="string"?e.type:e;if(!nt(i)){throw new Error(`Invalid event type for ${tt(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return He(this.eventBusEl_,e,t)}};function dt(t,i={}){const{eventBusKey:s}=i;if(s){if(!t[s].nodeName){throw new Error(`The eventBusKey "${s}" does not refer to an element.`)}t.eventBusEl_=t[s]}else{t.eventBusEl_=J("span",{className:"vjs-event-bus"})}Object.assign(t,ct);if(t.eventedCallbacks){t.eventedCallbacks.forEach(e=>{e()})}t.on("dispose",()=>{t.off();[t,t.el_,t.eventBusEl_].forEach(function(e){if(e&&xe.has(e)){xe.delete(e)}});e.setTimeout(()=>{t.eventBusEl_=null},0)});return t}const ht={state:{},setState(e){if(typeof e==="function"){e=e()}let t;v(e,(e,i)=>{if(this.state[i]!==e){t=t||{};t[i]={from:this.state[i],to:e}}this.state[i]=e});if(t&&it(this)){this.trigger({changes:t,type:"statechanged"})}return t}};function ft(e,t){Object.assign(e,ht);e.state=Object.assign({},e.state,t);if(typeof e.handleStateChanged==="function"&&it(e)){e.on("statechanged",e.handleStateChanged)}return e}const pt=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toLowerCase())};const mt=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const gt=function(e,t){return mt(e)===mt(t)};var yt=Object.freeze({__proto__:null,toLowerCase:pt,toTitleCase:mt,titleCaseEquals:gt});var _t=typeof globalThis!=="undefined"?globalThis:typeof e!=="undefined"?e:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function bt(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Tt=bt(function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;if(t)e=t}if("number"===typeof e)return a[e];var i=String(e);var r=s[i.toLowerCase()];if(r)return r;var r=n[i.toLowerCase()];if(r)return r;if(i.length===1)return i.charCodeAt(0);return undefined}i.isEventKey=function e(t,i){if(t&&"object"===typeof t){var r=t.which||t.keyCode||t.charCode;if(r===null||r===undefined){return false}if(typeof i==="string"){var a=s[i.toLowerCase()];if(a){return a===r}var a=n[i.toLowerCase()];if(a){return a===r}}else if(typeof i==="number"){return i===r}return false}};t=e.exports=i;var s=t.code=t.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};var n=t.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":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};for(r=97;r<123;r++)s[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)s[r-48]=r;for(r=1;r<13;r++)s["f"+r]=r+111;for(r=0;r<10;r++)s["numpad "+r]=r+96;var a=t.names=t.title={};for(r in s)a[s[r]]=r;for(var o in n){s[o]=n[o]}});Tt.code;Tt.codes;Tt.aliases;Tt.names;Tt.title;class St{constructor(e,t,i){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.isDisposed_=false;this.parentComponent_=null;this.options_=E({},this.options_);t=this.options_=E(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Ne()}`}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(t.createEl!==false){this.el_=this.createEl()}if(t.className&&this.el_){t.className.split(" ").forEach(e=>this.addClass(e))}["on","off","one","any","trigger"].forEach(e=>{this[e]=undefined});if(t.evented!==false){dt(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}ft(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_=false;if(t.initChildren!==false){this.initChildren()}this.ready(i);if(t.reportTouchActivity!==false){this.enableTouchActivity()}}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e){}dispose(e={}){if(this.isDisposed_){return}if(this.readyQueue_){this.readyQueue_.length=0}this.trigger({type:"dispose",bubbles:false});this.isDisposed_=true;if(this.children_){for(let e=this.children_.length-1;e>=0;e--){if(this.children_[e].dispose){this.children_[e].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(e.restoreEl){this.el_.parentNode.replaceChild(e.restoreEl,this.el_)}else{this.el_.parentNode.removeChild(this.el_)}}this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){if(!e){return this.options_}this.options_=E(this.options_,e);return this.options_}el(){return this.el_}createEl(e,t,i){return J(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language();const n=this.player_.languages&&this.player_.languages();const r=n&&n[s];const a=s&&s.split("-")[0];const o=n&&n[a];let l=i;if(r&&r[e]){l=r[e]}else if(o&&o[e]){l=o[e]}if(t){l=l.replace(/\{(\d+)\}/g,function(e,i){const s=t[i-1];let n=s;if(typeof s==="undefined"){n=e}return n})}return l}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}return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++){t=t.getChild(e[i]);if(!t||!t.getChild){return}}return t}addChild(e,t={},i=this.children_.length){let s;let n;if(typeof e==="string"){n=mt(e);const i=t.componentClass||n;t.name=n;const r=St.getComponent(i);if(!r){throw new Error(`Component ${i} does not exist`)}if(typeof r!=="function"){return null}s=new r(this.player_||this,t)}else{s=e}if(s.parentComponent_){s.parentComponent_.removeChild(s)}this.children_.splice(i,0,s);s.parentComponent_=this;if(typeof s.id==="function"){this.childIndex_[s.id()]=s}n=n||s.name&&mt(s.name());if(n){this.childNameIndex_[n]=s;this.childNameIndex_[pt(n)]=s}if(typeof s.el==="function"&&s.el()){let e=null;if(this.children_[i+1]){if(this.children_[i+1].el_){e=this.children_[i+1].el_}else if(Y(this.children_[i+1])){e=this.children_[i+1]}}this.contentEl().insertBefore(s.el(),e)}return s}removeChild(e){if(typeof e==="string"){e=this.getChild(e)}if(!e||!this.children_){return}let t=false;for(let i=this.children_.length-1;i>=0;i--){if(this.children_[i]===e){t=true;this.children_.splice(i,1);break}}if(!t){return}e.parentComponent_=null;this.childIndex_[e.id()]=null;this.childNameIndex_[mt(e.name())]=null;this.childNameIndex_[pt(e.name())]=null;const i=e.el();if(i&&i.parentNode===this.contentEl()){this.contentEl().removeChild(e.el())}}initChildren(){const e=this.options_.children;if(e){const t=this.options_;const i=e=>{const i=e.name;let s=e.opts;if(t[i]!==undefined){s=t[i]}if(s===false){return}if(s===true){s={}}s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);if(n){this[i]=n}};let s;const n=St.getComponent("Tech");if(Array.isArray(e)){s=e}else{s=Object.keys(e)}s.concat(Object.keys(this.options_).filter(function(e){return!s.some(function(t){if(typeof t==="string"){return e===t}return e===t.name})})).map(t=>{let i;let s;if(typeof t==="string"){i=t;s=e[i]||this.options_[i]||{}}else{i=t.name;s=t}return{name:i,opts:s}}).filter(e=>{const t=St.getComponent(e.opts.componentClass||mt(e.name));return t&&!n.isTech(t)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=false){if(!e){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(e);return}if(t){e.call(this)}else{this.setTimeout(e,1)}}triggerReady(){this.isReady_=true;this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[];if(e&&e.length>0){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)}$(e,t){return Te(e,t||this.contentEl())}$$(e,t){return Se(e,t||this.contentEl())}hasClass(e){return te(this.el_,e)}addClass(...e){ie(this.el_,...e)}removeClass(...e){se(this.el_,...e)}toggleClass(e,t){ne(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 oe(this.el_,e)}setAttribute(e,t){le(this.el_,e,t)}removeAttribute(e){ue(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,true);this.height(t)}dimension(e,t,i){if(t!==undefined){if(t===null||t!==t){t=0}if((""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1){this.el_.style[e]=t}else if(t==="auto"){this.el_.style[e]=""}else{this.el_.style[e]=t+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const s=this.el_.style[e];const n=s.indexOf("px");if(n!==-1){return parseInt(s.slice(0,n),10)}return parseInt(this.el_["offset"+mt(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height"){throw new Error("currentDimension only accepts width or height value")}t=Ee(this.el_,e);t=parseFloat(t);if(t===0||isNaN(t)){const i=`offset${mt(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){if(this.player_){if(!Tt.isEventKey(e,"Tab")){e.stopPropagation()}this.player_.handleKeyDown(e)}}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let t=0;let i=null;const s=10;const n=200;let r;this.on("touchstart",function(s){if(s.touches.length===1){i={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY};t=e.performance.now();r=true}});this.on("touchmove",function(e){if(e.touches.length>1){r=false}else if(i){const t=e.touches[0].pageX-i.pageX;const n=e.touches[0].pageY-i.pageY;const a=Math.sqrt(t*t+n*n);if(a>s){r=false}}});const a=function(){r=false};this.on("touchleave",a);this.on("touchcancel",a);this.on("touchend",function(s){i=null;if(r===true){const i=e.performance.now()-t;if(i<n){s.preventDefault();this.trigger("tap")}}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity){return}const e=Ye(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e();this.clearInterval(t);t=this.setInterval(e,250)});const i=function(i){e();this.clearInterval(t)};this.on("touchmove",e);this.on("touchend",i);this.on("touchcancel",i)}setTimeout(t,i){var s;t=Ye(this,t);this.clearTimersOnDispose_();s=e.setTimeout(()=>{if(this.setTimeoutIds_.has(s)){this.setTimeoutIds_.delete(s)}t()},i);this.setTimeoutIds_.add(s);return s}clearTimeout(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_.delete(t);e.clearTimeout(t)}return t}setInterval(t,i){t=Ye(this,t);this.clearTimersOnDispose_();const s=e.setInterval(t,i);this.setIntervalIds_.add(s);return s}clearInterval(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_.delete(t);e.clearInterval(t)}return t}requestAnimationFrame(t){this.clearTimersOnDispose_();var i;t=Ye(this,t);i=e.requestAnimationFrame(()=>{if(this.rafIds_.has(i)){this.rafIds_.delete(i)}t()});this.rafIds_.add(i);return i}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e)){return}this.clearTimersOnDispose_();t=Ye(this,t);const i=this.requestAnimationFrame(()=>{t();if(this.namedRafs_.has(e)){this.namedRafs_.delete(e)}});this.namedRafs_.set(e,i);return e}cancelNamedAnimationFrame(e){if(!this.namedRafs_.has(e)){return}this.cancelAnimationFrame(this.namedRafs_.get(e));this.namedRafs_.delete(e)}cancelAnimationFrame(t){if(this.rafIds_.has(t)){this.rafIds_.delete(t);e.cancelAnimationFrame(t)}return t}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,i)=>this[t](i))});this.clearingTimersOnDispose_=false})}static registerComponent(e,t){if(typeof e!=="string"||!e){throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`)}const i=St.getComponent("Tech");const s=i&&i.isTech(t);const n=St===t||St.prototype.isPrototypeOf(t.prototype);if(s||!n){let t;if(s){t="techs must be registered using Tech.registerTech()"}else{t="must be a Component subclass"}throw new Error(`Illegal component, "${e}"; ${t}.`)}e=mt(e);if(!St.components_){St.components_={}}const r=St.getComponent("Player");if(e==="Player"&&r&&r.players){const e=r.players;const t=Object.keys(e);if(e&&t.length>0&&t.map(t=>e[t]).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}St.components_[e]=t;St.components_[pt(e)]=t;return t}static getComponent(e){if(!e||!St.components_){return}return St.components_[e]}}St.registerComponent("Component",St);function Et(e,t,i){if(typeof t!=="number"||t<0||t>i){throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}}function It(e,t,i,s){Et(e,s,i.length-1);return i[s][t]}function kt(t){let i;if(t===undefined||t.length===0){i={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{i={length:t.length,start:It.bind(null,"start",0,t),end:It.bind(null,"end",1,t)}}if(e.Symbol&&e.Symbol.iterator){i[e.Symbol.iterator]=(()=>(t||[]).values())}return i}function Ct(e,t){if(Array.isArray(e)){return kt(e)}else if(e===undefined||t===undefined){return kt()}return kt([[e,t]])}const wt=function(e,t){e=e<0?0:e;let i=Math.floor(e%60);let s=Math.floor(e/60%60);let n=Math.floor(e/3600);const r=Math.floor(t/60%60);const a=Math.floor(t/3600);if(isNaN(e)||e===Infinity){n=s=i="-"}n=n>0||a>0?n+":":"";s=((n||r>=10)&&s<10?"0"+s:s)+":";i=i<10?"0"+i:i;return n+s+i};let At=wt;function Ot(e){At=e}function Dt(){At=wt}function Pt(e,t=e){return At(e,t)}var xt=Object.freeze({__proto__:null,createTimeRanges:Ct,createTimeRange:Ct,setFormatTime:Ot,resetFormatTime:Dt,formatTime:Pt});function Lt(e,t){let i=0;let s;let n;if(!t){return 0}if(!e||!e.length){e=Ct(0,0)}for(let r=0;r<e.length;r++){s=e.start(r);n=e.end(r);if(n>t){n=t}i+=n-s}return i/t}function Rt(e){if(e instanceof Rt){return e}if(typeof e==="number"){this.code=e}else if(typeof e==="string"){this.message=e}else if(T(e)){if(typeof e.code==="number"){this.code=e.code}Object.assign(this,e)}if(!this.message){this.message=Rt.defaultMessages[this.code]||""}}Rt.prototype.code=0;Rt.prototype.message="";Rt.prototype.status=null;Rt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Rt.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(let e=0;e<Rt.errorTypes.length;e++){Rt[Rt.errorTypes[e]]=e;Rt.prototype[Rt.errorTypes[e]]=e}var Nt=Mt;function Mt(e,t){var i;var s=null;try{i=JSON.parse(e,t)}catch(e){s=e}return[s,i]}function Ut(e){return e!==undefined&&e!==null&&typeof e.then==="function"}function Bt(e){if(Ut(e)){e.then(null,e=>{})}}const Ft=function(e){const t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,s)=>{if(e[i]){t[i]=e[i]}return t},{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})});return t};const jt=function(e){const t=e.$$("track");const i=Array.prototype.map.call(t,e=>e.track);const s=Array.prototype.map.call(t,function(e){const t=Ft(e.track);if(e.src){t.src=e.src}return t});return s.concat(Array.prototype.filter.call(e.textTracks(),function(e){return i.indexOf(e)===-1}).map(Ft))};const Vt=function(e,t){e.forEach(function(e){const i=t.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(e=>i.addCue(e))}});return t.textTracks()};var $t={textTracksToJson:jt,jsonToTextTracks:Vt,trackToJson_:Ft};const qt="vjs-modal-dialog";class Ht extends St{constructor(e,t){super(e,t);this.handleKeyDown_=(e=>this.handleKeyDown(e));this.close_=(e=>this.close(e));this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=J("div",{className:`${qt}-content`},{role:"document"});this.descEl_=J("p",{className:`${qt}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});Z(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"})}dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;super.dispose()}buildCSSClass(){return`${qt} 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.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=e.controls();e.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}}opened(e){if(typeof e==="boolean"){this[e?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const e=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){e.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(e){if(typeof e==="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_;i=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=e;this.on(i,"close",this.close_)}if(!t&&i){this.off(i,"close",this.close_);this.removeChild(i);i.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl();const i=t.parentNode;const s=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(t);this.empty();ve(t,e);this.trigger("modalfill");if(s){i.insertBefore(t,s)}else{i.appendChild(t)}const n=this.getChild("closeButton");if(n){i.appendChild(n.el_)}}empty(){this.trigger("beforemodalempty");ge(this.contentEl());this.trigger("modalempty")}content(e){if(typeof e!=="undefined"){this.content_=e}return this.content_}conditionalFocus_(){const e=t.activeElement;const i=this.player_.el_;this.previouslyActiveEl_=null;if(i.contains(e)||i===e){this.previouslyActiveEl_=e;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(e){e.stopPropagation();if(Tt.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!Tt.isEventKey(e,"Tab")){return}const i=this.focusableEls_();const s=this.el_.querySelector(":focus");let n;for(let e=0;e<i.length;e++){if(s===i[e]){n=e;break}}if(t.activeElement===this.el_){n=0}if(e.shiftKey&&n===0){i[i.length-1].focus();e.preventDefault()}else if(!e.shiftKey&&n===i.length-1){i[0].focus();e.preventDefault()}}focusableEls_(){const t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,t=>{return(t instanceof e.HTMLAnchorElement||t instanceof e.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof e.HTMLInputElement||t instanceof e.HTMLSelectElement||t instanceof e.HTMLTextAreaElement||t instanceof e.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof e.HTMLIFrameElement||t instanceof e.HTMLObjectElement||t instanceof e.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable")})}}Ht.prototype.options_={pauseOnOpen:true,temporary:true};St.registerComponent("ModalDialog",Ht);class Wt extends et{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;if(!(""+t in this)){Object.defineProperty(this,t,{get(){return this.tracks_[t]}})}if(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})});if(it(e)){e.addEventListener("labelchange",e.labelchange_)}}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++){if(this[i]===e){t=this[i];if(t.off){t.off()}this.tracks_.splice(i,1);break}}if(!t){return}this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}Wt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in Wt.prototype.allowedEvents_){Wt.prototype["on"+e]=null}const Gt=function(e,t){for(let i=0;i<e.length;i++){if(!Object.keys(e[i]).length||t.id===e[i].id){continue}e[i].enabled=false}};class Kt extends Wt{constructor(e=[]){for(let t=e.length-1;t>=0;t--){if(e[t].enabled){Gt(e,e[t]);break}}super(e);this.changing_=false}addTrack(e){if(e.enabled){Gt(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.enabledChange_=(()=>{if(this.changing_){return}this.changing_=true;Gt(this,e);this.changing_=false;this.trigger("change")});e.addEventListener("enabledchange",e.enabledChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.enabledChange_){e.removeEventListener("enabledchange",e.enabledChange_);e.enabledChange_=null}}}const zt=function(e,t){for(let i=0;i<e.length;i++){if(!Object.keys(e[i]).length||t.id===e[i].id){continue}e[i].selected=false}};class Yt extends Wt{constructor(e=[]){for(let t=e.length-1;t>=0;t--){if(e[t].selected){zt(e,e[t]);break}}super(e);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++){if(this[e].selected){return e}}return-1},set(){}})}addTrack(e){if(e.selected){zt(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.selectedChange_=(()=>{if(this.changing_){return}this.changing_=true;zt(this,e);this.changing_=false;this.trigger("change")});e.addEventListener("selectedchange",e.selectedChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.selectedChange_){e.removeEventListener("selectedchange",e.selectedChange_);e.selectedChange_=null}}}class Xt extends Wt{addTrack(e){super.addTrack(e);if(!this.queueChange_){this.queueChange_=(()=>this.queueTrigger("change"))}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=(()=>this.trigger("selectedlanguagechange"))}e.addEventListener("modechange",this.queueChange_);const t=["metadata","chapters"];if(t.indexOf(e.kind)===-1){e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(e){super.removeTrack(e);if(e.removeEventListener){if(this.queueChange_){e.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class Qt{constructor(e=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++){this.addTrackElement_(e[t])}}addTrackElement_(e){const t=this.trackElements_.length;if(!(""+t in this)){Object.defineProperty(this,t,{get(){return this.trackElements_[t]}})}if(this.trackElements_.indexOf(e)===-1){this.trackElements_.push(e)}}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++){if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++){if(e===this.trackElements_[t]){if(this.trackElements_[t].track&&typeof this.trackElements_[t].track.off==="function"){this.trackElements_[t].track.off()}if(typeof this.trackElements_[t].off==="function"){this.trackElements_[t].off()}this.trackElements_.splice(t,1);break}}}}class Jt{constructor(e){Jt.prototype.setCues_.call(this,e);Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e;this.length_=e.length;const n=function(e){if(!(""+e in this)){Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})}};if(t<s){i=t;for(;i<s;i++){n.call(this,i)}}}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}const Zt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"};const ei={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"};const ti={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"};const ii={disabled:"disabled",hidden:"hidden",showing:"showing"};class si extends et{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Ne(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t){Object.defineProperty(this,e,{get(){return t[e]},set(){}})}Object.defineProperty(this,"label",{get(){return i},set(e){if(e!==i){i=e;this.trigger("labelchange")}}})}}const ni=function(i){const s=["protocol","hostname","port","pathname","search","hash","host"];const n=t.createElement("a");n.href=i;const r={};for(let e=0;e<s.length;e++){r[s[e]]=n[s[e]]}if(r.protocol==="http:"){r.host=r.host.replace(/:80$/,"")}if(r.protocol==="https:"){r.host=r.host.replace(/:443$/,"")}if(!r.protocol){r.protocol=e.location.protocol}if(!r.host){r.host=e.location.host}return r};const ri=function(e){if(!e.match(/^https?:\/\//)){const i=t.createElement("a");i.href=e;e=i.href}return e};const ai=function(e){if(typeof e==="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;const i=t.exec(e);if(i){return i.pop().toLowerCase()}}return""};const oi=function(t,i=e.location){const s=ni(t);const n=s.protocol===":"?i.protocol:s.protocol;const r=n+s.host!==i.protocol+i.host;return r};var li=Object.freeze({__proto__:null,parseUrl:ni,getAbsoluteURL:ri,getFileExtension:ai,isCrossOrigin:oi});var ui;if(typeof e!=="undefined"){ui=e}else if(typeof _t!=="undefined"){ui=_t}else if(typeof self!=="undefined"){ui=self}else{ui={}}var ci=ui;var di=bt(function(e){function t(){e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){e[s]=i[s]}}}return e},e.exports.__esModule=true,e.exports["default"]=e.exports;return t.apply(this,arguments)}e.exports=t,e.exports.__esModule=true,e.exports["default"]=e.exports});vt(di);var hi=pi;var fi=Object.prototype.toString;function pi(t){if(!t){return false}var i=fi.call(t);return i==="[object Function]"||typeof t==="function"&&i!=="[object RegExp]"||typeof e!=="undefined"&&(t===e.setTimeout||t===e.alert||t===e.confirm||t===e.prompt)}var mi=function e(t,i){if(i===void 0){i=false}return function(e,s,n){if(e){t(e);return}if(s.statusCode>=400&&s.statusCode<=599){var r=n;if(i){if(ci.TextDecoder){var a=gi(s.headers&&s.headers["content-type"]);try{r=new TextDecoder(a).decode(n)}catch(e){}}else{r=String.fromCharCode.apply(null,new Uint8Array(n))}}t({cause:r});return}t(null,n)}};function gi(e){if(e===void 0){e=""}return e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),s=i[0],n=i[1];if(s.trim()==="charset"){return n.trim()}return e},"utf-8")}var yi=mi;Ii.httpHandler=yi;var _i=function e(t){var i={};if(!t){return i}t.trim().split("\n").forEach(function(e){var t=e.indexOf(":");var s=e.slice(0,t).trim().toLowerCase();var n=e.slice(t+1).trim();if(typeof i[s]==="undefined"){i[s]=n}else if(Array.isArray(i[s])){i[s].push(n)}else{i[s]=[i[s],n]}});return i};var vi=Ii;var bi=Ii;Ii.XMLHttpRequest=ci.XMLHttpRequest||wi;Ii.XDomainRequest="withCredentials"in new Ii.XMLHttpRequest?Ii.XMLHttpRequest:ci.XDomainRequest;Ti(["get","put","post","patch","head","delete"],function(e){Ii[e==="delete"?"del":e]=function(t,i,s){i=Ei(t,i,s);i.method=e.toUpperCase();return ki(i)}});function Ti(e,t){for(var i=0;i<e.length;i++){t(e[i])}}function Si(e){for(var t in e){if(e.hasOwnProperty(t))return false}return true}function Ei(e,t,i){var s=e;if(hi(t)){i=t;if(typeof e==="string"){s={uri:e}}}else{s=di({},t,{uri:e})}s.callback=i;return s}function Ii(e,t,i){t=Ei(e,t,i);return ki(t)}function ki(e){if(typeof e.callback==="undefined"){throw new Error("callback argument missing")}var t=false;var i=function i(s,n,r){if(!t){t=true;e.callback(s,n,r)}};function s(){if(o.readyState===4){setTimeout(a,0)}}function n(){var e=undefined;if(o.response){e=o.response}else{e=o.responseText||Ci(o)}if(m){try{e=JSON.parse(e)}catch(e){}}return e}function r(e){clearTimeout(g);if(!(e instanceof Error)){e=new Error(""+(e||"Unknown XMLHttpRequest Error"))}e.statusCode=0;return i(e,y)}function a(){if(u)return;var t;clearTimeout(g);if(e.useXDR&&o.status===undefined){t=200}else{t=o.status===1223?204:o.status}var s=y;var r=null;if(t!==0){s={body:n(),statusCode:t,method:d,headers:{},url:c,rawRequest:o};if(o.getAllResponseHeaders){s.headers=_i(o.getAllResponseHeaders())}}else{r=new Error("Internal XMLHttpRequest Error")}return i(r,s,s.body)}var o=e.xhr||null;if(!o){if(e.cors||e.useXDR){o=new Ii.XDomainRequest}else{o=new Ii.XMLHttpRequest}}var l;var u;var c=o.url=e.uri||e.url;var d=o.method=e.method||"GET";var h=e.body||e.data;var f=o.headers=e.headers||{};var p=!!e.sync;var m=false;var g;var y={body:undefined,headers:{},statusCode:0,method:d,url:c,rawRequest:o};if("json"in e&&e.json!==false){m=true;f["accept"]||f["Accept"]||(f["Accept"]="application/json");if(d!=="GET"&&d!=="HEAD"){f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json");h=JSON.stringify(e.json===true?h:e.json)}}o.onreadystatechange=s;o.onload=a;o.onerror=r;o.onprogress=function(){};o.onabort=function(){u=true};o.ontimeout=r;o.open(d,c,!p,e.username,e.password);if(!p){o.withCredentials=!!e.withCredentials}if(!p&&e.timeout>0){g=setTimeout(function(){if(u)return;u=true;o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";r(e)},e.timeout)}if(o.setRequestHeader){for(l in f){if(f.hasOwnProperty(l)){o.setRequestHeader(l,f[l])}}}else if(e.headers&&!Si(e.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in e){o.responseType=e.responseType}if("beforeSend"in e&&typeof e.beforeSend==="function"){e.beforeSend(o)}o.send(h||null);return o}function Ci(e){try{if(e.responseType==="document"){return e.responseXML}var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t){return e.responseXML}}catch(e){}return null}function wi(){}vi.default=bi;const Ai=function(t,i){const s=new e.WebVTT.Parser(e,e.vttjs,e.WebVTT.StringDecoder());const n=[];s.oncue=function(e){i.addCue(e)};s.onparsingerror=function(e){n.push(e)};s.onflush=function(){i.trigger({type:"loadeddata",target:i})};s.parse(t);if(n.length>0){if(e.console&&e.console.groupCollapsed){e.console.groupCollapsed(`Text Track parsing errors for ${i.src}`)}n.forEach(e=>m.error(e));if(e.console&&e.console.groupEnd){e.console.groupEnd()}}s.flush()};const Oi=function(t,i){const s={uri:t};const n=oi(t);if(n){s.cors=n}const r=i.tech_.crossOrigin()==="use-credentials";if(r){s.withCredentials=r}vi(s,Ye(this,function(t,s,n){if(t){return m.error(t,s)}i.loaded_=true;if(typeof e.WebVTT!=="function"){if(i.tech_){i.tech_.any(["vttjsloaded","vttjserror"],e=>{if(e.type==="vttjserror"){m.error(`vttjs failed to load, stopping trying to process ${i.src}`);return}return Ai(n,i)})}}else{Ai(n,i)}}))};class Di extends si{constructor(e={}){if(!e.tech){throw new Error("A tech was not provided.")}const t=E(e,{kind:ti[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ii[t.mode]||"disabled";const s=t.default;if(t.kind==="metadata"||t.kind==="chapters"){i="hidden"}super(t);this.tech_=t.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const n=new Jt(this.cues_);const r=new Jt(this.activeCues_);let a=false;this.timeupdateHandler=Ye(this,function(e={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(a){this.trigger("cuechange");a=false}if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}});const o=()=>{this.stopTracking()};this.tech_.one("dispose",o);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(e){if(!ii[e]){return}if(i===e){return}i=e;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){Oi(this.src,this)}this.stopTracking();if(i!=="disabled"){this.startTracking()}this.trigger("modechange")}},cues:{get(){if(!this.loaded_){return null}return n},set(){}},activeCues:{get(){if(!this.loaded_){return null}if(this.cues.length===0){return r}const e=this.tech_.currentTime();const t=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];if(s.startTime<=e&&s.endTime>=e){t.push(s)}}a=false;if(t.length!==this.activeCues_.length){a=true}else{for(let e=0;e<t.length;e++){if(this.activeCues_.indexOf(t[e])===-1){a=true}}}this.activeCues_=t;r.setCues_(this.activeCues_);return r},set(){}}});if(t.src){this.src=t.src;if(!this.preload_){this.loaded_=true}if(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions"){Oi(this.src,this)}}else{this.loaded_=true}}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler);this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){if(this.rvf_){this.tech_.cancelVideoFrameCallback(this.rvf_);this.rvf_=undefined}this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(t){let i=t;if(e.vttjs&&!(t instanceof e.vttjs.VTTCue)){i=new e.vttjs.VTTCue(t.startTime,t.endTime,t.text);for(const e in t){if(!(e in i)){i[e]=t[e]}}i.id=t.id;i.originalCue_=t}const s=this.tech_.textTracks();for(let e=0;e<s.length;e++){if(s[e]!==this){s[e].removeCue(i)}}this.cues_.push(i);this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;while(t--){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1);this.cues.setCues_(this.cues_);break}}}}Di.prototype.allowedEvents_={cuechange:"cuechange"};class Pi extends si{constructor(e={}){const t=E(e,{kind:ei[e.kind]||""});super(t);let i=false;Object.defineProperty(this,"enabled",{get(){return i},set(e){if(typeof e!=="boolean"||e===i){return}i=e;this.trigger("enabledchange")}});if(t.enabled){this.enabled=t.enabled}this.loaded_=true}}class xi extends si{constructor(e={}){const t=E(e,{kind:Zt[e.kind]||""});super(t);let i=false;Object.defineProperty(this,"selected",{get(){return i},set(e){if(typeof e!=="boolean"||e===i){return}i=e;this.trigger("selectedchange")}});if(t.selected){this.selected=t.selected}}}class Li extends et{constructor(e={}){super();let t;const i=new Di(e);this.kind=i.kind;this.src=i.src;this.srclang=i.language;this.label=i.label;this.default=i.default;Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}});t=Li.NONE;i.addEventListener("loadeddata",()=>{t=Li.LOADED;this.trigger({type:"load",target:this})})}}Li.prototype.allowedEvents_={load:"load"};Li.NONE=0;Li.LOADING=1;Li.LOADED=2;Li.ERROR=3;const Ri={audio:{ListClass:Kt,TrackClass:Pi,capitalName:"Audio"},video:{ListClass:Yt,TrackClass:xi,capitalName:"Video"},text:{ListClass:Xt,TrackClass:Di,capitalName:"Text"}};Object.keys(Ri).forEach(function(e){Ri[e].getterName=`${e}Tracks`;Ri[e].privateName=`${e}Tracks_`});const Ni={remoteText:{ListClass:Xt,TrackClass:Di,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Qt,TrackClass:Li,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const Mi=Object.assign({},Ri,Ni);Ni.names=Object.keys(Ni);Ri.names=Object.keys(Ri);Mi.names=[].concat(Ni.names).concat(Ri.names);var Ui={};function Bi(e,t,i,s,n={}){const r=e.textTracks();n.kind=t;if(i){n.label=i}if(s){n.language=s}n.tech=e;const a=new Mi.text.TrackClass(n);r.addTrack(a);return a}class Fi extends St{constructor(e={},t=function(){}){e.reportTouchActivity=false;super(null,e,t);this.onDurationChange_=(e=>this.onDurationChange(e));this.trackProgress_=(e=>this.trackProgress(e));this.trackCurrentTime_=(e=>this.trackCurrentTime(e));this.stopTrackingCurrentTime_=(e=>this.stopTrackingCurrentTime(e));this.disposeSourceHandler_=(e=>this.disposeSourceHandler(e));this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",function(){this.hasStarted_=true});this.on("loadstart",function(){this.hasStarted_=false});Mi.names.forEach(t=>{const i=Mi[t];if(e&&e[i.getterName]){this[i.privateName]=e[i.getterName]}});if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(t=>{if(e[`native${t}Tracks`]===false){this[`featuresNative${t}Tracks`]=false}});if(e.nativeCaptions===false||e.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(e.nativeCaptions===true||e.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=e.preloadTextTracks!==false;this.autoRemoteTextTracks_=new Mi.text.ListClass;this.initTrackListeners();if(!e.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(e){if(!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=true;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress();this.progressInterval=this.setInterval(Ye(this,function(){const e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(e===1){this.stopTrackingProgress()}}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ct(0,0)}bufferedPercent(){return Lt(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime_);this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}dispose(){this.clearTracks(Ri.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(e){e=[].concat(e);e.forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;while(i--){const s=t[i];if(e==="text"){this.removeRemoteTextTrack(s)}t.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;while(t--){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){if(e!==undefined){this.error_=new Rt(e);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return Ct(0,0)}return Ct()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){Ri.names.forEach(e=>{const t=Ri[e];const i=()=>{this.trigger(`${e}trackchange`)};const s=this[t.getterName]();s.addEventListener("removetrack",i);s.addEventListener("addtrack",i);this.on("dispose",()=>{s.removeEventListener("removetrack",i);s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(e.WebVTT){return}if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&S(Ui)&&Object.keys(Ui).length>0){this.trigger("vttjsloaded");return}const i=t.createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";i.onload=(()=>{this.trigger("vttjsloaded")});i.onerror=(()=>{this.trigger("vttjserror")});this.on("dispose",()=>{i.onload=null;i.onerror=null});e.WebVTT=true;this.el().parentNode.appendChild(i)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const e=this.textTracks();const t=this.remoteTextTracks();const i=t=>e.addTrack(t.track);const s=t=>e.removeTrack(t.track);t.on("addtrack",i);t.on("removetrack",s);this.addWebVttScript_();const n=()=>this.trigger("texttrackchange");const r=()=>{n();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",n);if(i.mode==="showing"){i.addEventListener("cuechange",n)}}};r();e.addEventListener("change",r);e.addEventListener("addtrack",r);e.addEventListener("removetrack",r);this.on("dispose",function(){t.off("addtrack",i);t.off("removetrack",s);e.removeEventListener("change",r);e.removeEventListener("addtrack",r);e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",n)}})}addTextTrack(e,t,i){if(!e){throw new Error("TextTrack kind is required but was not provided")}return Bi(this,e,t,i)}createRemoteTextTrack(e){const t=E(e,{tech:this});return new Ni.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);if(typeof t!=="boolean"){t=false}this.remoteTextTrackEls().addTrackElement_(i);this.remoteTextTracks().addTrack(i.track);if(t===false){this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track))}return i}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 true}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Ne();if(!this.isReady_||this.paused()){this.queuedHanders_.add(t);this.one("playing",()=>{if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t);e()}})}else{this.requestNamedAnimationFrame(t,e)}return t}cancelVideoFrameCallback(e){if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e)}else{this.cancelNamedAnimationFrame(e)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Fi.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Fi||e instanceof Fi||e===Fi}static registerTech(e,t){if(!Fi.techs_){Fi.techs_={}}if(!Fi.isTech(t)){throw new Error(`Tech ${e} must be a Tech`)}if(!Fi.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!Fi.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}e=mt(e);Fi.techs_[e]=t;Fi.techs_[pt(e)]=t;if(e!=="Tech"){Fi.defaultTechOrder_.push(e)}return t}static getTech(t){if(!t){return}if(Fi.techs_&&Fi.techs_[t]){return Fi.techs_[t]}t=mt(t);if(e&&e.videojs&&e.videojs[t]){m.warn(`The ${t} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return e.videojs[t]}}}Mi.names.forEach(function(e){const t=Mi[e];Fi.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});Fi.prototype.featuresVolumeControl=true;Fi.prototype.featuresMuteControl=true;Fi.prototype.featuresFullscreenResize=false;Fi.prototype.featuresPlaybackRate=false;Fi.prototype.featuresProgressEvents=false;Fi.prototype.featuresSourceset=false;Fi.prototype.featuresTimeupdateEvents=false;Fi.prototype.featuresNativeTextTracks=false;Fi.prototype.featuresVideoFrameCallback=false;Fi.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;if(!s){s=e.sourceHandlers=[]}if(i===undefined){i=s.length}s.splice(i,0,t)};e.canPlayType=function(t){const i=e.sourceHandlers||[];let s;for(let e=0;e<i.length;e++){s=i[e].canPlayType(t);if(s){return s}}return""};e.selectSourceHandler=function(t,i){const s=e.sourceHandlers||[];let n;for(let e=0;e<s.length;e++){n=s[e].canHandleSource(t,i);if(n){return s[e]}}return null};e.canPlaySource=function(t,i){const s=e.selectSourceHandler(t,i);if(s){return s.canHandleSource(t,i)}return""};const t=["seekable","seeking","duration"];t.forEach(function(e){const t=this[e];if(typeof t!=="function"){return}this[e]=function(){if(this.sourceHandler_&&this.sourceHandler_[e]){return this.sourceHandler_[e].apply(this.sourceHandler_,arguments)}return t.apply(this,arguments)}},e.prototype);e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);if(!i){if(e.nativeSourceHandler){i=e.nativeSourceHandler}else{m.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler_);if(i!==e.nativeSourceHandler){this.currentSource_=t}this.sourceHandler_=i.handleSource(t,this,this.options_);this.one("dispose",this.disposeSourceHandler_)};e.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(["audio","video"]);this.currentSource_=null}this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose()}this.sourceHandler_=null}}};St.registerComponent("Tech",Fi);Fi.registerTech("Tech",Fi);Fi.defaultTechOrder_=[];const ji={};const Vi={};const $i={};function qi(e,t){ji[e]=ji[e]||[];ji[e].push(t)}function Hi(e,t,i){e.setTimeout(()=>is(t,ji[t.type],i,e),1)}function Wi(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function Gi(e,t,i){return e.reduceRight(Ji(i),t[i]())}function Ki(e,t,i,s){return t[i](e.reduce(Ji(i),s))}function zi(e,t,i,s=null){const n="call"+mt(i);const r=e.reduce(Ji(n),s);const a=r===$i;const o=a?null:t[i](r);Zi(e,i,o,a);return o}const Yi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const Xi={setCurrentTime:1,setMuted:1,setVolume:1};const Qi={play:1,pause:1};function Ji(e){return(t,i)=>{if(t===$i){return $i}if(i[e]){return i[e](t)}return t}}function Zi(e,t,i,s){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r[t]){r[t](s,i)}}}function es(e){Vi[e.id()]=null}function ts(e,t){const i=Vi[e.id()];let s=null;if(i===undefined||i===null){s=t(e);Vi[e.id()]=[[t,s]];return s}for(let e=0;e<i.length;e++){const[n,r]=i[e];if(n!==t){continue}s=r}if(s===null){s=t(e);i.push([t,s])}return s}function is(e={},t=[],i,s,n=[],r=false){const[a,...o]=t;if(typeof a==="string"){is(e,ji[a],i,s,n,r)}else if(a){const t=ts(s,a);if(!t.setSource){n.push(t);return is(e,o,i,s,n,r)}t.setSource(Object.assign({},e),function(a,l){if(a){return is(e,o,i,s,n,r)}n.push(t);is(l,e.type===l.type?o:ji[l.type],i,s,n,r)})}else if(o.length){is(e,o,i,s,n,r)}else if(r){i(e,n)}else{is(e,ji["*"],i,s,n,true)}}const ss={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"};const ns=function(e=""){const t=ai(e);const i=ss[t.toLowerCase()];return i||""};const rs=(e,t)=>{if(!t){return""}if(e.cache_.source.src===t&&e.cache_.source.type){return e.cache_.source.type}const i=e.cache_.sources.filter(e=>e.src===t);if(i.length){return i[0].type}const s=e.$$("source");for(let e=0;e<s.length;e++){const i=s[e];if(i.type&&i.src&&i.src===t){return i.type}}return ns(t)};const as=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=as(e);if(Array.isArray(e)){t=t.concat(e)}else if(T(e)){t.push(e)}});e=t}else if(typeof e==="string"&&e.trim()){e=[os({src:e})]}else if(T(e)&&typeof e.src==="string"&&e.src&&e.src.trim()){e=[os(e)]}else{e=[]}return e};function os(e){if(!e.type){const t=ns(e.src);if(t){e.type=t}}return e}class ls extends St{constructor(e,t,i){const s=E({createEl:false},t);super(e,s,i);if(!t.playerOptions.sources||t.playerOptions.sources.length===0){for(let i=0,s=t.playerOptions.techOrder;i<s.length;i++){const t=mt(s[i]);let n=Fi.getTech(t);if(!t){n=St.getComponent(t)}if(n&&n.isSupported()){e.loadTech_(t);break}}}else{e.src(t.playerOptions.sources)}}}St.registerComponent("MediaLoader",ls);class us extends St{constructor(e,t){super(e,t);if(this.options_.controlText){this.controlText(this.options_.controlText)}this.handleMouseOver_=(e=>this.handleMouseOver(e));this.handleMouseOut_=(e=>this.handleMouseOut(e));this.handleClick_=(e=>this.handleClick(e));this.handleKeyDown_=(e=>this.handleKeyDown(e));this.emitTapEvents();this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t);if(e==="button"){m.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=t.tabIndex;const s=J(e,t,i);s.appendChild(J("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));this.createControlTextEl(s);return s}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(e){this.controlTextEl_=J("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_}controlText(e,t=this.el()){if(e===undefined){return this.controlText_||"Need Text"}const i=this.localize(e);this.controlText_=e;Z(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){t.setAttribute("title",i)}}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick_);this.on("keydown",this.handleKeyDown_)}}disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){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){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(e){if(Tt.isEventKey(e,"Space")||Tt.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}St.registerComponent("ClickableComponent",us);class cs extends us{constructor(e,t){super(e,t);this.update();this.update_=(e=>this.update(e));e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return J("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e==="undefined"){if(this.$("img")){return this.$("img").crossOrigin}else if(this.player_.tech_&&this.player_.tech_.isReady_){return this.player_.crossOrigin()}return 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}if(this.$("img")){this.$("img").crossOrigin=e}return}update(e){const t=this.player().poster();this.setSrc(t);if(t){this.show()}else{this.hide()}}setSrc(e){if(!e){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(J("picture",{className:"vjs-poster",tabIndex:-1},{},J("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=e}handleClick(e){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){Bt(this.player_.play())}else{this.player_.pause()}}}cs.prototype.crossorigin=cs.prototype.crossOrigin;St.registerComponent("PosterImage",cs);const ds="#222";const hs="#ccc";const fs={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 ps(e,t){let i;if(e.length===4){i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(e.length===7){i=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function ms(e,t,i){try{e.style[t]=i}catch(e){return}}class gs extends St{constructor(t,i,s){super(t,i,s);const n=e=>this.updateDisplay(e);t.on("loadstart",e=>this.toggleDisplay(e));t.on("texttrackchange",n);t.on("loadedmetadata",e=>this.preselectTrack(e));t.ready(Ye(this,function(){if(t.tech_&&t.tech_.featuresNativeTextTracks){this.hide();return}t.on("fullscreenchange",n);t.on("playerresize",n);const i=e.screen.orientation||e;const s=e.screen.orientation?"change":"orientationchange";i.addEventListener(s,n);t.on("dispose",()=>i.removeEventListener(s,n));const r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++){this.player_.addRemoteTextTrack(r[e],true)}this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1};const t=this.player_.textTracks();const i=this.player_.cache_.selectedLanguage;let s;let n;let r;for(let a=0;a<t.length;a++){const o=t[a];if(i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e){if(o.kind===i.kind){r=o}else if(!r){r=o}}else if(i&&!i.enabled){r=null;s=null;n=null}else if(o.default){if(o.kind==="descriptions"&&!s){s=o}else if(o.kind in e&&!n){n=o}}}if(r){r.mode="showing"}else if(n){n.mode="showing"}else if(s){s.mode="showing"}}toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide()}else{this.show()}}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){if(typeof e.WebVTT==="function"){e.WebVTT.processCues(e,[],this.el_)}}updateDisplay(){const e=this.player_.textTracks();const t=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(t){const t=[];for(let i=0;i<e.length;++i){const s=e[i];if(s.mode!=="showing"){continue}t.push(s)}this.updateForTrack(t);return}let i=null;let s=null;let n=e.length;while(n--){const t=e[n];if(t.mode==="showing"){if(t.kind==="descriptions"){i=t}else{s=t}}}if(s){if(this.getAttribute("aria-live")!=="off"){this.setAttribute("aria-live","off")}this.updateForTrack(s)}else if(i){if(this.getAttribute("aria-live")!=="assertive"){this.setAttribute("aria-live","assertive")}this.updateForTrack(i)}}updateDisplayState(t){const i=this.player_.textTrackSettings.getValues();const s=t.activeCues;let n=s.length;while(n--){const t=s[n];if(!t){continue}const r=t.displayState;if(i.color){r.firstChild.style.color=i.color}if(i.textOpacity){ms(r.firstChild,"color",ps(i.color||"#fff",i.textOpacity))}if(i.backgroundColor){r.firstChild.style.backgroundColor=i.backgroundColor}if(i.backgroundOpacity){ms(r.firstChild,"backgroundColor",ps(i.backgroundColor||"#000",i.backgroundOpacity))}if(i.windowColor){if(i.windowOpacity){ms(r,"backgroundColor",ps(i.windowColor,i.windowOpacity))}else{r.style.backgroundColor=i.windowColor}}if(i.edgeStyle){if(i.edgeStyle==="dropshadow"){r.firstChild.style.textShadow=`2px 2px 3px ${ds}, 2px 2px 4px ${ds}, 2px 2px 5px ${ds}`}else if(i.edgeStyle==="raised"){r.firstChild.style.textShadow=`1px 1px ${ds}, 2px 2px ${ds}, 3px 3px ${ds}`}else if(i.edgeStyle==="depressed"){r.firstChild.style.textShadow=`1px 1px ${hs}, 0 1px ${hs}, -1px -1px ${ds}, 0 -1px ${ds}`}else if(i.edgeStyle==="uniform"){r.firstChild.style.textShadow=`0 0 4px ${ds}, 0 0 4px ${ds}, 0 0 4px ${ds}, 0 0 4px ${ds}`}}if(i.fontPercent&&i.fontPercent!==1){const t=e.parseFloat(r.style.fontSize);r.style.fontSize=t*i.fontPercent+"px";r.style.height="auto";r.style.top="auto"}if(i.fontFamily&&i.fontFamily!=="default"){if(i.fontFamily==="small-caps"){r.firstChild.style.fontVariant="small-caps"}else{r.firstChild.style.fontFamily=fs[i.fontFamily]}}}}updateForTrack(t){if(!Array.isArray(t)){t=[t]}if(typeof e.WebVTT!=="function"||t.every(e=>{return!e.activeCues})){return}const i=[];for(let e=0;e<t.length;++e){const s=t[e];for(let e=0;e<s.activeCues.length;++e){i.push(s.activeCues[e])}}e.WebVTT.processCues(e,i,this.el_);for(let e=0;e<t.length;++e){const i=t[e];for(let t=0;t<i.activeCues.length;++t){const s=i.activeCues[t].displayState;ie(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:e));if(i.language){le(s,"lang",i.language)}}if(this.player_.textTrackSettings){this.updateDisplayState(i)}}}}St.registerComponent("TextTrackDisplay",gs);class ys extends St{createEl(){const e=this.player_.isAudio();const t=this.localize(e?"Audio Player":"Video Player");const i=J("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])});const s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});s.appendChild(i);return s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}St.registerComponent("LoadingSpinner",ys);class _s extends us{createEl(e,t={},i={}){e="button";t=Object.assign({className:this.buildCSSClass()},t);i=Object.assign({type:"button"},i);const s=J(e,t,i);s.appendChild(J("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));this.createControlTextEl(s);return s}addChild(e,t={}){const i=this.constructor.name;m.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`);return St.prototype.addChild.call(this,e,t)}enable(){super.enable();this.el_.removeAttribute("disabled")}disable(){super.disable();this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(Tt.isEventKey(e,"Space")||Tt.isEventKey(e,"Enter")){e.stopPropagation();return}super.handleKeyDown(e)}}St.registerComponent("Button",_s);class vs extends _s{constructor(e,t){super(e,t);this.mouseused_=false;this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){Bt(t);if(this.player_.tech(true)){this.player_.tech(true).focus()}return}const i=this.player_.getChild("controlBar");const s=i&&i.getChild("playToggle");if(!s){this.player_.tech(true).focus();return}const n=()=>s.focus();if(Ut(t)){t.then(n,()=>{})}else{this.setTimeout(n,1)}}handleKeyDown(e){this.mouseused_=false;super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=true}}vs.prototype.controlText_="Play Video";St.registerComponent("BigPlayButton",vs);class bs extends _s{constructor(e,t){super(e,t);this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:false})}handleKeyDown(e){if(Tt.isEventKey(e,"Esc")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}St.registerComponent("CloseButton",bs);class Ts extends _s{constructor(e,t={}){super(e,t);t.replay=t.replay===undefined||t.replay;this.on(e,"play",e=>this.handlePlay(e));this.on(e,"pause",e=>this.handlePause(e));if(t.replay){this.on(e,"ended",e=>this.handleEnded(e))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){if(this.player_.paused()){Bt(this.player_.play())}else{this.player_.pause()}}handleSeeked(e){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(e)}else{this.handlePlay(e)}}handlePlay(e){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.controlText("Replay");this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Ts.prototype.controlText_="Play";St.registerComponent("PlayToggle",Ts);class Ss extends St{constructor(e,t){super(e,t);this.on(e,["timeupdate","ended"],e=>this.updateContent(e));this.updateTextNode_()}createEl(){const e=this.buildCSSClass();const t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`});const i=J("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xa0`},{role:"presentation"});t.appendChild(i);this.contentEl_=J("span",{className:`${e}-display`},{role:"presentation"});t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}updateTextNode_(e=0){e=Pt(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_){return}let e=this.textNode_;if(e&&this.contentEl_.firstChild!==e){e=null;m.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_=t.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(e){this.contentEl_.replaceChild(this.textNode_,e)}else{this.contentEl_.appendChild(this.textNode_)}})}updateContent(e){}}Ss.prototype.labelText_="Time";Ss.prototype.controlText_="Time";St.registerComponent("TimeDisplay",Ss);class Es extends Ss{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;if(this.player_.ended()){t=this.player_.duration()}else{t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(t)}}Es.prototype.labelText_="Current Time";Es.prototype.controlText_="Current Time";St.registerComponent("CurrentTimeDisplay",Es);class Is extends Ss{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i);this.on(e,"loadstart",i);this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Is.prototype.labelText_="Duration";Is.prototype.controlText_="Duration";St.registerComponent("DurationDisplay",Is);class ks extends St{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const t=super.createEl("div");const i=super.createEl("span",{textContent:"/"});t.appendChild(i);e.appendChild(t);return e}}St.registerComponent("TimeDivider",ks);class Cs extends Ss{constructor(e,t){super(e,t);this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();if(this.options_.displayNegative!==false){e.insertBefore(J("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return e}updateContent(e){if(typeof this.player_.duration()!=="number"){return}let t;if(this.player_.ended()){t=0}else if(this.player_.remainingTimeDisplay){t=this.player_.remainingTimeDisplay()}else{t=this.player_.remainingTime()}this.updateTextNode_(t)}}Cs.prototype.labelText_="Remaining Time";Cs.prototype.controlText_="Remaining Time";St.registerComponent("RemainingTimeDisplay",Cs);class ws extends St{constructor(e,t){super(e,t);this.updateShowing();this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=J("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(J("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xa0`}));this.contentEl_.appendChild(t.createTextNode(this.localize("LIVE")));e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;super.dispose()}updateShowing(e){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}St.registerComponent("LiveDisplay",ws);class As extends _s{constructor(e,t){super(e,t);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=(e=>this.updateLiveEdgeStatus(e));this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.textEl_=J("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});e.appendChild(this.textEl_);return e}updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}this.textEl_=null;super.dispose()}}As.prototype.controlText_="Seek to live, currently playing live";St.registerComponent("SeekToLive",As);function Os(e,t,i){e=Number(e);return Math.min(i,Math.max(t,isNaN(e)?t:e))}var Ds=Object.freeze({__proto__:null,clamp:Os});class Ps extends St{constructor(e,t){super(e,t);this.handleMouseDown_=(e=>this.handleMouseDown(e));this.handleMouseUp_=(e=>this.handleMouseUp(e));this.handleKeyDown_=(e=>this.handleKeyDown(e));this.handleClick_=(e=>this.handleClick(e));this.handleMouseMove_=(e=>this.handleMouseMove(e));this.update_=(e=>this.update(e));this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled()){return}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);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true}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");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(e,t={},i={}){t.className=t.className+" vjs-slider";t=Object.assign({tabIndex:0},t);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;if(e.type==="mousedown"){e.preventDefault()}if(e.type==="touchstart"&&!L){e.preventDefault()}ce();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,true)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;de();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();if(e===this.progress_){return e}this.progress_=e;this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"});return e}getProgress(){return Number(Os(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=pe(this.el_,e);if(this.vertical()){return t.y}return t.x}handleKeyDown(e){if(Tt.isEventKey(e,"Left")||Tt.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepBack()}else if(Tt.isEventKey(e,"Right")||Tt.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepForward()}else{super.handleKeyDown(e)}}handleClick(e){e.stopPropagation();e.preventDefault()}vertical(e){if(e===undefined){return this.vertical_||false}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}St.registerComponent("Slider",Ps);const xs=(e,t)=>Os(e/t*100,0,100).toFixed(2)+"%";class Ls extends St{constructor(e,t){super(e,t);this.partEls_=[];this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"});const i=J("span",{className:"vjs-control-text"});const s=J("span",{textContent:this.localize("Loaded")});const n=t.createTextNode(": ");this.percentageEl_=J("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});e.appendChild(i);i.appendChild(s);i.appendChild(n);i.appendChild(this.percentageEl_);return e}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker;const t=this.player_.buffered();const i=e&&e.isLive()?e.seekableEnd():this.player_.duration();const s=this.player_.bufferedEnd();const n=this.partEls_;const r=xs(s,i);if(this.percent_!==r){this.el_.style.width=r;Z(this.percentageEl_,r);this.percent_=r}for(let e=0;e<t.length;e++){const i=t.start(e);const r=t.end(e);let a=n[e];if(!a){a=this.el_.appendChild(J());n[e]=a}if(a.dataset.start===i&&a.dataset.end===r){continue}a.dataset.start=i;a.dataset.end=r;a.style.left=xs(i,s);a.style.width=xs(r-i,s)}for(let e=n.length;e>t.length;e--){this.el_.removeChild(n[e-1])}n.length=t.length})}}St.registerComponent("LoadProgressBar",Ls);class Rs extends St{constructor(e,t){super(e,t);this.update=Xe(Ye(this,this.update),ze)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=fe(this.el_);const n=he(this.player_.el());const r=e.width*t;if(!n||!s){return}const a=e.left-n.left+r;const o=e.width-r+(n.right-e.right);let l=s.width/2;if(a<l){l+=l-a}else if(o<l){l=o}if(l<0){l=0}else if(l>s.width){l=s.width}l=Math.round(l);this.el_.style.right=`-${l}px`;this.write(i)}write(e){Z(this.el_,e)}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow();const i=e-t*e;n=(i<1?"":"-")+Pt(i,e)}else{n=Pt(i,r)}this.update(e,t,n);if(s){s()}})}}St.registerComponent("TimeTooltip",Rs);class Ns extends St{constructor(e,t){super(e,t);this.update=Xe(Ye(this,this.update),ze)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i){return}const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s)}}Ns.prototype.options_={children:[]};if(!q&&!A){Ns.prototype.options_.children.push("timeTooltip")}St.registerComponent("PlayProgressBar",Ns);class Ms extends St{constructor(e,t){super(e,t);this.update=Xe(Ye(this,this.update),ze)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}Ms.prototype.options_={children:["timeTooltip"]};St.registerComponent("MouseTimeDisplay",Ms);const Us=5;const Bs=12;class Fs extends Ps{constructor(e,t){super(e,t);this.setEventHandlers_()}setEventHandlers_(){this.update_=Ye(this,this.update);this.update=Xe(this.update_,ze);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(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_);if("hidden"in t&&"visibilityState"in t){this.on(t,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(e){if(t.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(e)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,ze)}disableInterval_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"){return}if(!this.updateInterval){return}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(t.visibilityState==="hidden"){return}const i=super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const t=this.player_.liveTracker;let s=this.player_.duration();if(t&&t.isLive()){s=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==i){this.el_.setAttribute("aria-valuenow",(i*100).toFixed(2));this.percent_=i}if(this.currentTime_!==e||this.duration_!==s){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Pt(e,s),Pt(s,s)],"{1} of {2}"));this.currentTime_=e;this.duration_=s}if(this.bar){this.bar.update(he(this.el()),this.getProgress())}});return i}userSeek_(e){if(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 i=this.player_.liveTracker;if(i&&i.isLive()){t=(e-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t}handleMouseDown(e){if(!be(e)){return}e.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(e)}handleMouseMove(e,t=false){if(!be(e)){return}if(!t&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const s=this.calculateDistance(e);const n=this.player_.liveTracker;if(!n||!n.isLive()){i=s*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{if(s>=.99){n.seekToLiveEdge();return}const e=n.seekableStart();const t=n.liveCurrentTime();i=e+s*n.liveWindow();if(i>=t){i=t}if(i<=e){i=e+.1}if(i===Infinity){return}}this.userSeek_(i)}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.hide()}handleMouseUp(e){super.handleMouseUp(e);if(e){e.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){Bt(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+Us)}stepBack(){this.userSeek_(this.player_.currentTime()-Us)}handleAction(e){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(e){const t=this.player_.liveTracker;if(Tt.isEventKey(e,"Space")||Tt.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.handleAction(e)}else if(Tt.isEventKey(e,"Home")){e.preventDefault();e.stopPropagation();this.userSeek_(0)}else if(Tt.isEventKey(e,"End")){e.preventDefault();e.stopPropagation();if(t&&t.isLive()){this.userSeek_(t.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(Tt(e))){e.preventDefault();e.stopPropagation();const i=(Tt.codes[Tt(e)]-Tt.codes["0"])*10/100;if(t&&t.isLive()){this.userSeek_(t.seekableStart()+t.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(Tt.isEventKey(e,"PgDn")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()-Us*Bs)}else if(Tt.isEventKey(e,"PgUp")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()+Us*Bs)}else{super.handleKeyDown(e)}}dispose(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],this.update);if(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_);if("hidden"in t&&"visibilityState"in t){this.off(t,"visibilitychange",this.toggleVisibility_)}super.dispose()}}Fs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!q&&!A){Fs.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}St.registerComponent("SeekBar",Fs);class js extends St{constructor(e,t){super(e,t);this.handleMouseMove=Xe(Ye(this,this.handleMouseMove),ze);this.throttledHandleMouseSeek=Xe(Ye(this,this.handleMouseSeek),ze);this.handleMouseUpHandler_=(e=>this.handleMouseUp(e));this.handleMouseDownHandler_=(e=>this.handleMouseDown(e));this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t){return}const i=t.getChild("playProgressBar");const s=t.getChild("mouseTimeDisplay");if(!i&&!s){return}const n=t.el();const r=fe(n);let a=pe(n,e).x;a=Os(a,0,1);if(s){s.update(r,a)}if(i){i.update(r,t.getProgress())}}handleMouseSeek(e){const t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}}enabled(){return this.enabled_}disable(){this.children().forEach(e=>e.disable&&e.disable());if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDownHandler_);this.off(this.el_,"mousemove",this.handleMouseMove);this.removeListenersAddedOnMousedownAndTouchstart();this.addClass("disabled");this.enabled_=false;if(this.player_.scrubbing()){const e=this.getChild("seekBar");this.player_.scrubbing(false);if(e.videoWasPlaying){Bt(this.player_.play())}}}enable(){this.children().forEach(e=>e.enable&&e.enable());if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDownHandler_);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true}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;const i=this.getChild("seekBar");if(i){i.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");if(t){t.handleMouseUp(e)}this.removeListenersAddedOnMousedownAndTouchstart()}}js.prototype.options_={children:["seekBar"]};St.registerComponent("ProgressControl",js);class Vs extends _s{constructor(e,t){super(e,t);this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e));this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e));this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>{const t=e.currentType().substring(0,5)==="audio";if(t||e.audioPosterMode()||e.audioOnlyMode()){if(e.isInPictureInPicture()){e.exitPictureInPicture()}this.hide()}else{this.show()}});this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control ${super.buildCSSClass()}`}handlePictureInPictureEnabledChange(){if(t.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in e){this.enable()}else{this.disable()}}handlePictureInPictureChange(e){if(this.player_.isInPictureInPicture()){this.controlText("Exit Picture-in-Picture")}else{this.controlText("Picture-in-Picture")}this.handlePictureInPictureEnabledChange()}handleClick(e){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}}Vs.prototype.controlText_="Picture-in-Picture";St.registerComponent("PictureInPictureToggle",Vs);class $s extends _s{constructor(e,i){super(e,i);this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e));if(t[e.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen")}else{this.controlText("Fullscreen")}}handleClick(e){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}$s.prototype.controlText_="Fullscreen";St.registerComponent("FullscreenToggle",$s);const qs=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class Hs extends St{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});e.appendChild(super.createEl("span",{className:"vjs-control-text"}));return e}}St.registerComponent("VolumeLevel",Hs);class Ws extends St{constructor(e,t){super(e,t);this.update=Xe(Ye(this,this.update),ze)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){const i=he(this.el_);const s=he(this.player_.el());const n=e.width*t;if(!s||!i){return}const r=e.left-s.left+n;const a=e.width-n+(s.right-e.right);let o=i.width/2;if(r<o){o+=o-r}else if(a<o){o=a}if(o<0){o=0}else if(o>i.width){o=i.width}this.el_.style.right=`-${o}px`}this.write(`${s}%`)}write(e){Z(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0));if(n){n()}})}}St.registerComponent("VolumeLevelTooltip",Ws);class Gs extends St{constructor(e,t){super(e,t);this.update=Xe(Ye(this,this.update),ze)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,()=>{if(i){this.el_.style.bottom=`${e.height*t}px`}else{this.el_.style.left=`${e.width*t}px`}})}}Gs.prototype.options_={children:["volumeLevelTooltip"]};St.registerComponent("MouseVolumeLevelDisplay",Gs);class Ks extends Ps{constructor(e,t){super(e,t);this.on("slideractive",e=>this.updateLastVolume_(e));this.on(e,"volumechange",e=>this.updateARIAAttributes(e));e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){if(!be(e)){return}super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el();const s=he(i);const n=this.vertical();let r=pe(i,e);r=n?r.y:r.x;r=Os(r,0,1);t.update(s,r,n)}if(!be(e)){return}this.checkMuted();this.player_.volume(this.calculateDistance(e))}checkMuted(){if(this.player_.muted()){this.player_.muted(false)}}getPercent(){if(this.player_.muted()){return 0}return 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",()=>{if(this.player_.volume()===0){this.player_.lastVolume_(e)}})}}Ks.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!q&&!A){Ks.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}Ks.prototype.playerEvent="volumechange";St.registerComponent("VolumeBar",Ks);class zs extends St{constructor(e,t={}){t.vertical=t.vertical||false;if(typeof t.volumeBar==="undefined"||S(t.volumeBar)){t.volumeBar=t.volumeBar||{};t.volumeBar.vertical=t.vertical}super(e,t);qs(this,e);this.throttledHandleMouseMove=Xe(Ye(this,this.handleMouseMove),ze);this.handleMouseUpHandler_=(e=>this.handleMouseUp(e));this.on("mousedown",e=>this.handleMouseDown(e));this.on("touchstart",e=>this.handleMouseDown(e));this.on("mousemove",e=>this.handleMouseMove(e));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active");this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";if(this.options_.vertical){e="vjs-volume-vertical"}return 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)}}zs.prototype.options_={children:["volumeBar"]};St.registerComponent("VolumeControl",zs);const Ys=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class Xs extends _s{constructor(e,t){super(e,t);Ys(this,e);this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume();const i=this.player_.lastVolume_();if(t===0){const e=i<.1?.1:i;this.player_.volume(e);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(e){this.updateIcon_();this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;if(q&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(e===0||this.player_.muted()){t=0}else if(e<.33){t=1}else if(e<.67){t=2}se(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,""));ie(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0;const t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}}}Xs.prototype.controlText_="Mute";St.registerComponent("MuteToggle",Xs);class Qs extends St{constructor(e,t={}){if(typeof t.inline!=="undefined"){t.inline=t.inline}else{t.inline=true}if(typeof t.volumeControl==="undefined"||S(t.volumeControl)){t.volumeControl=t.volumeControl||{};t.volumeControl.vertical=!t.inline}super(e,t);this.handleKeyPressHandler_=(e=>this.handleKeyPress(e));this.on(e,["loadstart"],e=>this.volumePanelState_(e));this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e));this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e));this.on("keydown",e=>this.handleKeyPress(e));this.on("mouseover",e=>this.handleMouseOver(e));this.on("mouseout",e=>this.handleMouseOut(e));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}}createEl(){let e="vjs-volume-panel-horizontal";if(!this.options_.inline){e="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(e){if(Tt.isEventKey(e,"Esc")){this.muteToggle.focus()}}handleMouseOver(e){this.addClass("vjs-hover");$e(t,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover");qe(t,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){if(Tt.isEventKey(e,"Esc")){this.handleMouseOut()}}}Qs.prototype.options_={children:["muteToggle","volumeControl"]};St.registerComponent("VolumePanel",Qs);class Js extends _s{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipForwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]));this.show()}else{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){const t=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;if(t+this.skipTime<=s){n=t+this.skipTime}else{n=s}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}St.registerComponent("SkipForward",Js);class Zs extends _s{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipBackwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]));this.show()}else{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();const i=this.player_.liveTracker;const s=i&&i.isLive()&&i.seekableStart();let n;if(s&&t-this.skipTime<=s){n=s}else if(t>=this.skipTime){n=t-this.skipTime}else{n=0}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Zs.prototype.controlText_="Skip Backward";St.registerComponent("SkipBackward",Zs);class en extends St{constructor(e,t){super(e,t);if(t){this.menuButton_=t.menuButton}this.focusedChild_=-1;this.on("keydown",e=>this.handleKeyDown(e));this.boundHandleBlur_=(e=>this.handleBlur(e));this.boundHandleTapClick_=(e=>this.handleTapClick(e))}addEventListenerForItem(e){if(!(e instanceof St)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(e){if(!(e instanceof St)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)}removeChild(e){if(typeof e==="string"){e=this.getChild(e)}this.removeEventListenerForItem(e);super.removeChild(e)}addItem(e){const t=this.addChild(e);if(t){this.addEventListenerForItem(t)}}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=J(e,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});t.appendChild(this.contentEl_);$e(t,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return t}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(e){const i=e.relatedTarget||t.activeElement;if(!this.children().some(e=>{return e.el()===i})){const e=this.menuButton_;if(e&&e.buttonPressed_&&i!==e.el().firstChild){e.unpressButton()}}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t)){return}const i=t.filter(t=>t.el()===e.target)[0];if(!i){return}if(i.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}handleKeyDown(e){if(Tt.isEventKey(e,"Left")||Tt.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(Tt.isEventKey(e,"Right")||Tt.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}}stepForward(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_+1}this.focus(e)}stepBack(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_-1}this.focus(e)}focus(e=0){const t=this.children().slice();const i=t.length&&t[0].hasClass("vjs-menu-title");if(i){t.shift()}if(t.length>0){if(e<0){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}}}St.registerComponent("Menu",en);class tn extends St{constructor(e,i={}){super(e,i);this.menuButton_=new _s(e,i);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=_s.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_);this.update();this.enabled_=true;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=(e=>this.handleMenuKeyUp(e));this.on(this.menuButton_,"tap",n);this.on(this.menuButton_,"click",n);this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();$e(t,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",e=>this.handleMouseLeave(e));this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide();this.menu.contentEl_.removeAttribute("role")}else{this.show();this.menu.contentEl_.setAttribute("role","menu")}}createMenu(){const e=new en(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const t=J("li",{className:"vjs-menu-title",textContent:mt(this.options_.title),tabIndex:-1});const i=new St(this.player_,{el:t});e.addItem(i)}this.items=this.createItems();if(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()},{})}buildWrapperCSSClass(){let e="vjs-menu-button";if(this.options_.inline===true){e+="-inline"}else{e+="-popup"}const t=_s.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";if(this.options_.inline===true){e+="-inline"}else{e+="-popup"}return`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){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}}handleMouseLeave(e){this.removeClass("vjs-hover");qe(t,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){if(Tt.isEventKey(e,"Esc")||Tt.isEventKey(e,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Tt.isEventKey(e,"Tab")){e.preventDefault();this.menuButton_.focus()}}else if(Tt.isEventKey(e,"Up")||Tt.isEventKey(e,"Down")){if(!this.buttonPressed_){e.preventDefault();this.pressButton()}}}handleMenuKeyUp(e){if(Tt.isEventKey(e,"Esc")||Tt.isEventKey(e,"Tab")){this.removeClass("vjs-hover")}}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){if(Tt.isEventKey(e,"Esc")||Tt.isEventKey(e,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Tt.isEventKey(e,"Tab")){e.preventDefault();this.menuButton_.focus()}}}pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(q&&X()){return}this.menu.focus()}}unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute("aria-expanded","false")}}disable(){this.unpressButton();this.enabled_=false;this.addClass("vjs-disabled");this.menuButton_.disable()}enable(){this.enabled_=true;this.removeClass("vjs-disabled");this.menuButton_.enable()}}St.registerComponent("MenuButton",tn);class sn extends tn{constructor(e,t){const i=t.tracks;super(e,t);if(this.items.length<=1){this.hide()}if(!i){return}const s=Ye(this,this.update);i.addEventListener("removetrack",s);i.addEventListener("addtrack",s);i.addEventListener("labelchange",s);this.player_.on("ready",s);this.player_.on("dispose",function(){i.removeEventListener("removetrack",s);i.removeEventListener("addtrack",s);i.removeEventListener("labelchange",s)})}}St.registerComponent("TrackButton",sn);const nn=["Tab","Esc","Up","Down","Right","Left"];class rn extends us{constructor(e,t){super(e,t);this.selectable=t.selectable;this.isSelected_=t.selected||false;this.multiSelectable=t.multiSelectable;this.selected(this.isSelected_);if(this.selectable){if(this.multiSelectable){this.el_.setAttribute("role","menuitemcheckbox")}else{this.el_.setAttribute("role","menuitemradio")}}else{this.el_.setAttribute("role","menuitem")}}createEl(e,t,i){this.nonIconControl=true;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i);s.replaceChild(J("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),s.querySelector(".vjs-icon-placeholder"));return s}handleKeyDown(e){if(!nn.some(t=>Tt.isEventKey(e,t))){super.handleKeyDown(e)}}handleClick(e){this.selected(true)}selected(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}}}St.registerComponent("MenuItem",rn);class an extends rn{constructor(i,s){const n=s.track;const r=i.textTracks();s.label=n.label||n.language||"Unknown";s.selected=n.mode==="showing";super(i,s);this.track=n;this.kinds=(s.kinds||[s.kind||this.track.kind]).filter(Boolean);const a=(...e)=>{this.handleTracksChange.apply(this,e)};const o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};i.on(["loadstart","texttrackchange"],a);r.addEventListener("change",a);r.addEventListener("selectedlanguagechange",o);this.on("dispose",function(){i.off(["loadstart","texttrackchange"],a);r.removeEventListener("change",a);r.removeEventListener("selectedlanguagechange",o)});if(r.onchange===undefined){let i;this.on(["tap","click"],function(){if(typeof e.Event!=="object"){try{i=new e.Event("change")}catch(e){}}if(!i){i=t.createEvent("Event");i.initEvent("change",true,true)}r.dispatchEvent(i)})}this.handleTracksChange()}handleClick(e){const t=this.track;const i=this.player_.textTracks();super.handleClick(e);if(!i){return}for(let e=0;e<i.length;e++){const s=i[e];if(this.kinds.indexOf(s.kind)===-1){continue}if(s===t){if(s.mode!=="showing"){s.mode="showing"}}else if(s.mode!=="disabled"){s.mode="disabled"}}}handleTracksChange(e){const t=this.track.mode==="showing";if(t!==this.isSelected_){this.selected(t)}}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind){return}this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null;super.dispose()}}St.registerComponent("TextTrackMenuItem",an);class on extends an{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:false,mode:"disabled"};if(!t.kinds){t.kinds=[t.kind]}if(t.label){t.track.label=t.label}else{t.track.label=t.kinds.join(" and ")+" off"}t.selectable=true;t.multiSelectable=false;super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=true;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(this.options_.kinds.indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i!==this.isSelected_){this.selected(i)}}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=true;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}St.registerComponent("OffTextTrackMenuItem",on);class ln extends sn{constructor(e,t={}){t.tracks=e.textTracks();super(e,t)}createItems(e=[],t=an){let i;if(this.label_){i=`${this.label_} off`}e.push(new on(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i}));this.hideThreshold_+=1;const s=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});i.addClass(`vjs-${n.kind}-menu-item`);e.push(i)}}return e}}St.registerComponent("TextTrackButton",ln);class un extends rn{constructor(e,t){const i=t.track;const s=t.cue;const n=e.currentTime();t.selectable=true;t.multiSelectable=false;t.label=s.text;t.selected=s.startTime<=n&&n<s.endTime;super(e,t);this.track=i;this.cue=s}handleClick(e){super.handleClick();this.player_.currentTime(this.cue.startTime)}}St.registerComponent("ChaptersTrackMenuItem",un);class cn extends ln{constructor(e,t,i){super(e,t,i);this.selectCurrentItem_=(()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})})}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters"){return}const t=this.findChaptersTrack();if(t!==this.track_){this.setTrack(t);super.update()}else if(!this.items||t&&t.cues&&t.cues.length!==this.items.length){super.update()}}setTrack(e){if(this.track_===e){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(e){e.removeEventListener("load",this.updateHandler_)}this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}this.track_=e;if(this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(e){e.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 i=e[t];if(i.kind===this.kind_){return i}}}getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(mt(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const e=[];if(!this.track_){return e}const t=this.track_.cues;if(!t){return e}for(let i=0,s=t.length;i<s;i++){const s=t[i];const n=new un(this.player_,{track:this.track_,cue:s});e.push(n)}return e}}cn.prototype.kind_="chapters";cn.prototype.controlText_="Chapters";St.registerComponent("ChaptersButton",cn);class dn extends ln{constructor(e,t,i){super(e,t,i);const s=e.textTracks();const n=Ye(this,this.handleTracksChange);s.addEventListener("change",n);this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=false;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(s.kind!==this.kind_&&s.mode==="showing"){i=true;break}}if(i){this.disable()}else{this.enable()}}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}dn.prototype.kind_="descriptions";dn.prototype.controlText_="Descriptions";St.registerComponent("DescriptionsButton",dn);class hn extends ln{constructor(e,t,i){super(e,t,i)}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}hn.prototype.kind_="subtitles";hn.prototype.controlText_="Subtitles";St.registerComponent("SubtitlesButton",hn);class fn extends an{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:false,default:false,mode:"disabled"};t.selectable=false;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()}}St.registerComponent("CaptionSettingsMenuItem",fn);class pn extends ln{constructor(e,t,i){super(e,t,i)}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new fn(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return super.createItems(e)}}pn.prototype.kind_="captions";pn.prototype.controlText_="Captions";St.registerComponent("CaptionsButton",pn);class mn extends an{createEl(e,t,i){const s=super.createEl(e,t,i);const n=s.querySelector(".vjs-menu-item-text");if(this.options_.track.kind==="captions"){n.appendChild(J("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(J("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))}return s}}St.registerComponent("SubsCapsMenuItem",mn);class gn extends ln{constructor(e,t={}){super(e,t);this.label_="subtitles";if(["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1){this.label_="captions"}this.menuButton_.controlText(mt(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new fn(this.player_,{kind:this.label_}));this.hideThreshold_+=1}e=super.createItems(e,mn);return e}}gn.prototype.kinds_=["captions","subtitles"];gn.prototype.controlText_="Subtitles";St.registerComponent("SubsCapsButton",gn);class yn extends rn{constructor(e,t){const i=t.track;const s=e.audioTracks();t.label=i.label||i.language||"Unknown";t.selected=i.enabled;super(e,t);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",n);this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){const s=super.createEl(e,t,i);const n=s.querySelector(".vjs-menu-item-text");if(this.options_.track.kind==="main-desc"){n.appendChild(J("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(J("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return s}handleClick(e){super.handleClick(e);this.track.enabled=true;if(this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];if(i===this.track){continue}i.enabled=i===this.track}}}handleTracksChange(e){this.selected(this.track.enabled)}}St.registerComponent("AudioTrackMenuItem",yn);class _n extends sn{constructor(e,t={}){t.tracks=e.audioTracks();super(e,t)}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 i=0;i<t.length;i++){const s=t[i];e.push(new yn(this.player_,{track:s,selectable:true,multiSelectable:false}))}return e}}_n.prototype.controlText_="Audio Track";St.registerComponent("AudioTrackButton",_n);class vn extends rn{constructor(e,t){const i=t.rate;const s=parseFloat(i,10);t.label=i;t.selected=s===e.playbackRate();t.selectable=true;t.multiSelectable=false;super(e,t);this.label=i;this.rate=s;this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick();this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}vn.prototype.contentElType="button";St.registerComponent("PlaybackRateMenuItem",vn);class bn extends tn{constructor(e,t){super(e,t);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(e,"loadstart",e=>this.updateVisibility(e));this.on(e,"ratechange",e=>this.updateLabel(e));this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=J("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});e.appendChild(this.labelEl_);return 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();const t=[];for(let i=e.length-1;i>=0;i--){t.push(new vn(this.player(),{rate:e[i]+"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){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(e){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}bn.prototype.controlText_="Playback Rate";St.registerComponent("PlaybackRateMenuButton",bn);class Tn extends St{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){if(!t.className){t.className=this.buildCSSClass()}return super.createEl(e,t,i)}}St.registerComponent("Spacer",Tn);class Sn extends Tn{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}}St.registerComponent("CustomControlSpacer",Sn);class En extends St{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}En.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};if("exitPictureInPicture"in t){En.prototype.options_.children.splice(En.prototype.options_.children.length-1,0,"pictureInPictureToggle")}St.registerComponent("ControlBar",En);class In extends Ht{constructor(e,t){super(e,t);this.on(e,"error",e=>this.open(e))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}In.prototype.options_=Object.assign({},Ht.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});St.registerComponent("ErrorDisplay",In);const kn="vjs-text-track-settings";const Cn=["#000","Black"];const wn=["#00F","Blue"];const An=["#0FF","Cyan"];const On=["#0F0","Green"];const Dn=["#F0F","Magenta"];const Pn=["#F00","Red"];const xn=["#FFF","White"];const Ln=["#FF0","Yellow"];const Rn=["1","Opaque"];const Nn=["0.5","Semi-Transparent"];const Mn=["0","Transparent"];const Un={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Cn,xn,Pn,On,wn,Ln,Dn,An]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Rn,Nn,Mn]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[xn,Cn,Pn,On,wn,Ln,Dn,An]},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:e=>e==="1.00"?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Rn,Nn]},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:"Opacity",options:[Mn,Nn,Rn]}};Un.windowColor.options=Un.backgroundColor.options;function Bn(e,t){if(t){e=t(e)}if(e&&e!=="none"){return e}}function Fn(e,t){const i=e.options[e.options.selectedIndex].value;return Bn(i,t)}function jn(e,t,i){if(!t){return}for(let s=0;s<e.options.length;s++){if(Bn(e.options[s].value,i)===t){e.selectedIndex=s;break}}}class Vn extends Ht{constructor(e,t){t.temporary=false;super(e,t);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=true;this.endDialog=J("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog);this.setDefaults();if(t.persistTextTrackSettings===undefined){this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings}this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults();this.updateDisplay()});v(Un,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)});if(this.options_.persistTextTrackSettings){this.restoreSettings()}}dispose(){this.endDialog=null;super.dispose()}createElSelect_(e,t="",i="label"){const s=Un[e];const n=s.id.replace("%s",this.id_);const r=[t,n].join(" ").trim();return[`<${i} id="${n}" class="${i==="label"?"vjs-label":""}">`,this.localize(s.label),`</${i}>`,`<select aria-labelledby="${r}">`].concat(s.options.map(e=>{const t=n+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${r} ${t}">`,this.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return J("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return J("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("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return J("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 b(Un,(e,t,i)=>{const s=Fn(this.$(t.selector),t.parser);if(s!==undefined){e[i]=s}return e},{})}setValues(e){v(Un,(t,i)=>{jn(this.$(t.selector),e[i],t.parser)})}setDefaults(){v(Un,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let t;try{t=JSON.parse(e.localStorage.getItem(kn))}catch(e){m.warn(e)}if(t){this.setValues(t)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const t=this.getValues();try{if(Object.keys(t).length){e.localStorage.setItem(kn,JSON.stringify(t))}else{e.localStorage.removeItem(kn)}}catch(e){m.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar;const t=e&&e.subsCapsButton;const i=e&&e.captionsButton;if(t){t.focus()}else if(i){i.focus()}}handleLanguagechange(){this.fill()}}St.registerComponent("TextTrackSettings",Vn);class $n extends St{constructor(t,i){let s=i.ResizeObserver||e.ResizeObserver;if(i.ResizeObserver===null){s=false}const n=E({createEl:!s,reportTouchActivity:false},i);super(t,n);this.ResizeObserver=i.ResizeObserver||e.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=Qe(()=>{this.resizeHandler()},100,false,this);if(s){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(t.el())}else{this.loadListener_=(()=>{if(!this.el_||!this.el_.contentWindow){return}const e=this.debouncedHandler_;let t=this.unloadListener_=function(){qe(this,"resize",e);qe(this,"unload",t);t=null};$e(this.el_.contentWindow,"unload",t);$e(this.el_.contentWindow,"resize",e)});this.one("load",this.loadListener_)}}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(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()}}St.registerComponent("ResizeManager",$n);const qn={trackingThreshold:20,liveTolerance:15};class Hn extends St{constructor(e,t){const i=E(qn,t,{createEl:false});super(e,i);this.trackLiveHandler_=(()=>this.trackLive_());this.handlePlay_=(e=>this.handlePlay(e));this.handleFirstTimeupdate_=(e=>this.handleFirstTimeupdate(e));this.handleSeeked_=(e=>this.handleSeeked(e));this.seekToLiveEdge_=(e=>this.seekToLiveEdge(e));this.reset_();this.on(this.player_,"durationchange",e=>this.handleDurationchange(e));this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const t=this.player_.seekable();if(!t||!t.length){return}const i=Number(e.performance.now().toFixed(4));const s=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i;this.pastSeekEnd_=this.pastSeekEnd()+s;const n=this.liveCurrentTime();const r=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-r)>this.options_.liveTolerance;if(!this.timeupdateSeen_||n===Infinity){a=false}if(a!==this.behindLiveEdge_){this.behindLiveEdge_=a;this.trigger("liveedgechange")}}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}}startTracking(){if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ze);this.trackLive_();this.on(this.player_,["play","pause"],this.trackLiveHandler_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay_);this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}else{this.on(this.player_,"seeked",this.handleSeeked_)}}handleFirstTimeupdate(){this.timeupdateSeen_=true;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_=false;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.nextSeekedFromUser_=false;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_=true}stopTracking(){if(!this.isTracking()){return}this.reset_();this.trigger("liveedgechange")}seekableEnd(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.end(i))}return t.length?t.sort()[t.length-1]:Infinity}seekableStart(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.start(i))}return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();if(e===Infinity){return 0}return e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();if(this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=e;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return}this.nextSeekedFromUser_=false;this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking();super.dispose()}}St.registerComponent("LiveTracker",Hn);class Wn extends St{constructor(e,t){super(e,t);this.on("statechanged",e=>this.updateDom_());this.updateDom_()}createEl(){this.els={title:J("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Ne()}`}),description:J("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Ne()}`})};return J("div",{className:"vjs-title-bar"},{},Object.values(this.els))}updateDom_(){const e=this.player_.tech_;const t=e&&e.el_;const i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const s=this.state[e];const n=this.els[e];const r=i[e];ge(n);if(s){Z(n,s)}if(t){t.removeAttribute(r);if(s){t.setAttribute(r,n.id)}}});if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(e){this.setState(e)}dispose(){const e=this.player_.tech_;const t=e&&e.el_;if(t){t.removeAttribute("aria-labelledby");t.removeAttribute("aria-describedby")}super.dispose();this.els=null}}St.registerComponent("TitleBar",Wn);const Gn=e=>{const t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return true}const i=e.$$("source");const s=[];let n="";if(!i.length){return false}for(let e=0;e<i.length;e++){const t=i[e].src;if(t&&s.indexOf(t)===-1){s.push(t)}}if(!s.length){return false}if(s.length===1){n=s[0]}e.triggerSourceset(n);return true};const Kn=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(true).innerHTML},set(i){const s=t.createElement(this.nodeName.toLowerCase());s.innerHTML=i;const n=t.createDocumentFragment();while(s.childNodes.length){n.appendChild(s.childNodes[0])}this.innerText="";e.Element.prototype.appendChild.call(this,n);return this.innerHTML}});const zn=(e,t)=>{let i={};for(let s=0;s<e.length;s++){i=Object.getOwnPropertyDescriptor(e[s],t);if(i&&i.set&&i.get){break}}i.enumerable=true;i.configurable=true;return i};const Yn=t=>zn([t.el(),e.HTMLMediaElement.prototype,e.Element.prototype,Kn],"innerHTML");const Xn=function(e){const t=e.el();if(t.resetSourceWatch_){return}const i={};const s=Yn(e);const n=i=>(...s)=>{const n=i.apply(t,s);Gn(e);return n};["append","appendChild","insertAdjacentHTML"].forEach(e=>{if(!t[e]){return}i[e]=t[e];t[e]=n(i[e])});Object.defineProperty(t,"innerHTML",E(s,{set:n(s.set)}));t.resetSourceWatch_=(()=>{t.resetSourceWatch_=null;Object.keys(i).forEach(e=>{t[e]=i[e]});Object.defineProperty(t,"innerHTML",s)});e.one("sourceset",t.resetSourceWatch_)};const Qn=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return ri(e.Element.prototype.getAttribute.call(this,"src"))}return""},set(t){e.Element.prototype.setAttribute.call(this,"src",t);return t}});const Jn=t=>zn([t.el(),e.HTMLMediaElement.prototype,Qn],"src");const Zn=function(e){if(!e.featuresSourceset){return}const t=e.el();if(t.resetSourceset_){return}const i=Jn(e);const s=t.setAttribute;const n=t.load;Object.defineProperty(t,"src",E(i,{set:s=>{const n=i.set.call(t,s);e.triggerSourceset(t.src);return n}}));t.setAttribute=((i,n)=>{const r=s.call(t,i,n);if(/src/i.test(i)){e.triggerSourceset(t.src)}return r});t.load=(()=>{const i=n.call(t);if(!Gn(e)){e.triggerSourceset("");Xn(e)}return i});if(t.currentSrc){e.triggerSourceset(t.currentSrc)}else if(!Gn(e)){Xn(e)}t.resetSourceset_=(()=>{t.resetSourceset_=null;t.load=n;t.setAttribute=s;Object.defineProperty(t,"src",i);if(t.resetSourceWatch_){t.resetSourceWatch_()}})};class er extends Fi{constructor(e,t){super(e,t);const i=e.source;let s=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(e.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];while(t--){const n=e[t];const r=n.nodeName.toLowerCase();if(r==="track"){if(!this.featuresNativeTextTracks){i.push(n)}else{this.remoteTextTrackEls().addTrackElement_(n);this.remoteTextTracks().addTrack(n.track);this.textTracks().addTrack(n.track);if(!s&&!this.el_.hasAttribute("crossorigin")&&oi(n.src)){s=true}}}}for(let e=0;e<i.length;e++){this.el_.removeChild(i[e])}}this.proxyNativeTracks_();if(this.featuresNativeTextTracks&&s){m.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n"+"This may prevent text tracks from loading.")}this.restoreMetadataTracksInIOSNativePlayer_();if((V||j)&&e.nativeControlsForTouch===true){this.setControls(true)}this.proxyWebkitFullscreen_();this.triggerReady()}dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}er.disposeMediaElement(this.el_);this.options_=null;super.dispose()}setupSourcesetHandling_(){Zn(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const s=e[i];if(s.kind==="metadata"){t.push({track:s,storedMode:s.mode})}}};i();e.addEventListener("change",i);this.on("dispose",()=>e.removeEventListener("change",i));const s=()=>{for(let e=0;e<t.length;e++){const i=t[e];if(i.track.mode==="disabled"&&i.track.mode!==i.storedMode){i.track.mode=i.storedMode}}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i);e.removeEventListener("change",s);e.addEventListener("change",s)});this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i);e.addEventListener("change",i);e.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`]){return}const i=e.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{const t=this.el()[`${i}Tracks`];t.removeEventListener(e,this[`${i}TracksListeners_`][e])})}this[`featuresNative${e}Tracks`]=!t;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Ri[e];const i=this.el()[t.getterName];const s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener){return}const n={change:t=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i);if(e==="text"){this[Ni.remoteText.getterName]().trigger(i)}},addtrack(e){s.addTrack(e.track)},removetrack(e){s.removeTrack(e.track)}};const r=function(){const e=[];for(let t=0;t<s.length;t++){let n=false;for(let e=0;e<i.length;e++){if(i[e]===s[t]){n=true;break}}if(!n){e.push(s[t])}}while(e.length){s.removeTrack(e.shift())}};this[t.getterName+"Listeners_"]=n;Object.keys(n).forEach(e=>{const t=n[e];i.addEventListener(e,t);this.on("dispose",s=>i.removeEventListener(e,t))});this.on("loadstart",r);this.on("dispose",e=>this.off("loadstart",r))}proxyNativeTracks_(){Ri.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const t=e.cloneNode(true);if(e.parentNode){e.parentNode.insertBefore(t,e)}er.disposeMediaElement(e);e=t}else{e=t.createElement("video");const i=this.options_.tag&&ae(this.options_.tag);const s=E({},i);if(!V||this.options_.nativeControlsForTouch!==true){delete s.controls}re(e,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){le(e,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){e.disablePictureInPicture=this.options_.disablePictureInPicture}const i=["loop","muted","playsinline","autoplay"];for(let t=0;t<i.length;t++){const s=i[t];const n=this.options_[s];if(typeof n!=="undefined"){if(n){le(e,s,s)}else{ue(e,s)}e[s]=n}}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3){return}if(e.readyState===0){let e=false;const t=function(){e=true};this.on("loadstart",t);const i=function(){if(!e){this.trigger("loadstart")}};this.on("loadedmetadata",i);this.ready(function(){this.off("loadstart",t);this.off("loadedmetadata",i);if(!e){this.trigger("loadstart")}});return}const t=["loadstart"];t.push("loadedmetadata");if(e.readyState>=2){t.push("loadeddata")}if(e.readyState>=3){t.push("canplay")}if(e.readyState>=4){t.push("canplaythrough")}this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{if(this.isScrubbing_&&this.el_.fastSeek&&H){this.el_.fastSeek(e)}else{this.el_.currentTime=e}}catch(e){m(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&A&&L&&this.el_.currentTime===0){const e=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",e)}};this.on("timeupdate",e);return 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:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const t=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",e);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};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){Bt(this.el_.play());this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0)}else{try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}}exitFullScreen(){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){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(e)}return super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(e)}else{super.cancelVideoFrameCallback(e)}}src(e){if(e===undefined){return this.el_.src}this.setSrc(e)}reset(){er.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(e,t,i)}return this.el_.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(e)}const i=t.createElement("track");if(e.kind){i.kind=e.kind}if(e.label){i.label=e.label}if(e.language||e.srclang){i.srclang=e.language||e.srclang}if(e.default){i.default=e.default}if(e.id){i.id=e.id}if(e.src){i.src=e.src}return i}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(e){super.removeRemoteTextTrack(e);if(this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;while(i--){if(e===t[i]||e===t[i].track){this.el().removeChild(t[i])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const t={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){t.droppedVideoFrames=this.el().webkitDroppedFrameCount;t.totalVideoFrames=this.el().webkitDecodedFrameCount}if(e.performance){t.creationTime=e.performance.now()}return t}}I(er,"TEST_VID",function(){if(!z()){return}const e=t.createElement("video");const i=t.createElement("track");i.kind="captions";i.srclang="en";i.label="English";e.appendChild(i);return e});er.isSupported=function(){try{er.TEST_VID.volume=.5}catch(e){return false}return!!(er.TEST_VID&&er.TEST_VID.canPlayType)};er.canPlayType=function(e){return er.TEST_VID.canPlayType(e)};er.canPlaySource=function(e,t){return er.canPlayType(e.type)};er.canControlVolume=function(){try{const t=er.TEST_VID.volume;er.TEST_VID.volume=t/2+.1;const i=t!==er.TEST_VID.volume;if(i&&q){e.setTimeout(()=>{if(er&&er.prototype){er.prototype.featuresVolumeControl=t!==er.TEST_VID.volume}});return false}return i}catch(e){return false}};er.canMuteVolume=function(){try{const e=er.TEST_VID.muted;er.TEST_VID.muted=!e;if(er.TEST_VID.muted){le(er.TEST_VID,"muted","muted")}else{ue(er.TEST_VID,"muted","muted")}return e!==er.TEST_VID.muted}catch(e){return false}};er.canControlPlaybackRate=function(){if(A&&L&&N<58){return false}try{const e=er.TEST_VID.playbackRate;er.TEST_VID.playbackRate=e/2+.1;return e!==er.TEST_VID.playbackRate}catch(e){return false}};er.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return false}return true};er.supportsNativeTextTracks=function(){return H||q&&L};er.supportsNativeVideoTracks=function(){return!!(er.TEST_VID&&er.TEST_VID.videoTracks)};er.supportsNativeAudioTracks=function(){return!!(er.TEST_VID&&er.TEST_VID.audioTracks)};er.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){I(er.prototype,e,()=>er[t](),true)});er.prototype.featuresVolumeControl=er.canControlVolume();er.prototype.movingMediaElementInDOM=!q;er.prototype.featuresFullscreenResize=true;er.prototype.featuresProgressEvents=true;er.prototype.featuresTimeupdateEvents=true;er.prototype.featuresVideoFrameCallback=!!(er.TEST_VID&&er.TEST_VID.requestVideoFrameCallback);er.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};er.resetMediaElement=function(e){if(!e){return}const t=e.querySelectorAll("source");let i=t.length;while(i--){e.removeChild(t[i])}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){er.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){er.prototype["set"+mt(e)]=function(t){this.el_[e]=t;if(t){this.el_.setAttribute(e,e)}else{this.el_.removeAttribute(e)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){er.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){er.prototype["set"+mt(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){er.prototype[e]=function(){return this.el_[e]()}});Fi.withSourceHandlers(er);er.nativeSourceHandler={};er.nativeSourceHandler.canPlayType=function(e){try{return er.TEST_VID.canPlayType(e)}catch(e){return""}};er.nativeSourceHandler.canHandleSource=function(e,t){if(e.type){return er.nativeSourceHandler.canPlayType(e.type)}else if(e.src){const t=ai(e.src);return er.nativeSourceHandler.canPlayType(`video/${t}`)}return""};er.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)};er.nativeSourceHandler.dispose=function(){};er.registerSourceHandler(er.nativeSourceHandler);Fi.registerTech("Html5",er);const tr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const ir={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const sr=["tiny","xsmall","small","medium","large","xlarge","huge"];const nr={};sr.forEach(e=>{const t=e.charAt(0)==="x"?`x-${e.substring(1)}`:e;nr[e]=`vjs-layout-${t}`});const rr={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class ar extends St{constructor(e,s,n){e.id=e.id||s.id||`vjs_video_${Ne()}`;s=Object.assign(ar.getTagSettings(e),s);s.initChildren=false;s.createEl=false;s.evented=false;s.reportTouchActivity=false;if(!s.language){const t=e.closest("[lang]");if(t){s.language=t.getAttribute("lang")}}super(null,s,n);this.boundDocumentFullscreenChange_=(e=>this.documentFullscreenChange_(e));this.boundFullWindowOnEscKey_=(e=>this.fullWindowOnEscKey(e));this.boundUpdateStyleEl_=(e=>this.updateStyleEl_(e));this.boundApplyInitTime_=(e=>this.applyInitTime_(e));this.boundUpdateCurrentBreakpoint_=(e=>this.updateCurrentBreakpoint_(e));this.boundHandleTechClick_=(e=>this.handleTechClick_(e));this.boundHandleTechDoubleClick_=(e=>this.handleTechDoubleClick_(e));this.boundHandleTechTouchStart_=(e=>this.handleTechTouchStart_(e));this.boundHandleTechTouchMove_=(e=>this.handleTechTouchMove_(e));this.boundHandleTechTouchEnd_=(e=>this.handleTechTouchEnd_(e));this.boundHandleTechTap_=(e=>this.handleTechTap_(e));this.isFullscreen_=false;this.log=g(this.id_);this.fsApi_=l;this.isPosterFromTech_=false;this.queuedCallbacks_=[];this.isReady_=false;this.hasStarted_=false;this.userActive_=false;this.debugEnabled_=false;this.audioOnlyMode_=false;this.audioPosterMode_=false;this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]};if(!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?")}this.tag=e;this.tagAttributes=e&&ae(e);this.language(this.options_.language);if(s.languages){const e={};Object.getOwnPropertyNames(s.languages).forEach(function(t){e[t.toLowerCase()]=s.languages[t]});this.languages_=e}else{this.languages_=ar.prototype.options_.languages}this.resetCache_();this.poster_=s.poster||"";this.controls_=!!s.controls;e.controls=false;e.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(s.plugins){Object.keys(s.plugins).forEach(e=>{if(typeof this[e]!=="function"){throw new Error(`plugin "${e}" does not exist`)}})}this.scrubbing_=false;this.el_=this.createEl();dt(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){$e(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const r=E(this.options_);if(s.plugins){Object.keys(s.plugins).forEach(e=>{this[e](s.plugins[e])})}if(s.debug){this.debug(true)}this.options_.playerOptions=r;this.middleware_=[];this.playbackRates(s.playbackRates);this.initChildren();this.isAudio(e.nodeName.toLowerCase()==="audio");if(this.controls()){this.addClass("vjs-controls-enabled")}else{this.addClass("vjs-controls-disabled")}this.el_.setAttribute("role","region");if(this.isAudio()){this.el_.setAttribute("aria-label",this.localize("Audio Player"))}else{this.el_.setAttribute("aria-label",this.localize("Video Player"))}if(this.isAudio()){this.addClass("vjs-audio")}if(V){this.addClass("vjs-touch-enabled")}if(!q){this.addClass("vjs-workinghover")}ar.players[this.id_]=this;const a=i.split(".")[0];this.addClass(`vjs-v${a}`);this.userActive(true);this.reportUserActivity();this.one("play",e=>this.listenForUserActivity_(e));this.on("keydown",e=>this.handleKeyDown(e));this.on("languagechange",e=>this.handleLanguagechange(e));this.breakpoints(this.options_.breakpoints);this.responsive(this.options_.responsive);this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode);this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose");this.off("dispose");qe(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);qe(t,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}ar.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}es(this);Mi.names.forEach(e=>{const t=Mi[e];const i=this[t.getterName]();if(i&&i.off){i.off()}});super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let i=this.tag;let s;let n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";if(n){s=this.el_=i.parentNode}else if(!r){s=this.el_=super.createEl("div")}const a=ae(i);if(r){s=this.el_=i;i=this.tag=t.createElement("video");while(s.children.length){i.appendChild(s.firstChild)}if(!te(s,"video-js")){ie(s,"video-js")}s.appendChild(i);n=this.playerElIngest_=s;Object.keys(s).forEach(e=>{try{i[e]=s[e]}catch(e){}})}i.setAttribute("tabindex","-1");a.tabindex="-1";if(L&&B){i.setAttribute("role","application");a.role="application"}i.removeAttribute("width");i.removeAttribute("height");if("width"in a){delete a.width}if("height"in a){delete a.height}Object.getOwnPropertyNames(a).forEach(function(e){if(!(r&&e==="class")){s.setAttribute(e,a[e])}if(r){i.setAttribute(e,a[e])}});i.playerId=i.id;i.id+="_html5_api";i.className="vjs-tech";i.player=s.player=this;this.addClass("vjs-paused");if(e.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=De("vjs-styles-dimensions");const e=Te(".vjs-styles-defaults");const t=Te("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=false;this.fluid_=false;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=i.getElementsByTagName("a");for(let e=0;e<o.length;e++){const t=o.item(e);ie(t,"vjs-hidden");t.setAttribute("hidden","hidden")}i.initNetworkState_=i.networkState;if(i.parentNode&&!n){i.parentNode.insertBefore(s,i)}ee(i,s);this.children_.unshift(i);this.el_.setAttribute("lang",this.language_);this.el_.setAttribute("translate","no");this.el_=s;return s}crossOrigin(e){if(typeof e==="undefined"){return this.techGet_("crossOrigin")}if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){m.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e);if(this.posterImage){this.posterImage.crossOrigin(e)}return}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===undefined){return this[i]||0}if(t===""||t==="auto"){this[i]=undefined;this.updateStyleEl_();return}const s=parseFloat(t);if(isNaN(s)){m.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=s;this.updateStyleEl_()}fluid(e){if(e===undefined){return!!this.fluid_}this.fluid_=!!e;if(it(this)){this.off(["playerreset","resize"],this.boundUpdateStyleEl_)}if(e){this.addClass("vjs-fluid");this.fill(false);st(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(e){if(e===undefined){return!!this.fill_}this.fill_=!!e;if(e){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(e){if(e===undefined){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(true);this.updateStyleEl_()}updateStyleEl_(){if(e.VIDEOJS_NO_DYNAMIC_STYLE===true){const e=typeof this.width_==="number"?this.width_:this.options_.width;const t=typeof this.height_==="number"?this.height_:this.options_.height;const i=this.tech_&&this.tech_.el();if(i){if(e>=0){i.width=e}if(t>=0){i.height=t}}return}let t;let i;let s;let n;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){s=this.aspectRatio_}else if(this.videoWidth()>0){s=this.videoWidth()+":"+this.videoHeight()}else{s="16:9"}const r=s.split(":");const a=r[1]/r[0];if(this.width_!==undefined){t=this.width_}else if(this.height_!==undefined){t=this.height_/a}else{t=this.videoWidth()||300}if(this.height_!==undefined){i=this.height_}else{i=t*a}if(/^[^a-zA-Z]/.test(this.id())){n="dimensions-"+this.id()}else{n=this.id()+"-dimensions"}this.addClass(n);Pe(this.styleEl_,`\n .${n} {\n width: ${t}px;\n height: ${i}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${a*100}%;\n }\n `)}loadTech_(e,t){if(this.tech_){this.unloadTech_()}const i=mt(e);const s=e.charAt(0).toLowerCase()+e.slice(1);if(i!=="Html5"&&this.tag){Fi.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=i;this.isReady_=false;let n=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===true&&this.options_.normalizeAutoplay){n=false}const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_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_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Mi.names.forEach(e=>{const t=Mi[e];r[t.getterName]=this[t.privateName]});Object.assign(r,this.options_[i]);Object.assign(r,this.options_[s]);Object.assign(r,this.options_[e.toLowerCase()]);if(this.tag){r.tag=this.tag}if(t&&t.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const a=Fi.getTech(e);if(!a){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new a(r);this.tech_.ready(Ye(this,this.handleTechReady_),true);$t.jsonToTextTracks(this.textTracksJson_||[],this.tech_);tr.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${mt(e)}_`](t))});Object.keys(ir).forEach(e=>{this.on(this.tech_,e,t=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${ir[e]}_`].bind(this),event:t});return}this[`handleTech${ir[e]}_`](t)})});this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e));this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e));this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e));this.on(this.tech_,"ended",e=>this.handleTechEnded_(e));this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e));this.on(this.tech_,"play",e=>this.handleTechPlay_(e));this.on(this.tech_,"pause",e=>this.handleTechPause_(e));this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e));this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t));this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t));this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e));this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e));this.on(this.tech_,"error",e=>this.handleTechError_(e));this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e));this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e));this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)){ee(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){Mi.names.forEach(e=>{const t=Mi[e];this[t.privateName]=this[t.getterName]()});this.textTracksJson_=$t.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(e){if(e===undefined){m.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\n"+"See https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_}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();if(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_();if(!this.paused()){this.trigger("loadstart")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay()===true&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=="string"){return}const t=()=>{const e=this.muted();this.muted(true);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(!Ut(i)){return}return i.catch(e=>{t();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${e?e:""}`)})};let i;if(e==="any"&&!this.muted()){i=this.play();if(Ut(i)){i=i.catch(t)}}else if(e==="muted"&&!this.muted()){i=t()}else{i=this.play()}if(!Ut(i)){return}return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e;let i="";if(typeof t!=="string"){t=e.src;i=e.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(t&&!i){i=rs(this,t)}this.cache_.source=E({},e,{src:t,type:i});const s=this.cache_.sources.filter(e=>e.src&&e.src===t);const n=[];const r=this.$$("source");const a=[];for(let e=0;e<r.length;e++){const i=ae(r[e]);n.push(i);if(i.src&&i.src===t){a.push(i.src)}}if(a.length&&!s.length){this.cache_.sources=n}else if(!s.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src;const s=e.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(s)){if(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i){t=(()=>{})}}t(s);if(!e.src){this.tech_.any(["sourceset","loadstart"],e=>{if(e.type==="sourceset"){return}const t=this.techGet("currentSrc");this.lastSource_.tech=t;this.updateSourceCaches_(t)})}}this.lastSource_={player:this.currentSource().src,tech:e.src};this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===undefined){return this.hasStarted_}if(e===this.hasStarted_){return}this.hasStarted_=e;if(this.hasStarted_){this.addClass("vjs-has-started")}else{this.removeClass("vjs-has-started")}}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")}handleTechRateChange_(){if(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();const t=()=>{if(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");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){if(!this.controls_){return}if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.click===undefined||this.options_.userActions.click!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.click==="function"){this.options_.userActions.click.call(this,e)}else if(this.paused()){Bt(this.play())}else{this.pause()}}}handleTechDoubleClick_(e){if(!this.controls_){return}const t=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target));if(!t){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,e)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity()}}handleTechTouchEnd_(e){if(e.cancelable){e.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(e){const i=e.target.player;if(i&&i!==this){return}const s=this.el();let n=t[this.fsApi_.fullscreenElement]===s;if(!n&&s.matches){n=s.matches(":"+this.fsApi_.fullscreen)}else if(!n&&s.msMatchesSelector){n=s.msMatchesSelector(":"+this.fsApi_.fullscreen)}this.isFullscreen(n)}handleTechFullscreenChange_(e,t){if(t){if(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_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(false)}handleTechError_(){const e=this.tech_.error();this.error(e)}handleTechTextData_(){let e=null;if(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 Xi){return Ki(this.middleware_,this.tech_,e,t)}else if(e in Qi){return zi(this.middleware_,this.tech_,e,t)}try{if(this.tech_){this.tech_[e](t)}}catch(e){m(e);throw e}},true)}techGet_(e){if(!this.tech_||!this.tech_.isReady_){return}if(e in Yi){return Gi(this.middleware_,this.tech_,e)}else if(e in Qi){return zi(this.middleware_,this.tech_,e)}try{return this.tech_[e]()}catch(t){if(this.tech_[e]===undefined){m(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t);throw t}if(t.name==="TypeError"){m(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t);this.tech_.isReady_=false;throw t}m(t);throw t}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Bt){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(H||q);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!t){this.waitToPlay_=(e=>{this.play_()});this.one(["ready","loadstart"],this.waitToPlay_);if(!t&&i){this.load()}return}const s=this.techGet_("play");const n=i&&this.hasClass("vjs-ended");if(n){this.resetProgressBar_()}if(s===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(s)}}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];e.forEach(function(e){e()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===false?false:true}played(){return this.techGet_("played")||Ct(0,0)}scrubbing(e){if(typeof e==="undefined"){return this.scrubbing_}this.scrubbing_=!!e;this.techCall_("setScrubbing",this.scrubbing_);if(e){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(e){if(typeof e!=="undefined"){if(e<0){e=0}if(!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;return}this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}e=parseFloat(e);if(e<0){e=Infinity}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!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");if(!e||!e.length){e=Ct(0,0)}return e}bufferedPercent(){return Lt(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered();const t=this.duration();let i=e.end(e.length-1);if(i>t){i=t}return i}volume(e){let t;if(e!==undefined){t=Math.max(0,Math.min(1,parseFloat(e)));this.cache_.volume=t;this.techCall_("setVolume",t);if(t>0){this.lastVolume_(t)}return}t=parseFloat(this.techGet_("volume"));return isNaN(t)?1:t}muted(e){if(e!==undefined){this.techCall_("setMuted",e);return}return this.techGet_("muted")||false}defaultMuted(e){if(e!==undefined){return this.techCall_("setDefaultMuted",e)}return this.techGet_("defaultMuted")||false}lastVolume_(e){if(e!==undefined&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(e){if(e!==undefined){const t=this.isFullscreen_;this.isFullscreen_=Boolean(e);if(this.isFullscreen_!==t&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const t=this;return new Promise((i,s)=>{function n(){t.off("fullscreenerror",a);t.off("fullscreenchange",r)}function r(){n();i()}function a(e,t){n();s(t)}t.one("fullscreenchange",r);t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);if(o){o.then(n,n);o.then(i,s)}})}requestFullscreenHelper_(e){let t;if(!this.fsApi_.prefixed){t=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(e!==undefined){t=e}}if(this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);if(e){e.then(()=>this.isFullscreen(true),()=>this.isFullscreen(false))}return e}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const e=this;return new Promise((t,i)=>{function s(){e.off("fullscreenerror",r);e.off("fullscreenchange",n)}function n(){s();t()}function r(e,t){s();i(t)}e.one("fullscreenchange",n);e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();if(a){a.then(s,s);a.then(t,i)}})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=t[this.fsApi_.exitFullscreen]();if(e){Bt(e.then(()=>this.isFullscreen(false)))}return e}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=t.documentElement.style.overflow;$e(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow="hidden";ie(t.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(e){if(Tt.isEventKey(e,"Esc")){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;qe(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow=this.docOrigOverflow;se(t.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",e);this.options_.disablePictureInPicture=e;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==undefined){this.isInPictureInPicture_=!!e;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&e.documentPictureInPicture){const i=t.createElement(this.el().tagName);i.classList=this.el().classList;i.classList.add("vjs-pip-container");if(this.posterImage){i.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){i.appendChild(this.titleBar.el().cloneNode(true))}i.appendChild(J("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return e.documentPictureInPicture.requestWindow({initialAspectRatio:this.videoWidth()/this.videoHeight(),copyStyleSheets:true}).then(e=>{this.el_.parentNode.insertBefore(i,this.el_);e.document.body.append(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger("enterpictureinpicture");e.addEventListener("unload",e=>{const t=e.target.querySelector(".video-js");i.replaceWith(t);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")});return e})}if("pictureInPictureEnabled"in t&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(e.documentPictureInPicture&&e.documentPictureInPicture.window){e.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in t){return t.exitPictureInPicture()}}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys){return}const i=e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(t==="input"){return i.indexOf(e.type)===-1}const s=["textarea"];return s.indexOf(t)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof t.hotkeys==="function"){t.hotkeys.call(this,e)}else{this.handleHotkeys(e)}}handleHotkeys(e){const i=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:s=(e=>Tt.isEventKey(e,"f")),muteKey:n=(e=>Tt.isEventKey(e,"m")),playPauseKey:r=(e=>Tt.isEventKey(e,"k")||Tt.isEventKey(e,"Space"))}=i;if(s.call(this,e)){e.preventDefault();e.stopPropagation();const i=St.getComponent("FullscreenToggle");if(t[this.fsApi_.fullscreenEnabled]!==false){i.prototype.handleClick.call(this,e)}}else if(n.call(this,e)){e.preventDefault();e.stopPropagation();const t=St.getComponent("MuteToggle");t.prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault();e.stopPropagation();const t=St.getComponent("PlayToggle");t.prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=Fi.getTech(n);if(!r){r=St.getComponent(n)}if(!r){m.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(r.isSupported()){t=r.canPlayType(e);if(t){return t}}}return""}selectSource(e){const t=this.options_.techOrder.map(e=>{return[e,Fi.getTech(e)]}).filter(([e,t])=>{if(t){return t.isSupported()}m.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`);return false});const i=function(e,t,i){let s;e.some(e=>{return t.some(t=>{s=i(e,t);if(s){return true}})});return s};let s;const n=e=>(t,i)=>e(i,t);const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()])){return{source:i,tech:e}}};if(this.options_.sourceOrder){s=i(e,t,n(r))}else{s=i(t,e,r)}return s||false}handleSrc_(e,t){if(typeof e==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const i=as(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}this.changingSrc_=true;if(!t){this.cache_.sources=i}this.updateSourceCaches_(i[0]);Hi(this,i[0],(e,s)=>{this.middleware_=s;if(!t){this.cache_.sources=i}this.updateSourceCaches_(e);const n=this.src_(e);if(n){if(i.length>1){return this.handleSrc_(i.slice(1))}this.changingSrc_=false;this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);this.triggerReady();return}Wi(s,this.tech_)});if(i.length>1){const e=()=>{this.error(null);this.handleSrc_(i.slice(1),true)};const t=()=>{this.off("error",e)};this.one("error",e);this.one("playing",t);this.resetRetryOnError_=(()=>{this.off("error",e);this.off("playing",t)})}}src(e){return this.handleSrc_(e,false)}src_(e){const t=this.selectSource([e]);if(!t){return true}if(!gt(t.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(t.tech,t.source);this.tech_.ready(()=>{this.changingSrc_=false});return false}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",e)}else{this.techCall_("src",e.src)}this.changingSrc_=false},true);return false}load(){this.techCall_("load")}reset(){if(this.paused()){this.doReset_()}else{const e=this.play();Bt(e.then(()=>this.doReset_()))}}doReset_(){if(this.tech_){this.tech_.clearTracks("text")}this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();if(it(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{};const{seekBar:n}=i||{};if(e){e.updateContent()}if(t){t.updateContent()}if(s){s.updateContent()}if(n){n.update();if(n.loadProgressBar){n.loadProgressBar.update()}}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const e=this.currentSource();const t=[];if(Object.keys(e).length!==0){t.push(e)}return 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!==undefined){this.techCall_("setPreload",e);this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===undefined){return this.options_.autoplay||false}let t;if(typeof e==="string"&&/(any|play|muted)/.test(e)||e===true&&this.options_.normalizeAutoplay){this.options_.autoplay=e;this.manualAutoplay_(typeof e==="string"?e:"play");t=false}else if(!e){this.options_.autoplay=false}else{this.options_.autoplay=true}t=typeof t==="undefined"?this.options_.autoplay:t;if(this.tech_){this.techCall_("setAutoplay",t)}}playsinline(e){if(e!==undefined){this.techCall_("setPlaysinline",e);this.options_.playsinline=e;return this}return this.techGet_("playsinline")}loop(e){if(e!==undefined){this.techCall_("setLoop",e);this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===undefined){return this.poster_}if(!e){e=""}if(e===this.poster_){return}this.poster_=e;this.techCall_("setPoster",e);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";if(e!==this.poster_){this.poster_=e;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(e){if(e===undefined){return!!this.controls_}e=!!e;if(this.controls_===e){return}this.controls_=e;if(this.usingNativeControls()){this.techCall_("setControls",e)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}}usingNativeControls(e){if(e===undefined){return!!this.usingNativeControls_}e=!!e;if(this.usingNativeControls_===e){return}this.usingNativeControls_=e;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(e){if(e===undefined){return this.error_||null}n("beforeerror").forEach(t=>{const i=t(this,e);if(!(T(i)&&!Array.isArray(i)||typeof i==="string"||typeof i==="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i});if(this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],t);this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=e;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new Rt(e);this.addClass("vjs-error");m.error(`(CODE:${this.error_.code} ${Rt.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");n("error").forEach(e=>e(this,this.error_));return}reportUserActivity(e){this.userActivity_=true}userActive(e){if(e===undefined){return this.userActive_}e=!!e;if(e===this.userActive_){return}this.userActive_=e;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(e){e.stopPropagation();e.preventDefault()})}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let e;let t;let i;const s=Ye(this,this.reportUserActivity);const n=function(e){if(e.screenX!==t||e.screenY!==i){t=e.screenX;i=e.screenY;s()}};const r=function(){s();this.clearInterval(e);e=this.setInterval(s,250)};const a=function(t){s();this.clearInterval(e)};this.on("mousedown",r);this.on("mousemove",n);this.on("mouseup",a);this.on("mouseleave",a);const o=this.getChild("controlBar");if(o&&!q&&!A){o.on("mouseenter",function(e){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0});o.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",s);this.on("keyup",s);let l;this.setInterval(function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(l);const e=this.options_.inactivityTimeout;if(e<=0){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false)}},e)},250)}playbackRate(e){if(e!==undefined){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(e){if(e!==undefined){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(e){if(e!==undefined){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children();const t=this.getChild("ControlBar");const i=t&&t.currentHeight();e.forEach(e=>{if(e===t){return}if(e.el_&&!e.hasClass("vjs-hidden")){e.hide();this.audioOnlyCache_.hiddenChildren.push(e)}});this.audioOnlyCache_.playerHeight=this.currentHeight();this.height(i);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");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_}this.audioOnlyMode_=e;if(e){const e=[];if(this.isInPictureInPicture()){e.push(this.exitPictureInPicture())}if(this.isFullscreen()){e.push(this.exitFullscreen())}if(this.audioPosterMode()){e.push(this.audioPosterMode(false))}return Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){const e=this.tech_&&this.tech_;e.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const e=this.tech_&&this.tech_;e.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(e){if(typeof e!=="boolean"||e===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=e;if(e){if(this.audioOnlyMode()){const e=this.audioOnlyMode(false);return e.then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_){return this.tech_.addTextTrack(e,t,i)}}addRemoteTextTrack(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}}removeRemoteTextTrack(e={}){let{track:t}=e;if(!t){t=e}if(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===undefined){return this.language_}if(this.language_!==String(e).toLowerCase()){this.language_=String(e).toLowerCase();if(it(this)){this.trigger("languagechange")}}}languages(){return E(ar.prototype.options_.languages,this.languages_)}toJSON(){const e=E(this.options_);const t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let s=t[i];s=E(s);s.player=undefined;e.tracks[i]=s}return e}createModal(e,t){t=t||{};t.content=e||"";const i=new Ht(this,t);this.addChild(i);i.on("dispose",()=>{this.removeChild(i)});i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const e=this.currentBreakpoint();const t=this.currentWidth();for(let i=0;i<sr.length;i++){const s=sr[i];const n=this.breakpoints_[s];if(t<=n){if(e===s){return}if(e){this.removeClass(nr[e])}this.addClass(nr[s]);this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="";if(e){this.removeClass(e)}}breakpoints(e){if(e===undefined){return Object.assign(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=Object.assign({},rr,e);this.updateCurrentBreakpoint_();return Object.assign(this.breakpoints_)}responsive(e){if(e===undefined){return this.responsive_}e=Boolean(e);const t=this.responsive_;if(e===t){return}this.responsive_=e;if(e){this.on("playerresize",this.boundUpdateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.boundUpdateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return nr[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!=="object"){return}this.reset();this.cache_.media=E(e);const{artist:i,artwork:s,description:n,poster:r,src:a,textTracks:o,title:l}=this.cache_.media;if(!s&&r){this.cache_.media.artwork=[{src:r,type:ns(r)}]}if(a){this.src(a)}if(r){this.poster(r)}if(Array.isArray(o)){o.forEach(e=>this.addRemoteTextTrack(e,false))}if(this.titleBar){this.titleBar.update({title:l,description:n||i||""})}this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster();const t=this.currentSources();const i=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}));const s={src:t,textTracks:i};if(e){s.poster=e;s.artwork=[{src:s.poster,type:ns(s.poster)}]}return s}return E(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]};const i=ae(e);const s=i["data-setup"];if(te(e,"vjs-fill")){i.fill=true}if(te(e,"vjs-fluid")){i.fluid=true}if(s!==null){const[e,t]=Nt(s||"{}");if(e){m.error(e)}Object.assign(i,t)}Object.assign(t,i);if(e.hasChildNodes()){const i=e.childNodes;for(let e=0,s=i.length;e<s;e++){const s=i[e];const n=s.nodeName.toLowerCase();if(n==="source"){t.sources.push(ae(s))}else if(n==="track"){t.tracks.push(ae(s))}}}return t}debug(e){if(e===undefined){return this.debugEnabled_}if(e){this.trigger("debugon");this.previousLogLevel_=this.log.level;this.log.level("debug");this.debugEnabled_=true}else{this.trigger("debugoff");this.log.level(this.previousLogLevel_);this.previousLogLevel_=undefined;this.debugEnabled_=false}}playbackRates(e){if(e===undefined){return this.cache_.playbackRates}if(!Array.isArray(e)){return}if(!e.every(e=>typeof e==="number")){return}this.cache_.playbackRates=e;this.trigger("playbackrateschange")}}Mi.names.forEach(function(e){const t=Mi[e];ar.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});ar.prototype.crossorigin=ar.prototype.crossOrigin;ar.players={};const or=e.navigator;ar.prototype.options_={techOrder:Fi.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:or&&(or.languages&&or.languages[0]||or.userLanguage||or.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:false,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:false,audioOnlyMode:false,audioPosterMode:false};["ended","seeking","seekable","networkState","readyState"].forEach(function(e){ar.prototype[e]=function(){return this.techGet_(e)}});tr.forEach(function(e){ar.prototype[`handleTech${mt(e)}_`]=function(){return this.trigger(e)}});St.registerComponent("Player",ar);const lr="plugin";const ur="activePlugins_";const cr={};const dr=e=>cr.hasOwnProperty(e);const hr=e=>dr(e)?cr[e]:undefined;const fr=(e,t)=>{e[ur]=e[ur]||{};e[ur][t]=true};const pr=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t);e.trigger(s+":"+t.name,t)};const mr=function(e,t){const i=function(){pr(this,{name:e,plugin:t,instance:null},true);const i=t.apply(this,arguments);fr(this,e);pr(this,{name:e,plugin:t,instance:i});return i};Object.keys(t).forEach(function(e){i[e]=t[e]});return i};const gr=(e,t)=>{t.prototype.name=e;return function(...i){pr(this,{name:e,plugin:t,instance:null},true);const s=new t(...[this,...i]);this[e]=(()=>s);pr(this,s.getEventHash());return s}};class yr{constructor(e){if(this.constructor===yr){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=e;if(!this.log){this.log=this.player.log.createLogger(this.name)}dt(this);delete this.trigger;ft(this,this.constructor.defaultState);fr(e,this.name);this.dispose=this.dispose.bind(this);e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){e.name=this.name;e.plugin=this.constructor;e.instance=this;return e}trigger(e,t={}){return He(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[ur][e]=false;this.player=this.state=null;t[e]=gr(e,cr[e])}static isBasic(e){const t=typeof e==="string"?hr(e):e;return typeof t==="function"&&!yr.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(dr(e)){m.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`)}else if(ar.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}.`)}cr[e]=t;if(e!==lr){if(yr.isBasic(t)){ar.prototype[e]=mr(e,t)}else{ar.prototype[e]=gr(e,t)}}return t}static deregisterPlugin(e){if(e===lr){throw new Error("Cannot de-register base plugin.")}if(dr(e)){delete cr[e];delete ar.prototype[e]}}static getPlugins(e=Object.keys(cr)){let t;e.forEach(e=>{const i=hr(e);if(i){t=t||{};t[e]=i}});return t}static getPluginVersion(e){const t=hr(e);return t&&t.VERSION||""}}yr.getPlugin=hr;yr.BASE_PLUGIN_NAME=lr;yr.registerPlugin(lr,yr);ar.prototype.usingPlugin=function(e){return!!this[ur]&&this[ur][e]===true};ar.prototype.hasPlugin=function(e){return!!dr(e)};function _r(e,t){let i=false;return function(...s){if(!i){m.warn(e)}i=true;return t.apply(this,s)}}function vr(e,t,i,s){return _r(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}const br=e=>e.indexOf("#")===0?e.slice(1):e;function Tr(e,t,i){let s=Tr.getPlayer(e);if(s){if(t){m.warn(`Player "${e}" is already initialised. Options will not be applied.`)}if(i){s.ready(i)}return s}const r=typeof e==="string"?Te("#"+br(e)):e;if(!Y(r)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}if(!r.ownerDocument.defaultView||!r.ownerDocument.body.contains(r)){m.warn("The element supplied is not included in the DOM")}t=t||{};if(t.restoreEl===true){t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(true)}n("beforesetup").forEach(e=>{const i=e(r,E(t));if(!T(i)||Array.isArray(i)){m.error("please return an object in beforesetup hooks");return}t=E(t,i)});const a=St.getComponent("Player");s=new a(r,t,i);n("setup").forEach(e=>e(s));return s}Tr.hooks_=s;Tr.hooks=n;Tr.hook=r;Tr.hookOnce=o;Tr.removeHook=a;if(e.VIDEOJS_NO_DYNAMIC_STYLE!==true&&z()){let e=Te(".vjs-styles-defaults");if(!e){e=De("vjs-styles-defaults");const t=Te("head");if(t){t.insertBefore(e,t.firstChild)}Pe(e,`\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n `)}}Ae(1,Tr);Tr.VERSION=i;Tr.options=ar.prototype.options_;Tr.getPlayers=(()=>ar.players);Tr.getPlayer=(e=>{const t=ar.players;let i;if(typeof e==="string"){const s=br(e);const n=t[s];if(n){return n}i=Te("#"+s)}else{i=e}if(Y(i)){const{player:e,playerId:s}=i;if(e||t[s]){return e||t[s]}}});Tr.getAllPlayers=(()=>Object.keys(ar.players).map(e=>ar.players[e]).filter(Boolean));Tr.players=ar.players;Tr.getComponent=St.getComponent;Tr.registerComponent=((e,t)=>{if(Fi.isTech(t)){m.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}St.registerComponent.call(St,e,t)});Tr.getTech=Fi.getTech;Tr.registerTech=Fi.registerTech;Tr.use=qi;Object.defineProperty(Tr,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(Tr.middleware,"TERMINATOR",{value:$i,writeable:false,enumerable:true});Tr.browser=W;Tr.obj=k;Tr.mergeOptions=vr(9,"videojs.mergeOptions","videojs.obj.merge",E);Tr.defineLazyProperty=vr(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",I);Tr.bind=vr(9,"videojs.bind","native Function.prototype.bind",Ye);Tr.registerPlugin=yr.registerPlugin;Tr.deregisterPlugin=yr.deregisterPlugin;Tr.plugin=((e,t)=>{m.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return yr.registerPlugin(e,t)});Tr.getPlugins=yr.getPlugins;Tr.getPlugin=yr.getPlugin;Tr.getPluginVersion=yr.getPluginVersion;Tr.addLanguage=function(e,t){e=(""+e).toLowerCase();Tr.options.languages=E(Tr.options.languages,{[e]:t});return Tr.options.languages[e]};Tr.log=m;Tr.createLogger=g;Tr.time=xt;Tr.createTimeRange=vr(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ct);Tr.createTimeRanges=vr(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ct);Tr.formatTime=vr(9,"videojs.formatTime","videojs.time.formatTime",Pt);Tr.setFormatTime=vr(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ot);Tr.resetFormatTime=vr(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dt);Tr.parseUrl=vr(9,"videojs.parseUrl","videojs.url.parseUrl",ni);Tr.isCrossOrigin=vr(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",oi);Tr.EventTarget=et;Tr.any=Ge;Tr.on=$e;Tr.one=We;Tr.off=qe;Tr.trigger=He;Tr.xhr=vi;Tr.TextTrack=Di;Tr.AudioTrack=Pi;Tr.VideoTrack=xi;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{Tr[e]=function(){m.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`);return Ie[e].apply(null,arguments)}});Tr.computedStyle=vr(9,"videojs.computedStyle","videojs.dom.computedStyle",Ee);Tr.dom=Ie;Tr.fn=Je;Tr.num=Ds;Tr.str=yt;Tr.url=li;return Tr});var r=e.videojs;var a=function(i){"use strict";function s(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var n=s(i);var r="1.7.3";function a(){a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){e[s]=i[s]}}}return e};return a.apply(this,arguments)}var o=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"});var l=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,128,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,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,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function u(e){return a({muted:false,timeout:250,inline:false},e)}function c(e,t){var i=e.muted,s=e.timeout,n=e.inline;var r=t(),a=r.element,o=r.source;var l=void 0;var u=void 0;var c=void 0;a.muted=i;if(i===true){a.setAttribute("muted","muted")}if(n===true){a.setAttribute("playsinline","playsinline")}a.src=o;return new Promise(function(e){l=a.play();u=setTimeout(function(){c(false,new Error("Timeout "+s+" ms has been reached"))},s);c=function t(i){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;a.remove();a.srcObject=null;clearTimeout(u);e({result:i,error:s})};if(l!==undefined){l.then(function(){return c(true)}).catch(function(e){return c(false,e)})}else{c(true)}})}function d(e){e=u(e);return c(e,function(){return{element:t.createElement("video"),source:URL.createObjectURL(l)}})}function h(e){e=u(e);return c(e,function(){return{element:t.createElement("audio"),source:URL.createObjectURL(o)}})}var f={audio:h,video:d};const p=[{inline:false,muted:false},{inline:true,muted:false},{inline:false,muted:true},{inline:true,muted:true}];function m(e){const t=e.filter(e=>e.passed)[0];if(!t){return{always:false,sometimes:false,never:true,inline:false,muted:false}}const{inline:i,muted:s}=t;const n=!i&&!s;return{always:n,sometimes:!n,never:false,inline:i,muted:s}}function g(t){let i;if(e.cast&&e.cast.receiver){i={always:true,sometimes:false,never:false,inline:false,muted:false}}if(t.ANDROID_VERSION||t.IS_IOS){i={always:false,sometimes:true,never:false,inline:false,muted:true};if(t.IS_IPHONE){i.inline=true}}if(i){return Promise.resolve(i)}}function y(e,t){if(e!=="video"&&e!=="audio"){throw new Error(`invalid autoplay type: ${e}`)}const i=g(t.browser);if(i){return i}const s=p.map(t=>{return f[e](t).then(({result:e})=>{return a({passed:e},t)})});return Promise.all(s).then(e=>{return m(e)})}const _=e.performance;const v={};["memory","navigation","timing"].forEach(e=>{v[e]=_&&_[e]||{}});["clearMarks","clearMeasures","clearResourceTimings","getEntries","getEntriesByName","getEntriesByType","mark","measure","now","setResourceTimingBufferSize","toJSON"].forEach(e=>{v[e]=((...t)=>{if(_&&_[e]){return _[e](...t)}})});function b(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function S(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function E(e,t,i,s){t=t||"&";i=i||"=";if(e===null){e=undefined}if(typeof e==="object"){return I(k(e),function(s){var n=encodeURIComponent(S(s))+i;if(T(e[s])){return I(e[s],function(e){return n+encodeURIComponent(S(e))}).join(t)}else{return n+encodeURIComponent(S(e[s]))}}).join(t)}if(!s)return"";return encodeURIComponent(S(s))+i+encodeURIComponent(S(e))}function I(e,t){if(e.map)return e.map(t);var i=[];for(var s=0;s<e.length;s++){i.push(t(e[s],s))}return i}var k=Object.keys||function(e){var t=[];for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i))t.push(i)}return t};function C(e,t,i,s){t=t||"&";i=i||"=";var n={};if(typeof e!=="string"||e.length===0){return n}var r=/\+/g;e=e.split(t);var a=1e3;if(s&&typeof s.maxKeys==="number"){a=s.maxKeys}var o=e.length;if(a>0&&o>a){o=a}for(var l=0;l<o;++l){var u=e[l].replace(r,"%20"),c=u.indexOf(i),d,h,f,p;if(c>=0){d=u.substr(0,c);h=u.substr(c+1)}else{d=u;h=""}f=decodeURIComponent(d);p=decodeURIComponent(h);if(!b(n,f)){n[f]=p}else if(T(n[f])){n[f].push(p)}else{n[f]=[n[f],p]}}return n}var w={encode:E,stringify:E,decode:C,parse:C};function A(t=e&&e.location||{}){let i;let s;try{i=w.parse((t.hash||"#").substr(1))}catch(e){i={}}try{s=w.parse((t.search||"?").substr(1))}catch(e){s={}}return a({hash:i,search:s},w)}const O={isArr(e){return Array.isArray(e)},isFn(e){return typeof e==="function"},isNil(e){return e===null||e===undefined},isNum(e){return typeof e==="number"&&e===e},isNonEmptyStr(e){return typeof e==="string"&&/\S/.test(e)},isObj(e){return Object.prototype.toString.call(e)==="[object Object]"}};const D=(e,t)=>{if(e){const i=Number(e.substring(0,e.indexOf(".")));if(i){return i>=t}n["default"].log.warn("Plugin VERSION string format does not conform to semantic versioning standards and cannot be checked.")}return false};const P=e=>{return e==="application/vnd.apple.mpegurl"||e==="application/x-mpegURL"};const x=(e,t)=>{const i=e&&e.encryption&&e.encryption.method;if(typeof i==="string"){return i.toLowerCase()==="aes-128"}const s=t.url.parseUrl(e.src);return s.hostname.indexOf("boltdns.net")!==-1&&s.pathname.indexOf("/aes128/")!==-1};var L={isHlsType:P,isEncryptedHls:x};const R=()=>{const t=e.GestureEvent;return!!(t&&e.WebKitMediaKeys&&e.WebKitMediaKeys.isTypeSupported("com.apple.fps.1_0","video/mp4"))};const N=t=>{return t.browser.IS_EDGE&&/Chrome/i.test(e.navigator.userAgent)};const M=t=>{return e.navigator.requestMediaKeySystemAccess&&!t.browser.IS_IOS&&(t.browser.IS_FIREFOX||t.browser.IS_CHROME||N(t))};const U=t=>{return e.SourceBuffer&&e.SourceBuffer.prototype&&typeof e.SourceBuffer.prototype.changeType==="function"};const B=()=>{return e.MediaSource&&e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.90"')};const F=e=>{return e.isSecureContext||!/^http:/.test(e.location.href)};let j;const V=()=>{j=undefined};const $=e=>{if(j!==undefined){return j}const i=t.createElement("video");const s=e.options.hls&&e.options.hls.overrideNative;if(i&&i.canPlayType){j=!s&&/probably|maybe/i.test(i.canPlayType("application/vnd.apple.mpegurl"))}else{j=false}return j};var q={isSafariWithFairplaySupport:R,isChromiumEdge:N,isBrowserWithWidevineSupport:M,isCodecSwitchingSupported:U,isHevcSupported:B,preferHttps:F,isNativeHlsSupported:$,clearCachedIsNativeHlsSupported:V};var H=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var W=function t(i){return e.atob?e.atob(i):Buffer.from(i,"base64").toString("binary")};function G(e){var t=W(e);var i=new Uint8Array(t.length);for(var s=0;s<t.length;s++){i[s]=t.charCodeAt(s)}return i}class K extends H{constructor(){super();this.buffer=""}push(e){let t;this.buffer+=e;t=this.buffer.indexOf("\n");for(;t>-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const z=String.fromCharCode(9);const Y=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const X=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const Q=function(e){const t={};if(!e){return t}const i=e.split(X());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).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");t[n[0]]=n[1]}return t};class J extends H{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(e){let t;let i;e=e.trim();if(e.length===0){return}if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}const s=this.tagMappers.reduce((t,i)=>{const s=i(e);if(s===e){return t}return t.concat([s])},[e]);s.forEach(e=>{for(let t=0;t<this.customParsers.length;t++){if(this.customParsers[t].call(this,e)){return}}if(e.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:e.slice(1)});return}e=e.replace("\r","");t=/^#EXTM3U/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"m3u"});return}t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"inf"};if(t[1]){i.duration=parseFloat(t[1])}if(t[2]){i.title=t[2]}this.trigger("data",i);return}t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"targetduration"};if(t[1]){i.duration=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"version"};if(t[1]){i.version=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"media-sequence"};if(t[1]){i.number=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"discontinuity-sequence"};if(t[1]){i.number=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"playlist-type"};if(t[1]){i.playlistType=t[1]}this.trigger("data",i);return}t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e);if(t){i=a(Y(t[1]),{type:"tag",tagType:"byterange"});this.trigger("data",i);return}t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e);if(t){i={type:"tag",tagType:"allow-cache"};if(t[1]){i.allowed=!/NO/.test(t[1])}this.trigger("data",i);return}t=/^#EXT-X-MAP:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"map"};if(t[1]){const e=Q(t[1]);if(e.URI){i.uri=e.URI}if(e.BYTERANGE){i.byterange=Y(e.BYTERANGE)}}this.trigger("data",i);return}t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"stream-inf"};if(t[1]){i.attributes=Q(t[1]);if(i.attributes.RESOLUTION){const e=i.attributes.RESOLUTION.split("x");const t={};if(e[0]){t.width=parseInt(e[0],10)}if(e[1]){t.height=parseInt(e[1],10)}i.attributes.RESOLUTION=t}if(i.attributes.BANDWIDTH){i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)}if(i.attributes["FRAME-RATE"]){i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])}if(i.attributes["PROGRAM-ID"]){i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10)}}this.trigger("data",i);return}t=/^#EXT-X-MEDIA:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"media"};if(t[1]){i.attributes=Q(t[1])}this.trigger("data",i);return}t=/^#EXT-X-ENDLIST/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"endlist"});return}t=/^#EXT-X-DISCONTINUITY/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"program-date-time"};if(t[1]){i.dateTimeString=t[1];i.dateTimeObject=new Date(t[1])}this.trigger("data",i);return}t=/^#EXT-X-KEY:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"key"};if(t[1]){i.attributes=Q(t[1]);if(i.attributes.IV){if(i.attributes.IV.substring(0,2).toLowerCase()==="0x"){i.attributes.IV=i.attributes.IV.substring(2)}i.attributes.IV=i.attributes.IV.match(/.{8}/g);i.attributes.IV[0]=parseInt(i.attributes.IV[0],16);i.attributes.IV[1]=parseInt(i.attributes.IV[1],16);i.attributes.IV[2]=parseInt(i.attributes.IV[2],16);i.attributes.IV[3]=parseInt(i.attributes.IV[3],16);i.attributes.IV=new Uint32Array(i.attributes.IV)}}this.trigger("data",i);return}t=/^#EXT-X-START:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"start"};if(t[1]){i.attributes=Q(t[1]);i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]);i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)}this.trigger("data",i);return}t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-out-cont"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-out"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-in"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-SKIP:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"skip"};i.attributes=Q(t[1]);if(i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)}if(i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(z)}this.trigger("data",i);return}t=/^#EXT-X-PART:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"part"};i.attributes=Q(t[1]);["DURATION"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});["INDEPENDENT","GAP"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=/YES/.test(i.attributes[e])}});if(i.attributes.hasOwnProperty("BYTERANGE")){i.attributes.byterange=Y(i.attributes.BYTERANGE)}this.trigger("data",i);return}t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"server-control"};i.attributes=Q(t[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=/YES/.test(i.attributes[e])}});this.trigger("data",i);return}t=/^#EXT-X-PART-INF:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"part-inf"};i.attributes=Q(t[1]);["PART-TARGET"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});this.trigger("data",i);return}t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"preload-hint"};i.attributes=Q(t[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t=e==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{};i.attributes.byterange[t]=i.attributes[e];delete i.attributes[e]}});this.trigger("data",i);return}t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"rendition-report"};i.attributes=Q(t[1]);["LAST-MSN","LAST-PART"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10)}});this.trigger("data",i);return}this.trigger("data",{type:"tag",data:e.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:s}){if(typeof i!=="function"){i=(e=>e)}this.customParsers.push(n=>{const r=e.exec(n);if(r){this.trigger("data",{type:"custom",data:i(n),customType:t,segment:s});return true}})}addTagMapper({expression:e,map:t}){const i=i=>{if(e.test(i)){return t(i)}return i};this.tagMappers.push(i)}}const Z=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const ee=function(e){const t={};Object.keys(e).forEach(function(i){t[Z(i)]=e[i]});return t};const te=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]<o){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`});t[r]=o}if(s&&!t.hasOwnProperty(a)){t[a]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})}if(s&&t[a]<l){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`});t[a]=l}};class ie extends H{constructor(){super();this.lineStream=new K;this.parseStream=new J;this.lineStream.pipe(this.parseStream);const e=this;const t=[];let i={};let s;let n;let r=false;const o=function(){};const l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const u="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let c=0;this.manifest={allowCache:true,discontinuityStarts:[],segments:[]};let d=0;let h=0;this.on("end",()=>{if(i.uri||!i.parts&&!i.preloadHints){return}if(!i.map&&s){i.map=s}if(!i.key&&n){i.key=n}if(!i.timeline&&typeof c==="number"){i.timeline=c}this.manifest.preloadSegment=i});this.parseStream.on("data",function(f){let p;let m;({tag(){(({version(){if(f.version){this.manifest.version=f.version}},"allow-cache"(){this.manifest.allowCache=f.allowed;if(!("allowed"in f)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in f){i.byterange=e;e.length=f.length;if(!("offset"in f)){f.offset=d}}if("offset"in f){i.byterange=e;e.offset=f.offset}d=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(f.duration>0){i.duration=f.duration}if(f.duration===0){i.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=t},key(){if(!f.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(f.attributes.METHOD==="NONE"){n=null;return}if(!f.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(f.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:f.attributes};return}if(f.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:f.attributes.URI};return}if(f.attributes.KEYFORMAT===u){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(f.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(f.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(f.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(f.attributes.KEYID&&f.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:f.attributes.KEYFORMAT,keyId:f.attributes.KEYID.substring(2)},pssh:G(f.attributes.URI.split(",")[1])};return}if(!f.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}n={method:f.attributes.METHOD||"AES-128",uri:f.attributes.URI};if(typeof f.attributes.IV!=="undefined"){n.iv=f.attributes.IV}},"media-sequence"(){if(!isFinite(f.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+f.number});return}this.manifest.mediaSequence=f.number},"discontinuity-sequence"(){if(!isFinite(f.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+f.number});return}this.manifest.discontinuitySequence=f.number;c=f.number},"playlist-type"(){if(!/VOD|EVENT/.test(f.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+f.playlist});return}this.manifest.playlistType=f.playlistType},map(){s={};if(f.uri){s.uri=f.uri}if(f.byterange){s.byterange=f.byterange}if(n){s.key=n}},"stream-inf"(){this.manifest.playlists=t;this.manifest.mediaGroups=this.manifest.mediaGroups||l;if(!f.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!i.attributes){i.attributes={}}a(i.attributes,f.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||l;if(!(f.attributes&&f.attributes.TYPE&&f.attributes["GROUP-ID"]&&f.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[f.attributes.TYPE];e[f.attributes["GROUP-ID"]]=e[f.attributes["GROUP-ID"]]||{};p=e[f.attributes["GROUP-ID"]];m={default:/yes/i.test(f.attributes.DEFAULT)};if(m.default){m.autoselect=true}else{m.autoselect=/yes/i.test(f.attributes.AUTOSELECT)}if(f.attributes.LANGUAGE){m.language=f.attributes.LANGUAGE}if(f.attributes.URI){m.uri=f.attributes.URI}if(f.attributes["INSTREAM-ID"]){m.instreamId=f.attributes["INSTREAM-ID"]}if(f.attributes.CHARACTERISTICS){m.characteristics=f.attributes.CHARACTERISTICS}if(f.attributes.FORCED){m.forced=/yes/i.test(f.attributes.FORCED)}p[f.attributes.NAME]=m},discontinuity(){c+=1;i.discontinuity=true;this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=f.dateTimeString;this.manifest.dateTimeObject=f.dateTimeObject}i.dateTimeString=f.dateTimeString;i.dateTimeObject=f.dateTimeObject},targetduration(){if(!isFinite(f.duration)||f.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+f.duration});return}this.manifest.targetDuration=f.duration;te.call(this,this.manifest)},start(){if(!f.attributes||isNaN(f.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:f.attributes["TIME-OFFSET"],precise:f.attributes.PRECISE}},"cue-out"(){i.cueOut=f.data},"cue-out-cont"(){i.cueOutCont=f.data},"cue-in"(){i.cueIn=f.data},skip(){this.manifest.skip=ee(f.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",f.attributes,["SKIPPED-SEGMENTS"])},part(){r=true;const e=this.manifest.segments.length;const t=ee(f.attributes);i.parts=i.parts||[];i.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=h}h=t.byterange.offset+t.byterange.length}const s=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${s} for segment #${e}`,f.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=ee(f.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}te.call(this,this.manifest);if(e.canSkipDateranges&&!e.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 e=this.manifest.segments.length;const t=ee(f.attributes);const s=t.type&&t.type==="PART";i.preloadHints=i.preloadHints||[];i.preloadHints.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=s?h:0;if(s){h=t.byterange.offset+t.byterange.length}}}const n=i.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${e}`,f.attributes,["TYPE","URI"]);if(!t.type){return}for(let s=0;s<i.preloadHints.length-1;s++){const r=i.preloadHints[s];if(!r.type){continue}if(r.type===t.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${t.type} as preload hint #${s}`})}}},"rendition-report"(){const e=ee(f.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1;const i=["LAST-MSN","URI"];if(r){i.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,f.attributes,i)},"part-inf"(){this.manifest.partInf=ee(f.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",f.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}te.call(this,this.manifest)}})[f.tagType]||o).call(e)},uri(){i.uri=f.uri;t.push(i);if(this.manifest.targetDuration&&!("duration"in i)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});i.duration=this.manifest.targetDuration}if(n){i.key=n}i.timeline=c;if(s){i.map=s}h=0;i={}},comment(){},custom(){if(f.segment){i.custom=i.custom||{};i.custom[f.customType]=f.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[f.customType]=f.data}}})[f.type].call(e)})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){s.push(e)}});if(s.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}function se(e){const{xhr:t}=n["default"];return new Promise((i,s)=>{t(e,(t,n)=>{if(t||n.statusCode!==200||!n.body){const i=n.statusCode||"";const r=t&&t.message?t.message:"";const a=new Error(`downloadManifest: xhr for manifest at ${e} failed ${i?"with status: "+i:""} ${r}.`);return s(a)}i(n.body)})})}function ne(e){const t=new ie;t.push(e);t.end();return t.manifest}var re={downloadManifest:se,parseHlsManifest:ne};const ae={perf:v,qs:A,isValidVersion:D,assign(...e){return a(...e)},get(e,t,i){let s=e;const n=t.split(".");if(!s){return i}for(let e=0;e<n.length;e++){const t=n[e];if(s[t]===undefined){return i}if(e+1<n.length){s=s[t]}else{return s[t]}}},withoutNilValues(e){let t=e;if(O.isArr(e)){t=e.filter(e=>!O.isNil(e)).map(ae.withoutNilValues)}else if(O.isObj(e)){t={};Object.keys(e).forEach(i=>{if(!O.isNil(e[i])){t[i]=ae.withoutNilValues(e[i])}})}return t},debounce(t,i,s,n=e){let r;return function(){const e=this;const a=arguments;let o=function(){r=null;o=null;if(!s){t.apply(e,a)}};if(!r&&s){t.apply(e,a)}n.clearTimeout(r);r=n.setTimeout(o,i)}},throttle(e,t){let i=Date.now();return function(...s){const n=Date.now();if(n-i>=t){e(...s);i=n}}}};ae.assign(ae,O,L,q,re);ae.VERSION="n/a";const oe="bc-style-vjs";function le(i,s,n){const{classNames:r}=i;if(!s&&!n&&s!==0&&n!==0){return}let a=t.querySelector("."+r.playerInstanceDimensions);if(!a){a=t.createElement("style");a.className=r.playerInstanceDimensions;const e=t.querySelector("."+r.playerStyle)||t.querySelector("."+oe);if(e){e.parentNode.insertBefore(a,e.nextSibling)}else{t.head.appendChild(a)}}else if(a.innerText){if(!s&&s!==0){const t=/width:(\d+)px;/g.exec(a.innerText);if(t&&t[1]){s=e.parseInt(t[1],10)}}else if(!n&&n!==0){const t=/height:(\d+)px;/g.exec(a.innerText);if(t&&t[1]){n=e.parseInt(t[1],10)}}}let o="."+r.playerInstance+"{";if(s||s===0){o+="width:"+e.parseInt(s,10)+"px;"}if(n||n===0){o+="height:"+e.parseInt(n,10)+"px;"}o+="}";a.innerText=o}const ue=3;const ce=50;const de=i=>{const s=t.body;const n=t.createElement("div");n.className="ads ad adsbox doubleclick ad-placement carbon-ads adglare pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text_ads_2 text-ads text-ad-links";n.innerHTML=" ";n.setAttribute("style","height:10px!important;font-size:20px;color:transparent;position:fixed;bottom:0;left:-10000px");let r=0;const a=()=>{r++;const t=n.offsetHeight===0||!s.contains(n)||n.style.display==="none"||n.style.visibility==="hidden";if(t||r===ue){if(n.parentNode){n.parentNode.removeChild(n)}return i(t)}e.setTimeout(a,ce)};s.appendChild(n);a()};let he=null;let fe;function pe(e){if(e||!fe){fe=new Promise(e=>{if(t.readyState==="complete"||t.readyState!=="loading"&&!t.documentElement.doScroll){de(e)}else{t.addEventListener("DOMContentLoaded",()=>{de(e)})}})}return fe.then(e=>{he=e;return e})}Object.defineProperties(pe,{VERSION:{enumerable:true,value:"n/a"},lastResult:{enumerable:true,get(){return he}},mightBe:{enumerable:true,get(){return he!==false}},mightNotBe:{enumerable:true,get(){return he!==true}}});const me=function(t){const i=e.matchMedia("(hover)");let s=true;if(i.media!=="not all"){s=i.matches}return s||t.browser.IS_FIREFOX&&t.browser.IS_WINDOWS};const ge="vjs-waiting-for-autoplay";function ye(e,t,i,s){return e.hasAttribute("data-debug")||t.debug!==undefined||i.debug||s.debug}function _e(i,s,n,r){const{settings:a,environment:o}=s;const{embedId:l,playerId:u}=a;const{isInBcFrame:c,queryString:d,urlHash:h}=o;const f=`bc-player-${u}_${l}`;const p=`${f}-index-${a.playerIndex}`;ae.perf.mark("bcInitStart");a.classNames={player:f,playerStyle:`bc-style-${u}-${l}`,playerInstance:p,playerInstanceDimensions:`${p}-video-dimensions`};a.embedState={controls:n.hasAttribute("controls")||n.hasAttribute("data-controls"),loop:n.hasAttribute("loop"),muted:n.hasAttribute("muted"),playsinline:n.hasAttribute("playsinline"),poster:n.hasAttribute("poster"),sources:!!n.querySelector("source"),tracks:!!n.querySelector("track")};r.debug=ye(n,d,r,a);if(n.hasAttribute("data-vttjs")&&ae.isNonEmptyStr(n.getAttribute("data-vttjs"))){r["vtt.js"]=n.getAttribute("data-vttjs")}else if(d.vttjs&&ae.isNonEmptyStr(d.vttjs)){r["vtt.js"]=d.vttjs}else if(r.hasOwnProperty("vtt.js")||r.hasOwnProperty("vttjs")){r["vtt.js"]=r["vtt.js"]||r.vttjs}else if(a["vtt.js"]||a.vttjs){r["vtt.js"]=a["vtt.js"]||a.vttjs}else{r["vtt.js"]="https://players.brightcove.net/videojs-vtt.js/0.15.4/vtt.global.min.js"}if(a.playButton){const{hover:e,shape:t,position:s}=a.playButton;if(e==="glow"){i.dom.addClass(n,"vjs-play-button-hover-glow")}else if(e==="darken"){i.dom.addClass(n,"vjs-play-button-hover-darken")}if(t==="square"){i.dom.addClass(n,"vjs-play-button-shape-square")}else if(t==="rectangle"){i.dom.addClass(n,"vjs-play-button-shape-rectangle")}if(s==="topRight"){i.dom.addClass(n,"vjs-play-button-position-top-right")}else if(s==="topLeft"){i.dom.addClass(n,"vjs-play-button-position-top-left")}}if(d.crossorigin!==undefined||a.media&&a.media.tracks&&i.browser.IS_ANY_SAFARI){a.crossorigin=true}if(a.crossorigin){n.setAttribute("crossorigin","anonymous")}if(a.audioPosterMode){r.audioPosterMode=a.audioPosterMode}if(a.audioOnlyMode){r.audioOnlyMode=a.audioOnlyMode}const m=h.t||d.t||n.getAttribute("data-start-time");if(/^[\d]+$/.test(m)){a.startTime=Number(m)}else if(/^(\d+h)?(\d+m)?(\d+s)?$/.test(m)){a.startTime=m}const g=d.adConfigId;const y=n.getAttribute("data-ad-config-id");if(ae.isNonEmptyStr(g)){a.adConfigId=g}else if(ae.isNonEmptyStr(y)){a.adConfigId=y}if(typeof a.adConfigId==="string"){a.adConfigId=a.adConfigId.trim()}if(!ae.isNonEmptyStr(a.adConfigId)){a.adConfigId=null}if(a.usingAdFailover&&!pe.mightBe){a.adConfigId=null}const _=d.deliveryConfigId;const v=n.getAttribute("data-delivery-config-id");if(ae.isNonEmptyStr(_)){a.deliveryConfigId=_}else if(ae.isNonEmptyStr(v)){a.deliveryConfigId=v}if(typeof a.deliveryConfigId==="string"){a.deliveryConfigId=a.deliveryConfigId.trim()}if(!ae.isNonEmptyStr(a.deliveryConfigId)){a.deliveryConfigId=null}a.applicationId=d.applicationId||n.getAttribute("data-application-id")||a.applicationId;const b=ae.qs();if(n.hasAttribute("autoplay")){r.autoplay=true}else if(c&&b.search.hasOwnProperty("autoplay")){if(b.search.autoplay==="true"||!b.search.autoplay){r.autoplay=true}else if(b.search.autoplay==="false"){r.autoplay=false}else{r.autoplay=b.search.autoplay}}else if(!r.hasOwnProperty("autoplay")){r.autoplay=a.autoplay||false}if(r.autoplay){i.dom.addClass(n,ge)}if(d.preload){r.preload=d.preload}else if(!r.hasOwnProperty("preload")&&a.preload){r.preload=a.preload}r.height=n.getAttribute("height")||undefined;r.width=n.getAttribute("width")||undefined;if(!c&&n&&(r.width||r.height)){le(a,r.width,r.height)}["loop","muted","playsinline"].forEach(function(e){if(d[e]!==undefined&&d[e]!=="false"||a[e]||a.embedState[e]||r[e]){r[e]=true}else{r[e]=false}});if(r.autoplay){r.playsinline=true}if(r.playsinline){n.setAttribute("playsinline","playsinline")}if(r.muted){n.setAttribute("muted","muted");n.muted=true}if(c){if(d.language){r.language=d.language}else if(ae.isNonEmptyStr(t.documentElement.lang)){r.language=t.documentElement.lang}else{r.language=e.navigator.language}t.documentElement.lang=r.language}else if(n.hasAttribute("language")){r.language=n.getAttribute("language");i.log.warn("Use of the language attribute on the video embed is invalid. Please use the lang attribute instead.")}else if(!r.hasOwnProperty("language")&&ae.isNonEmptyStr(a.language)){r.language=a.language}const T=n.getAttribute("data-bumper-id");const S=d.bumperId;const E=a.videoCloud?a.videoCloud.bumper:undefined;if(T||S||E){a.videoCloud=a.videoCloud||{};a.videoCloud.bumper=E&&typeof E==="object"?E:{};const e=T||S||E.id||E;if(typeof e==="string"){a.videoCloud.bumper.id=e}else{i.log.error("Bumper id must be a string")}}const{media:I}=a;if(I&&I.poster&&I.poster.highres&&!n.poster){if(/(https?:)?\/\//.test(I.poster.highres)){r.poster=I.poster.highres}else{r.poster=s.environment.scriptBaseUrl+"/"+I.poster.highres}if(i.browser.IS_IPHONE){n.poster=r.poster}}if(I&&I.tracks){I.tracks.forEach(function(e){n.appendChild(i.dom.createEl("track",{},{default:e.default?e.default:"",label:e.label?e.label:"",kind:"captions",src:e.src,srclang:e.srclang}))})}if(I&&I.src){r.sources=[I.src]}else if(I&&I.sources){r.sources=I.sources}r.runtime_=s;r.html5=r.html5||{};if(!(i.browser.IS_ANY_SAFARI||i.browser.IS_IOS)){r.html5.nativeCaptions=false}if(a.vhs!==false){if(!r.flash){r.flash={}}if(!r.flash.swf){r.flash.swf=`${a.playersCDN}/videojs-flashls-source-handler/1.4.8/video-js.swf`}}i.options.vhs=i.options.vhs||{};r.html5=r.html5||{};r.html5.vhs=r.html5.vhs||{};if(a.vhs&&typeof a.vhs==="object"){r.html5.vhs=a.vhs}if(i.browser.IS_ANDROID&&i.options.vhs.enableLowInitialPlaylist===undefined&&r.html5.vhs.enableLowInitialPlaylist===undefined){r.html5.vhs.enableLowInitialPlaylist=true}if(!(i.browser.IS_ANY_SAFARI||i.browser.IS_IOS)&&i.options.vhs.overrideNative===undefined&&r.html5.vhs.overrideNative===undefined){r.html5.vhs.overrideNative=true}if(i.options.vhs.experimentalLLHLS===undefined&&r.html5.vhs.experimentalLLHLS===undefined){r.html5.vhs.experimentalLLHLS=true}if(i.options.vhs.experimentalBufferBasedABR===undefined&&r.html5.vhs.experimentalBufferBasedABR===undefined){r.html5.vhs.experimentalBufferBasedABR=true}r.html5.initialBandwidth=typeof r.html5.initialBandwidth==="number"?r.html5.initialBandwidth:a.initialBandwidth;r.inactivityTimeout=5e3;if(!me(i)){r.inactivityTimeout=0}r.controls=c?true:a.embedState.controls;r.persistTextTrackSettings=true;r.sourceOrder=true;r.userActions={hotkeys:{}};if(a.fullscreenControl===false){r.userActions.doubleClick=false}const k=s.environment.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i);r.nativeControlsForTouch=i.browser.IS_ANDROID&&i.browser.ANDROID_VERSION<5&&k&&k[2]>0;const C=i.getPluginVersion("ima3");r.normalizeAutoplay=C?ae.isValidVersion(C,4):true;["controlBar","flash","liveui","playbackRates","responsive","suppressNotSupportedError","techOrder"].forEach(e=>{if(a.hasOwnProperty(e)){r[e]=a[e]}});return r}const ve=n["default"].getComponent("MenuItem");class be extends ve{handleClick(t){super.handleClick();this.options_.listener();e.setTimeout(()=>{this.player().contextmenuUI.menu.dispose()},1)}}const Te=n["default"].getComponent("Menu");const Se=n["default"].dom||n["default"];class Ee extends Te{constructor(t,i){super(t,i);this.dispose=n["default"].bind(this,this.dispose);i.content.forEach(i=>{let s=function(){};if(typeof i.listener==="function"){s=i.listener}else if(typeof i.href==="string"){s=(()=>e.open(i.href))}this.addItem(new be(t,{label:i.label,listener:n["default"].bind(t,s)}))})}createEl(){const e=super.createEl();Se.addClass(e,"vjs-contextmenu-ui-menu");e.style.left=this.options_.position.left+"px";e.style.top=this.options_.position.top+"px";return e}}function Ie(i){let s;if(i.getBoundingClientRect&&i.parentNode){s=i.getBoundingClientRect()}if(!s){return{left:0,top:0}}const n=t.documentElement;const r=t.body;const a=n.clientLeft||r.clientLeft||0;const o=e.pageXOffset||r.scrollLeft;const l=s.left+o-a;const u=n.clientTop||r.clientTop||0;const c=e.pageYOffset||r.scrollTop;const d=s.top+c-u;return{left:Math.round(l),top:Math.round(d)}}function ke(e,t){const i={};const s=Ie(e);const n=e.offsetWidth;const r=e.offsetHeight;const a=s.top;const o=s.left;let l=t.pageY;let u=t.pageX;if(t.changedTouches){u=t.changedTouches[0].pageX;l=t.changedTouches[0].pageY}i.y=Math.max(0,Math.min(1,(a-l+r)/r));i.x=Math.max(0,Math.min(1,(u-o)/n));return i}var Ce="6.0.0";function we(e){return e.hasOwnProperty("contextmenuUI")&&e.contextmenuUI.hasOwnProperty("menu")&&e.contextmenuUI.menu.el()}function Ae(e){const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"}function Oe(e,t){return{left:Math.round(t.width*e.x),top:Math.round(t.height-t.height*e.y)}}function De(e){if(we(this)){this.contextmenuUI.menu.dispose();return}if(this.contextmenuUI.options_.excludeElements(e.target)){return}const i=ke(this.el(),e);const s=this.el().getBoundingClientRect();const r=Oe(i,s);const a=n["default"].browser.IS_FIREFOX?t.documentElement:t;e.preventDefault();const o=this.contextmenuUI.menu=new Ee(this,{content:this.contextmenuUI.content,position:r});this.contextmenuUI.closeMenu=(()=>{n["default"].log.warn("player.contextmenuUI.closeMenu() is deprecated, please use player.contextmenuUI.menu.dispose() instead!");o.dispose()});o.on("dispose",()=>{n["default"].off(a,["click","tap"],o.dispose);this.removeChild(o);delete this.contextmenuUI.menu});this.addChild(o);const l=o.el_.getBoundingClientRect();const u=t.body.getBoundingClientRect();if(this.contextmenuUI.keepInside||l.right>u.width||l.bottom>u.height){o.el_.style.left=Math.floor(Math.min(r.left,this.player_.currentWidth()-o.currentWidth()))+"px";o.el_.style.top=Math.floor(Math.min(r.top,this.player_.currentHeight()-o.currentHeight()))+"px"}n["default"].on(a,["click","tap"],o.dispose)}function Pe(e){const t={keepInside:true,excludeElements:Ae};e=n["default"].mergeOptions(t,e);if(!Array.isArray(e.content)){throw new Error('"content" required')}if(we(this)){this.contextmenuUI.menu.dispose();this.off("contextmenu",this.contextmenuUI.onContextMenu);delete this.contextmenuUI}const i=this.contextmenuUI=function(){Pe.apply(this,arguments)};i.onContextMenu=n["default"].bind(this,De);i.content=e.content;i.keepInside=e.keepInside;i.options_=e;i.VERSION=Ce;this.on("contextmenu",i.onContextMenu);this.ready(()=>this.addClass("vjs-contextmenu-ui"))}n["default"].registerPlugin("contextmenuUI",Pe);Pe.VERSION=Ce;const xe=function(e){e.registerPlugin("urlparams",function(e){e=e||{};var t=function(e){var t=0,i;e=(e||"").replace(/^\s+|\s+$/g,"");if(!e||!/^(\d+h)?(\d+m)?(\d+s)?$/.test(e)){return-1}i=e.match(/^(\d+)h/);if(i){t+=parseFloat(i[1])*3600;e=e.replace(/^(\d+)h/,"")}i=e.match(/^(\d+)m/);if(i){t+=parseFloat(i[1])*60;e=e.replace(/^(\d+)m/,"")}i=e.match(/^(\d+)s/);if(i){t+=parseFloat(i[1])}return t},i=.9,s=function(e,t){var s=e-t;if(isNaN(s)){return false}return Math.abs(s)<i},n=function(e){r.ready(function(){if(r.networkState()===2){e()}else{r.one("loadedmetadata",function(){r.setTimeout(e,0)})}})},r=this;ae.qs();var a;if(typeof e.time==="number"){a=e.time}else{a=t(e.time)}if(a>0){(function(){var t=e.delay||250,i,o=false,l=function(){if(o||s(r.currentTime(),a)){o=true;u()}else{r.one("canplay",function(){r.currentTime(a)});i=r.setTimeout(l,t)}},u=function(){r.clearTimeout(i);r.off("timeupdate",u);if(!o){r.currentTime(a)}};r.on("timeupdate",u);n(l)})()}})};var Le=(e,t,i={})=>{t.forEach(t=>{if(e[t]!==undefined){i[t]=e[t]}});return i};const Re=e=>{const t=(i,s=[])=>{let n={};Object.keys(i).forEach(r=>{const a=i[r];s.push(r);if(ae.isObj(a)){n=e.obj.merge(n,t(a,s))}else{n[s.join(".")]=a}s.pop()});return n};return t};const Ne=e=>e.charAt(0).toUpperCase()+e.slice(1);const Me=(e,t)=>`${e}x${t}`;const Ue={memory:["jsHeapSizeLimit","usedJSHeapSize","totalJSHeapSize"],navigation:["redirectCount","type","directedMigration"],timing:["loadEventEnd","loadEventStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","responseEnd","responseStart","requestStart","secureConnectionStart","connectEnd","connectStart","domainLookupEnd","domainLookupStart","fetchStart","redirectEnd","redirectStart","unloadEventEnd","unloadEventStart","navigationStart"]};const Be={bitrate:"bitrates",event:"events"};const Fe=t=>{const i=Re(t);class s{constructor(){this.data_={bitrates:{bitrates:[],playlists:[],rendered:[],throughput:[]},events:[],mr:0,performance:{},content:{},player:{dimensions:[],pixelratio:[],screendimensions:[]},frames:{}}}keys(){return Object.keys(this.data_)}append(e,...t){e=Be.hasOwnProperty(e)?Be[e]:e;if(!this.data_.hasOwnProperty(e)){throw new Error(`"${e}" is not a known QosBuffer key`)}this[`append${Ne(e)}_`](...t)}flush(...e){if(!e.length){e=this.keys()}for(let t=0;t<e.length;t++){if(!this.data_.hasOwnProperty(e[t])){throw new Error(`"${e[t]}" is not a known QosBuffer key`)}}const i=e.map(e=>this[`flush${Ne(e)}_`]());const s=t.obj.merge(...i);const n=ae.qs().stringify(s).length;if(n>3e3&&s["qos.bitrates"]){s["qos.bitrates"]=JSON.stringify({bitrates:[],playlists:[],rendered:[],throughput:[]})}return s}appendBitrates_(e){if(typeof e.playlists!=="undefined"){this.data_.bitrates.playlists.push([Date.now(),e.bitrates,e.playlists]);delete e.bitrates;delete e.playlists}Object.keys(e).forEach(t=>{this.data_.bitrates[t].push([Date.now(),e[t]])})}appendMr_(e){this.data_.mr=e?1:null}appendPerformance_(t){const i=e.performance;if(ae.isNil(i)){return}Object.keys(Ue).forEach(e=>{if(!ae.isNil(i[e])){this.data_.performance[e]=Le(i[e],Ue[e])}});if(ae.isFn(i.measure)){["bcParse","bcInit"].forEach(e=>{i.getEntriesByName(e,"measure").forEach(t=>{this.data_.performance[e]=t.duration})})}if(this.data_.performance.navigation){this.data_.performance.navigation.directedMigration=t?ae.qs().parse(t).directedMigration==="true":false}}appendFrames_(e){this.data_.frames={dropped:e.droppedVideoFrames,corrupted:e.corruptedVideoFrames,total:e.totalVideoFrames}}appendPlayer_(t,i=Date.now()){this.data_.player.dimensions.push([i,Me(t.width,t.height),Me(t.computedWidth,t.computedHeight)]);this.data_.player.pixelratio.push([i,e.devicePixelRatio]);this.data_.player.screendimensions.push([i,Me(e.screen.width,e.screen.height)])}appendEvents_(...e){this.data_.events.push({type:e.join("."),time:Date.now()})}appendContent_(e){this.data_.content={sourceMimeType:e.sourceMimeType}}flushBitrates_(){const e=this.data_.bitrates;const t={};if(e.bitrates.length||e.playlists.length||e.rendered.length||e.throughput.length){t["qos.bitrates"]=JSON.stringify(e)}e.bitrates.length=0;e.playlists.length=0;e.rendered.length=0;e.throughput.length=0;return t}flushEvents_(){const e=this.data_.events;const t={};e.forEach(e=>{const{time:i,type:s}=e;const n=`qos.events.${s}`;if(Array.isArray(t[n])){t[n].push(i)}else if(t.hasOwnProperty(n)){t[n]=[t[n],i]}else{t[n]=i}});Object.keys(t).forEach(e=>{if(Array.isArray(t[e])){t[e]=JSON.stringify(t[e])}});e.length=0;return t}flushMr_(){return{"qos.mr":this.data_.mr}}flushFrames_(){const e=i(this.data_.frames,["qos","frames"]);this.data_.frames={};return e}flushPerformance_(){return i(this.data_.performance,["qos","performance"])}flushPlayer_(){const e=this.data_.player;const t={};Object.keys(e).forEach(i=>{const s=e[i];if(s.length){t[`qos.player.${i}`]=JSON.stringify(s);s.length=0}});return t}flushContent_(){return i(this.data_.content,["qos","content"])}}return s};const je=["ad-playback","ads-ready?","postroll?","preroll?"];const Ve=e=>e.usingPlugin("ads")?e.ads.state:undefined;const $e=e=>e.usingPlugin("ads")&&!!e.adonly;const qe=e=>je.indexOf(e)>-1;const He=e=>e.usingPlugin("ads")&&ae.isFn(e.ads.inAdBreak);const We=e=>{if(!e.usingPlugin("ads")){return false}if($e(e)){return true}if(He(e)){return e.ads.isInAdMode()}return qe(e.ads.state)};const Ge=e=>{if(!e.usingPlugin("ads")){return false}return e.ads.isContentResuming()&&!e.ads.isWaitingForAdBreak()};const Ke=(e,t)=>{if(He(t)&&e&&e.type==="loadstart"){return true}return!We(t)};const ze=e=>{const t={};if(e.ima3){const i=e.ima3.currentAdEventInfo;t.plugin="ima3";if(ae.isFn(e.ima3)){return t}t.pluginVersion=e.ima3.VERSION||e.ima3.version;t.adTech=e.ima3.adTech;t.requestMode=e.ima3.settings.requestMode;t.timeout=e.ima3.settings.timeout;if(i){Le(i,["adType","adPodLength","adPodId","creativeFormat","creativeLength","creativeId","creativeIndex","advertiserName","wrapperCreativeIds","dealId","adId","adTitle","adSystem","creativeAdId"],t);const e=i.creativeIndex;if(e&&e.length){t.firstPlayedAdIndex=e[0]}t.startedInAdPod=i.started;t.completedInAdPod=i.completed}}else if(e.FreeWheelPlugin){t.plugin="freewheel";if(ae.isFn(e.FreeWheelPlugin)){return t}t.pluginVersion=e.FreeWheelPlugin.VERSION||e.FreeWheelPlugin.getVersion()}return t};const Ye=e=>{e.adBreakIndex=null;e.hasAdBreakStarted=false;e["ads-request"]=null;e["ads-response-received"]=null;e["ads-loading"]=[];e["ads-ad-started"]=[];e["ads-ad-ended"]=[]};const Xe=()=>{const e={};Ye(e);return e};const Qe=(e,t,i)=>{const s=e.currentAdSequence_;const n=["ads-loading","ads-ad-started","ads-ad-ended"];if(t==="ads-request"){Ye(s)}else if(t==="adstart"||t==="ads-loading"){if(!s.hasAdBreakStarted){if(s.adBreakIndex===null){s.adBreakIndex=0}else{s.adBreakIndex++}s.hasAdBreakStarted=true;n.forEach(e=>{s[e].push([])})}}else if(t==="adend"){s.hasAdBreakStarted=false}if(n.indexOf(t)>-1){s[t][s.adBreakIndex].push(i)}else if(t==="ads-request"||t==="ads-response-received"){s[t]=i}};const Je=["progress","seeking","suspend","timeupdate"];const Ze=["seek","stable","unstable"];const et=["adend","adscanceled","adserror","adskip","adsready","adstart","adtimeout","contentplayback","contentupdate","nopostroll","nopreroll","readyforpreroll"];const tt=e=>{return[].concat(e.getTech("Html5").Events)};const it=e=>{return tt(e).filter(e=>Je.indexOf(e)===-1)};const st=["ads-request","ads-response-received","adstart","ads-loading","ads-ad-started","ads-ad-ended","adend"];const nt=["ad_hard_timeout","ad_mode_begin","ad_mode_complete","ad_timeout","catalog_request","catalog_request_error","catalog_response","error","play_request","player_init","player_load","video_complete","video_engagement","video_impression","video_view"];const rt=["catalog_request","catalog_request_error","catalog_response"];const at="sendBeacon"in e.navigator;const{Set:ot}=e;const lt="lbu";const ut=4e3;const ct=new ot(["account","domain","event","player"]);const dt=new ot(["account","destination","domain","dropped_frames","error_code","event","feature","file_size_bytes","forward_buffer_seconds","load_time_ms","measured_bps","platform","platform_version","player","player_height","player_name","player_width","range","rebuffering_count","rebuffering_seconds","rendition_height","rendition_indicated_bps","rendition_mime_type","rendition_width","response_time_ms","session","start_time_ms","source","time","video","video_duration","video_name","video_seconds_viewed"]);const ht=(e,t)=>{const i=ae.qs();Object.keys(t).forEach(e=>{if(ae.isNil(t[e])){delete t[e]}});let s=e+"?"+i.stringify(t);if(s.length<=ut){return s}Object.keys(t).forEach(e=>{if(!dt.has(e)){delete t[e]}});t.usage=lt;s=e+"?"+i.stringify(t);return s};const ft=e=>{ct.forEach(t=>{if(ae.isNil(e[t])){throw new Error(`the "${t}" param is required`)}})};const pt=i=>{const s=Fe(i);class n{constructor(t,i,n,r,a={}){this.baseUrl_=n;this.log=r.createLogger("Client");this.stateAgent_=i;this.player_=t;this.currentAdSequence_=Xe();this.beacons_=[];this.beaconsUnsent_=[];this.playerId=a.playerId;this.embedId=a.embedId;this.applicationId=a.applicationId;this.playerUrl_=null;this.user(a.user||null);this.device(a.device||null);const o=t.options_&&t.options_.runtime_||{};const l=o.environment&&o.environment.queryString||{};if(a.requiresConsent){if(typeof e.BC_ANALYTICS_CONSENT==="boolean"){this.setConsent(e.BC_ANALYTICS_CONSENT,{silent:true});this.disableSetConsent()}else if(l.hasOwnProperty("analyticsConsent")||t.el().hasAttribute("data-analytics-consent")){this.setConsent(true,{silent:true});this.disableSetConsent()}else{this.setConsent(false,{silent:true})}}else{this.setConsent(true,{silent:true});this.disableSetConsent()}if(a.corpCommsApp){this.log.warn("The `corpCommsApp` option is deprecated. Please use `application` instead.")}this.application(a.application||a.corpCommsApp||null);this.defaultParams_={domain:"videocloud",platform:"video-js",session:""};for(let e=0;e<3;e++){this.defaultParams_.session+=(Math.random()*4294967295>>>0).toString(16)}this.qos=new s(this);this.stateAgent_.resetTimesOf();this.subscribeToAnalyticsEvents_(t)}beacons(){return this.beacons_.map(i.obj.merge)}defaultParams(e){if(e){if(e.player){this.playerUrl_=e.player}e=ae.isFn(e)?e():e;this.defaultParams_=i.obj.merge(this.defaultParams_,e)}return this.defaultParams_}getSession(){return this.defaultParams_.session}user(e){if(e!==undefined){if(e===null||ae.isNonEmptyStr(e)||ae.isNum(e)){this.user_=e}else{this.log.warn("user() must be given a non-empty string, number, or null")}if(this.player_.usingPlugin("chinaMetrics")){this.log.warn("user() cannot be set when using China Delivery");this.user_=null}}return this.user_}setUser(e){this.log.warn("setUser(id) is deprecated, use user(id) instead");this.user(e)}getUser(){this.log.warn("getUser() is deprecated, use user() instead");return this.user()}setConsent(e,t={}){if(typeof e==="boolean"&&this.consent_!==e){this.consent_=e;if(!t.silent){this.player_.trigger({consent:e,type:"analytics-consent-changed"})}}}disableSetConsent(){Object.defineProperty(this,"setConsent",{value:()=>{},configurable:false,enumerable:true,writable:false})}getConsent(){return this.consent_}application(e){if(e===null||ae.isNonEmptyStr(e)||ae.isNum(e)){this.application_=e}return this.application_}corpCommsApp(e){if(e===null||ae.isNonEmptyStr(e)||ae.isNum(e)){this.application_=e;this.log.warn("The corpCommsApp() method is deprecated. Please use application() instead.")}return this.application_}device(e){if(e===null||ae.isNonEmptyStr(e)||ae.isNum(e)){this.device_=e}return this.device_}player(e){if(e===null||ae.isNonEmptyStr(e)){this.defaultParams_.player=e;this.playerUrl_=e}return this.playerUrl_||this.defaultParams_.player}subscribeToAnalyticsEvents_(){this.player_.on("analytics-beacon",({params:e})=>{this.send(e)})}send(e={}){const{event:t}=e;if(!nt.includes(t)){return null}const i=this.stateAgent_.getOptions(t);const s=this.sendRequest_(e,i);const n={video_view:"timeOfView",video_impression:"timeOfImpression"};if(s&&n.hasOwnProperty(t)){this.stateAgent_.state[n[t]]=Number(s.params.time)}return s}sendRequest_(i,s={}){if(this.getConsent()){const n=ht(this.baseUrl_,i);if(nt.indexOf(i.event)>-1){if(s.useSendBeaconOnly){if(at){e.navigator.sendBeacon(n)}else{return null}}else{const e=t.createElement("img");e.src=n}}return{params:i,url:n}}this.beaconsUnsent_.push({params:i,options:s});return null}sendAllUnsent(){const e=this.beaconsUnsent_.slice();this.beaconsUnsent_=[];return e.map(({params:e,options:t})=>{return this.sendRequest_(e,t)})}}return n};const mt=(e,t)=>Math.floor(e)+".."+(Math.floor(t)-1);const gt=(e,t,i,s)=>{let n=`players.brightcove.com/${e}/${t}_${i}`;if(s){n+=`/${s}`}return n};const yt=e=>{let t=e.preload();if(typeof t!=="string"){t=e.el().getAttribute("preload")}if(typeof t==="string"&&t.length===0){t="auto"}if(t){return t}};const _t=(e,t,i,s,n)=>{let r=t-e;if(n!==undefined&&n<t){r-=n-e}else if(i!==undefined&&s!==undefined){if(i<e){i=e}if(s>t){s=t}r-=s-i}return r};const vt=(e,t,...i)=>{const s=e.obj.merge(t.params||{},...i);delete t.params;return s};const bt=(e,t)=>{const i=e.mediainfo;const s=i&&i.duration||e.duration();if(i){if(t.video===undefined){t.video=i.id}if(t.video_name===undefined){t.video_name=i.name}if(t.reference_id===undefined){t.reference_id=i.referenceId}if(t.custom_fields===undefined){t.custom_fields=i.customFields}if(t.video_data===undefined){t.video_data=i}if(t.video_ads_supported===undefined){t.video_ads_supported=i.economics==="AD_SUPPORTED"}if(t.tags===undefined){t.tags=i.tags}}if(ae.isNum(s)&&t.video_duration===undefined){t.video_duration=Math.floor(s);if(t.video_duration<1||t.video_duration===Infinity){t.video_duration=null}}t.media_url=e.currentSrc();return t};const Tt=e=>{class t{constructor(e,t,i,s,n){this.player_=e;this.client_=t;this.history_=i;this.stateAgent_=s;this.log=n.createLogger("Emitter");this.eventCount_=0;this.streamCount_=-1}emitAnalyticsEvents_(e,t){e.trigger({params:t,type:"analytics-beacon"});const i=String(t.event).replace(/\_/g,"-");e.trigger({params:t,type:`analytics-beacon-${i}`})}refineClientParams_(t,i){if(this.client_.user()){t.user=this.client_.user()}if(this.client_.application()){t.application=this.client_.application();t.user=this.client_.user()||this.client_.device()}if(ae.isNil(t.time)){t.time=Date.now()}t.autoplay=this.player_.autoplay();i.qos=Array.isArray(i.qos)?i.qos:[];i.qos.push("mr");t=e.obj.merge(this.client_.defaultParams_,t,this.client_.qos.flush(...i.qos));t.seq=""+this.eventCount_;if(nt.indexOf(t.event)>-1){this.eventCount_++}if("streamCount"in i){t.seq+="_"+i.streamCount}if(typeof this.player_.getAccountId==="function"){const e=this.player_.getAccountId();t.account=e;t.player=this.client_.playerUrl_||gt(e,this.client_.playerId,this.client_.embedId,this.client_.applicationId)}ft(t);return{params:t,options:i}}resolveData_(t,i){const s=["player_init","player_load",...rt];const{params:n,options:r}=this.refineClientParams_(s.includes(i.event)?vt(e,t,i):bt(this.player_,vt(e,t,i)),t);if(rt.includes(i.event)){const{error:e,xhr:t}=r;if(e){n.error=JSON.stringify(t?a(e,{status:t.status}):e)}}this.client_.beacons_.push(n);this.log.debug(n.event,n);this.stateAgent_.setOptions(n.event,r);return n}triggerAdError(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_error"}))}triggerFullscreenEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_enabled"}))}triggerFullscreenDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_disabled"}))}triggerShareOverlay(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_overlay"}))}triggerShareSocialClicked(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_social_clicked"}))}triggerShareLinkCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_link_copied"}))}triggerShareEmbedCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_embed_copied"}))}triggerEnterPIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_enabled"}))}triggerLeavePIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_disabled"}))}triggerMuteEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_enabled"}))}triggerMuteDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_disabled"}))}triggerVolumeChange(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"volume_change"}))}triggerVideoPause(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_pause"}))}triggerVideoResume(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_resume"}))}triggerTextTrackEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_enabled"}))}triggerTextTrackDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_disabled"}))}triggerVideoImpression(e={}){const t=ae.isNonEmptyStr(this.player_.currentSrc());if(!t||this.stateAgent_.state.timeOfImpression){this.log.debug("skipped video_impression",{reason:!t&&"there is no source"||`already sent at ${this.stateAgent_.state.timeOfImpression}`});return}this.streamCount_++;e.streamCount=this.streamCount_;if(ae.isNonEmptyStr(this.player_.currentType())){this.client_.qos.append("content",{sourceMimeType:this.player_.currentType()});e.qos=e.qos||["content"]}const i=this.resolveData_(e,{event:"video_impression"});const s=ze(this.player_);const n=yt(this.player_);if(Object.keys(s).length>0){i.web_ad_info=JSON.stringify(s)}if(n){i.preload=n}this.emitAnalyticsEvents_(this.player_,i)}triggerVideoView(e={}){const t=ae.isNonEmptyStr(this.player_.currentSrc());const{timeOfView:i,timeOfImpression:s}=this.stateAgent_.state;if(!t||i||!s){this.log.debug("skipped video_view",{reason:!t&&"there is no source"||i&&`already sent at ${i}`||'"video_impression" not sent'});return}e.streamCount=this.streamCount_;const n=this.resolveData_(e,{event:"video_view"});const r=this.history_;const a=r.first("canplay");const o=r.first("loadstart");const l=r.first("play");if(a){n.load_time_ms=a-s}n.start_time_ms=_t(l||o,n.time,r.first("adstart",true),r.first("adend",true),r.first("adtimeout",true));if(this.player_.usingPlugin("pluginDev")){n.feature="iris"}this.emitAnalyticsEvents_(this.player_,n)}triggerVideoEngagement(e,t,i={}){const{buffered:s,duration:n,playbackEndTime:r,height:a,mediainfo:o,rebufferingCount:l,rendition:u,renditionWidth:c,renditionHeight:d,playbackStartTime:h,rangeStart:f,rangeEnd:p,rebuffering:m,rebufferingTime:g,rebufferingStart:y,stats:_,width:v}=t;const b=r-h;i.qos=i.qos||["bitrates","events","player","frames"];i.streamCount=this.streamCount_;e.length=e.end-e.start;this.log.debug("video_engagement requested",{rawOptions:i,period:e,playbackStartTime:h,playbackLength:b,playbackEndTime:r});let T=g;if(m&&y>0){const e=(Date.now()-y)/1e3;T=parseFloat(g+e).toFixed(1)}if(b<1&&T<=0){this.log.debug("video_engagement skipped; no rebuffering detected and playback duration too short");return null}const S=this.resolveData_(i,{event:"video_engagement"});S.player_height=a;S.player_width=v;S.video_duration=n;S.rendition_width=c;S.rendition_height=d;if(o){S.video=o.id;S.video_name=o.name}if(u){S.rendition_url=u.url;S.rendition_indicated_bps=u.indicatedBPS;S.rendition_mime_type=u.mimeType;S.rendition_height=u.height;S.rendition_width=u.width}if(_){if(!ae.isNil(_.mediaRequests)){S.media_requests=_.mediaRequests}if(!ae.isNil(_.mediaTransferDuration)){S.media_transfer_duration=_.mediaTransferDuration}if(!ae.isNil(_.mediaBytesTransferred)){S.media_bytes_transferred=_.mediaBytesTransferred}if(!ae.isNil(_.bandwidth)){S.measured_bps=_.bandwidth}if(!ae.isNil(_.mediaSecondsLoaded)){S.media_seconds_loaded=_.mediaSecondsLoaded}}if(l>0){S.rebuffering_count=l}if(T>0){S.rebuffering_seconds=T}if(s){let e=0;for(let t=0;t<s.length;t++){const i=s.start(t);const n=s.end(t);if(r>=i&&r<=n){e=n-r;break}}S.forward_buffer_seconds=e}const E=this.history_.filter(t=>t.name==="licenserequestattempted"&&t.time>=e.start&&t.time<e.end);if(E.length){S.license_request_attempts=E.length}if(S.video_duration===Infinity){S.video_seconds_viewed=Math.round(b);delete S.video_duration}else if(b>=1){S["qos.derived_range"]=mt(h,r);S.range=`${f}..${p}`}this.emitAnalyticsEvents_(this.player_,S);return S}sendError(e={}){const t=this.player_.error();if(!t){this.log.debug("skipped error event emission because there was no player error");return}e.streamCount=this.streamCount_;const i=this.resolveData_(e,{event:"error"});const s=ae.isFn(this.player_.errors)&&ae.isFn(this.player_.errors.getAll)&&this.player_.errors.getAll()||{unknown:{type:"MEDIA_ERR_UNKNOWN"}};if(t&&s.hasOwnProperty(String(t.code))){i.error_code=s[String(t.code)].type}else if(t.type!==undefined){i.error_code=t.type}else{i.error_code=s.unknown.type}this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogRequest(e,t={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(t,{event:"catalog_request",url:e}))}triggerCatalogRequestError(e,t={}){if(t.error){t.error=Le(t.error,["code","message","type"])}const i=this.resolveData_(t,{event:"catalog_request_error",url:e});this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogResponse(e,t={}){const i=this.resolveData_(t,{event:"catalog_response",url:e});i.response_time_ms=i.time-this.history_.last("catalog_request");this.emitAnalyticsEvents_(this.player_,i)}triggerAdHardTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_hard_timeout"}))}triggerAdModeBegin(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_mode_begin"}))}triggerAdModeComplete(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_mode_complete"}))}triggerAdTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_timeout"}))}triggerPlayRequest(e={}){if(this.stateAgent_.state.timeOfPlayRequest){return}e.streamCount=this.streamCount_;const t=this.resolveData_(e,{event:"play_request"});this.emitAnalyticsEvents_(this.player_,t);this.stateAgent_.state.timeOfPlayRequest=Number(t.time)}triggerPlayerInit(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_init"}))}triggerPlayerLoad(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_load"}))}}return t};class St{constructor(){this.optionsQueue_=[];this.state={};this.resetTimesOf()}setOptions(e,t){this.optionsQueue_.push({event:e,options:t})}getOptions(e){const t=this.optionsQueue_.findIndex(({event:t})=>t===e);if(t>-1){const{options:e}=this.optionsQueue_[t];this.optionsQueue_.splice(t,1);return e}}resetTimesOf(){this.state.timeOfImpression=null;this.state.timeOfView=null;this.state.timeOfPlayRequest=null}}const Et=e=>typeof e==="number"&&!isNaN(e)&&e>=0&&e<Infinity;const It=e=>e.map(e=>Math.floor(e)).reduce((e,t)=>{const i=e[e.length-1];if(t!==i){e.push(t)}return e},[]);const kt=e=>e.reduce((e,t)=>{const i=e[e.length-1];if(i){if(i.end+1===t){i.end=t}else{e.push({start:t,end:t})}}else{e.push({start:t,end:t})}return e},[]);const Ct=e=>e.map(e=>{const{start:t,end:i}=e;const s=i-t;if(s>0){return{start:t,end:i-1,remainder:i}}return{start:t,end:i,remainder:i}});const wt=e=>{const t=[];let{start:i,end:s,remainder:n}=e.shift()||{};while(Et(i)&&Et(s)&&Et(n)&&i===s&&i===n){({start:i,end:s,remainder:n}=e.shift()||{})}if(e.length===0){t.push(n)}for(let i=0;i<e.length;i++){const{start:s,end:n,remainder:r}=e[i];for(let e=s;e<=(r||n);e++){t.push(e)}}return{start:i,end:s,remainders:t,ranges:e.length}};const At=e=>wt(Ct(kt(It(e))));let Ot=1;function Dt(){return Ot++}const Pt=[];const xt=function(e,t,i,s,n=true){const r=[].concat(i).sort();if(t!=="removeEventListener"){e.off(r,s)}else{r.forEach(function(t){e.removeEventListener(t,s)})}if(!n){return}let a=Pt.length;while(a--){const t=Pt[a];if(t.context===e&&(t.fn.guid===s.guid||t.fn===s)&&r.every((e,i)=>t.events[i])){Pt.splice(a,1);break}}};const Lt=function(){let e=Pt.length;while(e--){const{context:e,mode:t,events:i,fn:s}=Pt.shift();let n="off";if(t==="addEventListener"){n="removeEventListener"}xt(e,n,i,s,false)}};const Rt=function(e,t,i,s){const n=[].concat(i).sort();const r={events:n,fn:s,mode:t,context:e};if(t==="one"||t==="onePerSrc"){r.fn=function(...e){let t="off";if(r.mode==="addEventListener"){t="removeEventListener"}xt(r.context,t,r.events,r.fn);return s.apply(this,e)};if(!s.guid){s.guid=Dt()}r.fn.guid=s.guid}Pt.push(r);if(t==="addEventListener"){r.events.forEach(e=>{r.context.addEventListener(e,r.fn)})}else{r.context[r.mode](r.events,r.fn)}};const Nt=function(){const e=Pt.slice(0);Lt();e.forEach(({context:e,mode:t,events:i,fn:s})=>{Rt(e,t,i,s)})};const Mt=1e4;const Ut=e=>Boolean(e.onceux&&e.onceux.currentTime&&e.onceux.timeline);const Bt=e=>{class t extends e.EventTarget{constructor(e,t){super();this.player_=e;this.log=t.createLogger("Engager");this.stateBySrc_={};this.lastStateRecord_=0;this.disposed_=false}stateBySrc(e=this.player_.currentSrc()){if(!this.stateBySrc_.hasOwnProperty(e)){this.stateBySrc_[e]={buffered:null,duration:0,end:0,height:0,mediainfo:null,playbackRate:1,rebufferingCount:0,src:e,start:0,width:0,playbackStartTime:0,playbackEndTime:0,stats:null,rebuffering:false,rebufferingEnd:0,rebufferingTime:0,rebufferingStart:0,rendition:null,videoPlaybackQuality:null,times:[]}}const t=this.player_.tech_&&this.player_.tech_.vhs;this.stateBySrc_[e].stats=t&&t.stats||null;return this.stateBySrc_[e]}clearStateBySrc(e=this.player_.currentSrc()){this.log.debug("cleared",this.stateBySrc_[e]);delete this.stateBySrc_[e]}updateState(t=this.player_.currentSrc(),i){const{isObj:s}=ae;if(!s(i)){e.log.warn("Engager.updateState: requires update arg to be an object");return this.stateBySrc(t)}const n=e.obj.merge(this.stateBySrc(t),i);this.stateBySrc_[t]=n;return n}recordState(){const e=this.player_;const t=this.stateBySrc();t.mediainfo=e.mediainfo;t.playbackEndTime=e.currentTime();t.times.push(t.playbackEndTime);if(Ut(e)){t.duration=e.onceux.timeline.contentDuration}else{t.duration=e.duration()}t.buffered=e.buffered();t.playbackRate=e.playbackRate()}isTracking(){return!!this.timerId_}start(e={}){if(this.disposed_){return}let{reason:t,src:i}=e;if(!i){i=this.player_.currentSrc()}const s=this.stateBySrc(i);s.playbackStartTime=s.playbackEndTime=this.player_.currentTime();if(Ut(this.player_)){s.duration=this.player_.onceux.timeline.contentDuration}else{s.duration=this.player_.duration()}s.rebufferingCount=0;s.rebufferingEnd=0;s.rebufferingTime=0;if(e.isRebuffering){s.rebuffering=true;s.rebufferingStart=Date.now()}else{s.rebufferingStart=0}this.player_.clearTimeout(this.timerId_);this.timerCreatedAt_=Date.now();this.timerId_=this.player_.setTimeout(()=>this.stop({src:i,reason:"engagement timer fired"}),Mt);this.log.debug("started",{reason:t,time:this.timerCreatedAt_});return this}prepareState_(t){const i=this.player_;const s=this.stateBySrc(t);const{isNativeHlsSupported:n}=ae;const r=i.currentType();s.height=Math.round(i.currentHeight());s.width=Math.round(i.currentWidth());const a=i.tech_&&i.tech_.vhs;if(a&&a.playlists&&a.playlists.media()){const e=a.playlists.media();const t=s.rendition={url:e.resolvedUri,mimeType:r};if(e.attributes){t.indicatedBPS=e.attributes.BANDWIDTH;if(e.attributes.RESOLUTION){t.height=e.attributes.RESOLUTION.height;t.width=e.attributes.RESOLUTION.width}}}if(n(e)&&r==="application/vnd.apple.mpegurl"){const t=this.stateBySrc_[this.player_.currentSrc()].parsedManifest||{playlists:[]};const{playlists:n}=t;const r=this.inferRenditions_(n);const a=()=>{if(!r.length){return{url:null,bandwidth:null}}if(r.length>1){return{url:"multiple",bandwidth:"multiple"}}return{url:r[0].uri,bandwidth:r[0].attributes.BANDWIDTH}};const o=a();s.rendition=e.obj.merge(s.rendition,{mimeType:"application/x-mpegurl",height:Math.round(i.videoHeight()),width:Math.round(i.videoWidth()),url:o.url,indicatedBPS:o.bandwidth})}s.videoPlaybackQuality=i.getVideoPlaybackQuality();s.times.push(i.currentTime());const{start:o,end:l,remainders:u,ranges:c}=At(s.times);s.times=u;return e.obj.merge({rangeExtras:c,rangeStart:o,rangeEnd:l},s)}inferRenditions_(e){if(!e||!Array.isArray(e)||!e.length){return[]}const t=this.player_.videoWidth();const i=new Set(e.map(e=>e.attributes.RESOLUTION.width).sort((e,t)=>e-t));const s=(e=t,n=Array.from(i))=>{const r=Math.floor((n.length-1)/2);const a=n.slice(0,r+1);const o=n.slice(r+1);const l=a[a.length-1];const u=o[0];if(l===e||u===e){return[e]}if(n.length===1){return n}if(l<e&&u>e){const t=Math.abs(l-e);const i=Math.abs(u-e);if(t===i){return[l,u]}return Math.min(t,i)===t?[l]:[u]}if(l>e){return s(e,a)}if(u<e){return s(e,o)}return[]};const n=s();let r=[];n.forEach(t=>{r=[...r,...e.filter(e=>e.attributes.RESOLUTION.width===t)]});return r}stop(e={}){if(!e.src){e.src=this.player_.currentSrc()}if(this.isTracking()){this.player_.clearTimeout(this.timerId_);this.timerId_=null;const t=this.stateBySrc(e.src);const i=(t.duration-t.playbackEndTime)*1e3;if(!this.player_.ended()&&i>0&&i<1500){this.timerId_=true;this.log.debug("delayed",{msFromEnd:i});Rt(this.player_,"one","ended",()=>{this.recordState();this.stop({reason:"content ended after we delayed the engager"})});return this}e.state=this.prepareState_(e.src);e.period=e.period||{};e.period.start=e.period.start||this.timerCreatedAt_;e.period.end=e.period.end||Date.now();this.log.debug("stopped",e);this.trigger({type:"engagement",engagement:e})}return this}dispose(){this.disposed_=true;this.stop({ignoreAdState:true,reason:"player disposed"});this.off();return this}}return t};const Ft=e=>{class t{constructor(e,t){this.log=t;this.player_=e;this.events_=[]}add(t,i=Date.now(),s){const n=e.obj.merge(s,{name:t,time:i});this.events_.push(n);this.log.debug(`saw "${t}" at`,i,s);return i}record(e){const t=Date.now();this.add(e,t,{adState:Ve(this.player_),isInAdState:We(this.player_)});return t}reset(){this.events_.length=0}filter(e){if(!ae.isFn(e)){return this.events_.filter(t=>t.name===e)}return this.events_.filter(e)}map(e){return this.events_.map(e)}names(){return this.map(e=>e.name)}first(e,t){for(let i=0;i<this.events_.length;i++){const s=this.events_[i];if(!t&&s.isInAdState){continue}if(s.name===e){return s.time}}}last(e,t){let i=this.events_.length;while(i--){const s=this.events_[i];if(!t&&s.isInAdState){continue}if(s.name===e){return s.time}}}}return t};class jt{constructor(){this.log_={}}put(e){this.log_[e]=true}peek(){return Object.keys(this.log_)}flush(){const e=Object.keys(this.log_);this.log_={};return e}}const Vt={production:"https://metrics.brightcove.com/v2/tracker",qa:"https://metrics.juju.qa.brightcove.com/v2/tracker",staging:"https://metrics.juju.staging.brightcove.com/v2/tracker"};const $t=(e,t,i)=>{Object.keys(i).forEach(s=>{t[s]=String(t[s]||"");if(s==="accountId"&&!ae.isNonEmptyStr(t[s])){t[s]=String(t.account||"")}if(!ae.isNonEmptyStr(t[s])){t[s]=e.getAttribute(`data-${i[s]}`)||""}});return t};const qt=(t,i)=>{const{accountId:s,applicationId:n,embedId:r,playerId:a}=$t(t.el(),i,{accountId:"account",applicationId:"application-id",embedId:"embed",playerId:"player",playerName:"name",usage:"usage"});if(!ae.isNonEmptyStr(i.player)){if(e.location.hostname==="players.api.brightcove.com"){i.player=`players.api.brightcove.com/${a}_${r}`;return}i.player=gt(s,a,r);if(n){i.player+="/"+n}}if(n){if(ae.isNonEmptyStr(i.playerName)){i.playerName+=" - "+n}else{i.playerName=n}}};const Ht=e=>({computedHeight:e.currentHeight(),computedWidth:e.currentWidth(),height:e.height(),width:e.width()});const Wt=(t,i)=>{if(typeof t==="boolean"){i.warn("The __iframe__ option should only be used in tests!");return t}try{return e.parent!==e.self}catch(e){return true}};const Gt=i=>{const s=it(i);const n=pt(i);const a=Tt(i);const o=Bt(i);const l=Ft(i);const u=function(u={}){let c=false;let d=false;const h={};let f;u=i.obj.merge(u);u.env=Vt.hasOwnProperty(u.env)?u.env:"production";qt(this,u);const p=this.log.createLogger("analytics");const m=new o(this,p);const g=new l(this,p);const y=new St;const _=new jt;const v=ae.isNonEmptyStr(u.usage)?u.usage.split(","):[];v.forEach(function(e){_.put(e)});const b=new n(this,y,ae.isNonEmptyStr(u.analyticsUrl)?u.analyticsUrl:Vt[u.env],p,{user:u.user,corpCommsApp:u.corpCommsApp,application:u.application,device:u.device,playerId:u.playerId,embedId:u.embedId,applicationId:u.applicationId,requiresConsent:u.requiresConsent});const T=new a(this,b,g,y,p);b.defaultParams(()=>{const i={account:u.accountId||null,destination:e.location.href,platform_version:u.platformVersion,player:u.player,player_name:u.playerName,source:t.referrer};if(Wt(u.__iframe__,p)){i.destination=t.referrer;if(ae.isNonEmptyStr(u.referrer)){i.source=u.referrer}else{try{i.source=e.parent.document.referrer}catch(e){i.source=null}}}return i});Rt(this,"on","pluginsetup:ads",Nt);const S=e=>{[p,b.log,m.log,g.log,T.log].forEach(t=>{if(e){t.level("debug");t.history.enable()}else{t.level("warn");t.history.disable()}})};u.debug=Boolean(u.debug);S(u.debug);this.on("debugon",()=>S(true));this.on("debugoff",()=>S(false));this.bcAnalytics={client:b,emitter:T,engager:m,history:g,settings:u,VERSION:r};Rt(this,"on","usage",e=>{if(!e.name){return p.warn("Ignored usage event without a `name` parameter")}_.put(e.name)});const E=function(){_.put("pagehide");m.stop({fromUnload:true,ignoreAdState:true,reason:"pagehide called"})};Rt(e,"addEventListener","pagehide",E);const I=e=>{if(!e.usingPlugin("bcAirplay")){return false}if(e.isConnectingToAirplay){e.isConnectingToAirplay=false;return true}};const k=e=>{p.debug(e?`workflow saw "${e.type}"`:"workflow called manually");if(!Ke(e,this)){p.debug("workflow bailing because player is in an ad state");return}let t=g.first("loadstart",He(this));let i=g.first("play");let s=g.last("playing");p.debug("workflow checking history",{loadstart:t,play:i,playing:s});if(e&&e.type==="playing"&&g.last("pause")){T.triggerVideoResume()}if((i||s)&&!m.isTracking()&&!this.paused()){m.start({period:{start:i||s},reason:"workflow detected that it is playing",isRebuffering:m.stateBySrc().rebuffering})}if(y.state.timeOfImpression&&y.state.timeOfView){return}h.workflow=h.workflow||this.setTimeout(()=>{h.workflow=null;t=g.first("loadstart",He(this));i=g.first("play");s=g.last("playing");if((t||i)&&!y.state.timeOfImpression){T.triggerVideoImpression({params:{time:Math.min(t||Infinity,i||Infinity)}})}if(t&&s&&!y.state.timeOfView){p.debug("workflow complete",{order:g.names()});T.triggerVideoView({params:{time:s}})}},1)};m.on("engagement",t=>{const{fromUnload:i,ignoreAdState:s,period:n,restartAlways:r,state:a}=t.engagement;const o=We(this);const l={useSendBeaconOnly:i,params:{time:n.end}};if(a.rangeExtras>=2){_.put("disco-engmnt")}const u=_.peek();if(u&&u.length){l.params.usage=u.map(e.encodeURIComponent).sort().join(",")}if(!o||s){b.qos.append("frames",a.videoPlaybackQuality);const e=T.triggerVideoEngagement(n,a,l);if(r||e&&!this.paused()){if(o){return}_.flush();m.start({reason:"sent engagement and still playing",isRebuffering:m.stateBySrc().rebuffering})}}});Rt(this,"on","dispose",()=>{Lt();_.put("disposed");m.dispose()});Rt(this,"on",s.concat(et,Ze).concat("sourceunstable"),e=>{g.record(e.type)});Rt(this,"on",s.concat("ads-ad-started"),e=>{b.qos.append("event",We(this)?"ad":"content",e.type)});Rt(this,"on",["loadedmetadata","resize"],()=>{b.qos.append("player",Ht(this))});Rt(this,"on","fullscreenchange",()=>{const e=Date.now();h.fullscreen=this.setTimeout(()=>{h.fullscreen=null;if(this.isFullscreen()){T.triggerFullscreenEnabled()}else{T.triggerFullscreenDisabled()}b.qos.append("player",Ht(this),e)},500)});Rt(this,"on","mediachange",()=>{if(this.tech_.vhs){const e=this.tech_.vhs.playlists.media();b.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,playlists:e&&e.attributes&&e.attributes.BANDWIDTH})}});Rt(this,"on","ratechange",()=>{const e=this.playbackRate().toFixed(2);_.put("pr:"+e)});Rt(this,"on","pipactive",()=>{T.triggerEnterPIP()});Rt(this,"on","pipinactive",()=>{T.triggerLeavePIP()});Rt(this,"on","texttrackchange",e=>{const t=this.textTracks();if(g.last(e.type)){const i=g.filter(e.type);const s=i[i.length-1].text_track_index;T.triggerTextTrackDisabled({params:{text_track_kind:t[s].kind,text_track_language:t[s].language}})}for(let i=0;i<t.length;i++){if(t[i].mode==="showing"){g.add(e.type,new Date,{text_track_index:i});T.triggerTextTrackEnabled({params:{text_track_kind:t[i].kind,text_track_language:t[i].language}});break}}});Rt(this,"on","volumechange",()=>{if(this.muted()&&!f){f=true;T.triggerMuteEnabled()}if(!this.muted()&&f){f=false;T.triggerMuteDisabled()}if(!this.muted()){T.triggerVolumeChange({params:{volume:this.volume()}})}});Rt(this,"on","ready",()=>{f=this.muted();Rt(this.tech_,"on","usage",e=>{if(!e.name){return p.warn("Ignored usage event without a `name` parameter")}_.put(e.name)});Rt(this.tech_,"on","bandwidthupdate",()=>{b.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,throughput:Math.round(this.tech_.vhs.throughput)})});Rt(this.tech_,"on","liveresync",()=>{this.trigger({type:"usage",name:"hls-live-resync"})});Rt(this.tech_,"on","videounderflow",()=>{this.trigger({type:"usage",name:"hls-video-underflow"})});Rt(this.tech_,"on","licenserequestattempted",()=>{g.add("licenserequestattempted")});Rt(this,"on","loadedmetadata",()=>{const e=this.player_.currentSrc();const t=i.url.parseUrl(e);const s=t.hostname.indexOf("boltdns.net")===-1;const n=Boolean(m.stateBySrc(e)&&m.stateBySrc(e).parsedManifest);const r=this.currentType();const{isHlsType:a,isNativeHlsSupported:o}=ae;const l=typeof u.nativeQoe==="boolean"?u.nativeQoe:!s;if(o(i)&&a(r)&&l&&!n){const{downloadManifest:t,parseHlsManifest:s}=ae;const n=t(e);n.then(t=>{const i=s(t);m.updateState(e,{parsedManifest:i})},e=>{i.log.error(e)})}const c=this.textTracks();for(let e=0;e<c.length;e++){if(c[e].label==="segment-metadata"){const t=c[e];let i;Rt(t,"addEventListener","cuechange",()=>{const e=t.activeCues[0];if(e){const t=this.tech_.vhs.playlists.main.playlists[e.value.playlist];if(i!==t.uri){if(t.attributes&&t.attributes.BANDWIDTH){b.qos.append("bitrate",{rendered:t.attributes.BANDWIDTH})}if(i!==undefined){m.stop({reason:"rendition on screen changed",restartAlways:true})}}i=t.uri}})}}if(this.usingPlugin("social")){Rt(this.socialButton,"on","click",()=>{T.triggerShareOverlay()});Rt(this.socialOverlay,"on","click",e=>{if(e.target.classList.contains("vjs-social-share-link")){T.triggerShareSocialClicked({params:{share_network:e.target.getAttribute("title").toLowerCase()}})}});Rt(this.socialOverlay,"on","copy",e=>{if(e.target.parentElement.classList.contains("vjs-social-direct-link")){T.triggerShareLinkCopied({params:{link_url:this.socialOverlay.getDirectLink()}})}else if(e.target.parentElement.classList.contains("vjs-social-embed-code")){T.triggerShareEmbedCopied({params:{embed_code:this.socialOverlay.getEmbedCode()}})}})}})});Rt(this,"on","waiting",e=>{const t=this.currentTime()===0&&!this.paused();if(!d&&!t&&!We(this)&&!m.stateBySrc().rebuffering){m.stateBySrc().rebuffering=true;m.stateBySrc().rebufferingCount++;m.stateBySrc().rebufferingStart=Date.now()}Rt(this,"one",["playing","pause"],()=>{if(m.stateBySrc().rebuffering){m.stateBySrc().rebufferingEnd=Date.now();const e=(m.stateBySrc().rebufferingEnd-m.stateBySrc().rebufferingStart)/1e3;const t=m.stateBySrc().rebufferingTime+e;const i=parseFloat(t.toFixed(1));m.stateBySrc().rebufferingTime=i;m.stateBySrc().rebuffering=false}})});Rt(this,"on","sourcechanged",(e,t)=>{const i=t.interimEvents;const s=i[0].event;const n=()=>{if(!d&&!We(this)){m.recordState()}};p.debug("sourcechanged",{by:s.type,interim:i.map(e=>e.event.type),from:t.from,to:t.to});if(t.from){m.stop({reason:"changing sources",period:{end:i[0].time},ignoreAdState:true,src:t.from});m.clearStateBySrc(t.from)}c=false;d=false;y.resetTimesOf();g.reset();i.forEach(e=>g.add(e.event.type,e.time));k();Rt(this,"onPerSrc","timeupdate",n);Rt(this,"onePerSrc","sourceunstable",()=>{if(Ve(this)==="content-resuming"){return}const e=this.currentSrc();m.stop({ignoreAdState:true,reason:"sourceunstable",src:e});if(!We(this)){xt(this,"off","timeupdate",n)}});Rt(this,"onPerSrc",["loadstart","play","playing"],k);Rt(this,"onPerSrc",["pause","ratechange"],e=>{if(e.type==="pause"){g.record(e.type);T.triggerVideoPause()}if(!d&&!We(this)&&!this.ended()){m.stop({reason:`saw "${e.type}"`});if(this.paused()){Rt(this,"onePerSrc","playing",()=>{m.start({reason:"playback began after a pause",isRebuffering:m.stateBySrc().rebuffering})})}else if(e.type==="ratechange"){h.ratechange=this.setTimeout(()=>{h.ratechange=null;m.start({reason:"the playback rate changed",isRebuffering:m.stateBySrc().rebuffering})},1)}}});Rt(this,"onPerSrc","unstable",()=>{if(!d&&!We(this)){d=true;m.stop({reason:"seeking"})}});Rt(this,"onPerSrc","seek",()=>{if(d&&!We(this)){d=false;m.start({reason:"stopped seeking",isRebuffering:m.stateBySrc().rebuffering})}});Rt(this,"onePerSrc","adstart",()=>{if(!$e(this)){T.triggerVideoImpression({params:{time:g.last("adstart",true)-100}})}});Rt(this,"onPerSrc","adstart",()=>{c=this.ended();m.stop({ignoreAdState:true,period:{end:g.last("adstart",true)},reason:"saw adstart"})});Rt(this,"onePerSrc","adend",()=>{if(!this.paused()&&!this.ended()){k()}});Rt(this,"onPerSrc","adend",()=>{if(!c){m.start({reason:'saw "adend"'})}})});Rt(this,"on","catalog_request",e=>{g.record(e.type);T.triggerCatalogRequest(e.url)});Rt(this,"on","catalog_request_error",e=>{g.record(e.type);T.triggerCatalogRequestError(e.url,{error:e.error,xhr:e.response})});Rt(this,"on","catalog_response",e=>{g.record(e.type);T.triggerCatalogResponse(e.url,{xhr:e.response})});Rt(this,"on","play",e=>{if(Ge(this)||I(this)||g.first("play")!==g.last("play")){return}const t={params:{time:Date.now()}};if(this.perSourceBehaviors.isSrcStable()){T.triggerPlayRequest(t)}else{Rt(this,"one","sourcechanged",()=>{T.triggerPlayRequest(t)})}});Rt(this,"on","error",()=>{if(!We(this)){T.sendError()}});Rt(this,"on","adstart",()=>{T.triggerAdModeBegin();h.perSrcDisable=this.setTimeout(()=>{h.perSrcDisable=null;this.perSourceBehaviors.disable()},1)});Rt(this,"on","adend",()=>{T.triggerAdModeComplete();if(h.perSrcDisable){this.clearTimeout(h.perSrcDisable)}else{this.perSourceBehaviors.enable()}});Rt(this,"on","adserror",e=>{T.triggerAdError({params:{ad_error:e.errorCode}})});Rt(this,"on","adtimeout",()=>{T.triggerAdTimeout()});Rt(this,"on","ad-hard-timeout",()=>{T.triggerAdHardTimeout()});Rt(this,"on",st,e=>{Qe(b,e.type,Date.now())});b.qos.append("mr",u.mr);if(ae.isFn(u.beforeFirstBeacon)){u.beforeFirstBeacon(this)}T.triggerPlayerInit();T.sendError();Rt(this,"on","ready",()=>{b.defaultParams({feature:$e(this)?"adonly":null,autoplay:this.autoplay(),ads_enabled:this.ads!==undefined});b.qos.append("performance",(e.location.href||"").split("?")[1]);b.qos.append("player",Ht(this));if("hidden"in t&&"visibilityState"in t){if(t.hidden){this.trigger({type:"usage",name:"document-hidden"})}const e=()=>{this.trigger({type:"usage",name:"document-"+t.visibilityState})};Rt(t,"addEventListener","visibilitychange",e)}if(t.querySelector(".bc-iframe")){this.trigger({type:"usage",name:"iframe-embed"})}else{this.trigger({type:"usage",name:"inpage-embed"})}T.triggerPlayerLoad({qos:b.qos.keys(),params:{usage:_.flush()}})})};u.VERSION=r;i.registerPlugin("bcAnalytics",u);return u};const Kt="video";const zt="playlist";const Yt="search";const Xt="lazySequence";const Qt="related";const Jt=[{attr:"data-video-id",query:"videoId",config:"videoId",type:Kt},{attr:"data-playlist-id",query:"playlistId",config:"playlistId",type:zt},{attr:"data-catalog-search",query:"catalogSearch",config:"search",type:Yt},{attr:"data-catalog-sequence",query:"catalogSequence",config:"sequence",type:Xt}];const Zt=(e,t,i)=>{for(let s=0;s<Jt.length;s++){const n=Jt[s];const r=n[e];if(t[r]){const e={id:t[r],type:n.type};if(e.type===zt){e.playlistVideoId=i}return e}}};const ei=e=>{const t=(t,i,s)=>{const n=i.options_;const r=Boolean(i.el().ownerDocument.querySelector(".bc-iframe"));const a=ae.qs();s=s?a.parse(s):a.search;Jt.concat({query:"playlistVideoId"}).forEach(({query:e})=>{if(Array.isArray(s[e])){s[e]=s[e].pop()}});if(Jt.filter(e=>!!t[e.config]).length>1||Jt.filter(e=>!!n[e.attr]).length>1){i.error({headline:"Bad Request: Multiple catalog media queries provided. Please only provide one",type:"PLAYER_ERR_CONFLICTING_DATA",code:-3,message:"Too many catalog media parameters were provided in this player. "+"Please use only one of the following: videoId, playlistId, catalogSequence, or catalogSearch."});return}const o=r&&Zt("query",s,s.playlistVideoId)||Zt("attr",n,n["data-playlist-video-id"]||s.playlistVideoId)||Zt("config",t,s.playlistVideoId||t.playlistVideoId);if(!o){return}if(typeof o.id==="string"&&(o.type===Yt||o.type===Xt)){const t=o.id;try{o.id=JSON.parse(t)}catch(t){if(o.type===Xt){e.log.error("sequence must be valid JSON or an object",t);return}}if(!ae.isObj(o.id)&&!Array.isArray(o.id)){o.id=t}}["adConfigId","deliveryConfigId","bumper"].forEach(e=>{const i=e==="bumper"?t[e]&&t[e].id:t[e];if(!ae.isNonEmptyStr(i)){return}if(ae.isObj(o.id)){o.id[e]=i}else if(Array.isArray(o.id)){o.id.forEach(t=>{t[e]=i})}else{o[e]=t[e]}});return o};return t};const ti={VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND:{headline:"The Video Cloud account was not found."},VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND:{headline:"The Video Cloud resource was not found."},VIDEO_CLOUD_ERR_NOT_PLAYABLE:{headline:"The Video Cloud video is not playable."},VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND:{headline:"The Video Cloud SSAI ad config id was not found."},VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND:{headline:"The Video Cloud video was not found."},VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS:{headline:"Invalid Request: Duplicate Parameter",message:"The same parameter name was provided more than once in the request."},VIDEO_CLOUD_ERR_TOKEN_REQUIRED:{headline:"Access Denied: Missing Token",message:"Video cannot be played without a token."},VIDEO_CLOUD_ERR_TOKEN_INVALID:{headline:"Access Denied: Invalid Token",message:"Video cannot be played without a valid token."},VIDEO_CLOUD_ERR_UNKNOWN:{headline:"The Playback API request failed for an unknown reason",message:"Unknown catalog request error."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"Playback Denied: Domain Restricted",message:"Video is not playable on this domain."},PLAYER_ERR_IP_RESTRICTED:{headline:"Playback Denied: IP",message:"Your IP address does not have access to this video."},PLAYER_ERR_GEO_RESTRICTED:{headline:"Playback Denied: Location",message:"Video is unavailable from your current location."},PLAYER_ERR_OFFER_RESTRICTED:{headline:"Playback Denied: Offer Restricted",message:"Video is not playable with your entitlements."},PLAYER_ERR_TAG_RESTRICTED:{headline:"Playback Denied: Tags",message:"Video does not have tags required for playback."},PLAYER_ERR_ACCOUNT_ID:{headline:"Playback Denied: Account ID",message:"Account ID missing or invalid."},PLAYER_ERR_DEVICE_RESTRICTED:{headline:"Playback Denied: Device",message:"Device does not have access to this resource."},VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Video is not currently available for playback."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Playlist is not currently available for playback."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE:{code:"DENIED_BY_STREAM_LIMIT_CREATE",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW:{code:"DENIED_BY_STREAM_LIMIT_RENEW",headline:"Stream Limiting: Existing Viewers",message:"Limited stream is already being watched by the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING:{code:"DENIED_BY_STREAM_LIMITING",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING:{code:"DENIED_BY_DEVICE_LIMITING",headline:"Device Limiting: New Viewers",message:"Maximum number of streams has been reached on this device."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND:{headline:"Playlist Unavailable: Not Found",message:"Playlist cannot be found."},VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED:{headline:"API: Method not allowed."},VIDEO_CLOUD_ERR_SERVER:{headline:"Server: Internal server error",message:"An internal server error prevented playback."},VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE:{headline:"Server Error: Video",message:"Video unavailable."},VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE:{headline:"Server Error: Account",message:"Account unavailable."},VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE:{headline:"Server Error: Video URLs",message:"Stream URLs unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE:{headline:"Server Error: Playlist",message:"Video playlist unavailable."},VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE:{headline:"Server Error: Playback Rights",message:"Entitlements unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE:{headline:"Server Error: Playlist Videos",message:"Playlist videos unavailable."},VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE:{headline:"Server Error: License",message:"Stream license unavailable."},VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE:{headline:"Server Error: Offers",message:"Stream offers unavailable."},VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE:{headline:"Server Error: Rights",message:"Stream rights unavailable."},VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE:{headline:"Server Error: Unavailable",message:"The server is currently unavailable. Please try again later."},VIDEO_CLOUD_ERR_SERVICE_TIMEOUT:{headline:"Server Error: Timeout",message:"Recevied a timeout from the server. Please try again later."},GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING:{headline:"Session Limiting: New Sessions",message:"Maximum number of sessions have been reached for this video",dismiss:false},GSC_TOKEN_REQUIRED:{headline:"Invalid Request: JWT is required",message:"Please provide a valid token",dismiss:false},GSC_INVALID_TOKEN:{headline:"Invalid Request: Invalid JWT",message:"Please provide a valid token",dismiss:false},GSC_MISSING_FIELD_ACCOUNT_ID:{headline:"Invalid Request: AccountID is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_UID:{headline:"Invalid Request: UID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_SESSION_ID:{headline:"Invalid Request: SID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_CLIMIT:{headline:"Invalid Request: CLIMIT in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_VIDEO_ID:{headline:"Invalid Request: videoId is required",message:"Please provide required information",dismiss:false},GSC_SESSION_STOPPED:{headline:"Stream Limiting: Session stopped",message:"Stream session no longer available",dismiss:false},GSC_SESSION_EXPIRED:{headline:"Stream Limiting: Session expired",message:"Stream session no longer available",dismiss:false},GSC_PLAYBACK_RESTRICTIONS:{headline:"Playback Restrictions: Not Met",message:"Playback restrictions requirements have not been met",dismiss:false},GSC_SESSION_NOT_FOUND:{headline:"Not found",message:"Playback session not found",dismiss:false},GSC_VIDEO_NOT_FOUND:{headline:"Not found",message:"Video cannot be found or does not exist",dismiss:false}};const ii=(e,t)=>{const i=e.error();if(t===null&&i&&(i.headline===ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE.headline||i.headline===ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW.headline||i.headline===ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING.headline||i.headline===ti.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING.headline||i.headline===ti.GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING.headline)){return i}if(t&&t.code===5&&/Denied by stream limiting \(create\)/.test(t.cause)){return ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE}if(t&&t.code===5&&/Denied by stream limiting \(renew\)/.test(t.cause)){return ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW}if(t&&t.code===5&&/Denied by stream limiting/.test(t.cause)){return ti.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING}if(t&&t.code===5&&/Denied by device limiting: [1-9] devices in use/.test(t.cause)){return ti.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING}return t};const si=e=>{const t=()=>e.errors.extend(ti);const i=ae.isFn(e.usingPlugin)?e.usingPlugin("errors"):ae.isFn(e.errors)&&ae.isFn(e.errors.extend);if(!i){e.on("pluginsetup:errors",t);e.on("dispose",()=>{e.off("pluginsetup:errors",t)});return}t()};const ni={400:{AD_CONFIG_NOT_FOUND:"VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND",DUPLICATE_PARAMETERS:"VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS"},401:{TOKEN_REQUIRED:"VIDEO_CLOUD_ERR_TOKEN_REQUIRED",TOKEN_VALIDATION:"VIDEO_CLOUD_ERR_TOKEN_INVALID"},403:{ACCESS_DENIED:{DOMAIN:"PLAYER_ERR_DOMAIN_RESTRICTED",CLIENT_IP:"PLAYER_ERR_IP_RESTRICTED",CLIENT_GEO:"PLAYER_ERR_GEO_RESTRICTED",OFFERS:"PLAYER_ERR_OFFER_RESTRICTED",TAGS:"PLAYER_ERR_TAG_RESTRICTED",ACCOUNT_ID:"PLAYER_ERR_ACCOUNT_ID",DEVICE:"PLAYER_ERR_DEVICE_RESTRICTED"},VIDEO_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE",PLAYLIST_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE",DENIED_BY_STREAM_LIMITING_CREATE:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE",DENIED_BY_STREAM_LIMITING_RENEW:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW",DENIED_BY_STREAM_LIMITING:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING",DENIED_BY_DEVICE_LIMITING:"VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING"},404:{ACCOUNT_NOT_FOUND:"VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND",RESOURCE_NOT_FOUND:"VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND",PLAYLIST_NOT_FOUND:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND"},405:{METHOD_NOT_ALLOWED:"VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED"},500:{SERVER_ERROR:"VIDEO_CLOUD_ERR_SERVER"},502:{VIDEO_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE",VIDEO_URLS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE",PLAYLIST_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE",PLAYLIST_VIDEOS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE",ACCOUNT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE",PLAYBACK_RIGHT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE",LICENSE_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE",OFFERS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE",RIGHTS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE"},503:{SERVICE_UNAVAILABLE:"VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE"},504:{SERVER_TIMEOUT:"VIDEO_CLOUD_ERR_SERVICE_TIMEOUT"}};const ri=(e,t)=>{const i=t.shift();if(ae.isNonEmptyStr(e[i])){return e[i]}if(!i||!e[i]){return"VIDEO_CLOUD_ERR_UNKNOWN"}return ri(e[i],t)};const ai=(e,t)=>{t=Array.isArray(t)?t[0]:t||{};return{code:ri(ni,[e,t.error_code,t.error_subcode])}};const oi=(e,t)=>{return(i,s)=>{if(i){i.data=s;e.catalog.error=i;e.error(ai(i.status,s));return e.trigger("bc-catalog-error")}e.ready(()=>e.catalog.load(t(s)))}};const li=e=>{const t=(t,i,s)=>{if(s.embedHasPoster){t.poster=i.options_.poster}if(s.embedHasSources){t.sources=i.options_.sources}if(s.embedHasTracks){t.textTracks=i.options_.tracks}if(t.textTracks&&t.textTracks.length>0&&e.browser.IS_ANY_SAFARI){i.$(".vjs-tech").setAttribute("crossorigin","anonymous")}return t};const i=(i,s,n)=>{if(i===Kt){return oi(s,e=>t(e,s,n))}return oi(s,r=>{const a=t({},s,n);if(Array.isArray(r.videos)){const t=r.videos[0]||{};r.videos[0]=e.obj.merge(t,a,{rawItem:t})}else{r.videos=[a]}if(n.playlistVideoId&&i===zt){for(let e=0;e<r.length;e++){if(r[e].id===n.playlistVideoId||`ref:${r[e].referenceId}`===n.playlistVideoId){r.startingIndex=e;break}}}return r})};return i};const ui=()=>Number.MAX_SAFE_INTEGER||Math.pow(2,53)-2;const ci=(e,t)=>{const i=e.cuePoints;const s=i[t];let n;for(t++;t<i.length;t++){if(i[t].time>s.time){n=i[t];break}}const r=isFinite(e.duration)?e.duration:ui();s.startTime=s.time;if(n&&n.time<r){s.endTime=n.time}else{s.endTime=r}return s};const di=e=>{const t=e.remoteTextTracks();if(t){let i=t.length;while(i--){e.removeRemoteTextTrack(t[i])}}const i=e.textTracks();if(i){let e=i.length;while(e--){const t=i[e];if(t.kind==="metadata"&&t.cues){let e=t.cues.length;while(e--){t.removeCue(t.cues[e])}}t.mode="disabled"}}};const hi=(t,i)=>{di(t);if(!i.cuePoints){return}const s=t.mediaCuePointsTrack();const n=e.VTTCue||e.vttjs&&e.vttjs.VTTCue||e.TextTrackCue;for(let e=0;e<i.cuePoints.length;e++){const t=i.cuePoints[e];const r=new n(t.startTime,t.endTime,t.type);r.originalCuePoint=t;s.addCue(r)}s.mode="hidden"};const fi=function(e,t,i){let s=0;for(;s<e.length;s++){if(t(e[s])){return e[s]}}return i};function pi(e){const t=pi.windowLocationProtocol();const i=function(e){return e.src&&e.src.indexOf(t)===0};if(e&&e.length&&e.length>0){return fi(e,i,e[0]).src}}pi.windowLocationProtocol=function(){return e.location.protocol};const mi=(e,t)=>`https://${e}.api.${t?t+".":""}brightcove.com/playback/v1/`;const gi={production:{papi:mi("edge"),epa:mi("edge-auth")},qa:{papi:mi("edge","qa"),epa:mi("edge-auth","qa")},staging:{papi:mi("edge","staging"),epa:mi("edge-auth","staging")}};const yi=t=>e.encodeURIComponent(t);const _i=e=>typeof e==="string"&&/^BCpk/.test(e);const vi=e=>{const t={ad_config_id:"adConfigId",config_id:"deliveryConfigId"};const i=["ad_config_id","config_id","tveToken"];if(e.type!==Kt){i.push("limit");i.push("offset")}if(e.type===Yt){i.push("q");i.push("sort")}const s={};i.forEach(i=>{const n=t[i]||i;if(e[n]){s[i]=e[n]}});const n=ae.qs().stringify(s);return n?"?"+n:""};const bi=(e,t)=>{let{env:i,type:s}=t;if(!i){i="production"}let n;if(ae.isNonEmptyStr(t.baseUrl)){n=t.baseUrl}else if(_i(t.policyKey)){n=gi[i].papi}else{n=gi[i].epa}if(n.slice(-1)==="/"){n=n.slice(0,-1)}let r;r=`${n}/accounts/${yi(e)}/${s===zt?"playlists":"videos"}`;if(s!==Yt){r+="/"+yi(t.id)}if(s===Qt){r+="/related"}r+=vi(t);return r};const Ti=e=>{const t=function(t,i,s,n=(()=>{})){const{deliveryConfigId:r,adConfigId:a,id:o,bcovAuthToken:l,policyKey:u,q:c,type:d}=s;if(!i||!d){return n(new Error("accountId and type are required"))}if(d===Yt&&!c){return n(new Error("q is required when performing a search"))}else if(d!==Yt&&!o){return n(new Error("id is required when getting a video or playlist"))}const h=bi(i,s);const f=(e,s)=>{t.trigger(ae.assign({type:`catalog_${e}`,accountId:i,deliveryConfigId:r,adConfigId:a,playlistId:d===zt?o:undefined,related:d===Qt?o:undefined,search:d===Yt?c:undefined,url:h,videoId:d===Kt?o:undefined},s))};const p=(e,t,i)=>f("request_error",{error:e,response:t,body:i});f("request");const m={};if(_i(u)){m.Accept="application/json;pk="+u}else if(l){m.Authorization="Bearer "+l}const g=e.xhr({headers:m,json:true,url:h},(e,t,i)=>{if(e){p(e,g,i);return n(e,i)}if(g.status>=400){p(new Error("Request Failed"),g,i);return n(g,i)}f("response",{response:g});n(null,i)});const y=g.onabort.bind(g);g.onabort=(()=>{const e=new Error("Request Aborted");y();p(e,g,null);return n(e,null)});return g};return t};const Si="https://fps.brightcove.com/v1/application_certificate";const Ei="com.apple.fps.1_0";const Ii=t=>{return e.btoa(String.fromCharCode.apply(null,t))};const ki=e=>{return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};const Ci=({source:e,publisherId:t,applicationId:i})=>{const s=e.key_systems[Ei].certificate_url;if(s){return s}if(i&&t){return`${Si}/${t}/${i}`}return null};const wi=e=>{const t=(t,i)=>{const s=Ci({source:t.source,publisherId:t.publisherId,applicationId:t.applicationId});e.xhr({uri:s,responseType:"arraybuffer"},e.xhr.httpHandler((e,t)=>{if(e){i(e);return}i(null,new Uint8Array(t))}))};return t};const Ai=(e,t)=>{if(typeof t==="string"){return t.split("//")[1]}return ki(t).split("//")[1]};const Oi=e=>{const t=(t,i)=>{return(s,n,r,a)=>{const o=n.split("&").filter(e=>/^renditionType/.test(e))[0]||"";const l=o.split("=")[1];const u={"Content-Type":"application/json",Accept:"application/octet-stream"};if(s.emeHeaders&&s.emeHeaders["BCOV-Auth"]){u["BCOV-Auth"]=s.emeHeaders["BCOV-Auth"]}if(l&&i){t=i[l]}e.xhr({uri:t,method:"POST",responseType:"arraybuffer",json:{publisher_id:s.publisherId,application_id:s.applicationId,key_id:n.split("/")[3],server_playback_context:Ii(r)},headers:u},e.xhr.httpHandler(a,true))}};return t};var Di={getCertificateUri:Ci,initGetCertificate:wi,getContentId:Ai,initCreateGetLicenseFunc:Oi,base64EncodeUint8Array:Ii,FAIRPLAY_KEY_SYSTEM:Ei};const Pi=(e=[])=>e.filter(e=>e.keySystems&&e.keySystems[Di.FAIRPLAY_KEY_SYSTEM]);const xi=(e,t,i)=>{const s=Pi(t);if(!s.length||!e.eme){i();return}const n=e.eme.options||{};let r=0;const a=[];const o={};for(let e=0;e<s.length;e++){const t=s[e];const l=Di.getCertificateUri({source:t,publisherId:n.publisherId,applicationId:n.applicationId});if(!l){continue}if(o[l]){o[l].push(t);continue}r++;o[l]=[t];t.keySystems[Di.FAIRPLAY_KEY_SYSTEM].getCertificate({source:t,publisherId:n.publisherId,applicationId:n.applicationId},(e,t)=>{if(e){a.push({message:"Unable to resolve FairPlay certificate",error:e})}else{const e=o[l];for(let i=0;i<e.length;i++){const s=e[i];s.keySystems[Di.FAIRPLAY_KEY_SYSTEM].getCertificate=((e,i)=>{i(null,t)})}}r--;if(!r){if(a.length){i(a);return}i()}})}};const Li=(e,t)=>{const i=Di.initCreateGetLicenseFunc(t);const s=Di.initGetCertificate(t);if(!ae.isHlsType(e.type)||!e.key_systems||!e.key_systems[Di.FAIRPLAY_KEY_SYSTEM]){return null}const n=e.key_systems[Di.FAIRPLAY_KEY_SYSTEM];const r=n.key_request_url;const a={};a[Di.FAIRPLAY_KEY_SYSTEM]={getCertificate:s,getLicense:i(r,n.key_request_urls),getContentId:Di.getContentId};return a};const Ri=e=>{const t=t=>{return Li(t,e)};return t};var Ni={initGetKeySystemOptions:Ri,getFairPlaySources:Pi,resolveFairPlayCertificates:xi};const Mi=(e,t)=>{t=t||e&&e.mediainfo||{};return e&&e.hasPlugin&&e.hasPlugin("vr")&&t&&t.projection};const Ui=50*1024*1024;const Bi=3*1024*1024;const Fi=.5*1024*1024;const ji={http:{nativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},noNativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},preferMp4:{http:{"application/vnd.apple.mpegurl":3,"video/mp4":1,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":4,"video/mp4":2,"application/dash+xml":6}}},https:{nativeHls:{http:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":1,"video/mp4":4,"application/dash+xml":3}},noNativeHls:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":1,"video/mp4":3,"application/dash+xml":2}},preferMp4:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":2,"video/mp4":1,"application/dash+xml":3}}},codecs:{switching:{hevc:{combined:1,hevc:2,avc:3},nohevc:{combined:5,hevc:6,avc:4}},noswitching:{hevc:{combined:3,hevc:5,avc:2},nohevc:{combined:4,hevc:6,avc:1}}}};const Vi={1:3,2:3.2,3:4.2,4:5,5:6,6:7,7:8};const $i=(e,t)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&ae.isSafariWithFairplaySupport()&&e.eme&&e.eme.options};const qi=(e,t,i)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&ae.isBrowserWithWidevineSupport(i)&&e.eme&&e.eme.options};const Hi=function(e,t,i,s,n){t.priority=9999;if(!t.src){return 9999}if(t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&(t.key_systems["com.apple.fps.1_0"]&&!$i(i,t)||t.key_systems["com.widevine.alpha"]&&!qi(i,t,n))){return 9999}if(t.profiles&&t.profiles.match(/hbbtv/i)){return 9999}if(n.browser.IS_IOS&&t.type==="application/vnd.apple.mpegurl"&&Vi[t.ext_x_version]>parseFloat(n.browser.IOS_VERSION)){return 9999}e=e[/^[^:]*/.exec(t.src)];if(!e){return 9999}if(e[t.type]){t.priority=e[t.type]}const r=t.codecs&&t.codecs.indexOf("avc1")!==-1;const a=t.codecs&&t.codecs.indexOf("hvc1")!==-1;const o=r&&a;let l;if(o){l=s.combined}else if(a){l=s.hevc}else{l=s.avc}return t.priority+l};const Wi=t=>{const i=function(e,i,s,n,r){let a=Wi.preferHttps()?ji.https:ji.http;let o;if(Mi(e,i)){o=Ui}else if(t.browser.IS_IOS||t.browser.IS_ANDROID){o=Fi}else{o=Bi}if(Wi.preferMp4(e,i)){a=a.preferMp4}else if(Wi.supportsNativeHls()){a=a.nativeHls}else{a=a.noNativeHls}let l=Hi(a,n,e,s,t)-Hi(a,r,e,s,t);const u=n.type==="application/vnd.apple.mpegurl"&&n.codecs&&n.ext_x_version||r.type==="application/vnd.apple.mpegurl"&&r.codecs&&r.ext_x_version;const c=n.codecs&&r.codecs?false:true;if(u&&c){l=n.priority-r.priority}delete n.priority;delete r.priority;if(l){return l}if(n.type==="video/mp4"&&r.type==="video/mp4"){if(n.avg_bitrate&&r.avg_bitrate){return Math.abs(n.avg_bitrate-o)-Math.abs(r.avg_bitrate-o)}if(n.avg_bitrate||r.avg_bitrate){l=n.avg_bitrate?-1:1}}if(n.type==="application/vnd.apple.mpegurl"&&r.type==="application/vnd.apple.mpegurl"){if(n.ext_x_version&&r.ext_x_version){return r.ext_x_version-n.ext_x_version}if(n.ext_x_version||r.ext_x_version){l=n.ext_x_version?-1:1}}return l};function s(e,s,n={}){const r=Ni.initGetKeySystemOptions(t);const a=s.sources||[];const o=[];let{bcovAuthToken:l,policyKey:u,watermarkingToken:c,allowPlayreadyInChromiumEdge:d}=n;const h=!!l&&u===null;if(l&&!ae.isNonEmptyStr(l)){t.log.error("The bcovAuthToken catalog property must be a string");l=null}if(c&&!ae.isNonEmptyStr(c)){t.log.error("The watermarking token catalog property must be a string");c=null}for(let i=0;i<a.length;i++){const s=a[i];if(s.key_systems&&s.key_systems["com.microsoft.playready"]&&ae.isChromiumEdge(t)&&(h&&typeof d==="undefined"||d===false)){if(Object.keys(s.key_systems).length>1){delete s.key_systems["com.microsoft.playready"]}else{a.splice(i,1);i--;continue}}if(l&&s.key_systems){s.emeHeaders={"BCOV-Auth":l}}if(c){s.src=s.src.replace("{WMT}",c)}if(s.src&&s.container==="MP4"){s.type="video/mp4"}else if(s.src&&(s.container==="M2TS"||ae.isHlsType(s.type))){s.type="application/vnd.apple.mpegurl";if($i(e,s)){s.keySystems=r(s)}if(ae.isEncryptedHls(s,t)&&l){if(s.vmap&&e.hasPlugin("ssai")){s.bcovAuthToken=l}else{const e=t.url.parseUrl(s.src);let i="bcov_auth="+l;if(!e.search){i="?"+i}else if(!(e.search[e.search.length-1]==="&")){i="&"+i}s.src+=i}}}o.push(s)}const f=Wi.supportsSwitchingCodecs(e)?"switching":"noswitching";const p=Wi.supportsHEVC()?"hevc":"nohevc";const m=ji.codecs[f][p];return o.sort(i.bind(null,e,s,m))}Wi.supportsNativeHls=function(){return ae.isNativeHlsSupported(t)};Wi.preferHttps=function(){return ae.preferHttps(e)};Wi.supportsHEVC=function(){return ae.isHevcSupported()};Wi.supportsSwitchingCodecs=function(e){return ae.isCodecSwitchingSupported(e)};Wi.preferMp4=function(e,i){return t.browser.IS_ANDROID&&t.browser.ANDROID_VERSION<5||Mi(e,i)};return s};class Gi{constructor(){this.defaults_={}}normalize(e,t,i){const s=ae.assign({},this.defaults_);if(e&&!ae.isObj(e)){s.id=e}else{ae.assign(s,e);if(ae.isObj(e.id)){ae.assign(s,e.id);if(!e.id.hasOwnProperty("id")){delete s.id}}}if(typeof t==="string"){s.type=t}if(s.type===Yt){if(!s.q){s.q=s.id}delete s.id}if(typeof e.deliveryConfigId==="string"){s.deliveryConfigId=e.deliveryConfigId}if(typeof i==="string"){s.adConfigId=i}if((s.type===zt||s.type===Yt)&&s.limit===undefined){s.limit="100"}return s}setDefaults(e){if(e===null){this.defaults_={}}else{ae.assign(this.defaults_,e)}}getDefault(e){return ae.isObj(this.defaults_)&&this.defaults_[e]||undefined}getDefaults(){return ae.isObj(this.defaults_)&&ae.assign({},this.defaults_)||{}}}function Ki(e){const t=e.options_.runtime_.settings;const i=t.videoCloud&&t.videoCloud.bumper;let s=false;let n;return{setSource(t,r){const o=e.usingPlugin("playlist")&&e.playlist().length>0;const l=o&&e.playlist.currentItem()>-1?e.playlist()[e.playlist.currentItem()]:e.mediainfo;const u=e.bcPlaylistUi&&e.bcPlaylistUi().options.autoadvance;const c=l.id;const d=l.manifestExpiresAt;e.catalog.isCurrentSourceBumper_=i&&(i.id===l.id||i.id===`ref:${l.referenceId}`);const h=()=>{const t=e.paused();e.catalog.get({id:c,type:"video"}).then(i=>{e.catalog.load(i);if(o){l.manifestExpiresAt=i.manifestExpiresAt;l.sources.forEach((e,t)=>{e.src=i.sources[t].src})}e.one("canplay",()=>{if(!t){e.play()}})}).catch(t=>{e.log.warn(t)})};if(Date.now()>d){h();return}e.one("play",()=>{if(Date.now()>d){h();return}});const f=()=>{e.one("play",()=>e.trigger("bumper-play"));e.one("ended",()=>{e.trigger("bumper-ended");s=true})};const p=()=>{e.one("bumper-ended",()=>{e.bigPlayButton.hide();e.posterImage.hide();if(n){n.poster="";e.catalog.load(n);if(u){e.playlist.autoadvance(u)}}})};if(i){if(e.catalog.isCurrentSourceBumper_);else{n=o?l:n||e.mediainfo}if(!s&&!e.catalog.isCurrentSourceBumper_){e.catalog.get({id:i.id,type:"video"}).then(t=>{t.economics="FREE";t.poster=n.poster;e.catalog.bumper_=a(i,{video:t});e.catalog.load(t)})}else if(!s&&e.catalog.isCurrentSourceBumper_){f();p()}else if(s&&!e.catalog.isCurrentSourceBumper_){e.on("canplay",()=>{e.play();if(o){s=false}})}}r(null,t)}}}const zi={production:"https://edge-gsc.api.brightcove.com",staging:"https://edge-gsc.api.staging.brightcove.com",qa:"https://edge-gsc.api.qa.brightcove.com"};const Yi={maxRetry:3,intervalRetry:6e4,interval:null};const Xi={MAX_CONCURRENCY:"MAX_CONCURRENCY",TOKEN_REQUIRED:"TOKEN_REQUIRED",INVALID_TOKEN:"INVALID_TOKEN",ACCOUNT_ID:"ACCOUNT_ID",UID:"UID",SESSION_ID:"SESSION_ID",CLIMIT:"CLIMIT",VIDEO_ID:"VIDEO_ID",SESSION_STOPPED:"SESSION_STOPPED",SESSION_EXPIRED:"SESSION_EXPIRED",PLAYBACK_RESTRICTIONS:"PLAYBACK_RESTRICTIONS",TOKEN_VALIDATION:"TOKEN_VALIDATION",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_NOT_FOUND"};const Qi=(e,t)=>{if(!t){t="production"}return`${zi[t]}/api/v1/accounts/${e}/sessions`};const Ji=(e,t)=>{const{statusCode:i,body:s}=e;let n=null;if(i<400||i>499){return n}const{error:r}=s;const a=r.sub_code||r.code;switch(a){case Xi.MAX_CONCURRENCY:n={code:"GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING"};t.log.error("GSC heartbeat max concurrency limit.",e);break;case Xi.TOKEN_REQUIRED:n={code:"GSC_TOKEN_REQUIRED"};t.log.error("GSC JWT is required.",e);break;case Xi.INVALID_TOKEN:n={code:"GSC_INVALID_TOKEN"};t.log.error("GSC JWT is required.",e);break;case Xi.ACCOUNT_ID:n={code:"GSC_MISSING_FIELD_ACCOUNT_ID"};t.log.error("GSC AccountID is required.",e);break;case Xi.UID:n={code:"GSC_MISSING_FIELD_UID"};t.log.error("GSC UID is required in JWT.",e);break;case Xi.SESSION_ID:n={code:"GSC_MISSING_FIELD_SESSION_ID"};t.log.error("GSC SID is required in JWT.",e);break;case Xi.CLIMIT:n={code:"GSC_MISSING_FIELD_CLIMIT"};t.log.error("GSC CLIMIT is required in JWT.",e);break;case Xi.VIDEO_ID:n={code:"GSC_MISSING_FIELD_VIDEO_ID"};t.log.error("GSC videoId is required.",e);break;case Xi.SESSION_STOPPED:n={code:"GSC_SESSION_STOPPED"};t.log.error("GSC session stopped.",e);break;case Xi.SESSION_EXPIRED:n={code:"GSC_SESSION_EXPIRED"};t.log.error("GSC session expired.",e);break;case Xi.PLAYBACK_RESTRICTIONS:n={code:"GSC_PLAYBACK_RESTRICTIONS"};t.log.error("GSC playback restrictions not met.",e);break;case Xi.SESSION_NOT_FOUND:n={code:"GSC_SESSION_NOT_FOUND"};t.log.error("GSC session not found.",e);break;case Xi.VIDEO_NOT_FOUND:n={code:"GSC_VIDEO_NOT_FOUND"};t.log.error("GSC video not found",e);break}return n};const Zi=e=>{class t{constructor(t,i={}){this.player=t;this.timerId=null;this.interval=null;this.sid=null;this.retryCount=0;this.options=e.obj.merge(Yi,i);this.player.on("ended",()=>this.stop());this.player.on("dispose",()=>this.stop(null,true));this.player.one("play",()=>this.init())}init(){this.onTimerTick()}onTimerTick(){this.send(t=>{const{statusCode:i,body:s}=t;if(i>=500){this.player.log.error("GSC Heartbeat failed to contact server");this.retry();return}if(i===204){this.player.log.warn("Stream Concurrency feature has not been enabled for this account");return}const n=Ji(t,e);if(n){return this.terminatePlayback(n)}this.interval=s.heartbeat_interval;if(!this.timerId){this.timerId=this.player.setInterval(()=>this.onTimerTick(),this.interval);this.retryCount=0}this.sid=s.sid})}terminatePlayback(e){this.player.one("playerreset",()=>this.player.error(e));this.player.reset()}retry(){const{maxRetry:e,intervalRetry:t}=this.options;if(this.retryCount>=e){this.terminatePlayback({code:"GSC_SESSION_STOPPED"});return}this.clear();this.retryCount++;this.player.setTimeout(()=>this.onTimerTick(),t)}send(t){const{catalog:i}=this.player;const s=i.getCatalogParamDefault_("accountId");const n=i.getCatalogParamDefault_("bcovAuthToken");const r=i.getCatalogParamDefault_("env");const a={Authorization:"Bearer "+n};const o={url:Qi(s,r),method:"POST",json:true,headers:a,body:{video:this.player.mediainfo?this.player.mediainfo.id||"":""}};e.xhr(o,(i,s)=>{if(i){e.log.error("GSC Heartbeat failed to perform request.",i);this.retry();return}t(s)})}clear(){if(!this.timerId){return}this.player.clearInterval(this.timerId);this.timerId=null;this.interval=null;this.sid=null}stop(t=false,i=false){this.isCasting=t;e.log.debug("GSC: about to stop and clear heartbeat");const{catalog:s}=this.player;const n=s.getCatalogParamDefault_("accountId");const r=s.getCatalogParamDefault_("bcovAuthToken");const a=s.getCatalogParamDefault_("env");const o=Qi(n,a);const l={Authorization:"Bearer "+r};const u={url:o,method:"DELETE",json:true,headers:l};this.clear();e.xhr(u,(s,n,r)=>{if(s){e.log.error("GSC failed request for stop session.",s)}if(i){return}const a=Ji(n,e);if(a){this.player.error(a)}if(!t){this.player.one("play",()=>this.init())}})}getSessionId(){return this.sid||""}}return t};const es=/([A-Za-z0-9])_([A-Za-z0-9])/g;const ts=e=>e.replace(es,(e,t,i)=>t+i.toUpperCase());const is=(e,t)=>{return(e.type==="application/vnd.apple.mpegurl"||e.type==="application/dash+xml")&&t.toLowerCase()==="html5"};const ss=(e,t)=>{if(!t){return e}let i=e;if(t.preferMp4){i=e.filter(e=>e.container&&e.container.toLowerCase()==="mp4");if(Array.isArray(t.preferMp4)){const[e,s]=t.preferMp4;i=i.sort((t,i)=>{const n=t.hasOwnProperty(e)?t[e]:null;const r=i.hasOwnProperty(e)?i[e]:null;if(n===null||r===null||!ae.isNum(n)||!ae.isNum(r)){return 0}if(ae.isNonEmptyStr(s)&&s.toLowerCase()==="asc"){return n-r}return r-n})}}return i};const ns=i=>{const s=ei(i);const n=li(i);const a=Wi(i);const o=Ti(i);const l=Zi(i);const u=e=>{const t=i.obj.merge(e);Object.keys(t).filter(e=>e.match(es)).forEach(e=>{t[ts(e)]=t[e]});return t};const c=(e,i)=>{if(!i){return}e.mediainfo=u(i);const s=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const n=e.mediainfo.name;if(s&&n){t.title=n}};const d=(e,t)=>{if(!t){return}e.playlistinfo=u(t);delete e.playlistinfo.videos};function h(t){const r=this;const h=e=>{if(e&&e.accountId){r.trigger({type:"usage",name:"catalog-get-account-id"});return e.accountId}if(typeof r.getAccountId==="function"){return r.getAccountId()}return t.accountId||r.options_["data-account"]};const f=new Gi;let p={};let m;const g={policyKey:r.options_["data-policy-key"],bcovAuthToken:r.options_["data-bcov-auth-token"],watermarkingToken:r.options_["data-watermarking-token"]};const y=Object.keys(g).reduce((e,t)=>{if(g[t]){e[t]=g[t]}return e},{});["adConfigId","allowPlayreadyInChromiumEdge","baseUrl","bcovAuthToken","deliveryConfigId","env","policyKey","sourceSelectionRules","watermarkingToken"].forEach(e=>{if(t.hasOwnProperty(e)){y[e]=t[e]}});let _=null;if(t.streamConcurrency){_=new l(r,t)}f.setDefaults(y);i.hook("beforeerror",ii);si(r);r.on("loadstart",()=>{if(!r.usingPlugin("playlist")||!r.playlist()||!r.playlist().length){return}c(r,r.playlist()[r.playlist.indexOf(r.currentSrc())])});r.on("dispose",()=>di(r));const v=(e,t)=>{const s=Ni.getFairPlaySources(e);if(!s.length){t();return}Ni.resolveFairPlayCertificates(r,s,e=>{if(e){i.log("Unable to resolve FairPlay certificates",e)}t()})};const b=e=>{if(!r.hasPlugin||!r.hasPlugin("ssai")||!e){return e}return e.map(function(e){if(e.vmap){e.type=i.getPlugin("ssai").MIME_TYPE;e.originalHlsSource=e.src;e.src=e.vmap}return e})};const T=e=>{if(!e.variants){return e}const{name:t,description:s,longDescription:n,customFields:r}=e;const a=null;const o={name:t,description:s,longDescription:n,language:a};o.customFields=i.obj.merge(r);const l=e.variants.map(u);e.variants=[...l,o];return e};const S=e=>{if(!e){return}if(Array.isArray(e)){m=e.map(e=>T(u(e)))}else{m=T(u(e))}};const E=(e,t)=>{if(!e||!e.variants){return i.obj.merge(e)}let s=null;let n=null;if(typeof t==="string"){s=t.toLowerCase();n=s.split("-")[0]}const r=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===s);const a=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===n);const o=()=>e.variants.find(e=>e.language===null);const l=r()||a()||o();return i.obj.merge(e,l)};const I=t=>{const s=()=>{let s=false;c(r,t);S(t);if(Mi(r)){const e=r.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}r.el().setAttribute("data-video-id",t.id);if(e.bc&&!e.bc.disposedAfterPreroll_){r.poster(t.poster)}if(t.sources){for(let e=0;e<t.sources.length;e++){if(t.sources[e].vmap!==undefined){s=true;break}}}if(s&&r.onceux!==undefined){r.onceux.loadSourcesFromCatalog(t.sources)}else{if(s){t.sources=b(t.sources)}r.src(t.sources)}hi(r,t);if(t.textTracks){const s=new RegExp("^"+e.location.protocol);const n=new RegExp("^https:");let a=null;let o=null;for(let e=0;e<t.textTracks.length;e++){const i=t.textTracks[e];if(i.label==="thumbnails"){if(r.usingPlugin("thumbnails")&&i.width<=480){if(s.test(i.src)){a=i}else if(n.test(i.src)){o=i}}}else{r.addRemoteTextTrack(i)}}const l=a||o;if(l){r.addRemoteTextTrack({src:l.src,label:"thumbnails",kind:"metadata",mode:"hidden"},false)}if(t.textTracks.length>0&&i.browser.IS_ANY_SAFARI||i.browser.IS_IOS){r.crossOrigin("anonymous")}}};v(t.sources,s)};const k=e=>{if(!r.usingPlugin("playlist")){r.log.warn("A playlist was loaded from the Playback API, but this player is not using the playlist plugin. The first video in the playlist will be loaded instead!");I(e[0]);return}const t=()=>{r.on("beforeplaylistitem",(e,t)=>hi(r,t));r.on("playlistchange",()=>S(r.playlist()));for(let t=0;t<e.length;t++){e[t].sources=b(e[t].sources);const i=e[t].textTracks;if(i&&i.length>0){e[t].textTracks=i.filter(e=>e.label!=="thumbnails")}}const t=e.startingIndex||0;S(e);c(r,e[t]);d(r,r.catalog.data);if(Mi(r)){const e=r.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}r.playlist(e,t)};const i=e.filter(e=>e.sources).reduce((e,t)=>e.concat(t.sources),[]);v(i,t)};const C=(e,i={})=>{let s;const n=u(e);if(n.sources){n.rawSources_=n.sources;n.sources=(t.getSources||a)(r,n,i);if(i.sourceSelectionRules){n.sources=ss(n.sources,i.sourceSelectionRules)}s=r.selectSource(n.sources)}if(n.posterSources){n.poster=pi(n.posterSources)}if(n.thumbnailSources){n.thumbnail=pi(n.thumbnailSources)}if(n.textTracks){const e=s&&is(s.source,s.tech);n.textTracks=n.textTracks.filter(t=>{return!(e&&t.in_band_metadata_track_dispatch_type!==undefined)}).map(e=>{if(e.sources){e.src=pi(e.sources)}return e})}if(n.duration){n.duration=n.duration*.001}if(n.cuePoints){for(let e=0;e<n.cuePoints.length;e++){ci(n,e)}}if(n.manifestUrlTtl){n.manifestExpiresAt=Date.now()+n.manifestUrlTtl*1e3}return n};r.catalog={transformCatalogError:ai,transformVideoResponse:C,mediaCuePointsTrack(){if(!r.catalog.mediaCuePointsTrack.hasWarned_){i.log.warn("player.catalog.mediaCuePointsTrack() is deprecated, please use player.mediaCuePointsTrack() instead!");r.catalog.mediaCuePointsTrack.hasWarned_=true}return r.mediaCuePointsTrack()},get(e,t){e=f.normalize(e);if(r.catalog.tveToken){e.tveToken=r.catalog.tveToken}p=e;r.catalog.loading++;let s;const n=new Promise((t,n)=>{s=o(r,h(e),e,(s,a)=>{r.catalog.loading--;if(e.type===Yt&&a&&(!a.videos||!a.videos.length)){s=new Error("No videos returned from search")}if(s){s.data=a;r.catalog.error=s;return n(s)}if(!a){return t(null)}r.catalog.data=i.obj.merge({},a);if(e.adConfigId){r.catalog.data.adConfigId=e.adConfigId}const o=["allowPlayreadyInChromiumEdge","bcovAuthToken","policyKey","sourceSelectionRules"].reduce((t,i)=>{if(e.hasOwnProperty(i)){t[i]=e[i]}return t},{});if(e.watermarkingToken){o.watermarkingToken=e.watermarkingToken}if(e.type===Kt){r.catalog.sources=a.sources;r.catalog.poster=a.poster;return t(C(a,o))}const l=a.videos.filter(e=>!e.hasOwnProperty("errors")).map(e=>C(e,o));if(l.length){return t(l)}return n(new Error("No videos returned from playlist"))})});if(!ae.isFn(t)){return n}n.then(e=>{t(null,e)}).catch(e=>{t(e,e.data)});return s},getVideo(e,t=(()=>{}),i){return this.get(f.normalize(e,Kt,i),t)},getSequence(e,t=(()=>{}),s){if(!Array.isArray(e)){e=[e]}if(!r.usingPlugin("playlist")){throw new Error("getSequence requires the playlist plugin")}e=e.filter(e=>{if(!/^(search|video|playlist)$/i.test(e.type)){i.log.error("invalid sequence type, please use search, video, or playlist. for:",e);return false}return true});if(!e.length){t(new Error("No valid sequences"),null);return}let n=e.length;const a=new Array(e.length);return e.map((o,l)=>{return this.get(f.normalize(o,o.type,s),(s,u)=>{n--;if(s){i.log.error("failed to request sequence",o);i.log.error("with error",s)}else if(u){if(!Array.isArray(u)){u=[u]}a[l]=u}if(n===0){r.catalog.data=a;const i=a.reduce((e,t)=>t&&e.concat(t),[]);if(!i.length){t(new Error("No data was loaded for the sequence "+JSON.stringify(e),null))}else{t(null,i)}}},s)})},getLazySequence(e,t=(()=>{}),i){if(!Array.isArray(e)){e=[e]}if(!r.usingPlugin("playlist")){throw new Error("getLazySequence requires the playlist plugin")}const s=t=>{return this.getSequence(e.shift(),(i,n)=>{if((i||!n)&&e&&e.length){return s(t)}t(i,n)},i)};const n=()=>{if(!e.length){r.off("playlistitem",n);return}const t=r.playlist;const i=t.currentIndex&&t.currentIndex()||t.currentItem&&t.currentItem()||0;const a=t.lastIndex&&t.lastIndex()||t().length-1||0;if(i!==a){return}s((e,t)=>{if(e||!t){return}r.playlist(r.playlist().concat(t),i)})};r.on("playlistitem",n);return s(t)},getSearch(e,t=(()=>{}),i){return this.get(f.normalize(e,Yt,i),t)},getPlaylist(e,t=(()=>{}),i){return this.get(f.normalize(e,zt,i),t)},load(e){if(Array.isArray(e)){k(e)}else{I(e)}},autoFindAndLoadMedia(e){const t=s(e,r);if(!t){return}e.playlistVideoId=t.playlistVideoId;const i=n(t.type,r,e);if(t.type===Xt){this.getLazySequence(t.id,i)}else{this.get(f.normalize(t),i)}return t},setBcovAuthToken(e){if(e!==null&&!ae.isNonEmptyStr(e)){i.log.warn("Authorization Token must be a valid string or null");return}f.setDefaults({bcovAuthToken:e})},setPolicyKey(e){if(e!==null&&!ae.isNonEmptyStr(e)){i.log.warn("Policy key must be a valid string or null");return}f.setDefaults({policyKey:e})},setWatermarkingToken(e){if(e!==null&&!ae.isNonEmptyStr(e)){i.log.warn("Watermarking token must be a valid string or null");return}f.setDefaults({watermarkingToken:e})},getWatermarkingToken(){return f.getDefault("watermarkingToken")},getCatalogParamDefault_(e){if(e==="accountId"){return h()}return f.getDefault(e)},getLastParams(){return i.obj.merge(p)},getLastData(){return i.obj.merge(r.catalog.data)},getMetadata(e){const{type:t,lang:s}=e?e:{};if(!m){i.log.debug("getMetadata() called with no cached metadata");return t===zt?[]:{}}const n=r.usingPlugin("playlist")?r.playlist():[];if(t===zt&&n.length){return m.map(e=>E(e,s))}if(n.length&&Array.isArray(m)){const e=r.playlist.indexOf(r.currentSrc());if(e===-1){return{}}return E(m[e],s)}return E(m,s)},getHeartbeat(){return _},bumper(){return this.bumper_||null},isCurrentSourceBumper(){return this.isCurrentSourceBumper_},loading:0}}if(!i.getPlugin("catalog")){i.use("*",Ki);i.registerPlugin("catalog",h);h.VERSION=r}};const rs={activeCues:null,cues:null,id:"",inBandMetadataTrackDispatchType:undefined,kind:"metadata",label:"",language:"",mode:"",oncuechange:undefined};const as=["activeCues","cues","id","inBandMetadataTrackDispatchType","kind","label","language"];const os=["mode"];const ls=function(e,t){if(e==="media"&&t.kind==="metadata"&&t.label==="media-cues"){return true}if(e==="id3"&&typeof t.inBandMetadataTrackDispatchType==="string"&&t.inBandMetadataTrackDispatchType.trim().length>0){return true}return false};const us=e=>{class t extends e.EventTarget{constructor(e,t,i=(()=>{})){super();const s=this;s.player_=e;s.reTriggerEvent_=s.reTriggerEvent_.bind(s);s.update_=s.update_.bind(s);s.type_=t;s.logger_=i;as.concat(os).forEach(e=>{const t={get:()=>s.track_&&s.track_[e]||rs[e],enumerable:true};if(os.indexOf(e)!==-1){t.set=function(t){if(!s.track_){return}s.track_[e]=t}}Object.defineProperty(s,e,t)});s.update_();const n=e.textTracks();const r=e=>{if(!s.track_){s.update_(e)}else if(s.track_.mode!=="hidden"){s.track_.mode="hidden";s.logger_(`timeupdate -> type:${s.type_}${s.track_?`,mode:${s.track_.mode}`:""} -> track was set to hidden`)}};["addtrack","removetrack"].forEach(e=>n.addEventListener(e,s.update_));s.player_.on("timeupdate",r);return s}addCue(){const e=arguments;if(!this.track_){this.one("trackexists",()=>this.addCue.apply(this,e));return}return this.track_.addCue.apply(this.track_,e)}removeCue(){const e=arguments;if(!this.track_){return this.one("trackexists",()=>this.removeCue.apply(this,e))}return this.track_.removeCue.apply(this.track_,e)}reTriggerEvent_(e){this.trigger(e)}update_(e={}){let t;if(e.type==="removetrack"&&e.track&&e.track===this.track_){t=null}else if(e.type==="addtrack"&&e.track&&!this.track_&&ls(this.type_,e.track)){t=e.track}else{const e=this.player_.textTracks();let i=e.length;while(i--){if(ls(this.type_,e[i])){t=e[i];break}}}const i=(...t)=>{if(e.type==="timeupdate"){return}this.logger_(...t)};i(`update -> type:${this.type_}, mode:${t?t.mode:"?"} -> event:${e.type||"constructor"}`);if(this.track_===t){i(`update -> type:${this.type_}, mode:${t?t.mode:"?"} -> ${t?"already proxied":"no track to proxy"}`);return}if(this.track_){this.track_.removeEventListener("cuechange",this.reTriggerEvent_)}this.track_=t;if(!this.track_){i(`update -> type:${this.type_}, mode:${t?t.mode:"?"} -> track changed, but no new track exists`);return}if(this.track_.mode!=="hidden"){this.track_.mode="hidden"}this.track_.addEventListener("cuechange",this.reTriggerEvent_);this.trigger("trackexists");i(`update -> type:${this.type_}, mode:${t?t.mode:"?"} -> track exists`)}}t.prototype.allowedEvents_={cuechange:"cuechange"};return t};const cs=e=>{const t=us(e);const i={id3CuePointsTrack(e){let i=this.proxyTracks_.id3;if(!i){i=this.proxyTracks_.id3=new t(this,"id3",e)}return i},mediaCuePointsTrack(e){let i=this.proxyTracks_.media;if(i){return i}i=this.proxyTracks_.media=new t(this,"media",e);if(i.track_){return i}this.addTextTrack("metadata","media-cues");i.update_();return i}};function s(t={}){this.proxyTracks_={};let s=e.createLogger("proxyTracks");if(!t.debug){s=(()=>{})}s("initialized");Object.keys(i).forEach(e=>{this[e]=(()=>i[e].call(this,s))});this.ready(()=>{Object.keys(i).forEach(e=>{const i=this[e]();if(t.debug){i.on("cuechange",()=>{for(let e=0;e<i.activeCues.length;e++){const t=i.activeCues[e];s(`${i.type_} -> cuechange -> activeCues[${e}]: ${t.value&&t.value.key||t.frame&&t.frame.id}`)}})}})})}e.registerPlugin("proxyTracks",s);s.VERSION=r};const ds=function(e,t){const i=e.encryptedWatcher().encryptedSeen();if(!t||!i||t.code!==-2||e.currentTime()>.1){return t}let s;const n=e.currentSource();if(!e.hasPlugin("eme")){s="DRM/EME plugin is not included!"}else if(e.hasPlugin("eme")&&!e.usingPlugin("eme")){s="DRM/EME plugin is included but not initialized!"}else if(!n.keySystems||!Object.keys(n.keySystems).length){s="DRM (keySystems) was not provided!"}if(s){return{code:5,message:`DRM configuration issue prevented playback: ${s}`}}return t};const hs=e=>{const t=e.getPlugin("plugin");class i extends t{constructor(e,t){super(e,t);this.player_=e;this.reset();this.handleEncrypted_=this.handleEncrypted_.bind(this);this.reset=this.reset.bind(this);this.player_.ready(()=>{this.player_.tech_.on("encrypted",this.handleEncrypted_);this.player_.tech_.on("webkitneedkey",this.handleEncrypted_);this.player_.tech_.on("msneedkey",this.handleEncrypted_);this.player_.tech_.on("loadstart",this.reset)},true)}handleEncrypted_(){this.encryptedSeen_=true}encryptedSeen(){return this.encryptedSeen_}reset(){this.encryptedSeen_=false}dispose(){this.reset();this.player_.tech_.off("encrypted",this.handleEncrypted_);this.player_.tech_.off("webkitneedkey",this.handleEncrypted_);this.player_.tech_.off("msneedkey",this.handleEncrypted_);this.player_.tech_.off("loadstart",this.reset)}}const s=e.hooks("beforeerror");if(s.indexOf(ds)===-1){e.hook("beforeerror",ds)}e.registerPlugin("encryptedWatcher",i)};const fs={verbose:false,maxSavedSeekEvents:10,debounceTimeout:1e3,playbackRateTolerance:1.5,stableTimeUpdateCount:3,minInterval:1};const ps=function(e){if(e.isDisposed_){return}e.trigger("seek")};const ms=function(e){const t=function(t){const i=e.obj.merge(fs,t);let s;let n=false;let r;let a;let o;let l;let u=0;const c=[];let d=0;const h={};const f={};const p=i.verbose?(...t)=>e.log.call(e,"seek-events:",...t):()=>{};const m=function(){h.seek=this.seekEvents.last().seekEnd;n=false;p("event seekStart: ",this.seekEvents.last().seekStart);p("event seekEnd: ",this.seekEvents.last().seekEnd)};const g=function(){p("stable");this.seekEvents.stable=true};const y=function(){p("unstable");this.seekEvents.stable=false};const _=function(e){h.seek=this.currentTime();h.clock=e.timeStamp||Date.now();f.seek=h.seek;f.clock=h.clock};const v=ae.debounce(ps,i.debounceTimeout);const b=function(e){r=this.currentTime();a=e.timeStamp||+new Date;o=r-f.seek;if(a===f.clock||r===h.seek){return}l=Math.abs(o)/(Math.abs(a-f.clock)*.001);if(l/this.playbackRate()>this.seekEvents.playbackRateTolerance){if(Math.abs(r-h.seek)>=this.seekEvents.minInterval){this.trigger("unstable");u=0;if(!n){d=Number(h.seek)}c.push({timeStamp:a,seekStart:d,seekEnd:r,seekInterval:r-d});if(c.length>i.maxSavedSeekEvents){c.shift()}n=true;v(this)}}else{u++;if(u>=this.seekEvents.stableTimeUpdateCount&&!this.seekEvents.stable&&!n){this.trigger("stable")}h.seek=r}f.seek=r;f.clock=a};this.seekEvents={stableTimeUpdateCount:i.stableTimeUpdateCount,playbackRateTolerance:i.playbackRateTolerance,debounceTimeout:i.debounceTimeout,minInterval:i.minInterval,stable:false,enabled(){return s},enable:function(){if(s){return}s=true;h.seek=0;h.clock=Date.now();f.seek=0;f.clock=h.clock;this.on("seek",m);this.on("stable",g);this.on("unstable",y);this.on(["loadstart","playing","adplaying"],_);this.on(["timeupdate","adtimeupdate"],b)}.bind(this),disable:function(){if(!s){return}s=false;this.off("seek",m);this.off("stable",g);this.off("unstable",y);this.off(["loadstart","playing","adplaying"],_);this.off(["timeupdate","adtimeupdate"],b)}.bind(this),last(){return c[c.length-1]},all(){return c}};this.seekEvents.enable()};t.VERSION=r;e.registerPlugin("seekEvents",t)};const gs=function(e){e.registerPlugin("touchActive",function(){if(!e.browser.TOUCH_ENABLED){return}const t=this;let i=false;const s=function(){if(!i){t.userActive(false)}};t.one("play",function(){const e=t.options_.inactivityTimeout>0?t.options_.inactivityTimeout:5e3;t.el().className+=" vjs-user-active";t.one(["click","tap"],function(){i=true});t.setTimeout(s,e)})})};const ys={"com.widevine.alpha":"Widevine","com.microsoft.playready":"PlayReady","com.apple.fps":"FairPlay"};const _s={'video/ogg; codecs="theora"':"Ogg",'video/mp4; codecs="avc1.42E01E"':"H.264",'video/mp4; codecs="hvc1"':"HEVC",'video/webm; codecs="vp8, vorbis"':"WebM",'video/webm; codecs="vp9"':"VP9",'application/x-mpegURL; codecs="avc1.42E01E"':"HLS","application/dash+xml":"DASH",'video/mp4; codecs="mp4a.40.2"':"AAC",'video/mp4; codecs="mp4a.6B"':"MP3",'video/mp4; codecs="ac-3"':"Dolby Digital/AC-3",'video/mp4; codecs="mp4a.a6"':"Dolby Digital Plus/EC-3/E-AC-3"};let vs=t.createElement("video");const bs={eme:Object.keys(ys).reduce((e,t)=>{e[t]={name:ys[t],persistentState:false,support:false};return e},{support:Boolean(e.navigator.requestMediaKeySystemAccess||e.MSMediaKeys&&e.MSMediaKeys.isTypeSupported||e.WebKitMediaKeys&&e.WebKitMediaKeys.isTypeSupported)}),formats:Object.keys(_s).reduce((e,t)=>{const i=_s[t];let s=vs.canPlayType(t);if(s){s=s.charAt(0).toUpperCase()+s.slice(1)}else{s="Not supported"}e[i]=s;return e},{}),mse:"MediaSource"in e};vs=null;if(!e.navigator.requestMediaKeySystemAccess){const t=e.MSMediaKeys&&e.MSMediaKeys.isTypeSupported||e.WebKitMediaKeys&&e.WebKitMediaKeys.isTypeSupported||(()=>false);e.navigator.requestMediaKeySystemAccess=function(i,s){let n;let r;e.setTimeout(()=>{const e=s.some(e=>{let s=[];if(e.audioCapabilities){s=s.concat(e.audioCapabilities)}if(e.videoCapabilities){s=s.concat(e.videoCapabilities)}return s.some(e=>{return!t(i,e.contentType)})});if(e){r()}else{n()}});return{then(e){n=e;return this},catch(e){r=e;return this}}}}const Ts={"com.widevine.alpha":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"',robustness:"SW_SECURE_CRYPTO"}]},"com.microsoft.playready":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]},"com.apple.fps":{initDataTypes:["sinf"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}};const Ss=(t,i={})=>{Object.keys(Ts).forEach(s=>{const n=JSON.parse(JSON.stringify(Ts[s]));if(i.persistentState){n.persistentState=i.persistentState}const r=e=>{bs.eme[s][t]=false};try{e.navigator.requestMediaKeySystemAccess(s,[n]).then(()=>{bs.eme[s][t]=true}).catch(r)}catch(e){r()}})};Ss("support");Ss("persistentState",{persistentState:"required"});function Es(e){return e.obj.merge(bs)}const{get:Is}=ae;const ks="unknown";const Cs=t=>{const i=t.getComponent("ModalDialog");const{dom:s}=t;const n={adonly:"Ad-Only",ampSupport:"AMP Support",bcAa:"Adobe Analytics",bcGa:"Google Analytics",bcGtm:"Google Tag Manager",bcPlaylistUi:"Brightcove Playlist UI",bcTealium:"Tealium",chromecastReceiver:"Chromecast Receiver",customEndscreen:"Custom Endscreen",dash:"DASH",dvrux:"Live DVRUX",FreeWheelPlugin:"FreeWheel",ima3:"IMA3",kollective:"Kollective",onceux:"OnceUX",pip:"Picture-in-Picture",qualityMenu:"Quality Menu",social:"Social",ssai:"SSAI",thumbnails:"Thumbnails",vr:"VR"};const r=(e,t="vjs-two")=>{return s.createEl("table",{className:t},{},s.createEl("tbody",{},{},e))};const a=(...e)=>{const t=e.map(e=>s.createEl("td",{},{},String(e)));return s.createEl("tr",{},{},t)};class o extends i{buildCSSClass(){return`vjs-player-info-modal ${super.buildCSSClass()}`}dataForPlugins_(){return Object.keys(n).filter(t.getPlugin).sort().map(e=>{const i=this.player();let s=t.getPluginVersion(e)||Is(i,`${e}.VERSION`,ks);if(e==="eme"&&s===ks&&t.drm&&t.drm.VERSION){s=t.drm.VERSION}return{active:i.usingPlugin(e),displayName:n[e],version:s}})}dataForSource_(){const e=this.player();const t=e.currentSource()||{};const i=e.tech(true);return{keySystem:i?i.el().keySystem:null,mediainfo:e.mediainfo,tech:e.techName_,type:t.type,url:t.src}}dataForVhs_(){const e=this.player();const t=e.tech(true);const i=t?t.vhs:null;if(!i){return null}const s={bandwidth:Is(i,"stats.bandwidth",ks),mediaBytesTransferred:Is(i,"stats.mediaBytesTransferred",ks),mediaTransferDuration:Is(i,"stats.mediaTransferDuration",ks),mediaRequests:Is(i,"stats.mediaRequests",ks),versions:i.version()};const n=Is(i,"playlists",{media:()=>{}}).media();if(n){s.rendition={height:Is(n,"attributes.RESOLUTION.height",ks),width:Is(n,"attributes.RESOLUTION.width",ks)}}return s}data(){const i=this.player();const n=s.getAttributes(i.el());const r=Is(i,"bcinfo.accountId",Is(n,"data-account",ks));const a=Is(i,"bcinfo.playerId",Is(n,"data-player",ks));const o=Is(i,"bcinfo.embedId",Is(n,"data-embed",ks));const l=Is(i,"bcinfo.applicationId",Is(n,"data-application-id","-"));const u=Is(e,`bc.${a}_${o}.VERSION`,Is(e,"bc.VERSION",ks));const c=Is(e,`bc.${a}_${o}.videojs.VERSION`,Is(e,"videojs.VERSION",ks));return{capabilities:Es(t),player:{accountId:r,playerId:a,embedId:o,applicationId:l,playerVersion:u,videojsVersion:c,language:i.language()},plugins:this.dataForPlugins_(),source:this.dataForSource_(),vhs:this.dataForVhs_()}}contentForPlayer_(e){const{player:t}=e;const i=[a("Brightcove Player Version",t.playerVersion),a("Video.js Version",t.videojsVersion),a("Account ID",t.accountId),a("Player ID",t.playerId),a("Embed ID",t.embedId),a("Application ID",t.applicationId)];return r(i)}contentForPlugins_(e){const t=e.plugins.map(e=>{return a(e.displayName,e.version,e.active?"Yes":"No")});if(!t.length){t.push(s.createEl("tr",{innerHTML:'<td colspan="3">No plugins available.</td>'}))}const i=r(t);const n=s.createEl("thead",{innerHTML:`\n <tr>\n <th>Name</th>\n <th>Version</th>\n <th>Active?</th>\n </tr>\n `.trim()});i.insertBefore(n,i.querySelector("tbody"));return i}contentForSource_(e){const{keySystem:t,mediainfo:i,type:s}=e.source;const n=[a("Current Media Type",s),a("DRM Key System",t||"n/a")];if(i){if(i.id){n.push(a("Video ID",i.id))}if(i.name){n.push(a("Video Name",i.name))}}return r(n)}contentForVhs_(e){const{vhs:t}=e;const i=[];if(t){if(ae.isObj(t.versions)){i.push(s.createEl("tr",{innerHTML:'<td colspan="2"><b>Library Versions</b></td>'}));Object.keys(t.versions).forEach(e=>{i.push(a(e,t.versions[e]))})}i.push(s.createEl("tr",{innerHTML:'<td colspan="2"><b>Statistics</b></td>'}),a("Current Bandwidth",t.bandwidth),a("Media Bytes Transferred",t.mediaBytesTransferred),a("Media Requests",t.mediaRequests),a("Media Transfer Duration",t.mediaTransferDuration));if(t.rendition){i.push(a("Rendition Width",t.rendition.width),a("Rendition Height",t.rendition.height))}}else{i.push(s.createEl("tr",{innerHTML:'<td colspan="2">Using native playback engine.</td>'}))}return r(i)}contentForCapabilities_(e){const{eme:t,mse:i}=e.capabilities;const s=[a("Media Source Extensions",i?"Yes":"No"),a("Encrypted Media Extensions",t.support?"Yes":"No")];Object.keys(t).forEach(e=>{if(e==="support"){return}const{name:i,persistentState:n,support:r}=t[e];s.push(a(i,r?"Yes":"No"));if(r){s.push(a(`${i} with persistentState`,n?"Yes":"No"))}});return r(s)}contentForFormats_(e){const{formats:t}=e.capabilities;const i=Object.keys(t).map(e=>{return a(e,t[e])});return r(i)}content(){const e=this.data();return[s.createEl("div",{className:"vjs-pi-section"},{},[s.createEl("h2",{},{},"Player Information"),this.contentForPlayer_(e),s.createEl("h2",{},{},"Media Information"),this.contentForSource_(e),s.createEl("h2",{},{},"Player Plugins"),this.contentForPlugins_(e)]),s.createEl("div",{className:"vjs-pi-section"},{},[s.createEl("h2",{},{},"Playback Engine"),this.contentForVhs_(e),s.createEl("h2",{},{},"Device Capabilities"),this.contentForCapabilities_(e),s.createEl("h2",{},{},"Device Format Support"),this.contentForFormats_(e)])]}}t.registerComponent("PlayerInfoModal",o);return o};const ws=e=>{Cs(e);function t(){if(this.playerInfo.modal){this.playerInfo.modal.dispose()}this.playerInfo=function(){t.apply(this,arguments)};this.ready(()=>{this.addClass("vjs-player-info");this.playerInfo.modal=this.addChild("playerInfoModal",{fillAlways:true,label:this.localize("Player Information Dialog"),temporary:false});this.playerInfo.modal.on("dispose",()=>{delete this.playerInfo})})}e.registerPlugin("playerInfo",t);t.VERSION=r};const As=e=>{const t=(e,t)=>{if(typeof e.usingPlugin==="function"){return e.usingPlugin(t)}return!!e[t]};const i=e=>{e.postrollFinished=false;e.postrollTimedOut=false;e.sawNoPostrollEvent=false};const s=e=>{if(!t(e,"ads")){return false}const i=e.endscreenState_;if(i.sawNoPostrollEvent){return false}return!i.postrollFinished&&!i.postrollTimedOut};const n=e=>{if(!t(e,"playlist")){return false}const i=e.playlist;const s=i();if(i.autoadvance_.delay!==0||!s.length){return false}return i.repeat()||i.currentItem()!==s.length-1};const a=function(){if(this.endscreenState_){return}const e=this.endscreenState_={};const t=()=>{this.trigger("endscreen")};i(e);this.on("adstart",()=>{const t=this.ended();if(this.ads.adType==="postroll"){e.isPostroll=true}e.postrollFinished=!t});this.on("adend",()=>{e.postrollFinished=this.ended()});this.on("adtimeout",()=>{e.postrollTimedOut=this.ended()});this.on(["endscreen","loadstart"],()=>{this.off("adend",t);i(e)});this.on("nopostroll",()=>{e.sawNoPostrollEvent=true});this.on("ended",()=>{if(n(this)){return}if(s(this)){this.one("adend",()=>{if(e.isPostroll){t()}});return}t()})};a.VERSION=r;if(!e.getPlugin("endscreen")){e.registerPlugin("endscreen",a)}};function Os(){Os=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){e[s]=i[s]}}}return e};return Os.apply(this,arguments)}var Ds=function e(t){var i=new ArrayBuffer(t.length*2);var s=new Uint16Array(i);for(var n=0;n<t.length;n++){s[n]=t.charCodeAt(n)}return s};var Ps=function e(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))};var xs=function e(i){var s=t.createElement("a");s.href=i;return s.hostname};var Ls=function e(t,i){if(t===i){return true}if(t.byteLength!==i.byteLength){return false}var s=new DataView(t);var n=new DataView(i);for(var r=0;r<s.byteLength;r++){if(s.getUint8(r)!==n.getUint8(r)){return false}}return true};var Rs=function e(t){if(t instanceof Uint8Array||t instanceof Uint16Array){return t.buffer}return t};var Ns=function e(){var t=n["default"].obj||n["default"];var i=t.merge||t.mergeOptions;for(var s=arguments.length,r=new Array(s),a=0;a<s;a++){r[a]=arguments[a]}return i.apply(t,r)};var Ms=function e(){var t=Ns.apply(void 0,arguments);Object.keys(t).forEach(function(e){if(t[e]===null){delete t[e]}});return t};var Us=n["default"].xhr.httpHandler;if(!Us){Us=function e(t,i){return function(e,s,n){if(e){t(e);return}if(s.statusCode>=400&&s.statusCode<=599){var r=n;if(i){r=String.fromCharCode.apply(null,new Uint8Array(n))}t({cause:r});return}t(null,n)}}}var Bs=function t(i){var s=String.fromCharCode.apply(null,new Uint16Array(i));var n=(new e.DOMParser).parseFromString(s,"application/xml");var r=n.getElementsByTagName("HttpHeaders")[0];var a={};if(r){var o=r.getElementsByTagName("name");var l=r.getElementsByTagName("value");for(var u=0;u<o.length;u++){a[o[u].childNodes[0].nodeValue]=l[u].childNodes[0].nodeValue}}var c=n.getElementsByTagName("Challenge")[0];var d;if(c){d=e.atob(c.childNodes[0].nodeValue)}return{headers:a,message:d}};var Fs=function e(t,i,s,r){var a=Bs(i);var o=a.message;var l=Ms(a.headers,s.emeHeaders,t.licenseHeaders);n["default"].xhr({uri:t.url,method:"post",headers:l,body:o,responseType:"arraybuffer"},Us(r,true))};var js=function e(t){if(t.supportedConfigurations){return t.supportedConfigurations}var i={};var s=t.audioContentType;var n=t.audioRobustness;var r=t.videoContentType;var a=t.videoRobustness;var o=t.persistentState;if(s||n){i.audioCapabilities=[Os({},s?{contentType:s}:{},n?{robustness:n}:{})]}if(r||a){i.videoCapabilities=[Os({},r?{contentType:r}:{},a?{robustness:a}:{})]}if(o){i.persistentState=o}return[i]};var Vs=function t(i){var s;Object.keys(i).forEach(function(t){var n=js(i[t]);if(!s){s=e.navigator.requestMediaKeySystemAccess(t,n)}else{s=s.catch(function(i){return e.navigator.requestMediaKeySystemAccess(t,n)})}});return s};var $s=function e(t,i){var s=i.mediaKeys,r=i.initDataType,a=i.initData,o=i.options,l=i.getLicense,u=i.removeSession,c=i.eventBus;var d=s.createSession();c.trigger("keysessioncreated");t.on("dispose",function(){d.close()});return new Promise(function(s,h){d.addEventListener("message",function(e){if(e.messageType!=="license-request"&&e.messageType!=="license-renewal"){return}l(o,e.message).then(function(e){s(d.update(e))}).catch(function(e){h(e)})},false);d.addEventListener("keystatuseschange",function(s){var r=false;d.keyStatuses.forEach(function(e,t){c.trigger({keyId:t,status:e,target:d,type:"keystatuschange"});switch(e){case"expired":r=true;break;case"internal-error":var i='Key status reported as "internal-error." Leaving the session open since we '+"don't have enough details to know if this error is fatal.";n["default"].log.warn(i,s);break}});if(r){d.close().then(function(){u(a);e(t,i)})}},false);d.generateRequest(r,a).catch(function(){h("Unable to create or initialize key session")})})};var qs=function e(t){var i=t.player,s=t.video,n=t.initDataType,r=t.initData,a=t.options,o=t.getLicense,l=t.removeSession,u=t.eventBus;if(s.mediaKeysObject){return $s(i,{mediaKeys:s.mediaKeysObject,initDataType:n,initData:r,options:a,getLicense:o,removeSession:l,eventBus:u})}s.pendingSessionData.push({initDataType:n,initData:r,options:a,getLicense:o,removeSession:l,eventBus:u});return Promise.resolve()};var Hs=function e(t){var i=t.player,s=t.video,n=t.certificate,r=t.createdMediaKeys;s.mediaKeysObject=r;var a=[];if(n){a.push(r.setServerCertificate(n))}for(var o=0;o<s.pendingSessionData.length;o++){var l=s.pendingSessionData[o];a.push($s(i,{mediaKeys:s.mediaKeysObject,initDataType:l.initDataType,initData:l.initData,options:l.options,getLicense:l.getLicense,removeSession:l.removeSession,eventBus:l.eventBus}))}s.pendingSessionData=[];a.push(s.setMediaKeys(r));return Promise.all(a)};var Ws=function e(t){return function(e,i,s){Fs(t,i,e,s)}};var Gs=function e(t){return function(e,i,s){var r=Ms({"Content-type":"application/octet-stream"},e.emeHeaders,t.licenseHeaders);n["default"].xhr({uri:t.url,method:"POST",responseType:"arraybuffer",body:i,headers:r},Us(s,true))}};var Ks=function e(t,i){return function(e,s){return new Promise(function(n,r){t(e,s,function(e,t){if(i){i.trigger("licenserequestattempted")}if(e){r(e);return}n(t)})})}};var zs=function e(t,i){if(typeof i==="string"){i={url:i}}if(!i.url&&!i.getLicense){throw new Error("Neither URL nor getLicense function provided to get license")}if(i.url&&!i.getLicense){i.getLicense=t==="com.microsoft.playready"?Ws(i):Gs(i)}return i};var Ys=function e(t){var i=t.player,s=t.video,n=t.initDataType,r=t.initData,a=t.keySystemAccess,o=t.options,l=t.removeSession,u=t.eventBus;var c=Promise.resolve();if(typeof s.mediaKeysObject==="undefined"){s.mediaKeysObject=null;s.pendingSessionData=[];var d;var h;c=new Promise(function(e,t){s.keySystem=a.keySystem;h=zs(a.keySystem,o.keySystems[a.keySystem]);if(!h.getCertificate){e(a);return}h.getCertificate(o,function(i,s){if(i){t(i);return}d=s;e()})}).then(function(){return a.createMediaKeys()}).then(function(e){return Hs({player:i,video:s,certificate:d,createdMediaKeys:e})}).catch(function(e){if(e){return Promise.reject(e)}return Promise.reject("Failed to create and initialize a MediaKeys object")})}return c.then(function(){var e=zs(s.keySystem,o.keySystems[s.keySystem]),t=e.getLicense;return qs({player:i,video:s,initDataType:n,initData:r,options:o,getLicense:s.keySystem?Ks(t,u):null,removeSession:l,eventBus:u})})};var Xs="com.apple.fps.1_0";var Qs=function e(t){var i=t.initData,s=t.id,n=t.cert;if(typeof s==="string"){s=Ds(s)}var r=0;var a=new ArrayBuffer(i.byteLength+4+s.byteLength+4+n.byteLength);var o=new DataView(a);var l=new Uint8Array(a,r,i.byteLength);l.set(i);r+=i.byteLength;o.setUint32(r,s.byteLength,true);r+=4;var u=new Uint16Array(a,r,s.length);u.set(s);r+=u.byteLength;o.setUint32(r,n.byteLength,true);r+=4;var c=new Uint8Array(a,r,n.byteLength);c.set(n);return new Uint8Array(a,0,a.byteLength)};var Js=function t(i){var s=i.video,n=i.contentId,r=i.initData,a=i.cert,o=i.options,l=i.getLicense,u=i.eventBus;return new Promise(function(t,i){if(!s.webkitKeys){try{s.webkitSetMediaKeys(new e.WebKitMediaKeys(Xs))}catch(e){i("Could not create MediaKeys");return}}var c;try{c=s.webkitKeys.createSession("video/mp4",Qs({id:n,initData:r,cert:a}))}catch(e){i("Could not create key session");return}u.trigger("keysessioncreated");c.contentId=n;c.addEventListener("webkitkeymessage",function(e){l(o,n,e.message,function(e,t){if(u){u.trigger("licenserequestattempted")}if(e){i(e);return}c.update(new Uint8Array(t))})});c.addEventListener("webkitkeyadded",function(){t()});c.addEventListener("webkitkeyerror",function(){var e=c.error;i("KeySession error: code "+e.code+", systemCode "+e.systemCode)})})};var Zs=function e(t){return function(e,i){var s=Ms(e.emeHeaders,t.certificateHeaders);n["default"].xhr({uri:t.certificateUri,responseType:"arraybuffer",headers:s},Us(function(e,t){if(e){i(e);return}i(null,new Uint8Array(t))}))}};var en=function e(t,i){return xs(Ps(i))};var tn=function e(t){return function(e,i,s,r){var a=Ms({"Content-type":"application/octet-stream"},e.emeHeaders,t.licenseHeaders);n["default"].xhr({uri:t.licenseUri,method:"POST",responseType:"arraybuffer",body:s,headers:a},Us(r,true))}};var sn=function e(t){var i=t.video,s=t.initData,n=t.options,r=t.eventBus;var a=n.keySystems[Xs];var o=a.getCertificate||Zs(a);var l=a.getContentId||en;var u=a.getLicense||tn(a);return new Promise(function(e,t){o(n,function(i,s){if(i){t(i);return}e(s)})}).then(function(e){return Js({video:i,cert:e,initData:s,getLicense:u,options:n,contentId:l(n,s),eventBus:r})})};var nn="com.microsoft.playready";var rn=function e(t,i,s,n){var r=t.keySystems[nn];if(typeof r.getKey==="function"){r.getKey(t,s.destinationURL,s.message.buffer,function(e,t){if(e){n.trigger({message:"Unable to get key: "+e,target:i,type:"mskeyerror"});return}i.update(t)});return}if(typeof r==="string"){r={url:r}}else if(typeof r==="boolean"){r={}}if(!r.url){r.url=s.destinationURL}var a=function e(t,s){if(n){n.trigger("licenserequestattempted")}if(t){n.trigger({message:"Unable to request key from url: "+r.url,target:i,type:"mskeyerror"});return}i.update(new Uint8Array(s))};if(r.getLicense){r.getLicense(t,s.message.buffer,a)}else{Fs(r,s.message.buffer,t,a)}};var an=function e(t,i,s,n){var r=t.msKeys.createSession("video/mp4",i);if(!r){throw new Error("Could not create key session.")}n.trigger("keysessioncreated");r.addEventListener("mskeymessage",function(e){rn(s,r,e,n)});r.addEventListener("mskeyerror",function(e){n.trigger({message:"Unexpected key error from key session with "+("code: "+r.error.code+" and systemCode: "+r.error.systemCode),target:r,type:"mskeyerror"})});r.addEventListener("mskeyadded",function(){n.trigger({target:r,type:"mskeyadded"})})};var on=function(t){var i=t.video,s=t.initData,n=t.options,r=t.eventBus;if(i.msKeys){delete i.msKeys}try{i.msSetMediaKeys(new e.MSMediaKeys(nn))}catch(e){throw new Error("Unable to create media keys for PlayReady key system. "+"Error: "+e.message)}an(i,s,n,r)};var ln="3.11.1";var un=function e(t,i){for(var s=0;s<t.length;s++){if(!t[s].initData){continue}var n=Rs(t[s].initData);var r=Rs(i);if(Ls(n,r)){return true}}return false};var cn=function e(t,i){for(var s=0;s<t.length;s++){if(t[s].initData===i){t.splice(s,1);return}}};var dn=function e(t,i,s,n,r){if(!s||!s.keySystems){return Promise.resolve()}var a=i.initData;return Vs(s.keySystems).then(function(e){var o=e.keySystem;if(s.keySystems[o]&&s.keySystems[o].pssh){a=s.keySystems[o].pssh}if(un(n,a)||!a){return Promise.resolve()}n.push({initData:a});return Ys({player:t,video:i.target,initDataType:i.initDataType,initData:a,keySystemAccess:e,options:s,removeSession:cn.bind(null,n),eventBus:r})})};var hn=function e(t,i,s){if(!i.keySystems||!i.keySystems[Xs]||!t.initData){return Promise.resolve()}return sn({video:t.target,initData:t.initData,options:i,eventBus:s})};var fn=function e(t,i,s,n){if(!i.keySystems||!i.keySystems[nn]){return}if(s.reduce(function(e,t){return e||t.playready},false)){return}var r=t.initData;if(i.keySystems[nn]&&i.keySystems[nn].pssh){r=i.keySystems[nn].pssh}if(!r){return}s.push({playready:true,initData:r});on({video:t.target,initData:r,options:i,eventBus:n})};var pn=function e(t){return Ns(t.currentSource(),t.eme.options)};var mn=function e(t){var i=t.src();if(i!==t.eme.activeSrc){t.eme.activeSrc=i;t.eme.sessions=[]}};var gn=function e(t){return function(e){var i={code:5};if(typeof e==="string"){i.message=e}else if(e){if(e.message){i.message=e.message}if(e.cause&&(e.cause.length||e.cause.byteLength)){i.cause=e.cause}}t.error(i)}};var yn=function t(i,s){if(i.$(".vjs-tech").tagName.toLowerCase()!=="video"){return}mn(i);if(e.WebKitMediaKeys){var n=function e(t){mn(i);hn(t,pn(i),i.tech_).catch(s)};i.tech_.el_.addEventListener("webkitneedkey",function(e){var t=pn(i);var s=t.firstWebkitneedkeyTimeout||1e3;var r=i.src();i.eme.webkitneedkey_=i.eme.webkitneedkey_||{};if(i.eme.webkitneedkey_.src!==r){i.eme.webkitneedkey_={handledFirstEvent:false,src:r}}if(!i.eme.webkitneedkey_.handledFirstEvent){i.clearTimeout(i.eme.webkitneedkey_.timeout);i.eme.webkitneedkey_.timeout=i.setTimeout(function(){i.eme.webkitneedkey_.handledFirstEvent=true;i.eme.webkitneedkey_.timeout=null;n(e)},s)}else{n(e)}})}else if(e.MediaKeys){i.tech_.el_.addEventListener("encrypted",function(e){mn(i);dn(i,e,pn(i),i.eme.sessions,i.tech_).catch(s)})}else if(e.MSMediaKeys){i.tech_.el_.addEventListener("msneedkey",function(e){mn(i);try{fn(e,pn(i),i.eme.sessions,i.tech_)}catch(e){s(e)}});i.tech_.on("mskeyerror",s);i.on("dispose",function(){i.tech_.off("mskeyerror",s)})}};var _n=function e(t){if(t===void 0){t={}}var i=this;var s=gn(i);i.ready(function(){return yn(i,s)});i.eme={initializeMediaKeys:function e(n,r,a){if(n===void 0){n={}}if(r===void 0){r=function e(){}}if(a===void 0){a=false}var o=Ns(i.currentSource(),t,n);var l={initDataType:"cenc",initData:null,target:i.tech_.el_};mn(i);if(i.tech_.el_.setMediaKeys){dn(i,l,o,i.eme.sessions,i.tech_).then(function(){return r()}).catch(function(e){r(e);if(!a){s(e)}})}else if(i.tech_.el_.msSetMediaKeys){var u=function e(t){i.tech_.off("mskeyadded",e);i.tech_.off("mskeyerror",e);if(t.type==="mskeyerror"){r(t.target.error);if(!a){s(t.message)}}else{r()}};i.tech_.one("mskeyadded",u);i.tech_.one("mskeyerror",u);try{fn(l,o,i.eme.sessions,i.tech_)}catch(e){i.tech_.off("mskeyadded",u);i.tech_.off("mskeyerror",u);r(e);if(!a){s(e)}}}},options:t}};n["default"].registerPlugin("eme",_n);_n.VERSION=ln;const vn=t=>{const i=e.atob(t);const s=new Uint8Array(i.length);for(let e=0;e<i.length;e++){s[e]=i.charCodeAt(e)}return s};const bn=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="";let s;let n;let r;let a;let o;let l;let u;let c=0;while(c<e.length){s=e[c++];n=c<e.length?e[c++]:Number.NaN;r=c<e.length?e[c++]:Number.NaN;a=s>>2;o=(s&3)<<4|n>>4;l=(n&15)<<2|r>>6;u=r&63;if(isNaN(n)){l=u=64}else if(isNaN(r)){u=64}i+=t.charAt(a)+t.charAt(o)+t.charAt(l)+t.charAt(u)}return i};const Tn=t=>(i,s,n)=>{if(i){return t(i)}const r=new e.DOMParser;const a=r.parseFromString(n,"text/xml");if(s.statusCode>=400){const e=a.getElementsByTagName("Error");let i=`License call failed with status code ${s.statusCode}.`;if(e.length>0){const e=a.getElementsByTagName("Message");if(e.length>0){i+=" "+e[0].childNodes[0].nodeValue}}return t(i)}let o="";const l=a.getElementsByTagName("ckc");if(l.length>0){o=l[0].childNodes[0].nodeValue}const u=vn(o);t(null,u)};const Sn=t=>{return{"com.apple.fps.1_0":{overrideOptions:{getLicense:(i,s,n,r)=>{const a=i.keySystems["com.apple.fps.1_0"].licenseUri;const o=e.btoa(String.fromCharCode.apply(null,n));const l=Tn(r);t.xhr({uri:a,method:"POST",body:`spc=${o}`,headers:{"Content-type":"application/x-www-form-urlencoded"}},l)}}}}};const En="utf-16";const In="utf-8";const kn="http://schemas.xmlsoap.org/soap/envelope/";function Cn(t,i){const s=i===En?new Uint16Array(t):new Uint8Array(t);const n=String.fromCharCode.apply(null,s);const r=new e.DOMParser;const a=r.parseFromString(n,"application/xml");return a}function wn(e,t=In){const i=Cn(e,t);let s="";let n="";let r="";let a=-1;let o=-1;const l=i?i.getElementsByTagNameNS(kn,"Envelope")[0]:null;const u=l?l.getElementsByTagNameNS(kn,"Body")[0]:null;const c=u?u.getElementsByTagNameNS(kn,"Fault")[0]:null;const d=c?c.getElementsByTagName("detail")[0]:null;const h=d?d.getElementsByTagName("Exception")[0]:null;let f=null;if(!c){return null}f=c.getElementsByTagName("faultstring")[0].firstChild;s=f?f.nodeValue:null;if(h!==null){f=h.getElementsByTagName("StatusCode")[0];n=f?f.firstChild.nodeValue:null;f=h.getElementsByTagName("Message")[0];r=f?f.firstChild.nodeValue:null;a=r?r.lastIndexOf("[")+1:-1;o=r?r.indexOf("]"):-1;r=r?r.substring(a,o):""}let p=`code: ${n}, name: ${s}`;if(r){p+=`, message: ${r}`}return p}function An(t,i=En){const s=Cn(t,i);const n={"Content-Type":`text/xml; charset=${i}`};let r=t;const a=s.querySelector("PlayReadyKeyMessage");if(!a){return{headers:n,body:r}}const o=a.querySelectorAll("name");const l=a.querySelectorAll("value");for(let e=0;e<o.length;e++){n[o[e].firstChild.textContent]=l[e].firstChild.textContent}if(n.hasOwnProperty("Content")){n["Content-Type"]=n.Content;delete n.Content}const u=a.querySelector("Challenge").firstChild.nodeValue;if(u){r=e.atob(u)}return{headers:n,body:r}}const On="https://lic.drmtoday.com";const Dn=`${On}/license-proxy-widevine/cenc/`;const Pn=`${On}/license-proxy-headerauth/drmtoday/RightsManager.asmx`;const xn=`${On}/license-server-fairplay/`;const Ln=`${On}/license-server-fairplay/cert/`;const Rn=e=>String.fromCharCode.apply(null,new Uint16Array(e));const Nn=e=>(t,i,s)=>{if(t){return e(t)}return e(null,new Uint8Array(s))};const Mn=(e,t)=>{const i=t.buffer?t.buffer:t;const s=Rn(i);const n="skd://drmtoday?";const r=s.indexOf(n);if(r>-1){return s.substring(r+n.length).replace(/assetid/gi,"assetId").replace(/variantid/gi,"variantId")}return""};const Un=t=>t.customDataIsB64?t.customData:e.btoa(t.customData);const Bn=(e,t)=>e.xhr.httpHandler((e,i)=>{if(e){return t(e)}let s=i.trim();if(s.substr(0,5)==="<ckc>"&&s.substr(-6)==="</ckc>"){s=s.slice(5,-6)}const n=vn(s);t(null,n)});const Fn=e=>{return{"com.apple.fps.1_0":{overrideOptions:{getCertificate:(t,i)=>{const s=Nn(i);const n=t.keySystems["com.apple.fps.1_0"];const{options:r}=n.vendor;e.xhr({uri:n.certificateUri||Ln,method:"GET",responseType:"arraybuffer",headers:{"x-dt-auth-token":r.authToken,"x-dt-custom-data":Un(r),Pragma:"Cache-Control: no-cache","Cache-Control":"max-age=0"}},e.xhr.httpHandler(s))},getContentId:Mn,getLicense:(t,i,s,n)=>{const r=Bn(e,n);const a=encodeURIComponent(bn(s));const o=t.keySystems["com.apple.fps.1_0"];const{options:l}=o.vendor;e.xhr({uri:o.licenseUri||xn,method:"POST",responseType:"text",body:`spc=${a}&${i}`,headers:{"x-dt-auth-token":l.authToken,"x-dt-custom-data":Un(l),"Content-type":"application/x-www-form-urlencoded"}},r)}}},"com.widevine.alpha":{overrideOptions:{getLicense(t,i,s){const n=t.keySystems["com.widevine.alpha"];const{options:r}=n.vendor;e.xhr({uri:n.licenseUri||Dn,method:"POST",responseType:"json",body:new Uint8Array(i),headers:{"x-dt-auth-token":r.authToken,"x-dt-custom-data":Un(r)}},e.xhr.httpHandler((e,t,i)=>{if(e){s(e);return}const n=vn(i.license);s(null,n)}))}}},"com.microsoft.playready":{overrideOptions:{getLicense(t,i,s){const n=t.keySystems["com.microsoft.playready"];const{options:r}=n.vendor;const a=An(i);a.headers["x-dt-auth-token"]=r.authToken;a.headers["x-dt-custom-data"]=Un(r);e.xhr({uri:n.licenseUri||Pn,method:"POST",body:a.body,headers:a.headers,responseType:"arraybuffer"},e.xhr.httpHandler((e,t,i)=>{e=e||wn(i);if(e){s(e);return}s(null,i)}))}}}}};const jn=e=>{return{azure:Sn(e),castlabs:Fn(e)}};const Vn=(e,t,i)=>{const s=jn(e);if(s[t]){const e=s[t][i];if(e){return e}}return null};const $n=(e,t,i,s)=>{const{getLicense:n,getContentId:r,getCertificate:a}=Vn(e,i,s).overrideOptions;if(!t.getLicense&&n){t.getLicense=n}if(!t.getContentId&&r){t.getContentId=r}if(!t.getCertificate&&a){t.getCertificate=a}return t};const qn=e=>{const t=function(t){const i=Object.keys(t);i.forEach(function(i){const s=t[i];if(s.vendor&&Vn(e,s.vendor.name,i)){t[i]=$n(e,t[i],s.vendor.name,i)}});return t};return t};const Hn="CsECCAMSEBcFuRfMEgSGiwYzOi93KowYgrSCkgUijgIwggEKAoIBAQCZ7Vs7Mn2rXiTvw7YqlbWYUgrVvMs3UD4GRbgU2Ha430BRBEGtjOOtsRu4jE5yWl5KngeVKR1YWEAjp+GvDjipEnk5MAhhC28VjIeMfiG/+/7qd+EBnh5XgeikX0YmPRTmDoBYqGB63OBPrIRXsTeo1nzN6zNwXZg6IftO7L1KEMpHSQykfqpdQ4IY3brxyt4zkvE9b/tkQv0x4b9AsMYE0cS6TJUgpL+X7r1gkpr87vVbuvVk4tDnbNfFXHOggrmWEguDWe3OJHBwgmgNb2fG2CxKxfMTRJCnTuw3r0svAQxZ6ChD4lgvC2ufXbD8Xm7fZPvTCLRxG88SUAGcn1oJAgMBAAE6FGxpY2Vuc2Uud2lkZXZpbmUuY29tEoADrjRzFLWoNSl/JxOI+3u4y1J30kmCPN3R2jC5MzlRHrPMveoEuUS5J8EhNG79verJ1BORfm7BdqEEOEYKUDvBlSubpOTOD8S/wgqYCKqvS/zRnB3PzfV0zKwo0bQQQWz53ogEMBy9szTK/NDUCXhCOmQuVGE98K/PlspKkknYVeQrOnA+8XZ/apvTbWv4K+drvwy6T95Z0qvMdv62Qke4XEMfvKUiZrYZ/DaXlUP8qcu9u/r6DhpV51Wjx7zmVflkb1gquc9wqgi5efhn9joLK3/bNixbxOzVVdhbyqnFk8ODyFfUnaq3fkC3hR3f0kmYgI41sljnXXjqwMoW9wRzBMINk+3k6P8cbxfmJD4/Paj8FwmHDsRfuoI6Jj8M76H3CTsZCZKDJjM3BQQ6Kb2m+bQ0LMjfVDyxoRgvfF//M/EEkPrKWyU2C3YBXpxaBquO4C8A0ujVmGEEqsxN1HX9lu6c5OMm8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0";const Wn=vn(Hn);const Gn=t.createElement("video");const Kn=e.navigator.requestMediaKeySystemAccess||Gn.msSetMediaKeys;const zn=e=>{return/manifest.prod.boltdns.net\/license/i.test(e)||/wvlic.brightcove.com\/proxy/i.test(e)};const Yn=e=>{e=Object.keys(e).reduce(function(t,i){t[i]={url:e[i].license_url};return t},{});const t=e["com.widevine.alpha"];if(t&&zn(t.url)){t.getCertificate=((e,t)=>{t(null,Wn)})}return e};const Xn=e=>{return e.reduce((e,t)=>{e[t.name]=t.options;const i=e[t.name].serverCertificate;if(i){e[t.name].getCertificate=((e,t)=>{t(null,vn(i))});delete e[t.name].serverCertificate}return e},{})};const Qn=t=>{const i=function(i){let s=i;if(!t.browser.IS_SAFARI){const n=!e.shaka&&i.key_systems&&Kn;if(n){s=t.obj.merge(i,{keySystems:Yn(i.key_systems)});if(i.keySystemOptions){s=t.obj.merge(s,{keySystems:Xn(i.keySystemOptions)})}}if(!Kn){let i="Cannot use keys for a DRM-protected source because the EME API is unavailable.";if(e.isSecureContext===false){i+=" The player is not running in a secure context, e.g. an HTTPS domain."}t.log.warn(i)}}return s};return i};const Jn=e=>{const t=Qn(e);const i=qn(e);e.use("*",function(e){return{setSource(e,s){e=t(e);if(e.keySystems){e.keySystems=i(e.keySystems)}return s(null,e)}}})};const Zn=t.documentElement;const er=t.body;const tr=()=>{return{top:0,left:0,right:Zn.clientWidth||er.clientWidth,width:Zn.clientWidth||er.clientWidth,bottom:Zn.clientHeight||er.clientHeight,height:Zn.clientHeight||er.clientHeight}};const ir=(e,t)=>{const i=Math.max(e.top,t.top);const s=Math.min(e.bottom,t.bottom);const n=Math.max(e.left,t.left);const r=Math.min(e.right,t.right);const a=r-n;const o=s-i;return a>=0&&o>=0&&{top:i,bottom:s,left:n,right:r,width:a,height:o}};const sr=e=>{const t=n["default"].dom.getBoundingClientRect(e);const i=tr();const s=ir(i,t);const r=t.width*t.height;const a=s.width*s.height;if(r){return a/r}return 0};class nr{constructor(t,i,s,n){this.el_=t;this.callback_=s;this.supportsIO_=n;this.observing_=false;if(n===undefined){this.supportsIO_="IntersectionObserver"in e&&"IntersectionObserverEntry"in e&&"intersectionRatio"in e.IntersectionObserverEntry.prototype}if(this.supportsIO_){this.io_=new e.IntersectionObserver(e=>{for(let i=0;i<e.length;i++){if(e[i].target===t){return s(e[i].intersectionRatio)}}},{threshold:i})}else{this.boundCheckForIntersection_=ae.throttle(e=>this.checkForIntersection_(e),500)}}observe(){if(this.observing_){return}this.observing_=true;if(this.supportsIO_){this.io_.observe(this.el_)}else{n["default"].on(e,"resize",this.boundCheckForIntersection_);n["default"].on(t,"scroll",this.boundCheckForIntersection_)}}unobserve(){if(!this.observing_){return}this.observing_=false;if(this.supportsIO_){this.io_.unobserve(this.el_)}else{n["default"].off(e,"resize",this.boundCheckForIntersection_);n["default"].off(t,"scroll",this.boundCheckForIntersection_)}}dispose(){this.unobserve();this.io_=null;this.el_=null;this.callback_=null}checkForIntersection_(){if(e.getComputedStyle(this.el_).display==="none"){return}const t=sr(this.el_);this.callback_(t)}}const rr={viewabilityThreshold:.6,minDurationForViewableImpression:2e3,thresholdPercentageIncrement:5,delayAutoplayIfNotViewable:false,delayAutoplayOnMobileOnly:false,pauseWhenNotViewable:false,useIntersectionObserver_:undefined};const ar="viewable-percent-change";const or="viewable-change";const lr=t=>{const i=t.getPlugin("plugin");class s extends i{constructor(e,i){super(e);this.options=t.obj.merge(rr,i);this.log=e.log.createLogger("viewability");this.log.level(this.options.debug?"debug":"off");this.log.debug("init",this.options);this.adImpressionTimeout_=null;this.player.ready(()=>{if(this.shouldDelayAutoplay_()){this.delayAutoplayIfNotViewable_()}else{this.pauseWhenNotViewable_()}this.player.addClass("vjs-viewability");if(this.player.usingPlugin("ads")){this.setupViewableAdImpression_()}this.observe_()});this.adImpressionViewabilityChangeHandler_=this.adImpressionViewabilityChangeHandler_.bind(this)}shouldDelayAutoplay_(){const{delayAutoplayIfNotViewable:e,delayAutoplayOnMobileOnly:i}=this.options;const{IS_ANDROID:s,IS_IOS:n}=t.browser;if(!e||!this.player.autoplay()){return false}return!i||s||n}buildThresholdArray_(){let e=0;const t=[];while(e<100){t.push((e+=this.options.thresholdPercentageIncrement)/100)}return t}observe_(){const e=this.player.el();if(!this.vo_){this.vo_=new nr(e,this.buildThresholdArray_(),e=>this.onViewableChange_(e),this.options.useIntersectionObserver_)}this.vo_.observe()}onViewableChange_(e){if(!this.state){return}const t=Math.ceil(e*100)/100;const i=t>=this.options.viewabilityThreshold;const s=this.state.viewable===undefined||this.state.viewable&&!i||!this.state.viewable&&i;if(s){const e=i?"viewable":"not-viewable";this.player.trigger({type:"usage",name:e});this.player.trigger({type:"usage",name:`${e}-${t}`})}this.setState({viewablePercent:t,viewable:i});this.log.debug("viewability changed",{viewable:i,viewablePercent:t});this.player.trigger({type:ar,viewable:i,viewablePercent:t});if(s){this.player.trigger({type:or,viewable:i,viewablePercent:t})}}delayAutoplayIfNotViewable_(){const e=this.options.delayAutoplayIfNotViewable;if(!e){return}this.log.debug("delaying autoplay until viewable");const t=this.player.autoplay();const i=e=>{if(e.viewable){this.player.addClass("vjs-waiting-for-autoplay");this.player.autoplay(t);this.player.off(ar,i)}};this.player.autoplay(false);this.player.removeClass("vjs-waiting-for-autoplay");this.player.on(ar,i);this.player.one("play",()=>{this.player.removeClass("vjs-ima3-not-playing-yet");this.player.off(ar,i);this.pauseWhenNotViewable_()})}pauseWhenNotViewable_(){if(!this.options.pauseWhenNotViewable){return}this.autoPaused_=false;const e=e=>{const t=this.player.paused();if(e.viewable&&t&&this.autoPaused_){this.player.play()}else if(!e.viewable&&!t){this.player.pause();this.autoPaused_=true;this.player.one("play",()=>{this.autoPaused_=false})}};this.player.on(or,e)}startAdImpressionTimeout_(){this.adImpressionTimeout_=this.player.setTimeout(()=>{this.player.trigger("viewable-ad-impression");this.log.debug("viewable-ad-impression");this.player.trigger({type:"usage",name:"viewable-ad-impression"});this.player.trigger({type:"usage",name:`viewable-ad-impression-${this.state.viewablePercent}`});this.adImpressionTimeout_=null;this.player.off(ar,this.adImpressionViewabilityChangeHandler_)},this.options.minDurationForViewableImpression)}stopAdImpressionTimeout_(){e.clearTimeout(this.adImpressionTimeout_);this.adImpressionTimeout_=null}adImpressionViewabilityChangeHandler_(e){if(e.viewable){if(!this.adImpressionTimeout_){this.startAdImpressionTimeout_()}}else if(this.adImpressionTimeout_){this.stopAdImpressionTimeout_()}}setupViewableAdImpression_(){this.player.on("ads-ad-started",()=>{if(this.state.viewable){this.startAdImpressionTimeout_()}this.player.on(ar,this.adImpressionViewabilityChangeHandler_);this.player.any(["adend","adtimeout","adserror"],()=>{this.player.off(ar,this.adImpressionViewabilityChangeHandler_)})})}}s.defaultState={viewable:undefined,viewablePercent:undefined};t.registerPlugin("viewability",s)};const ur={hidden:"hidden",off:"off",ready:"ready"};const cr=(e,t)=>{const i=e.name||e.id;if(!i){return t==="mp4"?"video":"videoTranscript"}return i.replace(/[^0-9a-z-A-Z]/g,"")};const dr=(e,i,s)=>{const n=s==="mp4"?"mp4":"txt";const r=t.createElement("a");r.href=e;r.target="_blank";r.download=`${i}.${n}`;t.body.appendChild(r);r.click();t.body.removeChild(r)};const hr=(e,t,i)=>{t.removeClass("has-icon-downloading");t.addClass("has-icon-file-download");e.removeClass("vjs-video-downloading");const s=`Download ${i==="mp4"?"Video":"Transcript"}`;t.setAttribute("aria-label",t.localize(s));t.controlText(s)};const fr=(e,t,i,s,n)=>{fetch(i).then(e=>e.blob()).then(i=>{const r=URL.createObjectURL(i);dr(r,s,n);hr(e,t,n);e.trigger({name:s,type:"download-finished"});URL.revokeObjectURL(r)}).catch(i=>{hr(e,t,n);e.trigger({err:i,type:"download-failed"})})};const pr=(e,t)=>{if(e.hasClass("vjs-video-downloading")){return}const i=t.options();const s=i.source;const n=i.type;const r=cr(e.mediainfo,n);e.addClass("vjs-video-downloading");t.removeClass("has-icon-file-download");t.addClass("has-icon-downloading");t.setAttribute("aria-label",t.localize("Downloading"));t.controlText("Downloading");e.trigger("download-started");fr(e,t,s,r,n)};const mr=n["default"].getComponent("Button");class gr extends mr{constructor(e,t={}){super(e,t);const i={[ur.hidden]:this.onHiddenState,[ur.off]:this.onOffState,[ur.ready]:this.onReadyState};const s=i[t.state];s.call(this,e,t.type)}onHiddenState(e){this.addClass("vjs-hidden");e.trigger("download-hidden")}onReadyState(e,t){const i=`Download ${t==="mp4"?"Video":"Transcript"}`;this.el_.setAttribute("aria-label",this.localize(i));this.controlText(i);this.addClass("has-icon-file-download");e.trigger("download-ready")}onOffState(e){this.el_.setAttribute("aria-label",this.localize("No downloadable item available"));this.controlText("No downloadable item available");this.addClass("has-icon-file-download-off");this.disable();e.trigger("download-disabled")}handleClick(){pr(this.player(),this)}buildWrapperCSSClass(){return`vjs-download-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`vjs-download-button ${super.buildCSSClass()}`}}n["default"].registerComponent("DownloadButton",gr);const yr=(e,t)=>{let i;const s=e.language()||"en";i=t.find(e=>e.src_lang===s);if(!i){i=t.find(e=>{return e.src_lang&&e.src_lang.slice(0,2)===s.slice(0,2)})}if(!i&&t.length){i=t[0]}return i};const _r=(e,t)=>{let i;let s;const n=e.mediainfo.sources||[];const r=e.mediainfo.transcripts||[];if(t==="mp4"){i=n.filter(e=>e.container==="MP4"&&e.hasOwnProperty("src"));const e=i.map(e=>e.size);const t=Math.max(...e);const r=i.find(e=>e.size===t);s=r&&r.src}if(t==="transcript"){const t=yr(e,r);s=t&&t.src}return s};const vr=(e,t)=>{const i=_r(e,t.type);const s=Array.isArray(e.mediainfo.tags)&&e.mediainfo.tags.find(e=>e==="downloadable");if(!s){return ur.hidden}if(!i){return ur.off}return ur.ready};const br=(e,t)=>{e.addClass("vjs-download-video");t.source=_r(e,t.type);t.state=vr(e,t);const i=e.getChild("controlBar");const s=i.addChild("DownloadButton",t,i.children_.length-2);return function(){e.removeClass("vjs-download-video");i.removeChild(s);s.dispose()}};const Tr=e=>{function t(e={}){if(typeof this.downloadButton==="undefined"){return}let t=()=>{};this.ready(()=>{t=br(this,e);this.on("loadstart",()=>{t();t=br(this,e)});this.downloadButton=(()=>{});this.downloadButton.source=e.source;this.downloadButton.state=e.state})}e.registerPlugin("downloadButton",t);t.VERSION=r};const Sr=new e.Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,128,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,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,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});const Er=URL.createObjectURL(Sr);const Ir=["perSourceBehaviors","contextmenu","contextmenuUI","bcAnalytics","errors","catalog","downloadButton","playerInfo","plugin","reloadSourceOnError","playlist","endscreen","proxyTracks","seekEvents","touchActive","urlparams","encryptedWatcher","viewability"];const kr=function(i,s,n){const r=n.settings;const o=n.environment;const l=o.queryString;const u={};const c=Boolean(s.options_.debug);const d={bcAnalytics:{applicationId:r.applicationId,mr:Boolean(e.bc_isManagedRelease),referrer:l.referrer,usage:l.usage,verbose:c},chromecastReceiver:{debug:c},ima3:{debugContribAds:c},ssai:{debug:c},vr:{debug:c}};s.on("pluginsetup",(e,t)=>{const{name:n}=t;if(Ir.indexOf(n)!==-1){return}s.trigger({type:"usage",name:`${n}!${i.getPluginVersion(n)}`})});const h=function(e,t={}){const n=d[e]||{};if(!s.hasPlugin(e)){i.log.error(`Plugin "${e}" is missing. Please check your player configuration.`);return}if(s.usingPlugin(e)){return}const r=i.obj.merge(n,t);try{s[e](r)}catch(t){i.log.error(`Unable to initialize "${e}" plugin:`,t)}};if(r.usingAdFailover&&r.usingIMAPrerollWithSSAI){i.log.warn("Ad failover is not compatible with SSAI and client-side preroll. "+"Please configure only one. This player will use ad failover behavior.");delete r.usingIMAPrerollWithSSAI}if(r.usingAdFailover){s.trigger({type:"usage",name:"ad-failover"});const{name:e,options:t}=s.usingAdBlocker.mightBe?r.serverSideAdPlugin:r.clientSideAdPlugin;h(e,t)}else if(r.usingIMAPrerollWithSSAI){if(e.bc.disposedAfterPreroll_){const t=r.serverSideAdPlugin.name;const s=r.serverSideAdPlugin.options;const n=r.clientSideAdPlugin.name;i.deregisterPlugin(n);i.registerPlugin(t,e.bc.ssaiPluginCache_);h(t,s)}else{s.trigger({type:"usage",name:"ssai-with-ima-preroll"});const n=r.clientSideAdPlugin.name;const a=r.clientSideAdPlugin.options;const o=r.serverSideAdPlugin.name;e.bc.ssaiPluginCache_=i.getPlugin("ssai");i.deregisterPlugin(o);h(n,a);const l=s.tagAttributes;s.one(["adend","adtimeout","adserror"],function(i){s.one("playing",function(){let n=s.volume();let r=s.muted();if(i.type==="adend"){if(s.ima3&&s.ima3.adPlayer){n=s.ima3.adPlayer.volume();r=s.ima3.adPlayer.muted()}else{n=s.ima3.player.volume();r=s.ima3.player.muted()}}const a=s.el();const o=a.parentNode;const u=t.createElement("div");o.replaceChild(u,a);s.dispose();e.bc.disposedAfterPreroll_=true;const c=t.createElement("video-js");Object.keys(l).forEach(e=>{c.setAttribute(e,l[e])});o.replaceChild(c,u);const d=e.bc(l.id);d.bigPlayButton.hide();d.ready(function(){d.one("playing",()=>{e.bc.disposedAfterPreroll_=false});const t=d.play();if(t.then){t.catch(()=>{d.bigPlayButton.show()})}d.volume(n);d.muted(r)})})})}}r.plugins.forEach(function({autoInit:e,name:t,options:i={}}){if(!e){return}const s=r.videoCloud&&r.videoCloud.bumper;if(t==="catalog"&&s&&s.id){let{showControls:e,progressBarColor:t,preventSeeking:n}=s;e=e&&Boolean(e)||true;t=t;n=Boolean(n);i.bumper=a(s,{showControls:e,progressBarColor:t,preventSeeking:n})}h(t,i)});const{media:f,videoCloud:p}=r;const m=f&&!!(f.sources||f.length&&f[0].sources);if(p&&p.policyKey&&!m){const t={embedHasPoster:r.embedState.poster,embedHasSources:r.embedState.sources,embedHasTracks:r.embedState.tracks,adConfigId:r.adConfigId,deliveryConfigId:r.deliveryConfigId,bumper:r.videoCloud&&r.videoCloud.bumper};if(p.playlist){s.trigger({type:"usage",name:"catalog-playlist"});t.playlistId=p.playlist}if(p.video){s.trigger({type:"usage",name:"catalog-video"});t.videoId=p.video}if(p.search){s.trigger({type:"usage",name:"catalog-search"});t.search=p.search}if(p.sequence){s.trigger({type:"usage",name:"catalog-sequence"});t.sequence=p.sequence}let i;if(r.usingIMAPrerollWithSSAI&&!e.bc.disposedAfterPreroll_){s.src({src:Er,type:"video/mp4"})}else if(p.autoLoad!==false){i=u.catalogMedia=s.catalog.autoFindAndLoadMedia(t)}if(i&&i.type==="video"){if(/^[\d]+$/.test(i.id)){s.mediainfo.id=i.id}else{s.mediainfo.referenceId=s.mediainfo.reference_id=i.id}}s.on("loadstart",()=>{if(s.language()&&s.catalog.getMetadata({lang:s.language()})){s.trigger({type:"usage",name:"variant:"+s.language()})}})}if(s.usingPlugin("bcAnalytics")){const e=function(){return(new Date).toISOString().split("T")[0]+":"+s.bcAnalytics.client.getSession()};s.ready(function(){ae.perf.mark("bcInitEnd");ae.perf.measure("bcInit","bcInitStart","bcInitEnd");if(s.usingPlugin("playerInfo")){s.playerInfo.modal.on("modalfill",function(){const i=e();const n=s.playerInfo.modal.$(".vjs-pi-section--player tbody");if(!i||!n){return}const r=t.createElement("tr");const a=t.createElement("tr");r.innerHTML="<td>"+s.localize("Session ID")+"</td> <td>"+i+"</td>";n.appendChild(r);a.innerHTML="<td>"+s.localize("Player Element ID")+"</td> <td>"+s.id()+"</td>";n.appendChild(a)})}});if(s.usingPlugin("errors")){s.errorDisplay.on("modalfill",function(){const t=e();const n=s.errorDisplay.$(".vjs-errors-content-container");if(!t||!n){return}n.appendChild(i.dom.createEl("div",{className:"vjs-errors-ref-id",innerHTML:"<b>"+s.localize("Session ID:")+"</b> "+t+" "+"<b>"+s.localize("Player Element ID:")+"</b> "+s.id()}))})}}if(s.usingPlugin("playerInfo")){s.on("contextmenu",function(){if(s.playerInfo.modal){s.playerInfo.modal.close()}})}const g=s.getChild("TitleBar");if(g&&r.hasTitleBar!==false){const e=f&&(f[0]&&f[0].title||f.title)||"";const t=f&&(f[0]&&f[0].description||f.description)||"";const i=function(){if(s.controls()){const{mediainfo:i}=s;const n=s.language()||"";let r;if(s.usingPlugin("catalog")){r=s.catalog.getMetadata({lang:n})}g.update({title:r&&r.name||i&&i.name||e,description:r&&r.description||i&&i.description||t})}};i();s.on(["loadstart","loadedmetadata","languagechange"],i)}return u};const Cr=/["'&<>]/;const wr=e=>{const t=""+e;const i=Cr.exec(t);if(!i){return t}let s;let n="";let r=0;let a=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}if(a!==r){n+=t.substring(a,r)}a=r+1;n+=s}return a!==r?n+t.substring(a,r):n};const Ar=e=>{if(typeof e!=="string"){return null}const t=e.toLowerCase();return t==="production"||t==="qa"||t==="staging"?t:null};class Or{constructor(e,t){this.runtime_=t;const i={};Object.keys(ae).forEach(e=>{const t=ae[e];Object.defineProperty(i,e,{enumerable:true,value:t,writable:false})});Object.defineProperty(this,"util",{enumerable:true,value:i,writable:false})}getRuntime(){return this.runtime_}}const Dr="vjs-waiting-for-autoplay";function Pr(i,s,n,r){const a=n.options_;const{settings:o,environment:l}=s;const{accountId:u,applicationId:c,css:d,embedId:h,playerId:f,videoCloud:p,analytics:m,chinaProxyDomain:g,version:y,viewability:_}=o;const v=Ar(o.env);const b=wr(o.playerName);n.brightcove=new Or(n,s);let T;n.mediainfo={accountId:u,account_id:u};n.bcinfo={accountId:u,applicationId:c,css:d,embedId:h,playerId:f,scriptUrl:l.scriptUrl,scriptBaseUrl:l.scriptBaseUrl};Object.defineProperty(n,"usingAdBlocker",{enumerable:true,value:pe});Object.defineProperty(n,"getAutoplayConditions",{enumerable:true,value:e=>r.getAutoplayConditions(e)});Object.defineProperty(n,"getAccountId",{enumerable:true,value(){return r.runtime.settings.accountId}});if(s.settings.allowAccountOverride){Object.defineProperty(n,"setAccountId",{enumerable:true,value(e){if(ae.isNil(e)){i.log.warn("account ID must be a string or number");return}r.runtime.settings.accountId=e;this.bcinfo.accountId=e;this.mediainfo.accountId=this.mediainfo.account_id=e}})}pe().then(function(e){if(e){n.trigger({type:"usage",name:"using-ad-blocker"})}});n.addClass(o.classNames.player);n.addClass(o.classNames.playerInstance);const S=n.dimension.bind(n);n.dimension=function(e,t){if(e==="width"){le(o,t,null)}else if(e==="height"){le(o,null,t)}return S(e,t)};n.ready(function(){if(!a.autoplay){return}function e(){n.removeClass(Dr)}if(!n.currentSrc()&&!T){e()}else{n.any(["autoplay-success","autoplay-failure","error"],e)}});if(o.fullscreenControl===false&&n.controls()){n.on("canplay",function(){if(!n.controlBar){return}const e=n.controlBar.children();if(!e||!e.length){return}for(let t=e.length-1;t>0;t--){if(e[t].hasClass("vjs-menu-button-popup")&&!e[t].hasClass("vjs-hidden")){e[t].addClass("vjs-menu-popup-last-visible");break}}})}if(i.browser.IS_IPHONE){n.on("fullscreenchange",function(){const e=n.$(".vjs-tech");if(e.hasAttribute("controls")){e.removeAttribute("controls")}});if(o.embedState.playsinline&&o.embedState.muted){n.addClass("vjs-iphone")}}if(a.autoplay&&i.browser.IS_IOS&&i.browser.IS_ANY_SAFARI){const e=n.$(".vjs-tech");if(!e.autoplay){e.autoplay=true}}if(i.browser.IS_IOS&&o.embedState.muted){n.addClass("vjs-ios")}if(n.controls()){n.one("play",function(){if(!n.controlBar||!n.controls()){return}const e=n.controlBar.children();if(!e||!e.length){return}const t=["Enter","ArrowDown","ArrowUp","Up","Down"," ","Spacebar"];for(let i=0;i<e.length;i++){if(e[i].hasClass("vjs-menu-button-popup")&&!e[i].hasClass("vjs-hidden")){e[i].on("keyup",function(e){if(t.indexOf(e.key)>=0){n.controlBar.addClass("vjs-control-bar-visible")}})}}});if(n.controlBar){const e=n.controlBar.el();let i;const s=function(){const s=t.activeElement;if(i!==s){i=s;n.controlBar.toggleClass("vjs-focus-within",e.contains(s))}};const r=function(){e.removeEventListener("focus",s,true);e.removeEventListener("blur",s,true)};e.addEventListener("focus",s,true);e.addEventListener("blur",s,true);n.on("dispose",r);n.controlBar.on("dispose",r)}}n.one("beforepluginsetup:ads",function(){const e=n.getChild("controlBar");if(e){e.removeChild("pictureInPictureToggle")}i.getComponent("Component").prototype.fsApi_=n.fsApi_});if(!i.browser.TOUCH_ENABLED){n.addClass("vjs-mouse");if(l.isInBcFrame){i.dom.addClass(t.documentElement,"vjs-mouse")}}else if(i.browser.IS_IPHONE){n.addClass("vjs-native")}n.requestAnimationFrame(function(){const e=t.querySelector(".bc-wrap");n.addClass("vjs-plugins-ready");if(e){e.style.opacity=0}});n.on(["mouseenter","ended","touchend"],function(){n.removeClass("vjs-hide-controls")});n.on("mouseleave",function(){n.addClass("vjs-hide-controls");if(!n.controlBar||!n.controlBar.el()){return}if(n.controlBar.hasClass("vjs-control-bar-visible")){n.controlBar.removeClass("vjs-control-bar-visible")}});if(!i.browser.IS_ANY_SAFARI){n.one("loadeddata",function(){if(n.language()!==undefined&&n.catalog&&n.catalog.getMetadata().variants!==undefined){const e=n.language()||"";const t=n.textTracks();if(t){const i=Array.prototype.filter.call(t,e=>(e.kind==="captions"||e.kind==="subtitles")&&e.mode==="showing");let s;let n;if(!i.length){for(n=0;n<t.length;n++){s=t[n];if((s.kind==="captions"||s.kind==="subtitles")&&s.language.toLowerCase()===e.toLowerCase()){s.mode="showing";return}}for(n=0;n<t.length;n++){s=t[n];if((s.kind==="captions"||s.kind==="subtitles")&&s.language.toLowerCase()===e.substring(0,2).toLowerCase()){s.mode="showing";return}}}}}})}let E;const I=e=>{if(e){n.addClass("vjs-audio-mode")}else{n.removeClass("vjs-audio-mode")}};const k=e=>{const t=n.getChild("PosterImage").el_.style;const i=()=>{const e=n.getChild("ControlBar");const i=e&&e.currentHeight();t.paddingBottom=`${i}px`;t.backgroundOrigin="content-box"};if(e){n.one("play",i)}else{n.off("play",i);t.paddingBottom="";t.backgroundOrigin=""}};n.on("loadedmetadata",()=>{const e=n.currentSource().type.includes("audio");const t=n.audioPosterMode();const i=n.audioOnlyMode();if(!o.audioPosterMode&&!o.audioOnlyMode&&e&&!E||!t&&!i&&e&&E){n.audioPosterMode(true)}else if(!e&&t&&E){n.audioPosterMode(false)}E=true});n.on("audiopostermodechange",()=>{const e=n.audioPosterMode();const t=n.audioOnlyMode();if(e){k(true);I(true)}else if(!t&&!e){k(false);I(false)}});n.on("audioonlymodechange",()=>{const e=n.audioPosterMode();const t=n.audioOnlyMode();if(t){const e=n.currentHeight();const t=n.getChild("ControlBar");const i=t&&t.getChild("ProgressControl");const s=i?i.currentHeight():0;I(true);n.height(e+s)}else if(!t&&!e){I(false)}});if(o.videoCloud&&o.videoCloud.bumper){const e=n.getChild("ControlBar");const t=e.getChild("ProgressControl");const i=o.videoCloud.bumper;n.on("bumper-play",()=>{if(i.preventSeeking){t.disable()}const s=e.getChild("NextButton");if(s){s.hide()}n.addClass("vjs-bumper-video")});n.on("bumper-ended",()=>{if(i.preventSeeking){t.enable()}const s=e.getChild("NextButton");if(s){s.show()}n.removeClass("vjs-bumper-video")})}const{bcShimDestripeTime:C}=l;if(C!==undefined){if(C>1){n.trigger({type:"usage",name:"sdt-"+(Math.log(C)/Math.LN10).toFixed(1)})}else{n.trigger({type:"usage",name:"sdt-0.0"})}}n.ready(function(){if(n.bcinfo&&n.bcinfo.PLAYER_LOADER||l.brightcovePlayerLoader){n.trigger({type:"usage",name:"player-loader"})}if(n.bcinfo&&n.bcinfo.REACT_PLAYER_LOADER||l.BrightcoveReactPlayerLoader){n.trigger({type:"usage",name:"react-player-loader"})}});if(n.options_.debug){n.log.level("debug");n.log.history.enable()}else{n.log.level("off");n.log.history.disable()}const w={accountId:u,playerId:f,embedId:h,playerName:b,platformVersion:y};if(g){w.analyticsUrl=`//${g}/v2/tracker`}if(v){w.env=v}if(m){if(m.analyticsUrl){w.analyticsUrl=m.analyticsUrl}if(m.env){w.env=m.env}if(m.hasOwnProperty("verbose")){w.verbose=Boolean(m.verbose)}if(m.requires_consent){w.requiresConsent=true}const e=s.environment&&s.environment.queryString||{};if(e.user){if(a.user&&e.user!==a.user){i.log.warn("user id in query param does not match user id in config; using query param user id")}w.user=e.user}else{w.user=a.user}if(m.hasOwnProperty("native_qoe")){w.nativeQoe=Boolean(m.native_qoe)}}const A={accountId:u,policyKey:p&&p.policyKey};if(g){A.baseUrl=`//${g}/playback/v1`}else if(p&&p.baseUrl){A.baseUrl=p.baseUrl}if(v){A.env=v}if(p&&p.sourceSelectionRules){A.sourceSelectionRules=p&&p.sourceSelectionRules}if(p&&typeof p.allowPlayreadyInChromiumEdge==="boolean"){A.allowPlayreadyInChromiumEdge=p.allowPlayreadyInChromiumEdge}const O=[{name:"bcAnalytics",register:Gt,opts:w},{name:"catalog",register:ns,opts:A},{name:"proxyTracks",register:cs,opts:{debug:n.options_.debug}},{name:"seekEvents",register:ms,opts:{verbose:n.options_.debug}},{name:"touchActive",register:gs},{name:"urlparams",register:xe,opts:{iframe:l.isInBcFrame,time:o.startTime}},{name:"playerInfo",register:ws},{name:"endscreen",register:As},{name:"encryptedWatcher",register:hs}];const D=s.settings.contextMenu;if(D!==false){const e=[{label:n.localize("Player Information"),listener:()=>n.usingPlugin("playerInfo")&&n.playerInfo.modal.open()}];if(ae.isObj(D)&&D.brightcoveBranding!==false){e.push({href:"https://www.brightcove.com/en/why-brightcove?utm_type=player",label:n.localize("About Brightcove")})}O.push({name:"contextmenuUI",opts:{content:e}})}if(_!==false){O.push({name:"viewability",register:lr,opts:_?_:{}})}const P=e.cast&&e.cast.receiver;const x=["mp4","transcript"].includes(o.downloadButton);if(x&&!P){O.push({name:"downloadButton",register:Tr,opts:{type:o.downloadButton}})}O.forEach(function({name:e,opts:t,register:s}){if(!n.hasPlugin(e)){s(i)}if(!n.usingPlugin(e)){n[e](t)}});Jn(i);n.eme();({catalogMedia:T}=kr(i,n,s));n.on("dispose",()=>{n=a.runtime_=null;i.log.history.clear()})}function xr(e,t,i){const{videojs:s}=e;let n=-1;return function r(a){const o=s.getPlayer(a);if(o){o.trigger({type:"usage",name:"bc-used-as-getter"});return o}n++;const l=e.getRuntime({playerIndex:n});s.hookOnce("beforesetup",(e,i)=>{i=_e(s,l,e,i);if(ae.isFn(t)){return t(s,l,e,i)}return i});s.hookOnce("setup",t=>{Pr(s,l,t,e);if(ae.isFn(i)){i(s,l,t)}});return s(...arguments)}}const Lr={accountId:"",adConfigId:"",applicationId:"",playsinline:false,loop:false,muted:false,autoplay:false,crossorigin:false,css:{},plugins:[],debug:false,contextMenu:{},deliveryConfigId:"",embedId:"default",misconfiguredWithMultipleAdPlugins:false,playerId:"default",skin:"luna",usingAdFailover:false,usingIMAPrerollWithSSAI:false,version:"0.0.0",videoCloud:null};const Rr={brightcovePlayerLoader:e.brightcovePlayerLoader,BrightcoveReactPlayerLoader:e.BrightcoveReactPlayerLoader,bcShimDestripeTime:e.bcShimDestripeTime,userAgent:e.navigator.userAgent};class Nr{constructor(e={},t={}){const{videojs:i}=Nr.shared;if(!i){throw new Error("missing videojs")}this.runtime={environment:i.obj.merge(Rr,t),settings:i.obj.merge(Lr,e)};if(this.runtime.settings.misconfiguredWithMultipleAdPlugins){i.log.warn('Brightcove Player "'+this.runtime.settings.playerId+'" is mis-configured with multiple ad plugins.')}this.videojs=i;this.util=ae;i.bc_=ae;this.detectRuntimeEnvironment();this.setupGlobalEnv();ae.perf.mark("bcAdBlockDetectStart");pe().then(function(e){ae.perf.mark("bcAdBlockDetectEnd");ae.perf.measure("bcAdBlockDetect","bcAdBlockDetectStart","bcAdBlockDetectEnd")})}getRuntime(e){return this.videojs.obj.merge(this.runtime,{settings:e})}getAutoplayConditions(e="video"){const{environment:t}=this.runtime;if(!t.autoplay){t.autoplay={}}return y(e,this.videojs).then(i=>{t.autoplay[e]=i;return i})}detectRuntimeEnvironment(){const{dom:i}=this.videojs;const{environment:s}=this.runtime;const n=i.hasClass(t.documentElement,"bc-iframe");const r=ae.qs();s.usingRequireJs=ae.isFn(e.define)&&e.define.amd&&ae.isFn(e.require&&e.require.toUrl);s.isInAnyFrame=i.isInFrame();s.isInBcFrame=n;s.queryString=n?r.search:{};s.urlHash=n?r.hash:{};this.setScriptUrl();this.setScriptBaseUrl()}setScriptUrl(){const{environment:i}=this.runtime;if(i.isInBcFrame){i.scriptUrl=""}else if(i.usingRequireJs){i.scriptUrl=e.require.toUrl("bc")}else if(t.currentScript){i.scriptUrl=t.currentScript.src}else{const e=t.getElementsByTagName("script");i.scriptUrl=e.length&&e[e.length-1].src||""}}setScriptBaseUrl(){const{environment:e}=this.runtime;if(e.scriptUrl){e.scriptBaseUrl=e.scriptUrl.split("/").slice(0,-1).join("/")}else{e.scriptBaseUrl="."}}safeSetGlobal(t,i){if(!ae.isNil(e[t])){return this.videojs.log.warn("setting window."+t+" would overwrite an existing global, skipping")}e[t]=i}setupGlobalEnv(){const{videojs:e}=this;const{environment:t}=this.runtime;const{queryStringToWindow:i}=t;if(!i||!t.isInBcFrame){return}const s=e.obj.merge(t.queryString);if(i.target){this.safeSetGlobal(i.target,s)}if(Array.isArray(i.globals)){i.globals.forEach(e=>{this.safeSetGlobal(e,s[e])})}}createInitializer(t,i){const{videojs:s}=this;const{bc:n}=e;const{embedId:r,playerId:a,skin:o,version:l}=this.runtime.settings;const u=xr(this,t,i);u.SKIN=o;u.VERSION=l;u.videojs=s;u[`${a}_${r}`]=u;if(n){Object.keys(n).forEach(e=>{const t=n[e];if(typeof t==="function"&&typeof t.videojs==="function"){u[e]=t;delete n[e]}})}Object.defineProperty(u,"usingAdBlocker",{enumerable:true,value:pe});Object.defineProperty(u,"getAutoplayConditions",{enumerable:true,value:e=>this.getAutoplayConditions(e)});e.bc=u;return u}static dedupeVideojs(t,i){let s=t;Nr.shared.firstVideojs=i||t;if(i&&i.VERSION===t.VERSION){s=i}else if(e.bc){const i=Object.keys(e.bc);for(let n=0;n<i.length;n++){const r=i[n];const a=e.bc[r];if(typeof a==="function"&&typeof a.videojs==="function"){if(a.videojs.VERSION===t.VERSION){s=a.videojs;break}}}}e.videojs=s;Nr.shared.videojs=s;return s}static restoreFirstVideojs(){e.videojs=Nr.shared.firstVideojs}}Nr.defaultSettings=Lr;Nr.shared={};Nr.VERSION=r;return Nr}(r);r=a.dedupeVideojs(r,n);var o=new a({accountId:"1964492303001",adConfigId:"",autoplay:"",hasTitleBar:false,css:{controlBarColor:"rgba(0, 0, 0, 0.45)",controlColor:"white",progressColor:"rgba(0, 0, 0, 0)"},embedId:"default",media:{poster:{}},playButton:{position:"center",shape:"circle"},plugins:[{name:"perSourceBehaviors",autoInit:true},{name:"errors",autoInit:true,options:{}},{name:"social",autoInit:true,options:{buttonParent:"controlBar",description:"",offset:"",services:{facebook:true,linkedin:true,pinterest:true,tumblr:true,twitter:true},title:"",url:""}}],contextMenu:false,playerId:"XvkzQ10d0",videoCloud:{policyKey:"BCpkADawqM38jhaIHP308ZvxUpT2lNEuy8uNC_SghAD7C08a2HQGpCUjp2cbrhYXgh69F0w62P9GrMGVt3IgR4ZSk0egG86gUbxtPpZg6w4vs7OczEaPrjS_Ky7TSMlz9uuNP_8O5BDAOebHNXGcICI-AK8qAjpJh5KZPA"},playerName:"FEI - Default Player v7 Auto (PROD)",skin:"sapphire",playersCDN:"//players.brightcove.net",responsive:true,liveui:true,controlBar:{volumePanel:{inline:false,vertical:true}},viewability:{},version:"7.7.0"},{});(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports,require("video.js"),require("@xmldom/xmldom")):typeof i==="function"&&i.amd?i(["exports","video.js","@xmldom/xmldom"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,t(e.httpStreaming={},e.videojs,e.window))})(this,function(i,s,n){"use strict";function r(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var a=r(s);var o={exports:{}};(function(e,t){(function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/;var s=/^([^\/?#]*)([^]*)$/;var n=/(?:\/|^)\.(?=\/)/g;var r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var a={buildAbsoluteURL:function(e,t,i){i=i||{};e=e.trim();t=t.trim();if(!t){if(!i.alwaysNormalize){return e}var n=a.parseURL(e);if(!n){throw new Error("Error trying to parse base URL.")}n.path=a.normalizePath(n.path);return a.buildURLFromParts(n)}var r=a.parseURL(t);if(!r){throw new Error("Error trying to parse relative URL.")}if(r.scheme){if(!i.alwaysNormalize){return t}r.path=a.normalizePath(r.path);return a.buildURLFromParts(r)}var o=a.parseURL(e);if(!o){throw new Error("Error trying to parse base URL.")}if(!o.netLoc&&o.path&&o.path[0]!=="/"){var l=s.exec(o.path);o.netLoc=l[1];o.path=l[2]}if(o.netLoc&&!o.path){o.path="/"}var u={scheme:o.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc){u.netLoc=o.netLoc;if(r.path[0]!=="/"){if(!r.path){u.path=o.path;if(!r.params){u.params=o.params;if(!r.query){u.query=o.query}}}else{var c=o.path;var d=c.substring(0,c.lastIndexOf("/")+1)+r.path;u.path=a.normalizePath(d)}}}if(u.path===null){u.path=i.alwaysNormalize?a.normalizePath(r.path):r.path}return a.buildURLFromParts(u)},parseURL:function(e){var t=i.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(n,"");while(e.length!==(e=e.replace(r,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a})()})(o);var l=o.exports;var u="http://example.com";var c=function t(i,s){if(/^[a-z]+:/i.test(s)){return s}if(/^data:/.test(i)){i=e.location&&e.location.href||""}var n=typeof e.URL==="function";var r=/^\/\//.test(i);var a=!e.location&&!/\/\//i.test(i);if(n){i=new e.URL(i,e.location||u)}else if(!/\/\//i.test(i)){i=l.buildAbsoluteURL(e.location&&e.location.href||"",i)}if(n){var o=new URL(s,i);if(a){return o.href.slice(u.length)}else if(r){return o.href.slice(o.protocol.length)}return o.href}return l.buildAbsoluteURL(i,s)};const d=c;const h=(e,t)=>{if(t&&t.responseURL&&e!==t.responseURL){return t.responseURL}return e};const f=e=>{if(a["default"].log.debug){return a["default"].log.debug.bind(a["default"],"VHS:",`${e} >`)}return function(){}};function p(){p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){e[s]=i[s]}}}return e};return p.apply(this,arguments)}var m=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var g=function t(i){return e.atob?e.atob(i):Buffer.from(i,"base64").toString("binary")};function y(e){var t=g(e);var i=new Uint8Array(t.length);for(var s=0;s<t.length;s++){i[s]=t.charCodeAt(s)}return i}class _ extends m{constructor(){super();this.buffer=""}push(e){let t;this.buffer+=e;t=this.buffer.indexOf("\n");for(;t>-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const v=String.fromCharCode(9);const b=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const T=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const S=function(e){const t={};if(!e){return t}const i=e.split(T());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).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");t[n[0]]=n[1]}return t};class E extends m{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(e){let t;let i;e=e.trim();if(e.length===0){return}if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}const s=this.tagMappers.reduce((t,i)=>{const s=i(e);if(s===e){return t}return t.concat([s])},[e]);s.forEach(e=>{for(let t=0;t<this.customParsers.length;t++){if(this.customParsers[t].call(this,e)){return}}if(e.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:e.slice(1)});return}e=e.replace("\r","");t=/^#EXTM3U/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"m3u"});return}t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"inf"};if(t[1]){i.duration=parseFloat(t[1])}if(t[2]){i.title=t[2]}this.trigger("data",i);return}t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"targetduration"};if(t[1]){i.duration=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"version"};if(t[1]){i.version=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"media-sequence"};if(t[1]){i.number=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e);if(t){i={type:"tag",tagType:"discontinuity-sequence"};if(t[1]){i.number=parseInt(t[1],10)}this.trigger("data",i);return}t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"playlist-type"};if(t[1]){i.playlistType=t[1]}this.trigger("data",i);return}t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e);if(t){i=p(b(t[1]),{type:"tag",tagType:"byterange"});this.trigger("data",i);return}t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e);if(t){i={type:"tag",tagType:"allow-cache"};if(t[1]){i.allowed=!/NO/.test(t[1])}this.trigger("data",i);return}t=/^#EXT-X-MAP:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"map"};if(t[1]){const e=S(t[1]);if(e.URI){i.uri=e.URI}if(e.BYTERANGE){i.byterange=b(e.BYTERANGE)}}this.trigger("data",i);return}t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"stream-inf"};if(t[1]){i.attributes=S(t[1]);if(i.attributes.RESOLUTION){const e=i.attributes.RESOLUTION.split("x");const t={};if(e[0]){t.width=parseInt(e[0],10)}if(e[1]){t.height=parseInt(e[1],10)}i.attributes.RESOLUTION=t}if(i.attributes.BANDWIDTH){i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)}if(i.attributes["FRAME-RATE"]){i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])}if(i.attributes["PROGRAM-ID"]){i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10)}}this.trigger("data",i);return}t=/^#EXT-X-MEDIA:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"media"};if(t[1]){i.attributes=S(t[1])}this.trigger("data",i);return}t=/^#EXT-X-ENDLIST/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"endlist"});return}t=/^#EXT-X-DISCONTINUITY/.exec(e);if(t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"program-date-time"};if(t[1]){i.dateTimeString=t[1];i.dateTimeObject=new Date(t[1])}this.trigger("data",i);return}t=/^#EXT-X-KEY:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"key"};if(t[1]){i.attributes=S(t[1]);if(i.attributes.IV){if(i.attributes.IV.substring(0,2).toLowerCase()==="0x"){i.attributes.IV=i.attributes.IV.substring(2)}i.attributes.IV=i.attributes.IV.match(/.{8}/g);i.attributes.IV[0]=parseInt(i.attributes.IV[0],16);i.attributes.IV[1]=parseInt(i.attributes.IV[1],16);i.attributes.IV[2]=parseInt(i.attributes.IV[2],16);i.attributes.IV[3]=parseInt(i.attributes.IV[3],16);i.attributes.IV=new Uint32Array(i.attributes.IV)}}this.trigger("data",i);return}t=/^#EXT-X-START:(.*)$/.exec(e);if(t){i={type:"tag",tagType:"start"};if(t[1]){i.attributes=S(t[1]);i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]);i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)}this.trigger("data",i);return}t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-out-cont"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-out"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e);if(t){i={type:"tag",tagType:"cue-in"};if(t[1]){i.data=t[1]}else{i.data=""}this.trigger("data",i);return}t=/^#EXT-X-SKIP:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"skip"};i.attributes=S(t[1]);if(i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)}if(i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(v)}this.trigger("data",i);return}t=/^#EXT-X-PART:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"part"};i.attributes=S(t[1]);["DURATION"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});["INDEPENDENT","GAP"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=/YES/.test(i.attributes[e])}});if(i.attributes.hasOwnProperty("BYTERANGE")){i.attributes.byterange=b(i.attributes.BYTERANGE)}this.trigger("data",i);return}t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"server-control"};i.attributes=S(t[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=/YES/.test(i.attributes[e])}});this.trigger("data",i);return}t=/^#EXT-X-PART-INF:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"part-inf"};i.attributes=S(t[1]);["PART-TARGET"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseFloat(i.attributes[e])}});this.trigger("data",i);return}t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"preload-hint"};i.attributes=S(t[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t=e==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{};i.attributes.byterange[t]=i.attributes[e];delete i.attributes[e]}});this.trigger("data",i);return}t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e);if(t&&t[1]){i={type:"tag",tagType:"rendition-report"};i.attributes=S(t[1]);["LAST-MSN","LAST-PART"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10)}});this.trigger("data",i);return}this.trigger("data",{type:"tag",data:e.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:s}){if(typeof i!=="function"){i=(e=>e)}this.customParsers.push(n=>{const r=e.exec(n);if(r){this.trigger("data",{type:"custom",data:i(n),customType:t,segment:s});return true}})}addTagMapper({expression:e,map:t}){const i=i=>{if(e.test(i)){return t(i)}return i};this.tagMappers.push(i)}}const I=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const k=function(e){const t={};Object.keys(e).forEach(function(i){t[I(i)]=e[i]});return t};const C=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]<o){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`});t[r]=o}if(s&&!t.hasOwnProperty(a)){t[a]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})}if(s&&t[a]<l){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`});t[a]=l}};class w extends m{constructor(){super();this.lineStream=new _;this.parseStream=new E;this.lineStream.pipe(this.parseStream);const e=this;const t=[];let i={};let s;let n;let r=false;const a=function(){};const o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const l="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let u=0;this.manifest={allowCache:true,discontinuityStarts:[],segments:[]};let c=0;let d=0;this.on("end",()=>{if(i.uri||!i.parts&&!i.preloadHints){return}if(!i.map&&s){i.map=s}if(!i.key&&n){i.key=n}if(!i.timeline&&typeof u==="number"){i.timeline=u}this.manifest.preloadSegment=i});this.parseStream.on("data",function(h){let f;let m;({tag(){(({version(){if(h.version){this.manifest.version=h.version}},"allow-cache"(){this.manifest.allowCache=h.allowed;if(!("allowed"in h)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in h){i.byterange=e;e.length=h.length;if(!("offset"in h)){h.offset=c}}if("offset"in h){i.byterange=e;e.offset=h.offset}c=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(h.duration>0){i.duration=h.duration}if(h.duration===0){i.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=t},key(){if(!h.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(h.attributes.METHOD==="NONE"){n=null;return}if(!h.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(h.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:h.attributes};return}if(h.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:h.attributes.URI};return}if(h.attributes.KEYFORMAT===l){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(h.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(h.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(h.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(h.attributes.KEYID&&h.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:h.attributes.KEYFORMAT,keyId:h.attributes.KEYID.substring(2)},pssh:y(h.attributes.URI.split(",")[1])};return}if(!h.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}n={method:h.attributes.METHOD||"AES-128",uri:h.attributes.URI};if(typeof h.attributes.IV!=="undefined"){n.iv=h.attributes.IV}},"media-sequence"(){if(!isFinite(h.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+h.number});return}this.manifest.mediaSequence=h.number},"discontinuity-sequence"(){if(!isFinite(h.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+h.number});return}this.manifest.discontinuitySequence=h.number;u=h.number},"playlist-type"(){if(!/VOD|EVENT/.test(h.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+h.playlist});return}this.manifest.playlistType=h.playlistType},map(){s={};if(h.uri){s.uri=h.uri}if(h.byterange){s.byterange=h.byterange}if(n){s.key=n}},"stream-inf"(){this.manifest.playlists=t;this.manifest.mediaGroups=this.manifest.mediaGroups||o;if(!h.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!i.attributes){i.attributes={}}p(i.attributes,h.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||o;if(!(h.attributes&&h.attributes.TYPE&&h.attributes["GROUP-ID"]&&h.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[h.attributes.TYPE];e[h.attributes["GROUP-ID"]]=e[h.attributes["GROUP-ID"]]||{};f=e[h.attributes["GROUP-ID"]];m={default:/yes/i.test(h.attributes.DEFAULT)};if(m.default){m.autoselect=true}else{m.autoselect=/yes/i.test(h.attributes.AUTOSELECT)}if(h.attributes.LANGUAGE){m.language=h.attributes.LANGUAGE}if(h.attributes.URI){m.uri=h.attributes.URI}if(h.attributes["INSTREAM-ID"]){m.instreamId=h.attributes["INSTREAM-ID"]}if(h.attributes.CHARACTERISTICS){m.characteristics=h.attributes.CHARACTERISTICS}if(h.attributes.FORCED){m.forced=/yes/i.test(h.attributes.FORCED)}f[h.attributes.NAME]=m},discontinuity(){u+=1;i.discontinuity=true;this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=h.dateTimeString;this.manifest.dateTimeObject=h.dateTimeObject}i.dateTimeString=h.dateTimeString;i.dateTimeObject=h.dateTimeObject},targetduration(){if(!isFinite(h.duration)||h.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+h.duration});return}this.manifest.targetDuration=h.duration;C.call(this,this.manifest)},start(){if(!h.attributes||isNaN(h.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:h.attributes["TIME-OFFSET"],precise:h.attributes.PRECISE}},"cue-out"(){i.cueOut=h.data},"cue-out-cont"(){i.cueOutCont=h.data},"cue-in"(){i.cueIn=h.data},skip(){this.manifest.skip=k(h.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",h.attributes,["SKIPPED-SEGMENTS"])},part(){r=true;const e=this.manifest.segments.length;const t=k(h.attributes);i.parts=i.parts||[];i.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=d}d=t.byterange.offset+t.byterange.length}const s=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${s} for segment #${e}`,h.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=k(h.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}C.call(this,this.manifest);if(e.canSkipDateranges&&!e.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 e=this.manifest.segments.length;const t=k(h.attributes);const s=t.type&&t.type==="PART";i.preloadHints=i.preloadHints||[];i.preloadHints.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=s?d:0;if(s){d=t.byterange.offset+t.byterange.length}}}const n=i.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${e}`,h.attributes,["TYPE","URI"]);if(!t.type){return}for(let s=0;s<i.preloadHints.length-1;s++){const r=i.preloadHints[s];if(!r.type){continue}if(r.type===t.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${t.type} as preload hint #${s}`})}}},"rendition-report"(){const e=k(h.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1;const i=["LAST-MSN","URI"];if(r){i.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,h.attributes,i)},"part-inf"(){this.manifest.partInf=k(h.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",h.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}C.call(this,this.manifest)}})[h.tagType]||a).call(e)},uri(){i.uri=h.uri;t.push(i);if(this.manifest.targetDuration&&!("duration"in i)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});i.duration=this.manifest.targetDuration}if(n){i.key=n}i.timeline=u;if(s){i.map=s}d=0;i={}},comment(){},custom(){if(h.segment){i.custom=i.custom||{};i.custom[h.customType]=h.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[h.customType]=h.data}}})[h.type].call(e)})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){s.push(e)}});if(s.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var A={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^/};var O=["video","audio","text"];var D=["Video","Audio","Text"];var P=function e(t){if(!t){return t}return t.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var s=("00"+Number(t).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n})};var x=function e(t){if(t===void 0){t=""}var i=t.split(",");var s=[];i.forEach(function(e){e=e.trim();var t;O.forEach(function(i){var n=A[i].exec(e.toLowerCase());if(!n||n.length<=1){return}t=i;var r=e.substring(0,n[1].length);var a=e.replace(r,"");s.push({type:r,details:a,mediaType:i})});if(!t){s.push({type:e,details:"",mediaType:"unknown"})}});return s};var L=function e(t,i){if(!t.mediaGroups.AUDIO||!i){return null}var s=t.mediaGroups.AUDIO[i];if(!s){return null}for(var n in s){var r=s[n];if(r.default&&r.playlists){return x(r.playlists[0].attributes.CODECS)}}return null};var R=function e(t){if(t===void 0){t=""}return A.audio.test(t.trim().toLowerCase())};var N=function e(t){if(t===void 0){t=""}return A.text.test(t.trim().toLowerCase())};var M=function e(t){if(!t||typeof t!=="string"){return}var i=t.toLowerCase().split(",").map(function(e){return P(e.trim())});var s="video";if(i.length===1&&R(i[0])){s="audio"}else if(i.length===1&&N(i[0])){s="application"}var n="mp4";if(i.every(function(e){return A.mp4.test(e)})){n="mp4"}else if(i.every(function(e){return A.webm.test(e)})){n="webm"}else if(i.every(function(e){return A.ogg.test(e)})){n="ogg"}return s+"/"+n+';codecs="'+t+'"'};var U=function t(i){if(i===void 0){i=""}return e.MediaSource&&e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported(M(i))||false};var B=function e(t){if(t===void 0){t=""}return t.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<D.length;t++){var i=D[t];if(A["muxer"+i].test(e)){return true}}return false})};var F="mp4a.40.2";var j="avc1.4d400d";function V(...e){const t=a["default"].obj||a["default"];const i=t.merge||t.mergeOptions;return i.apply(t,e)}function $(...e){const t=a["default"].time||a["default"];const i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}const q=1/30;const H=q*3;const W=function(e,t){const i=[];let s;if(e&&e.length){for(s=0;s<e.length;s++){if(t(e.start(s),e.end(s))){i.push([e.start(s),e.end(s)])}}}return $(i)};const G=function(e,t){return W(e,function(e,i){return e-H<=t&&i+H>=t})};const K=function(e,t){return W(e,function(e){return e-q>=t})};const z=function(e){if(e.length<2){return $()}const t=[];for(let i=1;i<e.length;i++){const s=e.end(i-1);const n=e.start(i);t.push([s,n])}return $(t)};const Y=function(e,t){let i=null;let s=null;let n=0;const r=[];const a=[];if(!e||!e.length||!t||!t.length){return $()}let o=e.length;while(o--){r.push({time:e.start(o),type:"start"});r.push({time:e.end(o),type:"end"})}o=t.length;while(o--){r.push({time:t.start(o),type:"start"});r.push({time:t.end(o),type:"end"})}r.sort(function(e,t){return e.time-t.time});for(o=0;o<r.length;o++){if(r[o].type==="start"){n++;if(n===2){i=r[o].time}}else if(r[o].type==="end"){n--;if(n===1){s=r[o].time}}if(i!==null&&s!==null){a.push([i,s]);i=null;s=null}}return $(a)};const X=e=>{const t=[];if(!e||!e.length){return""}for(let i=0;i<e.length;i++){t.push(e.start(i)+" => "+e.end(i))}return t.join(", ")};const Q=function(e,t,i=1){const s=e.length?e.end(e.length-1):0;return(s-t)/i};const J=e=>{const t=[];for(let i=0;i<e.length;i++){t.push({start:e.start(i),end:e.end(i)})}return t};const Z=function(e,t){if(e===t){return false}if(!e&&t||!t&&e){return true}if(e.length!==t.length){return true}for(let i=0;i<e.length;i++){if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i)){return true}}return false};const ee=function(e){if(!e||!e.length||!e.end){return}return e.end(e.length-1)};const te=function(e,t){let i=0;if(!e||!e.length){return i}for(let s=0;s<e.length;s++){const n=e.start(s);const r=e.end(s);if(t>r){continue}if(t>n&&t<=r){i+=r-t;continue}i+=r-n}return i};const ie=(e,t)=>{if(!t.preload){return t.duration}let i=0;(t.parts||[]).forEach(function(e){i+=e.duration});(t.preloadHints||[]).forEach(function(t){if(t.type==="PART"){i+=e.partTargetDuration}});return i};const se=e=>(e.segments||[]).reduce((e,t,i)=>{if(t.parts){t.parts.forEach(function(s,n){e.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:t})})}else{e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null})}return e},[]);const ne=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]};const re=({preloadSegment:e})=>{if(!e){return}const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce((e,t)=>e+(t.type==="PART"?1:0),0);s+=t&&t.length?t.length:0;return s};const ae=(e,t)=>{if(t.endList){return 0}if(e&&e.suggestedPresentationDelay){return e.suggestedPresentationDelay}const i=ne(t).length>0;if(i&&t.serverControl&&t.serverControl.partHoldBack){return t.serverControl.partHoldBack}else if(i&&t.partTargetDuration){return t.partTargetDuration*3}else if(t.serverControl&&t.serverControl.holdBack){return t.serverControl.holdBack}else if(t.targetDuration){return t.targetDuration*3}return 0};const oe=function(e,t){let i=0;let s=t-e.mediaSequence;let n=e.segments[s];if(n){if(typeof n.start!=="undefined"){return{result:n.start,precise:true}}if(typeof n.end!=="undefined"){return{result:n.end-n.duration,precise:true}}}while(s--){n=e.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=ie(e,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const le=function(e,t){let i=0;let s;let n=t-e.mediaSequence;for(;n<e.segments.length;n++){s=e.segments[n];if(typeof s.start!=="undefined"){return{result:s.start-i,precise:true}}i+=ie(e,s);if(typeof s.end!=="undefined"){return{result:s.end-i,precise:true}}}return{result:-1,precise:false}};const ue=function(e,t,i){if(typeof t==="undefined"){t=e.mediaSequence+e.segments.length}if(t<e.mediaSequence){return 0}const s=oe(e,t);if(s.precise){return s.result}const n=le(e,t);if(n.precise){return n.result}return s.result+i};const ce=function(t,i,s){if(!t){return 0}if(typeof s!=="number"){s=0}if(typeof i==="undefined"){if(t.totalDuration){return t.totalDuration}if(!t.endList){return e.Infinity}}return ue(t,i,s)};const de=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:s}){let n=0;if(i>s){[i,s]=[s,i]}if(i<0){for(let t=i;t<Math.min(0,s);t++){n+=e}i=0}for(let e=i;e<s;e++){n+=t[e].duration}return n};const he=function(e,t,i,s){if(!e||!e.segments){return null}if(e.endList){return ce(e)}if(t===null){return null}t=t||0;let n=ue(e,e.mediaSequence+e.segments.length,t);if(i){s=typeof s==="number"?s:ae(null,e);n-=s}return Math.max(0,n)};const fe=function(e,t,i){const s=true;const n=t||0;const r=he(e,t,s,i);if(r===null){return $()}return $(n,r)};const pe=function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let a=t-n;const o=se(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i!==t.segmentIndex){continue}if(typeof s==="number"&&typeof t.partIndex==="number"&&s!==t.partIndex){continue}l=e;break}if(a<0){if(l>0){for(let t=l-1;t>=0;t--){const i=o[t];a+=i.duration;if(r){if(a<0){continue}}else if(a+q<=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-de({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++){a-=e.targetDuration;if(a<0){return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}}l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;if(r){if(a>0){continue}}else if(a-q>=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+de({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}};const me=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};const ge=function(e){return e.excludeUntil&&e.excludeUntil===Infinity};const ye=function(e){const t=me(e);return!e.disabled&&!t};const _e=function(e){return e.disabled};const ve=function(e){for(let t=0;t<e.segments.length;t++){if(e.segments[t].key){return true}}return false};const be=function(e,t){return t.attributes&&t.attributes[e]};const Te=function(e,t,i,s=0){if(!be("BANDWIDTH",i)){return NaN}const n=e*i.attributes.BANDWIDTH;return(n-s*8)/t};const Se=(e,t)=>{if(e.playlists.length===1){return true}const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>{if(!ye(e)){return false}return(e.attributes.BANDWIDTH||0)<i}).length===0};const Ee=(e,t)=>{if(!e&&!t||!e&&t||e&&!t){return false}if(e===t){return true}if(e.id&&t.id&&e.id===t.id){return true}if(e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri){return true}if(e.uri&&t.uri&&e.uri===t.uri){return true}return false};const Ie=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=false;for(const e in i){for(const n in i[e]){s=t(i[e][n]);if(s){break}}if(s){break}}return!!s};const ke=e=>{if(!e||!e.playlists||!e.playlists.length){const t=Ie(e,e=>e.playlists&&e.playlists.length||e.uri);return t}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];const s=i.attributes&&i.attributes.CODECS;if(s&&s.split(",").every(e=>R(e))){continue}const n=Ie(e,e=>Ee(i,e));if(n){continue}return false}return true};var Ce={liveEdgeDelay:ae,duration:ce,seekable:fe,getMediaInfoForTime:pe,isEnabled:ye,isDisabled:_e,isExcluded:me,isIncompatible:ge,playlistEnd:he,isAes:ve,hasAttribute:be,estimateSegmentRequestTime:Te,isLowestEnabledRendition:Se,isAudioOnly:ke,playlistMatch:Ee,segmentDurationWithParts:ie};const{log:we}=a["default"];const Ae=(e,t)=>{return`${e}-${t}`};const Oe=(e,t,i)=>{return`placeholder-uri-${e}-${t}-${i}`};const De=({onwarn:e,oninfo:t,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new w;if(e){a.on("warn",e)}if(t){a.on("info",t)}s.forEach(e=>a.addParser(e));n.forEach(e=>a.addTagMapper(e));a.push(i);a.end();const o=a.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){if(o.hasOwnProperty(e)){delete o[e]}});if(o.segments){o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){if(e.hasOwnProperty(t)){delete e[t]}})})}}if(!o.targetDuration){let t=10;if(o.segments&&o.segments.length){t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)}if(e){e(`manifest has no targetDuration defaulting to ${t}`)}o.targetDuration=t}const l=ne(o);if(l.length&&!o.partTargetDuration){const t=l.reduce((e,t)=>Math.max(e,t.duration),0);if(e){e(`manifest has no partTargetDuration defaulting to ${t}`);we.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=t}return o};const Pe=(e,t)=>{if(!e.mediaGroups){return}["AUDIO","SUBTITLES"].forEach(i=>{if(!e.mediaGroups[i]){return}for(const s in e.mediaGroups[i]){for(const n in e.mediaGroups[i][s]){const r=e.mediaGroups[i][s][n];t(r,i,s,n)}}})};const xe=({playlist:e,uri:t,id:i})=>{e.id=i;e.playlistErrors_=0;if(t){e.uri=t}e.attributes=e.attributes||{}};const Le=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];xe({playlist:i,id:Ae(t,i.uri)});i.resolvedUri=d(e.uri,i.uri);e.playlists[i.id]=i;e.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){we.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const Re=e=>{Pe(e,t=>{if(t.uri){t.resolvedUri=d(e.uri,t.uri)}})};const Ne=(t,i)=>{const s=Ae(0,i);const n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:e.location.href,resolvedUri:e.location.href,playlists:[{uri:i,id:s,resolvedUri:i,attributes:{}}]};n.playlists[s]=n.playlists[0];n.playlists[i]=n.playlists[0];return n};const Me=(e,t,i=Oe)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++){if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}}const s=ke(e);Pe(e,(t,n,r,a)=>{if(!t.playlists||!t.playlists.length){if(s&&n==="AUDIO"&&!t.uri){for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r){return}}}t.playlists=[p({},t)]}t.playlists.forEach(function(t,s){const o=i(n,r,a,t);const l=Ae(s,o);if(t.uri){t.resolvedUri=t.resolvedUri||d(e.uri,t.uri)}else{t.uri=s===0?o:l;t.resolvedUri=t.uri}t.id=t.id||l;t.attributes=t.attributes||{};e.playlists[t.id]=t;e.playlists[t.uri]=t})});Le(e);Re(e)};const{EventTarget:Ue}=a["default"];const Be=(t,i)=>{if(i.endList||!i.serverControl){return t}const s={};if(i.serverControl.canBlockReload){const{preloadSegment:e}=i;let t=i.mediaSequence+i.segments.length;if(e){const n=e.parts||[];const r=re(i)-1;if(r>-1&&r!==n.length-1){s._HLS_part=r}if(r>-1||n.length){t--}}s._HLS_msn=t}if(i.serverControl&&i.serverControl.canSkipUntil){s._HLS_skip=i.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(s).length){const i=new e.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){if(!s.hasOwnProperty(e)){return}i.searchParams.set(e,s[e])});t=i.toString()}return t};const Fe=(e,t)=>{if(!e){return t}const i=V(e,t);if(e.preloadHints&&!t.preloadHints){delete i.preloadHints}if(e.parts&&!t.parts){delete i.parts}else if(e.parts&&t.parts){for(let s=0;s<t.parts.length;s++){if(e.parts&&e.parts[s]){i.parts[s]=V(e.parts[s],t.parts[s])}}}if(!e.skipped&&t.skipped){i.skipped=false}if(e.preload&&!t.preload){i.preload=false}return i};const je=(e,t,i)=>{const s=e.slice();const n=t.slice();i=i||0;const r=[];let a;for(let e=0;e<n.length;e++){const t=s[e+i];const o=n[e];if(t){a=t.map||a;r.push(Fe(t,o))}else{if(a&&!o.map){o.map=a}r.push(o)}}return r};const Ve=(e,t)=>{if(!e.resolvedUri&&e.uri){e.resolvedUri=d(t,e.uri)}if(e.key&&!e.key.resolvedUri){e.key.resolvedUri=d(t,e.key.uri)}if(e.map&&!e.map.resolvedUri){e.map.resolvedUri=d(t,e.map.uri)}if(e.map&&e.map.key&&!e.map.key.resolvedUri){e.map.key.resolvedUri=d(t,e.map.key.uri)}if(e.parts&&e.parts.length){e.parts.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=d(t,e.uri)})}if(e.preloadHints&&e.preloadHints.length){e.preloadHints.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=d(t,e.uri)})}};const $e=function(e){const t=e.segments||[];const i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;e<i.preloadHints.length;e++){if(i.preloadHints[e].type==="MAP"){return t}}}i.duration=e.targetDuration;i.preload=true;t.push(i)}return t};const qe=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment;const He=(e,t,i=qe)=>{const s=V(e,{});const n=s.playlists[t.id];if(!n){return null}if(i(n,t)){return null}t.segments=$e(t);const r=V(n,t);if(r.preloadSegment&&!t.preloadSegment){delete r.preloadSegment}if(n.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++){t.segments.unshift({skipped:true})}}r.segments=je(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}r.segments.forEach(e=>{Ve(e,r.resolvedUri)});for(let e=0;e<s.playlists.length;e++){if(s.playlists[e].id===t.id){s.playlists[e]=r}}s.playlists[t.id]=r;s.playlists[t.uri]=r;Pe(e,(e,i,s,n)=>{if(!e.playlists){return}for(let i=0;i<e.playlists.length;i++){if(t.id===e.playlists[i].id){e.playlists[i]=r}}});return s};const We=(e,t)=>{const i=e.segments||[];const s=i[i.length-1];const n=s&&s.parts&&s.parts[s.parts.length-1];const r=n&&n.duration||s&&s.duration;if(t&&r){return r*1e3}return(e.partTargetDuration||e.targetDuration||10)*500};class Ge extends Ue{constructor(e,t,i={}){super();if(!e){throw new Error("A non-empty playlist URL or object is required")}this.logger_=f("PlaylistLoader");const{withCredentials:s=false}=i;this.src=e;this.vhs_=t;this.withCredentials=s;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const e=this.media();let t=d(this.main.uri,e.uri);if(this.llhls){t=Be(t,e)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}if(e){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2};this.trigger("error")}parseManifest_({url:e,manifestString:t}){return De({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:i,manifestString:e});n.lastRequest=Date.now();xe({playlist:n,uri:i,id:s});const r=He(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration;this.pendingMedia_=null;if(r){this.main=r;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(We(this.media(),!!r));this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);e.clearTimeout(this.finalRenditionTimeout);this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(t,i){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof t==="string"){if(!this.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.main.playlists[t]}e.clearTimeout(this.finalRenditionTimeout);if(i){const i=(t.partTargetDuration||t.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=e.setTimeout(this.media.bind(this,t,false),i);return}const s=this.state;const n=!this.media_||t.id!==this.media_.id;const r=this.main.playlists[t.id];if(r&&r.endList||t.endList&&t.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(n){this.trigger("mediachanging");if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(We(t,true));if(!n){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=t;this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},(e,i)=>{if(!this.request){return}t.lastRequest=Date.now();t.resolvedUri=h(t.resolvedUri,i);if(e){return this.playlistRequestError(this.request,t,s)}this.haveMetadata({playlistString:i.responseText,url:t.uri,id:t.id});if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}})}pause(){if(this.mediaUpdateTimeout){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(t){if(this.mediaUpdateTimeout){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const i=this.media();if(t){const t=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=e.setTimeout(()=>{this.mediaUpdateTimeout=null;this.load()},t);return}if(!this.started){this.start();return}if(i&&!i.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(t){if(this.mediaUpdateTimeout){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=e.setTimeout(()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(t)},t)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=e.location.href}this.src.resolvedUri=this.src.uri;setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}this.request=null;if(e){this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.src=h(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(t){this.state="HAVE_MAIN_MANIFEST";if(t.playlists){this.main=t;Me(this.main,this.srcUri());t.playlists.forEach(e=>{e.segments=$e(e);e.segments.forEach(t=>{Ve(t,e.resolvedUri)})});this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const i=this.srcUri()||e.location.href;this.main=Ne(t,i);this.haveMetadata({playlistObject:t,url:i,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}}const{xhr:Ke}=a["default"];const ze=function(e,t,i,s){const n=e.responseType==="arraybuffer"?e.response:e.responseText;if(!t&&n){e.responseTime=Date.now();e.roundTripTime=e.responseTime-e.requestTime;e.bytesReceived=n.byteLength||n.length;if(!e.bandwidth){e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)}}if(i.headers){e.responseHeaders=i.headers}if(t&&t.code==="ETIMEDOUT"){e.timedout=true}if(!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))}s(t,e)};const Ye=function(){const e=function e(t,i){t=V({timeout:45e3},t);const s=e.beforeRequest||a["default"].Vhs.xhr.beforeRequest;if(s&&typeof s==="function"){const e=s(t);if(e){t=e}}const n=a["default"].Vhs.xhr.original===true?Ke:a["default"].Vhs.xhr;const r=n(t,function(e,t){return ze(r,e,t,i)});const o=r.abort;r.abort=function(){r.aborted=true;return o.apply(r,arguments)};r.uri=t.uri;r.requestTime=Date.now();return r};e.original=true;return e};const Xe=function(t){let i;const s=t.offset;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){i=e.BigInt(t.offset)+e.BigInt(t.length)-e.BigInt(1)}else{i=t.offset+t.length-1}return"bytes="+s+"-"+i};const Qe=function(e){const t={};if(e.byterange){t.Range=Xe(e.byterange)}return t};var Je=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;var Ze=/^application\/dash\+xml/i;var et=function e(t){if(Je.test(t)){return"hls"}if(Ze.test(t)){return"dash"}if(t==="application/vnd.videojs.vhs+json"){return"vhs-json"}return null};var tt=function e(t){return t.toString(2).length};var it=function e(t){return Math.ceil(tt(t)/8)};var st=function e(t){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}return t&&t.buffer instanceof ArrayBuffer};var nt=function e(t){return st(t)};var rt=function e(t){if(t instanceof Uint8Array){return t}if(!Array.isArray(t)&&!nt(t)&&!(t instanceof ArrayBuffer)){if(typeof t!=="number"||typeof t==="number"&&t!==t){t=0}else{t=[t]}}return new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0)};var at=e.BigInt||Number;var ot=[at("0x1"),at("0x100"),at("0x10000"),at("0x1000000"),at("0x100000000"),at("0x10000000000"),at("0x1000000000000"),at("0x100000000000000"),at("0x10000000000000000")];(function(){var e=new Uint16Array([65484]);var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t[0]===255){return"big"}if(t[0]===204){return"little"}return"unknown"})();var lt=function e(t,i){var s=i===void 0?{}:i,n=s.signed,r=n===void 0?false:n,a=s.le,o=a===void 0?false:a;t=rt(t);var l=o?"reduce":"reduceRight";var u=t[l]?t[l]:Array.prototype[l];var c=u.call(t,function(e,i,s){var n=o?s:Math.abs(s+1-t.length);return e+at(i)*ot[n]},at(0));if(r){var d=ot[t.length]/at(2)-at(1);c=at(c);if(c>d){c-=d;c-=d;c-=at(2)}}return Number(c)};var ut=function e(t,i){var s=i===void 0?{}:i,n=s.le,r=n===void 0?false:n;if(typeof t!=="bigint"&&typeof t!=="number"||typeof t==="number"&&t!==t){t=0}t=at(t);var a=it(t);var o=new Uint8Array(new ArrayBuffer(a));for(var l=0;l<a;l++){var u=r?l:Math.abs(l+1-o.length);o[u]=Number(t/ot[l]&at(255));if(t<0){o[u]=Math.abs(~o[u]);o[u]-=l===0?1:2}}return o};var ct=function e(t,i){if(typeof t!=="string"&&t&&typeof t.toString==="function"){t=t.toString()}if(typeof t!=="string"){return new Uint8Array}if(!i){t=unescape(encodeURIComponent(t))}var s=new Uint8Array(t.length);for(var n=0;n<t.length;n++){s[n]=t.charCodeAt(n)}return s};var dt=function e(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++){i[s]=arguments[s]}i=i.filter(function(e){return e&&(e.byteLength||e.length)&&typeof e!=="string"});if(i.length<=1){return rt(i[0])}var n=i.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0);var r=new Uint8Array(n);var a=0;i.forEach(function(e){e=rt(e);r.set(e,a);a+=e.byteLength});return r};var ht=function e(t,i,s){var n=s===void 0?{}:s,r=n.offset,a=r===void 0?0:r,o=n.mask,l=o===void 0?[]:o;t=rt(t);i=rt(i);var u=i.every?i.every:Array.prototype.every;return i.length&&t.length-a>=i.length&&u.call(i,function(e,i){var s=l[i]?l[i]&t[a+i]:t[a+i];return e===s})};const ft=function(e,t){return e.start(t)+"-"+e.end(t)};const pt=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")};const mt=function(e){if(e>=32&&e<126){return String.fromCharCode(e)}return"."};const gt=function(e){const t={};Object.keys(e).forEach(i=>{const s=e[i];if(st(s)){t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{t[i]=s}});return t};const yt=function(e){const t=e.byterange||{length:Infinity,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")};const _t=function(e){return e.resolvedUri};const vt=e=>{const t=Array.prototype.slice.call(e);const i=16;let s="";let n;let r;for(let e=0;e<t.length/i;e++){n=t.slice(e*i,e*i+i).map(pt).join("");r=t.slice(e*i,e*i+i).map(mt).join("");s+=n+" "+r+"\n"}return s};const bt=({bytes:e})=>vt(e);const Tt=e=>{let t="";let i;for(i=0;i<e.length;i++){t+=ft(e,i)+" "}return t};var St=Object.freeze({__proto__:null,createTransferableMessage:gt,initSegmentId:yt,segmentKeyId:_t,hexDump:vt,tagDump:bt,textRanges:Tt});const Et=.25;const It=(e,t)=>{if(!t.dateTimeObject){return null}const i=t.videoTimingInfo.transmuxerPrependedSeconds;const s=t.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=e-n;return new Date(t.dateTimeObject.getTime()+r*1e3)};const kt=e=>{return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds};const Ct=(e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||t.segments.length===0){return null}let s=t.segments[0];if(i<s.dateTimeObject){return null}for(let e=0;e<t.segments.length-1;e++){s=t.segments[e];const n=t.segments[e+1].dateTimeObject;if(i<n){break}}const n=t.segments[t.segments.length-1];const r=n.dateTimeObject;const a=n.videoTimingInfo?kt(n.videoTimingInfo):n.duration+n.duration*Et;const o=new Date(r.getTime()+a*1e3);if(i>o){return null}if(i>r){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Ce.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const wt=(e,t)=>{if(!t||!t.segments||t.segments.length===0){return null}let i=0;let s;for(let n=0;n<t.segments.length;n++){s=t.segments[n];i=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:i+s.duration;if(e<=i){break}}const n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e){return null}if(e>i){if(e>i+n.duration*Et){return null}s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:i-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}};const At=(e,t)=>{let i;let s;try{i=new Date(e);s=new Date(t)}catch(e){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const Ot=e=>{if(!e.segments||e.segments.length===0){return false}for(let t=0;t<e.segments.length;t++){const i=e.segments[t];if(!i.dateTimeObject){return false}}return true};const Dt=({playlist:e,time:t=undefined,callback:i})=>{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!e||t===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=wt(t,e);if(!s){return i({message:"valid programTime was not found"})}if(s.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}const n={mediaSeconds:t};const r=It(t,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const Pt=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:a})=>{if(!a){throw new Error("seekToProgramTime: callback must be provided")}if(typeof e==="undefined"||!t||!s){return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!t.endList&&!r.hasStarted_){return a({message:"player must be playing a live stream to start buffering"})}if(!Ot(t)){return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri})}const o=Ct(e,t);if(!o){return a({message:`${e} was not found in the stream`})}const l=o.segment;const u=At(l.dateTimeObject,e);if(o.type==="estimate"){if(i===0){return a({message:`${e} is not buffered yet. Try again`})}s(o.estimatedStart+u);r.one("seeked",()=>{Pt({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a})});return}const c=l.start+u;const d=()=>{return a(null,r.currentTime())};r.one("seeked",d);if(n){r.pause()}s(c)};var xt=function e(t,i,s){i.forEach(function(e){for(var i in t.mediaGroups[e]){for(var n in t.mediaGroups[e][i]){var r=t.mediaGroups[e][i][n];s(r,e,i,n)}}})};const Lt=e=>{return!!e&&typeof e==="object"};const Rt=(...e)=>{return e.reduce((e,t)=>{if(typeof t!=="object"){return e}Object.keys(t).forEach(i=>{if(Array.isArray(e[i])&&Array.isArray(t[i])){e[i]=e[i].concat(t[i])}else if(Lt(e[i])&&Lt(t[i])){e[i]=Rt(e[i],t[i])}else{e[i]=t[i]}});return e},{})};const Nt=e=>Object.keys(e).map(t=>e[t]);const Mt=(e,t)=>{const i=[];for(let s=e;s<t;s++){i.push(s)}return i};const Ut=e=>e.reduce((e,t)=>e.concat(t),[]);const Bt=e=>{if(!e.length){return[]}const t=[];for(let i=0;i<e.length;i++){t.push(e[i])}return t};const Ft=(e,t)=>e.reduce((e,i,s)=>{if(i[t]){e.push(s)}return e},[]);const jt=(e,t)=>{return Nt(e.reduce((e,i)=>{i.forEach(i=>{e[t(i)]=i});return e},{}))};var Vt={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",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const $t=({baseUrl:t="",source:i="",range:s="",indexRange:n=""})=>{const r={uri:i,resolvedUri:c(t||"",i)};if(s||n){const t=s?s:n;const i=t.split("-");let a=e.BigInt?e.BigInt(i[0]):parseInt(i[0],10);let o=e.BigInt?e.BigInt(i[1]):parseInt(i[1],10);if(a<Number.MAX_SAFE_INTEGER&&typeof a==="bigint"){a=Number(a)}if(o<Number.MAX_SAFE_INTEGER&&typeof o==="bigint"){o=Number(o)}let l;if(typeof o==="bigint"||typeof a==="bigint"){l=e.BigInt(o)-e.BigInt(a)+e.BigInt(1)}else{l=o-a+1}if(typeof l==="bigint"&&l<Number.MAX_SAFE_INTEGER){l=Number(l)}r.byterange={length:l,offset:a}}return r};const qt=t=>{let i;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){i=e.BigInt(t.offset)+e.BigInt(t.length)-e.BigInt(1)}else{i=t.offset+t.length-1}return`${t.offset}-${i}`};const Ht=e=>{if(e&&typeof e!=="number"){e=parseInt(e,10)}if(isNaN(e)){return null}return e};const Wt={static(e){const{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e;const r=Ht(e.endNumber);const a=t/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof n==="number"){return{start:0,end:n/a}}return{start:0,end:s/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=Infinity}=e;const u=Ht(e.endNumber);const c=(t+i)/1e3;const d=s+a;const h=c+o;const f=h-d;const p=Math.ceil(f*n/r);const m=Math.floor((c-d-l)*n/r);const g=Math.floor((c-d)*n/r);return{start:Math.max(0,m),end:typeof u==="number"?u:Math.min(p,g)}}};const Gt=e=>t=>{const{duration:i,timescale:s=1,periodStart:n,startNumber:r=1}=e;return{number:r+t,duration:i/s,timeline:n,time:t*i}};const Kt=e=>{const{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=e;const{start:a,end:o}=Wt[t](e);const l=Mt(a,o).map(Gt(e));if(t==="static"){const e=l.length-1;const t=typeof n==="number"?n:r;l[e].duration=t-i/s*e}return l};const zt=e=>{const{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t){throw new Error(Vt.NO_BASE_URL)}const u=$t({baseUrl:t,source:i.sourceURL,range:i.range});const c=$t({baseUrl:t,source:t,indexRange:n});c.map=u;if(l){const t=Kt(e);if(t.length){c.duration=t[0].duration;c.timeline=t[0].timeline}}else if(s){c.duration=s;c.timeline=r}c.presentationTime=a||r;c.number=o;return[c]};const Yt=(t,i,s)=>{const n=t.sidx.map?t.sidx.map:null;const r=t.sidx.duration;const a=t.timeline||0;const o=t.sidx.byterange;const l=o.offset+o.length;const u=i.timescale;const c=i.references.filter(e=>e.referenceType!==1);const d=[];const h=t.endList?"static":"dynamic";const f=t.sidx.timeline;let p=f;let m=t.mediaSequence||0;let g;if(typeof i.firstOffset==="bigint"){g=e.BigInt(l)+i.firstOffset}else{g=l+i.firstOffset}for(let t=0;t<c.length;t++){const o=i.references[t];const l=o.referencedSize;const c=o.subsegmentDuration;let y;if(typeof g==="bigint"){y=g+e.BigInt(l)-e.BigInt(1)}else{y=g+l-1}const _=`${g}-${y}`;const v={baseUrl:s,timescale:u,timeline:a,periodStart:f,presentationTime:p,number:m,duration:c,sourceDuration:r,indexRange:_,type:h};const b=zt(v)[0];if(n){b.map=n}d.push(b);if(typeof g==="bigint"){g+=e.BigInt(l)}else{g+=l}p+=c/u;m++}t.segments=d;return t};const Xt=["AUDIO","SUBTITLES"];const Qt=1/60;const Jt=e=>{return jt(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1)};const Zt=(e,t)=>{for(let i=0;i<e.length;i++){if(e[i].attributes.NAME===t){return e[i]}}return null};const ei=e=>{let t=[];xt(e,Xt,(e,i,s,n)=>{t=t.concat(e.playlists||[])});return t};const ti=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t;e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})};const ii=({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});const s=Zt(e,t.attributes.NAME);if(!s){return}if(t.sidx){return}const n=t.segments[0];const r=s.segments.findIndex(function(e){return Math.abs(e.presentationTime-n.presentationTime)<Qt});if(r===-1){ti({playlist:t,mediaSequence:s.mediaSequence+s.segments.length});t.segments[0].discontinuity=true;t.discontinuityStarts.unshift(0);if(!s.segments.length&&t.timeline>s.timeline||s.segments.length&&t.timeline>s.segments[s.segments.length-1].timeline){t.discontinuitySequence--}return}const a=s.segments[r];if(a.discontinuity&&!n.discontinuity){n.discontinuity=true;t.discontinuityStarts.unshift(0);t.discontinuitySequence--}ti({playlist:t,mediaSequence:s.segments[r].number})})};const si=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(ei(e));const s=t.playlists.concat(ei(t));t.timelineStarts=Jt([e.timelineStarts,t.timelineStarts]);ii({oldPlaylists:i,newPlaylists:s,timelineStarts:t.timelineStarts});return t};const ni=e=>e&&e.uri+"-"+qt(e.byterange);const ri=e=>{const t=Nt(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");if(!e[i]){e[i]=t;e[i].attributes.timelineStarts=[]}else{if(t.segments){if(t.segments[0]){t.segments[0].discontinuity=true}e[i].segments.push(...t.segments)}if(t.attributes.contentProtection){e[i].attributes.contentProtection=t.attributes.contentProtection}}e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart});return e},{}));return t.map(e=>{e.discontinuityStarts=Ft(e.segments||[],"discontinuity");return e})};const ai=(e,t)=>{const i=ni(e.sidx);const s=i&&t[i]&&t[i].sidx;if(s){Yt(e,s,e.sidx.resolvedUri)}return e};const oi=(e,t={})=>{if(!Object.keys(t).length){return e}for(const i in e){e[i]=ai(e[i],t)}return e};const li=({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t};if(e.contentProtection){o.contentProtection=e.contentProtection}if(i){o.sidx=i}if(a){o.attributes.AUDIO="audio";o.attributes.SUBTITLES="subs"}return o};const ui=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{if(typeof t==="undefined"){t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}];e.duration=e.sourceDuration}const r={NAME:e.id,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1};if(e.codecs){r.CODECS=e.codecs}return{attributes:r,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:t}};const ci=(e,t={},i=false)=>{let s;const n=e.reduce((e,n)=>{const r=n.attributes.role&&n.attributes.role.value||"";const a=n.attributes.lang||"";let o=n.attributes.label||"main";if(a&&!n.attributes.label){const e=r?` (${r})`:"";o=`${n.attributes.lang}${e}`}if(!e[o]){e[o]={language:a,autoselect:true,default:r==="main",playlists:[],uri:""}}const l=ai(li(n,i),t);e[o].playlists.push(l);if(typeof s==="undefined"&&r==="main"){s=n;s.default=true}return e},{});if(!s){const e=Object.keys(n)[0];n[e].default=true}return n};const di=(e,t={})=>{return e.reduce((e,i)=>{const s=i.attributes.label||i.attributes.lang||"text";if(!e[s]){e[s]={language:s,default:false,autoselect:false,playlists:[],uri:""}}e[s].playlists.push(ai(ui(i),t));return e},{})};const hi=e=>e.reduce((e,t)=>{if(!t){return e}t.forEach(t=>{const{channel:i,language:s}=t;e[s]={autoselect:false,default:false,instreamId:i,language:s};if(t.hasOwnProperty("aspectRatio")){e[s].aspectRatio=t.aspectRatio}if(t.hasOwnProperty("easyReader")){e[s].easyReader=t.easyReader}if(t.hasOwnProperty("3D")){e[s]["3D"]=t["3D"]}});return e},{});const fi=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t};if(e.frameRate){n.attributes["FRAME-RATE"]=e.frameRate}if(e.contentProtection){n.contentProtection=e.contentProtection}if(i){n.sidx=i}return n};const pi=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video";const mi=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio";const gi=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text";const yi=(e,t)=>{e.forEach(e=>{e.mediaSequence=0;e.discontinuitySequence=t.findIndex(function({timeline:t}){return t===e.timeline});if(!e.segments){return}e.segments.forEach((e,t)=>{e.number=t})})};const _i=e=>{if(!e){return[]}return Object.keys(e).reduce((t,i)=>{const s=e[i];return t.concat(s.playlists)},[])};const vi=({dashPlaylists:e,locations:t,sidxMapping:i={},previousManifest:s,eventStream:n})=>{if(!e.length){return{}}const{sourceDuration:r,type:a,suggestedPresentationDelay:o,minimumUpdatePeriod:l}=e[0].attributes;const u=ri(e.filter(pi)).map(fi);const c=ri(e.filter(mi));const d=ri(e.filter(gi));const h=e.map(e=>e.attributes.captionServices).filter(Boolean);const f={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:r,playlists:oi(u,i)};if(l>=0){f.minimumUpdatePeriod=l*1e3}if(t){f.locations=t}if(a==="dynamic"){f.suggestedPresentationDelay=o}if(n&&n.length>0){f.eventStream=n}const p=f.playlists.length===0;const m=c.length?ci(c,i,p):null;const g=d.length?di(d,i):null;const y=u.concat(_i(m),_i(g));const _=y.map(({timelineStarts:e})=>e);f.timelineStarts=Jt(_);yi(y,f.timelineStarts);if(m){f.mediaGroups.AUDIO.audio=m}if(g){f.mediaGroups.SUBTITLES.subs=g}if(h.length){f.mediaGroups["CLOSED-CAPTIONS"].cc=hi(h)}if(s){return si({oldManifest:s,newManifest:f})}return f};const bi=(e,t,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;const u=(s+n)/1e3;const c=r+o;const d=u+l;const h=d-c;return Math.ceil((h*a-t)/i)};const Ti=(e,t)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e;const u=[];let c=-1;for(let d=0;d<t.length;d++){const h=t[d];const f=h.d;const p=h.r||0;const m=h.t||0;if(c<0){c=m}if(m&&m>c){c=m}let g;if(p<0){const o=d+1;if(o===t.length){if(i==="dynamic"&&s>0&&n.indexOf("$Number$")>0){g=bi(e,c,f)}else{g=(r*a-c)/f}}else{g=(t[o].t-c)/f}}else{g=p+1}const y=o+u.length+g;let _=o+u.length;while(_<y){u.push({number:_,duration:f/a,time:c,timeline:l});c+=f;_++}}return u};const Si=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;const Ei=e=>(t,i,s,n)=>{if(t==="$$"){return"$"}if(typeof e[i]==="undefined"){return t}const r=""+e[i];if(i==="RepresentationID"){return r}if(!s){n=1}else{n=parseInt(n,10)}if(r.length>=n){return r}return`${new Array(n-r.length+1).join("0")}${r}`};const Ii=(e,t)=>e.replace(Si,Ei(t));const ki=(e,t)=>{if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}if(e.duration){return Kt(e)}return Ti(e,t)};const Ci=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0};const{initialization:s={sourceURL:"",range:""}}=e;const n=$t({baseUrl:e.baseUrl,source:Ii(s.sourceURL,i),range:s.range});const r=ki(e,t);return r.map(t=>{i.Number=t.number;i.Time=t.time;const s=Ii(e.media||"",i);const r=e.timescale||1;const a=e.presentationTimeOffset||0;const o=e.periodStart+(t.time-a)/r;const l={uri:s,timeline:t.timeline,duration:t.duration,resolvedUri:c(e.baseUrl||"",s),map:n,number:t.number,presentationTime:o};return l})};const wi=(e,t)=>{const{baseUrl:i,initialization:s={}}=e;const n=$t({baseUrl:i,source:s.sourceURL,range:s.range});const r=$t({baseUrl:i,source:t.media,range:t.mediaRange});r.map=n;return r};const Ai=(e,t)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=e;if(!i&&!t||i&&t){throw new Error(Vt.SEGMENT_TIME_UNSPECIFIED)}const r=s.map(t=>wi(e,t));let a;if(i){a=Kt(e)}if(t){a=Ti(e,t)}const o=a.map((t,i)=>{if(r[i]){const s=r[i];const a=e.timescale||1;const o=e.presentationTimeOffset||0;s.timeline=t.timeline;s.duration=t.duration;s.number=t.number;s.presentationTime=n+(t.time-o)/a;return s}}).filter(e=>e);return o};const Oi=({attributes:e,segmentInfo:t})=>{let i;let s;if(t.template){s=Ci;i=Rt(e,t.template)}else if(t.base){s=zt;i=Rt(e,t.base)}else if(t.list){s=Ai;i=Rt(e,t.list)}const n={attributes:e};if(!s){return n}const r=s(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else if(r.length){i.duration=r.reduce((e,t)=>{return Math.max(e,Math.ceil(t.duration))},0)}else{i.duration=0}n.attributes=i;n.segments=r;if(t.base&&i.indexRange){n.sidx=r[0];n.segments=[]}return n};const Di=e=>e.map(Oi);const Pi=(e,t)=>Bt(e.childNodes).filter(({tagName:e})=>e===t);const xi=e=>e.textContent.trim();const Li=e=>{return parseFloat(e.split("/").reduce((e,t)=>e/t))};const Ri=e=>{const t=365*24*60*60;const i=30*24*60*60;const s=24*60*60;const n=60*60;const r=60;const a=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const o=a.exec(e);if(!o){return 0}const[l,u,c,d,h,f]=o.slice(1);return parseFloat(l||0)*t+parseFloat(u||0)*i+parseFloat(c||0)*s+parseFloat(d||0)*n+parseFloat(h||0)*r+parseFloat(f||0)};const Ni=e=>{const t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(t.test(e)){e+="Z"}return Date.parse(e)};const Mi={mediaPresentationDuration(e){return Ri(e)},availabilityStartTime(e){return Ni(e)/1e3},minimumUpdatePeriod(e){return Ri(e)},suggestedPresentationDelay(e){return Ri(e)},type(e){return e},timeShiftBufferDepth(e){return Ri(e)},start(e){return Ri(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Li(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){const t=parseInt(e,10);if(isNaN(t)){return Ri(e)}return t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}};const Ui=e=>{if(!(e&&e.attributes)){return{}}return Bt(e.attributes).reduce((e,t)=>{const i=Mi[t.name]||Mi.DEFAULT;e[t.name]=i(t.value);return e},{})};const Bi={"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"};const Fi=(e,t)=>{if(!t.length){return e}return Ut(e.map(function(e){return t.map(function(t){return c(e,xi(t))})}))};const ji=e=>{const t=Pi(e,"SegmentTemplate")[0];const i=Pi(e,"SegmentList")[0];const s=i&&Pi(i,"SegmentURL").map(e=>Rt({tag:"SegmentURL"},Ui(e)));const n=Pi(e,"SegmentBase")[0];const r=i||t;const a=r&&Pi(r,"SegmentTimeline")[0];const o=i||n||t;const l=o&&Pi(o,"Initialization")[0];const u=t&&Ui(t);if(u&&l){u.initialization=l&&Ui(l)}else if(u&&u.initialization){u.initialization={sourceURL:u.initialization}}const c={template:u,segmentTimeline:a&&Pi(a,"S").map(e=>Ui(e)),list:i&&Rt(Ui(i),{segmentUrls:s,initialization:Ui(l)}),base:n&&Rt(Ui(n),{initialization:Ui(l)})};Object.keys(c).forEach(e=>{if(!c[e]){delete c[e]}});return c};const Vi=(e,t,i)=>s=>{const n=Pi(s,"BaseURL");const r=Fi(t,n);const a=Rt(e,Ui(s));const o=ji(s);return r.map(e=>{return{segmentInfo:Rt(i,o),attributes:Rt(a,{baseUrl:e})}})};const $i=e=>{return e.reduce((e,t)=>{const i=Ui(t);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const s=Bi[i.schemeIdUri];if(s){e[s]={attributes:i};const n=Pi(t,"cenc:pssh")[0];if(n){const t=xi(n);e[s].pssh=t&&y(t)}}return e},{})};const qi=e=>{if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const t=typeof e.value!=="string"?[]:e.value.split(";");return t.map(e=>{let t;let i;i=e;if(/^CC\d=/.test(e)){[t,i]=e.split("=")}else if(/^CC\d$/.test(e)){t=e}return{channel:t,language:i}})}else if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){const t=typeof e.value!=="string"?[]:e.value.split(";");return t.map(e=>{const t={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,s=""]=e.split("=");t.channel=i;t.language=e;s.split(",").forEach(e=>{const[i,s]=e.split(":");if(i==="lang"){t.language=s}else if(i==="er"){t.easyReader=Number(s)}else if(i==="war"){t.aspectRatio=Number(s)}else if(i==="3D"){t["3D"]=Number(s)}})}else{t.language=e}if(t.channel){t.channel="SERVICE"+t.channel}return t})}};const Hi=e=>{return Ut(Pi(e.node,"EventStream").map(t=>{const i=Ui(t);const s=i.schemeIdUri;return Pi(t,"Event").map(t=>{const n=Ui(t);const r=n.presentationTime||0;const a=i.timescale||1;const o=n.duration||0;const l=r/a+e.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:l,end:l+o/a,messageData:xi(t)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})}))};const Wi=(e,t,i)=>s=>{const n=Ui(s);const r=Fi(t,Pi(s,"BaseURL"));const a=Pi(s,"Role")[0];const o={role:Ui(a)};let l=Rt(e,n,o);const u=Pi(s,"Accessibility")[0];const c=qi(Ui(u));if(c){l=Rt(l,{captionServices:c})}const d=Pi(s,"Label")[0];if(d&&d.childNodes.length){const e=d.childNodes[0].nodeValue.trim();l=Rt(l,{label:e})}const h=$i(Pi(s,"ContentProtection"));if(Object.keys(h).length){l=Rt(l,{contentProtection:h})}const f=ji(s);const p=Pi(s,"Representation");const m=Rt(i,f);return Ut(p.map(Vi(l,r,m)))};const Gi=(e,t)=>(i,s)=>{const n=Fi(t,Pi(i.node,"BaseURL"));const r=Rt(e,{periodStart:i.attributes.start});if(typeof i.attributes.duration==="number"){r.periodDuration=i.attributes.duration}const a=Pi(i.node,"AdaptationSet");const o=ji(i.node);return Ut(a.map(Wi(r,n,o)))};const Ki=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>{if(typeof e.start==="number"){return e.start}if(t&&typeof t.start==="number"&&typeof t.duration==="number"){return t.start+t.duration}if(!t&&i==="static"){return 0}return null};const zi=(e,t={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0}=t;const r=Pi(e,"Period");if(!r.length){throw new Error(Vt.INVALID_NUMBER_OF_PERIOD)}const a=Pi(e,"Location");const o=Ui(e);const l=Fi([i],Pi(e,"BaseURL"));o.type=o.type||"static";o.sourceDuration=o.mediaPresentationDuration||0;o.NOW=s;o.clientOffset=n;if(a.length){o.locations=a.map(xi)}const u=[];r.forEach((e,t)=>{const i=Ui(e);const s=u[t-1];i.start=Ki({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:o.type});u.push({node:e,attributes:i})});return{locations:o.locations,representationInfo:Ut(u.map(Gi(o,l))),eventStream:Ut(u.map(Hi))}};const Yi=e=>{if(e===""){throw new Error(Vt.DASH_EMPTY_MANIFEST)}const t=new n.DOMParser;let i;let s;try{i=t.parseFromString(e,"application/xml");s=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(e){}if(!s||s&&s.getElementsByTagName("parsererror").length>0){throw new Error(Vt.DASH_INVALID_XML)}return s};const Xi=e=>{const t=Pi(e,"UTCTiming")[0];if(!t){return null}const i=Ui(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT";i.value=Date.parse(i.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(Vt.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const Qi=(e,t={})=>{const i=zi(Yi(e),t);const s=Di(i.representationInfo);return vi({dashPlaylists:s,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})};const Ji=e=>Xi(Yi(e));var Zi=Math.pow(2,32);var es=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return t.getUint32(0)*Zi+t.getUint32(4)};var ts={getUint64:es,MAX_UINT32:Zi};var is=ts.getUint64;var ss=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12;if(i.version===0){i.earliestPresentationTime=t.getUint32(s);i.firstOffset=t.getUint32(s+4);s+=8}else{i.earliestPresentationTime=is(e.subarray(s));i.firstOffset=is(e.subarray(s+8));s+=16}s+=2;var n=t.getUint16(s);s+=2;for(;n>0;s+=12,n--){i.references.push({referenceType:(e[s]&128)>>>7,referencedSize:t.getUint32(s)&2147483647,subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(e[s+8]&128),sapType:(e[s+8]&112)>>>4,sapDeltaTime:t.getUint32(s+8)&268435455})}return i};var ns=ss;var rs=rt([73,68,51]);var as=function e(t,i){if(i===void 0){i=0}t=rt(t);var s=t[i+5];var n=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];var r=(s&16)>>4;if(r){return n+20}return n+10};var os=function e(t,i){if(i===void 0){i=0}t=rt(t);if(t.length-i<10||!ht(t,rs,{offset:i})){return i}i+=as(t,i);return e(t,i)};var ls=function e(t){if(typeof t==="string"){return ct(t)}if(typeof t==="number"){return t}return t};var us=function e(t){if(!Array.isArray(t)){return[ls(t)]}return t.map(function(e){return ls(e)})};var cs=function e(t,i,s){if(s===void 0){s=false}i=us(i);t=rt(t);var n=[];if(!i.length){return n}var r=0;while(r<t.length){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0;var o=t.subarray(r+4,r+8);if(a===0){break}var l=r+a;if(l>t.length){if(s){break}l=t.length}var u=t.subarray(r+8,l);if(ht(o,i[0])){if(i.length===1){n.push(u)}else{n.push.apply(n,e(u,i.slice(1),s))}}r=l}return n};var ds={EBML:rt([26,69,223,163]),DocType:rt([66,130]),Segment:rt([24,83,128,103]),SegmentInfo:rt([21,73,169,102]),Tracks:rt([22,84,174,107]),Track:rt([174]),TrackNumber:rt([215]),DefaultDuration:rt([35,227,131]),TrackEntry:rt([174]),TrackType:rt([131]),FlagDefault:rt([136]),CodecID:rt([134]),CodecPrivate:rt([99,162]),VideoTrack:rt([224]),AudioTrack:rt([225]),Cluster:rt([31,67,182,117]),Timestamp:rt([231]),TimestampScale:rt([42,215,177]),BlockGroup:rt([160]),BlockDuration:rt([155]),Block:rt([161]),SimpleBlock:rt([163])};var hs=[128,64,32,16,8,4,2,1];var fs=function e(t){var i=1;for(var s=0;s<hs.length;s++){if(t&hs[s]){break}i++}return i};var ps=function e(t,i,s,n){if(s===void 0){s=true}if(n===void 0){n=false}var r=fs(t[i]);var a=t.subarray(i,i+r);if(s){a=Array.prototype.slice.call(t,i,i+r);a[0]^=hs[r-1]}return{length:r,value:lt(a,{signed:n}),bytes:a}};var ms=function e(t){if(typeof t==="string"){return t.match(/.{1,2}/g).map(function(t){return e(t)})}if(typeof t==="number"){return ut(t)}return t};var gs=function e(t){if(!Array.isArray(t)){return[ms(t)]}return t.map(function(e){return ms(e)})};var ys=function e(t,i,s){if(s>=i.length){return i.length}var n=ps(i,s,false);if(ht(t.bytes,n.bytes)){return s}var r=ps(i,s+n.length);return e(t,i,s+r.length+r.value+n.length)};var _s=function e(t,i){i=gs(i);t=rt(t);var s=[];if(!i.length){return s}var n=0;while(n<t.length){var r=ps(t,n,false);var a=ps(t,n+r.length);var o=n+r.length+a.length;if(a.value===127){a.value=ys(r,t,o);if(a.value!==t.length){a.value-=o}}var l=o+a.value>t.length?t.length:o+a.value;var u=t.subarray(o,l);if(ht(i[0],r.bytes)){if(i.length===1){s.push(u)}else{s=s.concat(e(u,i.slice(1)))}}var c=r.length+a.length+u.length;n+=c}return s};var vs=rt([0,0,0,1]);var bs=rt([0,0,1]);var Ts=rt([0,0,3]);var Ss=function e(t){var i=[];var s=1;while(s<t.length-2){if(ht(t.subarray(s,s+3),Ts)){i.push(s+2);s++}s++}if(i.length===0){return t}var n=t.length-i.length;var r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=t[a]}return r};var Es=function e(t,i,s,n){if(n===void 0){n=Infinity}t=rt(t);s=[].concat(s);var r=0;var a;var o=0;while(r<t.length&&(o<n||a)){var l=void 0;if(ht(t.subarray(r),vs)){l=4}else if(ht(t.subarray(r),bs)){l=3}if(!l){r++;continue}o++;if(a){return Ss(t.subarray(a,r))}var u=void 0;if(i==="h264"){u=t[r+l]&31}else if(i==="h265"){u=t[r+l]>>1&63}if(s.indexOf(u)!==-1){a=r+l}r+=l+(i==="h264"?1:2)}return t.subarray(0,0)};var Is=function e(t,i,s){return Es(t,"h264",i,s)};var ks=function e(t,i,s){return Es(t,"h265",i,s)};var Cs={webm:rt([119,101,98,109]),matroska:rt([109,97,116,114,111,115,107,97]),flac:rt([102,76,97,67]),ogg:rt([79,103,103,83]),ac3:rt([11,119]),riff:rt([82,73,70,70]),avi:rt([65,86,73]),wav:rt([87,65,86,69]),"3gp":rt([102,116,121,112,51,103]),mp4:rt([102,116,121,112]),fmp4:rt([115,116,121,112]),mov:rt([102,116,121,112,113,116]),moov:rt([109,111,111,118]),moof:rt([109,111,111,102])};var ws={aac:function e(t){var i=os(t);return ht(t,[255,16],{offset:i,mask:[255,22]})},mp3:function e(t){var i=os(t);return ht(t,[255,2],{offset:i,mask:[255,6]})},webm:function e(t){var i=_s(t,[ds.EBML,ds.DocType])[0];return ht(i,Cs.webm)},mkv:function e(t){var i=_s(t,[ds.EBML,ds.DocType])[0];return ht(i,Cs.matroska)},mp4:function e(t){if(ws["3gp"](t)||ws.mov(t)){return false}if(ht(t,Cs.mp4,{offset:4})||ht(t,Cs.fmp4,{offset:4})){return true}if(ht(t,Cs.moof,{offset:4})||ht(t,Cs.moov,{offset:4})){return true}},mov:function e(t){return ht(t,Cs.mov,{offset:4})},"3gp":function e(t){return ht(t,Cs["3gp"],{offset:4})},ac3:function e(t){var i=os(t);return ht(t,Cs.ac3,{offset:i})},ts:function e(t){if(t.length<189&&t.length>=1){return t[0]===71}var i=0;while(i+188<t.length&&i<188){if(t[i]===71&&t[i+188]===71){return true}i+=1}return false},flac:function e(t){var i=os(t);return ht(t,Cs.flac,{offset:i})},ogg:function e(t){return ht(t,Cs.ogg)},avi:function e(t){return ht(t,Cs.riff)&&ht(t,Cs.avi,{offset:8})},wav:function e(t){return ht(t,Cs.riff)&&ht(t,Cs.wav,{offset:8})},h264:function e(t){return Is(t,7,3).length},h265:function e(t){return ks(t,[32,33],3).length}};var As=Object.keys(ws).filter(function(e){return e!=="ts"&&e!=="h264"&&e!=="h265"}).concat(["ts","h264","h265"]);As.forEach(function(e){var t=ws[e];ws[e]=function(e){return t(rt(e))}});var Os=ws;var Ds=function e(t){t=rt(t);for(var i=0;i<As.length;i++){var s=As[i];if(Os[s](t)){return s}}return""};var Ps=function e(t){return cs(t,["moof"]).length>0};const xs=(e,t)=>{if(e.readyState===4){return t()}return};const Ls=(e,t,i)=>{let s=[];let n;let r=false;const a=function(e,t,s,n){t.abort();r=true;return i(e,t,s,n)};const o=function(e,t){if(r){return}if(e){return a(e,t,"",s)}const i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);s=dt(s,ct(i,true));n=n||os(s);if(s.length<10||n&&s.length<n+2){return xs(t,()=>a(e,t,"",s))}const o=Ds(s);if(o==="ts"&&s.length<188){return xs(t,()=>a(e,t,"",s))}if(!o&&s.length<376){return xs(t,()=>a(e,t,"",s))}return a(null,t,o,s)};const l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined");e.addEventListener("progress",function({total:t,loaded:i}){return ze(e,null,{statusCode:e.status},o)})}};const u=t(l,function(e,t){return ze(u,e,t,o)});return u};const{EventTarget:Rs}=a["default"];const Ns=function(e,t){if(!qe(e,t)){return false}if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)){return false}else if(!e.sidx&&t.sidx||e.sidx&&!t.sidx){return false}if(e.segments&&!t.segments||!e.segments&&t.segments){return false}if(!e.segments&&!t.segments){return true}for(let i=0;i<e.segments.length;i++){const s=e.segments[i];const n=t.segments[i];if(s.uri!==n.uri){return false}if(!s.byterange&&!n.byterange){continue}const r=s.byterange;const a=n.byterange;if(r&&!a||!r&&a){return false}if(r.offset!==a.offset||r.length!==a.length){return false}}return true};const Ms=(e,t,i,s)=>{const n=s.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${n}`};const Us=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=Qi(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});Me(r,t,Ms);return r};const Bs=(e,t)=>{Pe(e,(i,s,n,r)=>{if(!(r in t.mediaGroups[s][n])){delete e.mediaGroups[s][n][r]}})};const Fs=(e,t,i)=>{let s=true;let n=V(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const r=t.playlists[e];if(r.sidx){const e=ni(r.sidx);if(i&&i[e]&&i[e].sidx){Yt(r,i[e].sidx,r.sidx.resolvedUri)}}const a=He(n,r,Ns);if(a){n=a;s=false}}Pe(t,(e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id;const o=He(n,e.playlists[0],Ns);if(o){n=o;if(!(r in n.mediaGroups[t][i])){n.mediaGroups[t][i][r]=e}n.mediaGroups[t][i][r].playlists[0]=n.playlists[a];s=false}}});Bs(n,t);if(t.minimumUpdatePeriod!==e.minimumUpdatePeriod){s=false}if(s){return null}return n};const js=(e,t)=>{const i=Boolean(!e.map&&!t.map);const s=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return s&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length};const Vs=(e,t)=>{const i={};for(const s in e){const n=e[s];const r=n.sidx;if(r){const e=ni(r);if(!t[e]){break}const s=t[e].sidxInfo;if(js(s,r)){i[e]=t[e]}}}return i};const $s=(e,t)=>{const i=Vs(e.playlists,t);let s=i;Pe(e,(e,i,n,r)=>{if(e.playlists&&e.playlists.length){const i=e.playlists;s=V(s,Vs(i,t))}});return s};class qs extends Rs{constructor(e,t,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=t;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!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_=f("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=e;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=e}}requestErrored_(e,t,i){if(!this.request){return true}this.request=null;if(e){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};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(t,i,s){const n=t.sidx&&ni(t.sidx);if(!t.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n]){this.mediaRequest_=e.setTimeout(()=>s(false),0);return}const r=h(t.sidx.resolvedUri);const a=(e,r)=>{if(this.requestErrored_(e,r,i)){return}const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=ns(rt(r.response).subarray(8))}catch(e){this.requestErrored_(e,r,i);return}a[n]={sidxInfo:t.sidx,sidx:o};Yt(t,o,t.sidx.resolvedUri);return s(true)};this.request=Ls(r,this.vhs_.xhr,(e,i,s,n)=>{if(e){return a(e,i)}if(!s||s!=="mp4"){return a({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: ${r}`,response:"",playlist:t,internal:true,playlistExclusionDuration:Infinity,code:2},i)}const{offset:o,length:l}=t.sidx.byterange;if(n.length>=l+o){return a(e,{response:n.subarray(o,o+l),status:i.status,uri:i.uri})}this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:Qe({byterange:t.sidx.byterange})},a)})}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};e.clearTimeout(this.minimumUpdatePeriodTimeout_);e.clearTimeout(this.mediaRequest_);e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(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 i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA";this.media_=e;if(i){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!i){return}if(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);if(e==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){e.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(t){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const i=this.media();if(t){const t=i?i.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=e.setTimeout(()=>this.load(),t);return}if(!this.started){this.start();return}if(i&&!i.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=e.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}})}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,i)=>{if(this.requestErrored_(t,i)){if(this.state==="HAVE_NOTHING"){this.started=false}return}const s=i.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=i.responseText;if(i.responseHeaders&&i.responseHeaders.date){this.mainLoaded_=Date.parse(i.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=h(this.mainPlaylistLoader_.srcUrl,i);if(s){this.handleMain_();this.syncClientServerClock_(()=>{return e(i,s)});return}return e(i,s)})}syncClientServerClock_(e){const t=Ji(this.mainPlaylistLoader_.mainXml_);if(t===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return e()}if(t.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=t.value-Date.now();return e()}this.request=this.vhs_.xhr({uri:d(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(i,s)=>{if(!this.request){return}if(i){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return e()}let n;if(t.method==="HEAD"){if(!s.responseHeaders||!s.responseHeaders.date){n=this.mainLoaded_}else{n=Date.parse(s.responseHeaders.date)}}else{n=Date.parse(s.responseText)}this.mainPlaylistLoader_.clientOffset_=n-Date.now();e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=Us({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});if(e){t=Fs(e,t,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=t?t:e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=i}if(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(t);return Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const t=this.mainPlaylistLoader_;if(t.createMupOnMedia_){t.off("loadedmetadata",t.createMupOnMedia_);t.createMupOnMedia_=null}if(t.minimumUpdatePeriodTimeout_){e.clearTimeout(t.minimumUpdatePeriodTimeout_);t.minimumUpdatePeriodTimeout_=null}let i=t.main&&t.main.minimumUpdatePeriod;if(i===0){if(t.media()){i=t.media().targetDuration*1e3}else{t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_;t.one("loadedmetadata",t.createMupOnMedia_)}}if(typeof i!=="number"||i<=0){if(i<0){this.logger_(`found invalid minimumUpdatePeriod of ${i}, not setting a timeout`)}return}this.createMUPTimeout_(i)}createMUPTimeout_(t){const i=this.mainPlaylistLoader_;i.minimumUpdatePeriodTimeout_=e.setTimeout(()=>{i.minimumUpdatePeriodTimeout_=null;i.trigger("minimumUpdatePeriod");i.createMUPTimeout_(t)},t)}refreshXml_(){this.requestMain_((e,t)=>{if(!t){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=$s(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})})}refreshMedia_(t){if(!t){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const i=this.mainPlaylistLoader_.main.playlists;const s=!this.media_||this.media_!==i[t];if(s){this.media_=i[t]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const t=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=e.setTimeout(()=>{this.trigger("mediaupdatetimeout");t()},We(this.media(),Boolean(s)))};t()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map(e=>{return{cueTime:e.start,frames:[{data:e.messageData}]}});this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}}var Hs={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 Ws=e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++){t[i]=e.charCodeAt(i)}return t.buffer};const Gs=function(e){e.on=e.addEventListener;e.off=e.removeEventListener;return e};const Ks=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;i.append(e);return URL.createObjectURL(i.getBlob())}};const zs=function(e){return function(){const t=Ks(e);const i=Gs(new Worker(t));i.objURL=t;const s=i.terminate;i.on=i.addEventListener;i.off=i.removeEventListener;i.terminate=function(){URL.revokeObjectURL(t);return s.call(this)};return i}};const Ys=function(e){return`var browserWorkerPolyFill = ${Gs.toString()};\n`+"browserWorkerPolyFill(self);\n"+e};const Xs=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};const Qs=Ys(Xs(function(){var t=typeof globalThis!=="undefined"?globalThis:typeof e!=="undefined"?e:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var i=function(){this.init=function(){var e={};this.on=function(t,i){if(!e[t]){e[t]=[]}e[t]=e[t].concat(i)};this.off=function(t,i){var s;if(!e[t]){return false}s=e[t].indexOf(i);e[t]=e[t].slice();e[t].splice(s,1);return s>-1};this.trigger=function(t){var i,s,n,r;i=e[t];if(!i){return}if(arguments.length===2){n=i.length;for(s=0;s<n;++s){i[s].call(this,arguments[1])}}else{r=[];s=arguments.length;for(s=1;s<arguments.length;++s){r.push(arguments[s])}n=i.length;for(s=0;s<n;++s){i[s].apply(this,r)}}};this.dispose=function(){e={}}}};i.prototype.pipe=function(e){this.on("data",function(t){e.push(t)});this.on("done",function(t){e.flush(t)});this.on("partialdone",function(t){e.partialFlush(t)});this.on("endedtimeline",function(t){e.endTimeline(t)});this.on("reset",function(t){e.reset(t)});return e};i.prototype.push=function(e){this.trigger("data",e)};i.prototype.flush=function(e){this.trigger("done",e)};i.prototype.partialFlush=function(e){this.trigger("partialdone",e)};i.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)};i.prototype.reset=function(e){this.trigger("reset",e)};var s=i;var n=Math.pow(2,32);var r=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return t.getUint32(0)*n+t.getUint32(4)};var a={getUint64:r,MAX_UINT32:n};var o=a.MAX_UINT32;var l,u,c,d,h,f,p,m,g,y,_,v,b,T,S,E,I,k,C,w,A,O,D,P,x,L,R,N,M,U,B,F,j,V,$,q;(function(){var e;D={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:[]};if(typeof Uint8Array==="undefined"){return}for(e in D){if(D.hasOwnProperty(e)){D[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]}}P=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);L=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);x=new Uint8Array([0,0,0,1]);R=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]);N=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]);M={video:R,audio:N};F=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);B=new Uint8Array([0,0,0,0,0,0,0,0]);j=new Uint8Array([0,0,0,0,0,0,0,0]);V=j;$=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);q=j;U=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();l=function(e){var t=[],i=0,s,n,r;for(s=1;s<arguments.length;s++){t.push(arguments[s])}s=t.length;while(s--){i+=t[s].byteLength}n=new Uint8Array(i+8);r=new DataView(n.buffer,n.byteOffset,n.byteLength);r.setUint32(0,n.byteLength);n.set(e,4);for(s=0,i=8;s<t.length;s++){n.set(t[s],i);i+=t[s].byteLength}return n};u=function(){return l(D.dinf,l(D.dref,F))};c=function(e){return l(D.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};d=function(){return l(D.ftyp,P,x,P,L)};E=function(e){return l(D.hdlr,M[e])};h=function(e){return l(D.mdat,e)};S=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);if(e.samplerate){t[12]=e.samplerate>>>24&255;t[13]=e.samplerate>>>16&255;t[14]=e.samplerate>>>8&255;t[15]=e.samplerate&255}return l(D.mdhd,t)};T=function(e){return l(D.mdia,S(e),E(e.type),p(e))};f=function(e){return l(D.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))};p=function(e){return l(D.minf,e.type==="video"?l(D.vmhd,U):l(D.smhd,B),u(),k(e))};m=function(e,t){var i=[],s=t.length;while(s--){i[s]=w(t[s])}return l.apply(null,[D.moof,f(e)].concat(i))};g=function(e){var t=e.length,i=[];while(t--){i[t]=v(e[t])}return l.apply(null,[D.moov,_(4294967295)].concat(i).concat(y(e)))};y=function(e){var t=e.length,i=[];while(t--){i[t]=A(e[t])}return l.apply(null,[D.mvex].concat(i))};_=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l(D.mvhd,t)};I=function(e){var t=e.samples||[],i=new Uint8Array(4+t.length),s,n;for(n=0;n<t.length;n++){s=t[n].flags;i[n+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return l(D.sdtp,i)};k=function(e){return l(D.stbl,C(e),l(D.stts,q),l(D.stsc,V),l(D.stsz,$),l(D.stco,j))};(function(){var e,t;C=function(i){return l(D.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),i.type==="video"?e(i):t(i))};e=function(e){var t=e.sps||[],i=e.pps||[],s=[],n=[],r,a;for(r=0;r<t.length;r++){s.push((t[r].byteLength&65280)>>>8);s.push(t[r].byteLength&255);s=s.concat(Array.prototype.slice.call(t[r]))}for(r=0;r<i.length;r++){n.push((i[r].byteLength&65280)>>>8);n.push(i[r].byteLength&255);n=n.concat(Array.prototype.slice.call(i[r]))}a=[D.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l(D.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],s,[i.length],n))),l(D.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var o=e.sarRatio[0],u=e.sarRatio[1];a.push(l(D.pasp,new Uint8Array([(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255])))}return l.apply(null,a)};t=function(e){return l(D.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),c(e))}})();b=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return l(D.tkhd,t)};w=function(e){var t,i,s,n,r,a,u;t=l(D.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));a=Math.floor(e.baseMediaDecodeTime/o);u=Math.floor(e.baseMediaDecodeTime%o);i=l(D.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,a&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255]));r=32+20+8+16+8+8;if(e.type==="audio"){s=O(e,r);return l(D.traf,t,i,s)}n=I(e);s=O(e,n.length+r);return l(D.traf,t,i,s,n)};v=function(e){e.duration=e.duration||4294967295;return l(D.trak,b(e),T(e))};A=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(e.type!=="video"){t[t.length-1]=0}return l(D.trex,t)};(function(){var e,t,i;i=function(e,t){var i=0,s=0,n=0,r=0;if(e.length){if(e[0].duration!==undefined){i=1}if(e[0].size!==undefined){s=2}if(e[0].flags!==undefined){n=4}if(e[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};t=function(e,t){var s,n,r,a,o,u;a=e.samples||[];t+=8+12+16*a.length;r=i(a,t);n=new Uint8Array(r.length+a.length*16);n.set(r);s=r.length;for(u=0;u<a.length;u++){o=a[u];n[s++]=(o.duration&4278190080)>>>24;n[s++]=(o.duration&16711680)>>>16;n[s++]=(o.duration&65280)>>>8;n[s++]=o.duration&255;n[s++]=(o.size&4278190080)>>>24;n[s++]=(o.size&16711680)>>>16;n[s++]=(o.size&65280)>>>8;n[s++]=o.size&255;n[s++]=o.flags.isLeading<<2|o.flags.dependsOn;n[s++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample;n[s++]=o.flags.degradationPriority&240<<8;n[s++]=o.flags.degradationPriority&15;n[s++]=(o.compositionTimeOffset&4278190080)>>>24;n[s++]=(o.compositionTimeOffset&16711680)>>>16;n[s++]=(o.compositionTimeOffset&65280)>>>8;n[s++]=o.compositionTimeOffset&255}return l(D.trun,n)};e=function(e,t){var s,n,r,a,o,u;a=e.samples||[];t+=8+12+8*a.length;r=i(a,t);s=new Uint8Array(r.length+a.length*8);s.set(r);n=r.length;for(u=0;u<a.length;u++){o=a[u];s[n++]=(o.duration&4278190080)>>>24;s[n++]=(o.duration&16711680)>>>16;s[n++]=(o.duration&65280)>>>8;s[n++]=o.duration&255;s[n++]=(o.size&4278190080)>>>24;s[n++]=(o.size&16711680)>>>16;s[n++]=(o.size&65280)>>>8;s[n++]=o.size&255}return l(D.trun,s)};O=function(i,s){if(i.type==="audio"){return e(i,s)}return t(i,s)}})();var H={ftyp:d,mdat:h,moof:m,moov:g,initSegment:function(e){var t=d(),i=g(e),s;s=new Uint8Array(t.byteLength+i.byteLength);s.set(t);s.set(i,t.byteLength);return s}};var W=function(e){var t,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(t=0;t<e.length;t++){i=e[t];if(i.nalUnitType==="access_unit_delimiter_rbsp"){if(s.length){s.duration=i.dts-s.dts;n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s)}s=[i];s.byteLength=i.data.byteLength;s.pts=i.pts;s.dts=i.dts}else{if(i.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){s.keyFrame=true}s.duration=i.dts-s.dts;s.byteLength+=i.data.byteLength;s.push(i)}}if(n.length&&(!s.duration||s.duration<=0)){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s);return n};var G=function(e){var t,i,s=[],n=[];s.byteLength=0;s.nalCount=0;s.duration=0;s.pts=e[0].pts;s.dts=e[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=e[0].pts;n.dts=e[0].dts;for(t=0;t<e.length;t++){i=e[t];if(i.keyFrame){if(s.length){n.push(s);n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration}s=[i];s.nalCount=i.length;s.byteLength=i.byteLength;s.pts=i.pts;s.dts=i.dts;s.duration=i.duration}else{s.duration+=i.duration;s.nalCount+=i.length;s.byteLength+=i.byteLength;s.push(i)}}if(n.length&&s.duration<=0){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration;n.push(s);return n};var K=function(e){var t;if(!e[0][0].keyFrame&&e.length>1){t=e.shift();e.byteLength-=t.byteLength;e.nalCount-=t.nalCount;e[0][0].dts=t.dts;e[0][0].pts=t.pts;e[0][0].duration+=t.duration}return e};var z=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var Y=function(e,t){var i=z();i.dataOffset=t;i.compositionTimeOffset=e.pts-e.dts;i.duration=e.duration;i.size=4*e.length;i.size+=e.byteLength;if(e.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var X=function(e,t){var i,s,n,r,a,o=t||0,l=[];for(i=0;i<e.length;i++){r=e[i];for(s=0;s<r.length;s++){a=r[s];n=Y(a,o);o+=n.size;l.push(n)}}return l};var Q=function(e){var t,i,s,n,r,a,o=0,l=e.byteLength,u=e.nalCount,c=l+4*u,d=new Uint8Array(c),h=new DataView(d.buffer);for(t=0;t<e.length;t++){n=e[t];for(i=0;i<n.length;i++){r=n[i];for(s=0;s<r.length;s++){a=r[s];h.setUint32(o,a.data.byteLength);o+=4;d.set(a.data,o);o+=a.data.byteLength}}}return d};var J=function(e,t){var i,s=t||0,n=[];i=Y(e,s);n.push(i);return n};var Z=function(e){var t,i,s=0,n=e.byteLength,r=e.length,a=n+4*r,o=new Uint8Array(a),l=new DataView(o.buffer);for(t=0;t<e.length;t++){i=e[t];l.setUint32(s,i.data.byteLength);s+=4;o.set(i.data,s);s+=i.data.byteLength}return o};var ee={groupNalsIntoFrames:W,groupFramesIntoGops:G,extendFirstKeyFrame:K,generateSampleTable:X,concatenateNalData:Q,generateSampleTableForFrame:J,concatenateNalDataForFrame:Z};var te=[33,16,5,32,164,27];var ie=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var se=function(e){var t=[];while(e--){t.push(0)}return t};var ne=function(e){return Object.keys(e).reduce(function(t,i){t[i]=new Uint8Array(e[i].reduce(function(e,t){return e.concat(t)},[]));return t},{})};var re;var ae=function(){if(!re){var e={96000:[te,[227,64],se(154),[56]],88200:[te,[231],se(170),[56]],64000:[te,[248,192],se(240),[56]],48000:[te,[255,192],se(268),[55,148,128],se(54),[112]],44100:[te,[255,192],se(268),[55,163,128],se(84),[112]],32000:[te,[255,192],se(268),[55,234],se(226),[112]],24000:[te,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16000:[te,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12000:[ie,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[ie,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8000:[ie,se(268),[3,121,16],se(47),[7]]};re=ne(e)}return re};var oe=9e4,le,ue,ce,de,he,fe,pe;le=function(e){return e*oe};ue=function(e,t){return e*t};ce=function(e){return e/oe};de=function(e,t){return e/t};he=function(e,t){return le(de(e,t))};fe=function(e,t){return ue(ce(e),t)};pe=function(e,t,i){return ce(i?e:e-t)};var me={ONE_SECOND_IN_TS:oe,secondsToVideoTs:le,secondsToAudioTs:ue,videoTsToSeconds:ce,audioTsToSeconds:de,audioTsToVideoTs:he,videoTsToAudioTs:fe,metadataTsToSeconds:pe};var ge=ae;var ye=me;var _e=function(e){var t,i,s=0;for(t=0;t<e.length;t++){i=e[t];s+=i.data.byteLength}return s};var ve=function(e,t,i,s){var n,r=0,a=0,o=0,l=0,u,c,d;if(!t.length){return}n=ye.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate);r=Math.ceil(ye.ONE_SECOND_IN_TS/(e.samplerate/1024));if(i&&s){a=n-Math.max(i,s);o=Math.floor(a/r);l=o*r}if(o<1||l>ye.ONE_SECOND_IN_TS/2){return}u=ge()[e.samplerate];if(!u){u=t[0].data}for(c=0;c<o;c++){d=t[0];t.splice(0,0,{data:u,dts:d.dts-r,pts:d.pts-r})}e.baseMediaDecodeTime-=Math.floor(ye.videoTsToAudioTs(l,e.samplerate));return l};var be=function(e,t,i){if(t.minSegmentDts>=i){return e}t.minSegmentDts=Infinity;return e.filter(function(e){if(e.dts>=i){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return true}return false})};var Te=function(e){var t,i,s=[];for(t=0;t<e.length;t++){i=e[t];s.push({size:i.data.byteLength,duration:1024})}return s};var Se=function(e){var t,i,s=0,n=new Uint8Array(_e(e));for(t=0;t<e.length;t++){i=e[t];n.set(i.data,s);s+=i.data.byteLength}return n};var Ee={prefixWithSilence:ve,trimAdtsFramesByEarliestDts:be,generateSampleTable:Te,concatenateFrameData:Se};var Ie=me.ONE_SECOND_IN_TS;var ke=function(e,t){if(typeof t.pts==="number"){if(e.timelineStartInfo.pts===undefined){e.timelineStartInfo.pts=t.pts}if(e.minSegmentPts===undefined){e.minSegmentPts=t.pts}else{e.minSegmentPts=Math.min(e.minSegmentPts,t.pts)}if(e.maxSegmentPts===undefined){e.maxSegmentPts=t.pts}else{e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)}}if(typeof t.dts==="number"){if(e.timelineStartInfo.dts===undefined){e.timelineStartInfo.dts=t.dts}if(e.minSegmentDts===undefined){e.minSegmentDts=t.dts}else{e.minSegmentDts=Math.min(e.minSegmentDts,t.dts)}if(e.maxSegmentDts===undefined){e.maxSegmentDts=t.dts}else{e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts)}}};var Ce=function(e){delete e.minSegmentDts;delete e.maxSegmentDts;delete e.minSegmentPts;delete e.maxSegmentPts};var we=function(e,t){var i,s,n=e.minSegmentDts;if(!t){n-=e.timelineStartInfo.dts}i=e.timelineStartInfo.baseMediaDecodeTime;i+=n;i=Math.max(0,i);if(e.type==="audio"){s=e.samplerate/Ie;i*=s;i=Math.floor(i)}return i};var Ae={clearDtsInfo:Ce,calculateTrackBaseMediaDecodeTime:we,collectDtsInfo:ke};var Oe=4,De=128;var Pe=function(e){var t=0,i={payloadType:-1,payloadSize:0},s=0,n=0;while(t<e.byteLength){if(e[t]===De){break}while(e[t]===255){s+=255;t++}s+=e[t++];while(e[t]===255){n+=255;t++}n+=e[t++];if(!i.payload&&s===Oe){var r=String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6]);if(r==="GA94"){i.payloadType=s;i.payloadSize=n;i.payload=e.subarray(t,t+n);break}else{i.payload=void 0}}t+=n;s=0;n=0}return i};var xe=function(e){if(e.payload[0]!==181){return null}if((e.payload[1]<<8|e.payload[2])!==49){return null}if(String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])!=="GA94"){return null}if(e.payload[7]!==3){return null}return e.payload.subarray(8,e.payload.length-1)};var Le=function(e,t){var i=[],s,n,r,a;if(!(t[0]&64)){return i}n=t[0]&31;for(s=0;s<n;s++){r=s*3;a={type:t[r+2]&3,pts:e};if(t[r+2]&4){a.ccData=t[r+3]<<8|t[r+4];i.push(a)}}return i};var Re=function(e){var t=e.byteLength,i=[],s=1,n,r;while(s<t-2){if(e[s]===0&&e[s+1]===0&&e[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return e}n=t-i.length;r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=e[a]}return r};var Ne={parseSei:Pe,parseUserData:xe,parseCaptionPackets:Le,discardEmulationPreventionBytes:Re,USER_DATA_REGISTERED_ITU_T_T35:Oe};var Me=s;var Ue=Ne;var Be=function(e){e=e||{};Be.prototype.init.call(this);this.parse708captions_=typeof e.parse708captions==="boolean"?e.parse708captions:true;this.captionPackets_=[];this.ccStreams_=[new Xe(0,0),new Xe(0,1),new Xe(1,0),new Xe(1,1)];if(this.parse708captions_){this.cc708Stream_=new He({captionServices:e.captionServices})}this.reset();this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data"));e.on("partialdone",this.trigger.bind(this,"partialdone"));e.on("done",this.trigger.bind(this,"done"))},this);if(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"))}};Be.prototype=new Me;Be.prototype.push=function(e){var t,i,s;if(e.nalUnitType!=="sei_rbsp"){return}t=Ue.parseSei(e.escapedRBSP);if(!t.payload){return}if(t.payloadType!==Ue.USER_DATA_REGISTERED_ITU_T_T35){return}i=Ue.parseUserData(t);if(!i){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}s=Ue.parseCaptionPackets(e.pts,i);this.captionPackets_=this.captionPackets_.concat(s);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};Be.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return e==="flush"?t.flush():t.partialFlush()},this)};Be.prototype.flushStream=function(e){if(!this.captionPackets_.length){this.flushCCStreams(e);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(e.type<2){this.dispatchCea608Packet(e)}else{this.dispatchCea708Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};Be.prototype.flush=function(){return this.flushStream("flush")};Be.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Be.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Be.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(this.activeCea608Channel_[e.type]===null){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Be.prototype.setsChannel1Active=function(e){return(e.ccData&30720)===4096};Be.prototype.setsChannel2Active=function(e){return(e.ccData&30720)===6144};Be.prototype.setsTextOrXDSActive=function(e){return(e.ccData&28928)===256||(e.ccData&30974)===4138||(e.ccData&30974)===6186};Be.prototype.dispatchCea708Packet=function(e){if(this.parse708captions_){this.cc708Stream_.push(e)}};var Fe={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};var je=function(e){var t=Fe[e]||e;if(e&4096&&e===t){return""}return String.fromCharCode(t)};var Ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255};var $e=function(e){this.windowNum=e;this.reset()};$e.prototype.reset=function(){this.clearText();this.pendingNewLine=false;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};$e.prototype.getText=function(){return this.rows.join("\n")};$e.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};$e.prototype.newLine=function(e){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(e)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};$e.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};$e.prototype.addText=function(e){this.rows[this.rowIdx]+=e};$e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var qe=function(e,t,i){this.serviceNum=e;this.text="";this.currentWindow=new $e(-1);this.windows=[];this.stream=i;if(typeof t==="string"){this.createTextDecoder(t)}};qe.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new $e(i);if(typeof t==="function"){this.windows[i].beforeRowOverflow=t}}};qe.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};qe.prototype.createTextDecoder=function(e){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}}};var He=function(e){e=e||{};He.prototype.init.call(this);var t=this;var i=e.captionServices||{};var s={};var n;Object.keys(i).forEach(e=>{n=i[e];if(/^SERVICE/.test(e)){s[e]=n.encoding}});this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(e){if(e.type===3){t.new708Packet();t.add708Bytes(e)}else{if(t.current708Packet===null){t.new708Packet()}t.add708Bytes(e)}}};He.prototype=new Me;He.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};He.prototype.add708Bytes=function(e){var t=e.ccData;var i=t>>>8;var s=t&255;this.current708Packet.ptsVals.push(e.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};He.prototype.push708Packet=function(){var e=this.current708Packet;var t=e.data;var i=null;var s=null;var n=0;var r=t[n++];e.seq=r>>6;e.sizeCode=r&63;for(;n<t.length;n++){r=t[n++];i=r>>5;s=r&31;if(i===7&&s>0){r=t[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};He.prototype.pushServiceBlock=function(e,t,i){var s;var n=t;var r=this.current708Packet.data;var a=this.services[e];if(!a){a=this.initService(e,n)}for(;n<t+i&&n<r.length;n++){s=r[n];if(Ve(s)){n=this.handleText(n,a)}else if(s===24){n=this.multiByteCharacter(n,a)}else if(s===16){n=this.extendedCommands(n,a)}else if(128<=s&&s<=135){n=this.setCurrentWindow(n,a)}else if(152<=s&&s<=159){n=this.defineWindow(n,a)}else if(s===136){n=this.clearWindows(n,a)}else if(s===140){n=this.deleteWindows(n,a)}else if(s===137){n=this.displayWindows(n,a)}else if(s===138){n=this.hideWindows(n,a)}else if(s===139){n=this.toggleWindows(n,a)}else if(s===151){n=this.setWindowAttributes(n,a)}else if(s===144){n=this.setPenAttributes(n,a)}else if(s===145){n=this.setPenColor(n,a)}else if(s===146){n=this.setPenLocation(n,a)}else if(s===143){a=this.reset(n,a)}else if(s===8){a.currentWindow.backspace()}else if(s===12){a.currentWindow.clearText()}else if(s===13){a.currentWindow.pendingNewLine=true}else if(s===14){a.currentWindow.clearText()}else if(s===141){n++}else;}};He.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data;var s=i[++e];if(Ve(s)){e=this.handleText(e,t,{isExtended:true})}return e};He.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]};He.prototype.initService=function(e,t){var i="SERVICE"+e;var s=this;var i;var n;if(i in this.serviceEncodings){n=this.serviceEncodings[i]}this.services[e]=new qe(e,n,s);this.services[e].init(this.getPts(t),function(t){s.flushDisplayed(t,s.services[e])});return this.services[e]};He.prototype.handleText=function(e,t,i){var s=i&&i.isExtended;var n=i&&i.isMultiByte;var r=this.current708Packet.data;var a=s?4096:0;var o=r[e];var l=r[e+1];var u=t.currentWindow;var c;var d;if(t.textDecoder_&&!s){if(n){d=[o,l];e++}else{d=[o]}c=t.textDecoder_.decode(new Uint8Array(d))}else{c=je(a|o)}if(u.pendingNewLine&&!u.isEmpty()){u.newLine(this.getPts(e))}u.pendingNewLine=false;u.addText(c);return e};He.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data;var s=i[e+1];var n=i[e+2];if(Ve(s)&&Ve(n)){e=this.handleText(++e,t,{isMultiByte:true})}return e};He.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);return e};He.prototype.defineWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);var r=t.currentWindow;s=i[++e];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++e];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++e];r.anchorHorizontal=s;s=i[++e];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++e];r.columnCount=s&63;s=i[++e];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return e};He.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.winAttr;s=i[++e];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++e];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++e];n.borderType+=(s&128)>>5;n.wordWrap=(s&64)>>6;n.printDirection=(s&48)>>4;n.scrollDirection=(s&12)>>2;n.justify=s&3;s=i[++e];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return e};He.prototype.flushDisplayed=function(e,t){var i=[];for(var s=0;s<8;s++){if(t.windows[s].visible&&!t.windows[s].isEmpty()){i.push(t.windows[s].getText())}}t.endPts=e;t.text=i.join("\n\n");this.pushCaption(t);t.startPts=e};He.prototype.pushCaption=function(e){if(e.text!==""){this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum});e.text="";e.startPts=e.endPts}};He.prototype.displayWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible=1}}return e};He.prototype.hideWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible=0}}return e};He.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible^=1}}return e};He.prototype.clearWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].clearText()}}return e};He.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].reset()}}return e};He.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penAttr;s=i[++e];n.textTag=(s&240)>>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++e];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return e};He.prototype.setPenColor=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penColor;s=i[++e];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++e];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++e];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return e};He.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penLoc;t.currentWindow.pendingNewLine=true;s=i[++e];n.row=s&15;s=i[++e];n.column=s&63;return e};He.prototype.reset=function(e,t){var i=this.getPts(e);this.flushDisplayed(i,t);return this.initService(t.serviceNum,e)};var We={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};var Ge=function(e){if(e===null){return""}e=We[e]||e;return String.fromCharCode(e)};var Ke=14;var ze=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var Ye=function(){var e=[],t=Ke+1;while(t--){e.push("")}return e};var Xe=function(e,t){Xe.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,s,n,r;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}s=t>>>8;n=t&255;if(t===this.PADDING_){return}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=Ye()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Ye()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=Ye()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=Ge(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isExtCharacter(s,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}s=(s&3)<<8;r=Ge(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((n&14)===14){this.addFormatting(e.pts,["i"])}if((n&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){this.column_+=n&3}else if(this.isPAC(s,n)){var a=ze.indexOf(t&7968);if(this.mode_==="rollUp"){if(a-this.rollUpRows_+1<0){a=this.rollUpRows_-1}this.setRollUp(e.pts,a)}if(a!==this.row_){this.clearFormatting(e.pts);this.row_=a}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){this.column_=((t&14)>>1)*4}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=Ge(s);r+=Ge(n);this[this.mode_](e.pts,r);this.column_+=r.length}}};Xe.prototype=new Me;Xe.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(e){this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."});return""}},this).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};Xe.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Ye();this.nonDisplayed_=Ye();this.lastControlCode_=null;this.column_=0;this.row_=Ke;this.rollUpRows_=2;this.formatting_=[]};Xe.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(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};Xe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};Xe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};Xe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};Xe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};Xe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127};Xe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};Xe.prototype.isNormalChar=function(e){return e>=32&&e<=127};Xe.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=Ke;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=Ye();this.displayed_=Ye()}if(t!==undefined&&t!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[t-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]=""}}if(t===undefined){t=this.row_}this.topRow_=t-this.rollUpRows_+1};Xe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)};Xe.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};Xe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t;this.nonDisplayed_[this.row_]=i};Xe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};Xe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]=""}for(e=this.row_+1;e<Ke+1;e++){this.displayed_[e]=""}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]=""};Xe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};var Qe={CaptionStream:Be,Cea608Stream:Xe,Cea708Stream:He};var Je={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var Ze=s;var et=8589934592;var tt=4294967296;var it="shared";var st=function(e,t){var i=1;if(e>t){i=-1}while(Math.abs(t-e)>tt){e+=i*et}return e};var nt=function(e){var t,i;nt.prototype.init.call(this);this.type_=e||it;this.push=function(e){if(this.type_!==it&&e.type!==this.type_){return}if(i===undefined){i=e.dts}e.dts=st(e.dts,i);e.pts=st(e.pts,i);t=e.dts;this.trigger("data",e)};this.flush=function(){i=t;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;t=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};nt.prototype=new Ze;var rt={TimestampRolloverStream:nt,handleRollover:st};var at=(e,t,i)=>{if(!e){return-1}var s=i;for(;s<e.length;s++){if(e[s]===t){return s}}return-1};var ot={typedArrayIndexOf:at};var lt=ot.typedArrayIndexOf,ut={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ct=function(e,t,i){var s,n="";for(s=t;s<i;s++){n+="%"+("00"+e[s].toString(16)).slice(-2)}return n},dt=function(e,t,i){return decodeURIComponent(ct(e,t,i))},ht=function(e,t,i){return unescape(ct(e,t,i))},ft=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},pt={APIC:function(e){var t=1,i,s,n="--\x3e";if(e.data[0]!==ut.Utf8){return}i=lt(e.data,0,t);if(i<0){return}e.mimeType=ht(e.data,t,i);t=i+1;e.pictureType=e.data[t];t++;s=lt(e.data,0,t);if(s<0){return}e.description=dt(e.data,t,s);t=s+1;if(e.mimeType===n){e.url=ht(e.data,t,e.data.length)}else{e.pictureData=e.data.subarray(t,e.data.length)}},"T*":function(e){if(e.data[0]!==ut.Utf8){return}e.value=dt(e.data,1,e.data.length).replace(/\0*$/,"");e.values=e.value.split("\0")},TXXX:function(e){var t;if(e.data[0]!==ut.Utf8){return}t=lt(e.data,0,1);if(t===-1){return}e.description=dt(e.data,1,t);e.value=dt(e.data,t+1,e.data.length).replace(/\0*$/,"");e.data=e.value},"W*":function(e){e.url=ht(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;if(e.data[0]!==ut.Utf8){return}t=lt(e.data,0,1);if(t===-1){return}e.description=dt(e.data,1,t);e.url=ht(e.data,t+1,e.data.length).replace(/\0.*$/,"")},PRIV:function(e){var t;for(t=0;t<e.data.length;t++){if(e.data[t]===0){e.owner=ht(e.data,0,t);break}}e.privateData=e.data.subarray(t+1);e.data=e.privateData}};var mt=function(e){var t,i,s=10,n=0,r=[];if(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0)){return}n=ft(e.subarray(6,10));n+=10;var a=e[5]&64;if(a){s+=4;s+=ft(e.subarray(10,14));n-=ft(e.subarray(16,20))}do{t=ft(e.subarray(s+4,s+8));if(t<1){break}i=String.fromCharCode(e[s],e[s+1],e[s+2],e[s+3]);var o={id:i,data:e.subarray(s+10,s+t+10)};o.key=o.id;if(pt[o.id]){pt[o.id](o)}else if(o.id[0]==="T"){pt["T*"](o)}else if(o.id[0]==="W"){pt["W*"](o)}r.push(o);s+=10;s+=t}while(s<n);return r};var gt={parseId3Frames:mt,parseSyncSafeInteger:ft,frameParsers:pt};var yt=s,_t=Je,vt=gt,bt;bt=function(e){var t={descriptor:e&&e.descriptor},i=0,s=[],n=0,r;bt.prototype.init.call(this);this.dispatchType=_t.METADATA_STREAM_TYPE.toString(16);if(t.descriptor){for(r=0;r<t.descriptor.length;r++){this.dispatchType+=("00"+t.descriptor[r].toString(16)).slice(-2)}}this.push=function(e){var t,r,a,o,l,u;if(e.type!=="timed-metadata"){return}if(e.dataAlignmentIndicator){n=0;s.length=0}if(s.length===0&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}s.push(e);n+=e.data.byteLength;if(s.length===1){i=vt.parseSyncSafeInteger(e.data.subarray(6,10));i+=10}if(n<i){return}t={data:new Uint8Array(i),frames:[],pts:s[0].pts,dts:s[0].dts};for(l=0;l<i;){t.data.set(s[0].data.subarray(0,i-l),l);l+=s[0].data.byteLength;n-=s[0].data.byteLength;s.shift()}r=10;if(t.data[5]&64){r+=4;r+=vt.parseSyncSafeInteger(t.data.subarray(10,14));i-=vt.parseSyncSafeInteger(t.data.subarray(16,20))}do{a=vt.parseSyncSafeInteger(t.data.subarray(r+4,r+8));if(a<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}u=String.fromCharCode(t.data[r],t.data[r+1],t.data[r+2],t.data[r+3]);o={id:u,data:t.data.subarray(r+10,r+a+10)};o.key=o.id;if(vt.frameParsers[o.id]){vt.frameParsers[o.id](o)}else if(o.id[0]==="T"){vt.frameParsers["T*"](o)}else if(o.id[0]==="W"){vt.frameParsers["W*"](o)}if(o.owner==="com.apple.streaming.transportStreamTimestamp"){var c=o.data,d=(c[3]&1)<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4;d+=c[7]&3;o.timeStamp=d;if(t.pts===undefined&&t.dts===undefined){t.pts=o.timeStamp;t.dts=o.timeStamp}this.trigger("timestamp",o)}t.frames.push(o);r+=10;r+=a}while(r<i);this.trigger("data",t)}};bt.prototype=new yt;var Tt=bt;var St=s,Et=Qe,It=Je,kt=rt.TimestampRolloverStream;var Ct,wt,At;var Ot=188,Dt=71;Ct=function(){var e=new Uint8Array(Ot),t=0;Ct.prototype.init.call(this);this.push=function(i){var s=0,n=Ot,r;if(t){r=new Uint8Array(i.byteLength+t);r.set(e.subarray(0,t));r.set(i,t);t=0}else{r=i}while(n<r.byteLength){if(r[s]===Dt&&r[n]===Dt){this.trigger("data",r.subarray(s,n));s+=Ot;n+=Ot;continue}s++;n++}if(s<r.byteLength){e.set(r.subarray(s),0);t=r.byteLength-s}};this.flush=function(){if(t===Ot&&e[0]===Dt){this.trigger("data",e);t=0}this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.reset=function(){t=0;this.trigger("reset")}};Ct.prototype=new St;wt=function(){var e,t,i,s;wt.prototype.init.call(this);s=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;e=function(e,s){var n=0;if(s.payloadUnitStartIndicator){n+=e[n]+1}if(s.type==="pat"){t(e.subarray(n),s)}else{i(e.subarray(n),s)}};t=function(e,t){t.section_number=e[7];t.last_section_number=e[8];s.pmtPid=(e[10]&31)<<8|e[11];t.pmtPid=s.pmtPid};i=function(e,t){var i,n,r,a;if(!(e[5]&1)){return}s.programMapTable={video:null,audio:null,"timed-metadata":{}};i=(e[1]&15)<<8|e[2];n=3+i-4;r=(e[10]&15)<<8|e[11];a=12+r;while(a<n){var o=e[a];var l=(e[a+1]&31)<<8|e[a+2];if(o===It.H264_STREAM_TYPE&&s.programMapTable.video===null){s.programMapTable.video=l}else if(o===It.ADTS_STREAM_TYPE&&s.programMapTable.audio===null){s.programMapTable.audio=l}else if(o===It.METADATA_STREAM_TYPE){s.programMapTable["timed-metadata"][l]=o}a+=((e[a+3]&15)<<8|e[a+4])+5}t.programMapTable=s.programMapTable};this.push=function(t){var i={},s=4;i.payloadUnitStartIndicator=!!(t[1]&64);i.pid=t[1]&31;i.pid<<=8;i.pid|=t[2];if((t[3]&48)>>>4>1){s+=t[s]+1}if(i.pid===0){i.type="pat";e(t.subarray(s),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";e(t.subarray(s),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([t,s,i])}else{this.processPes_(t,s,i)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=It.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=It.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};wt.prototype=new St;wt.STREAM_TYPES={h264:27,adts:15};At=function(){var e=this,t=false,i={data:[],size:0},s={data:[],size:0},n={data:[],size:0},r,a=function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array;if(s!==1){return}t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=(e[6]&4)!==0;i=e[7];if(i&192){t.pts=(e[9]&14)<<27|(e[10]&255)<<20|(e[11]&254)<<12|(e[12]&255)<<5|(e[13]&254)>>>3;t.pts*=4;t.pts+=(e[13]&6)>>>1;t.dts=t.pts;if(i&64){t.dts=(e[14]&14)<<27|(e[15]&255)<<20|(e[16]&254)<<12|(e[17]&255)<<5|(e[18]&254)>>>3;t.dts*=4;t.dts+=(e[18]&6)>>>1}}t.data=e.subarray(9+e[8])},o=function(t,i,s){var n=new Uint8Array(t.size),r={type:i},o=0,l=0,u=false,c;if(!t.data.length||t.size<9){return}r.trackId=t.data[0].pid;for(o=0;o<t.data.length;o++){c=t.data[o];n.set(c.data,l);l+=c.data.byteLength}a(n,r);u=i==="video"||r.packetLength<=t.size;if(s||u){t.size=0;t.data.length=0}if(u){e.trigger("data",r)}};At.prototype.init.call(this);this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case It.H264_STREAM_TYPE:e=i;t="video";break;case It.ADTS_STREAM_TYPE:e=s;t="audio";break;case It.METADATA_STREAM_TYPE:e=n;t="timed-metadata";break;default:return}if(a.payloadUnitStartIndicator){o(e,t,true)}e.data.push(a);e.size+=a.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};r=a.programMapTable;if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}t=true;e.trigger("data",i)}})[a.type]()};this.reset=function(){i.size=0;i.data.length=0;s.size=0;s.data.length=0;this.trigger("reset")};this.flushStreams_=function(){o(i,"video");o(s,"audio");o(n,"timed-metadata")};this.flush=function(){if(!t&&r){var i={type:"metadata",tracks:[]};if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}e.trigger("data",i)}t=false;this.flushStreams_();this.trigger("done")}};At.prototype=new St;var Pt={PAT_PID:0,MP2T_PACKET_LENGTH:Ot,TransportPacketStream:Ct,TransportParseStream:wt,ElementaryStream:At,TimestampRolloverStream:kt,CaptionStream:Et.CaptionStream,Cea608Stream:Et.Cea608Stream,Cea708Stream:Et.Cea708Stream,MetadataStream:Tt};for(var xt in It){if(It.hasOwnProperty(xt)){Pt[xt]=It[xt]}}var Lt=Pt;var Rt=s;var Nt=me.ONE_SECOND_IN_TS;var Mt;var Ut=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Mt=function(e){var t,i=0;Mt.prototype.init.call(this);this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})};this.push=function(s){var n=0,r,a,o,l,u;if(!e){i=0}if(s.type!=="audio"){return}if(t&&t.length){o=t;t=new Uint8Array(o.byteLength+s.data.byteLength);t.set(o);t.set(s.data,o.byteLength)}else{t=s.data}var c;while(n+7<t.length){if(t[n]!==255||(t[n+1]&246)!==240){if(typeof c!=="number"){c=n}n++;continue}if(typeof c==="number"){this.skipWarn_(c,n);c=null}a=(~t[n+1]&1)*2;r=(t[n+3]&3)<<11|t[n+4]<<3|(t[n+5]&224)>>5;l=((t[n+6]&3)+1)*1024;u=l*Nt/Ut[(t[n+2]&60)>>>2];if(t.byteLength-n<r){break}this.trigger("data",{pts:s.pts+i*u,dts:s.dts+i*u,sampleCount:l,audioobjecttype:(t[n+2]>>>6&3)+1,channelcount:(t[n+2]&1)<<2|(t[n+3]&192)>>>6,samplerate:Ut[(t[n+2]&60)>>>2],samplingfrequencyindex:(t[n+2]&60)>>>2,samplesize:16,data:t.subarray(n+7+a,n+r)});i++;n+=r}if(typeof c==="number"){this.skipWarn_(c,n);c=null}t=t.subarray(n)};this.flush=function(){i=0;this.trigger("done")};this.reset=function(){t=void 0;this.trigger("reset")};this.endTimeline=function(){t=void 0;this.trigger("endedtimeline")}};Mt.prototype=new Rt;var Bt=Mt;var Ft;Ft=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t};this.bitsAvailable=function(){return 8*t+s};this.loadWord=function(){var n=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(a===0){throw new Error("no bytes available")}r.set(e.subarray(n,n+a));i=new DataView(r.buffer).getUint32(0);s=a*8;t-=a};this.skipBits=function(e){var n;if(s>e){i<<=e;s-=e}else{e-=s;n=Math.floor(e/8);e-=n*8;t-=n;this.loadWord();i<<=e;s-=e}};this.readBits=function(e){var n=Math.min(s,e),r=i>>>32-n;s-=n;if(s>0){i<<=n}else if(t>0){this.loadWord()}n=e-n;if(n>0){return r<<n|this.readBits(n)}return r};this.skipLeadingZeros=function(){var e;for(e=0;e<s;++e){if((i&2147483648>>>e)!==0){i<<=e;s-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var jt=Ft;var Vt=s;var $t=jt;var qt,Ht;var Wt;Ht=function(){var e=0,t,i;Ht.prototype.init.call(this);this.push=function(s){var n;if(!i){i=s.data}else{n=new Uint8Array(i.byteLength+s.data.byteLength);n.set(i);n.set(s.data,i.byteLength);i=n}var r=i.byteLength;for(;e<r-3;e++){if(i[e+2]===1){t=e+5;break}}while(t<r){switch(i[t]){case 0:if(i[t-1]!==0){t+=2;break}else if(i[t-2]!==0){t++;break}if(e+3!==t-2){this.trigger("data",i.subarray(e+3,t-2))}do{t++}while(i[t]!==1&&t<r);e=t-2;t+=3;break;case 1:if(i[t-1]!==0||i[t-2]!==0){t+=3;break}this.trigger("data",i.subarray(e+3,t-2));e=t-2;t+=3;break;default:t+=3;break}}i=i.subarray(e);t-=e;e=0};this.reset=function(){i=null;e=0;this.trigger("reset")};this.flush=function(){if(i&&i.byteLength>3){this.trigger("data",i.subarray(e+3))}i=null;e=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};Ht.prototype=new Vt;Wt={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};qt=function(){var e=new Ht,t,i,s,n,r,a,o;qt.prototype.init.call(this);t=this;this.push=function(t){if(t.type!=="video"){return}i=t.trackId;s=t.pts;n=t.dts;e.push(t)};e.on("data",function(e){var o={trackId:i,pts:s,dts:n,data:e,nalUnitTypeCode:e[0]&31};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp";o.escapedRBSP=r(e.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp";o.escapedRBSP=r(e.subarray(1));o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";break}t.trigger("data",o)});e.on("done",function(){t.trigger("done")});e.on("partialdone",function(){t.trigger("partialdone")});e.on("reset",function(){t.trigger("reset")});e.on("endedtimeline",function(){t.trigger("endedtimeline")});this.flush=function(){e.flush()};this.partialFlush=function(){e.partialFlush()};this.reset=function(){e.reset()};this.endTimeline=function(){e.endTimeline()};o=function(e,t){var i=8,s=8,n,r;for(n=0;n<e;n++){if(s!==0){r=t.readExpGolomb();s=(i+r+256)%256}i=s===0?i:s}};r=function(e){var t=e.byteLength,i=[],s=1,n,r;while(s<t-2){if(e[s]===0&&e[s+1]===0&&e[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return e}n=t-i.length;r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=e[a]}return r};a=function(e){var t=0,i=0,s=0,n=0,r,a,l,u,c,d,h,f,p,m,g,y=[1,1],_,v;r=new $t(e);a=r.readUnsignedByte();u=r.readUnsignedByte();l=r.readUnsignedByte();r.skipUnsignedExpGolomb();if(Wt[a]){c=r.readUnsignedExpGolomb();if(c===3){r.skipBits(1)}r.skipUnsignedExpGolomb();r.skipUnsignedExpGolomb();r.skipBits(1);if(r.readBoolean()){g=c!==3?8:12;for(v=0;v<g;v++){if(r.readBoolean()){if(v<6){o(16,r)}else{o(64,r)}}}}}r.skipUnsignedExpGolomb();d=r.readUnsignedExpGolomb();if(d===0){r.readUnsignedExpGolomb()}else if(d===1){r.skipBits(1);r.skipExpGolomb();r.skipExpGolomb();h=r.readUnsignedExpGolomb();for(v=0;v<h;v++){r.skipExpGolomb()}}r.skipUnsignedExpGolomb();r.skipBits(1);f=r.readUnsignedExpGolomb();p=r.readUnsignedExpGolomb();m=r.readBits(1);if(m===0){r.skipBits(1)}r.skipBits(1);if(r.readBoolean()){t=r.readUnsignedExpGolomb();i=r.readUnsignedExpGolomb();s=r.readUnsignedExpGolomb();n=r.readUnsignedExpGolomb()}if(r.readBoolean()){if(r.readBoolean()){_=r.readUnsignedByte();switch(_){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[r.readUnsignedByte()<<8|r.readUnsignedByte(),r.readUnsignedByte()<<8|r.readUnsignedByte()];break}}if(y){y[0]/y[1]}}}return{profileIdc:a,levelIdc:l,profileCompatibility:u,width:(f+1)*16-t*2-i*2,height:(2-m)*(p+1)*16-s*2-n*2,sarRatio:y}}};qt.prototype=new Vt;var Gt={H264Stream:qt,NalByteStream:Ht};var Kt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var zt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],s=e[t+5],n=(s&16)>>4;i=i>=0?i:0;if(n){return i+20}return i+10};var Yt=function(e,t){if(e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)){return t}t+=zt(e,t);return Yt(e,t)};var Xt=function(e){var t=Yt(e,0);return e.length>=t+2&&(e[t]&255)===255&&(e[t+1]&240)===240&&(e[t+1]&22)===16};var Qt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};var Jt=function(e,t,i){var s,n="";for(s=t;s<i;s++){n+="%"+("00"+e[s].toString(16)).slice(-2)}return n};var Zt=function(e,t,i){return unescape(Jt(e,t,i))};var ei=function(e,t){var i=(e[t+5]&224)>>5,s=e[t+4]<<3,n=e[t+3]&3<<11;return n|s|i};var ti=function(e,t){if(e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(e[t]&255===255&&(e[t+1]&240)===240){return"audio"}return null};var ii=function(e){var t=0;while(t+5<e.length){if(e[t]!==255||(e[t+1]&246)!==240){t++;continue}return Kt[(e[t+2]&60)>>>2]}return null};var si=function(e){var t,i,s,n;t=10;if(e[5]&64){t+=4;t+=Qt(e.subarray(10,14))}do{i=Qt(e.subarray(t+4,t+8));if(i<1){return null}n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(n==="PRIV"){s=e.subarray(t+10,t+i+10);for(var r=0;r<s.byteLength;r++){if(s[r]===0){var a=Zt(s,0,r);if(a==="com.apple.streaming.transportStreamTimestamp"){var o=s.subarray(r+1);var l=(o[3]&1)<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;l*=4;l+=o[7]&3;return l}break}}}t+=10;t+=i}while(t<e.byteLength);return null};var ni={isLikelyAacData:Xt,parseId3TagSize:zt,parseAdtsSize:ei,parseType:ti,parseSampleRate:ii,parseAacTimestamp:si};var ri=s;var ai=ni;var oi;oi=function(){var e=new Uint8Array,t=0;oi.prototype.init.call(this);this.setTimestamp=function(e){t=e};this.push=function(i){var s=0,n=0,r,a,o,l;if(e.length){l=e.length;e=new Uint8Array(i.byteLength+l);e.set(e.subarray(0,l));e.set(i,l)}else{e=i}while(e.length-n>=3){if(e[n]==="I".charCodeAt(0)&&e[n+1]==="D".charCodeAt(0)&&e[n+2]==="3".charCodeAt(0)){if(e.length-n<10){break}s=ai.parseId3TagSize(e,n);if(n+s>e.length){break}a={type:"timed-metadata",data:e.subarray(n,n+s)};this.trigger("data",a);n+=s;continue}else if((e[n]&255)===255&&(e[n+1]&240)===240){if(e.length-n<7){break}s=ai.parseAdtsSize(e,n);if(n+s>e.length){break}o={type:"audio",data:e.subarray(n,n+s),pts:t,dts:t};this.trigger("data",o);n+=s;continue}n++}r=e.length-n;if(r>0){e=e.subarray(n)}else{e=new Uint8Array}};this.reset=function(){e=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){e=new Uint8Array;this.trigger("endedtimeline")}};oi.prototype=new ri;var li=oi;var ui=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var ci=ui;var di=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var hi=di;var fi=s;var pi=H;var mi=ee;var gi=Ee;var yi=Ae;var _i=Lt;var vi=me;var bi=Bt;var Ti=Gt.H264Stream;var Si=li;var Ei=ni.isLikelyAacData;var Ii=me.ONE_SECOND_IN_TS;var ki=ci;var Ci=hi;var wi,Ai,Oi,Di;var Pi=function(e,t){t.stream=e;this.trigger("log",t)};var xi=function(e,t){var i=Object.keys(t);for(var s=0;s<i.length;s++){var n=i[s];if(n==="headOfPipeline"||!t[n].on){continue}t[n].on("log",Pi.bind(e,n))}};var Li=function(e,t){var i;if(e.length!==t.length){return false}for(i=0;i<e.length;i++){if(e[i]!==t[i]){return false}}return true};var Ri=function(e,t,i,s,n,r){var a=i-t,o=s-t,l=n-i;return{start:{dts:e,pts:e+a},end:{dts:e+o,pts:e+l},prependedContentDuration:r,baseMediaDecodeTime:e}};Ai=function(e,t){var i=[],s,n=0,r=0,a=Infinity;t=t||{};s=t.firstSequenceNumber||0;Ai.prototype.init.call(this);this.push=function(t){yi.collectDtsInfo(e,t);if(e){ki.forEach(function(i){e[i]=t[i]})}i.push(t)};this.setEarliestDts=function(e){n=e};this.setVideoBaseMediaDecodeTime=function(e){a=e};this.setAudioAppendStart=function(e){r=e};this.flush=function(){var o,l,u,c,d,h,f;if(i.length===0){this.trigger("done","AudioSegmentStream");return}o=gi.trimAdtsFramesByEarliestDts(i,e,n);e.baseMediaDecodeTime=yi.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps);f=gi.prefixWithSilence(e,o,r,a);e.samples=gi.generateSampleTable(o);u=pi.mdat(gi.concatenateFrameData(o));i=[];l=pi.moof(s,[e]);c=new Uint8Array(l.byteLength+u.byteLength);s++;c.set(l);c.set(u,l.byteLength);yi.clearDtsInfo(e);d=Math.ceil(Ii*1024/e.samplerate);if(o.length){h=o.length*d;this.trigger("segmentTimingInfo",Ri(vi.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,f||0));this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})}this.trigger("data",{track:e,boxes:c});this.trigger("done","AudioSegmentStream")};this.reset=function(){yi.clearDtsInfo(e);i=[];this.trigger("reset")}};Ai.prototype=new fi;wi=function(e,t){var i,s=[],n=[],r,a;t=t||{};i=t.firstSequenceNumber||0;wi.prototype.init.call(this);delete e.minPTS;this.gopCache_=[];this.push=function(t){yi.collectDtsInfo(e,t);if(t.nalUnitType==="seq_parameter_set_rbsp"&&!r){r=t.config;e.sps=[t.data];Ci.forEach(function(t){e[t]=r[t]},this)}if(t.nalUnitType==="pic_parameter_set_rbsp"&&!a){a=t.data;e.pps=[t.data]}s.push(t)};this.flush=function(){var r,a,o,l,u,c,d=0,h,f;while(s.length){if(s[0].nalUnitType==="access_unit_delimiter_rbsp"){break}s.shift()}if(s.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}r=mi.groupNalsIntoFrames(s);o=mi.groupFramesIntoGops(r);if(!o[0][0].keyFrame){a=this.getGopForFusion_(s[0],e);if(a){d=a.duration;o.unshift(a);o.byteLength+=a.byteLength;o.nalCount+=a.nalCount;o.pts=a.pts;o.dts=a.dts;o.duration+=a.duration}else{o=mi.extendFirstKeyFrame(o)}}if(n.length){var p;if(t.alignGopsAtEnd){p=this.alignGopsAtEnd_(o)}else{p=this.alignGopsAtStart_(o)}if(!p){this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}yi.clearDtsInfo(e);o=p}yi.collectDtsInfo(e,o);e.samples=mi.generateSampleTable(o);u=pi.mdat(mi.concatenateNalData(o));e.baseMediaDecodeTime=yi.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps);this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}));h=o[0];f=o[o.length-1];this.trigger("segmentTimingInfo",Ri(e.baseMediaDecodeTime,h.dts,h.pts,f.dts+f.duration,f.pts+f.duration,d));this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration});this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime);this.trigger("timelineStartInfo",e.timelineStartInfo);l=pi.moof(i,[e]);c=new Uint8Array(l.byteLength+u.byteLength);i++;c.set(l);c.set(u,l.byteLength);this.trigger("data",{track:e,boxes:c});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();s=[];this.gopCache_.length=0;n.length=0;this.trigger("reset")};this.resetStream_=function(){yi.clearDtsInfo(e);r=undefined;a=undefined};this.getGopForFusion_=function(t){var i=45e3,s=1e4,n=Infinity,r,a,o,l,u;for(u=0;u<this.gopCache_.length;u++){l=this.gopCache_[u];o=l.gop;if(!(e.pps&&Li(e.pps[0],l.pps[0]))||!(e.sps&&Li(e.sps[0],l.sps[0]))){continue}if(o.dts<e.timelineStartInfo.dts){continue}r=t.dts-o.dts-o.duration;if(r>=-s&&r<=i){if(!a||n>r){a=l;n=r}}}if(a){return a.gop}return null};this.alignGopsAtStart_=function(e){var t,i,s,r,a,o,l,u;a=e.byteLength;o=e.nalCount;l=e.duration;t=i=0;while(t<n.length&&i<e.length){s=n[t];r=e[i];if(s.pts===r.pts){break}if(r.pts>s.pts){t++;continue}i++;a-=r.byteLength;o-=r.nalCount;l-=r.duration}if(i===0){return e}if(i===e.length){return null}u=e.slice(i);u.byteLength=a;u.duration=l;u.nalCount=o;u.pts=u[0].pts;u.dts=u[0].dts;return u};this.alignGopsAtEnd_=function(e){var t,i,s,r,a,o;t=n.length-1;i=e.length-1;a=null;o=false;while(t>=0&&i>=0){s=n[t];r=e[i];if(s.pts===r.pts){o=true;break}if(s.pts>r.pts){t--;continue}if(t===n.length-1){a=i}i--}if(!o&&a===null){return null}var l;if(o){l=i}else{l=a}if(l===0){return e}var u=e.slice(l);var c=u.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});u.byteLength=c.byteLength;u.duration=c.duration;u.nalCount=c.nalCount;u.pts=u[0].pts;u.dts=u[0].dts;return u};this.alignGopsWith=function(e){n=e}};wi.prototype=new fi;Di=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if(typeof e.remux!=="undefined"){this.remuxTracks=!!e.remux}else{this.remuxTracks=true}if(typeof e.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Di.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if(e.track.type==="audio"){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};Di.prototype=new fi;Di.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,a=0,o;if(this.pendingTracks.length<this.numberOfTracks){if(e!=="VideoSegmentStream"&&e!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){a=this.videoTrack.timelineStartInfo.pts;Ci.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){a=this.audioTrack.timelineStartInfo.pts;ki.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=pi.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(o=0;o<this.pendingBoxes.length;o++){i.data.set(this.pendingBoxes[o],t);t+=this.pendingBoxes[o].byteLength}for(o=0;o<this.pendingCaptions.length;o++){s=this.pendingCaptions[o];s.startTime=vi.metadataTsToSeconds(s.startPts,a,this.keepOriginalTimestamps);s.endTime=vi.metadataTsToSeconds(s.endPts,a,this.keepOriginalTimestamps);i.captionStreams[s.stream]=true;i.captions.push(s)}for(o=0;o<this.pendingMetadata.length;o++){n=this.pendingMetadata[o];n.cueTime=vi.metadataTsToSeconds(n.pts,a,this.keepOriginalTimestamps);i.metadata.push(n)}i.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",i);for(o=0;o<i.captions.length;o++){s=i.captions[o];this.trigger("caption",s)}for(o=0;o<i.metadata.length;o++){n=i.metadata[o];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Di.prototype.setRemux=function(e){this.remuxTracks=e};Oi=function(e){var t=this,i=true,s,n;Oi.prototype.init.call(this);e=e||{};this.baseMediaDecodeTime=e.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="aac";i.metadataStream=new _i.MetadataStream;i.aacStream=new Si;i.audioTimestampRolloverStream=new _i.TimestampRolloverStream("audio");i.timedMetadataTimestampRolloverStream=new _i.TimestampRolloverStream("timed-metadata");i.adtsStream=new bi;i.coalesceStream=new Di(e,i.metadataStream);i.headOfPipeline=i.aacStream;i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream);i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream);i.metadataStream.on("timestamp",function(e){i.aacStream.setTimestamp(e.timeStamp)});i.aacStream.on("data",function(r){if(r.type!=="timed-metadata"&&r.type!=="audio"||i.audioSegmentStream){return}n=n||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"};i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ai(n,e);i.audioSegmentStream.on("log",t.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream);t.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})});i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));xi(this,i)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new _i.MetadataStream;i.packetStream=new _i.TransportPacketStream;i.parseStream=new _i.TransportParseStream;i.elementaryStream=new _i.ElementaryStream;i.timestampRolloverStream=new _i.TimestampRolloverStream;i.adtsStream=new bi;i.h264Stream=new Ti;i.captionStream=new _i.CaptionStream(e);i.coalesceStream=new Di(e,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",function(r){var a;if(r.type==="metadata"){a=r.tracks.length;while(a--){if(!s&&r.tracks[a].type==="video"){s=r.tracks[a];s.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}else if(!n&&r.tracks[a].type==="audio"){n=r.tracks[a];n.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}}if(s&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new wi(s,e);i.videoSegmentStream.on("log",t.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",function(s){if(n&&!e.keepOriginalTimestamps){n.timelineStartInfo=s;i.audioSegmentStream.setEarliestDts(s.dts-t.baseMediaDecodeTime)}});i.videoSegmentStream.on("processedGopsInfo",t.trigger.bind(t,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",t.trigger.bind(t,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(n){i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});i.videoSegmentStream.on("timingInfo",t.trigger.bind(t,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(n&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ai(n,e);i.audioSegmentStream.on("log",t.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",t.trigger.bind(t,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}});i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",function(e){e.dispatchType=i.metadataStream.dispatchType;t.trigger("id3Frame",e)});i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));xi(this,i)};this.setBaseMediaDecodeTime=function(t){var i=this.transmuxPipeline_;if(!e.keepOriginalTimestamps){this.baseMediaDecodeTime=t}if(n){n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;yi.clearDtsInfo(n);if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(s){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[]}s.timelineStartInfo.dts=undefined;s.timelineStartInfo.pts=undefined;yi.clearDtsInfo(s);i.captionStream.reset()}if(i.timestampRolloverStream){i.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(n){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t;if(i&&i.coalesceStream){i.coalesceStream.setRemux(t)}};this.alignGopsWith=function(e){if(s&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e;t.trigger("log",i)}};this.push=function(e){if(i){var t=Ei(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Oi.prototype=new fi;var Ni={Transmuxer:Oi,VideoSegmentStream:wi,AudioSegmentStream:Ai,AUDIO_PROPERTIES:ki,VIDEO_PROPERTIES:Ci,generateSegmentTimingInfo:Ri};var Mi=function(e){return e>>>0};var Ui=function(e){return("00"+e.toString(16)).slice(-2)};var Bi={toUnsigned:Mi,toHexString:Ui};var Fi=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t};var ji=Fi;var Vi=Bi.toUnsigned;var $i=ji;var qi=function(e,t){var i=[],s,n,r,a,o;if(!t.length){return null}for(s=0;s<e.byteLength;){n=Vi(e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]);r=$i(e.subarray(s+4,s+8));a=n>1?s+n:e.byteLength;if(r===t[0]){if(t.length===1){i.push(e.subarray(s+8,a))}else{o=qi(e.subarray(s+8,a),t.slice(1));if(o.length){i=i.concat(o)}}}s=a}return i};var Hi=qi;var Wi=Bi.toUnsigned;var Gi=a.getUint64;var Ki=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};if(t.version===1){t.baseMediaDecodeTime=Gi(e.subarray(4))}else{t.baseMediaDecodeTime=Wi(e[4]<<24|e[5]<<16|e[6]<<8|e[7])}return t};var zi=Ki;var Yi=function(e){return{isLeading:(e[0]&12)>>>2,dependsOn:e[0]&3,isDependedOn:(e[1]&192)>>>6,hasRedundancy:(e[1]&48)>>>4,paddingValue:(e[1]&14)>>>1,isNonSyncSample:e[1]&1,degradationPriority:e[2]<<8|e[3]}};var Xi=Yi;var Qi=Xi;var Ji=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t.flags[2]&1,n=t.flags[2]&4,r=t.flags[1]&1,a=t.flags[1]&2,o=t.flags[1]&4,l=t.flags[1]&8,u=i.getUint32(4),c=8,d;if(s){t.dataOffset=i.getInt32(c);c+=4}if(n&&u){d={flags:Qi(e.subarray(c,c+4))};c+=4;if(r){d.duration=i.getUint32(c);c+=4}if(a){d.size=i.getUint32(c);c+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(c)}else{d.compositionTimeOffset=i.getUint32(c)}c+=4}t.samples.push(d);u--}while(u--){d={};if(r){d.duration=i.getUint32(c);c+=4}if(a){d.size=i.getUint32(c);c+=4}if(o){d.flags=Qi(e.subarray(c,c+4));c+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(c)}else{d.compositionTimeOffset=i.getUint32(c)}c+=4}t.samples.push(d)}return t};var Zi=Ji;var es=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,a=i.flags[2]&16,o=i.flags[2]&32,l=i.flags[0]&65536,u=i.flags[0]&131072,c;c=8;if(s){c+=4;i.baseDataOffset=t.getUint32(12);c+=4}if(n){i.sampleDescriptionIndex=t.getUint32(c);c+=4}if(r){i.defaultSampleDuration=t.getUint32(c);c+=4}if(a){i.defaultSampleSize=t.getUint32(c);c+=4}if(o){i.defaultSampleFlags=t.getUint32(c)}if(l){i.durationIsEmpty=true}if(!s&&u){i.baseDataOffsetIsMoof=true}return i};var ts=es;var is;if(typeof e!=="undefined"){is=e}else if(typeof t!=="undefined"){is=t}else if(typeof self!=="undefined"){is=self}else{is={}}var ss=is;var ns=Ne.discardEmulationPreventionBytes;var rs=Qe.CaptionStream;var as=Hi;var os=zi;var ls=Zi;var us=ts;var cs=ss;var ds=function(e,t){var i=e;for(var s=0;s<t.length;s++){var n=t[s];if(i<n.size){return n}i-=n.size}return null};var hs=function(e,t,i){var s=new DataView(e.buffer,e.byteOffset,e.byteLength),n={logs:[],seiNals:[]},r,a,o,l;for(a=0;a+4<e.length;a+=o){o=s.getUint32(a);a+=4;if(o<=0){continue}switch(e[a]&31){case 6:var u=e.subarray(a+1,a+1+o);var c=ds(a,t);r={nalUnitType:"sei_rbsp",size:o,data:u,escapedRBSP:ns(u),trackId:i};if(c){r.pts=c.pts;r.dts=c.dts;l=c}else if(l){r.pts=l.pts;r.dts=l.dts}else{n.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+a+" for trackId "+i+". See mux.js#223."});break}n.seiNals.push(r);break}}return n};var fs=function(e,t,i){var s=t;var n=i.defaultSampleDuration||0;var r=i.defaultSampleSize||0;var a=i.trackId;var o=[];e.forEach(function(e){var t=ls(e);var i=t.samples;i.forEach(function(e){if(e.duration===undefined){e.duration=n}if(e.size===undefined){e.size=r}e.trackId=a;e.dts=s;if(e.compositionTimeOffset===undefined){e.compositionTimeOffset=0}if(typeof s==="bigint"){e.pts=s+cs.BigInt(e.compositionTimeOffset);s+=cs.BigInt(e.duration)}else{e.pts=s+e.compositionTimeOffset;s+=e.duration}});o=o.concat(i)});return o};var ps=function(e,t){var i=as(e,["moof","traf"]);var s=as(e,["mdat"]);var n={};var r=[];s.forEach(function(e,t){var s=i[t];r.push({mdat:e,traf:s})});r.forEach(function(e){var i=e.mdat;var s=e.traf;var r=as(s,["tfhd"]);var a=us(r[0]);var o=a.trackId;var l=as(s,["tfdt"]);var u=l.length>0?os(l[0]).baseMediaDecodeTime:0;var c=as(s,["trun"]);var d;var h;if(t===o&&c.length>0){d=fs(c,u,a);h=hs(i,d,o);if(!n[o]){n[o]={seiNals:[],logs:[]}}n[o].seiNals=n[o].seiNals.concat(h.seiNals);n[o].logs=n[o].logs.concat(h.logs)}});return n};var ms=function(e,t,i){var s;if(t===null){return null}s=ps(e,t);var n=s[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var gs=function(){var e=false;var t;var i;var s;var n;var r;var a;this.isInitialized=function(){return e};this.init=function(i){t=new rs;e=true;a=i?i.isPartial:false;t.on("data",function(e){e.startTime=e.startPts/n;e.endTime=e.endPts/n;r.captions.push(e);r.captionStreams[e.stream]=true});t.on("log",function(e){r.logs.push(e)})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return s!==e[0]||n!==t[s]};this.parse=function(e,t,a){var o;if(!this.isInitialized()){return null}else if(!t||!a){return null}else if(this.isNewInit(t,a)){s=t[0];n=a[s]}else if(s===null||!n){i.push(e);return null}while(i.length>0){var l=i.shift();this.parse(l,t,a)}o=ms(e,s,n);if(o&&o.logs){r.logs=r.logs.concat(o.logs)}if(o===null||!o.seiNals){if(r.logs.length){return{logs:r.logs,captions:[],captionStreams:[]}}return null}this.pushNals(o.seiNals);this.flushStream();return r};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){t.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}if(!a){t.flush()}else{t.partialFlush()}};this.clearParsedCaptions=function(){r.captions=[];r.captionStreams={};r.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}t.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){i=[];s=null;n=null;if(!r){r={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var ys=gs;var _s=function(e){var t=0;var i=String.fromCharCode(e[t]);var s="";while(i!=="\0"){s+=i;t++;i=String.fromCharCode(e[t])}s+=i;return s};var vs={uint8ToCString:_s};var bs=vs.uint8ToCString;var Ts=a.getUint64;var Ss=function(e){var t=4;var i=e[0];var s,n,r,a,o,l,u,c;if(i===0){s=bs(e.subarray(t));t+=s.length;n=bs(e.subarray(t));t+=n.length;var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;o=d.getUint32(t);t+=4;l=d.getUint32(t);t+=4;u=d.getUint32(t);t+=4}else if(i===1){var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;a=Ts(e.subarray(t));t+=8;l=d.getUint32(t);t+=4;u=d.getUint32(t);t+=4;s=bs(e.subarray(t));t+=s.length;n=bs(e.subarray(t));t+=n.length}c=new Uint8Array(e.subarray(t,e.byteLength));var h={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:a,presentation_time_delta:o,event_duration:l,id:u,message_data:c};return Is(i,h)?h:undefined};var Es=function(e,t,i,s){return e||e===0?e/t:s+i/t};var Is=function(e,t){var i=t.scheme_id_uri!=="\0";var s=e===0&&ks(t.presentation_time_delta)&&i;var n=e===1&&ks(t.presentation_time)&&i;return!(e>1)&&s||n};var ks=function(e){return e!==undefined||e!==null};var Cs={parseEmsgBox:Ss,scaleTime:Es};var ws=Bi.toUnsigned;var As=Bi.toHexString;var Os=Hi;var Ds=ji;var Ps=Cs;var xs=ts;var Ls=Zi;var Rs=zi;var Ns=a.getUint64;var Ms,Us,Bs,Fs,js,Vs,$s;var qs=ss;var Hs=gt.parseId3Frames;Ms=function(e){var t={},i=Os(e,["moov","trak"]);return i.reduce(function(e,t){var i,s,n,r,a;i=Os(t,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=ws(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);a=Os(t,["mdia","mdhd"])[0];if(!a){return null}s=a[0];n=s===0?12:20;e[r]=ws(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]);return e},t)};Us=function(e,t){var i;i=Os(t,["moof","traf"]);var s=i.reduce(function(t,i){var s=Os(i,["tfhd"])[0];var n=ws(s[4]<<24|s[5]<<16|s[6]<<8|s[7]);var r=e[n]||9e4;var a=Os(i,["tfdt"])[0];var o=new DataView(a.buffer,a.byteOffset,a.byteLength);var l;if(a[0]===1){l=Ns(a.subarray(4,12))}else{l=o.getUint32(4)}let u;if(typeof l==="bigint"){u=l/qs.BigInt(r)}else if(typeof l==="number"&&!isNaN(l)){u=l/r}if(u<Number.MAX_SAFE_INTEGER){u=Number(u)}if(u<t){t=u}return t},Infinity);return typeof s==="bigint"||isFinite(s)?s:0};Bs=function(e,t){var i=Os(t,["moof","traf"]);var s=0;var n=0;var r;if(i&&i.length){var a=Os(i[0],["tfhd"])[0];var o=Os(i[0],["trun"])[0];var l=Os(i[0],["tfdt"])[0];if(a){var u=xs(a);r=u.trackId}if(l){var c=Rs(l);s=c.baseMediaDecodeTime}if(o){var d=Ls(o);if(d.samples&&d.samples.length){n=d.samples[0].compositionTimeOffset||0}}}var h=e[r]||9e4;if(typeof s==="bigint"){n=qs.BigInt(n);h=qs.BigInt(h)}var f=(s+n)/h;if(typeof f==="bigint"&&f<Number.MAX_SAFE_INTEGER){f=Number(f)}return f};Fs=function(e){var t=Os(e,["moov","trak"]);var i=[];t.forEach(function(e){var t=Os(e,["mdia","hdlr"]);var s=Os(e,["tkhd"]);t.forEach(function(e,t){var n=Ds(e.subarray(8,12));var r=s[t];var a;var o;var l;if(n==="vide"){a=new DataView(r.buffer,r.byteOffset,r.byteLength);o=a.getUint8(0);l=o===0?a.getUint32(12):a.getUint32(20);i.push(l)}})});return i};Vs=function(e){var t=e[0];var i=t===0?12:20;return ws(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])};js=function(e){var t=Os(e,["moov","trak"]);var i=[];t.forEach(function(e){var t={};var s=Os(e,["tkhd"])[0];var n,r;if(s){n=new DataView(s.buffer,s.byteOffset,s.byteLength);r=n.getUint8(0);t.id=r===0?n.getUint32(12):n.getUint32(20)}var a=Os(e,["mdia","hdlr"])[0];if(a){var o=Ds(a.subarray(8,12));if(o==="vide"){t.type="video"}else if(o==="soun"){t.type="audio"}else{t.type=o}}var l=Os(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);t.codec=Ds(u.subarray(4,8));var c=Os(u,[t.codec])[0];var d,h;if(c){if(/^[asm]vc[1-9]$/i.test(t.codec)){d=c.subarray(78);h=Ds(d.subarray(4,8));if(h==="avcC"&&d.length>11){t.codec+=".";t.codec+=As(d[9]);t.codec+=As(d[10]);t.codec+=As(d[11])}else{t.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(t.codec)){d=c.subarray(28);h=Ds(d.subarray(4,8));if(h==="esds"&&d.length>20&&d[19]!==0){t.codec+="."+As(d[19]);t.codec+="."+As(d[20]>>>2&63).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}else{t.codec=t.codec.toLowerCase()}}}var f=Os(e,["mdia","mdhd"])[0];if(f){t.timescale=Vs(f)}i.push(t)});return i};$s=function(e,t=0){var i=Os(e,["emsg"]);return i.map(e=>{var i=Ps.parseEmsgBox(new Uint8Array(e));var s=Hs(i.message_data);return{cueTime:Ps.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:Ps.scaleTime(i.event_duration,i.timescale),frames:s}})};var Ws={findBox:Os,parseType:Ds,timescale:Ms,startTime:Us,compositionStartTime:Bs,videoTrackIds:Fs,tracks:js,getTimescaleFromMediaHeader:Vs,getEmsgID3:$s};var Gs=Je;var Ks=function(e){var t=e[1]&31;t<<=8;t|=e[2];return t};var zs=function(e){return!!(e[1]&64)};var Ys=function(e){var t=0;if((e[3]&48)>>>4>1){t+=e[4]+1}return t};var Xs=function(e,t){var i=Ks(e);if(i===0){return"pat"}else if(i===t){return"pmt"}else if(t){return"pes"}return null};var Qs=function(e){var t=zs(e);var i=4+Ys(e);if(t){i+=e[i]+1}return(e[i+10]&31)<<8|e[i+11]};var Js=function(e){var t={};var i=zs(e);var s=4+Ys(e);if(i){s+=e[s]+1}if(!(e[s+5]&1)){return}var n,r,a;n=(e[s+1]&15)<<8|e[s+2];r=3+n-4;a=(e[s+10]&15)<<8|e[s+11];var o=12+a;while(o<r){var l=s+o;t[(e[l+1]&31)<<8|e[l+2]]=e[l];o+=((e[l+3]&15)<<8|e[l+4])+5}return t};var Zs=function(e,t){var i=Ks(e);var s=t[i];switch(s){case Gs.H264_STREAM_TYPE:return"video";case Gs.ADTS_STREAM_TYPE:return"audio";case Gs.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var en=function(e){var t=zs(e);if(!t){return null}var i=4+Ys(e);if(i>=e.byteLength){return null}var s=null;var n;n=e[i+7];if(n&192){s={};s.pts=(e[i+9]&14)<<27|(e[i+10]&255)<<20|(e[i+11]&254)<<12|(e[i+12]&255)<<5|(e[i+13]&254)>>>3;s.pts*=4;s.pts+=(e[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(e[i+14]&14)<<27|(e[i+15]&255)<<20|(e[i+16]&254)<<12|(e[i+17]&255)<<5|(e[i+18]&254)>>>3;s.dts*=4;s.dts+=(e[i+18]&6)>>>1}}return s};var tn=function(e){switch(e){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}};var sn=function(e){var t=4+Ys(e);var i=e.subarray(t);var s=0;var n=0;var r=false;var a;for(;n<i.byteLength-3;n++){if(i[n+2]===1){s=n+5;break}}while(s<i.byteLength){switch(i[s]){case 0:if(i[s-1]!==0){s+=2;break}else if(i[s-2]!==0){s++;break}if(n+3!==s-2){a=tn(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}do{s++}while(i[s]!==1&&s<i.length);n=s-2;s+=3;break;case 1:if(i[s-1]!==0||i[s-2]!==0){s+=3;break}a=tn(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}n=s-2;s+=3;break;default:s+=3;break}}i=i.subarray(n);s-=n;n=0;if(i&&i.byteLength>3){a=tn(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var nn={parseType:Xs,parsePat:Qs,parsePmt:Js,parsePayloadUnitStartIndicator:zs,parsePesType:Zs,parsePesTime:en,videoPacketContainsKeyFrame:sn};var rn=Je;var an=rt.handleRollover;var on={};on.ts=nn;on.aac=ni;var ln=me.ONE_SECOND_IN_TS;var un=188,cn=71;var dn=function(e,t){var i=0,s=un,n,r;while(s<e.byteLength){if(e[i]===cn&&e[s]===cn){n=e.subarray(i,s);r=on.ts.parseType(n,t.pid);switch(r){case"pat":t.pid=on.ts.parsePat(n);break;case"pmt":var a=on.ts.parsePmt(n);t.table=t.table||{};Object.keys(a).forEach(function(e){t.table[e]=a[e]});break}i+=un;s+=un;continue}i++;s++}};var hn=function(e,t,i){var s=0,n=un,r,a,o,l,u;var c=false;while(n<=e.byteLength){if(e[s]===cn&&(e[n]===cn||n===e.byteLength)){r=e.subarray(s,n);a=on.ts.parseType(r,t.pid);switch(a){case"pes":o=on.ts.parsePesType(r,t.table);l=on.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){u=on.ts.parsePesTime(r);if(u){u.type="audio";i.audio.push(u);c=true}}break}if(c){break}s+=un;n+=un;continue}s++;n++}n=e.byteLength;s=n-un;c=false;while(s>=0){if(e[s]===cn&&(e[n]===cn||n===e.byteLength)){r=e.subarray(s,n);a=on.ts.parseType(r,t.pid);switch(a){case"pes":o=on.ts.parsePesType(r,t.table);l=on.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){u=on.ts.parsePesTime(r);if(u){u.type="audio";i.audio.push(u);c=true}}break}if(c){break}s-=un;n-=un;continue}s--;n--}};var fn=function(e,t,i){var s=0,n=un,r,a,o,l,u,c,d,h;var f=false;var p={data:[],size:0};while(n<e.byteLength){if(e[s]===cn&&e[n]===cn){r=e.subarray(s,n);a=on.ts.parseType(r,t.pid);switch(a){case"pes":o=on.ts.parsePesType(r,t.table);l=on.ts.parsePayloadUnitStartIndicator(r);if(o==="video"){if(l&&!f){u=on.ts.parsePesTime(r);if(u){u.type="video";i.video.push(u);f=true}}if(!i.firstKeyFrame){if(l){if(p.size!==0){c=new Uint8Array(p.size);d=0;while(p.data.length){h=p.data.shift();c.set(h,d);d+=h.byteLength}if(on.ts.videoPacketContainsKeyFrame(c)){var m=on.ts.parsePesTime(c);if(m){i.firstKeyFrame=m;i.firstKeyFrame.type="video"}else{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.")}}p.size=0}}p.data.push(r);p.size+=r.byteLength}}break}if(f&&i.firstKeyFrame){break}s+=un;n+=un;continue}s++;n++}n=e.byteLength;s=n-un;f=false;while(s>=0){if(e[s]===cn&&e[n]===cn){r=e.subarray(s,n);a=on.ts.parseType(r,t.pid);switch(a){case"pes":o=on.ts.parsePesType(r,t.table);l=on.ts.parsePayloadUnitStartIndicator(r);if(o==="video"&&l){u=on.ts.parsePesTime(r);if(u){u.type="video";i.video.push(u);f=true}}break}if(f){break}s-=un;n-=un;continue}s--;n--}};var pn=function(e,t){if(e.audio&&e.audio.length){var i=t;if(typeof i==="undefined"||isNaN(i)){i=e.audio[0].dts}e.audio.forEach(function(e){e.dts=an(e.dts,i);e.pts=an(e.pts,i);e.dtsTime=e.dts/ln;e.ptsTime=e.pts/ln})}if(e.video&&e.video.length){var s=t;if(typeof s==="undefined"||isNaN(s)){s=e.video[0].dts}e.video.forEach(function(e){e.dts=an(e.dts,s);e.pts=an(e.pts,s);e.dtsTime=e.dts/ln;e.ptsTime=e.pts/ln});if(e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=an(n.dts,s);n.pts=an(n.pts,s);n.dtsTime=n.dts/ln;n.ptsTime=n.pts/ln}}};var mn=function(e){var t=false,i=0,s=null,n=null,r=0,a=0,o;while(e.length-a>=3){var l=on.aac.parseType(e,a);switch(l){case"timed-metadata":if(e.length-a<10){t=true;break}r=on.aac.parseId3TagSize(e,a);if(r>e.length){t=true;break}if(n===null){o=e.subarray(a,a+r);n=on.aac.parseAacTimestamp(o)}a+=r;break;case"audio":if(e.length-a<7){t=true;break}r=on.aac.parseAdtsSize(e,a);if(r>e.length){t=true;break}if(s===null){o=e.subarray(a,a+r);s=on.aac.parseSampleRate(o)}i++;a+=r;break;default:a++;break}if(t){return null}}if(s===null||n===null){return null}var u=ln/s;var c={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*u,pts:n+i*1024*u}]};return c};var gn=function(e){var t={pid:null,table:null};var i={};dn(e,t);for(var s in t.table){if(t.table.hasOwnProperty(s)){var n=t.table[s];switch(n){case rn.H264_STREAM_TYPE:i.video=[];fn(e,t,i);if(i.video.length===0){delete i.video}break;case rn.ADTS_STREAM_TYPE:i.audio=[];hn(e,t,i);if(i.audio.length===0){delete i.audio}break}}}return i};var yn=function(e,t){var i=on.aac.isLikelyAacData(e);var s;if(i){s=mn(e)}else{s=gn(e)}if(!s||!s.audio&&!s.video){return null}pn(s,t);return s};var _n={inspect:yn,parseAudioPes_:hn};const vn=function(e,t){t.on("data",function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=t.data;t.data=s.buffer;e.postMessage({action:"data",segment:t,byteOffset:s.byteOffset,byteLength:s.byteLength},[t.data])});t.on("done",function(t){e.postMessage({action:"done"})});t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})});t.on("videoSegmentTimingInfo",function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};if(t.prependedContentDuration){i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)}e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})});t.on("audioSegmentTimingInfo",function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};if(t.prependedContentDuration){i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)}e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})});t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})});t.on("caption",function(t){e.postMessage({action:"caption",caption:t})});t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})});t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})});t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})});t.on("log",function(t){e.postMessage({action:"log",log:t})})};class bn{constructor(e,t){this.options=t||{};this.self=e;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Ni.Transmuxer(this.options);vn(this.self,this.transmuxer)}pushMp4Captions(e){if(!this.captionParser){this.captionParser=new ys;this.captionParser.init()}const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);const i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Ws.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Ws.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Ws.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i=typeof t==="number"&&!isNaN(t)?t*me.ONE_SECOND_IN_TS:void 0;const s=_n.inspect(e,i);let n=null;if(s){n={hasVideo:s.video&&s.video.length===2||false,hasAudio:s.audio&&s.audio.length===2||false};if(n.hasVideo){n.videoStart=s.video[0].ptsTime}if(n.hasAudio){n.audioStart=s.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:n,data:e},[e.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(me.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(me.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if(e.data.action==="init"&&e.data.options){this.messageHandlers=new bn(self,e.data.options);return}if(!this.messageHandlers){this.messageHandlers=new bn(self)}if(e.data&&e.data.action&&e.data.action!=="init"){if(this.messageHandlers[e.data.action]){this.messageHandlers[e.data.action](e.data)}}}}));var Js=zs(Qs);const Zs=(e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const c=e.data.segment.boxes||{data:e.data.segment.data};const d={type:s,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof l!=="undefined"){d.videoFrameDtsTime=l}if(typeof u!=="undefined"){d.videoFramePtsTime=u}i(d)};const en=({transmuxedData:e,callback:t})=>{e.buffer=[];t(e)};const tn=(e,t)=>{t.gopInfo=e.data.gopInfo};const sn=e=>{const{transmuxer:t,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:d,onId3:h,onCaptions:f,onDone:p,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y}=e;const _={buffer:[]};let v=y;const b=i=>{if(t.currentTransmux!==e){return}if(i.data.action==="data"){Zs(i,_,a)}if(i.data.action==="trackinfo"){o(i.data.trackInfo)}if(i.data.action==="gopInfo"){tn(i,_)}if(i.data.action==="audioTimingInfo"){l(i.data.audioTimingInfo)}if(i.data.action==="videoTimingInfo"){u(i.data.videoTimingInfo)}if(i.data.action==="videoSegmentTimingInfo"){c(i.data.videoSegmentTimingInfo)}if(i.data.action==="audioSegmentTimingInfo"){d(i.data.audioSegmentTimingInfo)}if(i.data.action==="id3Frame"){h([i.data.id3Frame],i.data.id3Frame.dispatchType)}if(i.data.action==="caption"){f(i.data.caption)}if(i.data.action==="endedtimeline"){v=false;m()}if(i.data.action==="log"){g(i.data.log)}if(i.data.type!=="transmuxed"){return}if(v){return}t.onmessage=null;en({transmuxedData:_,callback:p});nn(t)};t.onmessage=b;if(s){t.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){t.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){t.postMessage({action:"setRemux",remux:r})}if(i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer;const s=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:s,byteLength:i.byteLength},[e])}if(y){t.postMessage({action:"endTimeline"})}t.postMessage({action:"flush"})};const nn=e=>{e.currentTransmux=null;if(e.transmuxQueue.length){e.currentTransmux=e.transmuxQueue.shift();if(typeof e.currentTransmux==="function"){e.currentTransmux()}else{sn(e.currentTransmux)}}};const rn=(e,t)=>{e.postMessage({action:t});nn(e)};const an=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e;rn(t,e);return}t.transmuxQueue.push(rn.bind(null,t,e))};const on=e=>{an("reset",e)};const ln=e=>{an("endTimeline",e)};const un=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e;sn(e);return}e.transmuxer.transmuxQueue.push(e)};const cn=e=>{const t=new Js;t.currentTransmux=null;t.transmuxQueue=[];const i=t.terminate;t.terminate=(()=>{t.currentTransmux=null;t.transmuxQueue.length=0;return i.call(t)});t.postMessage({action:"init",options:e});return t};var dn={reset:on,endTimeline:ln,transmux:un,createTransmuxer:cn};const hn=function(e){const t=e.transmuxer;const i=e.endAction||e.action;const s=e.callback;const n=p({},e,{endAction:null,transmuxer:null,callback:null});const r=n=>{if(n.data.action!==i){return}t.removeEventListener("message",r);if(n.data.data){n.data.data=new Uint8Array(n.data.data,e.byteOffset||0,e.byteLength||n.data.data.byteLength);if(e.data){e.data=n.data.data}}s(n.data)};t.addEventListener("message",r);if(e.data){const i=e.data instanceof ArrayBuffer;n.byteOffset=i?0:e.data.byteOffset;n.byteLength=e.data.byteLength;const s=[i?e.data:e.data.buffer];t.postMessage(n,s)}else{t.postMessage(n)}};const fn={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const pn=e=>{e.forEach(e=>{e.abort()})};const mn=e=>{return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}};const gn=e=>{const t=e.target;const i=Date.now()-t.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=e.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const yn=(e,t)=>{if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fn.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:fn.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:fn.FAILURE,xhr:t}}if(t.responseType==="arraybuffer"&&t.response.byteLength===0){return{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:fn.FAILURE,xhr:t}}return null};const _n=(e,t,i)=>(s,n)=>{const r=n.response;const a=yn(s,n);if(a){return i(a,e)}if(r.byteLength!==16){return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:fn.FAILURE,xhr:n},e)}const o=new DataView(r);const l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++){t[e].bytes=l}return i(null,e)};const vn=(e,t)=>{const i=Ds(e.map.bytes);if(i!=="mp4"){const s=e.map.resolvedUri||e.map.uri;return t({internal:true,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: ${s}`,code:fn.FAILURE})}hn({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>{e.map.bytes=s;i.forEach(function(t){e.map.tracks=e.map.tracks||{};if(e.map.tracks[t.type]){return}e.map.tracks[t.type]=t;if(typeof t.id==="number"&&t.timescale){e.map.timescales=e.map.timescales||{};e.map.timescales[t.id]=t.timescale}});return t(null)}})};const bn=({segment:e,finishProcessingFn:t})=>(i,s)=>{const n=yn(i,s);if(n){return t(n,e)}const r=new Uint8Array(s.response);if(e.map.key){e.map.encryptedBytes=r;return t(null,e)}e.map.bytes=r;vn(e,function(i){if(i){i.xhr=s;i.status=s.status;return t(i,e)}t(null,e)})};const Tn=({segment:e,finishProcessingFn:t,responseType:i})=>(s,n)=>{const r=yn(s,n);if(r){return t(r,e)}const a=i==="arraybuffer"||!n.responseText?n.response:Ws(n.responseText.substring(e.lastReachedChar||0));e.stats=mn(n);if(e.key){e.encryptedBytes=new Uint8Array(a)}else{e.bytes=new Uint8Array(a)}return t(null,e)};const Sn=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})=>{const f=e.map&&e.map.tracks||{};const p=Boolean(f.audio&&f.video);let m=s.bind(null,e,"audio","start");const g=s.bind(null,e,"audio","end");let y=s.bind(null,e,"video","start");const _=s.bind(null,e,"video","end");const v=()=>un({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:p,onData:t=>{t.type=t.type==="combined"?"video":t.type;c(e,t)},onTrackInfo:t=>{if(i){if(p){t.isMuxed=true}i(e,t)}},onAudioTimingInfo:e=>{if(m&&typeof e.start!=="undefined"){m(e.start);m=null}if(g&&typeof e.end!=="undefined"){g(e.end)}},onVideoTimingInfo:e=>{if(y&&typeof e.start!=="undefined"){y(e.start);y=null}if(_&&typeof e.end!=="undefined"){_(e.end)}},onVideoSegmentTimingInfo:e=>{n(e)},onAudioSegmentTimingInfo:e=>{r(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:h,onDone:t=>{if(!d){return}t.type=t.type==="combined"?"video":t.type;d(null,e,t)}});hn({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:s=>{e.bytes=t=s.data;const n=s.result;if(n){i(e,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:p});i=null;if(n.hasAudio&&!p){m(n.audioStart)}if(n.hasVideo){y(n.videoStart)}m=null;y=null}v()}})};const En=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})=>{let f=new Uint8Array(t);if(Ps(f)){e.isFmp4=true;const{tracks:n}=e.map;const r={isFmp4:true,hasVideo:!!n.video,hasAudio:!!n.audio};if(n.audio&&n.audio.codec&&n.audio.codec!=="enca"){r.audioCodec=n.audio.codec}if(n.video&&n.video.codec&&n.video.codec!=="encv"){r.videoCodec=n.video.codec}if(n.video&&n.audio){r.isMuxed=true}i(e,r);const l=(t,i)=>{c(e,{data:f,type:r.hasAudio&&!r.isMuxed?"audio":"video"});if(i&&i.length){a(e,i)}if(t&&t.length){o(e,t)}d(null,e,{})};hn({action:"probeMp4StartTime",timescales:e.map.timescales,data:f,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer;e.bytes=f=i;if(r.hasAudio&&!r.isMuxed){s(e,"audio","start",a)}if(r.hasVideo){s(e,"video","start",a)}hn({action:"probeEmsgID3",data:f,transmuxer:e.transmuxer,offset:a,callback:({emsgData:s,id3Frames:r})=>{t=s.buffer;e.bytes=f=s;if(!n.video||!i.byteLength||!e.transmuxer){l(undefined,r);return}hn({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:f,timescales:e.map.timescales,trackIds:[n.video.id],callback:i=>{t=i.data.buffer;e.bytes=f=i.data;i.logs.forEach(function(e){h(V(e,{stream:"mp4CaptionParser"}))});l(i.captions,r)}})}})}});return}if(!e.transmuxer){d(null,e,{});return}if(typeof e.container==="undefined"){e.container=Ds(f)}if(e.container!=="ts"&&e.container!=="aac"){i(e,{hasAudio:false,hasVideo:false});d(null,e,{});return}Sn({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})};const In=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s},n){const r=t=>{if(t.data.source===e){s.removeEventListener("message",r);const e=t.data.decrypted;n(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};s.addEventListener("message",r);let a;if(t.bytes.slice){a=t.bytes.slice()}else{a=new Uint32Array(Array.prototype.slice.call(t.bytes))}s.postMessage(gt({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])};const kn=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})=>{In({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e;En({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})})};const Cn=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})=>{let f=0;let p=false;return(m,g)=>{if(p){return}if(m){p=true;pn(e);return d(m,g)}f+=1;if(f===e.length){const f=function(){if(g.encryptedBytes){return kn({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})}En({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h})};g.endOfAllRequests=Date.now();if(g.map&&g.map.encryptedBytes&&!g.map.bytes){return In({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},t=>{g.map.bytes=t;vn(g,t=>{if(t){pn(e);return d(t,g)}f()})})}f()}}};const wn=({loadendState:e,abortFn:t})=>i=>{const s=i.target;if(s.aborted&&t&&!e.calledAbortFn){t();e.calledAbortFn=true}};const An=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>i=>{const s=i.target;if(s.aborted){return}e.stats=V(e.stats,gn(i));if(!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived){e.stats.firstBytesReceivedAt=Date.now()}return t(i,e)};const On=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g})=>{const y=[];const _=Cn({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g});if(s.key&&!s.key.bytes){const i=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){i.push(s.map.key)}const n=V(t,{uri:s.key.resolvedUri,responseType:"arraybuffer"});const r=_n(s,i,_);const a=e(n,r);y.push(a)}if(s.map&&!s.map.bytes){const i=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(i){const i=V(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"});const n=_n(s,[s.map.key],_);const r=e(i,n);y.push(r)}const n=V(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Qe(s.map)});const r=bn({segment:s,finishProcessingFn:_});const a=e(n,r);y.push(a)}const v=V(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Qe(s)});const b=Tn({segment:s,finishProcessingFn:_,responseType:v.responseType});const T=e(v,b);T.addEventListener("progress",An({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p}));y.push(T);const S={};y.forEach(e=>{e.addEventListener("loadend",wn({loadendState:S,abortFn:n}))});return()=>pn(y)};const Dn=f("CodecUtils");const Pn=function(e){const t=e.attributes||{};if(t.CODECS){return x(t.CODECS)}};const xn=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]};const Ln=(e,t)=>{if(!xn(e,t)){return true}const i=t.attributes||{};const s=e.mediaGroups.AUDIO[i.AUDIO];for(const e in s){if(!s[e].uri&&!s[e].playlists){return true}}return false};const Rn=function(e){const t={};e.forEach(({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[];t[e].push(P(`${i}${s}`))});Object.keys(t).forEach(function(e){if(t[e].length>1){Dn(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);t[e]=null;return}t[e]=t[e][0]});return t};const Nn=function(e){let t=0;if(e.audio){t++}if(e.video){t++}return t};const Mn=function(e,t){const i=t.attributes||{};const s=Rn(Pn(t)||[]);if(xn(e,t)&&!s.audio){if(!Ln(e,t)){const t=Rn(L(e,i.AUDIO)||[]);if(t.audio){s.audio=t.audio}}}return s};const Un=f("PlaylistSelector");const Bn=function(e){if(!e||!e.playlist){return}const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})};const Fn=function(t,i){if(!t){return""}const s=e.getComputedStyle(t);if(!s){return""}return s[i]};const jn=function(e,t){const i=e.slice();e.sort(function(e,s){const n=t(e,s);if(n===0){return i.indexOf(e)-i.indexOf(s)}return n})};const Vn=function(t,i){let s;let n;if(t.attributes.BANDWIDTH){s=t.attributes.BANDWIDTH}s=s||e.Number.MAX_VALUE;if(i.attributes.BANDWIDTH){n=i.attributes.BANDWIDTH}n=n||e.Number.MAX_VALUE;return s-n};const $n=function(t,i){let s;let n;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){s=t.attributes.RESOLUTION.width}s=s||e.Number.MAX_VALUE;if(i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width){n=i.attributes.RESOLUTION.width}n=n||e.Number.MAX_VALUE;if(s===n&&t.attributes.BANDWIDTH&&i.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-i.attributes.BANDWIDTH}return s-n};let qn=function(t,i,s,n,r,a){if(!t){return}const o={bandwidth:i,width:s,height:n,limitRenditionByPlayerDimensions:r};let l=t.playlists;if(Ce.isAudioOnly(t)){l=a.getAudioTrackPlaylists_();o.audioOnly=true}let u=l.map(t=>{let i;const s=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;const n=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;i=t.attributes&&t.attributes.BANDWIDTH;i=i||e.Number.MAX_VALUE;return{bandwidth:i,width:s,height:n,playlist:t}});jn(u,(e,t)=>e.bandwidth-t.bandwidth);u=u.filter(e=>!Ce.isIncompatible(e.playlist));let c=u.filter(e=>Ce.isEnabled(e.playlist));if(!c.length){c=u.filter(e=>!Ce.isDisabled(e.playlist))}const d=c.filter(e=>e.bandwidth*Hs.BANDWIDTH_VARIANCE<i);let h=d[d.length-1];const f=d.filter(e=>e.bandwidth===h.bandwidth)[0];if(r===false){const e=f||c[0]||u[0];if(e&&e.playlist){let t="sortedPlaylistReps";if(f){t="bandwidthBestRep"}if(c[0]){t="enabledPlaylistReps"}Un(`choosing ${Bn(e)} using ${t} with options`,o);return e.playlist}Un("could not choose a playlist with options",o);return null}const p=d.filter(e=>e.width&&e.height);jn(p,(e,t)=>e.width-t.width);const m=p.filter(e=>e.width===s&&e.height===n);h=m[m.length-1];const g=m.filter(e=>e.bandwidth===h.bandwidth)[0];let y;let _;let v;if(!g){y=p.filter(e=>e.width>s||e.height>n);_=y.filter(e=>e.width===y[0].width&&e.height===y[0].height);h=_[_.length-1];v=_.filter(e=>e.bandwidth===h.bandwidth)[0]}let b;if(a.leastPixelDiffSelector){const e=p.map(e=>{e.pixelDiff=Math.abs(e.width-s)+Math.abs(e.height-n);return e});jn(e,(e,t)=>{if(e.pixelDiff===t.pixelDiff){return t.bandwidth-e.bandwidth}return e.pixelDiff-t.pixelDiff});b=e[0]}const T=b||v||g||f||c[0]||u[0];if(T&&T.playlist){let e="sortedPlaylistReps";if(b){e="leastPixelDiffRep"}else if(v){e="resolutionPlusOneRep"}else if(g){e="resolutionBestRep"}else if(f){e="bandwidthBestRep"}else if(c[0]){e="enabledPlaylistReps"}Un(`choosing ${Bn(T)} using ${e} with options`,o);return T.playlist}Un("could not choose a playlist with options",o);return null};const Hn=function(){const t=this.useDevicePixelRatio?e.devicePixelRatio||1:1;return qn(this.playlists.main,this.systemBandwidth,parseInt(Fn(this.tech_.el(),"width"),10)*t,parseInt(Fn(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.playlistController_)};const Wn=function(t){let i=-1;let s=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){const n=this.useDevicePixelRatio?e.devicePixelRatio||1:1;if(i<0){i=this.systemBandwidth;s=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==s){i=t*this.systemBandwidth+(1-t)*i;s=this.systemBandwidth}return qn(this.playlists.main,i,parseInt(Fn(this.tech_.el(),"width"),10)*n,parseInt(Fn(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const Gn=function(e){const{main:t,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e;const u=t.playlists.filter(e=>!Ce.isIncompatible(e));let c=u.filter(Ce.isEnabled);if(!c.length){c=u.filter(e=>!Ce.isDisabled(e))}const d=c.filter(Ce.hasAttribute.bind(null,"BANDWIDTH"));const h=d.map(e=>{const t=l.getSyncPoint(e,n,o,i);const u=t?1:2;const c=Ce.estimateSegmentRequestTime(r,s,e);const d=c*u-a;return{playlist:e,rebufferingImpact:d}});const f=h.filter(e=>e.rebufferingImpact<=0);jn(f,(e,t)=>Vn(t.playlist,e.playlist));if(f.length){return f[0]}jn(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact);return h[0]||null};const Kn=function(){const e=this.playlists.main.playlists.filter(Ce.isEnabled);jn(e,(e,t)=>Vn(e,t));const t=e.filter(e=>!!Mn(this.playlists.main,e).video);return t[0]||null};const zn=e=>{let t=0;let i;if(e.bytes){i=new Uint8Array(e.bytes);e.segments.forEach(e=>{i.set(e,t);t+=e.byteLength})}return i};const Yn=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let s=i;if(/^cc708_/.test(i)){s="SERVICE"+i.split("_")[1]}const n=t.textTracks().getTrackById(s);if(n){e[i]=n}else{const n=t.options_.vhs&&t.options_.vhs.captionServices||{};let r=i;let a=i;let o=false;const l=n[s];if(l){r=l.label;a=l.language;o=l.default}e[i]=t.addRemoteTextTrack({kind:"captions",id:s,default:o,label:r,language:a},false).track}}};const Xn=function({inbandTextTracks:t,captionArray:i,timestampOffset:s}){if(!i){return}const n=e.WebKitDataCue||e.VTTCue;i.forEach(e=>{const i=e.stream;t[i].addCue(new n(e.startTime+s,e.endTime+s,e.text))})};const Qn=function(e){Object.defineProperties(e.frame,{id:{get(){a["default"].log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get(){a["default"].log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get(){a["default"].log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})};const Jn=({inbandTextTracks:t,metadataArray:i,timestampOffset:s,videoDuration:n})=>{if(!i){return}const r=e.WebKitDataCue||e.VTTCue;const a=t.metadataTrack_;if(!a){return}i.forEach(t=>{const i=t.cueTime+s;if(typeof i!=="number"||e.isNaN(i)||i<0||!(i<Infinity)){return}if(!t.frames||!t.frames.length){return}t.frames.forEach(e=>{const t=new r(i,i,e.value||e.url||e.data||"");t.frame=e;t.value=e;Qn(t);a.addCue(t)})});if(!a.cues||!a.cues.length){return}const o=a.cues;const l=[];for(let e=0;e<o.length;e++){if(o[e]){l.push(o[e])}}const u=l.reduce((e,t)=>{const i=e[t.startTime]||[];i.push(t);e[t.startTime]=i;return e},{});const c=Object.keys(u).sort((e,t)=>Number(e)-Number(t));c.forEach((e,t)=>{const i=u[e];const s=Number(c[t+1])||n;i.forEach(e=>{e.endTime=s})})};const Zn=(e,t,i)=>{if(e.metadataTrack_){return}e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;e.metadataTrack_.inBandMetadataTrackDispatchType=t};const er=function(e,t,i){let s;let n;if(!i){return}if(!i.cues){return}s=i.cues.length;while(s--){n=i.cues[s];if(n.startTime>=e&&n.endTime<=t){i.removeCue(n)}}};const tr=function(e){const t=e.cues;if(!t){return}const i={};for(let s=t.length-1;s>=0;s--){const n=t[s];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(i[r]){e.removeCue(n)}else{i[r]=n}}};var ir=9e4,sr,nr,rr,ar,or,lr,ur;sr=function(e){return e*ir};nr=function(e,t){return e*t};rr=function(e){return e/ir};ar=function(e,t){return e/t};or=function(e,t){return sr(ar(e,t))};lr=function(e,t){return nr(rr(e),t)};ur=function(e,t,i){return rr(i?e:e-t)};var cr={ONE_SECOND_IN_TS:ir,secondsToVideoTs:sr,secondsToAudioTs:nr,videoTsToSeconds:rr,audioTsToSeconds:ar,audioTsToVideoTs:or,videoTsToAudioTs:lr,metadataTsToSeconds:ur};const dr=(e,t,i)=>{if(typeof t==="undefined"||t===null||!e.length){return[]}const s=Math.ceil((t-i+3)*cr.ONE_SECOND_IN_TS);let n;for(n=0;n<e.length;n++){if(e[n].pts>s){break}}return e.slice(n)};const hr=(e,t,i)=>{if(!t.length){return e}if(i){return t.slice()}const s=t[0].pts;let n=0;for(n;n<e.length;n++){if(e[n].pts>=s){break}}return e.slice(0,n).concat(t)};const fr=(e,t,i,s)=>{const n=Math.ceil((t-s)*cr.ONE_SECOND_IN_TS);const r=Math.ceil((i-s)*cr.ONE_SECOND_IN_TS);const a=e.slice();let o=e.length;while(o--){if(e[o].pts<=r){break}}if(o===-1){return a}let l=o+1;while(l--){if(e[l].pts<=n){break}}l=Math.max(l,0);a.splice(l,o-l+1);return a};const pr=function(e,t){if(!e&&!t||!e&&t||e&&!t){return false}if(e===t){return true}const i=Object.keys(e).sort();const s=Object.keys(t).sort();if(i.length!==s.length){return false}for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n]){return false}if(e[r]!==t[r]){return false}}return true};const mr=22;const gr=function(e,t,i){t=t||[];const s=[];let n=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline){s.push(r);n+=a.duration;if(n>i){return r}}}if(s.length===0){return 0}return s[s.length-1]};const yr=1;const _r=500;const vr=e=>typeof e==="number"&&isFinite(e);const br=1/60;const Tr=(e,t,i)=>{if(e!=="main"||!t||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(t.hasVideo&&!i.hasVideo){return"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."}if(!t.hasVideo&&i.hasVideo){return"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."}return null};const Sr=(e,t,i)=>{let s=t-Hs.BACK_BUFFER_LENGTH;if(e.length){s=Math.max(s,e.start(0))}const n=t-i;return Math.min(n,s)};const Er=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=e;const d=o.length-1;let h="mediaIndex/partIndex increment";if(e.getMediaInfoForTime){h=`getMediaInfoForTime (${e.getMediaInfoForTime})`}else if(e.isSyncRequest){h="getSyncSegmentCandidate (isSyncRequest)"}if(e.independent){h+=` with independent ${e.independent}`}const f=typeof u==="number";const p=e.segment.uri?"segment":"pre-segment";const m=f?re({preloadSegment:s})-1:0;return`${p} [${r+l}/${r+d}]`+(f?` part [${u}/${m}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(f?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${c}]`+` selected by [${h}]`+` playlist [${a}]`};const Ir=e=>`${e}TimingInfo`;const kr=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&e===t){return null}if(e<t){return i}return s.length?s.end(s.length-1):i};const Cr=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(t===i){return false}if(s==="audio"){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if(s==="main"&&n){const t=e.pendingTimelineChange({type:"audio"});if(t&&t.to===i){return false}return true}return false};const wr=t=>{let i=0;["video","audio"].forEach(function(s){const n=t[`${s}TimingInfo`];if(!n){return}const{start:r,end:a}=n;let o;if(typeof r==="bigint"||typeof a==="bigint"){o=e.BigInt(a)-e.BigInt(r)}else if(typeof r==="number"&&typeof a==="number"){o=a-r}if(typeof o!=="undefined"&&o>i){i=o}});if(typeof i==="bigint"&&i<Number.MAX_SAFE_INTEGER){i=Number(i)}return i};const Ar=({segmentDuration:e,maxDuration:t})=>{if(!e){return false}return Math.round(e)>t+q};const Or=(e,t)=>{if(t!=="hls"){return null}const i=wr({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i){return null}const s=e.playlist.targetDuration;const n=Ar({segmentDuration:i,maxDuration:s*2});const r=Ar({segmentDuration:i,maxDuration:s});const a=`Segment with index ${e.mediaIndex} `+`from playlist ${e.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${e.duration} `+`and the target duration is ${s}. `+"For HLS content, a duration in excess of the target duration may result in "+"playback issues. See the HLS specification section on EXT-X-TARGETDURATION for "+"more details: "+"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";if(n||r){return{severity:n?"warn":"info",message:a}}return null};class Dr extends a["default"].EventTarget{constructor(e,t={}){super();if(!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_=true;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.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;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",()=>{if(!this.isEndOfStream_()){this.ended_=false}});this.fetchAtBuffer_=false;this.logger_=f(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(e){if(e!==this.state_){this.logger_(`${this.state_} -> ${e}`);this.state_=e;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}});if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",()=>{if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}}createTransmuxer_(){return dn.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,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_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(e){this.audioDisabled_=!e;if(e){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(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_=false;e.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==e){return true}return false}error(e){if(typeof e!=="undefined"){this.logger_("error occurred:",e);this.error_=e}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){dn.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e){return $()}if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s){return this.sourceUpdater_.buffered()}if(i){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=false){if(!e){return null}const i=yt(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}}return s||e}segmentKey(e,t=false){if(!e){return null}const i=_t(e);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&t&&!s&&e.bytes){this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes}}const n={resolvedUri:(s||e).resolvedUri};if(s){n.bytes=s.bytes}return n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(e,t={}){if(!e){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=e;this.xhrOptions_=t;if(this.state==="INIT"){e.syncInfo={mediaSequence:e.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(e)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${e.id||e.uri}]`);this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==e.uri){if(this.mediaIndex!==null){if(!e.endList){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=e.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=e}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=e.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true};this.resetLoader();this.remove(0,Infinity,e);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;this.resyncLoader()}resyncLoader(){if(this.transmuxer_){dn.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(e,t,i=(()=>{}),s=false){if(t===Infinity){t=this.duration_()}if(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 r=()=>{n--;if(n===0){i()}};if(s||!this.audioDisabled_){n++;this.sourceUpdater_.removeAudio(e,t,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=fr(this.gopBuffer_,e,t,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(e,t,r)}for(const i in this.inbandTextTracks_){er(e,t,this.inbandTextTracks_[i])}er(e,t,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),_r)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const e=this.chooseNextRequest_();if(!e){return}if(typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})}this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_){return false}const s=typeof e==="number"&&t.segments[e];const n=e+1===t.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const e=this.buffered_();const t=ee(e)||0;const i=te(e,this.currentTime_());const s=!this.hasPlayed_()&&i>=1;const n=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||s||n){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest){a.mediaIndex=gr(this.currentTimeline_,r,t)}else if(this.mediaIndex!==null){const e=r[this.mediaIndex];const i=typeof this.partIndex==="number"?this.partIndex:-1;a.startOfSegment=e.end?e.end:t;if(e.parts&&e.parts[i+1]){a.mediaIndex=this.mediaIndex;a.partIndex=i+1}else{a.mediaIndex=this.mediaIndex+1}}else{const{segmentIndex:e,startTime:i,partIndex:s}=Ce.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`;a.mediaIndex=e;a.startOfSegment=i;a.partIndex=s}const o=r[a.mediaIndex];let l=o&&typeof a.partIndex==="number"&&o.parts&&o.parts[a.partIndex];if(!o||typeof a.partIndex==="number"&&!l){return null}if(typeof a.partIndex!=="number"&&o.parts){a.partIndex=0;l=o.parts[0]}if(!i&&l&&!l.independent){if(a.partIndex===0){const e=r[a.mediaIndex-1];const t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];if(t&&t.independent){a.mediaIndex-=1;a.partIndex=e.parts.length-1;a.independent="previous segment"}}else if(o.parts[a.partIndex-1].independent){a.partIndex-=1;a.independent="previous part"}}const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(a.mediaIndex>=r.length-1&&u&&!this.seeking_()){return null}return this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e;const u=i.segments[s];const c=typeof a==="number"&&u.parts[a];const d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:s,partIndex:c?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t};const h=typeof o!=="undefined"?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});const f=ee(this.sourceUpdater_.audioBuffered());if(typeof f==="number"){d.audioAppendStart=f-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){d.gopsToAlignWith=dr(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return d}timestampOffsetForSegment_(e){return kr(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3){return}const t=this.currentTime_();const i=e.bandwidth;const s=this.pendingSegment_.duration;const n=Ce.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived);const r=Q(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const a=Gn({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a){return}const o=n-r;const l=o-a.rebufferingImpact;let u=.5;if(r<=q){u=1}if(!a.playlist||a.playlist.uri===this.playlist_.uri||l<u){return}this.bandwidth=a.playlist.attributes.BANDWIDTH*Hs.BANDWIDTH_VARIANCE+1;this.trigger("earlyabort")}handleAbort_(e){this.logger_(`Aborting ${Er(e)}`);this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.checkForIllegalMediaSwitch(t)){return}t=t||{};if(!pr(this.currentMediaInfo_,t)){this.appendInitSegment_={audio:true,video:true};this.startingMediaInfo_=t;this.currentMediaInfo_=t;this.logger_("trackinfo update",t);this.trigger("trackinfo")}if(this.checkForAbort_(e.requestId)){return}this.pendingSegment_.trackInfo=t;if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleTimingInfo_(e,t,i,s){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const n=this.pendingSegment_;const r=Ir(t);n[r]=n[r]||{};n[r][i]=s;this.logger_(`timinginfo: ${t} - ${i} - ${s}`);if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleCaptions_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}const i=this.pendingSegment_;if(!i.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();const n={};t.forEach(e=>{n[e.stream]=n[e.stream]||{startTime:Infinity,captions:[],endTime:0};const t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+s);t.endTime=Math.max(t.endTime,e.endTime+s);t.captions.push(e)});Object.keys(n).forEach(e=>{const{startTime:t,endTime:i,captions:r}=n[e];const a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`);Yn(a,this.vhs_.tech_,e);er(t,i,a[e]);Xn({captionArray:r,inbandTextTracks:a,timestampOffset:s})});if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,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(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[];e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const e=this.pendingSegment_;if(!e){return false}if(!this.getCurrentMediaInfo_()){return true}if(Cr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}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()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const e=this.pendingSegment_;const t=this.getCurrentMediaInfo_();if(!e||!t){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=t;if(s&&!e.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo){return false}if(Cr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}handleData_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(e.map){e.map=this.initSegmentForMap(e.map,true);i.segment.map=e.map}if(e.key){this.segmentKey(e.key,true)}i.isFmp4=e.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[Ir(t.type)].start}else{const e=this.getCurrentMediaInfo_();const t=this.loaderType_==="main"&&e&&e.hasVideo;let s;if(t){s=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,t.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,t)}updateAppendInitSegmentStatus(e,t){if(this.loaderType_==="main"&&typeof e.timestampOffset==="number"&&!e.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[t]!==e.playlist){this.appendInitSegment_[t]=true}}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const e=yt(i);if(this.activeInitSegmentId_===e){return null}t=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=e}if(t&&this.appendInitSegment_[e]){this.playlistOfLastInitSegment_[e]=s;this.appendInitSegment_[e]=false;this.activeInitSegmentId_=null;return t}return null}handleQuotaExceededError_({segmentInfo:t,type:i,bytes:s},n){const r=this.sourceUpdater_.audioBuffered();const a=this.sourceUpdater_.videoBuffered();if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+J(r).join(", "))}if(a.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+J(a).join(", "))}const o=r.length?r.start(0):0;const l=r.length?r.end(r.length-1):0;const u=a.length?a.start(0):0;const c=a.length?a.end(a.length-1):0;if(l-o<=yr&&c-u<=yr){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${s.byteLength}, `+`audio buffer: ${J(r).join(", ")}, `+`video buffer: ${J(a).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:t,type:i,bytes:s}));const d=this.currentTime_();const h=d-yr;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${h}`);this.remove(0,h,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${yr}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=e.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()},yr*1e3)},true)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){if(!s){return}if(s.code===mr){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error(`${t} append of ${i.length}b failed for segment `+`#${e.mediaIndex} in playlist ${e.playlist.id}`);this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const e=[s];let t=s.byteLength;if(i){e.unshift(i);t+=i.byteLength}n=zn({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${e}TimingInfo`;if(!s[n]){s[n]={}}s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0;s[n].transmuxedPresentationStart=i.start.presentation;s[n].transmuxedDecodeStart=i.start.decode;s[n].transmuxedPresentationEnd=i.end.presentation;s[n].transmuxedDecodeEnd=i.end.decode;s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(e){this.state="WAITING";this.pendingSegment_=e;this.trimBackBuffer_(e);if(typeof e.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=p({},e,{forceTimestampOffset:true});p(e,this.generateSegmentInfo_(t));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){if(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);const i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex);const s=this.mediaIndex!==null;const n=e.timeline!==this.currentTimeline_&&e.timeline>0;const r=i||s&&n;this.logger_(`Requesting ${Er(e)}`);if(t.map&&!t.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}e.abortRequests=On({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:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:s})=>{this.logger_(`${Er(e)} logged from transmuxer stream ${s} as a ${i}: ${t}`)}})}trimBackBuffer_(e){const t=Sr(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(t>0){this.remove(0,t)}}createSimplifiedSegmentObj_(e){const t=e.segment;const i=e.part;const s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part};const n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline){if(n.videoTimingInfo){s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd}else if(n.audioTimingInfo){s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd}}if(t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key);s.key.iv=i}if(t.map){s.map=this.initSegmentForMap(t.map)}return s}saveTransferStats_(e){this.mediaRequests+=1;if(e){this.mediaBytesTransferred+=e.bytesReceived;this.mediaTransferDuration+=e.roundTripTime}}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived;if(e<br){this.logger_(`Ignoring segment's bandwidth because its duration of ${e}`+` is less than the min to record ${br}`);return}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,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}this.saveTransferStats_(t.stats);if(!this.pendingSegment_){return}if(t.requestId!==this.pendingSegment_.requestId){return}if(e){this.pendingSegment_=null;this.state="READY";if(e.code===fn.ABORTED){return}this.pause();if(e.code===fn.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1;this.error(e);this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats);s.endOfAllRequests=t.endOfAllRequests;if(i.gopInfo){this.gopBuffer_=hr(this.gopBuffer_,i.gopInfo,this.safeAppend_)}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(s)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);if(t!==null){this.timeMapping_=t}}updateMediaSecondsLoaded_(e){if(typeof e.start==="number"&&typeof e.end==="number"){this.mediaSecondsLoaded+=e.end-e.start}else{this.mediaSecondsLoaded+=e.duration}}shouldUpdateTransmuxerTimestampOffset_(e){if(e===null){return false}if(this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()){return true}if(!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()){return true}return false}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(typeof e!=="undefined"){return e}if(!r){return o.start}const l=t.segments[i-1];if(i===0||!l||typeof l.start==="undefined"||l.end!==s+n){return s}return a.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:Infinity});this.trigger("error");return}const{hasAudio:i,hasVideo:s,isMuxed:n}=t;const r=this.loaderType_==="main"&&s;const a=!this.audioDisabled_&&i&&!n;e.waitingOnAppends=0;if(!e.hasAppendedData_){if(!e.timingInfo&&typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=true}e.timingInfo={start:0};e.waitingOnAppends++;if(!this.isPendingTimestampOffset_){this.updateSourceBufferTimestampOffset_(e);this.processMetadataQueue_()}this.checkAppendsDone_(e);return}if(r){e.waitingOnAppends++}if(a){e.waitingOnAppends++}if(r){this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e))}if(a){this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}}checkAppendsDone_(e){if(this.checkForAbort_(e.requestId)){return}e.waitingOnAppends--;if(e.waitingOnAppends===0){this.handleAppendsDone_()}}checkForIllegalMediaSwitch(e){const t=Tr(this.loaderType_,this.getCurrentMediaInfo_(),e);if(t){this.error({message:t,playlistExclusionDuration:Infinity});this.trigger("error");return true}return false}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!=="number"||e.changedTimestampOffset||this.loaderType_!=="main"){return}let t=false;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo});e.changedTimestampOffset=true;if(e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()){this.sourceUpdater_.videoTimestampOffset(e.timestampOffset);t=true}if(e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()){this.sourceUpdater_.audioTimestampOffset(e.timestampOffset);t=true}if(t){this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){if(!this.useDtsForTimestampOffset_){return i.start}if(e&&typeof e.transmuxedDecodeStart==="number"){return e.transmuxedDecodeStart}if(t&&typeof t.transmuxedDecodeStart==="number"){return t.transmuxedDecodeStart}return i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_();const i=this.loaderType_==="main"&&t&&t.hasVideo;const s=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;if(!s){return}e.timingInfo.end=typeof s.end==="number"?s.end:s.start+e.duration}handleAppendsDone_(){if(this.pendingSegment_){this.trigger("appendsdone")}if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}const e=this.pendingSegment_;this.updateTimingInfoEnd_(e);if(this.shouldSaveSegmentTimingInfo_){this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"})}const t=Or(e,this.sourceType_);if(t){if(t.severity==="warn"){a["default"].log.warn(t.message)}else{this.logger_(t.message)}}this.recordThroughput_(e);this.pendingSegment_=null;this.state="READY";if(e.isSyncRequest){this.trigger("syncinfoupdate");if(!e.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${Er(e)}`);return}}this.logger_(`Appended ${Er(e)}`);this.addSegmentMetadataCue_(e);this.fetchAtBuffer_=true;if(this.currentTimeline_!==e.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})}}this.currentTimeline_=e.timeline;this.trigger("syncinfoupdate");const i=e.segment;const s=e.part;const n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${Er(e)}`);this.resetEverything();return}const o=this.mediaIndex!==null;if(o){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=e.mediaIndex;this.partIndex=e.partIndex;if(this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)){this.endOfStream()}this.trigger("appended");if(e.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(e){if(e.duration<br){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration}`+` is less than the min to record ${br}`);return}const t=this.throughput.rate;const i=Date.now()-e.endOfAllRequests+1;const s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(t){if(!this.segmentMetadataTrack_){return}const i=t.segment;const s=i.start;const n=i.end;if(!vr(s)||!vr(n)){return}er(s,n,this.segmentMetadataTrack_);const r=e.WebKitDataCue||e.VTTCue;const a={custom:i.custom,dateTimeObject:i.dateTimeObject,dateTimeString:i.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:s,end:n};const o=JSON.stringify(a);const l=new r(s,n,o);l.value=a;this.segmentMetadataTrack_.addCue(l)}}function Pr(){}const xr=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const Lr=["video","audio"];const Rr=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]};const Nr=(e,t)=>{for(let i=0;i<t.length;i++){const s=t[i];if(s.type==="mediaSource"){return null}if(s.type===e){return i}}return null};const Mr=(e,t)=>{if(t.queue.length===0){return}let i=0;let s=t.queue[i];if(s.type==="mediaSource"){if(!t.updating()&&t.mediaSource.readyState!=="closed"){t.queue.shift();s.action(t);if(s.doneFn){s.doneFn()}Mr("audio",t);Mr("video",t)}return}if(e==="mediaSource"){return}if(!t.ready()||t.mediaSource.readyState==="closed"||Rr(e,t)){return}if(s.type!==e){i=Nr(e,t.queue);if(i===null){return}s=t.queue[i]}t.queue.splice(i,1);t.queuePending[e]=s;s.action(e,t);if(!s.doneFn){t.queuePending[e]=null;Mr(e,t);return}};const Ur=(e,t)=>{const i=t[`${e}Buffer`];const s=xr(e);if(!i){return}i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]);i.removeEventListener("error",t[`on${s}Error_`]);t.codecs[e]=null;t[`${e}Buffer`]=null};const Br=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1;const Fr={appendBuffer:(e,t,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(!Br(n.mediaSource,r)){return}n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{r.appendBuffer(e)}catch(e){n.logger_(`Error with code ${e.code} `+(e.code===mr?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`);n.queuePending[s]=null;i(e)}},remove:(e,t)=>(i,s)=>{const n=s[`${i}Buffer`];if(!Br(s.mediaSource,n)){return}s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{n.remove(e,t)}catch(n){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}},timestampOffset:e=>(t,i)=>{const s=i[`${t}Buffer`];if(!Br(i.mediaSource,s)){return}i.logger_(`Setting ${t}timestampOffset to ${e}`);s.timestampOffset=e},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if(t.mediaSource.readyState!=="open"){return}t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){a["default"].log.warn("Failed to call media source endOfStream",e)}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){a["default"].log.warn("Failed to set media source duration",e)}},abort:()=>(e,t)=>{if(t.mediaSource.readyState!=="open"){return}const i=t[`${e}Buffer`];if(!Br(t.mediaSource,i)){return}t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){a["default"].log.warn(`Failed to abort on ${e}Buffer`,t)}},addSourceBuffer:(e,t)=>i=>{const s=xr(e);const n=M(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]);r.addEventListener("error",i[`on${s}Error_`]);i.codecs[e]=t;i[`${e}Buffer`]=r},removeSourceBuffer:e=>t=>{const i=t[`${e}Buffer`];Ur(e,t);if(!Br(t.mediaSource,i)){return}t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){a["default"].log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}},changeType:e=>(t,i)=>{const s=i[`${t}Buffer`];const n=M(e);if(!Br(i.mediaSource,s)){return}if(i.codecs[t]===e){return}i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`);s.changeType(n);i.codecs[t]=e}};const jr=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n});Mr(e,t)};const Vr=(e,t)=>i=>{if(t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null;if(i){i(t[`${e}Error_`])}}Mr(e,t)};class $r extends a["default"].EventTarget{constructor(e){super();this.mediaSource=e;this.sourceopenListener_=(()=>Mr("mediaSource",this));this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=f("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=Vr("video",this);this.onAudioUpdateEnd_=Vr("audio",this);this.onVideoError_=(e=>{this.videoError_=e});this.onAudioError_=(e=>{this.audioError_=e});this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(e);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(e,t){jr({type:"mediaSource",sourceUpdater:this,action:Fr.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){jr({type:e,sourceUpdater:this,action:Fr.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){a["default"].log.error("removeSourceBuffer is not supported!");return}jr({type:"mediaSource",sourceUpdater:this,action:Fr.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!a["default"].browser.IS_FIREFOX&&e.MediaSource&&e.MediaSource.prototype&&typeof e.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return e.SourceBuffer&&e.SourceBuffer.prototype&&typeof e.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){a["default"].log.error("changeType is not supported!");return}jr({type:e,sourceUpdater:this,action:Fr.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 i=e[t];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(t,i)}if(this.canChangeType()){this.changeType(t,i)}})}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=t;jr({type:s,sourceUpdater:this,action:Fr.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){if(!Br(this.mediaSource,this.audioBuffer)){return $()}return this.audioBuffer.buffered?this.audioBuffer.buffered:$()}videoBuffered(){if(!Br(this.mediaSource,this.videoBuffer)){return $()}return this.videoBuffer.buffered?this.videoBuffer.buffered:$()}buffered(){const e=Br(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const t=Br(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e){return this.audioBuffered()}if(e&&!t){return this.videoBuffered()}return Y(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Pr){jr({type:"mediaSource",sourceUpdater:this,action:Fr.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Pr){if(typeof e!=="string"){e=undefined}jr({type:"mediaSource",sourceUpdater:this,action:Fr.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Pr){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}jr({type:"audio",sourceUpdater:this,action:Fr.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=Pr){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}jr({type:"video",sourceUpdater:this,action:Fr.remove(e,t),doneFn:i,name:"remove"})}updating(){if(Rr("audio",this)||Rr("video",this)){return true}return false}audioTimestampOffset(e){if(typeof e!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e){jr({type:"audio",sourceUpdater:this,action:Fr.timestampOffset(e),name:"timestampOffset"});this.audioTimestampOffset_=e}return this.audioTimestampOffset_}videoTimestampOffset(e){if(typeof e!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==e){jr({type:"video",sourceUpdater:this,action:Fr.timestampOffset(e),name:"timestampOffset"});this.videoTimestampOffset_=e}return this.videoTimestampOffset_}audioQueueCallback(e){if(!this.audioBuffer){return}jr({type:"audio",sourceUpdater:this,action:Fr.callback(e),name:"callback"})}videoQueueCallback(e){if(!this.videoBuffer){return}jr({type:"video",sourceUpdater:this,action:Fr.callback(e),name:"callback"})}dispose(){this.trigger("dispose");Lr.forEach(e=>{this.abort(e);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(e)}else{this[`${e}QueueCallback`](()=>Ur(e,this))}});this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const qr=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e)));const Hr=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Wr extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Gr extends Dr{constructor(e,t={}){super(e,t);this.mediaSource_=null;this.subtitlesTrack_=null;this.loaderType_="subtitle";this.featuresNativeTextTracks_=e.featuresNativeTextTracks;this.loadVttJs=e.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return $()}const e=this.subtitlesTrack_.cues;const t=e[0].startTime;const i=e[e.length-1].startTime;return $([[t,i]])}initSegmentForMap(e,t=false){if(!e){return null}const i=yt(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const t=Hr.byteLength+e.bytes.byteLength;const n=new Uint8Array(t);n.set(e.bytes);n.set(Hr,e.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:n}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(e){if(typeof e==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=e;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(e,t){er(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(!e){return}if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const e=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",e);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(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_(t,i,s){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(i.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(t){if(t.code===fn.TIMEOUT){this.handleTimeout_()}if(t.code===fn.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(t);return}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,i.stats);if(i.key){this.segmentKey(i.key,true)}this.state="APPENDING";this.trigger("appending");const r=n.segment;if(r.map){r.map.bytes=i.map.bytes}n.bytes=i.bytes;if(typeof e.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then(()=>this.segmentRequestFinished_(t,i,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}r.requested=true;try{this.parseVTTCues_(n)}catch(e){this.stopForError({message:e.message});return}this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_);if(n.cues.length){n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}}else{n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration}}if(n.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}n.byteLength=n.bytes.byteLength;this.mediaSecondsLoaded+=r.duration;n.cues.forEach(t=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new e.VTTCue(t.startTime,t.endTime,t.text):t)});tr(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let i;let s=false;if(typeof e.WebVTT!=="function"){throw new Wr}if(typeof e.TextDecoder==="function"){i=new e.TextDecoder("utf8")}else{i=e.WebVTT.StringDecoder();s=true}const n=new e.WebVTT.Parser(e,e.vttjs,i);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};n.oncue=t.cues.push.bind(t.cues);n.ontimestampmap=(e=>{t.timestampmap=e});n.onparsingerror=(e=>{a["default"].log.warn("Error encountered when parsing cues: "+e.message)});if(t.segment.map){let e=t.segment.map.bytes;if(s){e=qr(e)}n.parse(e)}let r=t.bytes;if(s){r=qr(r)}n.parse(r);n.flush()}updateTimeMapping_(e,t,i){const s=e.segment;if(!t){return}if(!e.cues.length){s.empty=true;return}const n=e.timestampmap;const r=n.MPEGTS/cr.ONE_SECOND_IN_TS-n.LOCAL+t.mapping;e.cues.forEach(e=>{e.startTime+=r;e.endTime+=r});if(!i.syncInfo){const t=e.cues[0].startTime;const n=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,n-s.duration)}}}}const Kr=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const s=i[e];if(t>=s.adStartTime&&t<=s.adEndTime){return s}}return null};const zr=function(t,i,s=0){if(!t.segments){return}let n=s;let r;for(let s=0;s<t.segments.length;s++){const a=t.segments[s];if(!r){r=Kr(i,n+a.duration/2)}if(r){if("cueIn"in a){r.endTime=n;r.adEndTime=n;n+=a.duration;r=null;continue}if(n<r.endTime){n+=a.duration;continue}r.endTime+=a.duration}else{if("cueOut"in a){r=new e.VTTCue(n,n+a.duration,a.cueOut);r.adStartTime=n;r.adEndTime=n+parseFloat(a.cueOut);i.addCue(r)}if("cueOutCont"in a){const[t,s]=a.cueOutCont.split("/").map(parseFloat);r=new e.VTTCue(n,n+a.duration,"");r.adStartTime=n-t;r.adEndTime=r.adStartTime+s;i.addCue(r)}}n+=a.duration}};const Yr=86400;const Xr=[{name:"VOD",run:(e,t,i,s,n)=>{if(i!==Infinity){const e={time:0,segmentIndex:0,partIndex:null};return e}return null}},{name:"ProgramDateTime",run:(e,t,i,s,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length){return null}let r=null;let a=null;const o=se(t);n=n||0;for(let i=0;i<o.length;i++){const s=t.endList||n===0?i:o.length-(i+1);const l=o[s];const u=l.segment;const c=e.timelineToDatetimeMappings[u.timeline];if(!c||!u.dateTimeObject){continue}const d=u.dateTimeObject.getTime()/1e3;let h=d+c;if(u.parts&&typeof l.partIndex==="number"){for(let e=0;e<l.partIndex;e++){h+=u.parts[e].duration}}const f=Math.abs(n-h);if(a!==null&&(f===0||a<f)){break}a=f;r={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}return r}},{name:"Segment",run:(e,t,i,s,n)=>{let r=null;let a=null;n=n||0;const o=se(t);for(let e=0;e<o.length;e++){const i=t.endList||n===0?e:o.length-(e+1);const l=o[i];const u=l.segment;const c=l.part&&l.part.start||u&&u.start;if(u.timeline===s&&typeof c!=="undefined"){const e=Math.abs(n-c);if(a!==null&&a<e){break}if(!r||a===null||a>=e){a=e;r={time:c,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}}return r}},{name:"Discontinuity",run:(e,t,i,s,n)=>{let r=null;n=n||0;if(t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let s=0;s<t.discontinuityStarts.length;s++){const a=t.discontinuityStarts[s];const o=t.discontinuitySequence+s+1;const l=e.discontinuities[o];if(l){const e=Math.abs(n-l.time);if(i!==null&&i<e){break}if(!r||i===null||i>=e){i=e;r={time:l.time,segmentIndex:a,partIndex:null}}}}}return r}},{name:"Playlist",run:(e,t,i,s,n)=>{if(t.syncInfo){const e={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return e}return null}}];class Qr extends a["default"].EventTarget{constructor(e={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};this.logger_=f("SyncController")}getSyncPoint(e,t,i,s){const n=this.runStrategies_(e,t,i,s);if(!n.length){return null}return this.selectSyncPoint_(n,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments){return null}const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length){return null}const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});if(s.segmentIndex>0){s.time*=-1}return Math.abs(s.time+de({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s){const n=[];for(let r=0;r<Xr.length;r++){const a=Xr[r];const o=a.run(this,e,t,i,s);if(o){o.strategy=a.name;n.push({strategy:a.name,syncPoint:o})}}return n}selectSyncPoint_(e,t){let i=e[0].syncPoint;let s=Math.abs(e[0].syncPoint[t.key]-t.value);let n=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);if(a<s){s=a;i=e[r].syncPoint;n=e[r].strategy}}this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy`+` [${n}]: [time:${i.time},`+` segmentIndex:${i.segmentIndex}`+(typeof i.partIndex==="number"?`,partIndex:${i.partIndex}`:"")+"]");return i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>Yr){a["default"].log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){const i=e.segments[s];if(i&&typeof i.start!=="undefined"){t.syncInfo={mediaSequence:e.mediaSequence+s,time:i.start};this.logger_(`playlist refresh sync: [time:${t.syncInfo.time},`+` mediaSequence: ${t.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){this.timelineToDatetimeMappings={};if(e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0];const i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t);const s=e.segment;if(i){this.saveDiscontinuitySyncInfo_(e);if(!e.playlist.syncInfo){e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&t&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].time}mappingForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment;const n=e.part;let r=this.timelines[e.timeline];let a;let o;if(typeof e.timestampOffset==="number"){r={time:e.startOfSegment,mapping:e.startOfSegment-t.start};if(i){this.timelines[e.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${e.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}a=e.startOfSegment;o=t.end+r.mapping}else if(r){a=t.start+r.mapping;o=t.end+r.mapping}else{return false}if(n){n.start=a;n.end=o}if(!s.start||a<s.start){s.start=a}s.end=o;return true}saveDiscontinuitySyncInfo_(e){const t=e.playlist;const i=e.segment;if(i.discontinuity){this.discontinuities[i.timeline]={time:i.start,accuracy:0}}else if(t.discontinuityStarts&&t.discontinuityStarts.length){for(let s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s];const r=t.discontinuitySequence+s+1;const a=n-e.mediaIndex;const o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let s;if(a<0){s=i.start-de({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n})}else{s=i.end+de({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:s,accuracy:o}}}}}dispose(){this.trigger("dispose");this.off()}}class Jr extends a["default"].EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.pendingTimelineChanges_[e]={type:e,from:t,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i};delete this.pendingTimelineChanges_[e];this.trigger("timelinechange")}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Zr=Ys(Xs(function(){var t=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();function i(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}const s=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]];const t=e[0];const i=e[1];const s=t[4];const n=i[4];let r;let a;let o;const l=[];const u=[];let c;let d;let h;let f;let p;let m;for(r=0;r<256;r++){u[(l[r]=r<<1^(r>>7)*283)^r]=r}for(a=o=0;!s[a];a^=c||1,o=u[o]||1){f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^f&255^99;s[a]=f;n[f]=a;h=l[d=l[c=l[a]]];m=h*16843009^d*65537^c*257^a*16843008;p=l[f]*257^f*16843008;for(r=0;r<4;r++){t[r][a]=p=p<<24^p>>>8;i[r][f]=m=m<<24^m>>>8}}for(r=0;r<5;r++){t[r]=t[r].slice(0);i[r]=i[r].slice(0)}return e};let n=null;class r{constructor(e){if(!n){n=s()}this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let t;let i;let r;const a=this._tables[0][4];const o=this._tables[1];const l=e.length;let u=1;if(l!==4&&l!==6&&l!==8){throw new Error("Invalid aes key size")}const c=e.slice(0);const d=[];this._key=[c,d];for(t=l;t<4*l+28;t++){r=c[t-1];if(t%l===0||l===8&&t%l===4){r=a[r>>>24]<<24^a[r>>16&255]<<16^a[r>>8&255]<<8^a[r&255];if(t%l===0){r=r<<8^r>>>24^u<<24;u=u<<1^(u>>7)*283}}c[t]=c[t-l]^r}for(i=0;t;i++,t--){r=c[i&3?t:t-4];if(t<=4||i<4){d[i]=r}else{d[i]=o[0][a[r>>>24]]^o[1][a[r>>16&255]]^o[2][a[r>>8&255]]^o[3][a[r&255]]}}}decrypt(e,t,i,s,n,r){const a=this._key[1];let o=e^a[0];let l=s^a[1];let u=i^a[2];let c=t^a[3];let d;let h;let f;const p=a.length/4-2;let m;let g=4;const y=this._tables[1];const _=y[0];const v=y[1];const b=y[2];const T=y[3];const S=y[4];for(m=0;m<p;m++){d=_[o>>>24]^v[l>>16&255]^b[u>>8&255]^T[c&255]^a[g];h=_[l>>>24]^v[u>>16&255]^b[c>>8&255]^T[o&255]^a[g+1];f=_[u>>>24]^v[c>>16&255]^b[o>>8&255]^T[l&255]^a[g+2];c=_[c>>>24]^v[o>>16&255]^b[l>>8&255]^T[u&255]^a[g+3];g+=4;o=d;l=h;u=f}for(m=0;m<4;m++){n[(3&-m)+r]=S[o>>>24]<<24^S[l>>16&255]<<16^S[u>>8&255]<<8^S[c&255]^a[g++];d=o;o=l;l=u;u=c;c=d}}}class a extends t{constructor(){super(t);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const o=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24};const l=function(e,t,i){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2);const n=new r(Array.prototype.slice.call(t));const a=new Uint8Array(e.byteLength);const l=new Int32Array(a.buffer);let u;let c;let d;let h;let f;let p;let m;let g;let y;u=i[0];c=i[1];d=i[2];h=i[3];for(y=0;y<s.length;y+=4){f=o(s[y]);p=o(s[y+1]);m=o(s[y+2]);g=o(s[y+3]);n.decrypt(f,p,m,g,l,y);l[y]=o(l[y]^u);l[y+1]=o(l[y+1]^c);l[y+2]=o(l[y+2]^d);l[y+3]=o(l[y+3]^h);u=f;c=p;d=m;h=g}return a};class u{constructor(e,t,s,n){const r=u.STEP;const l=new Int32Array(e.buffer);const c=new Uint8Array(e.byteLength);let d=0;this.asyncStream_=new a;this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+r),t,s,c));for(d=r;d<l.length;d+=r){s=new Uint32Array([o(l[d-4]),o(l[d-3]),o(l[d-2]),o(l[d-1])]);this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+r),t,s,c))}this.asyncStream_.push(function(){n(null,i(c))})}static get STEP(){return 32e3}decryptChunk_(e,t,i,s){return function(){const n=l(e,t,i);s.set(n,e.byteOffset)}}}var c=typeof globalThis!=="undefined"?globalThis:typeof e!=="undefined"?e:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var d;if(typeof e!=="undefined"){d=e}else if(typeof c!=="undefined"){d=c}else if(typeof self!=="undefined"){d=self}else{d={}}var h=d;var f=function e(t){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}return t&&t.buffer instanceof ArrayBuffer};var p=h.BigInt||Number;[p("0x1"),p("0x100"),p("0x10000"),p("0x1000000"),p("0x100000000"),p("0x10000000000"),p("0x1000000000000"),p("0x100000000000000"),p("0x10000000000000000")];(function(){var e=new Uint16Array([65484]);var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t[0]===255){return"big"}if(t[0]===204){return"little"}return"unknown"})();const m=function(e){const t={};Object.keys(e).forEach(i=>{const s=e[i];if(f(s)){t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{t[i]=s}});return t};self.onmessage=function(e){const t=e.data;const i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength);const s=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4);const n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new u(i,s,n,function(e,i){self.postMessage(m({source:t.source,decrypted:i}),[i.buffer])})}}));var ea=zs(Zr);const ta=e=>{let t=e.default?"main":"alternative";if(e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0){t="main-desc"}return t};const ia=(e,t)=>{e.abort();e.pause();if(t&&t.activePlaylistLoader){t.activePlaylistLoader.pause();t.activePlaylistLoader=null}};const sa=(e,t)=>{t.activePlaylistLoader=e;e.load()};const na=(e,t)=>()=>{const{segmentLoaders:{[e]:i,main:s},mediaTypes:{[e]:n}}=t;const r=n.activeTrack();const a=n.getActiveGroup();const o=n.activePlaylistLoader;const l=n.lastGroup_;if(a&&l&&a.id===l.id){return}n.lastGroup_=a;n.lastTrack_=r;ia(i,n);if(!a||a.isMainPlaylist){return}if(!a.playlistLoader){if(o){s.resetEverything()}return}i.resyncLoader();sa(a.playlistLoader,n)};const ra=(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;s.lastGroup_=null;i.abort();i.pause()};const aa=(e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:s,main:n},mediaTypes:{[e]:r}}=t;const a=r.activeTrack();const o=r.getActiveGroup();const l=r.activePlaylistLoader;const u=r.lastTrack_;if(u&&a&&u.id===a.id){return}r.lastGroup_=o;r.lastTrack_=a;ia(s,r);if(!o){return}if(o.isMainPlaylist){if(!a||!u||a.id===u.id){return}const e=t.vhs.playlistController_;const s=e.selectPlaylist();if(e.media()===s){return}r.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`);i.pause();n.resetEverything();e.fastQualityChange_(s);return}if(e==="AUDIO"){if(!o.playlistLoader){n.setAudio(true);n.resetEverything();return}s.setAudio(true);n.setAudio(false)}if(l===o.playlistLoader){sa(o.playlistLoader,r);return}if(s.track){s.track(a)}s.resetEverything();sa(o.playlistLoader,r)};const oa={AUDIO:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s},excludePlaylist:n}=t;ia(i,s);const r=s.activeTrack();const o=s.activeGroup();const l=(o.filter(e=>e.default)[0]||o[0]).id;const u=s.tracks[l];if(r===u){n({error:{message:"Problem encountered loading the default audio track."}});return}a["default"].log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const e in s.tracks){s.tracks[e].enabled=s.tracks[e]===u}s.onTrackChanged()},SUBTITLES:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;a["default"].log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");ia(i,s);const n=s.activeTrack();if(n){n.mode="disabled"}s.onTrackChanged()}};const la={AUDIO:(e,t,i)=>{if(!t){return}const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",oa[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);r.track(a.activeTrack());if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",oa[e](e,i))}};const ua={AUDIO:(e,t)=>{const{vhs:i,sourceType:s,segmentLoaders:{[e]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u,logger_:c}},mainPlaylistLoader:d}=t;const h=ke(d.main);if(!o[e]||Object.keys(o[e]).length===0){o[e]={main:{default:{default:true}}};if(h){o[e].main.default.playlists=d.main.playlists}}for(const n in o[e]){if(!l[n]){l[n]=[]}for(const f in o[e][n]){let p=o[e][n][f];let m;if(h){c(`AUDIO group '${n}' label '${f}' is a main playlist`);p.isMainPlaylist=true;m=null}else if(s==="vhs-json"&&p.playlists){m=new Ge(p.playlists[0],i,r)}else if(p.resolvedUri){m=new Ge(p.resolvedUri,i,r)}else if(p.playlists&&s==="dash"){m=new qs(p.playlists[0],i,r,d)}else{m=null}p=V({id:f,playlistLoader:m},p);la[e](e,p.playlistLoader,t);l[n].push(p);if(typeof u[f]==="undefined"){const e=new a["default"].AudioTrack({id:f,kind:ta(p),enabled:false,language:p.language,default:p.default,label:f});u[f]=e}}}n.on("error",oa[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:c}=t;for(const r in o[e]){if(!l[r]){l[r]=[]}for(const d in o[e][r]){if(!s.options_.useForcedSubtitles&&o[e][r][d].forced){continue}let h=o[e][r][d];let f;if(n==="hls"){f=new Ge(h.resolvedUri,s,a)}else if(n==="dash"){const e=h.playlists.filter(e=>e.excludeUntil!==Infinity);if(!e.length){return}f=new qs(h.playlists[0],s,a,c)}else if(n==="vhs-json"){f=new Ge(h.playlists?h.playlists[0]:h.resolvedUri,s,a)}h=V({id:d,playlistLoader:f},h);la[e](e,h.playlistLoader,t);l[r].push(h);if(typeof u[d]==="undefined"){const e=i.addRemoteTextTrack({id:d,kind:"subtitles",default:h.default&&h.autoselect,language:h.language,label:d},false).track;u[d]=e}}}r.on("error",oa[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:n,tracks:r}}}=t;for(const t in s[e]){if(!n[t]){n[t]=[]}for(const a in s[e][t]){const o=s[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId)){continue}const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]){u=V(u,l[u.instreamId])}if(u.default===undefined){delete u.default}n[t].push(V({id:a},o));if(typeof r[a]==="undefined"){const e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},false).track;r[a]=e}}}}};const ca=(e,t)=>{for(let i=0;i<e.length;i++){if(Ee(t,e[i])){return true}if(e[i].playlists&&ca(e[i].playlists,t)){return true}}return false};const da=(e,t)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[e]:{groups:n}}}=t;const r=s.media();if(!r){return null}let a=null;if(r.attributes[e]){a=n[r.attributes[e]]}const o=Object.keys(n);if(!a){if(e==="AUDIO"&&o.length>1&&ke(t.main)){for(let e=0;e<o.length;e++){const t=n[o[e]];if(ca(t,r)){a=t;break}}}else if(n.main){a=n.main}else if(o.length===1){a=n[o[0]]}}if(typeof i==="undefined"){return a}if(i===null||!a){return null}return a.filter(e=>e.id===i.id)[0]||null};const ha={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i){if(i[e].enabled){return i[e]}}return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i){if(i[e].mode==="showing"||i[e].mode==="hidden"){return i[e]}}return null}};const fa=(e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();if(!i){return null}return t[e].activeGroup(i)};const pa=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{ua[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=da(i,e);t[i].activeTrack=ha[i](i,e);t[i].onGroupChanged=na(i,e);t[i].onGroupChanging=ra(i,e);t[i].onTrackChanged=aa(i,e);t[i].getActiveGroup=fa(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=true;t.AUDIO.onGroupChanged();t.AUDIO.onTrackChanged();const i=t.AUDIO.getActiveGroup();if(!i.playlistLoader){a.setAudio(true)}else{a.setAudio(false);r.setAudio(true)}}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())});i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l);s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged);n.on("dispose",()=>{s.audioTracks().removeEventListener("change",l);s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)});s.clearTracks("audio");for(const e in t.AUDIO.tracks){s.audioTracks().addTrack(t.AUDIO.tracks[e])}};const ma=()=>{const e={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Pr,activeTrack:Pr,getActiveGroup:Pr,onGroupChanged:Pr,onTrackChanged:Pr,lastTrack_:null,logger_:f(`MediaGroups[${t}]`)}});return e};const ga=60*2;let ya;const _a=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const va=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};const ba=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:l,log:u}){if(!s){a["default"].log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e){u(`${c} as current playlist is not set`);return true}if(s.id===e.id){return false}const d=Boolean(G(t,i).length);if(!e.endList){if(!d&&typeof e.partTargetDuration==="number"){u(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}u(`${c} as current playlist is live`);return true}const h=te(t,i);const f=l?Hs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Hs.MAX_BUFFER_LOW_WATER_LINE;if(o<f){u(`${c} as duration < max low water line (${o} < ${f})`);return true}const p=s.attributes.BANDWIDTH;const m=e.attributes.BANDWIDTH;if(p<m&&(!l||h<r)){let e=`${c} as next bandwidth < current bandwidth (${p} < ${m})`;if(l){e+=` and forwardBuffer < bufferHighWaterLine (${h} < ${r})`}u(e);return true}if((!l||p>m)&&h>=n){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${h} >= ${n})`;if(l){e+=` and next bandwidth > current bandwidth (${p} > ${m})`}u(e);return true}u(`not ${c} as no switching criteria met`);return false};class Ta extends a["default"].EventTarget{constructor(t){super();const{src:i,withCredentials:s,tech:n,bandwidth:r,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:d,bufferBasedABR:h,leastPixelDiffSelector:p,captionServices:m}=t;if(!i){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:g}=t;if(g===null||typeof g==="undefined"){g=Infinity}ya=a;this.bufferBasedABR=Boolean(h);this.leastPixelDiffSelector=Boolean(p);this.withCredentials=s;this.tech_=n;this.vhs_=n.vhs;this.sourceType_=c;this.useCueTags_=o;this.playlistExclusionDuration=l;this.maxPlaylistRetries=g;this.enableLowInitialPlaylist=u;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:s,maxPlaylistRetries:g,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=ma();this.mediaSource=new e.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=$();this.hasPlayed_=false;this.syncController_=new Qr(t);this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new ea;this.sourceUpdater_=new $r(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new Jr;const y={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:m,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:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new qs(i,this.vhs_,V(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ge(i,this.vhs_,this.requestOptions_);this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new Dr(V(y,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t);this.audioSegmentLoader_=new Dr(V(y,{loaderType:"audio"}),t);this.subtitleSegmentLoader_=new Gr(V(y,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",s);e()}function s(){n.off("vttjsloaded",i);t()}n.one("vttjsloaded",i);n.one("vttjserror",s);n.addWebVttScript_()})}),t);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_());this.tech_.on("pause",()=>this.stopABRTimer_());this.tech_.on("play",()=>this.startABRTimer_())}_a.forEach(e=>{this[e+"_"]=va.bind(this,e)});this.logger_=f("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=(()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()});this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const _=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(_,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_();const t=this.audioAppendsToLoadedData_();if(e===-1||t===-1){return-1}return e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();if(t&&this.shouldSwitchToMedia_(t)){this.switchMedia_(t,e)}}switchMedia_(e,t,i){const s=this.media();const n=s&&(s.id||s.uri);const r=e.id||e.uri;if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${t}`);this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=e.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}e.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const e=this.main();const t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO){return t}const i=e.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const e=i.main||s.length&&i[s[0]];for(const t in e){if(e[t].default){n={label:t};break}}}if(!n){return t}const r=[];for(const t in i){if(i[t][n.label]){const s=i[t][n.label];if(s.playlists&&s.playlists.length){r.push.apply(r,s.playlists)}else if(s.uri){r.push(s)}else if(e.playlists.length){for(let i=0;i<e.playlists.length;i++){const s=e.playlists[i];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===t){r.push(s)}}}}}if(!r.length){return t}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Se(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(e.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load()}pa({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),e);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}});this.mainPlaylistLoader_.on("loadedplaylist",()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let e=this.mainPlaylistLoader_.media();if(!e){this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist){t=this.selectInitialPlaylist()}if(!t){t=this.selectPlaylist()}if(!t||!this.shouldSwitchToMedia_(t)){return}this.initialMedia_=t;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)});this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()});this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Se(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}this.mainPlaylistLoader_.load();this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load();this.tech_.trigger({type:"mediachange",bubbles:true})});this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged"){return}const t=this.stuckAtPlaylistEnd_(e);if(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"})})}handleUpdatedMediaPlaylist(e){if(this.useCueTags_){this.updateAdCues_(e)}this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.updateDuration(!e.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const e in i.AUDIO){for(const t in i.AUDIO[e]){const n=i.AUDIO[e][t];if(!n.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(ya.Playlist.isAes(t)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return ba({buffered:r,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,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",()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}});if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")})}this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended");this.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",e=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:ga})});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e);this.audioSegmentLoader_.on("trackinfo",e);this.mainSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(e=this.selectPlaylist()){if(e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality");this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const e=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(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 false}if(!e.endList){const e=this.seekable();if(!e.length){return false}this.trigger("firstplay");this.tech_.setCurrentTime(e.end(0))}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const e=this.tech_.play();if(typeof e!=="undefined"&&typeof e.then==="function"){e.then(null,e=>{})}}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)===Infinity?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_();if(!t||t.hasVideo){e=e&&this.audioSegmentLoader_.ended_}else{e=this.audioSegmentLoader_.ended_}}if(!e){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length){return false}const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return false}const s=ya.Playlist.playlistEnd(e,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=H}const a=r.end(r.length-1);return a-n<=H&&s-a<=H}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){e=e||this.mainPlaylistLoader_.media();i=i||t.playlistExclusionDuration||this.playlistExclusionDuration;if(!e){this.error=t;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const n=s.filter(ye);const r=n.length===1&&n[0]===e;if(s.length===1&&i!==Infinity){a["default"].log.warn(`Problem encountered with playlist ${e.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){let t=false;s.forEach(i=>{if(i===e){return}const s=i.excludeUntil;if(typeof s!=="undefined"&&s!==Infinity){t=true;delete i.excludeUntil}});if(t){a["default"].log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let o;if(e.playlistErrors_>this.maxPlaylistRetries){o=Infinity}else{o=Date.now()+i*1e3}e.excludeUntil=o;if(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_:a["default"].log.warn;const c=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.`+`${c} Switching to playlist ${l.id}.`);if(l.attributes.AUDIO!==e.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(l.attributes.SUBTITLES!==e.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const d=l.targetDuration/2*1e3||5*1e3;const h=typeof l.lastRequest==="number"&&Date.now()-l.lastRequest<=d;return this.switchMedia_(l,"exclude",r||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(e,t){const i=[];const s=e==="all";if(s||e==="main"){i.push(this.mainPlaylistLoader_)}const n=[];if(s||e==="audio"){n.push("AUDIO")}if(s||e==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;if(t){i.push(t)}});["main","audio","subtitle"].forEach(t=>{const s=this[`${t}SegmentLoader_`];if(s&&(e===t||e==="all")){i.push(s)}});i.forEach(e=>t.forEach(t=>{if(typeof e[t]==="function"){e[t]()}}))}setCurrentTime(e){const t=G(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(t&&t.length){return e}this.mainSegmentLoader_.resetEverything();this.mainSegmentLoader_.abort();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything();this.audioSegmentLoader_.abort()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything();this.subtitleSegmentLoader_.abort()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const e=this.mainPlaylistLoader_.media();if(!e){return 0}if(!e.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return ya.Playlist.duration(e)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_){return}let t=this.mainPlaylistLoader_.media();if(!t){return}let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=ya.Playlist.seekable(t,i,ya.Playlist.liveEdgeDelay(s,t));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){t=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}e=ya.Playlist.seekable(t,i,ya.Playlist.liveEdgeDelay(s,t));if(e.length===0){return}}let r;let a;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);a=this.seekable_.start(0)}if(!e){this.seekable_=n}else if(e.start(0)>n.end(0)||n.start(0)>e.end(0)){this.seekable_=n}else{this.seekable_=$([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===a){return}}this.logger_(`seekable updated [${X(this.seekable_)}]`);this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const e=this.seekable();if(!e.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1)){this.sourceUpdater_.setDuration(e.end(e.length-1))}return}const t=this.tech_.buffered();let i=ya.Playlist.duration(this.mainPlaylistLoader_.media());if(t.length>0){i=Math.max(i,t.end(t.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const e in t){t[e].forEach(e=>{if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(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;const t=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!e?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!t||!i){return false}return true}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=Mn(this.main(),t);const s={};const n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo){s.video=i.video||e.main.videoCodec||j}if(e.main.isMuxed){s.video+=`,${i.audio||e.main.audioCodec||F}`}if(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n){s.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||F;e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(e,t)=>e?U(t):B(t);const a={};let o;["video","audio"].forEach(function(t){if(s.hasOwnProperty(t)&&!r(e[t].isFmp4,s[t])){const i=e[t].isFmp4?"browser":"muxer";a[i]=a[i]||[];a[i].push(s[t]);if(t==="audio"){o=i}}});if(n&&o&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach(i=>{const s=i.attributes&&i.attributes.AUDIO;if(s===e&&i!==t){i.excludeUntil=Infinity}});this.logger_(`excluding audio group ${e} as ${o} does not support codec(s): "${s.audio}"`)}if(Object.keys(a).length){const e=Object.keys(a).reduce((e,t)=>{if(e){e+=", "}e+=`${t} does not support codec(s): "${a[t].join(",")}"`;return e},"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:true,message:e},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];["video","audio"].forEach(t=>{const i=(x(this.sourceUpdater_.codecs[t]||"")[0]||{}).type;const n=(x(s[t]||"")[0]||{}).type;if(i&&n&&i.toLowerCase()!==n.toLowerCase()){e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${s[t]}"`)}});if(e.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!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;const t=[];Object.keys(e).forEach(i=>{const s=e[i];if(t.indexOf(s.id)!==-1){return}t.push(s.id);const n=Mn(this.main,s);const r=[];if(n.audio&&!B(n.audio)&&!U(n.audio)){r.push(`audio codec ${n.audio}`)}if(n.video&&!B(n.video)&&!U(n.video)){r.push(`video codec ${n.video}`)}if(n.text&&n.text==="stpp.ttml.im1t"){r.push(`text codec ${n.text}`)}if(r.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`)}})}excludeIncompatibleVariants_(e){const t=[];const i=this.main().playlists;const s=Rn(x(e));const n=Nn(s);const r=s.video&&x(s.video)[0]||null;const a=s.audio&&x(s.audio)[0]||null;Object.keys(i).forEach(e=>{const s=i[e];if(t.indexOf(s.id)!==-1||s.excludeUntil===Infinity){return}t.push(s.id);const o=[];const l=Mn(this.mainPlaylistLoader_.main,s);const u=Nn(l);if(!l.audio&&!l.video){return}if(u!==n){o.push(`codec count "${u}" !== "${n}"`)}if(!this.sourceUpdater_.canChangeType()){const e=l.video&&x(l.video)[0]||null;const t=l.audio&&x(l.audio)[0]||null;if(e&&r&&e.type.toLowerCase()!==r.type.toLowerCase()){o.push(`video codec "${e.type}" !== "${r.type}"`)}if(t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()){o.push(`audio codec "${t.type}" !== "${a.type}"`)}}if(o.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id}: ${o.join(" && ")}`)}})}updateAdCues_(e){let t=0;const i=this.seekable();if(i.length){t=i.start(0)}zr(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime();const t=Hs.GOAL_BUFFER_LENGTH;const i=Hs.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(t,Hs.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime();const t=Hs.BUFFER_LOW_WATER_LINE;const i=Hs.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(t,Hs.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(t,Hs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Hs.BUFFER_HIGH_WATER_LINE}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Zn(this.inbandTextTracks_,e,this.tech_);Jn({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}}const Sa=(e,t,i)=>s=>{const n=e.main.playlists[t];const r=ge(n);const a=ye(n);if(typeof s==="undefined"){return a}if(s){delete n.disabled}else{n.disabled=true}if(s!==a&&!r){i();if(s){e.trigger("renditionenabled")}else{e.trigger("renditiondisabled")}}return s};class Ea{constructor(e,t,i){const{playlistController_:s}=e;const n=s.fastQualityChange_.bind(s);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width;this.height=e&&e.height;this.bandwidth=t.attributes.BANDWIDTH;this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Mn(s.main(),t);this.playlist=t;this.id=i;this.enabled=Sa(e.playlists,t.id,n)}}const Ia=function(e){e.representations=(()=>{const t=e.playlistController_.main();const i=ke(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;if(!i){return[]}return i.filter(e=>!ge(e)).map((t,i)=>new Ea(e,t,t.id))})};const ka=["seeking","seeked","pause","playing","error"];class Ca{constructor(t){this.playlistController_=t.playlistController;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.checkCurrentTimeTimeout_=null;this.logger_=f("PlaybackWatcher");this.logger_("initialize");const i=()=>this.monitorCurrentTime_();const s=()=>this.monitorCurrentTime_();const n=()=>this.techWaiting_();const r=()=>this.resetTimeUpdate_();const a=this.playlistController_;const o=["main","subtitle","audio"];const l={};o.forEach(e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)};a[`${e}SegmentLoader_`].on("appendsdone",l[e].updateend);a[`${e}SegmentLoader_`].on("playlistupdate",l[e].reset);this.tech_.on(["seeked","seeking"],l[e].reset)});const u=e=>{["main","audio"].forEach(t=>{a[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=(()=>{if(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",n);this.tech_.on(ka,r);this.tech_.on("canplay",s);this.tech_.one("play",i);this.dispose=(()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",n);this.tech_.off(ka,r);this.tech_.off("canplay",s);this.tech_.off("play",i);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);o.forEach(e=>{a[`${e}SegmentLoader_`].off("appendsdone",l[e].updateend);a[`${e}SegmentLoader_`].off("playlistupdate",l[e].reset);this.tech_.off(["seeked","seeking"],l[e].reset)});if(this.checkCurrentTimeTimeout_){e.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()})}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){e.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=e.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];if(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_;const i=t[`${e}SegmentLoader_`];const s=i.buffered_();const n=Z(this[`${e}Buffered_`],s);this[`${e}Buffered_`]=s;if(n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++;this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:J(s)});if(this[`${e}StalledDownloads_`]<10){return}this.logger_(`${e} loader stalled download exclusion`);this.resetSegmentDownloads_(e);this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`});if(e==="subtitle"){return}t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+H>=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.consecutiveUpdates=0;this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e){return false}const t=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const e=t.end(t.length-1);n=e}if(this.beforeSeekableWindow_(t,i)){const e=t.start(0);n=e+(e===t.end(0)?0:H)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${X(t)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const a=this.tech_.buffered();const o=r.audioBuffer?r.audioBuffered():null;const l=r.videoBuffer?r.videoBuffered():null;const u=this.media();const c=u.partTargetDuration?u.partTargetDuration:(u.targetDuration-q)*2;const d=[o,l];for(let e=0;e<d.length;e++){if(!d[e]){continue}const t=te(d[e],i);if(t<c){return false}}const h=K(a,i);if(h.length===0){return false}n=h.start(0)+H;this.logger_(`Buffered region starts (${h.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();const i=G(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.logger_(`Stopped at ${e} while inside a buffered region `+`[${i.start(0)} -> ${i.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();const t=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);this.logger_(`Fell out of live window at time ${t}. Seeking to `+`live point (seekable end) ${i}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(i);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=K(s,t);if(r.length>0){this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(t);return true}return false}afterSeekableWindow_(e,t,i,s=false){if(!e.length){return false}let n=e.end(e.length-1)+H;const r=!i.endList;if(r&&s){n=e.end(e.length-1)+i.targetDuration*3}if(t>n){return true}return false}beforeSeekableWindow_(e,t){if(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e){return}let s;if(e.length&&t.length){const n=G(e,i-3);const r=G(e,i);const a=G(t,i);if(a.length&&!r.length&&n.length){s={start:n.end(0),end:a.end(0)}}}else{const t=K(e,i);if(!t.length){s=this.gapFromVideoUnderflow_(e,i)}}if(s){this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. `+`Seeking to current time ${i}`);return true}return false}skipTheGap_(e){const t=this.tech_.buffered();const i=this.tech_.currentTime();const s=K(t,i);this.resetTimeUpdate_();if(s.length===0||i!==e){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+q);this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=z(e);for(let e=0;e<i.length;e++){const s=i.start(e);const n=i.end(e);if(t-s<4&&t-s>2){return{start:s,end:n}}}return null}}const wa={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:true});const i=t.currentSource_||this.currentSource();return e(i)}};const Aa=function(e,t){let i=0;let s=0;const n=V(wa,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){if(s){e.currentTime(s)}};const o=function(t){if(t===null||t===undefined){return}s=e.duration()!==Infinity&&e.currentTime()||0;e.one("loadedmetadata",r);e.src(t);e.trigger({type:"usage",name:"vhs-error-reload"});e.play()};const l=function(){if(Date.now()-i<n.errorInterval*1e3){e.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!=="function"){a["default"].log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(e,o)};const u=function(){e.off("loadedmetadata",r);e.off("error",l);e.off("dispose",u)};const c=function(t){u();Aa(e,t)};e.on("error",l);e.on("dispose",u);e.reloadSourceOnError=c};const Oa=function(e){Aa(this,e)};var Da="3.2.0";var Pa="6.3.0";var xa="1.1.1";var La="6.0.0";var Ra="4.0.1";const Na={PlaylistLoader:Ge,Playlist:Ce,utils:St,STANDARD_PLAYLIST_SELECTOR:Hn,INITIAL_PLAYLIST_SELECTOR:Kn,lastBandwidthSelector:Hn,movingAverageBandwidthSelector:Wn,comparePlaylistBandwidth:Vn,comparePlaylistResolution:$n,xhr:Ye()};Object.keys(Hs).forEach(e=>{Object.defineProperty(Na,e,{get(){a["default"].log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`);return Hs[e]},set(t){a["default"].log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`);if(typeof t!=="number"||t<0){a["default"].log.warn(`value of Vhs.${e} must be greater than or equal to 0`);return}Hs[e]=t}})});const Ma="videojs-vhs";const Ua=function(e,t){const i=t.media();let s=-1;for(let t=0;t<e.length;t++){if(e[t].id===i.id){s=t;break}}e.selectedIndex_=s;e.trigger({selectedIndex:s,type:"change"})};const Ba=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)});Ua(e,t.playlists)};Na.canPlaySource=function(){return a["default"].log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const Fa=(e,t,i)=>{if(!e){return e}let s={};if(t&&t.attributes&&t.attributes.CODECS){s=Rn(x(t.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=M(s.video);const r=M(s.audio);const a={};for(const i in e){a[i]={};if(r){a[i].audioContentType=r}if(n){a[i].videoContentType=n}if(t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh){a[i].pssh=t.contentProtection[i].pssh}if(typeof e[i]==="string"){a[i].url=e[i]}}return V(e,a)};const ja=(e,t)=>{return e.reduce((e,i)=>{if(!i.contentProtection){return e}const s=t.reduce((e,t)=>{const s=i.contentProtection[t];if(s&&s.pssh){e[t]={pssh:s.pssh}}return e},{});if(Object.keys(s).length){e.push(s)}return e},[])};const Va=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys){return Promise.resolve()}const n=i?s.concat([i]):s;const r=ja(n,Object.keys(t));const a=[];const o=[];r.forEach(t=>{o.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)}));a.push(new Promise((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{if(e){s(e);return}i()})}))});return Promise.race([Promise.all(a),Promise.race(o)])};const $a=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=Fa(t,i,s);if(!n){return false}e.currentSource().keySystems=n;if(n&&!e.eme){a["default"].log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const qa=()=>{if(!e.localStorage){return null}const t=e.localStorage.getItem(Ma);if(!t){return null}try{return JSON.parse(t)}catch(e){return null}};const Ha=t=>{if(!e.localStorage){return false}let i=qa();i=i?V(i,t):t;try{e.localStorage.setItem(Ma,JSON.stringify(i))}catch(e){return false}return i};const Wa=e=>{if(e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(e.substring(e.indexOf(",")+1))}return e};Na.supportsNativeHls=function(){if(!t||!t.createElement){return false}const e=t.createElement("video");if(!a["default"].getTech("Html5").isSupported()){return false}const i=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return i.some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}();Na.supportsNativeDash=function(){if(!t||!t.createElement||!a["default"].getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(t.createElement("video").canPlayType("application/dash+xml"))}();Na.supportsTypeNatively=(e=>{if(e==="hls"){return Na.supportsNativeHls}if(e==="dash"){return Na.supportsNativeDash}return false});Na.isSupported=function(){return a["default"].log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const Ga=a["default"].getComponent("Component");class Ka extends Ga{constructor(e,i,s){super(i,s.vhs);if(typeof s.initialBandwidth==="number"){this.options_.bandwidth=s.initialBandwidth}this.logger_=f("VhsHandler");if(i.options_&&i.options_.playerId){const e=a["default"].getPlayer(i.options_.playerId);this.player_=e}this.tech_=i;this.source_=e;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks){i.overrideNativeAudioTracks(true);i.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(t,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const i=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;if(i&&i.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}});this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())});this.on(this.tech_,"error",function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}});this.on(this.tech_,"play",this.play)}setOptions_(){this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=5*60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const e=qa();if(e&&e.bandwidth){this.options_.bandwidth=e.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(e&&e.throughput){this.options_.throughput=e.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=Hs.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Hs.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{if(typeof this.source_[e]!=="undefined"){this.options_[e]=this.source_[e]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(t,i){if(!t){return}this.setOptions_();this.options_.src=Wa(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=Na;this.options_.sourceType=et(i);this.options_.seekTo=(e=>{this.tech_.setCurrentTime(e)});this.playlistController_=new Ta(this.options_);const s=V({liveRangeSafeTimeDelta:H},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Ca(s);this.playlistController_.on("error",()=>{const e=a["default"].players[this.tech_.options_.playerId];let t=this.playlistController_.error;if(typeof t==="object"&&!t.code){t.code=3}else if(typeof t==="string"){t={message:t,code:3}}e.error(t)});const n=this.options_.bufferBasedABR?Na.movingAverageBandwidthSelector(.55):Na.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this);this.playlistController_.selectInitialPlaylist=Na.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.playlistController_.mainPlaylistLoader_;this.mediaSource=this.playlistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let t=this.playlistController_.mainSegmentLoader_.bandwidth;const i=e.navigator.connection||e.navigator.mozConnection||e.navigator.webkitConnection;const s=1e7;if(this.options_.useNetworkInformationApi&&i){const e=i.downlink*1e3*1e3;if(e>=s&&t>=s){t=Math.max(t,e)}else{t=e}}return t},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;if(this.throughput>0){t=1/this.throughput}else{t=0}const i=Math.floor(1/(e+t));return i},set(){a["default"].log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>J(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>J(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){Ha({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}});this.playlistController_.on("selectedinitialmedia",()=>{Ia(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_=true});this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=e.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");Va({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e);this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const t=$a({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if(e.status!=="output-restricted"){return}const t=this.playlistController_.main();if(!t||!t.playlists){return}const i=[];t.playlists.forEach(e=>{if(e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720){if(!e.excludeUntil||e.excludeUntil<Infinity){e.excludeUntil=Infinity;i.push(e)}}});if(i.length){a["default"].log.warn('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.",...i);this.playlistController_.fastQualityChange_()}});this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=a["default"].players[this.tech_.options_.playerId];if(!e||!e.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=e.qualityLevels();this.playlistController_.on("selectedinitialmedia",()=>{Ba(this.qualityLevels_,this)});this.playlists.on("mediachange",()=>{Ua(this.qualityLevels_,this.playlists)})}static version(){return{"@videojs/http-streaming":Da,"mux.js":Pa,"mpd-parser":xa,"m3u8-parser":La,"aes-decrypter":Ra}}version(){return this.constructor.version()}canChangeType(){return $r.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&e.URL.revokeObjectURL){e.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(e,t){return Dt({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=true,s=2){return Pt({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}const za={name:"videojs-http-streaming",VERSION:Da,canHandleSource(e,t={}){const i=V(a["default"].options,t);return za.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=V(a["default"].options,i);t.vhs=new Ka(e,t,s);t.vhs.xhr=Ye();t.vhs.src(e.src,e.type);return t.vhs},canPlayType(e,t){const i=et(e);if(!i){return""}const s=za.getOverrideNative(t);const n=Na.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e;const i=!(a["default"].browser.IS_ANY_SAFARI||a["default"].browser.IS_IOS);const{overrideNative:s=i}=t;return s}};const Ya=()=>{return U("avc1.4d400d,mp4a.40.2")};if(Ya()){a["default"].getTech("Html5").registerSourceHandler(za,0)}a["default"].VhsHandler=Ka;a["default"].VhsSourceHandler=za;a["default"].Vhs=Na;if(!a["default"].use){a["default"].registerComponent("Vhs",Na)}a["default"].options.vhs=a["default"].options.vhs||{};if(!a["default"].getPlugin||!a["default"].getPlugin("reloadSourceOnError")){a["default"].registerPlugin("reloadSourceOnError",Oa)}i.LOCAL_STORAGE_KEY=Ma;i.Vhs=Na;i.VhsHandler=Ka;i.VhsSourceHandler=za;i.emeKeySystems=Fa;i.expandDataUri=Wa;i.getAllPsshKeySystemsOptions=ja;i.setupEmeOptions=$a;i.simpleTypeFromSourceType=et;i.waitForKeySessionCreation=Va;Object.defineProperty(i,"__esModule",{value:true})});(function(){if(r.getPlugin("perSourceBehaviors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsPerSourceBehaviors=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);var s="3.0.0";const n=i["default"].getTech("Html5");const r=i["default"].registerPlugin||i["default"].plugin;const a=["abort","emptied","loadstart","play"];const o=["abort","emptied"];const l=["ad-playback","ads-ready?","postroll?","preroll?"];const u=e=>l.indexOf(e)>-1;const c=e=>e.usingPlugin("ads")&&typeof e.ads.inAdBreak==="function";const d=(e,t)=>{if(!e.usingPlugin("ads")){return false}if(c(e)){return e.ads.isInAdMode()&&t.type!=="loadstart"}return u(e.ads.state)};const h=function(){const e=[];let t;let r=false;let l;let u=true;const c=t=>{return function(s,n){if(this.perSourceBehaviors.disabled()){return}const r=arguments.length===2;const a=this.currentSrc();const o=[s];const l=i["default"].bind(r?this:s,arguments[arguments.length-1]);const u=(...e)=>{const i=this.currentSrc()!==a;if(this.perSourceBehaviors.disabled()){return}if(i||t){this.off(...o)}if(!i){l(...e)}};u.guid=l.guid;if(!r){o.push(n)}o.push(u);e.push(o);return this.on(...o)}};this.perSourceBehaviors={disable:i["default"].bind(this,function e(){this.clearTimeout(l);l=null;r=true;return r}),disabled(){return r},enable(){r=false;return r},enabled(){return!r},isSrcStable(){return u},VERSION:s};this.onPerSrc=c();this.onePerSrc=c(true);this.on("dispose",()=>{e.length=0});this.on(a,i=>{if(this.perSourceBehaviors.disabled()||l||d(this,i)){return}if(u&&o.indexOf(i.type)>-1){u=false;this.trigger("sourceunstable")}const s=[];const r=e=>s.push({time:Date.now(),event:e});r(i);this.on(n.Events,r);l=this.setTimeout(()=>{const i=this.currentSrc();u=true;l=null;this.off(n.Events,r);if(i&&i!==t){e.forEach(e=>this.off(...e));e.length=0;this.trigger("sourcechanged",{interimEvents:s,from:t,to:i});t=i}},1)})};h.VERSION=s;r("perSourceBehaviors",h);return h})})();(function(){if(r.getPlugin("errors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsErrors=t(e.videojs))})(this,function(e){"use strict";function i(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var s=i(e);var n="6.0.0";const r=s["default"].getComponent("Flash");const a=!s["default"].browser.IS_IPHONE;const o=s["default"].registerPlugin||s["default"].plugin;const l={header:"",code:"",message:"",timeout:45*1e3,backgroundTimeout:300*1e3,dismiss:a,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are "+"connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how "+"to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"},FLASHLS_ERR_CROSS_DOMAIN:{headline:"The video could not be loaded: crossdomain access denied."}}};const u=function(e,i){let a;let o;let c;const d=[];const h=function(e){i.errors=s["default"].mergeOptions(i.errors,e);Object.keys(i.errors).forEach(e=>{const t=i.errors[e];if(!t.type){t.type=e}})};h();const f=function(){if(e.error()&&e.error().code===-2){e.error(null)}e.clearTimeout(o);e.clearTimeout(a);if(c){c=false;e.removeClass("vjs-waiting")}const s=[Infinity,-1];const n=(e,t)=>e.indexOf(t)!==-1;if(t.visibilityState==="hidden"&&(e.muted()||n(s,i.backgroundTimeout))||t.visibilityState==="visible"&&n(s,i.timeout)){return}o=e.setTimeout(function(){if(e.error()||e.paused()||e.ended()){return}c=true;e.addClass("vjs-waiting")},1e3);a=e.setTimeout(function(){if(e.error()||e.paused()||e.ended()){return}e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},t.visibilityState==="hidden"?i.backgroundTimeout:i.timeout)};const p=function(){let t;while(d.length){t=d.shift();e.off(t[0],t[1])}e.clearTimeout(a);e.clearTimeout(o)};const m=function(t,i){const s=function(){if(!e.error()){const t=e.$(".vjs-tech");if(t&&t.type==="application/x-shockwave-flash"&&!t.vjs_getProperty){e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});return}if(e.paused()){return f()}if(e.ended()){return f()}}i.call(this)};e.on(t,s);d.push([t,s])};const g=function(){let i=0;p();f();m(["timeupdate","adtimeupdate"],function(){const t=e.currentTime();if(t!==i){i=t;f()}});e.off(t,"visibilitychange",g);e.on(t,"visibilitychange",g)};const y=function(){if(!e.currentSrc()){e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})}};const _=function(){let n="";let a=e.error();const o=t.createElement("div");let l="";if(!a){return}e.off(t,"visibilitychange",g);a=s["default"].mergeOptions(a,i.errors[a.code||a.type||0]);if(a.message){n=`<div class="vjs-errors-details">${e.localize("Technical details")}\n : <div class="vjs-errors-message">${e.localize(a.message)}</div>\n </div>`}if(a.code===4&&r&&!r.isSupported()){const t=e.localize("If you are using an older browser please try upgrading or installing Flash.");n+=`<span class="vjs-errors-flashmessage">${t}</span>`}const u=e.getChild("errorDisplay");o.className="vjs-errors-dialog";const c=`<div class="vjs-errors-code"><b>${this.localize("Error Code")}:</b> ${a.type||a.code}</div>`;const d=a.code===-2;l=`<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">${this.localize(a.headline)}</h2>\n ${d?"":c}\n ${d?"":n}\n </div>`;const h=u.closeable(!("dismiss"in a)||a.dismiss);if(d){l+=`<div class="vjs-errors-timeout-button-container">\n <button>${this.localize("Reload Video")}</button>\n <button>${this.localize("Dismiss")}</button>\n </div>`;o.innerHTML=l;u.fillWith(o);u.getChild("closeButton").hide();const t=u.el().querySelector(".vjs-errors-timeout-button-container > button:first-child");const i=u.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");e.on(t,"click",function(){const t=e.currentSource();e.reset();e.src(t)});e.on(i,"click",function(){u.close()});u.one("modalclose",()=>{e.off(t);e.off(i)})}else if(h){l+=`<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">${this.localize("OK")}</button>\n </div>`;o.innerHTML=l;u.fillWith(o);u.contentEl().firstChild.appendChild(u.getChild("closeButton").el());const t=u.el().querySelector(".vjs-errors-ok-button");e.on(t,"click",function(){u.close()})}else{o.innerHTML=l;u.fillWith(o)}if(e.currentWidth()<=600||e.currentHeight()<=250){u.addClass("vjs-xs")}u.one("modalclose",()=>e.error(null))};const v=function(){p();e.removeClass("vjs-errors");e.off("play",g);e.off(t,"visibilitychange",g);e.off("play",y);e.off("dispose",v);e.off(["aderror","error"],_)};const b=function(t){v();u(e,s["default"].mergeOptions(l,t))};b.extend=(e=>h(e));b.getAll=(()=>s["default"].mergeOptions(i.errors));b.timeout=function(t){if(typeof t==="undefined"){return i.timeout}if(t!==i.timeout){i.timeout=t;if(!e.paused()){g()}}};b.backgroundTimeout=function(t){if(typeof t==="undefined"){return i.backgroundTimeout}if(t!==i.backgroundTimeout){i.backgroundTimeout=t;if(!e.paused()){g()}}};b.disableProgress=(()=>{});e.on("play",g);e.on("play",y);e.on("dispose",v);e.on(["aderror","contenterror","error"],_);e.ready(()=>{e.addClass("vjs-errors")});if(!e.paused()){g()}b.VERSION=n;e.errors=b};const c=function(e){u(this,s["default"].mergeOptions(l,e))};["extend","getAll"].forEach(e=>{c[e]=function(){s["default"].log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}});c.VERSION=n;o("errors",c);return c})})();(function(){if(r.getPlugin("social")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsSocial=t(e.videojs))})(this,function(i){"use strict";function s(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var n=s(i);const r=n["default"].getComponent("Button");class a extends r{constructor(e,t){super(e,t);this.controlText(this.localize("Share"))}handleClick(){this.showOverlay()}showOverlay(){const e=this.player().socialOverlay;if(e){e.open()}}buildCSSClass(){return`vjs-share-control ${super.buildCSSClass()}`}}function o(e){return e.replace(/\n\r?\s*/g,"")}var l=function e(t){var i="",s=0;for(;s<arguments.length;s++)i+=o(t[s])+(arguments[s+1]||"");return i};const u=n["default"].getComponent("ModalDialog");const c=n["default"].dom||n["default"];const d=[{key:"facebook",title:"Facebook",href:e=>l` https://www.facebook.com/sharer/sharer.php ?u=${e.url} &title=${e.title} `},{key:"google",classSuffix:"gplus",title:"Google+",href:e=>l` https://plus.google.com/share ?url=${e.url} `},{key:"linkedin",title:"LinkedIn",href:e=>l` https://www.linkedin.com/shareArticle ?mini=true &url=${e.url} &title=${e.title} &summary=${e.description} &source=Classic `},{key:"pinterest",title:"Pinterest",href:e=>l` https://pinterest.com/pin/create/button/ ?url=${e.url} &media=${e.poster} &description=${e.title} &is_video=true `},{key:"tumblr",title:"Tumblr",href:e=>l` https://www.tumblr.com/share ?v=3 &u=${e.url} &t=${e.title} `},{key:"twitter",title:"Twitter",href:e=>l` https://twitter.com/intent/tweet ?original_referer=https%3A%2F%2Fabout.twitter.com%2Fresources%2Fbuttons &text=${e.title} &tw_p=tweetbutton &url=${e.url} `}];const h=(e=>{return Object.keys(e).map(t=>`${t}=${e[t]}`).join(",")})({width:600,height:400,top:100,left:100,titlebar:"yes",modal:"yes",resizable:"yes",toolbar:"no",status:1,location:"no",menubar:"no",centerscreen:"yes"});const f=/^\s*(0*[1-5]?\d|0*[1-5]?\d:[0-5]\d|\d+:[0-5]\d:[0-5]\d)\s*$/;class p extends u{constructor(i,s){s.label=s.label||i.localize("Sharing Dialog");super(i,s);this.boundEndscreenHandler_=n["default"].bind(this,this.endscreenHandler_);this.isIframe_=e.parent!=e;this.on("modalfill",this.performSafeDomUpdates);this.on("modalopen",()=>{this.toggleTitleBar("hide");if(i.el().contains(t.activeElement)||t.activeElement===i.el()){const e=this.el().querySelector(".vjs-social-share-links a")||this.el().querySelector(".vjs-social-direct-link input")||this.el().querySelector(".vjs-social-embed-code input");if(e){e.focus()}}});this.on("modalclose",()=>{this.toggleTitleBar("show");this.player().socialButton.el().focus()});this.on(this.contentEl(),"click",this.delegateClick);this.on("modalfill",()=>{const e=this.offsetEl();if(!this.options_.deeplinking){if(e){this.off(e,"change",this.performSafeDomUpdates)}return}if(e){this.on(e,"change",this.performSafeDomUpdates)}});this.on(["beforemodalfill","dipose"],()=>{const e=this.offsetEl();if(e){this.off(e,"change",this.performSafeDomUpdates)}})}directLinkEl(){return this.contentEl().querySelector(".vjs-social-direct-link input")}embedCodeEl(){return this.contentEl().querySelector(".vjs-social-embed-code input")}offsetEl(){return this.contentEl().querySelector(".vjs-social-start-from input")}toggleTitleBar(e){if(this.options_.hasTitleBar){this.player().getChild("titleBar")[e]()}}delegateClick(t){t.preventDefault();if(t.target===this.contentEl().querySelector(".vjs-restart")){this.close();this.player().currentTime(0);this.player().play()}else if(t.target===this.directLinkEl()||t.target===this.embedCodeEl()){t.target.select()}else if(c.hasClass(t.target,"vjs-social-share-link")){e.open(t.target.href,"_blank",h)}}buildCSSClass(){return`vjs-social-overlay ${super.buildCSSClass()}`}performSafeDomUpdates(){const e=this.offsetEl();const t=this.directLinkEl();const i=this.embedCodeEl();if(e){const t=!!e.value&&!f.test(e.value);c.toggleClass(e,"vjs-invalid",t)}if(t){t.value=this.getDirectLink()}if(i){i.value=this.getEmbedCode()}}getEmbedCode(){const e=this.player();const t=this.getPlayerMediaInfo_();const i=e.options();let s;let n;let r;if(e.bcinfo&&e.bcinfo.playerId){s=e.bcinfo.playerId}else{s=i["data-player"]}if(typeof e.getAccountId==="function"){n=e.getAccountId()}else if(e.bcinfo&&e.bcinfo.accountId){n=e.bcinfo.accountId}else{n=i["data-account"]}if(e.bcinfo&&e.bcinfo.embedId){r=e.bcinfo.embedId}else{r=i["data-embed"]||"default"}const a=this.getEmbedUrl_({accountId:n,playerId:s,embedId:r,videoId:t.id?`?videoId=${t.id}`:""});let o="";if(!this.options_.embedCode&&this.options_.embedDimensions){const t=e.currentWidth();const i=e.currentHeight();o=" width='"+t+"' height='"+i+"'"}return this.options_.embedCode||l` <iframe src='${a}'${o} allowfullscreen frameborder=0></iframe> `}setEmbedCode(e=""){this.options_.embedCode=e}getDirectLink(){return this.getVideoUrl_(true)}setDirectLink(e=""){this.options_.url=e}asEndscreen(e){if(typeof e==="boolean"&&this.asEndscreen_!==e){this.asEndscreen_=e;if(e){if(this.player().height()<=300){this.addClass("vjs-social-short-player")}this.addClass("vjs-social-as-endscreen");this.open();this.one("modalclose",()=>this.asEndscreen(false))}else{this.removeClass("vjs-social-short-player");this.removeClass("vjs-social-as-endscreen")}}return this.asEndscreen_}endscreenHandler_(){this.asEndscreen(true)}content(){const e=t.createElement("form");e.innerHTML=l` <h1 class="vjs-social-title">${this.localize("Share")}: ${this.getTitle_()}</h1> <h2 class="vjs-social-description">${this.getDescription_()}</h2> <div class="vjs-social-share-links"> ${this.contentForSocialButtons_(this.options_.services,this.options_.customServices)} </div> ${this.contentForDirectLink_()} ${this.contentForEmbed_()} ${this.contentForRestart_()} `;return e}contentForEmbed_(){if(this.options_.removeEmbed===true){return""}const e=this.localize("Embed Code");const t=this.localize("Read Only: Embed Code");return l` <label class="vjs-social-embed-code" aria-label="${t}"> <span class="vjs-social-label-text">${e}</span> <input type="text" readonly="true" value=""> </label> `}contentForDirectLink_(){const e=this.options_.deeplinking;const t=this.options_.removeDirect!==true;if(!e&&!t){return""}let i="";if(t){const e=this.localize("Direct Link");const t=this.localize("Read Only");const s=t+": "+this.localize("Direct Link To Content");i+=l` <label class="vjs-social-direct-link" aria-label="${s}"> <span class="vjs-social-label-text">${e}</span> <input type="text" readonly="true" value=""> </label> `}if(e){const e=this.localize("Start From");const t=this.localize("The offset must be specified using the following pattern:");const s="hh:mm:ss";const n=f.test(this.options_.offset)?this.options_.offset:"";i+=l` <label class="vjs-social-start-from" aria-label="${e}"> <span class="vjs-social-label-text">${e}</span> <input type="text" title="${t} ${s}" placeholder= "${s}" maxlength="10" value="${n}"> </label> `}return i}contentForRestart_(){if(!this.asEndscreen()){return""}const e=this.localize("Restart");return l` <button class="vjs-restart vjs-icon-replay vjs-button"> <span class="vjs-control-text">${e}</span> </button> `}contentForSocialButtons_(e,t=[]){const i=this.player();const s={description:encodeURIComponent(this.options_.description),poster:encodeURIComponent(i.poster()||""),title:encodeURIComponent(this.getTitle_()),url:encodeURIComponent(this.getVideoUrl_())};t=t.filter(e=>{return!(e.mobileOnly&&!n["default"].browser.IS_IOS&&!n["default"].browser.IS_ANDROID)}).map(e=>{if(e.hrefTemplate&&typeof e.href!=="function"){e.href=(t=>{let i=e.hrefTemplate;for(const e in t){const s=new RegExp(`{{${e}}}`,"g");i=i.replace(s,t[e])}return i})}return e});return d.filter(t=>e[t.key]).concat(t).map((e,t)=>`\n <a href="${e.href(s)}"\n class="vjs-social-share-link ${e.className?e.className:`vjs-icon-${e.classSuffix||e.key}`}"\n aria-label="${i.localize("Share on {{network}}").replace("{{network}}",i.localize(e.title))}"\n title="${i.localize(e.title)}"\n ${e.bgColor?`style="background-color:${e.bgColor}"`:""}\n target="_blank">\n <span class="vjs-control-text">${i.localize(e.title)}</span>\n </a>\n `).join("")}getConvertedOffsetHash_(){if(this.options_.deeplinking){const e=this.offsetEl();const t=this.convertOffset_(e&&e.value||this.options_.offset);if(t){return"#t="+t}}return""}addPlaylistVideoId_(t){const i=this.player();const s=typeof i.playlist==="function"&&i.playlist();if(Array.isArray(s)&&s.length){const n=i.playlist.currentItem();const r=n>-1&&s[n];if(r&&r.id){const i=`${e.location.search?"&":"?"}playlistVideoId=${r.id}`;const s=/([?&])playlistVideoId=[^&]+/;const n=t.match(s);if(n){t=t.replace(s,`${n[1]}playlistVideoId=${r.id}`)}else{t+=i}}}return t}getVideoUrl_(i){let s;if(this.options_.url){s=this.options_.url}else if(this.isIframe_){s=t.referrer;if(!t.referrer){this.options_.removeDirect=true}}else{s=this.addPlaylistVideoId_(e.location.href)}if(i){s+=this.getConvertedOffsetHash_()}return s}getEmbedUrl_(t){if(this.isIframe_){return e.location.href}return l`// ${this.options_.embedDomain}/ ${t.accountId}/ ${t.playerId}_${t.embedId}/ index.html ${t.videoId} ${this.getConvertedOffsetHash_()} `}getPlayerMediaInfo_(){const e=this.player();return e.mediainfo||e.options_["data-media"]||{}}getTitle_(){return this.options_.title||this.getPlayerMediaInfo_().name||""}getDescription_(){return this.options_.description||this.getPlayerMediaInfo_().description||""}convertOffset_(e){let t=0;const i=[1,60,3600];let s="";if(typeof e==="string"){const n=e.split(":");if(n.length>=1&&n.length<=3){for(let e=0;e<n.length;++e){const s=parseInt(n[e],10)*i[n.length-1-e];if(isNaN(s)){return""}t+=s}if(t>=i[2]&&Math.floor(t/i[2])!==0){s=Math.floor(t/i[2])+"h";t=t%i[2]}if(t>=i[1]&&Math.floor(t/i[1])!==0){s+=Math.floor(t/i[1])+"m";t=t%i[1]}if(t>0){s+=t+"s"}}}return s}}p.prototype.options_=n["default"].mergeOptions(u.prototype.options_,{fillAlways:true,temporary:false});var m="4.1.0";const g={title:"",description:"",url:"",label:"",embedCode:"",embedDomain:"players.brightcove.net",embedDimensions:false,deeplinking:false,displayAfterVideo:false,offset:"00:00:00",buttonParent:"controlBar",hasTitleBar:false,removeDirect:false,removeEmbed:false,services:{facebook:true,google:false,twitter:true,tumblr:true,pinterest:true,linkedin:true},customServices:[]};const y=n["default"].getComponent("Component");const _=n["default"].registerPlugin||n["default"].plugin;const v=n["default"].dom||n["default"];const b=function(e){return e instanceof y};const T=function(e){return Object.prototype.toString.call(e)==="[object Object]"};const S=function(e){const t=function(){n["default"].log.warn('Using "show" to open the social plugin overlay is deprecated. Use open() instead!');this.open()};const i=function(){n["default"].log.warn('Using "hide" to close the social plugin overlay is deprecated. Use close() instead!');this.close()};e.show=t;e.hide=i;e.on("beforemodalopen",()=>{delete e.show});e.on("modalopen",()=>{e.show=t});e.on("beforemodalclose",()=>{delete e.hide});e.on("modalclose",()=>{e.hide=i})};const E=function(e,t){const i=t.buttonParent;let s=typeof i==="string"?e.getChild(i):i;if(!b(s)&&i!==g.buttonParent){t.buttonParent=g.buttonParent;s=E(e,t)}return b(s)?s:null};const I=function(e,t){if(T(e.socialSettings)){e.socialButton.dispose()}const i=E(e,t);const s=i.addChild("socialButton",t);i.one(s,"dispose",()=>i.removeChild(s));if(t.buttonParent===g.buttonParent){const e=i.el().querySelector(".vjs-spacer");i.el().insertBefore(s.el(),e.nextSibling)}else if(i===e.titleBar){s.removeClass("vjs-control");v.removeClass(s.$(".vjs-control-text"),"vjs-control-text")}return s};const k=function(e){e.socialOverlay.toggleClass("vjs-social-small",()=>e.currentWidth()<e.breakpoints().small+1)};const C=function(e,t){let i=e.socialOverlay;let s=false;if(i){s=i.opened();i.close()}if(!i||i&&i.options_.temporary){i=e.addChild("socialOverlay",t);S(i);v.addClass(i.$(".vjs-close-button",i),"vjs-icon-cancel");e.one(i,"dispose",()=>{e.off("endscreen",i.boundEndscreenHandler_);e.removeChild(i)})}else{i.options_=n["default"].mergeOptions({},i.options_,t);if(!t.displayAfterVideo){e.off("endscreen",i.boundEndscreenHandler_)}i.fill()}if(t.displayAfterVideo){e.off("endscreen",i.boundEndscreenHandler_);e.on("endscreen",i.boundEndscreenHandler_)}if(s){i.open()}return i};const w=function(e){const t=n["default"].mergeOptions(g,e);if(t.removeDirect){t.deeplinking=false}if(t.displayAfterVideo){this.endscreen()}this.ready(()=>{t.hasTitleBar=b(this.titleBar);this.socialButton=I(this,t);this.socialOverlay=C(this,t);this.socialSettings=t;this.on("loadstart",()=>{this.socialOverlay.close()});const e=()=>k(this);this.on("playerresize",e);this.socialOverlay.on("dispose",()=>{this.off("playerresize",e)});e.call(this)})};w.VERSION=m;n["default"].registerComponent("SocialButton",a);n["default"].registerComponent("SocialOverlay",p);_("social",w);return w});r.addLanguage("ar",{Share:"\u0645\u0634\u0627\u0631\u0643\u0629","Share Video":"\u0645\u0634\u0627\u0631\u0643\u0629 \u0641\u064a\u062f\u064a\u0648","Share via":"\u0645\u0634\u0627\u0631\u0643\u0629 \u0639\u0644\u0649","Share on":"\u0645\u0634\u0627\u0631\u0643\u0629 \u0639\u0644\u0649","Direct Link":"\u0631\u0627\u0628\u0637 \u0645\u0628\u0627\u0634\u0631","Start From":"\u0625\u0628\u062f\u0621 \u0645\u0646","Embed Code":"\u062a\u0636\u0645\u064a\u0646 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629","Sharing Dialog":"\u0646\u0627\u0641\u0630\u0629 \u0627\u0644\u0645\u0634\u0627\u0631\u0643\u0629","Share on {{network}}":"\u0645\u0634\u0627\u0631\u0643\u0629 \u0639\u0644\u0649 {{network}}",Facebook:"\u0641\u064a\u0633\u0628\u0648\u0643",Twitter:"\u062a\u063a\u0631\u064a\u062f",LinkedIn:"\u0644\u064a\u0646\u0643\u062f \u0625\u0646","Google+":"\u062c\u0648\u062c\u0644+",Pinterest:"\u0628\u0646\u062a\u0631\u0633\u062a",Tumblr:"\u062a\u0645\u0628\u0644\u0631","The offset must be specified using the following pattern:":"\u064a\u062c\u0628 \u062a\u062d\u062f\u064a\u062f \u0642\u064a\u0645\u0629 \u0627\u0644\u0625\u0632\u0627\u062d\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0646\u0645\u0637 \u0627\u0644\u062a\u0627\u0644\u064a:","Read Only: Embed Code":"\u0644\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637: \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0627\u0644\u0645\u0631\u0627\u062f \u062a\u0636\u0645\u064a\u0646\u0647\u0627","Read Only":"\u0644\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637","Direct Link To Content":"\u0631\u0627\u0628\u0637 \u0645\u0628\u0627\u0634\u0631 \u0644\u0644\u0645\u062d\u062a\u0648\u0649",Restart:"\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u0628\u062f\u0621"});r.addLanguage("de",{Share:"Teilen","Share Video":"Video teilen","Share via":"Teilen \xfcber","Share on":"Teilen auf","Direct Link":"Direkter Link","Start From":"Start ab","Embed Code":"Einbettungscode","Sharing Dialog":"Teilen-Dialogfenster","Share on {{network}}":"Auf {{network}} teilen","The offset must be specified using the following pattern:":"Der Zeitversatz ist folgenderma\xdfen festzulegen:","Read Only: Embed Code":"Schreibgesch\xfctzt: Einbettungscode","Read Only":"Schreibgesch\xfctzt","Direct Link To Content":"Direkter Link zum Inhalt",Restart:"Erneut starten"});r.addLanguage("es",{Share:"Compartir","Share Video":"Compartir v\xeddeo","Share via":"Compartir a trav\xe9s de","Share on":"Compartir en","Direct Link":"Enlace directo","Start From":"Comenzar desde","Embed Code":"C\xf3digo de incrustaci\xf3n","Sharing Dialog":"Di\xe1logo para compartir","Share on {{network}}":"Compartir en {{network}}","The offset must be specified using the following pattern:":"El offset debe ser especificado usando el siguiente patr\xf3n:","Read Only: Embed Code":"S\xf3lo Lectura: C\xf3digo incrustado","Read Only":"S\xf3lo Lectura","Direct Link To Content":"Enlace directo al contenido",Restart:"Reiniciar"});r.addLanguage("fi",{Share:"Jaa","Share Video":"Jaa video","Share via":"Jakaa kautta","Share on":"Jaa","Direct Link":"Linkki","Start From":"Alkaa alkaen","Embed Code":"Upotuskoodi","Sharing Dialog":"Jakamisikkuna","Share on {{network}}":"Jaa {{network}}issa","The offset must be specified using the following pattern:":"Aloitusaika on m\xe4\xe4ritett\xe4v\xe4 k\xe4ytt\xe4en seuraavaa kaavaa:","Read Only: Embed Code":"Lue ainoastaan: Upotuskoodi","Read Only":"Lue ainoastaan","Direct Link To Content":"Linkki sis\xe4lt\xf6\xf6n",Restart:"Toista uudestaan"});r.addLanguage("fr",{Share:"Partager","Share Video":"Partager la vid\xe9o","Share via":"Partager via","Share on":"Partager sur","Direct Link":"Lien direct","Start From":"Commencer \xe0 partir de","Embed Code":"Code d'int\xe9gration","Sharing Dialog":"Fen\xeatre de partage","Share on {{network}}":"Partager sur {{network}}","The offset must be specified using the following pattern:":"Le d\xe9calage doit \xeatre sp\xe9cifi\xe9 avec le format suivant:","Read Only: Embed Code":"Lecture seule: code d'int\xe9gration","Read Only":"Lecture seule","Direct Link To Content":"Lien direct vers le contenu",Restart:"Red\xe9marrer"});r.addLanguage("gl",{Share:"Compartir","Share Video":"Compartir v\xeddeo","Share via":"Compartir a trav\xe9s de","Share on":"Compartir en","Direct Link":"Enlace directo","Start From":"Comezar dende","Embed Code":"C\xf3digo de incrustaci\xf3n","Sharing Dialog":"Di\xe1logo para compartir","Share on {{network}}":"Compartir en {{network}}","The offset must be specified using the following pattern:":"O offset debe ser especificado empregando o seguinte patr\xf3n:","Read Only: Embed Code":"S\xf3 Lectura: C\xf3digo incrustado","Read Only":"S\xf3 Lectura","Direct Link To Content":"Enlace directo ao contido",Restart:"Reiniciar"});r.addLanguage("ja",{Share:"\u5171\u6709","Share Video":"\u52d5\u753b\u3092\u5171\u6709","Share via":"\u52d5\u753b\u5171\u6709\u65b9\u6cd5","Share on":"\u5171\u6709\u5148","Direct Link":"\u30c0\u30a4\u30ec\u30af\u30c8 \u30ea\u30f3\u30af","Start From":"\u958b\u59cb\u5143","Embed Code":"\u57cb\u3081\u8fbc\u307f\u30b3\u30fc\u30c9","Sharing Dialog":"\u5171\u6709\u30c0\u30a4\u30a2\u30ed\u30b0","Share on {{network}}":"{{network}}\u3067\u30b7\u30a7\u30a2","The offset must be specified using the following pattern:":"\u30aa\u30d5\u30bb\u30c3\u30c8\u306f\u3001\u6b21\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\uff1a","Read Only: Embed Code":"\u8aad\u53d6\u308a\u5c02\u7528\uff1a\u57cb\u3081\u8fbc\u307f\u30b3\u30fc\u30c9","Read Only":"\u8aad\u53d6\u308a\u5c02\u7528","Direct Link To Content":"\u30b3\u30f3\u30c6\u30f3\u30c4\u3078\u306e\u30c0\u30a4\u30ec\u30af\u30c8 \u30ea\u30f3\u30af",Restart:"\u518d\u8d77\u52d5"});r.addLanguage("ko",{Share:"\uacf5\uc720","Share Video":"\ube44\ub514\uc624 \uacf5\uc720","Share via":"\uacf5\uc720 \ubc29\ubc95","Share on":"\uacf5\uc720 \uacf5\uac04","Direct Link":"\uc9c1\uc811 \ub9c1\ud06c","Start From":"\uc2dc\uc791 \uc9c0\uc810","Embed Code":"\uc784\ubca0\ub4dc \ucf54\ub4dc","Sharing Dialog":"\ub300\ud654 \uacf5\uc720","Share on {{network}}":"{{network}}\uc5d0 \uacf5\uc720","The offset must be specified using the following pattern:":"\uc624\ud504\uc14b\uc740 \ubc18\ub4dc\uc2dc \ub2e4\uc74c \ud328\ud134\uc744 \uc0ac\uc6a9\ud558\uc5ec \uba85\uc2dc\ub418\uc5b4\uc57c \ud569\ub2c8\ub2e4:","Read Only: Embed Code":"\uc77d\uae30\ub9cc \uac00\ub2a5: \uc784\ubca0\ub4dc \ucf54\ub4dc","Read Only":"\uc77d\uae30\ub9cc \uac00\ub2a5","Direct Link To Content":"\ucf58\ud150\uce20\uc5d0 \ub300\ud55c \uc9c1\uc811 \ub9c1\ud06c",Restart:"\uc7ac\uc2dc\uc791"});r.addLanguage("pt",{Share:"Partilhar","Share Video":"Partilhar Video","Share via":"Partilhar via","Share on":"Partilhar no","Direct Link":"Link Direto","Start From":"Comecar a partir de","Embed Code":"Codigo de Embed","Share on {{network}}":"Partilhar no","The offset must be specified using the following pattern:":"O offset deve ser especificado utilizando o padrao seguinte:","Read Only: Embed Code":"Modo Leitura: Codigo de Embed","Read Only":"Modo Leitura","Direct Link To Content":"Link Direto ao Conteudo",Restart:"Reiniciar"});r.addLanguage("sv",{Share:"Dela","Share Video":"Dela videon","Share via":"Dela med","Share on":"Dela p\xe5","Direct Link":"L\xe4nk","Start From":"B\xf6rja fr\xe5n","Embed Code":"Inb\xe4ddningskod","Sharing Dialog":"Delningsinformationen","Share on {{network}}":"Dela p\xe5 {{network}}","The offset must be specified using the following pattern:":"F\xf6rskjutningen m\xe5ste anges med f\xf6ljande m\xf6nster:","Read Only: Embed Code":"Skrivskyddad: Inb\xe4ddningskod","Read Only":"Skrivskyddad","Direct Link To Content":"L\xe4nk till inneh\xe5llet",Restart:"Spela igen"});r.addLanguage("tr",{Share:"Payla\u015f","Share Video":"Video'yu Payla\u015f","Share via":"Sosyal a\u011flar","Share on":"Payla\u015f","Direct Link":"Direk Link","Start From":"Ba\u015flang\u0131\xe7","Embed Code":"Yerle\u015ftirme Kodu","Sharing Dialog":"Payla\u015f\u0131m Men\xfcs\xfc","Share on {{network}}":"{{network}}'ta payla\u015f"});r.addLanguage("zh-Hans",{Share:"\u5206\u4eab","Share Video":"\u5206\u4eab\u89c6\u9891","Share via":"\u5206\u4eab\u65b9\u5f0f","Share on":"\u5206\u4eab\u4f4d\u7f6e","Direct Link":"\u76f4\u63a5\u94fe\u63a5","Start From":"\u5f00\u59cb\u4f4d\u7f6e","Embed Code":"\u5d4c\u5165\u4ee3\u7801","Sharing Dialog":"\u5206\u4eab\u5bf9\u8bdd\u6846","Share on {{network}}":"\u5728 {{network}} \u4e0a\u5206\u4eab","The offset must be specified using the following pattern:":"\u5fc5\u987b\u4f7f\u7528\u4ee5\u4e0b\u6a21\u5f0f\u6307\u5b9a\u504f\u79fb\uff1a","Read Only: Embed Code":"\u53ea\u8bfb\uff1a\u5d4c\u5165\u4ee3\u7801","Read Only":"\u53ea\u8bfb","Direct Link To Content":"\u76f4\u63a5\u94fe\u63a5\u5230\u5185\u5bb9",Restart:"\u91cd\u65b0\u5f00\u59cb"});r.addLanguage("zh-Hant",{Share:"\u5206\u4eab","Share Video":"\u5206\u4eab\u8996\u8a0a","Share via":"\u5206\u4eab\u65b9\u5f0f","Share on":"\u5206\u4eab\u4f4d\u7f6e","Direct Link":"\u76f4\u63a5\u9023\u7d50","Start From":"\u958b\u59cb\u4f4d\u7f6e","Embed Code":"\u5167\u5d4c\u7a0b\u5f0f\u78bc","Sharing Dialog":"\u5206\u4eab\u5c0d\u8a71\u65b9\u584a","Share on {{network}}":"\u5728 {{network}} \u5206\u4eab","The offset must be specified using the following pattern:":"\u5fc5\u9808\u4f7f\u7528\u4e0b\u5217\u65b9\u5f0f\u6307\u5b9a\u504f\u79fb\uff1a","Read Only: Embed Code":"\u552f\u8b80\uff1a\u5167\u5d4c\u7a0b\u5f0f\u78bc","Read Only":"\u552f\u8b80","Direct Link To Content":"\u76f4\u63a5\u9023\u7d50\u5230\u5167\u5bb9",Restart:"\u91cd\u65b0\u958b\u59cb"})})();var l=o.createInitializer();a.restoreFirstVideojs();return l}(window,document)}catch(e){t=null;console.error("Unable to initialize Brightcove Player. ",e)}if(t===null||e(t.videojs.browser)){var i=function e(t,i,s){var n,r,a,o,l,u,c,d,h;n=document.createElement("div");r=document.createElement("div");r.setAttribute("style","min-height:10em;display:table-cell;vertical-align:middle;text-align:center;font-family:proxima-nova,sans-serif;color:#fff");n.appendChild(r);a=document.createElement("div");a.setAttribute("style","font-size:32px;margin-bottom:10px");a.innerHTML="Oops! There seems to be a problem...";r.appendChild(a);o=document.createElement("div");o.setAttribute("style","font-size:24px");if(s){o.innerHTML="This browser is not compatible with the Brightcove Player."}else{o.innerHTML="The player has been deactivated by the content owner."}r.appendChild(o);u=[].concat(Array.prototype.slice.call(document.querySelectorAll("video")),Array.prototype.slice.call(document.querySelectorAll("video-js")));for(h=0;h<u.length;h++){c=u[h];if(c.getAttribute("data-player")===t&&c.getAttribute("data-embed")===i){var f,p;l=c.parentElement;p=window.getComputedStyle(l).height;f=window.getComputedStyle(l).width;d="background:#414141;background:-moz-linear-gradient(top,#414141 0,grey 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#414141),color-stop(100%,grey));background:-webkit-linear-gradient(top,#414141 0,grey 100%);background:-o-linear-gradient(top,#414141 0,grey 100%);background:-ms-linear-gradient(top,#414141 0,grey 100%);background:linear-gradient(to bottom,#414141 0,grey 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#414141', endColorstr='#808080', GradientType=0 );display:table;margin:0;padding:0";d+=";width:"+f+";";d+="height:"+p;n.setAttribute("style",d);l.insertBefore(n,c);l.removeChild(c)}}};var s="XvkzQ10d0";var n="default";i(s,n,true);return}t(document.querySelector("video-js"))})();;</script> <script>(function(p){p.mark&&p.mark('bcParseEnd');p.measure&&p.measure('bcParse','bcParseStart','bcParseEnd')})(window.performance||{})</script> </body></html>