From c9351eb69697b808fc047c47629e2eec3421d5d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 26 Nov 2022 22:49:01 +0000 Subject: [PATCH] Bundle embedded web app --- static/web/404.html | 4 ++-- static/web/404/index.html | 4 ++-- .../_buildManifest.js | 2 +- .../_ssgManifest.js | 0 static/web/_next/static/chunks/5372.156686248b75341d.js | 1 + static/web/_next/static/chunks/5372.3546bc48355a0c0e.js | 1 - ...1aeb5-998a8438d86f867e.js => d6e1aeb5-0705bf43bcd6af77.js} | 2 +- static/web/_next/static/chunks/main-032bb01f10a7d678.js | 1 - static/web/_next/static/chunks/main-ae0b54a02d5e7994.js | 1 + ...-6ff3e3e38deacd0c.js => stream-health-6467dc61a002b06b.js} | 2 +- ...ebpack-b8103905b5d2755c.js => webpack-7dd45e3117fbb10c.js} | 2 +- static/web/admin/access-tokens/index.html | 2 +- static/web/admin/actions/index.html | 2 +- static/web/admin/chat/messages/index.html | 2 +- static/web/admin/chat/users/index.html | 2 +- static/web/admin/config-chat/index.html | 2 +- static/web/admin/config-federation/index.html | 2 +- static/web/admin/config-notify/index.html | 2 +- static/web/admin/config-public-details/index.html | 2 +- static/web/admin/config-server-details/index.html | 2 +- static/web/admin/config-social-items/index.html | 2 +- static/web/admin/config-storage/index.html | 2 +- static/web/admin/config-video/index.html | 2 +- static/web/admin/config/appearance/index.html | 2 +- static/web/admin/federation/actions/index.html | 2 +- static/web/admin/federation/followers/index.html | 2 +- static/web/admin/hardware-info/index.html | 2 +- static/web/admin/help/index.html | 2 +- static/web/admin/index.html | 2 +- static/web/admin/logs/index.html | 2 +- static/web/admin/stream-health/index.html | 2 +- static/web/admin/upgrade/index.html | 2 +- static/web/admin/viewer-info/index.html | 2 +- static/web/admin/webhooks/index.html | 2 +- static/web/embed/chat/readonly/index.html | 2 +- static/web/embed/chat/readwrite/index.html | 2 +- static/web/embed/video/index.html | 2 +- static/web/index.html | 4 ++-- 38 files changed, 38 insertions(+), 38 deletions(-) rename static/web/_next/static/{g_4q-fJJbdMggMfQQUKa9 => GdKMh5n5ozblhIUHdH66k}/_buildManifest.js (84%) rename static/web/_next/static/{g_4q-fJJbdMggMfQQUKa9 => GdKMh5n5ozblhIUHdH66k}/_ssgManifest.js (100%) create mode 100644 static/web/_next/static/chunks/5372.156686248b75341d.js delete mode 100644 static/web/_next/static/chunks/5372.3546bc48355a0c0e.js rename static/web/_next/static/chunks/{d6e1aeb5-998a8438d86f867e.js => d6e1aeb5-0705bf43bcd6af77.js} (60%) delete mode 100644 static/web/_next/static/chunks/main-032bb01f10a7d678.js create mode 100644 static/web/_next/static/chunks/main-ae0b54a02d5e7994.js rename static/web/_next/static/chunks/pages/admin/{stream-health-6ff3e3e38deacd0c.js => stream-health-6467dc61a002b06b.js} (98%) rename static/web/_next/static/chunks/{webpack-b8103905b5d2755c.js => webpack-7dd45e3117fbb10c.js} (98%) diff --git a/static/web/404.html b/static/web/404.html index 80ecaac91..9b81f2faa 100644 --- a/static/web/404.html +++ b/static/web/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/404/index.html b/static/web/404/index.html index 80ecaac91..9b81f2faa 100644 --- a/static/web/404/index.html +++ b/static/web/404/index.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/_next/static/g_4q-fJJbdMggMfQQUKa9/_buildManifest.js b/static/web/_next/static/GdKMh5n5ozblhIUHdH66k/_buildManifest.js similarity index 84% rename from static/web/_next/static/g_4q-fJJbdMggMfQQUKa9/_buildManifest.js rename to static/web/_next/static/GdKMh5n5ozblhIUHdH66k/_buildManifest.js index d2e1e49a4..0bf3744ce 100644 --- a/static/web/_next/static/g_4q-fJJbdMggMfQQUKa9/_buildManifest.js +++ b/static/web/_next/static/GdKMh5n5ozblhIUHdH66k/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,a,c,e,i,t,d,n,f,h,o,b,m,u,k,r,g,j,p,l,_,w,v,y,I,B,F){return{__rewrites:{beforeFiles:[],afterFiles:[{source:"/api/:path*"},{source:"/hls/:path*"},{source:"/img/:path*"},{source:"/logo"},{source:"/thumbnail.jpg"}],fallback:[]},"/":[a,s,c,t,d,f,b,m,g,"static/chunks/4466-96a54095a7a235f9.js",h,"static/css/901e2e696ed480dd.css","static/chunks/pages/index-08253d4ef17adb43.js"],"/_error":["static/chunks/pages/_error-02cc11fd74b4e5ff.js"],"/admin":[a,s,c,e,i,t,d,n,o,m,"static/chunks/8676-c38bd41883242e8e.js","static/chunks/pages/admin-75288f493201279e.js"],"/admin/access-tokens":[a,s,c,e,i,"static/chunks/pages/admin/access-tokens-91177ddb58bd90ee.js"],"/admin/actions":[a,s,c,e,"static/chunks/pages/admin/actions-9eeca8440633457f.js"],"/admin/chat/messages":[j,a,s,c,e,i,d,p,"static/chunks/pages/admin/chat/messages-7e88922542839f8a.js"],"/admin/chat/users":[j,a,s,c,e,i,t,d,p,"static/chunks/pages/admin/chat/users-072de9838f91e5fb.js"],"/admin/config/appearance":[l,b,_,w,"static/css/6c8941159bdd16f6.css","static/chunks/pages/admin/config/appearance-be1829febefc4db6.js"],"/admin/config-chat":["static/chunks/pages/admin/config-chat-fab037451220beb1.js"],"/admin/config-federation":["static/chunks/8572-deca358d1a965d80.js","static/chunks/pages/admin/config-federation-3e7e0a54acf1bd9b.js"],"/admin/config-notify":["static/chunks/pages/admin/config-notify-b525013f97b7a9a9.js"],"/admin/config-public-details":[l,a,s,c,e,u,_,"static/chunks/1043-3f08d4917e3aa7e7.js","static/chunks/pages/admin/config-public-details-085c048afcb776d7.js"],"/admin/config-server-details":[v,"static/chunks/pages/admin/config-server-details-a148074a13faf6b7.js"],"/admin/config-social-items":[a,s,c,e,"static/chunks/pages/admin/config-social-items-f022d29681248095.js"],"/admin/config-storage":["static/chunks/pages/admin/config-storage-cbcd9a6a6455390c.js"],"/admin/config-video":[a,s,c,e,v,"static/chunks/6962-f197cc126c73fb7f.js","static/chunks/pages/admin/config-video-5e04088ce814f271.js"],"/admin/federation/actions":[a,s,c,e,i,"static/chunks/pages/admin/federation/actions-d79f77b8b18148ad.js"],"/admin/federation/followers":[a,s,c,e,i,t,"static/chunks/pages/admin/federation/followers-0cddb891db616443.js"],"/admin/hardware-info":[k,i,t,n,o,r,u,"static/chunks/pages/admin/hardware-info-34c5be89db1620b1.js"],"/admin/help":[t,n,b,w,"static/chunks/7830-37f6f9f7aaae2bbf.js","static/chunks/pages/admin/help-1963799991a3eee0.js"],"/admin/logs":[a,s,c,e,i,m,"static/chunks/pages/admin/logs-c494c4dc6f214d8b.js"],"/admin/stream-health":[k,i,t,n,o,r,"static/chunks/2934-4a8cbef0e0cea1a5.js","static/chunks/pages/admin/stream-health-6ff3e3e38deacd0c.js"],"/admin/upgrade":[a,s,c,e,"static/chunks/2069-e3384794326f4767.js","static/chunks/pages/admin/upgrade-41783a74d59f851b.js"],"/admin/viewer-info":[k,a,s,c,e,i,t,d,n,o,r,u,"static/chunks/pages/admin/viewer-info-1518736f920a85d9.js"],"/admin/webhooks":[a,s,c,e,"static/chunks/pages/admin/webhooks-c59eaaf1fe4ac78c.js"],"/embed/chat/readonly":[y,I,f,B,h,F,"static/css/4913162dac9a95fc.css","static/chunks/pages/embed/chat/readonly-67babfd67c1bbe6e.js"],"/embed/chat/readwrite":[y,I,s,f,B,"static/chunks/911-9156415c36038fd8.js",h,F,"static/css/4b32f6bf48cc9a1c.css","static/chunks/pages/embed/chat/readwrite-98f900d6cb9a2d39.js"],"/embed/video":["static/chunks/d6e1aeb5-998a8438d86f867e.js",d,f,"static/css/7c735c05af084bb2.css","static/chunks/7902-139b487986de3737.js",g,h,"static/chunks/2239-ceff4252276e3d5e.js","static/css/f065863129f648da.css","static/chunks/pages/embed/video-58a5d6ba4b2bb819.js"],sortedPages:["/","/_app","/_error","/admin","/admin/access-tokens","/admin/actions","/admin/chat/messages","/admin/chat/users","/admin/config/appearance","/admin/config-chat","/admin/config-federation","/admin/config-notify","/admin/config-public-details","/admin/config-server-details","/admin/config-social-items","/admin/config-storage","/admin/config-video","/admin/federation/actions","/admin/federation/followers","/admin/hardware-info","/admin/help","/admin/logs","/admin/stream-health","/admin/upgrade","/admin/viewer-info","/admin/webhooks","/embed/chat/readonly","/embed/chat/readwrite","/embed/video"]}}("static/chunks/3903-37c1af34070ecbf4.js","static/chunks/8909-a395a0ce823f9797.js","static/chunks/4267-cfe0f573c442773c.js","static/chunks/2206-e3f24e552029bbca.js","static/chunks/8091-5d2e0cdb05cd1ef7.js","static/chunks/4381-3dc1e6927d726454.js","static/chunks/5938-b5bac17e4fa31c49.js","static/chunks/5101-e7798e997c291884.js","static/chunks/6395-e4a02973025beaca.js","static/chunks/7466-1e76829814bac0c3.js","static/chunks/4763-cd081ceb0032736f.js","static/chunks/1082-98b1d2f1eae8f1cb.js","static/chunks/5360-2adf520bd8bbb9c6.js","static/chunks/7910-44b63d030e4b1767.js","static/chunks/ee8b1517-9cf421a7da630c58.js","static/chunks/236-f876fd1a47451d45.js","static/chunks/8245-b34a27e35386277e.js","static/chunks/29107295-1453a3860b50f70e.js","static/chunks/9550-db4a457e5e1bbbcf.js","static/chunks/4ad82c5e-0279a86e0328570f.js","static/chunks/1943-2e24959fcef510e6.js","static/chunks/1938-540c13593ccef671.js","static/chunks/3286-716fef4ced844a4d.js","static/chunks/d3048c20-b61d7fb6003662e6.js","static/chunks/d2094a0f-ffa3d9fcb172f7b4.js","static/chunks/2852-bdd68deecc4d3e7e.js","static/chunks/4977-ecbc50443dc5370e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,a,c,e,i,t,n,d,f,h,o,m,b,u,k,r,g,j,p,l,_,w,v,y,I,B,F){return{__rewrites:{beforeFiles:[],afterFiles:[{source:"/api/:path*"},{source:"/hls/:path*"},{source:"/img/:path*"},{source:"/logo"},{source:"/thumbnail.jpg"}],fallback:[]},"/":[a,s,c,t,n,f,m,b,g,"static/chunks/4466-96a54095a7a235f9.js",h,"static/css/901e2e696ed480dd.css","static/chunks/pages/index-08253d4ef17adb43.js"],"/_error":["static/chunks/pages/_error-02cc11fd74b4e5ff.js"],"/admin":[a,s,c,e,i,t,n,d,o,b,"static/chunks/8676-c38bd41883242e8e.js","static/chunks/pages/admin-75288f493201279e.js"],"/admin/access-tokens":[a,s,c,e,i,"static/chunks/pages/admin/access-tokens-91177ddb58bd90ee.js"],"/admin/actions":[a,s,c,e,"static/chunks/pages/admin/actions-9eeca8440633457f.js"],"/admin/chat/messages":[j,a,s,c,e,i,n,p,"static/chunks/pages/admin/chat/messages-7e88922542839f8a.js"],"/admin/chat/users":[j,a,s,c,e,i,t,n,p,"static/chunks/pages/admin/chat/users-072de9838f91e5fb.js"],"/admin/config/appearance":[l,m,_,w,"static/css/6c8941159bdd16f6.css","static/chunks/pages/admin/config/appearance-be1829febefc4db6.js"],"/admin/config-chat":["static/chunks/pages/admin/config-chat-fab037451220beb1.js"],"/admin/config-federation":["static/chunks/8572-deca358d1a965d80.js","static/chunks/pages/admin/config-federation-3e7e0a54acf1bd9b.js"],"/admin/config-notify":["static/chunks/pages/admin/config-notify-b525013f97b7a9a9.js"],"/admin/config-public-details":[l,a,s,c,e,u,_,"static/chunks/1043-3f08d4917e3aa7e7.js","static/chunks/pages/admin/config-public-details-085c048afcb776d7.js"],"/admin/config-server-details":[v,"static/chunks/pages/admin/config-server-details-a148074a13faf6b7.js"],"/admin/config-social-items":[a,s,c,e,"static/chunks/pages/admin/config-social-items-f022d29681248095.js"],"/admin/config-storage":["static/chunks/pages/admin/config-storage-cbcd9a6a6455390c.js"],"/admin/config-video":[a,s,c,e,v,"static/chunks/6962-f197cc126c73fb7f.js","static/chunks/pages/admin/config-video-5e04088ce814f271.js"],"/admin/federation/actions":[a,s,c,e,i,"static/chunks/pages/admin/federation/actions-d79f77b8b18148ad.js"],"/admin/federation/followers":[a,s,c,e,i,t,"static/chunks/pages/admin/federation/followers-0cddb891db616443.js"],"/admin/hardware-info":[k,i,t,d,o,r,u,"static/chunks/pages/admin/hardware-info-34c5be89db1620b1.js"],"/admin/help":[t,d,m,w,"static/chunks/7830-37f6f9f7aaae2bbf.js","static/chunks/pages/admin/help-1963799991a3eee0.js"],"/admin/logs":[a,s,c,e,i,b,"static/chunks/pages/admin/logs-c494c4dc6f214d8b.js"],"/admin/stream-health":[k,i,t,d,o,r,"static/chunks/2934-4a8cbef0e0cea1a5.js","static/chunks/pages/admin/stream-health-6467dc61a002b06b.js"],"/admin/upgrade":[a,s,c,e,"static/chunks/2069-e3384794326f4767.js","static/chunks/pages/admin/upgrade-41783a74d59f851b.js"],"/admin/viewer-info":[k,a,s,c,e,i,t,n,d,o,r,u,"static/chunks/pages/admin/viewer-info-1518736f920a85d9.js"],"/admin/webhooks":[a,s,c,e,"static/chunks/pages/admin/webhooks-c59eaaf1fe4ac78c.js"],"/embed/chat/readonly":[y,I,f,B,h,F,"static/css/4913162dac9a95fc.css","static/chunks/pages/embed/chat/readonly-67babfd67c1bbe6e.js"],"/embed/chat/readwrite":[y,I,s,f,B,"static/chunks/911-9156415c36038fd8.js",h,F,"static/css/4b32f6bf48cc9a1c.css","static/chunks/pages/embed/chat/readwrite-98f900d6cb9a2d39.js"],"/embed/video":["static/chunks/d6e1aeb5-0705bf43bcd6af77.js",n,f,"static/css/7c735c05af084bb2.css","static/chunks/7902-139b487986de3737.js",g,h,"static/chunks/2239-ceff4252276e3d5e.js","static/css/f065863129f648da.css","static/chunks/pages/embed/video-58a5d6ba4b2bb819.js"],sortedPages:["/","/_app","/_error","/admin","/admin/access-tokens","/admin/actions","/admin/chat/messages","/admin/chat/users","/admin/config/appearance","/admin/config-chat","/admin/config-federation","/admin/config-notify","/admin/config-public-details","/admin/config-server-details","/admin/config-social-items","/admin/config-storage","/admin/config-video","/admin/federation/actions","/admin/federation/followers","/admin/hardware-info","/admin/help","/admin/logs","/admin/stream-health","/admin/upgrade","/admin/viewer-info","/admin/webhooks","/embed/chat/readonly","/embed/chat/readwrite","/embed/video"]}}("static/chunks/3903-37c1af34070ecbf4.js","static/chunks/8909-a395a0ce823f9797.js","static/chunks/4267-cfe0f573c442773c.js","static/chunks/2206-e3f24e552029bbca.js","static/chunks/8091-5d2e0cdb05cd1ef7.js","static/chunks/4381-3dc1e6927d726454.js","static/chunks/5938-b5bac17e4fa31c49.js","static/chunks/5101-e7798e997c291884.js","static/chunks/6395-e4a02973025beaca.js","static/chunks/7466-1e76829814bac0c3.js","static/chunks/4763-cd081ceb0032736f.js","static/chunks/1082-98b1d2f1eae8f1cb.js","static/chunks/5360-2adf520bd8bbb9c6.js","static/chunks/7910-44b63d030e4b1767.js","static/chunks/ee8b1517-9cf421a7da630c58.js","static/chunks/236-f876fd1a47451d45.js","static/chunks/8245-b34a27e35386277e.js","static/chunks/29107295-1453a3860b50f70e.js","static/chunks/9550-db4a457e5e1bbbcf.js","static/chunks/4ad82c5e-0279a86e0328570f.js","static/chunks/1943-2e24959fcef510e6.js","static/chunks/1938-540c13593ccef671.js","static/chunks/3286-716fef4ced844a4d.js","static/chunks/d3048c20-b61d7fb6003662e6.js","static/chunks/d2094a0f-ffa3d9fcb172f7b4.js","static/chunks/2852-bdd68deecc4d3e7e.js","static/chunks/4977-ecbc50443dc5370e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/static/web/_next/static/g_4q-fJJbdMggMfQQUKa9/_ssgManifest.js b/static/web/_next/static/GdKMh5n5ozblhIUHdH66k/_ssgManifest.js similarity index 100% rename from static/web/_next/static/g_4q-fJJbdMggMfQQUKa9/_ssgManifest.js rename to static/web/_next/static/GdKMh5n5ozblhIUHdH66k/_ssgManifest.js diff --git a/static/web/_next/static/chunks/5372.156686248b75341d.js b/static/web/_next/static/chunks/5372.156686248b75341d.js new file mode 100644 index 000000000..ef5407724 --- /dev/null +++ b/static/web/_next/static/chunks/5372.156686248b75341d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5372],{95372:function(e,t,r){r.r(t),r.d(t,{haskell:function(){return g}});var n=/[a-z_]/,a=/[A-Z]/,i=/\d/,o=/[0-9A-Fa-f]/,l=/[0-7]/,u=/[a-z_A-Z0-9'\xa1-\uffff]/,s=/[-!#$%&*+.\/<=>?@\\^|~:]/,f=/[(),;[\]`{}]/,c=/[ \t\v\f]/;function d(e,t){if(e.eatWhile(c))return null;var r,h=e.next();if(f.test(h)){if("{"==h&&e.eat("-")){var p,g="comment";return e.eat("#")&&(g="meta"),t(p=function e(t,r){return 0==r?d:function(n,a){for(var i=r;!n.eol();){var o=n.next();if("{"==o&&n.eat("-"))++i;else if("-"==o&&n.eat("}")&&0==--i)return a(d),t}return a(e(t,i)),t}}(g,1)),p(e,t)}return null}if("'"==h)return(e.eat("\\"),e.next(),e.eat("'"))?"string":"error";if('"'==h)return t(r=m),r(e,t);if(a.test(h))return(e.eatWhile(u),e.eat("."))?"qualifier":"type";if(n.test(h))return e.eatWhile(u),"variable";if(i.test(h)){if("0"==h){if(e.eat(/[xX]/))return e.eatWhile(o),"integer";if(e.eat(/[oO]/))return e.eatWhile(l),"number"}e.eatWhile(i);var g="number";return e.match(/^\.\d+/)&&(g="number"),e.eat(/[eE]/)&&(g="number",e.eat(/[-+]/),e.eatWhile(i)),g}return"."==h&&e.eat(".")?"keyword":s.test(h)?"-"==h&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(s))?(e.skipToEnd(),"comment"):(e.eatWhile(s),"variable"):"error"}function m(e,t){for(;!e.eol();){var r=e.next();if('"'==r)return t(d),"string";if("\\"==r){if(e.eol()||e.eat(c))return t(h),"string";e.eat("&")||e.next()}}return t(d),"error"}function h(e,t){if(e.eat("\\")){var r;return t(r=m),r(e,t)}return e.next(),t(d),"error"}var p=function(){var e={};function t(t){return function(){for(var r=0;r","@","~","=>"),t("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<*","<=","<$>","<*>","=<<","==",">",">=",">>",">>=","^","^^","||","*","*>","**"),t("builtin")("Applicative","Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),t("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","pure","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),e}();let g={name:"haskell",startState:function(){return{f:d}},copyState:function(e){return{f:e.f}},token:function(e,t){var r=t.f(e,function(e){t.f=e}),n=e.current();return p.hasOwnProperty(n)?p[n]:r},languageData:{commentTokens:{line:"--",block:{open:"{-",close:"-}"}}}}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/5372.3546bc48355a0c0e.js b/static/web/_next/static/chunks/5372.3546bc48355a0c0e.js deleted file mode 100644 index ad1f20579..000000000 --- a/static/web/_next/static/chunks/5372.3546bc48355a0c0e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5372],{95372:function(e,t,r){r.r(t),r.d(t,{haskell:function(){return g}});var n=/[a-z_]/,a=/[A-Z]/,i=/\d/,o=/[0-9A-Fa-f]/,l=/[0-7]/,u=/[a-z_A-Z0-9'\xa1-\uffff]/,s=/[-!#$%&*+.\/<=>?@\\^|~:]/,f=/[(),;[\]`{}]/,c=/[ \t\v\f]/;function d(e,t){if(e.eatWhile(c))return null;var r=e.next();if(f.test(r)){if("{"==r&&e.eat("-")){var h,p="comment";return e.eat("#")&&(p="meta"),t(h=function e(t,r){return 0==r?d:function(n,a){for(var i=r;!n.eol();){var o=n.next();if("{"==o&&n.eat("-"))++i;else if("-"==o&&n.eat("}")&&0==--i)return a(d),t}return a(e(t,i)),t}}(p,1)),h(e,t)}return null}if("'"==r)return(e.eat("\\"),e.next(),e.eat("'"))?"string":"error";if('"'==r)return t(m),m(e,t);if(a.test(r))return(e.eatWhile(u),e.eat("."))?"qualifier":"type";if(n.test(r))return e.eatWhile(u),"variable";if(i.test(r)){if("0"==r){if(e.eat(/[xX]/))return e.eatWhile(o),"integer";if(e.eat(/[oO]/))return e.eatWhile(l),"number"}e.eatWhile(i);var p="number";return e.match(/^\.\d+/)&&(p="number"),e.eat(/[eE]/)&&(p="number",e.eat(/[-+]/),e.eatWhile(i)),p}return"."==r&&e.eat(".")?"keyword":s.test(r)?"-"==r&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(s))?(e.skipToEnd(),"comment"):(e.eatWhile(s),"variable"):"error"}function m(e,t){for(;!e.eol();){var r=e.next();if('"'==r)return t(d),"string";if("\\"==r){if(e.eol()||e.eat(c))return t(h),"string";e.eat("&")||e.next()}}return t(d),"error"}function h(e,t){return e.eat("\\")?(t(m),m(e,t)):(e.next(),t(d),"error")}var p=function(){var e={};function t(t){return function(){for(var r=0;r","@","~","=>"),t("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<*","<=","<$>","<*>","=<<","==",">",">=",">>",">>=","^","^^","||","*","*>","**"),t("builtin")("Applicative","Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),t("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","pure","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),e}();let g={name:"haskell",startState:function(){return{f:d}},copyState:function(e){return{f:e.f}},token:function(e,t){var r=t.f(e,function(e){t.f=e}),n=e.current();return p.hasOwnProperty(n)?p[n]:r},languageData:{commentTokens:{line:"--",block:{open:"{-",close:"-}"}}}}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/d6e1aeb5-998a8438d86f867e.js b/static/web/_next/static/chunks/d6e1aeb5-0705bf43bcd6af77.js similarity index 60% rename from static/web/_next/static/chunks/d6e1aeb5-998a8438d86f867e.js rename to static/web/_next/static/chunks/d6e1aeb5-0705bf43bcd6af77.js index fa5d51eba..5095f03ac 100644 --- a/static/web/_next/static/chunks/d6e1aeb5-998a8438d86f867e.js +++ b/static/web/_next/static/chunks/d6e1aeb5-0705bf43bcd6af77.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2544],{85215:function(e,t,i){for(var n,r,a,s,o,l,u,d,c,h,p,f=i(58908),m=i.n(f),g=i(89144),_=i.n(g),v=i(87462),y=i(27537),T=i.n(y),b=i(97326),S=i(94578),k=i(75974),C=i.n(k),E=i(9603),w=i.n(E),I=i(13407),x=i.n(I),P=i(5647),A=i(60136),L=i(80779),O=i(9323),D=i(92260),M=i(8485),R=i(60562),U=i(12955),B=i(84221),N=i.n(B),F=i(68925),j=i(86185),H=i(51489),q="7.20.3",V={},W=function(e,t){return V[e]=V[e]||[],t&&(V[e]=V[e].concat(t)),V[e]},z=function(e,t){var i=W(e).indexOf(t);return!(i<=-1)&&(V[e]=V[e].slice(),V[e].splice(i,1),!0)},G={prefixed:!0},K=[["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"]],Z=K[0],Q=0;Q0?o:0)}if(m().console){var l=m().console[e];l||"debug"!==e||(l=m().console.info||m().console.log),l&&a&&s.test(e)&&l[Array.isArray(n)?"apply":"call"](m().console,n)}},r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw Error('"'+e+'" in not a valid log level');n=e}return n},r.history=function(){return Y?[].concat(Y):[]},r.history.filter=function(e){return(Y||[]).filter(function(t){return RegExp(".*"+e+".*").test(t[0])})},r.history.clear=function(){Y&&(Y.length=0)},r.history.disable=function(){null!==Y&&(Y.length=0,Y=null)},r.history.enable=function(){null===Y&&(Y=[])},r.error=function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-1:0),n=1;n=0)throw Error("class has illegal whitespace characters")}function eA(){return _()===m().document}function eL(e){return er(e)&&1===e.nodeType}function eO(){try{return m().parent!==m().self}catch(e){return!0}}function eD(e){return function(t,i){if(!ex(t))return _()[e](null);ex(i)&&(i=_().querySelector(i));var n=eL(i)?i:_();return n[e]&&n[e](t)}}function eM(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=_().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?($.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?eR(r,i):(r[e]!==i||"tabIndex"===e)&&(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),n&&e0(r,n),r}function eR(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function eU(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function eB(e,t){return(eP(t),e.classList)?e.classList.contains(t):RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)}function eN(e,t){return e.classList?e.classList.add(t):eB(e,t)||(e.className=(e.className+" "+t).trim()),e}function eF(e,t){return e?(e.classList?e.classList.remove(t):(eP(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e):($.warn("removeClass was called with an element that doesn't exist"),null)}function ej(e,t,i){var n=eB(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?eN(e,t):eF(e,t),e}function eH(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function eq(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,n=i.length-1;n>=0;n--){var r=i[n].name,a=i[n].value;("boolean"==typeof e[r]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+","))&&(a=null!==a),t[r]=a}return t}function eV(e,t){return e.getAttribute(t)}function eW(e,t,i){e.setAttribute(t,i)}function ez(e,t){e.removeAttribute(t)}function eG(){_().body.focus(),_().onselectstart=function(){return!1}}function eK(){_().onselectstart=function(){return!0}}function eZ(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(es(e,"height"))),i.width||(i.width=parseFloat(es(e,"width"))),i}}function eQ(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==_()[G.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function eX(e,t){var i={x:0,y:0};if(eE)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=es(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}var o={},l=eQ(t.target),u=eQ(e),d=u.width,c=u.height,h=t.offsetY-(u.top-l.top),p=t.offsetX-(u.left-l.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-u.left,h=t.changedTouches[0].pageY+u.top,eE&&(p-=i.x,h-=i.y)),o.y=1-Math.max(0,Math.min(1,h/c)),o.x=Math.max(0,Math.min(1,p/d)),o}function eY(e){return er(e)&&3===e.nodeType}function e$(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function eJ(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return("function"==typeof e&&(e=e()),eL(e)||eY(e))?e:"string"==typeof e&&/\S/.test(e)?_().createTextNode(e):void 0}).filter(function(e){return e})}function e0(e,t){return eJ(t).forEach(function(t){return e.appendChild(t)}),e}function e1(e,t){return e0(e$(e),t)}function e2(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var e8=eD("querySelector"),e4=eD("querySelectorAll"),e5=Object.freeze({__proto__:null,isReal:eA,isEl:eL,isInFrame:eO,createEl:eM,textContent:eR,prependTo:eU,hasClass:eB,addClass:eN,removeClass:eF,toggleClass:ej,setAttributes:eH,getAttributes:eq,getAttribute:eV,setAttribute:eW,removeAttribute:ez,blockTextSelection:eG,unblockTextSelection:eK,getBoundingClientRect:eZ,findPosition:eQ,getPointerPosition:eX,isTextNode:eY,emptyEl:e$,normalizeContent:eJ,appendContent:e0,insertContent:e1,isSingleLeftClick:e2,$:e8,$$:e4}),e3=!1,e6=function(){if(!1!==l.options.autoSetup){var e=Array.prototype.slice.call(_().getElementsByTagName("video")),t=Array.prototype.slice.call(_().getElementsByTagName("audio")),i=Array.prototype.slice.call(_().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}}function td(e,t,i){if(tn.has(e)){var n=tn.get(e);if(n.handlers){if(Array.isArray(t))return ta(td,e,t,i);var r=function(e,t){n.handlers[t]=[],tr(e,t)};if(void 0===t){for(var a in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},a)&&r(e,a);return}var s=n.handlers[t];if(s){if(!i){r(e,t);return}if(i.guid)for(var o=0;o=t&&(e.apply(void 0,arguments),i=n)}},t_=function(e,t,i,n){void 0===n&&(n=m());var r,a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a},tv=function(){};tv.prototype.allowedEvents_={},tv.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},tu(this,e,t),this.addEventListener=i},tv.prototype.addEventListener=tv.prototype.on,tv.prototype.off=function(e,t){td(this,e,t)},tv.prototype.removeEventListener=tv.prototype.off,tv.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},th(this,e,t),this.addEventListener=i},tv.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},tp(this,e,t),this.addEventListener=i},tv.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ts(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),tc(this,e)},tv.prototype.dispatchEvent=tv.prototype.trigger,tv.prototype.queueTrigger=function(e){var t=this;c||(c=new Map);var i=e.type||e,n=c.get(this);n||(n=new Map,c.set(this,n));var r=n.get(i);n.delete(i),m().clearTimeout(r);var a=m().setTimeout(function(){0===n.size&&(n=null,c.delete(t)),t.trigger(e)},0);n.set(i,a)};var ty=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},tT=function(e){return e instanceof tv||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},tb=function(e,t){tT(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},tS=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},tk=function(e,t,i){if(!e||!e.nodeName&&!tT(e))throw Error("Invalid target for "+ty(t)+"#"+i+"; must be a DOM node or evented object.")},tC=function(e,t,i){if(!tS(e))throw Error("Invalid event type for "+ty(t)+"#"+i+"; must be a non-empty string or array.")},tE=function(e,t,i){if("function"!=typeof e)throw Error("Invalid listener for "+ty(t)+"#"+i+"; must be a function.")},tw=function(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),tk(n,e,i),tC(r,e,i),tE(a,e,i),{isTargetingSelf:s,target:n,type:r,listener:a=tm(e,a)}},tI=function(e,t,i,n){tk(e,e,t),e.nodeName?tf[t](e,i,n):e[t](i,n)},tx={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e&&(this.options_=tM(this.options_,e)),this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return eM(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],l=i;return a&&a[e]?l=a[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r})),l},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[tD(e.name())]=null,this.childNameIndex_[tO(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||tD(t.name));return i&&!a.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}})}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(e,t){return e8(e,t||this.contentEl())},t.$$=function(e,t){return e4(e,t||this.contentEl())},t.hasClass=function(e){return eB(this.el_,e)},t.addClass=function(e){eN(this.el_,e)},t.removeClass=function(e){eF(this.el_,e)},t.toggleClass=function(e,t){ej(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return eV(this.el_,e)},t.setAttribute=function(e,t){eW(this.el_,e,t)},t.removeAttribute=function(e){ez(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t){(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:"auto"===t?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return -1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+tD(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(0===(t=parseFloat(t=es(this.el_,e)))||isNaN(t)){var i="offset"+tD(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(T().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=m().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}});var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){i=null,!0===e&&m().performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=tm(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=tm(this,e),this.clearTimersOnDispose_(),i=m().setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),m().clearTimeout(e)),e},t.setInterval=function(e,t){e=tm(this,e),this.clearTimersOnDispose_();var i=m().setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),m().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=tm(this,e),t=m().requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=tm(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),m().cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i)})}),e.clearingTimersOnDispose_=!1}))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!a)throw Error('Illegal component, "'+t+'"; '+(r?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=tD(t),e.components_||(e.components_={});var s=e.getComponent("Player");if("Player"===t&&s&&s.players){var o=s.players,l=Object.keys(o);if(o&&l.length>0&&l.map(function(e){return o[e]}).every(Boolean))throw Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[tO(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function tj(e,t,i,n){return!function(e,t,i){if("number"!=typeof t||t<0||t>i)throw Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function tH(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw Error("This TimeRanges object is empty")},end:function(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:tj.bind(null,"start",0,e),end:tj.bind(null,"end",1,e)},m().Symbol&&m().Symbol.iterator&&(t[m().Symbol.iterator]=function(){return(e||[]).values()}),t}function tq(e,t){return Array.isArray(e)?tH(e):void 0===e||void 0===t?tH():tH([[e,t]])}function tV(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=tq(0,0));for(var a=0;at&&(n=t),r+=n-i;return r/t}function tW(e){if(e instanceof tW)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:er(e)&&("number"==typeof e.code&&(this.code=e.code),en(this,e)),this.message||(this.message=tW.defaultMessages[this.code]||"")}tF.prototype.supportsRaf_="function"==typeof m().requestAnimationFrame&&"function"==typeof m().cancelAnimationFrame,tF.registerComponent("Component",tF),tW.prototype.code=0,tW.prototype.message="",tW.prototype.status=null,tW.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],tW.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var tz=0;tz=0;n--)if(t[n].enabled){t0(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}(0,S.Z)(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&t0(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,t0(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(t$),t2=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){t2(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty((0,b.Z)(i),"selectedIndex",{get:function(){for(var e=0;e0&&(m().console&&m().console.groupCollapsed&&m().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return $.error(e)}),m().console&&m().console.groupEnd&&m().console.groupEnd()),i.flush()},iu=function(e,t){var i={uri:e},n=is(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),w()(i,tm(this,function(e,i,n){if(e)return $.error(e,i);t.loaded_=!0,"function"!=typeof m().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"===e.type){$.error("vttjs failed to load, stopping trying to process "+t.src);return}return il(n,t)}):il(n,t)}))},id=function(e){function t(t){if(void 0===t&&(t={}),!t.tech)throw Error("A tech was not provided.");var i,n=tM(t,{kind:t9[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=ie[n.mode]||"disabled",a=n.default;("metadata"===n.kind||"chapters"===n.kind)&&(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new t3(i.cues_),o=new t3(i.activeCues_),l=!1;return i.timeupdateHandler=tm((0,b.Z)(i),function(e){if(void 0===e&&(e={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}}),i.tech_.one("dispose",function(){i.stopTracking()}),"disabled"!==r&&i.startTracking(),Object.defineProperties((0,b.Z)(i),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){ie[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||iu(this.src,this),this.stopTracking(),"disabled"!==r&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a0){this.trigger("vttjsloaded");return}var t=_().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),m().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)}},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var ik={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iC={setCurrentTime:1,setMuted:1,setVolume:1},iE={play:1,pause:1};function iw(e){return function(t,i){return t===ib?ib:i[e]?i[e](t):t}}var iI={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"},ix=function(e){return void 0===e&&(e=""),iI[ia(e).toLowerCase()]||""},iP=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0;this.player_.tech(!0)&&!((ey||eg)&&t)&&this.player_.tech(!0).focus(),this.player_.paused()?tK(this.player_.play()):this.player_.pause()}},t}(iD);tF.registerComponent("PosterImage",iM);var iR="#222",iU="#ccc",iB={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 iN(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(7===e.length)i=e.slice(1);else throw 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 iF(e,t,i){try{e.style[t]=i}catch(n){return}}var ij=function(e){function t(t,i,n){r=e.call(this,t,i,n)||this;var r,a=function(e){return r.updateDisplay(e)};return t.on("loadstart",function(e){return r.toggleDisplay(e)}),t.on("texttrackchange",a),t.on("loadedmetadata",function(e){return r.preselectTrack(e)}),t.ready(tm((0,b.Z)(r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks){this.hide();return}t.on("fullscreenchange",a),t.on("playerresize",a),m().addEventListener("orientationchange",a),t.on("dispose",function(){return m().removeEventListener("orientationchange",a)});for(var e=this.options_.playerOptions.tracks||[],i=0;i0;tK(t),this.player_.tech(!0)&&!((ey||eg)&&i)&&this.player_.tech(!0).focus();return}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}var a=function(){return r.focus()};tG(t)?t.then(a,function(){}):this.setTimeout(a,1)},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(iq);iV.prototype.controlText_="Play Video",tF.registerComponent("BigPlayButton",iV);var iW=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){T().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(iq);tF.registerComponent("CloseButton",iW);var iz=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e)}),n.on(t,"pause",function(e){return n.handlePause(e)}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?tK(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e)})},t}(iq);iz.prototype.controlText_="Play",tF.registerComponent("PlayToggle",iz);var iG=function(e,t){var i=Math.floor((e=e<0?0:e)%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),n=(((r=r>0||Math.floor(t/3600)>0?r+":":"")||Math.floor(t/60%60)>=10)&&n<10?"0"+n:n)+":",r+n+(i=i<10?"0"+i:i)},iK=iG;function iZ(e,t){return void 0===t&&(t=e),iK(e,t)}var iQ=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],function(e){return n.updateContent(e)}),n.updateTextNode_(),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=eM("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return i.appendChild(n),this.contentEl_=eM("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=iZ(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,$.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=_().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}}))},i.updateContent=function(e){},t}(tF);iQ.prototype.labelText_="Time",iQ.prototype.controlText_="Time",tF.registerComponent("TimeDisplay",iQ);var iX=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(iQ);iX.prototype.labelText_="Current Time",iX.prototype.controlText_="Current Time",tF.registerComponent("CurrentTimeDisplay",iX);var iY=function(e){function t(t,i){n=e.call(this,t,i)||this;var n,r=function(e){return n.updateContent(e)};return n.on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(iQ);iY.prototype.labelText_="Duration",iY.prototype.controlText_="Duration",tF.registerComponent("DurationDisplay",iY);var i$=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t},t}(tF);tF.registerComponent("TimeDivider",i$);var iJ=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",function(e){return n.updateContent(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(eM("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(iQ);iJ.prototype.labelText_="Remaining Time",iJ.prototype.controlText_="Remaining Time",tF.registerComponent("RemainingTimeDisplay",iJ);var i0=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=eM("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(eM("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(_().createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(tF);tF.registerComponent("LiveDisplay",i0);var i1=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=eM("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(iq);i1.prototype.controlText_="Seek to live, currently playing live",tF.registerComponent("SeekToLive",i1);var i2=function(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))},i8=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=en({tabIndex:0},i),n=en({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||e_||e.preventDefault(),eG(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;eK(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"})),t}},i.getProgress=function(){return Number(i2(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=eX(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){T().isEventKey(t,"Left")||T().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):T().isEventKey(t,"Right")||T().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(tF);tF.registerComponent("Slider",i8);var i4=function(e,t){return i2(e/t*100,0,100).toFixed(2)+"%"},i5=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",function(e){return n.update(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=eM("span",{className:"vjs-control-text"}),n=eM("span",{textContent:this.localize("Loaded")}),r=_().createTextNode(": ");return this.percentageEl_=eM("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=i4(r,n);t.percent_!==s&&(t.el_.style.width=s,eR(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;c--)t.el_.removeChild(a[c-1]);a.length=i.length})},t}(tF);tF.registerComponent("LoadProgressBar",i5);var i3=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=eQ(this.el_),r=eZ(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),l=n.width/2;sn.width&&(l=n.width),l=Math.round(l),this.el_.style.right="-"+l+"px",this.write(i)}},i.write=function(e){eR(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),l=o-t*o;a=(l<1?"":"-")+iZ(l,o)}else a=iZ(i,s);r.update(e,t,a),n&&n()})},t}(tF);tF.registerComponent("TimeTooltip",i3);var i6=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(tF);i6.prototype.options_={children:[]},eE||eh||i6.prototype.options_.children.push("timeTooltip"),tF.registerComponent("PlayProgressBar",i6);var i7=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},t}(tF);i7.prototype.options_={children:["timeTooltip"]},tF.registerComponent("MouseTimeDisplay",i7);var i9=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}(0,S.Z)(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=tm(this,this.update),this.update=tg(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _()&&"visibilityState"in _()&&this.on(_(),"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===_().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==_().visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),(i.currentTime_!==e||i.duration_!==r)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[iZ(e,r),iZ(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(eZ(i.el()),i.getProgress())}),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){e2(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),e2(e)){t||this.player_.scrubbing()||this.player_.scrubbing(!0);var i,n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99){r.seekToLiveEdge();return}var a=r.seekableStart(),s=r.liveCurrentTime();if((i=a+n*r.liveWindow())>=s&&(i=s),i<=a&&(i=a+.1),i===1/0)return}else(i=n*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?tK(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(T().isEventKey(t,"Space")||T().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(T().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(T().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(T()(t))){t.preventDefault(),t.stopPropagation();var n=(T().codes[T()(t)]-T().codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else T().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):T().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _()&&"visibilityState"in _()&&this.off(_(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(i8);i9.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},eE||eh||i9.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),tF.registerComponent("SeekBar",i9);var ne=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=tg(tm((0,b.Z)(n),n.handleMouseMove),30),n.throttledHandleMouseSeek=tg(tm((0,b.Z)(n),n.handleMouseSeek),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=eQ(r),s=eX(r,e).x;s=i2(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&tK(this.player_.play())}},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var 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_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");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_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(tF);ne.prototype.options_={children:["seekBar"]},tF.registerComponent("ProgressControl",ne);var nt=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e)}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e)}),n.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){_().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(iq);nt.prototype.controlText_="Picture-in-Picture",tF.registerComponent("PictureInPictureToggle",nt);var ni=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e)}),!1===_()[t.fsApi_.fullscreenEnabled]&&n.disable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(iq);ni.prototype.controlText_="Fullscreen",tF.registerComponent("FullscreenToggle",ni);var nn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},nr=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(tF);tF.registerComponent("VolumeLevel",nr);var na=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=eZ(this.el_),a=eZ(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,l=e.width-s+(a.right-e.right),u=r.width/2;or.width&&(u=r.width),this.el_.style.right="-"+u+"px"}this.write(n+"%")},i.write=function(e){eR(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r()})},t}(tF);tF.registerComponent("VolumeLevelTooltip",na);var ns=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"})},t}(tF);ns.prototype.options_={children:["volumeLevelTooltip"]},tF.registerComponent("MouseVolumeLevelDisplay",ns);var no=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",function(e){return n.updateLastVolume_(e)}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e)}),t.ready(function(){return n.updateARIAAttributes()}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){e2(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=eZ(i),r=this.vertical(),a=eX(i,e);a=i2(a=r?a.y:a.x,0,1),t.update(n,a,r)}e2(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(i8);no.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},eE||eh||no.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),no.prototype.playerEvent="volumechange",tF.registerComponent("VolumeBar",no);var nl=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||ea(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,nn((0,b.Z)(n),t),n.throttledHandleMouseMove=tg(tm((0,b.Z)(n),n.handleMouseMove),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",function(e){return n.handleMouseDown(e)}),n.on("touchstart",function(e){return n.handleMouseDown(e)}),n.on("mousemove",function(e){return n.handleMouseMove(e)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var 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_)},i.handleMouseUp=function(e){var 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_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(tF);nl.prototype.options_={children:["volumeBar"]},tF.registerComponent("VolumeControl",nl);var nu=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},nd=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,nu((0,b.Z)(n),t),n.on(t,["loadstart","volumechange"],function(e){return n.update(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;eE&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)eF(this.el_,"vjs-vol-"+i);eN(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(iq);nd.prototype.controlText_="Mute",tF.registerComponent("MuteToggle",nd);var nc=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||ea(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e)}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e)}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e)}),n.on("keydown",function(e){return n.handleKeyPress(e)}),n.on("mouseover",function(e){return n.handleMouseOver(e)}),n.on("mouseout",function(e){return n.handleMouseOut(e)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}(0,S.Z)(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){T().isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),tu(_(),"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),td(_(),"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){T().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(tF);nc.prototype.options_={children:["muteToggle","volumeControl"]},tF.registerComponent("VolumePanel",nc);var nh=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e)}),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}(0,S.Z)(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof tF&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof tF&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=eM(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),tu(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||_().activeElement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(Array.isArray(t)){var i=t.filter(function(t){return t.el()===e.target})[0];i&&"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}},i.handleKeyDown=function(e){T().isEventKey(e,"Left")||T().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(T().isEventKey(e,"Right")||T().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(tF);tF.registerComponent("Menu",nh);var np=function(e){function t(t,i){void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new iq(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var n,r=iq.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),tu(_(),"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(e){return n.handleMouseLeave(e)}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},i.createMenu=function(){var e=new nh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=eM("li",{className:"vjs-menu-title",textContent:tD(this.options_.title),tabIndex:-1}),i=new tF(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(n_);tF.registerComponent("OffTextTrackMenuItem",nv);var ny=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return(0,S.Z)(t,e),t.prototype.createItems=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=n_),this.label_&&(i=this.label_+" off"),e.push(new nv(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var i,n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(nf);tF.registerComponent("TextTrackButton",ny);var nT=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(tD(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(tD(n.label_)),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(t.push(new nC(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,nw)},t}(ny);nI.prototype.kinds_=["captions","subtitles"],nI.prototype.controlText_="Subtitles",tF.registerComponent("SubsCapsButton",nI);var nx=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=Array(e),i=0;i=0;i--)t.push(new nA(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var t=this.player().playbackRate(),i=this.playbackRates(),n=(i.indexOf(t)+1)%i.length;this.player().playbackRate(i[n])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(np);nL.prototype.controlText_="Playback Rate",tF.registerComponent("PlaybackRateMenuButton",nL);var nO=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n)},t}(tF);tF.registerComponent("Spacer",nO);var nD=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},t}(nO);tF.registerComponent("CustomControlSpacer",nD);var nM=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(tF);nM.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in _()&&nM.prototype.options_.children.splice(nM.prototype.options_.children.length-1,0,"pictureInPictureToggle"),tF.registerComponent("ControlBar",nM);var nR=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",function(e){return n.open(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(tY);nR.prototype.options_=(0,v.Z)({},tY.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),tF.registerComponent("ErrorDisplay",nR);var nU="vjs-text-track-settings",nB=["#000","Black"],nN=["#00F","Blue"],nF=["#0FF","Cyan"],nj=["#0F0","Green"],nH=["#F0F","Magenta"],nq=["#F00","Red"],nV=["#FFF","White"],nW=["#FF0","Yellow"],nz=["1","Opaque"],nG=["0.5","Semi-Transparent"],nK=["0","Transparent"],nZ={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[nB,nV,nq,nj,nN,nW,nH,nF]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[nz,nG,nK]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[nV,nB,nq,nj,nN,nW,nH,nF]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[nz,nG]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[nK,nG,nz]}};function nQ(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}nZ.windowColor.options=nZ.backgroundColor.options;var nX=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind((0,b.Z)(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=eM("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),ei(nZ,function(e){n.on(n.$(e.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}(0,S.Z)(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=nZ[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},i.createElColors_=function(){return eM("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return eM("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return eM("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e,t=this;return e=function(e,i,n){var r,a,s=(r=t.$(i.selector),a=i.parser,nQ(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[n]=s),e},et(nZ).reduce(function(t,i){return e(t,nZ[i],i)},{})},i.setValues=function(e){var t=this;ei(nZ,function(i,n){!function(e,t,i){if(t){for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(_(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(tF);tF.registerComponent("LiveTracker",nJ);var n0=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ew?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){$(t,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;return this.el_.duration===1/0&&eh&&e_&&0===this.el_.currentTime?(this.on("timeupdate",function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))}),NaN):this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)})}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=m().navigator&&m().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)tK(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},i.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},i.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=_().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)(t===i[n]||t===i[n].track)&&this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),m().performance&&"function"==typeof m().performance.now?e.creationTime=m().performance.now():m().performance&&m().performance.timing&&"number"==typeof m().performance.timing.navigationStart&&(e.creationTime=m().Date.now()-m().performance.timing.navigationStart),e},t}(iv);n3(n6,"TEST_VID",function(){if(eA()){var e=_().createElement("video"),t=_().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),n6.isSupported=function(){try{n6.TEST_VID.volume=.5}catch(e){return!1}return!!(n6.TEST_VID&&n6.TEST_VID.canPlayType)},n6.canPlayType=function(e){return n6.TEST_VID.canPlayType(e)},n6.canPlaySource=function(e,t){return n6.canPlayType(e.type)},n6.canControlVolume=function(){try{var e=n6.TEST_VID.volume;n6.TEST_VID.volume=e/2+.1;var t=e!==n6.TEST_VID.volume;if(t&&eE)return m().setTimeout(function(){n6&&n6.prototype&&(n6.prototype.featuresVolumeControl=e!==n6.TEST_VID.volume)}),!1;return t}catch(i){return!1}},n6.canMuteVolume=function(){try{var e=n6.TEST_VID.muted;return n6.TEST_VID.muted=!e,n6.TEST_VID.muted?eW(n6.TEST_VID,"muted","muted"):ez(n6.TEST_VID,"muted","muted"),e!==n6.TEST_VID.muted}catch(t){return!1}},n6.canControlPlaybackRate=function(){if(eh&&e_&&ev<58)return!1;try{var e=n6.TEST_VID.playbackRate;return n6.TEST_VID.playbackRate=e/2+.1,e!==n6.TEST_VID.playbackRate}catch(t){return!1}},n6.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(_().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(_().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(_().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(_().createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},n6.supportsNativeTextTracks=function(){return ew||eE&&e_},n6.supportsNativeVideoTracks=function(){return!!(n6.TEST_VID&&n6.TEST_VID.videoTracks)},n6.supportsNativeAudioTracks=function(){return!!(n6.TEST_VID&&n6.TEST_VID.audioTracks)},n6.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){var t=e[0],i=e[1];n3(n6.prototype,t,function(){return n6[i]()},!0)}),n6.prototype.featuresVolumeControl=n6.canControlVolume(),n6.prototype.movingMediaElementInDOM=!eE,n6.prototype.featuresFullscreenResize=!0,n6.prototype.featuresProgressEvents=!0,n6.prototype.featuresTimeupdateEvents=!0,n6.prototype.featuresVideoFrameCallback=!!(n6.TEST_VID&&n6.TEST_VID.requestVideoFrameCallback),n6.patchCanPlayType=function(){!(ep>=4)||em||e_||(h=n6.TEST_VID&&n6.TEST_VID.constructor.prototype.canPlayType,n6.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":h.call(this,e)})},n6.unpatchCanPlayType=function(){var e=n6.TEST_VID.constructor.prototype.canPlayType;return h&&(n6.TEST_VID.constructor.prototype.canPlayType=h),e},n6.patchCanPlayType(),n6.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(t){}}()}},n6.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){n6.prototype["set"+tD(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){n6.prototype["set"+tD(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]()}}),iv.withSourceHandlers(n6),n6.nativeSourceHandler={},n6.nativeSourceHandler.canPlayType=function(e){try{return n6.TEST_VID.canPlayType(e)}catch(t){return""}},n6.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return n6.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ia(e.src);return n6.nativeSourceHandler.canPlayType("video/"+i)}return""},n6.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},n6.nativeSourceHandler.dispose=function(){},n6.registerSourceHandler(n6.nativeSourceHandler),iv.registerTech("Html5",n6);var n7=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],n9={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},re=["tiny","xsmall","small","medium","large","xlarge","huge"],rt={};re.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;rt[e]="vjs-layout-"+t});var ri={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},rn=function(e){function t(i,n,r){if(i.id=i.id||n.id||"vjs_video_"+ti++,(n=en(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language){if("function"==typeof i.closest){var a,s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(eq(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break}o=o.parentNode}}if((a=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=J(a.id_),a.fsApi_=G,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&eq(i),a.language(a.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach(function(e){l[e.toLowerCase()]=n.languages[e]}),a.languages_=l}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(e){if("function"!=typeof a[e])throw Error('plugin "'+e+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),tP((0,b.Z)(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(tu(_(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var u=tM(a.options_);n.plugins&&Object.keys(n.plugins).forEach(function(e){a[e](n.plugins[e])}),n.debug&&a.debug(!0),a.options_.playerOptions=u,a.middleware_=[],a.playbackRates(n.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),eS&&a.addClass("vjs-touch-enabled"),eE||a.addClass("vjs-workinghover"),t.players[a.id_]=(0,b.Z)(a);var d=q.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",function(e){return a.listenForUserActivity_(e)}),a.on("stageclick",function(e){return a.handleStageClick_(e)}),a.on("keydown",function(e){return a.handleKeyDown(e)}),a.on("languagechange",function(e){return a.handleLanguagechange(e)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}(0,S.Z)(t,e);var i=t.prototype;return i.dispose=function(){var i,n=this;this.trigger("dispose"),this.off("dispose"),td(_(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),td(_(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),i=this,iT[i.id()]=null,i_.names.forEach(function(e){var t=n[i_[e].getterName]();t&&t.off&&t.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=eq(i);if(r){for(t=this.el_=i,i=this.tag=_().createElement("video");t.children.length;)i.appendChild(t.firstChild);eB(t,"video-js")||eN(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e]}catch(n){}})}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",(ey||e_&&eb)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==m().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=te("vjs-styles-dimensions");var s=e8(".vjs-styles-defaults"),o=e8("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var l=i.getElementsByTagName("a"),u=0;u=0&&(a.width=n),r>=0&&(a.height=r));return}var s=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*o,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),tt(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*o+"%;\n }\n ")},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=tD(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(iv.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};i_.names.forEach(function(e){var t=i_[e];s[t.getterName]=i[t.privateName]}),en(s,this.options_[n]),en(s,this.options_[r]),en(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=iv.getTech(e);if(!o)throw Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(tm(this,this.handleTechReady_),!0),tQ.jsonToTextTracks(this.textTracksJson_||[],this.tech_),n7.forEach(function(e){i.on(i.tech_,e,function(t){return i["handleTech"+tD(e)+"_"](t)})}),Object.keys(n9).forEach(function(e){i.on(i.tech_,e,function(t){if(0===i.tech_.playbackRate()&&i.tech_.seeking()){i.queuedCallbacks_.push({callback:i["handleTech"+n9[e]+"_"].bind(i),event:t});return}i["handleTech"+n9[e]+"_"](t)})}),this.on(this.tech_,"loadstart",function(e){return i.handleTechLoadStart_(e)}),this.on(this.tech_,"sourceset",function(e){return i.handleTechSourceset_(e)}),this.on(this.tech_,"waiting",function(e){return i.handleTechWaiting_(e)}),this.on(this.tech_,"ended",function(e){return i.handleTechEnded_(e)}),this.on(this.tech_,"seeking",function(e){return i.handleTechSeeking_(e)}),this.on(this.tech_,"play",function(e){return i.handleTechPlay_(e)}),this.on(this.tech_,"firstplay",function(e){return i.handleTechFirstPlay_(e)}),this.on(this.tech_,"pause",function(e){return i.handleTechPause_(e)}),this.on(this.tech_,"durationchange",function(e){return i.handleTechDurationChange_(e)}),this.on(this.tech_,"fullscreenchange",function(e,t){return i.handleTechFullscreenChange_(e,t)}),this.on(this.tech_,"fullscreenerror",function(e,t){return i.handleTechFullscreenError_(e,t)}),this.on(this.tech_,"enterpictureinpicture",function(e){return i.handleTechEnterPictureInPicture_(e)}),this.on(this.tech_,"leavepictureinpicture",function(e){return i.handleTechLeavePictureInPicture_(e)}),this.on(this.tech_,"error",function(e){return i.handleTechError_(e)}),this.on(this.tech_,"posterchange",function(e){return i.handleTechPosterChange_(e)}),this.on(this.tech_,"textdata",function(e){return i.handleTechTextData_(e)}),this.on(this.tech_,"ratechange",function(e){return i.handleTechRateChange_(e)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||eU(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;i_.names.forEach(function(t){var i=i_[t];e[i.privateName]=e[i.getterName]()}),this.textTracksJson_=tQ.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&$.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},i.manualAutoplay_=function(e){var t,i=this;if(this.tech_&&"string"==typeof e){var n=function(){var e=i.muted();i.muted(!0);var t=function(){i.muted(e)};i.playTerminatedQueue_.push(t);var n=i.play();if(tG(n))return n.catch(function(e){throw t(),Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))})};if("any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():n():tG(t=this.play())&&(t=t.catch(n)),tG(t))return t.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=iP(this,t)),this.cache_.source=tM({},e,{src:t,type:i});for(var n=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],a=this.$$("source"),s=[],o=0;o0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))})},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&($.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?tK(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=_()[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},i.handleTechFullscreenChange_=function(e,t){var i=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){i.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},i.techCall_=function(e,t){this.ready(function(){if(e in iC){var i;return i=this.middleware_,this.tech_[e](i.reduce(iw(e),t))}if(e in iE)return iS(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw $(n),n}},!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in ik){var t,i;return t=this.middleware_,i=this.tech_,t.reduceRight(iw(e),i[e]())}if(e in iE)return iS(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){if(void 0===this.tech_[e])throw $("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",n),n;if("TypeError"===n.name)throw $("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n;throw $(n),n}}},i.play=function(){var e=this,t=this.options_.Promise||m().Promise;return t?new t(function(t){e.play_(t)}):this.play_()},i.play_=function(e){var t=this;void 0===e&&(e=tK),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i){this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!i&&(ew||eE)&&this.load();return}var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||tq(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){if(void 0!==e){if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e===this.cache_.duration||(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=tq(0,0)),e},i.bufferedPercent=function(){return tV(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;if(void 0!==e){t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return isNaN(t=parseFloat(this.techGet_("volume")))?1:t},i.muted=function(e){if(void 0!==e){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0!==e&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},i.requestFullscreen=function(e){var t=this.options_.Promise||m().Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),n(t)}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n))})}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0===e||(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),n}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||m().Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),e()}function a(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i))})}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=_()[this.fsApi_.exitFullscreen]();return t&&tK(t.then(function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=_().documentElement.style.overflow,tu(_(),"keydown",this.boundFullWindowOnEscKey_),_().documentElement.style.overflow="hidden",eN(_().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){T().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,td(_(),"keydown",this.boundFullWindowOnEscKey_),_().documentElement.style.overflow=this.docOrigOverflow,eF(_().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){if(void 0!==e){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in _()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in _())return _().exitPictureInPicture()},i.handleKeyDown=function(e){var t,i,n=this.options_.userActions;n&&n.hotkeys&&(i=(t=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),t.isContentEditable||("input"===i?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(i))||("function"==typeof n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=t.muteKey,r=t.playPauseKey;if((void 0===i?function(e){return T().isEventKey(e,"f")}:i).call(this,e)){e.preventDefault(),e.stopPropagation();var a=tF.getComponent("FullscreenToggle");!1!==_()[this.fsApi_.fullscreenEnabled]&&a.prototype.handleClick.call(this,e)}else(void 0===n?function(e){return T().isEventKey(e,"m")}:n).call(this,e)?(e.preventDefault(),e.stopPropagation(),tF.getComponent("MuteToggle").prototype.handleClick.call(this,e)):(void 0===r?function(e){return T().isEventKey(e,"k")||T().isEventKey(e,"Space")}:r).call(this,e)&&(e.preventDefault(),e.stopPropagation(),tF.getComponent("PlayToggle").prototype.handleClick.call(this,e))},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void i.triggerReady());!function(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}(r,i.tech_)}),this.options_.retryOnError&&n.length>1){var r=function(){i.error(null),i.handleSrc_(n.slice(1),!0)},a=function(){i.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",a)}}},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||((t=r.tech,i=this.techName_,tD(t)!==tD(i))?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,t=this.options_.Promise||m().Promise;this.paused()||!t?this.doReset_():tK(this.play().then(function(){return e.doReset_()}))},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),tT(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){if(void 0!==e){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},i.autoplay=function(e){var t;if(void 0===e)return this.options_.autoplay||!1;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){if(void 0!==e){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(W("beforeerror").forEach(function(i){var n=i(t,e);if(!(er(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n)){t.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),this.one("loadstart",function(){this.off(["click","touchstart"],i)});return}if(null===e){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new tW(e),this.addClass("vjs-error"),$.error("(CODE:"+this.error_.code+" "+tW.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),W("error").forEach(function(e){return e(t,t.error_)})},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n,r=tm(this,this.reportUserActivity),a=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,r())}),this.on("mouseup",a),this.on("mouseleave",a);var s=this.getChild("controlBar");!s||eE||eh||(s.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);var e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},i.playbackRate=function(e){if(void 0!==e){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0!==e){this.isAudio_=!!e;return}return!!this.isAudio_},i.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();t.forEach(function(t){t!==i&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")},i.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},i.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var i=this.options_.Promise||m().Promise;if(i){if(e){var n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),i.all(n).then(function(){return t.enableAudioOnlyUI_()})}return i.resolve().then(function(){return t.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},i.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var i=this.options_.Promise||m().Promise;if(i)return e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.disablePosterModeUI_()});if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),tT(this)&&this.trigger("languagechange"))},i.languages=function(){return tM(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=tM(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){}},rS=1/30,rk=3*(1/30),rC=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t})},rw=function(e,t){return rC(e,function(e){return e-rS>=t})},rI=function(e){if(e.length<2)return rg.createTimeRanges();for(var t=[],i=1;i "+e.end(i));return t.join(", ")},rA=function(e){for(var t=[],i=0;ia)){if(t>r&&t<=a){i+=a-t;continue}i+=a-r}}return i},rM=rg.createTimeRange,rR=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},rU=function(e){return(e.segments||[]).reduce(function(e,t,i){return t.parts?t.parts.forEach(function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e},[])},rB=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},rN=function(e){var t=e.preloadSegment;if(t){var i=t.parts;return(t.preloadHints||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0)+(i&&i.length?i.length:0)}},rF=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=rB(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},rj=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=rR(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},rH=function(e,t){for(var i,n=0,r=t-e.mediaSequence;rr){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;oDate.now()},rK=function(e){return e.excludeUntil&&e.excludeUntil===1/0},rZ=function(e){var t=rG(e);return!e.disabled&&!t},rQ=function(e,t){return t.attributes&&t.attributes[e]},rX=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!rZ(e)&&(e.attributes.BANDWIDTH||0)0)for(var h=u-1;h>=0;h--){var p=l[h];if(o+=p.duration,s){if(o<0)continue}else if(o+rS<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-rW({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:h})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(u<0){for(var f=u;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i};u=0}for(var m=u;m0)continue}else if(o-rS>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+rW({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:m})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}},isEnabled:rZ,isDisabled:function(e){return e.disabled},isBlacklisted:rG,isIncompatible:rK,playlistEnd:rz,isAes:function(e){for(var t=0;t-1&&s!==a.length-1&&(i._HLS_part=s),(s>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var o=new(m()).URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&o.searchParams.set(e,i[e])}),e=o.toString()}return e},an=function(e,t){if(!e)return t;var i=ae(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return r8({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),r5({playlist:a,uri:n,id:r});var s=al(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(au(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),m().clearTimeout(this.mediaUpdateTimeout),m().clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(m().clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=m().setTimeout(this.media.bind(this,e,!1),n);return}var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(au(e,!0)),a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=rT(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}})}},i.pause=function(){this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=m().setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=m().setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},i.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src){this.src.uri||(this.src.uri=m().location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){e.setupInitialPlaylist(e.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=rT(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}})},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,r9(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=as(e),e.segments.forEach(function(t){aa(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var t=this.srcUri()||m().location.href;this.master=r7(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(at),ac=rg.xhr,ah=rg.mergeOptions,ap=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;t||!r||(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},af=function(){var e=function e(t,i){t=ah({timeout:45e3},t);var n=e.beforeRequest||rg.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=(!0===rg.Vhs.xhr.original?ac:rg.Vhs.xhr)(t,function(e,t){return ap(a,e,t,i)}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},am=function(e){var t,i={};return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?m().BigInt(t.offset)+m().BigInt(t.length)-m().BigInt(1):t.offset+t.length-1)),i},ag=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},a_=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},av=function(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];(0,R.Au)(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t},ay=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},aT=function(e){return e.resolvedUri},ab=function(e){for(var t=Array.prototype.slice.call(e),i="",n=0;nnew Date(l.getTime()+1e3*u)?null:(r>l&&(a=o),{segment:a,estimatedStart:a.videoTimingInfo?a.videoTimingInfo.transmuxedPresentationStart:r0.duration(t,t.mediaSequence+t.segments.indexOf(a)),type:a.videoTimingInfo?"accurate":"estimate"})},aE=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;rn){if(e>n+.25*a.duration)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},aw=function(e,t){try{n=new Date(e),r=new Date(t)}catch(i){}var n,r,a=n.getTime();return(r.getTime()-a)/1e3},aI=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t=d+u)return s(t,{response:o.subarray(u,u+d),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:am({byterange:e.sidx.byterange})},s)})},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},m().clearTimeout(this.minimumUpdatePeriodTimeout_),m().clearTimeout(this.mediaRequest_),m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e})}))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(m().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=m().setTimeout(function(){return t.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},i.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=m().setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(t.requestErrored_(i,n)){"HAVE_NOTHING"===t.state&&(t.started=!1);return}var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;if(t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=rT(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r){t.handleMaster_(),t.syncClientServerClock_(function(){return e(n,r)});return}return e(n,r)})},i.syncClientServerClock_=function(e){var t=this,i=(0,U.LG)(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:ry(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){var a;if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}}))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=aR({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=aU(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var i=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return i&&i!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(m().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0){t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout");return}this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=m().setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},i.refreshXml_=function(){var e=this;this.requestMaster_(function(t,i){i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=aN(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})},i.refreshMedia_=function(e){var t=this;if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];n?this.media_=i[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=m().setTimeout(function(){t.trigger("mediaupdatetimeout"),e()},au(t.media(),Boolean(n))))}(),this.trigger("loadedplaylist")},t}(aO),aj={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},aH=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t]){if(2==arguments.length)for(n=0,r=i.length;n>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),$(ef.mdhd,t)},es=function(e){var t;return $(ef.mdia,eo(e),(t=e.type,$(ef.hdlr,ev[t])),ee(e))},ee=function(e){return $(ef.minf,"video"===e.type?$(ef.vmhd,ey):$(ef.smhd,eT),$(ef.dinf,$(ef.dref,eb)),eu(e))},et=function(e){for(var t=e.length,i=[];t--;)i[t]=er(e[t]);return $.apply(null,[ef.moov,en(4294967295)].concat(i).concat(ei(e)))},ei=function(e){for(var t=e.length,i=[];t--;)i[t]=eh(e[t]);return $.apply(null,[ef.mvex].concat(i))},en=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 $(ef.mvhd,t)},el=function(e){var t,i,n=e.samples||[],r=new Uint8Array(4+n.length);for(i=0;i>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));for(t=0;t>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));if(i=[ef.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),$(ef.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],s))),$(ef.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];i.push($(ef.pasp,new Uint8Array([(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return $.apply(null,i)},Z=function(e){return $(ef.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),$(ef.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])))},ea=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return $(ef.tkhd,t)},ec=function(e){var t,i,n,r,a,s;return(t=$(ef.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/g),s=Math.floor(e.baseMediaDecodeTime%g),i=$(ef.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),"audio"===e.type)?(n=ep(e,92),$(ef.traf,t,i,n)):(r=el(e),n=ep(e,r.length+92),$(ef.traf,t,i,n,r))},er=function(e){return e.duration=e.duration||4294967295,$(ef.trak,ea(e),es(e))},eh=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),$(ef.trex,t)},Y=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},X=function(e,t){var i,n,r,a,s,o;for(t+=20+16*(a=e.samples||[]).length,r=Y(a,t),(n=new Uint8Array(r.length+16*a.length)).set(r),i=r.length,o=0;o>>24,n[i++]=(16711680&s.duration)>>>16,n[i++]=(65280&s.duration)>>>8,n[i++]=255&s.duration,n[i++]=(4278190080&s.size)>>>24,n[i++]=(16711680&s.size)>>>16,n[i++]=(65280&s.size)>>>8,n[i++]=255&s.size,n[i++]=s.flags.isLeading<<2|s.flags.dependsOn,n[i++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,n[i++]=61440&s.flags.degradationPriority,n[i++]=15&s.flags.degradationPriority,n[i++]=(4278190080&s.compositionTimeOffset)>>>24,n[i++]=(16711680&s.compositionTimeOffset)>>>16,n[i++]=(65280&s.compositionTimeOffset)>>>8,n[i++]=255&s.compositionTimeOffset;return $(ef.trun,n)},Q=function(e,t){var i,n,r,a,s,o;for(t+=20+8*(a=e.samples||[]).length,r=Y(a,t),(i=new Uint8Array(r.length+8*a.length)).set(r),n=r.length,o=0;o>>24,i[n++]=(16711680&s.duration)>>>16,i[n++]=(65280&s.duration)>>>8,i[n++]=255&s.duration,i[n++]=(4278190080&s.size)>>>24,i[n++]=(16711680&s.size)>>>16,i[n++]=(65280&s.size)>>>8,i[n++]=255&s.size;return $(ef.trun,i)},ep=function(e,t){return"audio"===e.type?Q(e,t):X(e,t)};var _={ftyp:J,mdat:function(e){return $(ef.mdat,e)},moof:function(e,t){for(var i=[],n=t.length;n--;)i[n]=ec(t[n]);return $.apply(null,[ef.moof,$(ef.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))].concat(i))},moov:et,initSegment:function(e){var t,i=J(),n=et(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},v=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},y={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(t=0,r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,n,r,a,s=t||0,o=[];for(i=0;iC.ONE_SECOND_IN_TS/2))){for((a=k()[e.samplerate])||(a=t[0].data),s=0;s=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,i=[];for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},M.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},M.prototype.addText=function(e){this.rows[this.rowIdx]+=e},M.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var R=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new M(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};R.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new M(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},R.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},R.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)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 U=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},a={};Object.keys(r).forEach(function(e){i=r[e],/^SERVICE/.test(e)&&(a[e]=i.encoding)}),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};U.prototype=new f,U.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},U.prototype.add708Bytes=function(e){var t=e.ccData;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t>>>8),this.current708Packet.data.push(255&t)},U.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5,n=31&a,7===i&&n>0&&(i=a=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},U.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e},U.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},U.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},U.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},U.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},U.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},U.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},U.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var B={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},N=function(e){return null===e?"":String.fromCharCode(e=B[e]||e)},F=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],j=function(){for(var e=[],t=15;t--;)e.push("");return e},H=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&t)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_){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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=j();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=j();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=j()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=N((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=N((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&r)==14&&this.addFormatting(e.pts,["i"]),(1&r)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=F.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),(16&t)==16&&(this.column_=((14&t)>>1)*4),this.isColorPAC(r)&&(14&r)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=N(n)+N(r),this[this.mode_](e.pts,a),this.column_+=a.length)}}};H.prototype=new f,H.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},H.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=j(),this.nonDisplayed_=j(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},H.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},H.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},H.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},H.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},H.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},H.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},H.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},H.prototype.isNormalChar=function(e){return e>=32&&e<=127},H.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=j(),this.displayed_=j()),void 0!==t&&t!==this.row_)for(var i=0;i"},"");this[this.mode_](e,i)},H.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[],this[this.mode_](e,t)}},H.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},H.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},H.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},G=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||W,this.push=function(e){(this.type_===W||e.type===this.type_)&&(void 0===n&&(n=e.dts),e.dts=z(e.dts,n),e.pts=z(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};G.prototype=new f;var K,Z,Q,X,Y,$,J,ee,et,ei,en,er,ea,es,eo,el,eu,ed,ec,eh,ep,ef,em,eg,e_,ev,ey,eT,eb,eS,ek,eC,eE,ew,eI,ex,eP,eA,eL,eO={TimestampRolloverStream:G,handleRollover:z},eD=function(e,t,i){var n,r="";for(n=t;n>>2;d*=4,d+=3&u[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i=10+s}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=V.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=V.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new f,t.STREAM_TYPES={h264:27,adts:15},(n=function(){var e,t=this,i=!1,r={data:[],size:0},a={data:[],size:0},s={data:[],size:0},o=function(e,t){var i,n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(4&e[6])!=0,192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},l=function(e,i,n){var r,a=new Uint8Array(e.size),s={type:i},l=0,u=0,d=!1;if(e.data.length&&!(e.size<9)){for(l=0,s.trackId=e.data[0].pid;l>5,u=(l=((3&t[d+6])+1)*1024)*ej/eH[(60&t[d+2])>>>2],t.byteLength-d>>6&3)+1,channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:eH[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+s,d+a)}),i++,d+=a}"number"==typeof r&&(this.skipWarn_(r,d),r=null),t=t.subarray(d)}},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")}}).prototype=new f;var eq=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return((n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0)?a<>>e)!=0)return i<<=e,n-=e,e;return this.loadWord(),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();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(s=function(){var e,t,i=0;s.prototype.init.call(this),this.push=function(n){t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var r,a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new f,o={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(a=function(){var e,t,i,n,r,l,u,d=new s;a.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,d.push(e))},d.on("data",function(a){var s={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(s.nalUnitTypeCode){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=r(a.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=r(a.subarray(1)),s.config=l(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",s)}),d.on("done",function(){e.trigger("done")}),d.on("partialdone",function(){e.trigger("partialdone")}),d.on("reset",function(){e.trigger("reset")}),d.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},u=function(e,t){var i,n=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4)?i+20:i+10},ez=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},eG=function(e,t,i){var n,r="";for(n=t;n=t+2&&(255&e[t])==255&&(240&e[t+1])==240&&(22&e[t+1])==16},parseId3TagSize:eW,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&(240&e[t+1])==240?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2]}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t=4+ez(e.subarray(10,14)));do{if((i=ez(e.subarray(t+4,t+8)))<1)break;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return s*=4,s+=3&a[7]}break}}t=10+i}while(t=3;){if(73===e[o]&&68===e[o+1]&&51===e[o+2]){if(e.length-o<10||(s=eK.parseId3TagSize(e,o),o+s>e.length))break;n={type:"timed-metadata",data:e.subarray(o,o+s)},this.trigger("data",n),o+=s;continue}if((255&e[o])==255&&(240&e[o+1])==240){if(e.length-o<7||(s=eK.parseAdtsSize(e,o),o+s>e.length))break;r={type:"audio",data:e.subarray(o,o+s),pts:t,dts:t},this.trigger("data",r),o+=s;continue}o++}e=e.length-o>0?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new f;var eZ=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],eQ=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],eX=eK.isLikelyAacData,eY=C.ONE_SECOND_IN_TS,e$=function(e,t){t.stream=e,this.trigger("log",t)},eJ=function(e,t){for(var i=Object.keys(t),n=0;n=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i);return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,l,u;for(a=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;tn.pts){t++;continue}i++,a-=r.byteLength,o-=r.nalCount,l-=r.duration}return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=a,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}if(n.pts>r.pts){t--;continue}t===s.length-1&&(a=i),i--}if(!o&&null===a)return null;if(0===(l=o?i:a))return e;var t,i,n,r,a,o,l,u=e.slice(l),d=u.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return u.byteLength=d.byteLength,u.duration=d.duration,u.nalCount=d.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){s=e}}).prototype=new f,(h=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,h.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):void(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),"audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes)))}}).prototype=new f,h.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,eQ.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,eZ.forEach(function(e){s.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=_.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},h.prototype.setRemux=function(e){this.remuxTracks=e},(c=function(e){var t,i,n=this,s=!0;c.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="aac",a.metadataStream=new eN.MetadataStream,a.aacStream=new l,a.audioTimestampRolloverStream=new eN.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new eN.TimestampRolloverStream("timed-metadata"),a.adtsStream=new r,a.coalesceStream=new h(e,a.metadataStream),a.headOfPipeline=a.aacStream,a.aacStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.aacStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.metadataStream.on("timestamp",function(e){a.aacStream.setTimestamp(e.timeStamp)}),a.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||a.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new d(i,e),a.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),a.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done")),eJ(this,a)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new eN.MetadataStream,s.packetStream=new eN.TransportPacketStream,s.parseStream=new eN.TransportParseStream,s.elementaryStream=new eN.ElementaryStream,s.timestampRolloverStream=new eN.TimestampRolloverStream,s.adtsStream=new r,s.h264Stream=new a,s.captionStream=new eN.CaptionStream(e),s.coalesceStream=new h(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new u(t,e),s.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new d(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,n.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eJ(this,s)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,x.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,x.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&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(s){var t=eX(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new f;var e2={Transmuxer:c,VideoSegmentStream:u,AudioSegmentStream:d,AUDIO_PROPERTIES:eZ,VIDEO_PROPERTIES:eQ,generateSegmentTimingInfo:e1},e8={toUnsigned:function(e){return e>>>0},toHexString:function(e){return("00"+e.toString(16)).slice(-2)}},e4=function(e){return String.fromCharCode(e[0])+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3])},e5=e8.toUnsigned,e3=function e(t,i){var n,r,a,s,o,l=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?l.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1))).length&&(l=l.concat(o))),n=s;return l},e6=e8.toUnsigned,e7=m.getUint64,e9=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=e7(e.subarray(4)):t.baseMediaDecodeTime=e6(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},te=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tt=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=n.getUint32(4),c=8;for(r&&(i.dataOffset=n.getInt32(c),c+=4),a&&d&&(t={flags:te(e.subarray(c,c+4))},c+=4,s&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},s&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),l&&(t.flags=te(e.subarray(c,c+4)),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t);return i},ti=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n},tn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},tr="undefined"!=typeof window?window:void 0!==tn?tn:"undefined"!=typeof self?self:{},ta=P.discardEmulationPreventionBytes,ts=q.CaptionStream,to=function(e,t){for(var i=e,n=0;n0?e9(l[0]).baseMediaDecodeTime:0,d=e3(a,["trun"]);t===o&&d.length>0&&(i=tl(n,tu(d,u,s),o),r[o]||(r[o]={seiNals:[],logs:[]}),r[o].seiNals=r[o].seiNals.concat(i.seiNals),r[o].logs=r[o].logs.concat(i.logs))}),r},tc=function(e,t,i){if(null===t)return null;var n=td(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}},th=function(){var e,t,i,n,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new ts,s=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return(!e||0!==e.length)&&(!t||"object"!=typeof t||0!==Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized()||!a||!s)return null;if(this.isNewInit(a,s))n=s[i=a[0]];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,a,s)}return((o=tc(e,i,n))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals)?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},tp=e8.toUnsigned,tf=e8.toHexString,tm=m.getUint64,tg={findBox:e3,parseType:e4,timescale:function(e){return e3(e,["moov","trak"]).reduce(function(e,t){var i,n,r,a;return(i=e3(t,["tkhd"])[0])&&(r=tp(i[n=0===i[0]?12:20]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]),a=e3(t,["mdia","mdhd"])[0])?(n=0===a[0]?12:20,e[r]=tp(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]),e):null},{})},startTime:function(e,t){var i=e3(t,["moof","traf"]).reduce(function(t,i){var n,r,a=e3(i,["tfhd"])[0],s=e[tp(a[4]<<24|a[5]<<16|a[6]<<8|a[7])]||9e4,o=e3(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);return"bigint"==typeof(n=1===o[0]?tm(o.subarray(4,12)):l.getUint32(4))?r=n/tr.BigInt(s):"number"!=typeof n||isNaN(n)||(r=n/s),r11?(t.codec+=".",t.codec+=tf(u[9]),t.codec+=tf(u[10]),t.codec+=tf(u[11])):t.codec="avc1.4d400d":/^mp4[a,v]$/i.test(t.codec)?"esds"===e4((u=c.subarray(28)).subarray(4,8))&&u.length>20&&0!==u[19]?(t.codec+="."+tf(u[19]),t.codec+="."+tf(u[20]>>>2&63).replace(/^0/,"")):t.codec="mp4a.40.2":t.codec=t.codec.toLowerCase())}var h=e3(e,["mdia","mdhd"])[0];h&&(t.timescale=p(h)),i.push(t)}),i},getTimescaleFromMediaHeader:p=function(e){var t=0===e[0]?12:20;return tp(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])}},t_=function(e){var t=31&e[1];return t<<=8,t|=e[2]},tv=function(e){return!!(64&e[1])},ty=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},tT=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}},tb=eO.handleRollover,tS={};tS.ts={parseType:function(e,t){var i=t_(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=tv(e),i=4+ty(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t,i={},n=tv(e),r=4+ty(e);if(n&&(r+=e[r]+1),1&e[r+5]){t=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a=e.byteLength)return null;var n=null;return 192&(t=e[i+7])&&((n={}).pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,n.pts*=4,n.pts+=(6&e[i+13])>>>1,n.dts=n.pts,64&t&&(n.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,n.dts*=4,n.dts+=(6&e[i+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+ty(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===tT(31&i[r+3])&&(a=!0),a}},tS.aac=eK;var tk=C.ONE_SECOND_IN_TS,tC=function(e,t){for(var i,n=0,r=188;r=0;){if(71===e[o]&&(71===e[l]||l===e.byteLength)){if(n=e.subarray(o,l),"pes"===tS.ts.parseType(n,t.pid)&&(r=tS.ts.parsePesType(n,t.table),a=tS.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=tS.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),u=!0)),u)break;o-=188,l-=188;continue}o--,l--}},tw=function(e,t,i){for(var n,r,a,s,o,l,u,d=0,c=188,h=!1,p={data:[],size:0};c=0;){if(71===e[d]&&71===e[c]){if(n=e.subarray(d,c),"pes"===tS.ts.parseType(n,t.pid)&&(r=tS.ts.parsePesType(n,t.table),a=tS.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=tS.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),h=!0)),h)break;d-=188,c-=188;continue}d--,c--}},tI=function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=tb(e.dts,i),e.pts=tb(e.pts,i),e.dtsTime=e.dts/tk,e.ptsTime=e.pts/tk})}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=tb(e.dts,n),e.pts=tb(e.pts,n),e.dtsTime=e.dts/tk,e.ptsTime=e.pts/tk}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=tb(r.dts,n),r.pts=tb(r.pts,n),r.dtsTime=r.dts/tk,r.ptsTime=r.pts/tk}}},tx=function(e){for(var t,i=!1,n=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(tS.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(s=tS.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=tS.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7||(s=tS.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=tS.aac.parseSampleRate(t)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var l=tk/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*l,pts:a+1024*n*l}]}},tP=function(e){var t={pid:null,table:null},i={};for(var n in tC(e,t),t.table)if(t.table.hasOwnProperty(n))switch(t.table[n]){case V.H264_STREAM_TYPE:i.video=[],tw(e,t,i),0===i.video.length&&delete i.video;break;case V.ADTS_STREAM_TYPE:i.audio=[],tE(e,t,i),0===i.audio.length&&delete i.audio}return i},tA={inspect:function(e,t){var i;return(i=tS.aac.isLikelyAacData(e)?tx(e):tP(e))&&(i.audio||i.video)?(tI(i,t),i):null},parseAudioPes_:tE},tL=function(e,t){t.on("data",function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.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){var i={start:{decode:C.videoTsToSeconds(t.start.dts),presentation:C.videoTsToSeconds(t.start.pts)},end:{decode:C.videoTsToSeconds(t.end.dts),presentation:C.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:C.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=C.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:C.videoTsToSeconds(t.start.dts),presentation:C.videoTsToSeconds(t.start.pts)},end:{decode:C.videoTsToSeconds(t.end.dts),presentation:C.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:C.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=C.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:C.videoTsToSeconds(t.start),end:C.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:C.videoTsToSeconds(t.start),end:C.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})},tO=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new e2.Transmuxer(this.options),tL(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new th,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),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])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=tg.startTime(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=tg.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:i*C.ONE_SECOND_IN_TS,r=tA.inspect(t,n),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(C.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(C.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){if("init"===e.data.action&&e.data.options){this.messageHandlers=new tO(self,e.data.options);return}this.messageHandlers||(this.messageHandlers=new tO(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}}))),aZ=function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,l=n.metadata,u=n.videoFrameDtsTime,d=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:l});var c=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==u&&(h.videoFrameDtsTime=u),void 0!==d&&(h.videoFramePtsTime=d),i(h)},aQ=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},aX=function(e,t){t.gopInfo=e.data.gopInfo},aY=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,l=e.onAudioTimingInfo,u=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,c=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,_=e.isEndOfTimeline,v={buffer:[]},y=_;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&aZ(i,v,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&aX(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(y=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"!==i.data.type||y||(t.onmessage=null,aQ({transmuxedData:v,callback:f}),a$(t)))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var T=i instanceof ArrayBuffer?i:i.buffer,b=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:T,byteOffset:b,byteLength:i.byteLength},[T])}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},a$=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():aY(e.currentTransmux))},aJ=function(e,t){e.postMessage({action:t}),a$(e)},a0=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,aJ(t,e);return}t.transmuxQueue.push(aJ.bind(null,t,e))},a1=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,aY(e);return}e.transmuxer.transmuxQueue.push(e)},a2={reset:function(e){a0("reset",e)},endTimeline:function(e){a0("endTimeline",e)},transmux:a1,createTransmuxer:function(e){var t=new aK;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t}},a8=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=(0,v.Z)({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data))}),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},a4={FAILURE:2,TIMEOUT:-101,ABORTED:-102},a5=function(e){e.forEach(function(e){e.abort()})},a3=function(e){var t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8e3),i},a6=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:a4.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:a4.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:a4.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:a4.FAILURE,xhr:t}:null},a7=function(e,t,i){return function(n,r){var a=r.response,s=a6(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:a4.FAILURE,xhr:r},e);for(var o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),u=0;u1){sd("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]}),t},sm=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},sg=function(e,t){var i=t.attributes||{},n=sf(sc(t)||[]);if(sh(e,t)&&!n.audio&&!sp(e,t)){var r=sf((0,D.Jg)(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},s_=rb("PlaylistSelector"),sv=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},sy=function(e,t){if(!e)return"";var i=m().getComputedStyle(e);return i?i[t]:""},sT=function(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r})},sb=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||m().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||m().Number.MAX_VALUE)},sS=function(e,t,i,n,r,a){if(e){var s,o,l,u,d={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},c=e.playlists;r0.isAudioOnly(e)&&(c=a.getAudioTrackPlaylists_(),d.audioOnly=!0);var h=c.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||m().Number.MAX_VALUE,width:t,height:i,playlist:e}});sT(h,function(e,t){return e.bandwidth-t.bandwidth});var p=(h=h.filter(function(e){return!r0.isIncompatible(e.playlist)})).filter(function(e){return r0.isEnabled(e.playlist)});p.length||(p=h.filter(function(e){return!r0.isDisabled(e.playlist)}));var f=p.filter(function(e){return e.bandwidth*aj.BANDWIDTH_VARIANCEi||e.height>n})).filter(function(e){return e.width===s[0].width&&e.height===s[0].height}))[o.length-1],l=o.filter(function(e){return e.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var k=T.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e});sT(k,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),u=k[0]}var C=u||l||S||_||p[0]||h[0];if(C&&C.playlist){var E="sortedPlaylistReps";return u?E="leastPixelDiffRep":l?E="resolutionPlusOneRep":S?E="resolutionBestRep":_?E="bandwidthBestRep":p[0]&&(E="enabledPlaylistReps"),s_("choosing "+sv(C)+" using "+E+" with options",d),C.playlist}return s_("could not choose a playlist with options",d),null}},sk=function(){var e=this.useDevicePixelRatio&&m().devicePixelRatio||1;return sS(this.playlists.master,this.systemBandwidth,parseInt(sy(this.tech_.el(),"width"),10)*e,parseInt(sy(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},sC=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,l=e.syncController,u=t.playlists.filter(function(e){return!r0.isIncompatible(e)}),d=u.filter(r0.isEnabled);d.length||(d=u.filter(function(e){return!r0.isDisabled(e)}));var c=d.filter(r0.hasAttribute.bind(null,"BANDWIDTH")).map(function(e){var t=l.getSyncPoint(e,r,o,i),u=r0.estimateSegmentRequestTime(a,n,e);return{playlist:e,rebufferingImpact:u*(t?1:2)-s}}),h=c.filter(function(e){return e.rebufferingImpact<=0});return(sT(h,function(e,t){return sb(t.playlist,e.playlist)}),h.length)?h[0]:(sT(c,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),c[0]||null)},sE=function(e){var t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(function(e){t.set(e,i),i+=e.byteLength})),t},sw=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=i,o=i,l=!1,u=a[n];u&&(s=u.label,o=u.language,l=u.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:l,label:s,language:o},!1).track}}},sI=function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=m().WebKitDataCue||m().VTTCue;i.forEach(function(e){t[e.stream].addCue(new r(e.startTime+n,e.endTime+n,e.text))})}},sx=function(e){Object.defineProperties(e.frame,{id:{get:function(){return rg.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return rg.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return rg.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},sP=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=m().WebKitDataCue||m().VTTCue,s=t.metadataTrack_;if(s&&(i.forEach(function(e){var t=e.cueTime+n;"number"!=typeof t||m().isNaN(t)||t<0||!(t<1/0)||e.frames.forEach(function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,sx(i),s.addCue(i)})}),s.cues&&s.cues.length)){for(var o=s.cues,l=[],u=0;u=e&&r.endTime<=t&&i.removeCue(r)},sO=function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]);n.length&&n.forEach(function(t){return e.removeCue(t)})}},sD=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*H.ONE_SECOND_IN_TS);for(n=0;nr);n++);return e.slice(n)},sM=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r=n);r++);return e.slice(0,r).concat(t)},sR=function(e,t,i,n){for(var r=Math.ceil((t-n)*H.ONE_SECOND_IN_TS),a=Math.ceil((i-n)*H.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var l=o+1;l--&&!(e[l].pts<=r););return l=Math.max(l,0),s.splice(l,o-l+1),s},sU=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;ri))return a}return 0===n.length?0:n[n.length-1]},sN=function(e){return"number"==typeof e&&isFinite(e)},sF=1/60,sj=function(e,t,i){var n=t-aj.BACK_BUFFER_LENGTH;return e.length&&(n=Math.max(n,e.start(0))),Math.min(t-i,n)},sH=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,l=a.segments,u=e.mediaIndex,d=e.partIndex,c=e.timeline,h=(void 0===l?[]:l).length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var f="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",g=f?rN({preloadSegment:n})-1:0;return m+" ["+(s+u)+"/"+(s+h)+"]"+(f?" part ["+d+"/"+g+"]":"")+(" segment start/end ["+n.start)+" => "+n.end+"]"+(f?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+c+"] selected by ["+p+"] playlist ["+o+"]"},sq=function(e){return e+"TimingInfo"},sV=function(e){var t=e.segmentTimeline,i=e.currentTimeline,n=e.startOfSegment,r=e.buffered;return e.overrideCheck||t!==i?tt&&(t=n)}}),"bigint"==typeof t&&ti+rS},sK=function(e,t){if("hls"!==t)return null;var i=sz({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var n=e.playlist.targetDuration,r=sG({segmentDuration:i,maxDuration:2*n}),a=sG({segmentDuration:i,maxDuration:n}),s="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 "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||a?{severity:r?"warn":"info",message:s}:null},sZ=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw TypeError("No currentTime getter specified");if(!t.mediaSource)throw TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,n.captionServices_=t.captionServices,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=rg.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=rb("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty((0,b.Z)(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return a2.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){if("WAITING"!==this.state){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,m().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&a2.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return rg.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=ay(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=aT(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY")}},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex){if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&a2.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var r=1,a=function(){0==--r&&i()};for(var s in(n||!this.audioDisabled_)&&(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=sR(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)sL(e,t,this.inbandTextTracks_[s]);sL(e,t,this.segmentMetadataTrack_),a()},i.monitorBuffer_=function(){this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=m().setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=m().setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},i.chooseNextRequest_=function(){var e=this.buffered_(),t=rO(e)||0,i=rD(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=sB(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],l="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[l+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=l+1):s.mediaIndex=this.mediaIndex+1}else{var u=r0.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),d=u.segmentIndex,c=u.startTime,h=u.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=d,s.startOfSegment=c,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent){if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part")}var _=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,l=e.getMediaInfoForTime,u=i.segments[n],d="number"==typeof s&&u.parts[s],c={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:d?s:null,isSyncRequest:a,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:d&&d.duration||u.duration,segment:u,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=rO(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=sD(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c},i.timestampOffsetForSegment_=function(e){return sV(e)},i.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t,i,n=this.currentTime_(),r=e.bandwidth,a=this.pendingSegment_.duration,s=r0.estimateSegmentRequestTime(a,r,this.playlist_,e.bytesReceived),o=(t=this.buffered_(),void 0===(i=this.vhs_.tech_.playbackRate())&&(i=1),((t.length?t.end(t.length-1):0)-n)/i-1);if(!(s<=o)){var l=sC({master:this.vhs_.playlists.master,currentTime:n,bandwidth:r,duration:this.duration_(),segmentDuration:a,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(l){var u=s-o-l.rebufferingImpact,d=.5;o<=rS&&(d=1),l.playlist&&l.playlist.uri!==this.playlist_.uri&&!(u "+s+" for "+e),sw(l,i.vhs_.tech_,e),sL(a,s,l[e]),sI({captionArray:o,inbandTextTracks:l,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();sA(this.inbandTextTracks_,i,this.vhs_.tech_),sP({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})}},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!sW({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo||sW({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[sq(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=ay(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+rA(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+rA(o).join(", "));var l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0,d=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0;if(u-l<=1&&c-d<=1){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+rA(s).join(", ")+", video buffer: "+rA(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=m().setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()},1e3)},!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;if(t){if(22===t.code){this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")}},i.appendToSourceBuffer_=function(e){var t=e.segmentInfo,i=e.type,n=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;n&&(s.unshift(n),o+=n.byteLength),a=sE({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:a}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var i=(0,v.Z)({},e,{forceTimestampOffset:!0});(0,v.Z)(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;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}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+sH(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=su({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,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:n||r&&a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,a=i.stream;t.logger_(sH(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=sj(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={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},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a){this.logger_("bad "+(r?"segment":"part")+" "+sH(e)),this.resetEverything();return}null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},i.recordThroughput_=function(e){if(e.duration=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},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===a4.TIMEOUT&&this.handleTimeout_(),e.code===a4.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof m().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})};s=function(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),this.subtitlesTrack_.tech_.one("vttjserror",o);return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new(m()).VTTCue(e.startTime,e.endTime,e.text):e)}),sO(this.subtitlesTrack_),this.handleAppendsDone_()},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof m().TextDecoder?t=new(m()).TextDecoder("utf8"):(t=m().WebVTT.StringDecoder(),i=!0);var n=new(m()).WebVTT.Parser(m(),m().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){rg.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=s6(r)),n.parse(r)}var a=e.bytes;i&&(a=s6(a)),n.parse(a),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t){if(!e.cues.length){n.empty=!0;return}var r=e.timestampmap,a=r.MPEGTS/H.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a}),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}},t}(sZ),oe=function(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r}return null},ot=function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a=h)&&(s=h,a={time:c,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=c)&&(s=c,a={time:d.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],on=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=rb("SyncController"),i}(0,S.Z)(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+rW({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a86400){rg.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");return}for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-(a.getTime()/1e3))},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+o.time)+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||no){var l=void 0;l=s<0?i.start-rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:l,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(rg.EventTarget),or=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}(0,S.Z)(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(rg.EventTarget),oa=aW(az(aG(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{};function t(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?i.path:t)}},i.exports),i.exports}var n=t(function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(2==arguments.length)for(var i=t.length,n=0;n>7)*283)^e]=e;for(t=i=0;!c[t];t^=n||1,i=f[i]||1)for(e=0,a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,c[t]=a,h[a]=t,o=16843009*p[r=p[n=p[t]]]^65537*r^257*n^16843008*t,s=257*p[a]^16843008*a;e<4;e++)u[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)u[e]=u[e].slice(0),d[e]=d[e].slice(0);return l},l=null,u=function(){function e(e){l||(l=o()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var t,i,n,r=this._tables[0][4],a=this._tables[1],s=e.length,u=1;if(4!==s&&6!==s&&8!==s)throw Error("Invalid aes key size");var d=e.slice(0),c=[];for(this._key=[d,c],t=s;t<4*s+28;t++)n=d[t-1],(t%s==0||8===s&&t%s==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^(u>>7)*283)),d[t]=d[t-s]^n;for(i=0;t;i++,t--)n=d[3&i?t:t-4],t<=4||i<4?c[i]=n:c[i]=a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,l,u,d=this._key[1],c=e^d[0],h=n^d[1],p=i^d[2],f=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],v=_[0],y=_[1],T=_[2],b=_[3],S=_[4];for(u=0;u>>24]^y[h>>16&255]^T[p>>8&255]^b[255&f]^d[g],o=v[h>>>24]^y[p>>16&255]^T[f>>8&255]^b[255&c]^d[g+1],l=v[p>>>24]^y[f>>16&255]^T[c>>8&255]^b[255&h]^d[g+2],f=v[f>>>24]^y[c>>16&255]^T[h>>8&255]^b[255&p]^d[g+3],g+=4,c=s,h=o,p=l;for(u=0;u<4;u++)r[(3&-u)+a]=S[c>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^d[g++],s=c,c=h,h=p,p=f,f=s},e}(),d=function(e){function t(){var t;return(t=e.call(this,s)||this).jobs=[],t.delay=1,t.timeout_=null,t}a(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(s),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(e,t,i){var n,r,a,s,o,l,d,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new u(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(p=0,n=i[0],r=i[1],a=i[2],s=i[3];p=0&&(t="main-desc"),t},oo=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},ol=function(e,t){t.activePlaylistLoader=e,e.load()},ou={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;oo(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(e){return e.default})[0]||s[0]).id,l=n.tracks[o];if(a===l){r({message:"Problem encountered loading the default audio track."});return}for(var u in rg.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[u].enabled=n.tracks[u]===l;n.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];rg.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),oo(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},od={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ou[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ou[e](e,i))}},oc={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],l=o.groups,u=o.tracks,d=o.logger_,c=t.masterPlaylistLoader,h=rJ(c.master);for(var p in(!s[e]||0===Object.keys(s[e]).length)&&(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=c.master.playlists)),s[e])for(var f in l[p]||(l[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(d("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new ad(m.playlists[0],i,a):m.resolvedUri?new ad(m.resolvedUri,i,a):m.playlists&&"dash"===n?new aF(m.playlists[0],i,a,c):null,m=rg.mergeOptions({id:f,playlistLoader:g},m),od[e](e,m.playlistLoader,t),l[p].push(m),void 0===u[f]){var _=new rg.AudioTrack({id:f,kind:os(m),enabled:!1,language:m.language,default:m.default,label:f});u[f]=_}}r.on("error",ou[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,d=l.tracks,c=t.masterPlaylistLoader;for(var h in o[e])for(var p in u[h]||(u[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new ad(f.resolvedUri,n,s);else if("dash"===r){if(!f.playlists.filter(function(e){return e.excludeUntil!==1/0}).length)return;m=new aF(f.playlists[0],n,s,c)}else"vhs-json"===r&&(m=new ad(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=rg.mergeOptions({id:p,playlistLoader:m},f),od[e](e,f.playlistLoader,t),u[h].push(f),void 0===d[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;d[p]=g}}a.on("error",ou[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var l in a[o]||(a[o]=[]),n[e][o]){var u=n[e][o][l];if(/^(?:CC|SERVICE)/.test(u.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},c={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(d[c.instreamId]&&(c=rg.mergeOptions(c,d[c.instreamId])),void 0===c.default&&delete c.default,a[o].push(rg.mergeOptions({id:l},u)),void 0===s[l]){var h=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;s[l]=h}}}}},oh=function e(t,i){for(var n=0;n1&&rJ(e.master))for(var l=0;l "+r.id;if(!t)return u(d+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var c=Boolean(rE(i,n).length);if(!t.endList)return c||"number"!=typeof t.partTargetDuration?(u(d+" as current playlist is live"),!0):(u("not "+d+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=rD(i,n),p=l?aj.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:aj.MAX_BUFFER_LOW_WATER_LINE;if(om)&&h>=a){var _=d+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return l&&(_+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),u(_),!0}return u("not "+d+" as no switching criteria met"),!1},oT=function(e){function t(t){i=e.call(this)||this;var i,n=t.src,r=t.handleManifestRedirects,a=t.withCredentials,s=t.tech,o=t.bandwidth,l=t.externVhs,u=t.useCueTags,d=t.blacklistDuration,c=t.enableLowInitialPlaylist,h=t.sourceType,f=t.cacheEncryptionKeys,g=t.experimentalBufferBasedABR,_=t.experimentalLeastPixelDiffSelector,v=t.captionServices;if(!n)throw Error("A non-empty playlist URL or JSON manifest string is required");var y=t.maxPlaylistRetries;null==y&&(y=1/0),p=l,i.experimentalBufferBasedABR=Boolean(g),i.experimentalLeastPixelDiffSelector=Boolean(_),i.withCredentials=a,i.tech_=s,i.vhs_=s.vhs,i.sourceType_=h,i.useCueTags_=u,i.blacklistDuration=d,i.maxPlaylistRetries=y,i.enableLowInitialPlaylist=c,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:a,handleManifestRedirects:r,maxPlaylistRetries:y,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=og(),i.mediaSource=new(m()).MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind((0,b.Z)(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind((0,b.Z)(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind((0,b.Z)(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=rg.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new on(t),i.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new oa,i.sourceUpdater_=new s3(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new or;var T={vhs:i.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:v,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:o,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};i.masterPlaylistLoader_="dash"===i.sourceType_?new aF(n,i.vhs_,i.requestOptions_):new ad(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new sZ(rg.mergeOptions(T,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new sZ(rg.mergeOptions(T,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new s9(rg.mergeOptions(T,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",function(){return i.startABRTimer_()}),i.tech_.on("pause",function(){return i.stopABRTimer_()}),i.tech_.on("play",function(){return i.startABRTimer_()})),o_.forEach(function(e){i[e+"_"]=ov.bind((0,b.Z)(i),e)}),i.logger_=rb("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var S="none"===i.tech_.preload()?"play":"loadstart";return i.tech_.one(S,function(){var e=Date.now();i.tech_.one("loadeddata",function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends})}),i}(0,S.Z)(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=m().setInterval(function(){return e.checkABR_()},250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(m().clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e,t=this.master(),i=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return i;var n=t.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){e={label:s};break}}if(!e)return i;var o=[];for(var l in n)if(n[l][e.label]){var u=n[l][e.label];if(u.playlists&&u.playlists.length)o.push.apply(o,u.playlists);else if(u.uri)o.push(u);else if(t.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return oy({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;if(void 0===e&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){rg.browser.IE_VERSION||rg.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=i,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var u=e.internal?this.logger_:rg.log.warn,d=e.message?" "+e.message:"";u((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+d+" Switching to playlist "+l.id+"."),l.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var c=l.targetDuration/2*1e3||5e3,h="number"==typeof l.lastRequest&&Date.now()-l.lastRequest<=c;return this.switchMedia_(l,"exclude",s||h)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];r&&(e===t||"all"===e)&&n.push(r)}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},i.setCurrentTime=function(e){var t=rE(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:void(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:p.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){if(!!this.masterPlaylistLoader_){var e,t,i,n=this.masterPlaylistLoader_.media();if(n){var r=this.syncController_.getExpiredTime(n,this.duration());if(null!==r){var a=this.masterPlaylistLoader_.master,s=p.Playlist.seekable(n,r,p.Playlist.liveEdgeDelay(a,n));0!==s.length&&(!this.mediaTypes_.AUDIO.activePlaylistLoader||(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null!==(r=this.syncController_.getExpiredTime(n,this.duration()))&&0!==(e=p.Playlist.seekable(n,r,p.Playlist.liveEdgeDelay(a,n))).length))&&(this.seekable_&&this.seekable_.length&&(t=this.seekable_.end(0),i=this.seekable_.start(0)),e?e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=rg.createTimeRanges([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!!t&&!!i},i.getCodecsOrExclude_=function(){var e,t=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var n=sg(this.master(),this.media()),r={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(r.video=n.video||i.main.videoCodec||D.xz),i.main.isMuxed&&(r.video+=","+(n.audio||i.main.audioCodec||D.lA)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||a)&&(r.audio=n.audio||i.main.audioCodec||i.audio.audioCodec||D.lA,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),!r.audio&&!r.video){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var s={};if(["video","audio"].forEach(function(t){var n,a;if(r.hasOwnProperty(t)&&(n=i[t].isFmp4,a=r[t],n?!(0,D.p7)(a):!(0,D.Hi)(a))){var o=i[t].isFmp4?"browser":"muxer";s[o]=s[o]||[],s[o].push(r[t]),"audio"===t&&(e=o)}}),a&&e&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach(function(e){(e.attributes&&e.attributes.AUDIO)===o&&e!==t.media()&&(e.excludeUntil=1/0)}),this.logger_("excluding audio group "+o+" as "+e+' does not support codec(s): "'+r.audio+'"')}if(Object.keys(s).length){var l=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach(function(e){var i=((0,D.kS)(t.sourceUpdater_.codecs[e]||"")[0]||{}).type,n=((0,D.kS)(r[e]||"")[0]||{}).type;i&&n&&i.toLowerCase()!==n.toLowerCase()&&u.push('"'+t.sourceUpdater_.codecs[e]+'" -> "'+r[e]+'"')}),u.length){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return r},i.tryToCreateSourceBuffers_=function(){if(!("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=sg(e.master,r),s=[];!a.audio||(0,D.Hi)(a.audio)||(0,D.p7)(a.audio)||s.push("audio codec "+a.audio),!a.video||(0,D.Hi)(a.video)||(0,D.p7)(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}})},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=sf((0,D.kS)(e)),a=sm(r),s=r.video&&(0,D.kS)(r.video)[0]||null,o=r.audio&&(0,D.kS)(r.audio)[0]||null;Object.keys(n).forEach(function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var l=[],u=sg(t.masterPlaylistLoader_.master,r),d=sm(u);if(u.audio||u.video){if(d!==a&&l.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var c=u.video&&(0,D.kS)(u.video)[0]||null,h=u.audio&&(0,D.kS)(u.audio)[0]||null;c&&s&&c.type.toLowerCase()!==s.type.toLowerCase()&&l.push('video codec "'+c.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&l.push('audio codec "'+h.type+'" !== "'+o.type+'"')}l.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+l.join(" && ")))}}})},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),ot(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=aj.GOAL_BUFFER_LENGTH,i=aj.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,aj.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=aj.BUFFER_LOW_WATER_LINE,i=aj.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,aj.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,aj.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return aj.BUFFER_HIGH_WATER_LINE},t}(rg.EventTarget),ob=function(e,t,i){var n,r,a=e.masterPlaylistController_,s=a[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(a);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=sg(a.master(),t),this.playlist=t,this.id=i,this.enabled=(n=e.playlists,r=t.id,function(e){var t=n.master.playlists[r],i=rK(t),a=rZ(t);return void 0===e?a:(e?delete t.disabled:t.disabled=!0,e===a||i||(s(),e?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),e)})},oS=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=rJ(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!rK(e)}).map(function(t,i){return new ob(e,t,t.id)}):[]}},ok=["seeking","seeked","pause","playing","error"],oC=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=rb("PlaybackWatcher"),this.logger_("initialize");var i=function(){return t.monitorCurrentTime_()},n=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],l={};o.forEach(function(e){l[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),t.tech_.on(["seeked","seeking"],l[e].reset)});var u=function(e){["main","audio"].forEach(function(i){s[i+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=function(){return u("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(ok,a),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(ok,a),t.tech_.off("canplay",n),t.tech_.off("play",i),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach(function(e){s[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),t.tech_.off(["seeked","seeking"],l[e].reset)}),t.checkCurrentTimeTimeout_&&m().clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&m().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=m().setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=rL(this[e+"Buffered_"],n);if(this[e+"Buffered_"]=n,r){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:rA(n)}),!(this[e+"StalledDownloads_"]<10)&&(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+rk>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:rk)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+rP(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,l=this.media(),u=l.partTargetDuration?l.partTargetDuration:(l.targetDuration-rS)*2,d=[s,o],c=0;c "+t.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=rw(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+rk;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),oE={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ow=function e(t,i){var n=0,r=0,a=rg.mergeOptions(oE,i);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},l=function(){if(Date.now()-n<1e3*a.errorInterval){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!a.getSource||"function"!=typeof a.getSource){rg.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),a.getSource.call(t,o)},u=function e(){t.off("loadedmetadata",s),t.off("error",l),t.off("dispose",e)};t.on("error",l),t.on("dispose",u),t.reloadSourceOnError=function(i){u(),e(t,i)}},oI="2.14.3",ox={PlaylistLoader:ad,Playlist:r0,utils:aS,STANDARD_PLAYLIST_SELECTOR:sk,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(r0.isEnabled);return sT(t,function(e,t){return sb(e,t)}),t.filter(function(t){return!!sg(e.playlists.master,t).video})[0]||null},lastBandwidthSelector:sk,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&m().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),sS(this.playlists.master,t,parseInt(sy(this.tech_.el(),"width"),10)*n,parseInt(sy(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:sb,comparePlaylistResolution:function(e,t){var i,n;return(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||m().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||m().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH)?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:af()};Object.keys(aj).forEach(function(e){Object.defineProperty(ox,e,{get:function(){return rg.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),aj[e]},set:function(t){if(rg.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0){rg.log.warn("value of Vhs."+e+" must be greater than or equal to 0");return}aj[e]=t}})});var oP="videojs-vhs",oA=function(e,t){for(var i=t.media(),n=-1,r=0;r=1e7&&e>=1e7?Math.max(e,i):i}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){rg.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return rA(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return rA(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&oU({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){oS(n)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){n.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=m().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),oD({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=oM({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",function(t){if("output-restricted"===t.status){var i,n=e.masterPlaylistController_.master();if(n&&n.playlists){var r=[];n.playlists.forEach(function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,r.push(e))}),r.length&&((i=rg.log).warn.apply(i,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(r)),e.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11===rg.browser.IE_VERSION||!i){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},i.setupQualityLevels_=function(){var e=this,t=rg.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){oL(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){oA(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":oI,"mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return s3.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&m().URL.revokeObjectURL&&(m().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return ax({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),aP({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(rg.getComponent("Component")),oN={name:"videojs-http-streaming",VERSION:oI,canHandleSource:function(e,t){void 0===t&&(t={});var i=rg.mergeOptions(rg.options,t);return oN.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=rg.mergeOptions(rg.options,i);return t.vhs=new oB(e,t,n),rg.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return rg.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=af(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=rg.mergeOptions(rg.options,t),n=i.vhs,r=(n=void 0===n?{}:n).overrideNative,a=void 0===r?!rg.browser.IS_ANY_SAFARI:r,s=i.hls,o=(s=void 0===s?{}:s).overrideNative,l=(0,M.t)(e);return l&&(!ox.supportsTypeNatively(l)||void 0!==o&&o||a)?"maybe":""}};(0,D.p7)("avc1.4d400d,mp4a.40.2")&&rg.getTech("Html5").registerSourceHandler(oN,0),rg.VhsHandler=oB,Object.defineProperty(rg,"HlsHandler",{get:function(){return rg.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),oB},configurable:!0}),rg.VhsSourceHandler=oN,Object.defineProperty(rg,"HlsSourceHandler",{get:function(){return rg.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),oN},configurable:!0}),rg.Vhs=ox,Object.defineProperty(rg,"Hls",{get:function(){return rg.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),ox},configurable:!0}),rg.use||(rg.registerComponent("Hls",ox),rg.registerComponent("Vhs",ox)),rg.options.vhs=rg.options.vhs||{},rg.options.hls=rg.options.hls||{},rg.getPlugin&&rg.getPlugin("reloadSourceOnError")||(rg.registerPlugin||rg.plugin)("reloadSourceOnError",function(e){ow(this,e)}),t.Z=rg}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2544],{85215:function(e,t,i){for(var n,r,a,s,o,l,u,d,c,h,p,f=i(58908),m=i.n(f),g=i(89144),_=i.n(g),v=i(87462),y=i(27537),T=i.n(y),b=i(97326),S=i(94578),k=i(75974),C=i.n(k),E=i(9603),w=i.n(E),I=i(13407),x=i.n(I),P=i(5647),A=i(60136),L=i(80779),O=i(9323),D=i(92260),M=i(8485),R=i(60562),U=i(12955),B=i(84221),N=i.n(B),F=i(68925),j=i(86185),H=i(51489),q="7.20.3",V={},W=function(e,t){return V[e]=V[e]||[],t&&(V[e]=V[e].concat(t)),V[e]},z=function(e,t){var i=W(e).indexOf(t);return!(i<=-1)&&(V[e]=V[e].slice(),V[e].splice(i,1),!0)},G={prefixed:!0},K=[["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"]],Z=K[0],Q=0;Q0?o:0)}if(m().console){var l=m().console[e];l||"debug"!==e||(l=m().console.info||m().console.log),l&&a&&s.test(e)&&l[Array.isArray(n)?"apply":"call"](m().console,n)}},r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw Error('"'+e+'" in not a valid log level');n=e}return n},r.history=function(){return Y?[].concat(Y):[]},r.history.filter=function(e){return(Y||[]).filter(function(t){return RegExp(".*"+e+".*").test(t[0])})},r.history.clear=function(){Y&&(Y.length=0)},r.history.disable=function(){null!==Y&&(Y.length=0,Y=null)},r.history.enable=function(){null===Y&&(Y=[])},r.error=function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-1:0),n=1;n=0)throw Error("class has illegal whitespace characters")}function eA(){return _()===m().document}function eL(e){return er(e)&&1===e.nodeType}function eO(){try{return m().parent!==m().self}catch(e){return!0}}function eD(e){return function(t,i){if(!ex(t))return _()[e](null);ex(i)&&(i=_().querySelector(i));var n=eL(i)?i:_();return n[e]&&n[e](t)}}function eM(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=_().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?($.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?eR(r,i):(r[e]!==i||"tabIndex"===e)&&(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),n&&e0(r,n),r}function eR(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function eU(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function eB(e,t){return(eP(t),e.classList)?e.classList.contains(t):RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)}function eN(e,t){return e.classList?e.classList.add(t):eB(e,t)||(e.className=(e.className+" "+t).trim()),e}function eF(e,t){return e?(e.classList?e.classList.remove(t):(eP(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e):($.warn("removeClass was called with an element that doesn't exist"),null)}function ej(e,t,i){var n=eB(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?eN(e,t):eF(e,t),e}function eH(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function eq(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,n=i.length-1;n>=0;n--){var r=i[n].name,a=i[n].value;("boolean"==typeof e[r]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+","))&&(a=null!==a),t[r]=a}return t}function eV(e,t){return e.getAttribute(t)}function eW(e,t,i){e.setAttribute(t,i)}function ez(e,t){e.removeAttribute(t)}function eG(){_().body.focus(),_().onselectstart=function(){return!1}}function eK(){_().onselectstart=function(){return!0}}function eZ(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(es(e,"height"))),i.width||(i.width=parseFloat(es(e,"width"))),i}}function eQ(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==_()[G.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function eX(e,t){var i={x:0,y:0};if(eE)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=es(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}var o={},l=eQ(t.target),u=eQ(e),d=u.width,c=u.height,h=t.offsetY-(u.top-l.top),p=t.offsetX-(u.left-l.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-u.left,h=t.changedTouches[0].pageY+u.top,eE&&(p-=i.x,h-=i.y)),o.y=1-Math.max(0,Math.min(1,h/c)),o.x=Math.max(0,Math.min(1,p/d)),o}function eY(e){return er(e)&&3===e.nodeType}function e$(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function eJ(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return("function"==typeof e&&(e=e()),eL(e)||eY(e))?e:"string"==typeof e&&/\S/.test(e)?_().createTextNode(e):void 0}).filter(function(e){return e})}function e0(e,t){return eJ(t).forEach(function(t){return e.appendChild(t)}),e}function e1(e,t){return e0(e$(e),t)}function e2(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var e8=eD("querySelector"),e4=eD("querySelectorAll"),e5=Object.freeze({__proto__:null,isReal:eA,isEl:eL,isInFrame:eO,createEl:eM,textContent:eR,prependTo:eU,hasClass:eB,addClass:eN,removeClass:eF,toggleClass:ej,setAttributes:eH,getAttributes:eq,getAttribute:eV,setAttribute:eW,removeAttribute:ez,blockTextSelection:eG,unblockTextSelection:eK,getBoundingClientRect:eZ,findPosition:eQ,getPointerPosition:eX,isTextNode:eY,emptyEl:e$,normalizeContent:eJ,appendContent:e0,insertContent:e1,isSingleLeftClick:e2,$:e8,$$:e4}),e3=!1,e6=function(){if(!1!==l.options.autoSetup){var e=Array.prototype.slice.call(_().getElementsByTagName("video")),t=Array.prototype.slice.call(_().getElementsByTagName("audio")),i=Array.prototype.slice.call(_().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}}function td(e,t,i){if(tn.has(e)){var n=tn.get(e);if(n.handlers){if(Array.isArray(t))return ta(td,e,t,i);var r=function(e,t){n.handlers[t]=[],tr(e,t)};if(void 0===t){for(var a in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},a)&&r(e,a);return}var s=n.handlers[t];if(s){if(!i){r(e,t);return}if(i.guid)for(var o=0;o=t&&(e.apply(void 0,arguments),i=n)}},t_=function(e,t,i,n){void 0===n&&(n=m());var r,a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a},tv=function(){};tv.prototype.allowedEvents_={},tv.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},tu(this,e,t),this.addEventListener=i},tv.prototype.addEventListener=tv.prototype.on,tv.prototype.off=function(e,t){td(this,e,t)},tv.prototype.removeEventListener=tv.prototype.off,tv.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},th(this,e,t),this.addEventListener=i},tv.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},tp(this,e,t),this.addEventListener=i},tv.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ts(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),tc(this,e)},tv.prototype.dispatchEvent=tv.prototype.trigger,tv.prototype.queueTrigger=function(e){var t=this;c||(c=new Map);var i=e.type||e,n=c.get(this);n||(n=new Map,c.set(this,n));var r=n.get(i);n.delete(i),m().clearTimeout(r);var a=m().setTimeout(function(){0===n.size&&(n=null,c.delete(t)),t.trigger(e)},0);n.set(i,a)};var ty=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},tT=function(e){return e instanceof tv||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},tb=function(e,t){tT(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},tS=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},tk=function(e,t,i){if(!e||!e.nodeName&&!tT(e))throw Error("Invalid target for "+ty(t)+"#"+i+"; must be a DOM node or evented object.")},tC=function(e,t,i){if(!tS(e))throw Error("Invalid event type for "+ty(t)+"#"+i+"; must be a non-empty string or array.")},tE=function(e,t,i){if("function"!=typeof e)throw Error("Invalid listener for "+ty(t)+"#"+i+"; must be a function.")},tw=function(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),tk(n,e,i),tC(r,e,i),tE(a,e,i),{isTargetingSelf:s,target:n,type:r,listener:a=tm(e,a)}},tI=function(e,t,i,n){tk(e,e,t),e.nodeName?tf[t](e,i,n):e[t](i,n)},tx={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e&&(this.options_=tM(this.options_,e)),this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return eM(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],l=i;return a&&a[e]?l=a[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r})),l},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[tD(e.name())]=null,this.childNameIndex_[tO(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||tD(t.name));return i&&!a.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}})}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(e,t){return e8(e,t||this.contentEl())},t.$$=function(e,t){return e4(e,t||this.contentEl())},t.hasClass=function(e){return eB(this.el_,e)},t.addClass=function(e){eN(this.el_,e)},t.removeClass=function(e){eF(this.el_,e)},t.toggleClass=function(e,t){ej(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return eV(this.el_,e)},t.setAttribute=function(e,t){eW(this.el_,e,t)},t.removeAttribute=function(e){ez(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t){(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:"auto"===t?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return -1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+tD(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(0===(t=parseFloat(t=es(this.el_,e)))||isNaN(t)){var i="offset"+tD(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(T().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=m().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}});var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){i=null,!0===e&&m().performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=tm(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=tm(this,e),this.clearTimersOnDispose_(),i=m().setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),m().clearTimeout(e)),e},t.setInterval=function(e,t){e=tm(this,e),this.clearTimersOnDispose_();var i=m().setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),m().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=tm(this,e),t=m().requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=tm(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),m().cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i)})}),e.clearingTimersOnDispose_=!1}))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!a)throw Error('Illegal component, "'+t+'"; '+(r?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=tD(t),e.components_||(e.components_={});var s=e.getComponent("Player");if("Player"===t&&s&&s.players){var o=s.players,l=Object.keys(o);if(o&&l.length>0&&l.map(function(e){return o[e]}).every(Boolean))throw Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[tO(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function tj(e,t,i,n){return!function(e,t,i){if("number"!=typeof t||t<0||t>i)throw Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function tH(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw Error("This TimeRanges object is empty")},end:function(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:tj.bind(null,"start",0,e),end:tj.bind(null,"end",1,e)},m().Symbol&&m().Symbol.iterator&&(t[m().Symbol.iterator]=function(){return(e||[]).values()}),t}function tq(e,t){return Array.isArray(e)?tH(e):void 0===e||void 0===t?tH():tH([[e,t]])}function tV(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=tq(0,0));for(var a=0;at&&(n=t),r+=n-i;return r/t}function tW(e){if(e instanceof tW)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:er(e)&&("number"==typeof e.code&&(this.code=e.code),en(this,e)),this.message||(this.message=tW.defaultMessages[this.code]||"")}tF.prototype.supportsRaf_="function"==typeof m().requestAnimationFrame&&"function"==typeof m().cancelAnimationFrame,tF.registerComponent("Component",tF),tW.prototype.code=0,tW.prototype.message="",tW.prototype.status=null,tW.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],tW.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var tz=0;tz=0;n--)if(t[n].enabled){t0(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}(0,S.Z)(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&t0(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,t0(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(t$),t2=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){t2(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty((0,b.Z)(i),"selectedIndex",{get:function(){for(var e=0;e0&&(m().console&&m().console.groupCollapsed&&m().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return $.error(e)}),m().console&&m().console.groupEnd&&m().console.groupEnd()),i.flush()},iu=function(e,t){var i={uri:e},n=is(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),w()(i,tm(this,function(e,i,n){if(e)return $.error(e,i);t.loaded_=!0,"function"!=typeof m().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"===e.type){$.error("vttjs failed to load, stopping trying to process "+t.src);return}return il(n,t)}):il(n,t)}))},id=function(e){function t(t){if(void 0===t&&(t={}),!t.tech)throw Error("A tech was not provided.");var i,n=tM(t,{kind:t9[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=ie[n.mode]||"disabled",a=n.default;("metadata"===n.kind||"chapters"===n.kind)&&(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new t3(i.cues_),o=new t3(i.activeCues_),l=!1;return i.timeupdateHandler=tm((0,b.Z)(i),function(e){if(void 0===e&&(e={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}}),i.tech_.one("dispose",function(){i.stopTracking()}),"disabled"!==r&&i.startTracking(),Object.defineProperties((0,b.Z)(i),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){ie[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||iu(this.src,this),this.stopTracking(),"disabled"!==r&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a0){this.trigger("vttjsloaded");return}var t=_().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),m().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)}},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var ik={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iC={setCurrentTime:1,setMuted:1,setVolume:1},iE={play:1,pause:1};function iw(e){return function(t,i){return t===ib?ib:i[e]?i[e](t):t}}var iI={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"},ix=function(e){return void 0===e&&(e=""),iI[ia(e).toLowerCase()]||""},iP=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0;this.player_.tech(!0)&&!((ey||eg)&&t)&&this.player_.tech(!0).focus(),this.player_.paused()?tK(this.player_.play()):this.player_.pause()}},t}(iD);tF.registerComponent("PosterImage",iM);var iR="#222",iU="#ccc",iB={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 iN(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(7===e.length)i=e.slice(1);else throw 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 iF(e,t,i){try{e.style[t]=i}catch(n){return}}var ij=function(e){function t(t,i,n){r=e.call(this,t,i,n)||this;var r,a=function(e){return r.updateDisplay(e)};return t.on("loadstart",function(e){return r.toggleDisplay(e)}),t.on("texttrackchange",a),t.on("loadedmetadata",function(e){return r.preselectTrack(e)}),t.ready(tm((0,b.Z)(r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks){this.hide();return}t.on("fullscreenchange",a),t.on("playerresize",a),m().addEventListener("orientationchange",a),t.on("dispose",function(){return m().removeEventListener("orientationchange",a)});for(var e=this.options_.playerOptions.tracks||[],i=0;i0;tK(t),this.player_.tech(!0)&&!((ey||eg)&&i)&&this.player_.tech(!0).focus();return}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}var a=function(){return r.focus()};tG(t)?t.then(a,function(){}):this.setTimeout(a,1)},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(iq);iV.prototype.controlText_="Play Video",tF.registerComponent("BigPlayButton",iV);var iW=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){T().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(iq);tF.registerComponent("CloseButton",iW);var iz=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e)}),n.on(t,"pause",function(e){return n.handlePause(e)}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?tK(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e)})},t}(iq);iz.prototype.controlText_="Play",tF.registerComponent("PlayToggle",iz);var iG=function(e,t){var i=Math.floor((e=e<0?0:e)%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),n=(((r=r>0||Math.floor(t/3600)>0?r+":":"")||Math.floor(t/60%60)>=10)&&n<10?"0"+n:n)+":",r+n+(i=i<10?"0"+i:i)},iK=iG;function iZ(e,t){return void 0===t&&(t=e),iK(e,t)}var iQ=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],function(e){return n.updateContent(e)}),n.updateTextNode_(),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=eM("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return i.appendChild(n),this.contentEl_=eM("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=iZ(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,$.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=_().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}}))},i.updateContent=function(e){},t}(tF);iQ.prototype.labelText_="Time",iQ.prototype.controlText_="Time",tF.registerComponent("TimeDisplay",iQ);var iX=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(iQ);iX.prototype.labelText_="Current Time",iX.prototype.controlText_="Current Time",tF.registerComponent("CurrentTimeDisplay",iX);var iY=function(e){function t(t,i){n=e.call(this,t,i)||this;var n,r=function(e){return n.updateContent(e)};return n.on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(iQ);iY.prototype.labelText_="Duration",iY.prototype.controlText_="Duration",tF.registerComponent("DurationDisplay",iY);var i$=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t},t}(tF);tF.registerComponent("TimeDivider",i$);var iJ=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",function(e){return n.updateContent(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(eM("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(iQ);iJ.prototype.labelText_="Remaining Time",iJ.prototype.controlText_="Remaining Time",tF.registerComponent("RemainingTimeDisplay",iJ);var i0=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=eM("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(eM("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(_().createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(tF);tF.registerComponent("LiveDisplay",i0);var i1=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=eM("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(iq);i1.prototype.controlText_="Seek to live, currently playing live",tF.registerComponent("SeekToLive",i1);var i2=function(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))},i8=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=en({tabIndex:0},i),n=en({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||e_||e.preventDefault(),eG(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;eK(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"})),t}},i.getProgress=function(){return Number(i2(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=eX(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){T().isEventKey(t,"Left")||T().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):T().isEventKey(t,"Right")||T().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(tF);tF.registerComponent("Slider",i8);var i4=function(e,t){return i2(e/t*100,0,100).toFixed(2)+"%"},i5=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",function(e){return n.update(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=eM("span",{className:"vjs-control-text"}),n=eM("span",{textContent:this.localize("Loaded")}),r=_().createTextNode(": ");return this.percentageEl_=eM("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=i4(r,n);t.percent_!==s&&(t.el_.style.width=s,eR(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;c--)t.el_.removeChild(a[c-1]);a.length=i.length})},t}(tF);tF.registerComponent("LoadProgressBar",i5);var i3=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=eQ(this.el_),r=eZ(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),l=n.width/2;sn.width&&(l=n.width),l=Math.round(l),this.el_.style.right="-"+l+"px",this.write(i)}},i.write=function(e){eR(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),l=o-t*o;a=(l<1?"":"-")+iZ(l,o)}else a=iZ(i,s);r.update(e,t,a),n&&n()})},t}(tF);tF.registerComponent("TimeTooltip",i3);var i6=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(tF);i6.prototype.options_={children:[]},eE||eh||i6.prototype.options_.children.push("timeTooltip"),tF.registerComponent("PlayProgressBar",i6);var i7=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},t}(tF);i7.prototype.options_={children:["timeTooltip"]},tF.registerComponent("MouseTimeDisplay",i7);var i9=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}(0,S.Z)(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=tm(this,this.update),this.update=tg(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _()&&"visibilityState"in _()&&this.on(_(),"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===_().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==_().visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),(i.currentTime_!==e||i.duration_!==r)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[iZ(e,r),iZ(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(eZ(i.el()),i.getProgress())}),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){e2(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),e2(e)){t||this.player_.scrubbing()||this.player_.scrubbing(!0);var i,n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99){r.seekToLiveEdge();return}var a=r.seekableStart(),s=r.liveCurrentTime();if((i=a+n*r.liveWindow())>=s&&(i=s),i<=a&&(i=a+.1),i===1/0)return}else(i=n*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?tK(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(T().isEventKey(t,"Space")||T().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(T().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(T().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(T()(t))){t.preventDefault(),t.stopPropagation();var n=(T().codes[T()(t)]-T().codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else T().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):T().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _()&&"visibilityState"in _()&&this.off(_(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(i8);i9.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},eE||eh||i9.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),tF.registerComponent("SeekBar",i9);var ne=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=tg(tm((0,b.Z)(n),n.handleMouseMove),30),n.throttledHandleMouseSeek=tg(tm((0,b.Z)(n),n.handleMouseSeek),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=eQ(r),s=eX(r,e).x;s=i2(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&tK(this.player_.play())}},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var 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_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");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_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(tF);ne.prototype.options_={children:["seekBar"]},tF.registerComponent("ProgressControl",ne);var nt=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e)}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e)}),n.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){_().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(iq);nt.prototype.controlText_="Picture-in-Picture",tF.registerComponent("PictureInPictureToggle",nt);var ni=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e)}),!1===_()[t.fsApi_.fullscreenEnabled]&&n.disable(),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(iq);ni.prototype.controlText_="Fullscreen",tF.registerComponent("FullscreenToggle",ni);var nn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},nr=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(tF);tF.registerComponent("VolumeLevel",nr);var na=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=eZ(this.el_),a=eZ(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,l=e.width-s+(a.right-e.right),u=r.width/2;or.width&&(u=r.width),this.el_.style.right="-"+u+"px"}this.write(n+"%")},i.write=function(e){eR(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r()})},t}(tF);tF.registerComponent("VolumeLevelTooltip",na);var ns=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=tg(tm((0,b.Z)(n),n.update),30),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"})},t}(tF);ns.prototype.options_={children:["volumeLevelTooltip"]},tF.registerComponent("MouseVolumeLevelDisplay",ns);var no=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",function(e){return n.updateLastVolume_(e)}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e)}),t.ready(function(){return n.updateARIAAttributes()}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){e2(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=eZ(i),r=this.vertical(),a=eX(i,e);a=i2(a=r?a.y:a.x,0,1),t.update(n,a,r)}e2(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(i8);no.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},eE||eh||no.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),no.prototype.playerEvent="volumechange",tF.registerComponent("VolumeBar",no);var nl=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||ea(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,nn((0,b.Z)(n),t),n.throttledHandleMouseMove=tg(tm((0,b.Z)(n),n.handleMouseMove),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",function(e){return n.handleMouseDown(e)}),n.on("touchstart",function(e){return n.handleMouseDown(e)}),n.on("mousemove",function(e){return n.handleMouseMove(e)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var 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_)},i.handleMouseUp=function(e){var 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_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(tF);nl.prototype.options_={children:["volumeBar"]},tF.registerComponent("VolumeControl",nl);var nu=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},nd=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,nu((0,b.Z)(n),t),n.on(t,["loadstart","volumechange"],function(e){return n.update(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;eE&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)eF(this.el_,"vjs-vol-"+i);eN(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(iq);nd.prototype.controlText_="Mute",tF.registerComponent("MuteToggle",nd);var nc=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||ea(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e)}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e)}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e)}),n.on("keydown",function(e){return n.handleKeyPress(e)}),n.on("mouseover",function(e){return n.handleMouseOver(e)}),n.on("mouseout",function(e){return n.handleMouseOut(e)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}(0,S.Z)(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){T().isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),tu(_(),"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),td(_(),"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){T().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(tF);nc.prototype.options_={children:["muteToggle","volumeControl"]},tF.registerComponent("VolumePanel",nc);var nh=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e)}),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}(0,S.Z)(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof tF&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof tF&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=eM(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),tu(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||_().activeElement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(Array.isArray(t)){var i=t.filter(function(t){return t.el()===e.target})[0];i&&"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}},i.handleKeyDown=function(e){T().isEventKey(e,"Left")||T().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(T().isEventKey(e,"Right")||T().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(tF);tF.registerComponent("Menu",nh);var np=function(e){function t(t,i){void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new iq(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var n,r=iq.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),tu(_(),"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(e){return n.handleMouseLeave(e)}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},i.createMenu=function(){var e=new nh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=eM("li",{className:"vjs-menu-title",textContent:tD(this.options_.title),tabIndex:-1}),i=new tF(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(n_);tF.registerComponent("OffTextTrackMenuItem",nv);var ny=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return(0,S.Z)(t,e),t.prototype.createItems=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=n_),this.label_&&(i=this.label_+" off"),e.push(new nv(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var i,n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(nf);tF.registerComponent("TextTrackButton",ny);var nT=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(tD(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(tD(n.label_)),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(t.push(new nC(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,nw)},t}(ny);nI.prototype.kinds_=["captions","subtitles"],nI.prototype.controlText_="Subtitles",tF.registerComponent("SubsCapsButton",nI);var nx=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=Array(e),i=0;i=0;i--)t.push(new nA(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var t=this.player().playbackRate(),i=this.playbackRates(),n=(i.indexOf(t)+1)%i.length;this.player().playbackRate(i[n])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(np);nL.prototype.controlText_="Playback Rate",tF.registerComponent("PlaybackRateMenuButton",nL);var nO=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n)},t}(tF);tF.registerComponent("Spacer",nO);var nD=function(e){function t(){return e.apply(this,arguments)||this}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},t}(nO);tF.registerComponent("CustomControlSpacer",nD);var nM=function(e){function t(){return e.apply(this,arguments)||this}return(0,S.Z)(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(tF);nM.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in _()&&nM.prototype.options_.children.splice(nM.prototype.options_.children.length-1,0,"pictureInPictureToggle"),tF.registerComponent("ControlBar",nM);var nR=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",function(e){return n.open(e)}),n}(0,S.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(tY);nR.prototype.options_=(0,v.Z)({},tY.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),tF.registerComponent("ErrorDisplay",nR);var nU="vjs-text-track-settings",nB=["#000","Black"],nN=["#00F","Blue"],nF=["#0FF","Cyan"],nj=["#0F0","Green"],nH=["#F0F","Magenta"],nq=["#F00","Red"],nV=["#FFF","White"],nW=["#FF0","Yellow"],nz=["1","Opaque"],nG=["0.5","Semi-Transparent"],nK=["0","Transparent"],nZ={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[nB,nV,nq,nj,nN,nW,nH,nF]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[nz,nG,nK]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[nV,nB,nq,nj,nN,nW,nH,nF]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[nz,nG]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[nK,nG,nz]}};function nQ(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}nZ.windowColor.options=nZ.backgroundColor.options;var nX=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind((0,b.Z)(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=eM("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),ei(nZ,function(e){n.on(n.$(e.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}(0,S.Z)(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=nZ[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},i.createElColors_=function(){return eM("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return eM("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return eM("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e,t=this;return e=function(e,i,n){var r,a,s=(r=t.$(i.selector),a=i.parser,nQ(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[n]=s),e},et(nZ).reduce(function(t,i){return e(t,nZ[i],i)},{})},i.setValues=function(e){var t=this;ei(nZ,function(i,n){!function(e,t,i){if(t){for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(_(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(tF);tF.registerComponent("LiveTracker",nJ);var n0=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ew?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){$(t,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;return this.el_.duration===1/0&&eh&&e_&&0===this.el_.currentTime?(this.on("timeupdate",function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))}),NaN):this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)})}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=m().navigator&&m().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)tK(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},i.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},i.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=_().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)(t===i[n]||t===i[n].track)&&this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),m().performance&&"function"==typeof m().performance.now?e.creationTime=m().performance.now():m().performance&&m().performance.timing&&"number"==typeof m().performance.timing.navigationStart&&(e.creationTime=m().Date.now()-m().performance.timing.navigationStart),e},t}(iv);n3(n6,"TEST_VID",function(){if(eA()){var e=_().createElement("video"),t=_().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),n6.isSupported=function(){try{n6.TEST_VID.volume=.5}catch(e){return!1}return!!(n6.TEST_VID&&n6.TEST_VID.canPlayType)},n6.canPlayType=function(e){return n6.TEST_VID.canPlayType(e)},n6.canPlaySource=function(e,t){return n6.canPlayType(e.type)},n6.canControlVolume=function(){try{var e=n6.TEST_VID.volume;n6.TEST_VID.volume=e/2+.1;var t=e!==n6.TEST_VID.volume;if(t&&eE)return m().setTimeout(function(){n6&&n6.prototype&&(n6.prototype.featuresVolumeControl=e!==n6.TEST_VID.volume)}),!1;return t}catch(i){return!1}},n6.canMuteVolume=function(){try{var e=n6.TEST_VID.muted;return n6.TEST_VID.muted=!e,n6.TEST_VID.muted?eW(n6.TEST_VID,"muted","muted"):ez(n6.TEST_VID,"muted","muted"),e!==n6.TEST_VID.muted}catch(t){return!1}},n6.canControlPlaybackRate=function(){if(eh&&e_&&ev<58)return!1;try{var e=n6.TEST_VID.playbackRate;return n6.TEST_VID.playbackRate=e/2+.1,e!==n6.TEST_VID.playbackRate}catch(t){return!1}},n6.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(_().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(_().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(_().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(_().createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},n6.supportsNativeTextTracks=function(){return ew||eE&&e_},n6.supportsNativeVideoTracks=function(){return!!(n6.TEST_VID&&n6.TEST_VID.videoTracks)},n6.supportsNativeAudioTracks=function(){return!!(n6.TEST_VID&&n6.TEST_VID.audioTracks)},n6.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){var t=e[0],i=e[1];n3(n6.prototype,t,function(){return n6[i]()},!0)}),n6.prototype.featuresVolumeControl=n6.canControlVolume(),n6.prototype.movingMediaElementInDOM=!eE,n6.prototype.featuresFullscreenResize=!0,n6.prototype.featuresProgressEvents=!0,n6.prototype.featuresTimeupdateEvents=!0,n6.prototype.featuresVideoFrameCallback=!!(n6.TEST_VID&&n6.TEST_VID.requestVideoFrameCallback),n6.patchCanPlayType=function(){!(ep>=4)||em||e_||(h=n6.TEST_VID&&n6.TEST_VID.constructor.prototype.canPlayType,n6.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":h.call(this,e)})},n6.unpatchCanPlayType=function(){var e=n6.TEST_VID.constructor.prototype.canPlayType;return h&&(n6.TEST_VID.constructor.prototype.canPlayType=h),e},n6.patchCanPlayType(),n6.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(t){}}()}},n6.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){n6.prototype["set"+tD(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){n6.prototype["set"+tD(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){n6.prototype[e]=function(){return this.el_[e]()}}),iv.withSourceHandlers(n6),n6.nativeSourceHandler={},n6.nativeSourceHandler.canPlayType=function(e){try{return n6.TEST_VID.canPlayType(e)}catch(t){return""}},n6.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return n6.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ia(e.src);return n6.nativeSourceHandler.canPlayType("video/"+i)}return""},n6.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},n6.nativeSourceHandler.dispose=function(){},n6.registerSourceHandler(n6.nativeSourceHandler),iv.registerTech("Html5",n6);var n7=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],n9={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},re=["tiny","xsmall","small","medium","large","xlarge","huge"],rt={};re.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;rt[e]="vjs-layout-"+t});var ri={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},rn=function(e){function t(i,n,r){if(i.id=i.id||n.id||"vjs_video_"+ti++,(n=en(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language){if("function"==typeof i.closest){var a,s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(eq(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break}o=o.parentNode}}if((a=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=J(a.id_),a.fsApi_=G,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&eq(i),a.language(a.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach(function(e){l[e.toLowerCase()]=n.languages[e]}),a.languages_=l}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(e){if("function"!=typeof a[e])throw Error('plugin "'+e+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),tP((0,b.Z)(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(tu(_(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var u=tM(a.options_);n.plugins&&Object.keys(n.plugins).forEach(function(e){a[e](n.plugins[e])}),n.debug&&a.debug(!0),a.options_.playerOptions=u,a.middleware_=[],a.playbackRates(n.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),eS&&a.addClass("vjs-touch-enabled"),eE||a.addClass("vjs-workinghover"),t.players[a.id_]=(0,b.Z)(a);var d=q.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",function(e){return a.listenForUserActivity_(e)}),a.on("stageclick",function(e){return a.handleStageClick_(e)}),a.on("keydown",function(e){return a.handleKeyDown(e)}),a.on("languagechange",function(e){return a.handleLanguagechange(e)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}(0,S.Z)(t,e);var i=t.prototype;return i.dispose=function(){var i,n=this;this.trigger("dispose"),this.off("dispose"),td(_(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),td(_(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),i=this,iT[i.id()]=null,i_.names.forEach(function(e){var t=n[i_[e].getterName]();t&&t.off&&t.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=eq(i);if(r){for(t=this.el_=i,i=this.tag=_().createElement("video");t.children.length;)i.appendChild(t.firstChild);eB(t,"video-js")||eN(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e]}catch(n){}})}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",(ey||e_&&eb)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==m().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=te("vjs-styles-dimensions");var s=e8(".vjs-styles-defaults"),o=e8("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var l=i.getElementsByTagName("a"),u=0;u=0&&(a.width=n),r>=0&&(a.height=r));return}var s=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*o,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),tt(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*o+"%;\n }\n ")},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=tD(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(iv.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};i_.names.forEach(function(e){var t=i_[e];s[t.getterName]=i[t.privateName]}),en(s,this.options_[n]),en(s,this.options_[r]),en(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=iv.getTech(e);if(!o)throw Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(tm(this,this.handleTechReady_),!0),tQ.jsonToTextTracks(this.textTracksJson_||[],this.tech_),n7.forEach(function(e){i.on(i.tech_,e,function(t){return i["handleTech"+tD(e)+"_"](t)})}),Object.keys(n9).forEach(function(e){i.on(i.tech_,e,function(t){if(0===i.tech_.playbackRate()&&i.tech_.seeking()){i.queuedCallbacks_.push({callback:i["handleTech"+n9[e]+"_"].bind(i),event:t});return}i["handleTech"+n9[e]+"_"](t)})}),this.on(this.tech_,"loadstart",function(e){return i.handleTechLoadStart_(e)}),this.on(this.tech_,"sourceset",function(e){return i.handleTechSourceset_(e)}),this.on(this.tech_,"waiting",function(e){return i.handleTechWaiting_(e)}),this.on(this.tech_,"ended",function(e){return i.handleTechEnded_(e)}),this.on(this.tech_,"seeking",function(e){return i.handleTechSeeking_(e)}),this.on(this.tech_,"play",function(e){return i.handleTechPlay_(e)}),this.on(this.tech_,"firstplay",function(e){return i.handleTechFirstPlay_(e)}),this.on(this.tech_,"pause",function(e){return i.handleTechPause_(e)}),this.on(this.tech_,"durationchange",function(e){return i.handleTechDurationChange_(e)}),this.on(this.tech_,"fullscreenchange",function(e,t){return i.handleTechFullscreenChange_(e,t)}),this.on(this.tech_,"fullscreenerror",function(e,t){return i.handleTechFullscreenError_(e,t)}),this.on(this.tech_,"enterpictureinpicture",function(e){return i.handleTechEnterPictureInPicture_(e)}),this.on(this.tech_,"leavepictureinpicture",function(e){return i.handleTechLeavePictureInPicture_(e)}),this.on(this.tech_,"error",function(e){return i.handleTechError_(e)}),this.on(this.tech_,"posterchange",function(e){return i.handleTechPosterChange_(e)}),this.on(this.tech_,"textdata",function(e){return i.handleTechTextData_(e)}),this.on(this.tech_,"ratechange",function(e){return i.handleTechRateChange_(e)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||eU(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;i_.names.forEach(function(t){var i=i_[t];e[i.privateName]=e[i.getterName]()}),this.textTracksJson_=tQ.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&$.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},i.manualAutoplay_=function(e){var t,i=this;if(this.tech_&&"string"==typeof e){var n=function(){var e=i.muted();i.muted(!0);var t=function(){i.muted(e)};i.playTerminatedQueue_.push(t);var n=i.play();if(tG(n))return n.catch(function(e){throw t(),Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))})};if("any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():n():tG(t=this.play())&&(t=t.catch(n)),tG(t))return t.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=iP(this,t)),this.cache_.source=tM({},e,{src:t,type:i});for(var n=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],a=this.$$("source"),s=[],o=0;o0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))})},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&($.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?tK(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=_()[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},i.handleTechFullscreenChange_=function(e,t){var i=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){i.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},i.techCall_=function(e,t){this.ready(function(){if(e in iC){var i;return i=this.middleware_,this.tech_[e](i.reduce(iw(e),t))}if(e in iE)return iS(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw $(n),n}},!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in ik){var t,i;return t=this.middleware_,i=this.tech_,t.reduceRight(iw(e),i[e]())}if(e in iE)return iS(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){if(void 0===this.tech_[e])throw $("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",n),n;if("TypeError"===n.name)throw $("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n;throw $(n),n}}},i.play=function(){var e=this,t=this.options_.Promise||m().Promise;return t?new t(function(t){e.play_(t)}):this.play_()},i.play_=function(e){var t=this;void 0===e&&(e=tK),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i){this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!i&&(ew||eE)&&this.load();return}var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||tq(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){if(void 0!==e){if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e===this.cache_.duration||(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=tq(0,0)),e},i.bufferedPercent=function(){return tV(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;if(void 0!==e){t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return isNaN(t=parseFloat(this.techGet_("volume")))?1:t},i.muted=function(e){if(void 0!==e){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0!==e&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},i.requestFullscreen=function(e){var t=this.options_.Promise||m().Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),n(t)}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n))})}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0===e||(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),n}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||m().Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),e()}function a(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i))})}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=_()[this.fsApi_.exitFullscreen]();return t&&tK(t.then(function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=_().documentElement.style.overflow,tu(_(),"keydown",this.boundFullWindowOnEscKey_),_().documentElement.style.overflow="hidden",eN(_().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){T().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,td(_(),"keydown",this.boundFullWindowOnEscKey_),_().documentElement.style.overflow=this.docOrigOverflow,eF(_().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){if(void 0!==e){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in _()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in _())return _().exitPictureInPicture()},i.handleKeyDown=function(e){var t,i,n=this.options_.userActions;n&&n.hotkeys&&(i=(t=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),t.isContentEditable||("input"===i?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(i))||("function"==typeof n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=t.muteKey,r=t.playPauseKey;if((void 0===i?function(e){return T().isEventKey(e,"f")}:i).call(this,e)){e.preventDefault(),e.stopPropagation();var a=tF.getComponent("FullscreenToggle");!1!==_()[this.fsApi_.fullscreenEnabled]&&a.prototype.handleClick.call(this,e)}else(void 0===n?function(e){return T().isEventKey(e,"m")}:n).call(this,e)?(e.preventDefault(),e.stopPropagation(),tF.getComponent("MuteToggle").prototype.handleClick.call(this,e)):(void 0===r?function(e){return T().isEventKey(e,"k")||T().isEventKey(e,"Space")}:r).call(this,e)&&(e.preventDefault(),e.stopPropagation(),tF.getComponent("PlayToggle").prototype.handleClick.call(this,e))},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void i.triggerReady());!function(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}(r,i.tech_)}),this.options_.retryOnError&&n.length>1){var r=function(){i.error(null),i.handleSrc_(n.slice(1),!0)},a=function(){i.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",a)}}},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||((t=r.tech,i=this.techName_,tD(t)!==tD(i))?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,t=this.options_.Promise||m().Promise;this.paused()||!t?this.doReset_():tK(this.play().then(function(){return e.doReset_()}))},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),tT(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){if(void 0!==e){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},i.autoplay=function(e){var t;if(void 0===e)return this.options_.autoplay||!1;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){if(void 0!==e){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(W("beforeerror").forEach(function(i){var n=i(t,e);if(!(er(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n)){t.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),this.one("loadstart",function(){this.off(["click","touchstart"],i)});return}if(null===e){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new tW(e),this.addClass("vjs-error"),$.error("(CODE:"+this.error_.code+" "+tW.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),W("error").forEach(function(e){return e(t,t.error_)})},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n,r=tm(this,this.reportUserActivity),a=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,r())}),this.on("mouseup",a),this.on("mouseleave",a);var s=this.getChild("controlBar");!s||eE||eh||(s.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);var e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},i.playbackRate=function(e){if(void 0!==e){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0!==e){this.isAudio_=!!e;return}return!!this.isAudio_},i.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();t.forEach(function(t){t!==i&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")},i.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},i.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var i=this.options_.Promise||m().Promise;if(i){if(e){var n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),i.all(n).then(function(){return t.enableAudioOnlyUI_()})}return i.resolve().then(function(){return t.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},i.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var i=this.options_.Promise||m().Promise;if(i)return e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.disablePosterModeUI_()});if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),tT(this)&&this.trigger("languagechange"))},i.languages=function(){return tM(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=tM(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){}},rS=1/30,rk=3*(1/30),rC=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t})},rw=function(e,t){return rC(e,function(e){return e-rS>=t})},rI=function(e){if(e.length<2)return rg.createTimeRanges();for(var t=[],i=1;i "+e.end(i));return t.join(", ")},rA=function(e){for(var t=[],i=0;ia)){if(t>r&&t<=a){i+=a-t;continue}i+=a-r}}return i},rM=rg.createTimeRange,rR=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},rU=function(e){return(e.segments||[]).reduce(function(e,t,i){return t.parts?t.parts.forEach(function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e},[])},rB=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},rN=function(e){var t=e.preloadSegment;if(t){var i=t.parts;return(t.preloadHints||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0)+(i&&i.length?i.length:0)}},rF=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=rB(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},rj=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=rR(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},rH=function(e,t){for(var i,n=0,r=t-e.mediaSequence;rr){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;oDate.now()},rK=function(e){return e.excludeUntil&&e.excludeUntil===1/0},rZ=function(e){var t=rG(e);return!e.disabled&&!t},rQ=function(e,t){return t.attributes&&t.attributes[e]},rX=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!rZ(e)&&(e.attributes.BANDWIDTH||0)0)for(var h=u-1;h>=0;h--){var p=l[h];if(o+=p.duration,s){if(o<0)continue}else if(o+rS<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-rW({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:h})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(u<0){for(var f=u;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i};u=0}for(var m=u;m0)continue}else if(o-rS>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+rW({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:m})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}},isEnabled:rZ,isDisabled:function(e){return e.disabled},isBlacklisted:rG,isIncompatible:rK,playlistEnd:rz,isAes:function(e){for(var t=0;t-1&&s!==a.length-1&&(i._HLS_part=s),(s>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var o=new(m()).URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&o.searchParams.set(e,i[e])}),e=o.toString()}return e},an=function(e,t){if(!e)return t;var i=ae(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return r8({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),r5({playlist:a,uri:n,id:r});var s=al(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(au(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),m().clearTimeout(this.mediaUpdateTimeout),m().clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(m().clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=m().setTimeout(this.media.bind(this,e,!1),n);return}var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(au(e,!0)),a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=rT(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}})}},i.pause=function(){this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=m().setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=m().setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},i.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src){this.src.uri||(this.src.uri=m().location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){e.setupInitialPlaylist(e.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=rT(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}})},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,r9(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=as(e),e.segments.forEach(function(t){aa(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var t=this.srcUri()||m().location.href;this.master=r7(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(at),ac=rg.xhr,ah=rg.mergeOptions,ap=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;t||!r||(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},af=function(){var e=function e(t,i){t=ah({timeout:45e3},t);var n=e.beforeRequest||rg.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=(!0===rg.Vhs.xhr.original?ac:rg.Vhs.xhr)(t,function(e,t){return ap(a,e,t,i)}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},am=function(e){var t,i={};return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?m().BigInt(t.offset)+m().BigInt(t.length)-m().BigInt(1):t.offset+t.length-1)),i},ag=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},a_=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},av=function(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];(0,R.Au)(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t},ay=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},aT=function(e){return e.resolvedUri},ab=function(e){for(var t=Array.prototype.slice.call(e),i="",n=0;nnew Date(l.getTime()+1e3*u)?null:(r>l&&(a=o),{segment:a,estimatedStart:a.videoTimingInfo?a.videoTimingInfo.transmuxedPresentationStart:r0.duration(t,t.mediaSequence+t.segments.indexOf(a)),type:a.videoTimingInfo?"accurate":"estimate"})},aE=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;rn){if(e>n+.25*a.duration)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},aw=function(e,t){try{n=new Date(e),r=new Date(t)}catch(i){}var n,r,a=n.getTime();return(r.getTime()-a)/1e3},aI=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t=d+u)return s(t,{response:o.subarray(u,u+d),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:am({byterange:e.sidx.byterange})},s)})},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},m().clearTimeout(this.minimumUpdatePeriodTimeout_),m().clearTimeout(this.mediaRequest_),m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e})}))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(m().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;m().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=m().setTimeout(function(){return t.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},i.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=m().setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(t.requestErrored_(i,n)){"HAVE_NOTHING"===t.state&&(t.started=!1);return}var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;if(t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=rT(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r){t.handleMaster_(),t.syncClientServerClock_(function(){return e(n,r)});return}return e(n,r)})},i.syncClientServerClock_=function(e){var t=this,i=(0,U.LG)(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:ry(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){var a;if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}}))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=aR({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=aU(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var i=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return i&&i!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(m().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0){t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout");return}this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=m().setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},i.refreshXml_=function(){var e=this;this.requestMaster_(function(t,i){i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=aN(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})},i.refreshMedia_=function(e){var t=this;if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];n?this.media_=i[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=m().setTimeout(function(){t.trigger("mediaupdatetimeout"),e()},au(t.media(),Boolean(n))))}(),this.trigger("loadedplaylist")},t}(aO),aj={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},aH=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t]){if(2==arguments.length)for(n=0,r=i.length;n>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),$(ef.mdhd,t)},es=function(e){var t;return $(ef.mdia,eo(e),(t=e.type,$(ef.hdlr,ev[t])),ee(e))},ee=function(e){return $(ef.minf,"video"===e.type?$(ef.vmhd,ey):$(ef.smhd,eT),$(ef.dinf,$(ef.dref,eb)),eu(e))},et=function(e){for(var t=e.length,i=[];t--;)i[t]=er(e[t]);return $.apply(null,[ef.moov,en(4294967295)].concat(i).concat(ei(e)))},ei=function(e){for(var t=e.length,i=[];t--;)i[t]=eh(e[t]);return $.apply(null,[ef.mvex].concat(i))},en=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 $(ef.mvhd,t)},el=function(e){var t,i,n=e.samples||[],r=new Uint8Array(4+n.length);for(i=0;i>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));for(t=0;t>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));if(i=[ef.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),$(ef.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],s))),$(ef.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];i.push($(ef.pasp,new Uint8Array([(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return $.apply(null,i)},Z=function(e){return $(ef.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),$(ef.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])))},ea=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return $(ef.tkhd,t)},ec=function(e){var t,i,n,r,a,s;return(t=$(ef.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/g),s=Math.floor(e.baseMediaDecodeTime%g),i=$(ef.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),"audio"===e.type)?(n=ep(e,92),$(ef.traf,t,i,n)):(r=el(e),n=ep(e,r.length+92),$(ef.traf,t,i,n,r))},er=function(e){return e.duration=e.duration||4294967295,$(ef.trak,ea(e),es(e))},eh=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),$(ef.trex,t)},Y=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},X=function(e,t){var i,n,r,a,s,o;for(t+=20+16*(a=e.samples||[]).length,r=Y(a,t),(n=new Uint8Array(r.length+16*a.length)).set(r),i=r.length,o=0;o>>24,n[i++]=(16711680&s.duration)>>>16,n[i++]=(65280&s.duration)>>>8,n[i++]=255&s.duration,n[i++]=(4278190080&s.size)>>>24,n[i++]=(16711680&s.size)>>>16,n[i++]=(65280&s.size)>>>8,n[i++]=255&s.size,n[i++]=s.flags.isLeading<<2|s.flags.dependsOn,n[i++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,n[i++]=61440&s.flags.degradationPriority,n[i++]=15&s.flags.degradationPriority,n[i++]=(4278190080&s.compositionTimeOffset)>>>24,n[i++]=(16711680&s.compositionTimeOffset)>>>16,n[i++]=(65280&s.compositionTimeOffset)>>>8,n[i++]=255&s.compositionTimeOffset;return $(ef.trun,n)},Q=function(e,t){var i,n,r,a,s,o;for(t+=20+8*(a=e.samples||[]).length,r=Y(a,t),(i=new Uint8Array(r.length+8*a.length)).set(r),n=r.length,o=0;o>>24,i[n++]=(16711680&s.duration)>>>16,i[n++]=(65280&s.duration)>>>8,i[n++]=255&s.duration,i[n++]=(4278190080&s.size)>>>24,i[n++]=(16711680&s.size)>>>16,i[n++]=(65280&s.size)>>>8,i[n++]=255&s.size;return $(ef.trun,i)},ep=function(e,t){return"audio"===e.type?Q(e,t):X(e,t)};var _={ftyp:J,mdat:function(e){return $(ef.mdat,e)},moof:function(e,t){for(var i=[],n=t.length;n--;)i[n]=ec(t[n]);return $.apply(null,[ef.moof,$(ef.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))].concat(i))},moov:et,initSegment:function(e){var t,i=J(),n=et(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},v=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},y={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(t=0,r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,n,r,a,s=t||0,o=[];for(i=0;iC.ONE_SECOND_IN_TS/2))){for((a=k()[e.samplerate])||(a=t[0].data),s=0;s=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,i=[];for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},M.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},M.prototype.addText=function(e){this.rows[this.rowIdx]+=e},M.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var R=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new M(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};R.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new M(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},R.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},R.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)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 U=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},a={};Object.keys(r).forEach(function(e){i=r[e],/^SERVICE/.test(e)&&(a[e]=i.encoding)}),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};U.prototype=new f,U.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},U.prototype.add708Bytes=function(e){var t=e.ccData;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t>>>8),this.current708Packet.data.push(255&t)},U.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5,n=31&a,7===i&&n>0&&(i=a=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},U.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e},U.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},U.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},U.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},U.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},U.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},U.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},U.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var B={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},N=function(e){return null===e?"":String.fromCharCode(e=B[e]||e)},F=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],j=function(){for(var e=[],t=15;t--;)e.push("");return e},H=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&t)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_){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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=j();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=j();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=j()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=N((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=N((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&r)==14&&this.addFormatting(e.pts,["i"]),(1&r)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=F.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),(16&t)==16&&(this.column_=((14&t)>>1)*4),this.isColorPAC(r)&&(14&r)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=N(n)+N(r),this[this.mode_](e.pts,a),this.column_+=a.length)}}};H.prototype=new f,H.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},H.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=j(),this.nonDisplayed_=j(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},H.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},H.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},H.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},H.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},H.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},H.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},H.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},H.prototype.isNormalChar=function(e){return e>=32&&e<=127},H.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=j(),this.displayed_=j()),void 0!==t&&t!==this.row_)for(var i=0;i"},"");this[this.mode_](e,i)},H.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[],this[this.mode_](e,t)}},H.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},H.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},H.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},G=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||W,this.push=function(e){(this.type_===W||e.type===this.type_)&&(void 0===n&&(n=e.dts),e.dts=z(e.dts,n),e.pts=z(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};G.prototype=new f;var K,Z,Q,X,Y,$,J,ee,et,ei,en,er,ea,es,eo,el,eu,ed,ec,eh,ep,ef,em,eg,e_,ev,ey,eT,eb,eS,ek,eC,eE,ew,eI,ex,eP,eA,eL,eO={TimestampRolloverStream:G,handleRollover:z},eD=function(e,t,i){var n,r="";for(n=t;n>>2;d*=4,d+=3&u[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10+s}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=V.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=V.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new f,t.STREAM_TYPES={h264:27,adts:15},(n=function(){var e,t=this,i=!1,r={data:[],size:0},a={data:[],size:0},s={data:[],size:0},o=function(e,t){var i,n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(4&e[6])!=0,192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},l=function(e,i,n){var r,a=new Uint8Array(e.size),s={type:i},l=0,u=0,d=!1;if(e.data.length&&!(e.size<9)){for(l=0,s.trackId=e.data[0].pid;l>5,u=(l=((3&t[d+6])+1)*1024)*ej/eH[(60&t[d+2])>>>2],t.byteLength-d>>6&3)+1,channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:eH[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+s,d+a)}),i++,d+=a}"number"==typeof r&&(this.skipWarn_(r,d),r=null),t=t.subarray(d)}},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")}}).prototype=new f;var eq=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return((n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0)?a<>>e)!=0)return i<<=e,n-=e,e;return this.loadWord(),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();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(s=function(){var e,t,i=0;s.prototype.init.call(this),this.push=function(n){t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var r,a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new f,o={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(a=function(){var e,t,i,n,r,l,u,d=new s;a.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,d.push(e))},d.on("data",function(a){var s={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(s.nalUnitTypeCode){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=r(a.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=r(a.subarray(1)),s.config=l(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",s)}),d.on("done",function(){e.trigger("done")}),d.on("partialdone",function(){e.trigger("partialdone")}),d.on("reset",function(){e.trigger("reset")}),d.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},u=function(e,t){var i,n=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4)?i+20:i+10},ez=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},eG=function(e,t,i){var n,r="";for(n=t;n=t+2&&(255&e[t])==255&&(240&e[t+1])==240&&(22&e[t+1])==16},parseId3TagSize:eW,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&(240&e[t+1])==240?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2]}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4+ez(e.subarray(10,14)));do{if((i=ez(e.subarray(t+4,t+8)))<1)break;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return s*=4,s+=3&a[7]}break}}t+=10+i}while(t=3;){if(73===e[o]&&68===e[o+1]&&51===e[o+2]){if(e.length-o<10||(s=eK.parseId3TagSize(e,o),o+s>e.length))break;n={type:"timed-metadata",data:e.subarray(o,o+s)},this.trigger("data",n),o+=s;continue}if((255&e[o])==255&&(240&e[o+1])==240){if(e.length-o<7||(s=eK.parseAdtsSize(e,o),o+s>e.length))break;r={type:"audio",data:e.subarray(o,o+s),pts:t,dts:t},this.trigger("data",r),o+=s;continue}o++}e=e.length-o>0?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new f;var eZ=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],eQ=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],eX=eK.isLikelyAacData,eY=C.ONE_SECOND_IN_TS,e$=function(e,t){t.stream=e,this.trigger("log",t)},eJ=function(e,t){for(var i=Object.keys(t),n=0;n=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i);return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,l,u;for(a=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;tn.pts){t++;continue}i++,a-=r.byteLength,o-=r.nalCount,l-=r.duration}return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=a,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}if(n.pts>r.pts){t--;continue}t===s.length-1&&(a=i),i--}if(!o&&null===a)return null;if(0===(l=o?i:a))return e;var t,i,n,r,a,o,l,u=e.slice(l),d=u.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return u.byteLength=d.byteLength,u.duration=d.duration,u.nalCount=d.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){s=e}}).prototype=new f,(h=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,h.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):void(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),"audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes)))}}).prototype=new f,h.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,eQ.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,eZ.forEach(function(e){s.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=_.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},h.prototype.setRemux=function(e){this.remuxTracks=e},(c=function(e){var t,i,n=this,s=!0;c.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="aac",a.metadataStream=new eN.MetadataStream,a.aacStream=new l,a.audioTimestampRolloverStream=new eN.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new eN.TimestampRolloverStream("timed-metadata"),a.adtsStream=new r,a.coalesceStream=new h(e,a.metadataStream),a.headOfPipeline=a.aacStream,a.aacStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.aacStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.metadataStream.on("timestamp",function(e){a.aacStream.setTimestamp(e.timeStamp)}),a.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||a.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new d(i,e),a.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),a.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done")),eJ(this,a)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new eN.MetadataStream,s.packetStream=new eN.TransportPacketStream,s.parseStream=new eN.TransportParseStream,s.elementaryStream=new eN.ElementaryStream,s.timestampRolloverStream=new eN.TimestampRolloverStream,s.adtsStream=new r,s.h264Stream=new a,s.captionStream=new eN.CaptionStream(e),s.coalesceStream=new h(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new u(t,e),s.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new d(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,n.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eJ(this,s)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,x.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,x.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&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(s){var t=eX(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new f;var e2={Transmuxer:c,VideoSegmentStream:u,AudioSegmentStream:d,AUDIO_PROPERTIES:eZ,VIDEO_PROPERTIES:eQ,generateSegmentTimingInfo:e1},e8={toUnsigned:function(e){return e>>>0},toHexString:function(e){return("00"+e.toString(16)).slice(-2)}},e4=function(e){return""+(String.fromCharCode(e[0])+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3]))},e5=e8.toUnsigned,e3=function e(t,i){var n,r,a,s,o,l=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?l.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1))).length&&(l=l.concat(o))),n=s;return l},e6=e8.toUnsigned,e7=m.getUint64,e9=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=e7(e.subarray(4)):t.baseMediaDecodeTime=e6(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},te=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tt=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=n.getUint32(4),c=8;for(r&&(i.dataOffset=n.getInt32(c),c+=4),a&&d&&(t={flags:te(e.subarray(c,c+4))},c+=4,s&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},s&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),l&&(t.flags=te(e.subarray(c,c+4)),c+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(c):t.compositionTimeOffset=n.getUint32(c),c+=4),i.samples.push(t);return i},ti=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n},tn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},tr="undefined"!=typeof window?window:void 0!==tn?tn:"undefined"!=typeof self?self:{},ta=P.discardEmulationPreventionBytes,ts=q.CaptionStream,to=function(e,t){for(var i=e,n=0;n0?e9(l[0]).baseMediaDecodeTime:0,d=e3(a,["trun"]);t===o&&d.length>0&&(i=tl(n,tu(d,u,s),o),r[o]||(r[o]={seiNals:[],logs:[]}),r[o].seiNals=r[o].seiNals.concat(i.seiNals),r[o].logs=r[o].logs.concat(i.logs))}),r},tc=function(e,t,i){if(null===t)return null;var n=td(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}},th=function(){var e,t,i,n,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new ts,s=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return(!e||0!==e.length)&&(!t||"object"!=typeof t||0!==Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized()||!a||!s)return null;if(this.isNewInit(a,s))n=s[i=a[0]];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,a,s)}return((o=tc(e,i,n))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals)?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},tp=e8.toUnsigned,tf=e8.toHexString,tm=m.getUint64,tg={findBox:e3,parseType:e4,timescale:function(e){return e3(e,["moov","trak"]).reduce(function(e,t){var i,n,r,a;return(i=e3(t,["tkhd"])[0])&&(r=tp(i[n=0===i[0]?12:20]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]),a=e3(t,["mdia","mdhd"])[0])?(n=0===a[0]?12:20,e[r]=tp(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]),e):null},{})},startTime:function(e,t){var i=e3(t,["moof","traf"]).reduce(function(t,i){var n,r,a=e3(i,["tfhd"])[0],s=e[tp(a[4]<<24|a[5]<<16|a[6]<<8|a[7])]||9e4,o=e3(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);return"bigint"==typeof(n=1===o[0]?tm(o.subarray(4,12)):l.getUint32(4))?r=n/tr.BigInt(s):"number"!=typeof n||isNaN(n)||(r=n/s),r11?(t.codec+=".",t.codec+=tf(u[9]),t.codec+=tf(u[10]),t.codec+=tf(u[11])):t.codec="avc1.4d400d":/^mp4[a,v]$/i.test(t.codec)?"esds"===e4((u=c.subarray(28)).subarray(4,8))&&u.length>20&&0!==u[19]?(t.codec+="."+tf(u[19]),t.codec+="."+tf(u[20]>>>2&63).replace(/^0/,"")):t.codec="mp4a.40.2":t.codec=t.codec.toLowerCase())}var h=e3(e,["mdia","mdhd"])[0];h&&(t.timescale=p(h)),i.push(t)}),i},getTimescaleFromMediaHeader:p=function(e){var t=0===e[0]?12:20;return tp(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])}},t_=function(e){var t=31&e[1];return t<<=8,t|=e[2]},tv=function(e){return!!(64&e[1])},ty=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},tT=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}},tb=eO.handleRollover,tS={};tS.ts={parseType:function(e,t){var i=t_(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=tv(e),i=4+ty(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t,i={},n=tv(e),r=4+ty(e);if(n&&(r+=e[r]+1),1&e[r+5]){t=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a=e.byteLength)return null;var n=null;return 192&(t=e[i+7])&&((n={}).pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,n.pts*=4,n.pts+=(6&e[i+13])>>>1,n.dts=n.pts,64&t&&(n.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,n.dts*=4,n.dts+=(6&e[i+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+ty(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===tT(31&i[r+3])&&(a=!0),a}},tS.aac=eK;var tk=C.ONE_SECOND_IN_TS,tC=function(e,t){for(var i,n=0,r=188;r=0;){if(71===e[o]&&(71===e[l]||l===e.byteLength)){if(n=e.subarray(o,l),"pes"===tS.ts.parseType(n,t.pid)&&(r=tS.ts.parsePesType(n,t.table),a=tS.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=tS.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),u=!0)),u)break;o-=188,l-=188;continue}o--,l--}},tw=function(e,t,i){for(var n,r,a,s,o,l,u,d=0,c=188,h=!1,p={data:[],size:0};c=0;){if(71===e[d]&&71===e[c]){if(n=e.subarray(d,c),"pes"===tS.ts.parseType(n,t.pid)&&(r=tS.ts.parsePesType(n,t.table),a=tS.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=tS.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),h=!0)),h)break;d-=188,c-=188;continue}d--,c--}},tI=function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=tb(e.dts,i),e.pts=tb(e.pts,i),e.dtsTime=e.dts/tk,e.ptsTime=e.pts/tk})}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=tb(e.dts,n),e.pts=tb(e.pts,n),e.dtsTime=e.dts/tk,e.ptsTime=e.pts/tk}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=tb(r.dts,n),r.pts=tb(r.pts,n),r.dtsTime=r.dts/tk,r.ptsTime=r.pts/tk}}},tx=function(e){for(var t,i=!1,n=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(tS.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(s=tS.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=tS.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7||(s=tS.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=tS.aac.parseSampleRate(t)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var l=tk/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*l,pts:a+1024*n*l}]}},tP=function(e){var t={pid:null,table:null},i={};for(var n in tC(e,t),t.table)if(t.table.hasOwnProperty(n))switch(t.table[n]){case V.H264_STREAM_TYPE:i.video=[],tw(e,t,i),0===i.video.length&&delete i.video;break;case V.ADTS_STREAM_TYPE:i.audio=[],tE(e,t,i),0===i.audio.length&&delete i.audio}return i},tA={inspect:function(e,t){var i;return(i=tS.aac.isLikelyAacData(e)?tx(e):tP(e))&&(i.audio||i.video)?(tI(i,t),i):null},parseAudioPes_:tE},tL=function(e,t){t.on("data",function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.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){var i={start:{decode:C.videoTsToSeconds(t.start.dts),presentation:C.videoTsToSeconds(t.start.pts)},end:{decode:C.videoTsToSeconds(t.end.dts),presentation:C.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:C.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=C.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:C.videoTsToSeconds(t.start.dts),presentation:C.videoTsToSeconds(t.start.pts)},end:{decode:C.videoTsToSeconds(t.end.dts),presentation:C.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:C.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=C.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:C.videoTsToSeconds(t.start),end:C.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:C.videoTsToSeconds(t.start),end:C.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})},tO=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new e2.Transmuxer(this.options),tL(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new th,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),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])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=tg.startTime(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=tg.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:i*C.ONE_SECOND_IN_TS,r=tA.inspect(t,n),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(C.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(C.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){if("init"===e.data.action&&e.data.options){this.messageHandlers=new tO(self,e.data.options);return}this.messageHandlers||(this.messageHandlers=new tO(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}}))),aZ=function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,l=n.metadata,u=n.videoFrameDtsTime,d=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:l});var c=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==u&&(h.videoFrameDtsTime=u),void 0!==d&&(h.videoFramePtsTime=d),i(h)},aQ=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},aX=function(e,t){t.gopInfo=e.data.gopInfo},aY=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,l=e.onAudioTimingInfo,u=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,c=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,_=e.isEndOfTimeline,v={buffer:[]},y=_;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&aZ(i,v,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&aX(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(y=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"!==i.data.type||y||(t.onmessage=null,aQ({transmuxedData:v,callback:f}),a$(t)))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var T=i instanceof ArrayBuffer?i:i.buffer,b=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:T,byteOffset:b,byteLength:i.byteLength},[T])}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},a$=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():aY(e.currentTransmux))},aJ=function(e,t){e.postMessage({action:t}),a$(e)},a0=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,aJ(t,e);return}t.transmuxQueue.push(aJ.bind(null,t,e))},a1=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,aY(e);return}e.transmuxer.transmuxQueue.push(e)},a2={reset:function(e){a0("reset",e)},endTimeline:function(e){a0("endTimeline",e)},transmux:a1,createTransmuxer:function(e){var t=new aK;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t}},a8=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=(0,v.Z)({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data))}),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},a4={FAILURE:2,TIMEOUT:-101,ABORTED:-102},a5=function(e){e.forEach(function(e){e.abort()})},a3=function(e){var t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8e3),i},a6=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:a4.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:a4.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:a4.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:a4.FAILURE,xhr:t}:null},a7=function(e,t,i){return function(n,r){var a=r.response,s=a6(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:a4.FAILURE,xhr:r},e);for(var o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),u=0;u1){sd("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]}),t},sm=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},sg=function(e,t){var i=t.attributes||{},n=sf(sc(t)||[]);if(sh(e,t)&&!n.audio&&!sp(e,t)){var r=sf((0,D.Jg)(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},s_=rb("PlaylistSelector"),sv=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},sy=function(e,t){if(!e)return"";var i=m().getComputedStyle(e);return i?i[t]:""},sT=function(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r})},sb=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||m().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||m().Number.MAX_VALUE)},sS=function(e,t,i,n,r,a){if(e){var s,o,l,u,d={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},c=e.playlists;r0.isAudioOnly(e)&&(c=a.getAudioTrackPlaylists_(),d.audioOnly=!0);var h=c.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||m().Number.MAX_VALUE,width:t,height:i,playlist:e}});sT(h,function(e,t){return e.bandwidth-t.bandwidth});var p=(h=h.filter(function(e){return!r0.isIncompatible(e.playlist)})).filter(function(e){return r0.isEnabled(e.playlist)});p.length||(p=h.filter(function(e){return!r0.isDisabled(e.playlist)}));var f=p.filter(function(e){return e.bandwidth*aj.BANDWIDTH_VARIANCEi||e.height>n})).filter(function(e){return e.width===s[0].width&&e.height===s[0].height}))[o.length-1],l=o.filter(function(e){return e.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var k=T.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e});sT(k,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),u=k[0]}var C=u||l||S||_||p[0]||h[0];if(C&&C.playlist){var E="sortedPlaylistReps";return u?E="leastPixelDiffRep":l?E="resolutionPlusOneRep":S?E="resolutionBestRep":_?E="bandwidthBestRep":p[0]&&(E="enabledPlaylistReps"),s_("choosing "+sv(C)+" using "+E+" with options",d),C.playlist}return s_("could not choose a playlist with options",d),null}},sk=function(){var e=this.useDevicePixelRatio&&m().devicePixelRatio||1;return sS(this.playlists.master,this.systemBandwidth,parseInt(sy(this.tech_.el(),"width"),10)*e,parseInt(sy(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},sC=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,l=e.syncController,u=t.playlists.filter(function(e){return!r0.isIncompatible(e)}),d=u.filter(r0.isEnabled);d.length||(d=u.filter(function(e){return!r0.isDisabled(e)}));var c=d.filter(r0.hasAttribute.bind(null,"BANDWIDTH")).map(function(e){var t=l.getSyncPoint(e,r,o,i),u=r0.estimateSegmentRequestTime(a,n,e);return{playlist:e,rebufferingImpact:u*(t?1:2)-s}}),h=c.filter(function(e){return e.rebufferingImpact<=0});return(sT(h,function(e,t){return sb(t.playlist,e.playlist)}),h.length)?h[0]:(sT(c,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),c[0]||null)},sE=function(e){var t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(function(e){t.set(e,i),i+=e.byteLength})),t},sw=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=i,o=i,l=!1,u=a[n];u&&(s=u.label,o=u.language,l=u.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:l,label:s,language:o},!1).track}}},sI=function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=m().WebKitDataCue||m().VTTCue;i.forEach(function(e){t[e.stream].addCue(new r(e.startTime+n,e.endTime+n,e.text))})}},sx=function(e){Object.defineProperties(e.frame,{id:{get:function(){return rg.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return rg.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return rg.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},sP=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=m().WebKitDataCue||m().VTTCue,s=t.metadataTrack_;if(s&&(i.forEach(function(e){var t=e.cueTime+n;"number"!=typeof t||m().isNaN(t)||t<0||!(t<1/0)||e.frames.forEach(function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,sx(i),s.addCue(i)})}),s.cues&&s.cues.length)){for(var o=s.cues,l=[],u=0;u=e&&r.endTime<=t&&i.removeCue(r)},sO=function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]);n.length&&n.forEach(function(t){return e.removeCue(t)})}},sD=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*H.ONE_SECOND_IN_TS);for(n=0;nr);n++);return e.slice(n)},sM=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r=n);r++);return e.slice(0,r).concat(t)},sR=function(e,t,i,n){for(var r=Math.ceil((t-n)*H.ONE_SECOND_IN_TS),a=Math.ceil((i-n)*H.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var l=o+1;l--&&!(e[l].pts<=r););return l=Math.max(l,0),s.splice(l,o-l+1),s},sU=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;ri))return a}return 0===n.length?0:n[n.length-1]},sN=function(e){return"number"==typeof e&&isFinite(e)},sF=1/60,sj=function(e,t,i){var n=t-aj.BACK_BUFFER_LENGTH;return e.length&&(n=Math.max(n,e.start(0))),Math.min(t-i,n)},sH=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,l=a.segments,u=e.mediaIndex,d=e.partIndex,c=e.timeline,h=(void 0===l?[]:l).length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var f="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",g=f?rN({preloadSegment:n})-1:0;return m+" ["+(s+u)+"/"+(s+h)+"]"+(f?" part ["+d+"/"+g+"]":"")+(" segment start/end ["+n.start)+" => "+n.end+"]"+(f?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+c+"] selected by ["+p+"] playlist ["+o+"]"},sq=function(e){return e+"TimingInfo"},sV=function(e){var t=e.segmentTimeline,i=e.currentTimeline,n=e.startOfSegment,r=e.buffered;return e.overrideCheck||t!==i?tt&&(t=n)}}),"bigint"==typeof t&&ti+rS},sK=function(e,t){if("hls"!==t)return null;var i=sz({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var n=e.playlist.targetDuration,r=sG({segmentDuration:i,maxDuration:2*n}),a=sG({segmentDuration:i,maxDuration:n}),s="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 "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||a?{severity:r?"warn":"info",message:s}:null},sZ=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw TypeError("No currentTime getter specified");if(!t.mediaSource)throw TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,n.captionServices_=t.captionServices,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=rg.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=rb("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty((0,b.Z)(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}(0,S.Z)(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return a2.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){if("WAITING"!==this.state){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,m().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&a2.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return rg.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=ay(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=aT(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY")}},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex){if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&a2.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var r=1,a=function(){0==--r&&i()};for(var s in(n||!this.audioDisabled_)&&(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=sR(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)sL(e,t,this.inbandTextTracks_[s]);sL(e,t,this.segmentMetadataTrack_),a()},i.monitorBuffer_=function(){this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=m().setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&m().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=m().setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},i.chooseNextRequest_=function(){var e=this.buffered_(),t=rO(e)||0,i=rD(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=sB(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],l="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[l+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=l+1):s.mediaIndex=this.mediaIndex+1}else{var u=r0.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),d=u.segmentIndex,c=u.startTime,h=u.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=d,s.startOfSegment=c,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent){if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part")}var _=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,l=e.getMediaInfoForTime,u=i.segments[n],d="number"==typeof s&&u.parts[s],c={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:d?s:null,isSyncRequest:a,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:d&&d.duration||u.duration,segment:u,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=rO(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=sD(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c},i.timestampOffsetForSegment_=function(e){return sV(e)},i.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t,i,n=this.currentTime_(),r=e.bandwidth,a=this.pendingSegment_.duration,s=r0.estimateSegmentRequestTime(a,r,this.playlist_,e.bytesReceived),o=(t=this.buffered_(),void 0===(i=this.vhs_.tech_.playbackRate())&&(i=1),((t.length?t.end(t.length-1):0)-n)/i-1);if(!(s<=o)){var l=sC({master:this.vhs_.playlists.master,currentTime:n,bandwidth:r,duration:this.duration_(),segmentDuration:a,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(l){var u=s-o-l.rebufferingImpact,d=.5;o<=rS&&(d=1),l.playlist&&l.playlist.uri!==this.playlist_.uri&&!(u "+s+" for "+e),sw(l,i.vhs_.tech_,e),sL(a,s,l[e]),sI({captionArray:o,inbandTextTracks:l,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();sA(this.inbandTextTracks_,i,this.vhs_.tech_),sP({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})}},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!sW({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo||sW({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[sq(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=ay(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+rA(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+rA(o).join(", "));var l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0,d=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0;if(u-l<=1&&c-d<=1){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+rA(s).join(", ")+", video buffer: "+rA(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=m().setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()},1e3)},!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;if(t){if(22===t.code){this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")}},i.appendToSourceBuffer_=function(e){var t=e.segmentInfo,i=e.type,n=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;n&&(s.unshift(n),o+=n.byteLength),a=sE({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:a}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var i=(0,v.Z)({},e,{forceTimestampOffset:!0});(0,v.Z)(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;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}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+sH(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=su({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,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:n||r&&a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,a=i.stream;t.logger_(sH(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=sj(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={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},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a){this.logger_("bad "+(r?"segment":"part")+" "+sH(e)),this.resetEverything();return}null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},i.recordThroughput_=function(e){if(e.duration=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},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===a4.TIMEOUT&&this.handleTimeout_(),e.code===a4.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof m().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})};s=function(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),this.subtitlesTrack_.tech_.one("vttjserror",o);return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new(m()).VTTCue(e.startTime,e.endTime,e.text):e)}),sO(this.subtitlesTrack_),this.handleAppendsDone_()},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof m().TextDecoder?t=new(m()).TextDecoder("utf8"):(t=m().WebVTT.StringDecoder(),i=!0);var n=new(m()).WebVTT.Parser(m(),m().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){rg.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=s6(r)),n.parse(r)}var a=e.bytes;i&&(a=s6(a)),n.parse(a),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t){if(!e.cues.length){n.empty=!0;return}var r=e.timestampmap,a=r.MPEGTS/H.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a}),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}},t}(sZ),oe=function(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r}return null},ot=function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a=h)&&(s=h,a={time:c,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=c)&&(s=c,a={time:d.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],on=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=rb("SyncController"),i}(0,S.Z)(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+rW({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a86400){rg.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");return}for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-(a.getTime()/1e3))},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+o.time)+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||no){var l=void 0;l=s<0?i.start-rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:l,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(rg.EventTarget),or=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}(0,S.Z)(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(rg.EventTarget),oa=aW(az(aG(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{};function t(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?i.path:t)}},i.exports),i.exports}var n=t(function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(2==arguments.length)for(var i=t.length,n=0;n>7)*283)^e]=e;for(t=i=0;!c[t];t^=n||1,i=f[i]||1)for(e=0,a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,c[t]=a,h[a]=t,o=16843009*p[r=p[n=p[t]]]^65537*r^257*n^16843008*t,s=257*p[a]^16843008*a;e<4;e++)u[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)u[e]=u[e].slice(0),d[e]=d[e].slice(0);return l},l=null,u=function(){function e(e){l||(l=o()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var t,i,n,r=this._tables[0][4],a=this._tables[1],s=e.length,u=1;if(4!==s&&6!==s&&8!==s)throw Error("Invalid aes key size");var d=e.slice(0),c=[];for(this._key=[d,c],t=s;t<4*s+28;t++)n=d[t-1],(t%s==0||8===s&&t%s==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^(u>>7)*283)),d[t]=d[t-s]^n;for(i=0;t;i++,t--)n=d[3&i?t:t-4],t<=4||i<4?c[i]=n:c[i]=a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,l,u,d=this._key[1],c=e^d[0],h=n^d[1],p=i^d[2],f=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],v=_[0],y=_[1],T=_[2],b=_[3],S=_[4];for(u=0;u>>24]^y[h>>16&255]^T[p>>8&255]^b[255&f]^d[g],o=v[h>>>24]^y[p>>16&255]^T[f>>8&255]^b[255&c]^d[g+1],l=v[p>>>24]^y[f>>16&255]^T[c>>8&255]^b[255&h]^d[g+2],f=v[f>>>24]^y[c>>16&255]^T[h>>8&255]^b[255&p]^d[g+3],g+=4,c=s,h=o,p=l;for(u=0;u<4;u++)r[(3&-u)+a]=S[c>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^d[g++],s=c,c=h,h=p,p=f,f=s},e}(),d=function(e){function t(){var t;return(t=e.call(this,s)||this).jobs=[],t.delay=1,t.timeout_=null,t}a(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(s),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(e,t,i){var n,r,a,s,o,l,d,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new u(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(p=0,n=i[0],r=i[1],a=i[2],s=i[3];p=0&&(t="main-desc"),t},oo=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},ol=function(e,t){t.activePlaylistLoader=e,e.load()},ou={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;oo(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(e){return e.default})[0]||s[0]).id,l=n.tracks[o];if(a===l){r({message:"Problem encountered loading the default audio track."});return}for(var u in rg.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[u].enabled=n.tracks[u]===l;n.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];rg.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),oo(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},od={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ou[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ou[e](e,i))}},oc={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],l=o.groups,u=o.tracks,d=o.logger_,c=t.masterPlaylistLoader,h=rJ(c.master);for(var p in(!s[e]||0===Object.keys(s[e]).length)&&(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=c.master.playlists)),s[e])for(var f in l[p]||(l[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(d("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new ad(m.playlists[0],i,a):m.resolvedUri?new ad(m.resolvedUri,i,a):m.playlists&&"dash"===n?new aF(m.playlists[0],i,a,c):null,m=rg.mergeOptions({id:f,playlistLoader:g},m),od[e](e,m.playlistLoader,t),l[p].push(m),void 0===u[f]){var _=new rg.AudioTrack({id:f,kind:os(m),enabled:!1,language:m.language,default:m.default,label:f});u[f]=_}}r.on("error",ou[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,d=l.tracks,c=t.masterPlaylistLoader;for(var h in o[e])for(var p in u[h]||(u[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new ad(f.resolvedUri,n,s);else if("dash"===r){if(!f.playlists.filter(function(e){return e.excludeUntil!==1/0}).length)return;m=new aF(f.playlists[0],n,s,c)}else"vhs-json"===r&&(m=new ad(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=rg.mergeOptions({id:p,playlistLoader:m},f),od[e](e,f.playlistLoader,t),u[h].push(f),void 0===d[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;d[p]=g}}a.on("error",ou[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var l in a[o]||(a[o]=[]),n[e][o]){var u=n[e][o][l];if(/^(?:CC|SERVICE)/.test(u.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},c={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(d[c.instreamId]&&(c=rg.mergeOptions(c,d[c.instreamId])),void 0===c.default&&delete c.default,a[o].push(rg.mergeOptions({id:l},u)),void 0===s[l]){var h=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;s[l]=h}}}}},oh=function e(t,i){for(var n=0;n1&&rJ(e.master))for(var l=0;l "+r.id;if(!t)return u(d+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var c=Boolean(rE(i,n).length);if(!t.endList)return c||"number"!=typeof t.partTargetDuration?(u(d+" as current playlist is live"),!0):(u("not "+d+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=rD(i,n),p=l?aj.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:aj.MAX_BUFFER_LOW_WATER_LINE;if(om)&&h>=a){var _=d+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return l&&(_+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),u(_),!0}return u("not "+d+" as no switching criteria met"),!1},oT=function(e){function t(t){i=e.call(this)||this;var i,n=t.src,r=t.handleManifestRedirects,a=t.withCredentials,s=t.tech,o=t.bandwidth,l=t.externVhs,u=t.useCueTags,d=t.blacklistDuration,c=t.enableLowInitialPlaylist,h=t.sourceType,f=t.cacheEncryptionKeys,g=t.experimentalBufferBasedABR,_=t.experimentalLeastPixelDiffSelector,v=t.captionServices;if(!n)throw Error("A non-empty playlist URL or JSON manifest string is required");var y=t.maxPlaylistRetries;null==y&&(y=1/0),p=l,i.experimentalBufferBasedABR=Boolean(g),i.experimentalLeastPixelDiffSelector=Boolean(_),i.withCredentials=a,i.tech_=s,i.vhs_=s.vhs,i.sourceType_=h,i.useCueTags_=u,i.blacklistDuration=d,i.maxPlaylistRetries=y,i.enableLowInitialPlaylist=c,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:a,handleManifestRedirects:r,maxPlaylistRetries:y,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=og(),i.mediaSource=new(m()).MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind((0,b.Z)(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind((0,b.Z)(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind((0,b.Z)(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=rg.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new on(t),i.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new oa,i.sourceUpdater_=new s3(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new or;var T={vhs:i.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:v,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:o,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};i.masterPlaylistLoader_="dash"===i.sourceType_?new aF(n,i.vhs_,i.requestOptions_):new ad(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new sZ(rg.mergeOptions(T,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new sZ(rg.mergeOptions(T,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new s9(rg.mergeOptions(T,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",function(){return i.startABRTimer_()}),i.tech_.on("pause",function(){return i.stopABRTimer_()}),i.tech_.on("play",function(){return i.startABRTimer_()})),o_.forEach(function(e){i[e+"_"]=ov.bind((0,b.Z)(i),e)}),i.logger_=rb("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var S="none"===i.tech_.preload()?"play":"loadstart";return i.tech_.one(S,function(){var e=Date.now();i.tech_.one("loadeddata",function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends})}),i}(0,S.Z)(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=m().setInterval(function(){return e.checkABR_()},250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(m().clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e,t=this.master(),i=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return i;var n=t.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){e={label:s};break}}if(!e)return i;var o=[];for(var l in n)if(n[l][e.label]){var u=n[l][e.label];if(u.playlists&&u.playlists.length)o.push.apply(o,u.playlists);else if(u.uri)o.push(u);else if(t.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return oy({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;if(void 0===e&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){rg.browser.IE_VERSION||rg.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=i,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var u=e.internal?this.logger_:rg.log.warn,d=e.message?" "+e.message:"";u((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+d+" Switching to playlist "+l.id+"."),l.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var c=l.targetDuration/2*1e3||5e3,h="number"==typeof l.lastRequest&&Date.now()-l.lastRequest<=c;return this.switchMedia_(l,"exclude",s||h)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];r&&(e===t||"all"===e)&&n.push(r)}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},i.setCurrentTime=function(e){var t=rE(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:void(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:p.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){if(!!this.masterPlaylistLoader_){var e,t,i,n=this.masterPlaylistLoader_.media();if(n){var r=this.syncController_.getExpiredTime(n,this.duration());if(null!==r){var a=this.masterPlaylistLoader_.master,s=p.Playlist.seekable(n,r,p.Playlist.liveEdgeDelay(a,n));0!==s.length&&(!this.mediaTypes_.AUDIO.activePlaylistLoader||(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null!==(r=this.syncController_.getExpiredTime(n,this.duration()))&&0!==(e=p.Playlist.seekable(n,r,p.Playlist.liveEdgeDelay(a,n))).length))&&(this.seekable_&&this.seekable_.length&&(t=this.seekable_.end(0),i=this.seekable_.start(0)),e?e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=rg.createTimeRanges([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!!t&&!!i},i.getCodecsOrExclude_=function(){var e,t=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var n=sg(this.master(),this.media()),r={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(r.video=n.video||i.main.videoCodec||D.xz),i.main.isMuxed&&(r.video+=","+(n.audio||i.main.audioCodec||D.lA)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||a)&&(r.audio=n.audio||i.main.audioCodec||i.audio.audioCodec||D.lA,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),!r.audio&&!r.video){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var s={};if(["video","audio"].forEach(function(t){var n,a;if(r.hasOwnProperty(t)&&(n=i[t].isFmp4,a=r[t],n?!(0,D.p7)(a):!(0,D.Hi)(a))){var o=i[t].isFmp4?"browser":"muxer";s[o]=s[o]||[],s[o].push(r[t]),"audio"===t&&(e=o)}}),a&&e&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach(function(e){(e.attributes&&e.attributes.AUDIO)===o&&e!==t.media()&&(e.excludeUntil=1/0)}),this.logger_("excluding audio group "+o+" as "+e+' does not support codec(s): "'+r.audio+'"')}if(Object.keys(s).length){var l=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach(function(e){var i=((0,D.kS)(t.sourceUpdater_.codecs[e]||"")[0]||{}).type,n=((0,D.kS)(r[e]||"")[0]||{}).type;i&&n&&i.toLowerCase()!==n.toLowerCase()&&u.push('"'+t.sourceUpdater_.codecs[e]+'" -> "'+r[e]+'"')}),u.length){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return r},i.tryToCreateSourceBuffers_=function(){if(!("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=sg(e.master,r),s=[];!a.audio||(0,D.Hi)(a.audio)||(0,D.p7)(a.audio)||s.push("audio codec "+a.audio),!a.video||(0,D.Hi)(a.video)||(0,D.p7)(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}})},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=sf((0,D.kS)(e)),a=sm(r),s=r.video&&(0,D.kS)(r.video)[0]||null,o=r.audio&&(0,D.kS)(r.audio)[0]||null;Object.keys(n).forEach(function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var l=[],u=sg(t.masterPlaylistLoader_.master,r),d=sm(u);if(u.audio||u.video){if(d!==a&&l.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var c=u.video&&(0,D.kS)(u.video)[0]||null,h=u.audio&&(0,D.kS)(u.audio)[0]||null;c&&s&&c.type.toLowerCase()!==s.type.toLowerCase()&&l.push('video codec "'+c.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&l.push('audio codec "'+h.type+'" !== "'+o.type+'"')}l.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+l.join(" && ")))}}})},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),ot(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=aj.GOAL_BUFFER_LENGTH,i=aj.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,aj.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=aj.BUFFER_LOW_WATER_LINE,i=aj.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,aj.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,aj.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return aj.BUFFER_HIGH_WATER_LINE},t}(rg.EventTarget),ob=function(e,t,i){var n,r,a=e.masterPlaylistController_,s=a[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(a);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=sg(a.master(),t),this.playlist=t,this.id=i,this.enabled=(n=e.playlists,r=t.id,function(e){var t=n.master.playlists[r],i=rK(t),a=rZ(t);return void 0===e?a:(e?delete t.disabled:t.disabled=!0,e===a||i||(s(),e?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),e)})},oS=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=rJ(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!rK(e)}).map(function(t,i){return new ob(e,t,t.id)}):[]}},ok=["seeking","seeked","pause","playing","error"],oC=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=rb("PlaybackWatcher"),this.logger_("initialize");var i=function(){return t.monitorCurrentTime_()},n=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],l={};o.forEach(function(e){l[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),t.tech_.on(["seeked","seeking"],l[e].reset)});var u=function(e){["main","audio"].forEach(function(i){s[i+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=function(){return u("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(ok,a),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(ok,a),t.tech_.off("canplay",n),t.tech_.off("play",i),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach(function(e){s[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),t.tech_.off(["seeked","seeking"],l[e].reset)}),t.checkCurrentTimeTimeout_&&m().clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&m().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=m().setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=rL(this[e+"Buffered_"],n);if(this[e+"Buffered_"]=n,r){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:rA(n)}),!(this[e+"StalledDownloads_"]<10)&&(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+rk>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:rk)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+rP(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,l=this.media(),u=l.partTargetDuration?l.partTargetDuration:(l.targetDuration-rS)*2,d=[s,o],c=0;c "+t.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=rw(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+rk;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),oE={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ow=function e(t,i){var n=0,r=0,a=rg.mergeOptions(oE,i);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},l=function(){if(Date.now()-n<1e3*a.errorInterval){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!a.getSource||"function"!=typeof a.getSource){rg.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),a.getSource.call(t,o)},u=function e(){t.off("loadedmetadata",s),t.off("error",l),t.off("dispose",e)};t.on("error",l),t.on("dispose",u),t.reloadSourceOnError=function(i){u(),e(t,i)}},oI="2.14.3",ox={PlaylistLoader:ad,Playlist:r0,utils:aS,STANDARD_PLAYLIST_SELECTOR:sk,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(r0.isEnabled);return sT(t,function(e,t){return sb(e,t)}),t.filter(function(t){return!!sg(e.playlists.master,t).video})[0]||null},lastBandwidthSelector:sk,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&m().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),sS(this.playlists.master,t,parseInt(sy(this.tech_.el(),"width"),10)*n,parseInt(sy(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:sb,comparePlaylistResolution:function(e,t){var i,n;return(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||m().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||m().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH)?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:af()};Object.keys(aj).forEach(function(e){Object.defineProperty(ox,e,{get:function(){return rg.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),aj[e]},set:function(t){if(rg.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0){rg.log.warn("value of Vhs."+e+" must be greater than or equal to 0");return}aj[e]=t}})});var oP="videojs-vhs",oA=function(e,t){for(var i=t.media(),n=-1,r=0;r=1e7&&e>=1e7?Math.max(e,i):i}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){rg.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return rA(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return rA(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&oU({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){oS(n)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){n.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=m().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),oD({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=oM({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",function(t){if("output-restricted"===t.status){var i,n=e.masterPlaylistController_.master();if(n&&n.playlists){var r=[];n.playlists.forEach(function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,r.push(e))}),r.length&&((i=rg.log).warn.apply(i,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(r)),e.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11===rg.browser.IE_VERSION||!i){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},i.setupQualityLevels_=function(){var e=this,t=rg.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){oL(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){oA(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":oI,"mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return s3.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&m().URL.revokeObjectURL&&(m().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return ax({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),aP({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(rg.getComponent("Component")),oN={name:"videojs-http-streaming",VERSION:oI,canHandleSource:function(e,t){void 0===t&&(t={});var i=rg.mergeOptions(rg.options,t);return oN.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=rg.mergeOptions(rg.options,i);return t.vhs=new oB(e,t,n),rg.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return rg.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=af(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=rg.mergeOptions(rg.options,t),n=i.vhs,r=(n=void 0===n?{}:n).overrideNative,a=void 0===r?!rg.browser.IS_ANY_SAFARI:r,s=i.hls,o=(s=void 0===s?{}:s).overrideNative,l=(0,M.t)(e);return l&&(!ox.supportsTypeNatively(l)||void 0!==o&&o||a)?"maybe":""}};(0,D.p7)("avc1.4d400d,mp4a.40.2")&&rg.getTech("Html5").registerSourceHandler(oN,0),rg.VhsHandler=oB,Object.defineProperty(rg,"HlsHandler",{get:function(){return rg.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),oB},configurable:!0}),rg.VhsSourceHandler=oN,Object.defineProperty(rg,"HlsSourceHandler",{get:function(){return rg.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),oN},configurable:!0}),rg.Vhs=ox,Object.defineProperty(rg,"Hls",{get:function(){return rg.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),ox},configurable:!0}),rg.use||(rg.registerComponent("Hls",ox),rg.registerComponent("Vhs",ox)),rg.options.vhs=rg.options.vhs||{},rg.options.hls=rg.options.hls||{},rg.getPlugin&&rg.getPlugin("reloadSourceOnError")||(rg.registerPlugin||rg.plugin)("reloadSourceOnError",function(e){ow(this,e)}),t.Z=rg}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/main-032bb01f10a7d678.js b/static/web/_next/static/chunks/main-032bb01f10a7d678.js deleted file mode 100644 index ece6938bf..000000000 --- a/static/web/_next/static/chunks/main-032bb01f10a7d678.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[179],{60932:function(e,t){"use strict";function r(e,t,r,n,a,o,i){try{var l=e[o](i),s=l.value}catch(u){r(u);return}l.done?t(s):Promise.resolve(s).then(n,a)}t.Z=function(e){return function(){var t=this,n=arguments;return new Promise(function(a,o){var i=e.apply(t,n);function l(e){r(i,a,o,l,s,"next",e)}function s(e){r(i,a,o,l,s,"throw",e)}l(void 0)})}}},6495:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(a[r]=e[r]);return a}},40037:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})})},33468:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addBasePath=function(e,t){return a.normalizePathTrailingSlash(n.addPathPrefix(e,""))};var n=r(44135),a=r(52700);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54465:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLocale=void 0,r(52700),t.addLocale=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'.concat(e.props["data-href"],'"]')))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let r=t[e.type]||[];r.push(e),t[e.type]=r});let r=t.title?t.title[0]:null,o="";if(r){let{children:i}=r.props;o="string"==typeof i?i:Array.isArray(i)?i.join(""):""}o!==document.title&&(document.title=o),["meta","base","link","style","script"].forEach(e=>{(function(e,t){let r=document.getElementsByTagName("head")[0],o=r.querySelector("meta[name=next-head-count]"),i=Number(o.content),l=[];for(let s=0,u=o.previousElementSibling;s{for(let t=0,r=l.length;t{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),d.forEach(e=>r.insertBefore(e,o)),o.content=(i-l.length+d.length).toString()})(e,t[e]||[])})}}},t.isEqualNode=a,t.DOMAttributeNames=void 0;let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function n(e){let{type:t,props:n}=e,a=document.createElement(t);for(let o in n){if(!n.hasOwnProperty(o)||"children"===o||"dangerouslySetInnerHTML"===o||void 0===n[o])continue;let i=r[o]||o.toLowerCase();"script"===t&&("async"===i||"defer"===i||"noModule"===i)?a[i]=!!n[o]:a.setAttribute(i,n[o])}let{children:l,dangerouslySetInnerHTML:s}=n;return s?a.innerHTML=s.__html||"":l&&(a.textContent="string"==typeof l?l:Array.isArray(l)?l.join(""):""),a}function a(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let r=t.getAttribute("nonce");if(r&&!e.getAttribute("nonce")){let n=t.cloneNode(!0);return n.setAttribute("nonce",""),n.nonce=r,r===e.nonce&&e.isEqualNode(n)}}return e.isEqualNode(t)}t.DOMAttributeNames=r,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},84534:function(e,t,r){"use strict";let n,a,o,i,l,s,u,c,d,f,p,h;Object.defineProperty(t,"__esModule",{value:!0});let m=r(91598).Z;Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=function(){return z.apply(this,arguments)},t.hydrate=function(e){return ei.apply(this,arguments)},t.emitter=t.router=t.version=void 0;var g=r(60932).Z,y=r(6495).Z,v=r(92648).Z;r(91598).Z,r(40037);var _=v(r(67294)),P=v(r(20745)),b=r(4664),E=v(r(8550)),S=r(72692),x=r(86238),w=r(94919),C=r(86949),R=r(670),O=r(17345),j=v(r(31831)),A=v(r(70976)),M=v(r(659)),L=r(18483),T=r(80880),I=r(80676),N=r(28730),k=r(82813),D=r(10928),B=r(48245),U=r(60401),H=r(78914);t.version="13.0.4",t.router=n;let F=E.default();t.emitter=F;let q=e=>[].slice.call(e),W=!1;self.__next_require__=r;class Z extends _.default.Component{componentDidCatch(e,t){this.props.fn(e,t)}componentDidMount(){this.scrollToHash(),n.isSsr&&"/404"!==a.page&&"/_error"!==a.page&&(a.isFallback||a.nextExport&&(x.isDynamicRoute(n.pathname)||location.search,1)||a.props&&a.props.__N_SSG&&(location.search,1))&&n.replace(n.pathname+"?"+String(w.assign(w.urlQueryToSearchParams(n.query),new URLSearchParams(location.search))),o,{_h:1,shallow:!a.isFallback&&!W}).catch(e=>{if(!e.cancelled)throw e})}componentDidUpdate(){this.scrollToHash()}scrollToHash(){let{hash:e}=location;if(!(e=e&&e.substring(1)))return;let t=document.getElementById(e);t&&setTimeout(()=>t.scrollIntoView(),0)}render(){return this.props.children}}function z(){return(z=g(function*(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=JSON.parse(document.getElementById("__NEXT_DATA__").textContent),window.__NEXT_DATA__=a,h=a.defaultLocale;let e=a.assetPrefix||"";if(r.p="".concat(e,"/_next/"),C.setConfig({serverRuntimeConfig:{},publicRuntimeConfig:a.runtimeConfig||{}}),o=R.getURL(),D.hasBasePath(o)&&(o=k.removeBasePath(o)),a.scriptLoader){let{initScriptLoader:t}=r(63573);t(a.scriptLoader)}i=new A.default(a.buildId,e);let u=e=>{let[t,r]=e;return i.routeLoader.onEntrypoint(t,r)};return window.__NEXT_P&&window.__NEXT_P.map(e=>setTimeout(()=>u(e),0)),window.__NEXT_P=[],window.__NEXT_P.push=u,(s=j.default()).getIsSsr=()=>n.isSsr,l=document.getElementById("__next"),{assetPrefix:e}})).apply(this,arguments)}function G(e,t){return _.default.createElement(e,Object.assign({},t))}function V(e){var t;let{children:r}=e;return _.default.createElement(Z,{fn:e=>X({App:d,err:e}).catch(e=>console.error("Error rendering page: ",e))},_.default.createElement(B.AppRouterContext.Provider,{value:U.adaptForAppRouterInstance(n)},_.default.createElement(H.SearchParamsContext.Provider,{value:U.adaptForSearchParams(n)},_.default.createElement(U.PathnameContextProviderAdapter,{router:n,isAutoExport:null!=(t=self.__NEXT_DATA__.autoExport)&&t},_.default.createElement(S.RouterContext.Provider,{value:T.makePublicRouterInstance(n)},_.default.createElement(b.HeadManagerContext.Provider,{value:s},_.default.createElement(N.ImageConfigContext.Provider,{value:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}},r)))))))}let $=e=>t=>{let r=y({},t,{Component:p,err:a.err,router:n});return _.default.createElement(V,null,G(e,r))};function X(e){let{App:t,err:l}=e;return console.error(l),console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"),i.loadPage("/_error").then(n=>{let{page:a,styleSheets:o}=n;return(null==u?void 0:u.Component)===a?Promise.resolve().then(()=>m(r(97345))).then(n=>Promise.resolve().then(()=>m(r(74297))).then(r=>(t=r.default,e.App=t,n))).then(e=>({ErrorComponent:e.default,styleSheets:[]})):{ErrorComponent:a,styleSheets:o}}).then(r=>{var i;let{ErrorComponent:s,styleSheets:u}=r,c=$(t),d={Component:s,AppTree:c,router:n,ctx:{err:l,pathname:a.page,query:a.query,asPath:o,AppTree:c}};return Promise.resolve((null==(i=e.props)?void 0:i.err)?e.props:R.loadGetInitialProps(t,d)).then(t=>en(y({},e,{err:l,Component:s,styleSheets:u,props:t})))})}function Y(e){let{callback:t}=e;return _.default.useLayoutEffect(()=>t(),[t]),null}let K=null,Q=!0;function J(){["beforeRender","afterHydrate","afterRender","routeChange"].forEach(e=>performance.clearMarks(e))}function ee(){R.ST&&(performance.mark("afterHydrate"),performance.measure("Next.js-before-hydration","navigationStart","beforeRender"),performance.measure("Next.js-hydration","beforeRender","afterHydrate"),f&&performance.getEntriesByName("Next.js-hydration").forEach(f),J())}function et(){if(!R.ST)return;performance.mark("afterRender");let e=performance.getEntriesByName("routeChange","mark");e.length&&(performance.measure("Next.js-route-change-to-render",e[0].name,"beforeRender"),performance.measure("Next.js-render","beforeRender","afterRender"),f&&(performance.getEntriesByName("Next.js-render").forEach(f),performance.getEntriesByName("Next.js-route-change-to-render").forEach(f)),J(),["Next.js-route-change-to-render","Next.js-render"].forEach(e=>performance.clearMeasures(e)))}function er(e){let{callbacks:t,children:r}=e;return _.default.useLayoutEffect(()=>t.forEach(e=>e()),[t]),_.default.useEffect(()=>{M.default(f)},[]),r}function en(e){let t,{App:r,Component:a,props:o,err:i}=e,s="initial"in e?void 0:e.styleSheets;a=a||u.Component,o=o||u.props;let d=y({},o,{Component:a,err:i,router:n});u=d;let f=!1,p=new Promise((e,r)=>{c&&c(),t=()=>{c=null,e()},c=()=>{f=!0,c=null;let e=Error("Cancel rendering route");e.cancelled=!0,r(e)}});function h(){t()}!function(){if(!s)return;let e=q(document.querySelectorAll("style[data-n-href]")),t=new Set(e.map(e=>e.getAttribute("data-n-href"))),r=document.querySelector("noscript[data-n-css]"),n=null==r?void 0:r.getAttribute("data-n-css");s.forEach(e=>{let{href:r,text:a}=e;if(!t.has(r)){let o=document.createElement("style");o.setAttribute("data-n-href",r),o.setAttribute("media","x"),n&&o.setAttribute("nonce",n),document.head.appendChild(o),o.appendChild(document.createTextNode(a))}})}();let m=_.default.createElement(_.default.Fragment,null,_.default.createElement(Y,{callback:function(){if(s&&!f){let t=new Set(s.map(e=>e.href)),r=q(document.querySelectorAll("style[data-n-href]")),n=r.map(e=>e.getAttribute("data-n-href"));for(let a=0;a{let{href:t}=e,r=document.querySelector('style[data-n-href="'.concat(t,'"]'));r&&(o.parentNode.insertBefore(r,o.nextSibling),o=r)}),q(document.querySelectorAll("link[data-n-p]")).forEach(e=>{e.parentNode.removeChild(e)})}if(e.scroll){let i=document.documentElement,l=i.style.scrollBehavior;i.style.scrollBehavior="auto",window.scrollTo(e.scroll.x,e.scroll.y),i.style.scrollBehavior=l}}}),_.default.createElement(V,null,G(r,d),_.default.createElement(O.Portal,{type:"next-route-announcer"},_.default.createElement(L.RouteAnnouncer,null))));return!function(e,t){R.ST&&performance.mark("beforeRender");let r=t(Q?ee:et);if(K){let n=_.default.startTransition;n(()=>{K.render(r)})}else K=P.default.hydrateRoot(e,r),Q=!1}(l,e=>_.default.createElement(er,{callbacks:[e,h]},_.default.createElement(_.default.StrictMode,null,m))),p}function ea(e){return eo.apply(this,arguments)}function eo(){return(eo=g(function*(e){if(e.err){yield X(e);return}try{yield en(e)}catch(r){let t=I.getProperError(r);if(t.cancelled)throw t;yield X(y({},e,{err:t}))}})).apply(this,arguments)}function ei(){return(ei=g(function*(e){let r=a.err;try{let l=yield i.routeLoader.whenEntrypoint("/_app");if("error"in l)throw l.error;let{component:s,exports:u}=l;d=s,u&&u.reportWebVitals&&(f=e=>{let t,{id:r,name:n,startTime:a,value:o,duration:i,entryType:l,entries:s,attribution:c}=e,d="".concat(Date.now(),"-").concat(Math.floor(Math.random()*(9e12-1))+1e12);s&&s.length&&(t=s[0].startTime);let f={id:r||d,name:n,startTime:a||t,value:null==o?i:o,label:"mark"===l||"measure"===l?"custom":"web-vital"};c&&(f.attribution=c),u.reportWebVitals(f)});let c=yield i.routeLoader.whenEntrypoint(a.page);if("error"in c)throw c.error;p=c.component}catch(m){r=I.getProperError(m)}window.__NEXT_PRELOADREADY&&(yield window.__NEXT_PRELOADREADY(a.dynamicIds)),t.router=n=T.createRouter(a.page,a.query,o,{initialProps:a.props,pageLoader:i,App:d,Component:p,wrapApp:$,err:r,isFallback:Boolean(a.isFallback),subscription:(e,t,r)=>ea(Object.assign({},e,{App:t,scroll:r})),locale:a.locale,locales:a.locales,defaultLocale:h,domainLocales:a.domainLocales,isPreview:a.isPreview}),W=yield n._initialMatchesMiddlewarePromise;let g={App:d,initial:!0,Component:p,props:a.props,err:r};(null==e?void 0:e.beforeRender)&&(yield e.beforeRender()),ea(g)})).apply(this,arguments)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21783:function(e,t,r){"use strict";var n=r(84534);window.next={version:n.version,get router(){return n.router},emitter:n.emitter},n.initialize({}).then(()=>n.hydrate()).catch(console.error),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52700:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathTrailingSlash=void 0;var n=r(40012),a=r(26727);let o=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:o}=a.parsePath(e);return/\.[^/]+\/?$/.test(t)?"".concat(n.removeTrailingSlash(t)).concat(r).concat(o):t.endsWith("/")?"".concat(t).concat(r).concat(o):"".concat(t,"/").concat(r).concat(o)};t.normalizePathTrailingSlash=o,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},70976:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(92648).Z,a=r(33468),o=r(41003),i=n(r(27929)),l=r(54465),s=r(86238),u=r(22864),c=r(40012),d=r(82497);t.default=class{getPageList(){return d.getClientBuildManifest().then(e=>e.sortedPages)}getMiddleware(){return window.__MIDDLEWARE_MATCHERS=[],window.__MIDDLEWARE_MATCHERS}getDataHref(e){let{asPath:t,href:r,locale:n}=e,{pathname:d,query:f,search:p}=u.parseRelativeUrl(r),{pathname:h}=u.parseRelativeUrl(t),m=c.removeTrailingSlash(d);if("/"!==m[0])throw Error('Route name should start with a "/", got "'.concat(m,'"'));return(e=>{let t=i.default(c.removeTrailingSlash(l.addLocale(e,n)),".json");return a.addBasePath("/_next/data/".concat(this.buildId).concat(t).concat(p),!0)})(e.skipInterpolation?h:s.isDynamicRoute(m)?o.interpolateAs(d,h,f).result:m)}_isSsg(e){return this.promisedSsgManifest.then(t=>t.has(e))}loadPage(e){return this.routeLoader.loadRoute(e).then(e=>{if("component"in e)return{page:e.component,mod:e.exports,styleSheets:e.styles.map(e=>({href:e.href,text:e.content}))};throw e.error})}prefetch(e){return this.routeLoader.prefetch(e)}constructor(e,t){this.routeLoader=d.createRouteLoader(t),this.buildId=e,this.assetPrefix=t,this.promisedSsgManifest=new Promise(e=>{window.__SSG_MANIFEST?e(window.__SSG_MANIFEST):window.__SSG_MANIFEST_CB=()=>{e(window.__SSG_MANIFEST)}})}},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},659:function(e,t,r){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let a=["CLS","FCP","FID","INP","LCP","TTFB"];location.href;let o=!1;function i(e){n&&n(e)}var l=e=>{if(n=e,!o)for(let t of(o=!0,a))try{let l;l||(l=r(78018)),l["on".concat(t)](i)}catch(s){console.warn("Failed to track ".concat(t," web-vital"),s)}};t.default=l,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17345:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Portal=void 0;var n=r(67294),a=r(73935);let o=e=>{let{children:t,type:r}=e,[o,i]=n.useState(null);return n.useEffect(()=>{let e=document.createElement(r);return document.body.appendChild(e),i(e),()=>{document.body.removeChild(e)}},[r]),o?a.createPortal(t,o):null};t.Portal=o,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82813:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeBasePath=function(e){return(e=e.slice(0)).startsWith("/")||(e="/".concat(e)),e},r(10928),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66876:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeLocale=function(e,t){return e},r(26727),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44686:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelIdleCallback=t.requestIdleCallback=void 0;let r="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)};t.requestIdleCallback=r;let n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};t.cancelIdleCallback=n,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},18483:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RouteAnnouncer=void 0;var n=(0,r(92648).Z)(r(67294)),a=r(80880);let o={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},i=()=>{let{asPath:e}=a.useRouter(),[t,r]=n.default.useState(""),i=n.default.useRef(e);return n.default.useEffect(()=>{if(i.current!==e){if(i.current=e,document.title)r(document.title);else{var t;let n=document.querySelector("h1"),a=null!=(t=null==n?void 0:n.innerText)?t:null==n?void 0:n.textContent;r(a||e)}}},[e]),n.default.createElement("p",{"aria-live":"assertive",id:"__next-route-announcer__",role:"alert",style:o},t)};t.RouteAnnouncer=i,t.default=i,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82497:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markAssetError=l,t.isAssetError=function(e){return e&&i in e},t.getClientBuildManifest=c,t.createRouteLoader=function(e){let t=new Map,r=new Map,n=new Map,i=new Map;function c(e){{var t;let n=r.get(e.toString());return n||(document.querySelector('script[src^="'.concat(e,'"]'))?Promise.resolve():(r.set(e.toString(),n=new Promise((r,n)=>{(t=document.createElement("script")).onload=r,t.onerror=()=>n(l(Error("Failed to load script: ".concat(e)))),t.crossOrigin=void 0,t.src=e,document.body.appendChild(t)})),n))}}function f(e){let t=n.get(e);return t||n.set(e,t=fetch(e).then(t=>{if(!t.ok)throw Error("Failed to load stylesheet: ".concat(e));return t.text().then(t=>({href:e,content:t}))}).catch(e=>{throw l(e)})),t}return{whenEntrypoint:e=>o(e,t),onEntrypoint(e,r){(r?Promise.resolve().then(()=>r()).then(e=>({component:e&&e.default||e,exports:e}),e=>({error:e})):Promise.resolve(void 0)).then(r=>{let n=t.get(e);n&&"resolve"in n?r&&(t.set(e,r),n.resolve(r)):(r?t.set(e,r):t.delete(e),i.delete(e))})},loadRoute(r,n){return o(r,i,()=>{let a;return u(d(e,r).then(e=>{let{scripts:n,css:a}=e;return Promise.all([t.has(r)?[]:Promise.all(n.map(c)),Promise.all(a.map(f))])}).then(e=>this.whenEntrypoint(r).then(t=>({entrypoint:t,styles:e[1]}))),3800,l(Error("Route did not complete loading: ".concat(r)))).then(e=>{let{entrypoint:t,styles:r}=e,n=Object.assign({styles:r},t);return"error"in t?t:n}).catch(e=>{if(n)throw e;return{error:e}}).finally(()=>null==a?void 0:a())})},prefetch(t){let r;return(r=navigator.connection)&&(r.saveData||/2g/.test(r.effectiveType))?Promise.resolve():d(e,t).then(e=>Promise.all(s?e.scripts.map(e=>{var t,r,n;return t=e.toString(),r="script",new Promise((e,a)=>{let o='\n link[rel="prefetch"][href^="'.concat(t,'"],\n link[rel="preload"][href^="').concat(t,'"],\n script[src^="').concat(t,'"]');if(document.querySelector(o))return e();n=document.createElement("link"),r&&(n.as=r),n.rel="prefetch",n.crossOrigin=void 0,n.onload=e,n.onerror=()=>a(l(Error("Failed to prefetch: ".concat(t)))),n.href=t,document.head.appendChild(n)})}):[])).then(()=>{a.requestIdleCallback(()=>this.loadRoute(t,!0).catch(()=>{}))}).catch(()=>{})}}},(0,r(92648).Z)(r(27929));var n=r(65407),a=r(44686);function o(e,t,r){let n,a=t.get(e);if(a)return"future"in a?a.future:Promise.resolve(a);let o=new Promise(e=>{n=e});return t.set(e,a={resolve:n,future:o}),r?r().then(e=>(n(e),e)).catch(r=>{throw t.delete(e),r}):o}let i=Symbol("ASSET_LOAD_ERROR");function l(e){return Object.defineProperty(e,i,{})}let s=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(t){return!1}}();function u(e,t,r){return new Promise((n,o)=>{let i=!1;e.then(e=>{i=!0,n(e)}).catch(o),a.requestIdleCallback(()=>setTimeout(()=>{i||o(r)},t))})}function c(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);let e=new Promise(e=>{let t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}});return u(e,3800,l(Error("Failed to load client build manifest")))}function d(e,t){return c().then(r=>{if(!(t in r))throw l(Error("Failed to lookup route: ".concat(t)));let a=r[t].map(t=>e+"/_next/"+encodeURI(t));return{scripts:a.filter(e=>e.endsWith(".js")).map(e=>n.__unsafeCreateTrustedScriptURL(e)),css:a.filter(e=>e.endsWith(".css"))}})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80880:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Router",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"withRouter",{enumerable:!0,get:function(){return s.default}}),t.useRouter=function(){let e=a.default.useContext(i.RouterContext);if(!e)throw Error("Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return e},t.createRouter=function(){for(var e=arguments.length,t=Array(e),r=0;re()),u.readyCallbacks=[],u.router},t.makePublicRouterInstance=function(e){let t={};for(let r of c){if("object"==typeof e[r]){t[r]=Object.assign(Array.isArray(e[r])?[]:{},e[r]);continue}t[r]=e[r]}return t.events=o.default.events,d.forEach(r=>{t[r]=function(){for(var t=arguments.length,n=Array(t),a=0;ao.default.events}),c.forEach(e=>{Object.defineProperty(u,e,{get(){let t=f();return t[e]}})}),d.forEach(e=>{u[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n{u.ready(()=>{o.default.events.on(e,function(){for(var t=arguments.length,r=Array(t),n=0;n{let t=e.id||e.getAttribute("src");p.add(t)})}()},t.default=void 0;var n=r(6495).Z,a=r(92648).Z,o=r(91598).Z,i=r(17273).Z,l=a(r(73935)),s=o(r(67294)),u=r(4664),c=r(31831),d=r(44686);let f=new Map,p=new Set,h=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy"],m=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:a=null,dangerouslySetInnerHTML:o,children:i="",strategy:l="afterInteractive",onError:s}=e,u=r||t;if(u&&p.has(u))return;if(f.has(t)){p.add(u),f.get(t).then(n,s);return}let d=()=>{a&&a(),p.add(u)},m=document.createElement("script"),g=new Promise((e,t)=>{m.addEventListener("load",function(t){e(),n&&n.call(this,t),d()}),m.addEventListener("error",function(e){t(e)})}).catch(function(e){s&&s(e)});for(let[y,v]of(o?(m.innerHTML=o.__html||"",d()):i?(m.textContent="string"==typeof i?i:Array.isArray(i)?i.join(""):"",d()):t&&(m.src=t,f.set(t,g)),Object.entries(e))){if(void 0===v||h.includes(y))continue;let _=c.DOMAttributeNames[y]||y.toLowerCase();m.setAttribute(_,v)}"worker"===l&&m.setAttribute("type","text/partytown"),m.setAttribute("data-nscript",l),document.body.appendChild(m)};function g(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{d.requestIdleCallback(()=>m(e))}):m(e)}function y(e){let{id:t,src:r="",onLoad:a=()=>{},onReady:o=null,strategy:c="afterInteractive",onError:f}=e,h=i(e,["id","src","onLoad","onReady","strategy","onError"]),{updateScripts:g,scripts:y,getIsSsr:v,appDir:_,nonce:P}=s.useContext(u.HeadManagerContext),b=s.useRef(!1);s.useEffect(()=>{let e=t||r;b.current||(o&&e&&p.has(e)&&o(),b.current=!0)},[o,t,r]);let E=s.useRef(!1);if(s.useEffect(()=>{!E.current&&("afterInteractive"===c?m(e):"lazyOnload"===c&&("complete"===document.readyState?d.requestIdleCallback(()=>m(e)):window.addEventListener("load",()=>{d.requestIdleCallback(()=>m(e))})),E.current=!0)},[e,c]),("beforeInteractive"===c||"worker"===c)&&(g?(y[c]=(y[c]||[]).concat([n({id:t,src:r,onLoad:a,onReady:o,onError:f},h)]),g(y)):v&&v()?p.add(t||r):v&&!v()&&m(e)),_){if("beforeInteractive"===c)return r?(l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"}),s.default.createElement("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push(".concat(JSON.stringify([r]),")")}})):(h.dangerouslySetInnerHTML&&(h.children=h.dangerouslySetInnerHTML.__html,delete h.dangerouslySetInnerHTML),s.default.createElement("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push(".concat(JSON.stringify([0,n({},h)]),")")}}));"afterInteractive"===c&&r&&l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"})}return null}Object.defineProperty(y,"__nextScript",{value:!0}),t.default=y,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65407:function(e,t){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.__unsafeCreateTrustedScriptURL=function(e){var t;return(null==(t=function(){if(void 0===r){var e;r=(null==(e=window.trustedTypes)?void 0:e.createPolicy("nextjs",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))||null}return r}())?void 0:t.createScriptURL(e))||e},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49977:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){return n.default.createElement(e,Object.assign({router:a.useRouter()},t))}return t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,t};var n=(0,r(92648).Z)(r(67294)),a=r(80880);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74297:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a=r(60932).Z,o=(0,r(92648).Z)(r(67294)),i=r(670);function l(e){return s.apply(this,arguments)}function s(){return(s=a(function*(e){let{Component:t,ctx:r}=e,n=yield i.loadGetInitialProps(t,r);return{pageProps:n}})).apply(this,arguments)}class u extends(n=o.default.Component){render(){let{Component:e,pageProps:t}=this.props;return o.default.createElement(e,Object.assign({},t))}}u.origGetInitialProps=l,u.getInitialProps=l,t.default=u},97345:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a=r(92648).Z,o=a(r(67294)),i=a(r(83121));let l={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"};function s(e){let{res:t,err:r}=e,n=t&&t.statusCode?t.statusCode:r?r.statusCode:404;return{statusCode:n}}let u={error:{fontFamily:'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",margin:0,marginRight:"20px",padding:"0 23px 0 0",fontSize:"24px",fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"49px",margin:0,padding:0}};class c extends(n=o.default.Component){render(){let{statusCode:e,withDarkMode:t=!0}=this.props,r=this.props.title||l[e]||"An unexpected error has occurred";return o.default.createElement("div",{style:u.error},o.default.createElement(i.default,null,o.default.createElement("title",null,e?"".concat(e,": ").concat(r):"Application error: a client-side exception has occurred")),o.default.createElement("div",null,o.default.createElement("style",{dangerouslySetInnerHTML:{__html:"\n body { margin: 0; color: #000; background: #fff; }\n .next-error-h1 {\n border-right: 1px solid rgba(0, 0, 0, .3);\n }\n\n ".concat(t?"@media (prefers-color-scheme: dark) {\n body { color: #fff; background: #000; }\n .next-error-h1 {\n border-right: 1px solid rgba(255, 255, 255, .3);\n }\n }":"")}}),e?o.default.createElement("h1",{className:"next-error-h1",style:u.h1},e):null,o.default.createElement("div",{style:u.desc},o.default.createElement("h2",{style:u.h2},this.props.title||e?r:o.default.createElement(o.default.Fragment,null,"Application error: a client-side exception has occurred (see the browser console for more information)"),"."))))}}c.displayName="ErrorPage",c.getInitialProps=s,c.origGetInitialProps=s,t.default=c},40610:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext({});t.AmpStateContext=a},40532:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=function(){let{ampFirst:e=!1,hybrid:t=!1,hasQuery:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e||t&&r}},48245:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateContext=t.GlobalLayoutRouterContext=t.LayoutRouterContext=t.AppRouterContext=t.CacheStates=void 0;var n,a,o=(0,r(92648).Z)(r(67294));t.CacheStates=n,(a=n||(t.CacheStates=n={})).LAZY_INITIALIZED="LAZYINITIALIZED",a.DATA_FETCH="DATAFETCH",a.READY="READY";let i=o.default.createContext(null);t.AppRouterContext=i;let l=o.default.createContext(null);t.LayoutRouterContext=l;let s=o.default.createContext(null);t.GlobalLayoutRouterContext=s;let u=o.default.createContext(null);t.TemplateContext=u},18659:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeStringRegexp=function(e){return r.test(e)?e.replace(n,"\\$&"):e};let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g},4664:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeadManagerContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext({});t.HeadManagerContext=a},83121:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=c,t.default=void 0;var n=r(6495).Z,a=r(92648).Z,o=(0,r(91598).Z)(r(67294)),i=a(r(31436)),l=r(40610),s=r(4664),u=r(40532);function c(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[o.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(o.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function d(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(57238);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:r}=t;return e.reduce(d,[]).reverse().concat(c(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return a=>{let o=!0,i=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){i=!0;let l=a.key.slice(a.key.indexOf("$")+1);e.has(l)?o=!1:e.add(l)}switch(a.type){case"title":case"base":t.has(a.type)?o=!1:t.add(a.type);break;case"meta":for(let s=0,u=f.length;s{let a=e.key||t;if(!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let i=n({},e.props||{});return i["data-href"]=i.href,i.href=void 0,i["data-optimized-fonts"]=!0,o.default.cloneElement(e,i)}return o.default.cloneElement(e,{key:a})})}t.default=function(e){let{children:t}=e,r=o.useContext(l.AmpStateContext),n=o.useContext(s.HeadManagerContext);return o.default.createElement(i.default,{reduceComponentsToState:p,headManager:n,inAmpMode:u.isInAmpMode(r)},t)},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78914:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutSegmentsContext=t.ParamsContext=t.PathnameContext=t.SearchParamsContext=void 0;var n=r(67294);let a=n.createContext(null);t.SearchParamsContext=a;let o=n.createContext(null);t.PathnameContext=o;let i=n.createContext(null);t.ParamsContext=i;let l=n.createContext(null);t.LayoutSegmentsContext=l},24769:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLocalePath=function(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}},28730:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageConfigContext=void 0;var n=(0,r(92648).Z)(r(67294)),a=r(10139);let o=n.default.createContext(a.imageConfigDefault);t.ImageConfigContext=o},10139:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageConfigDefault=t.VALID_LOADERS=void 0,t.VALID_LOADERS=["default","imgix","cloudinary","akamai","custom"],t.imageConfigDefault={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",remotePatterns:[],unoptimized:!1}},82849:function(e,t){"use strict";function r(e){return Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectClassLabel=r,t.isPlainObject=function(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}},8550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=Object.create(null);return{on(t,r){(e[t]||(e[t]=[])).push(r)},off(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{e(...n)})}}}},6301:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.denormalizePagePath=function(e){let t=a.normalizePathSep(e);return t.startsWith("/index/")&&!n.isDynamicRoute(t)?t.slice(6):"/index"!==t?t:"/"};var n=r(18588),a=r(49997)},49997:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathSep=function(e){return e.replace(/\\/g,"/")}},72692:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouterContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext(null);t.RouterContext=a},60401:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adaptForAppRouterInstance=function(e){return{back(){e.back()},forward(){e.forward()},refresh(){e.reload()},push(t){e.push(t)},replace(t){e.replace(t)},prefetch(t){e.prefetch(t)}}},t.adaptForSearchParams=function(e){return e.isReady&&e.query?function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let a of n)t.append(r,a);else void 0!==n&&t.append(r,n);return t}(e.query):new URLSearchParams},t.PathnameContextProviderAdapter=function(e){var{children:t,router:r}=e,n=a(e,["children","router"]);let s=o.useRef(n.isAutoExport),u=o.useMemo(()=>{let e=s.current;if(e&&(s.current=!1),l.isDynamicRoute(r.pathname)&&(r.isFallback||e&&!r.isReady))return null;let t=new URL(r.asPath,"http://f");return t.pathname},[r.asPath,r.isFallback,r.isReady,r.pathname]);return o.default.createElement(i.PathnameContext.Provider,{value:u},t)};var n=r(91598).Z,a=r(17273).Z,o=n(r(67294)),i=r(78914),l=r(18588)},41003:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesMiddleware=I,t.isLocalURL=B,t.interpolateAs=U,t.resolveHref=H,t.createKey=$,t.default=void 0;var n=r(60932).Z,a=r(6495).Z,o=r(92648).Z,i=r(91598).Z,l=r(52700),s=r(40012),u=r(82497),c=r(63573),d=i(r(80676)),f=r(6301),p=r(24769),h=o(r(8550)),m=r(670),g=r(86238),y=r(22864),v=r(94919),_=o(r(27980)),P=r(13156),b=r(54903),E=r(67795);r(84643);var S=r(26727),x=r(54465),w=r(66876),C=r(82813),R=r(33468),O=r(10928),j=r(18756),A=r(57429),M=r(79002),L=r(21754);function T(){return Object.assign(Error("Route Cancelled"),{cancelled:!0})}function I(e){return N.apply(this,arguments)}function N(){return(N=n(function*(e){let t=yield Promise.resolve(e.router.pageLoader.getMiddleware());if(!t)return!1;let{pathname:r}=S.parsePath(e.asPath),n=O.hasBasePath(r)?C.removeBasePath(r):r,a=R.addBasePath(x.addLocale(n,e.locale));return t.some(e=>RegExp(e.regexp).test(a))})).apply(this,arguments)}function k(e){let t=m.getLocationOrigin();return e.startsWith(t)?e.substring(t.length):e}function D(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}function B(e){if(!m.isAbsoluteUrl(e))return!0;try{let t=m.getLocationOrigin(),r=new URL(e,t);return r.origin===t&&O.hasBasePath(r.pathname)}catch(n){return!1}}function U(e,t,r){let n="",a=b.getRouteRegex(e),o=a.groups,i=(t!==e?P.getRouteMatcher(a)(t):"")||r;n=e;let l=Object.keys(o);return l.every(e=>{let t=i[e]||"",{repeat:r,optional:a}=o[e],l="[".concat(r?"...":"").concat(e,"]");return a&&(l="".concat(t?"":"/","[").concat(l,"]")),r&&!Array.isArray(t)&&(t=[t]),(a||e in i)&&(n=n.replace(l,r?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(n=""),{params:l,result:n}}function H(e,t,r){let n;let a="string"==typeof t?t:E.formatWithValidation(t),o=a.match(/^[a-zA-Z]{1,}:\/\//),i=o?a.slice(o[0].length):a,s=i.split("?");if((s[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href passed to next/router: ".concat(a,", repeated forward-slashes (//) or backslashes \\ are not valid in the href"));let u=m.normalizeRepeatedSlashes(i);a=(o?o[0]:"")+u}if(!B(a))return r?[a]:a;try{n=new URL(a.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(c){n=new URL("/","http://n")}try{let d=new URL(a,n);d.pathname=l.normalizePathTrailingSlash(d.pathname);let f="";if(g.isDynamicRoute(d.pathname)&&d.searchParams&&r){let p=v.searchParamsToUrlQuery(d.searchParams),{result:h,params:y}=U(d.pathname,d.pathname,p);h&&(f=E.formatWithValidation({pathname:h,hash:d.hash,query:D(p,y)}))}let _=d.origin===n.origin?d.href.slice(d.origin.length):d.href;return r?[_,f||_]:_}catch(P){return r?[a]:a}}function F(e,t,r){let[n,a]=H(e,t,!0),o=m.getLocationOrigin(),i=n.startsWith(o),l=a&&a.startsWith(o);n=k(n),a=a?k(a):a;let s=i?n:R.addBasePath(n),u=r?k(H(e,r)):a||n;return{url:s,as:l?u:R.addBasePath(u)}}function q(e,t){let r=s.removeTrailingSlash(f.denormalizePagePath(e));return"/404"===r||"/_error"===r?e:(t.includes(r)||t.some(t=>{if(g.isDynamicRoute(t)&&b.getRouteRegex(t).re.test(r))return e=t,!0}),s.removeTrailingSlash(e))}function W(e){return I(e).then(t=>t&&e.fetchData?e.fetchData().then(t=>(function(e,t,r){let n={basePath:r.router.basePath,i18n:{locales:r.router.locales},trailingSlash:Boolean(!0)},o=t.headers.get("x-nextjs-rewrite"),i=o||t.headers.get("x-nextjs-matched-path"),l=t.headers.get("x-matched-path");if(!l||i||l.includes("__next_data_catchall")||l.includes("/_error")||l.includes("/404")||(i=l),i){if(i.startsWith("/")){let c=y.parseRelativeUrl(i),d=j.getNextPathnameInfo(c.pathname,{nextConfig:n,parseData:!0}),f=s.removeTrailingSlash(d.pathname);return Promise.all([r.router.pageLoader.getPageList(),u.getClientBuildManifest()]).then(t=>{let[n,{__rewrites:a}]=t,i=x.addLocale(d.pathname,d.locale);if(g.isDynamicRoute(i)||!o&&n.includes(p.normalizeLocalePath(C.removeBasePath(i),r.router.locales).pathname)){let l=j.getNextPathnameInfo(y.parseRelativeUrl(e).pathname,{parseData:!0});i=R.addBasePath(l.pathname),c.pathname=i}{let s=_.default(i,n,a,c.query,e=>q(e,n),r.router.locales);s.matchedPage&&(c.pathname=s.parsedAs.pathname,i=c.pathname,Object.assign(c.query,s.parsedAs.query))}let u=n.includes(f)?f:q(p.normalizeLocalePath(C.removeBasePath(c.pathname),r.router.locales).pathname,n);if(g.isDynamicRoute(u)){let h=P.getRouteMatcher(b.getRouteRegex(u))(i);Object.assign(c.query,h||{})}return{type:"rewrite",parsedAs:c,resolvedHref:u}})}let h=S.parsePath(e),m=A.formatNextPathnameInfo(a({},j.getNextPathnameInfo(h.pathname,{nextConfig:n,parseData:!0}),{defaultLocale:r.router.defaultLocale,buildId:""}));return Promise.resolve({type:"redirect-external",destination:"".concat(m).concat(h.query).concat(h.hash)})}let v=t.headers.get("x-nextjs-redirect");if(v){if(v.startsWith("/")){let E=S.parsePath(v),w=A.formatNextPathnameInfo(a({},j.getNextPathnameInfo(E.pathname,{nextConfig:n,parseData:!0}),{defaultLocale:r.router.defaultLocale,buildId:""}));return Promise.resolve({type:"redirect-internal",newAs:"".concat(w).concat(E.query).concat(E.hash),newUrl:"".concat(w).concat(E.query).concat(E.hash)})}return Promise.resolve({type:"redirect-external",destination:v})}return Promise.resolve({type:"next"})})(t.dataHref,t.response,e).then(e=>({dataHref:t.dataHref,cacheKey:t.cacheKey,json:t.json,response:t.response,text:t.text,effect:e}))).catch(e=>null):null)}let Z=Symbol("SSG_DATA_NOT_FOUND");function z(e){let t=document.documentElement,r=t.style.scrollBehavior;t.style.scrollBehavior="auto",e(),t.style.scrollBehavior=r}function G(e){try{return JSON.parse(e)}catch(t){return null}}function V(e){var t;let{dataHref:r,inflightCache:n,isPrefetch:a,hasMiddleware:o,isServerRender:i,parseJSON:l,persistCache:s,isBackground:c,unstable_skipClientCache:d}=e,{href:f}=new URL(r,window.location.href),p=e=>(function e(t,r,n){return fetch(t,{credentials:"same-origin",method:n.method||"GET",headers:Object.assign({},n.headers,{"x-nextjs-data":"1"})}).then(a=>!a.ok&&r>1&&a.status>=500?e(t,r-1,n):a)})(r,i?3:1,{headers:Object.assign({},a?{purpose:"prefetch"}:{},a&&o?{"x-middleware-prefetch":"1"}:{}),method:null!=(t=null==e?void 0:e.method)?t:"GET"}).then(t=>t.ok&&(null==e?void 0:e.method)==="HEAD"?{dataHref:r,response:t,text:"",json:{},cacheKey:f}:t.text().then(e=>{if(!t.ok){if(o&&[301,302,307,308].includes(t.status))return{dataHref:r,response:t,text:e,json:{},cacheKey:f};if(!o&&404===t.status){var n;if(null==(n=G(e))?void 0:n.notFound)return{dataHref:r,json:{notFound:Z},response:t,text:e,cacheKey:f}}let a=Error("Failed to load static props");throw i||u.markAssetError(a),a}return{dataHref:r,json:l?G(e):null,response:t,text:e,cacheKey:f}})).then(e=>(s&&"no-cache"!==e.response.headers.get("x-middleware-cache")||delete n[f],e)).catch(e=>{throw d||delete n[f],"Failed to fetch"===e.message&&u.markAssetError(e),e});return d&&s?p({}).then(e=>(n[f]=Promise.resolve(e),e)):void 0!==n[f]?n[f]:n[f]=p(c?{method:"HEAD"}:{})}function $(){return Math.random().toString(36).slice(2,10)}function X(e){let{url:t,router:r}=e;if(t===R.addBasePath(x.addLocale(r.asPath,r.locale)))throw Error("Invariant: attempted to hard navigate to the same URL ".concat(t," ").concat(location.href));window.location.href=t}let Y=e=>{let{route:t,router:r}=e,n=!1,a=r.clc=()=>{n=!0},o=()=>{if(n){let e=Error('Abort fetching component for route: "'.concat(t,'"'));throw e.cancelled=!0,e}a===r.clc&&(r.clc=null)};return o};class K{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{url:e,as:t}=F(this,e,t),this.change("pushState",e,t,r)}replace(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{url:e,as:t}=F(this,e,t),this.change("replaceState",e,t,r)}change(e,t,r,o,i){var l=this;return n(function*(){let n,f;if(!B(t))return X({url:t,router:l}),!1;let p=o._h,h=p||o._shouldResolveHref||S.parsePath(t).pathname===S.parsePath(r).pathname,v=a({},l.state),j=!0!==l.isReady;l.isReady=!0;let A=l.isSsr;if(p||(l.isSsr=!1),p&&l.clc)return!1;let L=v.locale;m.ST&&performance.mark("routeChange");let{shallow:N=!1,scroll:k=!0}=o,H={shallow:N};l._inFlightRoute&&l.clc&&(A||K.events.emit("routeChangeError",T(),l._inFlightRoute,H),l.clc(),l.clc=null),r=R.addBasePath(x.addLocale(O.hasBasePath(r)?C.removeBasePath(r):r,o.locale,l.defaultLocale));let W=w.removeLocale(O.hasBasePath(r)?C.removeBasePath(r):r,v.locale);l._inFlightRoute=r;let z=L!==v.locale;if(!p&&l.onlyAHashChange(W)&&!z){v.asPath=W,K.events.emit("hashChangeStart",r,H),l.changeState(e,t,r,a({},o,{scroll:!1})),k&&l.scrollToHash(W);try{yield l.set(v,l.components[v.route],null)}catch(G){throw d.default(G)&&G.cancelled&&K.events.emit("routeChangeError",G,W,H),G}return K.events.emit("hashChangeComplete",r,H),!0}let V=y.parseRelativeUrl(t),{pathname:$,query:Y}=V;try{[n,{__rewrites:f}]=yield Promise.all([l.pageLoader.getPageList(),u.getClientBuildManifest(),l.pageLoader.getMiddleware()])}catch(Q){return X({url:r,router:l}),!1}l.urlIsNew(W)||z||(e="replaceState");let J=r;$=$?s.removeTrailingSlash(C.removeBasePath($)):$;let ee=s.removeTrailingSlash($),et=r.startsWith("/")&&y.parseRelativeUrl(r).pathname,er=!!(et&&ee!==et&&(!g.isDynamicRoute(ee)||!P.getRouteMatcher(b.getRouteRegex(ee))(et))),en=yield I({asPath:r,locale:v.locale,router:l});if(o.shallow&&en&&($=l.pathname),p&&en&&(h=!1),h&&"/_error"!==$){if(o._shouldResolveHref=!0,r.startsWith("/")){let ea=_.default(R.addBasePath(x.addLocale(W,v.locale),!0),n,f,Y,e=>q(e,n),l.locales);if(ea.externalDest)return X({url:r,router:l}),!0;en||(J=ea.asPath),ea.matchedPage&&ea.resolvedHref&&($=ea.resolvedHref,V.pathname=R.addBasePath($),en||(t=E.formatWithValidation(V)))}else V.pathname=q($,n),V.pathname===$||($=V.pathname,V.pathname=R.addBasePath($),en||(t=E.formatWithValidation(V)))}if(!B(r))return X({url:r,router:l}),!1;J=w.removeLocale(C.removeBasePath(J),v.locale),ee=s.removeTrailingSlash($);let eo=!1;if(g.isDynamicRoute(ee)){let ei=y.parseRelativeUrl(J),el=ei.pathname,es=b.getRouteRegex(ee);eo=P.getRouteMatcher(es)(el);let eu=ee===el,ec=eu?U(ee,el,Y):{};if(eo&&(!eu||ec.result))eu?r=E.formatWithValidation(Object.assign({},ei,{pathname:ec.result,query:D(Y,ec.params)})):Object.assign(Y,eo);else{let ed=Object.keys(es.groups).filter(e=>!Y[e]&&!es.groups[e].optional);if(ed.length>0&&!en)throw Error((eu?"The provided `href` (".concat(t,") value is missing query values (").concat(ed.join(", "),") to be interpolated properly. "):"The provided `as` value (".concat(el,") is incompatible with the `href` value (").concat(ee,"). "))+"Read more: https://nextjs.org/docs/messages/".concat(eu?"href-interpolation-failed":"incompatible-href-as"))}}p||K.events.emit("routeChangeStart",r,H);try{var ef,ep,eh,em;let eg=yield l.getRouteInfo({route:ee,pathname:$,query:Y,as:r,resolvedAs:J,routeProps:H,locale:v.locale,isPreview:v.isPreview,hasMiddleware:en,unstable_skipClientCache:o.unstable_skipClientCache,isQueryUpdating:p&&!l.isFallback,isMiddlewareRewrite:er});if("route"in eg&&en){ee=$=eg.route||ee,H.shallow||(Y=Object.assign({},eg.query||{},Y));let ey=O.hasBasePath(V.pathname)?C.removeBasePath(V.pathname):V.pathname;if(eo&&$!==ey&&Object.keys(eo).forEach(e=>{eo&&Y[e]===eo[e]&&delete Y[e]}),g.isDynamicRoute($)){let ev=!H.shallow&&eg.resolvedAs?eg.resolvedAs:R.addBasePath(x.addLocale(new URL(r,location.href).pathname,v.locale),!0),e_=ev;O.hasBasePath(e_)&&(e_=C.removeBasePath(e_));let eP=b.getRouteRegex($),eb=P.getRouteMatcher(eP)(new URL(e_,location.href).pathname);eb&&Object.assign(Y,eb)}}if("type"in eg){if("redirect-internal"===eg.type)return l.change(e,eg.newUrl,eg.newAs,o);return X({url:eg.destination,router:l}),new Promise(()=>{})}let{error:eE,props:eS,__N_SSG:ex,__N_SSP:ew}=eg,eC=eg.Component;if(eC&&eC.unstable_scriptLoader){let eR=[].concat(eC.unstable_scriptLoader());eR.forEach(e=>{c.handleClientScriptLoad(e.props)})}if((ex||ew)&&eS){if(eS.pageProps&&eS.pageProps.__N_REDIRECT){o.locale=!1;let eO=eS.pageProps.__N_REDIRECT;if(eO.startsWith("/")&&!1!==eS.pageProps.__N_REDIRECT_BASE_PATH){let ej=y.parseRelativeUrl(eO);ej.pathname=q(ej.pathname,n);let{url:eA,as:eM}=F(l,eO,eO);return l.change(e,eA,eM,o)}return X({url:eO,router:l}),new Promise(()=>{})}if(v.isPreview=!!eS.__N_PREVIEW,eS.notFound===Z){let eL;try{yield l.fetchComponent("/404"),eL="/404"}catch(eT){eL="/_error"}if(eg=yield l.getRouteInfo({route:eL,pathname:eL,query:Y,as:r,resolvedAs:J,routeProps:{shallow:!1},locale:v.locale,isPreview:v.isPreview}),"type"in eg)throw Error("Unexpected middleware effect on /404")}}K.events.emit("beforeHistoryChange",r,H),l.changeState(e,t,r,o),p&&"/_error"===$&&(null==(ef=self.__NEXT_DATA__.props)?void 0:null==(ep=ef.pageProps)?void 0:ep.statusCode)===500&&(null==eS?void 0:eS.pageProps)&&(eS.pageProps.statusCode=500);let eI=o.shallow&&v.route===(null!=(eh=eg.route)?eh:ee),eN=null!=(em=o.scroll)?em:!o._h&&!eI,ek=a({},v,{route:ee,pathname:$,query:Y,asPath:W,isFallback:!1}),eD=null!=i?i:eN?{x:0,y:0}:null,eB=o._h&&!eD&&!j&&!z&&M.compareRouterStates(ek,l.state);if(!eB){if(yield l.set(ek,eg,eD).catch(e=>{if(e.cancelled)eE=eE||e;else throw e}),eE)throw p||K.events.emit("routeChangeError",eE,W,H),eE;p||K.events.emit("routeChangeComplete",r,H),eN&&/#.+$/.test(r)&&l.scrollToHash(r)}return!0}catch(eU){if(d.default(eU)&&eU.cancelled)return!1;throw eU}})()}changeState(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};("pushState"!==e||m.getURL()!==r)&&(this._shallow=n.shallow,window.history[e]({url:t,as:r,options:n,__N:!0,key:this._key="pushState"!==e?this._key:$()},"",r))}handleRouteInfoError(e,t,r,a,o,i){var l=this;return n(function*(){if(console.error(e),e.cancelled)throw e;if(u.isAssetError(e)||i)throw K.events.emit("routeChangeError",e,a,o),X({url:a,router:l}),T();try{let n;let{page:s,styleSheets:c}=yield l.fetchComponent("/_error"),f={props:n,Component:s,styleSheets:c,err:e,error:e};if(!f.props)try{f.props=yield l.getInitialProps(s,{err:e,pathname:t,query:r})}catch(p){console.error("Error in error page `getInitialProps`: ",p),f.props={}}return f}catch(h){return l.handleRouteInfoError(d.default(h)?h:Error(h+""),t,r,a,o,!0)}})()}getRouteInfo(e){let{route:t,pathname:r,query:o,as:i,resolvedAs:l,routeProps:u,locale:c,hasMiddleware:f,isPreview:h,unstable_skipClientCache:m,isQueryUpdating:g,isMiddlewareRewrite:y}=e;var v=this;return n(function*(){let e=t;try{var _,P,b,S;let x=Y({route:e,router:v}),w=v.components[e];if(u.shallow&&w&&v.route===e)return w;f&&(w=void 0);let R=!w||"initial"in w?void 0:w,O={dataHref:v.pageLoader.getDataHref({href:E.formatWithValidation({pathname:r,query:o}),skipInterpolation:!0,asPath:l,locale:c}),hasMiddleware:!0,isServerRender:v.isSsr,parseJSON:!0,inflightCache:g?v.sbc:v.sdc,persistCache:!h,isPrefetch:!1,unstable_skipClientCache:m,isBackground:g},j=g&&!y?{}:yield W({fetchData:()=>V(O),asPath:l,locale:c,router:v}).catch(e=>{if(g)return{};throw e});if(g&&(j.json=self.__NEXT_DATA__.props),x(),(null==j?void 0:null==(_=j.effect)?void 0:_.type)==="redirect-internal"||(null==j?void 0:null==(P=j.effect)?void 0:P.type)==="redirect-external")return j.effect;if((null==j?void 0:null==(b=j.effect)?void 0:b.type)==="rewrite"){let A=s.removeTrailingSlash(j.effect.resolvedHref),M=yield v.pageLoader.getPageList();if((!g||M.includes(A))&&(e=A,r=j.effect.resolvedHref,o=a({},o,j.effect.parsedAs.query),l=C.removeBasePath(p.normalizeLocalePath(j.effect.parsedAs.pathname,v.locales).pathname),w=v.components[e],u.shallow&&w&&v.route===e&&!f))return a({},w,{route:e})}if("/api"===e||e.startsWith("/api/"))return X({url:i,router:v}),new Promise(()=>{});let L=R||(yield v.fetchComponent(e).then(e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP}))),T=null==j?void 0:null==(S=j.response)?void 0:S.headers.get("x-middleware-skip"),I=L.__N_SSG||L.__N_SSP;T&&delete v.sdc[null==j?void 0:j.dataHref];let{props:N,cacheKey:k}=yield v._getData(n(function*(){if(I){let{json:e,cacheKey:t}=(null==j?void 0:j.json)&&!T?j:yield V({dataHref:(null==j?void 0:j.json)?null==j?void 0:j.dataHref:v.pageLoader.getDataHref({href:E.formatWithValidation({pathname:r,query:o}),asPath:l,locale:c}),isServerRender:v.isSsr,parseJSON:!0,inflightCache:T?{}:v.sdc,persistCache:!h,isPrefetch:!1,unstable_skipClientCache:m});return{cacheKey:t,props:e||{}}}return{headers:{},cacheKey:"",props:yield v.getInitialProps(L.Component,{pathname:r,query:o,asPath:i,locale:c,locales:v.locales,defaultLocale:v.defaultLocale})}}));return L.__N_SSP&&O.dataHref&&delete v.sdc[k],v.isPreview||!L.__N_SSG||g||V(Object.assign({},O,{isBackground:!0,persistCache:!1,inflightCache:v.sbc})).catch(()=>{}),N.pageProps=Object.assign({},N.pageProps),L.props=N,L.route=e,L.query=o,L.resolvedAs=l,v.components[e]=L,L}catch(D){return v.handleRouteInfoError(d.getProperError(D),r,o,i,u)}})()}set(e,t,r){return this.state=e,this.sub(t,this.components["/_app"].Component,r)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;let[t,r]=this.asPath.split("#"),[n,a]=e.split("#");return!!a&&t===n&&r===a||t===n&&r!==a}scrollToHash(e){let[,t=""]=e.split("#");if(""===t||"top"===t){z(()=>window.scrollTo(0,0));return}let r=decodeURIComponent(t),n=document.getElementById(r);if(n){z(()=>n.scrollIntoView());return}let a=document.getElementsByName(r)[0];a&&z(()=>a.scrollIntoView())}urlIsNew(e){return this.asPath!==e}prefetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=this;return n(function*(){if(L.isBot(window.navigator.userAgent))return;let n=y.parseRelativeUrl(e),{pathname:i,query:l}=n,c=i,d=yield o.pageLoader.getPageList(),f=t,p=void 0!==r.locale?r.locale||void 0:o.locale,h=yield I({asPath:t,locale:p,router:o});if(t.startsWith("/")){let m;({__rewrites:m}=yield u.getClientBuildManifest());let v=_.default(R.addBasePath(x.addLocale(t,o.locale),!0),d,m,n.query,e=>q(e,d),o.locales);if(v.externalDest)return;h||(f=w.removeLocale(C.removeBasePath(v.asPath),o.locale)),v.matchedPage&&v.resolvedHref&&(i=v.resolvedHref,n.pathname=i,h||(e=E.formatWithValidation(n)))}n.pathname=q(n.pathname,d),g.isDynamicRoute(n.pathname)&&(i=n.pathname,n.pathname=i,Object.assign(l,P.getRouteMatcher(b.getRouteRegex(n.pathname))(S.parsePath(t).pathname)||{}),h||(e=E.formatWithValidation(n)));let O=yield W({fetchData:()=>V({dataHref:o.pageLoader.getDataHref({href:E.formatWithValidation({pathname:c,query:l}),skipInterpolation:!0,asPath:f,locale:p}),hasMiddleware:!0,isServerRender:o.isSsr,parseJSON:!0,inflightCache:o.sdc,persistCache:!o.isPreview,isPrefetch:!0}),asPath:t,locale:p,router:o});if((null==O?void 0:O.effect.type)==="rewrite"&&(n.pathname=O.effect.resolvedHref,i=O.effect.resolvedHref,l=a({},l,O.effect.parsedAs.query),f=O.effect.parsedAs.pathname,e=E.formatWithValidation(n)),(null==O?void 0:O.effect.type)==="redirect-external")return;let j=s.removeTrailingSlash(i);yield Promise.all([o.pageLoader._isSsg(j).then(t=>!!t&&V({dataHref:(null==O?void 0:O.json)?null==O?void 0:O.dataHref:o.pageLoader.getDataHref({href:e,asPath:f,locale:p}),isServerRender:!1,parseJSON:!0,inflightCache:o.sdc,persistCache:!o.isPreview,isPrefetch:!0,unstable_skipClientCache:r.unstable_skipClientCache||r.priority&&!0}).then(()=>!1)),o.pageLoader[r.priority?"loadPage":"prefetch"](j)])})()}fetchComponent(e){var t=this;return n(function*(){let r=Y({route:e,router:t});try{let n=yield t.pageLoader.loadPage(e);return r(),n}catch(a){throw r(),a}})()}_getData(e){let t=!1,r=()=>{t=!0};return this.clc=r,e().then(e=>{if(r===this.clc&&(this.clc=null),t){let n=Error("Loading initial props cancelled");throw n.cancelled=!0,n}return e})}_getFlightData(e){return V({dataHref:e,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(e=>{let{text:t}=e;return{data:t}})}getInitialProps(e,t){let{Component:r}=this.components["/_app"],n=this._wrapApp(r);return t.AppTree=n,m.loadGetInitialProps(r,{AppTree:n,Component:e,router:this,ctx:t})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(e,t,r,{initialProps:n,pageLoader:a,App:o,wrapApp:i,Component:l,err:u,subscription:c,isFallback:d,locale:f,locales:p,defaultLocale:h,domainLocales:v,isPreview:_}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=$(),this.onPopState=e=>{let t;let{isFirstPopStateEvent:r}=this;this.isFirstPopStateEvent=!1;let n=e.state;if(!n){let{pathname:a,query:o}=this;this.changeState("replaceState",E.formatWithValidation({pathname:R.addBasePath(a),query:o}),m.getURL());return}if(n.__NA){window.location.reload();return}if(!n.__N||r&&this.locale===n.options.locale&&n.as===this.asPath)return;let{url:i,as:l,options:s,key:u}=n;this._key=u;let{pathname:c}=y.parseRelativeUrl(i);(!this.isSsr||l!==R.addBasePath(this.asPath)||c!==R.addBasePath(this.pathname))&&(!this._bps||this._bps(n))&&this.change("replaceState",i,l,Object.assign({},s,{shallow:s.shallow&&this._shallow,locale:s.locale||this.defaultLocale,_h:0}),t)};let P=s.removeTrailingSlash(e);this.components={},"/_error"!==e&&(this.components[P]={Component:l,initial:!0,props:n,err:u,__N_SSG:n&&n.__N_SSG,__N_SSP:n&&n.__N_SSP}),this.components["/_app"]={Component:o,styleSheets:[]},this.events=K.events,this.pageLoader=a;let b=g.isDynamicRoute(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath="",this.sub=c,this.clc=null,this._wrapApp=i,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||(b||self.location.search,0)),this.state={route:P,pathname:e,query:t,asPath:b?e:r,isPreview:!!_,locale:void 0,isFallback:d},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),!r.startsWith("//")){let S={locale:f},x=m.getURL();this._initialMatchesMiddlewarePromise=I({router:this,locale:f,asPath:x}).then(n=>(S._shouldResolveHref=r!==e,this.changeState("replaceState",n?x:E.formatWithValidation({pathname:R.addBasePath(e),query:t}),x,S),n))}window.addEventListener("popstate",this.onPopState)}}K.events=h.default(),t.default=K},34441:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLocale=function(e,t,r,o){return t&&t!==r&&(o||!a.pathHasPrefix(e.toLowerCase(),"/".concat(t.toLowerCase()))&&!a.pathHasPrefix(e.toLowerCase(),"/api"))?n.addPathPrefix(e,"/".concat(t)):e};var n=r(44135),a=r(93210)},44135:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPathPrefix=function(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:a,hash:o}=n.parsePath(e);return"".concat(t).concat(r).concat(a).concat(o)};var n=r(26727)},96074:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPathSuffix=function(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:a,hash:o}=n.parsePath(e);return"".concat(r).concat(t).concat(a).concat(o)};var n=r(26727)},79002:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareRouterStates=function(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=r.length;n--;){let a=r[n];if("query"===a){let o=Object.keys(e.query);if(o.length!==Object.keys(t.query).length)return!1;for(let i=o.length;i--;){let l=o[i];if(!t.query.hasOwnProperty(l)||e.query[l]!==t.query[l])return!1}}else if(!t.hasOwnProperty(a)||e[a]!==t[a])return!1}return!0}},57429:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatNextPathnameInfo=function(e){let t=i.addLocale(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=n.removeTrailingSlash(t)),e.buildId&&(t=o.addPathSuffix(a.addPathPrefix(t,"/_next/data/".concat(e.buildId)),"/"===e.pathname?"index.json":".json")),t=a.addPathPrefix(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:o.addPathSuffix(t,"/"):n.removeTrailingSlash(t)};var n=r(40012),a=r(44135),o=r(96074),i=r(34441)},67795:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatUrl=o,t.formatWithValidation=function(e){return o(e)},t.urlObjectKeys=void 0;var n=(0,r(91598).Z)(r(94919));let a=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,o=e.protocol||"",i=e.pathname||"",l=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?"[".concat(r,"]"):r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(n.urlQueryToSearchParams(s)));let c=e.search||s&&"?".concat(s)||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||a.test(o))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),"".concat(o).concat(u).concat(i).concat(c).concat(l)}t.urlObjectKeys=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"]},27929:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="/"===e?"/index":/^\/index(\/|$)/.test(e)?"/index".concat(e):"".concat(e);return r+t}},18756:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNextPathnameInfo=function(e,t){var r;let{basePath:i,i18n:l,trailingSlash:s}=null!=(r=t.nextConfig)?r:{},u={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};if(i&&o.pathHasPrefix(u.pathname,i)&&(u.pathname=a.removePathPrefix(u.pathname,i),u.basePath=i),!0===t.parseData&&u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){let c=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),d=c[0];u.pathname="index"!==c[1]?"/".concat(c.slice(1).join("/")):"/",u.buildId=d}if(l){let f=n.normalizeLocalePath(u.pathname,l.locales);u.locale=null==f?void 0:f.detectedLocale,u.pathname=(null==f?void 0:f.pathname)||u.pathname}return u};var n=r(24769),a=r(22650),o=r(93210)},18588:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n.getSortedRoutes}}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return a.isDynamicRoute}});var n=r(30566),a=r(86238)},21754:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBot=function(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}},86238:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicRoute=function(e){return r.test(e)};let r=/\/\[[^/]+?\](?=\/|$)/},26727:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePath=function(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}},22864:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRelativeUrl=function(e,t){let r=new URL(n.getLocationOrigin()),o=t?new URL(t,r):e.startsWith(".")?new URL(window.location.href):r,{pathname:i,searchParams:l,search:s,hash:u,href:c,origin:d}=new URL(e,o);if(d!==r.origin)throw Error("invariant: invalid relative URL, router received ".concat(e));return{pathname:i,query:a.searchParamsToUrlQuery(l),search:s,hash:u,href:c.slice(r.origin.length)}};var n=r(670),a=r(94919)},97253:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUrl=function(e){if(e.startsWith("/"))return a.parseRelativeUrl(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:n.searchParamsToUrlQuery(t.searchParams),search:t.search}};var n=r(94919),a=r(22864)},93210:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathHasPrefix=function(e,t){if("string"!=typeof e)return!1;let{pathname:r}=n.parsePath(e);return r===t||r.startsWith(t+"/")};var n=r(26727)},77127:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMatch=function(e,t){let r=[],o=a.pathToRegexp(e,r,{delimiter:"/",sensitive:!1,strict:null==t?void 0:t.strict}),i=a.regexpToFunction((null==t?void 0:t.regexModifier)?RegExp(t.regexModifier(o.source),o.flags):o,r);return(e,a)=>{let o=null!=e&&i(e);if(!o)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let l of r)"number"==typeof l.name&&delete o.params[l.name];return n({},a,o.params)}};var n=r(6495).Z,a=r(74329)},67327:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchHas=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a={},o=r=>{let n;let o=r.key;switch(r.type){case"header":o=o.toLowerCase(),n=e.headers[o];break;case"cookie":n=e.cookies[r.key];break;case"query":n=t[o];break;case"host":{let{host:i}=(null==e?void 0:e.headers)||{},l=null==i?void 0:i.split(":")[0].toLowerCase();n=l}}if(!r.value&&n)return a[function(e){let t="";for(let r=0;r64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(o)]=n,!0;if(n){let s=RegExp("^".concat(r.value,"$")),u=Array.isArray(n)?n.slice(-1)[0].match(s):n.match(s);if(u)return Array.isArray(u)&&(u.groups?Object.keys(u.groups).forEach(e=>{a[e]=u.groups[e]}):"host"===r.type&&u[0]&&(a.host=u[0])),!0}return!1},i=r.every(e=>o(e))&&!n.some(e=>o(e));return!!i&&a},t.compileNonPath=s,t.prepareDestination=function(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq;let u=e.destination;for(let c of Object.keys(n({},e.params,r))){var d,f;d=u,f=c,u=d.replace(RegExp(":".concat(o.escapeStringRegexp(f)),"g"),"__ESC_COLON_".concat(f))}let p=i.parseUrl(u),h=p.query,m=l("".concat(p.pathname).concat(p.hash||"")),g=l(p.hostname||""),y=[],v=[];a.pathToRegexp(m,y),a.pathToRegexp(g,v);let _=[];y.forEach(e=>_.push(e.name)),v.forEach(e=>_.push(e.name));let P=a.compile(m,{validate:!1}),b=a.compile(g,{validate:!1});for(let[E,S]of Object.entries(h))Array.isArray(S)?h[E]=S.map(t=>s(l(t),e.params)):"string"==typeof S&&(h[E]=s(l(S),e.params));let x=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!x.some(e=>_.includes(e)))for(let w of x)w in h||(h[w]=e.params[w]);try{t=P(e.params);let[C,R]=t.split("#");p.hostname=b(e.params),p.pathname=C,p.hash="".concat(R?"#":"").concat(R||""),delete p.search}catch(O){if(O.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw O}return p.query=n({},r,p.query),{newUrl:t,destQuery:h,parsedDestination:p}};var n=r(6495).Z,a=r(74329),o=r(18659),i=r(97253);function l(e){return e.replace(/__ESC_COLON_/gi,":")}function s(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":".concat(r))&&(e=e.replace(RegExp(":".concat(r,"\\*"),"g"),":".concat(r,"--ESCAPED_PARAM_ASTERISKS")).replace(RegExp(":".concat(r,"\\?"),"g"),":".concat(r,"--ESCAPED_PARAM_QUESTION")).replace(RegExp(":".concat(r,"\\+"),"g"),":".concat(r,"--ESCAPED_PARAM_PLUS")).replace(RegExp(":".concat(r,"(?!\\w)"),"g"),"--ESCAPED_PARAM_COLON".concat(r)));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),a.compile("/".concat(e),{validate:!1})(t).slice(1)}},94919:function(e,t){"use strict";function r(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.searchParamsToUrlQuery=function(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t},t.urlQueryToSearchParams=function(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[n,a]=e;Array.isArray(a)?a.forEach(e=>t.append(n,r(e))):t.set(n,r(a))}),t},t.assign=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}},22650:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePathPrefix=function(e,t){if(n.pathHasPrefix(e,t)){let r=e.slice(t.length);return r.startsWith("/")?r:"/".concat(r)}return e};var n=r(93210)},40012:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=function(e){return e.replace(/\/$/,"")||"/"}},27980:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,u,c,d){let f,p=!1,h=!1,m=s.parseRelativeUrl(e),g=o.removeTrailingSlash(i.normalizeLocalePath(l.removeBasePath(m.pathname),d).pathname),y=r=>{let s=n.getPathMatch(r.source+"(/)?",{removeUnnamedParams:!0,strict:!0}),y=s(m.pathname);if((r.has||r.missing)&&y){let v=a.matchHas({headers:{host:document.location.hostname},cookies:document.cookie.split("; ").reduce((e,t)=>{let[r,...n]=t.split("=");return e[r]=n.join("="),e},{})},m.query,r.has,r.missing);v?Object.assign(y,v):y=!1}if(y){if(!r.destination)return h=!0,!0;let _=a.prepareDestination({appendParamsToQuery:!0,destination:r.destination,params:y,query:u});if(m=_.parsedDestination,e=_.newUrl,Object.assign(u,_.parsedDestination.query),g=o.removeTrailingSlash(i.normalizeLocalePath(l.removeBasePath(e),d).pathname),t.includes(g))return p=!0,f=g,!0;if((f=c(g))!==e&&t.includes(f))return p=!0,!0}},v=!1;for(let _=0;_{let a=t.exec(e);if(!a)return!1;let o=e=>{try{return decodeURIComponent(e)}catch(t){throw new n.DecodeError("failed to decode param")}},i={};return Object.keys(r).forEach(e=>{let t=r[e],n=a[t.pos];void 0!==n&&(i[e]=~n.indexOf("/")?n.split("/").map(e=>o(e)):t.repeat?[o(n)]:o(n))}),i}};var n=r(670)},54903:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRouteRegex=s,t.getNamedRouteRegex=function(e){let t=u(e);return n({},s(e),{namedRegex:"^".concat(t.namedParameterizedRoute,"(?:/)?$"),routeKeys:t.routeKeys})},t.getNamedMiddlewareRegex=function(e,t){let{parameterizedRoute:r}=l(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/".concat(n?".*":"","$")};let{namedParameterizedRoute:a}=u(e);return{namedRegex:"^".concat(a).concat(n?"(?:(/.*)?)":"","$")}};var n=r(6495).Z,a=r(18659),o=r(40012);function i(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function l(e){let t=o.removeTrailingSlash(e).slice(1).split("/"),r={},n=1;return{parameterizedRoute:t.map(e=>{if(!(e.startsWith("[")&&e.endsWith("]")))return"/".concat(a.escapeStringRegexp(e));{let{key:t,optional:o,repeat:l}=i(e.slice(1,-1));return r[t]={pos:n++,repeat:l,optional:o},l?o?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function s(e){let{parameterizedRoute:t,groups:r}=l(e);return{re:RegExp("^".concat(t,"(?:/)?$")),groups:r}}function u(e){let t,r;let n=o.removeTrailingSlash(e).slice(1).split("/"),l=(t=97,r=1,()=>{let e="";for(let n=0;n122&&(r++,t=97);return e}),s={};return{namedParameterizedRoute:n.map(e=>{if(!(e.startsWith("[")&&e.endsWith("]")))return"/".concat(a.escapeStringRegexp(e));{let{key:t,optional:r,repeat:n}=i(e.slice(1,-1)),o=t.replace(/\W/g,""),u=!1;return(0===o.length||o.length>30)&&(u=!0),isNaN(parseInt(o.slice(0,1)))||(u=!0),u&&(o=l()),s[o]=t,n?r?"(?:/(?<".concat(o,">.+?))?"):"/(?<".concat(o,">.+?)"):"/(?<".concat(o,">[^/]+?)")}}).join(""),routeKeys:s}}},30566:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSortedRoutes=function(e){let t=new r;return e.forEach(e=>t.insert(e)),t.smoosh()};class r{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh("".concat(e).concat(t,"/"))).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh("".concat(e,"[").concat(this.slugName,"]/"))),!this.placeholder){let n="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'.concat(n,'" and "').concat(n,"[[...").concat(this.optionalRestSlugName,']]").'));r.unshift(n)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh("".concat(e,"[...").concat(this.restSlugName,"]/"))),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh("".concat(e,"[[...").concat(this.optionalRestSlugName,"]]/"))),r}_insert(e,t,n){if(0===e.length){this.placeholder=!1;return}if(n)throw Error("Catch-all must be the last part of the URL.");let a=e[0];if(a.startsWith("[")&&a.endsWith("]")){let o=a.slice(1,-1),i=!1;if(o.startsWith("[")&&o.endsWith("]")&&(o=o.slice(1,-1),i=!0),o.startsWith("...")&&(o=o.substring(3),n=!0),o.startsWith("[")||o.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('".concat(o,"')."));if(o.startsWith("."))throw Error("Segment names may not start with erroneous periods ('".concat(o,"')."));function l(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('".concat(e,"' !== '").concat(r,"')."));t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'.concat(r,'" repeat within a single dynamic path'));if(e.replace(/\W/g,"")===a.replace(/\W/g,""))throw Error('You cannot have the slug names "'.concat(e,'" and "').concat(r,'" differ only by non-word symbols within a single dynamic path'))}),t.push(r)}if(n){if(i){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'.concat(this.restSlugName,']" and "').concat(e[0],'" ).'));l(this.optionalRestSlugName,o),this.optionalRestSlugName=o,a="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'.concat(this.optionalRestSlugName,']]" and "').concat(e[0],'").'));l(this.restSlugName,o),this.restSlugName=o,a="[...]"}}else{if(i)throw Error('Optional route parameters are not yet supported ("'.concat(e[0],'").'));l(this.slugName,o),this.slugName=o,a="[]"}}this.children.has(a)||this.children.set(a,new r),this.children.get(a)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}},86949:function(e,t){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.setConfig=function(e){r=e},t.default=void 0,t.default=()=>r,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},31436:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let a=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(a,e))}}if(a){var s;null==t||null==(s=t.mountedInstances)||s.add(e.children),l()}return o(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null};var n=(0,r(91598).Z)(r(67294));let a=!1,o=a?()=>{}:n.useLayoutEffect,i=a?()=>{}:n.useEffect},670:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execOnce=function(e){let t,r=!1;return function(){for(var n=arguments.length,a=Array(n),o=0;oa.test(e);function i(){let{protocol:e,hostname:t,port:r}=window.location;return"".concat(e,"//").concat(t).concat(r?":"+r:"")}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function u(e,t){return c.apply(this,arguments)}function c(){return(c=n(function*(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:yield u(t.Component,t.ctx)}:{};let n=yield e.getInitialProps(t);if(r&&s(r))return n;if(!n){let a='"'.concat(l(e),'.getInitialProps()" should resolve to an object. But found "').concat(n,'" instead.');throw Error(a)}return n})).apply(this,arguments)}t.isAbsoluteUrl=o;let d="undefined"!=typeof performance;t.SP=d;let f=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);t.ST=f,t.DecodeError=class extends Error{},t.NormalizeError=class extends Error{},t.PageNotFoundError=class extends Error{constructor(e){super(),this.code="ENOENT",this.message="Cannot find module for page: ".concat(e)}},t.MissingStaticPage=class extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: ".concat(e," ").concat(t)}},t.MiddlewareNotFoundError=class extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}},57238:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warnOnce=void 0;let r=e=>{};t.warnOnce=r},74329:function(e,t){"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||95===i){a+=e[o++];continue}break}if(!a)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=o;continue}if("("===n){var l=1,s="",o=r+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o-1:void 0===_;a||(p+="(?:"+f+"(?="+d+"))?"),P||(p+="(?="+f+"|"+d+")")}return RegExp(p,i(r))}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n=0?n="back-forward-cache":r&&(n=document.prerendering||d()>0?"prerender":r.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},p=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(e){t(e.getEntries())});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(a){}},h=function(e,t){var r=function r(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},m=function(e,t,r,n){var a,o;return function(i){var l;t.value>=0&&(i||n)&&((o=t.value-(a||0))||void 0===a)&&(a=t.value,t.delta=o,t.rating=(l=t.value)>r[1]?"poor":l>r[0]?"needs-improvement":"good",e(t))}},g=-1,y=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},v=function(){h(function(e){g=e.timeStamp},!0)},_=function(){return g<0&&(g=y(),v(),u(function(){setTimeout(function(){g=y(),v()},0)})),{get firstHiddenTime(){return g}}},P=function(e,t){t=t||{};var r,n=[1800,3e3],a=_(),o=f("FCP"),i=function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(s&&s.disconnect(),e.startTime-1&&e(t)},o=f("CLS",0),i=0,l=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=l[0],r=l[l.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,l.push(e)):(i=e.value,l=[e]),i>o.value&&(o.value=i,o.entries=l,n())}})},c=p("layout-shift",s);c&&(n=m(a,o,r,t.reportAllChanges),h(function(){s(c.takeRecords()),n(!0)}),u(function(){i=0,E=-1,n=m(a,o=f("CLS",0),r,t.reportAllChanges)}))},x={passive:!0,capture:!0},w=new Date,C=function(e,t){n||(n=t,a=e,o=new Date,j(removeEventListener),R())},R=function(){if(a>=0&&a1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?(t=function(){C(a,e),n()},r=function(){n()},n=function(){removeEventListener("pointerup",t,x),removeEventListener("pointercancel",r,x)},addEventListener("pointerup",t,x),addEventListener("pointercancel",r,x)):C(a,e)}},j=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,O,x)})},A=function(e,t){t=t||{};var r,o=[100,300],l=_(),s=f("FID"),c=function(e){e.startTimet.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};H[n.id]=n,U.push(n)}U.sort(function(e,t){return t.latency-e.latency}),U.splice(10).forEach(function(e){delete H[e.id]})}},q=function(e,t){t=t||{};var r=[200,500];k();var n,a=f("INP"),o=function(e){e.forEach(function(e){e.interactionId&&F(e),"first-input"!==e.entryType||U.some(function(t){return t.entries.some(function(t){return e.duration===t.duration&&e.startTime===t.startTime})})||F(e)});var t=U[Math.min(U.length-1,Math.floor(B()/50))];t&&t.latency!==a.value&&(a.value=t.latency,a.entries=t.entries,n())},i=p("event",o,{durationThreshold:t.durationThreshold||40});n=m(e,a,r,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),h(function(){o(i.takeRecords()),a.value<0&&B()>0&&(a.value=0,a.entries=[]),n(!0)}),u(function(){U=[],D=N(),n=m(e,a=f("INP"),r,t.reportAllChanges)}))},W={},Z=function(e,t){t=t||{};var r,n=[2500,4e3],a=_(),o=f("LCP"),i=function(e){var t=e[e.length-1];if(t){var n=t.startTime-d();nperformance.now())return;n.entries=[o],a(!0),u(function(){(a=m(e,n=f("TTFB",0),r,t.reportAllChanges))(!0)})}})},e.exports=r},80676:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.getProperError=function(e){return a(e)?e:Error(n.isPlainObject(e)?JSON.stringify(e):e+"")};var n=r(82849);function a(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}}},function(e){e.O(0,[9774],function(){return e(e.s=21783)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/main-ae0b54a02d5e7994.js b/static/web/_next/static/chunks/main-ae0b54a02d5e7994.js new file mode 100644 index 000000000..1c1e8d6d7 --- /dev/null +++ b/static/web/_next/static/chunks/main-ae0b54a02d5e7994.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[179],{60932:function(e,t){"use strict";function r(e,t,r,n,a,o,i){try{var l=e[o](i),s=l.value}catch(u){r(u);return}l.done?t(s):Promise.resolve(s).then(n,a)}function n(e){return function(){var t=this,n=arguments;return new Promise(function(a,o){var i=e.apply(t,n);function l(e){r(i,a,o,l,s,"next",e)}function s(e){r(i,a,o,l,s,"throw",e)}l(void 0)})}}Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return n}})},6495:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(a[r]=e[r]);return a}Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return r}})},40037:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})})},33468:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addBasePath=function(e,t){return a.normalizePathTrailingSlash(n.addPathPrefix(e,""))};var n=r(44135),a=r(52700);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54465:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLocale=void 0,r(52700),t.addLocale=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'.concat(e.props["data-href"],'"]')))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let r=t[e.type]||[];r.push(e),t[e.type]=r});let r=t.title?t.title[0]:null,o="";if(r){let{children:i}=r.props;o="string"==typeof i?i:Array.isArray(i)?i.join(""):""}o!==document.title&&(document.title=o),["meta","base","link","style","script"].forEach(e=>{(function(e,t){let r=document.getElementsByTagName("head")[0],o=r.querySelector("meta[name=next-head-count]"),i=Number(o.content),l=[];for(let s=0,u=o.previousElementSibling;s{for(let t=0,r=l.length;t{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),d.forEach(e=>r.insertBefore(e,o)),o.content=(i-l.length+d.length).toString()})(e,t[e]||[])})}}},t.isEqualNode=a,t.DOMAttributeNames=void 0;let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function n(e){let{type:t,props:n}=e,a=document.createElement(t);for(let o in n){if(!n.hasOwnProperty(o)||"children"===o||"dangerouslySetInnerHTML"===o||void 0===n[o])continue;let i=r[o]||o.toLowerCase();"script"===t&&("async"===i||"defer"===i||"noModule"===i)?a[i]=!!n[o]:a.setAttribute(i,n[o])}let{children:l,dangerouslySetInnerHTML:s}=n;return s?a.innerHTML=s.__html||"":l&&(a.textContent="string"==typeof l?l:Array.isArray(l)?l.join(""):""),a}function a(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let r=t.getAttribute("nonce");if(r&&!e.getAttribute("nonce")){let n=t.cloneNode(!0);return n.setAttribute("nonce",""),n.nonce=r,r===e.nonce&&e.isEqualNode(n)}}return e.isEqualNode(t)}t.DOMAttributeNames=r,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},84534:function(e,t,r){"use strict";let n,a,o,i,l,s,u,c,d,f,p,h;Object.defineProperty(t,"__esModule",{value:!0});let m=r(91598).Z;Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=function(){return z.apply(this,arguments)},t.hydrate=function(e){return ei.apply(this,arguments)},t.emitter=t.router=t.version=void 0;var g=r(60932).Z,y=r(6495).Z,v=r(92648).Z;r(91598).Z,r(40037);var _=v(r(67294)),P=v(r(20745)),b=r(4664),E=v(r(8550)),S=r(72692),x=r(86238),w=r(94919),C=r(86949),O=r(670),R=r(17345),j=v(r(31831)),A=v(r(70976)),M=v(r(659)),L=r(18483),T=r(80880),I=r(80676),N=r(28730),k=r(82813),D=r(10928),B=r(48245),U=r(60401),H=r(78914);t.version="13.0.5",t.router=n;let F=E.default();t.emitter=F;let q=e=>[].slice.call(e),W=!1;self.__next_require__=r;class Z extends _.default.Component{componentDidCatch(e,t){this.props.fn(e,t)}componentDidMount(){this.scrollToHash(),n.isSsr&&"/404"!==a.page&&"/_error"!==a.page&&(a.isFallback||a.nextExport&&(x.isDynamicRoute(n.pathname)||location.search,1)||a.props&&a.props.__N_SSG&&(location.search,1))&&n.replace(n.pathname+"?"+String(w.assign(w.urlQueryToSearchParams(n.query),new URLSearchParams(location.search))),o,{_h:1,shallow:!a.isFallback&&!W}).catch(e=>{if(!e.cancelled)throw e})}componentDidUpdate(){this.scrollToHash()}scrollToHash(){let{hash:e}=location;if(!(e=e&&e.substring(1)))return;let t=document.getElementById(e);t&&setTimeout(()=>t.scrollIntoView(),0)}render(){return this.props.children}}function z(){return(z=g(function*(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=JSON.parse(document.getElementById("__NEXT_DATA__").textContent),window.__NEXT_DATA__=a,h=a.defaultLocale;let e=a.assetPrefix||"";if(r.p="".concat(e,"/_next/"),C.setConfig({serverRuntimeConfig:{},publicRuntimeConfig:a.runtimeConfig||{}}),o=O.getURL(),D.hasBasePath(o)&&(o=k.removeBasePath(o)),a.scriptLoader){let{initScriptLoader:t}=r(63573);t(a.scriptLoader)}i=new A.default(a.buildId,e);let u=e=>{let[t,r]=e;return i.routeLoader.onEntrypoint(t,r)};return window.__NEXT_P&&window.__NEXT_P.map(e=>setTimeout(()=>u(e),0)),window.__NEXT_P=[],window.__NEXT_P.push=u,(s=j.default()).getIsSsr=()=>n.isSsr,l=document.getElementById("__next"),{assetPrefix:e}})).apply(this,arguments)}function G(e,t){return _.default.createElement(e,Object.assign({},t))}function V(e){var t;let{children:r}=e;return _.default.createElement(Z,{fn:e=>X({App:d,err:e}).catch(e=>console.error("Error rendering page: ",e))},_.default.createElement(B.AppRouterContext.Provider,{value:U.adaptForAppRouterInstance(n)},_.default.createElement(H.SearchParamsContext.Provider,{value:U.adaptForSearchParams(n)},_.default.createElement(U.PathnameContextProviderAdapter,{router:n,isAutoExport:null!=(t=self.__NEXT_DATA__.autoExport)&&t},_.default.createElement(S.RouterContext.Provider,{value:T.makePublicRouterInstance(n)},_.default.createElement(b.HeadManagerContext.Provider,{value:s},_.default.createElement(N.ImageConfigContext.Provider,{value:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}},r)))))))}let $=e=>t=>{let r=y({},t,{Component:p,err:a.err,router:n});return _.default.createElement(V,null,G(e,r))};function X(e){let{App:t,err:l}=e;return console.error(l),console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"),i.loadPage("/_error").then(n=>{let{page:a,styleSheets:o}=n;return(null==u?void 0:u.Component)===a?Promise.resolve().then(()=>m(r(97345))).then(n=>Promise.resolve().then(()=>m(r(74297))).then(r=>(t=r.default,e.App=t,n))).then(e=>({ErrorComponent:e.default,styleSheets:[]})):{ErrorComponent:a,styleSheets:o}}).then(r=>{var i;let{ErrorComponent:s,styleSheets:u}=r,c=$(t),d={Component:s,AppTree:c,router:n,ctx:{err:l,pathname:a.page,query:a.query,asPath:o,AppTree:c}};return Promise.resolve((null==(i=e.props)?void 0:i.err)?e.props:O.loadGetInitialProps(t,d)).then(t=>en(y({},e,{err:l,Component:s,styleSheets:u,props:t})))})}function Y(e){let{callback:t}=e;return _.default.useLayoutEffect(()=>t(),[t]),null}let K=null,Q=!0;function J(){["beforeRender","afterHydrate","afterRender","routeChange"].forEach(e=>performance.clearMarks(e))}function ee(){O.ST&&(performance.mark("afterHydrate"),performance.measure("Next.js-before-hydration","navigationStart","beforeRender"),performance.measure("Next.js-hydration","beforeRender","afterHydrate"),f&&performance.getEntriesByName("Next.js-hydration").forEach(f),J())}function et(){if(!O.ST)return;performance.mark("afterRender");let e=performance.getEntriesByName("routeChange","mark");e.length&&(performance.measure("Next.js-route-change-to-render",e[0].name,"beforeRender"),performance.measure("Next.js-render","beforeRender","afterRender"),f&&(performance.getEntriesByName("Next.js-render").forEach(f),performance.getEntriesByName("Next.js-route-change-to-render").forEach(f)),J(),["Next.js-route-change-to-render","Next.js-render"].forEach(e=>performance.clearMeasures(e)))}function er(e){let{callbacks:t,children:r}=e;return _.default.useLayoutEffect(()=>t.forEach(e=>e()),[t]),_.default.useEffect(()=>{M.default(f)},[]),r}function en(e){let t,{App:r,Component:a,props:o,err:i}=e,s="initial"in e?void 0:e.styleSheets;a=a||u.Component,o=o||u.props;let d=y({},o,{Component:a,err:i,router:n});u=d;let f=!1,p=new Promise((e,r)=>{c&&c(),t=()=>{c=null,e()},c=()=>{f=!0,c=null;let e=Error("Cancel rendering route");e.cancelled=!0,r(e)}});function h(){t()}!function(){if(!s)return;let e=q(document.querySelectorAll("style[data-n-href]")),t=new Set(e.map(e=>e.getAttribute("data-n-href"))),r=document.querySelector("noscript[data-n-css]"),n=null==r?void 0:r.getAttribute("data-n-css");s.forEach(e=>{let{href:r,text:a}=e;if(!t.has(r)){let o=document.createElement("style");o.setAttribute("data-n-href",r),o.setAttribute("media","x"),n&&o.setAttribute("nonce",n),document.head.appendChild(o),o.appendChild(document.createTextNode(a))}})}();let m=_.default.createElement(_.default.Fragment,null,_.default.createElement(Y,{callback:function(){if(s&&!f){let t=new Set(s.map(e=>e.href)),r=q(document.querySelectorAll("style[data-n-href]")),n=r.map(e=>e.getAttribute("data-n-href"));for(let a=0;a{let{href:t}=e,r=document.querySelector('style[data-n-href="'.concat(t,'"]'));r&&(o.parentNode.insertBefore(r,o.nextSibling),o=r)}),q(document.querySelectorAll("link[data-n-p]")).forEach(e=>{e.parentNode.removeChild(e)})}if(e.scroll){let i=document.documentElement,l=i.style.scrollBehavior;i.style.scrollBehavior="auto",window.scrollTo(e.scroll.x,e.scroll.y),i.style.scrollBehavior=l}}}),_.default.createElement(V,null,G(r,d),_.default.createElement(R.Portal,{type:"next-route-announcer"},_.default.createElement(L.RouteAnnouncer,null))));return!function(e,t){O.ST&&performance.mark("beforeRender");let r=t(Q?ee:et);if(K){let n=_.default.startTransition;n(()=>{K.render(r)})}else K=P.default.hydrateRoot(e,r),Q=!1}(l,e=>_.default.createElement(er,{callbacks:[e,h]},_.default.createElement(_.default.StrictMode,null,m))),p}function ea(e){return eo.apply(this,arguments)}function eo(){return(eo=g(function*(e){if(e.err){yield X(e);return}try{yield en(e)}catch(r){let t=I.getProperError(r);if(t.cancelled)throw t;yield X(y({},e,{err:t}))}})).apply(this,arguments)}function ei(){return(ei=g(function*(e){let r=a.err;try{let l=yield i.routeLoader.whenEntrypoint("/_app");if("error"in l)throw l.error;let{component:s,exports:u}=l;d=s,u&&u.reportWebVitals&&(f=e=>{let t,{id:r,name:n,startTime:a,value:o,duration:i,entryType:l,entries:s,attribution:c}=e,d="".concat(Date.now(),"-").concat(Math.floor(Math.random()*(9e12-1))+1e12);s&&s.length&&(t=s[0].startTime);let f={id:r||d,name:n,startTime:a||t,value:null==o?i:o,label:"mark"===l||"measure"===l?"custom":"web-vital"};c&&(f.attribution=c),u.reportWebVitals(f)});let c=yield i.routeLoader.whenEntrypoint(a.page);if("error"in c)throw c.error;p=c.component}catch(m){r=I.getProperError(m)}window.__NEXT_PRELOADREADY&&(yield window.__NEXT_PRELOADREADY(a.dynamicIds)),t.router=n=T.createRouter(a.page,a.query,o,{initialProps:a.props,pageLoader:i,App:d,Component:p,wrapApp:$,err:r,isFallback:Boolean(a.isFallback),subscription:(e,t,r)=>ea(Object.assign({},e,{App:t,scroll:r})),locale:a.locale,locales:a.locales,defaultLocale:h,domainLocales:a.domainLocales,isPreview:a.isPreview}),W=yield n._initialMatchesMiddlewarePromise;let g={App:d,initial:!0,Component:p,props:a.props,err:r};(null==e?void 0:e.beforeRender)&&(yield e.beforeRender()),ea(g)})).apply(this,arguments)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21783:function(e,t,r){"use strict";var n=r(84534);window.next={version:n.version,get router(){return n.router},emitter:n.emitter},n.initialize({}).then(()=>n.hydrate()).catch(console.error),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52700:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathTrailingSlash=void 0;var n=r(40012),a=r(26727);let o=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:o}=a.parsePath(e);return/\.[^/]+\/?$/.test(t)?"".concat(n.removeTrailingSlash(t)).concat(r).concat(o):t.endsWith("/")?"".concat(t).concat(r).concat(o):"".concat(t,"/").concat(r).concat(o)};t.normalizePathTrailingSlash=o,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},70976:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(92648).Z,a=r(33468),o=r(41003),i=n(r(27929)),l=r(54465),s=r(86238),u=r(22864),c=r(40012),d=r(82497);t.default=class{getPageList(){return d.getClientBuildManifest().then(e=>e.sortedPages)}getMiddleware(){return window.__MIDDLEWARE_MATCHERS=[],window.__MIDDLEWARE_MATCHERS}getDataHref(e){let{asPath:t,href:r,locale:n}=e,{pathname:d,query:f,search:p}=u.parseRelativeUrl(r),{pathname:h}=u.parseRelativeUrl(t),m=c.removeTrailingSlash(d);if("/"!==m[0])throw Error('Route name should start with a "/", got "'.concat(m,'"'));return(e=>{let t=i.default(c.removeTrailingSlash(l.addLocale(e,n)),".json");return a.addBasePath("/_next/data/".concat(this.buildId).concat(t).concat(p),!0)})(e.skipInterpolation?h:s.isDynamicRoute(m)?o.interpolateAs(d,h,f).result:m)}_isSsg(e){return this.promisedSsgManifest.then(t=>t.has(e))}loadPage(e){return this.routeLoader.loadRoute(e).then(e=>{if("component"in e)return{page:e.component,mod:e.exports,styleSheets:e.styles.map(e=>({href:e.href,text:e.content}))};throw e.error})}prefetch(e){return this.routeLoader.prefetch(e)}constructor(e,t){this.routeLoader=d.createRouteLoader(t),this.buildId=e,this.assetPrefix=t,this.promisedSsgManifest=new Promise(e=>{window.__SSG_MANIFEST?e(window.__SSG_MANIFEST):window.__SSG_MANIFEST_CB=()=>{e(window.__SSG_MANIFEST)}})}},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},659:function(e,t,r){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let a=["CLS","FCP","FID","INP","LCP","TTFB"];location.href;let o=!1;function i(e){n&&n(e)}var l=e=>{if(n=e,!o)for(let t of(o=!0,a))try{let l;l||(l=r(78018)),l["on".concat(t)](i)}catch(s){console.warn("Failed to track ".concat(t," web-vital"),s)}};t.default=l,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17345:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Portal=void 0;var n=r(67294),a=r(73935);let o=e=>{let{children:t,type:r}=e,[o,i]=n.useState(null);return n.useEffect(()=>{let e=document.createElement(r);return document.body.appendChild(e),i(e),()=>{document.body.removeChild(e)}},[r]),o?a.createPortal(t,o):null};t.Portal=o,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82813:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeBasePath=function(e){return(e=e.slice(0)).startsWith("/")||(e="/".concat(e)),e},r(10928),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66876:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeLocale=function(e,t){return e},r(26727),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44686:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelIdleCallback=t.requestIdleCallback=void 0;let r="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)};t.requestIdleCallback=r;let n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};t.cancelIdleCallback=n,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},18483:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RouteAnnouncer=void 0;var n=(0,r(92648).Z)(r(67294)),a=r(80880);let o={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},i=()=>{let{asPath:e}=a.useRouter(),[t,r]=n.default.useState(""),i=n.default.useRef(e);return n.default.useEffect(()=>{if(i.current!==e){if(i.current=e,document.title)r(document.title);else{var t;let n=document.querySelector("h1"),a=null!=(t=null==n?void 0:n.innerText)?t:null==n?void 0:n.textContent;r(a||e)}}},[e]),n.default.createElement("p",{"aria-live":"assertive",id:"__next-route-announcer__",role:"alert",style:o},t)};t.RouteAnnouncer=i,t.default=i,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82497:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markAssetError=l,t.isAssetError=function(e){return e&&i in e},t.getClientBuildManifest=c,t.createRouteLoader=function(e){let t=new Map,r=new Map,n=new Map,i=new Map;function c(e){{var t;let n=r.get(e.toString());return n||(document.querySelector('script[src^="'.concat(e,'"]'))?Promise.resolve():(r.set(e.toString(),n=new Promise((r,n)=>{(t=document.createElement("script")).onload=r,t.onerror=()=>n(l(Error("Failed to load script: ".concat(e)))),t.crossOrigin=void 0,t.src=e,document.body.appendChild(t)})),n))}}function f(e){let t=n.get(e);return t||n.set(e,t=fetch(e).then(t=>{if(!t.ok)throw Error("Failed to load stylesheet: ".concat(e));return t.text().then(t=>({href:e,content:t}))}).catch(e=>{throw l(e)})),t}return{whenEntrypoint:e=>o(e,t),onEntrypoint(e,r){(r?Promise.resolve().then(()=>r()).then(e=>({component:e&&e.default||e,exports:e}),e=>({error:e})):Promise.resolve(void 0)).then(r=>{let n=t.get(e);n&&"resolve"in n?r&&(t.set(e,r),n.resolve(r)):(r?t.set(e,r):t.delete(e),i.delete(e))})},loadRoute(r,n){return o(r,i,()=>{let a;return u(d(e,r).then(e=>{let{scripts:n,css:a}=e;return Promise.all([t.has(r)?[]:Promise.all(n.map(c)),Promise.all(a.map(f))])}).then(e=>this.whenEntrypoint(r).then(t=>({entrypoint:t,styles:e[1]}))),3800,l(Error("Route did not complete loading: ".concat(r)))).then(e=>{let{entrypoint:t,styles:r}=e,n=Object.assign({styles:r},t);return"error"in t?t:n}).catch(e=>{if(n)throw e;return{error:e}}).finally(()=>null==a?void 0:a())})},prefetch(t){let r;return(r=navigator.connection)&&(r.saveData||/2g/.test(r.effectiveType))?Promise.resolve():d(e,t).then(e=>Promise.all(s?e.scripts.map(e=>{var t,r,n;return t=e.toString(),r="script",new Promise((e,a)=>{let o='\n link[rel="prefetch"][href^="'.concat(t,'"],\n link[rel="preload"][href^="').concat(t,'"],\n script[src^="').concat(t,'"]');if(document.querySelector(o))return e();n=document.createElement("link"),r&&(n.as=r),n.rel="prefetch",n.crossOrigin=void 0,n.onload=e,n.onerror=()=>a(l(Error("Failed to prefetch: ".concat(t)))),n.href=t,document.head.appendChild(n)})}):[])).then(()=>{a.requestIdleCallback(()=>this.loadRoute(t,!0).catch(()=>{}))}).catch(()=>{})}}},(0,r(92648).Z)(r(27929));var n=r(65407),a=r(44686);function o(e,t,r){let n,a=t.get(e);if(a)return"future"in a?a.future:Promise.resolve(a);let o=new Promise(e=>{n=e});return t.set(e,a={resolve:n,future:o}),r?r().then(e=>(n(e),e)).catch(r=>{throw t.delete(e),r}):o}let i=Symbol("ASSET_LOAD_ERROR");function l(e){return Object.defineProperty(e,i,{})}let s=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(t){return!1}}();function u(e,t,r){return new Promise((n,o)=>{let i=!1;e.then(e=>{i=!0,n(e)}).catch(o),a.requestIdleCallback(()=>setTimeout(()=>{i||o(r)},t))})}function c(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);let e=new Promise(e=>{let t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}});return u(e,3800,l(Error("Failed to load client build manifest")))}function d(e,t){return c().then(r=>{if(!(t in r))throw l(Error("Failed to lookup route: ".concat(t)));let a=r[t].map(t=>e+"/_next/"+encodeURI(t));return{scripts:a.filter(e=>e.endsWith(".js")).map(e=>n.__unsafeCreateTrustedScriptURL(e)),css:a.filter(e=>e.endsWith(".css"))}})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80880:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Router",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"withRouter",{enumerable:!0,get:function(){return s.default}}),t.useRouter=function(){let e=a.default.useContext(i.RouterContext);if(!e)throw Error("Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return e},t.createRouter=function(){for(var e=arguments.length,t=Array(e),r=0;re()),u.readyCallbacks=[],u.router},t.makePublicRouterInstance=function(e){let t={};for(let r of c){if("object"==typeof e[r]){t[r]=Object.assign(Array.isArray(e[r])?[]:{},e[r]);continue}t[r]=e[r]}return t.events=o.default.events,d.forEach(r=>{t[r]=function(){for(var t=arguments.length,n=Array(t),a=0;ao.default.events}),c.forEach(e=>{Object.defineProperty(u,e,{get(){let t=f();return t[e]}})}),d.forEach(e=>{u[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n{u.ready(()=>{o.default.events.on(e,function(){for(var t=arguments.length,r=Array(t),n=0;n{let t=e.id||e.getAttribute("src");p.add(t)})}()},t.default=void 0;var n=r(6495).Z,a=r(92648).Z,o=r(91598).Z,i=r(17273).Z,l=a(r(73935)),s=o(r(67294)),u=r(4664),c=r(31831),d=r(44686);let f=new Map,p=new Set,h=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy"],m=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:a=null,dangerouslySetInnerHTML:o,children:i="",strategy:l="afterInteractive",onError:s}=e,u=r||t;if(u&&p.has(u))return;if(f.has(t)){p.add(u),f.get(t).then(n,s);return}let d=()=>{a&&a(),p.add(u)},m=document.createElement("script"),g=new Promise((e,t)=>{m.addEventListener("load",function(t){e(),n&&n.call(this,t),d()}),m.addEventListener("error",function(e){t(e)})}).catch(function(e){s&&s(e)});for(let[y,v]of(o?(m.innerHTML=o.__html||"",d()):i?(m.textContent="string"==typeof i?i:Array.isArray(i)?i.join(""):"",d()):t&&(m.src=t,f.set(t,g)),Object.entries(e))){if(void 0===v||h.includes(y))continue;let _=c.DOMAttributeNames[y]||y.toLowerCase();m.setAttribute(_,v)}"worker"===l&&m.setAttribute("type","text/partytown"),m.setAttribute("data-nscript",l),document.body.appendChild(m)};function g(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{d.requestIdleCallback(()=>m(e))}):m(e)}function y(e){let{id:t,src:r="",onLoad:a=()=>{},onReady:o=null,strategy:c="afterInteractive",onError:f}=e,h=i(e,["id","src","onLoad","onReady","strategy","onError"]),{updateScripts:g,scripts:y,getIsSsr:v,appDir:_,nonce:P}=s.useContext(u.HeadManagerContext),b=s.useRef(!1);s.useEffect(()=>{let e=t||r;b.current||(o&&e&&p.has(e)&&o(),b.current=!0)},[o,t,r]);let E=s.useRef(!1);if(s.useEffect(()=>{!E.current&&("afterInteractive"===c?m(e):"lazyOnload"===c&&("complete"===document.readyState?d.requestIdleCallback(()=>m(e)):window.addEventListener("load",()=>{d.requestIdleCallback(()=>m(e))})),E.current=!0)},[e,c]),("beforeInteractive"===c||"worker"===c)&&(g?(y[c]=(y[c]||[]).concat([n({id:t,src:r,onLoad:a,onReady:o,onError:f},h)]),g(y)):v&&v()?p.add(t||r):v&&!v()&&m(e)),_){if("beforeInteractive"===c)return r?(l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"}),s.default.createElement("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push(".concat(JSON.stringify([r]),")")}})):(h.dangerouslySetInnerHTML&&(h.children=h.dangerouslySetInnerHTML.__html,delete h.dangerouslySetInnerHTML),s.default.createElement("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push(".concat(JSON.stringify([0,n({},h)]),")")}}));"afterInteractive"===c&&r&&l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"})}return null}Object.defineProperty(y,"__nextScript",{value:!0}),t.default=y,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65407:function(e,t){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.__unsafeCreateTrustedScriptURL=function(e){var t;return(null==(t=function(){if(void 0===r){var e;r=(null==(e=window.trustedTypes)?void 0:e.createPolicy("nextjs",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))||null}return r}())?void 0:t.createScriptURL(e))||e},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49977:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){return n.default.createElement(e,Object.assign({router:a.useRouter()},t))}return t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,t};var n=(0,r(92648).Z)(r(67294)),a=r(80880);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74297:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a=r(60932).Z,o=(0,r(92648).Z)(r(67294)),i=r(670);function l(e){return s.apply(this,arguments)}function s(){return(s=a(function*(e){let{Component:t,ctx:r}=e,n=yield i.loadGetInitialProps(t,r);return{pageProps:n}})).apply(this,arguments)}class u extends(n=o.default.Component){render(){let{Component:e,pageProps:t}=this.props;return o.default.createElement(e,Object.assign({},t))}}u.origGetInitialProps=l,u.getInitialProps=l,t.default=u},97345:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a=r(92648).Z,o=a(r(67294)),i=a(r(83121));let l={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"};function s(e){let{res:t,err:r}=e,n=t&&t.statusCode?t.statusCode:r?r.statusCode:404;return{statusCode:n}}let u={error:{fontFamily:'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",margin:0,marginRight:"20px",padding:"0 23px 0 0",fontSize:"24px",fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"49px",margin:0,padding:0}};class c extends(n=o.default.Component){render(){let{statusCode:e,withDarkMode:t=!0}=this.props,r=this.props.title||l[e]||"An unexpected error has occurred";return o.default.createElement("div",{style:u.error},o.default.createElement(i.default,null,o.default.createElement("title",null,e?"".concat(e,": ").concat(r):"Application error: a client-side exception has occurred")),o.default.createElement("div",null,o.default.createElement("style",{dangerouslySetInnerHTML:{__html:"\n body { margin: 0; color: #000; background: #fff; }\n .next-error-h1 {\n border-right: 1px solid rgba(0, 0, 0, .3);\n }\n\n ".concat(t?"@media (prefers-color-scheme: dark) {\n body { color: #fff; background: #000; }\n .next-error-h1 {\n border-right: 1px solid rgba(255, 255, 255, .3);\n }\n }":"")}}),e?o.default.createElement("h1",{className:"next-error-h1",style:u.h1},e):null,o.default.createElement("div",{style:u.desc},o.default.createElement("h2",{style:u.h2},this.props.title||e?r:o.default.createElement(o.default.Fragment,null,"Application error: a client-side exception has occurred (see the browser console for more information)"),"."))))}}c.displayName="ErrorPage",c.getInitialProps=s,c.origGetInitialProps=s,t.default=c,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40610:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext({});t.AmpStateContext=a},40532:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=function(){let{ampFirst:e=!1,hybrid:t=!1,hasQuery:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e||t&&r}},48245:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateContext=t.GlobalLayoutRouterContext=t.LayoutRouterContext=t.AppRouterContext=t.CacheStates=void 0;var n,a,o=(0,r(92648).Z)(r(67294));t.CacheStates=n,(a=n||(t.CacheStates=n={})).LAZY_INITIALIZED="LAZYINITIALIZED",a.DATA_FETCH="DATAFETCH",a.READY="READY";let i=o.default.createContext(null);t.AppRouterContext=i;let l=o.default.createContext(null);t.LayoutRouterContext=l;let s=o.default.createContext(null);t.GlobalLayoutRouterContext=s;let u=o.default.createContext(null);t.TemplateContext=u},18659:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeStringRegexp=function(e){return r.test(e)?e.replace(n,"\\$&"):e};let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g},4664:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeadManagerContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext({});t.HeadManagerContext=a},83121:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=c,t.default=void 0;var n=r(6495).Z,a=r(92648).Z,o=(0,r(91598).Z)(r(67294)),i=a(r(31436)),l=r(40610),s=r(4664),u=r(40532);function c(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[o.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(o.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function d(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(57238);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:r}=t;return e.reduce(d,[]).reverse().concat(c(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return a=>{let o=!0,i=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){i=!0;let l=a.key.slice(a.key.indexOf("$")+1);e.has(l)?o=!1:e.add(l)}switch(a.type){case"title":case"base":t.has(a.type)?o=!1:t.add(a.type);break;case"meta":for(let s=0,u=f.length;s{let a=e.key||t;if(!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let i=n({},e.props||{});return i["data-href"]=i.href,i.href=void 0,i["data-optimized-fonts"]=!0,o.default.cloneElement(e,i)}return o.default.cloneElement(e,{key:a})})}t.default=function(e){let{children:t}=e,r=o.useContext(l.AmpStateContext),n=o.useContext(s.HeadManagerContext);return o.default.createElement(i.default,{reduceComponentsToState:p,headManager:n,inAmpMode:u.isInAmpMode(r)},t)},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78914:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutSegmentsContext=t.ParamsContext=t.PathnameContext=t.SearchParamsContext=void 0;var n=r(67294);let a=n.createContext(null);t.SearchParamsContext=a;let o=n.createContext(null);t.PathnameContext=o;let i=n.createContext(null);t.ParamsContext=i;let l=n.createContext(null);t.LayoutSegmentsContext=l},24769:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLocalePath=function(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}},28730:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageConfigContext=void 0;var n=(0,r(92648).Z)(r(67294)),a=r(10139);let o=n.default.createContext(a.imageConfigDefault);t.ImageConfigContext=o},10139:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageConfigDefault=t.VALID_LOADERS=void 0,t.VALID_LOADERS=["default","imgix","cloudinary","akamai","custom"],t.imageConfigDefault={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",remotePatterns:[],unoptimized:!1}},82849:function(e,t){"use strict";function r(e){return Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectClassLabel=r,t.isPlainObject=function(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}},8550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=Object.create(null);return{on(t,r){(e[t]||(e[t]=[])).push(r)},off(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{e(...n)})}}}},6301:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.denormalizePagePath=function(e){let t=a.normalizePathSep(e);return t.startsWith("/index/")&&!n.isDynamicRoute(t)?t.slice(6):"/index"!==t?t:"/"};var n=r(18588),a=r(49997)},49997:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathSep=function(e){return e.replace(/\\/g,"/")}},72692:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouterContext=void 0;var n=(0,r(92648).Z)(r(67294));let a=n.default.createContext(null);t.RouterContext=a},60401:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adaptForAppRouterInstance=function(e){return{back(){e.back()},forward(){e.forward()},refresh(){e.reload()},push(t){e.push(t)},replace(t){e.replace(t)},prefetch(t){e.prefetch(t)}}},t.adaptForSearchParams=function(e){return e.isReady&&e.query?function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let a of n)t.append(r,a);else void 0!==n&&t.append(r,n);return t}(e.query):new URLSearchParams},t.PathnameContextProviderAdapter=function(e){var{children:t,router:r}=e,n=a(e,["children","router"]);let s=o.useRef(n.isAutoExport),u=o.useMemo(()=>{let e=s.current;if(e&&(s.current=!1),l.isDynamicRoute(r.pathname)&&(r.isFallback||e&&!r.isReady))return null;let t=new URL(r.asPath,"http://f");return t.pathname},[r.asPath,r.isFallback,r.isReady,r.pathname]);return o.default.createElement(i.PathnameContext.Provider,{value:u},t)};var n=r(91598).Z,a=r(17273).Z,o=n(r(67294)),i=r(78914),l=r(18588)},41003:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesMiddleware=I,t.isLocalURL=B,t.interpolateAs=U,t.resolveHref=H,t.createKey=$,t.default=void 0;var n=r(60932).Z,a=r(6495).Z,o=r(92648).Z,i=r(91598).Z,l=r(52700),s=r(40012),u=r(82497),c=r(63573),d=i(r(80676)),f=r(6301),p=r(24769),h=o(r(8550)),m=r(670),g=r(86238),y=r(22864),v=r(94919),_=o(r(27980)),P=r(13156),b=r(54903),E=r(67795);r(84643);var S=r(26727),x=r(54465),w=r(66876),C=r(82813),O=r(33468),R=r(10928),j=r(18756),A=r(57429),M=r(79002),L=r(21754);function T(){return Object.assign(Error("Route Cancelled"),{cancelled:!0})}function I(e){return N.apply(this,arguments)}function N(){return(N=n(function*(e){let t=yield Promise.resolve(e.router.pageLoader.getMiddleware());if(!t)return!1;let{pathname:r}=S.parsePath(e.asPath),n=R.hasBasePath(r)?C.removeBasePath(r):r,a=O.addBasePath(x.addLocale(n,e.locale));return t.some(e=>RegExp(e.regexp).test(a))})).apply(this,arguments)}function k(e){let t=m.getLocationOrigin();return e.startsWith(t)?e.substring(t.length):e}function D(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}function B(e){if(!m.isAbsoluteUrl(e))return!0;try{let t=m.getLocationOrigin(),r=new URL(e,t);return r.origin===t&&R.hasBasePath(r.pathname)}catch(n){return!1}}function U(e,t,r){let n="",a=b.getRouteRegex(e),o=a.groups,i=(t!==e?P.getRouteMatcher(a)(t):"")||r;n=e;let l=Object.keys(o);return l.every(e=>{let t=i[e]||"",{repeat:r,optional:a}=o[e],l="[".concat(r?"...":"").concat(e,"]");return a&&(l="".concat(t?"":"/","[").concat(l,"]")),r&&!Array.isArray(t)&&(t=[t]),(a||e in i)&&(n=n.replace(l,r?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(n=""),{params:l,result:n}}function H(e,t,r){let n;let a="string"==typeof t?t:E.formatWithValidation(t),o=a.match(/^[a-zA-Z]{1,}:\/\//),i=o?a.slice(o[0].length):a,s=i.split("?");if((s[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href passed to next/router: ".concat(a,", repeated forward-slashes (//) or backslashes \\ are not valid in the href"));let u=m.normalizeRepeatedSlashes(i);a=(o?o[0]:"")+u}if(!B(a))return r?[a]:a;try{n=new URL(a.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(c){n=new URL("/","http://n")}try{let d=new URL(a,n);d.pathname=l.normalizePathTrailingSlash(d.pathname);let f="";if(g.isDynamicRoute(d.pathname)&&d.searchParams&&r){let p=v.searchParamsToUrlQuery(d.searchParams),{result:h,params:y}=U(d.pathname,d.pathname,p);h&&(f=E.formatWithValidation({pathname:h,hash:d.hash,query:D(p,y)}))}let _=d.origin===n.origin?d.href.slice(d.origin.length):d.href;return r?[_,f||_]:_}catch(P){return r?[a]:a}}function F(e,t,r){let[n,a]=H(e,t,!0),o=m.getLocationOrigin(),i=n.startsWith(o),l=a&&a.startsWith(o);n=k(n),a=a?k(a):a;let s=i?n:O.addBasePath(n),u=r?k(H(e,r)):a||n;return{url:s,as:l?u:O.addBasePath(u)}}function q(e,t){let r=s.removeTrailingSlash(f.denormalizePagePath(e));return"/404"===r||"/_error"===r?e:(t.includes(r)||t.some(t=>{if(g.isDynamicRoute(t)&&b.getRouteRegex(t).re.test(r))return e=t,!0}),s.removeTrailingSlash(e))}function W(e){return I(e).then(t=>t&&e.fetchData?e.fetchData().then(t=>(function(e,t,r){let n={basePath:r.router.basePath,i18n:{locales:r.router.locales},trailingSlash:Boolean(!0)},o=t.headers.get("x-nextjs-rewrite"),i=o||t.headers.get("x-nextjs-matched-path"),l=t.headers.get("x-matched-path");if(!l||i||l.includes("__next_data_catchall")||l.includes("/_error")||l.includes("/404")||(i=l),i){if(i.startsWith("/")){let c=y.parseRelativeUrl(i),d=j.getNextPathnameInfo(c.pathname,{nextConfig:n,parseData:!0}),f=s.removeTrailingSlash(d.pathname);return Promise.all([r.router.pageLoader.getPageList(),u.getClientBuildManifest()]).then(t=>{let[n,{__rewrites:a}]=t,i=x.addLocale(d.pathname,d.locale);if(g.isDynamicRoute(i)||!o&&n.includes(p.normalizeLocalePath(C.removeBasePath(i),r.router.locales).pathname)){let l=j.getNextPathnameInfo(y.parseRelativeUrl(e).pathname,{parseData:!0});i=O.addBasePath(l.pathname),c.pathname=i}{let s=_.default(i,n,a,c.query,e=>q(e,n),r.router.locales);s.matchedPage&&(c.pathname=s.parsedAs.pathname,i=c.pathname,Object.assign(c.query,s.parsedAs.query))}let u=n.includes(f)?f:q(p.normalizeLocalePath(C.removeBasePath(c.pathname),r.router.locales).pathname,n);if(g.isDynamicRoute(u)){let h=P.getRouteMatcher(b.getRouteRegex(u))(i);Object.assign(c.query,h||{})}return{type:"rewrite",parsedAs:c,resolvedHref:u}})}let h=S.parsePath(e),m=A.formatNextPathnameInfo(a({},j.getNextPathnameInfo(h.pathname,{nextConfig:n,parseData:!0}),{defaultLocale:r.router.defaultLocale,buildId:""}));return Promise.resolve({type:"redirect-external",destination:"".concat(m).concat(h.query).concat(h.hash)})}let v=t.headers.get("x-nextjs-redirect");if(v){if(v.startsWith("/")){let E=S.parsePath(v),w=A.formatNextPathnameInfo(a({},j.getNextPathnameInfo(E.pathname,{nextConfig:n,parseData:!0}),{defaultLocale:r.router.defaultLocale,buildId:""}));return Promise.resolve({type:"redirect-internal",newAs:"".concat(w).concat(E.query).concat(E.hash),newUrl:"".concat(w).concat(E.query).concat(E.hash)})}return Promise.resolve({type:"redirect-external",destination:v})}return Promise.resolve({type:"next"})})(t.dataHref,t.response,e).then(e=>({dataHref:t.dataHref,cacheKey:t.cacheKey,json:t.json,response:t.response,text:t.text,effect:e}))).catch(e=>null):null)}let Z=Symbol("SSG_DATA_NOT_FOUND");function z(e){let t=document.documentElement,r=t.style.scrollBehavior;t.style.scrollBehavior="auto",e(),t.style.scrollBehavior=r}function G(e){try{return JSON.parse(e)}catch(t){return null}}function V(e){var t;let{dataHref:r,inflightCache:n,isPrefetch:a,hasMiddleware:o,isServerRender:i,parseJSON:l,persistCache:s,isBackground:c,unstable_skipClientCache:d}=e,{href:f}=new URL(r,window.location.href),p=e=>(function e(t,r,n){return fetch(t,{credentials:"same-origin",method:n.method||"GET",headers:Object.assign({},n.headers,{"x-nextjs-data":"1"})}).then(a=>!a.ok&&r>1&&a.status>=500?e(t,r-1,n):a)})(r,i?3:1,{headers:Object.assign({},a?{purpose:"prefetch"}:{},a&&o?{"x-middleware-prefetch":"1"}:{}),method:null!=(t=null==e?void 0:e.method)?t:"GET"}).then(t=>t.ok&&(null==e?void 0:e.method)==="HEAD"?{dataHref:r,response:t,text:"",json:{},cacheKey:f}:t.text().then(e=>{if(!t.ok){if(o&&[301,302,307,308].includes(t.status))return{dataHref:r,response:t,text:e,json:{},cacheKey:f};if(!o&&404===t.status){var n;if(null==(n=G(e))?void 0:n.notFound)return{dataHref:r,json:{notFound:Z},response:t,text:e,cacheKey:f}}let a=Error("Failed to load static props");throw i||u.markAssetError(a),a}return{dataHref:r,json:l?G(e):null,response:t,text:e,cacheKey:f}})).then(e=>(s&&"no-cache"!==e.response.headers.get("x-middleware-cache")||delete n[f],e)).catch(e=>{throw d||delete n[f],"Failed to fetch"===e.message&&u.markAssetError(e),e});return d&&s?p({}).then(e=>(n[f]=Promise.resolve(e),e)):void 0!==n[f]?n[f]:n[f]=p(c?{method:"HEAD"}:{})}function $(){return Math.random().toString(36).slice(2,10)}function X(e){let{url:t,router:r}=e;if(t===O.addBasePath(x.addLocale(r.asPath,r.locale)))throw Error("Invariant: attempted to hard navigate to the same URL ".concat(t," ").concat(location.href));window.location.href=t}let Y=e=>{let{route:t,router:r}=e,n=!1,a=r.clc=()=>{n=!0},o=()=>{if(n){let e=Error('Abort fetching component for route: "'.concat(t,'"'));throw e.cancelled=!0,e}a===r.clc&&(r.clc=null)};return o};class K{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{url:e,as:t}=F(this,e,t),this.change("pushState",e,t,r)}replace(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{url:e,as:t}=F(this,e,t),this.change("replaceState",e,t,r)}change(e,t,r,o,i){var l=this;return n(function*(){let n,f;if(!B(t))return X({url:t,router:l}),!1;let p=o._h,h=p||o._shouldResolveHref||S.parsePath(t).pathname===S.parsePath(r).pathname,v=a({},l.state),j=!0!==l.isReady;l.isReady=!0;let A=l.isSsr;if(p||(l.isSsr=!1),p&&l.clc)return!1;let L=v.locale;m.ST&&performance.mark("routeChange");let{shallow:N=!1,scroll:k=!0}=o,H={shallow:N};l._inFlightRoute&&l.clc&&(A||K.events.emit("routeChangeError",T(),l._inFlightRoute,H),l.clc(),l.clc=null),r=O.addBasePath(x.addLocale(R.hasBasePath(r)?C.removeBasePath(r):r,o.locale,l.defaultLocale));let W=w.removeLocale(R.hasBasePath(r)?C.removeBasePath(r):r,v.locale);l._inFlightRoute=r;let z=L!==v.locale;if(!p&&l.onlyAHashChange(W)&&!z){v.asPath=W,K.events.emit("hashChangeStart",r,H),l.changeState(e,t,r,a({},o,{scroll:!1})),k&&l.scrollToHash(W);try{yield l.set(v,l.components[v.route],null)}catch(G){throw d.default(G)&&G.cancelled&&K.events.emit("routeChangeError",G,W,H),G}return K.events.emit("hashChangeComplete",r,H),!0}let V=y.parseRelativeUrl(t),{pathname:$,query:Y}=V;try{[n,{__rewrites:f}]=yield Promise.all([l.pageLoader.getPageList(),u.getClientBuildManifest(),l.pageLoader.getMiddleware()])}catch(Q){return X({url:r,router:l}),!1}l.urlIsNew(W)||z||(e="replaceState");let J=r;$=$?s.removeTrailingSlash(C.removeBasePath($)):$;let ee=s.removeTrailingSlash($),et=r.startsWith("/")&&y.parseRelativeUrl(r).pathname,er=!!(et&&ee!==et&&(!g.isDynamicRoute(ee)||!P.getRouteMatcher(b.getRouteRegex(ee))(et))),en=yield I({asPath:r,locale:v.locale,router:l});if(o.shallow&&en&&($=l.pathname),p&&en&&(h=!1),h&&"/_error"!==$){if(o._shouldResolveHref=!0,r.startsWith("/")){let ea=_.default(O.addBasePath(x.addLocale(W,v.locale),!0),n,f,Y,e=>q(e,n),l.locales);if(ea.externalDest)return X({url:r,router:l}),!0;en||(J=ea.asPath),ea.matchedPage&&ea.resolvedHref&&($=ea.resolvedHref,V.pathname=O.addBasePath($),en||(t=E.formatWithValidation(V)))}else V.pathname=q($,n),V.pathname===$||($=V.pathname,V.pathname=O.addBasePath($),en||(t=E.formatWithValidation(V)))}if(!B(r))return X({url:r,router:l}),!1;J=w.removeLocale(C.removeBasePath(J),v.locale),ee=s.removeTrailingSlash($);let eo=!1;if(g.isDynamicRoute(ee)){let ei=y.parseRelativeUrl(J),el=ei.pathname,es=b.getRouteRegex(ee);eo=P.getRouteMatcher(es)(el);let eu=ee===el,ec=eu?U(ee,el,Y):{};if(eo&&(!eu||ec.result))eu?r=E.formatWithValidation(Object.assign({},ei,{pathname:ec.result,query:D(Y,ec.params)})):Object.assign(Y,eo);else{let ed=Object.keys(es.groups).filter(e=>!Y[e]&&!es.groups[e].optional);if(ed.length>0&&!en)throw Error((eu?"The provided `href` (".concat(t,") value is missing query values (").concat(ed.join(", "),") to be interpolated properly. "):"The provided `as` value (".concat(el,") is incompatible with the `href` value (").concat(ee,"). "))+"Read more: https://nextjs.org/docs/messages/".concat(eu?"href-interpolation-failed":"incompatible-href-as"))}}p||K.events.emit("routeChangeStart",r,H);try{var ef,ep,eh,em;let eg=yield l.getRouteInfo({route:ee,pathname:$,query:Y,as:r,resolvedAs:J,routeProps:H,locale:v.locale,isPreview:v.isPreview,hasMiddleware:en,unstable_skipClientCache:o.unstable_skipClientCache,isQueryUpdating:p&&!l.isFallback,isMiddlewareRewrite:er});if("route"in eg&&en){ee=$=eg.route||ee,H.shallow||(Y=Object.assign({},eg.query||{},Y));let ey=R.hasBasePath(V.pathname)?C.removeBasePath(V.pathname):V.pathname;if(eo&&$!==ey&&Object.keys(eo).forEach(e=>{eo&&Y[e]===eo[e]&&delete Y[e]}),g.isDynamicRoute($)){let ev=!H.shallow&&eg.resolvedAs?eg.resolvedAs:O.addBasePath(x.addLocale(new URL(r,location.href).pathname,v.locale),!0),e_=ev;R.hasBasePath(e_)&&(e_=C.removeBasePath(e_));let eP=b.getRouteRegex($),eb=P.getRouteMatcher(eP)(new URL(e_,location.href).pathname);eb&&Object.assign(Y,eb)}}if("type"in eg){if("redirect-internal"===eg.type)return l.change(e,eg.newUrl,eg.newAs,o);return X({url:eg.destination,router:l}),new Promise(()=>{})}let{error:eE,props:eS,__N_SSG:ex,__N_SSP:ew}=eg,eC=eg.Component;if(eC&&eC.unstable_scriptLoader){let eO=[].concat(eC.unstable_scriptLoader());eO.forEach(e=>{c.handleClientScriptLoad(e.props)})}if((ex||ew)&&eS){if(eS.pageProps&&eS.pageProps.__N_REDIRECT){o.locale=!1;let eR=eS.pageProps.__N_REDIRECT;if(eR.startsWith("/")&&!1!==eS.pageProps.__N_REDIRECT_BASE_PATH){let ej=y.parseRelativeUrl(eR);ej.pathname=q(ej.pathname,n);let{url:eA,as:eM}=F(l,eR,eR);return l.change(e,eA,eM,o)}return X({url:eR,router:l}),new Promise(()=>{})}if(v.isPreview=!!eS.__N_PREVIEW,eS.notFound===Z){let eL;try{yield l.fetchComponent("/404"),eL="/404"}catch(eT){eL="/_error"}if(eg=yield l.getRouteInfo({route:eL,pathname:eL,query:Y,as:r,resolvedAs:J,routeProps:{shallow:!1},locale:v.locale,isPreview:v.isPreview}),"type"in eg)throw Error("Unexpected middleware effect on /404")}}K.events.emit("beforeHistoryChange",r,H),l.changeState(e,t,r,o),p&&"/_error"===$&&(null==(ef=self.__NEXT_DATA__.props)?void 0:null==(ep=ef.pageProps)?void 0:ep.statusCode)===500&&(null==eS?void 0:eS.pageProps)&&(eS.pageProps.statusCode=500);let eI=o.shallow&&v.route===(null!=(eh=eg.route)?eh:ee),eN=null!=(em=o.scroll)?em:!o._h&&!eI,ek=a({},v,{route:ee,pathname:$,query:Y,asPath:W,isFallback:!1}),eD=null!=i?i:eN?{x:0,y:0}:null,eB=o._h&&!eD&&!j&&!z&&M.compareRouterStates(ek,l.state);if(!eB){if(yield l.set(ek,eg,eD).catch(e=>{if(e.cancelled)eE=eE||e;else throw e}),eE)throw p||K.events.emit("routeChangeError",eE,W,H),eE;p||K.events.emit("routeChangeComplete",r,H),eN&&/#.+$/.test(r)&&l.scrollToHash(r)}return!0}catch(eU){if(d.default(eU)&&eU.cancelled)return!1;throw eU}})()}changeState(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};("pushState"!==e||m.getURL()!==r)&&(this._shallow=n.shallow,window.history[e]({url:t,as:r,options:n,__N:!0,key:this._key="pushState"!==e?this._key:$()},"",r))}handleRouteInfoError(e,t,r,a,o,i){var l=this;return n(function*(){if(console.error(e),e.cancelled)throw e;if(u.isAssetError(e)||i)throw K.events.emit("routeChangeError",e,a,o),X({url:a,router:l}),T();try{let n;let{page:s,styleSheets:c}=yield l.fetchComponent("/_error"),f={props:n,Component:s,styleSheets:c,err:e,error:e};if(!f.props)try{f.props=yield l.getInitialProps(s,{err:e,pathname:t,query:r})}catch(p){console.error("Error in error page `getInitialProps`: ",p),f.props={}}return f}catch(h){return l.handleRouteInfoError(d.default(h)?h:Error(h+""),t,r,a,o,!0)}})()}getRouteInfo(e){let{route:t,pathname:r,query:o,as:i,resolvedAs:l,routeProps:u,locale:c,hasMiddleware:f,isPreview:h,unstable_skipClientCache:m,isQueryUpdating:g,isMiddlewareRewrite:y}=e;var v=this;return n(function*(){let e=t;try{var _,P,b,S;let x=Y({route:e,router:v}),w=v.components[e];if(u.shallow&&w&&v.route===e)return w;f&&(w=void 0);let O=!w||"initial"in w?void 0:w,R={dataHref:v.pageLoader.getDataHref({href:E.formatWithValidation({pathname:r,query:o}),skipInterpolation:!0,asPath:l,locale:c}),hasMiddleware:!0,isServerRender:v.isSsr,parseJSON:!0,inflightCache:g?v.sbc:v.sdc,persistCache:!h,isPrefetch:!1,unstable_skipClientCache:m,isBackground:g},j=g&&!y?{}:yield W({fetchData:()=>V(R),asPath:l,locale:c,router:v}).catch(e=>{if(g)return{};throw e});if(g&&(j.json=self.__NEXT_DATA__.props),x(),(null==j?void 0:null==(_=j.effect)?void 0:_.type)==="redirect-internal"||(null==j?void 0:null==(P=j.effect)?void 0:P.type)==="redirect-external")return j.effect;if((null==j?void 0:null==(b=j.effect)?void 0:b.type)==="rewrite"){let A=s.removeTrailingSlash(j.effect.resolvedHref),M=yield v.pageLoader.getPageList();if((!g||M.includes(A))&&(e=A,r=j.effect.resolvedHref,o=a({},o,j.effect.parsedAs.query),l=C.removeBasePath(p.normalizeLocalePath(j.effect.parsedAs.pathname,v.locales).pathname),w=v.components[e],u.shallow&&w&&v.route===e&&!f))return a({},w,{route:e})}if("/api"===e||e.startsWith("/api/"))return X({url:i,router:v}),new Promise(()=>{});let L=O||(yield v.fetchComponent(e).then(e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP}))),T=null==j?void 0:null==(S=j.response)?void 0:S.headers.get("x-middleware-skip"),I=L.__N_SSG||L.__N_SSP;T&&delete v.sdc[null==j?void 0:j.dataHref];let{props:N,cacheKey:k}=yield v._getData(n(function*(){if(I){let{json:e,cacheKey:t}=(null==j?void 0:j.json)&&!T?j:yield V({dataHref:(null==j?void 0:j.json)?null==j?void 0:j.dataHref:v.pageLoader.getDataHref({href:E.formatWithValidation({pathname:r,query:o}),asPath:l,locale:c}),isServerRender:v.isSsr,parseJSON:!0,inflightCache:T?{}:v.sdc,persistCache:!h,isPrefetch:!1,unstable_skipClientCache:m});return{cacheKey:t,props:e||{}}}return{headers:{},cacheKey:"",props:yield v.getInitialProps(L.Component,{pathname:r,query:o,asPath:i,locale:c,locales:v.locales,defaultLocale:v.defaultLocale})}}));return L.__N_SSP&&R.dataHref&&delete v.sdc[k],v.isPreview||!L.__N_SSG||g||V(Object.assign({},R,{isBackground:!0,persistCache:!1,inflightCache:v.sbc})).catch(()=>{}),N.pageProps=Object.assign({},N.pageProps),L.props=N,L.route=e,L.query=o,L.resolvedAs=l,v.components[e]=L,L}catch(D){return v.handleRouteInfoError(d.getProperError(D),r,o,i,u)}})()}set(e,t,r){return this.state=e,this.sub(t,this.components["/_app"].Component,r)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;let[t,r]=this.asPath.split("#"),[n,a]=e.split("#");return!!a&&t===n&&r===a||t===n&&r!==a}scrollToHash(e){let[,t=""]=e.split("#");if(""===t||"top"===t){z(()=>window.scrollTo(0,0));return}let r=decodeURIComponent(t),n=document.getElementById(r);if(n){z(()=>n.scrollIntoView());return}let a=document.getElementsByName(r)[0];a&&z(()=>a.scrollIntoView())}urlIsNew(e){return this.asPath!==e}prefetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=this;return n(function*(){if(L.isBot(window.navigator.userAgent))return;let n=y.parseRelativeUrl(e),{pathname:i,query:l}=n,c=i,d=yield o.pageLoader.getPageList(),f=t,p=void 0!==r.locale?r.locale||void 0:o.locale,h=yield I({asPath:t,locale:p,router:o});if(t.startsWith("/")){let m;({__rewrites:m}=yield u.getClientBuildManifest());let v=_.default(O.addBasePath(x.addLocale(t,o.locale),!0),d,m,n.query,e=>q(e,d),o.locales);if(v.externalDest)return;h||(f=w.removeLocale(C.removeBasePath(v.asPath),o.locale)),v.matchedPage&&v.resolvedHref&&(i=v.resolvedHref,n.pathname=i,h||(e=E.formatWithValidation(n)))}n.pathname=q(n.pathname,d),g.isDynamicRoute(n.pathname)&&(i=n.pathname,n.pathname=i,Object.assign(l,P.getRouteMatcher(b.getRouteRegex(n.pathname))(S.parsePath(t).pathname)||{}),h||(e=E.formatWithValidation(n)));let R=yield W({fetchData:()=>V({dataHref:o.pageLoader.getDataHref({href:E.formatWithValidation({pathname:c,query:l}),skipInterpolation:!0,asPath:f,locale:p}),hasMiddleware:!0,isServerRender:o.isSsr,parseJSON:!0,inflightCache:o.sdc,persistCache:!o.isPreview,isPrefetch:!0}),asPath:t,locale:p,router:o});if((null==R?void 0:R.effect.type)==="rewrite"&&(n.pathname=R.effect.resolvedHref,i=R.effect.resolvedHref,l=a({},l,R.effect.parsedAs.query),f=R.effect.parsedAs.pathname,e=E.formatWithValidation(n)),(null==R?void 0:R.effect.type)==="redirect-external")return;let j=s.removeTrailingSlash(i);yield Promise.all([o.pageLoader._isSsg(j).then(t=>!!t&&V({dataHref:(null==R?void 0:R.json)?null==R?void 0:R.dataHref:o.pageLoader.getDataHref({href:e,asPath:f,locale:p}),isServerRender:!1,parseJSON:!0,inflightCache:o.sdc,persistCache:!o.isPreview,isPrefetch:!0,unstable_skipClientCache:r.unstable_skipClientCache||r.priority&&!0}).then(()=>!1)),o.pageLoader[r.priority?"loadPage":"prefetch"](j)])})()}fetchComponent(e){var t=this;return n(function*(){let r=Y({route:e,router:t});try{let n=yield t.pageLoader.loadPage(e);return r(),n}catch(a){throw r(),a}})()}_getData(e){let t=!1,r=()=>{t=!0};return this.clc=r,e().then(e=>{if(r===this.clc&&(this.clc=null),t){let n=Error("Loading initial props cancelled");throw n.cancelled=!0,n}return e})}_getFlightData(e){return V({dataHref:e,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(e=>{let{text:t}=e;return{data:t}})}getInitialProps(e,t){let{Component:r}=this.components["/_app"],n=this._wrapApp(r);return t.AppTree=n,m.loadGetInitialProps(r,{AppTree:n,Component:e,router:this,ctx:t})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(e,t,r,{initialProps:n,pageLoader:a,App:o,wrapApp:i,Component:l,err:u,subscription:c,isFallback:d,locale:f,locales:p,defaultLocale:h,domainLocales:v,isPreview:_}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=$(),this.onPopState=e=>{let t;let{isFirstPopStateEvent:r}=this;this.isFirstPopStateEvent=!1;let n=e.state;if(!n){let{pathname:a,query:o}=this;this.changeState("replaceState",E.formatWithValidation({pathname:O.addBasePath(a),query:o}),m.getURL());return}if(n.__NA){window.location.reload();return}if(!n.__N||r&&this.locale===n.options.locale&&n.as===this.asPath)return;let{url:i,as:l,options:s,key:u}=n;this._key=u;let{pathname:c}=y.parseRelativeUrl(i);(!this.isSsr||l!==O.addBasePath(this.asPath)||c!==O.addBasePath(this.pathname))&&(!this._bps||this._bps(n))&&this.change("replaceState",i,l,Object.assign({},s,{shallow:s.shallow&&this._shallow,locale:s.locale||this.defaultLocale,_h:0}),t)};let P=s.removeTrailingSlash(e);this.components={},"/_error"!==e&&(this.components[P]={Component:l,initial:!0,props:n,err:u,__N_SSG:n&&n.__N_SSG,__N_SSP:n&&n.__N_SSP}),this.components["/_app"]={Component:o,styleSheets:[]},this.events=K.events,this.pageLoader=a;let b=g.isDynamicRoute(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath="",this.sub=c,this.clc=null,this._wrapApp=i,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||(b||self.location.search,0)),this.state={route:P,pathname:e,query:t,asPath:b?e:r,isPreview:!!_,locale:void 0,isFallback:d},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),!r.startsWith("//")){let S={locale:f},x=m.getURL();this._initialMatchesMiddlewarePromise=I({router:this,locale:f,asPath:x}).then(n=>(S._shouldResolveHref=r!==e,this.changeState("replaceState",n?x:E.formatWithValidation({pathname:O.addBasePath(e),query:t}),x,S),n))}window.addEventListener("popstate",this.onPopState)}}K.events=h.default(),t.default=K},34441:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLocale=function(e,t,r,o){return t&&t!==r&&(o||!a.pathHasPrefix(e.toLowerCase(),"/".concat(t.toLowerCase()))&&!a.pathHasPrefix(e.toLowerCase(),"/api"))?n.addPathPrefix(e,"/".concat(t)):e};var n=r(44135),a=r(93210)},44135:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPathPrefix=function(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:a,hash:o}=n.parsePath(e);return"".concat(t).concat(r).concat(a).concat(o)};var n=r(26727)},96074:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPathSuffix=function(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:a,hash:o}=n.parsePath(e);return"".concat(r).concat(t).concat(a).concat(o)};var n=r(26727)},79002:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareRouterStates=function(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=r.length;n--;){let a=r[n];if("query"===a){let o=Object.keys(e.query);if(o.length!==Object.keys(t.query).length)return!1;for(let i=o.length;i--;){let l=o[i];if(!t.query.hasOwnProperty(l)||e.query[l]!==t.query[l])return!1}}else if(!t.hasOwnProperty(a)||e[a]!==t[a])return!1}return!0}},57429:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatNextPathnameInfo=function(e){let t=i.addLocale(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=n.removeTrailingSlash(t)),e.buildId&&(t=o.addPathSuffix(a.addPathPrefix(t,"/_next/data/".concat(e.buildId)),"/"===e.pathname?"index.json":".json")),t=a.addPathPrefix(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:o.addPathSuffix(t,"/"):n.removeTrailingSlash(t)};var n=r(40012),a=r(44135),o=r(96074),i=r(34441)},67795:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatUrl=o,t.formatWithValidation=function(e){return o(e)},t.urlObjectKeys=void 0;var n=(0,r(91598).Z)(r(94919));let a=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,o=e.protocol||"",i=e.pathname||"",l=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?"[".concat(r,"]"):r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(n.urlQueryToSearchParams(s)));let c=e.search||s&&"?".concat(s)||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||a.test(o))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),"".concat(o).concat(u).concat(i).concat(c).concat(l)}t.urlObjectKeys=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"]},27929:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="/"===e?"/index":/^\/index(\/|$)/.test(e)?"/index".concat(e):"".concat(e);return r+t}},18756:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNextPathnameInfo=function(e,t){var r;let{basePath:i,i18n:l,trailingSlash:s}=null!=(r=t.nextConfig)?r:{},u={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};if(i&&o.pathHasPrefix(u.pathname,i)&&(u.pathname=a.removePathPrefix(u.pathname,i),u.basePath=i),!0===t.parseData&&u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){let c=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),d=c[0];u.pathname="index"!==c[1]?"/".concat(c.slice(1).join("/")):"/",u.buildId=d}if(l){let f=n.normalizeLocalePath(u.pathname,l.locales);u.locale=null==f?void 0:f.detectedLocale,u.pathname=(null==f?void 0:f.pathname)||u.pathname}return u};var n=r(24769),a=r(22650),o=r(93210)},18588:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n.getSortedRoutes}}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return a.isDynamicRoute}});var n=r(30566),a=r(86238)},21754:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBot=function(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}},86238:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicRoute=function(e){return r.test(e)};let r=/\/\[[^/]+?\](?=\/|$)/},26727:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePath=function(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}},22864:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRelativeUrl=function(e,t){let r=new URL(n.getLocationOrigin()),o=t?new URL(t,r):e.startsWith(".")?new URL(window.location.href):r,{pathname:i,searchParams:l,search:s,hash:u,href:c,origin:d}=new URL(e,o);if(d!==r.origin)throw Error("invariant: invalid relative URL, router received ".concat(e));return{pathname:i,query:a.searchParamsToUrlQuery(l),search:s,hash:u,href:c.slice(r.origin.length)}};var n=r(670),a=r(94919)},97253:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUrl=function(e){if(e.startsWith("/"))return a.parseRelativeUrl(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:n.searchParamsToUrlQuery(t.searchParams),search:t.search}};var n=r(94919),a=r(22864)},93210:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathHasPrefix=function(e,t){if("string"!=typeof e)return!1;let{pathname:r}=n.parsePath(e);return r===t||r.startsWith(t+"/")};var n=r(26727)},77127:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMatch=function(e,t){let r=[],o=a.pathToRegexp(e,r,{delimiter:"/",sensitive:!1,strict:null==t?void 0:t.strict}),i=a.regexpToFunction((null==t?void 0:t.regexModifier)?RegExp(t.regexModifier(o.source),o.flags):o,r);return(e,a)=>{let o=null!=e&&i(e);if(!o)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let l of r)"number"==typeof l.name&&delete o.params[l.name];return n({},a,o.params)}};var n=r(6495).Z,a=r(74329)},67327:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchHas=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a={},o=r=>{let n;let o=r.key;switch(r.type){case"header":o=o.toLowerCase(),n=e.headers[o];break;case"cookie":n=e.cookies[r.key];break;case"query":n=t[o];break;case"host":{let{host:i}=(null==e?void 0:e.headers)||{},l=null==i?void 0:i.split(":")[0].toLowerCase();n=l}}if(!r.value&&n)return a[function(e){let t="";for(let r=0;r64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(o)]=n,!0;if(n){let s=RegExp("^".concat(r.value,"$")),u=Array.isArray(n)?n.slice(-1)[0].match(s):n.match(s);if(u)return Array.isArray(u)&&(u.groups?Object.keys(u.groups).forEach(e=>{a[e]=u.groups[e]}):"host"===r.type&&u[0]&&(a.host=u[0])),!0}return!1},i=r.every(e=>o(e))&&!n.some(e=>o(e));return!!i&&a},t.compileNonPath=s,t.prepareDestination=function(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq;let u=e.destination;for(let c of Object.keys(n({},e.params,r))){var d,f;d=u,f=c,u=d.replace(RegExp(":".concat(o.escapeStringRegexp(f)),"g"),"__ESC_COLON_".concat(f))}let p=i.parseUrl(u),h=p.query,m=l("".concat(p.pathname).concat(p.hash||"")),g=l(p.hostname||""),y=[],v=[];a.pathToRegexp(m,y),a.pathToRegexp(g,v);let _=[];y.forEach(e=>_.push(e.name)),v.forEach(e=>_.push(e.name));let P=a.compile(m,{validate:!1}),b=a.compile(g,{validate:!1});for(let[E,S]of Object.entries(h))Array.isArray(S)?h[E]=S.map(t=>s(l(t),e.params)):"string"==typeof S&&(h[E]=s(l(S),e.params));let x=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!x.some(e=>_.includes(e)))for(let w of x)w in h||(h[w]=e.params[w]);try{t=P(e.params);let[C,O]=t.split("#");p.hostname=b(e.params),p.pathname=C,p.hash="".concat(O?"#":"").concat(O||""),delete p.search}catch(R){if(R.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw R}return p.query=n({},r,p.query),{newUrl:t,destQuery:h,parsedDestination:p}};var n=r(6495).Z,a=r(74329),o=r(18659),i=r(97253);function l(e){return e.replace(/__ESC_COLON_/gi,":")}function s(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":".concat(r))&&(e=e.replace(RegExp(":".concat(r,"\\*"),"g"),":".concat(r,"--ESCAPED_PARAM_ASTERISKS")).replace(RegExp(":".concat(r,"\\?"),"g"),":".concat(r,"--ESCAPED_PARAM_QUESTION")).replace(RegExp(":".concat(r,"\\+"),"g"),":".concat(r,"--ESCAPED_PARAM_PLUS")).replace(RegExp(":".concat(r,"(?!\\w)"),"g"),"--ESCAPED_PARAM_COLON".concat(r)));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),a.compile("/".concat(e),{validate:!1})(t).slice(1)}},94919:function(e,t){"use strict";function r(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.searchParamsToUrlQuery=function(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t},t.urlQueryToSearchParams=function(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[n,a]=e;Array.isArray(a)?a.forEach(e=>t.append(n,r(e))):t.set(n,r(a))}),t},t.assign=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}},22650:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePathPrefix=function(e,t){if(n.pathHasPrefix(e,t)){let r=e.slice(t.length);return r.startsWith("/")?r:"/".concat(r)}return e};var n=r(93210)},40012:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=function(e){return e.replace(/\/$/,"")||"/"}},27980:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,u,c,d){let f,p=!1,h=!1,m=s.parseRelativeUrl(e),g=o.removeTrailingSlash(i.normalizeLocalePath(l.removeBasePath(m.pathname),d).pathname),y=r=>{let s=n.getPathMatch(r.source+"(/)?",{removeUnnamedParams:!0,strict:!0}),y=s(m.pathname);if((r.has||r.missing)&&y){let v=a.matchHas({headers:{host:document.location.hostname},cookies:document.cookie.split("; ").reduce((e,t)=>{let[r,...n]=t.split("=");return e[r]=n.join("="),e},{})},m.query,r.has,r.missing);v?Object.assign(y,v):y=!1}if(y){if(!r.destination)return h=!0,!0;let _=a.prepareDestination({appendParamsToQuery:!0,destination:r.destination,params:y,query:u});if(m=_.parsedDestination,e=_.newUrl,Object.assign(u,_.parsedDestination.query),g=o.removeTrailingSlash(i.normalizeLocalePath(l.removeBasePath(e),d).pathname),t.includes(g))return p=!0,f=g,!0;if((f=c(g))!==e&&t.includes(f))return p=!0,!0}},v=!1;for(let _=0;_{let a=t.exec(e);if(!a)return!1;let o=e=>{try{return decodeURIComponent(e)}catch(t){throw new n.DecodeError("failed to decode param")}},i={};return Object.keys(r).forEach(e=>{let t=r[e],n=a[t.pos];void 0!==n&&(i[e]=~n.indexOf("/")?n.split("/").map(e=>o(e)):t.repeat?[o(n)]:o(n))}),i}};var n=r(670)},54903:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRouteRegex=s,t.getNamedRouteRegex=function(e){let t=u(e);return n({},s(e),{namedRegex:"^".concat(t.namedParameterizedRoute,"(?:/)?$"),routeKeys:t.routeKeys})},t.getNamedMiddlewareRegex=function(e,t){let{parameterizedRoute:r}=l(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/".concat(n?".*":"","$")};let{namedParameterizedRoute:a}=u(e);return{namedRegex:"^".concat(a).concat(n?"(?:(/.*)?)":"","$")}};var n=r(6495).Z,a=r(18659),o=r(40012);function i(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function l(e){let t=o.removeTrailingSlash(e).slice(1).split("/"),r={},n=1;return{parameterizedRoute:t.map(e=>{if(!(e.startsWith("[")&&e.endsWith("]")))return"/".concat(a.escapeStringRegexp(e));{let{key:t,optional:o,repeat:l}=i(e.slice(1,-1));return r[t]={pos:n++,repeat:l,optional:o},l?o?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function s(e){let{parameterizedRoute:t,groups:r}=l(e);return{re:RegExp("^".concat(t,"(?:/)?$")),groups:r}}function u(e){let t,r;let n=o.removeTrailingSlash(e).slice(1).split("/"),l=(t=97,r=1,()=>{let e="";for(let n=0;n122&&(r++,t=97);return e}),s={};return{namedParameterizedRoute:n.map(e=>{if(!(e.startsWith("[")&&e.endsWith("]")))return"/".concat(a.escapeStringRegexp(e));{let{key:t,optional:r,repeat:n}=i(e.slice(1,-1)),o=t.replace(/\W/g,""),u=!1;return(0===o.length||o.length>30)&&(u=!0),isNaN(parseInt(o.slice(0,1)))||(u=!0),u&&(o=l()),s[o]=t,n?r?"(?:/(?<".concat(o,">.+?))?"):"/(?<".concat(o,">.+?)"):"/(?<".concat(o,">[^/]+?)")}}).join(""),routeKeys:s}}},30566:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSortedRoutes=function(e){let t=new r;return e.forEach(e=>t.insert(e)),t.smoosh()};class r{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh("".concat(e).concat(t,"/"))).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh("".concat(e,"[").concat(this.slugName,"]/"))),!this.placeholder){let n="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'.concat(n,'" and "').concat(n,"[[...").concat(this.optionalRestSlugName,']]").'));r.unshift(n)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh("".concat(e,"[...").concat(this.restSlugName,"]/"))),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh("".concat(e,"[[...").concat(this.optionalRestSlugName,"]]/"))),r}_insert(e,t,n){if(0===e.length){this.placeholder=!1;return}if(n)throw Error("Catch-all must be the last part of the URL.");let a=e[0];if(a.startsWith("[")&&a.endsWith("]")){let o=a.slice(1,-1),i=!1;if(o.startsWith("[")&&o.endsWith("]")&&(o=o.slice(1,-1),i=!0),o.startsWith("...")&&(o=o.substring(3),n=!0),o.startsWith("[")||o.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('".concat(o,"')."));if(o.startsWith("."))throw Error("Segment names may not start with erroneous periods ('".concat(o,"')."));function l(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('".concat(e,"' !== '").concat(r,"')."));t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'.concat(r,'" repeat within a single dynamic path'));if(e.replace(/\W/g,"")===a.replace(/\W/g,""))throw Error('You cannot have the slug names "'.concat(e,'" and "').concat(r,'" differ only by non-word symbols within a single dynamic path'))}),t.push(r)}if(n){if(i){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'.concat(this.restSlugName,']" and "').concat(e[0],'" ).'));l(this.optionalRestSlugName,o),this.optionalRestSlugName=o,a="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'.concat(this.optionalRestSlugName,']]" and "').concat(e[0],'").'));l(this.restSlugName,o),this.restSlugName=o,a="[...]"}}else{if(i)throw Error('Optional route parameters are not yet supported ("'.concat(e[0],'").'));l(this.slugName,o),this.slugName=o,a="[]"}}this.children.has(a)||this.children.set(a,new r),this.children.get(a)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}},86949:function(e,t){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.setConfig=function(e){r=e},t.default=void 0,t.default=()=>r,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},31436:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let a=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(a,e))}}if(a){var s;null==t||null==(s=t.mountedInstances)||s.add(e.children),l()}return o(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null};var n=(0,r(91598).Z)(r(67294));let a=!1,o=a?()=>{}:n.useLayoutEffect,i=a?()=>{}:n.useEffect},670:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execOnce=function(e){let t,r=!1;return function(){for(var n=arguments.length,a=Array(n),o=0;oa.test(e);function i(){let{protocol:e,hostname:t,port:r}=window.location;return"".concat(e,"//").concat(t).concat(r?":"+r:"")}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function u(e,t){return c.apply(this,arguments)}function c(){return(c=n(function*(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:yield u(t.Component,t.ctx)}:{};let n=yield e.getInitialProps(t);if(r&&s(r))return n;if(!n){let a='"'.concat(l(e),'.getInitialProps()" should resolve to an object. But found "').concat(n,'" instead.');throw Error(a)}return n})).apply(this,arguments)}t.isAbsoluteUrl=o;let d="undefined"!=typeof performance;t.SP=d;let f=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);t.ST=f,t.DecodeError=class extends Error{},t.NormalizeError=class extends Error{},t.PageNotFoundError=class extends Error{constructor(e){super(),this.code="ENOENT",this.message="Cannot find module for page: ".concat(e)}},t.MissingStaticPage=class extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: ".concat(e," ").concat(t)}},t.MiddlewareNotFoundError=class extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}},57238:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warnOnce=void 0;let r=e=>{};t.warnOnce=r},74329:function(e,t){"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||95===i){a+=e[o++];continue}break}if(!a)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=o;continue}if("("===n){var l=1,s="",o=r+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o-1:void 0===_;a||(p+="(?:"+f+"(?="+d+"))?"),P||(p+="(?="+f+"|"+d+")")}return RegExp(p,i(r))}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n=0?n="back-forward-cache":r&&(n=document.prerendering||d()>0?"prerender":r.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},p=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(e){t(e.getEntries())});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(a){}},h=function(e,t){var r=function r(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},m=function(e,t,r,n){var a,o;return function(i){var l;t.value>=0&&(i||n)&&((o=t.value-(a||0))||void 0===a)&&(a=t.value,t.delta=o,t.rating=(l=t.value)>r[1]?"poor":l>r[0]?"needs-improvement":"good",e(t))}},g=-1,y=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},v=function(){h(function(e){g=e.timeStamp},!0)},_=function(){return g<0&&(g=y(),v(),u(function(){setTimeout(function(){g=y(),v()},0)})),{get firstHiddenTime(){return g}}},P=function(e,t){t=t||{};var r,n=[1800,3e3],a=_(),o=f("FCP"),i=function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(s&&s.disconnect(),e.startTime-1&&e(t)},o=f("CLS",0),i=0,l=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=l[0],r=l[l.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,l.push(e)):(i=e.value,l=[e]),i>o.value&&(o.value=i,o.entries=l,n())}})},c=p("layout-shift",s);c&&(n=m(a,o,r,t.reportAllChanges),h(function(){s(c.takeRecords()),n(!0)}),u(function(){i=0,E=-1,n=m(a,o=f("CLS",0),r,t.reportAllChanges)}))},x={passive:!0,capture:!0},w=new Date,C=function(e,t){n||(n=t,a=e,o=new Date,j(removeEventListener),O())},O=function(){if(a>=0&&a1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?(t=function(){C(a,e),n()},r=function(){n()},n=function(){removeEventListener("pointerup",t,x),removeEventListener("pointercancel",r,x)},addEventListener("pointerup",t,x),addEventListener("pointercancel",r,x)):C(a,e)}},j=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,R,x)})},A=function(e,t){t=t||{};var r,o=[100,300],l=_(),s=f("FID"),c=function(e){e.startTimet.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};H[n.id]=n,U.push(n)}U.sort(function(e,t){return t.latency-e.latency}),U.splice(10).forEach(function(e){delete H[e.id]})}},q=function(e,t){t=t||{};var r=[200,500];k();var n,a=f("INP"),o=function(e){e.forEach(function(e){e.interactionId&&F(e),"first-input"!==e.entryType||U.some(function(t){return t.entries.some(function(t){return e.duration===t.duration&&e.startTime===t.startTime})})||F(e)});var t=U[Math.min(U.length-1,Math.floor(B()/50))];t&&t.latency!==a.value&&(a.value=t.latency,a.entries=t.entries,n())},i=p("event",o,{durationThreshold:t.durationThreshold||40});n=m(e,a,r,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),h(function(){o(i.takeRecords()),a.value<0&&B()>0&&(a.value=0,a.entries=[]),n(!0)}),u(function(){U=[],D=N(),n=m(e,a=f("INP"),r,t.reportAllChanges)}))},W={},Z=function(e,t){t=t||{};var r,n=[2500,4e3],a=_(),o=f("LCP"),i=function(e){var t=e[e.length-1];if(t){var n=t.startTime-d();nperformance.now())return;n.entries=[o],a(!0),u(function(){(a=m(e,n=f("TTFB",0),r,t.reportAllChanges))(!0)})}})},e.exports=r},80676:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.getProperError=function(e){return a(e)?e:Error(n.isPlainObject(e)?JSON.stringify(e):e+"")};var n=r(82849);function a(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}}},function(e){e.O(0,[9774],function(){return e(e.s=21783)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/stream-health-6ff3e3e38deacd0c.js b/static/web/_next/static/chunks/pages/admin/stream-health-6467dc61a002b06b.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin/stream-health-6ff3e3e38deacd0c.js rename to static/web/_next/static/chunks/pages/admin/stream-health-6467dc61a002b06b.js index b1e7b2f43..202504748 100644 --- a/static/web/_next/static/chunks/pages/admin/stream-health-6ff3e3e38deacd0c.js +++ b/static/web/_next/static/chunks/pages/admin/stream-health-6467dc61a002b06b.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2885],{16791:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/stream-health",function(){return a(17253)}])},94185:function(e,t,a){"use strict";a.d(t,{k:function(){return c}});var i=a(85893),r=a(9085),n=a(92616),s=a.n(n),o=a(58091),l=a(60727);function d(e){let t={};return e.forEach(e=>{let a=new Date(e.time),i=(0,o.Z)(a,"H:mma");t[i]=e.value}),t}s().use(r.ZP);let c=e=>{let{data:t,title:a,color:r,unit:n,dataCollections:s,yFlipped:o,yLogarithmic:c}=e,u=[];t&&t.length>0&&u.push({name:a,color:r,data:d(t)}),s.forEach(e=>{u.push({name:e.name,data:d(e.data),color:e.color,dataset:e.options})});let h={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return h.scales.y.reverse=o,h.scales.y.type=c?"logarithmic":"linear",(0,i.jsx)("div",{className:"line-chart-container",children:(0,i.jsx)(l.wW,{xtitle:"Time",ytitle:a,suffix:n,legend:"bottom",color:r,data:u,download:a,library:h})})};c.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},28073:function(e,t,a){"use strict";a.d(t,{j:function(){return x}});var i=a(85893),r=a(8751),n=a(11475),s=a(71230),o=a(15746),l=a(74763),d=a(84485),c=a(14670),u=a(71577),h=a(41664),y=a.n(h),p=a(67294),m=a(99519);let x=e=>{let{showTroubleshootButton:t}=e,a=(0,p.useContext)(m.aC),{health:h}=a;if(!h)return null;let{healthy:x,healthPercentage:g,message:f,representation:w}=h,v="#3f8600",j="info";return g<80?(v="#cf000f",j="error"):g<30&&(v="#f0ad4e",j="error"),(0,i.jsxs)("div",{children:[(0,i.jsxs)(s.Z,{gutter:8,children:[(0,i.jsx)(o.Z,{span:12,children:(0,i.jsx)(l.Z,{title:"Healthy Stream",value:x?"Yes":"No",valueStyle:{color:v},prefix:x?(0,i.jsx)(r.Z,{}):(0,i.jsx)(n.Z,{})})}),(0,i.jsx)(o.Z,{span:12,children:(0,i.jsx)(l.Z,{title:"Playback Health",value:g,valueStyle:{color:v},suffix:"%"})})]}),(0,i.jsx)(s.Z,{style:{display:w<100&&0!==w?"grid":"none"},children:(0,i.jsxs)(d.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",w,"% of all known players. Other player status is unknown."]})}),(0,i.jsx)(s.Z,{gutter:16,style:{width:"100%",display:f?"grid":"none",marginTop:"10px"},children:(0,i.jsx)(o.Z,{span:24,children:(0,i.jsx)(c.Z,{message:f,type:j,showIcon:!0,action:t&&(0,i.jsx)(y(),{passHref:!0,href:"/stream-health",children:(0,i.jsx)(u.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})};x.defaultProps={showTroubleshootButton:!0}},17253:function(e,t,a){"use strict";a.r(t);var i=a(85893),r=a(84485),n=a(14670),s=a(11382),o=a(26713),l=a(71230),d=a(15746),c=a(59652),u=a(74763),h=a(67294),y=a(93069),p=a(24019),m=a(28058),x=a(64777),g=a(94185),f=a(28073);let w=e=>{let{title:t,description:a}=e;return(0,i.jsxs)("div",{className:"description-box",children:[(0,i.jsx)(r.Z.Title,{children:t}),(0,i.jsx)(r.Z.Paragraph,{children:a})]})},v=()=>{var e,t,a,v,j,b,F;let[Z,k]=(0,h.useState)([]),[S,P]=(0,h.useState)([]),[T,N]=(0,h.useState)(),[C,D]=(0,h.useState)(),[E,L]=(0,h.useState)([]),[B,I]=(0,h.useState)([]),[_,q]=(0,h.useState)([]),[O,H]=(0,h.useState)([]),[M,V]=(0,h.useState)([]),[R,z]=(0,h.useState)([]),[A,Q]=(0,h.useState)([]),[Y,X]=(0,h.useState)([]),[U,W]=(0,h.useState)(0),$=async()=>{try{let e=await (0,x.rQ)(x.N$);k(e.errors),P(e.qualityVariantChanges),D(e.highestLatency),N(e.lowestLatency),L(e.medianLatency),I(e.medianSegmentDownloadDuration),q(e.maximumSegmentDownloadDuration),H(e.minimumSegmentDownloadDuration),V(e.minPlayerBitrate),z(e.medianPlayerBitrate),Q(e.maxPlayerBitrate),X(e.availableBitrates),W(e.segmentLength-.3)}catch(t){console.error(t)}};(0,h.useEffect)(()=>{let e=null;return $(),e=setInterval($,x.NE),()=>{clearInterval(e)}},[]);let G=(0,i.jsxs)("div",{children:[(0,i.jsx)(r.Z.Title,{children:"Stream Performance"}),(0,i.jsx)(n.Z,{type:"info",message:" Data has not yet been collected. Once a stream has begun and viewers are watching this page will be available."}),(0,i.jsx)(s.Z,{size:"large",children:(0,i.jsx)("div",{style:{marginTop:"50px",height:"100px"}})})]});if(!(null==Z?void 0:Z.length)||!(null==E?void 0:E.length)||!(null==B?void 0:B.length))return G;let J=[{name:"Errors",color:"#B63FFF",options:{radius:3},data:Z},{name:"Quality changes",color:"#2087E2",options:{radius:2},data:S}],K=[{name:"Max download duration",color:"#B63FFF",options:{radius:2},data:_},{name:"Median download duration",color:"#00FFFF",options:{radius:2},data:B},{name:"Min download duration",color:"#02FD0D",options:{radius:2},data:O},{name:"Approximate limit",color:"#003FFF",data:B.map(e=>({time:e.time,value:U})),options:{radius:0}}],ee=[{name:"Lowest player speed",color:"#B63FFF",data:M,options:{radius:2}},{name:"Median player speed",color:"#00FFFF",data:R,options:{radius:2}},{name:"Maximum player speed",color:"#02FD0D",data:A,options:{radius:2}}];Y.forEach(e=>{ee.push({name:"Available bitrate",color:"#003FFF",data:M.map(t=>({time:t.time,value:e})),options:{radius:0}})});let et=null===(t=null===(e=ee[0])||void 0===e?void 0:e.data[ee[0].data.length-1])||void 0===t?void 0:t.value,ea=null===(a=B[B.length-1])||void 0===a?void 0:a.value,ei=Y[0],er=(null===(v=E[E.length-1])||void 0===v?void 0:v.value)||0,en=(null===(j=C[C.length-1])||void 0===j?void 0:j.value)||0,es=(null===(b=T[T.length-1])||void 0===b?void 0:b.value)||0,eo=(Number(en)+Number(es)+Number(er))/3,el=0,ed=(null===(F=J[0])||void 0===F?void 0:F.data.length)||0;if(ed>5){let ec=J[0].data.slice(-5);el=ec.reduce((e,t)=>e+Number(t.value),0)}else el=J[0].data.reduce((e,t)=>e+Number(t.value),0);let eu=et>0||ea>0||el>0,eh=null,ey=null;0!==et&&etU&&(ey="Your viewers may be consuming your video slower than required. This may be due to slow networks or your latency configuration. You need to decrease the amount of time viewers are taking to consume your video. Consider adding a lower quality with a lower bitrate or experiment with increasing the latency buffer setting.");let ep=el>0?"#B63FFF":"#FFFFFF",em={display:"flex",alignItems:"center",justifyContent:"center",height:"80px"};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Title,{children:"Stream Performance"}),(0,i.jsx)(r.Z.Paragraph,{children:"This tool hopes to help you identify and troubleshoot problems you may be experiencing with your stream. It aims to aggregate experiences across your viewers, meaning one viewer with an exceptionally bad experience may throw off numbers for the whole, especially with a low number of viewers."}),(0,i.jsx)(r.Z.Paragraph,{children:"The data is only collected by those using the Owncast web interface and is unable to gain insight into external players people may be using such as VLC, MPV, QuickTime, etc."}),(0,i.jsxs)(o.Z,{direction:"vertical",size:"middle",children:[(0,i.jsx)(l.Z,{justify:"space-around",children:(0,i.jsx)(d.Z,{style:{width:"100%"},children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)(f.j,{showTroubleshootButton:!1})})})}),(0,i.jsxs)(l.Z,{gutter:[16,16],justify:"space-around",style:{display:eu?"flex":"none"},children:[(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Viewer Playback Speed",value:"".concat(et),prefix:(0,i.jsx)(y.Z,{style:{marginRight:"5px"}}),precision:0,suffix:"kbps"})})})}),(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Viewer Latency",value:"".concat(eo),prefix:(0,i.jsx)(p.Z,{style:{marginRight:"5px"}}),precision:0,suffix:"seconds"})})})}),(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Recent Playback Errors",value:"".concat(el||0),valueStyle:{color:ep},prefix:(0,i.jsx)(m.Z,{style:{marginRight:"5px"}}),suffix:""})})})})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Video Segment Download",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"Once a video segment takes too long to download a viewer will experience buffering. If you see slow downloads you should offer a lower quality for your viewers, or find other ways, possibly an external storage provider, a CDN or a faster network, to improve your stream quality. Increasing your latency buffer can also help for some viewers."}),(0,i.jsx)(r.Z.Paragraph,{children:"In short, once the pink line consistently gets near the blue line, your stream is likely experiencing problems for viewers."})]})}),ey&&(0,i.jsx)(n.Z,{message:"Slow downloads",description:ey,type:"error",showIcon:!0}),(0,i.jsx)(g.k,{title:"Seconds",dataCollections:K,color:"#FF7700",unit:"s",yLogarithmic:!0})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Player Network Speed",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"The playback bitrate of your viewers. Once somebody's bitrate drops below the lowest video variant bitrate they will experience buffering. If you see viewers with slow connections trying to play your video you should consider offering an additional, lower quality."}),(0,i.jsx)(r.Z.Paragraph,{children:"In short, once the pink line gets near the lowest blue line, your stream is likely experiencing problems for at least one of your viewers."})]})}),eh&&(0,i.jsx)(n.Z,{message:"Low bandwidth viewers",description:eh,type:"error",showIcon:!0}),(0,i.jsx)(g.k,{title:"Lowest Player Bitrate",dataCollections:ee,color:"#FF7700",unit:"kbps",yLogarithmic:!0})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Errors and Quality Changes",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"Recent number of errors, including buffering, and quality changes from across all your viewers. Errors can occur for many reasons, including browser issues, plugins, wifi problems, and they don't all represent fatal issues or something you have control over."}),"A quality change is not necessarily a negative thing, but if it's excessive and coinciding with errors you should consider adding another quality variant.",(0,i.jsx)(r.Z.Paragraph,{})]})}),(0,i.jsx)(g.k,{title:"#",dataCollections:J,color:"#FF7700",unit:""})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Viewer Latency",description:"An approximate number of seconds that your viewers are behind your live video. The largest cause of latency spikes is buffering. High latency itself is not a problem, and optimizing for low latency can result in buffering, resulting in even higher latency."}),(0,i.jsx)(g.k,{title:"Seconds",dataCollections:[{name:"Median stream latency",color:"#00FFFF",options:{radius:2},data:E},{name:"Lowest stream latency",color:"#02FD0D",options:{radius:2},data:T},{name:"Highest stream latency",color:"#B63FFF",options:{radius:2},data:C}],color:"#FF7700",unit:"s"})]})]})]})};t.default=v}},function(e){e.O(0,[2196,8091,4381,5101,4763,236,2934,9774,2888,179],function(){return e(e.s=16791)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2885],{16791:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/stream-health",function(){return a(17253)}])},94185:function(e,t,a){"use strict";a.d(t,{k:function(){return c}});var i=a(85893),r=a(9085),n=a(92616),s=a.n(n),o=a(58091),l=a(60727);function d(e){let t={};return e.forEach(e=>{let a=new Date(e.time),i=(0,o.Z)(a,"H:mma");t[i]=e.value}),t}s().use(r.ZP);let c=e=>{let{data:t,title:a,color:r,unit:n,dataCollections:s,yFlipped:o,yLogarithmic:c}=e,u=[];t&&t.length>0&&u.push({name:a,color:r,data:d(t)}),s.forEach(e=>{u.push({name:e.name,data:d(e.data),color:e.color,dataset:e.options})});let h={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return h.scales.y.reverse=o,h.scales.y.type=c?"logarithmic":"linear",(0,i.jsx)("div",{className:"line-chart-container",children:(0,i.jsx)(l.wW,{xtitle:"Time",ytitle:a,suffix:n,legend:"bottom",color:r,data:u,download:a,library:h})})};c.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},28073:function(e,t,a){"use strict";a.d(t,{j:function(){return x}});var i=a(85893),r=a(8751),n=a(11475),s=a(71230),o=a(15746),l=a(74763),d=a(84485),c=a(14670),u=a(71577),h=a(41664),y=a.n(h),p=a(67294),m=a(99519);let x=e=>{let{showTroubleshootButton:t}=e,a=(0,p.useContext)(m.aC),{health:h}=a;if(!h)return null;let{healthy:x,healthPercentage:g,message:f,representation:w}=h,v="#3f8600",j="info";return g<80?(v="#cf000f",j="error"):g<30&&(v="#f0ad4e",j="error"),(0,i.jsxs)("div",{children:[(0,i.jsxs)(s.Z,{gutter:8,children:[(0,i.jsx)(o.Z,{span:12,children:(0,i.jsx)(l.Z,{title:"Healthy Stream",value:x?"Yes":"No",valueStyle:{color:v},prefix:x?(0,i.jsx)(r.Z,{}):(0,i.jsx)(n.Z,{})})}),(0,i.jsx)(o.Z,{span:12,children:(0,i.jsx)(l.Z,{title:"Playback Health",value:g,valueStyle:{color:v},suffix:"%"})})]}),(0,i.jsx)(s.Z,{style:{display:w<100&&0!==w?"grid":"none"},children:(0,i.jsxs)(d.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",w,"% of all known players. Other player status is unknown."]})}),(0,i.jsx)(s.Z,{gutter:16,style:{width:"100%",display:f?"grid":"none",marginTop:"10px"},children:(0,i.jsx)(o.Z,{span:24,children:(0,i.jsx)(c.Z,{message:f,type:j,showIcon:!0,action:t&&(0,i.jsx)(y(),{passHref:!0,href:"/stream-health",children:(0,i.jsx)(u.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})};x.defaultProps={showTroubleshootButton:!0}},17253:function(e,t,a){"use strict";a.r(t);var i=a(85893),r=a(84485),n=a(14670),s=a(11382),o=a(26713),l=a(71230),d=a(15746),c=a(59652),u=a(74763),h=a(67294),y=a(93069),p=a(24019),m=a(28058),x=a(64777),g=a(94185),f=a(28073);let w=e=>{let{title:t,description:a}=e;return(0,i.jsxs)("div",{className:"description-box",children:[(0,i.jsx)(r.Z.Title,{children:t}),(0,i.jsx)(r.Z.Paragraph,{children:a})]})},v=()=>{var e,t,a,v,j,b,F;let[Z,k]=(0,h.useState)([]),[S,P]=(0,h.useState)([]),[T,N]=(0,h.useState)(),[C,D]=(0,h.useState)(),[E,L]=(0,h.useState)([]),[B,I]=(0,h.useState)([]),[_,q]=(0,h.useState)([]),[O,H]=(0,h.useState)([]),[M,V]=(0,h.useState)([]),[R,z]=(0,h.useState)([]),[A,Q]=(0,h.useState)([]),[Y,X]=(0,h.useState)([]),[U,W]=(0,h.useState)(0),$=async()=>{try{let e=await (0,x.rQ)(x.N$);k(e.errors),P(e.qualityVariantChanges),D(e.highestLatency),N(e.lowestLatency),L(e.medianLatency),I(e.medianSegmentDownloadDuration),q(e.maximumSegmentDownloadDuration),H(e.minimumSegmentDownloadDuration),V(e.minPlayerBitrate),z(e.medianPlayerBitrate),Q(e.maxPlayerBitrate),X(e.availableBitrates),W(e.segmentLength-.3)}catch(t){console.error(t)}};(0,h.useEffect)(()=>{let e=null;return $(),e=setInterval($,x.NE),()=>{clearInterval(e)}},[]);let G=(0,i.jsxs)("div",{children:[(0,i.jsx)(r.Z.Title,{children:"Stream Performance"}),(0,i.jsx)(n.Z,{type:"info",message:" Data has not yet been collected. Once a stream has begun and viewers are watching this page will be available."}),(0,i.jsx)(s.Z,{size:"large",children:(0,i.jsx)("div",{style:{marginTop:"50px",height:"100px"}})})]});if(!(null==Z?void 0:Z.length)||!(null==E?void 0:E.length)||!(null==B?void 0:B.length))return G;let J=[{name:"Errors",color:"#B63FFF",options:{radius:3},data:Z},{name:"Quality changes",color:"#2087E2",options:{radius:2},data:S}],K=[{name:"Max download duration",color:"#B63FFF",options:{radius:2},data:_},{name:"Median download duration",color:"#00FFFF",options:{radius:2},data:B},{name:"Min download duration",color:"#02FD0D",options:{radius:2},data:O},{name:"Approximate limit",color:"#003FFF",data:B.map(e=>({time:e.time,value:U})),options:{radius:0}}],ee=[{name:"Lowest player speed",color:"#B63FFF",data:M,options:{radius:2}},{name:"Median player speed",color:"#00FFFF",data:R,options:{radius:2}},{name:"Maximum player speed",color:"#02FD0D",data:A,options:{radius:2}}];Y.forEach(e=>{ee.push({name:"Available bitrate",color:"#003FFF",data:M.map(t=>({time:t.time,value:e})),options:{radius:0}})});let et=null===(e=null===(t=ee[0])||void 0===t?void 0:t.data[ee[0].data.length-1])||void 0===e?void 0:e.value,ea=null===(a=B[B.length-1])||void 0===a?void 0:a.value,ei=Y[0],er=(null===(v=E[E.length-1])||void 0===v?void 0:v.value)||0,en=(null===(j=C[C.length-1])||void 0===j?void 0:j.value)||0,es=(null===(b=T[T.length-1])||void 0===b?void 0:b.value)||0,eo=(Number(en)+Number(es)+Number(er))/3,el=0,ed=(null===(F=J[0])||void 0===F?void 0:F.data.length)||0;if(ed>5){let ec=J[0].data.slice(-5);el=ec.reduce((e,t)=>e+Number(t.value),0)}else el=J[0].data.reduce((e,t)=>e+Number(t.value),0);let eu=et>0||ea>0||el>0,eh=null,ey=null;0!==et&&etU&&(ey="Your viewers may be consuming your video slower than required. This may be due to slow networks or your latency configuration. You need to decrease the amount of time viewers are taking to consume your video. Consider adding a lower quality with a lower bitrate or experiment with increasing the latency buffer setting.");let ep=el>0?"#B63FFF":"#FFFFFF",em={display:"flex",alignItems:"center",justifyContent:"center",height:"80px"};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Title,{children:"Stream Performance"}),(0,i.jsx)(r.Z.Paragraph,{children:"This tool hopes to help you identify and troubleshoot problems you may be experiencing with your stream. It aims to aggregate experiences across your viewers, meaning one viewer with an exceptionally bad experience may throw off numbers for the whole, especially with a low number of viewers."}),(0,i.jsx)(r.Z.Paragraph,{children:"The data is only collected by those using the Owncast web interface and is unable to gain insight into external players people may be using such as VLC, MPV, QuickTime, etc."}),(0,i.jsxs)(o.Z,{direction:"vertical",size:"middle",children:[(0,i.jsx)(l.Z,{justify:"space-around",children:(0,i.jsx)(d.Z,{style:{width:"100%"},children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)(f.j,{showTroubleshootButton:!1})})})}),(0,i.jsxs)(l.Z,{gutter:[16,16],justify:"space-around",style:{display:eu?"flex":"none"},children:[(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Viewer Playback Speed",value:"".concat(et),prefix:(0,i.jsx)(y.Z,{style:{marginRight:"5px"}}),precision:0,suffix:"kbps"})})})}),(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Viewer Latency",value:"".concat(eo),prefix:(0,i.jsx)(p.Z,{style:{marginRight:"5px"}}),precision:0,suffix:"seconds"})})})}),(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{type:"inner",children:(0,i.jsx)("div",{style:em,children:(0,i.jsx)(u.Z,{title:"Recent Playback Errors",value:"".concat(el||0),valueStyle:{color:ep},prefix:(0,i.jsx)(m.Z,{style:{marginRight:"5px"}}),suffix:""})})})})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Video Segment Download",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"Once a video segment takes too long to download a viewer will experience buffering. If you see slow downloads you should offer a lower quality for your viewers, or find other ways, possibly an external storage provider, a CDN or a faster network, to improve your stream quality. Increasing your latency buffer can also help for some viewers."}),(0,i.jsx)(r.Z.Paragraph,{children:"In short, once the pink line consistently gets near the blue line, your stream is likely experiencing problems for viewers."})]})}),ey&&(0,i.jsx)(n.Z,{message:"Slow downloads",description:ey,type:"error",showIcon:!0}),(0,i.jsx)(g.k,{title:"Seconds",dataCollections:K,color:"#FF7700",unit:"s",yLogarithmic:!0})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Player Network Speed",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"The playback bitrate of your viewers. Once somebody's bitrate drops below the lowest video variant bitrate they will experience buffering. If you see viewers with slow connections trying to play your video you should consider offering an additional, lower quality."}),(0,i.jsx)(r.Z.Paragraph,{children:"In short, once the pink line gets near the lowest blue line, your stream is likely experiencing problems for at least one of your viewers."})]})}),eh&&(0,i.jsx)(n.Z,{message:"Low bandwidth viewers",description:eh,type:"error",showIcon:!0}),(0,i.jsx)(g.k,{title:"Lowest Player Bitrate",dataCollections:ee,color:"#FF7700",unit:"kbps",yLogarithmic:!0})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Errors and Quality Changes",description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z.Paragraph,{children:"Recent number of errors, including buffering, and quality changes from across all your viewers. Errors can occur for many reasons, including browser issues, plugins, wifi problems, and they don't all represent fatal issues or something you have control over."}),"A quality change is not necessarily a negative thing, but if it's excessive and coinciding with errors you should consider adding another quality variant.",(0,i.jsx)(r.Z.Paragraph,{})]})}),(0,i.jsx)(g.k,{title:"#",dataCollections:J,color:"#FF7700",unit:""})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(w,{title:"Viewer Latency",description:"An approximate number of seconds that your viewers are behind your live video. The largest cause of latency spikes is buffering. High latency itself is not a problem, and optimizing for low latency can result in buffering, resulting in even higher latency."}),(0,i.jsx)(g.k,{title:"Seconds",dataCollections:[{name:"Median stream latency",color:"#00FFFF",options:{radius:2},data:E},{name:"Lowest stream latency",color:"#02FD0D",options:{radius:2},data:T},{name:"Highest stream latency",color:"#B63FFF",options:{radius:2},data:C}],color:"#FF7700",unit:"s"})]})]})]})};t.default=v}},function(e){e.O(0,[2196,8091,4381,5101,4763,236,2934,9774,2888,179],function(){return e(e.s=16791)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/webpack-b8103905b5d2755c.js b/static/web/_next/static/chunks/webpack-7dd45e3117fbb10c.js similarity index 98% rename from static/web/_next/static/chunks/webpack-b8103905b5d2755c.js rename to static/web/_next/static/chunks/webpack-7dd45e3117fbb10c.js index 6ed237e68..5bbacaa51 100644 --- a/static/web/_next/static/chunks/webpack-b8103905b5d2755c.js +++ b/static/web/_next/static/chunks/webpack-7dd45e3117fbb10c.js @@ -1 +1 @@ -!function(){"use strict";var e,t,a,c,f,d,n,r,b,o,u,i,s={},l={};function h(e){var t=l[e];if(void 0!==t)return t.exports;var a=l[e]={id:e,loaded:!1,exports:{}},c=!0;try{s[e].call(a.exports,a,a.exports,h),c=!1}finally{c&&delete l[e]}return a.loaded=!0,a.exports}h.m=s,h.amdO={},e=[],h.O=function(t,a,c,f){if(a){f=f||0;for(var d=e.length;d>0&&e[d-1][2]>f;d--)e[d]=e[d-1];e[d]=[a,c,f];return}for(var n=1/0,d=0;d=f&&Object.keys(h.O).every(function(e){return h.O[e](a[b])})?a.splice(b--,1):(r=!1,f0&&e[d-1][2]>f;d--)e[d]=e[d-1];e[d]=[a,c,f];return}for(var n=1/0,d=0;d=f&&Object.keys(h.O).every(function(e){return h.O[e](a[b])})?a.splice(b--,1):(r=!1,fOwncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No data

\ No newline at end of file diff --git a/static/web/admin/actions/index.html b/static/web/admin/actions/index.html index 0282fb06c..c287c690e 100644 --- a/static/web/admin/actions/index.html +++ b/static/web/admin/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No data

\ No newline at end of file diff --git a/static/web/admin/chat/messages/index.html b/static/web/admin/chat/messages/index.html index 7e253b713..5544e1cf8 100644 --- a/static/web/admin/chat/messages/index.html +++ b/static/web/admin/chat/messages/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No data
\ No newline at end of file diff --git a/static/web/admin/chat/users/index.html b/static/web/admin/chat/users/index.html index 32fd2e30c..f926a1038 100644 --- a/static/web/admin/chat/users/index.html +++ b/static/web/admin/chat/users/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file diff --git a/static/web/admin/config-chat/index.html b/static/web/admin/config-chat/index.html index 45465cd1e..4e0c80f7f 100644 --- a/static/web/admin/config-chat/index.html +++ b/static/web/admin/config-chat/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-federation/index.html b/static/web/admin/config-federation/index.html index df43fb548..cc91a2e45 100644 --- a/static/web/admin/config-federation/index.html +++ b/static/web/admin/config-federation/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-notify/index.html b/static/web/admin/config-notify/index.html index 700c5b5a3..587007f1f 100644 --- a/static/web/admin/config-notify/index.html +++ b/static/web/admin/config-notify/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Custom

Build your own notifications by using custom webhooks.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Custom

Build your own notifications by using custom webhooks.

\ No newline at end of file diff --git a/static/web/admin/config-public-details/index.html b/static/web/admin/config-public-details/index.html index 2be1fe769..6431ad466 100644 --- a/static/web/admin/config-public-details/index.html +++ b/static/web/admin/config-public-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


\ No newline at end of file diff --git a/static/web/admin/config-server-details/index.html b/static/web/admin/config-server-details/index.html index 0663434ed..8104817a0 100644 --- a/static/web/admin/config-server-details/index.html +++ b/static/web/admin/config-server-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file diff --git a/static/web/admin/config-social-items/index.html b/static/web/admin/config-social-items/index.html index 0eda82d6b..80030ebc6 100644 --- a/static/web/admin/config-social-items/index.html +++ b/static/web/admin/config-social-items/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file diff --git a/static/web/admin/config-storage/index.html b/static/web/admin/config-storage/index.html index f47e6e81b..cc7213e3e 100644 --- a/static/web/admin/config-storage/index.html +++ b/static/web/admin/config-storage/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file diff --git a/static/web/admin/config-video/index.html b/static/web/admin/config-video/index.html index 06f18ebe2..2abd7cb48 100644 --- a/static/web/admin/config-video/index.html +++ b/static/web/admin/config-video/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file diff --git a/static/web/admin/config/appearance/index.html b/static/web/admin/config/appearance/index.html index ad3de8c87..4b7dcbe6a 100644 --- a/static/web/admin/config/appearance/index.html +++ b/static/web/admin/config/appearance/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
Loading...
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
Loading...
\ No newline at end of file diff --git a/static/web/admin/federation/actions/index.html b/static/web/admin/federation/actions/index.html index 881237d7f..6ce3d7652 100644 --- a/static/web/admin/federation/actions/index.html +++ b/static/web/admin/federation/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No data
\ No newline at end of file diff --git a/static/web/admin/federation/followers/index.html b/static/web/admin/federation/followers/index.html index bad031f8e..090c7d92d 100644 --- a/static/web/admin/federation/followers/index.html +++ b/static/web/admin/federation/followers/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No data
\ No newline at end of file diff --git a/static/web/admin/hardware-info/index.html b/static/web/admin/hardware-info/index.html index c7ff17cf7..894016f36 100644 --- a/static/web/admin/hardware-info/index.html +++ b/static/web/admin/hardware-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file diff --git a/static/web/admin/help/index.html b/static/web/admin/help/index.html index 1875a0bf0..8feedb4b0 100644 --- a/static/web/admin/help/index.html +++ b/static/web/admin/help/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file diff --git a/static/web/admin/index.html b/static/web/admin/index.html index 12b9f5318..255bf766e 100644 --- a/static/web/admin/index.html +++ b/static/web/admin/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file diff --git a/static/web/admin/logs/index.html b/static/web/admin/logs/index.html index 37faf1bdc..e24662e0c 100644 --- a/static/web/admin/logs/index.html +++ b/static/web/admin/logs/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/stream-health/index.html b/static/web/admin/stream-health/index.html index b9057b6b7..fc9b1311e 100644 --- a/static/web/admin/stream-health/index.html +++ b/static/web/admin/stream-health/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file diff --git a/static/web/admin/upgrade/index.html b/static/web/admin/upgrade/index.html index 33c63b9e7..509b7e372 100644 --- a/static/web/admin/upgrade/index.html +++ b/static/web/admin/upgrade/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No data
\ No newline at end of file diff --git a/static/web/admin/viewer-info/index.html b/static/web/admin/viewer-info/index.html index 0eb99e6d3..83f1780cb 100644 --- a/static/web/admin/viewer-info/index.html +++ b/static/web/admin/viewer-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No data
\ No newline at end of file diff --git a/static/web/admin/webhooks/index.html b/static/web/admin/webhooks/index.html index 86d4bd495..313e15d15 100644 --- a/static/web/admin/webhooks/index.html +++ b/static/web/admin/webhooks/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No data

\ No newline at end of file diff --git a/static/web/embed/chat/readonly/index.html b/static/web/embed/chat/readonly/index.html index 5fd3393ea..d193bb033 100644 --- a/static/web/embed/chat/readonly/index.html +++ b/static/web/embed/chat/readonly/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/static/web/embed/chat/readwrite/index.html b/static/web/embed/chat/readwrite/index.html index 3aa9e5f80..b48ea684e 100644 --- a/static/web/embed/chat/readwrite/index.html +++ b/static/web/embed/chat/readwrite/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/static/web/embed/video/index.html b/static/web/embed/video/index.html index dfb45d16e..0b4c6cdab 100644 --- a/static/web/embed/video/index.html +++ b/static/web/embed/video/index.html @@ -1 +1 @@ -
This stream is offline. Check back soon!
\ No newline at end of file +
This stream is offline. Check back soon!
\ No newline at end of file diff --git a/static/web/index.html b/static/web/index.html index acfd09487..7f35cfae7 100644 --- a/static/web/index.html +++ b/static/web/index.html @@ -1,9 +1,9 @@ {{.Name}}
{{.Name}}
Logo
Preview
\ No newline at end of file +
Logo
Preview
\ No newline at end of file